keypwd.vue 26 KB

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