index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <div class="capitalPool pagePadding">
  3. <ex-table
  4. v-loading="loading"
  5. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  6. :table="table"
  7. :data="tableData"
  8. :columns="columns"
  9. :page="pageInfo"
  10. :size="size"
  11. @page-curr-change="handlePageChange"
  12. @page-size-change="handleSizeChange"
  13. @screen-reset="
  14. pageInfo.curr = 1;
  15. parmValue.page = 1;
  16. searchList();
  17. "
  18. @screen-submit="
  19. pageInfo.curr = 1;
  20. parmValue.page = 1;
  21. searchList();
  22. "
  23. >
  24. <template #table-header="{}">
  25. <div style="width: 100%">
  26. <el-row :gutter="10" style="padding: 0 0 10px 80px">
  27. <el-col :span="8" style="width: 470px">
  28. <el-select
  29. v-model="code"
  30. multiple
  31. filterable
  32. :size="searchSize"
  33. remote
  34. style="width: 100%"
  35. :multiple-limit="1"
  36. reserve-keyword
  37. placeholder="请输入公司名称"
  38. :remote-method="remoteMethod"
  39. :loading="selectLoading"
  40. class="setWidth"
  41. >
  42. <el-option
  43. v-for="item in activeOptions"
  44. :key="item.companyNo"
  45. :label="item.companyName"
  46. :value="item.companyNo"
  47. />
  48. </el-select>
  49. </el-col>
  50. <el-col :span="8" style="width: 282px">
  51. <el-input
  52. :size="searchSize"
  53. v-model="parmValue.traNo"
  54. placeholder="请输入资金编号"
  55. >
  56. </el-input>
  57. </el-col>
  58. <el-col :span="4" style="width: 66px" class="fr tr">
  59. <el-button
  60. :size="searchSize"
  61. type="primary"
  62. @click="searchList"
  63. >
  64. 刷新
  65. </el-button>
  66. </el-col>
  67. <el-col :span="4" style="width: 66px" class="fr tr">
  68. <el-button
  69. type="warning"
  70. :size="searchSize"
  71. @click="restSearch"
  72. >
  73. 重置
  74. </el-button></el-col
  75. >
  76. </el-row>
  77. <el-row :gutter="10">
  78. <el-col :span="7" style="width: 168px">
  79. <el-select
  80. style="width: 100%"
  81. :size="searchSize"
  82. v-model="parmValue.inv_status"
  83. clearable
  84. @change="
  85. pageInfo.curr = 1;
  86. parmValue.page = 1;
  87. searchList();
  88. "
  89. placeholder="关联发票状态"
  90. >
  91. <el-option
  92. v-for="item in invoiceType"
  93. :key="item.code"
  94. :label="item.name"
  95. :value="item.code"
  96. >
  97. </el-option>
  98. </el-select>
  99. </el-col>
  100. <el-col :span="7" style="width: 168px">
  101. <el-select
  102. style="width: 100%"
  103. :size="searchSize"
  104. @change="
  105. pageInfo.curr = 1;
  106. parmValue.page = 1;
  107. searchList();
  108. "
  109. v-model="parmValue.order_status"
  110. clearable
  111. placeholder="关联确认单状态"
  112. >
  113. <el-option
  114. v-for="item in orderType"
  115. :key="item.code"
  116. :label="item.name"
  117. :value="item.code"
  118. >
  119. </el-option>
  120. </el-select>
  121. </el-col>
  122. <el-col :span="6" style="width: 302px">
  123. <number-range
  124. :start="parmValue.total_low"
  125. :end="parmValue.total_up"
  126. :type="1"
  127. :width="'135px'"
  128. :title="'资金总额'"
  129. :size="searchSize"
  130. @numReturned="numReturned($event, 0)"
  131. />
  132. </el-col>
  133. <el-col :span="4" style="width: 54px" class="fr tr">
  134. <el-button
  135. type="primary"
  136. :size="searchSize"
  137. icon="el-icon-search"
  138. @click="searchList"
  139. ></el-button>
  140. </el-col>
  141. </el-row>
  142. </div>
  143. </template>
  144. <template #status="{ scope }">
  145. <el-tag
  146. :type="
  147. scope.row.status == '4'
  148. ? 'danger'
  149. : scope.row.status == '3'
  150. ? 'success'
  151. : scope.row.status == '2'
  152. ? ''
  153. : 'warning'
  154. "
  155. size="mini"
  156. v-text="
  157. (
  158. capitalFlowType.find((item) => item.code == scope.row.status) ||
  159. {}
  160. ).name || '--'
  161. "
  162. ></el-tag>
  163. </template>
  164. <template #inv_status="{ scope }">
  165. <el-tag size="mini" v-if="scope.row.inv_status == '1'" type="danger"
  166. >未核销</el-tag
  167. >
  168. <el-tag
  169. size="mini"
  170. v-else-if="scope.row.inv_status == '2'"
  171. type="warning"
  172. >部分核销</el-tag
  173. >
  174. <el-tag size="mini" v-else type="success">全部核销</el-tag>
  175. </template>
  176. <template #order_status="{ scope }">
  177. <el-tag size="mini" v-if="scope.row.order_status == '1'" type="danger"
  178. >未核销</el-tag
  179. >
  180. <el-tag
  181. size="mini"
  182. v-else-if="scope.row.order_status == '2'"
  183. type="warning"
  184. >部分核销</el-tag
  185. >
  186. <el-tag v-else size="mini" type="success">全部核销</el-tag>
  187. </template>
  188. </ex-table>
  189. <no-auth v-else></no-auth>
  190. <!-- 导入数据 -->
  191. <add-edit
  192. :show-model="importshowModel"
  193. @refresh="searchList"
  194. @cancel="importshowModel = false"
  195. />
  196. <add-edit1
  197. :id="modelId"
  198. :show-model="showModel"
  199. :is-detail="isDetail"
  200. :traNo="traNo"
  201. :exam_remark="exam_remark"
  202. :status="status"
  203. @refresh="searchList"
  204. @cancel="showModel = false"
  205. />
  206. </div>
  207. </template>
  208. <script>
  209. import ExTable from "@/components/ExTableNew.vue";
  210. import asyncRequest from "@/apis/service/InvoiceSales/capitalPool";
  211. import mixinPage from "@/mixins/elPaginationHandle";
  212. import { mapGetters } from "vuex";
  213. import numberRange from "@/components/numberRange";
  214. import { invoiceType, orderType, capitalFlowType } from "@/assets/js/linkType";
  215. import resToken from "@/mixins/resToken";
  216. export default {
  217. name: "capitalPool",
  218. mixins: [mixinPage, resToken],
  219. components: {
  220. ExTable,
  221. numberRange,
  222. },
  223. computed: {
  224. //组件SIZE设置
  225. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  226. powers() {
  227. let tran =
  228. this.$store.getters.btnList.find(
  229. (item) => item.menu_route == "capitalPool"
  230. ) || {};
  231. if (tran && tran.action && tran.action.length > 0) {
  232. return tran.action;
  233. } else {
  234. return [];
  235. }
  236. },
  237. },
  238. data() {
  239. return {
  240. traNo: "",
  241. status: "",
  242. exam_remark: "",
  243. importshowModel: false,
  244. invoiceType: invoiceType,
  245. orderType: orderType,
  246. capitalFlowType: capitalFlowType,
  247. code: [],
  248. selectLoading: false,
  249. activeOptions: [],
  250. name: "",
  251. contector: "",
  252. loading: false,
  253. parmValue: {
  254. companyNo: "",
  255. total_low: "", //
  256. total_up: "", //
  257. inv_status: "", //
  258. order_status: "", //
  259. traNo: "", //
  260. status: "3", //
  261. start: "",
  262. end: "",
  263. page: 1, // 页码
  264. size: 15, // 每页显示条数
  265. },
  266. // 表格 - 数据
  267. tableData: [],
  268. // 表格 - 参数
  269. table: {
  270. stripe: true,
  271. border: true,
  272. _defaultHeader_: ["setcol"],
  273. },
  274. // 表格 - 分页
  275. pageInfo: {
  276. size: 15,
  277. curr: 1,
  278. total: 0,
  279. },
  280. // 表格 - 列参数
  281. columns: [
  282. {
  283. prop: "traNo",
  284. label: "资金编号",
  285. width: "250px",
  286. fixed: "left",
  287. },
  288. {
  289. prop: "total_fee",
  290. label: "总额",
  291. width: "120px",
  292. },
  293. {
  294. prop: "companyNo",
  295. label: "认领企业编码",
  296. width: "130px",
  297. },
  298. {
  299. prop: "customer",
  300. label: "认领企业",
  301. "min-width": "200px",
  302. },
  303. {
  304. prop: "inv_fee",
  305. label: "发票已核销金额",
  306. width: "120px",
  307. },
  308. {
  309. prop: "inv_used",
  310. label: "发票处理中的金额",
  311. width: "120px",
  312. },
  313. {
  314. prop: "winv_fee",
  315. label: "发票未核销金额",
  316. width: "120px",
  317. },
  318. {
  319. prop: "inv_status",
  320. label: "发票核销状态",
  321. width: "110px",
  322. _slot_: "inv_status",
  323. },
  324. {
  325. prop: "order_fee",
  326. label: "确认单已核销金额",
  327. width: "120px",
  328. },
  329. {
  330. prop: "order_used",
  331. label: "确认单处理中的金额",
  332. width: "135px",
  333. },
  334. {
  335. prop: "worder_fee",
  336. label: "确认单未核销金额",
  337. width: "120px",
  338. },
  339. {
  340. prop: "order_status",
  341. label: "确认单核销状态",
  342. width: "110px",
  343. _slot_: "order_status",
  344. },
  345. {
  346. prop: "addtime",
  347. label: "认领时间",
  348. sortable: true,
  349. width: "145px",
  350. },
  351. ],
  352. };
  353. },
  354. mounted() {
  355. this.searchList();
  356. },
  357. methods: {
  358. restSearch() {
  359. this.code = [];
  360. // 表格 - 分页
  361. this.pageInfo = {
  362. size: 15,
  363. curr: 1,
  364. total: 0,
  365. };
  366. this.parmValue = {
  367. companyNo: "",
  368. total_low: "", //
  369. total_up: "", //
  370. inv_status: "", //
  371. order_status: "", //
  372. start: "",
  373. end: "",
  374. traNo: "", //
  375. status: "3", //
  376. page: 1, // 页码
  377. size: 15, // 每页显示条数
  378. };
  379. this.searchList();
  380. },
  381. numReturned(e, type) {
  382. if (type === 0) {
  383. this.parmValue.total_low = e.lower; //最小金额
  384. this.parmValue.total_up = e.online; //最大金额
  385. } else if (type === 1) {
  386. this.parmValue.pay_low = e.lower; //最小金额
  387. this.parmValue.pay_up = e.online; //最大金额
  388. } else {
  389. this.parmValue.inv_low = e.lower; //最小金额
  390. this.parmValue.inv_up = e.online; //最大金额
  391. }
  392. },
  393. // 刷新表格
  394. async searchList() {
  395. if (
  396. (this.parmValue.total_low !== "" && this.parmValue.total_up === "") ||
  397. (this.parmValue.total_low === "" && this.parmValue.total_up !== "")
  398. ) {
  399. this.$message.warning("资金总额区间有误!");
  400. return;
  401. }
  402. this.parmValue.companyNo = this.code.join(",");
  403. this.loading = true;
  404. const res = await asyncRequest.list(this.parmValue);
  405. if (res && res.code === 0 && res.data) {
  406. this.tableData = res.data.list;
  407. // this.tableData.map((v1) => {
  408. // v1.addtime = v1.addtime.replace(".000", "");
  409. // return v1;
  410. // });
  411. this.pageInfo.total = Number(res.data.count);
  412. } else if (res && res.code >= 100 && res.code <= 104) {
  413. await this.logout();
  414. } else {
  415. this.tableData = [];
  416. this.pageInfo.total = 0;
  417. }
  418. this.loading = false;
  419. },
  420. async remoteMethod(query) {
  421. this.selectLoading = true;
  422. if (query !== "") {
  423. this.activeOptions = [];
  424. const res = await asyncRequest.clist({
  425. page: 1,
  426. size: 100,
  427. company: query,
  428. });
  429. if (res && res.code === 0 && res.data && res.data.list) {
  430. this.activeOptions = res.data.list;
  431. } else if (res && res.code >= 100 && res.code <= 104) {
  432. await this.logout();
  433. } else {
  434. this.$message.warning(res.message);
  435. }
  436. } else {
  437. this.activeOptions = [];
  438. }
  439. this.selectLoading = false;
  440. },
  441. },
  442. };
  443. </script>
  444. <style lang="scss" scoped>
  445. </style>