Browse Source

'合同提交'

zhujun 2 years ago
parent
commit
08655c3ce8

+ 2 - 1
src/api/saleManage/quotation.js

@@ -76,7 +76,8 @@ export async function getExport(id) {
 
 export async function getProduceTreeByPid() {
   const res = await request.get(
-    `/main/categoryLevel/getTreeByPid/9`,
+    //`/main/categoryLevel/getTreeByPid/9`,
+    `/main/categoryLevel/getProduceTreeByPid?type=1`,
     {}
   );
   if (res.data.code == 0) {

+ 6 - 4
src/views/contractManage/contractBook/components/addDialog.vue

@@ -442,7 +442,7 @@ export default {
         tableLinkData: [],
      
         rules: {
-          typeName:[
+          type:[
             { required: true, message: '请选择合同类型', trigger: 'change' }
           ],
           receiptPaymentType:[
@@ -451,7 +451,7 @@ export default {
           contractNumber:[
             { required: true, message: '请输入自带编号', trigger: 'change' }
           ],
-          contactName: [
+          contractName: [
             { required: true, message: '请输入合同名称', trigger: 'blur' }
           ],
           partaName: [
@@ -483,7 +483,7 @@ export default {
             { pattern: emailReg, message: '邮箱格式不正确', trigger: 'blur' }
           ],
           contractStartDate: [
-          { validator: this.validateStartDate, trigger: 'blur' }
+          { required: true,validator: this.validateStartDate, trigger: 'blur' }
           ],
           contractEndDate: [
           { validator: this.validateEndDate, trigger: 'blur' }
@@ -750,7 +750,9 @@ export default {
         if (!this.isUpdate) {
           delete this.form.id;
         } 
-        this.form.totalPrice=this.$refs.inventoryTable.getTotalPrice()
+        let [totalPrice,discountTotalPrice]=this.$refs.inventoryTable.getPrice()
+        this.form.totalPrice=totalPrice
+        this.form.discountTotalPrice=discountTotalPrice
         if (this.form.categoryId) {
           this.form.categoryName = this.findNameById(this.categoryTreeList,this.form.categoryId);
         }

+ 9 - 1
src/views/contractManage/contractBook/components/inventoryTable.vue

@@ -182,7 +182,8 @@ export default {
       isFirst: 0,
       name: '',
       startTime: '',
-      workHour: ''
+      workHour: '',
+      technicalDrawings:[]
     };
     return {
       discountTotalPrice:0.00,
@@ -331,9 +332,13 @@ export default {
         comitDatasource.forEach(v=>{
           v.totalPrice=(v.totalCount*v.singlePrice)?.toFixed(2)||0
           v.guaranteePeriodUnitName=this.getDictValue('质保期单位', v.guaranteePeriodUnitCode)
+          v.technicalDrawings=v.technicalDrawings?v.technicalDrawings:null
         })
          return comitDatasource
       },
+      getPrice(){
+        return [this.allPrice,this.discountTotalPrice]
+      },
     //计算总金额
     getTotalPrice(){
    if(this.form.datasource.length){
@@ -347,9 +352,11 @@ export default {
     this.allPrice=allsum
     this.discountTotalPrice=allsum
     this.$store.commit('concact/setDiscountAmount',allsum);
+    return allsum
    }else{
    this.allPrice=0.00
    this.discountTotalPrice=0.00
+   return 0.00
    }
     },
     //更新优惠总金额
@@ -360,6 +367,7 @@ export default {
       putTableValue(data){
         if(data&&data?.length){
             this.form.datasource=data
+            this.getTotalPrice()
         }
       },
     //选择产品

+ 6 - 5
src/views/contractManage/contractBook/components/paymentList.vue

@@ -168,8 +168,10 @@
      async ratioInput(val,index=null){
       val=Number(val)
       try {
-        this.checkRatio().then(r=>{
-             let newval=(val/100).toFixed(2)
+        if(index!=null){
+          await this.checkRatio()
+        }
+        let newval=(val/100).toFixed(2)
           let price=(this.discountAmount*newval).toFixed(2)
           console.log(newval,price,index,'88888')
           if(index!=null){
@@ -178,7 +180,6 @@
           }else{
            return price
           }
-        })
       } catch (error) {
          return 0
       }
@@ -210,10 +211,10 @@
       },
       refreshprice(){
         let newData=this.form.datasource
-        newData.forEach((r,index)=>{
+        newData.forEach(async (r,index)=>{
           if(r.ratio){
             console.log(this.ratioInput(Number(r.ratio)),'9999888888')
-            r.price=this.ratioInput(Number(r.ratio))
+            r.price =await this.ratioInput(Number(r.ratio));
           }
         })
       },

+ 0 - 1
src/views/contractManage/contractBook/components/product-list.vue

@@ -164,7 +164,6 @@ export default {
             return getProductList({
                 pageNum: page,
                 size: limit,
-                categoryLevelId:9,
                 ...where
             });
         },