|
|
@@ -482,18 +482,16 @@ export default {
|
|
|
handleActionEvent(key) {
|
|
|
switch (key) {
|
|
|
case 'save':
|
|
|
- //this.handleSave(this.form);
|
|
|
- this.saveExperimentalData(this.form.id,this.form.shiFouGuoShen)
|
|
|
+ this.handleSaveDraft(this.form);
|
|
|
+ //this.saveExperimentalData(this.form.id,this.form.shiFouGuoShen)
|
|
|
break;
|
|
|
case 'submit':
|
|
|
- this.handleAgree(this.params.taskId,this.form);
|
|
|
- /*
|
|
|
- if (this.getSubmitLabel() === '同意') {
|
|
|
+ //this.handleAgree(this.params.taskId,this.form);
|
|
|
+ if (this.getSubmitLabel() === '同意' || this.form.shiFouGuoShen === '已退回' ) {
|
|
|
this.handleAgree(this.params.taskId, this.form )
|
|
|
} else {
|
|
|
this.handleStartFlow(this.form);
|
|
|
}
|
|
|
- break;*/
|
|
|
break;
|
|
|
case 'approvalHistory':
|
|
|
this.handleapprovalHistory(this.params.taskId, this.form);
|
|
|
@@ -539,6 +537,22 @@ export default {
|
|
|
this.$message.error('保存失败');
|
|
|
});
|
|
|
},*/
|
|
|
+ async handleSaveDraft(data) {
|
|
|
+ data.pk = data.id;
|
|
|
+ const instid = await this.fetchInstanceId(data.id);
|
|
|
+ saveDraft({
|
|
|
+ defId: '1430598730687447040',
|
|
|
+ version: '0',
|
|
|
+ data: JSON.stringify(data),
|
|
|
+ proInstId: instid || ''
|
|
|
+ }).then((res) => {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ const id = res.variables.bizKey || '';
|
|
|
+ this.saveExperimentalData(id,'已暂存')
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.error('保存失败');
|
|
|
+ });
|
|
|
+ },
|
|
|
validateFormData() {
|
|
|
return new Promise((resolve, reject) => {
|
|
|
this.$refs.form.validate((valid) => {
|
|
|
@@ -557,7 +571,6 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
- /*
|
|
|
handleStartFlow(data) {
|
|
|
this.validateFormData()
|
|
|
.then(async () => {
|
|
|
@@ -573,12 +586,15 @@ export default {
|
|
|
this.$message.success('提交成功');
|
|
|
this.visible = false;
|
|
|
const id = res.variables.bizKey || '';
|
|
|
- return this.saveExperimentalData(id,'已编制')
|
|
|
+ return this.saveExperimentalData(id,'已编制').then(() => {
|
|
|
+ this.closeDialog();
|
|
|
+
|
|
|
+ })
|
|
|
})
|
|
|
.catch((error) => {
|
|
|
- this.$message.error('启动失败');
|
|
|
+ this.$message.error('提交失败');
|
|
|
});
|
|
|
- },*/
|
|
|
+ },
|
|
|
handleAgree(taskId,data) {
|
|
|
if(data.shiFouGuoShen === '已编制'){
|
|
|
data.shiFouGuoShen = '已审核'
|
|
|
@@ -801,6 +817,7 @@ export default {
|
|
|
this.dialogVisible = false
|
|
|
this.$emit('close', false)
|
|
|
this.$emit('refresh');
|
|
|
+ this.$emit('search');
|
|
|
},
|
|
|
handleUpdateParams(value) {
|
|
|
this.form.shiYanCanShu = value
|