@@ -1308,6 +1308,12 @@ | |||||
"style": { | "style": { | ||||
"navigationBarTitleText": "部门周计划" | "navigationBarTitleText": "部门周计划" | ||||
} | } | ||||
}, | |||||
{ | |||||
"path": "pages/EducationalAdministration/departmentWeek/singleFlow", | |||||
"style": { | |||||
"navigationBarTitleText": "部门周计划" | |||||
} | |||||
} | } | ||||
], | ], | ||||
@@ -291,8 +291,10 @@ export default { | |||||
if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) { | if (!(await this.CONFIRM('提交项目', '是否确认提交该项?', true))) { | ||||
return | return | ||||
} | } | ||||
this.LOADING('正在提交...') | |||||
this.HTTP_POST('learun/departmentWeek/changeStatusById', id, '提交失败').then( | this.HTTP_POST('learun/departmentWeek/changeStatusById', id, '提交失败').then( | ||||
success => { | success => { | ||||
this.HIDE_LOADING() | |||||
if (!success) { | if (!success) { | ||||
return | return | ||||
} | } | ||||
@@ -304,8 +306,10 @@ export default { | |||||
if (!(await this.CONFIRM('提交项目', '是否确认发布已审核通过的项目?', true))) { | if (!(await this.CONFIRM('提交项目', '是否确认发布已审核通过的项目?', true))) { | ||||
return | return | ||||
} | } | ||||
this.LOADING('正在发布...') | |||||
this.HTTP_POST('learun/departmentWeek/pushForm', id, '发布失败').then( | this.HTTP_POST('learun/departmentWeek/pushForm', id, '发布失败').then( | ||||
success => { | success => { | ||||
this.HIDE_LOADING() | |||||
if (!success) { | if (!success) { | ||||
return | return | ||||
} | } | ||||
@@ -318,9 +322,10 @@ export default { | |||||
if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) { | if (!(await this.CONFIRM('删除项目', '确定要删除该项吗?', true))) { | ||||
return | return | ||||
} | } | ||||
this.LOADING('正在删除...') | |||||
this.HTTP_POST('learun/departmentWeek/deleteForm', id, '删除失败').then( | this.HTTP_POST('learun/departmentWeek/deleteForm', id, '删除失败').then( | ||||
success => { | success => { | ||||
this.HIDE_LOADING() | |||||
if (!success) { | if (!success) { | ||||
return | return | ||||
} | } | ||||
@@ -16,19 +16,19 @@ | |||||
<view class="tableTitle"> | <view class="tableTitle"> | ||||
一、常规工作安排 | 一、常规工作安排 | ||||
</view> | </view> | ||||
<l-customform-table @input="setValue('DepartmentWeek.Firset',$event)" :value="getValue('DepartmentWeek.Firset')" | |||||
:item="scheme.DepartmentWeek.Firset" :edit="edit" /> | |||||
<view class="hasNotData" v-if="!current.DepartmentWeek.Firset.length"> | <view class="hasNotData" v-if="!current.DepartmentWeek.Firset.length"> | ||||
暂无数据 | 暂无数据 | ||||
</view> | </view> | ||||
<l-customform-table @input="setValue('DepartmentWeek.Firset',$event)" :value="getValue('DepartmentWeek.Firset')" | |||||
:item="scheme.DepartmentWeek.Firset" :edit="edit" /> | |||||
<view class="tableTitle"> | <view class="tableTitle"> | ||||
二、特色、创新(小微改革)工作安排 | 二、特色、创新(小微改革)工作安排 | ||||
</view> | </view> | ||||
<l-customform-table @input="setValue('DepartmentWeek.Second',$event)" :value="getValue('DepartmentWeek.Second')" | |||||
:item="scheme.DepartmentWeek.Second" :edit="edit" /> | |||||
<view class="hasNotData" v-if="!current.DepartmentWeek.Second.length"> | <view class="hasNotData" v-if="!current.DepartmentWeek.Second.length"> | ||||
暂无数据 | 暂无数据 | ||||
</view> | </view> | ||||
<l-customform-table @input="setValue('DepartmentWeek.Second',$event)" :value="getValue('DepartmentWeek.Second')" | |||||
:item="scheme.DepartmentWeek.Second" :edit="edit" /> | |||||
<!-- <l-textarea @input="setValue('DepartmentWeek.Remark', $event)" :value="getValue('DepartmentWeek.Remark')" | <!-- <l-textarea @input="setValue('DepartmentWeek.Remark', $event)" :value="getValue('DepartmentWeek.Remark')" | ||||
:readonly="!edit" title="备注" /> --> | :readonly="!edit" title="备注" /> --> | ||||
<!-- <l-upload-file @input="setValue('DepartmentWeek.FilePath', $event)" | <!-- <l-upload-file @input="setValue('DepartmentWeek.FilePath', $event)" | ||||
@@ -37,8 +37,11 @@ | |||||
</view> | </view> | ||||
<view v-if="ready && edit && current.DepartmentWeek" class="bg-white margin-tb padding" | <view v-if="ready && edit && current.DepartmentWeek" class="bg-white margin-tb padding" | ||||
style="padding-top: 0; overflow: hidden;"> | style="padding-top: 0; overflow: hidden;"> | ||||
<l-button v-if="edit" @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||||
提交保存 | |||||
<l-button @click="action('save')" size="lg" color="green" class="block margin-top" block> | |||||
保存草稿 | |||||
</l-button> | |||||
<l-button @click="action('save',true)" size="lg" color="orange" class="block margin-top" block> | |||||
保存并提交 | |||||
</l-button> | </l-button> | ||||
<!-- <l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block> | <!-- <l-button v-if="!edit && mode !== 'create'" @click="action('edit')" size="lg" line="orange" class="block margin-top" block> | ||||
编辑本页 | 编辑本页 | ||||
@@ -156,7 +159,7 @@ export default { | |||||
this.id = id | this.id = id | ||||
this.mode = type | this.mode = type | ||||
this.edit = ['create', 'edit'].includes(this.mode) | |||||
this.edit = ['create', 'edit', 'draft'].includes(this.mode) | |||||
// 拉取表单数据,同时拉取所有来自数据源的选单数据 | // 拉取表单数据,同时拉取所有来自数据源的选单数据 | ||||
await Promise.all([ | await Promise.all([ | ||||
@@ -169,6 +172,7 @@ export default { | |||||
// 加载表单数据 | // 加载表单数据 | ||||
async fetchForm() { | async fetchForm() { | ||||
const noticeItem = this.GET_PARAM() | |||||
if (this.mode === 'create') { | if (this.mode === 'create') { | ||||
this.origin = await this.getDefaultForm() | this.origin = await this.getDefaultForm() | ||||
let userInfo = this.GET_GLOBAL('loginUser'); | let userInfo = this.GET_GLOBAL('loginUser'); | ||||
@@ -179,13 +183,19 @@ export default { | |||||
this.origin.DepartmentWeek.Firset = [] | this.origin.DepartmentWeek.Firset = [] | ||||
this.origin.DepartmentWeek.Second = [] | this.origin.DepartmentWeek.Second = [] | ||||
} else { | } else { | ||||
const result = await this.HTTP_GET('learun/departmentWeek/getFormData', this.id) | |||||
let result = {} | |||||
if(this.mode == 'draft'){ | |||||
result = await this.HTTP_GET("learun/departmentWeek/getFormDataByProcessId",noticeItem.currentTask.F_Id,"加载数据时出错") | |||||
this.id = result.DepartmentWeek.ID | |||||
}else{ | |||||
result = await this.HTTP_GET('learun/departmentWeek/getFormData', this.id) | |||||
} | |||||
this.origin = await this.formatFormData({ DepartmentWeek: { ...result.DepartmentWeek, Firset: result.Firset || [], Second: result.Second || [] } }) | this.origin = await this.formatFormData({ DepartmentWeek: { ...result.DepartmentWeek, Firset: result.Firset || [], Second: result.Second || [] } }) | ||||
} | } | ||||
this.current = this.COPY(this.origin) | this.current = this.COPY(this.origin) | ||||
}, | }, | ||||
// 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | // 点击 「编辑」、「重置」、「保存」、「删除」 按钮 | ||||
async action(type) { | |||||
async action(type,isSubmit=false) { | |||||
switch (type) { | switch (type) { | ||||
case 'edit': | case 'edit': | ||||
this.edit = true | this.edit = true | ||||
@@ -205,7 +215,7 @@ export default { | |||||
if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | if (!(await this.CONFIRM('提交确认', '确定要提交本页表单内容吗?', true))) { | ||||
return | return | ||||
} | } | ||||
this.LOADING('正在提交...') | |||||
this.LOADING('正在提交保存...') | |||||
const postData = await this.getPostData(this.id) | const postData = await this.getPostData(this.id) | ||||
// 处理表格数据 | // 处理表格数据 | ||||
let strEntity = JSON.parse(postData.strEntity) | let strEntity = JSON.parse(postData.strEntity) | ||||
@@ -228,13 +238,33 @@ export default { | |||||
if (!success) { | if (!success) { | ||||
return | return | ||||
} | } | ||||
this.EMIT('list-change') | |||||
this.TOAST('提交保存成功') | |||||
setTimeout(() => { | |||||
this.NAV_BACK() | |||||
}, 600) | |||||
if(isSubmit){ | |||||
if(!this.id)this.id = success | |||||
this.action('submit') | |||||
}else{ | |||||
this.EMIT('task-list-change') | |||||
this.EMIT('list-change') | |||||
this.TOAST('提交保存成功') | |||||
setTimeout(() => { | |||||
this.NAV_BACK() | |||||
}, 600) | |||||
} | |||||
}) | }) | ||||
break | break | ||||
case 'submit': | |||||
this.LOADING('正在提交...') | |||||
this.HTTP_POST('learun/departmentWeek/changeStatusById', this.id, '提交失败').then( | |||||
success => { | |||||
this.HIDE_LOADING() | |||||
this.EMIT('task-list-change') | |||||
this.EMIT('list-change') | |||||
this.TOAST('提交成功') | |||||
setTimeout(() => { | |||||
this.NAV_BACK() | |||||
}, 600) | |||||
}) | |||||
return | |||||
case 'delete': | case 'delete': | ||||
if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | if (!(await this.CONFIRM('删除项目', '确定要删除本项吗?', true))) { | ||||
@@ -247,7 +277,6 @@ export default { | |||||
if (!success) { | if (!success) { | ||||
return | return | ||||
} | } | ||||
this.EMIT('list-change') | this.EMIT('list-change') | ||||
this.NAV_BACK() | this.NAV_BACK() | ||||
this.this.TOAST('删除成功', 'success') | this.this.TOAST('删除成功', 'success') | ||||
@@ -0,0 +1,279 @@ | |||||
<template> | |||||
<view id="notice" class="page"> | |||||
<!-- 顶部页签 --> | |||||
<l-nav v-model="tab" :items="['表单信息', '流程信息']" type="flex" class="solid-bottom" /> | |||||
<view v-if="ready && tab == 0"> | |||||
<l-select :value="formData.CreateUser" :range="dataSource.DepartmentWeek.CreateUser" title="发布人" | |||||
disabled /> | |||||
<l-select :value="formData.Department" :range="dataSource.DepartmentWeek.Department" title="部门" | |||||
disabled /> | |||||
<l-input disabled | |||||
:value="formData.Title" title="标题" /> | |||||
<l-select :value="formData.Week" | |||||
:range="dataSource.DepartmentWeek.Week" title="周别" disabled /> | |||||
<l-datetime-picker :value="formData.CreateTime" disabled title="发布时间" /> | |||||
<view class="tableTitle"> | |||||
一、常规工作安排 | |||||
</view> | |||||
<view class="hasNotData" v-if="!formData.Firset.length"> | |||||
暂无数据 | |||||
</view> | |||||
<l-customform-table :value="formData.Firset" | |||||
:item="Firset" :edit="false" /> | |||||
<view class="tableTitle"> | |||||
二、特色、创新(小微改革)工作安排 | |||||
</view> | |||||
<view class="hasNotData" v-if="!formData.Second.length"> | |||||
暂无数据 | |||||
</view> | |||||
<l-customform-table :value="formData.Second" | |||||
:item="Second" :edit="false" /> | |||||
<l-workflow-action | |||||
@audit="audit" | |||||
@action="action" | |||||
:type="type" | |||||
:currentNode="currentNode" | |||||
:currentTask="currentTask" | |||||
/> | |||||
</view> | |||||
<view v-if="ready && tab == 1" class="progress"><l-workflow-timeline :processList="processList" /></view> | |||||
<!-- <view class="padding-sm text-grey notice-info"> | |||||
<view class="text-right">本页内容发布于 {{ time }}</view> | |||||
<view class="text-right">{{ date }}</view> | |||||
</view> --> | |||||
</view> | |||||
</template> | |||||
<script> | |||||
import moment from 'moment' | |||||
import workflowFormMixins from '@/pages/nworkflow/workflow.js' | |||||
export default { | |||||
mixins: [workflowFormMixins], | |||||
data() { | |||||
return { | |||||
tab:0, | |||||
type:'view', | |||||
currentNode:null, | |||||
currentTask:null, | |||||
taskId:'', | |||||
processId:'', | |||||
processInfo:null, | |||||
processList:[], | |||||
formData:{}, | |||||
ready: false, | |||||
content: '', | |||||
time: '', | |||||
date: '', | |||||
fileList:[], | |||||
// 数据源 | |||||
Firset: { | |||||
type: 'girdtable', title: '常规工作安排', __defaultItem__: {}, fieldsData: [ | |||||
{ field: 'MainWork', type: 'input', name: '主要工作' }, | |||||
{ field: 'TimeLimitFinish', type: 'input', name: '完成时限' }, | |||||
{ field: 'PersonAndDepartment', type: 'input', name: '负责人及关联部门' }, | |||||
{ field: 'QuestSpecialProject', type: 'input', name: '对接专项任务' }, | |||||
{ field: 'Remark', type: 'input', name: '备注' }, | |||||
] | |||||
}, | |||||
Second: { | |||||
type: 'girdtable', title: '特色、创新(小微改革)工作安排', __defaultItem__: {}, fieldsData: [ | |||||
{ field: 'MainWork', type: 'input', name: '主要工作' }, | |||||
{ field: 'TimeLimitFinish', type: 'input', name: '完成时限' }, | |||||
{ field: 'PersonAndDepartment', type: 'input', name: '负责人及关联部门' }, | |||||
{ field: 'QuestSpecialProject', type: 'input', name: '对接专项任务' }, | |||||
{ field: 'Remark', type: 'input', name: '备注' }, | |||||
] | |||||
}, | |||||
// 数据源 | |||||
dataSource: { | |||||
DepartmentWeek: { | |||||
Department: Object.entries(this.GET_GLOBAL('department')).map(e => { | |||||
return { | |||||
value: e[0], | |||||
text: e[1].name | |||||
} | |||||
}), | |||||
CreateUser: Object.entries(this.GET_GLOBAL('user')).map(e => { | |||||
return { | |||||
value: e[0], | |||||
text: e[1].name | |||||
} | |||||
}), | |||||
Week: Object.values(this.GET_GLOBAL('dataDictionary').Week).map(t => ({ | |||||
value: t.value, | |||||
text: t.text | |||||
})), | |||||
}, | |||||
} | |||||
} | |||||
}, | |||||
async onLoad({type}) { | |||||
await this.init(type) | |||||
}, | |||||
methods: { | |||||
async init(type) { | |||||
if(type){this.type = type} | |||||
this.LOADING('加载中…') | |||||
const noticeItem = this.GET_PARAM() | |||||
this.processList = noticeItem.logList | |||||
this.currentNode = noticeItem.currentNode | |||||
this.currentTask = noticeItem.currentTask | |||||
this.processInfo = noticeItem.processInfo | |||||
this.taskId = this.currentTask.F_TaskId | |||||
this.processId = this.currentTask.F_Id | |||||
this.formValue = noticeItem.formValue | |||||
this.scheme = noticeItem.scheme | |||||
// 拉取表单数据,同时拉取所有来自数据源的选单数据 | |||||
await Promise.all([ | |||||
() => {} | |||||
]) | |||||
await this.getFormData(this.processList[0].F_ProcessId) | |||||
this.HIDE_LOADING(); | |||||
// this.content = this.CONVERT_HTML(noticeItem.f_content) | |||||
// this.time = moment(noticeItem.f_time).format('HH : mm') | |||||
// this.date = moment(noticeItem.f_time).format('YYYY年 M月 D日') | |||||
// this.SET_TITLE(noticeItem.f_title) | |||||
// this.HIDE_LOADING() | |||||
}, | |||||
// 获取表单数据 | |||||
getFormData(ProcessId){ | |||||
return this.HTTP_GET("learun/departmentWeek/getFormDataByProcessId",ProcessId,"加载数据时出错").then(async result=>{ | |||||
if(result){ | |||||
this.formData = { ...result.DepartmentWeek, Firset: result.Firset || [], Second: result.Second || [] } | |||||
this.ready = true | |||||
} | |||||
}) | |||||
}, | |||||
// 点击审批相关按钮 | |||||
async audit(action) { | |||||
this.LOADING('加载中…') | |||||
const currentTask = this.processInfo.task.find(t => t.F_NodeId === this.currentNode.id) | |||||
const postData = await this.getPostData(this.formValue, this.scheme) | |||||
const pageParam = { | |||||
type: 'sign', | |||||
processId: currentTask.F_ProcessId, | |||||
taskId: currentTask.F_Id, | |||||
formreq: postData.formreq, | |||||
taskName: this.currentTask.F_Title, | |||||
currentNode:this.currentNode, | |||||
code:this.code||'' | |||||
} | |||||
// 不是加签 | |||||
if (action.code !== '__sign__') { | |||||
Object.assign(pageParam, action) | |||||
pageParam.type = 'verify' | |||||
pageParam.auditors = JSON.stringify({}) | |||||
pageParam.isFromSignAudit = Number(this.currentTask.F_TaskType) === 3 | |||||
} | |||||
this.HIDE_LOADING() | |||||
this.NAV_TO('/pages/nworkflow/myflow/sign', pageParam, true) | |||||
}, | |||||
// 点击操作按钮(非审批类按钮) | |||||
async action(taskType) { | |||||
switch (taskType) { | |||||
// 点击「催办」/「撤销流程」/「标记已阅」按钮 | |||||
case 'urge': | |||||
case 'revoke': | |||||
case 'refer': | |||||
const actionText = { urge: '催办', revoke: '撤销', refer: '已阅' }[taskType] | |||||
const actionUrl = { urge: '/urge', revoke: '/revoke', refer: '/refer' }[taskType] | |||||
let actionData = this.processId | |||||
if (taskType === 'refer') { | |||||
actionData = { processId: this.processId, taskId: this.taskId } | |||||
} | |||||
if (!(await this.CONFIRM(`${actionText}确认`, `确定要提交${actionText}吗?`, true))) { | |||||
return | |||||
} | |||||
this.LOADING(`提交${actionText}中…`) | |||||
this.HTTP_POST(`/learun/adms/newwf${actionUrl}`, actionData, `提交${actionText}失败`).then(success => { | |||||
this.HIDE_LOADING() | |||||
if (success) { | |||||
this.EMIT('task-list-change') | |||||
this.TOAST(`成功提交${actionText}`, 'success') | |||||
if (taskType === 'revoke') { | |||||
this.NAV_BACK() | |||||
} | |||||
} | |||||
}) | |||||
break | |||||
// 点击「提交草稿」按钮 | |||||
case 'draft': | |||||
this.CONFIRM('不支持此操作') | |||||
return | |||||
if (!(await this.CONFIRM('提交确认', '确定要提交草稿吗?', true))) { | |||||
return | |||||
} | |||||
this.LOADING('正在提交…') | |||||
const draftFormValue = this.$refs.form.getFormValue() | |||||
const draftPostData = await this.getPostData(draftFormValue, this.scheme) | |||||
this.HTTP_POST('/learun/adms/newwf/draft', draftPostData, '提交草稿失败').then(success => { | |||||
this.HIDE_LOADING() | |||||
if (success) { | |||||
this.EMIT('task-list-change') | |||||
this.NAV_BACK() | |||||
this.TOAST('草稿已保存', 'success') | |||||
} | |||||
}) | |||||
break | |||||
// 点击「发起流程」按钮 | |||||
case 'submit': | |||||
this.CONFIRM('不支持此操作') | |||||
return | |||||
const verifyResult = this.$refs.form.verifyValue() | |||||
if (verifyResult.length > 0) { | |||||
this.CONFIRM('表单验证失败', verifyResult.join('\n')) | |||||
return | |||||
} | |||||
if (!(await this.CONFIRM('提交确认', '确定要发起流程吗?', true))) { | |||||
return | |||||
} | |||||
this.LOADING('正在提交…') | |||||
const formValue = this.$refs.form.getFormValue() | |||||
const postData = await this.getPostData(formValue, this.scheme) | |||||
postData.auditors = JSON.stringify({}) | |||||
if (this.type === 'child') { | |||||
postData.parentProcessId = this.processId | |||||
postData.parentTaskId = this.taskId | |||||
} | |||||
const errorTips = '流程发起失败' | |||||
this.HTTP_POST('/newwf/createchildflow', postData, errorTips).then(success => { | |||||
this.HIDE_LOADING() | |||||
if (success) { | |||||
this.EMIT('task-list-change') | |||||
this.NAV_BACK() | |||||
this.TOAST('流程发起成功', 'success') | |||||
} | |||||
}) | |||||
break | |||||
default: | |||||
break | |||||
} | |||||
}, | |||||
} | |||||
} | |||||
</script> | |||||
<style> | |||||
.tableTitle{ | |||||
font-size: 15px; | |||||
color: #2f2f2f; | |||||
padding: 14px; | |||||
} | |||||
.hasNotData{ | |||||
text-align: center; | |||||
font-size: 14px; | |||||
padding: 14px; | |||||
color: #666; | |||||
} | |||||
</style> |