|
|
@@ -2,21 +2,30 @@
|
|
|
<div>
|
|
|
<div class="customer-head">
|
|
|
<div class="customer-back">
|
|
|
- <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
|
|
|
- @click="backToList(0)">返回列表
|
|
|
+ <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left" @click="backToList(0)"
|
|
|
+ >返回列表
|
|
|
</el-button>
|
|
|
</div>
|
|
|
<div class="add-customer-btn">
|
|
|
- <el-button class="el-button--small-yh" style="margin-right: 10px" type="primary" size="small"
|
|
|
- v-if="!editButton" @click="confirmEditing">编辑
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh"
|
|
|
+ style="margin-right: 10px"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ v-if="!editButton"
|
|
|
+ @click="confirmEditing"
|
|
|
+ >编辑
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="primary" size="small"
|
|
|
- :disabled="form.financeStatus == '已收款' || isSaveBtn" @click="editCustomer">保存数据
|
|
|
+ <el-button
|
|
|
+ class="el-button--small-yh"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ :disabled="form.financeStatus == '已收款' || isSaveBtn"
|
|
|
+ @click="editCustomer"
|
|
|
+ >保存数据
|
|
|
</el-button>
|
|
|
- <el-button class="el-button--small-yh" type="warning" :disabled="isFinanceBtn" size="small"
|
|
|
- @click="collection">{{
|
|
|
- form.financeStatus ==
|
|
|
- '已收款' ? '撤销收款' : '收款' }}
|
|
|
+ <el-button v-if="form.id" class="el-button--small-yh" type="warning" :disabled="isFinanceBtn" size="small" @click="collection"
|
|
|
+ >{{ form.financeStatus == "已收款" ? "撤销收款" : "收款" }}
|
|
|
</el-button>
|
|
|
<!-- <el-button class="el-button--small-yh" type="primary" size="small" v-if="form.id">启用
|
|
|
</el-button> -->
|
|
|
@@ -26,68 +35,127 @@
|
|
|
<trade-card title="基础信息">
|
|
|
<avue-form :option="optionForm" v-model="form" ref="form">
|
|
|
<tempalte slot="corpName" slot-scope="{ row }">
|
|
|
- <dic-select v-model="form.corpName" placeholder="客户" key="id" label="cname" res="records"
|
|
|
- url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH" :filterable="true" :remote="true"
|
|
|
- dataName="cname" @selectChange="dicChange('corpName', $event)"
|
|
|
- :disabled="optionForm.disabled"></dic-select>
|
|
|
+ <dic-select
|
|
|
+ v-model="form.corpName"
|
|
|
+ placeholder="客户"
|
|
|
+ key="id"
|
|
|
+ label="cname"
|
|
|
+ res="records"
|
|
|
+ url="/blade-sales-part/corpsDesc/list?current=1&size=10&corpType=KH"
|
|
|
+ :filterable="true"
|
|
|
+ :remote="true"
|
|
|
+ dataName="cname"
|
|
|
+ @selectChange="dicChange('corpName', $event)"
|
|
|
+ :disabled="optionForm.disabled"
|
|
|
+ ></dic-select>
|
|
|
</tempalte>
|
|
|
</avue-form>
|
|
|
</trade-card>
|
|
|
<trade-card title="明细信息">
|
|
|
- <avue-crud :option="optionContacts" v-model="formContacts" ref="formContacts" :data="form.settlementItemsList"
|
|
|
- @row-save="rowSave" @row-update="rowUpdate"
|
|
|
+ <avue-crud
|
|
|
+ :option="optionContacts"
|
|
|
+ v-model="formContacts"
|
|
|
+ ref="formContacts"
|
|
|
+ :data="form.settlementItemsList"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-update="rowUpdate"
|
|
|
@resetColumn="resetColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 267.1)"
|
|
|
- @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 267.1)">
|
|
|
+ @saveColumn="saveColumnTwo('formContacts', 'optionContacts', 'optionContactsBack', 267.1)"
|
|
|
+ >
|
|
|
<template slot-scope="scope" slot="menuLeft">
|
|
|
- <el-button type="primary" icon="el-icon-plus" :disabled="form.financeStatus == '已收款' || isMenu" size="small"
|
|
|
- @click="rowAdd()">选择订单</el-button>
|
|
|
+ <el-button type="primary" icon="el-icon-plus" :disabled="form.financeStatus == '已收款' || isMenu" size="small" @click="rowAdd()"
|
|
|
+ >选择订单</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="contractNumber">
|
|
|
- <span style="color: #409EFF;cursor: pointer" @click.stop="viewDocuments(row)">{{ row.contractNumber }}
|
|
|
- </span>
|
|
|
+ <span style="color: #409EFF;cursor: pointer" @click.stop="viewDocuments(row)">{{ row.contractNumber }} </span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="thisAmount">
|
|
|
- <el-input-number size="small" v-model="row.thisAmount" :precision="2" :controls="false"
|
|
|
- v-if="row.$cellEdit && row.businesType == 'XS'" @change="thisAmountChange(row)"
|
|
|
- :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ v-model="row.thisAmount"
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ v-if="row.$cellEdit && row.businesType == 'XS'"
|
|
|
+ @change="thisAmountChange(row)"
|
|
|
+ :max="row.accountsAmount - row.settlmentAmount"
|
|
|
+ ></el-input-number>
|
|
|
<span v-else>{{ row.thisAmount }}</span>
|
|
|
</template>
|
|
|
<template slot-scope="{ row, index }" slot="thisRefundAmount">
|
|
|
- <el-input-number size="small" width="100" v-model="row.thisRefundAmount" :precision="2" :controls="false"
|
|
|
- v-if="row.$cellEdit && row.businesType == 'TKXS'" @change="thisReAmountChange(row)"
|
|
|
- :max="row.accountsAmount - row.settlmentAmount"></el-input-number>
|
|
|
+ <el-input-number
|
|
|
+ size="small"
|
|
|
+ width="100"
|
|
|
+ v-model="row.thisRefundAmount"
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ v-if="row.$cellEdit && row.businesType == 'TKXS'"
|
|
|
+ @change="thisReAmountChange(row)"
|
|
|
+ :max="row.accountsAmount - row.settlmentAmount"
|
|
|
+ ></el-input-number>
|
|
|
<span v-else>{{ row.thisRefundAmount }}</span>
|
|
|
</template>
|
|
|
- <template slot-scope="{type,size,row,index,disabled}" slot="menu">
|
|
|
- <el-button :size="size" :disabled="form.financeStatus == '已收款' || isMenu" :type="type"
|
|
|
- :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="$refs.formContacts.rowCell(row, index)">{{
|
|
|
- row.$cellEdit ? '确认' : '修改' }}
|
|
|
+ <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
|
|
|
+ <el-button
|
|
|
+ :size="size"
|
|
|
+ :disabled="form.financeStatus == '已收款' || isMenu"
|
|
|
+ :type="type"
|
|
|
+ :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'"
|
|
|
+ @click="$refs.formContacts.rowCell(row, index)"
|
|
|
+ >{{ row.$cellEdit ? "确认" : "修改" }}
|
|
|
</el-button>
|
|
|
- <el-button icon="el-icon-delete" :size="size" :disabled="form.financeStatus == '已收款' || isMenu" :type="type"
|
|
|
- @click="rowDelBox(row, index)">删除
|
|
|
+ <el-button
|
|
|
+ icon="el-icon-delete"
|
|
|
+ :size="size"
|
|
|
+ :disabled="form.financeStatus == '已收款' || isMenu"
|
|
|
+ :type="type"
|
|
|
+ @click="rowDelBox(row, index)"
|
|
|
+ >删除
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</avue-crud>
|
|
|
</trade-card>
|
|
|
|
|
|
<containerTitle title="上传附件"></containerTitle>
|
|
|
- <c-upload v-loading="loadingBtn" typeUpload="LT" :disabled="isMenu"
|
|
|
- deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId" :data="filesList" display
|
|
|
- :enumerationValue="35.1"></c-upload>
|
|
|
+ <c-upload
|
|
|
+ v-loading="loadingBtn"
|
|
|
+ typeUpload="LT"
|
|
|
+ :disabled="isMenu"
|
|
|
+ deleteUrl="/api/trade-purchase/woodHarvestingCloud/removeByFileId"
|
|
|
+ :data="filesList"
|
|
|
+ display
|
|
|
+ :enumerationValue="35.1"
|
|
|
+ ></c-upload>
|
|
|
</div>
|
|
|
- <el-dialog title="导入订单" v-if="billDetailDialog" append-to-body class="el-dialogDeep"
|
|
|
- :visible.sync="billDetailDialog" width="80%" :close-on-click-modal="false" :destroy-on-close="true"
|
|
|
- :close-on-press-escape="false" top="10vh" v-dialog-drag>
|
|
|
- <bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail"
|
|
|
- @importProMent="importProMent">
|
|
|
- </bill-detail>
|
|
|
+ <el-dialog
|
|
|
+ title="导入订单"
|
|
|
+ v-if="billDetailDialog"
|
|
|
+ append-to-body
|
|
|
+ class="el-dialogDeep"
|
|
|
+ :visible.sync="billDetailDialog"
|
|
|
+ width="80%"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :destroy-on-close="true"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ top="10vh"
|
|
|
+ v-dialog-drag
|
|
|
+ >
|
|
|
+ <bill-detail :params="params" :billType="billType" :flag="1" @closeFun="closeBillDetail" @importProMent="importProMent"> </bill-detail>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import billDetail from "@/components/bill/selectOrderDetailList";
|
|
|
-import { saveSubmit, collectionAndPayment, revokeCollectionAndPayment, detail, removeItems, getFinanceList, remove } from '@/api/accountingManagement/index.js';
|
|
|
+import {
|
|
|
+ saveSubmit,
|
|
|
+ collectionAndPayment,
|
|
|
+ revokeCollectionAndPayment,
|
|
|
+ detail,
|
|
|
+ removeItems,
|
|
|
+ getFinanceList,
|
|
|
+ remove
|
|
|
+} from "@/api/accountingManagement/index.js";
|
|
|
import { getList } from "@/api/collectionSettlement/index.js";
|
|
|
import { skgetKh } from "@/api/tirePartsMall/salesManagement/saleOrder";
|
|
|
import dicSelect from "@/components/dicSelect/main";
|
|
|
@@ -122,102 +190,120 @@ export default {
|
|
|
disabled: false,
|
|
|
menuBtn: false,
|
|
|
span: 8,
|
|
|
- column: [{
|
|
|
- label: '客户',
|
|
|
- prop: "corpName",
|
|
|
- // type: 'select',
|
|
|
- // remote: true,
|
|
|
- // props: {
|
|
|
- // label: 'cname',
|
|
|
- // value: 'id',
|
|
|
- // res: 'data.records'
|
|
|
- // },
|
|
|
- // click: () => {
|
|
|
- // this.$refs.form.dicInit()
|
|
|
- // },
|
|
|
- // dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&cname={{key}}&corpType=KH',
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }],
|
|
|
- }, {
|
|
|
- label: '收款账户',
|
|
|
- prop: "accountId",
|
|
|
- type: 'select',
|
|
|
- props: {
|
|
|
- label: 'cname',
|
|
|
- value: 'id',
|
|
|
- res: 'data.records'
|
|
|
+ column: [
|
|
|
+ {
|
|
|
+ label: "客户",
|
|
|
+ prop: "corpName",
|
|
|
+ // type: 'select',
|
|
|
+ // remote: true,
|
|
|
+ // props: {
|
|
|
+ // label: 'cname',
|
|
|
+ // value: 'id',
|
|
|
+ // res: 'data.records'
|
|
|
+ // },
|
|
|
+ // click: () => {
|
|
|
+ // this.$refs.form.dicInit()
|
|
|
+ // },
|
|
|
+ // dicUrl: '/api/blade-sales-part/corpsDesc/list?current=1&size=20&cname={{key}}&corpType=KH',
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "收款账户",
|
|
|
+ prop: "accountId",
|
|
|
+ type: "select",
|
|
|
+ props: {
|
|
|
+ label: "cname",
|
|
|
+ value: "id",
|
|
|
+ res: "data.records"
|
|
|
+ },
|
|
|
+ click: () => {
|
|
|
+ this.$refs.form.dicInit();
|
|
|
+ },
|
|
|
+ dicUrl: "/api/blade-sales-part/accountManagement/list?enableOrNot=1&cname={{key}}&billType=HYCK",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "金额",
|
|
|
+ prop: "amount",
|
|
|
+ disabled: true,
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
- click: () => {
|
|
|
- this.$refs.form.dicInit()
|
|
|
+ {
|
|
|
+ label: "经办人",
|
|
|
+ prop: "handledByName",
|
|
|
+ type: "select",
|
|
|
+ props: {
|
|
|
+ label: "name",
|
|
|
+ value: "name"
|
|
|
+ },
|
|
|
+ click: () => {
|
|
|
+ this.$refs.form.dicInit();
|
|
|
+ },
|
|
|
+ dicUrl: "/api/blade-user/financeList",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
- dicUrl: '/api/blade-sales-part/accountManagement/list?enableOrNot=1&cname={{key}}&billType=HYCK',
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '金额',
|
|
|
- prop: "amount",
|
|
|
- disabled: true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: "经办人",
|
|
|
- prop: "handledByName",
|
|
|
- type: "select",
|
|
|
- props: {
|
|
|
- label: "name",
|
|
|
- value: "name"
|
|
|
+ {
|
|
|
+ label: "收款日期",
|
|
|
+ prop: "settlementDate",
|
|
|
+ type: "date",
|
|
|
+ overHidden: true,
|
|
|
+ width: 100,
|
|
|
+ searchRange: true,
|
|
|
+ searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
+ format: "yyyy-MM-dd",
|
|
|
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
+ value: "",
|
|
|
+ rules: [
|
|
|
+ {
|
|
|
+ required: true,
|
|
|
+ message: " ",
|
|
|
+ trigger: "blur"
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
- click: () => {
|
|
|
- this.$refs.form.dicInit()
|
|
|
+ {
|
|
|
+ label: "单据编号",
|
|
|
+ prop: "sysNo",
|
|
|
+ disabled: true
|
|
|
},
|
|
|
- dicUrl: "/api/blade-user/financeList",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }],
|
|
|
- }, {
|
|
|
- label: '收款日期',
|
|
|
- prop: "settlementDate",
|
|
|
- type: "date",
|
|
|
- overHidden: true,
|
|
|
- width: 100,
|
|
|
- searchRange: true,
|
|
|
- searchDefaultTime: ["00:00:00", "23:59:59"],
|
|
|
- format: "yyyy-MM-dd",
|
|
|
- valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
|
- value: '',
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: " ",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- }, {
|
|
|
- label: '单据编号',
|
|
|
- prop: "sysNo",
|
|
|
- disabled: true
|
|
|
- }, {
|
|
|
- label: '备注',
|
|
|
- prop: "remarks",
|
|
|
- type: 'textarea',
|
|
|
- span: 24,
|
|
|
- minRows: 2
|
|
|
- }]
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
+ type: "textarea",
|
|
|
+ span: 24,
|
|
|
+ minRows: 2
|
|
|
+ }
|
|
|
+ ]
|
|
|
},
|
|
|
formContacts: {},
|
|
|
optionContacts: {},
|
|
|
optionContactsBack: {
|
|
|
disabled: false,
|
|
|
- align: 'center',
|
|
|
+ align: "center",
|
|
|
index: true,
|
|
|
// addBtnText: "录入明细",
|
|
|
refreshBtn: false,
|
|
|
@@ -238,51 +324,60 @@ export default {
|
|
|
// cell: true
|
|
|
// },
|
|
|
{
|
|
|
- label: '合同号',
|
|
|
- prop: 'contractNumber',
|
|
|
+ label: "合同号",
|
|
|
+ prop: "contractNumber",
|
|
|
cell: false
|
|
|
- }, {
|
|
|
- label: '应收金额',
|
|
|
- prop: 'accountsAmount',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "应收金额",
|
|
|
+ prop: "accountsAmount",
|
|
|
cell: false
|
|
|
- }, {
|
|
|
- label: '结算金额',
|
|
|
- prop: 'settlmentAmount',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "结算金额",
|
|
|
+ prop: "settlmentAmount",
|
|
|
cell: false,
|
|
|
decimals: 2
|
|
|
- }, {
|
|
|
- label: '本次金额',
|
|
|
- prop: 'thisAmount',
|
|
|
- width: 140,
|
|
|
- }, {
|
|
|
- label: '本次退货金额',
|
|
|
- prop: 'thisRefundAmount',
|
|
|
- width: 140,
|
|
|
- }, {
|
|
|
- label: '来源主表id',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本次金额",
|
|
|
+ prop: "thisAmount",
|
|
|
+ width: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "本次退货金额",
|
|
|
+ prop: "thisRefundAmount",
|
|
|
+ width: 140
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "来源主表id",
|
|
|
hide: true,
|
|
|
showColumn: false,
|
|
|
- prop: 'srcParentId',
|
|
|
- }, {
|
|
|
- label: '来源单据编号',
|
|
|
- prop: 'srcBillNo',
|
|
|
+ prop: "srcParentId"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "来源单据编号",
|
|
|
+ prop: "srcBillNo",
|
|
|
hide: true,
|
|
|
showColumn: false,
|
|
|
cell: false
|
|
|
- }, {
|
|
|
- label: '所属公司id',
|
|
|
- prop: 'salesCompanyId',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "所属公司id",
|
|
|
+ prop: "salesCompanyId",
|
|
|
hide: true,
|
|
|
showColumn: false,
|
|
|
cell: false
|
|
|
- }, {
|
|
|
- label: '所属公司名称',
|
|
|
- prop: 'salesCompanyName',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "所属公司名称",
|
|
|
+ prop: "salesCompanyName",
|
|
|
hide: true,
|
|
|
showColumn: false,
|
|
|
cell: false
|
|
|
- }, {
|
|
|
- label: '业务日期',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "业务日期",
|
|
|
prop: "businesDate",
|
|
|
disabled: false,
|
|
|
type: "datetime",
|
|
|
@@ -295,58 +390,59 @@ export default {
|
|
|
trigger: "blur"
|
|
|
}
|
|
|
]
|
|
|
- }, {
|
|
|
- label: '备注',
|
|
|
- prop: 'remarks',
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "备注",
|
|
|
+ prop: "remarks",
|
|
|
cell: true
|
|
|
- }]
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
props: {
|
|
|
onLoad: Object,
|
|
|
detailData: Object
|
|
|
},
|
|
|
async created() {
|
|
|
-
|
|
|
// 获取今天的日期
|
|
|
var today = new Date();
|
|
|
var year = today.getFullYear();
|
|
|
- var month = String(today.getMonth() + 1).padStart(2, '0');
|
|
|
- var day = String(today.getDate()).padStart(2, '0');
|
|
|
- var hours = String(today.getHours()).padStart(2, '0');
|
|
|
- var minutes = String(today.getMinutes()).padStart(2, '0');
|
|
|
- var seconds = String(today.getSeconds()).padStart(2, '0');
|
|
|
+ var month = String(today.getMonth() + 1).padStart(2, "0");
|
|
|
+ var day = String(today.getDate()).padStart(2, "0");
|
|
|
+ var hours = String(today.getHours()).padStart(2, "0");
|
|
|
+ var minutes = String(today.getMinutes()).padStart(2, "0");
|
|
|
+ var seconds = String(today.getSeconds()).padStart(2, "0");
|
|
|
|
|
|
// 查询经办人
|
|
|
getFinanceList().then(res => {
|
|
|
- this.financeList = res.data.data
|
|
|
- const logInUser = JSON.parse(localStorage.getItem('saber-userInfo'));
|
|
|
- if (logInUser.content.role_name.includes('财务')) {
|
|
|
+ this.financeList = res.data.data;
|
|
|
+ const logInUser = JSON.parse(localStorage.getItem("saber-userInfo"));
|
|
|
+ if (logInUser.content.role_name.includes("财务")) {
|
|
|
for (let finance of res.data.data) {
|
|
|
if (finance.name === logInUser.content.nick_name) {
|
|
|
- console.log(finance.name)
|
|
|
+ console.log(finance.name);
|
|
|
this.form.handledByName = finance.name;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
|
|
|
// 构建今天的日期时间字符串
|
|
|
- var todayDateTime = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds;
|
|
|
+ var todayDateTime = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
|
|
|
if (this.onLoad.id) {
|
|
|
- this.refresh(this.onLoad.id)
|
|
|
- this.$set(this.optionForm, 'disabled', true)
|
|
|
- this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- this.isSaveBtn = true
|
|
|
- this.isFinanceBtn = true
|
|
|
+ this.refresh(this.onLoad.id);
|
|
|
+ this.$set(this.optionForm, "disabled", true);
|
|
|
+ this.$set(this.optionContactsBack, "disabled", true);
|
|
|
+ this.isSaveBtn = true;
|
|
|
+ this.isFinanceBtn = true;
|
|
|
|
|
|
- this.isMenu = true
|
|
|
+ this.isMenu = true;
|
|
|
} else {
|
|
|
- this.isFinanceBtn = true
|
|
|
- this.findObject(this.optionForm.column, 'settlementDate').value = todayDateTime
|
|
|
- this.editButton = true
|
|
|
+ this.isFinanceBtn = true;
|
|
|
+ this.findObject(this.optionForm.column, "settlementDate").value = todayDateTime;
|
|
|
+ this.editButton = true;
|
|
|
// console.log(this.form.settlementDate = '2023-07-03');
|
|
|
}
|
|
|
|
|
|
@@ -366,39 +462,39 @@ export default {
|
|
|
|
|
|
// 获取客户的数据
|
|
|
skgetKh().then(res => {
|
|
|
- console.log(res, 330)
|
|
|
- this.corpIdData = res.data.data
|
|
|
- })
|
|
|
+ console.log(res, 330);
|
|
|
+ this.corpIdData = res.data.data;
|
|
|
+ });
|
|
|
// this.corpIdData
|
|
|
},
|
|
|
methods: {
|
|
|
dicChange(name, row) {
|
|
|
- if (name == 'corpName') {
|
|
|
+ if (name == "corpName") {
|
|
|
if (row) {
|
|
|
- this.form.corpId = row.id
|
|
|
+ this.form.corpId = row.id;
|
|
|
} else {
|
|
|
- this.form.corpId = null
|
|
|
- this.form.corpName = null
|
|
|
+ this.form.corpId = null;
|
|
|
+ this.form.corpName = null;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
thisAmountChange(row) {
|
|
|
- let sum1 = 0
|
|
|
- let sum2 = 0
|
|
|
+ let sum1 = 0;
|
|
|
+ let sum2 = 0;
|
|
|
this.form.settlementItemsList.forEach(e => {
|
|
|
sum1 += e.thisAmount ? Number(e.thisAmount) : 0;
|
|
|
sum2 += e.thisRefundAmount ? Number(e.thisRefundAmount) : 0;
|
|
|
- this.$set(this.form, 'amount', sum1 - sum2)
|
|
|
- })
|
|
|
+ this.$set(this.form, "amount", sum1 - sum2);
|
|
|
+ });
|
|
|
},
|
|
|
thisReAmountChange(row) {
|
|
|
- let sum1 = 0
|
|
|
- let sum2 = 0
|
|
|
+ let sum1 = 0;
|
|
|
+ let sum2 = 0;
|
|
|
this.form.settlementItemsList.forEach(e => {
|
|
|
sum1 += e.thisAmount ? Number(e.thisAmount) : 0;
|
|
|
sum2 += e.thisRefundAmount ? Number(e.thisRefundAmount) : 0;
|
|
|
- this.$set(this.form, 'amount', sum1 - sum2)
|
|
|
- })
|
|
|
+ this.$set(this.form, "amount", sum1 - sum2);
|
|
|
+ });
|
|
|
},
|
|
|
rowDelBox(row, index) {
|
|
|
this.$confirm("确定将选择数据删除?", {
|
|
|
@@ -416,51 +512,51 @@ export default {
|
|
|
this.form.settlementItemsList.splice(index, 1);
|
|
|
this.$message.success("操作成功!");
|
|
|
}
|
|
|
- }
|
|
|
- )
|
|
|
- ;
|
|
|
+ });
|
|
|
},
|
|
|
rowSave(form, done, loading) {
|
|
|
- done(form)
|
|
|
+ done(form);
|
|
|
},
|
|
|
rowUpdate(form, index, done, loading) {
|
|
|
- done(form)
|
|
|
+ done(form);
|
|
|
},
|
|
|
refresh(id, type) {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
- })
|
|
|
- detail({ id: id }).then(res => {
|
|
|
- this.form = res.data.data
|
|
|
- this.filesList = res.data.data.filesList
|
|
|
- // if (res.data.data.financeStatus == '已收款') {
|
|
|
- // console.log('已收款');
|
|
|
- // this.$set(this.optionForm, 'disabled', true)
|
|
|
- // this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- // } else {
|
|
|
- // this.$set(this.optionForm, 'disabled', false)
|
|
|
- // }
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
+ });
|
|
|
+ detail({ id: id })
|
|
|
+ .then(res => {
|
|
|
+ this.form = res.data.data;
|
|
|
+ this.filesList = res.data.data.filesList;
|
|
|
+ // if (res.data.data.financeStatus == '已收款') {
|
|
|
+ // console.log('已收款');
|
|
|
+ // this.$set(this.optionForm, 'disabled', true)
|
|
|
+ // this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
+ // } else {
|
|
|
+ // this.$set(this.optionForm, 'disabled', false)
|
|
|
+ // }
|
|
|
|
|
|
- loading.close();
|
|
|
- }).catch(() => {
|
|
|
- loading.close();
|
|
|
- })
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
},
|
|
|
//新增
|
|
|
rowAdd() {
|
|
|
if (!this.form.corpId) {
|
|
|
- this.$message.warning("请先选择客户!")
|
|
|
- return
|
|
|
+ this.$message.warning("请先选择客户!");
|
|
|
+ return;
|
|
|
}
|
|
|
this.params = {
|
|
|
customerId: this.form.corpId,
|
|
|
- generateTask: '已生成',
|
|
|
- bsType: 'XS,TKXS,GX',
|
|
|
- actualPaymentStatus: '2'
|
|
|
- }
|
|
|
+ generateTask: "已生成",
|
|
|
+ bsType: "XS,TKXS,GX",
|
|
|
+ actualPaymentStatus: "2"
|
|
|
+ };
|
|
|
this.billDetailDialog = true;
|
|
|
|
|
|
// this.$refs.formContacts.rowAdd()
|
|
|
@@ -476,79 +572,83 @@ export default {
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
- let sum1 = 0
|
|
|
- let sum2 = 0
|
|
|
+ let sum1 = 0;
|
|
|
+ let sum2 = 0;
|
|
|
list.forEach((item, index) => {
|
|
|
item.contractNumber = item.ordNo;
|
|
|
- item.accountsAmount = item.bsType == "XS" || item.bsType == "GX" ? item.totalMoney : item.returnsAmount
|
|
|
- item.settlmentAmount = item.paymentAmountTl
|
|
|
- item.businesType = item.bsType
|
|
|
- this.$set(item, 'thisAmount', item.bsType == "XS" || item.bsType == "GX" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0)
|
|
|
- this.$set(item, 'thisRefundAmount', item.bsType == "TKXS" ? (Number(item.returnsAmount) - Number(item.paymentAmountTl)) : 0)
|
|
|
+ item.accountsAmount = item.bsType == "XS" || item.bsType == "GX" ? item.totalMoney : item.returnsAmount;
|
|
|
+ item.settlmentAmount = item.paymentAmountTl;
|
|
|
+ item.businesType = item.bsType;
|
|
|
+ this.$set(item, "thisAmount", item.bsType == "XS" || item.bsType == "GX" ? Number(item.totalMoney) - Number(item.paymentAmountTl) : 0);
|
|
|
+ this.$set(item, "thisRefundAmount", item.bsType == "TKXS" ? Number(item.returnsAmount) - Number(item.paymentAmountTl) : 0);
|
|
|
// item.thisAmount =item.bsType=="XS"?(Number(item.totalMoney) - Number(item.paymentAmountTl)):0
|
|
|
// item.thisRefundAmount =item.bsType=="TKXS"? (Number(item.totalMoney) - Number(item.paymentAmountTl)):0
|
|
|
- item.srcParentId = item.id
|
|
|
- item.srcBillNo = item.ordNo
|
|
|
- item.salesCompanyId = item.salesCompanyId
|
|
|
- item.salesCompanyName = item.salesCompanyName
|
|
|
- item.id = null
|
|
|
+ item.srcParentId = item.id;
|
|
|
+ item.srcBillNo = item.ordNo;
|
|
|
+ item.salesCompanyId = item.salesCompanyId;
|
|
|
+ item.salesCompanyName = item.salesCompanyName;
|
|
|
+ item.id = null;
|
|
|
delete item.ordNo;
|
|
|
this.$refs.formContacts.rowCellAdd(item);
|
|
|
//计算主表金额
|
|
|
- sum1 += item.bsType == "XS" || item.bsType == "GX" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0
|
|
|
- sum2 += item.bsType == "TKXS" ? (Number(item.totalMoney) - Number(item.paymentAmountTl)) : 0
|
|
|
- this.form.amount = sum1 - sum2
|
|
|
- })
|
|
|
+ sum1 += item.bsType == "XS" || item.bsType == "GX" ? Number(item.totalMoney) - Number(item.paymentAmountTl) : 0;
|
|
|
+ sum2 += item.bsType == "TKXS" ? Number(item.totalMoney) - Number(item.paymentAmountTl) : 0;
|
|
|
+ this.form.amount = sum1 - sum2;
|
|
|
+ });
|
|
|
//明细列表所有合同号 去重 加, 为主表合同号
|
|
|
// this.$set(this.form,'srcOrderno',Array.from(new Set(this.dataList.map(item =>{ return item.srcOrderno}))).join(','))
|
|
|
this.billDetailDialog = false;
|
|
|
},
|
|
|
//保存数据
|
|
|
editCustomer() {
|
|
|
- console.log(this.form, 441)
|
|
|
+ console.log(this.form, 441);
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
- done()
|
|
|
+ done();
|
|
|
if (valid) {
|
|
|
let data = {
|
|
|
...this.form,
|
|
|
- dc: 'd',
|
|
|
- billType: 'SK',
|
|
|
+ dc: "d",
|
|
|
+ billType: "SK",
|
|
|
// corpName: this.form.$corpId,
|
|
|
accountName: this.form.$accountId,
|
|
|
filesList: this.filesList
|
|
|
- }
|
|
|
+ };
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
});
|
|
|
for (let finance of this.financeList) {
|
|
|
if (finance.name == data.handledByName) {
|
|
|
- data.handledById = finance.id
|
|
|
+ data.handledById = finance.id;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- saveSubmit(data).then(res => {
|
|
|
- console.log(res);
|
|
|
- this.isFinanceBtn = false
|
|
|
- this.refresh(res.data.data.id)
|
|
|
- this.$message.success('保存成功')
|
|
|
- loading.close();
|
|
|
- }).catch(() => {
|
|
|
- loading.close()
|
|
|
- })
|
|
|
+ saveSubmit(data)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ this.isFinanceBtn = false;
|
|
|
+ this.refresh(res.data.data.id);
|
|
|
+ this.$message.success("保存成功");
|
|
|
+ loading.close();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+ });
|
|
|
},
|
|
|
//收款
|
|
|
collection() {
|
|
|
+ if (!this.form.id) {
|
|
|
+ return this.$message.error("请保存数据");
|
|
|
+ }
|
|
|
this.$refs["form"].validate((valid, done) => {
|
|
|
- done()
|
|
|
+ done();
|
|
|
if (valid) {
|
|
|
- if (this.form.financeStatus !== '已收款') {
|
|
|
- console.log('this.form.financeStatus', this.form.financeStatus);
|
|
|
+ if (this.form.financeStatus !== "已收款") {
|
|
|
+ console.log("this.form.financeStatus", this.form.financeStatus);
|
|
|
this.$confirm("确认收款?", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
@@ -556,28 +656,31 @@ export default {
|
|
|
}).then(() => {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
});
|
|
|
let data = {
|
|
|
...this.form,
|
|
|
- dc: 'd',
|
|
|
- billType: 'SK',
|
|
|
+ dc: "d",
|
|
|
+ billType: "SK"
|
|
|
// corpName: this.form.$corpId
|
|
|
- }
|
|
|
- saveSubmit(data).then(res => {
|
|
|
- loading.close()
|
|
|
- collectionAndPayment(data).then((res => {
|
|
|
- this.refresh(res.data.data.id)
|
|
|
- this.$set(this.optionForm, 'disabled', true)
|
|
|
- this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- this.$message.success('收款成功')
|
|
|
- }))
|
|
|
- }).catch(() => {
|
|
|
- loading.close()
|
|
|
- })
|
|
|
- })
|
|
|
+ };
|
|
|
+ saveSubmit(data)
|
|
|
+ .then(res => {
|
|
|
+ loading.close();
|
|
|
+ collectionAndPayment(data).then(res => {
|
|
|
+ this.refresh(res.data.data.id);
|
|
|
+ this.$set(this.optionForm, "disabled", true);
|
|
|
+ this.$set(this.optionContactsBack, "disabled", true);
|
|
|
+ this.$message.success("收款成功");
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.refresh(this.form.id);
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ });
|
|
|
} else {
|
|
|
this.$confirm("确认撤销退款?", {
|
|
|
confirmButtonText: "确定",
|
|
|
@@ -586,48 +689,47 @@ export default {
|
|
|
}).then(() => {
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: '加载中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(255,255,255,0.7)'
|
|
|
+ text: "加载中",
|
|
|
+ spinner: "el-icon-loading",
|
|
|
+ background: "rgba(255,255,255,0.7)"
|
|
|
});
|
|
|
let data = {
|
|
|
...this.form,
|
|
|
- dc: 'd',
|
|
|
- billType: 'SK'
|
|
|
- }
|
|
|
- revokeCollectionAndPayment(data).then((res => {
|
|
|
- this.refresh(res.data.data.id)
|
|
|
- this.editButton = false
|
|
|
- this.$message.success('撤销收款成功')
|
|
|
- loading.close()
|
|
|
- }))
|
|
|
- })
|
|
|
+ dc: "d",
|
|
|
+ billType: "SK"
|
|
|
+ };
|
|
|
+ revokeCollectionAndPayment(data).then(res => {
|
|
|
+ this.refresh(res.data.data.id);
|
|
|
+ this.editButton = false;
|
|
|
+ this.$message.success("撤销收款成功");
|
|
|
+ loading.close();
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
-
|
|
|
+ });
|
|
|
},
|
|
|
confirmEditing() {
|
|
|
- this.editButton = true
|
|
|
- if (this.form.financeStatus == '已收款') {
|
|
|
- this.$set(this.optionForm, 'disabled', true)
|
|
|
- this.$set(this.optionContactsBack, 'disabled', true)
|
|
|
- this.isFinanceBtn = false
|
|
|
+ this.editButton = true;
|
|
|
+ if (this.form.financeStatus == "已收款") {
|
|
|
+ this.$set(this.optionForm, "disabled", true);
|
|
|
+ this.$set(this.optionContactsBack, "disabled", true);
|
|
|
+ this.isFinanceBtn = false;
|
|
|
} else {
|
|
|
- this.$set(this.optionForm, 'disabled', false)
|
|
|
- this.$set(this.optionContactsBack, 'disabled', false)
|
|
|
- this.isFinanceBtn = false
|
|
|
- this.isSaveBtn = false
|
|
|
- this.isMenu = false
|
|
|
+ this.$set(this.optionForm, "disabled", false);
|
|
|
+ this.$set(this.optionContactsBack, "disabled", false);
|
|
|
+ this.isFinanceBtn = false;
|
|
|
+ this.isSaveBtn = false;
|
|
|
+ this.isMenu = false;
|
|
|
}
|
|
|
},
|
|
|
//查看单据
|
|
|
viewDocuments(row) {
|
|
|
console.log(row);
|
|
|
- this.$router.$avueRouter.closeTag('/tirePartsMall/salesManagement/saleOrder/index');
|
|
|
+ this.$router.$avueRouter.closeTag("/tirePartsMall/salesManagement/saleOrder/index");
|
|
|
this.$router.push({
|
|
|
path: "/tirePartsMall/salesManagement/saleOrder/index",
|
|
|
- query: { detail: row, type: 'S' },
|
|
|
+ query: { detail: row, type: "S" }
|
|
|
});
|
|
|
},
|
|
|
//关闭
|
|
|
@@ -661,7 +763,7 @@ export default {
|
|
|
this.$emit("backToList", type);
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|