returns.vue 29 KB

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