detailsInfo.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. <template>
  2. <div>
  3. <div class="borderless">
  4. <div class="customer-head">
  5. <div class="customer-back">
  6. <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
  7. @click="backToList">返回列表
  8. </el-button>
  9. </div>
  10. <!-- <div class="add-customer-btn">
  11. <el-button type="primary" size="small" @click="editCustomer">
  12. 编辑
  13. </el-button>
  14. </div> -->
  15. </div>
  16. </div>
  17. <containerTitle title="基础信息" style="margin-top: 60px"></containerTitle>
  18. <basic-container v-loading="loading">
  19. <span style="font-size: 18px;font-weight: 600;">{{ form.cname }}</span>
  20. <containerTitle title="应收款项" style="margin-top:5px"></containerTitle>
  21. <table border="0" width="100%" v-loading="loading">
  22. <tr>
  23. <td class="stat-td">
  24. <img src="@/assets/img/contractAmountBg.png" class="stat-img">
  25. <div class="stat-tip">
  26. <div class="money">
  27. <span style="font-size:20px;">¥</span>
  28. <avue-count-up :end="forms.totalAmount"></avue-count-up>
  29. </div>
  30. <div class="title">合同金额</div>
  31. </div>
  32. </td>
  33. <!-- <td class="stat-td">
  34. <img src="@/assets/img/deliveredBg.png" class="stat-img">
  35. <div class="stat-tip">
  36. <div class="money">
  37. <span style="font-size:20px;">¥</span>
  38. <avue-count-up :end="form.deliveringAmount"></avue-count-up>
  39. </div>
  40. <div class="title">已送货</div>
  41. </div>
  42. </td> -->
  43. <!-- <td class="stat-td">
  44. <img src="@/assets/img/advanceCollectionBg.png" class="stat-img">
  45. <div class="stat-tip">
  46. <div class="money">
  47. <span style="font-size:20px;">¥</span>
  48. <avue-count-up :end="form.advancePayment"></avue-count-up>
  49. </div>
  50. <div class="title">预收款</div>
  51. </div>
  52. </td> -->
  53. <td class="stat-td">
  54. <img src="@/assets/img/uncollectedBg.png" class="stat-img">
  55. <div class="stat-tip">
  56. <div class="money">
  57. <span style="font-size:20px;">¥</span>
  58. <avue-count-up :end="forms.unpaidAmount"></avue-count-up>
  59. </div>
  60. <div class="title">未收款</div>
  61. </div>
  62. </td>
  63. <td class="stat-td">
  64. <img src="@/assets/img/receivableBg.png" class="stat-img">
  65. <div class="stat-tip">
  66. <div class="money">
  67. <span style="font-size:20px;">¥</span>
  68. <avue-count-up :end="forms.paidAmount"></avue-count-up>
  69. </div>
  70. <div class="title">已收款</div>
  71. </div>
  72. </td>
  73. </tr>
  74. </table>
  75. </basic-container>
  76. <containerTitle title="明细信息"></containerTitle>
  77. <basic-container v-loading="loading">
  78. <el-tabs v-model="activeName">
  79. <el-tab-pane label="采购记录" name="first">
  80. <avue-crud ref="crud" :option="sellOption" :data="sellList" :page.sync="page" :search.sync="search"
  81. @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
  82. @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
  83. @resetColumn="resetColumn" :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch">
  84. <!-- <template slot="menuLeft"> -->
  85. <!-- <el-button type="primary" size="mini">新建销售单
  86. </el-button> -->
  87. <!-- <el-button size="mini">收款 -->
  88. <!-- </el-button> -->
  89. <!-- <el-button size="mini">送货 -->
  90. <!-- </el-button> -->
  91. <!-- </template> -->
  92. <template slot="corpIdSearch">
  93. <crop-select v-model="search.corpId" corpType="KH"></crop-select>
  94. </template>
  95. <template slot-scope="{ row, index }" slot="sysNo">
  96. <span style="color: #409EFF;cursor: pointer" @click.stop="editOrder(row)">{{ row.sysNo }}</span>
  97. </template>
  98. <template slot-scope="{ row, index }" slot="corpId">
  99. <span style="color: #409EFF;cursor: pointer" @click.stop="editCustomer">{{ row.corpsName }}
  100. </span>
  101. </template>
  102. <template slot="businesDateSearch">
  103. <el-date-picker v-model="search.businesDate" type="daterange" start-placeholder="开始日期"
  104. end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
  105. :default-time="['00:00:00', '23:59:59']" :picker-options="pickerOptions">
  106. </el-date-picker>
  107. </template>
  108. </avue-crud>
  109. </el-tab-pane>
  110. <el-tab-pane label="资金往来" name="second">
  111. <avue-crud ref="crud2" :option="capitalOption" :data="capitalList" :page.sync="page2"
  112. :search.sync="search2" @search-change="searchChange2" @current-change="currentChange2"
  113. @size-change="sizeChange2" @refresh-change="refreshChange2" @on-load="onLoad2"
  114. :table-loading="loading2" @saveColumn="saveColumn2" @resetColumn="resetColumn2"
  115. :cell-style="cellStyle" @search-criteria-switch="searchCriteriaSwitch2">
  116. <!-- <template slot="menuLeft">
  117. <el-button size="mini">收款
  118. </el-button>
  119. </template> -->
  120. <template slot="settlementDateSearch">
  121. <el-date-picker v-model="search2.settlementDate" type="daterange" start-placeholder="开始日期"
  122. end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
  123. :default-time="['00:00:00', '23:59:59']" :picker-options="pickerOptions">
  124. </el-date-picker>
  125. </template>
  126. </avue-crud>
  127. </el-tab-pane>
  128. <el-tab-pane label="供应商信息" name="third">
  129. <div style="display:flex;justify-content: flex-end;">
  130. <el-button size="mini">禁用</el-button>
  131. <el-button type="primary" size="mini">打印</el-button>
  132. </div>
  133. <el-row class="client_info">
  134. <el-col :span="4">客户名称</el-col>
  135. <el-col :span="4">{{ form.cname | nameFileter }}</el-col>
  136. <el-col :span="4">信用额度</el-col>
  137. <el-col :span="4">{{ form.arrears | nameFileter }}</el-col>
  138. <el-col :span="4">电话</el-col>
  139. <el-col :span="4">{{ form.tel | nameFileter }}</el-col>
  140. </el-row>
  141. <el-row class="client_info">
  142. <el-col :span="4">商城价格</el-col>
  143. <el-col :span="4">{{ form.telephone | nameFileter }}</el-col>
  144. <el-col :span="4">账期</el-col>
  145. <el-col :span="4">{{ form.fax | nameFileter }}</el-col>
  146. <el-col :span="4">邮箱</el-col>
  147. <el-col :span="4">{{ form.mailbox | nameFileter }}</el-col>
  148. </el-row>
  149. <el-row class="client_info">
  150. <el-col :span="4">备注</el-col>
  151. <el-col :span="20">{{ form.remarks | nameFileter }}</el-col>
  152. </el-row>
  153. <el-row class="client_info" v-for="(item, index) in corpsAddrList" :key="index">
  154. <el-col :span="2"><i class="el-icon-location"></i></el-col>
  155. <el-col :span="4">送货地址</el-col>
  156. <el-col :span="18">{{ item.detailedAddress }}</el-col>
  157. </el-row>
  158. </el-tab-pane>
  159. </el-tabs>
  160. </basic-container>
  161. </div>
  162. </template>
  163. <script>
  164. import { optionList, sellOption, capitalOption } from "./js/optionList";
  165. // import { getList, getCorpsAll, gainUser, getCorpType, getAllgoods } from "@/api/basicData/salesOrder";
  166. import { getList } from "@/api/tirePartsMall/salesManagement/saleOrder";
  167. import { pageStatistics, remove, addCorpType, customerList } from "@/api/basicData/customerTransactions";
  168. import { getDetails, getSellList } from "@/api/basicData/client";
  169. import {getList as getLists} from "@/api/collectionSettlement/index.js";
  170. import { getDetails as getDetail } from "@/api/tirePartsMall/basicData/customerInformation";
  171. import { validatenull } from "@/util/validate";
  172. export default {
  173. name: "index",
  174. data() {
  175. return {
  176. loading: false,
  177. loading2: false,
  178. form: {
  179. debitAmount: 0,
  180. deliveringAmount: 0,
  181. advancePayment: 0,
  182. balanceAmount: 0,
  183. settlmentAmount: 0
  184. },
  185. forms:{
  186. paidAmount:0,
  187. totalAmount:0,
  188. unpaidAmount:0,
  189. },
  190. page: {
  191. pageSize: 10,
  192. currentPage: 1,
  193. total: 0,
  194. pageSizes: [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
  195. },
  196. page2: {
  197. pageSize: 20,
  198. currentPage: 1,
  199. total: 0,
  200. pageSizes: [20]
  201. },
  202. activeName: "first",
  203. search: {},
  204. search2: {},
  205. sellOption: {},
  206. capitalOption: {},
  207. sellList: [],
  208. capitalList: [],
  209. corpsAddrList: [],
  210. pickerOptions: {
  211. shortcuts: [
  212. {
  213. text: '当天',
  214. onClick(picker) {
  215. const date = new Date();
  216. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
  217. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  218. picker.$emit('pick', [start, end]);
  219. }
  220. },
  221. {
  222. text: '昨天',
  223. onClick(picker) {
  224. const date = new Date();
  225. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 0, 0, 0);
  226. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 1, 23, 59, 59);
  227. picker.$emit('pick', [start, end]);
  228. }
  229. }, {
  230. text: '当月',
  231. onClick(picker) {
  232. const date = new Date();
  233. const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
  234. const end = new Date(date.getFullYear(), date.getMonth() + 1, 0, 23, 59, 59);
  235. picker.$emit('pick', [start, end]);
  236. }
  237. }, {
  238. text: '当季',
  239. onClick(picker) {
  240. const date = new Date();
  241. const start = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3, 1, 0, 0, 0);
  242. const end = new Date(date.getFullYear(), parseInt(date.getMonth() / 3) * 3 + 3, 0, 23, 59, 59);
  243. picker.$emit('pick', [start, end]);
  244. }
  245. }, {
  246. text: '当年',
  247. onClick(picker) {
  248. const date = new Date();
  249. const start = new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0);
  250. const end = new Date(date.getFullYear() + 1, 0, 0, 23, 59, 59);
  251. picker.$emit('pick', [start, end]);
  252. }
  253. }, {
  254. text: '最近一周',
  255. onClick(picker) {
  256. const date = new Date();
  257. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7, 0, 0, 0);
  258. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  259. picker.$emit('pick', [start, end]);
  260. }
  261. }, {
  262. text: '最近二周',
  263. onClick(picker) {
  264. const date = new Date();
  265. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 2, 0, 0, 0);
  266. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  267. picker.$emit('pick', [start, end]);
  268. }
  269. }, {
  270. text: '最近三周',
  271. onClick(picker) {
  272. const date = new Date();
  273. const start = new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7 * 3, 0, 0, 0);
  274. const end = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 23, 59, 59);
  275. picker.$emit('pick', [start, end]);
  276. }
  277. }]
  278. },
  279. };
  280. },
  281. props: {
  282. detailData: {
  283. type: Object
  284. }
  285. },
  286. filters: {
  287. nameFileter(val) {
  288. return validatenull(val) ? '-' : val
  289. }
  290. },
  291. async created() {
  292. this.sellOption = await this.getColumnData(
  293. this.getColumnName(278),
  294. sellOption
  295. );
  296. this.getWorkDicts("order_status_pjjl").then(res => {
  297. this.findObject(this.sellOption.column, "actualPaymentStatus").dicData = res.data.data;
  298. this.findObject(this.sellOption.column, "status").dicData = res.data.data;
  299. });
  300. this.capitalOption = await this.getColumnData(
  301. this.getColumnName(278.1),
  302. capitalOption
  303. );
  304. // this.sellOption.height = window.innerHeight - 330;
  305. console.log(this.detailData);
  306. this.$refs.crud2.dicInit()
  307. if (this.detailData.id) {
  308. console.log('this.detailData.id');
  309. this.getDetail(this.detailData.id);
  310. }
  311. this.getAllWorkDicts()
  312. this.$refs.crud.dicInit()
  313. },
  314. methods: {
  315. getAllWorkDicts() {
  316. // gainUser().then(res => {
  317. // this.findObject(this.sellOption.column, "createUser").dicData = res.data.data;
  318. // })
  319. // getCorpType({ corpType: 'KH' }).then(res => {
  320. // this.findObject(this.sellOption.column, "corpType").dicData = res.data.data
  321. // });
  322. // getAllgoods().then(res => {
  323. // this.findObject(this.sellOption.column, "cname").dicData = res.data.data
  324. // });
  325. // this.getWorkDicts("account").then(res => {
  326. // this.findObject(this.capitalOption.column, "account").dicData = res.data.data;
  327. // });
  328. },
  329. cellStyle() {
  330. return "padding:0;height:40px;";
  331. },
  332. searchCriteriaSwitch(type) {
  333. if (type) {
  334. this.sellOption.height = this.sellOption.height - 46;
  335. } else {
  336. this.sellOption.height = this.sellOption.height + 46;
  337. }
  338. this.$refs.crud.getTableHeight();
  339. },
  340. //点击搜索按钮触发
  341. searchChange(params, done) {
  342. this.page.currentPage = 1;
  343. this.onLoad(this.page, params);
  344. done();
  345. },
  346. refreshChange() {
  347. this.onLoad(this.page, this.search);
  348. },
  349. currentChange(val) {
  350. this.page.currentPage = val;
  351. },
  352. sizeChange(val) {
  353. this.page.currentPage = 1;
  354. this.page.pageSize = val;
  355. },
  356. onLoad(page, params = {}) {
  357. let data = this.deepClone(Object.assign(params, this.search));
  358. // data.billType = 'XS';
  359. // data.tradeType = 'YPJ';
  360. // if (data.businesDate) {
  361. // data.orderStartDate = data.businesDate[0];
  362. // data.orderEndDate = data.businesDate[1];
  363. // }
  364. // delete data.businesDate
  365. // data.corpId = this.detailData.id;
  366. this.loading = true;
  367. console.log(data);
  368. //id: id, status: '待确认,待发货,已发货,退款请核', bsType: 'XS'
  369. data.status = '待确认,待发货,已发货,退款请核'
  370. getList({ id: this.detailData.id, status: '待确认,待发货,已发货,退款请核', bsType: 'CG',...data })
  371. .then(res => {
  372. this.sellList = res.data.data.records ? res.data.data.records : [];
  373. this.page.total = res.data.data.total;
  374. })
  375. .finally(() => {
  376. this.loading = false;
  377. });
  378. },
  379. onLoad2(page, params = {}) {
  380. let data = this.deepClone(Object.assign(params, this.search2));
  381. if (data.settlementDate) {
  382. data.settlementStartDate = data.settlementDate[0];
  383. data.settlementEndDate = data.settlementDate[1];
  384. }
  385. delete data.settlementDate
  386. data.corpId = this.detailData.id;
  387. this.loading = true;
  388. params = {
  389. current: page.currentPage,
  390. size: page.pageSize,
  391. billType: "FK",
  392. dc: 'c',
  393. ...data
  394. }
  395. getLists(params)
  396. .then(res => {
  397. this.capitalList = res.data.data.records ? res.data.data.records : [];
  398. this.page2.total = res.data.data.total;
  399. })
  400. .finally(() => {
  401. this.loading = false;
  402. });
  403. },
  404. searchCriteriaSwitch2(type) {
  405. if (type) {
  406. this.capitalOption.height = this.capitalOption.height - 46;
  407. } else {
  408. this.capitalOption.height = this.capitalOption.height + 46;
  409. }
  410. this.$refs.crud2.getTableHeight();
  411. },
  412. //点击搜索按钮触发
  413. searchChange2(params, done) {
  414. this.page2.currentPage = 1;
  415. this.onLoad2(this.page2, params);
  416. done();
  417. },
  418. refreshChange2() {
  419. this.onLoad2(this.page2, this.search2);
  420. },
  421. currentChange2(val) {
  422. this.page2.currentPage = val;
  423. },
  424. sizeChange2(val) {
  425. this.page2.currentPage = 1;
  426. this.page2.pageSize = val;
  427. },
  428. getDetail(id) {
  429. this.loading = true
  430. getDetail({ id: id })
  431. .then(res => {
  432. this.form = res.data.data;
  433. }).finally(() => {
  434. this.loading = false;
  435. });
  436. pageStatistics({ id: id })
  437. .then(res => {
  438. this.forms = res.data.data;
  439. this.corpsAddrList = res.data.data.corpsAddrList;
  440. })
  441. .finally(() => {
  442. this.loading = false;
  443. });
  444. },
  445. editCustomer() {
  446. this.$emit('editOpen', this.form, 2)
  447. },
  448. editOrder(row) {
  449. if (this.$store.getters.pjxsStatus) {
  450. return this.$alert("销售单已存在,请保存销售单再进行操作", "温馨提示", {
  451. confirmButtonText: "确定",
  452. type: "warning",
  453. callback: action => {
  454. console.log(action);
  455. }
  456. });
  457. }
  458. this.$router.push({
  459. path: '/salesOrder/index',
  460. query: { orderId: row.id },
  461. });
  462. },
  463. async saveColumn() {
  464. const inSave = await this.saveColumnData(
  465. this.getColumnName(278),
  466. this.sellOption
  467. );
  468. if (inSave) {
  469. this.$nextTick(() => {
  470. this.$refs.crud.doLayout();
  471. });
  472. this.$message.success("保存成功");
  473. //关闭窗口
  474. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  475. }
  476. },
  477. async resetColumn() {
  478. this.sellOption = sellOption;
  479. const inSave = await this.delColumnData(
  480. this.getColumnName(278),
  481. sellOption
  482. );
  483. if (inSave) {
  484. this.$nextTick(() => {
  485. this.$refs.crud.doLayout();
  486. });
  487. this.getAllWorkDicts()
  488. this.$message.success("重置成功");
  489. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  490. }
  491. },
  492. async saveColumn2() {
  493. const inSave = await this.saveColumnData(
  494. this.getColumnName(278.1),
  495. this.capitalOption
  496. );
  497. if (inSave) {
  498. this.$nextTick(() => {
  499. this.$refs.crud2.doLayout();
  500. });
  501. this.$message.success("保存成功");
  502. //关闭窗口
  503. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  504. }
  505. },
  506. async resetColumn2() {
  507. this.capitalOption = capitalOption;
  508. const inSave = await this.delColumnData(
  509. this.getColumnName(278.1),
  510. capitalOption
  511. );
  512. if (inSave) {
  513. this.$nextTick(() => {
  514. this.$refs.crud2.doLayout();
  515. });
  516. this.getAllWorkDicts()
  517. this.$message.success("重置成功");
  518. this.$refs.crud2.$refs.dialogColumn.columnBox = false;
  519. }
  520. },
  521. //返回列表
  522. backToList() {
  523. this.$emit("goBack");
  524. }
  525. }
  526. };
  527. </script>
  528. <style lang="scss" scoped>
  529. .page-crad ::v-deep .basic-container__card {
  530. height: 94.2vh;
  531. }
  532. .stat-td {
  533. text-align: center;
  534. position: relative;
  535. }
  536. .stat-img {
  537. width: 95%;
  538. height: 75px;
  539. }
  540. .stat-tip {
  541. position: absolute;
  542. left: 15px;
  543. top: 5px;
  544. .money {
  545. color: #fff;
  546. font-size: 28px;
  547. font-weight: 600;
  548. }
  549. .title {
  550. color: #fff;
  551. font-size: 14px;
  552. text-align: left;
  553. margin-top: 4px;
  554. }
  555. }
  556. .client_info {
  557. font-size: 14px;
  558. color: #333;
  559. line-height: 20px;
  560. margin-top: 10px;
  561. margin-bottom: 10px;
  562. }
  563. </style>