liujt 1 неделя назад
Родитель
Сommit
678ce2e049

+ 119 - 102
src/views/bpm/handleTask/components/financialManage/invoiceManage/components/addOrEditDialog.vue

@@ -25,33 +25,50 @@
                 :disabled="true"
                 style="width: 100%"
               >
-                <el-option label="收款计划" :value="6"></el-option>
-                <el-option label="付款计划" :value="7"></el-option>
-                <el-option label="应收管理" :value="5"></el-option>
-                <el-option label="应付管理" :value="4"></el-option>
+                <el-option v-for="item in sourceTypeList" :key="item.value" :value="item.value" :label="item.label"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8" v-if="form.sourceType == 6">
-            <el-form-item label="收款计划" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8" v-if="form.sourceType == 7">
-            <el-form-item label="付款计划" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8" v-if="form.sourceType == 5">
-            <el-form-item label="应收管理" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8" v-if="form.sourceType == 4">
-            <el-form-item label="应付管理" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
+          <el-col :span="8" v-if="form.sourceType == 1">
+          <el-form-item label="对账单" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 2">
+          <el-form-item label="合同" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 3">
+          <el-form-item label="订单" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 5">
+          <el-form-item label="已收" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 4">
+          <el-form-item label="已付" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+            ></el-input>
+          </el-form-item>
+        </el-col>
           <el-col :span="8">
             <el-form-item label="发票金额" prop="amount">
               <el-input-number
@@ -226,38 +243,55 @@
       ref="table"
       @setPrice="setPrice"
     ></table-info> -->
-    <div v-if="form.sourceType != 99" style="margin-top: 20px; margin-bottom: 20px;">
+    <div style="margin-top: 20px; margin-bottom: 20px;">
         <headerTitle title="收款计划信息"></headerTitle>
         <!-- <el-form ref="form" :model="tableForm"> -->
           <ele-pro-table
             ref="table"
             :needPage="false"
             :columns="columns"
-            :datasource="form.receiptPayments"
+            :datasource="form.relatedList"
             row-key="id"
             class="time-form"
           >
             <template v-slot:toolbar>
               <!-- <span>已开票金额:{{ totalInvoiceAmount }}</span> -->
             </template>
-            
+            <template v-slot:planPaymentAmount="scope">
+              <el-form-item
+                style="width: 100%;"
+                label-width="0"
+                :prop="'relatedList.' + scope.$index + '.planPaymentAmount'"
+                :rules="[
+                  {
+                    required: false,
+                    message: '请输入计划金额',
+                    trigger: 'blur'
+                  }
+                ]"
+              > 
+                <span v-if="dialogType === 'view'">{{ scope.row.planPaymentAmount }}</span>
+                <el-input v-else v-model="scope.row.planPaymentAmount" type="number" @input="updatePlanPaymentAmount(scope.row)"></el-input>
+              </el-form-item>
+            </template>
             <template v-slot:invoiceAmount="scope">
-              <!-- <el-form-item
+              <el-form-item
                 style="width: 100%;"
                 label-width="0"
-                :prop="'receiptPayments.' + scope.$index + '.invoiceAmount'"
+                :prop="'relatedList.' + scope.$index + '.invoiceAmount'"
                 :rules="[
                   {
-                    required: true,
+                    required: false,
                     message: '请输入开票金额',
                     trigger: 'blur'
                   },
                   {
+                    required: false,
                     validator: (rule, value, callback) => {
                       if (value === undefined || value === null || value === '') {
                         callback('请输入开票金额');
-                      } else if (parseFloat(value) <= 0) {
-                        callback('开票金额必须大于0');  
+                      } else if (parseFloat(value) <= 0 || parseFloat(value) > parseFloat(scope.row.unInvoiceAmount)) {
+                        callback('开票金额必须大于0且不超过未开票金额');  
                       } else {
                         callback();
                       }
@@ -265,10 +299,10 @@
                     trigger: 'blur'
                   }
                 ]"
-              >  -->
+              > 
                 <span v-if="dialogType === 'view'">{{ scope.row.invoiceAmount }}</span>
-                <!-- <el-input :min="0" :max="scope.row.planPaymentAmount" v-limit="{ min: 0, max: scope.row.planPaymentAmount }" v-else v-model="scope.row.invoiceAmount" type="number" @input="updateInvoiceAmount(scope.row)"></el-input> -->
-              <!-- </el-form-item> -->
+                <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="updateInvoiceAmount(scope.row)"></el-input>
+              </el-form-item>
             </template>
           </ele-pro-table>
         <!-- </el-form> -->
@@ -344,92 +378,49 @@
             fixed: 'left'
           },
           {
-            width: 150,
-            prop: 'sourceOrderDetailNo',
-            label: this.form.type == 1 ? '收款计划编码' : '付款计划编码',
-            align: 'center'
-          },
-          {
-            width: 150,
-            prop: 'relatedOrderNo',
-            label: '订单编号',
+            minWidth: 150,
+            prop: 'sourceCode',
+            label: '来源编码',
             align: 'center'
           },
+          // {
+          //   width: 150,
+          //   prop: 'relatedOrderNo',
+          //   label: '来源编号',
+          //   align: 'center'
+          // },
           {
-            width: 120,
-            prop: 'relatedOrderType',
-            label: '订单类型',
+            minWidth: 120,
+            prop: 'sourceType',
+            label: '来源类型',
             align: 'center',
             formatter: (row) => {
-              return row.relatedOrderType == 1 ? '销售订单' : '采购订单'
+              return this.sourceTypeList.find(item => item.value == row.sourceType)?.label || ''
             }
           },
+          // {
+          //   width: 170,
+          //   prop: 'planPaymentAmount',
+          //   label: this.form.type == 1 ? '计划收款金额' : '计划付款金额',
+          //   align: 'center',
+          //   slot: 'planPaymentAmount'
+          // },
           {
-            width: 120,
-            prop: 'contractNo',
-            label: '合同编码',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'contractCode',
-            label: '合同编号',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'contractName',
-            label: '合同名称',
-            align: 'center'
-          },
-          {
-            prop: 'issueNumber',
-            label: '期数',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'paymentType',
-            label: '款项类型',
-            align: 'center',
-            formatter: (row) => {
-              return this.paymentTypeOp.find(item => item.value == row.paymentType)?.label || ''
-            }
-          },
-          {
-            prop: 'moneyName',
-            label: '款项名称',
-            align: 'center',
-            width: 170
-          },
-          {
-            width: 150,
-            prop: 'paymentRatio',
-            label: '比例',
-            align: 'center'
-          },
-          {
-            width: 170,
-            prop: 'planPaymentAmount',
-            label: this.form.type == 1 ? '计划收款金额' : '计划付款金额',
-            align: 'center',
-          },
-          {
-            width: 150,
+            minWidth: 150,
             prop: 'unInvoiceAmount',
             label: '未开票金额',
             align: 'center'
           },
           {
-            width: 150,
+            minWidth: 150,
             prop: 'invoicedAmount',
             label: '已开票金额',
             align: 'center'
           },
           {
-            width: 160,
+            minWidth: 160,
             prop: 'invoiceAmount',
-            label: '开票金额',
+            label: '本次开票金额',
             align: 'center',
             // slot: 'invoiceAmount',
             fixed: 'right'
@@ -442,6 +433,32 @@
         dialogType: '',
         title: '',
         paymentTypeOp,
+        sourceTypeList: [
+          {
+            label: '对账单',
+            value: 1
+          },
+          {
+            label: '合同',
+            value: 2
+          },
+          {
+            label: '订单',
+            value: 3
+          },
+          {
+            label: '已付',
+            value: 4
+          },
+          {
+            label: '已收',
+            value: 5
+          },
+          {
+            label: '其他无订单无合同',
+            value: 99
+          }
+        ],
         form: {
           salesCompanyUsc: '',
           salesCompanyBankBranchNo: '',

+ 127 - 110
src/views/bpm/handleTask/components/financialManage/invoiceManage/components/detailDialog.vue

@@ -18,38 +18,56 @@
                 :disabled="true"
                 style="width: 100%"
               >
-                <el-option label="收款计划" :value="6"></el-option>
-                <el-option label="付款计划" :value="7"></el-option>
-                <el-option label="应收管理" :value="5"></el-option>
-                <el-option label="应付管理" :value="4"></el-option>
+                <el-option v-for="item in sourceTypeList" :key="item.value" :value="item.value" :label="item.label"></el-option>
               </el-select>
             </el-form-item>
           </el-col>
-          <el-col :span="8" v-if="form.sourceType == 6">
-            <el-form-item label="收款计划" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8" v-if="form.sourceType == 7">
-            <el-form-item label="付款计划" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <!-- <el-col :span="8" v-if="form.sourceType == 3">
-            <el-form-item label="订单" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col> -->
-          <el-col :span="8" v-if="form.sourceType == 5">
-            <el-form-item label="应收管理" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="8" v-if="form.sourceType == 4">
-            <el-form-item label="应付管理" prop="sourceCode">
-              <el-input v-model="form.sourceCode" :disabled="true"></el-input>
-            </el-form-item>
-          </el-col>
+
+          <el-col :span="8" v-if="form.sourceType == 1">
+          <el-form-item label="对账单" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+              @click.native="handleSelectAccount(1)"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 2">
+          <el-form-item label="合同" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+              @click.native="handleSelectAccount(2)"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 3">
+          <el-form-item label="订单" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+              @click.native="handleSelectAccount(3)"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 5">
+          <el-form-item label="已收" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+              @click.native="handleSelectAccount(5)"
+            ></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="8" v-if="form.sourceType == 4">
+          <el-form-item label="已付" prop="sourceCode">
+            <el-input
+              v-model="form.sourceCode"
+              readonly
+              @click.native="handleSelectAccount(4)"
+            ></el-input>
+          </el-form-item>
+        </el-col>
           <el-col :span="8">
             <el-form-item label="发票金额" prop="amount">
               <el-input
@@ -177,38 +195,57 @@
         </el-col>
       </el-row>
     </el-form>
-    <div v-if="form.sourceType != 99" style="margin-top: 20px; margin-bottom: 20px;">
-        <headerTitle title="收款计划信息"></headerTitle>
+
+
+    <div class="payinfo" style="margin-top: 20px;">
+        <headerTitle title="来源清单"></headerTitle>
         <!-- <el-form ref="form" :model="tableForm"> -->
           <ele-pro-table
             ref="table"
             :needPage="false"
             :columns="columns"
-            :datasource="form.receiptPayments"
+            :datasource="form.relatedList"
             row-key="id"
             class="time-form"
           >
             <template v-slot:toolbar>
               <!-- <span>已开票金额:{{ totalInvoiceAmount }}</span> -->
             </template>
-            
+            <template v-slot:planPaymentAmount="scope">
+              <el-form-item
+                style="width: 100%;"
+                label-width="0"
+                :prop="'relatedList.' + scope.$index + '.planPaymentAmount'"
+                :rules="[
+                  {
+                    required: false,
+                    message: '请输入计划金额',
+                    trigger: 'blur'
+                  }
+                ]"
+              > 
+                <span v-if="dialogType === 'view'">{{ scope.row.planPaymentAmount }}</span>
+                <el-input v-else v-model="scope.row.planPaymentAmount" type="number" @input="updatePlanPaymentAmount(scope.row)"></el-input>
+              </el-form-item>
+            </template>
             <template v-slot:invoiceAmount="scope">
-              <!-- <el-form-item
+              <el-form-item
                 style="width: 100%;"
                 label-width="0"
-                :prop="'receiptPayments.' + scope.$index + '.invoiceAmount'"
+                :prop="'relatedList.' + scope.$index + '.invoiceAmount'"
                 :rules="[
                   {
-                    required: true,
+                    required: false,
                     message: '请输入开票金额',
                     trigger: 'blur'
                   },
                   {
+                    required: false,
                     validator: (rule, value, callback) => {
                       if (value === undefined || value === null || value === '') {
                         callback('请输入开票金额');
-                      } else if (parseFloat(value) <= 0) {
-                        callback('开票金额必须大于0');  
+                      } else if (parseFloat(value) <= 0 || parseFloat(value) > parseFloat(scope.row.unInvoiceAmount)) {
+                        callback('开票金额必须大于0且不超过未开票金额');  
                       } else {
                         callback();
                       }
@@ -216,10 +253,10 @@
                     trigger: 'blur'
                   }
                 ]"
-              >  -->
+              > 
                 <span v-if="dialogType === 'view'">{{ scope.row.invoiceAmount }}</span>
-                <!-- <el-input :min="0" :max="scope.row.planPaymentAmount" v-limit="{ min: 0, max: scope.row.planPaymentAmount }" v-else v-model="scope.row.invoiceAmount" type="number" @input="updateInvoiceAmount(scope.row)"></el-input> -->
-              <!-- </el-form-item> -->
+                <el-input v-else v-model="scope.row.invoiceAmount" type="number" @input="updateInvoiceAmount(scope.row)"></el-input>
+              </el-form-item>
             </template>
           </ele-pro-table>
         <!-- </el-form> -->
@@ -276,93 +313,47 @@
             fixed: 'left'
           },
           {
-            width: 150,
-            prop: 'sourceOrderDetailNo',
-            label: this.form.type == 1 ? '收款计划编码' : '付款计划编码',
+            minWidth: 150,
+            prop: 'sourceCode',
+            label: '来源编码',
             align: 'center'
           },
+          // {
+          //   width: 150,
+          //   prop: 'relatedOrderNo',
+          //   label: '来源编号',
+          //   align: 'center'
+          // },
           {
-            width: 150,
-            prop: 'relatedOrderNo',
-            label: '订单编号',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'relatedOrderType',
-            label: '订单类型',
+            minWidth: 120,
+            prop: 'sourceType',
+            label: '来源类型',
             align: 'center',
             formatter: (row) => {
-              return row.relatedOrderType == 1 ? '销售订单' : '采购订单'
+              return this.sourceTypeList.find(item => item.value == row.sourceType)?.label || ''
             }
           },
+          // {
+          //   width: 170,
+          //   prop: 'planPaymentAmount',
+          //   label: this.form.type == 1 ? '计划收款金额' : '计划付款金额',
+          //   align: 'center',
+          //   slot: 'planPaymentAmount'
+          // },
           {
-            width: 120,
-            prop: 'contractNo',
-            label: '合同编码',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'contractCode',
-            label: '合同编号',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'contractName',
-            label: '合同名称',
-            align: 'center'
-          },
-          {
-            prop: 'issueNumber',
-            label: '期数',
-            align: 'center'
-          },
-          {
-            width: 120,
-            prop: 'paymentType',
-            label: '款项类型',
-            align: 'center',
-            formatter: (row) => {
-              return this.paymentTypeOp.find(item => item.value == row.paymentType)?.label || ''
-            }
-          },
-          {
-            prop: 'moneyName',
-            label: '款项名称',
-            align: 'center',
-            width: 170
-          },
-          {
-            width: 150,
-            prop: 'paymentRatio',
-            label: '比例',
-            align: 'center',
-            formatter: (row) => {
-              return row.paymentRatio ? row.paymentRatio + '%' : ''
-            }
-          },
-          {
-            width: 170,
-            prop: 'planPaymentAmount',
-            label: this.form.type == 1 ? '计划收款金额' : '计划付款金额',
-            align: 'center',
-          },
-          {
-            width: 150,
+            minWidth: 150,
             prop: 'unInvoiceAmount',
             label: '未开票金额',
             align: 'center'
           },
           {
-            width: 150,
+            minWidth: 150,
             prop: 'invoicedAmount',
             label: '已开票金额',
             align: 'center'
           },
           {
-            width: 160,
+            minWidth: 160,
             prop: 'invoiceAmount',
             label: '本次开票金额',
             align: 'center',
@@ -376,6 +367,32 @@
       return {
         paymentTypeOp,
         dialogType: 'view',
+        sourceTypeList: [
+          {
+            label: '对账单',
+            value: 1
+          },
+          {
+            label: '合同',
+            value: 2
+          },
+          {
+            label: '订单',
+            value: 3
+          },
+          {
+            label: '已付',
+            value: 4
+          },
+          {
+            label: '已收',
+            value: 5
+          },
+          {
+            label: '其他无订单无合同',
+            value: 99
+          }
+        ],
         form: {
           files: []
         }

+ 37 - 49
src/views/bpm/handleTask/components/financialManage/invoiceManage/components/tableInfoNew.vue

@@ -113,36 +113,32 @@
           {
             width: 100,
             prop: 'key',
-            label: '编码',
+            label: '来源编码',
             align: 'center'
           },
+          // {
+          //   width: 100,
+          //   prop: 'key',
+          //   label: '对账日期',
+          //   align: 'center'
+          // },
           {
             width: 100,
-            prop: 'typeName',
-            label: '类型',
-            slot: 'typeName',
+            prop: 'sourceOrderNo',
+            label: '销售订单编码',
             align: 'center'
           },
           // {
-          //   minWidth: 100,
-          //   prop: 'sourceCode',
-          //   label: '类型编码',
-          //   slot: 'sourceCode',
-          //   align: 'center'
-          // },
-          // {
           //   width: 100,
-          //   prop: 'productCategoryName',
-          //   label: '分类',
-          //   slot: 'productCategoryName',
-          //   align: "center"
+          //   prop: 'key',
+          //   label: '发货单编码',
+          //   align: 'center'
           // },
           // {
           //   width: 100,
-          //   prop: 'productCode',
-          //   label: '编码',
-          //   slot: 'productCode',
-          //   align: "center"
+          //   prop: 'key',
+          //   label: '发货日期',
+          //   align: 'center'
           // },
           {
             minWidth: 100,
@@ -151,36 +147,7 @@
             slot: 'productName',
             align: 'center'
           },
-          {
-            minWidth: 100,
-            prop: 'modelType',
-            label: '型号',
-            slot: 'modelType',
-            align: 'center'
-          },
-
-          {
-            minWidth: 100,
-            prop: 'specification',
-            label: '规格',
-            slot: 'specification',
-            align: 'center'
-          },
-          // {
-          //   width: 100,
-          //   prop: 'unInvoiceAmount',
-          //   label: '未开票金额',
-          //   slot: 'unInvoiceAmount',
-          //   align: "center"
-          // },
-          
-          // {
-          //   width: 80,
-          //   prop: 'singleWeight',
-          //   label: '单量',
-          //   align: 'center'
-          // },
-
+        
           {
             minWidth: 150,
             prop: 'invoiceAmount',
@@ -271,6 +238,27 @@
             label: '折让合计',
             align: 'center'
           },
+          {
+            width: 100,
+            prop: 'productCode',
+            label: '产品编码',
+            align: 'center'
+          },
+          {
+            minWidth: 100,
+            prop: 'modelType',
+            label: '型号',
+            slot: 'modelType',
+            align: 'center'
+          },
+
+          {
+            minWidth: 100,
+            prop: 'specification',
+            label: '规格',
+            slot: 'specification',
+            align: 'center'
+          },
           // {
           //   width: 100,
           //   prop: 'sourceType',