Procházet zdrojové kódy

销售报价单-增加配置子表折扣字段

jingbb před 1 měsícem
rodič
revize
33f382c166

+ 15 - 3
src/views/saleCode/quotation/components/SetSonList.vue

@@ -1,6 +1,6 @@
 <template>
     <a-modal
-      title="设置子表字段(SetSonList)"
+      :title="modeTitle"
       width="45%"
       :visible="visible"
       :maskClosable="false"
@@ -27,7 +27,8 @@
 <script lang="ts" setup>
     import {ref, reactive } from 'vue';
     var visible = ref(false);
-    const emit = defineEmits([ 'success']); //定义emit
+    const emit = defineEmits([ 'success','successDiscount']); //定义emit
+    var modeTitle = ref('设置子表字段(SetSonList)');
     var form = ref({
         numericalValue:''
     });
@@ -45,8 +46,14 @@
     }
     function handleOk(){
         formRef.value .validate().then(() => {
+            if(modeTitle.value == '批量折扣配置(Batch discount configuration)'){
+                emit('successDiscount',form.value)
+                handleCancel()
+            }else{
               emit('success',form.value)
               handleCancel()
+            }
+              
           }).catch((error) => {
             console.log('error', error);
           });
@@ -56,8 +63,13 @@
         form.value.numericalValue=''
         formRef.value.resetFields();
     }
-    function getTable(){
+    function getTable(data){
         visible.value = true
+        if(data=='discount'){
+            modeTitle.value = '批量折扣配置(Batch discount configuration)'
+        }else{
+            modeTitle.value = '设置子表字段(SetSonList)'
+        }
     }
     defineExpose({
         getTable

+ 13 - 3
src/views/saleCode/quotation/components/quotationFormForm.vue

@@ -199,7 +199,7 @@
                 <a-input v-model:value="formData.grossMarginHead" placeholder="" allow-clear AutoComplete="off" disabled/>
               </a-form-item>
             </a-col>
-            <a-col :span="12">
+            <!-- <a-col :span="12">
               <a-form-item
                 label="客户折扣(custumer discount)"
                 v-bind="validateInfos.custumerDiscount"
@@ -217,7 +217,7 @@
                   suffix="%"
                 />
               </a-form-item>
-            </a-col>
+            </a-col> -->
             <a-col :span="12">
               <a-form-item
                 label="销售部门(sale department)"
@@ -298,6 +298,7 @@
         <a-button type="primary" @click="selectProducts" style="margin-right: 1%; margin-bottom: 1%"> 选择产品(select product)</a-button>
         <a-button type="primary" @click="chooseSupplier"> 选择供应商报价选定(select supplier quotation selection)</a-button>
         <a-button type="primary" @click="setSonList" style="margin-left: 1%; margin-bottom: 1%"> 配置毛利率(Configure gross margin)</a-button>
+        <a-button type="primary" @click="setSonListDiscount" style="margin-left: 1%; margin-bottom: 1%"> 配置折扣(Configure discount)</a-button>
         <j-vxe-table
           :keep-source="true"
           resizable
@@ -352,7 +353,7 @@
     <SelectProjectModal ref="SelectProjectModalRef" @select-project="addProject" />
     <ViewHistoryQuotationModal ref="ViewHistoryQuotationModalRef" />
     <SelectSupplierQuotation ref="SelectSupplierQuotationRef" @select-supplier-quatation-confirm="addProductFromSupplier" />
-    <SetSonList ref="SetSonListRef" @success="setSonListFiled"></SetSonList>
+    <SetSonList ref="SetSonListRef" @success="setSonListFiled" @successDiscount = 'setBatchDiscount'></SetSonList>
   </a-spin>
 </template>
 
@@ -995,6 +996,9 @@
       function setSonList(){
         SetSonListRef.value.getTable()
       }
+      function setSonListDiscount(){
+        SetSonListRef.value.getTable('discount')
+      }
       function setSonListFiled(value){
         var xTable = (saleQuotationFormProductTableRef.value!.getXTable()).data
         if(xTable.length>0){
@@ -1005,6 +1009,10 @@
         saleQuotationFormProductTable.dataSource =[...xTable]
         changeDiscountOrExchangeRate()
       }
+      function setBatchDiscount(prop) {
+        formData.custumerDiscount= prop.numericalValue
+        changeDiscountOrExchangeRate()
+      }
       function countGrossMargin(){
         var customerCommisionAll = 0,
         platformCommisionAll=0,
@@ -1092,8 +1100,10 @@
         changeDiscountOrExchangeRate,
         changeExchangeRate,
         setSonList,
+        setSonListDiscount,
         SetSonListRef,
         setSonListFiled,
+        setBatchDiscount,
         linkOption,
         getLinkOptionsArr,
         onChangeLiaison