Browse Source

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-eom into dev

tanzx 1 tháng trước cách đây
mục cha
commit
b5fd553c6f

+ 28 - 28
src/BIZComponents/selectStockLedger/item-search.vue

@@ -29,6 +29,23 @@
             </template>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="所属工厂:" prop="factoryId">
+            <el-select
+              filterable
+              placeholder="请选择"
+              v-model="params.factoryId"
+              clearable
+              class="w100"
+            >
+              <el-option
+                v-for="item in factoryList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              ></el-option>
+            </el-select> </el-form-item
+        ></el-col>
         <el-col :span="6" style="height: 43px">
           <el-form-item label="列表维度:" prop="dimension">
             <template>
@@ -98,7 +115,7 @@
             ></el-input>
           </el-form-item>
         </el-col>
-        <el-col :span="6">
+        <!-- <el-col :span="6">
           <el-form-item label="颜色:" prop="color">
             <el-input
               clearable
@@ -106,32 +123,15 @@
               placeholder="请输入"
             ></el-input>
           </el-form-item>
-        </el-col>
-<!--        <el-col :span="6">-->
-<!--          <el-form-item label="组织机构:">-->
-<!--            <auth-selection-->
-<!--              v-model="params.deptIds"-->
-<!--              style="width: 100%"-->
-<!--            ></auth-selection>-->
-<!--          </el-form-item>-->
-<!--        </el-col>-->
-        <el-col :span="6">
-          <el-form-item label="所属工厂:" prop="factoryId">
-            <el-select
-              filterable
-              placeholder="请选择"
-              v-model="params.factoryId"
-              clearable
-              class="w100"
-            >
-              <el-option
-                v-for="item in factoryList"
-                :key="item.id"
-                :label="item.name"
-                :value="item.id"
-              ></el-option>
-            </el-select> </el-form-item
-        ></el-col>
+        </el-col> -->
+        <!--        <el-col :span="6">-->
+        <!--          <el-form-item label="组织机构:">-->
+        <!--            <auth-selection-->
+        <!--              v-model="params.deptIds"-->
+        <!--              style="width: 100%"-->
+        <!--            ></auth-selection>-->
+        <!--          </el-form-item>-->
+        <!--        </el-col>-->
         <el-col :span="6">
           <el-form-item label="颜色:" prop="colorKey">
             <el-input
@@ -140,7 +140,7 @@
               placeholder="请输入"
             ></el-input>
           </el-form-item>
-        </el-col>  
+        </el-col>
         <el-col :span="6" v-if="params.dimension == 2">
           <el-form-item label="系统批次:" prop="systemBatchNo">
             <el-input

+ 1 - 3
src/components/Dict/DictSelection.vue

@@ -59,7 +59,6 @@
     computed: {
       ...mapGetters(['dict', 'getDict']),
       dictList() {
-
         return (
           (this.listFormatte &&
             this.listFormatte(
@@ -84,8 +83,7 @@
       }
     },
     created() {
-      if (this.dictName&&this.isOne) {
-        
+      if (this.dictName && this.isOne) {
         this.requestDict(this.dictName);
       }
     },

+ 33 - 6
src/views/financialManage/invoiceManage/components/addOrEditDialogNew.vue

@@ -802,8 +802,11 @@
       //合同回调
       async changeContract(data) {
         console.log('changeOrder~~~', data);
-        const tempIds = data.map((item) => item.id);
-        const tempNames = data.map((item) => item.contractNo);
+        // 子组件在单选/多选路径下 emit 的形态不一致,归一化为数组
+        const list = Array.isArray(data) ? data : data ? [data] : [];
+        if (!list.length) return;
+        const tempIds = list.map((item) => item.id);
+        const tempNames = list.map((item) => item.contractNo);
         this.getPlanData(tempIds, tempNames);
         // const res = await getDetail(data.id);
         // this.$set(this.form, 'sourceId', data.id);
@@ -897,8 +900,11 @@
       //订单回调
       async changeOrder(data) {
         console.log('changeOrder~~~', data);
-        const tempIds = data.map((item) => item.id);
-        const tempNames = data.map((item) => item.orderNo);
+        // 子组件在单选/多选路径下 emit 的形态不一致,归一化为数组
+        const list = Array.isArray(data) ? data : data ? [data] : [];
+        if (!list.length) return;
+        const tempIds = list.map((item) => item.id);
+        const tempNames = list.map((item) => item.orderNo);
         this.getPlanData(tempIds, tempNames);
         // this.$set(this.form, 'sourceId', data.id);
         // this.$set(this.form, 'sourceCode', data.orderNo);
@@ -1182,9 +1188,23 @@
 
       invoiceAmountChange(item, sum) {
         console.log('item~~~', item, sum);
-        const sameKeyItems = this.form.relatedList.filter((d) => d.sourceCode === item.key)
+        const sameKeyItems = this.form.relatedList.filter((d) => d.sourceCode === item.key);
         console.log('sameKeyItems~~~', sameKeyItems);
-        
+
+        // 从关联物品清单中取该订单的"未开票金额"和"本次开票金额"(per-detail 字段)
+        const tableInfoRef = this.$refs.tableInfoRef;
+        let unInvoiceAmount = 0;
+        let invoiceAmount = 0;
+        if (tableInfoRef && tableInfoRef.tableForm && tableInfoRef.tableForm.detailList) {
+          const matchedDetail = tableInfoRef.tableForm.detailList.find(
+            (d) => d.key === item.key
+          );
+          if (matchedDetail) {
+            unInvoiceAmount = parseFloat(matchedDetail.unInvoiceAmount) || 0;
+            invoiceAmount = parseFloat(matchedDetail.invoiceAmount) || 0;
+          }
+        }
+
         let remainingTotal = sum;
         const lastIndex = sameKeyItems.length - 1;
 
@@ -1202,6 +1222,13 @@
             remainingTotal -= allocateAmount;
           }
         });
+
+        // 来源清单的未开票金额 = 关联物品清单的未开票金额 - 本次开票金额
+        const remainingUnInvoice = (unInvoiceAmount - invoiceAmount).toFixed(2);
+        sameKeyItems.forEach((paymentItem) => {
+          this.$set(paymentItem, 'unInvoiceAmount', remainingUnInvoice);
+        });
+
         this.updateInvoiceAmount();
         console.log('分配完成后的 sameKeyItems:', sameKeyItems);
       },

+ 10 - 3
src/views/financialManage/prepayment/components/addDialog.vue

@@ -393,13 +393,20 @@
     },
     computed: {
       paidAmount() {
-        return this.form.tableData.reduce((sum, item) => {
-          const val = parseFloat(item.paidAmount);
+        let productList =
+          (this.form &&
+            (this.form.redressProductList ||
+              this.form.quoteProductList ||
+              this.form.productList ||
+              this.form.detailList)) ||
+          [];
+        return productList.reduce((sum, item) => {
+          const val = parseFloat(item.paidTotalPrice);
           return sum + (isNaN(val) ? 0 : val);
         }, 0).toFixed(2);
       },
       unpaidAmount() {
-        const total = parseFloat(this.row.prepayTotalPrice) || 0;
+        const total = parseFloat(this.form.prepayTotalPrice) || 0;
         const paid = parseFloat(this.paidAmount) || 0;
         return (total - paid).toFixed(2);
       }

+ 5 - 2
src/views/financialManage/prepayment/components/payDialog.vue

@@ -198,7 +198,7 @@
     computed: {
       paidAmount() {
         return this.form.tableData.reduce((sum, item) => {
-          const val = parseFloat(item.paidAmount);
+          const val = parseFloat(item.paidTotalPrice);
           return sum + (isNaN(val) ? 0 : val);
         }, 0).toFixed(2);
       },
@@ -213,7 +213,10 @@
         this.visible = true;
         this.row = row;
         this.info = await getPrepaymentInfo(row.id);
-        this.form.tableData = this.info.detailList || [];
+        this.form.tableData = (this.info.detailList || []).map(item => ({
+          ...item,
+          paymentType: item.paymentType != null ? String(item.paymentType) : ''
+        }));
       },
 
       addRow() {

+ 9 - 6
src/views/financialManage/receivableManage/components/addReceivableDialog.vue

@@ -61,17 +61,17 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item prop="invoiceNo" label="发票号">
-              <el-input disabled v-model="dataForm.invoiceNo"></el-input>
+            <el-form-item prop="invoiceNos" label="发票号">
+              <el-input disabled v-model="dataForm.invoiceNos"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item prop="category" label="发票种类">
+            <el-form-item prop="invoiceCategory" label="发票种类">
               <el-select
                 :disabled="true"
                 clearable
                 class="ele-block"
-                v-model="dataForm.category"
+                v-model="dataForm.invoiceCategory"
                 placeholder="请选择"
               >
                 <el-option label="增值税专用发票" :value="1"></el-option>
@@ -104,6 +104,7 @@
                 <el-option label="采购收货单" :value="6" />
                 <el-option label="付款计划单" :value="8" />
                 <el-option label="其他" :value="99" />
+                <el-option label="其他" :value="9" />
               </el-select>
             </el-form-item>
           </el-col>
@@ -371,7 +372,8 @@
 
           this.dataForm = {
             ...this.dataForm,
-            ...data
+            ...data,
+            invoiceCategory: Number(data?.invoiceCategory) || 1
           };
 
           this.statReceipt = data.statReceipt || null;
@@ -399,7 +401,8 @@
 
         this.dataForm = {
           ...this.dataForm,
-          ...data
+          ...data,
+          invoiceCategory: Number(data?.invoiceCategory) || 1
         };
 
         this.statReceipt = data.statReceipt || null;

+ 7 - 7
src/views/financialManage/receivableManage/components/collectionDialog.vue

@@ -138,17 +138,17 @@ export default {
     isView() {
       return this.dialogType === 'view';
     },
-    // 应收金额 = 勾选的应收明细「折让合计」之和
+    // 应收金额 = 接口下发的 row.receivableTotalPrice
     selectedReceivableAmount() {
+      return this.row.receivableTotalPrice || 0;
+    },
+    // 已收金额 = 勾选的应收明细「折让合计」之和 || 接口下发的 row.receivedTotalPrice 
+    receivedAmount() {
       const sum = this.selection.reduce((pre, item) => {
         const val = parseFloat(item.statementAmount);
         return pre + (isNaN(val) ? 0 : val);
       }, 0);
-      return sum.toFixed(2);
-    },
-    // 已收金额 = 接口下发的 row.receivedTotalPrice
-    receivedAmount() {
-      return this.row.receivedTotalPrice || 0;
+      return sum.toFixed(2) || (this.row.receivedTotalPrice || 0);
     },
     // 未收金额 = 接口下发的 row.unreceiveTotalPrice
     unreceivedAmount() {
@@ -184,7 +184,7 @@ export default {
         },
         {
           minWidth: 140,
-          prop: 'statementSubOrderNo',
+          prop: this.queryDimension == 3 ? 'statementSubOrderNo' : this.queryDimension == 1 ? 'statementSubOrderCode' : 'statementSubOrderNo',
           label: this.queryDimension == 3 ? '收货单编码' : this.queryDimension == 1 ? '发货单编码' : '调拨单编码',
           align: 'center',
           showOverflowTooltip: true

+ 6 - 5
src/views/financialManage/receivableManage/components/detailDialog.vue

@@ -72,17 +72,17 @@
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item prop="invoiceNo" label="发票号">
-              <el-input disabled v-model="dataForm.invoiceNo"></el-input>
+            <el-form-item prop="invoiceNos" label="发票号">
+              <el-input disabled v-model="dataForm.invoiceNos"></el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
-            <el-form-item prop="category" label="发票种类">
+            <el-form-item prop="invoiceCategory" label="发票种类">
               <el-select
                 :disabled="true"
                 clearable
                 class="ele-block"
-                v-model="dataForm.category"
+                v-model="dataForm.invoiceCategory"
                 placeholder="请选择"
               >
                 <el-option label="增值税专用发票" :value="1"></el-option>
@@ -340,7 +340,8 @@
 
         this.dataForm = {
           ...this.dataForm,
-          ...data
+          ...data,
+          invoiceCategory: Number(data?.invoiceCategory) || 1
         };
 
         this.statReceipt = data.statReceipt || null;

+ 2 - 2
src/views/financialManage/receivedManaged/index.vue

@@ -51,7 +51,7 @@
             >
               提交
             </el-link> -->
-            <el-link
+            <!-- <el-link
               type="primary"
               :underline="false"
               icon="el-icon-plus"
@@ -59,7 +59,7 @@
               v-if="canAddInvoice(row)"
             >
               新增发票
-            </el-link>
+            </el-link> -->
           </template>
           <!-- 收款信息 -->
           <template v-slot:detailCode="{ row }">

+ 9 - 0
src/views/saleManage/saleOrder/accountstatement/components/saleForm.vue

@@ -146,6 +146,15 @@
           </el-date-picker>
         </el-form-item>
       </el-col>
+      <el-col :span="8" v-if="dataForm.sourceType == 3">
+        <el-form-item label="客户名称" prop="contactName">
+          <el-input
+            :disabled="true"
+            v-model="dataForm.contactName"
+            placeholder="选择订单后自动带入"
+          ></el-input>
+        </el-form-item>
+      </el-col>
       <el-col :span="8" v-if="[2].includes(dataForm.dateType)">
         <el-form-item
           label="选择年度"