Quellcode durchsuchen

采购管理-添加主子表必填校验/增行顺序调整

jingbb vor 4 Monaten
Ursprung
Commit
a665848e47
18 geänderte Dateien mit 234 neuen und 138 gelöschten Zeilen
  1. 2 1
      src/views/purchase/arrivedGoods/ArriveGoodsForm.data.ts
  2. 34 12
      src/views/purchase/arrivedGoods/components/ArriveGoodsFormForm.vue
  3. 1 0
      src/views/purchase/commissionPayRequest/commissionPayRequestList.data.ts
  4. 27 11
      src/views/purchase/commissionPayRequest/components/commissionPayRequestForm.vue
  5. 2 1
      src/views/purchase/freightPurchaseOrder/FreightPurOrderForm.data.ts
  6. 27 18
      src/views/purchase/freightPurchaseOrder/components/FreightPurOrderForm.vue
  7. 1 1
      src/views/purchase/freightPurchaseOrder/components/SelectDeliveryNoticeModal.vue
  8. 6 0
      src/views/purchase/payment/components/paymentForm.vue
  9. 27 13
      src/views/purchase/purPaymentRequest/components/purPaymentRequestForm.vue
  10. 1 0
      src/views/purchase/purPaymentRequest/purPaymentRequest.data.ts
  11. 2 1
      src/views/purchase/purchaseInquiryForm/PurchaseInquiryForm.data.ts
  12. 28 11
      src/views/purchase/purchaseInquiryForm/components/PurchaseInquiryFormForm.vue
  13. 2 0
      src/views/purchase/purchaseOrder/PurchaseOrderForm.data.ts
  14. 32 53
      src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue
  15. 4 0
      src/views/purchase/purchaseQuotationFrm/PurchaseQuotationForm.data.ts
  16. 36 16
      src/views/purchase/purchaseQuotationFrm/components/PurchaseQuotationFormForm.vue
  17. 1 0
      src/views/purchase/purchaseQuotationFrm/components/SelectSupplierInquiryModal.vue
  18. 1 0
      src/views/purchase/selectionQuotationForm/components/SelectQuotationFormForm.vue

+ 2 - 1
src/views/purchase/arrivedGoods/ArriveGoodsForm.data.ts

@@ -268,7 +268,8 @@ export const ArriveGoodsDetailColumns: JVxeColumn[] = [
     {
       title: '数量(quantity)',
       key: 'quantity',
-      type: JVxeTypes.input,
+      type: JVxeTypes.inputNumber,
+      validateRules: [{ required: true, message: '' }],
       placeholder: '请输入${title}',
       defaultValue:'',  
       width:"200px",

+ 34 - 12
src/views/purchase/arrivedGoods/components/ArriveGoodsFormForm.vue

@@ -20,7 +20,7 @@
 							</a-form-item>
 						</a-col>
 						<a-col :span="12">
-							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplierName" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="ArriveGoodsForm-supplierName" name="supplierName">
+							<a-form-item label="供应商(supplier)" v-bind="validateInfos.supplier" :label-col="formItemLayout.labelCol1" :wrapper-col="formItemLayout.wrapperCol1" id="ArriveGoodsForm-supplier" name="supplier">
                 <ApiSelect
                   :api="supplierOption"
                   showSearch
@@ -274,6 +274,12 @@
       });
       //表单验证
       const validatorRules = reactive({
+        projectName: [
+          { required: true, message: '请选择项目(select project)' }
+        ],
+        supplier: [
+          { required: true, message: '请选择供应商(select supplier)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};
@@ -358,14 +364,25 @@
       }
 
       async function submitForm() {
-          const mainData = await getFormData();
-          const subData = await getSubFormAndTableData();
-          const values = Object.assign({}, dbData, mainData, subData);
-          console.log('表单提交数据', values)
-          const isUpdate = values.id ? true : false
-          await saveOrUpdate(values, isUpdate);
-          //关闭弹窗
-          emit('success');
+        var xTable = arriveDetailsFormProductTableRef.value!.getXTable()
+        if(xTable.data.length==0){
+          message.warning('请添加产品明细')
+        }else{
+          arriveDetailsFormProductTableRef.value!.validateTable().then(async (errMap) =>  {
+            if (errMap) {
+              console.log('表单验证未通过:', { errMap });
+            } else {
+              const mainData = await getFormData();
+              const subData = await getSubFormAndTableData();
+              const values = Object.assign({}, dbData, mainData, subData);
+              console.log('表单提交数据', values)
+              const isUpdate = values.id ? true : false
+              await saveOrUpdate(values, isUpdate);
+              //关闭弹窗
+              emit('success');
+            }
+          });
+        }
       }
       
       function setFieldsValue(values) {
@@ -406,7 +423,8 @@
       }
       //产品明细-删除行
       function handleDelete(prop) {
-        var newArray = [...arriveDetailsFormProductTable.dataSource]
+        var xTable = arriveDetailsFormProductTableRef.value!.getXTable()
+        var newArray = [...xTable.data]
         newArray.splice(prop.rowIndex, 1)
         arriveDetailsFormProductTable.dataSource = newArray  
         if(arriveDetailsFormProductTable.dataSource.length!==0){
@@ -423,7 +441,8 @@
           item.arrivalQuantity=item.arrivalQuantity?Number(item.arrivalQuantity):0
           item.quantity = Number(item.orderQuantity)-item.arrivalQuantity
         })
-        var arr = data.concat(arriveDetailsFormProductTable.dataSource)
+        var xTable = arriveDetailsFormProductTableRef.value!.getXTable()
+        var arr = xTable.data.concat(data)
         arriveDetailsFormProductTable.dataSource=arr  
         notAllowEdit.value=true
         formData.sourceCode =data[0].billCode
@@ -516,5 +535,8 @@
   /deep/.ant-form-item{
     margin-bottom: 8px !important;
   }
-      
+  /deep/.vxe-cell--valid-error-msg{
+    color: white !important;
+    background-color: white !important;
+  }
 </style>

+ 1 - 0
src/views/purchase/commissionPayRequest/commissionPayRequestList.data.ts

@@ -117,6 +117,7 @@ export const paymentDetailColumns: JVxeColumn[] = [
     title: '本次申请金额(apply money)',
     key: 'applyMoney',
     type: JVxeTypes.inputNumber,
+    validateRules: [{ required: true, message: '' }],
     placeholder: '请输入${title}',
     width:"250px",
     defaultValue:'',

+ 27 - 11
src/views/purchase/commissionPayRequest/components/commissionPayRequestForm.vue

@@ -163,6 +163,12 @@
 
       //表单验证
       const validatorRules = reactive({
+        payee: [
+          { required: true, message: '请选择付款人(select payee)' }
+        ],
+        currency: [
+          { required: true, message: '请选择币种(select currency)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};
@@ -234,17 +240,25 @@
       }
       //保存
       async function submitForm() {
-        const mainData = await getFormData();
-        const subData = await getSubFormAndTableData();
-        if(!subData.purCommissionRequestDetailsList||subData.purCommissionRequestDetailsList.lenght==0){
+        var xTable = paymentDetailsTableRef.value!.getXTable()
+        if(xTable.data.length==0){
           message.warning('请添加付款明细')
         }else{
-          const values = Object.assign({}, dbData, mainData, subData);
-          console.log('表单提交数据', values)
-          const isUpdate = values.id ? true : false
-          await saveOrUpdate(values, isUpdate);
-          //关闭弹窗
-          emit('success');
+          paymentDetailsTableRef.value!.validateTable().then(async (errMap) =>  {
+            if (errMap) {
+              console.log('表单验证未通过:', { errMap });
+            } else {
+              const mainData = await getFormData();
+              const subData = await getSubFormAndTableData();
+              const values = Object.assign({}, dbData, mainData, subData);
+              console.log('表单提交数据', values)
+              const isUpdate = values.id ? true : false
+              await saveOrUpdate(values, isUpdate);
+              //关闭弹窗
+              emit('success');
+            }
+          })
+          
         }        
       }
       
@@ -266,7 +280,8 @@
       }
        //产品明细-删除行
       async function handleDelete1(prop) {
-        var newArray = [...paymentDetailsTable.dataSource]
+        var xTable = paymentDetailsTableRef.value!.getXTable()
+        var newArray = [...xTable.data]
         newArray.splice(prop.rowIndex, 1)
         paymentDetailsTable.dataSource = newArray  
         
@@ -281,7 +296,8 @@
           item.saleId =  item.id
           item.orderMoney =  item.taxAmount
         })
-        var arrSonFormDelivery = data.concat(paymentDetailsTable.dataSource)
+        var xTable = paymentDetailsTableRef.value!.getXTable()
+        var arrSonFormDelivery = xTable.data.concat(data)
         paymentDetailsTable.dataSource=arrSonFormDelivery  
 
       }

+ 2 - 1
src/views/purchase/freightPurchaseOrder/FreightPurOrderForm.data.ts

@@ -129,7 +129,8 @@ export const FreightProDetailsColumns: JVxeColumn[] = [
     {
       title: '运费金额(amount)',
       key: 'taxAmount',
-      type: JVxeTypes.input,
+      type: JVxeTypes.inputNumber,
+      validateRules: [{ required: true, message: '' }],
       placeholder: '请输入${title}',
       defaultValue:'',  
     },

+ 27 - 18
src/views/purchase/freightPurchaseOrder/components/FreightPurOrderForm.vue

@@ -239,21 +239,26 @@
       }
 
       async function submitForm() {
-          const mainData = await getFormData();
-          const subData = await getSubFormAndTableData();
-          if(!subData.purShippingFeeNoticeList||subData.purShippingFeeNoticeList.lenght==0){
+        var xTable = DeliveryDoticeTableableRef.value!.getXTable()
+        if(xTable.data.length==0){
             message.error('请添加发货通知单!');
-          }else{
-            const values = Object.assign({}, dbData, mainData, subData);
-            console.log('表单提交数据', values)
-            const isUpdate = values.id ? true : false
-            await saveOrUpdate(values, isUpdate);
-            //关闭弹窗
-            emit('success');
-          }
-          
-      }
-      
+        }else{
+            FreightProductDetailsTableRef.value!.validateTable().then(async (errMap) =>  {
+              if (errMap) {
+                console.log('表单验证未通过:', { errMap });
+              } else {
+                const mainData = await getFormData();
+                const subData = await getSubFormAndTableData();
+                const values = Object.assign({}, dbData, mainData, subData);
+                console.log('表单提交数据', values)
+                const isUpdate = values.id ? true : false
+                await saveOrUpdate(values, isUpdate);
+                //关闭弹窗
+                emit('success');
+              }
+            });
+        }
+    } 
       function setFieldsValue(values) {
         if(values){
           Object.keys(values).map(k=>{
@@ -263,13 +268,15 @@
       }
       //运费产品明细-删除行
       function handleDelete(prop) {
-        var newArray = [...FreightProductDetailsTable.dataSource]
+        var xTable = FreightProductDetailsTableRef.value!.getXTable()
+        var newArray = [...xTable.data]
         newArray.splice(prop.rowIndex, 1)
         FreightProductDetailsTable.dataSource = newArray        
       }
       //发货通知单-删除行
       function handleDelete1(prop) {
-        var newArray = [...DeliveryDoticeTable.dataSource]
+        var xTable = DeliveryDoticeTableableRef.value!.getXTable()
+        var newArray = [...xTable.data]
         newArray.splice(prop.rowIndex, 1)
         DeliveryDoticeTable.dataSource = newArray        
       }
@@ -295,7 +302,8 @@
             item.productCode = item.code
             item.productId = item.id
           })
-          var arrProduct = data.concat(FreightProductDetailsTable.dataSource)
+          var xTable = FreightProductDetailsTableRef.value!.getXTable()
+          var arrProduct = xTable.data.concat(data)
           FreightProductDetailsTable.dataSource=arrProduct  
         }
       }
@@ -306,7 +314,8 @@
         data.map(item=>{
           item.sourceId = item.id
         })
-        var arrDeliveryList = data.concat(DeliveryDoticeTable.dataSource)
+        var xTable = DeliveryDoticeTableableRef.value!.getXTable()
+        var arrDeliveryList = xTable.data.concat(data)
         DeliveryDoticeTable.dataSource=arrDeliveryList  
       }
       /**

+ 1 - 1
src/views/purchase/freightPurchaseOrder/components/SelectDeliveryNoticeModal.vue

@@ -124,7 +124,7 @@
             </a-alert>
             <a-table
                 :columns="columns"
-                :row-key="record => record.childId"
+                :row-key="record => record.id"
                 :data-source="dataSource"
                 bordered
                 size="small"

+ 6 - 0
src/views/purchase/payment/components/paymentForm.vue

@@ -149,6 +149,12 @@
 
       //表单验证
       const validatorRules = reactive({
+        payType: [
+          { required: true, message: '请选择付款类型(select payType)' }
+        ],
+        applyBill: [
+          { required: true, message: '请选择申请单(select applyBill)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};

+ 27 - 13
src/views/purchase/purPaymentRequest/components/purPaymentRequestForm.vue

@@ -180,6 +180,9 @@
 
       //表单验证
       const validatorRules = reactive({
+        supplier: [
+          { required: true, message: '请选择供应商(select supplier)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};
@@ -253,18 +256,24 @@
       }
       //保存
       async function submitForm() {
-        const mainData = await getFormData();
-        const subData = await getSubFormAndTableData();
-        if(!subData.purPaymentRequestDetailsList||subData.purPaymentRequestDetailsList.lenght==0){
+        var xTable = paymentDetailsTableRef.value!.getXTable()
+        if(xTable.data.length==0){
           message.warning('请添加付款明细')
         }else{
-          
-          const values = Object.assign({}, dbData, mainData, subData);
-          console.log('表单提交数据', values)
-          const isUpdate = values.id ? true : false
-          await saveOrUpdate(values, isUpdate);
-          //关闭弹窗
-          emit('success');
+          paymentDetailsTableRef.value!.validateTable().then(async (errMap) =>  {
+            if (errMap) {
+              console.log('表单验证未通过:', { errMap });
+            } else {
+              const mainData = await getFormData();
+              const subData = await getSubFormAndTableData();
+              const values = Object.assign({}, dbData, mainData, subData);
+              console.log('表单提交数据', values)
+              const isUpdate = values.id ? true : false
+              await saveOrUpdate(values, isUpdate);
+              //关闭弹窗
+              emit('success');
+            }
+          })
         }        
       }
       
@@ -286,7 +295,8 @@
       }
        //产品明细-删除行
       async function handleDelete1(prop) {
-        var newArray = [...paymentDetailsTable.dataSource]
+        var xTable = paymentDetailsTableRef.value!.getXTable()
+        var newArray = [...xTable.data]
         newArray.splice(prop.rowIndex, 1)
         paymentDetailsTable.dataSource = newArray  
         // if( paymentDetailsTable.dataSource.length!==0){
@@ -318,7 +328,8 @@
           item.purchaseId =  item.id
           item.orderMoney =  item.taxAmount
         })
-        var arrSonFormDelivery = data.concat(paymentDetailsTable.dataSource)
+        var xTable = paymentDetailsTableRef.value!.getXTable()
+        var arrSonFormDelivery = xTable.data.concat(data)
         paymentDetailsTable.dataSource=arrSonFormDelivery     
       }
       async function changeSupplier(value){
@@ -374,5 +385,8 @@
   /deep/.ant-form-item{
     margin-bottom: 8px !important;
   }
-      
+  /deep/.vxe-cell--valid-error-msg{
+    color: white !important;
+    background-color: white !important;
+  }   
 </style>

+ 1 - 0
src/views/purchase/purPaymentRequest/purPaymentRequest.data.ts

@@ -111,6 +111,7 @@ export const paymentDetailColumns: JVxeColumn[] = [
     title: '本次申请金额(apply money)',
     key: 'applyMoney',
     type: JVxeTypes.inputNumber,
+    validateRules: [{ required: true, message: '' }],
     placeholder: '请输入${title}',
     width:"250px",
     defaultValue:'',

+ 2 - 1
src/views/purchase/purchaseInquiryForm/PurchaseInquiryForm.data.ts

@@ -227,7 +227,7 @@ export const PuechaseInquiryFormProductColumns: JVxeColumn[] = [
       defaultValue:'',
       type: JVxeTypes.normal,
       formatter({ cellValue, row, column }) {
-        if(row.quantity=='0'){
+        if(row.needShip=='0'){
           return '否'
         }else{
           return '是'
@@ -246,6 +246,7 @@ export const PuechaseInquiryFormProductColumns: JVxeColumn[] = [
       title: '数量(quantity)',
       key: 'quantity',
       type: JVxeTypes.inputNumber,
+      validateRules: [{ required: true, message: '' }],
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',

+ 28 - 11
src/views/purchase/purchaseInquiryForm/components/PurchaseInquiryFormForm.vue

@@ -265,6 +265,12 @@
 
       //表单验证
       const validatorRules = reactive({
+        projectName: [
+          { required: true, message: '请选择项目(select project)' }
+        ],
+        inquirySuppiler: [
+          { required: true, message: '请选择供应商(select supplier)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};
@@ -346,17 +352,25 @@
       }
 
       async function submitForm() {
-        if(formData.sourceCode==''){
-          message.warning('请选择客户询价单')
+        var xTable = PuechaseInquiryFormProductTableRef.value!.getXTable()
+        if(xTable.data.length==0){
+          message.warning('请添加产品明细')
         }else{
-          const mainData = await getFormData();
-          const subData = await getSubFormAndTableData();
-          const values = Object.assign({}, dbData, mainData, subData);
-          console.log('表单提交数据', values)
-          const isUpdate = values.id ? true : false
-          await saveOrUpdate(values, isUpdate);
-          //关闭弹窗
-          emit('success');
+          PuechaseInquiryFormProductTableRef.value!.validateTable().then(async (errMap) =>  {
+            if (errMap) {
+              console.log('表单验证未通过:', { errMap });
+            } else {
+              const mainData = await getFormData();
+              const subData = await getSubFormAndTableData();
+              const values = Object.assign({}, dbData, mainData, subData);
+              console.log('表单提交数据', values)
+              const isUpdate = values.id ? true : false
+              await saveOrUpdate(values, isUpdate);
+              //关闭弹窗
+              emit('success');
+            }
+          });
+         
         }
       }
       
@@ -584,5 +598,8 @@
   /deep/.ant-form-item{
     margin-bottom: 8px !important;
   }
-      
+  /deep/.vxe-cell--valid-error-msg{
+    color: white !important;
+    background-color: white !important;
+  }
 </style>

+ 2 - 0
src/views/purchase/purchaseOrder/PurchaseOrderForm.data.ts

@@ -284,6 +284,7 @@ export const purchaseOrderProductColumns: JVxeColumn[] = [
       title: '数量(quantity)',
       key: 'quantity',
       type: JVxeTypes.inputNumber,
+      validateRules: [{ required: true, message: '' }],
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',
@@ -292,6 +293,7 @@ export const purchaseOrderProductColumns: JVxeColumn[] = [
       title: '单价(price)',
       key: 'taxPrice',
       type: JVxeTypes.inputNumber,
+      validateRules: [{ required: true, message: '' }],
       width:"200px",
       placeholder: '请输入${title}',
       defaultValue:'',

+ 32 - 53
src/views/purchase/purchaseOrder/components/PurchaseOrderFormForm.vue

@@ -168,8 +168,6 @@
       <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="selectVirtualProducts"> 选择虚拟产品(select virtual products)</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> -->
         <j-vxe-table
           :keep-source="true"
           resizable
@@ -214,7 +212,6 @@
     <SelectPrpductModal ref="SelectPrpductModalRef" @selectProduct ='addProduct'></SelectPrpductModal>
     <SelectProjectModal ref="SelectProjectModalRef" @selectProject="addProject"></SelectProjectModal>
     <BaseShipArchiveAccessoriesModal ref="BaseShipArchiveAccessoriesModalRef"></BaseShipArchiveAccessoriesModal>
-    <SelectSupplierQuotation ref="SelectSupplierQuotationRef" @selectSupplierQuatationConfirm="addFromQuotation"></SelectSupplierQuotation>
     <SelectSaleOrderModal ref="SelectSaleOrderModalRef" @selectSaleOrder="addFormSaleOrder"></SelectSaleOrderModal>
   </a-spin>
 </template>
@@ -229,7 +226,6 @@
   import SelectPrpductModal from '../../../publicComponents/SelectPrpductModal.vue';
   import SelectProjectModal from '../../../publicComponents/SelectProjectModal.vue';
   import SelectSaleOrderModal from '../../../publicComponents/SelectSaleOrderModal.vue';
-  import SelectSupplierQuotation from '../../../publicComponents/SelectSupplierQuotation.vue';
   import BaseShipArchiveAccessoriesModal from '../../../publicComponents/BaseShipArchiveAccessoriesModal.vue';
   import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
   import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
@@ -250,7 +246,6 @@
       JSelectInput,
       SelectProjectModal,
       BaseShipArchiveAccessoriesModal,
-      SelectSupplierQuotation,
       SelectSaleOrderModal,
       ApiSelect
     },
@@ -271,7 +266,6 @@
       const SelectPrpductModalRef = ref()
       const SelectProjectModalRef = ref()
       const BaseShipArchiveAccessoriesModalRef = ref();
-      const SelectSupplierQuotationRef = ref();
       const SelectSaleOrderModalRef = ref();
       const PurOrderFormShipFormShipTable = reactive<Record<string, any>>({
         loading: false,
@@ -327,6 +321,12 @@
 
       //表单验证
       const validatorRules = reactive({
+        projectName: [
+          { required: true, message: '请选择报价项目(select project)' }
+        ],
+        currency:[
+          { required: true, message: '请选择币种(currency)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};
@@ -465,19 +465,26 @@
       }
 
       async function submitForm() {
-        if(formData.sourceCode==''&&formData.sourceCode2==''){
-          message.warning('请选择销售订单或报价单')
+        var xTable = purOrderFormShipFormProductTableRef.value!.getXTable()
+        if(xTable.data.length==0){
+          message.warning('请添加产品明细')
         }else{
-          const mainData = await getFormData();
-          const subData = await getSubFormAndTableData();
-          const values = Object.assign({}, dbData, mainData, subData);
-          console.log('表单提交数据', values)
-          const isUpdate = values.id ? true : false
-          const isRevise = values.submit=='1' ? true : false
-          await saveOrUpdate(values, isUpdate,isRevise);
-          //关闭弹窗
-          emit('success');
-        }
+          purOrderFormShipFormProductTableRef.value!.validateTable().then(async (errMap) =>  {
+            if (errMap) {
+              console.log('表单验证未通过:', { errMap });
+            } else {
+              const mainData = await getFormData();
+              const subData = await getSubFormAndTableData();
+              const values = Object.assign({}, dbData, mainData, subData);
+              console.log('表单提交数据', values)
+              const isUpdate = values.id ? true : false
+              const isRevise = values.submit=='1' ? true : false
+              await saveOrUpdate(values, isUpdate,isRevise);
+              //关闭弹窗
+              emit('success');
+            }
+        })
+      }
       }
       
       function setFieldsValue(values) {
@@ -509,32 +516,6 @@
             }
           })
       }
-      function addFromQuotation(data){
-        data.map(item=>{
-          item.fatherModel = item.model
-          item.model = item.childModel
-          item.sourceId = item.childId
-          item.sourceType = 'Quo'+item.childId
-          item.sourceCode =item.billCode
-        })
-        var arrProduct = data.concat(purOrderFormShipFormProductTable.dataSource)
-        purOrderFormShipFormProductTable.dataSource=arrProduct  
-        notAllowEdit.value=true
-        formData.sourceCode =data[0].billCode
-        if(formData.sourceCode2==''){
-          formData.project = data[0].inquiryProject
-          formData.projectName = data[0].projectName
-          formData.supplier= data[0].selectionSupplier
-          formData.supplierName= data[0].selectionSupplier_dictText
-          formData.priority =data[0].priority
-          formData.productionClass =data[0].productionClass
-          formData.model =data[0].fatherModel
-          formData.maker =data[0].maker
-          formData.exchangeRate = data[0].exchangeRateUsd
-          formData.currency = data[0].currency
-          getShipList(data[0].headId,'quotation')
-        }
-      }
       function addFormSaleOrder(data){
         data.map(item=>{
           item.model = item.childModel
@@ -585,7 +566,8 @@
       }
       //产品明细-删除行
       function handleDelete(prop) {
-        var newArray = [...purOrderFormShipFormProductTable.dataSource]
+        var xTable = purOrderFormShipFormProductTableRef.value!.getXTable()
+        var newArray = [...xTable.data]
         newArray.splice(prop.rowIndex, 1)
         purOrderFormShipFormProductTable.dataSource = newArray  
         if( purOrderFormShipFormProductTable.dataSource.length!==0){
@@ -616,10 +598,7 @@
         }
         
       }
-      //选择供应商报价单选定
-      function SelectSupplierQuotationList (){
-        SelectSupplierQuotationRef.value.getTable(formData,'purOrder')
-      }
+
 
       // 选择销售订单
       function selectSaleOrderList(){
@@ -655,7 +634,6 @@
         PurOrderFormShipFormShipTable,
         purOrderFormShipFormProductTableRef,
         purOrderFormShipFormProductTable,
-        SelectSupplierQuotationRef,
         SelectSaleOrderModalRef,
         validatorRules,
         validateInfos,
@@ -681,8 +659,6 @@
         BaseShipArchiveAccessoriesModalRef,
         viewAccessory,
         VersionDetail,
-        SelectSupplierQuotationList,
-        addFromQuotation,
         notAllowEdit,
         selectSaleOrderList,
         addFormSaleOrder,
@@ -713,5 +689,8 @@
   /deep/.ant-form-item{
     margin-bottom: 8px !important;
   }
-      
+  /deep/.vxe-cell--valid-error-msg{
+    color: white !important;
+    background-color: white !important;
+  }  
 </style>

+ 4 - 0
src/views/purchase/purchaseQuotationFrm/PurchaseQuotationForm.data.ts

@@ -265,8 +265,10 @@ export const PuechaseQuotationFormProductColumns: JVxeColumn[] = [
       placeholder: '请输入${title}',
       width:"200px",
       defaultValue:'',
+      validateRules: [{ required: true, message: '' }],
       formatter({ cellValue, row, column }) {
         row.taxAmount = Number(row.quantity)*Number(row.taxPrice)
+        row.taxAmount = isNaN( row.taxAmount)?'':Number(row.taxAmount).toFixed(4)
         return cellValue
       },
     },
@@ -277,8 +279,10 @@ export const PuechaseQuotationFormProductColumns: JVxeColumn[] = [
       placeholder: '请输入${title}',
       defaultValue:'',  
       width:"200px",
+      validateRules: [{ required: true, message: '' }],
       formatter({ cellValue, row, column }) {
         row.taxAmount = Number(row.quantity)*Number(row.taxPrice)
+        row.taxAmount = isNaN( row.taxAmount)?'':Number(row.taxAmount).toFixed(4)
         return cellValue
       },
     },

+ 36 - 16
src/views/purchase/purchaseQuotationFrm/components/PurchaseQuotationFormForm.vue

@@ -272,6 +272,15 @@
 
       //表单验证
       const validatorRules = reactive({
+        projectName: [
+          { required: true, message: '请选择报价项目(select project)' }
+        ],
+        quotationSuppiler:[
+          { required: true, message: '请选择报价供应商(select supplier)' }
+        ],
+        currency:[
+          { required: true, message: '请选择币种(currency)' }
+        ],
       });
       const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
       const dbData = {};
@@ -352,13 +361,19 @@
           message.warning('请选择供应商询价单')
         }else{
           const mainData = await getFormData();
-          const subData = await getSubFormAndTableData();
-          const values = Object.assign({}, dbData, mainData, subData);
-          console.log('表单提交数据', values)
-          const isUpdate = values.id ? true : false
-          await saveOrUpdate(values, isUpdate);
-          //关闭弹窗
-          emit('success');
+          PuechaseQuotationFormProductTableRef.value!.validateTable().then(async (errMap) =>  {
+            if (errMap) {
+              console.log('表单验证未通过:', { errMap });
+            } else {
+              const subData = await getSubFormAndTableData();
+              const values = Object.assign({}, dbData, mainData, subData);
+              console.log('表单提交数据', values)
+              const isUpdate = values.id ? true : false
+              await saveOrUpdate(values, isUpdate);
+              //关闭弹窗
+              emit('success');
+            }
+          });
         }
       }
       
@@ -488,14 +503,16 @@
           SelectSupplierInquiryModalRef.value.getTable(formData)
       }
       async function changeSupplier(prop){
-        if(prop){
-          var params={id:prop}
-          var obj = await supplierOption(params)
-          formData.suppilerName = obj.records[0].name
-          formData.paymentTerms = obj.records[0].paymentTerms
-        }else{
-          formData.quotationSuppiler = ''
-          formData.suppilerName = ''
+        if(Array.isArray(prop)){
+          if(prop){
+            var params={id:prop[0]}
+            var obj = await supplierOption(params)
+            formData.suppilerName = obj.records[0].name
+            formData.paymentTerms = obj.records[0].paymentTerms
+          }else{
+            formData.quotationSuppiler = ''
+            formData.suppilerName = ''
+          }
         }
         
       }
@@ -560,5 +577,8 @@
   /deep/.ant-form-item{
     margin-bottom: 8px !important;
   }
-      
+  /deep/.vxe-cell--valid-error-msg{
+    color: white !important;
+    background-color: white !important;
+  }  
 </style>

+ 1 - 0
src/views/purchase/purchaseQuotationFrm/components/SelectSupplierInquiryModal.vue

@@ -252,6 +252,7 @@
             key: 'notes',
             dataIndex: 'notes',
             align:"center",
+            ellipsis: true,
             width:250
         },
         

+ 1 - 0
src/views/purchase/selectionQuotationForm/components/SelectQuotationFormForm.vue

@@ -424,6 +424,7 @@
                   item.sourceCode=event.sourceCode
                   item.sourceId=event.sourceId
                   item.sourceId2=item.id
+                  item.paymentTerm = item.paymentTerms
                   arr[index]={...item}
                   arr[index].selectionSupplier=item.quotationSuppiler
                 }