|
|
|
|
@ -53,6 +53,9 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
// 模拟发起流程后存入业务表 |
|
|
|
|
// import { submit } from '@/api/plugin/workflow/demo/leave.js' |
|
|
|
|
|
|
|
|
|
import WfExamineForm from '@/views/plugin/workflow/process/components/examForm.vue' |
|
|
|
|
import WfUserSelect from '@/views/plugin/workflow/process/components/user-select' |
|
|
|
|
|
|
|
|
|
@ -69,8 +72,8 @@ export default { |
|
|
|
|
handler(val) { |
|
|
|
|
if (val) { |
|
|
|
|
const param = JSON.parse(Buffer.from(val, 'base64').toString()) |
|
|
|
|
const { processId } = param |
|
|
|
|
if (processId) this.getForm(processId) |
|
|
|
|
const { processId, processDefKey } = param |
|
|
|
|
if (processId || processDefKey) this.getForm(processId, processDefKey) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
immediate: true |
|
|
|
|
@ -103,7 +106,7 @@ export default { |
|
|
|
|
label: '创建部门', |
|
|
|
|
span: 12, |
|
|
|
|
display: true, |
|
|
|
|
prop: 'createDept', |
|
|
|
|
prop: 'creatorDept', |
|
|
|
|
value: '${this.$store.getters.userInfo.dept_name}', |
|
|
|
|
readonly: true |
|
|
|
|
}, |
|
|
|
|
@ -115,6 +118,7 @@ export default { |
|
|
|
|
format: 'yyyy-MM-dd HH:mm:ss', |
|
|
|
|
valueFormat: 'yyyy-MM-dd HH:mm:ss', |
|
|
|
|
prop: 'datetime', |
|
|
|
|
dataType: 'string', |
|
|
|
|
required: true, |
|
|
|
|
rules: [ |
|
|
|
|
{ |
|
|
|
|
@ -126,8 +130,8 @@ export default { |
|
|
|
|
if (!value || value.length == 0) { |
|
|
|
|
this.$set(this.form, 'days', undefined) |
|
|
|
|
} else { |
|
|
|
|
const d1 = Date.parse(value[0]) |
|
|
|
|
const d2 = Date.parse(value[1]) |
|
|
|
|
const d1 = Date.parse(value.split(',')[0]) |
|
|
|
|
const d2 = Date.parse(value.split(',')[1]) |
|
|
|
|
const day = (d2 - d1) / (1 * 24 * 60 * 60 * 1000) |
|
|
|
|
this.$set(this.form, 'days', Number(day.toFixed(2))) |
|
|
|
|
} |
|
|
|
|
@ -149,7 +153,8 @@ export default { |
|
|
|
|
controls: true, |
|
|
|
|
controlsPosition: 'right', |
|
|
|
|
change: ({ value }) => { |
|
|
|
|
this.$set(this.form, 'reason', '请假' + value + '天') |
|
|
|
|
if (value) this.$set(this.form, 'reason', '请假' + value + '天') |
|
|
|
|
else this.$set(this.form, 'reason', '') |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
@ -180,7 +185,8 @@ export default { |
|
|
|
|
showFileList: true, |
|
|
|
|
multiple: true, |
|
|
|
|
limit: 10, |
|
|
|
|
prop: 'attachment' |
|
|
|
|
prop: 'attachment', |
|
|
|
|
dataType: 'string' |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
@ -189,8 +195,17 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
getForm(processId) { |
|
|
|
|
this.getStartForm(processId).then(res => { |
|
|
|
|
getForm(processId, processDefKey) { |
|
|
|
|
let param |
|
|
|
|
let method |
|
|
|
|
if (processId) { |
|
|
|
|
param = processId |
|
|
|
|
method = 'getStartForm' |
|
|
|
|
} else if (processDefKey) { |
|
|
|
|
param = processDefKey |
|
|
|
|
method = 'getStartFormByProcessDefKey' |
|
|
|
|
} |
|
|
|
|
this[method](param).then(res => { |
|
|
|
|
let { process, startForm } = res |
|
|
|
|
this.form.processId = process.id |
|
|
|
|
const option = this.option |
|
|
|
|
@ -230,6 +245,30 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// 模拟发起流程后存入业务表 |
|
|
|
|
// let form = this.deepClone(this.form) |
|
|
|
|
// form = { |
|
|
|
|
// ...form, |
|
|
|
|
// processDefId: form.processId, |
|
|
|
|
// exFormKey: this.process.formKey, |
|
|
|
|
// exFormUrl: this.process.formUrl, |
|
|
|
|
// } |
|
|
|
|
// submit(form).then(res => { |
|
|
|
|
// const data = res.data.data |
|
|
|
|
// this.form.processDefKey = this.process.key |
|
|
|
|
// this.form.businessKey = data.id |
|
|
|
|
// this.handleStartProcessByKey(true).then((res, done) => { |
|
|
|
|
// const processInsId = res.data.data |
|
|
|
|
// submit({ id: data.id, processInsId }).then(() => { |
|
|
|
|
// this.$message.success("发起成功") |
|
|
|
|
// this.handleCloseTag('/plugin/workflow/process/send') |
|
|
|
|
// done() |
|
|
|
|
// }) |
|
|
|
|
// }).catch(() => { |
|
|
|
|
// this.loading = false |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|