| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055 |
- <template>
- <!--布局容器-->
- <div class="container" style="width: 99%; margin-top: 0px">
- <!-- 顶部查询 -->
- <el-row class="top">
- <el-form v-model="queryFrom" size="small" label-width="95px" class="form">
- <el-form-item label="账户类别" label-width="95px" prop="outerFlag">
- <el-select
- v-model="queryFrom.outerFlag"
- placeholder="请选择账户类别"
- clearable
- >
- <el-option label="内部账户" value="0"></el-option>
- <el-option label="外部账户" value="1"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="账户性质" label-width="95px" prop="accountQuality">
- <el-select
- v-model="queryFrom.accountQuality"
- placeholder="请选择账户性质"
- clearable
- >
- <el-option
- v-for="item in account_qualityData"
- :key="item.value + 'aa'"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="户名" label-width="95px" prop="invCompanyName">
- <el-input
- v-model="queryFrom.accountName"
- placeholder="请输入户名"
- class="widths"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item label="银行卡号" label-width="95px" prop="invCompanyName">
- <el-input
- v-model="queryFrom.bankCardNum"
- placeholder="请输入银行卡号"
- class="widths"
- clearable
- ></el-input>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" size="small" @click="queryStaffInfo"
- >查询</el-button
- >
- </el-form-item>
- </el-form>
- </el-row>
- <!-- 新增 -->
- <el-button
- class="operation"
- type="primary"
- plain
- size="medium"
- @click="addAmount"
- >新增账户</el-button
- >
- <!-- 表格 -->
- <kt-common-table
- :operationWidth="operationWidth"
- class="ktTable"
- permsEdit="sys:agent:view"
- ref="dataTable"
- :data="pageResult"
- :columns="columns"
- :showBatchDelete="false"
- :showOperation="true"
- editButtonName="修改"
- :button3Name="button3Name"
- :button2Name="button2Name"
- :button1Name="button1Name"
- button2Background="#92D050"
- button3Background="#f56c6c"
- button1Icon="el-icon-s-finance"
- button2Icon="el-icon-s-ticket"
- button3Icon="fa fa-trash"
- @handleButton3="handleTableDelete"
- @handleButton2="handleTableIncome"
- @handleButton1="handleTableExpend"
- @findPage="findPage"
- @handleEdit="handleTableEdit"
- :isshowpagination="true"
- ></kt-common-table>
- <!-- 新增修改弹框 -->
- <expense-component
- ref="expenseComponent"
- :formData="formData"
- :formDataId="formDataId"
- :title="title"
- :dialogFormVisible="dialogFormVisible"
- @resetForm="resetForm"
- @submitForm="submitForm"
- @setDateInterval="setDateInterval"
- @outChange="outChange"
- ></expense-component>
- <!-- 支出弹框 -->
- <el-dialog
- class="dialog expendDialog"
- title="支出信息"
- :close-on-click-modal="false"
- :before-close="expendResetForm"
- :visible.sync="expendDialogVisible"
- width="60%"
- >
- <!-- 支出表格 -->
- <kt-common-table
- :operationWidth="130"
- class="ktTable expendTable"
- ref="expendTable"
- :data="expendPageResult"
- :columns="expendColumns"
- :showBatchDelete="false"
- :showOperation="true"
- :button1Name="expendButton1Name"
- button2Background="#92D050"
- button3Background="#f56c6c"
- button1Icon="el-icon-s-finance"
- @handleButton1="handleTableConfirm"
- @findPage="getExpendData"
- :isshowpagination="true"
- ></kt-common-table>
- </el-dialog>
- <!-- 收入弹框 -->
- <el-dialog
- class="dialog expendDialog"
- title="收入信息"
- :close-on-click-modal="false"
- :before-close="incomeResetForm"
- :visible.sync="incomeDialogVisible"
- width="60%"
- >
- <el-form
- :model="inComeFormData"
- :rules="inComeFormRules"
- ref="inComeFormData"
- label-width="130px"
- size="small"
- class="inComeForm"
- >
- <el-row>
- <el-col :span="12">
- <el-form-item label="转账方" prop="company">
- <el-select
- v-model="inComeFormData.company"
- filterable
- placeholder=""
- @change="companyChange"
- >
- <el-option
- v-for="item in collectionData"
- :key="item.accountId"
- :label="item.name"
- :value="item.nameValue"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="收款方" prop="collectionMessage">
- <el-input
- disabled
- v-model="inComeFormData.collectionMessage"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="金额" prop="outerFlag">
- <el-input-number
- v-model="inComeFormData.applyAmount"
- :min="0"
- :precision="2"
- @blur="chageAppl"
- :max="99999999999999999"
- label=""
- ></el-input-number>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="大写金额" prop="bigApplyAmount">
- <el-input
- v-model="inComeFormData.bigApplyAmount"
- disabled
- autocomplete="off"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row class="collec">
- <el-col :span="24">
- <el-form-item label="资金流向" style="width: 100%">
- <el-input
- v-model="inComeFormData.company"
- disabled
- autocomplete="off"
- ></el-input>
- <i class="el-icon-right"></i>
- <el-input
- disabled
- v-model="inComeFormData.collectionMessage"
- autocomplete="off"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12"> </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="备注" prop="remark">
- <el-select v-model="inComeFormData.remark" placeholder="">
- <el-option
- v-for="item in use_fundsData"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="incomeResetForm()" size="small">取 消</el-button>
- <el-button type="primary" @click="submitIncomeForm()" size="small"
- >确 定</el-button
- >
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
- import KtButton from "@/views/Core/KtButton"; // 按钮权限组件
- import ExpenseComponent from "./ExpenseComponent.vue"; //新增账户信息弹框
- import {toChies} from '../../../utils/moneyTransition';
- export default {
- name: "ExpenseManagement",
- components: { KtCommonTable, KtButton, ExpenseComponent },
- created() {
- this.business("account_quality"); //账户性质字典;
- this.business("use_funds"); //备注字典
- },
- mounted() {},
- data() {
- return {
- /**
- * 账户收入模块
- */
- incomeDialogVisible: false, //收入弹出框状态
- collectionData: [], //收入form表单 转账方下拉菜单数组
- use_fundsData: [], //收入form表单 备注字典数据
- inComeFormData: {
- //收入form表单
- collectionMessage: "", //收款名字
- fundFlow: "", //资金流向
- applyAmount: "", //金额
- bigApplyAmount: "", //大写金额
- remark: "", //备注
- company: "", //转账方
- },
- inComeFormRules: {
- //收入form表单规则
- company: [
- { required: true, message: "转账方不能为空", trigger: "change" },
- ],
- remark: [{ required: true, message: "请选择备注", trigger: "change" }],
- },
- enterAccountId: "", //点击收入按钮当条数据收入id
- /**
- * 账户模块
- */
- title: "新增账户信息",
- dialogFormVisible: false, //弹出框状态
- operationWidth: 200, //操作列宽度
- account_qualityData: [], //账户性质数据字典
- queryFrom: {//查询条件
- accountQuality: "", //账户性质查询
- bankCardNum: "", //银行卡号查询
- accountName: "", //户名查询
- },
- button1Name: "支出", //按钮内容
- button3Name: "删除",
- button2Name: "收入",
- expendButton1Name: "确认已转账",
- pageResult: {}, //表格内容分页参数
- formDataId: "", //数据Id
- pageRequest: {
- // 列表查询条件
- pageNo: 1,
- pageSize: 10,
- },
- // 数据列
- columns: [
- {
- prop: "outerFlagName",
- label: "账户类别",
- minWidth: 70,
- sortable: false,
- },
- {
- prop: "accountQualityName",
- label: "账户性质",
- minWidth: 70,
- sortable: false,
- },
- {
- prop: "yy",
- label: "营业性质",
- minWidth: 70,
- sortable: false,
- },
- {
- prop: "ss",
- label: "所属地",
- minWidth: 70,
- sortable: false,
- },
- {
- prop: "fr",
- label: "法人",
- minWidth: 70,
- sortable: false,
- },
- {
- prop: "clrq",
- label: "成立日期",
- minWidth: 70,
- sortable: false,
- },
- {
- prop: "accountName",
- label: "户名",
- minWidth: 160,
- sortable: false,
- },
- {
- prop: "bankCardNum",
- label: "银行卡号",
- minWidth: 170,
- sortable: false,
- },
- { prop: "bank", label: "开户行", minWidth: 100, sortable: false },
- {
- prop: "bankName",
- label: "开户行名称",
- minWidth: 190,
- sortable: false,
- },
- { prop: "bankNum", label: "开户行号", minWidth: 150, sortable: false },
- {
- prop: "balance",
- label: "余额",
- minWidth: 100,
- sortable: false,
- },
- {
- prop: "startCertExpirationDate",
- label: "证书有效开始日期",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "endCertExpirationDate",
- label: "证书有效结束日期",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "clearingProfit",
- label: "结算卡",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "dayStrokeNum",
- label: "单日转账笔数限制",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "exteriorProfit",
- label: "外部过账金额",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "fiscalProfit",
- label: "财税公司利润",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "insuranceProfit",
- label: "保险公司回款",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "otherProfit",
- label: "其他利润",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "parkProfit",
- label: "园区利润",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "priDayLines",
- label: "对私单日限额",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "priSingleLines",
- label: "对私单笔限额",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "priYearExcess",
- label: "对私年剩余额度",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "priYearLines",
- label: "对私年额度",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "pubDayLines",
- label: "对公单日限额",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "pubSingleLines",
- label: "对公单笔限额",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "pubYearExcess",
- label: "对公年剩余额度",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "pubYearLines",
- label: "对公年额度",
- minWidth: 120,
- sortable: false,
- },
- {
- prop: "tianqinProfit",
- label: "天勤利润",
- minWidth: 120,
- sortable: false,
- },
- ],
- formData: {//账户form表单
- outerFlag: "0", //账户类别
- accountName: "", //户名
- accountQuality: "", //账户性质
- bankCardNum: "", //银行卡号
- bank: "", //开户行
- bankName: "", //开户行名称
- bankNum: "", //开户行号
- certExpirationDate: "", //证书有效期
- clearingProfit: "", //结算卡
- dayStrokeNum: "", //单日转账笔数限制
- exteriorProfit: "", //外部过账金额
- fiscalProfit: "", //财税公司利润
- insuranceProfit: "", //保险公司回款
- otherProfit: "", //其他利润
- parkProfit: "", //园区利润
- priDayLines: "", //对私单日限额
- priSingleLines: "", //对私单笔限额
- priYearExcess: "", //对私年剩余额度
- priYearLines: "", //对私年额度
- pubDayLines: "", //对公单日限额
- pubSingleLines: "", //对公单笔限额
- pubYearExcess: "", //对公年剩余额度
- pubYearLines: "", //对公年额度
- tianqinProfit: "", //天勤利润
- },
- /**
- * 支出模块
- */
- expendColumns: [// 支出数据列
- {
- prop: "company",
- label: "转账方",
- minWidth: 160,
- sortable: false,
- },
- {
- prop: "collectionMessage",
- label: "收账方",
- minWidth: 80,
- sortable: false,
- },
- {
- prop: "applyAmount",
- label: "金额",
- minWidth: 150,
- sortable: false,
- },
- {
- prop: "applyTime",
- label: "转账日期",
- minWidth: 150,
- sortable: false,
- },
- {
- prop: "transferFlagName",
- label: "转账状态",
- minWidth: 150,
- sortable: false,
- },
- ],
- expendPageResult: {
- //支出表格参数
- pageNo: 1,
- pageSize: 10,
- },
- expendDialogVisible: false, //支出弹出框状态
- expendOutAccountId: "", //点击支出按钮当条数据支出id
- companyItem: {}, //选择单位整条数据
- };
- },
- watch: {
- expendDialogVisible(n) {
- if (n == false) {
- this.expendOutAccountId = "";
- }
- },
- //收入去除form表单信息
- incomeDialogVisible(n) {
- if (n == false) {
- this.enterAccountId = "";
- this.$refs.inComeFormData.clearValidate();
- this.inComeFormData = {
- //收入form数据
- collectionMessage: "", //收款名字
- fundFlow: "", //资金流向
- applyAmount: "", //金额
- bigApplyAmount: "", //大写金额
- remark: "", //备注
- company: "", //转账方
- };
- }
- },
- },
- methods: {
- //申请金额填写完成后
- chageAppl(e) {
- this.inComeFormData.bigApplyAmount = toChies(
- this.inComeFormData.applyAmount
- );
- },
- //获取所有外部账户信息
- getAllUser() {
- this.$api.expense.getAccountByAccountName().then((res) => {
- if (res.code == 200) {
- let outArr = res.data.filter((item) => item.outerFlag == 1);
- outArr.forEach((item, index) => {
- item.name =
- (item.accountQuality == 0 ? "公户" : "私户") +
- " " +
- item.accountName +
- " " +
- item.bankCardNum +
- " " +
- item.bank;
- item.nameValue =
- item.accountName + " " + item.bankCardNum + " " + item.bank;
- });
- this.collectionData = outArr;
- }
- });
- },
- //选择收款单位change事件
- companyChange(val) {
- const item = this.collectionData.find((item) => item.accountId === val);
- this.companyItem = item;
- },
- //选择账户类别
- outChange(e) {
- if (e == 1) {
- this.formData = {
- outerFlag: e, //账户类别
- accountName: this.formData.accountName, //户名
- accountQuality: this.formData.accountQuality, //账户性质
- bankCardNum: this.formData.bankCardNum, //银行卡号
- bank: this.formData.bank, //开户行
- };
- } else {
- this.formData = {
- outerFlag: e, //账户类别
- accountName: this.formData.accountName, //户名
- accountQuality: this.formData.accountQuality, //账户性质
- bankCardNum: this.formData.bankCardNum, //银行卡号
- bank: this.formData.bank, //开户行
- bankName: "", //开户行名称
- bankNum: "", //开户行号
- certExpirationDate: "", //证书有效期
- clearingProfit: "", //结算卡
- dayStrokeNum: "", //单日转账笔数限制
- exteriorProfit: "", //外部过账金额
- fiscalProfit: "", //财税公司利润
- insuranceProfit: "", //保险公司回款
- otherProfit: "", //其他利润
- parkProfit: "", //园区利润
- priDayLines: "", //对私单日限额
- priSingleLines: "", //对私单笔限额
- priYearExcess: "", //对私年剩余额度
- priYearLines: "", //对私年额度
- pubDayLines: "", //对公单日限额
- pubSingleLines: "", //对公单笔限额
- pubYearExcess: "", //对公年剩余额度
- pubYearLines: "", //对公年额度
- tianqinProfit: "", //天勤利润
- };
- }
- },
- //点击确认收入事件
- submitIncomeForm() {
- let obj = JSON.parse(JSON.stringify(this.inComeFormData));
- obj.enterAccountId = this.enterAccountId;
- obj.fundFlow = obj.company + "→" + obj.collectionMessage;
- this.$refs.inComeFormData.validate((valid) => {
- if (valid) {
- this.$api.expense.insertAccountOperate(obj).then((res) => {
- this.incomeDialogVisible = false;
- if (res.code == 200) {
- this.$message.success("添加成功!");
- } else {
- this.$message.success(res.msg);
- }
- });
- } else {
- return false;
- }
- });
- },
- //点击页面收入按钮
- handleTableIncome(e) {
- if (e.row.outerFlag == 1) {
- this.$message.error("请选择内部账户");
- return;
- }
- this.getAllUser();
- this.enterAccountId = e.row.accountId;
- this.inComeFormData.collectionMessage =
- e.row.accountName + " " + e.row.bankCardNum + " " + e.row.bank;
- this.incomeDialogVisible = true;
- },
- //点击页面支出按钮
- handleTableExpend(e) {
- if (e.row.outerFlag == 1) {
- this.$message.error("请选择内部账户");
- return;
- }
- this.expendDialogVisible = true;
- this.expendOutAccountId = e.row.accountId;
- this.getExpendData();
- },
- //获取支出信息列表
- getExpendData(data) {
- if (data && data.pageRequest) {
- this.expendPageResult.pageNo = data.pageRequest.pageNum;
- this.expendPageResult.pageSize = data.pageRequest.pageSize;
- }
- let obj = {
- pageNo: this.expendPageResult.pageNo,
- pageSize: this.expendPageResult.pageSize,
- transferFlag: 1,
- outAccountId: this.expendOutAccountId,
- };
- this.$api.expense
- .getAccountExcel(obj)
- .then((res) => {
- res.data.records.forEach((element) => {
- element.transferFlagName =
- element.transferFlag == 0 ? "已转账" : "未转账";
- this.use_fundsData.forEach((item) => {
- if (element.remark == item.value) {
- element.remarkName = item.label;
- }
- });
- });
- this.expendPageResult = {
- content: res.data.records,
- pageNum: res.data.current,
- pageSize: res.data.size,
- totalPages: res.data.pages,
- totalSize: res.data.total,
- };
- })
- .then(data != null ? data.callback : "");
- },
- //弹框确认支出按钮事件
- handleTableConfirm(index) {
- this.$confirm("确认把该条数据设为已转账状态吗?", "提示", {
- type: "warning",
- })
- .then(() => {
- this.$api.expense
- .updateTransferFlag(index.row.excelAccountOperateId)
- .then((res) => {
- if (res.code == 200) {
- this.$message.success("确认转账成功");
- this.getExpendData();
- } else {
- this.$message.error(res.msg);
- }
- });
- })
- .catch(() => {});
- },
- //选择证书有效日期区间
- setDateInterval(e) {
- if (e != null && e != "") {
- this.formData.startCertExpirationDate = e[0];
- this.formData.endCertExpirationDate = e[1];
- } else {
- this.formData.startCertExpirationDate = "";
- this.formData.endCertExpirationDate = "";
- }
- },
- //获取支出页面列表数据
- expendFindPage(data) {},
- //获取页面列表数据
- findPage(data) {
- if (data && data.pageRequest) {
- this.pageRequest.pageNo = data.pageRequest.pageNum;
- this.pageRequest.pageSize = data.pageRequest.pageSize;
- }
- let obj = { ...this.queryFrom, ...this.pageRequest };
- this.$api.expense
- .getAccount(obj)
- .then((res) => {
- console.log(res)
- res.data.records.forEach((element) => {
- element.outerFlagName =
- element.outerFlag == 0 ? "内部账户" : "外部账户";
- element.accountQualityName = this.dictFn(element, 1); //转化账户性质跟账户性别
- });
- this.pageResult = {
- content: res.data.records,
- pageNum: res.data.current,
- pageSize: res.data.size,
- totalPages: res.data.pages,
- totalSize: res.data.total,
- };
- })
- .then(data != null ? data.callback : "");
- },
- //数据字典
- business(typeName) {
- this.$api.dict.findByLableName(typeName).then((res) => {
- // this.account_qualityData = res.data;
- this[typeName + "Data"] = res.data;
- });
- },
- //用户性质转换
- dictFn(obj, type) {
- if(obj.accountQuality==null){
- return
- }
- if (type == 1) {
- return this.account_qualityData.find(
- (item) => item.value == obj.accountQuality
- ).label;
- } else {
- return this.account_qualityData.find(
- (item) => item.label == obj.accountQuality
- ).value;
- }
- },
- // 查询
- queryStaffInfo() {
- this.findPage();
- },
- //新增事件
- addAmount() {
- this.title = "新增账户信息";
- this.dialogFormVisible = true;
- },
- //删除数据事件
- handleTableDelete(index) {
- this.$confirm("确认删除该记录吗?", "提示", {
- type: "warning",
- })
- .then(() => {
- this.$api.expense.deleteAccount(index.row.accountId).then((res) => {
- if (res.code == 200) {
- this.$message.success("删除成功");
- this.findPage();
- } else {
- this.$message.error(res.msg);
- }
- });
- })
- .catch(() => {});
- },
- //收入弹框取消重置
- incomeResetForm() {
- this.incomeDialogVisible = false;
- },
- //支出弹框取消重置
- expendResetForm() {
- this.expendDialogVisible = false;
- },
- //弹框取消重置
- resetForm() {
- this.dialogFormVisible = false;
- this.formDataId = "";
- this.formData = {
- outerFlag: "0", //账户类别
- accountName: "", //户名
- accountQuality: "", //账户性质
- bankCardNum: "", //银行卡号
- bank: "", //开户行
- bankName: "", //开户行名称
- bankNum: "", //开户行号
- certExpirationDate: "", //证书有效期
- clearingProfit: "", //结算卡
- dayStrokeNum: "", //单日转账笔数限制
- exteriorProfit: "", //外部过账金额
- fiscalProfit: "", //财税公司利润
- insuranceProfit: "", //保险公司回款
- otherProfit: "", //其他利润
- parkProfit: "", //园区利润
- priDayLines: "", //对私单日限额
- priSingleLines: "", //对私单笔限额
- priYearExcess: "", //对私年剩余额度
- priYearLines: "", //对私年额度
- pubDayLines: "", //对公单日限额
- pubSingleLines: "", //对公单笔限额
- pubYearExcess: "", //对公年剩余额度
- pubYearLines: "", //对公年额度
- tianqinProfit: "", //天勤利润
- };
- },
- //修改
- handleTableEdit(index) {
- let row = index.row;
- this.formDataId = row.accountId;
- this.$api.expense.getAccountById(this.formDataId).then((res) => {
- if (res.code == 200) {
- this.formData = JSON.parse(JSON.stringify(res.data));
- if (
- res.data.startCertExpirationDate &&
- res.data.endCertExpirationDate
- ) {
- this.formData.certExpirationDate = [
- res.data.startCertExpirationDate,
- res.data.endCertExpirationDate,
- ];
- }
- } else {
- this.$message.error(res.msg);
- }
- });
- this.title = "编辑账户信息";
- this.dialogFormVisible = true;
- },
- //提交
- submitForm() {
- let params = JSON.parse(JSON.stringify(this.formData));
- delete params.certExpirationDate;
- if (this.formDataId) {
- //修改
- params.accountId = this.formDataId;
- this.$api.expense.updateAccoount(params).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "修改成功",
- type: "success",
- });
- } else {
- this.$message({
- message: `修改失败, ${res.msg}`,
- type: "error",
- });
- }
- this.findPage();
- this.resetForm();
- });
- } else {
- //新增
- this.$api.expense.insertAccount(params).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "添加成功",
- type: "success",
- });
- } else {
- this.$message({
- message: `添加失败, ${res.msg}`,
- type: "error",
- });
- }
- this.findPage();
- this.resetForm();
- });
- }
- },
- },
- };
- </script>
-
- <style scoped>
- .operation {
- margin-left: 14px !important;
- margin-top: 15px !important ;
- }
- .form {
- display: flex;
- margin-top: 14px;
- align-items: center;
- margin-left: -12px;
- margin-bottom: 20px;
- }
- .el-pagination {
- font-weight: normal;
- }
- .el-card__body {
- padding: 12px !important;
- }
- .footer .footerdiv {
- display: flex;
- align-items: center;
- }
- .container .el-form-item {
- margin-bottom: -14px !important;
- }
- .form .el-form-item__label {
- font-size: 15px !important;
- font-weight: 600 !important;
- }
- .ktTable {
- margin-top: 20px;
- }
- .el-row {
- margin-top: 18px;
- }
- .top {
- margin-top: 0px;
- }
- .el-date-editor--daterange.el-input__inner {
- width: 300px;
- }
- /deep/ .el-select--small {
- width: 100%;
- }
- .frame {
- width: 100%;
- background-color: #fff;
- padding: 20px;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- margin-bottom: 15px;
- border-radius: 6px;
- border: 1px solid #ebeef5;
- -webkit-transition: all 0.2s ease-in-out;
- transition: all 0.2s ease-in-out;
- -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- }
- /deep/ .el-dialog__body {
- overflow-y: scroll;
- max-height: 500px;
- }
- .addremove-box {
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 25px;
- margin-top: 10px;
- /* position: absolute;
- bottom:0;
- left: 0; */
- }
- .addremove-box > i {
- cursor: pointer;
- }
- .frame >>> .el-date-editor {
- width: 100%;
- }
- .frame .el-input-number--small {
- width: 200px;
- }
- .ktTable >>> .el-button span {
- margin-left: 0;
- }
- .expendTable >>> .bottomFixed {
- position: static;
- margin-top: 20px;
- }
- .expendTable >>> .el-table {
- height: 400px !important;
- }
- .expendDialog >>> .el-dialog__body {
- overflow-y: hidden !important;
- max-height: 500px;
- }
- .collec >>> .el-form-item__content {
- display: flex;
- align-items: center;
- }
- .inComeForm >>> .el-input-number__decrease,
- .inComeForm >>> .el-input-number__increase {
- display: none;
- }
- .inComeForm >>> .el-input-number {
- width: 100%;
- }
- .inComeForm >>> .el-input.is-disabled .el-input__inner {
- background-color: #fff;
- color: #606266;
- }
- .el-icon-right {
- margin: 0 10px;
- font-size: 20px;
- }
- .ktTable >>> .cell .el-button{
- width: 80px;
- }
- .expendDialog >>> .cell .el-button{
- width: auto;
- }
- </style>
-
|