123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564 |
- <template>
- <div>
- <div class="borderless">
- <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">返回列表
- </el-button>
- </div>
- <div class="add-customer-btn">
- <el-button type="primary" size="small" @click="editCustomer">
- 编辑
- </el-button>
- </div>
- </div>
- </div>
- <containerTitle title="基础信息" style="margin-top: 60px"></containerTitle>
- <basic-container v-loading="loading">
- <span style="font-size: 18px;font-weight: 600;">{{ form.cname }}</span>
- <containerTitle title="应收款项" style="margin-top:5px"></containerTitle>
- <table border="0" width="100%" v-loading="loading">
- <tr>
- <td class="stat-td">
- <img src="@/assets/img/contractAmountBg.png" class="stat-img">
- <div class="stat-tip">
- <div class="money">
- <span style="font-size:20px;">¥</span>
- <avue-count-up :end="form.debitAmount"></avue-count-up>
- </div>
- <div class="title">合同金额</div>
- </div>
- </td>
- <td class="stat-td">
- <img src="@/assets/img/deliveredBg.png" class="stat-img">
- <div class="stat-tip">
- <div class="money">
- <span style="font-size:20px;">¥</span>
- <avue-count-up :end="form.deliveringAmount"></avue-count-up>
- </div>
- <div class="title">已送货</div>
- </div>
- </td>
- <td class="stat-td">
- <img src="@/assets/img/advanceCollectionBg.png" class="stat-img">
- <div class="stat-tip">
- <div class="money">
- <span style="font-size:20px;">¥</span>
- <avue-count-up :end="form.advancePayment"></avue-count-up>
- </div>
- <div class="title">预收款</div>
- </div>
- </td>
- <td class="stat-td">
- <img src="@/assets/img/uncollectedBg.png" class="stat-img">
- <div class="stat-tip">
- <div class="money">
- <span style="font-size:20px;">¥</span>
- <avue-count-up :end="form.balanceAmount"></avue-count-up>
- </div>
- <div class="title">未收款</div>
- </div>
- </td>
- <td class="stat-td">
- <img src="@/assets/img/receivableBg.png" class="stat-img">
- <div class="stat-tip">
- <div class="money">
- <span style="font-size:20px;">¥</span>
- <avue-count-up :end="form.settlmentAmount"></avue-count-up>
- </div>
- <div class="title">已收款</div>
- </div>
- </td>
- </tr>
- </table>
- </basic-container>
- <containerTitle title="明细信息"></containerTitle>
- <basic-container v-loading="loading">
- <el-tabs v-model="activeName">
- <el-tab-pane label="销售记录" name="first">
- <avue-crud ref="crud" :option="sellOption" :data="sellList" :page.sync="page" :search.sync="search"
- @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
- @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
- @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
- <!-- <template slot="menuLeft"> -->
- <!-- <el-button type="primary" size="mini">新建销售单
- </el-button> -->
- <!-- <el-button size="mini">收款 -->
- <!-- </el-button> -->
- <!-- <el-button size="mini">送货 -->
- <!-- </el-button> -->
- <!-- </template> -->
- <template slot="corpIdSearch">
- <crop-select v-model="search.corpId" corpType="KH"></crop-select>
- </template>
- <template slot-scope="{ row, index }" slot="sysNo">
- <span style="color: #409EFF;cursor: pointer" @click.stop="editOrder(row)">{{ row.sysNo }}</span>
- </template>
- <template slot-scope="{ row, index }" slot="corpId">
- <span style="color: #409EFF;cursor: pointer" @click.stop="editCustomer">{{ row.corpsName }}
- </span>
- </template>
- <template slot="businesDateSearch">
- <el-date-picker v-model="search.businesDate" type="daterange" start-placeholder="开始日期"
- end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']" :picker-options="pickerOptions">
- </el-date-picker>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="资金往来" name="second">
- <avue-crud ref="crud2" :option="capitalOption" :data="capitalList" :page.sync="page2"
- :search.sync="search2" @search-change="searchChange2" @current-change="currentChange2"
- @size-change="sizeChange2" @refresh-change="refreshChange2" @on-load="onLoad2"
- :table-loading="loading2" @saveColumn="saveColumn2" @resetColumn="resetColumn2"
- :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch2">
- <!-- <template slot="menuLeft">
- <el-button size="mini">收款
- </el-button>
- </template> -->
- <template slot="settlementDateSearch">
- <el-date-picker v-model="search2.settlementDate" type="daterange" start-placeholder="开始日期"
- end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
- :default-time="['00:00:00', '23:59:59']" :picker-options="pickerOptions">
- </el-date-picker>
- </template>
- </avue-crud>
- </el-tab-pane>
- <el-tab-pane label="客户信息" name="third">
- <div style="display:flex;justify-content: flex-end;">
- <el-button size="mini">禁用</el-button>
- <el-button type="primary" size="mini">打印</el-button>
- </div>
- <el-row class="client_info">
- <el-col :span="4">客户名称</el-col>
- <el-col :span="4">{{ form.cname | nameFileter }}</el-col>
- <el-col :span="4">期初欠款</el-col>
- <el-col :span="4">{{ form.arrears | nameFileter }}</el-col>
- <el-col :span="4">电话</el-col>
- <el-col :span="4">{{ form.tel | nameFileter }}</el-col>
- </el-row>
- <el-row class="client_info">
- <el-col :span="4">备用电话</el-col>
- <el-col :span="4">{{ form.telephone | nameFileter }}</el-col>
- <el-col :span="4">传真</el-col>
- <el-col :span="4">{{ form.fax | nameFileter }}</el-col>
- <el-col :span="4">邮箱</el-col>
- <el-col :span="4">{{ form.mailbox | nameFileter }}</el-col>
- </el-row>
- <el-row class="client_info">
- <el-col :span="4">备注</el-col>
- <el-col :span="20">{{ form.remarks | nameFileter }}</el-col>
- </el-row>
- <el-row class="client_info" v-for="(item, index) in corpsAddrList" :key="index">
- <el-col :span="2"><i class="el-icon-location"></i></el-col>
- <el-col :span="4">送货地址</el-col>
- <el-col :span="18">{{ item.detailedAddress }}</el-col>
- </el-row>
- </el-tab-pane>
- </el-tabs>
- </basic-container>
- </div>
- </template>
- <script>
- import { optionList, sellOption, capitalOption } from "./js/optionList";
- // import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
- import { getList } from "@/api/tirePartsMall/salesManagement/saleOrder";
- import { pageStatistics, remove, addCorpType, customerList } from "@/api/basicData/customerTransactions";
- import { getDetails, getSellList } from "@/api/basicData/client";
- import { getList as getLists } from "@/api/collectionSettlement/index.js";
- import { getDetails as getDetail} from "@/api/tirePartsMall/basicData/customerInformation"
- import { validatenull } from "@/util/validate";
- export default {
- name: "index",
- data() {
- return {
- loading: false,
- loading2: false,
- form: {
- debitAmount: 0,
- deliveringAmount: 0,
- advancePayment: 0,
- balanceAmount: 0,
- settlmentAmount: 0
- },
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
- pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
- },
- page2: {
- pageSize: 20,
- currentPage: 1,
- total: 0,
- pageSizes: [20]
- },
- activeName: "first",
- search: {},
- search2: {},
- sellOption: {},
- capitalOption: {},
- sellList: [],
- capitalList: [],
- corpsAddrList: [],
- pickerOptions: {
- shortcuts: [
- {
- text: '当天',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
- const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- },
- {
- text: '昨天',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 0, 0, 0);
- const end = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '当月',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
- const end = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '当季',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3, 1, 0, 0, 0);
- const end = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3 + 3, 0, 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '当年',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
- const end = new Date(date.getFullYear() + 1, 0, 0, 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近一周',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7, 0, 0, 0);
- const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近二周',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 2, 0, 0, 0);
- const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }, {
- text: '最近三周',
- onClick(picker) {
- const date = new Date();
- const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 3, 0, 0, 0);
- const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
- picker.$emit('pick', [start, end]);
- }
- }]
- },
- };
- },
- props: {
- detailData: {
- type: Object
- }
- },
- filters: {
- nameFileter(val) {
- return validatenull(val) ? '-' : val
- }
- },
- async created() {
- this.sellOption = await this.getColumnData(
- this.getColumnName(277.3),
- sellOption
- );
- this.getWorkDicts("order_status_pjjl").then(res => {
- this.findObject(this.sellOption.column, "actualPaymentStatus").dicData = res.data.data;
- this.findObject(this.sellOption.column, "status").dicData = res.data.data;
- });
- this.capitalOption = await this.getColumnData(
- this.getColumnName(277.4),
- capitalOption
- );
- // this.sellOption.height = window.innerHeight - 330;
- console.log(this.detailData);
- if (this.detailData.id) {
- console.log('this.detailData.id');
- this.getDetail(this.detailData.id);
- }
- this.getAllWorkDicts()
- },
- methods: {
- getAllWorkDicts() {
- // gainUser().then(res => {
- // this.findObject(this.sellOption.column, "createUser").dicData = res.data.data;
- // })
- // getCorpType({ corpType: 'KH' }).then(res => {
- // this.findObject(this.sellOption.column, "corpType").dicData = res.data.data
- // });
- // getAllgoods().then(res => {
- // this.findObject(this.sellOption.column, "cname").dicData = res.data.data
- // });
- // this.getWorkDicts("account").then(res => {
- // this.findObject(this.capitalOption.column, "account").dicData = res.data.data;
- // });
- },
- cellStyle() {
- return "padding:0;height:40px;";
- },
- searchCriteriaSwitch(type) {
- if (type) {
- this.sellOption.height = this.sellOption.height - 46;
- } else {
- this.sellOption.height = this.sellOption.height + 46;
- }
- this.$refs.crud.getTableHeight();
- },
- //点击搜索按钮触发
- searchChange(params, done) {
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- refreshChange() {
- this.onLoad(this.page, this.search);
- },
- currentChange(val) {
- this.page.currentPage = val;
- },
- sizeChange(val) {
- this.page.currentPage = 1;
- this.page.pageSize = val;
- },
- onLoad(page, params = {}) {
- let data = this.deepClone(Object.assign(params, this.search));
- data.billType = 'XS';
- data.tradeType = 'YPJ';
- if (data.businesDate) {
- data.orderStartDate = data.businesDate[0];
- data.orderEndDate = data.businesDate[1];
- }
- delete data.businesDate
- data.corpId = this.detailData.id;
- this.loading = true;
- console.log(data);
- //id: id, status: '待确认,待发货,已发货,退款请核', bsType: 'XS'
- data.status = '待确认,待发货,已发货,退款请核'
- getList({ id: this.detailData.id, status: '待确认,待发货,已发货,退款请核', bsType: 'XS' })
- .then(res => {
- this.sellList = res.data.data.records ? res.data.data.records : [];
- this.page.total = res.data.data.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- onLoad2(page, params = {}) {
- let data = this.deepClone(Object.assign(params, this.search2));
- if (data.settlementDate) {
- data.settlementStartDate = data.settlementDate[0];
- data.settlementEndDate = data.settlementDate[1];
- }
- delete data.settlementDate
- data.corpId = this.detailData.id;
- this.loading = true;
- params = {
- current: page.currentPage,
- size: page.pageSize,
- billType: "SK",
- dc: 'd',
- ...data
- }
- getLists(params)
- .then(res => {
- this.capitalList = res.data.data.records ? res.data.data.records : [];
- this.page2.total = res.data.data.total;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- searchCriteriaSwitch2(type) {
- if (type) {
- this.capitalOption.height = this.capitalOption.height - 46;
- } else {
- this.capitalOption.height = this.capitalOption.height + 46;
- }
- this.$refs.crud2.getTableHeight();
- },
- //点击搜索按钮触发
- searchChange2(params, done) {
- this.page2.currentPage = 1;
- this.onLoad2(this.page2, params);
- done();
- },
- refreshChange2() {
- this.onLoad2(this.page2, this.search2);
- },
- currentChange2(val) {
- this.page2.currentPage = val;
- },
- sizeChange2(val) {
- this.page2.currentPage = 1;
- this.page2.pageSize = val;
- },
- getDetail(id) {
- this.loading = true
- getDetail({ id: id })
- .then(res => {
- this.form = res.data.data;
- }).finally(() => {
- this.loading = false;
- });
- pageStatistics({ id: id })
- .then(res => {
- // this.form = res.data.data;
- this.corpsAddrList = res.data.data.corpsAddrList;
- })
- .finally(() => {
- this.loading = false;
- });
- },
- editCustomer() {
- this.$emit('editOpen', this.form, 2)
- },
- editOrder(row) {
- if (this.$store.getters.pjxsStatus) {
- return this.$alert("销售单已存在,请保存销售单再进行操作", "温馨提示", {
- confirmButtonText: "确定",
- type: "warning",
- callback: action => {
- console.log(action);
- }
- });
- }
- this.$router.push({
- path: '/salesOrder/index',
- query: { orderId: row.id },
- });
- },
- async saveColumn() {
- const inSave = await this.saveColumnData(
- this.getColumnName(277.3),
- this.sellOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn() {
- this.sellOption = sellOption;
- const inSave = await this.delColumnData(
- this.getColumnName(277.3),
- sellOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud.doLayout();
- });
- this.getAllWorkDicts()
- this.$message.success("重置成功");
- this.$refs.crud.$refs.dialogColumn.columnBox = false;
- }
- },
- async saveColumn2() {
- const inSave = await this.saveColumnData(
- this.getColumnName(277.4),
- this.capitalOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud2.doLayout();
- });
- this.$message.success("保存成功");
- //关闭窗口
- this.$refs.crud2.$refs.dialogColumn.columnBox = false;
- }
- },
- async resetColumn2() {
- this.capitalOption = capitalOption;
- const inSave = await this.delColumnData(
- this.getColumnName(277.4),
- capitalOption
- );
- if (inSave) {
- this.$nextTick(() => {
- this.$refs.crud2.doLayout();
- });
- this.getAllWorkDicts()
- this.$message.success("重置成功");
- this.$refs.crud2.$refs.dialogColumn.columnBox = false;
- }
- },
- //返回列表
- backToList() {
- this.$emit("goBack");
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .page-crad ::v-deep .basic-container__card {
- height: 94.2vh;
- }
- .stat-td {
- text-align: center;
- position: relative;
- }
- .stat-img {
- width: 95%;
- height: 75px;
- }
- .stat-tip {
- position: absolute;
- left: 15px;
- top: 5px;
- .money {
- color: #fff;
- font-size: 28px;
- font-weight: 600;
- }
- .title {
- color: #fff;
- font-size: 14px;
- text-align: left;
- margin-top: 4px;
- }
- }
- .client_info {
- font-size: 14px;
- color: #333;
- line-height: 20px;
- margin-top: 10px;
- margin-bottom: 10px;
- }
- </style>
|