hookehuyr

fix 新增流程逻辑优化

...@@ -780,9 +780,6 @@ export default { ...@@ -780,9 +780,6 @@ export default {
780 updateUrl(id); // 更新URL 780 updateUrl(id); // 更新URL
781 getFlowData(id); // 更新流程图数据 781 getFlowData(id); // 更新流程图数据
782 state.flow_version = code; 782 state.flow_version = code;
783 - state.versionForm.id = id;
784 - state.versionForm.code = code;
785 - state.versionForm.note = note;
786 } 783 }
787 const showEditFlowVersion = (id: number, code: number, note: string) => { 784 const showEditFlowVersion = (id: number, code: number, note: string) => {
788 // 切换版本信息 785 // 切换版本信息
...@@ -810,7 +807,30 @@ export default { ...@@ -810,7 +807,30 @@ export default {
810 type: 'success', 807 type: 'success',
811 message: '新增成功', 808 message: '新增成功',
812 }); 809 });
813 - getVersionList(); // 刷新版本列表 810 + axios.get('/admin/?a=flow_version&form_id=' + form_id)
811 + .then(res => {
812 + if (res.data.code) {
813 + // 版本列表
814 + state.version_list = res.data.data;
815 + state.version_list.forEach((ele) => {
816 + if (ele.id === flow_id) {
817 + // 选中新增的版本
818 + state.flow_version = ele.code;
819 + }
820 + if (ele.status === '1') {
821 + state.current_version_code = ele.code;
822 + }
823 + });
824 + } else {
825 + ElMessage({
826 + type: 'error',
827 + message: res.data.msg,
828 + });
829 + }
830 + })
831 + .catch(err => {
832 + console.error(err);
833 + });
814 } 834 }
815 }) 835 })
816 .catch(err => { 836 .catch(err => {
......