| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861 |
- <template>
- <basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :permission="permissionList"
- :before-open="beforeOpen"
- v-model="form"
- ref="crud"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @row-del="rowDel"
- :search.sync="search"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
- <template slot="menuLeft">
- <el-button type="danger"
- size="small"
- icon="el-icon-delete"
- :disabled="delBatchBtn"
- plain
- v-if="permission.keypwd_delete"
- @click="handleDelete">刪 除
- </el-button>
- <el-button type="success"
- size="small"
- icon="el-icon-search"
- plain
- v-if="permission.keypwd_keep_view"
- @click="keepVisible = true">保管人查詢
- </el-button>
- <el-button type="primary"
- size="small"
- icon="el-icon-download"
- plain
- v-if="permission.keypwd_download"
- @click="handleDownload">下載
- </el-button>
- </template>
- <template slot="menu" slot-scope="{row, index}">
- <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>
- <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>
- <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>
- </template>
- <template slot="receiverNameForm">
- <select-dialog-user :id="form.receiverId" :name="form.receiverName" :ehr="form.receiverNo" :disabled="disabeldReceiver" :callback="selectCallback"></select-dialog-user>
- </template>
- <template slot="handoverPersonNameForm">
- <select-dialog-user :id="form.handoverPersonId" :name="form.handoverPersonName" :ehr="form.handoverPersonNo" :disabled="disabeldHandover" :callback="handoverSelectCallback"></select-dialog-user>
- </template>
- <template slot-scope="{disabled,size}" slot="categorySearch">
- <avue-input-tree :check-strictly="false" v-model="search.category" placeholder="請選擇內容" type="tree" :dic="typeList" :props="props"></avue-input-tree>
- </template>
- <template slot="isTurnIn" slot-scope="{row}">
- <el-tag size="small " type="success" plain v-if="row.isTurnIn">上繳</el-tag>
- <el-tag size="small " type="danger" plain v-if="!row.isTurnIn">非上繳</el-tag>
- </template>
- <template slot="isTurnInForm" slot-scope="{row}">
- <el-checkbox v-model="row.isTurnIn" @change="turnInChange"></el-checkbox>
- <el-tag size="small " type="success" plain v-if="row.isTurnIn">上繳</el-tag>
- <el-tag size="small " type="danger" plain v-if="!row.isTurnIn">非上繳</el-tag>
- </template>
- <template slot="process" slot-scope="{row, index}">
- <el-tag size="small " type="warning" plain v-if="row.process == 2">待確認</el-tag>
- <el-tag size="small " type="success" plain v-if="row.process == 3">已確認</el-tag>
- </template>
- <template slot="titleForm" slot-scope="{row, index}">
- <div v-html="title" style="white-space: pre-line;color: red;font-weight: bold;"></div>
- </template>
- <template slot="titleLabel" slot-scope="{row, index}">
- <span style="color: red;font-weight: bold;">注意事項:</span>
- </template>
- </avue-crud>
- <el-dialog :append-to-body="true" :modal-append-to-body="false" :destroy-on-close="true" :fullscreen="true" :visible.sync="keepVisible" title="保管人查詢">
- <div v-if="keepVisible">
- <keypwd-keep></keypwd-keep>
- </div>
- </el-dialog>
- <el-dialog title="信息確認"
- append-to-body
- :visible.sync="approveVisible"
- width="70%">
- <keypwd-sure :form="approveForm" @close="approveVisible = false, onLoad(page)"></keypwd-sure>
- </el-dialog>
- </basic-container>
- </template>
- <script>
- import {getList, getDetail, add, update, remove, getByCategoryAndType, getKeyType, getDownloadList, getCurrentUserKeepCategory} from "@/api/bank/keypwd";
- import {mapGetters} from "vuex";
- import {dateFormat} from "../../util/date";
- import SelectDialogUser from "../select-dialog/select-dialog-user";
- import { getCurrentDept, getChildsDept } from "@/api/system/dept";
- import {getDeptTree, getTree} from "@/api/system/dept";
- import KeypwdKeep from "../../views/bank/keypwd-keep";
- import {getStandardByCode} from "@/api/bank/handoverstandard";
- import KeypwdSure from "@/components/common/keypwd-sure";
- export default {
- name: "init-keypwd",
- components: {KeypwdSure, KeypwdKeep, SelectDialogUser},
- data() {
- return {
- isManageUser: false,
- userKeepList: [],
- currentDept: [],
- title: "",
- search: {},
- typeList: [],
- props:{
- label: "dictValue",
- value: "dictKey",
- },
- approveForm: {},
- approveVisible: false,
- delBatchBtn: true,
- keepVisible: false,
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- disabeldReceiver: false,
- disabeldHandover: true,
- selectionList: [],
- selectReceiver: '',
- selectHandover: '',
- type: '',
- option: {
- addTitle: '新增【網點鎖匙/密碼/實物交接登記表】',
- editTitle: '編輯【網點鎖匙/密碼/實物交接登記表】',
- viewTitle: '查看【網點鎖匙/密碼/實物交接登記表】',
- height:'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: true,
- editBtn: false,
- delBtn: false,
- selection: true,
- dialogClickModal: false,
- column: [
- {
- label: '注意事項',
- prop: 'title',
- formslot: true,
- hide: true,
- type: 'text',
- span: 24
- },
- {
- label: "銀行號",
- prop: "bankNo",
- span: 24,
- hide: true,
- disabled: true,
- search: true,
- searchSpan: 4,
- rules: [{
- required: true,
- message: "請輸入銀行號",
- trigger: "blur"
- }]
- },
- {
- label: "機構號",
- prop: "orgNo",
- type: "select",
- hide: true,
- disabled: true,
- filterable: true,
- dicData: [],
- props: {
- label: "orgNo",
- value: "orgNo"
- },
- change: ({value, column}) => {
- if (!value) return;
- let dicData = this.findObject(this.option.column, 'orgNo').dicData;
- dicData.forEach(item => {
- if (item.orgNo == value){
- this.form.orgName = item.deptName;
- }
- })
- },
- rules: [{
- required: true,
- message: "請輸入機構號",
- trigger: "blur"
- }]
- },
- {
- label: "機構名稱",
- prop: "orgName",
- disabled: true,
- rules: [{
- required: true,
- message: "請輸入機構號",
- trigger: "blur"
- }]
- },
- {
- label: "分類種類",
- prop: "categoryShow",
- checkStrictly: true,
- type: "tree",
- multiple: true,
- addDisplay: false,
- editDisplay: false,
- viewDisplay: true,
- // dicUrl: "/api/blade-system/dict/dictionary?code=key_type",
- dicData: [],
- dataType: "string",
- props:{
- label: "dictValue",
- value: "dictKey",
- },
- },
- {
- label: "分類種類",
- prop: "category",
- hide: true,
- addDisplay: true,
- editDisplay: true,
- viewDisplay: false,
- search: true,
- checkStrictly: true,
- type: "tree",
- multiple: true,
- // dicUrl: "/api/blade-system/dict/dictionary?code=key_type",
- dicData: [],
- dataType: "string",
- props:{
- label: "dictValue",
- value: "dictKey",
- },
- searchslot: true,
- change: ({value, column}) => {
- /*if (!value || value.length == 0 || this.type == 'view' || this.form.category == value) return;
- getByCategoryAndType(value, this.form.orgNo).then(res => {
- const data = res.data.data;
- let $handoverNo = this.findObject(this.option.column, 'handoverPersonNo');
- let $handoverName = this.findObject(this.option.column, 'handoverPersonName');
- if (Object.keys(data).length == 0){
- // $handoverNo.disabled = false;
- this.form.handoverPersonNo = '';
- this.form.handoverPersonName = '';
- } else {
- $handoverNo.disabled = true;
- this.form.handoverPersonNo = data.receiverNo;
- this.form.handoverPersonName = data.receiverName;
- }
- });*/
- },
- rules: [{
- required: true,
- message: "請輸入分類",
- trigger: "blur"
- }]
- },
- {
- label: "區域/支行",
- prop: "orgNos",
- hide: true,
- display: false,
- searchMultiple: true,
- search: true,
- type: "tree",
- dicData: [],
- props: {
- label: "title",
- value: "key"
- },
- checkStrictly: true,
- rules: [{
- required: true,
- message: "請輸入機構號",
- trigger: "blur"
- }]
- },
- {
- label: "交接日期",
- prop: "handoverDateRange",
- type: "datetime",
- format: "yyyy-MM-dd HH:mm",
- valueFormat: "yyyy-MM-dd HH:mm",
- // searchValue: [_today + ' 00:00', _today + ' 23:59'],
- // searchTime: ['00:00', '23:59'],
- searchRange:true,
- hide: true,
- addDisplay: false,
- editDisplay: false,
- viewDisplay: false,
- search: true,
- rules: [{
- required: true,
- message: "請輸入交接日期",
- trigger: "blur"
- }]
- },
- /*{
- label: "種類",
- prop: "type",
- type: "select",
- dicUrl: "/api/blade-system/dict/dictionary?code={{key}}",
- props:{
- label: "dictValue",
- value: "dictKey",
- },
- change: ({value, column}) => {
- if (!value || this.type == 'view' || this.type == 'edit') return;
- getByCategoryAndType(this.form.category, value, this.form.orgNo).then(res => {
- const data = res.data.data;
- let $handoverNo = this.findObject(this.option.column, 'handoverPersonNo');
- let $handoverName = this.findObject(this.option.column, 'handoverPersonName');
- if (Object.keys(data).length == 0){
- // $handoverNo.disabled = false;
- this.form.handoverPersonNo = '';
- this.form.handoverPersonName = '';
- } else {
- $handoverNo.disabled = true;
- this.form.handoverPersonNo = data.receiverNo;
- this.form.handoverPersonName = data.receiverName;
- }
- });
- },
- rules: [{
- required: true,
- message: "請輸入種類",
- trigger: "blur"
- }]
- },*/
- /* {
- label: "數量",
- prop: "number",
- type: "number",
- disabled: true,
- hide: true,
- display: false,
- rules: [{
- required: true,
- message: "請輸入數量",
- trigger: "blur"
- }]
- },*/
- {
- label: "是否上繳",
- prop: "isTurnIn",
- formslot: true,
- rules: [{
- required: false,
- message: "請勾選是否上繳",
- trigger: "blur"
- }]
- },
- {
- label: "交出人",
- prop: "handoverPersonName",
- formslot: true,
- rules: [{
- required: false,
- message: "請輸入交出人姓名",
- trigger: "blur"
- }]
- },
- {
- label: "交出人員工號",
- prop: "handoverPersonNo",
- disabled: true,
- rules: [{
- required: false,
- message: "請輸入交出人員工號",
- trigger: "blur"
- }]
- },
- {
- label: "接收人",
- prop: "receiverName",
- disabled: true,
- search: true,
- searchSpan: 4,
- // formslot: true,
- disabled: true,
- rules: [{
- required: true,
- message: "請輸入接收人員工號",
- trigger: "focus"
- }]
- },
- {
- label: "接收人員工號",
- prop: "receiverNo",
- disabled: true,
- rules: [{
- required: true,
- message: "請輸入接收人員工號",
- trigger: "change"
- }]
- },
- {
- label: "交接日期",
- prop: "handoverDate",
- type: "datetime",
- format: "yyyy-MM-dd HH:mm",
- valueFormat: "yyyy-MM-dd HH:mm",
- change: ({value, culumn}) => {
- if (!value) return;
- },
- rules: [{
- required: true,
- message: "請輸入交接日期",
- trigger: "blur"
- }]
- },
- /* {
- label: "接收人姓名",
- prop: "receiverName",
- rules: [{
- required: true,
- message: "請輸入接收人姓名",
- trigger: "change "
- }]
- },*/
- {
- label: "備註",
- prop: "remark",
- rules: [{
- required: false,
- message: "請輸入備註",
- trigger: "blur"
- }]
- },
- {
- label: "填報時間",
- prop: "fillingDate",
- addDisplay: false,
- editDisplay: false,
- rules: [{
- required: true,
- message: "請輸入填報時間",
- trigger: "blur"
- }]
- },
- {
- label: "填報人",
- prop: "fillingPerson",
- addDisplay: false,
- editDisplay: false,
- rules: [{
- required: true,
- message: "請輸入填報人",
- trigger: "blur"
- }]
- },
- {
- label: "進度",
- prop: "process",
- display: false,
- },
- {
- label: "確認時間",
- prop: "sureTime",
- hide: true,
- addDisplay: false,
- editDisplay: false,
- type: "datetime",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- },
- ]
- },
- data: []
- };
- },
- computed: {
- ...mapGetters(["permission"]),
- ...mapGetters(["userInfo"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.keypwd_add, false),
- viewBtn: this.vaildData(this.permission.keypwd_view, false),
- delBtn: this.vaildData(this.permission.keypwd_delete, false),
- editBtn: this.vaildData(this.permission.keypwd_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
- },
- created() {
- this.initTypeDict();
- getDeptTree().then(res => {
- const column = this.findObject(this.option.column, "orgNos");
- let treeData = getTree(res.data.data, this.userInfo.dept_id);
- column.dicData = treeData;
- });
- getStandardByCode("keypwd").then(res => {
- const data = res.data.data;
- if (Object.keys(data).length > 0){
- this.title = data.content;
- }else {
- this.option.column.splice(0,1)
- }
- });
- getChildsDept().then(res => {
- let dicData = [];
- let data = res.data.data;
- data.forEach(item => {
- if (item.orgNo.indexOf("999") == -1){
- dicData.push(item)
- }
- })
- this.findObject(this.option.column, "orgNo").dicData = dicData;
- });
- // this.initCurrentDeptAndKeepCategroy();
- },
- methods: {
- initCurrentDeptAndKeepCategroy(){
- getCurrentDept().then(res => {
- const data = res.data.data;
- this.currentDept = data;
- this.isManageUser = data.deptCategory == 1;
- });
- },
- turnInChange(value){
- this.findObject(this.option.column, "receiverNo").rules[0].required = !value;
- this.findObject(this.option.column, "receiverName").rules[0].required = !value;
- // this.findObject(this.option.column, "receiverNo").disabled = !value;
- this.disabeldReceiver = !!value;
- this.form.receiverNo = null,this.form.receiverName = null;
- },
- handleDownload(){
- if (this.selectionList.length === 0) {
- let tip = "確定下載篩選的" + this.page.total + "條數據嗎?"
- this.$confirm(tip, {
- confirmButtonText: "確定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- getDownloadList(this.query).then(res => {
- let data = res.data.data;
- data.forEach(item => {item.isTurnIn = item.isTurnIn == 1 ? true : false;item.categoryShow = item.category;})
- this.downLoadData(data, true)
- });
- })
- }else{
- this.downLoadData(this.selectionList, false)
- }
- },
- downLoadData(data, isAll){
- let columns = this.deepClone(this.option.column);
- for (let i = 0; i < columns.length; i++) {
- let item = columns[i];
- if (item.hide || item.prop == 'process'){
- columns.splice(i, 1);
- i--;
- }
- if (!isAll && (item.type == 'select' || item.type == 'tree')){
- item.prop = '$' + item.prop;
- }
- }
- this.$Export.excel({
- title: "網點鎖匙密碼實物交接登記表" || new Date().getTime(),
- columns: columns,
- data: data
- });
- },
- initTypeDict(){
- getKeyType().then(res => {
- let data = res.data.data;
- let pid = new Set();
- for (let i = 0; i < data.length; i++) {
- let item = data[i];
- pid.add(item.parentId);
- }
- let arr = [];
- pid.forEach(id => {
- data.forEach(item => {
- if (id == item.id){
- arr.push(item)
- }
- })
- })
- arr.forEach(item => {
- item.disabled = true;
- data.forEach(it => {
- if (item.id == it.parentId){
- if (!item.children){
- item.children = [];
- }
- it.dictValue = item.dictValue + '-' + it.dictValue;
- item.children.push(it)
- item.hasChildren = true;
- }
- })
- })
- this.typeList = arr;
- let formDicData = this.deepClone(arr);
- formDicData.forEach(item => {
- item.disabled = true;
- if (item.hasChildren){
- item.children.forEach(child => {
- child.disabled = child.isSealed == 1;
- })
- }
- });
- this.findObject(this.option.column, 'category').dicData = formDicData;
- this.findObject(this.option.column, 'categoryShow').dicData = formDicData;
- return arr;
- })
- },
- handoverSelectCallback(value){
- this.form.handoverPersonNo = value.ehr;
- this.form.handoverPersonName = value.name;
- },
- selectCallback(value){
- this.form.receiverId = value.id;
- this.form.receiverNo = value.ehr;
- this.form.receiverName = value.name;
- },
- rowSave(row, done, loading) {
- row.isTurnIn = !row.isTurnIn ? 0 : 1;
- add(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- window.console.log(error);
- });
- },
- rowUpdate(row, index, done, loading) {
- row.isTurnIn = !row.isTurnIn ? 0 : 1;
- update(row).then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- done();
- }, error => {
- loading();
- console.log(error);
- });
- },
- rowDel(row) {
- this.$confirm("確定將選擇數據刪除?", {
- confirmButtonText: "確定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- });
- },
- handleDelete() {
- if (this.selectionList.length === 0) {
- this.$message.warning("請選擇至少一條數據");
- return;
- }
- this.$confirm("確定將選擇數據刪除?", {
- confirmButtonText: "確定",
- cancelButtonText: "取消",
- type: "warning"
- })
- .then(() => {
- return remove(this.ids);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
- },
- beforeOpen(done, type) {
- this.type = type;
- if (type === 'add'){
- this.form.number = 1;
- this.form.handoverDate = dateFormat(new Date(), "yyyy-MM-dd hh:mm");
- const data = this.currentDept;
- this.form.bankNo = data.bankNo;
- if (data.deptCategory != 1){
- //非管理部门
- this.form.orgNo = data.orgNo;
- this.form.orgName = data.deptName;
- this.form.handoverPersonName = this.userInfo.user_name;
- this.form.handoverPersonNo = this.userInfo.user_ehr;
- this.form.handoverPersonId = this.userInfo.user_id;
- let $category = this.findObject(this.option.column, 'category');
- let dicDataOld = this.findObject(this.option.column, 'categoryShow').dicData;
- $category.dicData = [];
- getCurrentUserKeepCategory().then(res => {
- let data = res.data.data;
- if (!data){
- // this.$message.warning("當前用戶暫時並無持有相關鑰匙/密碼/實物!");
- }else{
- data += ",";
- let dicDataNew = [];
- dicDataOld.forEach(item => {
- item.disabled = true;
- if (item.hasChildren){
- item.children.forEach(child => {
- child.disabled = child.isSealed == 1;
- if (data.indexOf(child.dictKey + ',') != -1){
- dicDataNew.push(child)
- }
- })
- }
- })
- $category.dicData = dicDataNew;
- this.userKeepList = dicDataNew;
- }
- done();
- });
- }else{
- this.form.handoverPersonName = this.userInfo.user_name;
- this.form.handoverPersonNo = this.userInfo.user_ehr;
- this.form.handoverPersonId = this.userInfo.user_id;
- this.findObject(this.option.column, 'orgNo').disabled = false;
- this.findObject(this.option.column, 'orgName').disabled = false;
- done();
- }
- /*// 支行用户自行添加交接,需要获取当前用户持有的列表作为下拉内容
- this.findObject(this.option.column, 'sealType').dicData = this.userKeepList;*/
- }
- if (["edit", "view"].includes(type)) {
- getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- this.form.categoryShow = this.form.category;
- done();
- });
- }
- /*done();*/
- },
- searchReset() {
- this.query = {};
- this.onLoad(this.page);
- },
- searchChange(params, done) {
- /*if (params.category){
- params.category = params.category.join();
- }*/
- if (params.orgNos){
- params.orgNostr = params.orgNos.join();
- params.orgNos = '';
- }
- if (params.handoverDateRange){
- params.handoverDate_begin = params.handoverDateRange[0], params.handoverDate_end = params.handoverDateRange[1];
- params.handoverDateRange = null;
- }
- this.query = params;
- this.page.currentPage = 1;
- this.onLoad(this.page, params);
- done();
- },
- selectionChange(list) {
- this.selectionList = list;
- if (list && list.length > 0){
- let delFlag = true;
- // permission.keypwd_delete && userInfo.user_id == row.createUser
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- delFlag = delFlag && item.createUser == this.userInfo.user_id;
- }
- this.delBatchBtn = !delFlag;
- }else{
- this.delBatchBtn = true;
- }
- },
- selectionClear() {
- this.selectionList = [];
- this.$refs.crud.toggleSelection();
- },
- currentChange(currentPage){
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize){
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- params.status = 1;
- params.createUser = this.userInfo.user_id;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- data.records.forEach(item => {
- item.isTurnIn = item.isTurnIn == 1;
- item.categoryShow = item.category;
- })
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
- });
- this.initCurrentDeptAndKeepCategroy();
- }
- }
- };
- </script>
- <style>
- </style>
|