pay-detail.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. <!-- 合同付款详情 -->
  2. <template>
  3. <div class="container-wrap">
  4. <div class="top-title">
  5. <div>
  6. <span>本月{{ titleDay }}日付款统计</span>
  7. <RadioGroup v-model="params.payApprovalStatus" style="margin-left: 20px;" @on-change="stateChange">
  8. <Radio :label="0">
  9. 全部
  10. (<span style="color: red;">{{ data.totalCount || 0 }}</span>)
  11. </Radio>
  12. <Radio :label="1">
  13. 待审批
  14. (<span style="color: red;">{{ data.unApprovalCount || 0 }}</span>)
  15. </Radio>
  16. <Radio :label="2">
  17. 已通过
  18. (<span style="color: red;">{{ data.approvalCount || 0 }}</span>)
  19. </Radio>
  20. </RadioGroup>
  21. <span style="font-size: 12px;margin-left: 20px;">*已付</span>
  22. <span style="font-size: 12px;color: #0077ff">{{ data.hadPayAmount || 0 }}</span>
  23. <span style="font-size: 12px">元,未付</span>
  24. <span style="font-size: 12px;color: red">{{ data.unPayAmount || 0 }}</span>
  25. <span style="font-size: 12px;">元</span>
  26. </div>
  27. <span style="font-size: 12px;font-weight: normal;cursor: pointer;" @click="$router.push('material_pay')">
  28. <Icon type="ios-arrow-dropleft" size="16"/>
  29. 返回上一级
  30. </span>
  31. </div>
  32. <div class="container">
  33. <div class="tabs">
  34. <div
  35. class="tab-item"
  36. @click="tabClick(item.techType, index)"
  37. :class="tabsIndex === index ? 'active' : ''"
  38. v-for="(item, index) in data.techAmtItems"
  39. :key="index">
  40. {{ item.dispalyName + item.amount + '元' }}
  41. </div>
  42. </div>
  43. <div class="table-filter">
  44. <div class="filter-item">
  45. <Button
  46. v-if="data.accountDateItems"
  47. :style="{border: menuIndex === '' ? '1px solid #3F92F9' : ''}"
  48. style="width: 90px;" @click="menuClick()">
  49. 全部
  50. </Button>
  51. </div>
  52. <div class="filter-item" v-for="(item, index) in data.accountDateItems" :key="index">
  53. <Button
  54. :style="{border: menuIndex === index ? '1px solid #3F92F9' : ''}"
  55. style="width: 90px;"
  56. @click="menuClick(item, index)">
  57. {{ item }}天
  58. </Button>
  59. </div>
  60. </div>
  61. <!-- 表格 -->
  62. <div class="table-content">
  63. <div v-if="data.payBillItems && data.payBillItems.length === 0" style="height: 100%;display: flex;justify-content: center;align-items: center">
  64. 暂无数据
  65. </div>
  66. <div v-else class="list">
  67. <div class="item" v-for="(item, index) in data.payBillItems" :key="index">
  68. <div class="content">
  69. <div class="item-left">
  70. <div class="row">
  71. <div class="col">
  72. <div class="label">合同编码:</div>
  73. <div class="value">{{ item.purchaseBillNo }}</div>
  74. </div>
  75. <div class="col">
  76. <div class="label">供应商:</div>
  77. <div class="value">{{ item.supplierName }}</div>
  78. </div>
  79. <div class="col">
  80. <div class="label">付款期限:</div>
  81. <div class="value">{{ item.payTimeLimit }}</div>
  82. </div>
  83. <div class="col" style="flex: 1">
  84. <div class="label">单价:</div>
  85. <div class="value">{{ item.price }}</div>
  86. </div>
  87. </div>
  88. <div class="row">
  89. <div class="col">
  90. <div class="label">物料名称:</div>
  91. <div class="value">{{ item.materialName }}</div>
  92. </div>
  93. <div class="col">
  94. <div class="label">规格:</div>
  95. <div class="value">{{ item.spec }}</div>
  96. </div>
  97. <div class="col">
  98. <div class="label">采购数量:</div>
  99. <div class="value">{{ item.purchaseQty }}</div>
  100. </div>
  101. <div class="col" style="flex: 1"></div>
  102. </div>
  103. <div class="row">
  104. <div class="col">
  105. <div class="label">合同金额:</div>
  106. <div class="value">{{ item.contractAmount }}元</div>
  107. </div>
  108. <div class="col">
  109. <div class="label">质检金额:</div>
  110. <div class="value">{{ item.qtyCheckAmount }}元</div>
  111. </div>
  112. <div class="col">
  113. <div class="label">已付金额:</div>
  114. <div class="value">{{ item.hadPayAmount }}元</div>
  115. </div>
  116. <div class="col" style="flex: 1">
  117. <Tooltip
  118. placement="bottom"
  119. @on-popper-show="getData(item)"
  120. max-width="600"
  121. >
  122. <div class="label">
  123. <div class="label">本次应付:</div>
  124. <div class="value">
  125. <span style="color: red">{{ item.actAmount }}</span>元
  126. </div>
  127. </div>
  128. <div slot="content">
  129. <div v-for="(itemPay, index) in paymentList" :key="index">
  130. <span style="text-align: left; white-space: normal">
  131. 物料编码: {{ itemPay.materialcode }}
  132. </span>
  133. <span
  134. style="
  135. padding-left: 16px;
  136. text-align: left;
  137. white-space: normal;
  138. "
  139. >
  140. 合同批次: {{ itemPay.batchno }}
  141. </span>
  142. <span
  143. style="
  144. padding-left: 16px;
  145. text-align: left;
  146. white-space: normal;
  147. "
  148. >
  149. 退货日期: {{ itemPay.outDate }}
  150. </span>
  151. <span
  152. style="
  153. padding-left: 16px;
  154. text-align: left;
  155. white-space: normal;
  156. "
  157. >
  158. 退货数量: {{ itemPay.quantity }}
  159. </span>
  160. <span
  161. style="
  162. padding-left: 16px;
  163. text-align: left;
  164. white-space: normal;
  165. "
  166. >
  167. 单价: {{ itemPay.price }}
  168. </span>
  169. <span
  170. style="
  171. padding-left: 16px;
  172. text-align: left;
  173. white-space: normal;
  174. "
  175. >
  176. 金额: {{ itemPay.amount }}
  177. </span>
  178. <span
  179. style="
  180. padding-left: 16px;
  181. text-align: left;
  182. white-space: normal;
  183. "
  184. >
  185. 原因: {{ itemPay.applyreason }}
  186. </span>
  187. </div>
  188. </div>
  189. </Tooltip>
  190. </div>
  191. </div>
  192. <div class="row">
  193. <div class="col">
  194. <div class="label">付款说明:</div>
  195. <div class="value">{{ item.payAccount }}</div>
  196. </div>
  197. </div>
  198. <!-- <div class="row">
  199. <div class="col">
  200. <div class="label">审批进度:</div>
  201. <div class="value">{{ item.approvalNode }}</div>
  202. </div>
  203. </div> -->
  204. </div>
  205. <div class="item-right">
  206. <div class="forms">
  207. <div class="row">
  208. <div class="col">
  209. <span class="text" @click="showForm(0, item)">申购单</span>
  210. <Icon type="md-checkmark" color="#07C909" size="20" />
  211. </div>
  212. <div class="col">
  213. <span class="text" @click="showForm(1, item)">入库单</span>
  214. <Icon v-if="item.hasInStock" type="md-checkmark" color="#07C909" size="20" />
  215. <Icon v-else type="md-close" color="red" size="20" />
  216. </div>
  217. <div class="col">
  218. <span class="text" @click="showForm(2, item)">质检单</span>
  219. <Icon v-if="item.hasQtyCheck" type="md-checkmark" color="#07C909" size="20" />
  220. <Icon v-else type="md-close" color="red" size="20" />
  221. </div>
  222. </div>
  223. <div class="row">
  224. <div class="col">
  225. <span class="text" @click="showForm(3, item)">合同</span>
  226. <Icon v-if="item.hasContractFile" type="md-checkmark" color="#07C909" size="20" />
  227. <Icon v-else type="md-close" color="red" size="20" />
  228. </div>
  229. <div class="col">
  230. <span class="text" @click="showForm(4, item)">发票</span>
  231. <Icon v-if="item.hasGreaterCheckAmt" type="md-checkmark" color="#07C909" size="20" />
  232. <Icon v-else type="md-close" color="red" size="20" />
  233. </div>
  234. <div class="col"></div>
  235. </div>
  236. <div class="row">
  237. <div class="col" style="justify-content: flex-start">
  238. <span class="text" style="text-decoration: none;cursor: auto">质检金额&lt;=发票金额</span>
  239. <Icon v-if="item.hasGreaterCheckAmt" type="md-checkmark" color="#07C909" size="20" />
  240. <Icon v-else type="md-close" color="red" size="20" />
  241. </div>
  242. </div>
  243. </div>
  244. <div v-if="['supervisor','manager','finance'].includes(access)">
  245. <div class="btn" v-if="item.flowCheckId">
  246. <Button type="primary" size="small" style="margin-bottom: 10px;" @click="pass(0, item)">审批通过</Button>
  247. <Button type="error" size="small" @click="pass(1, item)">拒绝</Button>
  248. </div>
  249. <div class="btn" v-if="!item.flowCheckId">
  250. <Button size="small" @click="showPayApproval(item.payBillId)">{{ item.approvalNode || '未知状态' }}</Button>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="other" style="margin-top: 2px" v-if="item.hasOtherPayBill">
  256. <Collapse :value="item.payObjList ? '1' : '0'" @on-change="open(item)">
  257. <Panel name="1">
  258. 合同付款记录
  259. <div slot="content">
  260. <div class="row" v-for="(payItem, payIndex) in item.payObjList" :key="payIndex">
  261. <div class="col">
  262. <div class="label">付款时间:</div>
  263. <div class="value">{{ payItem.payTime }}</div>
  264. </div>
  265. <div class="col">
  266. <div class="label">付款金额:</div>
  267. <div class="value">
  268. <span style="color: red">{{ payItem.payAmount }}</span>元
  269. </div>
  270. </div>
  271. <div class="col">
  272. <div class="label">审批状态:</div>
  273. <div class="value" :style="{color: payItem.approvalStateStr === '待审批'? 'red' : '' }">
  274. {{ payItem.approvalStateStr }}
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. </Panel>
  280. </Collapse>
  281. </div>
  282. </div>
  283. </div>
  284. </div>
  285. <!-- 分页 -->
  286. <div class="table-page">
  287. <Page :current="params.pageIndex" :total="params.total" :show-total="true" :page-size="10" show-elevator @on-change="changePage" />
  288. </div>
  289. </div>
  290. <pass-modal v-model="passShow" :data="currentItem" @getlist="getList"></pass-modal>
  291. <my-form-pay v-model="payShow" type="form" :data="currentItem" :showSider="false"></my-form-pay>
  292. <store-in-form v-model="storeInShow" :data="currentItem"></store-in-form>
  293. <quality-form v-model="qualityShow" :data="qualityData"></quality-form>
  294. <invoice-form v-model="invoiceShow" :data="currentItem" @getlist="getList"></invoice-form>
  295. <contract-form v-model="contractShow" :data="currentItem" @getlist="getList"></contract-form>
  296. <apply-form v-model="applyShow" :data="currentItem" @getlist="getList"></apply-form>
  297. <pay-form v-model="show" :data="formData" @getlist="getList"></pay-form>
  298. </div>
  299. </template>
  300. <script>
  301. import {
  302. GetContractPayBillTechSum,
  303. ApprovalBillFlow,
  304. GetApplyPurchasePageList,
  305. GetContractQtyCheckBill,
  306. GetApplyPayBill, GetApplyPurchasePay
  307. } from '@/api/applyPurchase'
  308. import MyTable from '_c/my-table/my-table'
  309. import MyFormPay from '_c/my-modal-pay'
  310. import PassModal from './modals/pass-modal'
  311. import StoreInForm from './modals/store-in-form'
  312. import QualityForm from './modals/quality-form'
  313. import InvoiceForm from './modals/invoice-form'
  314. import ContractForm from './modals/contract-form'
  315. import ApplyForm from './modals/apply-pass-form'
  316. import { GetInStockBill } from '@/api/stock'
  317. import PayForm from '@/view/index/schedule/pay-form'
  318. import axios from "axios";
  319. export default {
  320. name: 'material_pay_detail',
  321. components: {
  322. MyTable,
  323. PassModal,
  324. MyFormPay,
  325. StoreInForm,
  326. QualityForm,
  327. InvoiceForm,
  328. ContractForm,
  329. ApplyForm,
  330. PayForm
  331. },
  332. data () {
  333. return {
  334. menuIndex: '',
  335. titleDay: 0,
  336. tabsIndex: 0,
  337. access: this.$store.state.user.access,
  338. show: false,
  339. contractShow: false,
  340. invoiceShow: false,
  341. qualityShow: false,
  342. storeInShow: false,
  343. payShow: false, // 申购单
  344. passShow: false, // 驳回
  345. applyShow: false,
  346. currentItem: {},
  347. formData: {},
  348. qualityData: [],
  349. tabs: ['总额', '直喷', '热转', '打纸'],
  350. data: {},
  351. params: {
  352. pageIndex: 1,
  353. pageSize: 10,
  354. total: 0,
  355. payApprovalStatus: 0
  356. },
  357. paymentList: [],
  358. }
  359. },
  360. methods: {
  361. getData(item) {
  362. this.paymentList = [];
  363. axios
  364. .post("/cloudApi/stockWater/contractPaymentList", {
  365. balancePurBillNo: item.purchaseBillNo,
  366. })
  367. .then((res) => {
  368. this.paymentList = res.data.data;
  369. });
  370. },
  371. showPayApproval (linkId) {
  372. this.formData = { linkId }
  373. this.show = true
  374. },
  375. open (item) {
  376. if (!item.payObjList) {
  377. GetApplyPayBill({
  378. purchaseBillNo: item.purchaseBillNo,
  379. payBillId: item.payBillId
  380. }).then(res => {
  381. if (res.code === 0) {
  382. this.$set(item, 'payObjList', res.result)
  383. }
  384. })
  385. }
  386. },
  387. stateChange () {
  388. this.params.pageIndex = 1
  389. this.tabsIndex = 0
  390. this.menuIndex = ''
  391. this.params.technologyType = ''
  392. this.params.accountDate = ''
  393. this.getList()
  394. },
  395. changePage (pageIndex) {
  396. this.params.pageIndex = pageIndex
  397. this.getList()
  398. },
  399. menuClick (item = '', index = '') {
  400. this.menuIndex = index
  401. this.params.accountDate = item
  402. this.params.pageIndex = 1
  403. this.getList()
  404. },
  405. tabClick (value, index) {
  406. this.tabsIndex = index
  407. this.menuIndex = ''
  408. this.params.accountDate = ''
  409. this.params.pageIndex = 1
  410. this.params.technologyType = value
  411. this.getList()
  412. },
  413. showForm (type, item) {
  414. this.currentItem = { ...item }
  415. switch (type) {
  416. // 申购单
  417. case 0:
  418. this.currentItem.id = this.currentItem.payBillId
  419. GetApplyPurchasePageList({
  420. pageIndex: 1,
  421. pageSize: 1,
  422. purBillState: 1,
  423. keyWord: this.currentItem.applyBillNo
  424. }).then(res => {
  425. if (res.code === 0) {
  426. this.currentItem = { ...this.currentItem, ...res.result.list[0] }
  427. this.payShow = true
  428. console.log(this.currentItem)
  429. }
  430. })
  431. break
  432. case 1:
  433. GetInStockBill({
  434. inOutStorageNo: this.currentItem.inOutStorageNo,
  435. applyBillNo: this.currentItem.applyBillNo
  436. }).then(res => {
  437. if (res.code === 0) {
  438. this.currentItem = { ...this.currentItem, ...res.result }
  439. this.storeInShow = true
  440. }
  441. })
  442. break
  443. case 2:
  444. GetContractQtyCheckBill({
  445. purchaseBillNo: this.currentItem.purchaseBillNo
  446. }).then(res => {
  447. if (res.code === 0) {
  448. this.qualityData = res.result
  449. this.qualityShow = true
  450. }
  451. })
  452. break
  453. case 3:
  454. this.contractShow = true
  455. break
  456. case 4:
  457. this.invoiceShow = true
  458. break
  459. }
  460. },
  461. /* 审核 */
  462. pass (type, item) {
  463. if (type === 0) {
  464. GetApplyPurchasePay({
  465. id: item.payBillId
  466. }).then(res => {
  467. if (res.code === 0) {
  468. this.currentItem = { ...res.result, payBillId: item.payBillId, flowCheckId: item.flowCheckId,invoiceAmount:item.invoiceAmount,adjustAmount:item.qtyCheckAmount }
  469. console.log(res.result)
  470. this.applyShow = true
  471. }
  472. })
  473. } else {
  474. this.currentItem = { purchaseBillNo: item.purchaseBillNo, flowCheckId: item.flowCheckId }
  475. this.passShow = true
  476. }
  477. },
  478. /* 审批 */
  479. cfm (type) {
  480. ApprovalBillFlow({
  481. linkCheckId: [this.currentItem.flowCheckId],
  482. updateAction: type,
  483. suggestions: this.remark
  484. }).then(res => {
  485. if (res.code === 0) {
  486. this.$Message.info(res.msg || '操作成功!')
  487. this.currentItem = {}
  488. this.getList()
  489. }
  490. })
  491. },
  492. getList () {
  493. /* 获取供应商聚合列表 */
  494. GetContractPayBillTechSum({
  495. ...this.params
  496. }).then(res => {
  497. if (res.code === 0) {
  498. res.result.unPayAmount = res.result.unPayAmount.toFixed(2)
  499. res.result.payBillItems.map(item => {
  500. item.actAmount = item.actAmount.toFixed(2)
  501. })
  502. res.result.techAmtItems.map(item => {
  503. item.amount = item.amount.toFixed(2)
  504. })
  505. this.data = res.result
  506. this.params.total = res.result.pageCount
  507. }
  508. })
  509. }
  510. },
  511. mounted () {
  512. let date = new Date()
  513. if (date.getDate() > 15) {
  514. date.setDate(1) // 设置到当月第一天
  515. date.setMonth(date.getMonth() + 1) // 再设置成下个月
  516. date.setDate(date.getDate() - 1) // 最后减一天即为当月最后一天
  517. this.titleDay = date.getDate()
  518. } else {
  519. this.titleDay = 15
  520. }
  521. this.getList()
  522. }
  523. }
  524. </script>
  525. <style lang="less" scoped>
  526. .container-wrap {
  527. height: 100%;
  528. overflow: hidden;
  529. .top-title {
  530. margin-bottom: 18px;
  531. height: 16px;
  532. line-height: 16px;
  533. font-size: 16px;
  534. font-weight: bold;
  535. display: flex;
  536. justify-content: space-between;
  537. }
  538. .container {
  539. height: ~"calc(100% - 34px)";
  540. display: flex;
  541. flex-direction: column;
  542. border: 1px solid #d7d7d7;
  543. .tabs {
  544. box-sizing: border-box;
  545. height: 50px;
  546. display: flex;
  547. justify-content: space-between;
  548. align-items: center;
  549. .tab-item {
  550. box-sizing: border-box;
  551. flex: 1;
  552. overflow: auto;
  553. border-right: 1px solid #dcdee2;
  554. border-bottom: 1px solid #dcdee2;
  555. text-align: center;
  556. height: 100%;
  557. display: flex;
  558. align-items: center;
  559. justify-content: center;
  560. font-size: 14px;
  561. font-weight: bold;
  562. cursor: pointer;
  563. &:last-child {
  564. border-right: none;
  565. }
  566. &.active {
  567. color: #3F92F9;
  568. border-bottom: 3px solid #3F92F9;
  569. }
  570. }
  571. }
  572. .table-filter {
  573. padding: 10px;
  574. padding-bottom: 0;
  575. .filter-item {
  576. margin-right: 10px;
  577. float: left;
  578. //&:last-child {
  579. // margin-right: 0;
  580. //}
  581. }
  582. }
  583. .table-content {
  584. flex: 1;
  585. overflow: hidden;
  586. .row {
  587. margin-bottom: 5px;
  588. display: flex;
  589. justify-content: space-between;
  590. align-items: flex-start;
  591. &:last-child {
  592. margin-bottom: 0;
  593. }
  594. .col {
  595. padding: 0 5px;
  596. flex: 2;
  597. overflow: hidden;
  598. display: flex;
  599. justify-content: space-between;
  600. align-items: flex-start;
  601. .value {
  602. flex: 1;
  603. overflow: hidden;
  604. word-break: break-all;
  605. }
  606. }
  607. }
  608. .list {
  609. padding: 10px;
  610. height: 100%;
  611. overflow: auto;
  612. .item {
  613. margin-bottom: 10px;
  614. &:last-child {
  615. margin-bottom: 0;
  616. }
  617. .content {
  618. display: flex;
  619. justify-content: space-between;
  620. align-items: center;
  621. padding: 10px;
  622. border: 1px solid #d7d7d7;
  623. border-radius: 5px;
  624. background: #FFFFFF;
  625. .item-left {
  626. padding: 0 10px;
  627. flex: 1;
  628. border-right: 1px solid #333333;
  629. }
  630. .item-right {
  631. display: flex;
  632. justify-content: space-between;
  633. align-items: center;
  634. .forms {
  635. padding: 0 10px;
  636. .col {
  637. align-items: center;
  638. .text {
  639. text-decoration: underline;
  640. cursor: pointer;
  641. }
  642. }
  643. }
  644. .btn {
  645. display: flex;
  646. flex-direction: column;
  647. }
  648. }
  649. }
  650. }
  651. }
  652. }
  653. .table-page {
  654. padding: 10px 0;
  655. display: flex;
  656. justify-content: center;
  657. align-items: center;
  658. height: 43px;
  659. overflow: hidden;
  660. }
  661. }
  662. }
  663. </style>