refund_list.vue 12 KB

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