|
|
|
|
@ -46,38 +46,31 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="form-container" id="print-content">
|
|
|
|
|
<template v-if="device === 'desktop'">
|
|
|
|
|
<DesktopForm
|
|
|
|
|
:device="device"
|
|
|
|
|
ref="desktopForm"
|
|
|
|
|
:config="config"
|
|
|
|
|
:is-first-node="isFirstNode"
|
|
|
|
|
:sub-form="subConfig"
|
|
|
|
|
:fields="fields"
|
|
|
|
|
:original-form="form"
|
|
|
|
|
:readable="readableFields"
|
|
|
|
|
:writeable="writeableFields"
|
|
|
|
|
:rules="{}"
|
|
|
|
|
:sub-rules="{}"
|
|
|
|
|
:logs="config.logs"
|
|
|
|
|
></DesktopForm>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<MobileForm
|
|
|
|
|
:device="device"
|
|
|
|
|
ref="mobileForm"
|
|
|
|
|
:config="config"
|
|
|
|
|
:is-first-node="isFirstNode"
|
|
|
|
|
:sub-form="subConfig"
|
|
|
|
|
:fields="fields"
|
|
|
|
|
:original-form="form"
|
|
|
|
|
:readable="readableFields"
|
|
|
|
|
:writeable="writeableFields"
|
|
|
|
|
:rules="{}"
|
|
|
|
|
:sub-rules="{}"
|
|
|
|
|
:logs="config.logs"
|
|
|
|
|
></MobileForm>
|
|
|
|
|
</template>
|
|
|
|
|
<el-form :model="flowLinkForm" label-position="right" label-width="130px">
|
|
|
|
|
<el-form-item label="out_pay_id">
|
|
|
|
|
<el-input v-model="flowLinkForm.out_pay_id"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="out_away_id">
|
|
|
|
|
<el-input v-model="flowLinkForm.out_away_id"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="out_contract_id">
|
|
|
|
|
<el-input v-model="flowLinkForm.out_contract_id"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<DesktopForm
|
|
|
|
|
:device="device"
|
|
|
|
|
ref="desktopForm"
|
|
|
|
|
:config="config"
|
|
|
|
|
:is-first-node="isFirstNode"
|
|
|
|
|
:sub-form="subConfig"
|
|
|
|
|
:fields="fields"
|
|
|
|
|
:original-form="form"
|
|
|
|
|
:readable="readableFields"
|
|
|
|
|
:writeable="writeableFields"
|
|
|
|
|
:rules="{}"
|
|
|
|
|
:sub-rules="{}"
|
|
|
|
|
:logs="config.logs"
|
|
|
|
|
></DesktopForm>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
@ -243,6 +236,11 @@ export default {
|
|
|
|
|
[0, ""],
|
|
|
|
|
[1, "success"],
|
|
|
|
|
]),
|
|
|
|
|
flowLinkForm: {
|
|
|
|
|
out_pay_id: '',
|
|
|
|
|
out_away_id: '',
|
|
|
|
|
out_contract_id: ''
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
form: {},
|
|
|
|
|
result: {},
|
|
|
|
|
@ -503,6 +501,10 @@ export default {
|
|
|
|
|
this.generateForm(this.form, fields);
|
|
|
|
|
this.form = Object.assign({}, this.form);
|
|
|
|
|
const { data } = res?.flow;
|
|
|
|
|
this.flowLinkForm.out_contract_id = res?.flow?.out_contract_id;
|
|
|
|
|
this.flowLinkForm.out_away_id = res?.flow?.out_away_id;
|
|
|
|
|
this.flowLinkForm.out_pay_id = res?.flow?.out_pay_id;
|
|
|
|
|
|
|
|
|
|
for (let key in data) {
|
|
|
|
|
try {
|
|
|
|
|
let jsonObj = JSON.parse(data[key]);
|
|
|
|
|
@ -557,25 +559,14 @@ export default {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
let copyForm;
|
|
|
|
|
if (this.device === "desktop") {
|
|
|
|
|
try {
|
|
|
|
|
await this.$refs['desktopForm'].validate()
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.warn(err)
|
|
|
|
|
this.$message.warning('数据校验失败')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
copyForm = deepCopy(this.$refs["desktopForm"].form);
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
|
await this.$refs['mobileForm'].validate()
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.warn(err)
|
|
|
|
|
this.$message.warning('数据校验失败')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
copyForm = deepCopy(this.$refs["mobileForm"].form);
|
|
|
|
|
try {
|
|
|
|
|
await this.$refs['desktopForm'].validate()
|
|
|
|
|
} catch (err) {
|
|
|
|
|
console.warn(err)
|
|
|
|
|
this.$message.warning('数据校验失败')
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
copyForm = deepCopy(this.$refs["desktopForm"].form);
|
|
|
|
|
const uploadHandler = (form) => {
|
|
|
|
|
let keys = Object.keys(form)
|
|
|
|
|
keys.forEach(key => {
|
|
|
|
|
@ -610,7 +601,7 @@ export default {
|
|
|
|
|
copyForm.id = this.$route.query.flow_id;
|
|
|
|
|
const { flow, is_last_handled_log } = await save(
|
|
|
|
|
this.$route.query.flow_id,
|
|
|
|
|
copyForm
|
|
|
|
|
Object.assign(copyForm, this.flowLinkForm)
|
|
|
|
|
);
|
|
|
|
|
this.result = flow;
|
|
|
|
|
this.$message.success("操作成功")
|
|
|
|
|
@ -684,7 +675,7 @@ export default {
|
|
|
|
|
];
|
|
|
|
|
},
|
|
|
|
|
isFirstNode() {
|
|
|
|
|
return this.config?.logs?.length === 0 || this.config?.currentNode?.category === 'start'
|
|
|
|
|
return this.config?.logs?.length === 0 || this.config?.currentNode?.category === 'start' || this.$route.path === '/flow/edit'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
|