deposit_list.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group v-model="deduction" size="mini" @change="handleRadio">
  5. <el-radio-button label="全部" />
  6. <el-radio-button label="已退押" />
  7. </el-radio-group>
  8. <br><br>
  9. <!-- 筛选条件 -->
  10. <div>
  11. <el-form
  12. ref="screenForm"
  13. :model="screenForm"
  14. label-width="120px"
  15. size="mini"
  16. label-position="left"
  17. >
  18. <el-row :gutter="20">
  19. <el-col :xs="24" :sm="12" :lg="6">
  20. <el-form-item label="工程登录编号" prop="refEnginRecordNo">
  21. <el-input
  22. v-model="screenForm.refEnginRecordNo"
  23. placeholder="请输入"
  24. />
  25. </el-form-item>
  26. </el-col>
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="经销商编码/名称" prop="customerKeyword">
  29. <el-input
  30. v-model="screenForm.customerKeyword"
  31. placeholder="请输入"
  32. />
  33. </el-form-item>
  34. </el-col>
  35. <!-- <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="经销商名称" prop="customerKeyword">
  37. <el-input
  38. v-model="screenForm.customerKeyword"
  39. placeholder="请输入"
  40. ></el-input>
  41. </el-form-item>
  42. </el-col> -->
  43. <el-col :xs="24" :sm="12" :lg="6">
  44. <el-form-item label="使用单位" prop="refUseUnit">
  45. <el-input
  46. v-model="screenForm.refUseUnit"
  47. placeholder="请输入使用单位"
  48. />
  49. </el-form-item>
  50. </el-col>
  51. <el-col :xs="24" :sm="12" :lg="6">
  52. <el-form-item label="开始申请日期" prop="startSubmitTime">
  53. <el-date-picker
  54. v-model="screenForm.startSubmitTime"
  55. class="dateStyle"
  56. type="datetime"
  57. placeholder="选择日期"
  58. />
  59. </el-form-item>
  60. </el-col>
  61. <el-col :xs="24" :sm="12" :lg="6">
  62. <el-form-item label="结束申请日期" prop="endSubmitTime">
  63. <el-date-picker
  64. v-model="screenForm.endSubmitTime"
  65. class="dateStyle"
  66. type="datetime"
  67. placeholder="选择日期"
  68. />
  69. </el-form-item>
  70. </el-col>
  71. <el-col :xs="24" :sm="12" :lg="6">
  72. <el-form-item label="开始验收日期" prop="startConfirmTime">
  73. <el-date-picker
  74. v-model="screenForm.startConfirmTime"
  75. class="dateStyle"
  76. type="datetime"
  77. placeholder="选择日期"
  78. />
  79. </el-form-item>
  80. </el-col>
  81. <el-col :xs="24" :sm="12" :lg="6">
  82. <el-form-item label="结束验收日期" prop="endConfirmTime">
  83. <el-date-picker
  84. v-model="screenForm.endConfirmTime"
  85. class="dateStyle"
  86. type="datetime"
  87. placeholder="选择日期"
  88. />
  89. </el-form-item>
  90. </el-col>
  91. <el-col :xs="24" :sm="12" :lg="6">
  92. <el-form-item label="是否退押 " prop="isRefundDeposit">
  93. <el-select style="width:100%" v-model="screenForm.isRefundDeposit" placeholder="请选择是否退押 " >
  94. <el-option label="默认" :value="null"></el-option>
  95. <el-option v-for="item in refundDepositArr"
  96. :key="item.value"
  97. :label="item.label"
  98. :value="item.value">
  99. </el-option>
  100. </el-select>
  101. </el-form-item>
  102. </el-col>
  103. <el-col :xs="24" :sm="12" :lg="6">
  104. <el-form-item label="状态 " prop="examineStatus">
  105. <el-select style="width:100%" v-model="screenForm.examineStatus" placeholder="请选择状态 " >
  106. <el-option label="默认" :value="null"></el-option>
  107. <el-option v-for="item in examineStatusArr"
  108. :key="item.value"
  109. :label="item.label"
  110. :value="item.value">
  111. </el-option>
  112. </el-select>
  113. </el-form-item>
  114. </el-col>
  115. <!-- <el-col :xs="24" :sm="12" :lg="6">
  116. <el-form-item label="产品名称" prop="">
  117. <el-input placeholder="请输入"></el-input>
  118. </el-form-item>
  119. </el-col>
  120. <el-col :xs="24" :sm="12" :lg="6">
  121. <el-form-item label="规格型号" prop="">
  122. <el-input placeholder="请输入"></el-input>
  123. </el-form-item>
  124. </el-col> -->
  125. <template v-if="!isCustomer">
  126. <el-col :xs="24" :sm="12" :lg="6">
  127. <el-form-item label="审核人" prop="confirmName">
  128. <el-input
  129. v-model="screenForm.confirmName"
  130. placeholder="请输入审核人"
  131. />
  132. </el-form-item>
  133. </el-col>
  134. <el-col :xs="24" :sm="12" :lg="12">
  135. <el-form-item label="区域" prop="refRegionWork">
  136. <el-input
  137. v-model="screenForm.refRegionWork"
  138. placeholder="请输入区域"
  139. />
  140. </el-form-item>
  141. </el-col>
  142. <el-col :xs="24" :sm="12" :lg="12">
  143. <el-form-item label="安装日期" >
  144. <div class="fanwei">
  145. <el-form-item prop="startInstallTime">
  146. <el-date-picker
  147. v-model="screenForm.startInstallTime"
  148. class="dateStyle"
  149. type="datetime"
  150. placeholder="选择日期"
  151. />
  152. </el-form-item>
  153. <span>-</span>
  154. <el-form-item prop="endInstallTime">
  155. <el-date-picker
  156. v-model="screenForm.endInstallTime"
  157. class="dateStyle"
  158. type="datetime"
  159. placeholder="选择日期"
  160. />
  161. </el-form-item>
  162. </div>
  163. </el-form-item>
  164. </el-col>
  165. <el-col :xs="24" :sm="12" :lg="12">
  166. <el-form-item label="机型" >
  167. <div class="fanwei">
  168. <el-form-item prop="startSpecification">
  169. <el-input v-model="screenForm.startSpecification" ></el-input>
  170. </el-form-item>
  171. <span>-</span>
  172. <el-form-item prop="endSpecification">
  173. <el-input v-model="screenForm.endSpecification" ></el-input>
  174. </el-form-item>
  175. </div>
  176. </el-form-item>
  177. </el-col>
  178. <el-col :xs="24" :sm="12" :lg="12">
  179. <el-form-item label="特价编号" >
  180. <div class="fanwei">
  181. <el-form-item prop="startSpecialNo">
  182. <el-input v-model="screenForm.startSpecialNo" ></el-input>
  183. </el-form-item>
  184. <span>-</span>
  185. <el-form-item prop="endSpecialNo">
  186. <el-input v-model="screenForm.endSpecialNo" ></el-input>
  187. </el-form-item>
  188. </div>
  189. </el-form-item>
  190. </el-col>
  191. <el-col :xs="24" :sm="12" :lg="12">
  192. <el-form-item label="厂编号" >
  193. <div class="fanwei">
  194. <el-form-item prop="startRefFactoryNo">
  195. <el-input v-model="screenForm.startRefFactoryNo" ></el-input>
  196. </el-form-item>
  197. <span>-</span>
  198. <el-form-item prop="endRefFactoryNo">
  199. <el-input v-model="screenForm.endRefFactoryNo" ></el-input>
  200. </el-form-item>
  201. </div>
  202. </el-form-item>
  203. </el-col>
  204. </template>
  205. <el-col :xs="24" :sm="24" :lg="24">
  206. <el-form-item label="" class="fr">
  207. <el-button
  208. size="mini"
  209. @click="resetScreenForm"
  210. >清空</el-button>
  211. <el-button
  212. size="mini"
  213. type="primary"
  214. @click="submitScreenForm"
  215. >搜索</el-button>
  216. </el-form-item>
  217. </el-col>
  218. </el-row>
  219. </el-form>
  220. </div>
  221. <!-- 按钮 -->
  222. <div class="btn-group clearfix" style="display: flex">
  223. <el-button
  224. type="primary"
  225. size="mini"
  226. @click="hanleDownloadFiles"
  227. >导出</el-button>
  228. <el-upload
  229. v-if="$checkBtnRole('import', $route.meta.roles)"
  230. class="import-btn"
  231. :action="baseURL + 'student/import'"
  232. :http-request="handleImport"
  233. :file-list="importFileList"
  234. :show-file-list="false"
  235. >
  236. <el-button size="mini">导入</el-button>
  237. </el-upload>
  238. </div>
  239. <!-- 列表 -->
  240. <div class="mymain-container">
  241. <div class="table">
  242. <el-table
  243. v-loading="listLoading"
  244. :data="dataList"
  245. element-loading-text="Loading"
  246. border
  247. fit
  248. highlight-current-row
  249. stripe
  250. show-summary
  251. :summary-method="$getSummaries"
  252. @select-all="handleSelectionAllChange"
  253. @selection-change="handleSelectionAllChange"
  254. >
  255. <el-table-column align="left" type="selection" width="55" />
  256. <el-table-column
  257. align="left"
  258. label="工程登录编号"
  259. prop="refEnginRecordNo"
  260. min-width="160"
  261. show-overflow-tooltip
  262. />
  263. <el-table-column
  264. align="left"
  265. label="使用单位"
  266. prop="refUseUnit"
  267. min-width="160"
  268. show-overflow-tooltip
  269. />
  270. <el-table-column
  271. align="left"
  272. label="申请日期"
  273. prop="submitTime"
  274. min-width="160"
  275. show-overflow-tooltip
  276. />
  277. <el-table-column
  278. align="left"
  279. label="验收日期"
  280. prop="checkDate"
  281. min-width="160"
  282. show-overflow-tooltip
  283. />
  284. <el-table-column
  285. align="left"
  286. label="经销商编码"
  287. prop="customerNumber"
  288. min-width="160"
  289. show-overflow-tooltip
  290. >
  291. <template slot-scope="scope">
  292. <CopyButton :copy-text="scope.row.customerNumber" />
  293. <span>{{ scope.row.customerNumber }}</span>
  294. </template>
  295. </el-table-column>
  296. <el-table-column
  297. align="left"
  298. label="经销商名称"
  299. prop="customerName"
  300. min-width="160"
  301. show-overflow-tooltip
  302. >
  303. <template slot-scope="scope">
  304. <CopyButton :copy-text="scope.row.customerName" />
  305. <span>{{ scope.row.customerName }}</span>
  306. </template>
  307. </el-table-column>
  308. <!-- <el-table-column
  309. align="left"
  310. label="是否免扣"
  311. prop=""
  312. min-width="160"
  313. show-overflow-tooltip
  314. ></el-table-column> -->
  315. <el-table-column
  316. align="left"
  317. label="是否退押"
  318. prop="isRefundDeposit"
  319. min-width="160"
  320. show-overflow-tooltip
  321. >
  322. <template slot-scope="scope">
  323. <el-tag
  324. v-if="scope.row.isRefundDeposit"
  325. type="success"
  326. size="small"
  327. >是</el-tag>
  328. <el-tag v-else type="warning" size="small">否</el-tag>
  329. </template>
  330. </el-table-column>
  331. <!-- <el-table-column
  332. align="left"
  333. label="押金比例"
  334. prop=""
  335. min-width="160"
  336. show-overflow-tooltip
  337. ></el-table-column> -->
  338. <el-table-column
  339. align="right"
  340. label="押金金额"
  341. prop="depositAmount"
  342. min-width="160"
  343. show-overflow-tooltip
  344. >
  345. <template slot-scope="scope">
  346. {{ scope.row.depositAmount | numToFixed }}
  347. </template>
  348. </el-table-column>
  349. <el-table-column
  350. align="left"
  351. label="状态"
  352. prop="examineStatus"
  353. min-width="160"
  354. show-overflow-tooltip
  355. >
  356. <template slot-scope="scope">
  357. <el-tag
  358. v-if="scope.row.examineStatus == 'SAVE'"
  359. type="success"
  360. size="small"
  361. >保存
  362. </el-tag>
  363. <el-tag
  364. v-if="scope.row.examineStatus == 'WAIT'"
  365. type="warning"
  366. size="small"
  367. >待审核
  368. </el-tag>
  369. <el-tag
  370. v-if="scope.row.examineStatus == 'OK'"
  371. type="warning"
  372. size="mini"
  373. >通过</el-tag>
  374. <el-tag
  375. v-if="scope.row.examineStatus == 'FAIL'"
  376. type="warning"
  377. size="small"
  378. >不通过</el-tag>
  379. <el-tag
  380. v-if="scope.row.examineStatus == 'CLOSE'"
  381. type="warning"
  382. size="small"
  383. >关闭</el-tag>
  384. </template>
  385. </el-table-column>
  386. <el-table-column
  387. align="right"
  388. label="订单数量"
  389. prop="qty"
  390. min-width="160"
  391. show-overflow-tooltip
  392. />
  393. <el-table-column
  394. align="left"
  395. label="资料审核日期"
  396. prop="refDatumAcceptDate"
  397. min-width="160"
  398. show-overflow-tooltip
  399. ></el-table-column>
  400. <el-table-column
  401. align="center"
  402. label="操作"
  403. min-width="160"
  404. fixed="right"
  405. show-overflow-tooltip
  406. >
  407. <template slot-scope="scope">
  408. <el-button
  409. type="text"
  410. class="textColor"
  411. size="mini"
  412. @click="detailFn(scope.row)"
  413. >详情</el-button>
  414. <el-button
  415. v-if="
  416. scope.row.examineStatus == 'SAVE' &&
  417. $checkBtnRole('apply', $route.meta.roles)
  418. "
  419. type="text"
  420. class="textColor"
  421. @click="surrenderFn(scope.row)"
  422. >申请退押</el-button>
  423. <!-- <el-button type="text" class="textColor" slot="reference"
  424. >免扣退押</el-button
  425. > -->
  426. </template>
  427. </el-table-column>
  428. </el-table>
  429. </div>
  430. <!-- 分页 -->
  431. <div class="fr">
  432. <el-pagination
  433. :current-page="currentPage"
  434. :page-sizes="[10, 20, 30, 50]"
  435. :page-size="10"
  436. layout="total, sizes, prev, pager, next, jumper"
  437. :total="listTotal"
  438. @size-change="handleSizeChange"
  439. @current-change="handleCurrentChange"
  440. />
  441. </div>
  442. </div>
  443. </div>
  444. <DepositListDetail v-else-if="showPage == 2" />
  445. <DepositApplyDeduction v-else-if="showPage == 3" />
  446. <DepositApplySurrender v-else-if="showPage == 4" />
  447. </div>
  448. </template>
  449. <script>
  450. import DepositListDetail from './components/deposit_list-detail'
  451. import DepositApplyDeduction from './components/deposit-apply-deduction.vue'
  452. import DepositApplySurrender from './components/deposit-apply-surrender.vue'
  453. import { downloadFiles, handleImport } from '@/utils/util'
  454. import { getList } from '@/api/engin_deposit.js'
  455. import Mixin from '@/mixin'
  456. export default {
  457. components: {
  458. DepositListDetail,
  459. DepositApplyDeduction,
  460. DepositApplySurrender
  461. },
  462. mixins: [Mixin],
  463. data() {
  464. return {
  465. currentPage: 1, // 当前页码
  466. pageSize: 10, // 每页数量
  467. listTotal: 0, // 列表总数
  468. dataList: [], // 列表数据
  469. screenForm: {
  470. confirmName: '', // 审核人
  471. createName: '', // 创建人
  472. customerKeyword: '', // 客户编码/客户名称
  473. endDeliverTime: '', // 发货申请日期-结束
  474. enginOrderNo: '', // 工程订单编号
  475. enginOrderType: 'HOME', // 工程订单类型
  476. examineStatus: '', // 状态
  477. refEnginRecordNo: '', // 登录单号
  478. refProjectName: '', // 项目名称
  479. refUseUnit: '', // 使用单位
  480. startDeliverTime: '', // 发货申请日期-开始
  481. startSubmitTime:'',
  482. startConfirmTime:'',
  483. isRefundDeposit:null,
  484. examineStatus:null,
  485. refUseUnit:'',
  486. endConfirmTime:'',
  487. startInstallTime:'',
  488. endInstallTime:'',
  489. startSpecification:'',
  490. startSpecialNo:'',
  491. startRefFactoryNo:'',
  492. endSpecification:'',
  493. endSpecialNo:'',
  494. endRefFactoryNo:'',
  495. factoryNo:'',
  496. specialNo:'',
  497. confirmName:'',
  498. refRegionWork:'',
  499. endSubmitTime:'',
  500. startSubmitTime:''
  501. }, // 搜索表单
  502. listLoading: false, // 列表加载loading
  503. deduction: '全部',
  504. showPage: 1,
  505. importFileList: [],
  506. selectData: [],
  507. baseURL: '',
  508. refundDepositArr:[
  509. {
  510. label:'是',
  511. value:true
  512. },
  513. {
  514. label:'否',
  515. value:false
  516. }
  517. ],
  518. examineStatusArr:[
  519. {
  520. label:'保存',
  521. value:'SAVE'
  522. },
  523. {
  524. label:'待审核',
  525. value:'WAIT'
  526. },
  527. {
  528. label:'通过',
  529. value:'OK'
  530. },
  531. {
  532. label:'不通过',
  533. value:'FAIL'
  534. },
  535. {
  536. label:'关闭',
  537. value:'CLOSE'
  538. },
  539. ]
  540. }
  541. },
  542. computed:{
  543. isCustomer(){
  544. return this.$store.getters.customerId && this.$store.getters.customerNumber
  545. }
  546. },
  547. methods: {
  548. // 免扣申请
  549. deductionFn() {
  550. this.showPage = 3
  551. },
  552. // 申请退押
  553. surrenderFn(row) {
  554. this.depositManageId = row.depositManageId
  555. this.showPage = 4
  556. },
  557. detailFn(row) {
  558. this.depositManageId = row.depositManageId
  559. this.refEnginRecordNo = row.refEnginRecordNo
  560. this.showPage = 2
  561. },
  562. getList() {
  563. this.listLoading = true
  564. const params = {
  565. pageSize: this.pageSize,
  566. pageNum: this.currentPage,
  567. isRefundDeposit: this.deduction === '已退押' ? true : null,
  568. ...this.screenForm
  569. }
  570. getList(params).then((res) => {
  571. this.dataList = res.data.records
  572. res.data.records.forEach((item) => {
  573. // item.number = (item.qty*100 - item.directTransferQty*100 - item.retiredQty*100) / 100;
  574. item.sums1 = ['qty']
  575. item.sums2 = ['depositAmount', 'diffAmount', 'price']
  576. })
  577. this.listLoading = false
  578. this.listTotal = res.data.total
  579. })
  580. },
  581. handleRadio() {
  582. this.getList()
  583. },
  584. hanleDownloadFiles() {
  585. if (this.selectData.length) {
  586. const arr = []
  587. for (let i = 0; i < this.selectData.length; i++) {
  588. arr.push(this.selectData[i].depositManageId)
  589. }
  590. downloadFiles('/deposit-manage/export', { id: arr,orderType:'HOME' })
  591. } else {
  592. this.$errorMsg('请选择押金项')
  593. }
  594. },
  595. // 导入
  596. async handleImport(param) {
  597. this.importLoading = true
  598. const file = param.file
  599. console.log(file, 123)
  600. const formData = new FormData()
  601. formData.append('file', file)
  602. // formData.append("policyId", this.screenForm.code);
  603. const result = await handleImport('deposit-manage/import', formData)
  604. this.importLoading = false
  605. this.importFileList = []
  606. if (result.code == 200) {
  607. this.$alert(result.message, '导入成功', {
  608. confirmButtonText: '确定'
  609. })
  610. this.handletwoList()
  611. } else {
  612. this.$alert(result.message, '导入失败', {
  613. confirmButtonText: '确定'
  614. })
  615. }
  616. },
  617. handleSelectionAllChange(e) {
  618. this.selectData = e
  619. }
  620. }
  621. }
  622. </script>
  623. <style lang="scss" scoped>
  624. .fanwei {
  625. display: flex;
  626. span {
  627. margin: 0 20px;
  628. }
  629. div{
  630. width:100%
  631. }
  632. }
  633. .dateStyle {
  634. width: 100%;
  635. }
  636. .import-btn {
  637. margin-left: 10px;
  638. }
  639. </style>