Infsea.vue 12.2 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 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
<template>
	<div class="eibs-tab">
		<c-col :span="12" class="col-left">
			<c-col :span="24">
				<el-form-item label="Created between" prop="trncorco.inidatfro" style="width: 100%">
					<c-col :span="11">
						<c-date-picker placeholder="请选择创建时间" style="width: 100%" type="date" v-model="model.trncorco.inidatfro">
						</c-date-picker>
					</c-col>
					<c-col :span="2" style="text-align: center">
						<label style="display: inline-block; width: 100%">-</label>
					</c-col>
					<c-col :span="11">
						<c-date-picker placeholder="请选择创建时间" style="width: 100%" type="date" v-model="model.trncorco.inidattil">
						</c-date-picker>
					</c-col>
				</el-form-item>
			</c-col>
			<c-col :span="24">
				<el-form-item label="Reference" prop="trncorco.ownref">
					<c-input v-model="model.trncorco.ownref" style="width: 100%" placeholder="请输入Reference"></c-input>
				</el-form-item>
			</c-col>
			<c-col :span="24">
				<el-form-item label="Service" prop="trncorco.srv">
					<c-input v-model="model.trncorco.srv" style="width: 100%" placeholder="请输入Service"></c-input>
				</el-form-item>
			</c-col>
		</c-col>
		<c-col :span="12" class="col-right">
			<c-col :span="24">
				<el-form-item label="Status" prop="trncorco.relflg">
					<c-select clearable filterable placeholder="请选择交易状态" style="width: 100%" v-model="model.trncorco.relflg">
						<el-option :key="item.value" :label="item.label" :value="item.value" v-for="item in relflgList">
						</el-option>
					</c-select>
				</el-form-item>
			</c-col>
			<c-col :span="24">
				<el-form-item label="Transaction" prop="trncorco.cod">
					<c-input v-model="model.trncorco.cod" style="width: 100%" placeholder="请输入Transaction"></c-input>
				</el-form-item>
			</c-col>
			<c-col :span="24">
				<el-form-item label="Branch" prop="trncorco.bchkeyinr">
					<c-select clearable placeholder="请选择业务机构" style="width: 100%" v-model="model.trncorco.bchkeyinr">
						<el-option :key="item.inr" :label="item.bchname" :value="item.inr" v-for="item in bchtypList">
						</el-option>
					</c-select>
				</el-form-item>
			</c-col>
		</c-col>
		<c-col :span="24">
			<el-form-item label="Workflow entries" prop="trncorco.entries" style="width: 100%">
				<el-checkbox-group v-model="model.trncorco.entries">
					<el-checkbox :key="sta.value" :label="sta.value" class="el-checkbox-width" v-for="sta in entriesList">{{sta.label}}
					</el-checkbox>
				</el-checkbox-group>
			</el-form-item>
		</c-col>
		<c-col :span="24" style="text-align: right;margin-bottom: 20px;">
			<el-button size="small" :disabled="isDeal" @click="handleDone">Done</el-button>
			<el-button size="small" :disabled="isDeal" @click="handleReDo">ReDo</el-button>
			<el-button size="small" :disabled="isDeal" @click="handleError">Error</el-button>
			<el-button size="small" :disabled="isDeal" @click="handleSkip">Skip</el-button>
			<el-button size="small" @click="handleReset">重置</el-button>
			<el-button type="primary" icon="el-icon-search" size="small" :loading="searchLoading" @click="onSearch()">查询
			</el-button>
		</c-col>
		<c-col :span="24">
			<el-table :data="dbwData.data" @selection-change="handleSelectionChange" @sort-change="sortChange" border height="calc(100vh - 400px)" size="small" style="width:100%">
				<el-table-column :selectable="selectableFn" type="selection" width="55">
				</el-table-column>
				<el-table-column :key="key" :label="item.label" :min-width="item.width" :prop="item.prop" show-overflow-tooltip sortable="custom" v-for="(item, key) in dbwData.columns">
					<template slot-scope="scope">
						<span v-if="item.prop==='reloriamt'">
							{{ moneyFormat(scope.row.reloriamt, scope.row.reloricur) }}
						</span>
						<span v-else>
							{{ scope.row[item.prop] }}
						</span>
					</template>
				</el-table-column>
			</el-table>
			<el-pagination :current-page.sync="pagination.pageIndex" :page-size="pagination.pageSize" :page-sizes="[10, 20, 50, 100, 500]" :total="pagination.total" @current-change="handleCurrentChange" @size-change="handleSizeChange" layout="total, sizes, prev, pager, next, jumper"></el-pagination>
		</c-col>

	</div>
</template>

<script>
import Dbw from "./Dbw.js";
import Api from "~/service/Api";
import moment from "moment";

import commonFunctions from "~/mixin/commonFunctions.js";

export default {
  mixins: [commonFunctions],
  name: "",
  props: ["model"],
  inject: ["root"],
  data() {
    return {
      selectRow: {},
      selectAllRow: [],
      dbwData: {
        columns: [
          {
            label: "交易码",
            prop: "inifrm",
            width: "150px"
          },
          {
            label: "业务编号",
            prop: "ownref",
            width: "150px"
          },
          {
            label: "币种",
            prop: "relcur",
            width: "150px"
          },
          {
            label: "金额",
            prop: "relamt",
            width: "150px"
          },
          {
            label: "工作流名称",
            prop: "srv",
            width: "150px"
          },
          {
            label: "工作流状态",
            prop: "sta",
            width: "150px"
          },
          {
            label: "创建时间",
            prop: "inidattim",
            width: "150px"
          },
          {
            label: "经办柜员",
            prop: "iniusr",
            width: "150px"
          },
          {
            label: "交易状态",
            prop: "relflg",
            width: "150px"
          },

          {
            label: "服务名称",
            prop: "wfssub",
            width: "150px"
          },
          {
            label: "签名要求",
            prop: "relreq",
            width: "150px"
          },
          {
            label: "签名状态",
            prop: "relres",
            width: "150px"
          }
        ],
        data: []
      },
      searchLoading: false,
      entriesList: [
        { label: "Open", value: "O" },
        { label: "Waiting", value: "W" },
        { label: "Retry", value: "R" },
        { label: "Error", value: "E" },
        { label: "Done", value: "D" },
        { label: "Skip", value: "S" }
      ],
      relflgList: [
        { label: "ALL", value: "" },
        { label: "Waiting", value: "W" },
        { label: "Release", value: "R" },
        { label: "收单行已复核", value: "A" },
        { label: "总行已经办", value: "B" },
        { label: "Correct", value: "C" },
        { label: "Reject", value: "N" },
        { label: "Final", value: "F" }
      ],
      bchtypList: [],
      pagination: {
        pageIndex: 1,
        pageSize: 20,
        total: 0
      }
    };
  },
  mounted() {
    this.onInfDbwSearch();
    this.getBranchList();
    this.getInidatfro();
  },
  computed: {
    isDeal() {
      if (
        this.selectAllRow &&
        this.selectAllRow.length === 1 &&
        this.selectAllRow[0].id
      ) {
        return false;
      }
      return true;
    }
  },
  methods: {
    getInidatfro() {
      if (this.model.trncorco.inidatfro) {
        this.model.trncorco.inidatfro =
          moment(new Date() - 7).format("YYYY-MM-DD") + " 00:00:00";
      }
      this.model.trncorco.inidattil =
        moment(new Date()).format("YYYY-MM-DD") + " 23:59:59";
    },
    handleReset() {
      this.model.trncorco.inidatfro = "";
      this.model.trncorco.inidattil = "";
      this.model.trncorco.ownref = "";
      this.model.trncorco.srv = "";
      this.model.trncorco.relflg = "";
      this.model.trncorco.cod = "";
      this.model.trncorco.bchkeyinr = "";
      this.model.trncorco.entries = [];
    },
    onSearch() {
      this.model.pageNum = 1;
      this.model.pageSize = PageSize;
      this.onInfDbwSearch();
    },
    async onInfDbwSearch() {
      // this.searchLoading = true;
      let inidatfro = this.model.trncorco.inidatfro;
      let inidattil = this.model.trncorco.inidattil;
      if (!inidattil) {
        this.$notify.error({
          title: "错误",
          message: "查询结束日期必输!"
        });
        return;
      }
      let params = {
        inidatfro: this.model.trncorco.inidatfro,
        inidattil: this.model.trncorco.inidattil,
        ownref: this.model.trncorco.ownref,
        srv: this.model.trncorco.srv,
        relflg: this.model.trncorco.relflg,
        inifrm: this.model.trncorco.cod,
        bchkeyinr: this.model.trncorco.bchkeyinr,
        staList: this.model.trncorco.entries,
        pageNum: this.pagination.pageIndex,
        pageSize: this.pagination.pageSize
      };
      //查询接口
      const res = await Api.post("/manager/wfe/queryWfeByPage", params);
      if (res.respCode === SUCCESS) {
        this.dbwData.data = res.data.list;
        this.pagination.total = res.data.total;
      }
      this.searchLoading = false;
    },
    // 表格多选
    async handleSelectionChange(val) {
      this.selectRow = {};
      this.selectRow = val[0];
      this.selectAllRow = val;
    },

    sortChange(obj) {},
    selectableFn(row) {
      return true;
    },
    // 页码改变
    handleCurrentChange(val) {
      this.pagination.pageIndex = val;
      this.onInfDbwSearch();
    },
    // pageSize改变
    handleSizeChange(val) {
      this.pagination.pageIndex = 1;
      this.pagination.pageSize = val;
      this.onInfDbwSearch();
    },
    handleDone() {
      this.$confirm("是否确定更新成done?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async () => {
        const res = await Api.post("/manager/wfe/updateDone", {
          id: this.selectRow.id
        });
        if (res.respCode === SUCCESS) {
          this.$notify({
            title: "成功",
            message: "更新成功",
            type: "success"
          });
          this.onSearch();
        } else {
          this.$notify.error("未完成");
        }
      });
    },
    handleReDo() {
      this.$confirm("是否确定更新成waiting?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async () => {
        const res = await Api.post("/manager/wfe/updateWaiting", {
          id: this.selectRow.id
        });
        if (res.respCode === SUCCESS) {
          this.$notify({
            title: "成功",
            message: "更新成功",
            type: "success"
          });
          this.onSearch();
        } else {
          this.$notify.error("未完成");
        }
      });
    },
    handleError() {
      this.$confirm("是否确定更新成error?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async () => {
        const res = await Api.post("/manager/wfe/updateError", {
          id: this.selectRow.id
        });
        if (res.respCode === SUCCESS) {
          this.$notify({
            title: "成功",
            message: "更新成功",
            type: "success"
          });
          this.onSearch();
        } else {
          this.$notify.error("未完成");
        }
      });
    },
    handleSkip() {
      this.$confirm("是否确定更新成skip?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(async () => {
        const res = await Api.post("/manager/wfe/updateSkip", {
          id: this.selectRow.id
        });
        if (res.respCode === SUCCESS) {
          this.$notify({
            title: "成功",
            message: "更新成功",
            type: "success"
          });
          this.onSearch();
        } else {
          this.$notify.error("未完成");
        }
      });
    },
    async getBranchList() {
      const loading = this.loading();
      let res = await Api.post("/public/quesel/getActBranchList");
      if (res.respCode == SUCCESS) {
        this.bchtypList = res.data.list;
      }
      loading.close();
    }
  }
};
</script>

<style lang="less" scoped>
.el-checkbox-width {
  margin-right: 0px;
  float: left;
  text-align: left !important;
  width: 150px;
}

/* .table-button-item-list {
  padding: 0;
  margin: 0;
}

.table-button-item-list li {
  list-style: none;
  padding: 5px 0;
  text-align: center;
  color: #606266;
  cursor: pointer;
} */
</style>