Просмотр исходного кода

1.开票管理修改接口功能

haizhouwang 2 лет назад
Родитель
Сommit
5059f4af36

+ 9 - 1
src/http/moudules/expense.js

@@ -261,7 +261,15 @@ export const addInvAccountIncoice = (data) => {
         data
     })
 }
-//修改开票
+//开票修改
+export const updateIncoice = (data) => {
+    return axios({
+        url: '/invAccountIncoice/updateIncoice',
+        method: "post",
+        data
+    })
+}
+//开票进账
 export const putInvAccountIncoice = (data) => {
     return axios({
         url: '/invAccountIncoice/update',

+ 19 - 19
src/views/FinancialManagement/ExpenseManagement/ExpenseApplyFor.vue

@@ -272,51 +272,51 @@
           </el-row>
           <el-row>
             <el-col :span="12">
-              <el-form-item label="收入方资金归属" prop="entProfit">
+              <el-form-item label="支出方资金归属" prop="outFlag">
                 <el-select
-                  v-model="profitObj.entProfitName"
-                  filterable
-                  @change="profitChange($event, 1)"
-                  placeholder=""
+                v-model="profitObj.outProfitName"
+                filterable
+                @change="profitChange($event, 2)"
+                placeholder=""
                 >
                   <el-option
                     v-for="(item, index) in affiliationData"
-                    :key="item.profitId + 'ent' + index"
+                    :key="item.profitId + 'out' + index"
                     :label="item.profitName"
                     :value="item.profitEng"
                   >
-                  </el-option>
+                </el-option>
                 </el-select>
                 <el-input-number
-                  v-model="profitObj.entProfitValue"
-                  :min="0"
-                  @blur="profitBlur($event, 1)"
-                  placeholder="请输入利润(%)"
-                  :max="100"
-                  label=""
+                v-model="profitObj.outProfitValue"
+                :min="0"
+                @blur="profitBlur($event, 2)"
+                placeholder="请输入利润(%)"
+                :max="100"
+                label=""
                 ></el-input-number>
               </el-form-item>
             </el-col>
             <el-col :span="12">
-              <el-form-item label="支出方资金归属" prop="outFlag">
+              <el-form-item label="收入方资金归属" prop="entProfit">
                 <el-select
-                  v-model="profitObj.outProfitName"
+                  v-model="profitObj.entProfitName"
                   filterable
-                  @change="profitChange($event, 2)"
+                  @change="profitChange($event, 1)"
                   placeholder=""
                 >
                   <el-option
                     v-for="(item, index) in affiliationData"
-                    :key="item.profitId + 'out' + index"
+                    :key="item.profitId + 'ent' + index"
                     :label="item.profitName"
                     :value="item.profitEng"
                   >
                   </el-option>
                 </el-select>
                 <el-input-number
-                  v-model="profitObj.outProfitValue"
+                  v-model="profitObj.entProfitValue"
                   :min="0"
-                  @blur="profitBlur($event, 2)"
+                  @blur="profitBlur($event, 1)"
                   placeholder="请输入利润(%)"
                   :max="100"
                   label=""

+ 23 - 23
src/views/FinancialManagement/ExpenseManagement/ExpenseComponent.vue

@@ -427,29 +427,29 @@ export default {
         accountName: [
           { required: true, message: "户名不能为空", trigger: "blur" },
         ],
-        businessQuality: [
-          { required: true, message: "请选择营业性质", trigger: "change" },
-        ],
-        owned: [
-          { required: true, message: "所属地不能为空", trigger: "change" },
-        ],
-        juridicalPerson: [
-          { required: true, message: "法人不能为空", trigger: "change" },
-        ],
-        establishTime: [
-          {
-            required: true,
-            message: "请选择成立日期",
-            trigger: "change",
-          },
-        ],
-        biller: [
-          {
-            required: true,
-            message: "开票员不能为空",
-            trigger: "blur",
-          },
-        ],
+        // businessQuality: [
+        //   { required: true, message: "请选择营业性质", trigger: "change" },
+        // ],
+        // owned: [
+        //   { required: true, message: "所属地不能为空", trigger: "change" },
+        // ],
+        // juridicalPerson: [
+        //   { required: true, message: "法人不能为空", trigger: "change" },
+        // ],
+        // establishTime: [
+        //   {
+        //     required: true,
+        //     message: "请选择成立日期",
+        //     trigger: "change",
+        //   },
+        // ],
+        // biller: [
+        //   {
+        //     required: true,
+        //     message: "开票员不能为空",
+        //     trigger: "blur",
+        //   },
+        // ],
       },
       interiorRules: {
         //卡表单规则

+ 2 - 2
src/views/FinancialManagement/ExpenseManagement/ExpenseManagement.vue

@@ -361,10 +361,10 @@
         </el-row>
         <el-row>
           <el-col :span="12" style="text-align: center"
-            ><h3>收入方资金归属</h3></el-col
+            ><h3>收入方资金归属(%)</h3><span>(请输入资金归属百分比)</span></el-col
           >
           <el-col :span="12" style="text-align: center"
-            ><h3>支出方资金归属</h3></el-col
+            ><h3>支出方资金归属(%)</h3><span>(请输入资金归属百分比)</span></el-col
           >
         </el-row>
         <el-row class="profit_box">

+ 69 - 31
src/views/FinancialManagement/ExpenseManagement/PaymentManagement.vue

@@ -115,12 +115,15 @@
       :columns="columns"
       :showBatchDelete="false"
       :showOperation="true"
-      editButtonName="编辑"
+      editButtonName="进账"
       button3Name="撤销"
+      button2Name="编辑"
       button3Icon="fa fa-trash"
       button3Background="#f56c6c"
+      button2Background="#E6A23C"
       @handleButton3="handleTableDelete"
-      @handleEdit="handleDetail"
+      @handleButton2="handleDetail($event, 1)"
+      @handleEdit="handleDetail($event, 2)"
       @findPage="findPage"
       :isshowpagination="true"
     ></kt-common-table>
@@ -142,7 +145,7 @@
           size="small"
           :class="formDataId ? 'data_form' : 'frame data_form'"
         >
-          <div v-if="!formDataId">
+          <div v-if="!formDataId || (typeStatus == 1 && formDataId)">
             <el-row>
               <el-col :span="12">
                 <el-form-item label="开票方" prop="invoiceBy">
@@ -293,7 +296,7 @@
               </el-col>
             </el-row>
           </div>
-          <div v-else>
+          <div v-if="typeStatus == 2 && formDataId">
             <el-row>
               <el-col :span="12">
                 <el-form-item label="进账金额" prop="payoutMoney">
@@ -392,10 +395,12 @@
             </el-row> -->
             <el-row>
               <el-col :span="12" style="text-align: center"
-                ><h3>收入方资金归属</h3></el-col
+                ><h3>收入方资金归属(%)</h3>
+                <span>(请输入资金归属百分比)</span></el-col
               >
               <el-col :span="12" style="text-align: center"
-                ><h3>支出方资金归属</h3></el-col
+                ><h3>支出方资金归属(%)</h3>
+                <span>(请输入资金归属百分比)</span></el-col
               >
             </el-row>
             <el-row class="profit_box">
@@ -481,7 +486,7 @@ export default {
       title: "开票新增",
       loading: true,
       detailDialog: false,
-      operationWidth: 200, //操作列宽度
+      operationWidth: 220, //操作列宽度
       queryFrom: {
         //查询条件
       },
@@ -642,6 +647,7 @@ export default {
       allCollectionData: [], //所有账户信息列表
       formDataId: "", //编辑数据id
       profitObj: {},
+      typeStatus: "", //1是编辑 2是进账
     };
   },
   watch: {
@@ -663,11 +669,11 @@ export default {
           rate: 0, //税率
           payMethod: [], //支付方式
         };
-        this.affiliationData.forEach(item=>{
-          item.profit = 0
+        this.affiliationData.forEach((item) => {
+          item.profit = 0;
         });
-        this.affiliationData2.forEach(item=>{
-          item.profit = 0
+        this.affiliationData2.forEach((item) => {
+          item.profit = 0;
         });
         this.formDataId = "";
         this.$nextTick(() => {
@@ -690,9 +696,9 @@ export default {
     getAffiliationData() {
       this.$api.expense.getList().then((res) => {
         if (res.code == 200) {
-          res.data.forEach(item=>{
-            item.profit = 0
-          })
+          res.data.forEach((item) => {
+            item.profit = 0;
+          });
           this.affiliationData = JSON.parse(JSON.stringify(res.data));
           this.affiliationData2 = JSON.parse(JSON.stringify(res.data));
         } else {
@@ -725,21 +731,21 @@ export default {
     //获取资金用途树数据
     getTreeList() {
       this.$api.expense.getAccountExpensesTreeList().then((res) => {
-        if(res.code == 200){
+        if (res.code == 200) {
           this.fundFlowData = res.data;
-          this.fundFlowSet()
-        }else{
+          this.fundFlowSet();
+        } else {
           this.$message.error(res.msg);
         }
       });
     },
     //资金用途数据转换     如果最后一项child数组长度为0把值变为null
-    fundFlowSet(data){
-      data = data || this.fundFlowData
-      for(var i = 0; i <data.length;i++) {
-        if(data[i].child.length){
-          this.fundFlowSet(data[i].child)
-        }else{
+    fundFlowSet(data) {
+      data = data || this.fundFlowData;
+      for (var i = 0; i < data.length; i++) {
+        if (data[i].child.length) {
+          this.fundFlowSet(data[i].child);
+        } else {
           data[i].child = null;
         }
       }
@@ -827,11 +833,12 @@ export default {
       let params = JSON.parse(JSON.stringify(this.formData));
       this.$refs.formData.validate((valid) => {
         if (valid) {
-          if (this.formDataId) {
+          //进账
+          if (this.formDataId && this.typeStatus == 2) {
             //转化资金归属
             params.entProfit = {};
             params.outProfit = {};
-            this.affiliationData.forEach((item) => { 
+            this.affiliationData.forEach((item) => {
               params.entProfit[item.profitEng] = item.profit;
             });
             this.affiliationData2.forEach((item) => {
@@ -846,8 +853,8 @@ export default {
               fundUse: this.formData.fundUse[this.formData.fundUse.length - 2], //资金用途
               fundFen: this.formData.fundUse[this.formData.fundUse.length - 1], //资金用途分项
               payoutTime: params.payoutTime, //进账日期
-              entProfit:params.entProfit, //收入方资金归属
-              outProfit:params.outProfit, //支出方资金归属
+              entProfit: params.entProfit, //收入方资金归属
+              outProfit: params.outProfit, //支出方资金归属
             };
             this.$api.expense.putInvAccountIncoice(obj).then((res) => {
               if (res.code == 200) {
@@ -857,6 +864,26 @@ export default {
                 this.$message.error(res.msg);
               }
             });
+            //编辑
+          } else if (this.formDataId && this.typeStatus == 1) {
+            params.invoiceBy = this.formData.invoiceBy.nameValue; //开票方
+            params.bigApplyAmount = toChies(params.invoiceMoney); //大写金额
+            params.invoiceSubjects =
+              params.invoiceSubjects1 + "*" + params.invoiceSubjects2; //开票科目
+            params.otherUnit = params.otherUnit.nameValue; //对方单位名称
+            params.company = params.otherUnit; //单位
+            delete params.payMethod;
+            delete params.payoutTime;
+            console.log(params);
+            this.$api.expense.updateIncoice(params).then((res) => {
+              if (res.code == 200) {
+                this.detailDialog = false;
+                this.findPage();
+              } else {
+                this.$message.error(res.msg);
+              }
+            });
+            //新增
           } else {
             params.invoiceBy = this.formData.invoiceBy.nameValue; //开票方
             params.bigApplyAmount = toChies(params.invoiceMoney); //大写金额
@@ -907,10 +934,11 @@ export default {
       this.detailParams.pageSize = 10;
     },
     //编辑按钮
-    handleDetail(index) {
+    handleDetail(index, type) {
+      this.typeStatus = type;
       let row = index.row;
       this.formDataId = row.invoiceId;
-      this.title = "开票编辑";
+      this.title = type == 1 ? "开票编辑" : "开票进账";
       this.getDetailData(row.invoiceId);
       this.detailDialog = true;
     },
@@ -919,12 +947,22 @@ export default {
       this.$api.expense.detailInvAccountIncoice(id).then((res) => {
         if (res.code == 200) {
           let obj = this.collectionData.find(
-            (item) => item.bankCardNum == res.data.bankCardNum
+            (item) => item.bankCardNum == res.data.revBankCardNum
+          );
+          let obj2 = this.collectionData.find(
+            (item) => item.bankCardNum == res.data.outBankCardNum
           );
           if (obj) {
             res.data.invoiceBy = obj;
           }
-          this.formData = res.data;
+          if (obj2) {
+            res.data.otherUnit = obj;
+          }
+          if (this.typeStatus == 1) {
+            res.data.invoiceSubjects1 = res.data.invoiceSubjects.split('*')[0]
+            res.data.invoiceSubjects2 = res.data.invoiceSubjects.split('*')[1]
+          }
+          this.formData = JSON.parse(JSON.stringify(res.data));
         } else {
           this.$message.error(res.msg);
         }