deposit_list.vue 13 KB

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