import Api from '~/service/Api'; import { getTrnNameByInr } from "~/service/business/common"; import moment from 'moment'; import commonFunctions from '~/mixin/commonFunctions.js'; import Pts from '~/components/business/commonModel/Pts'; import commonApi from "~/mixin/commonApi"; import Utils from "~/utils"; export default { mixins: [commonFunctions], methods: { async ruleHandleSearch() { const loading = this.loading(); let param = { scenecode: this.model.signinfo.scenecode, isdefault: "1", pageNumber: this.model.rulePagination.pageIndex, pageSize: this.model.rulePagination.pageSize, }; let rtnmsg = await Api.post('/Remittance/autosignrule/list', param); if (rtnmsg.respCode == SUCCESS) { this.model.ruleList = rtnmsg.data.list; this.model.rulePagination.total = rtnmsg.data.total; } else { this.$notify.error({ title: '错误', message: '服务请求失败!' }); } loading.close(); }, // pageSize改变 ruleHandleSizeChange(val) { console.log(`每页 ${val} 条`); this.model.rulePagination.pageIndex = 1; this.model.rulePagination.pageSize = val; this.ruleHandleSearch(); }, // 页码改变 ruleHandleCurrentChange(val) { console.log(`当前页: ${val}`); this.model.rulePagination.pageIndex = val; this.ruleHandleSearch(); }, async handleSearch() { const loading = this.loading(); let param = { scenecode: this.model.signinfo.scenecode, pageNumber: this.model.pagination.pageIndex, pageSize: this.model.pagination.pageSize, }; let rtnmsg = await Api.post('/Remittance/autosignpty/list', param); if (rtnmsg.respCode == SUCCESS) { this.model.countPtyList = rtnmsg.data.list; this.model.pagination.total = rtnmsg.data.total; } else { this.$notify.error({ title: '错误', message: '服务请求失败!' }); } loading.close(); }, // pageSize改变 handleSizeChange(val) { console.log(`每页 ${val} 条`); this.model.pagination.pageIndex = 1; this.model.pagination.pageSize = val; this.handleSearch(); }, // 页码改变 handleCurrentChange(val) { console.log(`当前页: ${val}`); this.model.pagination.pageIndex = val; this.handleSearch(); }, async commitAdd() { this.$refs['modelForm'].validate(async (validStatic) => { if (validStatic) { const loading = this.loading(); let params = { autoSignInfo: this.model.signinfo, ruleList: this.model.ruleList, countPtyList: this.model.countPtyList, }; let rtnmsg = await Api.post(`/${this.moduleRouter()}/autosign/add`, params); if (rtnmsg.respCode == SUCCESS) { this.$notify({ title: "成功", message: "保存成功", type: "success", }); this.goBack(true); } else { this.$notify.error({ title: '错误', message: rtnmsg.respMsg }); } this.initdialog = false; loading.close(); } }) }, changePaytyp(){ this.model.signinfo.scenecode = ''; this.ruleHandleSearch(); }, clearDialogData() { Object.keys(this.model.signinfo).forEach(key => (this.model.signinfo[key] = '')); this.model.signinfo.pye = { ptytyp: '', pts: new Pts().data, }; }, selectableFn(row) { return true; }, // 表格多选 handleSelectionChange(val) { this.multipleSelection = val.map((item) => { return item.inr }) this.multipleSelectionObj = val.map((item) => { return item }) this.multipleStatusSelection = val.map((item) => { return item.sta }) this.multipleSelectionRow = val.map((item) => { return item })[0] }, handleSta() { this.stadialog = true; }, /** * update 是否更新查询列表 */ goBack() { this.$store.commit('delTagsArry', this.$route.path); this.$router.back() this.$store.commit("updateAulsigRefresh", true); }, //获取交易编码列列表 async getBopcodItems() { const loading = this.loading(); let res = await Api.post(`/${this.moduleRouter()}/autosign/getBopList`); if (res.respCode === SUCCESS) { this.model.iBopcodList = res.data.iBopcodList; this.model.oBopcodList = res.data.oBopcodList; } loading.close(); }, formatSymbol(row, column) { var result = ""; Object.keys(this.symbolsCodeMap).forEach(key => { if (row.symbols == key) { result = this.symbolsCodeMap[key]; } }); return result; }, }, };