deposit_list.vue 19 KB

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