init-returns.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. :page.sync="page"
  7. :permission="permissionList"
  8. :before-open="beforeOpen"
  9. v-model="form"
  10. ref="crud"
  11. @row-update="rowUpdate"
  12. @row-save="rowSave"
  13. @row-del="rowDel"
  14. @search-change="searchChange"
  15. @search-reset="searchReset"
  16. @selection-change="selectionChange"
  17. @current-change="currentChange"
  18. @size-change="sizeChange"
  19. @refresh-change="refreshChange"
  20. @on-load="onLoad">
  21. <template slot="menuLeft">
  22. <el-button type="danger"
  23. size="small"
  24. icon="el-icon-delete"
  25. plain
  26. :disabled="delBatchBtn"
  27. v-if="permission.returns_delete"
  28. @click="handleDelete">刪 除
  29. </el-button>
  30. <el-button type="primary"
  31. size="small"
  32. icon="el-icon-upload"
  33. plain
  34. v-if="permission.returns_upload"
  35. @click="handleUpload">上 傳
  36. </el-button>
  37. <el-button type="success"
  38. size="small"
  39. icon="el-icon-setting"
  40. plain
  41. v-if="permission.returns_setting"
  42. @click="handleSetting">設置發佈人
  43. </el-button>
  44. <el-button type="primary"
  45. size="small"
  46. icon="el-icon-download"
  47. plain
  48. v-if="permission.returns_download"
  49. @click="handleDownload">下載
  50. </el-button>
  51. <el-button type="primary" size="small" :disabled="issueBatchBtn" v-if="permission.returns_issue" @click="issueBatch">批量發佈</el-button>
  52. <el-button type="primary" size="small" :disabled="approveBatchBtn" v-if="permission.returns_approve" @click="approveBatch"><i class="el-icon-check"></i>批量確認</el-button>
  53. </template>
  54. <template slot="menu" slot-scope="{row, index}">
  55. <el-button size="small" class="el-button--text" v-if="permission.returns_view" @click="$refs.crud.rowView(row, index)"><i class="el-icon-view"></i> 查 看</el-button>
  56. <el-button size="small" class="el-button--text" v-if="permission.returns_edit && row.process <= 2" @click="$refs.crud.rowEdit(row, index)"><i class="el-icon-edit"></i> 編 輯</el-button>
  57. <el-button size="small" class="el-button--text" v-if="permission.returns_delete && row.process <= 2" @click="$refs.crud.rowDel(row, index)"><i class="el-icon-delete"></i> 刪 除</el-button>
  58. <el-button size="small" class="el-button--text" v-if="permission.returns_issue && row.process == 2 && row.personNo == userInfo.user_ehr" @click="form = row,issueVisible = true">去發佈</el-button>
  59. <el-button size="small" class="el-button--text" v-if="permission.returns_approve && row.process == 3" @click="approve(row, index)"><i class="el-icon-check"></i> 確 認</el-button>
  60. </template>
  61. <template slot="process" slot-scope="{row, index}">
  62. <el-tag size="small " type="primary" plain v-if="row.process == 2">待發佈</el-tag>
  63. <el-tag size="small " type="warning" plain v-if="row.process == 3">待確認</el-tag>
  64. <el-tag size="small " type="success" plain v-if="row.process == 4">已確認</el-tag>
  65. </template>
  66. <template slot="personNo" slot-scope="{row}">
  67. <span v-if="row.process != 4">{{row.personName + '-' + row.personNo}}</span>
  68. </template>
  69. </avue-crud>
  70. <el-dialog title="文件上傳"
  71. append-to-body
  72. :visible.sync="attachBox"
  73. width="555px">
  74. <avue-form ref="form" :option="attachOption" v-model="attachForm" :upload-after="uploadAfter">
  75. </avue-form>
  76. </el-dialog>
  77. <el-dialog title="信息分解"
  78. append-to-body
  79. :visible.sync="temVisible"
  80. :fullscreen="true"
  81. :close-on-press-escape="false"
  82. @close="attachBox = false,onLoad(page)"
  83. >
  84. <returns-comfire :data="data2"></returns-comfire>
  85. </el-dialog>
  86. <el-dialog title="批量審核"
  87. append-to-body
  88. :visible.sync="approveBatchVisible"
  89. width="70%">
  90. <returns-approve-batch :data="this.selectionList" @close="approveBatchVisible = false, onLoad(page)"></returns-approve-batch>
  91. </el-dialog>
  92. <el-dialog title="信息確認"
  93. append-to-body
  94. :visible.sync="approveVisible"
  95. width="70%">
  96. <returns-approve :form="approveForm" @close="approveVisible = false, onLoad(page)"></returns-approve>
  97. </el-dialog>
  98. <el-dialog :append-to-body="true" :modal-append-to-body="false" :visible.sync="settingVisible" title="設置發佈人">
  99. <flow-settings :id="personId" :ehr="personNo" :name="personName" :callback="settingCallback" @close="settingVisible = false"></flow-settings>
  100. </el-dialog>
  101. <el-dialog :append-to-body="true" :modal-append-to-body="false" :visible.sync="issueVisible">
  102. <returns-issue :form="form" @close="issueVisible = false, onLoad(page)"></returns-issue>
  103. </el-dialog>
  104. </basic-container>
  105. </template>
  106. <script>
  107. import {getList, getDetail, add, update, remove, returnsSubmit, settingSave, getSetting, issue, getDownloadList} from "@/api/bank/returns";
  108. import {mapGetters} from "vuex";
  109. import {dateFormat} from "../../util/date";
  110. import ReturnsComfire from "../../components/common/returns-comfire";
  111. import ReturnsApprove from "../../components/common/returns-approve";
  112. import FlowSettings from "../../components/common/flow-settings";
  113. import ReturnsIssue from "../../components/common/returns-issue";
  114. import {getDeptTree, getTree} from "@/api/system/dept";
  115. import {getStandardByCode} from "@/api/bank/handoverstandard";
  116. import ReturnsApproveBatch from "../../components/common/returns-approve-batch";
  117. import {getDictValue} from "../../api/system/dict";
  118. export default {
  119. name: "init-returns",
  120. components: {ReturnsApproveBatch, ReturnsIssue, FlowSettings, ReturnsApprove, ReturnsComfire},
  121. data() {
  122. return {
  123. personId: null,
  124. personNo: null,
  125. personName: null,
  126. settingVisible: false,
  127. issueVisible: false,
  128. delBatchBtn: true,
  129. issueBatchBtn: true,
  130. approveBatchBtn: false,
  131. form: {},
  132. approveForm: {},
  133. query: {},
  134. loading: true,
  135. temVisible: false,
  136. approveVisible: false,
  137. approveBatchVisible: false,
  138. page: {
  139. pageSize: 10,
  140. currentPage: 1,
  141. total: 0
  142. },
  143. selectionList: [],
  144. option: {
  145. addTitle: '新增【新開戶退件登記表】',
  146. editTitle: '編輯【新開戶退件登記表】',
  147. viewTitle: '查看【新開戶退件登記表】',
  148. height:'auto',
  149. calcHeight: 30,
  150. tip: false,
  151. searchShow: true,
  152. searchMenuSpan: 6,
  153. border: true,
  154. index: true,
  155. viewBtn: false,
  156. editBtn: false,
  157. addBtn: false,
  158. delBtn: false,
  159. selection: true,
  160. dialogClickModal: false,
  161. column: [
  162. {
  163. label: "業務類型",
  164. prop: "isPublic",
  165. type: "select",
  166. search: true,
  167. searchSpan: 4,
  168. dataType: "string",
  169. dicUrl: `/api/blade-system/dict/dictionary?code=business_type`,
  170. props: {
  171. label: "dictValue",
  172. value: "dictKey"
  173. },
  174. dicFormatter: (res) => {
  175. res.data.forEach(item => {item.disabled = item.isSealed == 1;})
  176. return res.data;
  177. },
  178. rules: [{
  179. required: true,
  180. message: "請輸入業務類型",
  181. trigger: "blur"
  182. }]
  183. },
  184. {
  185. label: "銀行號",
  186. prop: "bankNo",
  187. span: 24,
  188. hide: true,
  189. search: true,
  190. searchSpan: 4,
  191. rules: [{
  192. required: true,
  193. message: "請輸入銀行號",
  194. trigger: "blur"
  195. }]
  196. },
  197. {
  198. label: "機構號",
  199. prop: "orgNo",
  200. hide: true,
  201. rules: [{
  202. required: true,
  203. message: "請輸入機構號",
  204. trigger: "blur"
  205. }]
  206. },
  207. {
  208. label: "機構名稱",
  209. prop: "orgName",
  210. disabled: true,
  211. rules: [{
  212. required: true,
  213. message: "請輸入機構號",
  214. trigger: "blur"
  215. }]
  216. },
  217. {
  218. label: "區域/支行",
  219. prop: "orgNos",
  220. hide: true,
  221. display: false,
  222. searchMultiple: true,
  223. search: true,
  224. type: "tree",
  225. dicData: [],
  226. props: {
  227. label: "title",
  228. value: "key"
  229. },
  230. checkStrictly: true,
  231. rules: [{
  232. required: true,
  233. message: "請輸入機構號",
  234. trigger: "blur"
  235. }]
  236. },
  237. /*{
  238. label: "序號",
  239. prop: "serialNo",
  240. rules: [{
  241. required: true,
  242. message: "請輸入序號",
  243. trigger: "blur"
  244. }]
  245. },*/
  246. {
  247. label: "支行",
  248. prop: "subBank",
  249. rules: [{
  250. required: true,
  251. message: "請輸入支行",
  252. trigger: "blur"
  253. }]
  254. },
  255. {
  256. label: "支行機構號",
  257. prop: "subOrgNo",
  258. rules: [{
  259. required: true,
  260. message: "請輸入支行機構號",
  261. trigger: "blur"
  262. }]
  263. },
  264. {
  265. label: "客戶名稱",
  266. prop: "customerName",
  267. rules: [{
  268. required: true,
  269. message: "請輸入客戶名稱",
  270. trigger: "blur"
  271. }]
  272. },
  273. {
  274. label: "狀態",
  275. prop: "status",
  276. type: "select",
  277. dataType: "string",
  278. dicUrl: `/api/blade-system/dict/dictionary?code=returns_status`,
  279. props: {
  280. label: "dictValue",
  281. value: "dictKey"
  282. },
  283. dicFormatter: (res) => {
  284. res.data.forEach(item => {item.disabled = item.isSealed == 1;})
  285. return res.data;
  286. },
  287. rules: [{
  288. required: true,
  289. message: "請輸入狀態",
  290. trigger: "blur"
  291. }]
  292. },
  293. {
  294. label: "退件原因",
  295. prop: "reason",
  296. rules: [{
  297. required: true,
  298. message: "請輸入退件原因",
  299. trigger: "blur"
  300. }]
  301. },
  302. {
  303. label: "備註",
  304. prop: "remark",
  305. rules: [{
  306. required: false,
  307. message: "請輸入備註",
  308. trigger: "blur"
  309. }]
  310. },
  311. {
  312. label: "條碼",
  313. prop: "barCode",
  314. rules: [{
  315. required: false,
  316. message: "請輸入條碼",
  317. trigger: "blur"
  318. }]
  319. },
  320. {
  321. label: "接辦行經辦",
  322. prop: "handlingBank",
  323. search: true,
  324. searchSpan: 4,
  325. rules: [{
  326. required: true,
  327. message: "請輸入接辦行經辦",
  328. trigger: "blur"
  329. }]
  330. },
  331. {
  332. label: "接辦行覆核",
  333. prop: "handlingBankReview",
  334. search: true,
  335. searchSpan: 4,
  336. rules: [{
  337. required: false,
  338. message: "請輸入接辦行覆核",
  339. trigger: "blur"
  340. }]
  341. },
  342. {
  343. label: "處理日期",
  344. prop: "handlingDate",
  345. type: "date",
  346. format: "yyyy-MM-dd",
  347. valueFormat: "yyyy-MM-dd",
  348. rules: [{
  349. required: true,
  350. message: "請輸入處理日期",
  351. trigger: "blur"
  352. }]
  353. },
  354. {
  355. label: "退件日期",
  356. prop: "handlingDateRange",
  357. type: "date",
  358. format: "yyyy-MM-dd",
  359. valueFormat: "yyyy-MM-dd",
  360. searchRange:true,
  361. hide: true,
  362. addDisplay: false,
  363. editDisplay: false,
  364. viewDisplay: false,
  365. search: true,
  366. rules: [{
  367. required: true,
  368. message: "請輸入交接日期",
  369. trigger: "blur"
  370. }]
  371. },
  372. {
  373. label: "經辦",
  374. prop: "handler",
  375. rules: [{
  376. required: true,
  377. message: "請輸入經辦",
  378. trigger: "blur"
  379. }]
  380. },
  381. {
  382. label: "跟進情況",
  383. prop: "handlingStatus",
  384. type: "select",
  385. dataType: "string",
  386. dicUrl: `/api/blade-system/dict/dictionary?code=processing_status`,
  387. props: {
  388. label: "dictValue",
  389. value: "dictKey"
  390. },
  391. dicFormatter: (res) => {
  392. res.data.forEach(item => {item.disabled = item.isSealed == 1;})
  393. return res.data;
  394. },
  395. rules: [{
  396. required: false,
  397. message: "請輸入跟進情況",
  398. trigger: "blur"
  399. }]
  400. },
  401. {
  402. label: "支行備註",
  403. prop: "bankRemark",
  404. viewDisplay: false,
  405. editDisplay: false,
  406. // hide: true,
  407. rules: [{
  408. required: false,
  409. message: "請輸入支行備註",
  410. trigger: "blur"
  411. }]
  412. },
  413. {
  414. label: "支行確認人員工號",
  415. prop: "bankConfirmNo",
  416. viewDisplay: false,
  417. editDisplay: false,
  418. // hide: true,
  419. rules: [{
  420. required: true,
  421. message: "請輸入支行確認人員工號",
  422. trigger: "blur"
  423. }]
  424. },
  425. {
  426. label: "支行確認人姓名",
  427. prop: "bankConfirmName",
  428. viewDisplay: false,
  429. editDisplay: false,
  430. // hide: true,
  431. rules: [{
  432. required: true,
  433. message: "請輸入支行確認人姓名",
  434. trigger: "blur"
  435. }]
  436. },
  437. {
  438. label: "確認日期",
  439. prop: "bankConfirmTime",
  440. type: "datetime",
  441. format: "yyyy-MM-dd HH:mm:ss",
  442. valueFormat: "yyyy-MM-dd HH:mm:ss",
  443. viewDisplay: false,
  444. editDisplay: false,
  445. // hide: true,
  446. rules: [{
  447. required: true,
  448. message: "請輸入確認日期",
  449. trigger: "blur"
  450. }]
  451. },
  452. /*{
  453. label: "待辦人",
  454. prop: 'personNo'
  455. },*/
  456. {
  457. label: "進度",
  458. prop: "process",
  459. viewDisplay: false,
  460. editDisplay: false,
  461. rules: [{
  462. required: true,
  463. message: "請輸入節點",
  464. trigger: "blur"
  465. }]
  466. },
  467. ]
  468. },
  469. data: [],
  470. data2: [],
  471. temForm: {},
  472. attachForm: {},
  473. attachBox: false,
  474. attachOption: {
  475. submitBtn: false,
  476. emptyBtn: false,
  477. column: [
  478. {
  479. label: '文件上傳',
  480. prop: 'attachFile',
  481. type: 'upload',
  482. drag: true,
  483. loadText: '文件上傳中,請稍等',
  484. span: 24,
  485. propsHttp: {
  486. res: 'data'
  487. },
  488. action: "/api/bank/returns/readExcel"
  489. }
  490. ]
  491. }
  492. };
  493. },
  494. computed: {
  495. ...mapGetters(["permission"]),
  496. ...mapGetters(["userInfo"]),
  497. permissionList() {
  498. return {
  499. addBtn: this.vaildData(this.permission.returns_add, false),
  500. viewBtn: this.vaildData(this.permission.returns_view, false),
  501. delBtn: this.vaildData(this.permission.returns_delete, false),
  502. editBtn: this.vaildData(this.permission.returns_edit, false)
  503. };
  504. },
  505. ids() {
  506. let ids = [];
  507. this.selectionList.forEach(ele => {
  508. ids.push(ele.id);
  509. });
  510. return ids.join(",");
  511. }
  512. },
  513. mounted() {
  514. getDeptTree().then(res => {
  515. const column = this.findObject(this.option.column, "orgNos");
  516. let treeData = getTree(res.data.data, this.userInfo.dept_id);
  517. column.dicData = treeData;
  518. });
  519. getStandardByCode("returns").then(res => {
  520. const data = res.data.data;
  521. if (data){
  522. this.option.addTitle = data.content;
  523. this.option.editTitle = data.content;
  524. this.option.viewTitle = data.content;
  525. }
  526. });
  527. },
  528. methods: {
  529. settingCallback(row){
  530. this.form.personId = row.personId;
  531. this.form.personNo = row.personNo;
  532. this.form.personName = row.personName;
  533. settingSave(this.form).then(() => {
  534. this.onLoad(this.page);
  535. this.$message({
  536. type: "success",
  537. message: "操作成功!"
  538. });
  539. }, error => {
  540. window.console.log('error');
  541. });
  542. },
  543. handleDownload(){
  544. if (this.selectionList.length === 0) {
  545. let tip = "確定下載篩選的" + this.page.total + "條數據嗎?"
  546. this.$confirm(tip, {
  547. confirmButtonText: "確定",
  548. cancelButtonText: "取消",
  549. type: "warning"
  550. })
  551. .then(() => {
  552. getDownloadList(this.query).then(res => {
  553. let data = res.data.data;
  554. if (data && data.length > 0){
  555. data.forEach(item => {
  556. item.status = item.returnStatus;
  557. });
  558. }
  559. this.downLoadData(data, true)
  560. });
  561. })
  562. }else{
  563. this.downLoadData(this.selectionList, false)
  564. }
  565. },
  566. downLoadData(data, isAll){
  567. let columns = this.deepClone(this.option.column);
  568. for (let i = 0; i < columns.length; i++) {
  569. let item = columns[i];
  570. if (item.hide || item.prop == 'process'){
  571. columns.splice(i, 1);
  572. i--;
  573. }
  574. if (!isAll && (item.type == 'select' || item.type == 'tree')){
  575. item.prop = '$' + item.prop;
  576. }
  577. }
  578. this.$Export.excel({
  579. title: "新開戶退件登記表" || new Date().getTime(),
  580. columns: columns,
  581. data: data
  582. });
  583. },
  584. handleSetting(){
  585. getSetting().then((res) => {
  586. let data = res.data.data;
  587. if (!!data){
  588. this.personId = data.personId;
  589. this.personNo = data.personNo;
  590. this.personName = data.personName;
  591. }
  592. });
  593. this.settingVisible = true;
  594. },
  595. issueBatch(){
  596. let _this = this;
  597. this.$confirm("確定將選擇數據發佈?", {
  598. confirmButtonText: "確定",
  599. cancelButtonText: "取消",
  600. type: "warning"
  601. })
  602. .then(() => {
  603. for (let i = 0; i < this.selectionList.length; i++) {
  604. let row = this.selectionList[i];
  605. issue(row).then(() => {})
  606. }
  607. this.$confirm("批量發佈成功!",{
  608. type: "success",
  609. showCancelButton: false,
  610. showClose: false,
  611. }).then(() => {
  612. _this.onLoad(this.page)
  613. })
  614. })
  615. },
  616. approveBatch(){
  617. this.$refs.crud.toggleSelection();
  618. let toApproveArr = [];
  619. for (let i = 0; i < this.data.length; i++) {
  620. let item = this.data[i];
  621. if (item.process == 3){
  622. toApproveArr.push(item)
  623. }
  624. }
  625. if (toApproveArr.length == 0){
  626. this.$message.warning("當前頁沒有符合條件的記錄!")
  627. return;
  628. }
  629. this.$refs.crud.toggleSelection(toApproveArr);
  630. this.approveBatchVisible = true;
  631. },
  632. approve(row, index){
  633. this.approveVisible = true;
  634. this.approveForm = row;
  635. },
  636. infoFormat(row){
  637. row.isPublic = row.isPublic == '對公' ? 1 : 0;
  638. let arr = row.subBank.split(' ');
  639. row.subOrgNo = arr[0];
  640. row.subBank = arr[1];
  641. if (row.status == '退件'){
  642. row.status = '1';
  643. }else if (row.status == 'HOLD'){
  644. row.status = '2';
  645. }else if (row.status == '完成'){
  646. row.status = '3';
  647. }
  648. /*let userInfoStr = localStorage.getItem("saber-userInfo");
  649. let userInfo = JSON.parse(userInfoStr);
  650. row.bankConfirmNo = userInfo.content.user_ehr;
  651. row.bankConfirmName = userInfo.content.user_name;
  652. row.bankConfirmTime = dateFormat(new Date(), "yyyy-MM-dd HH:mm:ss");*/
  653. return row;
  654. },
  655. uploadAfter(res, done, loading, column){
  656. if (res && res.length > 0){
  657. for (let i = 0; i < res.length; i++) {
  658. let row = res[i];
  659. row = this.infoFormat(row);
  660. }
  661. this.data2 = res;
  662. }
  663. this.temVisible = true;
  664. loading = false;
  665. done();
  666. },
  667. handleUpload(){
  668. this.attachBox = true;
  669. },
  670. rowSave(row, done, loading) {
  671. add(row).then(() => {
  672. this.onLoad(this.page);
  673. this.$message({
  674. type: "success",
  675. message: "操作成功!"
  676. });
  677. done();
  678. }, error => {
  679. loading();
  680. window.console.log(error);
  681. });
  682. },
  683. rowUpdate(row, index, done, loading) {
  684. update(row).then(() => {
  685. this.onLoad(this.page);
  686. this.$message({
  687. type: "success",
  688. message: "操作成功!"
  689. });
  690. done();
  691. }, error => {
  692. loading();
  693. console.log(error);
  694. });
  695. },
  696. rowDel(row) {
  697. this.$confirm("確定將選擇數據刪除?", {
  698. confirmButtonText: "確定",
  699. cancelButtonText: "取消",
  700. type: "warning"
  701. })
  702. .then(() => {
  703. return remove(row.id);
  704. })
  705. .then(() => {
  706. this.onLoad(this.page);
  707. this.$message({
  708. type: "success",
  709. message: "操作成功!"
  710. });
  711. });
  712. },
  713. handleDelete() {
  714. if (this.selectionList.length === 0) {
  715. this.$message.warning("請選擇至少一條數據");
  716. return;
  717. }
  718. this.$confirm("確定將選擇數據刪除?", {
  719. confirmButtonText: "確定",
  720. cancelButtonText: "取消",
  721. type: "warning"
  722. })
  723. .then(() => {
  724. return remove(this.ids);
  725. })
  726. .then(() => {
  727. this.onLoad(this.page);
  728. this.$message({
  729. type: "success",
  730. message: "操作成功!"
  731. });
  732. this.$refs.crud.toggleSelection();
  733. });
  734. },
  735. beforeOpen(done, type) {
  736. if (["edit", "view"].includes(type)) {
  737. /*getDetail(this.form.id).then(res => {
  738. this.form = res.data.data;
  739. });*/
  740. if (type == "view"){
  741. this.findObject(this.option.column, "bankRemark").viewDisplay = this.form.process == 4;
  742. this.findObject(this.option.column, "bankConfirmNo").viewDisplay = this.form.process == 4;
  743. this.findObject(this.option.column, "bankConfirmName").viewDisplay = this.form.process == 4;
  744. this.findObject(this.option.column, "bankConfirmTime").viewDisplay = this.form.process == 4;
  745. }
  746. }
  747. done();
  748. },
  749. searchReset() {
  750. this.query = {};
  751. this.onLoad(this.page);
  752. },
  753. searchChange(params, done) {
  754. if (params.handlingDateRange){
  755. params.handlingDate_begin = params.handlingDateRange[0], params.handlingDate_end = params.handlingDateRange[1];
  756. params.handlingDateRange = null;
  757. }
  758. if (params.orgNos){
  759. params.orgNostr = params.orgNos.join();
  760. params.orgNos = '';
  761. }
  762. this.query = params;
  763. this.page.currentPage = 1;
  764. this.onLoad(this.page, params);
  765. done();
  766. },
  767. selectionChange(list) {
  768. this.selectionList = list;
  769. if (list && list.length > 0){
  770. let issueFlag = true, approveFlag = true, delFlag = true;
  771. for (let i = 0; i < list.length; i++) {
  772. let item = list[i];
  773. delFlag = delFlag && item.process <= 2;
  774. issueFlag = issueFlag && item.process == 2 && item.personNo == this.userInfo.user_ehr;
  775. approveFlag = approveFlag && item.process == 3;
  776. }
  777. this.delBatchBtn = !delFlag;
  778. this.issueBatchBtn = !issueFlag;
  779. // this.approveBatchBtn = !approveFlag;
  780. }else{
  781. this.delBatchBtn = true;
  782. this.issueBatchBtn = true;
  783. // this.approveBatchBtn = true;
  784. }
  785. },
  786. selectionClear() {
  787. this.selectionList = [];
  788. this.$refs.crud.toggleSelection();
  789. },
  790. currentChange(currentPage){
  791. this.page.currentPage = currentPage;
  792. },
  793. sizeChange(pageSize){
  794. this.page.pageSize = pageSize;
  795. },
  796. refreshChange() {
  797. this.onLoad(this.page, this.query);
  798. },
  799. onLoad(page, params = {}) {
  800. this.loading = true;
  801. params.createUser = this.userInfo.user_id;
  802. getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  803. const data = res.data.data;
  804. this.page.total = data.total;
  805. this.data = data.records;
  806. this.loading = false;
  807. this.selectionClear();
  808. });
  809. }
  810. }
  811. };
  812. </script>
  813. <style>
  814. </style>