index.js 3.54 KB
Newer Older
fukai committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
import Api from '~/service/Api';
import Utils from "~/utils"
import commonFunctions from '~/mixin/commonFunctions.js';
import moment from 'moment'
export default {
	mixins: [commonFunctions],
	methods: {
    //柜员明细
  async  usrDetail(row){
      let params = {
        usr : row.extkey,
      }
      let res = await Api.post('/public/taskdist/config/changelog/getloglistbyextkey',params);
      if(res.respCode == SUCCESS){
        this.taskData.data = res.data
      }
    },
		//重置
		handleReset() {
			this.model.extkey = ''
      this.model.bizGroup = ''
      this.model.bizPosition = ''
      this.model.status = ''
      this.model.participateFlag = ''
		},

		//查询列表
		async handleSearch() {
			let params = {
        extkey: this.model.extkey,
        bizGroup: this.model.bizGroup ,
        bizPosition: this.model.bizPosition ,
        status: this.model.status,
        participateFlag: this.model.participateFlag,
        pageNo: this.pagination.pageIndex,
				pageSize: this.pagination.pageSize,
			};
			//查询接口
			const loading = this.loading();
			const res = await Api.post('/public/taskdist/user/getTaskUsrs', params);
			if (res.respCode === SUCCESS) {
				this.tskUsrData = res.data.records;
				this.pagination.total = Number(res.data.total);
			}
			loading.close();
    },
    //参与/退出分配
    async inOutDist(row){
      let flg = row.participateFlag
      let params = {
        extkey : row.extkey,
        participationFlag :flg == 'Y' ? 'N' :'Y'
      }
      this.$confirm('您确定将该柜员'+ (flg == 'Y' ? '退出' : '加入') +'分配?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning',
			}).then(async () => {
      const res = await Api.post('/public/taskdist/user/update/participationFlag',params);
      if(res.respCode === SUCCESS){
        this.$notify({
          title: '成功',
          message: (flg == 'Y' ? '退出' : '参与') +'分配成功',
          type: 'success',
        });
        this.handleSearch()
      }
    })
    },
    async queryUsrByBch(){
      const res = await Api.post('/manager/usr/queryUserByPage');
      if(res.respCode === SUCCESS){
        this.usrs = res.data.list
      }
      console.log("usrs:" ,this.model.usrs)
      console.log("list:" ,res.data.list)
    },
		currentChange(num) {
			this.currentPage = num;
			this.getTableData();
		},

	
		beforeClose(done) {
			this.dialogTableVisible = false;
			this.currentPage = 1;
			done();
		},

		
		
		// pageSize改变
		handleSizeChange(val) {
			this.pagination.pageIndex = 1;
			this.pagination.pageSize = val;
			this.handleSearch();
		},
		// 页码改变
		handleCurrentChange(val) {
			this.pagination.pageIndex = val;
			this.handleSearch();
    },
       //格式化列表显示
       flgFormat(flg){
        if(flg == 'Y'){
          return '参与';
        }else{
          return '不参与';
        }
        
      },
       //获取码表
    async getdbCode(codeType, uil, codeNam) {
      let params = {
        codeType: codeType,
        uil: uil ? uil : 'EN'
      }
      let rtnmsg = await Api.post("/manager/dic/listDicInfo", params)
      if (rtnmsg.respCode === SUCCESS) {
        let curList = rtnmsg.data.map(item => ({
          value: item.codeValue,
          label: item.codeName
        }));
        this.dbCodes[codeNam] = curList
      }
    },
    //表格码表格式化
      getCodelabel(value,codenam) {
            const codeobj = this.dbCodes[codenam].find(obj => obj.value === value)
            return codeobj ? codeobj.label : value;
      },
		
	},
};