refund_list.vue 12 KB

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