index.js 7.51 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 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282
import Api from '~/service/Api';
import Utils from "~/utils"
import commonFunctions from '~/mixin/commonFunctions.js';
import moment from 'moment'
export default {
	mixins: [commonFunctions],
	methods: {
		//重置
		handleReset() {
			this.model.bchcon = '';
			this.model.trncorco.ownref = '';
			this.model.trncorco.relflg = '';
			this.model.usrcon = '';
			this.model.trncorco.inidatfro = '';
			this.model.trncorco.inidattil = '';
			this.model.atp.cod = '';
			this.model.trncorco.dflg = '1';
			this.model.atptxt = '';
			this.model.searchAllUsers = false;
			this.model.channel = '';
		},

		//查询列表
		async handleSearch() {
			let inidatfro = this.model.trncorco.inidatfro;
			if (!inidatfro) {
				this.$notify.error({
					title: '错误',
					message: '查询开始日期必输!'
				});
				return;
			}
			let inidattil = this.model.trncorco.inidattil;
			if (!inidattil) {
				this.$notify.error({
					title: '错误',
					message: '查询结束日期必输!'
				});
				return;
			}
			let params = {
				ownref: this.model.trncorco.ownref,
				inidatfro: moment(inidatfro).format('YYYY-MM-DD') + ' 00:00:00',
        inidattil: moment(inidattil).format('YYYY-MM-DD') + ' 23:59:59',
        tskcla:this.model.tskcla,
        tsksta:this.model.tsksta,
        // frm:this.model.frm,
        usr:this.model.usr,
				pageNo: this.pagination.pageIndex,
				pageSize: this.pagination.pageSize,
			};
			//查询接口
			const loading = this.loading();
			const res = await Api.post('/public/quesel/tasklist', params);
			if (res.respCode === SUCCESS) {
				this.stmData.data = res.data.list;
        this.pagination.total = Number(res.data.total);
			}
			loading.close();
		},

		currentChange(num) {
			this.currentPage = num;
			this.getTableData();
		},

		async dbClickRow(row, column, event) {
			// 此处为了回填数据时回调
			this.$emit('handleChange')
			// 回填数据
			this.model.atp.cod = row.cod + '-' + row.txt;
			this.dialogTableVisible = false;
		},
		beforeClose(done) {
			this.dialogTableVisible = false;
			this.currentPage = 1;
			done();
		},

		//交易详情
		async onWaitDetail(idx, row) {
			this.routerPush({
				path: '/business/inftrnpsDetail',
				query: {
					inr: row.objinr,
					inifrm: row.inifrm.toLocaleLowerCase(),
					businessType: row['objtyp']
				}
			});
		},
		//处理
		async onHandle(idx, row) {
      let inifrm = row['inifrm'].toLocaleLowerCase();
      let params={
        queinr:row.inr
      }
      let res = await Api.post("/public/quesel/checkStatus", params);
      if (res.respCode == SUCCESS) {
        this.routerPush({
          path: row.objtyp === 'TRN' ? `/review/review-${inifrm}` : `/business/${inifrm}`,
          query: {
            businessInr: row['objinr'],
            businessType: row['objtyp']
          }
        });
      }else{
        this.$notify({
          title: "错误",
          message: res.respMsg,
          type: "error",
        });
      }
    },
    //置顶
    pinTask(row){
      let isPin = (row.pinflg == 'Y')
      console.log("pinflg:" ,row.pinflg)
      console.log("isPin:" ,isPin)
      this.$confirm('您确定'+ (isPin ? '取消' : '') +'置顶该笔交易?', '提示', {
				confirmButtonText: '确定',
				cancelButtonText: '取消',
				type: 'warning',
			}).then(async () => {
				let params = {
					inr: row.inr,
				}
				let res = await Api.post("/public/taskdist/"+ (isPin ? "unpin" : "pin"), params);
				if (res.respCode == SUCCESS) {
					this.$notify({
						title: '成功',
						message: (isPin ? '取消' : '') +'置顶成功',
						type: 'success',
          });
          this.handleSearch()
				}
			})
    },
		// 手工分配
		singleManualAssign (index, row) {
      console.log('inr1:' ,row.inr)
      this.multipleSelection = [row.inr]
      // this.taskInr = row.inr
      this.distTyp = 'single'
			this.isShowManualAssign = true
		},
		// 批量手工分配
		mulManualAssign () {
      this.distTyp = 'batch'
			if (!this.multipleSelection.length) {
				this.$notify({
					title: '提示',
					message: '请至少选择一个需要手工分配的数据',
					type: 'warning',
				});
				return;
      }else{
        for(let i = 0 ; i < this.multipleSelection.length; i++){
          for(let j = 0; j < this.multipleSelection.length; j++){
            if(this.multipleSelection[i].cla !== this.multipleSelection[j].cla){
              this.$notify({
                title: '提示',
                message: '请选择相同类型业务进行批量手工分配!',
                type: 'warning',
              });
              return;
            }
          }
        }
      }
      this.multipleSelection = this.multipleSelection.map((item) => {
				return item.inr
			})
			this.isShowManualAssign = true
		},
		// 手工分配关闭弹框
		closeDialog () {
			this.isShowManualAssign = false
		},
		// 手工分配成功回调,刷新页面
		refresh () {
			this.isShowManualAssign = false
			this.handleSearch();
    },
    corToQue(index, row){
      this.multipleSelection = [row.inr]
			this.isShowCorToQue = true
    },
    mulcorToQue(){
      if (!this.multipleSelection.length) {
				this.$notify({
					title: '提示',
					message: '请至少选择一个需要退回分配的数据',
					type: 'warning',
				});
				return;
      }else{
        for(let j = 0; j < this.multipleSelection.length; j++){
          console.log(this.multipleSelection[j].usr)
          if(this.multipleSelection[j].usr == null ){
            this.$notify({
              title: '提示',
              message: '请勾选已分配的业务进行批量退回分配!',
              type: 'warning',
            });
            return;
          }
        }
      }
      this.multipleSelection = this.multipleSelection.map((item) => {
				return item.inr
			})
			this.isShowCorToQue = true
    },
    closeCorDialog () {
			this.isShowCorToQue = false
    },
    refreshC () {
			this.isShowCorToQue = false
			this.handleSearch();
    },
		// pageSize改变
		handleSizeChange(val) {
			this.pagination.pageIndex = 1;
			this.pagination.pageSize = val;
			this.handleSearch();
		},
		// 页码改变
		handleCurrentChange(val) {
			this.pagination.pageIndex = val;
			this.handleSearch();
		},
		selectableFn (row) {
			return 'new|assigned|correct|incoming|waiting'.indexOf(row.status) != -1
		},
		// 表格多选
		handleSelectionChange (val) {
			this.multipleSelection = val.map((item) => {
				return item
			})
			console.log(this.multipleSelection)
    },
    async  getallusers(){
      let res = await Api.post("/public/taskdist/user/getallusers");
      if (res.respCode == SUCCESS) {
        this.userList= res.data 
      }
   },
     //初始化码表
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;
},

    // 机构列表
    async getBranchList() {
      const res = await Api.post("/public/quesel/getBranchList");
      if (res.respCode == SUCCESS) {
        this.bchtypList = res.data.list;
      }
    },

    //格式化机构
    bchFormat(value){
      const codeobj = this.bchtypList.find(obj => obj.inr === value)
      return codeobj ? codeobj.bchname : value;
    }
	},
};