Commit feda776f by mabaofu

更新前段

parents 582b42c8 df6ee642
......@@ -13,25 +13,25 @@ export default {
return Api.post(this.declareParams.trnName+"/init",{params})
},
save(params){
return Api.post(this.declareParams.trnName+"/saveData", Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/saveData", this.wrapper(params))
},
exeuteCheck(rulePath,params){
return Api.post(this.declareParams.trnName+"/executeCheck/"+rulePath, Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeCheck/"+rulePath, this.wrapper(params))
},
executeDefault(rulePath,params)
{
return Api.post(this.declareParams.trnName+"/executeDefault/"+rulePath, Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeDefault/"+rulePath, this.wrapper(params))
},
executeRule(rulePath,params)
{
return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath, Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeRule/"+rulePath, this.wrapper(params))
},
async checkAll(params){
const res = await Api.post(this.declareParams.trnName+"/checkAll", Utils.getRequestDataFn.call(this, params))
const res = await Api.post(this.declareParams.trnName+"/checkAll", this.wrapper(params))
return res
},
pedding(params){
return Api.post(this.declareParams.trnName+"/pending", Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/pending", this.wrapper(params))
},
async restoreDisplay()
{
......@@ -43,7 +43,7 @@ export default {
},
executeNotify(params)
{
return Api.post(this.declareParams.trnName+"/executeNotify", Utils.getRequestDataFn.call(this, params))
return Api.post(this.declareParams.trnName+"/executeNotify", this.wrapper(params))
},
}
}
\ No newline at end of file
......@@ -45,7 +45,8 @@ export default {
ruleCheck() {
if(!this.pattern)
return
const keySet = new Set(Object.keys(this.pattern).concat(Object.keys(this.checkRules).concat(Object.keys(this.defaultRules))))
// const keySet = new Set(Object.keys(this.pattern).concat(Object.keys(this.checkRules).concat(Object.keys(this.defaultRules))))
const keySet = new Set(Object.keys(this.pattern).concat(Object.keys(this.defaultRules)))
const res = {};
const that = this;
for (let key of keySet.keys()) {
......@@ -54,22 +55,22 @@ export default {
rule.push(...that.pattern[key])
}
const triggerType = that.getTriggerType(key)
if(that.checkRules[key]){
if (Array.isArray(that.checkRules[key])) {
for (let j = 0; j < that.checkRules[key].length; j++) {
const check = that.checkRules[key][j];
rule.push({
validator: check.bind(that),
trigger: triggerType
})
}
} else {
rule.push({
validator: that.checkRules[key].bind(that),
trigger: triggerType
})
}
}
// if(that.checkRules[key]){
// if (Array.isArray(that.checkRules[key])) {
// for (let j = 0; j < that.checkRules[key].length; j++) {
// const check = that.checkRules[key][j];
// rule.push({
// validator: check.bind(that),
// trigger: triggerType
// })
// }
// } else {
// rule.push({
// validator: that.checkRules[key].bind(that),
// trigger: triggerType
// })
// }
// }
if (that.defaultRules[key]) {
rule.push({
validator: that.defaultRules[key].bind(that),
......@@ -97,6 +98,26 @@ export default {
return "blur";
},
/**
* 以函数形式获取model(请求参数),保证取到的是最新赋值的
* @param {any} params 参数
* @returns
*/
wrapper(params) {
params = params || {}
const fn = async () => {
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
const d = Utils.flatObject(that.model)
resolve(d)
}, 0)
})
return {...data, params}
}
return fn;
},
/**
* 更新Model
* @param {any} data model数据
*/
......
......@@ -771,7 +771,7 @@ function checkDidgrpRecAvbbyN100(rule, value, callback) {
const that = this;
that.exeuteCheck("didgrp.rec.avbby").then(res => {
//TODO
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
Utils.copyValueFromVO(that.model, res.data);
}
})
......
import Api from "~/service/Api"
export default {
onInfbutSearow(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/infbut_searow",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
async onInfbutSearow() {
let rtnmsg = await this.executeRule("infbut_searow")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
onInfbutDsp(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/infbut_dsp",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onInfbutDsp() {
let rtnmsg = await this.executeRule("infbut_dsp")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
onInfbutUserow(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/infbut_userow",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onInfbutUserow() {
let rtnmsg = await this.executeRule("infbut_userow")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
onInfbutClr(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/infbut_clr",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onInfbutClr() {
let rtnmsg = await this.executeRule("infbut_clr")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
onInfbutButprt(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/infbut_butprt",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onInfbutButprt() {
let rtnmsg = await this.executeRule("infbut_butprt")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
onInfbutExi(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/infbut_exi",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onInfbutExi() {
let rtnmsg = await this.executeRule("infbut_exi")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
onRecpanLnkinfptm(){
this.root.$refs.modelForm.validate(async valid => {
if(!valid)
return;
let rtnmsg = await Api.post("infpta/recpan_lnkinfptm",{data:this.model})
if(rtnmsg.retcod == SUCCESS)
{
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
async onRecpanLnkinfptm() {
let rtnmsg = await this.executeRule("recpan_lnkinfptm")
if (rtnmsg.retcod == SUCCESS) {
//TODO 处理数据逻辑
}
else
{
this.$notify.error({title: '错误',message: '服务请求失败!'});
}
})
},
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
}
\ No newline at end of file
import Api from "~/service/Api"
import Utils from "~/utils/index"
export default {
onUsfmodShwflt() {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/usfmod_shwflt", Utils.getRequestDataFn.call(this))
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
async onUsfmodShwflt() {
let rtnmsg = await this.executeRule("usfmod_shwflt")
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
onButypt() {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/butypt", Utils.getRequestDataFn.call(this))
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
async onButypt() {
let rtnmsg = await this.executeRule("butypt")
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
onDlmft() {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/dlmft", Utils.getRequestDataFn.call(this))
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
async onDlmft() {
let rtnmsg = await this.executeRule("dlmft")
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
onDlaxq() {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/dlaxq", Utils.getRequestDataFn.call(this))
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
async onDlaxq() {
let rtnmsg = await this.executeRule("dlaxq")
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
onButimg() {
this.root.$refs.modelForm.validate(async valid => {
if (!valid)
return;
let rtnmsg = await Api.post("sptsel/butimg", Utils.getRequestDataFn.call(this))
if (rtnmsg.respCode == "AAAAAA") {
//TODO 处理数据逻辑
async onButimg() {
let rtnmsg = await this.executeRule("butimg")
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
}
else {
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
},
tabClick() {
},
async continueEdit(row){
//let rtnmsg = await Api.post("sptsel/getPendingData",{params:{'selsptinr':row[0]}})
//if (rtnmsg.respCode == "AAAAAA") {
//var cacheFileName = rtnmsg.data.cacheFileName;
let viewurl ="/business/ditopn?selsptinr="+row[0];
this.$router.push(viewurl);
async continueEdit(row) {
//let rtnmsg = await Api.post("getPendingData",{params:{'selsptinr':row[0]}})
//if (rtnmsg.respCode == SUCCESS) {
//var cacheFileName = rtnmsg.data.cacheFileName;
let viewurl = "/business/ditopn?selsptinr=" + row[0];
this.$router.push(viewurl);
//}
}
......
......@@ -142,22 +142,6 @@ export default class Utils {
return output.join('');
}
static getRequestDataFn(params) {
params = params||{}
const fn = async () => {
const that = this;
const data = await new Promise(resolve => {
// 保证前一次请求结果赋值VO完成
setTimeout(() => {
const d = Utils.flatObject(that.model)
resolve(d)
}, 0)
})
return {...data, params}
}
return fn;
}
static positioningErrorMsg(fieldErrors, formFields) {
let firstErrorItem = null
for (let i = 0; i < formFields.length; i++) {
......
......@@ -360,39 +360,36 @@ import Utils from "~/utils/index"
export default {
inject: ['root'],
props: ["model", "codes"],
components: { SetpanDialog },
data() {
return {
dialogVisible2: false,
dialog2: {
feetxtinf:"",
feetxt:"",
},
index: 0,
data:[]
};
},
methods: {
...Event,
dispDefault(){
Api.post("cptopn/executeDefault/mac",Utils.getRequestDataFn.call(this)).then(res=>{
Utils.copyValueFromVO(this.model, res.data)
props: ["model", "codes"],
components: { SetpanDialog },
data() {
return {
dialogVisible2: false,
dialog2: {
feetxtinf:"",
feetxt:"",
},
index: 0,
data:[]
};
},
methods: {
...Event,
dispDefault(){
this.executeDefault("mac").then(res=>{
Utils.copyValueFromVO(this.model, res.data)
})
},
detail2(index, row) {
Api.post("cptopn/executeRule/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
this.executeRule("det").then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
},
},
created: function () {},
},
created: function () {},
};
</script>
<style>
......
......@@ -135,7 +135,7 @@ export default {
if (label === "Settlement") {
this.executeRule("setmod.setpan").then(res => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
......@@ -149,7 +149,7 @@ export default {
}
if (label === "Messages") {
this.executeRule("trnmod.trndoc.docpan").then(res => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
var stm = [];
......@@ -165,7 +165,7 @@ export default {
}
if (label === "Attachments") {
this.executeRule("trnmod.trndoc.doctre").then(res => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
......
......@@ -147,20 +147,18 @@ export default {
this.model.didgrp.rec.tenmaxday = 0;
this.model.didgrp.blk.defdet = "";
}
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeCheck/didgrp.rec.avbby", arg).then(
this.executeCheck("didgrp.rec.avbby").then(
(res) => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
Utils.copyValueFromVO(this.model, res.data);
}
}
);
},
recTenmaxdayEvent(){
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeDefault/didgrp.rec.tenmaxday", arg).then(
this.executeDefault("didgrp.rec.tenmaxday").then(
(res) => {
if (res.respCode = "AAAAAA"){
if (res.respCode = SUCCESS){
Utils.copyValueFromVO(this.model, res.data);
}
}
......
......@@ -528,16 +528,14 @@ export default {
this.centerDialogVisible = false;
console.log(this.model);
this.model.trnmod.trndoc.doceot.splice(this.index, 1, this.dialog);
let res = Api.post(
"ditopn/executeRule/trnmod.trndoc.doccur.butaddok",
Utils.getRequestDataFn.call(this)
);
if(res.data.respCode=="AAAAAA"){
//TODO
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
this.executeRule("trnmod.trndoc.doccur.butaddok").then(res => {
if(res.data.respCode==SUCCESS){
//TODO
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
},
},
created: function () {},
......
......@@ -734,10 +734,9 @@ export default {
}
},
nom1CurEvent(){
const data = Utils.flatObject(this.model);
Api.post("ditopn/executeDefault/didgrp.cbs.nom1.cur", Utils.getRequestDataFn.call(this)).then(
this.executeDefault("didgrp.cbs.nom1.cur").then(
(res) => {
if (res.respCode = "AAAAAA"){
if (res.respCode = SUCCESS){
Utils.copyValueFromVO(this.model, res.data);
}
}
......
......@@ -433,26 +433,26 @@ export default {
},
// 第二个表格
detail1(index, row) {
Api.post("ditopn/executeDefault/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.executeDefault("det").then(res=>{
this.dialogVisible = true;
this.dialog = row;
this.index = index;
this.dialog = row;
this.index = index;
})
},
dispDefault(){
Api.post("ditopn/executeDefault/mac",Utils.getRequestDataFn.call(this)).then(res=>{
Utils.copyValueFromVO(this.model, res.data)
this.executeDefault("mac").then(res=>{
Utils.copyValueFromVO(this.model, res.data)
})
},
// 第三个表格
detail2(index, row) {
Api.post("ditopn/executeRule/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
this.executeRule("det").then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
},
},
created: function () {},
......
......@@ -2012,7 +2012,7 @@ export default {
created: async function () {
console.log("进入ditame交易");
let rtnmsg = await Api.post("ditame/init", { params: {} });
if (rtnmsg.respCode == "AAAAAA") {
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
Utils.copyValueFromVO(this.model, rtnmsg.data);
} else {
......
......@@ -147,20 +147,18 @@ export default {
this.model.didgrp.rec.tenmaxday = 0;
this.model.didgrp.blk.defdet = "";
}
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeCheck/didgrp.rec.avbby", arg).then(
this.executeCheck("didgrp.rec.avbby").then(
(res) => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
Utils.copyValueFromVO(this.model, res.data);
}
}
);
},
recTenmaxdayEvent(){
const arg = Utils.getRequestDataFn.call(this);
Api.post("ditopn/executeDefault/didgrp.rec.tenmaxday", arg).then(
this.executeDefault("didgrp.rec.tenmaxday").then(
(res) => {
if (res.respCode = "AAAAAA"){
if (res.respCode = SUCCESS){
Utils.copyValueFromVO(this.model, res.data);
}
}
......
......@@ -528,16 +528,14 @@ export default {
this.centerDialogVisible = false;
console.log(this.model);
this.model.trnmod.trndoc.doceot.splice(this.index, 1, this.dialog);
let res = Api.post(
"ditopn/executeRule/trnmod.trndoc.doccur.butaddok",
Utils.getRequestDataFn.call(this)
);
if(res.data.respCode=="AAAAAA"){
//TODO
this.executeRule("trnmod.trndoc.doccur.butaddok").then(res => {
if(res.data.respCode==SUCCESS){
//TODO
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
}else{
this.$notify.error({ title: '错误', message: '服务请求失败!' });
}
})
},
},
created: function () {},
......
......@@ -713,10 +713,9 @@ export default {
}
},
nom1CurEvent(){
const data = Utils.flatObject(this.model);
Api.post("ditopn/executeDefault/didgrp.cbs.nom1.cur", Utils.getRequestDataFn.call(this)).then(
this.executeDefault("didgrp.cbs.nom1.cur").then(
(res) => {
if (res.respCode = "AAAAAA"){
if (res.respCode = SUCCESS){
Utils.copyValueFromVO(this.model, res.data);
}
}
......
......@@ -432,26 +432,26 @@ export default {
},
// 第二个表格
detail1(index, row) {
Api.post("ditopn/executeDefault/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.executeDefault("det").then(res=>{
this.dialogVisible = true;
this.dialog = row;
this.index = index;
this.dialog = row;
this.index = index;
})
},
dispDefault(){
Api.post("ditopn/executeDefault/mac",Utils.getRequestDataFn.call(this)).then(res=>{
Utils.copyValueFromVO(this.model, res.data)
this.executeDefault("mac").then(res=>{
Utils.copyValueFromVO(this.model, res.data)
})
},
// 第三个表格
detail2(index, row) {
Api.post("ditopn/executeRule/det",Utils.getRequestDataFn.call(this)).then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
this.executeRule("det").then(res=>{
this.dialogVisible2 = true;
this.index = index;
this.dialog2 = row
})
},
},
created: function () {},
......
......@@ -190,7 +190,7 @@ export default {
}
if (name === "setpan") {
this.executeRule("setmod.setpan").then(res => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
......@@ -198,7 +198,7 @@ export default {
}
if (name === "docpan") {
this.executeRule("trnmod.trndoc.docpan").then(res => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
var stm = [];
......@@ -214,7 +214,7 @@ export default {
}
if (name === "limitbody") {
this.executeRule("liaall.limmod.limitbody").then(res => {
if (res.respCode == "AAAAAA"){
if (res.respCode == SUCCESS){
const data = res.data;
Utils.copyValueFromVO(this.model, data)
}
......
......@@ -541,7 +541,7 @@ export default {
created: async function () {
console.log("进入ditsel交易");
let rtnmsg = await Api.post("ditsel/init", { params: {} });
if (rtnmsg.respCode == "AAAAAA") {
if (rtnmsg.respCode == SUCCESS) {
//TODO 处理数据逻辑
Utils.copyValueFromVO(this.model,rtnmsg.data)
} else {
......
......@@ -194,7 +194,7 @@ export default {
console.log("进入office交易");
if(1) return
let rtnmsg = await Api.post("office/init",Utils.getRequestDataFn.call(this, {}))
let rtnmsg = await this.init()
console.log(rtnmsg)
if(rtnmsg.code == SUCCESS)
{
......
......@@ -48,7 +48,7 @@ export default {
});
if (this.model.docXML != "")
Api.post("pdf", { xml: this.model.docXML }).then((res) => {
if (res.respCode == "AAAAAA") {
if (res.respCode == SUCCESS) {
this.pdf += res.data;
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment