diff --git a/api/index.js b/api/index.js index 7d3d594..e296e6d 100644 --- a/api/index.js +++ b/api/index.js @@ -36,7 +36,7 @@ export const getEMPLOYMENTAPPLYMANAGEMENTID = (params) => post("/app/user/getEMP // 以下接口八项作业流程使用 export const getCorpInfoList = (params) => post("/app/util/getCorp", params) //获取公司列表 -export const getConfinedSpaceSelectList = (params) => post("/app/Task/getAllToDoList", { +export const getConfinedSpaceSelectList = (params) => post("/app/eightWork/getSpace", { loading: false, ...params }) //获取受限空间名称选择列表 @@ -46,7 +46,9 @@ export const setTaskSave = (params) => post("/app/Task/init", params) //八项 export const getCurrentNextOperation = (params) => post("/app/Task/getSupplementInfo", 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/getAllToDoList", params) //获取待办列表 +export const getToDoTaskList = (params) => post("/app/Task/getAllList", params) //获取待办列表 export const getTaskTechnologicalProcess = (params) => post("/app/Task/getAgencyList", params) //获取流程 export const getTaskInfo = (params) => post("/app/Task/getInfo", params) //查看信息 +export const setTaskFile = (params) => upload("/app/util/uploadFile", params) //上传文件 +export const setTaskSign = (params) => post("/app/Task/sign", params) //审批意见签字提交 // 结束 diff --git a/components/other-select/index.vue b/components/other-select/index.vue index 859f354..dfc4176 100644 --- a/components/other-select/index.vue +++ b/components/other-select/index.vue @@ -4,8 +4,8 @@ + :label="type === 'assignments' ? item.TYPE_NAME : item.NAME" + :name="type === 'assignments' ? item.TYPE_NAME : item.NAME"> diff --git a/components/sign/sign.vue b/components/sign/sign.vue index 835e82e..8a64cba 100644 --- a/components/sign/sign.vue +++ b/components/sign/sign.vue @@ -1,7 +1,7 @@ diff --git a/pages/eight_assignments/select_review_personnel.vue b/pages/eight_assignments/select_review_personnel.vue index 90f9891..c55a8d6 100644 --- a/pages/eight_assignments/select_review_personnel.vue +++ b/pages/eight_assignments/select_review_personnel.vue @@ -3,11 +3,29 @@ - - - - + + + + + + + + + + + + @@ -45,6 +63,16 @@ export default { 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 @@ -55,34 +83,88 @@ export default { methods: { fnInitFormAndRules() { this.list.forEach((item) => { - this.$set(this.form, item.key_name, '') - this.$set(this.form, item.key_id, '') - this.$set(this.rules, item.key_name, [{ - required: item.isRequired === '1', - message: item.name + '不能为空', - trigger: ['blur', 'change'], - }]) + item.list.forEach((item1) => { + // 将key_name和key_id作为form的key + // 将key_name作为rules的key + 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'], + }]) + }) }) }, - fnSelect({key_name, key_id, type, value}) { + fnAdd(index) { + const currentItem = this.list[index] + // 克隆拿到当前的部门和人员 + const currentItemDepartment = uni.$u.deepClone(currentItem.list[0]) + const currentItemUser = uni.$u.deepClone(currentItem.list[1]) + // 重新生成key_id和key_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_id和key_name添加到form和rules + 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) { + 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) + // 在form和rules中删除 + 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, value) + this.fnSelectDepartment(key_name, key_id, key_value) return } if (type === '0') { - // 弹出选择人员 - this.fnSelectUser(key_name, key_id, value) + 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'] = '' - this.form[value + '_USER_NAME'] = '' + this.form[value + '_USER_ID' + guid] = '' + this.form[value + '_USER_NAME' + guid] = '' this.fnGetUserList(event, value) } }, @@ -137,5 +219,14 @@ export default { diff --git a/pages/eight_assignments/sign.vue b/pages/eight_assignments/sign.vue new file mode 100644 index 0000000..52e73b9 --- /dev/null +++ b/pages/eight_assignments/sign.vue @@ -0,0 +1,96 @@ + + + + + diff --git a/pages/eight_assignments/technological_process.vue b/pages/eight_assignments/technological_process.vue index a9b364d..b508ae0 100644 --- a/pages/eight_assignments/technological_process.vue +++ b/pages/eight_assignments/technological_process.vue @@ -10,64 +10,7 @@ import {getTaskTechnologicalProcess} from "@/api"; export default { data() { return { - stepData: [ - { - name: '提交申请', - time: '2023-06-09 20:01:49', - isNow: 0, - type: 1, - desc: '不想要了' - }, - { - name: '等待审核', - time: '2023-06-09 20:01:49', - isNow: 0, - type: 1, - desc: '您的服务单已申请成功,待售后审核中' - }, - { - name: '审核意见', - time: '2023-06-09 20:13:49', - isNow: 0, - type: 1, - desc: '您的售后单已收到,会在24小时与您联系。' - }, - { - name: '审核上门取件', - time: '2023-06-09 20:13:49', - isNow: 0, - type: 1, - desc: '您的服务单已预约时间2023-06-10(周日) 15:00-20:00' - }, - { - name: '取件成功', - time: '2023-06-10 18:54:55', - isNow: 0, - type: 1, - desc: '您的商品已取件成功' - }, - { - name: '商家售后已收到', - time: '2023-06-12 09:01:49', - isNow: 0, - type: 1, - desc: '您的服务单商品已收到' - }, - { - name: '返修换新订单生产', - time: '2023-06-12 13:19:49', - isNow: 0, - type: 1, - desc: '您的服务订单已生成新的订单' - }, - { - name: '返修换新完成', - time: '2023-06-13 12:12:49', - isNow: 1, - type: 1, - desc: '您的服务单已完成,如有疑问请反馈,谢谢~,欢迎再次光临' - }, - ] + stepData: [] } }, onLoad(query) { @@ -79,7 +22,7 @@ export default { methods: { async fnGetData(taskId) { let resData = await getTaskTechnologicalProcess({ID: taskId}) - console.log(resData) + this.stepData = resData.list } }, } diff --git a/pages/eight_assignments/to_do_list.vue b/pages/eight_assignments/to_do_list.vue index b9cf754..cfe4fbc 100644 --- a/pages/eight_assignments/to_do_list.vue +++ b/pages/eight_assignments/to_do_list.vue @@ -3,7 +3,10 @@ - 申请人:{{ item.taskName }} + 申请人:{{ item.jobName }} + + + 作业编号:{{ item.id }} 作业分公司:{{ item.taskName }} @@ -22,7 +25,7 @@ @@ -61,7 +64,8 @@ export default { let resData = await getToDoTaskList({ showCount: this.pageSize, currentPage: this.currentPage, - type: this.type, + TYPE: this.type, + vectors: '0' }); this.list = [...this.list, ...resData.list.list]; this.totalPage = resData.list.totalPage; diff --git a/pages/eight_assignments/view_info.vue b/pages/eight_assignments/view_info.vue index 26503dc..7eda71f 100644 --- a/pages/eight_assignments/view_info.vue +++ b/pages/eight_assignments/view_info.vue @@ -1,14 +1,44 @@ - diff --git a/utils/request.js b/utils/request.js index e72ff42..f032665 100644 --- a/utils/request.js +++ b/utils/request.js @@ -1,4 +1,4 @@ -let requestPath = 'http://192.168.0.99:8199/'; // 后台请求地址 +let requestPath = 'http://192.168.0.18:8199/'; // 后台请求地址 // let requestPath = 'https://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址 // let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址 import store from '../store/index' diff --git a/utils/submitHomeworkProcess.js b/utils/submitHomeworkProcess.js index 9d3502b..7c1ed9a 100644 --- a/utils/submitHomeworkProcess.js +++ b/utils/submitHomeworkProcess.js @@ -24,23 +24,27 @@ export const setSubmitForm = async ({form, formItems, TYPE, CORP_ID}) => { TYPE, postMethod: 'application/json', }) - await resolveNextOperation(taskIds[0], CORP_ID, TYPE) + await resolveNextOperation({EW_RU_TASK_ID: taskIds[0], CORP_ID, TYPE}) } // 处理选择人员数据 const processSelectedPersonnelData = (formData, list) => { const form = [] for (let i = 0; i < list.length; i++) { - const item = list[i] - form.push({ - TYPE_NAME: item.value, - TYPE: item.code, - TYPE_DESCRIBE: item.desc, - DEPARTMENT_ID: list[i].type === '1' ? formData[item.key_id] : '', - DEPARTMENT_NAME: list[i].type === '1' ? formData[item.key_name] : '', - USER_ID: list[i].type === '0' ? formData[item.key_id] : '', - USER_NAME: list[i].type === '0' ? formData[item.key_name] : '', - isDepartment: list[i].type - }) + for (let j = 0; j < list[i].list.length; j++) { + const item = list[i].list[j] + const link = item.key_id.substring(item.key_id.indexOf('&&') + 2) + form.push({ + TYPE_NAME: item.value, + TYPE: item.code, + TYPE_DESCRIBE: item.desc, + DEPARTMENT_ID: item.type === '1' ? formData[item.key_id] : '', + DEPARTMENT_NAME: item.type === '1' ? formData[item.key_name] : '', + USER_ID: item.type === '0' ? formData[item.key_id] : '', + USER_NAME: item.type === '0' ? formData[item.key_name] : '', + isDepartment: item.type, + link: list[i].multiple === '1' ? link : '', + }) + } } return form } @@ -50,7 +54,7 @@ export const setPersonnelForm = async ({form, list, taskId, CORP_ID, TYPE}) => { data: [{jobs: processSelectedPersonnelData(form, list), task: {EW_RU_TASK_ID: taskId}}], postMethod: 'application/json', }) - await resolveNextOperation(taskId, CORP_ID, TYPE) + await resolveNextOperation({EW_RU_TASK_ID: taskId, CORP_ID, TYPE}) } const endCurrentPersonnelTechnologicalProcess = async ({EW_RU_TASK_ID}) => { await setTaskSave({ @@ -59,29 +63,43 @@ const endCurrentPersonnelTechnologicalProcess = async ({EW_RU_TASK_ID}) => { postMethod: 'application/json', }) } -// 决定下一步操作 EW_RU_TASK_ID当前任务id CORP_ID 选择的企业id TYPE作业类型 -const resolveNextOperation = async (EW_RU_TASK_ID, CORP_ID, TYPE) => { - const {info} = await getCurrentNextOperation({EW_RU_TASK_ID}) - // 选人 - if (info.chooseNextFlag === '1') { - uni.navigateTo({ - url: '/pages/eight_assignments/select_review_personnel', - success: ({eventChannel}) => { - eventChannel.emit('nextNodes', {nextNodes: info.nextNodes, taskId: EW_RU_TASK_ID, CORP_ID, TYPE}) - } - }) - return +// 决定下一步操作 +// EW_RU_TASK_ID当前任务id +// CORP_ID选择的企业id +// TYPE作业类型 +// EW_RU_JOB_ID当前操作节点的人员id +export const resolveNextOperation = async ({EW_RU_TASK_ID, CORP_ID, TYPE, EW_RU_JOB_ID}, isLastStep = true) => { + if (isLastStep) { + const {info} = await getCurrentNextOperation({EW_RU_TASK_ID}) + // 选人 + if (info.chooseNextFlag === '1') { + uni.navigateTo({ + url: '/pages/eight_assignments/select_review_personnel', + success: ({eventChannel}) => { + eventChannel.emit('nextNodes', {nextNodes: info.nextNodes, taskId: EW_RU_TASK_ID, CORP_ID, TYPE}) + } + }) + return + } + // 填写安全措施 + if (info.completeFlag === '1') { + return + } + // 填写其它安全措施 + if (info.canAddFlag === '1') { + return + } + // 签字 + if (info.submitFlag === '1') { + uni.$u.route({ + url: '/pages/eight_assignments/sign', + params: {taskId: EW_RU_TASK_ID, EW_RU_JOB_ID, TYPE} + }) + return + } + // 没有下一步,结束流程,因为无法确定之前有多少步骤,跳转了多少页面,所以直接跳转到首页 + await endCurrentPersonnelTechnologicalProcess({EW_RU_TASK_ID}) } - // 填写安全措施 - if (info.completeFlag === '1') { - return - } - // 填写其它安全措施 - if (info.canAddFlag === '1') { - return - } - // 没有下一步,结束流程,因为无法确定有多少步骤,跳转了多少页面,所以直接跳转到首页 - await endCurrentPersonnelTechnologicalProcess({EW_RU_TASK_ID}) uni.$u.toast('提交成功') setTimeout(() => { uni.switchTab({