yusheng před 1 rokem
rodič
revize
0d432762f1

+ 54 - 51
src/views/purchasingManage/inquiryManage/components/addDialog.vue

@@ -481,6 +481,8 @@
         this.getplanData(data.id, 'change');
       },
       async supplierSelect(row) {
+        console.log(row);
+
         if (!row) {
           this.$message.warning('请选择供应商');
           return;
@@ -502,15 +504,15 @@
         });
       },
 
-      setIsInquiry() {
-        let supplierList = [];
+      setIsInquiry(supplierList) {
+     
 
         this.$nextTick(() => {
-          this.supplierList.forEach((item) => {
-            supplierList.push(
-              this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
-            );
-          });
+          // this.supplierList.forEach((item) => {
+          //   supplierList.push(
+          //     this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
+          //   );
+          // });
           this.$refs.inventoryTable.setIsInquiry(supplierList);
         });
       },
@@ -538,26 +540,27 @@
         };
         let supplierIds = this.supplierList.map((item) => item.supplierId);
         let supplierIndex = supplierIds.indexOf(data.base.id);
+        console.log(supplierIndex);
         if (supplierIndex == -1) {
           this.supplierList.push(params);
         } else {
-          let isHave = this.supplierList[supplierIndex].resultList.some(
-            (item) => item.productCode == obj.productCode
-          );
-          if (!isHave) {
-            // putTableValue
-            //this.supplierList[supplierIndex].resultList.push(obj)
-            this.$set(this.supplierList[supplierIndex], 'resultList', [
-              ...this.supplierList[supplierIndex].resultList,
-              obj
-            ]);
-            this.$nextTick(() => {
-              this.$refs['inquiryTable' + data.base.id][0]?.putTableValue(
-                this.supplierList[supplierIndex].resultList
-              );
-              this.$refs['inquiryTable' + data.base.id][0]?.getSpanArr();
-            });
-          }
+          // let isHave = this.supplierList[supplierIndex].resultList.some(
+          //   (item) => item.productCode == obj.productCode
+          // );
+          // if (!isHave) {
+          // putTableValue
+          //this.supplierList[supplierIndex].resultList.push(obj)
+          this.$set(this.supplierList[supplierIndex], 'resultList', [
+            ...this.supplierList[supplierIndex].resultList,
+            obj
+          ]);
+          this.$nextTick(() => {
+            this.$refs['inquiryTable' + data.base.id][0]?.putTableValue(
+              this.supplierList[supplierIndex].resultList
+            );
+            this.$refs['inquiryTable' + data.base.id][0]?.getSpanArr();
+          });
+          // }
         }
       },
       //供应商回调
@@ -591,7 +594,7 @@
                 (i) => i.productCode == val.productCode
               );
               console.log(isHave, supplierIndex);
-              if (!isHave) {
+              // if (!isHave) {
                 this.$set(this.supplierList[supplierIndex], 'resultList', [
                   ...this.supplierList[supplierIndex].resultList,
                   val
@@ -602,41 +605,41 @@
                 this.$nextTick(() => {
                   this.$refs['inquiryTable' + item.id][0]?.getSpanArr();
                 });
-              }
+              // }
             });
           }
         });
       },
 
       async save(type) {
-        let supplierList = [];
-        this.setIsInquiry();
-        // return
-
-        this.supplierList.forEach((item) => {
-          supplierList.push(
-            this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
-          );
-        });
-        let is=false
-        supplierList.forEach((item) => {
-          item.resultList.forEach((val) => {
-            val['technicalDrawings'] = [];
+        try {
+          await this.getValidate();
+         
+          let supplierList = [];
 
-            if(val.minimumOrderQuantity>val.totalCount){
-              is=true
-            }
+          this.supplierList.forEach((item) => {
+            supplierList.push(
+              this.$refs['inquiryTable' + item.supplierId][0].getTableValue()
+            );
           });
-        });
-        if(is){
-          this.$message.warning('购买数量不能小于最低订购量!');
-           return
-        }
+          this.setIsInquiry(supplierList);
+          let is = false;
+          supplierList.forEach((item) => {
+            item.resultList.forEach((val) => {
+              val['technicalDrawings'] = [];
+
+              if (val.minimumOrderQuantity > val.totalCount) {
+                is = true;
+              }
+            });
+          });
+          if (is) {
+            this.$message.warning('购买数量不能小于最低订购量!');
+            return;
+          }
 
-        this.form.detailList = this.list;
-        this.form.supplierList = supplierList;
-        try {
-          await this.getValidate();
+          this.form.detailList = this.list;
+          this.form.supplierList = supplierList;
           //  let arr = this.form.supplierList.map(item => item.resultList).flat(2);
           //  console.log(arr);
           //  let a = _.groupBy(arr,'productName')

+ 1 - 1
src/views/purchasingManage/inquiryManage/components/inventoryTable.vue

@@ -465,7 +465,7 @@
             //供应商列表
             item.resultList.forEach((val) => {
               //供应商产品
-              if (val.productCode == productItem.productCode) {
+              if (val.productCode == productItem.productCode&&val.batchNo == productItem.batchNo&&val.taskId == productItem.taskId) {
                 totalCountS.push(
                   Number(val.totalCount || 0) +
                     Number(productItem.doneTotalCount || 0)

+ 17 - 10
src/views/purchasingManage/purchaseOrder/accountstatement/components/addAccountDialog.vue

@@ -20,6 +20,8 @@
       @handleSearch="handleSearch"
       :dataForm.sync="dataForm"
       :datasource.sync="datasource"
+      :recorpayList.sync="recorpayList"
+
       :dialogType="dialogType"
     ></purchase-form>
     <headerTitle title="对账明细" style="margin-top: 30px">
@@ -33,21 +35,21 @@
             <span>{{ dataForm.amountReceivablePrice || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已收金额:</span>
-            <span>{{ dataForm.amountReceivablePass }}</span>
+            <span>{{ dataForm.amountReceivablePass||0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>应付金额:</span>
             <span>{{ dataForm.amountPayablePrice || 0 }}</span>
       
             <el-divider direction="vertical"></el-divider>
             <span>已付金额:</span>
-            <span>{{ dataForm.amountPayablePass }}</span>
+            <span>{{ dataForm.amountPayablePass||0 }}</span>
         </el-row>
       </template>
     </headerTitle>
     <recorpayTableList
       ref="recorpayListRef"
       :dataForm="dataForm"
-      :datasource.sync="recorpayList"
+      :recorpayList.sync="recorpayList"
       :dialogType="dialogType"
     ></recorpayTableList>
     <inventoryTable
@@ -158,24 +160,28 @@
         this.dataForm = data;
         switch (this.dataForm.dateType) {
           case 1:
-            this.dataForm.year = this.dataForm.dateValue;
+            this.$set(this.dataForm,'year',this.dataForm.dateValue)
+          
             break;
           case 2:
             //2023年-四季度
             let data = this.dataForm.dateValue.split('年-');
-            this.dataForm.year = data[0];
-            this.dataForm.quarter = data[1];
+            this.$set(this.dataForm,'year',data[0])
+            this.$set(this.dataForm,'quarter',data[1])
+
             break;
           case 3:
-            this.dataForm.month = this.dataForm.dateValue;
+            this.$set(this.dataForm,'month',this.dataForm.dateValue)
             break;
           default:
             this.dataForm.dateValue = '';
-            this.dataForm.dateTimeRange = [
+            this.$set(this.dataForm,'dateTimeRange',[
               this.dataForm.startDate,
               this.dataForm.endDate
-            ];
+            ])
+
         }
+        this.$forceUpdate()
       },
       //关闭弹窗
       cancel() {
@@ -213,7 +219,8 @@
             : updateAccountStatementAPI;
         let params = {
           ...this.dataForm,
-          orderList: this.datasource
+          orderList: this.datasource,
+          recorpayList:this.recorpayList
         };
         let data = await api(params);
         if (is == 'sub') {

+ 2 - 2
src/views/purchasingManage/purchaseOrder/accountstatement/components/detailDialog.vue

@@ -50,14 +50,14 @@
             <span>{{ dataForm.amountReceivablePrice || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已收金额:</span>
-            <span>{{ dataForm.amountReceivablePass }}</span>
+            <span>{{ dataForm.amountReceivablePass||0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>应付金额:</span>
             <span>{{ dataForm.amountPayablePrice || 0 }}</span>
       
             <el-divider direction="vertical"></el-divider>
             <span>已付金额:</span>
-            <span>{{ dataForm.amountPayablePass }}</span>
+            <span>{{ dataForm.amountPayablePass||0 }}</span>
           </el-row>
         </template>
       </headerTitle>

+ 23 - 4
src/views/purchasingManage/purchaseOrder/accountstatement/components/purchaseForm.vue

@@ -43,7 +43,7 @@
         <!--        </el-form-item>-->
         <el-form-item
           label="选择订单"
-          prop="orderId"
+          prop="sourceName"
           v-if="dataForm.sourceType == 3"
         >
           <el-input
@@ -232,7 +232,7 @@
       parentList,
       contractListDialog
     },
-    props: ['dataForm', 'datasource', 'dialogType'],
+    props: ['dataForm', 'datasource', 'dialogType','recorpayList'],
     data() {
       return {
         monthByDays: {},
@@ -347,7 +347,7 @@
           sourceId: obj.id,
           sourceName: obj.contractName,
           contactId: obj.partbId,
-          contactName: obj.partbName,
+          contactName: obj.partbName
         });
         this.$emit('update:dataForm', params);
         this.reloadTableData();
@@ -363,7 +363,12 @@
             contactId: '',
             contactName: '',
             sourceName: '',
-            sourceId: ''
+            sourceId: '',
+            amountPayablePrice: '',
+            amountReceivablePrice: '',
+            amountTotalPrice: '',
+            amountPayablePass: '',
+            amountReceivablePass: ''
           }
         );
         this.$emit('update:dataForm', params);
@@ -371,6 +376,20 @@
       },
       reloadTableData() {
         this.$emit('update:datasource', []);
+        this.$emit('update:recorpayList', []);
+        // let params = Object.assign(
+        //   {},
+        //   {
+        //     ...this.dataForm,
+           
+        //     amountPayablePrice: '',
+        //     amountReceivablePrice: '',
+        //     amountTotalPrice: '',
+        //     amountPayablePass: '',
+        //     amountReceivablePass: ''
+        //   }
+        // );
+        // this.$emit('update:dataForm', params);
       },
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);

+ 9 - 0
src/views/purchasingManage/purchaseOrder/invoice/components/orderListDialog.vue

@@ -95,6 +95,15 @@
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'sourceTypeName',
+            label: '订单类型',
+            align: 'center',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200,
+            fixed: 'left'
+          },
           {
             prop: 'contractName',
             label: '合同名称',

+ 10 - 4
src/views/saleManage/saleOrder/accountstatement/components/addAccountDialog.vue

@@ -23,6 +23,8 @@
       :datasource.sync="datasource"
       :contactData="contactData"
       :saleOrderData="saleOrderData"
+      :recorpayList.sync="recorpayList"
+
       :dialogType="dialogType"
       ref="saleFormRef"
     ></sale-form>
@@ -36,21 +38,21 @@
             <span>{{ dataForm.amountReceivablePrice || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已收金额:</span>
-            <span>{{ dataForm.amountReceivablePass }}</span>
+            <span>{{ dataForm.amountReceivablePass||0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>应付金额:</span>
             <span>{{ dataForm.amountPayablePrice || 0 }}</span>
       
             <el-divider direction="vertical"></el-divider>
             <span>已付金额:</span>
-            <span>{{ dataForm.amountPayablePass }}</span>
+            <span>{{ dataForm.amountPayablePass||0 }}</span>
         </el-row>
       </template>
     </headerTitle>
     <recorpayTableList
       ref="recorpayListRef"
       :dataForm="dataForm"
-      :datasource.sync="recorpayList"
+      :recorpayList.sync="recorpayList"
       :dialogType="dialogType"
     ></recorpayTableList>
     <inventoryTable
@@ -182,6 +184,7 @@
       async getInfo(row) {
         let data = await infoAccountStatementAPI(row.id);
         this.recorpayList = data.recorpayList||[];
+        this.datasource = data.orderList || [];
         this.dataForm = data;
         switch (this.dataForm.dateType) {
           case 1:
@@ -203,6 +206,7 @@
               this.dataForm.endDate
             ];
         }
+        this.$forceUpdate()
       },
       //关闭弹窗
       cancel() {
@@ -230,6 +234,7 @@
           amountPayablePass: data.amountPayablePass,
           amountReceivablePass: data.amountReceivablePass,
         };
+        this.$forceUpdate()
         if (!this.datasource.length) this.$message.warning('暂无订单信息');
       },
       //保存
@@ -242,7 +247,8 @@
             : updateAccountStatementAPI;
         let params = {
           ...this.dataForm,
-          orderList: this.datasource
+          orderList: this.datasource,
+          recorpayList:this.recorpayList
         };
         let data = await api(params);
         if (is == 'sub') {

+ 3 - 3
src/views/saleManage/saleOrder/accountstatement/components/detailDialog.vue

@@ -43,14 +43,14 @@
             <span>{{ dataForm.amountReceivablePrice || 0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>已收金额:</span>
-            <span>{{ dataForm.amountReceivablePass }}</span>
+            <span>{{ dataForm.amountReceivablePass||0 }}</span>
             <el-divider direction="vertical"></el-divider>
             <span>应付金额:</span>
             <span>{{ dataForm.amountPayablePrice || 0 }}</span>
       
             <el-divider direction="vertical"></el-divider>
             <span>已付金额:</span>
-            <span>{{ dataForm.amountPayablePass }}</span>
+            <span>{{ dataForm.amountPayablePass||0 }}</span>
 
           </el-row>
         </template>
@@ -58,7 +58,7 @@
       <recorpayTableList
         ref="recorpayListRef"
         :dataForm="dataForm"
-        :datasource.sync="recorpayList"
+        :recorpayList.sync="recorpayList"
         dialogType="view"
       ></recorpayTableList>
       <inventoryTable ref="inventoryTableref" :dataForm="dataForm" :datasource.sync="datasource" dialogType="view"></inventoryTable>

+ 16 - 7
src/views/saleManage/saleOrder/accountstatement/components/recorpayTableList.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div v-for="item in datasource" style="margin-bottom: 10px">
+    <div v-for="item in recorpayList" style="margin-bottom: 10px">
       <div>
         <div style="margin-bottom: 10px; font-weight: bold">
           <div>
@@ -35,11 +35,11 @@
 <script>
   export default {
     components: {},
-    props: ['datasource', 'dialogType', 'dataForm'],
+    props: ['recorpayList', 'dialogType', 'dataForm'],
     computed: {
       getObj(){
         return (j) => {
-          return this.datasource.filter(item=>item.code==j.code)
+          return this.recorpayList.filter(item=>item.code==j.code)
         }
       },
       getColumns() {
@@ -64,16 +64,25 @@
               prop: 'sourceType',
               label: '来源类型',
               formatter(_row, _column, cellValue) {
-                return cellValue == 1 ? '销售订单' : cellValue == 2 ? '采购订单' : '合同';
+                return cellValue == 2 ? '合同' : cellValue == 3? '订单' : '';
+      
               },
               align: 'center',
               showOverflowTooltip: true
             },
             {
               minWidth: 140,
-              prop: 'productName',
-              label: '产品名称',
-              slot: 'productName',
+              prop: 'sourceName',
+              label: '来源名称',
+              slot: 'sourceCode',
+              align: 'center',
+              showOverflowTooltip: true
+            },
+            {
+              minWidth: 140,
+              prop: 'sourceName',
+              label: '来源编码',
+              slot: 'sourceCode',
               align: 'center',
               showOverflowTooltip: true
             },

+ 15 - 2
src/views/saleManage/saleOrder/accountstatement/components/saleForm.vue

@@ -230,7 +230,14 @@
         default: () => {
           return {};
         }
-      }
+      },
+      recorpayList: {
+        type: Object,
+        default: () => {
+          return [];
+        }
+      },
+      
     },
     data() {
       return {
@@ -362,7 +369,12 @@
             contactId: '',
             contactName: '',
             sourceName: '',
-            sourceId: ''
+            sourceId: '',
+            amountPayablePrice: '',
+            amountReceivablePrice: '',
+            amountTotalPrice: '',
+            amountPayablePass: '',
+            amountReceivablePass: ''
           }
         );
 
@@ -374,6 +386,7 @@
       },
       reloadTableData() {
         this.$emit('update:datasource', []);
+        this.$emit('update:recorpayList', []);
       },
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);

+ 9 - 0
src/views/saleManage/saleOrder/invoice/components/orderListDialog.vue

@@ -99,6 +99,15 @@
             showOverflowTooltip: true,
             minWidth: 200
           },
+          {
+            prop: 'sourceTypeName',
+            label: '订单类型',
+            align: 'center',
+            sortable: true,
+            showOverflowTooltip: true,
+            minWidth: 200,
+            fixed: 'left'
+          },
           {
             prop: 'contractName',
             label: '合同名称',