refund_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <template>
  2. <div style="width: 100%; height: 100%">
  3. <template-page
  4. v-show="showSurrender == 0"
  5. ref="pageRef"
  6. :operation="operation()"
  7. :options-evens-group="optionsEvensGroup"
  8. :get-list="getList"
  9. :export-list="exportList"
  10. :table-attributes="tableAttributes"
  11. :table-events="tableEvents"
  12. :column-parsing="columnParsing"
  13. :replace-or-not-map="false"
  14. >
  15. <div slot="moreSearch">
  16. <ul class="ulStyle">
  17. <li class="title">
  18. 金额:<span class="num">{{ (Number(numSum.amountC) || 0) | numToFixed }}</span>
  19. </li>
  20. <li class="title">
  21. 数量:<span class="num">{{ Number(numSum.totalC) || 0 }}</span>
  22. </li>
  23. <li class="title">
  24. 项目数:<span class="num">{{ Number(numSum.totalEC) || 0 }}</span>
  25. </li>
  26. </ul>
  27. </div>
  28. </template-page>
  29. <div v-if="showSurrender == 1" class="app-container">
  30. <refund-list-detail
  31. :detail-id="detailId"
  32. @updateList="updateList"
  33. @setShowPage="
  34. val => {
  35. $refs.pageRef.refreshList()
  36. showSurrender = val
  37. }
  38. "
  39. />
  40. </div>
  41. <div v-else-if="showSurrender == 2" class="app-container">
  42. <refund-replenish
  43. :detail-id="detailId"
  44. @updateList="updateList"
  45. @setShowPage="
  46. val => {
  47. $refs.pageRef.refreshList()
  48. showSurrender = val
  49. }
  50. "
  51. />
  52. </div>
  53. <div v-else-if="showSurrender == 3" class="app-container">
  54. <refund-reexamine
  55. :detail-id="detailId"
  56. @updateList="updateList"
  57. @setShowPage="
  58. val => {
  59. $refs.pageRef.refreshList()
  60. showSurrender = val
  61. }
  62. "
  63. />
  64. </div>
  65. <examine-dialog :is-show.sync="isShowExamineDialog" :examine-form.sync="examineForm" />
  66. </div>
  67. </template>
  68. <script>
  69. import {
  70. examineData,
  71. getDepositManageDate,
  72. secondRefund } from '@/api/engin_deposit/refund_list'
  73. import { downloadFiles, handleImport } from '@/utils/util'
  74. import ExamineDialog from '@/components/Common/examine-dialog'
  75. import RefundListDetail from './components/refund_list-detail.vue'
  76. import RefundReplenish from './components/refund_replenish.vue'
  77. import RefundReexamine from './components/refund_reexamine.vue'
  78. import TemplatePage from '@/components/template/template-page-1.vue'
  79. import { depositManageHomeList, depositManageHomeListExport, getCountList } from '@/api/deposit_list_v2.js'
  80. export default {
  81. components: {
  82. RefundListDetail,
  83. ExamineDialog,
  84. RefundReplenish,
  85. RefundReexamine,
  86. TemplatePage
  87. },
  88. data() {
  89. return {
  90. importFileList: [],
  91. enginOrderType: 'HOME', // 列表类型
  92. currentPage: 1, // 当前页码
  93. pageSize: 10, // 每页数量
  94. listTotal: 0, // 列表总数
  95. dataList: [], // 列表数据
  96. screenForm: {
  97. confirmName: '', // 审核人
  98. createName: '', // 创建人
  99. customerKeyword: '', // 客户编码/客户名称
  100. endDeliverTime: '', // 发货申请日期-结束
  101. enginOrderNo: '', // 工程订单编号
  102. enginOrderType: 'HOME', // 工程订单类型
  103. examineStatus: '', // 状态
  104. refEnginRecordNo: '', // 登录单号
  105. refProjectName: '', // 项目名称
  106. refUseUnit: '', // 使用单位
  107. startDeliverTime: '', // 发货申请日期-开始
  108. startSubmitTime: '',
  109. startConfirmTime: '',
  110. isRefundDeposit: null,
  111. startInstallTime: '',
  112. endConfirmTime: '',
  113. endInstallTime: '',
  114. specification: '',
  115. refFactoryNo: '',
  116. factoryNo: '',
  117. specialNo: '',
  118. refRegionWork: '',
  119. endSubmitTime: '',
  120. refTradeCategory: '',
  121. startAcceptTime: '',
  122. endAcceptTime: '',
  123. geLiInerNote: '',
  124. startFactoryNo: '',
  125. endFactoryNo: '',
  126. settlementStatus: '',
  127. mailFactoryStatus: '',
  128. endOrderDate: '',
  129. startOrderDate: '',
  130. dataStates: [],
  131. startInstallTime: '',
  132. endInstallTime: '',
  133. startSettlementDate: '',
  134. endSettlementDate: '',
  135. endMailFactoryDate: '',
  136. startMailFactoryDate: ''
  137. }, // 搜索表单
  138. refundDepositArr: [
  139. {
  140. label: '是',
  141. value: true
  142. },
  143. {
  144. label: '否',
  145. value: false
  146. }
  147. ],
  148. isCollapse: true,
  149. examineStatusArr: [
  150. {
  151. label: '保存',
  152. value: 'SAVE'
  153. },
  154. {
  155. label: '待审核',
  156. value: 'WAIT'
  157. },
  158. {
  159. label: '通过',
  160. value: 'OK'
  161. },
  162. {
  163. label: '不通过',
  164. value: 'FAIL'
  165. },
  166. {
  167. label: '关闭',
  168. value: 'CLOSE'
  169. }
  170. ],
  171. dataStatesArr: [
  172. {
  173. label: '正常',
  174. value: 'NORMAL'
  175. },
  176. {
  177. label: '补充',
  178. value: 'AMEND'
  179. },
  180. {
  181. label: '待复核',
  182. value: 'WAIT_REVIEW'
  183. },
  184. {
  185. label: '复核',
  186. value: 'REVIEW'
  187. }
  188. ],
  189. listLoading: false, // 列表加载loading
  190. examine: '',
  191. showSurrender: 0,
  192. detailId: '',
  193. selectData: [],
  194. mailFactoryStatus: '',
  195. settlementStatus: '',
  196. isShowExamineDialog: false,
  197. examineForm: {
  198. status: 'OK',
  199. remark: ''
  200. },
  201. numSum: {
  202. totalC: 0,
  203. amountC: 0
  204. },
  205. // 表格属性
  206. tableAttributes: {
  207. // 启用勾选列
  208. selectColumn: true
  209. },
  210. // 表格事件
  211. tableEvents: {
  212. 'selection-change': this.selectionChange
  213. },
  214. recordSelected: []
  215. }
  216. },
  217. computed: {
  218. optionsEvensGroup() {
  219. return [
  220. [
  221. [
  222. {
  223. name: '',
  224. isRole: this.$checkBtnRole('examine', this.$route.meta.roles),
  225. render: () => {
  226. return (
  227. <el-popconfirm
  228. title='批量审核吗?'
  229. onOnConfirm={() => {
  230. if (!this.selectData.length) {
  231. this.$errorMsg('请选择')
  232. return
  233. }
  234. this.batchExamine()
  235. }}
  236. >
  237. <span slot='reference'>批量审核工程机已审单据</span>
  238. </el-popconfirm>
  239. )
  240. }
  241. }
  242. ]
  243. ],
  244. [
  245. [
  246. {
  247. name: '',
  248. render: () => {
  249. return (
  250. <el-upload
  251. action=''
  252. http-request={this.handleImport}
  253. file-list={this.importFileList}
  254. show-file-list={false}
  255. >
  256. <span>导入</span>
  257. </el-upload>
  258. )
  259. }
  260. }
  261. ]
  262. ]
  263. ]
  264. },
  265. isCustomer() {
  266. return this.$store.getters.customerId && this.$store.getters.customerNumber
  267. }
  268. },
  269. methods: {
  270. // 列表请求函数
  271. getList(...p) {
  272. this.$refs.pageRef.showTable = false
  273. this.recordSelected = []
  274. getCountList(...p).then(res => {
  275. this.numSum = res.data
  276. })
  277. return depositManageHomeList(...p)
  278. },
  279. // 列表导出函数
  280. exportList: depositManageHomeListExport,
  281. // 表格列解析渲染数据更改
  282. columnParsing(item, defaultData) {
  283. return defaultData
  284. },
  285. // 监听勾选变化
  286. selectionChange(data) {
  287. this.selectData = data
  288. },
  289. operation() {
  290. return (h, { row, index, column }) => {
  291. return (
  292. <div class='operation-btns'>
  293. {row.examineStatus == 'WAIT' && this.$checkBtnRole('examine', this.$route.meta.roles) ? (
  294. <el-button
  295. type='text'
  296. class='textColor'
  297. onClick={() => {
  298. this.examineFn(row.depositManageId)
  299. }}
  300. >
  301. 审批
  302. </el-button>
  303. ) : null}
  304. {row.dataState == 'WAIT_REVIEW' &&
  305. row.examineStatus == 'OK' &&
  306. this.$checkBtnRole('examine', this.$route.meta.roles) ? (
  307. <el-button
  308. type='text'
  309. class='textColor'
  310. onClick={() => {
  311. this.reexamineClick(row.depositManageId)
  312. }}
  313. >
  314. 复核
  315. </el-button>
  316. ) : null}
  317. {row.examineStatus == 'SAVE' ||
  318. row.examineStatus == 'OK' ||
  319. row.examineStatus == 'FAIL' ||
  320. row.dataState == 'WAIT_REVIEW' ||
  321. row.dataState == 'REVIEW' ||
  322. row.dataState == 'AMEND' ? (
  323. <el-button
  324. type='text'
  325. class='textColor'
  326. onClick={() => {
  327. this.infoFn(row.depositManageId)
  328. }}
  329. >
  330. 详情
  331. </el-button>
  332. ) : null}
  333. {row.examineStatus == 'OK' && !row.isRefundDeposit ? (
  334. <el-popconfirm
  335. style='margin-left: 10px'
  336. title='二次退押吗?'
  337. onOnConfirm={() => {
  338. this.secondRefund(row)
  339. }}
  340. >
  341. <el-button slot='reference' type='text' size='mini'>
  342. 二次退押
  343. </el-button>
  344. </el-popconfirm>
  345. ) : null}
  346. </div>
  347. )
  348. }
  349. },
  350. // ------------------------------------
  351. replenishClick(id) {
  352. this.detailId = id
  353. this.showSurrender = 2
  354. },
  355. reexamineClick(id) {
  356. this.detailId = id
  357. this.showSurrender = 3
  358. },
  359. // 同步资料日期
  360. async syncDateFn() {
  361. await getDepositManageDate()
  362. this.$message.success('同步资料日期成功')
  363. },
  364. // 导入
  365. async handleImport(param) {
  366. const file = param.file
  367. const formData = new FormData()
  368. formData.append('file', file)
  369. const result = await handleImport('deposit-manage/import', formData)
  370. console.log(result)
  371. this.importFileList = []
  372. if (result.code == 200) {
  373. this.$message.success('导入成功')
  374. this.$refs.pageRef.refreshList()
  375. } else {
  376. this.$message.error(result.message)
  377. }
  378. },
  379. // 打开 批量审批
  380. batchExamine() {
  381. if (this.selectData.length) {
  382. this.submitExamineForm()
  383. // this.isShowExamineDialog = true;
  384. return
  385. }
  386. this.$errorMsg('请选择')
  387. },
  388. // 提交 批量审批
  389. submitExamineForm() {
  390. let ids = this.selectData.map(item => {
  391. return item.depositManageId
  392. })
  393. ids = [...new Set(ids)]
  394. examineData({
  395. ids: ids.join(',')
  396. // examineStatus: this.examineForm.status,
  397. // examineRemark: this.examineForm.remark,
  398. // serviceId: ''
  399. }).then(res => {
  400. this.isShowExamineDialog = false
  401. this.$successMsg('修改成功')
  402. this.$refs.pageRef.refreshList()
  403. })
  404. },
  405. // 审批后更新列表数据
  406. updateList() {
  407. this.$refs.pageRef.refreshList()
  408. },
  409. // 二次退押
  410. secondRefund(row) {
  411. delete row.sums1
  412. delete row.sums2
  413. secondRefund(row).then(res => {
  414. this.$successMsg('二次退押成功')
  415. this.$refs.pageRef.refreshList()
  416. })
  417. },
  418. // 导出
  419. exportFn() {
  420. const params = {
  421. ...this.screenForm,
  422. orderType: 'HOME',
  423. examine: this.examine
  424. }
  425. downloadFiles('deposit-manage/export', params)
  426. },
  427. // 详情
  428. infoFn(id) {
  429. this.detailId = id
  430. this.showSurrender = 1
  431. },
  432. examineFn(id) {
  433. this.detailId = id
  434. this.showSurrender = 1
  435. }
  436. }
  437. }
  438. </script>
  439. <style lang="scss" scoped>
  440. .dateStyle {
  441. width: 100%;
  442. }
  443. .import-btn {
  444. margin-left: 10px;
  445. display: inline-block;
  446. }
  447. .fanwei {
  448. display: flex;
  449. span {
  450. margin: 0 20px;
  451. line-height: 28px;
  452. }
  453. }
  454. .ulStyle{
  455. list-style: none;
  456. padding: 0;
  457. li{
  458. display: inline-block;
  459. margin-right: 20px;
  460. }
  461. }
  462. .title {
  463. display: inline-block;
  464. font-weight: 700;
  465. margin-right: 20px;
  466. }
  467. .num {
  468. padding-left: 6px;
  469. font-weight: 400;
  470. }
  471. </style>