Browse Source

采购订单-隐藏‘选择产品按钮’/选择销售订单不可选择不用供应商

jingbb 3 months ago
parent
commit
083e8b4575

+ 36 - 33
src/views/publicComponents/SelectSaleOrderModal.vue

@@ -63,25 +63,29 @@
                                 <ApiSelect
                                     :api="supplierOption"
                                     showSearch
-                                    v-model:value="queryParams.supplierName"
+                                    v-model:value="queryParams.supplierId"
                                     optionFilterProp="label"
                                     resultField="records"
                                     labelField="name"
-                                    valueField="name"
+                                    valueField="id"
                                     :params='{pageSize:-1}'
+                                    :disabled="fatherSupplier!==''"
                                     />
                             </a-form-item>
                         </a-col>
                         <a-col :md="6" :sm="8" v-if="showCustomer=='yes'">
-                            <a-form-item label="客户(supplier)">
+                            <a-form-item label="客户(customer)">
                                 <ApiSelect
                                     :api="CustomerOption"
                                     showSearch
-                                    v-model:value="queryParams.customerName"
+                                    v-model:value="queryParams.customer"
                                     optionFilterProp="label"
                                     resultField="records"
-                                    labelField="abbreviation"
-                                    valueField="name"
+                                    labelField="name"
+                                    valueField="id"
+                                    :params='{pageSize:-1}'
+                                    allowClear
+                                    @change="changeCustmer"
                                     />
                             </a-form-item>
                         </a-col>
@@ -174,9 +178,9 @@
     var visible = ref(false)
     var fatherProject = ref('')
     var fatherSourceCode = ref('')
-    var fatherSupplierName =ref('')
+    var fatherSupplier =ref('')
     var fatherType = ref('')
-    var fatherCustomerName=ref('')
+    var fatherCustomer=ref('')
     var showCustomer = ref('no')
     var columns=[]
     var columns1 = [
@@ -339,7 +343,7 @@
         productionClass:'',
         priority:'',
         supplierId:'',
-        supplierName:'',
+        supplier:'',
         headModel:'',
         englishName:'',
         productCode:'',
@@ -349,7 +353,6 @@
         saleDepartment:'',
         salesman:'',
         customer:'',
-        customerName:''
     });
     let pagination = ref({
       current: 1,
@@ -388,15 +391,15 @@
         }else {
             queryParams.value.project = params.project
         }
-        if(fatherSupplierName.value&&fatherSupplierName.value!==''){
-            queryParams.value.supplierName = fatherSupplierName.value
+        if(fatherSupplier.value&&fatherSupplier.value!==''){
+            queryParams.value.supplierId = fatherSupplier.value
         }else {
-            queryParams.value.supplierName = params.supplierName
+            queryParams.value.supplierId = params.supplierId
         }
-        if(fatherCustomerName.value&&fatherCustomerName.value!==''){
-            queryParams.value.customerName = fatherCustomerName.value
+        if(fatherCustomer.value&&fatherCustomer.value!==''){
+            queryParams.value.customer = fatherCustomer.value
         }else {
-            queryParams.value.customerName = params.customerName
+            queryParams.value.customer = params.customer
         }
         return filterObj(params);
     }
@@ -419,7 +422,7 @@
             productionClass:'',
             priority:'',
             supplierId:'',
-            supplierName:'',
+            supplier:'',
             headModel:'',
             englishName:'',
             productCode:'',
@@ -429,7 +432,6 @@
             saleDepartment:'',
             salesman:'',
             customer:'',
-            customerName:''
         }
         pagination.value.current =1;
         pagination.value.pageSize = 10; 
@@ -448,22 +450,19 @@
             handleCancel()
         }else{
             var arr = [],
-            arrSupplierName=[]
+            arrSupplier=[]
             selectedRows.value.map(item=>{
                 arr.push(item.billCode)
-                arrSupplierName.push(item.supplierName)
+                arrSupplier.push(item.supplierId)
             })
             if(fatherSourceCode.value&&fatherSourceCode.value!==''){
                 arr.push(fatherSourceCode.value)
             }
-            if(fatherSupplierName.value&&fatherSupplierName.value!==''){
-                arrSupplierName.push(fatherSupplierName.value)
-            }
             if(selectedRowKeys.value.length==0){
                 message.error('请勾选数据');
             }else if(new Set(arr).size!==1){
                 message.error('请勾选订单编号相同的数据');
-            }else if(new Set(arrSupplierName).size!==1){
+            }else if(new Set(arrSupplier).size!==1){
                 message.error('请勾选供应商相同的数据');
             }else{
                 emit('selectSaleOrder', selectedRows.value)
@@ -484,7 +483,7 @@
             productionClass:'',
             priority:'',
             supplierId:'',
-            supplierName:'',
+            supplier:'',
             headModel:'',
             englishName:'',
             productCode:'',
@@ -494,7 +493,6 @@
             saleDepartment:'',
             salesman:'',
             customer:'',
-            customerName:''
         }
         pagination.value.current =1;
         pagination.value.pageSize = 10; 
@@ -521,22 +519,23 @@
         if(data=='delivery'){
             showCustomer.value = 'yes'
             columns= columns1.filter(function(value, i) {
-                return i !== 3;
+                return i !== 4;
             });
-            if(formData.supplierName&&formData.supplierName!==''){
-                fatherCustomerName.value = formData.supplierName
+            if(formData.customer&&formData.customer!==''){
+                
+                fatherCustomer.value = formData.customer
             }else{
-                fatherCustomerName.value = ''
+                fatherCustomer.value = ''
             }
         }else{
             showCustomer.value = 'no'
             columns= columns1.filter(function(value, i) {
-                return i !== 4;
+                return i !== 5;
             });
             if(formData.supplierName&&formData.supplierName!==''){
-                fatherSupplierName.value = formData.supplierName
+                fatherSupplier.value = formData.supplier
             }else{
-                fatherSupplierName.value = ''
+                fatherSupplier.value = ''
             }
         }
         loadData()
@@ -565,6 +564,10 @@
        }
        
     }
+    function changeCustmer(value){
+        queryParams.value.customer = queryParams.value.customer
+        fatherCustomer.value=''
+    }
     defineExpose({
       getTable,
       getTableFromSalePayRequestForm

+ 1 - 1
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -168,7 +168,7 @@
       <a-tab-pane tab="采购订单 - 产品明细(product details)" key="purOrderFormShipFormProduct" :forceRender="true">
         <a-button type="primary"  style="margin-right: 1%;margin-bottom: 1%;" @click="selectSaleOrderList"> 选择销售订单(select saleorder)</a-button>
         <!-- <a-button type="primary"  style="margin-right: 1%;margin-bottom: 1%;" @click="SelectSupplierQuotationList">选择供应商报价选定(select supplier quotation selection)</a-button> -->
-        <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectProductList"> 选择产品(select product)</a-button>
+        <!-- <a-button type="primary" style="margin-right: 1%;margin-bottom: 1%;" @click="selectProductList"> 选择产品(select product)</a-button> -->
         <j-vxe-table
           :keep-source="true"
           resizable