index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. <template>
  2. <zj-form-container>
  3. <!-- 支付费用-安装 -->
  4. <zj-form-module v-if="~[1, 2, 3, 4].indexOf(this.orderType)" title="支付费用">
  5. <zj-table
  6. :is-drop="true"
  7. :columns="paymentColumns"
  8. :table-data="paymentData"
  9. :table-attributes="{
  10. border: true
  11. }"
  12. />
  13. <el-dialog
  14. :modal="true"
  15. title="服务支付工单(商品详情)"
  16. :visible.sync="installDialog"
  17. width="60%"
  18. :show-close="true"
  19. :close-on-click-modal="false"
  20. :modal-append-to-body="false"
  21. >
  22. <zj-table
  23. :is-drop="true"
  24. :columns="installColumns"
  25. :table-data="installTableData"
  26. :table-attributes="{
  27. border: true
  28. }"
  29. />
  30. </el-dialog>
  31. </zj-form-module>
  32. <!-- 支付费用-维修/移机 -->
  33. <zj-form-module v-else title="支付费用">
  34. <div class="ZF_header">维修费用信息</div>
  35. <el-descriptions class="margin-top" :column="3" :border="true" :label-style="{ width: '140px' }">
  36. <el-descriptions-item>
  37. <template slot="label"> 流水号 </template>
  38. {{ info.orderPayStreamWaterId }}
  39. </el-descriptions-item>
  40. <el-descriptions-item>
  41. <template slot="label"> 操作者名称 </template>
  42. {{ info.updateBy }}
  43. </el-descriptions-item>
  44. <el-descriptions-item>
  45. <template slot="label"> 操作者编号 </template>
  46. {{ info.insureName }}
  47. </el-descriptions-item>
  48. <el-descriptions-item>
  49. <template slot="label"> 支付方式 </template>
  50. 微信支付
  51. </el-descriptions-item>
  52. <el-descriptions-item>
  53. <template slot="label"> 客户名称 </template>
  54. {{ info.customerName }}
  55. </el-descriptions-item>
  56. <el-descriptions-item>
  57. <template slot="label"> 电话号码 </template>
  58. {{ info.customerMobile }}
  59. </el-descriptions-item>
  60. <el-descriptions-item>
  61. <template slot="label"> 支付状态 </template>
  62. {{ info.isPay === 'YES' ? '是' : '否' }}
  63. </el-descriptions-item>
  64. <el-descriptions-item>
  65. <template slot="label"> 支付总金额 </template>
  66. {{ info.payValue }}
  67. </el-descriptions-item>
  68. <el-descriptions-item>
  69. <template slot="label"> 总手续费 </template>
  70. {{ (info.chargeValue || 0) * (info.qty || 0) }}
  71. </el-descriptions-item>
  72. <el-descriptions-item>
  73. <template slot="label"> 支付时间 </template>
  74. {{ info.payTime }}
  75. </el-descriptions-item>
  76. <el-descriptions-item v-if="~[6].indexOf(this.orderType)">
  77. <template slot="label"> 移机类型 </template>
  78. {{ info.insureName }}
  79. </el-descriptions-item>
  80. <el-descriptions-item>
  81. <template v-if="~[6].indexOf(this.orderType)" slot="label"> 匹数 </template>
  82. {{ info.insureName }}
  83. </el-descriptions-item>
  84. </el-descriptions>
  85. <br>
  86. <div class="ZF_header">支付明细</div>
  87. <zj-table
  88. :is-drop="true"
  89. :columns="repairPaymentColumns"
  90. :table-data="repairPaymentData"
  91. :table-attributes="{
  92. border: true
  93. }"
  94. />
  95. <br>
  96. <el-descriptions class="margin-top" :column="1" :border="false" :label-style="{ width: '140px' }">
  97. <el-descriptions-item>
  98. <template slot="label"> 收费单据 </template>
  99. <div v-if="info.fileUrl.length > 0">
  100. <el-image
  101. v-for="v in info.fileUrl"
  102. :key="v.fileUrl"
  103. style="width: 210px; height: 130px; margin-right: 10px"
  104. :src="$imageUrl + v.fileUrl"
  105. :preview-src-list="[$imageUrl + v.fileUrl]"
  106. >
  107. <div slot="error" style="height: 100%; display: flex; justify-content: center; align-items: center">
  108. <i>暂无图片</i>
  109. </div>
  110. </el-image>
  111. </div>
  112. </el-descriptions-item>
  113. <el-descriptions-item>
  114. <template slot="label"> 备注 </template>
  115. <el-input v-model="info.remark" type="textarea" disabled />
  116. </el-descriptions-item>
  117. </el-descriptions>
  118. <el-descriptions
  119. v-if="~[6].indexOf(this.orderType)"
  120. class="margin-top"
  121. :column="2"
  122. :border="false"
  123. :label-style="{ width: '140px' }"
  124. >
  125. <el-descriptions-item>
  126. <template slot="label"> 支付状态 </template>
  127. {{ info.isPay === 'YES'? '是':'否'}}
  128. </el-descriptions-item>
  129. <el-descriptions-item>
  130. <template slot="label"> 支付时间 </template>
  131. {{ info.payTime }}
  132. </el-descriptions-item>
  133. <el-descriptions-item>
  134. <template slot="label"> 商户交易号 </template>
  135. {{ info.outTradeNo }}
  136. </el-descriptions-item>
  137. <el-descriptions-item>
  138. <template slot="label"> 第三方交易号 </template>
  139. {{ info.transactionId }}
  140. </el-descriptions-item>
  141. </el-descriptions>
  142. <br>
  143. <div class="ZF_header">交易记录</div>
  144. <zj-table
  145. :is-drop="true"
  146. :columns="repairBusinessColumns"
  147. :table-data="repairBusinessData"
  148. :table-attributes="{
  149. border: true
  150. }"
  151. />
  152. </zj-form-module>
  153. </zj-form-container>
  154. </template>
  155. <script>
  156. export default {
  157. data() {
  158. return {
  159. installDialog: false,
  160. installTableData: [],
  161. info: {
  162. websitName: '',
  163. orderBaseId: '',
  164. updateBy: '',
  165. updateByNumber: '',
  166. customerName: '',
  167. customerMobile: '',
  168. payValue: '',
  169. chargeValue: '',
  170. remark: '',
  171. payTime: '',
  172. fileUrl: [],
  173. qty: ''
  174. },
  175. paymentData: [],
  176. repairPaymentData: [],
  177. repairBusinessData: [],
  178. washPaymentData: [],
  179. orderType: ''
  180. }
  181. },
  182. computed: {
  183. paymentColumns() {
  184. return [
  185. {
  186. columnAttributes: {
  187. label: '辅材单号',
  188. prop: 'outTradeNo',
  189. width: 200
  190. }
  191. },
  192. {
  193. columnAttributes: {
  194. label: '支付商户单号',
  195. prop: 'outTradeNo',
  196. width: 200
  197. }
  198. },
  199. {
  200. columnAttributes: {
  201. label: '操作网点',
  202. prop: 'websitName'
  203. }
  204. },
  205. {
  206. columnAttributes: {
  207. label: '操作人',
  208. prop: 'createBy'
  209. }
  210. },
  211. {
  212. columnAttributes: {
  213. label: '支付状态',
  214. prop: 'isPay'
  215. },
  216. render: (h, { row, column, $index }) => {
  217. return (
  218. <div style='padding-left:6px'>{row.isPay == 'YES' ? '已支付' : row.isPay == 'NO' ? '未支付' : ''}</div>
  219. )
  220. }
  221. },
  222. {
  223. columnAttributes: {
  224. label: '支付时间',
  225. prop: 'payTime'
  226. }
  227. },
  228. {
  229. columnAttributes: {
  230. label: '金额',
  231. prop: 'payValue'
  232. }
  233. },
  234. {
  235. columnAttributes: {
  236. label: '商品详情',
  237. prop: 'brandName'
  238. },
  239. render: (h, { row, column, $index }) => {
  240. return (
  241. <div style=''>
  242. {' '}
  243. <el-button
  244. size='mini'
  245. type='text'
  246. onClick={async() => {
  247. this.installDialog = true
  248. this.getOrderPayOutlayDetail(row.orderBaseId, row.orderPayRecordId, 'INSTALL')
  249. }}
  250. >
  251. 查看详情
  252. </el-button>
  253. </div>
  254. )
  255. }
  256. },
  257. {
  258. columnAttributes: {
  259. label: '备注',
  260. prop: 'remark'
  261. }
  262. }
  263. ]
  264. },
  265. installColumns() {
  266. return [
  267. {
  268. columnAttributes: {
  269. label: '商品ID',
  270. prop: 'orderBaseId',
  271. width: 200
  272. }
  273. },
  274. {
  275. columnAttributes: {
  276. label: '商品名称',
  277. prop: 'goodsName'
  278. }
  279. },
  280. {
  281. columnAttributes: {
  282. label: '数量',
  283. prop: 'qty'
  284. }
  285. },
  286. {
  287. columnAttributes: {
  288. label: '单价',
  289. prop: 'price'
  290. }
  291. },
  292. {
  293. columnAttributes: {
  294. label: '小计',
  295. prop: 'totalAmount'
  296. }
  297. }
  298. ]
  299. },
  300. repairPaymentColumns() {
  301. return [
  302. {
  303. columnAttributes: {
  304. label: '费用项目',
  305. prop: 'goodsName'
  306. }
  307. },
  308. {
  309. columnAttributes: {
  310. label: '收取费用',
  311. prop: 'totalAmount'
  312. }
  313. },
  314. {
  315. columnAttributes: {
  316. label: '手续费',
  317. prop: 'chargeValue'
  318. }
  319. },
  320. {
  321. columnAttributes: {
  322. label: '单价',
  323. prop: 'price'
  324. }
  325. },
  326. {
  327. columnAttributes: {
  328. label: '数量',
  329. prop: 'qty'
  330. }
  331. },
  332. {
  333. columnAttributes: {
  334. label: '总手续费',
  335. prop: ''
  336. },
  337. render: (h, { row, column, $index }) => {
  338. return (
  339. <div>{+row.chargeValue * +row.qty}</div>
  340. )
  341. }
  342. },
  343. ]
  344. },
  345. repairBusinessColumns() {
  346. return [
  347. // {
  348. // columnAttributes: {
  349. // label: 'ID',
  350. // prop: 'orderBaseId'
  351. // }
  352. // },
  353. {
  354. columnAttributes: {
  355. label: '交易类型',
  356. prop: 'tradeType'
  357. }
  358. },
  359. {
  360. columnAttributes: {
  361. label: '交易金额',
  362. prop: 'payValue'
  363. }
  364. },
  365. {
  366. columnAttributes: {
  367. label: '原工单流水',
  368. prop: 'payValue'
  369. }
  370. },
  371. {
  372. columnAttributes: {
  373. label: '商户交易号',
  374. prop: 'outTradeNo'
  375. }
  376. },
  377. {
  378. columnAttributes: {
  379. label: '第三方交易号',
  380. prop: 'transactionId'
  381. }
  382. },
  383. {
  384. columnAttributes: {
  385. label: '交易状态',
  386. prop: 'isPay'
  387. },
  388. render: (h, { row, column, $index }) => {
  389. return (
  390. <div style='padding-left:6px'>{row.isPay == 'YES' ? '已支付' : row.isPay == 'NO' ? '未支付' : ''}</div>
  391. )
  392. }
  393. },
  394. {
  395. columnAttributes: {
  396. label: '交易时间',
  397. prop: 'payTime'
  398. }
  399. },
  400. {
  401. columnAttributes: {
  402. label: '创建时间',
  403. prop: 'createTime'
  404. }
  405. }
  406. // {
  407. // columnAttributes: {
  408. // label: '操作',
  409. // prop: 'brandName'
  410. // },
  411. // render: (h, { row, column, $index }) => {
  412. // return (
  413. // <div style="">
  414. // <el-button
  415. // size="mini"
  416. // type="text"
  417. // onClick={async () => {
  418. // this.installDialog = true
  419. // this.getOrderPayOutlayDetail(row.orderBaseId, row.outTradeNo, 'REPAIR')
  420. // this.getOrderPayOutlayFileList(row.orderBaseId, row.outTradeNo)
  421. // }}
  422. // >
  423. // 查看详情
  424. // </el-button>
  425. // </div>
  426. // )
  427. // }
  428. // }
  429. ]
  430. },
  431. washPaymentColumns() {
  432. return [
  433. {
  434. columnAttributes: {
  435. label: '清洗费用名称',
  436. prop: 'goodsName'
  437. }
  438. },
  439. {
  440. columnAttributes: {
  441. label: '单价',
  442. prop: 'price'
  443. }
  444. },
  445. {
  446. columnAttributes: {
  447. label: '数量',
  448. prop: 'qty'
  449. }
  450. },
  451. // {
  452. // columnAttributes: {
  453. // label: '单位',
  454. // prop: 'brandName'
  455. // }
  456. // },
  457. {
  458. columnAttributes: {
  459. label: '收取总费用',
  460. prop: 'totalAmount'
  461. }
  462. },
  463. {
  464. columnAttributes: {
  465. label: '清洗手续费',
  466. prop: 'chargeValue'
  467. }
  468. }
  469. ]
  470. }
  471. },
  472. methods: {
  473. init(id, params, orderType) {
  474. this.orderType = orderType
  475. this.getOrderPayOutlayList(id)
  476. },
  477. getOrderPayOutlayList(id, type) {
  478. getOrderPayOutlayList({ orderBaseId: id }).then(res => {
  479. if (~[1, 2, 3, 4].indexOf(this.orderType)) {
  480. this.paymentData = res.data.filter(k => k.isPay === 'YES')
  481. } else {
  482. this.repairBusinessData = res.data.filter(k => k.isPay === 'YES')
  483. if (this.repairBusinessData && this.repairBusinessData.length) {
  484. this.info.websitName = this.repairBusinessData[0].websitName
  485. this.info.orderBaseId = this.repairBusinessData[0].orderBaseId
  486. this.info.updateBy = this.repairBusinessData[0].updateBy
  487. this.info.updateByNumber = this.repairBusinessData[0].updateByNumber
  488. this.info.customerName = this.repairBusinessData[0].customerName
  489. this.info.customerMobile = this.repairBusinessData[0].customerMobile
  490. this.info.payValue = this.repairBusinessData[0].payValue
  491. this.info.payTime = this.repairBusinessData[0].payTime
  492. this.info.chargeValue = this.repairBusinessData[0].chargeValue
  493. this.info.qty = this.repairBusinessData[0].qty
  494. this.info.remark = this.repairBusinessData[0].remark
  495. this.info.isPay = this.repairBusinessData[0].isPay
  496. this.info.outTradeNo = this.repairBusinessData[0].outTradeNo
  497. this.info.transactionId = this.repairBusinessData[0].transactionId
  498. this.getOrderPayOutlayDetail(id, this.repairBusinessData[0].orderPayRecordId)
  499. this.getOrderPayOutlayFileList(id, this.repairBusinessData[0].outTradeNo)
  500. }
  501. }
  502. })
  503. },
  504. getOrderPayOutlayFileList(orderBaseId, outTradeNo) {
  505. getOrderPayOutlayFileList({ orderBaseId, outTradeNo }).then(res => {
  506. if (~[6].indexOf(this.orderType)) {
  507. this.info.fileUrl = res.data ? res.data : []
  508. } else {
  509. this.info.fileUrl = res.data ? [res.data[0].fileUrl] : ''
  510. }
  511. })
  512. },
  513. getOrderPayOutlayDetail(orderBaseId, orderPayRecordId, type) {
  514. // {/* INSTALL=安装单 REPAIR=维修单*/}
  515. getOrderPayOutlayDetail({ orderPayRecordId }).then(res => {
  516. if (~[1, 2, 3, 4].indexOf(this.orderType)) {
  517. this.installTableData = res.data
  518. } else {
  519. this.repairPaymentData = res.data
  520. }
  521. })
  522. }
  523. }
  524. }
  525. </script>
  526. <style lang="scss" scoped>
  527. .ZF_header {
  528. font-size: 14px;
  529. margin: 0px 0 8px;
  530. }
  531. </style>
  532. .