فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

001295 1 سال پیش
والد
کامیت
264c7eb579

+ 52 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -427,6 +427,14 @@
     <!-- 批量调整参数 -->
     <el-dialog title="批量调整" :visible.sync="adjust.open" @close="closeEvent" width="38%">
       <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">默认采购组织</el-col>
+        <el-col :span="14">
+        <el-input class="pltzIpt" clearable size="mini" v-model="adjust.purOrgName" @focus="chooseOrg('ORG_PARAM', true, '采购组织')">
+          <el-button size="mini" slot="append" icon="el-icon-more" @click="chooseOrg('ORG_PARAM', true, '采购组织')"></el-button>
+        </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">价格类型</el-col>
         <el-col :span="14">
         <el-select class="pltzIpt" clearable size="mini" v-model="adjust.priceType">
@@ -460,6 +468,14 @@
         </el-col>
       </el-row>
       <el-row style="margin-bottom: 10px;">
+        <el-col :span="6" class="pltzTxt">补单供应商</el-col>
+        <el-col :span="14">
+        <el-input class="pltzIpt" clearable :disabled="sonDisable || BDZT" size="mini" v-model="adjust.additionalSupplierName" @focus="chooseOrg('SUPPLIER_PARAM', true, '补单供应商')">
+          <el-button size="mini" :disabled="sonDisable || BDZT" slot="append" icon="el-icon-more" @click="chooseOrg('SUPPLIER_PARAM', true, '补单供应商')"></el-button>
+        </el-input>
+        </el-col>
+      </el-row>
+      <el-row style="margin-bottom: 10px;">
         <el-col :span="6" class="pltzTxt">业务备注</el-col>
         <el-col :span="14">
           <el-input class="pltzIpt" clearable size="mini" v-model="adjust.remark"/>
@@ -602,6 +618,8 @@ export default {
       // 批量调整参数
       adjust: {
         open: false,
+        puOrg: '',
+        purOrgName: '',
         priceType: '',
         purchaseMan: '',
         purchaseManName: '',
@@ -609,6 +627,8 @@ export default {
         warehouseName: '',
         allocation: '',
         allocationName: '',
+        additionalSupplier: '',
+        additionalSupplierName: '',
         remark:'',
         deliveryAddress: '',
         deliveryAddressName: '',
@@ -1284,11 +1304,19 @@ export default {
         this.basicForm.demandPersonal = selection[0].code
         this.basicForm.demandPersonalName = selection[0].name
       }
+      if(this.referCondition.type == 'ORG_PARAM' && this.referCondition.title == '采购组织') {
+        this.adjust.puOrg = selection[0].id
+        this.adjust.purOrgName = selection[0].name
+      }
       if(this.referCondition.type == 'CONTACTS_PARAM' && this.referCondition.title == '采购员') {
         this.purchaseManOptions = selection
         this.adjust.purchaseMan = selection[0].code
         this.adjust.purchaseManName = selection[0].name
       }
+      if(this.referCondition.type == 'SUPPLIER_PARAM' && this.referCondition.title == '补单供应商') {
+        this.adjust.additionalSupplier = selection[0].id
+        this.adjust.additionalSupplierName = selection[0].name
+      }
       if(this.referCondition.type == 'WAREHOUSE_PARAM' && this.referCondition.title == '收货仓库') {
         this.adjust.warehouse = selection[0].id
         this.adjust.warehouseName = selection[0].name
@@ -1760,6 +1788,26 @@ export default {
             if(this.adjust.priceType) {
               item.priceType = this.adjust.priceType
             }
+            if(this.adjust.additionalSupplierName) {
+              item.additionalSupplier = this.adjust.additionalSupplier
+              item.additionalSupplierName = this.adjust.additionalSupplierName
+            }
+            if(this.adjust.purOrgName) {
+              item.purOrgName = this.adjust.purOrgName
+              item.puOrg = this.adjust.puOrg
+              item.deliveryWarehouse = this.adjust.warehouse
+              item.deliveryWarehouseName = this.adjust.warehouseName
+              item.deliveryAllocation = this.adjust.allocation
+              item.deliveryAllocationName = this.adjust.allocationName
+              item.deliveryAddressName = this.adjust.deliveryAddressName
+              item.deliveryAddress = this.adjust.deliveryAddress
+              item.contacts = this.adjust.contacts
+              item.contactsPhone = this.adjust.contactsPhone
+              item.address = this.adjust.address
+              item.lastStockOrgName = null
+              item.lastWarehouseName = null
+              item.lastAllocationName = null
+            }
             if(this.adjust.warehouseName) {
               item.deliveryWarehouse = this.adjust.warehouse
               item.deliveryWarehouseName = this.adjust.warehouseName
@@ -1802,6 +1850,8 @@ export default {
     closeEvent() {
       this.adjust =  {
         open: false,
+        puOrg: '',
+        purOrgName: '',
         priceType: '',
         purchaseMan: '',
         purchaseManName: '',
@@ -1809,6 +1859,8 @@ export default {
         warehouseName: '',
         allocation: '',
         allocationName: '',
+        additionalSupplier: '',
+        additionalSupplierName: '',
         remark: '',
         deliveryAddress: '',
         deliveryAddressName: '',

+ 26 - 22
src/views/purchase/purchase-order/add/column.js

@@ -73,6 +73,7 @@ const PurColumns =[
     referName: "SUPPLIER_PARAM",
     dataMapping: {
       supplier: "id",
+      supplierCode:'code',
       supplierName: "name",
       paymentAgreement: 'paymentId',
       paymentAgreementName: 'paymentName',
@@ -156,15 +157,15 @@ const PurColumns =[
     disabled:true,
   },
   { 
-    key: "address",
-    title: "收货地址",
+    key: "goodsWarehouseName",
+    title: "收货仓库",
     inputType: "PopoverSelect",
-    valueKey: "address",
+    valueKey: "name",
     referName: "ADDRESS_PARAM",
-    require: true,
     isShow:true,
+    require: true,
     dataMapping: {
-      // address: 'address',
+      address: 'address',
       // addressName: '',
       goodsWarehouse:'id',
       goodsWarehouseName:'name',
@@ -172,8 +173,8 @@ const PurColumns =[
       contactsPhone:'contactsPhone'
     },
     queryParams: () => ({}),
-    width: 180
   },
+  
  
   { 
     key: "originalMoney", 
@@ -217,12 +218,13 @@ const PurColumns =[
     require: true,
   },
   { 
-    key: "goodsWarehouseName",
-    title: "收货仓库",
+    key: "address",
+    title: "收货地址",
     inputType: "Input",
-    isShow:true,
-    disabled:true,
     require: true,
+    disabled:true,
+    isShow:true,
+    width: 180
   },
   
   { 
@@ -768,6 +770,7 @@ const CauseColumns =[
     referName: "SUPPLIER_PARAM",
     dataMapping: {
       supplier: "id",
+      supplierCode:'code',
       supplierName: "name",
       paymentAgreement: 'paymentId',
       paymentAgreementName: 'paymentName',
@@ -933,31 +936,32 @@ const CauseColumns =[
   },
   
   // { key: "place", title: "收货地点", inputType: "Input", width: 180 },
-  { 
-    key: "address",
-    title: "收货地址",
+  {
+    key: "goodsWarehouseName",
+    title: "收货仓库", 
     inputType: "PopoverSelect",
-    valueKey: "address",
+    valueKey: "name",
     referName: "ADDRESS_PARAM",
-    width: 180,
+    width: 200,
     isShow:true,
     dataMapping:{
-      // address: 'address',
-      // addressName: '',
+      address: 'address',
       goodsWarehouse:'id',
       goodsWarehouseName:'name',
       contacts:'contactsName',
       contactsPhone:'contactsPhone'
     }
   },
-  {
-    key: "goodsWarehouseName",
-    title: "收货仓库", 
+  { 
+    key: "address",
+    title: "收货地址",
     inputType: "Input",
-    width: 200,
-    disabled:true,
+    width: 180,
     isShow:true,
+    disabled:true,
+   
   },
+  
   { 
     key: "contacts", 
     title: "收货联系人", 

+ 25 - 21
src/views/purchase/purchase-order/edit/index.vue

@@ -116,6 +116,7 @@ export default {
                 key !== 'id' && ( _this.params[tableTwo][index][key] = item[key]);
 
             }
+
           }
         });
     },
@@ -212,8 +213,10 @@ export default {
       // prop.push(initParams(arr, "key", "value"));
     },
     // 删除行
-    async delTableRow(prop, row) {
-      console.log(row,'row---------------');
+    async delTableRow(prop, row, name) {
+
+      let delNo = name  === 'puOrderItemList' ? 'rowNo' :'rowno';
+
       if(prop.length === 1){
         this.$alert('订单行不允许为空', '提示', {
           confirmButtonText: '确定',
@@ -225,28 +228,28 @@ export default {
           }
         });
       }else{
-
-        // prop.splice(index, 1);
         for (const key in this.params) {
-  
-          // if (Array.isArray(this.params[key])) {
-            // params[column.key].filter(item => item.delFlag === '0')
+        
+
           if (key === 'puOrderItemList' || key === 'puOrderExecuteList') {
 
-            this.params[key] = this.params[key].map(item =>{
-              if(item.id && item.id === row.id){
-                console.log('删除已有ID的');
-                item['delFlag'] = '2';
-                return item;
-              }else if(item.insertId && item.insertId === row.insertId){
-                console.log('新增的');
-                return ;
-              }else{
-                return item;
+            this.params[key].forEach((item,index) =>{
+
+              let flag = key === 'puOrderItemList' ? 'rowNo' :'rowno';
+
+              // if(item.id && item.id === row.id){
+              //   console.log('删除已有ID的');
+              //   item['delFlag'] = '2';
+              // }
+
+              if(item[flag] && item[flag] === row[delNo]){
+
+                item.id ? (item['delFlag'] = '2'):
+                this.params[key].splice(index, 1);
               }
-            }).filter(item2 => item2 !== undefined)
-           
-            // console.log(this.params[key]);
+
+            })
+
             // this.params[key][index].id ? 
             //   (this.params[key][index]['delFlag'] = '2') :
             //   this.params[key].splice(index, 1);
@@ -254,6 +257,7 @@ export default {
              
           }
         }
+
   
         await this.handleGetPrice();
       }
@@ -990,7 +994,7 @@ export default {
               >
               <!-- v-if="!handleIsRevise()"  -->
                   <el-button 
-                    @click.native.prevent="delTableRow(params[tabName], scope.row)" 
+                    @click.native.prevent="delTableRow(params[tabName], scope.row,tabName)" 
                     type="text" 
                     size="small"
                     > 删行