فهرست منبع

feat: 应收审批

liujt 1 هفته پیش
والد
کامیت
d5ff93de4a

+ 176 - 118
src/views/bpm/handleTask/components/financialManage/receivableManage/components/detailDialog.vue

@@ -1,110 +1,133 @@
 <template>
   <div>
-    <el-form ref="form" :model="form" :rules="rules" label-width="130px">
-      <headerTitle title="基本信息"></headerTitle>
-      <el-row :gutter="12">
-        <el-col :span="8">
-          <el-form-item
-            label="应收日期"
-            prop="receivableDate"
-            style="margin-bottom: 22px"
-          >
-            <el-date-picker
-              style="width: 100%"
-              v-model="form.receivableDate"
-              type="date"
-              value-format="yyyy-MM-dd"
+    <headerTitle title="基本信息" style="margin-top: 30px"></headerTitle>
+      <el-form ref="form" :model="dataForm" :rules="rules" label-width="120px">
+        <el-row>
+          <el-col :span="8">
+            <el-form-item label="会计科目:" prop="accountingSubjectId">
+              <ele-tree-select
+                clearable
+                filterable
+                ref="treeSelect"
+                :data="accountingSubjectList"
+                v-model="dataForm.accountingSubjectId"
+                valueKey="id"
+                labelKey="name"
+                placeholder="请选择"
+                @change="changeSubjectInfo"
+                default-expand-all
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item
+              label="应收日期"
+              prop="receivableDate"
             >
-            </el-date-picker>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item
-            label="应收金额"
-            prop="receivableTotalPrice"
-            style="margin-bottom: 22px"
-          >
-            <el-input-number
-              disabled
-              v-model="form.receivableTotalPrice"
-              :precision="2"
-              :controls="false"
-              style="width: 100%"
-              :min="0"
-            ></el-input-number>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item
-            label="会计科目"
-            prop="accountingSubjectId"
-            style="margin-bottom: 22px"
-          >
-            <ele-tree-select
-              clearable
-              filterable
-              ref="treeSelect"
-              :data="accountingSubjectList"
-              v-model="form.accountingSubjectId"
-              valueKey="id"
-              labelKey="name"
-              placeholder="请选择"
-              @change="changeSubjectInfo"
-              default-expand-all
-            />
-          </el-form-item>
-        </el-col>
-      </el-row>
-      <el-row :gutter="12">
-        <el-col :span="8">
-          <el-form-item
-            label="发票编码"
-            prop="invoiceCode"
-            style="margin-bottom: 22px"
-          >
-            <el-input disabled v-model="form.invoiceCode"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item
-            label="来源类型"
-            prop="sourceType"
-            style="margin-bottom: 22px"
-          >
-            <el-input
-              :value="form.sourceTypeName"
-              disabled
-            ></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item
-            label="来源编码"
-            prop="sourceCode"
-            style="margin-bottom: 22px"
-          >
-            <el-input v-model="form.sourceCode" disabled></el-input>
-          </el-form-item>
-        </el-col>
-      </el-row>
-
-      <el-row :gutter="12">
-        <el-col :span="8">
-          <el-form-item
-            label="公司名称"
-            prop="contactName"
-            style="margin-bottom: 22px"
-          >
-            <el-input disabled v-model="form.contactName"></el-input>
-          </el-form-item>
-        </el-col>
-        <el-col :span="8">
-          <el-form-item label="附件">
-            <fileMain v-model="form.files"></fileMain>
-          </el-form-item>
-        </el-col>
-      </el-row>
-    </el-form>
+              <el-date-picker
+                :disabled="dialogType == 'view'"
+                v-model="dataForm.receivableDate"
+                value-format="yyyy-MM-dd"
+                type="date"
+                style="width: 100%"
+              >
+              </el-date-picker>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="receivableTotalPrice" label="应收金额">
+              <el-input :disabled="dialogType == 'view'" v-model="dataForm.receivableTotalPrice"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="invoiceCode" label="发票编码">
+              <el-input disabled v-model="dataForm.invoiceCode"></el-input>
+            </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>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="category" label="发票种类">
+              <el-select
+                :disabled="true"
+                clearable
+                class="ele-block"
+                v-model="dataForm.category"
+                placeholder="请选择"
+              >
+                <el-option label="增值税专用发票" :value="1"></el-option>
+                <el-option label="增值税普通发票" :value="2"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="contactName" label="公司名称">
+              <el-input disabled v-model="dataForm.contactName"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item label="来源类型" prop="sourceType">
+              <el-select
+                :disabled="true"
+                clearable
+                class="ele-block"
+                v-model="dataForm.sourceType"
+                placeholder="请选择"
+              >
+                <el-option label="采购订单" :value="2" />
+                <!--            <el-option label="项目" :value="2"/>-->
+                <!-- <el-option label="合同" :value="4" /> -->
+
+                <el-option label="销售订单" :value="1" />
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :span="8">
+            <el-form-item prop="sourceCode" label="来源编码">
+              <el-input disabled v-model="dataForm.sourceCode"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <el-row>
+          <el-col :span="8">
+            <el-form-item prop="remark" label="备注">
+              <el-input :disabled="dialogType == 'view'" v-model="dataForm.remark"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="12">
+            <el-form-item prop="files" label="附件">
+              <fileMain v-model="dataForm.files" :type="dialogType == 'view' ? 'view' : 'add'"></fileMain>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+
+      <headerTitle title="应收信息" style="margin-top: 30px"></headerTitle>
+      <receivable-info
+        :dataForm.sync="dataForm"
+        :receivableList.sync="receivableList"
+        dialogType="view"
+        ref="receivableInfoRef"
+        @addAdvanceReceipt="addAdvanceReceipt"
+      ></receivable-info>
+
+      <headerTitle title="对账明细" style="margin-top: 30px"></headerTitle>
+      <account-detail-table
+        ref="accountDetailTableRef"
+        :datasource.sync="datasource"
+        dialogType="view"
+        :queryDimension="dataForm.queryDimension"
+        @totalChange="handleTotalChange"
+        @countChange="handleCountChange"
+      ></account-detail-table>
   </div>
 </template>
 
@@ -124,6 +147,8 @@
   import { getTreeByPid } from '@/api/classifyManage';
   import { payAndReceiveEnum } from '@/enum/dict';
   // import fileMain from "@/components/addDoc/index.vue";
+  import AccountDetailTable from '@/views/bpm/handleTask/components/saleOrder/accountstatement/accountDetailTable.vue';
+  import ReceivableInfo from '@/views/bpm/handleTask/components/saleOrder/accountstatement/receivableInfo.vue';
 
   export default {
     mixins: [dictMixins],
@@ -131,12 +156,14 @@
       // fileMain,
       tableInfo,
       personSelect,
-      fileUpload
+      fileUpload,
+      AccountDetailTable,
+      ReceivableInfo
     },
     data() {
       return {
-        dialogType: '',
-        form: {
+        dialogType: 'view',
+        dataForm: {
           accountingSubjectCode: '',
           accountingSubjectId: '',
           accountingSubjectName: '',
@@ -154,7 +181,10 @@
           sourceType: '',
           unreceiveTotalPrice: 0
         },
+        receivableList: [],
         accountingSubjectList: [],
+        statReceipt: null,
+        datasource: [],
         rules: {
           accountingSubjectId: {
             required: true,
@@ -181,21 +211,49 @@
       await this.getInfo(this.businessId);
     },
     methods: {
+      handleTotalChange(total) {
+        this.dataForm.amountTotalPrice = total;
+      },
+      handleCountChange(count) {
+        this.dataForm.totalStatementCount = count;
+      },
+      // 明细表本次对账金额变化时,按销售单号同步到应收信息对应行
+      handleStatementAmountChange(summaryMap) {
+        if (this.$refs.receivableInfoRef) {
+          this.$refs.receivableInfoRef.syncStatementAmount(summaryMap);
+        }
+      },
+      // 新增预收款:打开预收款选择弹窗
+      addAdvanceReceipt() {
+        this.$refs.advanceReceiptSelectRef.open();
+      },
       //获取详情
       async getInfo(id) {
         await this.getClassifyList(24, 'accountingSubjectList');
         let data = await getFinReceivableInfoAPI(id);
-        data.sourceTypeName = payAndReceiveEnum.find(item=>item.value==data.sourceType)?.label;
-        this.form = data;
-        console.log('获取详情', data);
-        let invoiceData = {};
-        if (data.invoiceId) {
-          invoiceData = await invoiceApplyInfoAPI(data.invoiceId);
-        }
 
-        this.form.accountingSubjectCode = invoiceData.accountingSubjectCode;
-        this.form.accountingSubjectId = invoiceData.accountingSubjectId || '';
-        this.form.accountingSubjectName = invoiceData.accountingSubjectName || '';
+        this.dataForm = {
+          ...this.dataForm,
+          ...data
+        };
+
+        this.statReceipt = data.statReceipt || null;
+
+        this.receivableList =
+        (data.statReceipt && data.statReceipt.statReceiptDetailList) || [];
+
+        this.datasource = data.productList || [];
+        // data.sourceTypeName = payAndReceiveEnum.find(item=>item.value==data.sourceType)?.label;
+        // this.form = data;
+        // console.log('获取详情', data);
+        // let invoiceData = {};
+        // if (data.invoiceId) {
+        //   invoiceData = await invoiceApplyInfoAPI(data.invoiceId);
+        // }
+
+        // this.form.accountingSubjectCode = invoiceData.accountingSubjectCode;
+        // this.form.accountingSubjectId = invoiceData.accountingSubjectId || '';
+        // this.form.accountingSubjectName = invoiceData.accountingSubjectName || '';
       },
       downloadFile(file) {
         getFile({ objectName: file.storePath }, file.name);
@@ -219,7 +277,7 @@
           this.$refs.form.validate(async (valid) => {
             if (!valid) return this.$message.warning('有必填项未填,请检查');
             const API = finReceivableUpdateAPI;
-            const res = await API(this.form);
+            const res = await API(this.dataForm);
             res.code == '0' ? resolve('1') : reject(new Error(data.message));
           });
         });

+ 5 - 0
src/views/bpm/handleTask/components/financialManage/receivableManage/submit.vue

@@ -23,6 +23,7 @@
         type="success"
         size="mini"
         v-click-once
+        :loading="saveLoading"
         @click="handleAudit(1)"
       >通过
       </el-button>
@@ -31,6 +32,7 @@
         type="danger"
         size="mini"
         v-click-once
+        :loading="saveLoading"
         @click="handleAudit(0)"
         v-if="!['starter'].includes(taskDefinitionKey)"
       >驳回
@@ -101,6 +103,7 @@ export default {
         reason: '同意',
 
       },
+      saveLoading: false,
       tabOptions: [
         {key: 'financeApprove', permissionType: 'update', name: '财务审批'},
       ],
@@ -131,11 +134,13 @@ export default {
         pass: !!status
       };
       let API = !!status ? approveTaskWithVariables : rejectTask;
+      this.saveLoading = true;
       API({
         id: this.taskId,
         reason: this.form.reason,
         variables
       }).then((res) => {
+        this.saveLoading = false;
         if (res.data.code != '-1') {
           this.$emit('handleAudit', {
             status,

+ 22 - 22
src/views/bpm/handleTask/components/saleOrder/accountstatement/page.vue

@@ -6,7 +6,7 @@
                :dataForm.sync="dataForm"
                :datasource.sync="datasource"
                :dialogType="permissionType"></sale-form>
-    <headerTitle title="对账明细" style="margin-top: 30px">
+    <!-- <headerTitle title="对账明细" style="margin-top: 30px">
       <template v-slot>
         <el-row style="font-weight: 700; color: red">
             <span>订单总金额:</span>
@@ -22,17 +22,17 @@
             <span>{{ dataForm.amountTotalPrice || 0 }}</span>
           </el-row>
       </template>
-    </headerTitle>
+    </headerTitle> -->
     <!-- <recorpayTableList
       ref="recorpayListRef"
       :dataForm="dataForm"
       :recorpayList.sync="recorpayList"
       :dialogType="permissionType"
     ></recorpayTableList> -->
-    <inventoryTable ref="inventoryTableref" :priceObj="priceObj" :dataForm="dataForm" :datasource.sync="datasource"
+    <!-- <inventoryTable ref="inventoryTableref" :priceObj="priceObj" :dataForm="dataForm" :datasource.sync="datasource"
                     :dialogType="permissionType"
-                    :taskDefinitionKey="taskDefinitionKey"></inventoryTable>
-    <!-- <headerTitle title="应收信息" style="margin-top: 30px"></headerTitle>
+                    :taskDefinitionKey="taskDefinitionKey"></inventoryTable> -->
+    <headerTitle title="应收信息" style="margin-top: 30px"></headerTitle>
       <receivable-info
         :dataForm.sync="dataForm"
         :receivableList="receivableList"
@@ -50,7 +50,7 @@
         @totalChange="handleTotalChange"
         @countChange="handleCountChange"
         @statementAmountChange="handleStatementAmountChange"
-      ></account-detail-table> -->
+      ></account-detail-table>
   </div>
 </template>
 
@@ -166,24 +166,24 @@ export default {
     //获取对账单详情
     async getInfo(id) {
       let data = await accountstatementInfoAPI(id)
-      this.datasource = data?.orderList || []
-      this.recorpayList=data?.recorpayList||[]
-      data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
-      data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
-      data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
-      data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
-      this.dataForm = data
+      // this.datasource = data?.orderList || []
+      // this.recorpayList=data?.recorpayList||[]
+      // data.orderTotalAmount = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.orderAmount * 100), 0) / 100;
+      // data.amountTotalPrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementAmount * 100), 0) / 100;
+      // data.amountCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.statementedAmount * 100), 0) / 100;
+      // data.amountUnCompletePrice = data.orderList.reduce((pre, cur) => pre + Math.round(+cur.unStatementAmount * 100), 0) / 100;
+      // this.dataForm = data
       //this.priceObj.previousPeriodEndDebt = data.previousPeriodEndDebt
 
-      // this.datasource = data.productList || [];
-      //   this.receivableList =
-      //     (data.statReceipt && data.statReceipt.statReceiptDetailList) || [];
-      //   // 保存查询到的完整 statReceipt 对象,作为提交入参
-      //   this.statReceipt = data.statReceipt || null;
-      //   this.dataForm = {
-      //     ...this.dataForm,
-      //     ...data,
-      //   };
+      this.datasource = data.productList || [];
+        this.receivableList =
+          (data.statReceipt && data.statReceipt.statReceiptDetailList) || [];
+        // 保存查询到的完整 statReceipt 对象,作为提交入参
+        this.statReceipt = data.statReceipt || null;
+        this.dataForm = {
+          ...this.dataForm,
+          ...data,
+        };
       switch (this.dataForm.dateType) {
         case 1:
           this.dataForm.year = this.dataForm.dateValue

+ 7 - 0
src/views/bpm/handleTask/components/saleOrder/accountstatement/submit.vue

@@ -22,6 +22,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
+        :loading="saveLoading"
         @click="handleAudit(1)"
         v-click-once
       >通过
@@ -31,6 +32,7 @@
         type="danger"
         size="mini"
         v-click-once
+        :loading="saveLoading"
         @click="rejectTask(0)">驳回
       </el-button>
 
@@ -109,6 +111,7 @@ export default {
         {key: 'uploadReceipt', permissionType: 'view', name: '上传回执'},
       ],
       permissionType: '',
+      saveLoading: false,
     };
   },
   created() {
@@ -153,11 +156,15 @@ export default {
         let variables = {
           pass: !!pass,
         }
+
+        this.saveLoading = true;
+
         approveTaskWithVariablesAPI({
           id: this.taskId,
           reason: this.form.reason,
           variables
         }).then((res) => {
+          this.saveLoading = false;
           if (res.code != '-1') {
             this.$emit('handleAudit', {
               status: pass,