feat: 新增需求
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<view>
|
||||
<template v-if="config.formType == 1">
|
||||
<template >
|
||||
<dynamicForm ref="form" @eventReceiver="eventReceiver" @setBtnLoad="setBtnLoad" :config="config" />
|
||||
</template>
|
||||
<template v-if="config.formType == 2">
|
||||
<!-- <template v-if="config.formType == 2">
|
||||
<crmOrder ref="form" @eventReceiver="eventReceiver" v-if="config.formEnCode==='crmOrder'"
|
||||
:config="config" />
|
||||
<leaveApply ref="form" @eventReceiver="eventReceiver" v-if="config.formEnCode==='leaveApply'"
|
||||
@@ -12,7 +12,7 @@
|
||||
:config="config" />
|
||||
<revokeApply ref="form" @eventReceiver="eventReceiver" v-if="config.formEnCode==='revoke'"
|
||||
:config="config" />
|
||||
</template>
|
||||
</template> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -36,6 +36,15 @@
|
||||
default: () => {}
|
||||
},
|
||||
},
|
||||
watch:{
|
||||
config:{
|
||||
handler(val){
|
||||
console.log(val,'val1233')
|
||||
},
|
||||
deep:true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
eventReceiver(formData, eventType) {
|
||||
this.$emit('eventReceiver', formData, eventType)
|
||||
|
||||
@@ -99,7 +99,9 @@
|
||||
import {
|
||||
createModel,
|
||||
updateModel,
|
||||
getOnlineLog
|
||||
getOnlineLog,
|
||||
getDesForm,
|
||||
getProcessBusinessInfo
|
||||
} from '@/api/apply/visualDev'
|
||||
import {
|
||||
createComment
|
||||
@@ -127,6 +129,8 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formConf: {},
|
||||
processBusinessInfo: {},
|
||||
dataLogList: [],
|
||||
dataLog: false,
|
||||
childFormKey: +new Date(),
|
||||
@@ -207,6 +211,7 @@
|
||||
onLoad(option) {
|
||||
if (!option.config) return this.jnpf.goBack()
|
||||
this.config = JSON.parse(this.jnpf.base64.decode(option.config))
|
||||
|
||||
uni.$on('operate', (data) => {
|
||||
this.btnLoading = true
|
||||
this[data.eventType + 'Handle'](data)
|
||||
@@ -450,7 +455,7 @@
|
||||
})
|
||||
})
|
||||
},
|
||||
init() {
|
||||
async init() {
|
||||
this.processId = this.config.id
|
||||
if (this.config.id) {
|
||||
let extra = {
|
||||
@@ -464,6 +469,10 @@
|
||||
}
|
||||
uni.setStorageSync('dynamicModelExtra', extra)
|
||||
}
|
||||
// 先获取id
|
||||
const res = await getProcessBusinessInfo(this.config.processInstance.id)
|
||||
console.log(res,'res----------')
|
||||
this.processBusinessInfo = res.data || {}
|
||||
/**
|
||||
* opType
|
||||
* -1 - 我发起的新建/编辑
|
||||
@@ -484,100 +493,110 @@
|
||||
};
|
||||
if (config.isFlow) query.isFlow = config.isFlow
|
||||
if (config.opType != "-1" && config.opType != '0') query.operatorId = config.operatorId;
|
||||
FlowTask(config?.taskId || config?.id || 0, query).then((res) => {
|
||||
this.flowInfo = res.data.flowInfo || {};
|
||||
this.properties = res.data.nodeProperties || {};
|
||||
this.auxiliaryInfo = this.properties.auxiliaryInfo
|
||||
this.$nextTick(() => {
|
||||
this.initApprovalField()
|
||||
})
|
||||
this.formInfo = res.data.formInfo || {};
|
||||
this.taskInfo = res.data.taskInfo || {};
|
||||
this.btnInfo = res.data.btnInfo || [];
|
||||
this.progressList = res.data.progressList || [];
|
||||
config.formOperates = res.data.formOperates || [];
|
||||
config.formType = this.formInfo.type
|
||||
const fullName =
|
||||
config.opType == "-1" ?
|
||||
this.flowInfo.fullName :
|
||||
this.taskInfo.fullName;
|
||||
config.fullName = fullName;
|
||||
this.title = this.flowInfo.fullName;
|
||||
this.thisStep = this.taskInfo.thisStep || "";
|
||||
if (config.status !== 0 && config.status !== 3) {
|
||||
this.title = this.thisStep ?
|
||||
config.fullName + "/" + this.thisStep :
|
||||
config.fullName;
|
||||
getDesForm(this.processBusinessInfo.dbformId).then((res) => {
|
||||
// this.flowInfo = res.data.flowInfo || {};
|
||||
// this.properties = res.data.nodeProperties || {};
|
||||
// this.auxiliaryInfo = this.properties.auxiliaryInfo
|
||||
// this.$nextTick(() => {
|
||||
// this.initApprovalField()
|
||||
// })
|
||||
const data = res.data ? JSON.parse(res.data) : {};
|
||||
console.log(data,'data---11')
|
||||
// this.formConf = JSON.parse(data.formData)
|
||||
this.config = {
|
||||
...data,
|
||||
formConf: data.formData
|
||||
}
|
||||
config.type = this.flowInfo.type;
|
||||
config.draftData = res.data.draftData || null;
|
||||
config.formData = res.data.formData || {};
|
||||
let dataId = config.formData.id
|
||||
config.formEnCode = this.formInfo.enCode;
|
||||
this.nodeList = res.data.nodeList || [];
|
||||
this.recordList = (res.data.recordList || []).reverse();
|
||||
config.formConf = this.formInfo.formData;
|
||||
if (config.formConf) {
|
||||
this.dataLog = JSON.parse(config.formConf).dataLog
|
||||
if (this.dataLog) this.getOnlineLog(dataId)
|
||||
}
|
||||
this.hasComment = this.flowInfo.flowNodes.global.hasComment;
|
||||
console.log(this.config,'config--')
|
||||
// this.$refs.child.$refs.form.init(this.formConf)
|
||||
// console.log(JSON.parse(data.formData),'判断---')
|
||||
// this.formInfo = res.data.formInfo || {};
|
||||
// this.taskInfo = res.data.taskInfo || {};
|
||||
// this.btnInfo = res.data.btnInfo || [];
|
||||
// this.progressList = res.data.progressList || [];
|
||||
// config.formOperates = res.data.formOperates || [];
|
||||
// config.formType = this.formInfo.type
|
||||
// const fullName =
|
||||
// config.opType == "-1" ?
|
||||
// this.flowInfo.fullName :
|
||||
// this.taskInfo.fullName;
|
||||
// config.fullName = fullName;
|
||||
// // this.title = this.flowInfo.fullName;
|
||||
// this.thisStep = this.taskInfo.thisStep || "";
|
||||
// if (config.status !== 0 && config.status !== 3) {
|
||||
// this.title = this.thisStep ?
|
||||
// config.fullName + "/" + this.thisStep :
|
||||
// config.fullName;
|
||||
// }
|
||||
// config.type = this.flowInfo.type;
|
||||
// config.draftData = res.data.draftData || null;
|
||||
// config.formData = res.data.formData || {};
|
||||
// let dataId = config.formData.id
|
||||
// config.formEnCode = this.formInfo.enCode;
|
||||
// this.nodeList = res.data.nodeList || [];
|
||||
// this.recordList = (res.data.recordList || []).reverse();
|
||||
// config.formConf = this.formInfo.formData;
|
||||
// if (config.formConf) {
|
||||
// this.dataLog = JSON.parse(config.formConf).dataLog
|
||||
// if (this.dataLog) this.getOnlineLog(dataId)
|
||||
// }
|
||||
// this.hasComment = this.flowInfo.flowNodes.global.hasComment;
|
||||
this.loading = false;
|
||||
this.formLoding = true;
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.config.formEnCode === "revoke" ? `${this.flowInfo.fullName}撤销申请` : this
|
||||
.flowInfo.fullName,
|
||||
});
|
||||
if (config.formRecords && config.title) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: config.title,
|
||||
});
|
||||
}
|
||||
this.flowUrgent = this.taskInfo.flowUrgent || 1;
|
||||
const getSelectInfo = () => {
|
||||
var obj = {
|
||||
value: this.flowUrgent,
|
||||
extra: "0",
|
||||
label: "普通",
|
||||
};
|
||||
this.flowUrgentList.forEach((e, i) => {
|
||||
if (e.value == this.flowUrgent) {
|
||||
obj.extra = i;
|
||||
obj.label = e.label;
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
this.selectflowUrgent = getSelectInfo();
|
||||
this.initRightBtnList();
|
||||
if (config.opType != "-1" && config.opType != "3") config.readonly =
|
||||
true;
|
||||
config.formOperates = [];
|
||||
if (config.opType == 0) {
|
||||
if (this.properties && this.properties && this.properties.formOperates) config
|
||||
.formOperates = this.properties.formOperates || [];
|
||||
} else {
|
||||
config.formOperates = res.data.formOperates || [];
|
||||
}
|
||||
this.getFlowStatus()
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
if (!this.$refs.child || !this.$refs.child.$refs.form) {
|
||||
uni.showToast({
|
||||
title: "暂无此流程表单",
|
||||
icon: "none",
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
uni.navigateBack();
|
||||
}, 1500);
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$refs.child.$refs.form.init(config)
|
||||
});
|
||||
}, 100);
|
||||
this.config = config;
|
||||
// this.formLoding = true;
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: this.config.formEnCode === "revoke" ? `${this.flowInfo.fullName}撤销申请` : this
|
||||
// .flowInfo.fullName,
|
||||
// });
|
||||
// if (config.formRecords && config.title) {
|
||||
// uni.setNavigationBarTitle({
|
||||
// title: config.title,
|
||||
// });
|
||||
// }
|
||||
// this.flowUrgent = this.taskInfo.flowUrgent || 1;
|
||||
// const getSelectInfo = () => {
|
||||
// var obj = {
|
||||
// value: this.flowUrgent,
|
||||
// extra: "0",
|
||||
// label: "普通",
|
||||
// };
|
||||
// this.flowUrgentList.forEach((e, i) => {
|
||||
// if (e.value == this.flowUrgent) {
|
||||
// obj.extra = i;
|
||||
// obj.label = e.label;
|
||||
// }
|
||||
// });
|
||||
// return obj;
|
||||
// };
|
||||
// this.selectflowUrgent = getSelectInfo();
|
||||
// this.initRightBtnList();
|
||||
// if (config.opType != "-1" && config.opType != "3") config.readonly =
|
||||
// true;
|
||||
// config.formOperates = [];
|
||||
// if (config.opType == 0) {
|
||||
// if (this.properties && this.properties && this.properties.formOperates) config
|
||||
// .formOperates = this.properties.formOperates || [];
|
||||
// } else {
|
||||
// config.formOperates = res.data.formOperates || [];
|
||||
// }
|
||||
// this.getFlowStatus()
|
||||
// setTimeout(() => {
|
||||
// this.$nextTick(() => {
|
||||
// if (!this.$refs.child || !this.$refs.child.$refs.form) {
|
||||
// uni.showToast({
|
||||
// title: "暂无此流程表单",
|
||||
// icon: "none",
|
||||
// complete: () => {
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack();
|
||||
// }, 1500);
|
||||
// },
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
// this.$refs.child.$refs.form.init(config)
|
||||
// });
|
||||
// }, 100);
|
||||
// this.config = config;
|
||||
});
|
||||
},
|
||||
//获取修改记录
|
||||
|
||||
Reference in New Issue
Block a user