deposit_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group v-model="deduction" size="" @change="handleRadio">
  5. <el-radio-button label="全部"></el-radio-button>
  6. <el-radio-button label="已退押"></el-radio-button>
  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="small"
  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="enginOrderNo">
  21. <el-input
  22. v-model="screenForm.enginOrderNo"
  23. placeholder="请输入"
  24. ></el-input>
  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. ></el-input>
  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. ></el-input>
  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-date-picker>
  60. </el-form-item>
  61. </el-col>
  62. <el-col :xs="24" :sm="12" :lg="6">
  63. <el-form-item label="产品名称" prop="">
  64. <el-input placeholder="请输入"></el-input>
  65. </el-form-item>
  66. </el-col>
  67. <el-col :xs="24" :sm="12" :lg="6">
  68. <el-form-item label="规格型号" prop="">
  69. <el-input placeholder="请输入"></el-input>
  70. </el-form-item>
  71. </el-col>
  72. <el-col :xs="24" :sm="24" :lg="12">
  73. <el-form-item label="" class="fr">
  74. <el-button size="small" @click="resetScreenForm">清空</el-button>
  75. <el-button size="small" type="primary" @click="submitScreenForm">搜索</el-button>
  76. </el-form-item>
  77. </el-col>
  78. </el-row>
  79. </el-form>
  80. </div>
  81. <!-- 按钮 -->
  82. <div class="btn-group clearfix" style="display:flex">
  83. <el-button type="primary" size="small" @click="hanleDownloadFiles"
  84. >导出</el-button
  85. >
  86. <el-upload
  87. class="import-btn"
  88. :action="baseURL + 'student/import'"
  89. :http-request="handleImport"
  90. :file-list="importFileList"
  91. :show-file-list="false"
  92. >
  93. <el-button size="small">导入</el-button>
  94. </el-upload>
  95. </div>
  96. <!-- 列表 -->
  97. <div class="mymain-container">
  98. <div class="table">
  99. <el-table
  100. v-loading="listLoading"
  101. :data="dataList"
  102. element-loading-text="Loading"
  103. border
  104. fit
  105. highlight-current-row
  106. stripe
  107. @select-all="handleSelectionAllChange"
  108. @selection-change="handleSelectionAllChange"
  109. >
  110. <el-table-column
  111. align="center"
  112. type="selection"
  113. width="55"
  114. >
  115. </el-table-column>
  116. <el-table-column
  117. align="center"
  118. label="工程登录编码"
  119. prop="refProjectNo"
  120. min-width="160"
  121. show-overflow-tooltip
  122. ></el-table-column>
  123. <el-table-column
  124. align="center"
  125. label="工程名称"
  126. prop="refProjectName"
  127. min-width="160"
  128. show-overflow-tooltip
  129. ></el-table-column>
  130. <el-table-column
  131. align="center"
  132. label="经销商编码"
  133. prop="customerId"
  134. min-width="160"
  135. show-overflow-tooltip
  136. ></el-table-column>
  137. <el-table-column
  138. align="center"
  139. label="经销商名称"
  140. prop="customerName"
  141. min-width="160"
  142. show-overflow-tooltip
  143. ></el-table-column>
  144. <!-- <el-table-column
  145. align="center"
  146. label="是否免扣"
  147. prop=""
  148. min-width="160"
  149. show-overflow-tooltip
  150. ></el-table-column> -->
  151. <el-table-column
  152. align="center"
  153. label="是否退押"
  154. prop="isRefundDeposit"
  155. min-width="160"
  156. show-overflow-tooltip
  157. >
  158. <template slot-scope="scope">
  159. <el-tag
  160. type="success"
  161. size="small"
  162. v-if="scope.row.isRefundDeposit"
  163. >是</el-tag
  164. >
  165. <el-tag type="warning" size="small" v-else>否</el-tag>
  166. </template>
  167. </el-table-column>
  168. <el-table-column
  169. align="center"
  170. label="押金比例"
  171. prop=""
  172. min-width="160"
  173. show-overflow-tooltip
  174. ></el-table-column>
  175. <el-table-column
  176. align="center"
  177. label="押金金额"
  178. prop="depositAmount"
  179. min-width="160"
  180. show-overflow-tooltip
  181. ></el-table-column>
  182. <el-table-column
  183. align="center"
  184. label="状态"
  185. prop="examineStatus"
  186. min-width="160"
  187. show-overflow-tooltip
  188. >
  189. <template slot-scope="scope">
  190. <el-tag
  191. type="success"
  192. size="small"
  193. v-if="scope.row.examineStatus == 'SAVE'"
  194. >保存
  195. </el-tag>
  196. <el-tag
  197. type="warning"
  198. size="small"
  199. v-if="scope.row.examineStatus == 'WAIT'"
  200. >待审核
  201. </el-tag>
  202. <el-tag
  203. type="warning"
  204. size="small"
  205. v-if="scope.row.examineStatus == 'OK'"
  206. >通过</el-tag
  207. >
  208. <el-tag
  209. type="warning"
  210. size="small"
  211. v-if="scope.row.examineStatus == 'FAIL'"
  212. >不通过</el-tag
  213. >
  214. <el-tag
  215. type="warning"
  216. size="small"
  217. v-if="scope.row.examineStatus == 'CLOSE'"
  218. >关闭</el-tag
  219. >
  220. </template>
  221. </el-table-column>
  222. <el-table-column
  223. align="center"
  224. label="订单数量"
  225. prop="qty"
  226. min-width="160"
  227. show-overflow-tooltip
  228. ></el-table-column>
  229. <el-table-column
  230. align="center"
  231. label="是否已发货"
  232. prop=""
  233. min-width="160"
  234. show-overflow-tooltip
  235. ></el-table-column>
  236. <el-table-column
  237. align="center"
  238. label="操作"
  239. min-width="160"
  240. show-overflow-tooltip
  241. >
  242. <template slot-scope="scope">
  243. <el-button type="text" class="textColor" @click="detailFn(scope.row)"
  244. >详情</el-button
  245. >
  246. <el-button type="text" class="textColor" v-if="scope.row.examineStatus == 'SAVE'" @click="surrenderFn(scope.row)"
  247. >申请退押</el-button
  248. >
  249. <!-- <el-button type="text" class="textColor" slot="reference"
  250. >免扣退押</el-button
  251. > -->
  252. </template>
  253. </el-table-column>
  254. </el-table>
  255. </div>
  256. <!-- 分页 -->
  257. <div class="fr">
  258. <el-pagination
  259. :current-page="currentPage"
  260. :page-sizes="[10, 20, 30, 50]"
  261. :page-size="10"
  262. layout="total, sizes, prev, pager, next, jumper"
  263. :total="listTotal"
  264. >
  265. </el-pagination>
  266. </div>
  267. </div>
  268. </div>
  269. <DepositListDetail v-else-if="showPage == 2" />
  270. <DepositApplyDeduction v-else-if="showPage == 3" />
  271. <DepositApplySurrender v-else-if="showPage == 4" />
  272. </div>
  273. </template>
  274. <script>
  275. import DepositListDetail from "./components/deposit_list-detail";
  276. import DepositApplyDeduction from "./components/deposit-apply-deduction.vue";
  277. import DepositApplySurrender from "./components/deposit-apply-surrender.vue";
  278. import { downloadFiles, handleImport } from "@/utils/util";
  279. import { getList } from "@/api/engin_deposit.js";
  280. import Mixin from "@/mixin";
  281. export default {
  282. mixins: [Mixin],
  283. components: {
  284. DepositListDetail,
  285. DepositApplyDeduction,
  286. DepositApplySurrender,
  287. },
  288. data() {
  289. return {
  290. currentPage: 1, // 当前页码
  291. pageSize: 10, // 每页数量
  292. listTotal: 0, // 列表总数
  293. dataList: [], // 列表数据
  294. screenForm: {
  295. confirmName: "", //审核人
  296. createName: "", //创建人
  297. customerKeyword: "", //客户编码/客户名称
  298. endDeliverTime: "", //发货申请日期-结束
  299. enginOrderNo: "", //工程订单编号
  300. enginOrderType: "", //工程订单类型
  301. examineStatus: "", //状态
  302. refEnginRecordNo: "", //登录单号
  303. refProjectName: "", //项目名称
  304. refUseUnit: "", //使用单位
  305. startDeliverTime: "", //发货申请日期-开始
  306. }, //搜索表单
  307. listLoading: false, // 列表加载loading
  308. deduction: "全部",
  309. showPage: 1,
  310. importFileList:[],
  311. selectData:[],
  312. baseURL:''
  313. };
  314. },
  315. methods: {
  316. //免扣申请
  317. deductionFn() {
  318. this.showPage = 3;
  319. },
  320. //申请退押
  321. surrenderFn(row) {
  322. this.depositManageId = row.depositManageId
  323. this.showPage = 4;
  324. },
  325. detailFn(row) {
  326. this.depositManageId = row.depositManageId
  327. this.refEnginRecordNo = row.refEnginRecordNo
  328. this.showPage = 2;
  329. },
  330. getList() {
  331. this.listLoading = true;
  332. const params = {
  333. pageSize: this.pageSize,
  334. pageNum: this.currentPage,
  335. ...this.screenForm,
  336. };
  337. getList(params).then((res) => {
  338. this.dataList = res.data.records;
  339. this.listLoading = false;
  340. this.listTotal = res.data.total;
  341. });
  342. },
  343. handleRadio(){
  344. this.getList()
  345. },
  346. hanleDownloadFiles() {
  347. if (this.selectData.length) {
  348. const arr = []
  349. for (let i = 0; i < this.selectData.length; i++) {
  350. arr.push( this.selectData[i].depositManageId)
  351. }
  352. downloadFiles("/deposit-manage/export",{id:arr});
  353. }else{
  354. this.$errorMsg('请选择押金项')
  355. }
  356. },
  357. // 导入
  358. async handleImport(param) {
  359. this.importLoading = true;
  360. const file = param.file;
  361. console.log(file, 123);
  362. const formData = new FormData();
  363. formData.append("file", file);
  364. // formData.append("policyId", this.screenForm.code);
  365. let result = await handleImport("deposit-manage/import", formData);
  366. this.importLoading = false;
  367. this.importFileList = [];
  368. if (result.code == 200) {
  369. this.$alert(result.message, "导入成功", {
  370. confirmButtonText: "确定",
  371. });
  372. this.handletwoList();
  373. } else {
  374. this.$alert(result.message, "导入失败", {
  375. confirmButtonText: "确定",
  376. });
  377. }
  378. },
  379. handleSelectionAllChange(e) {
  380. this.selectData = e;
  381. },
  382. },
  383. };
  384. </script>
  385. <style lang="scss" scoped>
  386. .dateStyle {
  387. width: 100%;
  388. }
  389. .import-btn{
  390. margin-left: 10px;
  391. }
  392. </style>