diff --git a/pages/apply/dynamicModelList/components/list/index.vue b/pages/apply/dynamicModelList/components/list/index.vue index d2879ee..fdcc2ef 100644 --- a/pages/apply/dynamicModelList/components/list/index.vue +++ b/pages/apply/dynamicModelList/components/list/index.vue @@ -928,7 +928,7 @@ index: item.index, enableEdit, labelS, - name: this.config.name, + name: this.config.tableTitle, billNoPrefix: this.config.billNoPrefix } console.log(config,'config12233') diff --git a/pages/apply/dynamicModelList/form.vue b/pages/apply/dynamicModelList/form.vue index 1ff9cb1..5f787a0 100644 --- a/pages/apply/dynamicModelList/form.vue +++ b/pages/apply/dynamicModelList/form.vue @@ -56,7 +56,7 @@ - + 发起流程 @@ -66,6 +66,9 @@ 查看流程 + + 取消 + 不通过 @@ -197,7 +200,10 @@ - 审批意见 + + 审批意见 + * + --> - 指定用户 + + 指定用户 + * + + + + + + 取消流程 + + + + + + 取消原因 + + + + + 取消 + 确定 + + + @@ -362,7 +397,11 @@ processInstanceName: '', options: {}, reason: '' - } + }, + // 取消 + showCacleDialog: false, + cacleReason: '', + cacleSubmitting: false, } }, computed: { @@ -386,6 +425,17 @@ isApproval(){ const {current} = this.config return !!current || this.isProcess + }, + // 是否显示底部按钮 + isShowBtn(){ + const {approveStatus,id} = this.dataForm + const {config,isProcess} = this + if(!isProcess) return true + console.log(approveStatus,'approveStatus--') + console.log(config.current,'config.current--') + if(approveStatus == 3 &&config.current ==3 ) return false + if(approveStatus !== 4 || !id || config.current && config.current == 2 ) return true + return false } }, onLoad(option) { @@ -496,6 +546,9 @@ case 'fail': name = '审批不通过成功' break; + case 'cancel': + name = '取消成功' + break; } uni.showToast({ @@ -589,7 +642,7 @@ if (res.code === 0 || res.code === 200) { this.processList = res.data || [] if(this.processList.length === 1){ - this.selectProcess(res.data[0]) + this.selectProcess(res.data[0].id) } if (this.processList.length === 0) { uni.showToast({ @@ -621,6 +674,15 @@ }, // 抄送-提交 submitCopyRule(){ + const {options,reason} = this.copyForm + if(!options.length || !reason){ + const name = !options.length ? '指定用户不能为空' : '抄送原因不能为空' + uni.showToast({ + title: name, + icon: 'none' + }) + return + } const {id,processInstance} = this.approvalData[0] const params = { processType: '4', @@ -758,6 +820,47 @@ this.approvalReason = '' // 清空之前的意见 this.showApprovalReasonDialog = true }, + // 取消 + handleCancle() { + this.approvalType = 'cancel' + this.cacleReason = '' + this.showCacleDialog = true + }, + // 取消弹框确认 + submitCancel() { + if(!this.cacleReason){ + uni.showToast({ + title: '请输入取消原因', + icon: 'none' + }) + return + } + try { + this.cacleSubmitting = true + //参数 + const params = { + processType: 5, + processInstanceId: this.formData.processInstanceId, // 流程实例ID + id: this.formData.id, + data: { + dbFormId : this.modelId, + id: this.approvalData && this.approvalData[0].id, // 审批记录第一条id + reason: this.cacleReason || '', + } + } + //调用 + this.getListCreateData(params) + + } catch (err) { + console.error('取消失败:', err) + uni.showToast({ + title: '取消失败,请重试', + icon: 'none' + }) + } finally { + this.cacleSubmitting = false + } + }, // 查看流程 goProcess(){ this.isProcess = true @@ -769,6 +872,13 @@ // 提交审批结果(通过/不通过) async submitApprovalResult() { + if(!this.approvalReason){ + uni.showToast({ + title: '请填写审批意见', + icon: 'none' + }) + return + } try { this.approvalSubmitting = true // 构造审批参数( diff --git a/pages/apply/dynamicModelList/index.vue b/pages/apply/dynamicModelList/index.vue index 89b3735..28da4d8 100644 --- a/pages/apply/dynamicModelList/index.vue +++ b/pages/apply/dynamicModelList/index.vue @@ -46,7 +46,7 @@ import { computed } from "vue"; this.config = JSON.parse(this.jnpf.base64.decode(obj.config)) || {}; this.isPreview = this.config.isPreview || false; this.enableFlow = this.config.type === 9 ? 1 : 0; - this.title = this.config.name || ""; + this.title = this.config.tableTitle || ""; this.modelId = this.config.id || ""; uni.setNavigationBarTitle({ title: this.title, diff --git a/pages/index/indexWork.vue b/pages/index/indexWork.vue index 5f4cde4..a817de6 100644 --- a/pages/index/indexWork.vue +++ b/pages/index/indexWork.vue @@ -430,7 +430,7 @@ }, // 跳转待办 openToDoPage() { - uni.setStorageSync('fromNonTabBar', true); + uni.setStorageSync('fromNonTabBar', 1); uni.switchTab({ url: '/pages/workFlow/flowTodo/index', }); diff --git a/pages/workFlow/flowTodo/index.vue b/pages/workFlow/flowTodo/index.vue index 4f9f829..4dc2829 100644 --- a/pages/workFlow/flowTodo/index.vue +++ b/pages/workFlow/flowTodo/index.vue @@ -65,14 +65,23 @@ }, } }, + watch:{ + current:{ + handler(val){ + uni.setStorageSync('fromNonTabBar', val); + }, + immediate: true + } + }, onShow() { const fromNonTabBar = uni.getStorageSync('fromNonTabBar'); console.log(fromNonTabBar,'fromNonTabBar---') - if(!fromNonTabBar){ - this.current = 1 - }else { - this.current = 0 - } + this.current = fromNonTabBar && Number(fromNonTabBar) + // if(!fromNonTabBar){ + // this.current = 1 + // }else { + // this.current = 0 + // } uni.removeStorageSync('fromNonTabBar'); uni.$off('operate') uni.$on('refresh', () => {