changhaoning 2 anni fa
parent
commit
34c8ea691e

+ 1 - 1
src/api/pages/mst/dictionaryData.js

@@ -5,7 +5,7 @@
  */
 export default {
   dictionaryDataService:{
-    prefix: '/mdm-server/mst/dictionaryData/',
+    prefix: '/mdm-server/sys/dictionaryData/',
   }
 }
 

+ 1 - 0
src/config/index.js

@@ -403,6 +403,7 @@ export default {
     goodsCategory: '商品属性-种类',
     goodsSeries: '商品属性-系列',
     goodsUnit: '商品属性-单位',
+    basicUnit: '基础资料-计量单位',
     basicWarehouse: '基础资料-仓库',
     basicChannel: '基础资料-渠道',
     basicIncome: '基础资料-收入',

+ 39 - 58
src/view/mst/basic-data/index.vue

@@ -41,18 +41,15 @@
           </DkTableColumn>
         </DkTable>
 
-        <!-- 仓库表格   -->
-        <DkTable v-if="wareHouseTableFlag" slot="right" :id="'table-' + $options.name" ref="table-select"
-                 :data="wareHouseData"
+        <!-- 计量单位表格   -->
+        <DkTable v-if="unitTableFlag" slot="right" :id="'table-' + $options.name" ref="table-select"
+                 :data="unitData"
                  :pageFlag="true"
                  :page-total="pageInfo.total" :current-page="pageInfo.currentPage" :choose-flag="false"
                  :height="this.tableHeight" primaryKey="brandId" @pageChange="pageSizeChange">
-          <DkTableColumn field="whCode"></DkTableColumn>
-          <DkTableColumn field="whName"></DkTableColumn>
-          <DkTableColumn field="supervisor"></DkTableColumn>
-          <DkTableColumn field="contactPhone"></DkTableColumn>
-          <DkTableColumn field="flgDefault" type="switch"></DkTableColumn>
-          <DkTableColumn field="flgValid" type="switch"></DkTableColumn>
+          <DkTableColumn field="unitCode"></DkTableColumn>
+          <DkTableColumn field="unitName"></DkTableColumn>
+          <DkTableColumn field="decimalPlaces"></DkTableColumn>
           <DkTableColumn field="remarks"></DkTableColumn>
         </DkTable>
 
@@ -96,22 +93,13 @@
         <DkFormItem prop="kindName" :label="$t('className')" >
           <InputPop v-model="formData.kindName" :disabled="true"/>
         </DkFormItem>
-        <!--仓库名称-->
-        <DkFormItem prop="name" :required="true">
+        <!--计量单位名称-->
+        <DkFormItem prop="name" :label="$t('goodsAttrName')" :required="true">
           <InputPop v-model="formData.name"/>
         </DkFormItem>
-        <!--仓库主管 (仓库特有)-->
-        <DkFormItem v-if="kindCode === this.$config.kindCode.basicWarehouse" prop="supervisor">
-          <InputPop v-model="formData.supervisor"/>
-        </DkFormItem>
-        <!--联系电话(仓库特有)-->
-        <DkFormItem v-if="kindCode === this.$config.kindCode.basicWarehouse" prop="contactPhone">
-          <InputPop v-model="formData.contactPhone"/>
-        </DkFormItem>
-        <!-- 默认仓库(仓库特有)-->
-        <DkFormItem v-if="kindCode === this.$config.kindCode.basicWarehouse" prop="flgDefault">
-          <DkSwitch prop="flgDefault" v-model="formData.flgDefault"
-                    ref="flgDefault"></DkSwitch>
+        <!--小数位数(计量单位特有)-->
+        <DkFormItem v-if="kindCode === this.$config.kindCode.basicUnit" prop="decimalPlaces" :required="true" :data-type="$config.dataType.number">
+          <InputNumberPop v-model="formData.decimalPlaces" :decimalPlaces="0" :min="0" :max="6"/>
         </DkFormItem>
         <!--备注-->
         <DkFormItem prop="remarks">
@@ -140,11 +128,11 @@ export default {
       minSplit: 0.15,
       leftData: [],
       tableData: [],
-      wareHouseTableFlag: false, //仓库
+      unitTableFlag: false, //计量单位
       saleChannelTableFlag: false, //销售渠道
       dictionaryTableFlag: false, //数据字典
-      // 仓库数据
-      wareHouseData: [],
+      // 计量单位数据
+      unitData: [],
       // 销售渠道
       saleChannelTableData: [],
       // 数据字典
@@ -153,9 +141,7 @@ export default {
         id:null,
         kindName: null,
         name:null,
-        supervisor:null,
-        contactPhone:null,
-        flgDefault:false,
+        decimalPlaces:null,
         remarks: null,
       },
       searchContent:
@@ -181,21 +167,19 @@ export default {
       if (row != null) {
         this.kindCode = row.kindCode
         let params = {
-          cpId: this.$store.state.user.cpId,
+          cpId: 0,
         }
 
-        // 仓库
-        if (this.kindCode == this.$config.kindCode.basicWarehouse || this.kindCode == null) {
+        // 计量单位
+        if (this.kindCode == this.$config.kindCode.basicUnit || this.kindCode == null) {
           setTimeout(() => {
-            this.wareHouseTableFlag = true
+            this.unitTableFlag = true
           }, 100)
           this.saleChannelTableFlag = false
           this.dictionaryTableFlag = false
-          params.whCode = row.code
-          params.whName = row.name
-          this.excute(this.$service.wareHouseService, this.$service.wareHouseService.selectByCond, params).then(res => {
+          this.excute(this.$service.unitService, this.$service.unitService.selectByCond, params).then(res => {
             if (res.code === this.$config.SUCCESS_CODE) {
-              this.wareHouseData = res.data.list
+              this.unitData = res.data.list
             }
           })
         }
@@ -203,7 +187,7 @@ export default {
         else if (this.kindCode == this.$config.kindCode.basicChannel) {
           params.channelCode = row.code
           params.channelName = row.name
-          this.wareHouseTableFlag = false
+          this.unitTableFlag = false
           this.dictionaryTableFlag = false
           setTimeout(() => {
             this.saleChannelTableFlag = true
@@ -220,7 +204,7 @@ export default {
             this.dictionaryTableFlag = true
           }, 100)
           this.saleChannelTableFlag = false
-          this.wareHouseTableFlag = false
+          this.unitTableFlag = false
           this.excute(this.$service.dictionaryDataService, this.$service.dictionaryDataService.selectByCond, params).then(res => {
             if (res.code === this.$config.SUCCESS_CODE) {
               this.dictionaryTableData = res.data.list
@@ -255,14 +239,12 @@ export default {
       this.modalTitle = this.setTitle(this.$config.formMode.edit, '基础资料')
       let row = this.$refs['leftTable'].$refs.table.getCurrentRecord()
       if (rows.length > 0) {
-        // 仓库
-        if (row.kindCode == this.$config.kindCode.basicWarehouse) {
+        // 计量单位
+        if (row.kindCode == this.$config.kindCode.basicUnit) {
           this.formData.kindName = row.kindName
-          this.formData.id = rows[0].whId
-          this.formData.name = rows[0].whName
-          this.formData.supervisor = rows[0].supervisor
-          this.formData.contactPhone = rows[0].contactPhone
-          this.formData.flgDefault = rows[0].flgDefault
+          this.formData.id = rows[0].unitId
+          this.formData.name = rows[0].unitName
+          this.formData.decimalPlaces = rows[0].decimalPlaces
           this.formData.remarks = rows[0].remarks
         }
         // 销售渠道
@@ -293,21 +275,19 @@ export default {
       let serviceName
       let serviceNameWay
       let params = {}
-      //仓库
-      if (this.kindCode === this.$config.kindCode.basicWarehouse) {
+      //计量单位
+      if (this.kindCode === this.$config.kindCode.basicUnit) {
         params = {
-          whId:this.formData.id,
-          whName: this.formData.name,
-          supervisor: this.formData.supervisor,
-          contactPhone: this.formData.contactPhone,
+          unitId:this.formData.id,
+          unitName: this.formData.name,
+          decimalPlaces: this.formData.decimalPlaces,
           remarks:this.formData.remarks,
-          flgDefault:this.formData.flgDefault,
         }
-        serviceName = this.$service.wareHouseService
+        serviceName = this.$service.unitService
         if (this.modalParams.button === this.$config.formMode.add) {
-          serviceNameWay = this.$service.wareHouseService.insert
+          serviceNameWay = this.$service.unitService.insert
         } else {
-          serviceNameWay = this.$service.wareHouseService.update
+          serviceNameWay = this.$service.unitService.update
         }
       }
       // 销售渠道
@@ -340,7 +320,7 @@ export default {
       }
       this.excute(serviceName, serviceNameWay, params, true, 'save').then(res => {
         if (res.code === this.$config.SUCCESS_CODE) {
-          this.formData = []
+          this.formData = {}
           this.getData();
         }
       })
@@ -386,7 +366,8 @@ export default {
   created() {
     this.primaryKey = 'basicDataId'  // 设置主键Id
     this.routeObjName = 'basicData'  // 设置路由名称
-    this.getBasicData() //商品属性左侧列表数据
+    this.comHandleEnableFlag = true; //开启启用停用功能
+    this.getBasicData() //基础资料左侧列表数据
   }
 }
 </script>