receivable_list.vue 12 KB

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