deposit_list.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423
  1. <template>
  2. <div style="width: 100%; height: 100%">
  3. <template-page
  4. v-show="showPage == 1"
  5. ref="pageRef"
  6. :operation="operation()"
  7. :options-evens-group="optionsEvensGroup"
  8. :get-list="getList2"
  9. :export-list="exportList"
  10. :table-attributes="tableAttributes"
  11. :table-events="tableEvents"
  12. :column-parsing="columnParsing"
  13. :field-beans-hook="fieldBeansHook"
  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="showPage == 2" class="app-container">
  30. <DepositListDetail
  31. :deposit-manage-id="depositManageId"
  32. :ref-engin-record-no="refEnginRecordNo"
  33. @updateList="updateList"
  34. @setShowPage="
  35. val => {
  36. $refs.pageRef.refreshList()
  37. showPage = val
  38. }
  39. "
  40. />
  41. </div>
  42. <div v-else-if="showPage == 3" class="app-container">
  43. <DepositApplyDeduction
  44. :deposit-manage-id="depositManageId"
  45. :ref-engin-record-no="refEnginRecordNo"
  46. @updateList="updateList"
  47. @setShowPage="
  48. val => {
  49. $refs.pageRef.refreshList()
  50. showPage = val
  51. }
  52. "
  53. />
  54. </div>
  55. <div v-else-if="showPage == 4" class="app-container">
  56. <DepositApplySurrender
  57. :deposit-manage-id="depositManageId"
  58. :ref-engin-record-no="refEnginRecordNo"
  59. @updateList="updateList"
  60. @setShowPage="
  61. val => {
  62. $refs.pageRef.refreshList()
  63. showPage = val
  64. }
  65. "
  66. />
  67. </div>
  68. <div v-else-if="showPage == 5" class="app-container">
  69. <deposit_replenish
  70. :deposit-manage-id="depositManageId"
  71. :ref-engin-record-no="refEnginRecordNo"
  72. @updateList="updateList"
  73. @setShowPage="
  74. val => {
  75. $refs.pageRef.refreshList()
  76. showPage = val
  77. }
  78. "
  79. />
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import DepositListDetail from './components/deposit_list-detail'
  85. import { getDepositManageDate } from '@/api/engin_deposit/refund_list'
  86. import DepositApplyDeduction from './components/deposit-apply-deduction.vue'
  87. import DepositApplySurrender from './components/deposit-apply-surrender.vue'
  88. import { downloadFiles, handleImport } from '@/utils/util'
  89. import { depositManageHomeList, depositManageHomeListExport, getCountList, updateDepositManageenginInfo } from '@/api/deposit_list_v2.js'
  90. import TemplatePage from '@/components/template/template-page-1.vue'
  91. import deposit_replenish from './components/deposit_replenish.vue'
  92. export default {
  93. components: {
  94. DepositListDetail,
  95. DepositApplyDeduction,
  96. DepositApplySurrender,
  97. deposit_replenish,
  98. TemplatePage
  99. },
  100. data() {
  101. return {
  102. currentPage: 1, // 当前页码
  103. pageSize: 10, // 每页数量
  104. listTotal: 0, // 列表总数
  105. dataList: [], // 列表数据
  106. screenForm: {
  107. confirmName: '', // 审核人
  108. createName: '', // 创建人
  109. customerKeyword: '', // 客户编码/客户名称
  110. endDeliverTime: '', // 发货申请日期-结束
  111. enginOrderNo: '', // 工程订单编号
  112. enginOrderType: 'HOME', // 工程订单类型
  113. examineStatus: '', // 状态
  114. refEnginRecordNo: '', // 登录单号
  115. refProjectName: '', // 项目名称
  116. refTradeCategory: '',
  117. refUseUnit: '', // 使用单位
  118. startDeliverTime: '', // 发货申请日期-开始
  119. startSubmitTime: '',
  120. startConfirmTime: '',
  121. isRefundDeposit: null,
  122. endConfirmTime: '',
  123. startInstallTime: '',
  124. endInstallTime: '',
  125. specification: '',
  126. refFactoryNo: '',
  127. factoryNo: '',
  128. specialNo: '',
  129. refRegionWork: '',
  130. endSubmitTime: '',
  131. startAcceptTime: '',
  132. endAcceptTime: '',
  133. geLiInerNote: '',
  134. startFactoryNo: '',
  135. endFactoryNo: '',
  136. startSpecialNo: '',
  137. endSpecialNo: '',
  138. startBillNo: '',
  139. endBillNo: '',
  140. mailFactoryYear: '',
  141. startConfirmDate: '',
  142. endConfirmDate: '',
  143. settlementNo: '',
  144. startSettlementDate: '',
  145. endSettlementDate: '',
  146. startInFactoryDate: '',
  147. endInFactoryDate: '',
  148. startSettlementNo: '',
  149. endSettlementNo: '',
  150. inFactoryType: '',
  151. endMailFactoryDate: '',
  152. startMailFactoryDate: '',
  153. settlementStatus: '',
  154. mailFactoryStatus: '',
  155. endOrderDate: '',
  156. startOrderDate: ''
  157. }, // 搜索表单
  158. listLoading: false, // 列表加载loading
  159. deduction: '全部',
  160. showPage: 1,
  161. importFileList: [],
  162. selectData: [],
  163. baseURL: '',
  164. isCollapse: true,
  165. refundDepositArr: [
  166. {
  167. label: '是',
  168. value: true
  169. },
  170. {
  171. label: '否',
  172. value: false
  173. }
  174. ],
  175. mailFactoryStatus: '',
  176. settlementStatus: '',
  177. examineStatusArr: [
  178. {
  179. label: '保存',
  180. value: 'SAVE'
  181. },
  182. {
  183. label: '待审核',
  184. value: 'WAIT'
  185. },
  186. {
  187. label: '通过',
  188. value: 'OK'
  189. },
  190. {
  191. label: '关闭',
  192. value: 'CLOSE'
  193. }
  194. ],
  195. // 表格属性
  196. tableAttributes: {
  197. // 启用勾选列
  198. selectColumn: false
  199. },
  200. // 表格事件
  201. tableEvents: {
  202. 'selection-change': this.selectionChange
  203. },
  204. recordSelected: [],
  205. depositManageId: '',
  206. refEnginRecordNo: '',
  207. numSum: {
  208. totalC: 0,
  209. amountC: 0,
  210. totalEC: 0
  211. }
  212. }
  213. },
  214. computed: {
  215. optionsEvensGroup() {
  216. return [
  217. [
  218. [
  219. {
  220. name: '',
  221. // isRole: this.$checkBtnRole('add', this.$route.meta.roles),
  222. render: () => {
  223. return (
  224. <el-popconfirm
  225. title='更新工程信息吗?'
  226. onOnConfirm={() => {
  227. updateDepositManageenginInfo().then(res => {
  228. this.$message.success('更新工程信息成功')
  229. this.$refs.pageRef.refreshList()
  230. })
  231. }}
  232. >
  233. <span slot='reference'>更新工程信息</span>
  234. </el-popconfirm>
  235. )
  236. }
  237. }
  238. ]
  239. ],
  240. [
  241. [
  242. {
  243. name: '',
  244. isRole: !this.isCustomer,
  245. render: () => {
  246. return (
  247. <el-upload
  248. action={this.baseURL + 'student/import'}
  249. http-request={this.handleImport}
  250. file-list={this.importFileList}
  251. show-file-list={false}
  252. >
  253. <span>导入</span>
  254. </el-upload>
  255. )
  256. }
  257. }
  258. ]
  259. ]
  260. ]
  261. },
  262. isCustomer() {
  263. return this.$store.getters.customerId && this.$store.getters.customerNumber
  264. }
  265. },
  266. methods: {
  267. updateList() {
  268. this.$refs.pageRef.refreshList()
  269. },
  270. fieldBeansHook(list) {
  271. if (this.isCustomer) {
  272. var newlist = [...list]
  273. for (var i = 0; i < newlist.length; i++) {
  274. if (newlist[i].jname === 'geLiInerNote') {
  275. newlist.splice(i, 1)
  276. break
  277. }
  278. }
  279. return newlist
  280. }
  281. return list
  282. },
  283. // 列表请求函数
  284. getList2(...p) {
  285. this.$refs.pageRef.showTable = false
  286. this.recordSelected = []
  287. getCountList(...p).then(res => {
  288. this.numSum = res.data
  289. })
  290. return depositManageHomeList(...p)
  291. },
  292. // 列表导出函数
  293. exportList: depositManageHomeListExport,
  294. // 表格列解析渲染数据更改
  295. columnParsing(item, defaultData) {
  296. return defaultData
  297. },
  298. // 监听勾选变化
  299. selectionChange(data) {
  300. this.recordSelected = data
  301. },
  302. operation() {
  303. return (h, { row, index, column }) => {
  304. return (
  305. <div class='operation-btns'>
  306. <el-button
  307. type='text'
  308. class='textColor'
  309. size='mini'
  310. onClick={() => {
  311. this.detailFn(row)
  312. }}
  313. >
  314. 详情
  315. </el-button>
  316. {row.examineStatus == '保存' && this.$checkBtnRole('apply', this.$route.meta.roles) ? (
  317. <el-button
  318. type='text'
  319. class='textColor'
  320. onClick={() => {
  321. this.surrenderFn(row)
  322. }}
  323. >
  324. 申请退押
  325. </el-button>
  326. ) : null}
  327. {((row.examineStatus == '审核通过' && row.dataState == '补充') ||
  328. (row.examineStatus == '审核通过' && row.dataState == '正常')) &&
  329. this.isCustomer ? (
  330. <el-button
  331. type='text'
  332. class='textColor'
  333. onClick={() => {
  334. this.replenishClick(row.depositManageId)
  335. }}
  336. >
  337. 补充资料
  338. </el-button>
  339. ) : null}
  340. </div>
  341. )
  342. }
  343. },
  344. // ------------------------------------
  345. replenishClick(id) {
  346. this.depositManageId = id
  347. this.showPage = 5
  348. },
  349. reexamineClick(id) {
  350. this.detailId = id
  351. this.showSurrender = 3
  352. },
  353. // 同步资料日期
  354. async syncDateFn() {
  355. await getDepositManageDate()
  356. this.$message.success('同步资料日期成功')
  357. },
  358. // 免扣申请
  359. deductionFn() {
  360. this.showPage = 3
  361. },
  362. // 申请退押
  363. surrenderFn(row) {
  364. this.depositManageId = row.depositManageId
  365. this.showPage = 4
  366. },
  367. detailFn(row) {
  368. this.depositManageId = row.depositManageId
  369. this.refEnginRecordNo = row.refEnginRecordNo
  370. this.showPage = 2
  371. },
  372. hanleDownloadFiles() {
  373. let isRefundDeposit = this.deduction === '已退押' ? true : ''
  374. if (this.screenForm.isRefundDeposit == true || this.screenForm.isRefundDeposit == false) {
  375. isRefundDeposit = this.screenForm.isRefundDeposit
  376. }
  377. downloadFiles('deposit-manage/export', {
  378. ...this.screenForm,
  379. isRefundDeposit,
  380. orderType: 'HOME'
  381. })
  382. },
  383. // 导入
  384. async handleImport(param) {
  385. this.importLoading = true
  386. const file = param.file
  387. const formData = new FormData()
  388. formData.append('file', file)
  389. const result = await handleImport('deposit-manage/import', formData)
  390. this.importLoading = false
  391. this.importFileList = []
  392. if (result.code == 200) {
  393. this.$alert(result.message, '导入成功', {
  394. confirmButtonText: '确定'
  395. })
  396. this.$refs.pageRef.refreshList()
  397. } else {
  398. this.$alert(result.message, '导入失败', {
  399. confirmButtonText: '确定'
  400. })
  401. }
  402. },
  403. handleSelectionAllChange(e) {
  404. this.selectData = e
  405. }
  406. }
  407. }
  408. </script>
  409. <style lang="scss" scoped>
  410. .ulStyle{
  411. list-style: none;
  412. padding: 0;
  413. li{
  414. display: inline-block;
  415. margin-right: 20px;
  416. }
  417. }
  418. </style>