deposit_list.vue 22 KB

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