detailsInfo.vue 23 KB

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