yaoyao 2 лет назад
Родитель
Сommit
d070a755a6

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

@@ -381,4 +381,13 @@ export const deriveReport = (data) => {
         method: "post",
         data
     })
+}
+
+// 支出部分
+export const updateExpenditure = (params) => {
+    return axios({
+        url: '/accountExcel/updateTransferFlag',
+        method: "get",
+        params
+    })
 }

+ 7 - 0
src/http/moudules/insCompany.js

@@ -67,6 +67,13 @@ export const findAgreementByCompanyId = (data) => {
     data
   })
 }
+export const agreementListInternal = (data) => {
+  return axios({
+    url: '/plt/agreement/listInternal',
+    method: 'post',
+    data
+  })
+}
 
 // 编辑保险公司
 export const editCompany = (data) => {

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

@@ -63,7 +63,7 @@
         </el-form-item>
         <el-form-item label="金额" prop="applyTime">
           <el-input
-            v-model.number="queryFrom.applyAmount"
+            v-model="queryFrom.applyAmount"
             placeholder="请输入金额"
             clearable
           ></el-input>
@@ -102,6 +102,8 @@
       @handleButton1="expendDelete"
       @handleButton2="expendEdit($event, 2)"
       @selectionChange="selectionChange"
+      button3Name="支出"
+      @handleButton3="expendExpenditure($event)"
     ></kt-common-table>
     <!-- 申请资金弹框 -->
     <el-dialog
@@ -376,6 +378,31 @@
       @outChange="outChange"
       class="expense-component"
     ></expense-component> -->
+    <el-dialog
+      title="支出"
+      :close-on-click-modal="false"
+      :before-close="closeExpenditure"
+      :visible.sync="expenditureVisible"
+      width="30%"
+    >
+      <div>
+        <el-radio-group v-model="expendRadio">
+          <el-radio :label="0">全部</el-radio>
+          <el-radio :label="1">部分支出</el-radio>
+        </el-radio-group>
+        <el-input v-show="expendRadio" v-model="payOutAmount" placeholder="请输入支出金额" style="width: 200px;margin-left: 20px;" size="small"></el-input>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="closeExpenditure" size="small">取 消</el-button>
+        <el-button
+          v-if="!formDisable"
+          type="primary"
+          @click="submitFormExpend"
+          size="small"
+          >确定支出</el-button
+        >
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -398,11 +425,15 @@ export default {
       }
     };
     return {
+      expenditureRow: {},
+      payOutAmount: 0,    // 已转金额
+      expendRadio: 0,
+      expenditureVisible: false,
       formDisable: false, //资金申请form表单是否可选状态
       expentList: [], //批量导出数据
       expenseaaa: true,
       expendTitle: "新增资金使用申请单", //弹框标题
-      operationWidth: 250, //操作单元格宽度
+      operationWidth: 300, //操作单元格宽度
       queryFrom: {}, //查询form表单
       pageRequest: {
         // 列表查询条件
@@ -482,6 +513,12 @@ export default {
           minWidth: 150,
           sortable: false,
         },
+        {
+          prop: "payoutAmount",
+          label: "已转金额(元)",
+          minWidth: 120,
+          sortable: false,
+        },
         {
           prop: "company",
           label: "单位",
@@ -647,6 +684,44 @@ export default {
   },
   mounted() {},
   methods: {
+    // 确定支出
+    submitFormExpend() {
+      const num = this.expenditureRow.applyAmount - this.expenditureRow.payoutAmount
+      if (num == 0) {
+        this.$message.error('支出金额不足')
+        return
+      }
+      if (this.payOutAmount > num) {
+        this.$message.error('支出金额不足')
+        return
+      }
+      if (!this.expendRadio) {
+        this.payOutAmount = num
+      }
+      this.$api.expense.updateExpenditure({
+        excelAccountOperateId: this.expenditureRow.excelAccountOperateId,
+        payOutAmount: this.payOutAmount
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('支出成功')
+          this.queryStaffInfo()
+          this.closeExpenditure()
+        } else {
+          this.$message.error(res.msg)
+        }
+      })
+    },
+    closeExpenditure() {
+      this.expenditureRow = {}
+      this.payOutAmount = 0
+      this.expendRadio = 0
+      this.expenditureVisible = false
+    },
+    // 支出
+    expendExpenditure(e) {
+      this.expenditureRow = e.row
+      this.expenditureVisible = true
+    },
     //表格多选事件
     selectionChange(e) {
       this.expentList = e.selections.map((item) => item.excelAccountOperateId);

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

@@ -96,7 +96,7 @@
       <kt-common-table :operationWidth="130" class="ktTable expendTable" ref="expendTable" :data="expendPageResult"
         :columns="expendColumns" :showBatchDelete="false" :showOperation="true" :button1Name="expendButton1Name"
         permsButton1="expenseManagement:accountInformation:changeStatus" button2Background="#92D050"
-        button3Background="#f56c6c" button1Icon="el-icon-s-finance" @handleButton1="handleTableConfirm"
+        button3Background="#f56c6c" button1Icon="el-icon-s-finance" @handleButton1="handleTableConfirm($event)"
         @findPage="getExpendData" :isshowpagination="true"></kt-common-table>
     </el-dialog>
     <!-- 收入弹框 -->
@@ -194,6 +194,31 @@
         <el-button type="primary" @click="submitIncomeForm()" size="small">确 定</el-button>
       </div>
     </el-dialog>
+    <el-dialog
+      title="支出"
+      :close-on-click-modal="false"
+      :before-close="closeExpenditure"
+      :visible.sync="expenditureVisible"
+      width="30%"
+    >
+      <div>
+        <el-radio-group v-model="expendRadio">
+          <el-radio :label="0">全部</el-radio>
+          <el-radio :label="1">部分支出</el-radio>
+        </el-radio-group>
+        <el-input v-show="expendRadio" v-model="payOutAmount" placeholder="请输入支出金额" style="width: 200px;margin-left: 20px;" size="small"></el-input>
+      </div>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="closeExpenditure" size="small">取 消</el-button>
+        <el-button
+          v-if="!formDisable"
+          type="primary"
+          @click="submitFormExpend"
+          size="small"
+          >确定支出</el-button
+        >
+      </div>
+    </el-dialog>
   </div>
 </template>
 <script>
@@ -214,6 +239,10 @@ export default {
   mounted() { },
   data() {
     return {
+      expenditureRow: {},
+      payOutAmount: 0,    // 已转金额
+      expendRadio: 0,
+      expenditureVisible: false,
       type: 1, //1为账户信息,2为卡信息 账户和卡判断条件
       /**
        * 账户收入模块
@@ -811,25 +840,60 @@ export default {
         })
         .then(data != null ? data.callback : "");
     },
-    //弹框确认支出按钮事件
-    handleTableConfirm(index) {
-      this.$confirm("确认把该条数据设为已转账状态吗?", "提示", {
-        type: "warning",
+    // 确定支出
+    submitFormExpend() {
+      const num = this.expenditureRow.applyAmount - this.expenditureRow.payoutAmount
+      if (num == 0) {
+        this.$message.error('支出金额不足')
+        return
+      }
+      if (this.payOutAmount > num) {
+        this.$message.error('支出金额不足')
+        return
+      }
+      if (!this.expendRadio) {
+        this.payOutAmount = num
+      }
+      this.$api.expense.updateExpenditure({
+        excelAccountOperateId: this.expenditureRow.excelAccountOperateId,
+        payOutAmount: this.payOutAmount
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('支出成功')
+          this.queryStaffInfo()
+          this.closeExpenditure()
+        } else {
+          this.$message.error(res.msg)
+        }
       })
-        .then(() => {
-          this.$api.expense
-            .updateTransferFlag(index.row.excelAccountOperateId)
-            .then((res) => {
-              if (res.code == 200) {
-                this.$message.success("确认转账成功");
-                this.getExpendData();
-                this.findPage();
-              } else {
-                this.$message.error(res.msg);
-              }
-            });
-        })
-        .catch(() => { });
+    },
+    closeExpenditure() {
+      this.expenditureRow = {}
+      this.payOutAmount = 0
+      this.expendRadio = 0
+      this.expenditureVisible = false
+    },
+    //弹框确认支出按钮事件
+    handleTableConfirm(e) {
+      this.expenditureRow = e.row
+      this.expenditureVisible = true
+      // this.$confirm("确认把该条数据设为已转账状态吗?", "提示", {
+      //   type: "warning",
+      // })
+      //   .then(() => {
+      //     this.$api.expense
+      //       .updateTransferFlag(index.row.excelAccountOperateId)
+      //       .then((res) => {
+      //         if (res.code == 200) {
+      //           this.$message.success("确认转账成功");
+      //           this.getExpendData();
+      //           this.findPage();
+      //         } else {
+      //           this.$message.error(res.msg);
+      //         }
+      //       });
+      //   })
+      //   .catch(() => { });
     },
     //选择证书有效日期区间
     setDateInterval(e) {

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

@@ -45,9 +45,10 @@
         </el-form-item>
         <el-form-item label="金额" label-width="95px" prop="applyAmount">
           <el-input
-            v-model.number="pageRequest.applyAmount"
+            v-model="pageRequest.applyAmount"
             placeholder="请输入金额"
             clearable
+            type="number"
           ></el-input>
         </el-form-item>
       </el-form>
@@ -105,9 +106,15 @@ export default {
           minWidth: 80,
           sortable: false,
         },
+        {
+          prop: "applyTime",
+          label: "申请时间",
+          minWidth: 100,
+          sortable: false,
+        },
         {
           prop: "createTime",
-          label: "创建时间",
+          label: "交易时间",
           minWidth: 100,
           sortable: false,
         },

+ 8 - 0
src/views/FinancialManagement/ExpenseManagement/ViewExpenseReport.vue

@@ -46,6 +46,9 @@
         <el-form-item label="支出金额" prop="applyAmount">
           <el-input v-model="queryFrom.applyAmount" placeholder="请输入支出金额" class="widths" clearable></el-input>
         </el-form-item>
+        <el-form-item label="成本分类" prop="label">
+          <el-input v-model="queryFrom.label" placeholder="请输入成本分类" class="widths" clearable></el-input>
+        </el-form-item>
         <el-form-item>
           <kt-button label="查询" type="primary" @click="queryStaffInfo" />
           <kt-button label="批量导出" type="primary" :disabled="!this.expentList.length" @click="expendDataup" />
@@ -108,6 +111,11 @@ export default {
           label: "转账日期",
           sortable: false,
         },
+        {
+          prop: "label",
+          label: "成本分类",
+          sortable: false,
+        },
         {
           prop: "fundUse",
           label: "费用类型",