Commit 7d89e9e9 by 李少勇

暂存功能联调

parent bf0072d4
......@@ -6,6 +6,7 @@ import glentry from '~/components/business/glentry/event';
import engp from '~/components/business/engp/event';
import docpan from '~/components/business/docpan/event';
import ccvpan from '~/components/business/ccvpan/event';
import Utils from "~/utils"
export default {
mixins: [commonFunctions],
......@@ -17,7 +18,7 @@ export default {
...ccvpan,
async init () {
const params = {
spt: this.toHandleRowData
spt: this.toHandleRowData['row_' + this.trnName]
}
const res = await Api.post('/service/gitopn/init', {
...params,
......@@ -27,28 +28,23 @@ export default {
if (!res.data) {
return
}
if (res.data.addbcb) {
this.$set(this.model, 'addbcb', res.data.addbcb)
}
if (res.data.gitp) {
this.$set(this.model, 'gitp', res.data.gitp)
}
if (res.data.gidgrp) {
this.$set(this.model, 'gidgrp', res.data.gidgrp)
}
if (res.data.cfagit) {
this.$set(this.model, 'cfagit', res.data.cfagit)
}
if (res.data.cnybop) {
this.$set(this.model, 'cnybop', res.data.cnybop)
}
this.$set(this.model, 'setmod', {
...this.model.setmod,
setfeg: res.data.setfeg,
setfog: res.data.setfog,
setglg: res.data.setglg,
this.copyValueFromVoData(this.model, res.data)
this.copyValueFromVoData(this.model.setmod.setfeg, res.data.setfeg)
this.copyValueFromVoData(this.model.setmod.setfog, res.data.setfog)
this.copyValueFromVoData(this.model.setmod.setglg, res.data.setglg)
},
// 兼容处理在前端model中定义了字段,后端返回的数据中不存在字段的问题
copyValueFromVoData (model, data) {
let keysList = Object.keys(model)
keysList.map((key) => {
if (data[key]) {
if (Utils.typeOf(model[key]) === 'Object') {
this.copyValueFromVoData(model[key], data[key])
} else {
this.$set(model, key, data[key])
}
}
})
console.log(res)
},
async tabClick(tab) {
if (this.isInDisplay) {
......
......@@ -560,6 +560,7 @@
</template>
<script>
import event from '../event'
import { mapMutations } from 'vuex';
export default {
inject: ["root"],
props: ["model", "codes"],
......@@ -631,11 +632,16 @@ export default {
};
},
methods: {
...mapMutations(['updateToHandleRowData']),
toGitpop() {
this.$router.history.push("/business/gitpop");
},
toGitopn() {
this.$router.history.push("/business-new/gitopn");
// 点击开立,清空从待经办进来的时候带的行参数
this.updateToHandleRowData({
[`row_${row.frm.toLowerCase()}`]: {}
})
},
toGetopn() {
this.$router.history.push("/business/getopn");
......
import Api from '~/service/Api';
import moment from 'moment';
import { mapMutations } from 'vuex';
export default {
methods: {
...mapMutations(['updateToHandleRowData']),
async handleReset() {
this.model.chkinc = '';
this.model.chkdzt = '';
......@@ -53,8 +52,10 @@ export default {
this.$router.push({ path: 'business-new/sptpopup', query: { inr: inr } });
},
async continueEdit(row, scope) {
console.log('row=====', row)
this.updateToHandleRowData(row)
this.updateToHandleRowData({
...this.toHandleRowData,
[`row_${row.frm.toLowerCase()}`]: row
})
let trnName = row.frm.toLowerCase();
this.$router.push({
path: 'business-new/' + trnName,
......
......@@ -148,9 +148,15 @@
<script>
import Api from '~/service/Api';
import event from '../event'
import { mapMutations, mapState } from 'vuex';
export default {
inject: ['root'],
props: ['model', 'codes'],
computed: {
...mapState({
toHandleRowData: (state) => state.gitopn.toHandleRowData
})
},
mixins: [event],
data() {
return {
......@@ -232,22 +238,9 @@ export default {
{ label: '拒绝', value: 'chkdel' },
{ label: '网银', value: 'chktco' },
];
// await this.handleSearch()
// this.$store.commit('setTaskList', {key: 'sptsel', val: this.stmData.data.length})
},
methods: {
// async choose(idx,row){
// var params = {selDst:"sptstm",selrow:[idx+1]}
// let rtnmsg = await this.executeRule("sptstm" , params) //SPTSTM
// if(rtnmsg.respCode == SUCCESS)
// {
// this.stmData.data = rtnmsg.data.sptstm.rows;
// }
// else
// {
// this.$notify.error({title: '错误',message: '服务请求失败!'});
// }
// },
...mapMutations(['updateToHandleRowData']),
getInidatfro() {
let datetime = new Date();
datetime = datetime.setDate(datetime.getDate() - 10);
......
......@@ -53,6 +53,7 @@ export default {
setfeg: this.model.setmod.setfeg,
setglg: this.model.setmod.setglg,
doceot: this.model.docpan.doceot,
spt: this.toHandleRowData['row_' + this.trnName] || {},
gidgrp: this.model.gidgrp,
gitp: this.model.gitp,
}
......@@ -63,9 +64,9 @@ export default {
message: '暂存成功',
type: 'success',
});
loading.close();
this.$router.push('/taskList')
}
loading.close();
},
}
}
\ No newline at end of file
......@@ -317,5 +317,8 @@ export default class Utils {
}
}
}
// 值分别为:Number、String、Boolean、Null、Undefined、Symbol、Object、Array、Function、Date
static typeOf (data) {
return Object.prototype.toString.call(data).slice(8, -1);
}
}
\ No newline at end of file
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