deposit_list.vue 21 KB

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