Prechádzať zdrojové kódy

bug修复-需求单明细删除delFlag,部分字段更改

黄梓星 2 rokov pred
rodič
commit
ca3fc72fab

+ 2 - 2
src/views/purchase/DemandSummary/add.vue

@@ -24,10 +24,10 @@
         <el-table-column show-overflow-tooltip label="品名" align="center" prop="materialName" width="180"/>
         <el-table-column show-overflow-tooltip label="规格" align="center" prop="specification"/>
         <el-table-column show-overflow-tooltip label="单位" align="center" prop="unit"/>
-        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturer" width="150"/>
+        <el-table-column show-overflow-tooltip label="生产厂家/代理人" align="center" prop="manufacturerName" width="150"/>
         <el-table-column show-overflow-tooltip label="末级供应仓库存量" align="center" prop="lastWarehouseQty" width="150"/>
         <el-table-column show-overflow-tooltip label="月销量" align="center" prop="totalMonthlySales"/>
-        <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="buyPeriod"/>
+        <el-table-column show-overflow-tooltip label="采购周期" align="center" prop="puPeriod"/>
         <el-table-column show-overflow-tooltip label="最终净需求量" align="center" prop="resDemandQty" width="150"/>
         <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="puQtyRes" width="150"/>
         <el-table-column show-overflow-tooltip label="需求客户" align="center" prop="customerName"/>

+ 1 - 1
src/views/purchase/DemandSummary/index.vue

@@ -295,7 +295,7 @@
             </template>
           </el-table-column>
           <el-table-column show-overflow-tooltip label="建议采购量" align="center" prop="suggestionPurchase" width="100px"/>
-          <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/>
+          <!-- <el-table-column show-overflow-tooltip label="建议净采购量" align="center" prop="suggestBuyQty" width="100px"/> -->
           <el-table-column show-overflow-tooltip label="最终采购量" align="center" prop="finalBuyQty" width="150">
             <template slot-scope="scope">
                 <el-input :disabled="scope.row.status !== '1' || lineDisable" v-model="scope.row.finalBuyQty"/>

+ 40 - 9
src/views/purchase/PurchaseDemandList/add.vue

@@ -56,7 +56,9 @@
 
          <el-col :span="1.5">
             <el-form-item label="客户负责人">
-              <el-input disabled v-model="basicForm.customerPrincipal" size="small" style="width: 200px"></el-input>
+              <el-select disabled size="small" v-model="basicForm.customerPrincipal" style="width: 200px">
+                <el-option v-for="item in manOptions" :key="item.id" :label="item.name" :value="item.code"/>
+              </el-select>
             </el-form-item>
           </el-col>
 
@@ -419,7 +421,7 @@
               </el-form-item>
             </template>
           </el-table-column> -->
-          <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="superiorStockOrgName" width="200px"></el-table-column>
+          <el-table-column show-overflow-tooltip label="末级供应库存组织" align="center" prop="lastStockOrgName" width="200px"></el-table-column>
           <el-table-column show-overflow-tooltip label="中心仓可用量" align="center"  prop="centralWarehouseQty" width="200px"/>
           <el-table-column show-overflow-tooltip label="调拨单号" align="center"  prop="allotCode"></el-table-column>
           <el-table-column show-overflow-tooltip label="收货地址" align="center"  prop="deliveryAddressName" width="200px">
@@ -535,6 +537,7 @@ export default {
         remark: '',
         puDemandItemList: []
       },
+      delDemandItemList: [],
       options: [{
         value: 'Y', label: '是',
       }, {
@@ -554,6 +557,7 @@ export default {
       // },
       tableIndex: null,
       orgOptions: [],
+      manOptions: [],
       personOptions: [],
       deptOptions: [],
       customerOptions: [],
@@ -626,7 +630,9 @@ export default {
     },
     // 获取预留数量
     getYLSL(scope) {
-      scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      if (scope.row.reservedProportion) {
+        scope.row.reservedQty = Math.ceil(scope.row.reservedProportion.replace('%', '') / 100 * scope.row.qty)
+      }
       // 如果选择预留比例,预留周期必填
       if(scope.row.reservedQty && scope.row.reservedQty !== 0) {
         this.isYl = true
@@ -665,10 +671,12 @@ export default {
         this.$refs['basic'].validate((valid) => {
           if(valid) {
             if(this.sonPageStu == 'add') {
+              this.$modal.loading("操作中...");
               this.handleData()
               addDemand(this.basicForm).then(res => {
                 console.log(333)
                 if (res.code === 200) {
+                  this.$modal.closeLoading();
                   this.$modal.msgSuccess("保存成功");
                   this.$emit('jugislist', true)
                   let queryParams = {
@@ -679,10 +687,18 @@ export default {
                 }
               })
             } else if (this.sonPageStu == 'edit') {
+              this.$modal.loading("操作中...");
+              this.basicForm.puDemandItemList.push(...this.delDemandItemList)
               editDemand(this.basicForm).then(res => {
                 if (res.code === 200) {
+                  this.$modal.closeLoading();
                   this.$modal.msgSuccess("编辑成功");
-                  this.back()
+                  this.$emit('jugislist', true)
+                  let queryParams = {
+                    pageNum: 1,
+                    pageSize: 10
+                  }
+                  this.$emit('refresh', queryParams)
                 }
               })
             }
@@ -818,12 +834,23 @@ export default {
         this.BDZT = true
       }
     },
-    delLine(index) {
+    delLine(index, row) {
       console.log('删除行:', index)
+      console.log('改变行:', row)
       // this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
       //   return item.id !== row.id
       // })
-      this.basicForm.puDemandItemList.splice(index,1)
+      row.delFlag = '2'
+      // this.basicForm.puDemandItemList.splice(index,1)
+      let delList = []
+      delList = this.basicForm.puDemandItemList.filter(item => {
+        return item.delFlag == '2'
+      })
+      this.basicForm.puDemandItemList = this.basicForm.puDemandItemList.filter(item => {
+        return item.delFlag == '0'
+      })
+      this.delDemandItemList.push(...delList)
+      console.log('删除的数组',this.delDemandItemList)
     },
     back() {
       this.$emit('jugislist', true)
@@ -847,7 +874,8 @@ export default {
               this.basicForm = reciveForm
               if(this.basicForm.org) { this.reBackRefer('ORG_PARAM', this.basicForm.org) }
               if(this.basicForm.customer) { this.reBackRefer('CUSTOMER_PARAM', this.basicForm.customer) }
-              if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal) }
+              if(this.basicForm.customerPrincipal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.customerPrincipal, '客户负责人') }
+              if(this.basicForm.demandPersonal) { this.reBackRefer('CONTACTS_PARAM', this.basicForm.demandPersonal, '需求人员') }
               if(this.basicForm.demandDept) { this.reBackRefer('DEPT_PARAM', this.basicForm.demandDept) }
               // 详情时将收货仓库id赋值给stordocId
               // 如果业务类型为补单需求,则明细内补单供应商编码可以编辑
@@ -873,7 +901,7 @@ export default {
       this.dialog.config = val
     },
     // 回显参照框
-    reBackRefer(type, id) {
+    reBackRefer(type, id, title) {
       getRefer({type: type, id: id}).then(res => {
         if(type == 'ORG_PARAM') {
           this.orgOptions = res.rows
@@ -881,9 +909,12 @@ export default {
         if (type == 'CUSTOMER_PARAM') {
           this.customerOptions = res.rows
         }
-        if (type == 'CONTACTS_PARAM') {
+        if (type == 'CONTACTS_PARAM' && title == '需求人员') {
           this.personOptions = res.rows
         }
+        if (type == 'CONTACTS_PARAM' && title == '客户负责人') {
+          this.manOptions = res.rows
+        }
         if (type == 'DEPT_PARAM') {
           this.deptOptions = res.rows
         }