init-returns.vue 29 KB

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