deposit_list.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. <template>
  2. <div style="width: 100%; height: 100%">
  3. <template-page
  4. v-if="showPage == 1"
  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. :fieldBeansHook="fieldBeansHook"
  14. >
  15. </template-page>
  16. <div class="app-container" v-else-if="showPage == 2">
  17. <DepositListDetail />
  18. </div>
  19. <div class="app-container" v-else-if="showPage == 3">
  20. <DepositApplyDeduction />
  21. </div>
  22. <div class="app-container" v-else-if="showPage == 4">
  23. <DepositApplySurrender />
  24. </div>
  25. <div class="app-container" v-else-if="showPage == 5">
  26. <deposit_replenish />
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import DepositListDetail from './components/deposit_list-detail'
  32. import { getDepositManageDate } from '@/api/engin_deposit/refund_list'
  33. import DepositApplyDeduction from './components/deposit-apply-deduction.vue'
  34. import DepositApplySurrender from './components/deposit-apply-surrender.vue'
  35. import { downloadFiles, handleImport } from '@/utils/util'
  36. import { depositManageHomeList, depositManageHomeListExport } from '@/api/deposit_list_v2.js'
  37. import TemplatePage from '@/components/template/template-page-1.vue'
  38. import Mixin from '@/mixin'
  39. import deposit_replenish from './components/deposit_replenish.vue'
  40. export default {
  41. components: {
  42. DepositListDetail,
  43. DepositApplyDeduction,
  44. DepositApplySurrender,
  45. deposit_replenish,
  46. TemplatePage
  47. },
  48. mixins: [Mixin],
  49. data() {
  50. return {
  51. currentPage: 1, // 当前页码
  52. pageSize: 10, // 每页数量
  53. listTotal: 0, // 列表总数
  54. dataList: [], // 列表数据
  55. screenForm: {
  56. confirmName: '', // 审核人
  57. createName: '', // 创建人
  58. customerKeyword: '', // 客户编码/客户名称
  59. endDeliverTime: '', // 发货申请日期-结束
  60. enginOrderNo: '', // 工程订单编号
  61. enginOrderType: 'HOME', // 工程订单类型
  62. examineStatus: '', // 状态
  63. refEnginRecordNo: '', // 登录单号
  64. refProjectName: '', // 项目名称
  65. refTradeCategory: '',
  66. refUseUnit: '', // 使用单位
  67. startDeliverTime: '', // 发货申请日期-开始
  68. startSubmitTime: '',
  69. startConfirmTime: '',
  70. isRefundDeposit: null,
  71. endConfirmTime: '',
  72. startInstallTime: '',
  73. endInstallTime: '',
  74. specification: '',
  75. refFactoryNo: '',
  76. factoryNo: '',
  77. specialNo: '',
  78. refRegionWork: '',
  79. endSubmitTime: '',
  80. startAcceptTime: '',
  81. endAcceptTime: '',
  82. geLiInerNote: '',
  83. startFactoryNo: '',
  84. endFactoryNo: '',
  85. startSpecialNo: '',
  86. endSpecialNo: '',
  87. startBillNo: '',
  88. endBillNo: '',
  89. mailFactoryYear: '',
  90. startConfirmDate: '',
  91. endConfirmDate: '',
  92. settlementNo: '',
  93. startSettlementDate: '',
  94. endSettlementDate: '',
  95. startInFactoryDate: '',
  96. endInFactoryDate: '',
  97. startSettlementNo: '',
  98. endSettlementNo: '',
  99. inFactoryType: '',
  100. endMailFactoryDate: '',
  101. startMailFactoryDate: '',
  102. settlementStatus: '',
  103. mailFactoryStatus: '',
  104. endOrderDate: '',
  105. startOrderDate: ''
  106. }, // 搜索表单
  107. listLoading: false, // 列表加载loading
  108. deduction: '全部',
  109. showPage: 1,
  110. importFileList: [],
  111. selectData: [],
  112. baseURL: '',
  113. isCollapse: true,
  114. refundDepositArr: [
  115. {
  116. label: '是',
  117. value: true
  118. },
  119. {
  120. label: '否',
  121. value: false
  122. }
  123. ],
  124. mailFactoryStatus: '',
  125. settlementStatus: '',
  126. examineStatusArr: [
  127. {
  128. label: '保存',
  129. value: 'SAVE'
  130. },
  131. {
  132. label: '待审核',
  133. value: 'WAIT'
  134. },
  135. {
  136. label: '通过',
  137. value: 'OK'
  138. },
  139. {
  140. label: '关闭',
  141. value: 'CLOSE'
  142. }
  143. ],
  144. // 表格属性
  145. tableAttributes: {
  146. // 启用勾选列
  147. selectColumn: false
  148. },
  149. // 表格事件
  150. tableEvents: {
  151. 'selection-change': this.selectionChange
  152. },
  153. recordSelected: []
  154. }
  155. },
  156. computed: {
  157. optionsEvensGroup() {
  158. return [
  159. [
  160. [
  161. {
  162. name: '',
  163. isRole: !this.isCustomer,
  164. render: () => {
  165. return (
  166. <el-upload
  167. action={this.baseURL + 'student/import'}
  168. http-request={this.handleImport}
  169. file-list={this.importFileList}
  170. show-file-list={false}
  171. >
  172. <span>导入</span>
  173. </el-upload>
  174. )
  175. }
  176. }
  177. ]
  178. ]
  179. ]
  180. },
  181. isCustomer() {
  182. return this.$store.getters.customerId && this.$store.getters.customerNumber
  183. }
  184. },
  185. methods: {
  186. fieldBeansHook(list) {
  187. if (this.isCustomer) {
  188. var newlist = [...list]
  189. for (var i = 0; i < newlist.length; i++) {
  190. if (newlist[i].jname === 'geLiInerNote') {
  191. newlist.splice(i, 1)
  192. break
  193. }
  194. }
  195. return newlist
  196. }
  197. return list
  198. },
  199. // 列表请求函数
  200. getList: depositManageHomeList,
  201. // 列表导出函数
  202. exportList: depositManageHomeListExport,
  203. // 表格列解析渲染数据更改
  204. columnParsing(item, defaultData) {
  205. return defaultData
  206. },
  207. // 监听勾选变化
  208. selectionChange(data) {
  209. this.recordSelected = data
  210. },
  211. operation() {
  212. return (h, { row, index, column }) => {
  213. return (
  214. <div class="operation-btns">
  215. <el-button
  216. type="text"
  217. class="textColor"
  218. size="mini"
  219. onClick={() => {
  220. this.detailFn(row)
  221. }}
  222. >
  223. 详情
  224. </el-button>
  225. {row.examineStatus == '保存' && this.$checkBtnRole('apply', this.$route.meta.roles) ? (
  226. <el-button
  227. type="text"
  228. class="textColor"
  229. onClick={() => {
  230. this.surrenderFn(row)
  231. }}
  232. >
  233. 申请退押
  234. </el-button>
  235. ) : null}
  236. {((row.examineStatus == '审核通过' && row.dataState == '补充') ||
  237. (row.examineStatus == '审核通过' && row.dataState == '正常')) &&
  238. this.isCustomer ? (
  239. <el-button
  240. type="text"
  241. class="textColor"
  242. onClick={() => {
  243. this.replenishClick(row.depositManageId)
  244. }}
  245. >
  246. 补充资料
  247. </el-button>
  248. ) : null}
  249. </div>
  250. )
  251. }
  252. },
  253. // ------------------------------------
  254. replenishClick(id) {
  255. this.depositManageId = id
  256. this.showPage = 5
  257. },
  258. reexamineClick(id) {
  259. this.detailId = id
  260. this.showSurrender = 3
  261. },
  262. // 同步资料日期
  263. async syncDateFn() {
  264. await getDepositManageDate()
  265. this.$message.success('同步资料日期成功')
  266. },
  267. // 免扣申请
  268. deductionFn() {
  269. this.showPage = 3
  270. },
  271. // 申请退押
  272. surrenderFn(row) {
  273. this.depositManageId = row.depositManageId
  274. this.showPage = 4
  275. },
  276. detailFn(row) {
  277. this.depositManageId = row.depositManageId
  278. this.refEnginRecordNo = row.refEnginRecordNo
  279. this.showPage = 2
  280. },
  281. hanleDownloadFiles() {
  282. let isRefundDeposit = this.deduction === '已退押' ? true : ''
  283. if (this.screenForm.isRefundDeposit == true || this.screenForm.isRefundDeposit == false) {
  284. isRefundDeposit = this.screenForm.isRefundDeposit
  285. }
  286. downloadFiles('deposit-manage/export', {
  287. ...this.screenForm,
  288. isRefundDeposit,
  289. orderType: 'HOME'
  290. })
  291. },
  292. // 导入
  293. async handleImport(param) {
  294. this.importLoading = true
  295. const file = param.file
  296. const formData = new FormData()
  297. formData.append('file', file)
  298. const result = await handleImport('deposit-manage/import', formData)
  299. this.importLoading = false
  300. this.importFileList = []
  301. if (result.code == 200) {
  302. this.$alert(result.message, '导入成功', {
  303. confirmButtonText: '确定'
  304. })
  305. this.$refs.pageRef.refreshList()
  306. } else {
  307. this.$alert(result.message, '导入失败', {
  308. confirmButtonText: '确定'
  309. })
  310. }
  311. },
  312. handleSelectionAllChange(e) {
  313. this.selectData = e
  314. }
  315. }
  316. }
  317. </script>
  318. <style lang="scss" scoped></style>