相关方八项作业新流程bug修改

八项作业
liujun 2024-09-03 14:49:32 +08:00
parent ab79c71ec7
commit 5de6658478
8 changed files with 77 additions and 266 deletions

View File

@ -54,6 +54,7 @@ export const getHotWorkMethodSelectList = (params) => post("/app/util/getDicList
export const getQyDicList = (params) => post("/app/util/otherSysDic", params) // 动火方法选择列表
export const setTaskSave = (params) => post("/app/Task/init", params) //八项作业、隐患整改、安全环保检查任务保存更新接口
export const getCurrentNextOperation = (params) => post("/app/Task/getSupplementInfo", params) //获取当前任务的下一步操作
export const addFormInfo = (params) => post("/app/Task/addSupplementInfo", params) //审批过程中添加其他信息
export const getDepartmentTree = (params) => post("/app/util/getDepartmentTree", params) //获取部门树
export const getUserList = (params) => post("/app/util/getUserList", params) //获取人员
export const getToDoTaskList = (params) => post("/app/Task/getAllList", params) //获取待办列表

View File

@ -5,6 +5,9 @@
<view class="flex-between main-title">
<text>申请人{{ item.jobName }}</text>
</view>
<view class="flex-between main-title">
<text>身份{{ item.taskName }}</text>
</view>
<view class="flex-between main-title">
<text>作业编号{{ item.id }}</text>
</view>

View File

@ -75,7 +75,6 @@ export default {
try {
const {CODE} = await setTaskFile({formData: {type: 0}, name: 'files', filePath: this.form.imgList[0].url})
this.form.FILE_PATH = CODE
console.log('this.form :>> ', this.form);
await setHotWorkRecord({
EW_SP_DHW_MONITOR_ID: this.form.EW_SP_DHW_MONITOR_ID,
EW_RU_JOB_ID: this.EW_RU_JOB_ID,

View File

@ -31,7 +31,7 @@
</template>
<script>
import {getHotWorkGasAll, getHotWorkRecord} from "../../../../api";
import {getHotWorkGasAll, getHotWorkRecord, setTaskSign} from "../../../../api";
export default {
data() {
@ -115,8 +115,17 @@ export default {
/**
* 完成延时监火的确认按钮事件
*/
goSubmit() {
alert('等待开发接入中...')
async goSubmit() {
await setTaskSign({
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
EW_RU_TASK_ID: this.EW_RU_TASK_ID,
})
uni.$u.toast('保存成功')
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
})
}, 2000)
},
}
}

View File

@ -70,6 +70,12 @@ export default {
SIGN_FLAG: 1,
JOB_DTO: JSON.stringify(JOB_DTO)
})
uni.$u.toast('保存成功')
setTimeout(() => {
uni.switchTab({
url: '/pages/index/index'
})
}, 2000)
} catch {
}
} catch {

View File

@ -1,241 +0,0 @@
<template>
<view>
<view class="content">
<view class="card">
<u-form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="140px">
<view v-for="(item, index) in list" :key="index">
<view v-if="item.multiple === '1'" class="mt-10 multiple_btn">
<u-button type="primary" size="mini" :customStyle="{width:'auto',margin:0}"
:text="'添加' + item.list[1].name" @click="fnAdd(index)"/>
</view>
<view v-for="(item1, index1) in item.list"
:key="index.toString() + index1.toString()"
:class="{'mt-10': item.multiple === '1' && index1 % 2 === 0,'multiple_form_item': item.multiple === '1'}">
<u-form-item
:label="item1.name"
:prop="item1.key_name"
borderBottom
:required="item1.isRequired === '1'"
@click="fnSelect(item,item1)">
<u-input v-model="form[item1.key_name]" border="none" readonly/>
<u-icon name="arrow-right"/>
</u-form-item>
<u-icon name="close-circle-fill" color="#ff2929" size="20"
v-if="item.multiple === '1' && index1 !== 0 && index1 % 2 === 0"
:customStyle="{position: 'absolute',top:'-15rpx',right:'0'}"
@click="fnDelete(index,index1)"/>
</view>
</view>
</u-form>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000,true)"/>
</view>
</view>
</view>
<u-picker :show="picker.show" :columns="picker.columns" keyName="NAME"
:key="picker.currentColumnKey" @confirm="fnPickerConfirm" @cancel="fnPickerCancel"/>
</view>
</template>
<script>
import {getUserList} from "@/api";
import {setPersonnelForm} from "@/utils/submitHomeworkProcess";
export default {
data() {
return {
taskId: '',
CORP_ID: '',
TYPE: '',
list: [],
form: {},
rules: {},
picker: {
show: false,
columnsAll: {},
columns: [],
currentColumnKey: '',
currentName: '',
currentId: '',
}
}
},
onLoad() {
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('nextNodes', (data) => {
for (let i = 0; i < data.nextNodes.length; i++) {
if (data.nextNodes[i].multiple === '1') {
const guid = uni.$u.guid()
for (let j = 0; j < data.nextNodes[i].list.length; j++) {
//
data.nextNodes[i].list[j].key_name = data.nextNodes[i].list[j].key_name + `&&${guid}`
data.nextNodes[i].list[j].key_id = data.nextNodes[i].list[j].key_id + `&&${guid}`
}
}
}
this.list = data.nextNodes
this.taskId = data.taskId
this.CORP_ID = data.CORP_ID
this.TYPE = data.TYPE
this.fnInitFormAndRules()
})
},
methods: {
fnInitFormAndRules() {
this.list.forEach((item) => {
item.list.forEach((item1) => {
// key_namekey_idformkey
// key_nameruleskey
this.$set(this.form, item1.key_name, '')
this.$set(this.form, item1.key_id, '')
this.$set(this.rules, item1.key_name, [{
required: item1.isRequired === '1',
message: item1.name + '不能为空',
trigger: ['blur', 'change'],
}])
})
})
},
fnAdd(index) {
const currentItem = this.list[index]
//
const currentItemDepartment = uni.$u.deepClone(currentItem.list[0])
const currentItemUser = uni.$u.deepClone(currentItem.list[1])
// key_idkey_name
const guid = uni.$u.guid()
currentItemDepartment.key_id = this.fnReSplicing(currentItemDepartment.key_id, guid)
currentItemDepartment.key_name = this.fnReSplicing(currentItemDepartment.key_name, guid)
currentItemUser.key_id = this.fnReSplicing(currentItemUser.key_id, guid)
currentItemUser.key_name = this.fnReSplicing(currentItemUser.key_name, guid)
//
currentItem.list.push(currentItemDepartment)
currentItem.list.push(currentItemUser)
// key_idkey_nameformrules
this.$set(this.form, currentItemDepartment.key_id, '')
this.$set(this.form, currentItemDepartment.key_name, '')
this.$set(this.form, currentItemUser.key_id, '')
this.$set(this.form, currentItemUser.key_name, '')
this.$set(this.rules, currentItemDepartment.key_name, [{
required: currentItemDepartment.isRequired === '1',
message: currentItemDepartment.name + '不能为空',
trigger: ['blur', 'change'],
}])
this.$set(this.rules, currentItemUser.key_name, [{
required: currentItemUser.isRequired === '1',
message: currentItemUser.name + '不能为空',
trigger: ['blur', 'change'],
}])
},
fnReSplicing(value, guid) {
return value.substring(0, value.indexOf('&&')) + `&&${guid}`
},
fnDelete(index, index1) {
uni.showModal({
title: '提示',
content: '是否删除该条数据?',
success: (res) => {
if (res.confirm) {
const departmentKeyId = this.list[index].list[index1].key_id
const departmentKeyName = this.list[index].list[index1].key_name
const userKeyId = this.list[index].list[index1 + 1].key_id
const userKeyName = this.list[index].list[index1 + 1].key_name
//
this.list[index].list.splice(index1, 1)
this.list[index].list.splice(index1, 1)
// formrules
delete this.form[departmentKeyId]
delete this.form[departmentKeyName]
delete this.form[userKeyId]
delete this.form[userKeyName]
delete this.rules[departmentKeyName]
delete this.rules[userKeyName]
}
}
})
},
fnSelect({multiple}, {key_name, key_id, type, value}) {
const key_value = multiple === '1' ? key_id.substring(key_id.indexOf('&&') + 2) : value
if (type === '1') {
this.fnSelectDepartment(key_name, key_id, key_value)
return
}
if (type === '0') {
this.fnSelectUser(key_name, key_id, key_value)
}
},
fnSelectDepartment(key_name, key_id, value) {
const guid = key_name.substring(key_name.indexOf('&&'))
uni.navigateTo({
url: `/pages/eight_assignments/select_department?CORP_ID=${this.CORP_ID}`,
events: {
confirm: (event) => {
this.form[key_name] = event.DEPARTMENT_NAME
this.form[key_id] = event.DEPARTMENT_ID
this.form[value + '_USER_ID' + guid] = ''
this.form[value + '_USER_NAME' + guid] = ''
this.picker.columnsAll[value] = []
this.fnGetUserList(event, value)
}
},
})
},
async fnGetUserList({DEPARTMENT_ID, TYPE}, value) {
let resData = await getUserList({DEPARTMENT_ID, TYPE})
for (let i = 0; i < resData.list.list.length; i++) {
resData.list.list[i].NAME = resData.list.list[i].name || resData.list.list[i].NAME
resData.list.list[i].USER_ID = resData.list.list[i].user_ID || resData.list.list[i].USER_ID
}
this.$set(this.picker.columnsAll, value, [resData.list.list])
},
fnSelectUser(key_name, key_id, value) {
this.picker.currentName = key_name
this.picker.currentId = key_id
this.picker.currentColumnKey = value
this.picker.columns = this.picker.columnsAll[this.picker.currentColumnKey]
if (!this.picker.columnsAll[this.picker.currentColumnKey]) {
uni.$u.toast('没有选择部门或当前部门没有人员')
return
}
this.picker.show = true
},
fnPickerConfirm(event) {
this.form[this.picker.currentId] = event.value[0].USER_ID
this.form[this.picker.currentName] = event.value[0].NAME
this.fnPickerCancel()
},
fnPickerCancel() {
this.picker.show = false
},
async fnSubmit() {
try {
await this.$refs.formRef.validate()
try {
await setPersonnelForm({
form: this.form,
list: this.list,
taskId: this.taskId,
CORP_ID: this.CORP_ID,
TYPE: this.TYPE
})
} catch {
}
} catch {
uni.$u.toast('请补全必填项')
}
}
},
}
</script>
<style scoped lang="scss">
.multiple_btn {
display: flex;
justify-content: end;
}
.multiple_form_item {
position: relative;
background-color: #f9f9f9;
padding: 0 20rpx;
}
</style>

View File

@ -40,6 +40,7 @@
<script>
import {getUserList} from "@/api";
import {setPersonnelForm} from "@/utils/submitHomeworkProcess";
import {addFlowInfo} from '@/utils/submitHomeworkProcess';
export default {
data() {
@ -57,10 +58,13 @@ export default {
currentColumnKey: '',
currentName: '',
currentId: '',
}
},
initFlag: null,
vernier: null
}
},
onLoad() {
onLoad(event) {
this.vernier = event.vernier
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('nextNodes', (data) => {
for (let i = 0; i < data.nextNodes.length; i++) {
@ -75,8 +79,11 @@ export default {
}
this.list = data.nextNodes
this.taskId = data.taskId
this.EW_RU_JOB_ID = data.EW_RU_JOB_ID
this.CORP_ID = data.CORP_ID
this.TYPE = data.TYPE
this.initFlag = data.initFlag
console.log(data.initFlag)
this.fnInitFormAndRules()
})
},
@ -210,14 +217,27 @@ export default {
try {
await this.$refs.formRef.validate()
try {
await setPersonnelForm({
form: this.form,
list: this.list,
taskId: this.taskId,
CORP_ID: this.CORP_ID,
TYPE: this.TYPE
})
} catch {
if (!this.initFlag || this.initFlag === '1'){
await setPersonnelForm({
form: this.form,
list: this.list,
taskId: this.taskId,
CORP_ID: this.CORP_ID,
TYPE: this.TYPE
})
} else {
await addFlowInfo({
form:this.form,
list: this.list,
taskId: this.taskId,
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
TYPE: this.TYPE,
CORP_ID: this.CORP_ID,
vernier:this.vernier
})
}
} catch(e) {
console.log(e)
}
} catch {
uni.$u.toast('请补全必填项')

View File

@ -5,6 +5,7 @@ import {
setTaskFile,
setTaskSave
} from "@/api";
import {addFormInfo} from "../api";
// 处理表单数据
// TYPE 0 纯文本 1 图片 2 视频 3 divider标签 4 动态添加 5 签字
@ -146,31 +147,44 @@ const endCurrentPersonnelTechnologicalProcess = async ({EW_RU_TASK_ID}) => {
postMethod: 'application/json',
})
}
// 在审批过程中指定下一节点人
export const addFlowInfo = async ({form,list, taskId,EW_RU_JOB_ID, TYPE,CORP_ID, vernier}) => {
// 在审批过程中添加节点信息
await addFormInfo({
job: processSelectedPersonnelData(form,list),
EW_RU_TASK_ID: taskId,
TYPE,
postMethod: 'application/json'
}
)
// 结束后续流程
await resolveNextOperation({
EW_RU_TASK_ID: taskId,
CORP_ID,
TYPE,
EW_RU_JOB_ID,
vernier
})
}
// 决定下一步操作
// EW_RU_TASK_ID当前任务id
// CORP_ID选择的企业id
// TYPE作业类型
// EW_RU_JOB_ID当前操作节点的人员id
// isLastStep是否还有下一步纯前端确定不去后台获取
export const resolveNextOperation = async (
{
EW_RU_TASK_ID = '',
CORP_ID = '',
TYPE = '',
EW_RU_JOB_ID = '',
},
isLastStep = true
) => {
export const resolveNextOperation = async ({EW_RU_TASK_ID = '', CORP_ID = '', TYPE = '', EW_RU_JOB_ID = '',vernier = ''}, isLastStep = true) => {
if (isLastStep) {
const {info} = await getCurrentNextOperation({EW_RU_TASK_ID, EW_RU_JOB_ID})
const {info} = await getCurrentNextOperation({EW_RU_TASK_ID, EW_RU_JOB_ID, VERNIER: vernier})
// 选人
if (info.chooseNextFlag === '1') {
uni.navigateTo({
url: '/pages/eight_assignments/select_review_personnel',
url: '/pages/eight_assignments/select_review_personnel?vernier='+ info.vernier,
success: ({eventChannel}) => {
eventChannel.emit('nextNodes', {
nextNodes: info.nextNodes,
initFlag: info.initFlag,
taskId: EW_RU_TASK_ID,
EW_RU_JOB_ID: EW_RU_JOB_ID,
CORP_ID,
TYPE
})