receivable_list.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <el-radio-group @change="changeRadioGroupFn" v-model="examine" size="">
  5. <el-radio-button label="">全部</el-radio-button>
  6. <el-radio-button label="WAIT">待审核</el-radio-button>
  7. <el-radio-button label="OK">审核通过</el-radio-button>
  8. <el-radio-button label="FAIL">审核驳回</el-radio-button>
  9. </el-radio-group>
  10. <br /><br />
  11. <!-- 筛选条件 -->
  12. <div>
  13. <el-form
  14. ref="searchForm"
  15. :model="searchForm"
  16. label-width="100px"
  17. size="small"
  18. label-position="left"
  19. >
  20. <el-row :gutter="20">
  21. <el-col :xs="24" :sm="12" :lg="6">
  22. <el-form-item label="单据来源" prop="source">
  23. <el-select
  24. v-model="searchForm.source"
  25. class="selectStyle"
  26. placeholder="请选择"
  27. filterable
  28. >
  29. <el-option value="工程押金"> </el-option>
  30. <el-option value="保证金"> </el-option>
  31. <el-option value="工程价差"> </el-option>
  32. </el-select>
  33. </el-form-item>
  34. </el-col>
  35. <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="单据编号" prop="code">
  37. <el-input
  38. v-model="searchForm.code"
  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="userName">
  45. <el-input
  46. v-model="searchForm.userName"
  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="startTime">
  53. <el-date-picker
  54. class="dateStyle"
  55. v-model="searchForm.startTime"
  56. placeholder="选择日期"
  57. type="datetime"
  58. default-time="00:00:00"
  59. value-format="yyyy-MM-dd HH:mm:ss"
  60. >
  61. </el-date-picker>
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="12" :lg="6">
  65. <el-form-item label="业务结束时间" prop="endTime">
  66. <el-date-picker
  67. class="dateStyle"
  68. v-model="searchForm.endTime"
  69. placeholder="选择日期"
  70. type="datetime"
  71. default-time="23:59:59"
  72. value-format="yyyy-MM-dd HH:mm:ss"
  73. >
  74. </el-date-picker>
  75. </el-form-item>
  76. </el-col>
  77. <el-col :xs="24" :sm="12" :lg="18">
  78. <el-form-item label="" class="fr">
  79. <el-button size="small" @click="clearFn">清空</el-button>
  80. <el-button size="small" type="primary" @click="searchFn"
  81. >搜索</el-button
  82. >
  83. </el-form-item>
  84. </el-col>
  85. </el-row>
  86. </el-form>
  87. </div>
  88. <!-- 按钮 -->
  89. <div class="btn-group clearfix">
  90. <div class="fl">
  91. <el-button
  92. v-if="$checkBtnRole('add', $route.meta.roles)"
  93. type="primary"
  94. icon="el-icon-plus"
  95. size="small"
  96. @click="addFn"
  97. >新建</el-button
  98. >
  99. <el-popconfirm
  100. v-if="$checkBtnRole('del', $route.meta.roles)"
  101. class="delClass"
  102. @onConfirm="deleFn"
  103. title="这是一段内容确定删除吗?"
  104. >
  105. <el-button
  106. :disabled="deleList.length < 1"
  107. slot="reference"
  108. type="danger"
  109. icon="el-icon-minus"
  110. size="small"
  111. >批量删除</el-button
  112. >
  113. </el-popconfirm>
  114. </div>
  115. <div class="fr">
  116. <ExportButton
  117. :exUrl="'/finance/other/rece/listExport'"
  118. :exParams="exParams"
  119. />
  120. </div>
  121. </div>
  122. <!-- 列表 -->
  123. <div class="mymain-container">
  124. <div class="table">
  125. <el-table
  126. v-loading="listLoading"
  127. :data="dataList"
  128. element-loading-text="Loading"
  129. border
  130. fit
  131. highlight-current-row
  132. stripe
  133. @selection-change="selectionChangeFn"
  134. >
  135. <el-table-column align="center" type="selection" width="100">
  136. </el-table-column>
  137. <el-table-column
  138. align="center"
  139. label="单据类型"
  140. prop="billType"
  141. min-width="160"
  142. show-overflow-tooltip
  143. ></el-table-column>
  144. <el-table-column
  145. align="center"
  146. label="单据来源"
  147. prop="source"
  148. min-width="160"
  149. show-overflow-tooltip
  150. ></el-table-column>
  151. <el-table-column
  152. align="center"
  153. label="单据编码"
  154. prop="code"
  155. min-width="160"
  156. show-overflow-tooltip
  157. ></el-table-column>
  158. <el-table-column
  159. align="center"
  160. label="业务日期"
  161. prop="theTime"
  162. min-width="160"
  163. show-overflow-tooltip
  164. ></el-table-column>
  165. <el-table-column
  166. align="center"
  167. label="往来单位类型"
  168. prop="userType"
  169. min-width="160"
  170. show-overflow-tooltip
  171. >
  172. <template slot-scope="scope">
  173. {{ scope.row.userType == "BD_Customer" ? "客户" : "" }}
  174. </template>
  175. </el-table-column>
  176. <el-table-column
  177. align="center"
  178. label="往来单位"
  179. prop="userName"
  180. min-width="160"
  181. show-overflow-tooltip
  182. ></el-table-column>
  183. <el-table-column
  184. align="center"
  185. label="币别"
  186. prop="amountType"
  187. min-width="160"
  188. show-overflow-tooltip
  189. ></el-table-column>
  190. <el-table-column
  191. align="center"
  192. label="总金额"
  193. prop="totalAmount"
  194. min-width="160"
  195. show-overflow-tooltip
  196. ></el-table-column>
  197. <el-table-column
  198. align="center"
  199. label="单据状态"
  200. prop="examineStatus"
  201. min-width="160"
  202. show-overflow-tooltip
  203. >
  204. <template slot-scope="scope">
  205. <el-tag v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  206. <el-tag v-show="scope.row.examineStatus == 'WAIT'"
  207. >待审核</el-tag
  208. >
  209. <el-tag v-show="scope.row.examineStatus == 'OK'">通过</el-tag>
  210. <el-tag v-show="scope.row.examineStatus == 'FAIL'"
  211. >不通过</el-tag
  212. >
  213. <el-tag v-show="scope.row.examineStatus == 'CLOSE'"
  214. >已关闭</el-tag
  215. >
  216. </template>
  217. </el-table-column>
  218. <el-table-column
  219. align="center"
  220. label="操作"
  221. min-width="160"
  222. show-overflow-tooltip
  223. fixed="right"
  224. >
  225. <template slot-scope="scope">
  226. <el-button
  227. v-show="
  228. (scope.row.examineStatus == 'WAIT' ||
  229. scope.row.examineStatus == 'FAIL') &&
  230. $checkBtnRole('examine', $route.meta.roles)
  231. "
  232. type="text"
  233. class="textColor"
  234. @click="approvalFn(scope.row.id)"
  235. >审批</el-button
  236. >
  237. <!-- <el-button
  238. type="text"
  239. class="textColor"
  240. v-show="scope.row.examineStatus == 'OK'"
  241. @click="unApprovalFn(scope.row.id)"
  242. >弃审</el-button
  243. > -->
  244. <el-button
  245. type="text"
  246. class="textColor"
  247. @click="detailFn(scope.row.id)"
  248. >详情</el-button
  249. >
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. </div>
  254. <!-- 分页 -->
  255. <div class="fr">
  256. <el-pagination
  257. @size-change="handleSizeChange"
  258. @current-change="handleCurrentChange"
  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. <ReceivableListAdd @updateList="updateList" v-else-if="showPage == 2" />
  270. <ReceivableListApproval
  271. :approvalId="approvalId"
  272. @updateList="updateList"
  273. v-else-if="showPage == 3"
  274. />
  275. <ReceivableListDetail :approvalId="approvalId" v-else-if="showPage == 4" />
  276. </div>
  277. </template>
  278. <script>
  279. import {
  280. getFinanceOtherReceList,
  281. getFinanceOtherReceDelete,
  282. getFinanceOtherReceAbandon,
  283. } from "@/api/finance/receivable_list";
  284. import ReceivableListAdd from "./components/receivable_list-add";
  285. import ReceivableListApproval from "./components/receivable_list-approval";
  286. import ReceivableListDetail from "./components/receivable_list-detail";
  287. export default {
  288. components: {
  289. ReceivableListAdd,
  290. ReceivableListApproval,
  291. ReceivableListDetail,
  292. },
  293. data() {
  294. return {
  295. currentPage: 1, // 当前页码
  296. pageSize: 10, // 每页数量
  297. listTotal: 0, // 列表总数
  298. dataList: [], // 列表数据
  299. searchForm: {
  300. source: "",
  301. code: "",
  302. userName: "",
  303. startTime: "",
  304. endTime: "",
  305. }, //搜索表单
  306. listLoading: false, // 列表加载loading
  307. examine: "",
  308. showPage: 1,
  309. approvalId: null,
  310. deleList: [],
  311. };
  312. },
  313. computed: {
  314. exParams() {
  315. return {
  316. source: this.searchForm.source,
  317. code: this.searchForm.code,
  318. userName: this.searchForm.userName,
  319. startTime: this.searchForm.startTime,
  320. endTime: this.searchForm.endTime,
  321. examineStatus: this.examine,
  322. };
  323. },
  324. },
  325. created() {
  326. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  327. },
  328. methods: {
  329. // //弃审
  330. // async unApprovalFn(id) {
  331. // await getFinanceOtherReceAbandon({ id });
  332. // this.$message.success("弃审成功");
  333. // this.getDataList({
  334. // pageNum: 1,
  335. // pageSize: this.pageSize,
  336. // examineStatus: this.examine,
  337. // });
  338. // },
  339. //radio切换'
  340. changeRadioGroupFn(v) {
  341. this.getDataList({
  342. pageSize: this.pageSize,
  343. pageNum: this.currentPage,
  344. examineStatus: v,
  345. });
  346. },
  347. // 更改每页数量
  348. handleSizeChange(val) {
  349. this.pageSize = val;
  350. this.currentPage = 1;
  351. this.getDataList({
  352. pageNum: 1,
  353. pageSize: this.pageSize,
  354. examineStatus: this.examine,
  355. });
  356. },
  357. // 更改当前页
  358. handleCurrentChange(val) {
  359. this.currentPage = val;
  360. this.getDataList({
  361. pageNum: val,
  362. pageSize: 10,
  363. examineStatus: this.examine,
  364. });
  365. },
  366. //清除
  367. async clearFn() {
  368. await this.$refs.searchForm.resetFields();
  369. this.examine = "";
  370. },
  371. //搜索
  372. searchFn() {
  373. this.getDataList({
  374. ...this.searchForm,
  375. // examineStatus: this.examine,
  376. pageSize: this.pageSize,
  377. pageNum: this.currentPage,
  378. });
  379. },
  380. //删除
  381. async deleFn() {
  382. let res = this.deleList.toString();
  383. console.log(res);
  384. await getFinanceOtherReceDelete({ ids: res });
  385. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  386. this.$message.success("删除成功");
  387. this.deleList = [];
  388. },
  389. selectionChangeFn(value) {
  390. console.log(value);
  391. const res = value.map((v) => v.id);
  392. console.log(res);
  393. this.deleList = res;
  394. },
  395. //新建后更新列表
  396. updateList() {
  397. this.getDataList({ pageSize: this.pageSize, pageNum: this.currentPage });
  398. },
  399. //获取来列表数据
  400. async getDataList(data) {
  401. const res = await getFinanceOtherReceList(data);
  402. console.log(res);
  403. this.dataList = res.data.records;
  404. this.listTotal = res.data.total;
  405. },
  406. //详情
  407. detailFn(id) {
  408. this.approvalId = id;
  409. this.showPage = 4;
  410. },
  411. //审批
  412. approvalFn(id) {
  413. this.approvalId = id;
  414. this.showPage = 3;
  415. },
  416. //新建
  417. addFn() {
  418. this.showPage = 2;
  419. },
  420. },
  421. };
  422. </script>
  423. <style lang="scss" scoped>
  424. .selectStyle {
  425. width: 100%;
  426. }
  427. .dateStyle {
  428. width: 100%;
  429. }
  430. .delClass {
  431. margin-left: 10px;
  432. }
  433. </style>