reroutingDialog.vue 13.4 KB
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 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433
<template>
	<div class="routing">
		<el-dialog v-dialogDrag width="60%" title="ReRouting" v-if="visiable" :visible.sync="visiable" :append-to-body="true" :modal-append-to-body="false" :before-close="handleClose" destroy-on-close>
			<div align="right" v-if="branch!=='1000'">
        <span slot="footer" class="dialog-footer">
          <el-button class="flex-item"  height="75px;" width="32px;" type="primary" @click="sendUp"> Snd.H.O </el-button>
        </span>
      </div>
      <el-form ref="reroutingForm" style="margin-top:20px;" label-width="120px" :model="formData" :rules="polrulesReRouting">
				<el-row>
					<c-col :span="24">
						<c-col :span="12">
							<el-form-item label="文件路径">
								<c-input v-model="formData.filepath" disabled></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="10">
							<el-form-item label="文件名称">
								<c-input v-model="formData.filename" disabled></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="2" style="padding-left:10px" min-width="100%" align="center" >
              <div class="flex-container">
							<el-button class="flex-item" type="primary" :disabled="!formData.filename"  @click="showReMsg">查看</el-button>
              </div>
						</c-col>
					</c-col>
				</el-row>
				<el-row>
					<c-col :span="24">
						<c-col :span="12">
							<el-form-item label="报文描述">
								<c-input v-model="formData.msgtxt" disabled></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="12">
							<el-form-item label="交易状态">
								<c-input v-model="formData.status" disabled></c-input>
							</el-form-item>
						</c-col>
					</c-col>
				</el-row>
				<el-row>
					<c-col :span="24">
						<c-col :span="12">
							<el-form-item label="交易码" prop="inifrm">
                	<c-select v-model="formData.inifrm" disabled  style="width: 100%" placeholder="请选择交易码" clearable>
								<el-option v-for="item in inifrmList" :key="item.cod" :label="item.cod+'-'+item.codName" :value="item.cod">
									</el-option>
                	</c-select>
							</el-form-item>
						</c-col>
					</c-col>
				</el-row>
				<el-row>
					<c-col :span="24">

						<c-col :span="12">
							<el-form-item label="业务参考号" prop="ownref">
								<c-input v-model="formData.ownref" disabled placeholder="请输入业务参考号"></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="12">
							<el-form-item label="业务描述">
								<c-input v-model="formData.bustxt" placeholder="请输入业务描述" disabled></c-input>
							</el-form-item>
						</c-col>
					</c-col>
				</el-row>
				<el-row>
					<c-col :span="24">
						<c-col :span="12">
							<el-form-item label="经办柜员" prop="usrcon">
								<c-select v-model="formData.usrcon" @blur="loadUser" style="width: 100%" placeholder="请选择经办柜员" clearable>
									<el-option v-for="(item,index) in userList"  :key="item.extkey+index" :label="item.extkey+'-'+item.nam" :value="item.extkey">
									</el-option>
								</c-select>
							</el-form-item>
						</c-col>
						<c-col :span="12">
							<el-form-item label="虚拟机构" prop="wrkbch">
								<c-select v-model="formData.wrkbch"  :disabled="roletypeName==='单证中心'?false:true"   @change="bchChange"   style="width: 100%" placeholder="请选择业务机构" clearable>
									<el-option v-for="item in bchtypList" :key="item.inr" :label="item.branch+'-'+item.bchname" :value="item.inr">
									</el-option>
								</c-select>
							</el-form-item>
						</c-col>
					</c-col>
				</el-row>
				<el-row>
					<c-col :span="24">
						<el-form-item label="备注">
							<c-input type="textarea" :rows="2" placeholder="请输入备注" v-model="formData.remark"></c-input>
						</el-form-item>
					</c-col>
				</el-row>
				<el-row>
					<c-col :span="24">
						<c-col :span="12">
							<el-form-item label="处理人">
								<c-input v-model="formData.handleUsr" disabled></c-input>
							</el-form-item>
						</c-col>
						<c-col :span="12">
							<el-form-item label="处理时间">
								<c-date-picker type="datetime" :default-value="formData.handleTime" value-format="yyyy-MM-dd HH:mm:ss" format="yyyy-MM-dd HH:mm:ss" v-model="formData.handleTime" disabled></c-date-picker>
							</el-form-item>
						</c-col>
					</c-col>
				</el-row>
			</el-form>
      <div align="center">
        <span slot="footer" class="dialog-footer">
          <el-button type="primary" @click="submit">保 存</el-button>
          <el-button type="primary" @click="handleClose">退 出</el-button>
        </span>
      </div>
		</el-dialog>
	</div>
</template>
<script>
import Api from "~/service/Api";
import moment from "moment";
export default {
  name: "reroutingDialog",
  props: {
    isShowReRouting: {
      type: Boolean,
      default: false
    },
    modelInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      branch:JSON.parse(window.sessionStorage.currentOrg).departmentNumber,
      roletypeName: JSON.parse(window.sessionStorage.curRole).name,
      formData: {
        filepath: "",
        filename: "",
        bustxt: "",
        msgtxt: "",
        ownref: "",
        status: "",
        inifrm: "",
        inifrmname: "",
        usrcon: "",
        wrkbch: "",
        remark: "",
        handleUsr: window.sessionStorage.userName,
        handleTime: new Date()
      },
      polrulesReRouting: {
        // ownref: [{ required: true, message: "必填", trigger: "blur" }],
        // inifrm: [{ required: true, message: "必填", trigger: "blur" }],
        usrcon: JSON.parse(window.sessionStorage.curRole).name!=="保函复核"?[]:
                [{ required: true, message: "必填", trigger: "blur" }],
        wrkbch: [{ required: true, message: "必填", trigger: "blur" }]
      },
      queinr: "",
      queinrList:[],
      multipleSelectionObj:[],
      channel:"",
      smhinr: "",
      inifrmList: [],
      bchtypList: [],
      userList: [],
      visiable: false,
      loadingFlag: false,
      tableColumn: [
        {
          label: "工号",
          prop: "extkey",
          width: "100px"
        },
        {
          label: "名称",
          prop: "nam",
          width: "200px"
        },
        {
          label: "机构",
          prop: "bchname"
        }
      ],
      tableList: []
    };
  },
  watch: {
    isShowReRouting(newVal) {
      if (newVal) {
        (this.visiable = true),
          (this.queinr = this.modelInfo ? this.modelInfo.queinr : ""),
          (this.queinrList = this.modelInfo ? this.modelInfo.queinrList : []),
          (this.multipleSelectionObj = this.modelInfo ? this.modelInfo.multipleSelectionObj : []),
          this.getBranchList();
        this.getUserList();
        this.getFrameList();
        this.init();
      }
    }
  },
  computed: {
    isDisable() {
      if (
        this.formData.status === "pending" ||
        this.formData.status === "correct"
      ) {
        return true;
      }
      return false;
    },
     isInifrmDisable(){
      	if (this.channel==='EJS'||this.channel==='YPT') {
          return true;
        }
        return false;
    },
  },
  methods: {
    bchChange(){
       this.formData.usrcon="";
       this.getUserList();
    },
     loadUser(){
        //this.getUserList();
    },
     async getFrameList() {
      this.loadingFlag = true;
      let param={};
      if(this.formData.wrkbch){
        param.usrcon=this.formData.wrkbch
      }
      let res = await Api.post("/public/quesel/getReCodeList",param);
      if (res.respCode == SUCCESS) {
        this.inifrmList = res.data.list;
      }
      this.loadingFlag = false;
    },
    // 机构列表
    async getBranchList() {
      this.loadingFlag = true;
      let res = await Api.post("/public/quesel/getActBranchList");
      if (res.respCode == SUCCESS) {
        this.bchtypList = res.data.list;
      }
      this.loadingFlag = false;
    },

    //柜员列表
    async getUserList() {
      this.loadingFlag = true;
      let param={};
      if(this.formData.wrkbch){
        param.usrcon=this.formData.wrkbch
      }
      let res = await Api.post("/public/quesel/getActUserList",param);
      if (res.respCode == SUCCESS) {
        this.userList = res.data.list;
      }
      this.loadingFlag = false;
    },

    async init() {
      this.smhinr = "";
      this.formData.usrcon = "";
      this.formData.remark = "";
      let params = {
        queinr: this.queinr
      };
      let res = await Api.post("/public/quesel/initRouting", params);
      if (res.respCode == SUCCESS) {
        this.formData.bustxt = res.data.spt.objnam;
        this.formData.status = res.data.que.status;
        this.formData.ownref = res.data.que.objref.trim();
        this.formData.inifrm = res.data.que.frm;
        this.formData.wrkbch = res.data.que.bchkeyinr;
        this.channel=res.data.que.channel;
        if (res.data.smh) {
          this.smhinr = res.data.smh.inr;
          this.formData.filepath = res.data.smh.docpth;
          this.formData.filename =
            res.data.smh.docfil + "." + res.data.smh.docfxt;
          this.formData.msgtxt = res.data.smh.extkey;
        }
      }
    },

    async submit() {
       let checkSuccess=true;
       if(!this.formData.usrcon){
         for(let i=0;i<this.multipleSelectionObj.length;i++){
            if("-pending-correct-".indexOf(this.multipleSelectionObj[i].status)>0){
               checkSuccess=false;
               break;
            }
         }
       }
      if(!checkSuccess){
          this.$alert('选中业务中包含有暂存,已退回业务时,经办柜员不能为空!', '提示', {
		          confirmButtonText: '确定',
		          callback: action => {

		          }
		     });
         return;
      }

      let confirmtxt=`您确定ReRouting此${this.queinrList.length}笔交易给${this.formData.usrcon}?`;
      if(!this.formData.usrcon){
          confirmtxt=`您确定ReRouting该笔交易?`;
      }
      this.$refs.reroutingForm.validate(valid => {
        if (valid) {
          this.$confirm(
            confirmtxt,
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }
          ).then(async () => {
            let params = {};
            params.queinr = this.queinr;
            params.queinrList=this.queinrList;
            switch (this.formData.status) {
              case "incoming":
                params.ownref = this.formData.ownref;
                params.inifrm = this.formData.inifrm;
                params.usrcon = this.formData.usrcon;
                params.bchkeyinr = this.formData.wrkbch;
                params.remark = this.formData.remark;
                break;
              case "new":
              case "assigned":
                params.usrcon = this.formData.usrcon;
                params.bchkeyinr = this.formData.wrkbch;
                params.remark = this.formData.remark;
                params.status="assigned";
                break;
              default:
                params.usrcon = this.formData.usrcon;
                params.bchkeyinr = this.formData.wrkbch;
                params.remark = this.formData.remark;
                break;
            }

             if(this.roletypeName==="单证中心"){
                  let res = await Api.post("/public/sptrou/reRouting", params);
                  if (res.respCode == SUCCESS) {
                        this.$notify({
                          title: "成功",
                          message: "ReRouting成功",
                          type: "success"
                      });
                    this.$parent.searchUnAssign();
                    this.handleClose();
                  }
              }else{
                  let res = await Api.post("/public/sptrou/reRoutingAssignList", params);
                  if (res.respCode == SUCCESS) {
                    this.$notify({
                      title: "成功",
                      message: "Rerouting分配成功",
                      type: "success"
                    });
                    this.$parent.searchUnAssign();
                    this.handleClose();
                  }
              }
          });
        }
      });
    },

    handleClose () {
			this.visiable = false
			this.$emit('closeDialog')
		},

    async sendUp() {
          this.$confirm(
            `您确定将该笔业务ReRouting给总行?`,
            "提示",
            {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }
          ).then(async () => {
            let params = {};
            params.queinr = this.queinr;
            params.sendUpper = true;
            params.inifrm=this.formData.inifrm;
            let res = await Api.post("/public/sptrou/reRouting", params);
            if (res.respCode == SUCCESS) {
              this.$notify({
                title: "成功",
                message: "ReRouting总行成功",
                type: "success"
              });
              this.visiable = false;
              this.$emit("refresh");
            }
          });
    },
    handleClose() {
      this.visiable = false;
      this.$emit("closeDialog");
    },
    showReMsg() {
      // this.$emit('showmsg');
      this.$parent.showMsg();
    }
  }
};
</script>
<style lang="less" scoped>
::v-deep .routing .el-dialog__body {
  height: calc(100% - 60px) !important;
  overflow: hidden !important;
}
.flex-container {
  display: flex;
}

.flex-item {
  flex-grow: 1;
}
</style>