sealhandover.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  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. :search.sync="search"
  12. @row-update="rowUpdate"
  13. @row-save="rowSave"
  14. @row-del="rowDel"
  15. @search-change="searchChange"
  16. @search-reset="searchReset"
  17. @selection-change="selectionChange"
  18. @current-change="currentChange"
  19. @size-change="sizeChange"
  20. @refresh-change="refreshChange"
  21. @on-load="onLoad">
  22. <template slot="menuLeft">
  23. <el-button type="danger"
  24. size="small"
  25. icon="el-icon-delete"
  26. plain
  27. :disabled="delBatchBtn"
  28. v-if="permission.sealhandover_delete"
  29. @click="handleDelete">刪 除
  30. </el-button>
  31. <el-button type="success"
  32. size="small"
  33. icon="el-icon-search"
  34. plain
  35. v-if="permission.sealhandover_keep_view"
  36. @click="keepVisible = true">保管人查詢
  37. </el-button>
  38. <el-button type="primary"
  39. size="small"
  40. icon="el-icon-download"
  41. plain
  42. v-if="permission.sealhandover_download"
  43. @click="handleDownload">下載
  44. </el-button>
  45. </template>
  46. <template slot="menu" slot-scope="{row, index}">
  47. <el-button size="small" class="el-button--text" v-if="permission.sealhandover_edit && userInfo.user_id == row.createUser && row.process == 2" @click="$refs.crud.rowEdit(row, index)"><i class="el-icon-edit"></i> 編 輯</el-button>
  48. <el-button size="small" class="el-button--text" v-if="permission.sealhandover_delete && userInfo.user_id == row.createUser && row.process == 2" @click="$refs.crud.rowDel(row, index)"><i class="el-icon-delete"></i> 刪 除</el-button>
  49. <el-button size="small" class="el-button--text" v-if="permission.sealhandover_sure && row.process == 2 && row.receiverId == userInfo.user_id" @click="approveForm=row,approveVisible=true"><i class="el-icon-check"></i> 確 認</el-button>
  50. </template>
  51. <template slot="receiverNameForm">
  52. <div v-if="!hasOrgNo">
  53. <select-dialog-user :id="form.receiverId" :name="form.receiverName" :ehr="form.receiverNo" :disabled="receiverDisabled" :callback="selectCallback"></select-dialog-user>
  54. </div>
  55. <div v-if="hasOrgNo">
  56. <select-dialog-user v-if="hasOrgNo" :id="form.receiverId" :name="form.receiverName" :ehr="form.receiverNo" :disabled="receiverDisabled" :has-org-no="hasOrgNo" :callback="selectCallback"></select-dialog-user>
  57. </div>
  58. </template>
  59. <!--<template slot="handoverPersonNameForm">
  60. <select-dialog-user :name="form.handoverPersonName" :ehr="form.handoverPersonNo" :callback="handoverSelectCallback"></select-dialog-user>
  61. </template>-->
  62. <template slot-scope="{disabled,size}" slot="sealNoSearch">
  63. <!-- <avue-input placeholder="請選擇內容" v-model="search.sealNos"></avue-input>-->
  64. <el-input placeholder="請輸入印章編號" v-model="search.sealNo"></el-input>
  65. </template>
  66. <template slot="titleForm" slot-scope="{row, index}">
  67. <div v-html="title" style="white-space: pre-line;color: red;font-weight: bold;"></div>
  68. </template>
  69. <template slot="titleLabel" slot-scope="{row, index}">
  70. <span style="color: red;font-weight: bold;">注意事項:</span>
  71. </template>
  72. <template slot="isTurnIn" slot-scope="{row, index}">
  73. <!-- <el-checkbox v-model="row.isTurnIn" @change="turnInChange"></el-checkbox>-->
  74. <el-tag size="small " type="success" plain v-if="row.isTurnIn">上繳至上級單位</el-tag>
  75. <el-tag size="small " type="danger" plain v-if="!row.isTurnIn">非上繳</el-tag>
  76. </template>
  77. <template slot="isTurnInForm" slot-scope="{row, index}">
  78. <el-checkbox v-model="row.isTurnIn" :disabled="turnInDisabled" @change="turnInChange"></el-checkbox>
  79. <el-tag size="small " type="success" plain v-if="row.isTurnIn">上繳至上級單位</el-tag>
  80. <el-tag size="small " type="danger" plain v-if="!row.isTurnIn">非上繳</el-tag>
  81. </template>
  82. <template slot="process" slot-scope="{row, index}">
  83. <el-tag size="small " type="warning" plain v-if="row.process == 2">待確認</el-tag>
  84. <el-tag size="small " type="success" plain v-if="row.process == 3">已確認</el-tag>
  85. </template>
  86. </avue-crud>
  87. <el-dialog :append-to-body="true" :modal-append-to-body="false" :destroy-on-close="true" :fullscreen="true" :visible.sync="keepVisible" title="保管人查詢">
  88. <div v-if="keepVisible">
  89. <sealhandover-keep></sealhandover-keep>
  90. </div>
  91. </el-dialog>
  92. <el-dialog title="信息確認"
  93. append-to-body
  94. :visible.sync="approveVisible"
  95. width="70%">
  96. <sealhandover-sure :form="approveForm" @close="approveVisible = false, onLoad(page)"></sealhandover-sure>
  97. </el-dialog>
  98. </basic-container>
  99. </template>
  100. <script>
  101. import {getList, getDetail, add, update, remove, getByNoAndType, getDownloadList, getCurrentUserKeepList} from "@/api/bank/sealhandover";
  102. import {mapGetters} from "vuex";
  103. import { getCurrentDept } from "@/api/system/dept";
  104. import {dateFormat} from "../../util/date";
  105. import SelectDialogUser from "../../components/select-dialog/select-dialog-user";
  106. import {getDeptTree, getTree, getChildsDept} from "@/api/system/dept";
  107. import SealhandoverKeep from "./sealhandover-keep";
  108. import {getStandardByCode} from "@/api/bank/handoverstandard";
  109. import SealhandoverSure from "../../components/common/sealhandover-sure";
  110. export default {
  111. components: {SealhandoverSure, SealhandoverKeep, SelectDialogUser},
  112. data() {
  113. return {
  114. turnInDisabled: false,
  115. isManageUser: false,
  116. userKeepList: [],
  117. currentDept: [],
  118. title: "",
  119. search: {},
  120. receiverDisabled: false,
  121. keepVisible: false,
  122. delBatchBtn: true,
  123. approveForm: {},
  124. approveVisible: false,
  125. type: '',
  126. hasOrgNo: null,
  127. form: {},
  128. query: {},
  129. loading: true,
  130. page: {
  131. pageSize: 10,
  132. currentPage: 1,
  133. total: 0
  134. },
  135. selectionList: [],
  136. option: {
  137. addTitle: '新增【業務印章交接登記表】',
  138. editTitle: '編輯【業務印章交接登記表】',
  139. viewTitle: '查看【業務印章交接登記表】',
  140. height:'auto',
  141. calcHeight: 30,
  142. tip: false,
  143. searchShow: true,
  144. searchMenuSpan: 6,
  145. border: true,
  146. index: true,
  147. viewBtn: true,
  148. editBtn: false,
  149. delBtn: false,
  150. selection: true,
  151. dialogClickModal: false,
  152. column: [
  153. {
  154. label: '注意事項',
  155. prop: 'title',
  156. hide: true,
  157. formslot: true,
  158. type: 'text',
  159. span: 24
  160. },
  161. {
  162. label: "銀行號",
  163. prop: "bankNo",
  164. span: 24,
  165. hide: true,
  166. disabled: true,
  167. span: 24,
  168. search: true,
  169. searchSpan: 4,
  170. rules: [{
  171. required: true,
  172. message: "請輸入銀行號",
  173. trigger: "blur"
  174. }]
  175. },
  176. {
  177. label: "機構號",
  178. prop: "orgNo",
  179. hide: true,
  180. disabled: true,
  181. filterable: true,
  182. type: "select",
  183. // dicUrl: `/api/blade-system/expand/dept/getChildsDept`,
  184. dicData: [],
  185. props: {
  186. label: "orgNo",
  187. value: "orgNo"
  188. },
  189. change: ({value, column}) => {
  190. if (!value) return;
  191. let dicData = this.findObject(this.option.column, 'orgNo').dicData;
  192. dicData.forEach(item => {
  193. if (item.orgNo == value){
  194. this.form.orgName = item.deptName;
  195. }
  196. })
  197. },
  198. rules: [{
  199. required: true,
  200. message: "請輸入機構號",
  201. trigger: "blur"
  202. }]
  203. },
  204. {
  205. label: "機構名稱",
  206. prop: "orgName",
  207. disabled: true,
  208. rules: [{
  209. required: true,
  210. message: "請輸入機構號",
  211. trigger: "blur"
  212. }]
  213. },
  214. {
  215. label: "印章類型",
  216. prop: "sealTypeSearch",
  217. type: "select",
  218. dicUrl: "/api/blade-system/dict/dictionary?code=seal_type",
  219. props:{
  220. label: "dictValue",
  221. value: "dictKey",
  222. },
  223. dicFormatter: (res) => {
  224. let dicData = this.deepClone(res.data);
  225. // 处理完封存的,再填充给印章类型下拉
  226. dicData.forEach(item => {item.disabled = item.isSealed == 1;})
  227. this.findObject(this.option.column, 'sealType').dicData = dicData;
  228. return res.data;
  229. },
  230. search: true,
  231. // hide: true,
  232. addDisplay: false,
  233. editDisplay: false,
  234. viewDisplay: true,
  235. searchMultiple: true,
  236. },
  237. {
  238. label: "印章類型",
  239. prop: "sealType",
  240. type: "select",
  241. hide: true,
  242. addDisplay: true,
  243. editDisplay: true,
  244. viewDisplay: false,
  245. props:{
  246. label: "dictValue",
  247. value: "dictKey",
  248. },
  249. change: ({value, column}) => {
  250. if (!value || this.type == 'view') return;
  251. if (!this.form.sealNo){
  252. getByNoAndType(this.form.sealNo, value, this.form.orgNo).then(res => {
  253. const data = res.data.data;
  254. if (Object.keys(data).length == 0){
  255. this.receiverDisabled = false;
  256. } else {
  257. // 編輯時,若記錄為自己,則跳過
  258. if (this.form.id == data.id){
  259. return;
  260. }
  261. if (data.isTurnIn == 1){
  262. this.$message.warning("此印章已上繳,請重新選擇!");
  263. this.receiverDisabled = true;
  264. this.form.sealNo = null;
  265. }else{
  266. this.receiverDisabled = false;
  267. }
  268. }
  269. });
  270. }
  271. //支行用户添加交接
  272. if (!this.isManageUser && this.type == 'add'){
  273. let sealObj = value.split('-');
  274. this.form.sealType = sealObj[0];
  275. this.form.sealNo = sealObj[1];
  276. }
  277. },
  278. rules: [{
  279. required: true,
  280. message: "請輸入印章類型",
  281. trigger: "blur"
  282. }]
  283. },
  284. {
  285. label: "印章編號",
  286. prop: "sealNo",
  287. search: true,
  288. searchSpan: 4,
  289. searchslot: true,
  290. change: ({value, column}) => {
  291. if (!value ||!this.form.sealType || this.type == 'view') return;
  292. getByNoAndType(value, this.form.sealType, this.form.orgNo).then(res => {
  293. const data = res.data.data;
  294. let $handoverNo = this.findObject(this.option.column, 'handoverPersonNo');
  295. if (Object.keys(data).length == 0){
  296. this.receiverDisabled = false;
  297. } else {
  298. // 編輯時,若記錄為自己,則跳過
  299. if (this.form.id == data.id){
  300. return;
  301. }
  302. if (data.isTurnIn == 1){
  303. this.$message.warning("此印章已上繳,請重新選擇!");
  304. this.receiverDisabled = true;
  305. this.form.sealNo = null;
  306. }else{
  307. this.receiverDisabled = false;
  308. }
  309. }
  310. });
  311. },
  312. rules: [{
  313. required: true,
  314. message: "請輸入印章編號",
  315. trigger: "blur"
  316. }]
  317. },
  318. {
  319. label: "區域/支行",
  320. prop: "orgNos",
  321. hide: true,
  322. display: false,
  323. searchMultiple: true,
  324. search: true,
  325. type: "tree",
  326. dicData: [],
  327. props: {
  328. label: "title",
  329. value: "key"
  330. },
  331. checkStrictly: true,
  332. rules: [{
  333. required: true,
  334. message: "請輸入機構號",
  335. trigger: "blur"
  336. }]
  337. },
  338. {
  339. label: "交出人",
  340. prop: "handoverPersonName",
  341. // formslot: true,
  342. disabled: true,
  343. rules: [{
  344. required: false,
  345. message: "請輸入交出人姓名",
  346. trigger: "change"
  347. }]
  348. },
  349. {
  350. label: "交出人員工號",
  351. prop: "handoverPersonNo",
  352. disabled: true,
  353. rules: [{
  354. required: false,
  355. message: "請輸入交出人員工號",
  356. trigger: "blur"
  357. }]
  358. },
  359. {
  360. label: "交接日期",
  361. prop: "handoverDate",
  362. type: "datetime",
  363. format: "yyyy-MM-dd HH:mm",
  364. valueFormat: "yyyy-MM-dd HH:mm",
  365. rules: [{
  366. required: true,
  367. message: "請輸入交接日期",
  368. trigger: "blur"
  369. }]
  370. },
  371. {
  372. label: "是否上繳",
  373. prop: "isTurnIn",
  374. formslot: true,
  375. rules: [{
  376. required: false,
  377. message: "請勾選是否上繳",
  378. trigger: "blur"
  379. }]
  380. },
  381. {
  382. label: "接收人",
  383. prop: "receiverName",
  384. disabled: true,
  385. search: true,
  386. searchSpan: 4,
  387. // formslot: true,
  388. rules: [{
  389. required: true,
  390. message: "請輸入接收人姓名",
  391. trigger: "change"
  392. }]
  393. },
  394. {
  395. label: "交接日期",
  396. prop: "handoverDateRange",
  397. type: "datetime",
  398. format: "yyyy-MM-dd HH:mm",
  399. valueFormat: "yyyy-MM-dd HH:mm",
  400. searchRange:true,
  401. hide: true,
  402. addDisplay: false,
  403. editDisplay: false,
  404. viewDisplay: false,
  405. search: true,
  406. rules: [{
  407. required: true,
  408. message: "請輸入交接日期",
  409. trigger: "blur"
  410. }]
  411. },
  412. {
  413. label: "接收人員工號",
  414. prop: "receiverNo",
  415. disabled: true,
  416. rules: [{
  417. required: true,
  418. message: "請輸入接收人員工號",
  419. trigger: "blur"
  420. }]
  421. },
  422. {
  423. label: "備註",
  424. prop: "remark",
  425. rules: [{
  426. required: false,
  427. message: "請輸入備註",
  428. trigger: "blur"
  429. }]
  430. },
  431. {
  432. label: "填報時間",
  433. prop: "fillingDate",
  434. addDisplay: false,
  435. editDisplay: false,
  436. rules: [{
  437. required: true,
  438. message: "請輸入填報時間",
  439. trigger: "blur"
  440. }]
  441. },
  442. {
  443. label: "填報人",
  444. prop: "fillingPerson",
  445. addDisplay: false,
  446. editDisplay: false,
  447. rules: [{
  448. required: true,
  449. message: "請輸入填報人",
  450. trigger: "blur"
  451. }]
  452. },
  453. {
  454. label: "進度",
  455. prop: "process",
  456. display: false,
  457. },
  458. {
  459. label: "確認時間",
  460. prop: "sureTime",
  461. hide: true,
  462. addDisplay: false,
  463. editDisplay: false,
  464. type: "datetime",
  465. format: "yyyy-MM-dd HH:mm:ss",
  466. valueFormat: "yyyy-MM-dd HH:mm:ss",
  467. },
  468. ]
  469. },
  470. data: []
  471. };
  472. },
  473. computed: {
  474. ...mapGetters(["permission"]),
  475. ...mapGetters(["userInfo"]),
  476. permissionList() {
  477. return {
  478. addBtn: this.vaildData(this.permission.sealhandover_add, false),
  479. viewBtn: this.vaildData(this.permission.sealhandover_view, false),
  480. delBtn: this.vaildData(this.permission.sealhandover_delete, false),
  481. editBtn: this.vaildData(this.permission.sealhandover_edit, false)
  482. };
  483. },
  484. ids() {
  485. let ids = [];
  486. this.selectionList.forEach(ele => {
  487. ids.push(ele.id);
  488. });
  489. return ids.join(",");
  490. }
  491. },
  492. created() {
  493. getDeptTree().then(res => {
  494. const column = this.findObject(this.option.column, "orgNos");
  495. let treeData = getTree(res.data.data, this.userInfo.dept_id);
  496. column.dicData = treeData;
  497. // this.findObject(this.option.column, "orgNo").dicData = treeData;
  498. });
  499. getChildsDept().then(res => {
  500. let dicData = [];
  501. let data = res.data.data;
  502. data.forEach(item => {
  503. if (item.orgNo.indexOf("999") == -1){
  504. dicData.push(item)
  505. }
  506. })
  507. this.findObject(this.option.column, "orgNo").dicData = dicData;
  508. });
  509. getStandardByCode("sealhandover").then(res => {
  510. const data = res.data.data;
  511. if (Object.keys(data).length > 0){
  512. this.title = data.content;
  513. }else {
  514. this.option.column.splice(0,1)
  515. }
  516. });
  517. getCurrentUserKeepList().then(res => {
  518. this.userKeepList = res.data.data;
  519. });
  520. getCurrentDept().then(res => {
  521. const data = res.data.data;
  522. this.currentDept = data;
  523. })
  524. },
  525. methods: {
  526. turnInChange(value){
  527. // this.findObject(this.option.column, "receiverNo").rules[0].required = !value;
  528. // this.findObject(this.option.column, "receiverName").rules[0].required = !value;
  529. this.hasOrgNo = value == true ? "51007" : null;
  530. this.form.receiverNo = null,this.form.receiverName = null;
  531. },
  532. handleDownload(){
  533. if (this.selectionList.length === 0) {
  534. let tip = "確定下載篩選的" + this.page.total + "條數據嗎?"
  535. this.$confirm(tip, {
  536. confirmButtonText: "確定",
  537. cancelButtonText: "取消",
  538. type: "warning"
  539. })
  540. .then(() => {
  541. getDownloadList(this.query).then(res => {
  542. let data = res.data.data;
  543. data.forEach(item => {item.isTurnIn = item.isTurnIn == 1 ? true : false})
  544. this.downLoadData(data, true)
  545. });
  546. })
  547. }else{
  548. this.downLoadData(this.selectionList, false)
  549. }
  550. },
  551. downLoadData(data, isAll){
  552. let columns = this.deepClone(this.option.column);
  553. for (let i = 0; i < columns.length; i++) {
  554. let item = columns[i];
  555. if (item.hide || item.prop == 'process'){
  556. columns.splice(i, 1);
  557. i--;
  558. }
  559. if (!isAll && (item.type == 'select' || item.type == 'tree')){
  560. item.prop = '$' + item.prop;
  561. }
  562. }
  563. this.$Export.excel({
  564. title: "業務印章交接登記表" || new Date().getTime(),
  565. columns: columns,
  566. data: data
  567. });
  568. },
  569. handoverSelectCallback(value){
  570. this.form.handoverPersonId = value.id;
  571. this.form.handoverPersonNo = value.ehr;
  572. this.form.handoverPersonName = value.name;
  573. },
  574. selectCallback(value){
  575. this.form.receiverId = value.id;
  576. this.form.receiverNo = value.ehr;
  577. this.form.receiverName = value.name;
  578. },
  579. rowSave(row, done, loading) {
  580. row.isTurnIn = !row.isTurnIn ? 0 : 1;
  581. if (row.sealType.indexOf('-') != -1){
  582. let sealObj = row.sealType.split('-');
  583. row.sealType = sealObj[0];
  584. }
  585. add(row).then(() => {
  586. this.onLoad(this.page);
  587. this.$message({
  588. type: "success",
  589. message: "操作成功!"
  590. });
  591. done();
  592. }, error => {
  593. loading();
  594. window.console.log(error);
  595. });
  596. },
  597. rowUpdate(row, index, done, loading) {
  598. row.isTurnIn = !row.isTurnIn ? 0 : 1;
  599. if (row.sealType.indexOf('-') != -1){
  600. let sealObj = row.sealType.split('-');
  601. row.sealType = sealObj[0];
  602. }
  603. update(row).then(() => {
  604. this.onLoad(this.page);
  605. this.$message({
  606. type: "success",
  607. message: "操作成功!"
  608. });
  609. done();
  610. }, error => {
  611. loading();
  612. console.log(error);
  613. });
  614. },
  615. rowDel(row) {
  616. this.$confirm("確定將選擇數據刪除?", {
  617. confirmButtonText: "確定",
  618. cancelButtonText: "取消",
  619. type: "warning"
  620. })
  621. .then(() => {
  622. return remove(row.id);
  623. })
  624. .then(() => {
  625. this.onLoad(this.page);
  626. this.$message({
  627. type: "success",
  628. message: "操作成功!"
  629. });
  630. });
  631. },
  632. handleDelete() {
  633. if (this.selectionList.length === 0) {
  634. this.$message.warning("請選擇至少一條數據");
  635. return;
  636. }
  637. this.$confirm("確定將選擇數據刪除?", {
  638. confirmButtonText: "確定",
  639. cancelButtonText: "取消",
  640. type: "warning"
  641. })
  642. .then(() => {
  643. return remove(this.ids);
  644. })
  645. .then(() => {
  646. this.onLoad(this.page);
  647. this.$message({
  648. type: "success",
  649. message: "操作成功!"
  650. });
  651. this.$refs.crud.toggleSelection();
  652. });
  653. },
  654. beforeOpen(done, type) {
  655. this.type = type;
  656. if (type === 'add'){
  657. this.form.handoverPersonId = this.userInfo.user_id;
  658. this.form.handoverPersonNo = this.userInfo.user_ehr;
  659. this.form.handoverPersonName = this.userInfo.user_name;
  660. this.form.number = 1;
  661. this.form.handoverDate = dateFormat(new Date(), "yyyy-MM-dd hh:mm");
  662. const data = this.currentDept;
  663. this.form.bankNo = data.bankNo;
  664. if (data.deptCategory == 1){
  665. this.isManageUser = true;
  666. this.findObject(this.option.column, 'orgNo').disabled = false;
  667. this.findObject(this.option.column, 'sealType').disabled = false;
  668. this.findObject(this.option.column, 'sealNo').disabled = false;
  669. }else{
  670. this.isManageUser = false;
  671. this.findObject(this.option.column, 'orgNo').disabled = true;
  672. this.findObject(this.option.column, 'sealType').disabled = false;
  673. this.findObject(this.option.column, 'sealNo').disabled = true;
  674. this.form.orgNo = data.orgNo;
  675. this.form.orgName = data.deptName;
  676. // 支行用户自行添加交接,需要获取当前用户持有的列表作为下拉内容
  677. this.findObject(this.option.column, 'sealType').dicData = this.userKeepList;
  678. }
  679. //恢复必填
  680. this.findObject(this.option.column, "receiverNo").rules[0].required = true;
  681. this.findObject(this.option.column, "receiverName").rules[0].required = true;
  682. this.receiverDisabled = false;
  683. }
  684. if (type == 'edit'){
  685. this.findObject(this.option.column, 'sealType').disabled = true;
  686. this.findObject(this.option.column, 'sealNo').disabled = true;
  687. // 支行用户自行添加交接,需要获取当前用户持有的列表作为下拉内容
  688. this.findObject(this.option.column, 'sealType').dicData = this.userKeepList;
  689. }
  690. if (this.form.isTurnIn){
  691. this.turnInChange(true)
  692. }
  693. if (type == 'edit' && this.form.sealType.indexOf('-') == -1){
  694. this.form.sealType = this.form.sealType + '-' + this.form.sealNo;
  695. }
  696. /*if (["edit", "view"].includes(type)) {
  697. getDetail(this.form.id).then(res => {
  698. this.form = res.data.data;
  699. });
  700. }*/
  701. this.turnInDisabled = type == 'edit'
  702. done();
  703. },
  704. searchReset() {
  705. this.query = {};
  706. this.onLoad(this.page);
  707. },
  708. searchChange(params, done) {
  709. if (params.sealTypeSearch){
  710. params.sealType = params.sealTypeSearch.join();
  711. params.sealTypeSearch = [];
  712. }
  713. if (params.orgNos){
  714. params.orgNostr = params.orgNos.join();
  715. params.orgNos = '';
  716. }
  717. if (params.handoverDateRange){
  718. params.handoverDate_begin = params.handoverDateRange[0], params.handoverDate_end = params.handoverDateRange[1];
  719. params.handoverDateRange = null;
  720. }
  721. this.query = params;
  722. this.page.currentPage = 1;
  723. this.onLoad(this.page, params);
  724. done();
  725. },
  726. selectionChange(list) {
  727. this.selectionList = list;
  728. if (list && list.length > 0){
  729. let delFlag = true;
  730. // permission.keypwd_delete && userInfo.user_id == row.createUser
  731. for (let i = 0; i < list.length; i++) {
  732. let item = list[i];
  733. delFlag = delFlag && item.createUser == this.userInfo.user_id;
  734. }
  735. this.delBatchBtn = !delFlag;
  736. }else{
  737. this.delBatchBtn = true;
  738. }
  739. },
  740. selectionClear() {
  741. this.selectionList = [];
  742. this.$refs.crud.toggleSelection();
  743. },
  744. currentChange(currentPage){
  745. this.page.currentPage = currentPage;
  746. },
  747. sizeChange(pageSize){
  748. this.page.pageSize = pageSize;
  749. },
  750. refreshChange() {
  751. this.onLoad(this.page, this.query);
  752. },
  753. onLoad(page, params = {}) {
  754. this.loading = true;
  755. getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  756. const data = res.data.data;
  757. this.page.total = data.total;
  758. data.records.forEach(item => {
  759. item.isTurnIn = item.isTurnIn == 1;
  760. item.sealTypeSearch = item.sealType;
  761. })
  762. this.data = data.records;
  763. this.loading = false;
  764. this.selectionClear();
  765. });
  766. }
  767. }
  768. };
  769. </script>
  770. <style>
  771. </style>