Jelajahi Sumber

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-mini-web

zhoux 2 tahun lalu
induk
melakukan
10693b6fda
2 mengubah file dengan 82 tambahan dan 26 penghapusan
  1. 1 0
      src/locale/lang/zh-CN.js
  2. 81 26
      src/view/pur/pur-return/form.vue

+ 1 - 0
src/locale/lang/zh-CN.js

@@ -348,6 +348,7 @@ export const columns = {
   ingEntry:'已入库',
   itemIntoAmt:'入库金额',
   wareHouse:'收货仓库',
+  returnWareHouse:'退货仓库',
   priceStandard:'标价',
   skuSpec:'商品规格',
   macCode:'账号编码',

+ 81 - 26
src/view/pur/pur-return/form.vue

@@ -22,23 +22,23 @@
                              :multiple="false"
                              :otherCondition="{supplierType:'供应商类别-采购'}"/>
           </DkFormItem>
-          <!--收货人-->
-          <DkFormItem prop="contactName" :label="$t('contactName')">
-            <InputPop ref="contactName" :readonly="true" v-model="formData.contactName"/>
-          </DkFormItem>
-          <!--收货电话-->
-          <DkFormItem prop="contactPhone" :label="$t('contactPhone')">
-            <InputPop :telephone="true" ref="contactPhone" :readonly="true" v-model="formData.contactPhone"/>
-          </DkFormItem>
           <!--来源单号-->
           <DkFormItem prop="fromNo">
             <InputPop ref="fromNo" v-model="formData.fromNo" :readonly="true"/>
           </DkFormItem>
+          <!--收货仓库-->
+          <DkFormItem prop="whId" :label="$t('returnWareHouse')" :required="true">
+            <SelectPop v-model="formData.whId" ref="whId"
+                       :options="warehouseList"
+                       :multiple="false"
+                       labelKey="whName" valueKey="whId"
+                       @on-select="changItemWhId">
+            </SelectPop>
+          </DkFormItem>
           <!--自动出库库标识-->
           <DkFormItem prop="autoFlag" v-show="showAutoFlag">
             <template>
-              <i-switch v-model="formData.automaticFlg" @on-change="changeIntoStatus"
-                        :disabled="type === $config.formMode.handle">
+              <i-switch v-model="formData.automaticFlg":disabled="type === $config.formMode.handle">
                 <span slot="open"></span>
                 <span slot="close"></span>
               </i-switch>
@@ -63,6 +63,7 @@
                      :freeze="false"
                      :show-footer="true"
                      :add-flag="false"
+                     @changeValue="changeValue"
           ></EditTable>
         </div>
       </DkPanel>
@@ -233,8 +234,8 @@ export default {
         purNo: null,//采购入库单号
         supId: null,//供应商Id
         supplierName: null,//供应商
-        contactName: null,//联系人
-        contactPhone: null,//联系电话
+        whId: null,//仓库Id
+        whName: null,//仓库
         automaticFlg: false,//自动出库标识
         remarks: null,
       },
@@ -290,6 +291,19 @@ export default {
           },
         },
         {
+          field: 'whId',
+          type: 'select',
+          options: () => self.warehouseList,
+          labelKey: 'whName',
+          valueKey: 'whId',
+          dataType: self.$config.tableSelectType.warehouse,
+          fieldUpdate: [
+            {updateField: 'whName', valueFiled: 'whName'},
+            {updateField: 'whId', valueFiled: 'whId'},
+          ],
+          searchDataFlag: false,
+        },//仓库名称
+        {
           field: 'remarks',
         },
       ],
@@ -300,21 +314,20 @@ export default {
   methods: {
 
     /**
-     * @desc   : 自动入库标识变更
-     * @author : 夏常明
-     * @date   : 2023/9/1 16:34
+     * @desc   : 总单仓库修改明细仓库
+     * @author : 常皓宁
+     * @date   : 2024/3/19 9:23
      */
-    changeIntoStatus() {
-      if (this.type === this.$config.formMode.add) {
-        if (this.formData.automaticFlg) {
-          this.formData.intoDate = new Date().format("yyyy-MM-dd")
-          this.showIntoDate = true
-        }else{
-          this.formData.intoDate = null
-          this.showIntoDate = false
-        }
-      }else {
-        this.formData.intoDate = new Date().format("yyyy-MM-dd")
+    changItemWhId(){
+      let itemData = this.$refs['detailTable'].getTableDataFilter();
+      let whName = this.warehouseList.filter(it => it.whId  == this.formData.whId)
+      if(itemData && itemData.length > 0){
+        itemData.forEach(it =>{
+          it.whId = this.formData.whId
+          it.whId_Name = whName[0].whName
+          it.whName = whName[0].whName
+        })
+        this.$refs['detailTable'].$refs.xTable.reloadData(itemData)
       }
     },
 
@@ -382,12 +395,17 @@ export default {
           this.formData.fromNo = batchRows[0].fromNo
           this.formData.supId = batchRows[0].supId
           this.formData.supplierName = batchRows[0].supplierName
+          this.formData.whId = batchRows[0].whId
+          this.formData.whName = batchRows[0].whName
         }
         // 明细
         if (itemBatchRows) {
           itemBatchRows.map(row => {
             let item = row
             this.$set(item, 'intoItemId', row['itemId'])
+            // 仓库
+            this.$set(item, 'whId', this.formData.whId)
+            this.$set(item, 'whName', this.formData.whName)
           })
           this.purchaseItemList = itemBatchRows
           for (let index = 0; index < this.purchaseItemList.length; index++) {
@@ -469,6 +487,18 @@ export default {
     },
 
     /**
+     * @desc   : 行改变事件
+     * @author : 常皓宁
+     * @date   : 2024/3/19 10:51
+     */
+    changeValue(field, row, rowIndex) {
+        if (!row.whId || row.whId === 0 || row.whId === null) {
+          this.$set(row, 'whId', this.whId);
+          this.$set(row, 'whId_Name', this.whName);
+        }
+    },
+
+    /**
      *   @desc   : 清空参数
      *   @date   : 2022/12/20 15:33
      *   @author : 常皓宁
@@ -481,6 +511,8 @@ export default {
         purNo: null,
         supId: null,
         supName: null,
+        whId: null,
+        whName: null,
         remarks: null,
       },
         this.purchaseItemList = []
@@ -580,6 +612,8 @@ export default {
       this.formData.remarks = data.data.remarks
       this.formData.contactName = data.contactName
       this.formData.contactPhone = data.contactPhone
+      this.formData.whId = data.data.whId
+      this.formData.whName = data.data.whName
       let dataItem = data.dataItem
       dataItem.map(row => {
         let item = row
@@ -595,12 +629,33 @@ export default {
     },
 
     /**
+     * @desc   : 获取仓库
+     * @author : 常皓宁
+     * @date   : 2024/2/28 14:39
+     */
+    getWareHouseList() {
+      let params = {
+        cpId: this.$store.state.user.cpId
+      }
+      this.excute(this.$service.commonService, this.$service.commonService.getWarehouse, params, false).then(res => {//调用api查询方法
+        if (res.code === this.$config.SUCCESS_CODE) {
+          this.warehouseList = res.data
+          //赋值默认仓库 组件需要
+          let newList = res.data.filter(it => it.flgDefault)
+          this.whId = newList[0].whId
+          this.whName = newList[0].whName
+        }
+      })
+    },
+
+    /**
      * @desc   : 加载数据
      * @author : 常皓宁
      * @date   : 2024/2/28 14:37
      */
     initData() {
       if (this.type === this.$config.formMode.add || this.type === this.$config.formMode.handle) {
+        this.getWareHouseList();   // 获取仓库数据
       }
     },
   },