有限空间作业

八项作业
LiuJiaNan 2024-07-08 17:59:08 +08:00
parent 5aa5305982
commit c4bb84aee1
15 changed files with 525 additions and 338 deletions

View File

@ -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) //审批意见签字提交
// 结束

View File

@ -4,8 +4,8 @@
<view class="container">
<u-checkbox-group v-model="selectValue" placement="column">
<u-checkbox :customStyle="{marginBottom: '8px'}" v-for="(item, index) in list" :key="index"
:label="type === 'assignments' ? item.CHECK_NO : item.NAME"
:name="type === 'assignments' ? item.CHECK_NO : item.NAME">
:label="type === 'assignments' ? item.TYPE_NAME : item.NAME"
:name="type === 'assignments' ? item.TYPE_NAME : item.NAME">
</u-checkbox>
</u-checkbox-group>
<view class="button_group_placeholder"></view>

View File

@ -1,7 +1,7 @@
<template>
<u-modal
:show="signShow"
title="签名"
title="签名(请横屏签字)"
showCancelButton
confirmText="完成"
cancelText="重写"

View File

@ -227,6 +227,12 @@
"style": {
"navigationBarTitleText": "选择部门"
}
},
{
"path": "pages/eight_assignments/sign",
"style": {
"navigationBarTitleText": "签字"
}
}
],
"globalStyle": {

View File

@ -88,6 +88,7 @@ export default {
},
data() {
return {
type: '',
formItems: [
{name: '申请单位', key_name: 'APPLY_DEPARTMENT_NAME', key_id: 'APPLY_DEPARTMENT_ID', type: 0},
{name: '申请人', key_name: 'APPLY_USER_NAME', key_id: 'APPLY_USER_ID', type: 0},
@ -118,33 +119,43 @@ export default {
WORK_CONTENT: '',
WORK_START_DATE: '',
WORK_END_DATE: '',
WORK_LONGITUDE: '',
WORK_LATITUDE: '',
WORK_LONGITUDE: '1',
WORK_LATITUDE: '2',
WORK_USER: '',
SPECIAL_WORK: '',
RISK_IDENTIFICATION: '',
},
rules: {
APPLY_DEPARTMENT_ID: [{type: 'string', required: true, message: '请选择申请单位', trigger: ['blur','change']}],
APPLY_DEPARTMENT_NAME: [{type: 'string', required: true, message: '请选择申请人', trigger: ['blur','change']}],
APPLY_USER_NAME: [{type: 'string', required: true, message: '请选择申请人', trigger: ['blur','change']}],
CORP_NAME: [{type: 'string', required: true, message: '请选择作业分公司', trigger: ['blur','change']}],
BELONG_CORP: [{type: 'string', required: true, message: '请输入受限空间所属单位', trigger: ['blur','change']}],
LIMITSPACE_NAME: [{type: 'string', required: true, message: '请选择受限空间名称', trigger: ['blur','change']}],
MEDIUM_NAME: [{type: 'string', required: true, message: '请输入受限空间内原有介质名称', trigger: ['blur','change']}],
WORK_CONTENT: [{type: 'string', required: true, message: '请输入作业内容', trigger: ['blur','change']}],
WORK_START_DATE: [{type: 'string', required: true, message: '请选择作业开始时间', trigger: ['blur','change']}],
WORK_END_DATE: [{type: 'string', required: true, message: '请选择作业结束时间', trigger: ['blur','change']}],
WORK_LONGITUDE: [{type: 'string', required: true, message: '请选择经度', trigger: ['blur','change']}],
WORK_LATITUDE: [{type: 'string', required: true, message: '请选择纬度', trigger: ['blur','change']}],
WORK_USER: [{type: 'string', required: true, message: '请输入作业人', trigger: ['blur','change']}],
APPLY_DEPARTMENT_ID: [{type: 'string', required: true, message: '请选择申请单位', trigger: ['blur', 'change']}],
APPLY_DEPARTMENT_NAME: [{type: 'string', required: true, message: '请选择申请人', trigger: ['blur', 'change']}],
APPLY_USER_NAME: [{type: 'string', required: true, message: '请选择申请人', trigger: ['blur', 'change']}],
CORP_NAME: [{type: 'string', required: true, message: '请选择作业分公司', trigger: ['blur', 'change']}],
BELONG_CORP: [{type: 'string', required: true, message: '请输入受限空间所属单位', trigger: ['blur', 'change']}],
LIMITSPACE_NAME: [{type: 'string', required: true, message: '请选择受限空间名称', trigger: ['blur', 'change']}],
MEDIUM_NAME: [{
type: 'string',
required: true,
message: '请输入受限空间内原有介质名称',
trigger: ['blur', 'change']
}],
WORK_CONTENT: [{type: 'string', required: true, message: '请输入作业内容', trigger: ['blur', 'change']}],
WORK_START_DATE: [{type: 'string', required: true, message: '请选择作业开始时间', trigger: ['blur', 'change']}],
WORK_END_DATE: [{type: 'string', required: true, message: '请选择作业结束时间', trigger: ['blur', 'change']}],
WORK_LONGITUDE: [{type: 'string', required: true, message: '请选择经度', trigger: ['blur', 'change']}],
WORK_LATITUDE: [{type: 'string', required: true, message: '请选择纬度', trigger: ['blur', 'change']}],
WORK_USER: [{type: 'string', required: true, message: '请输入作业人', trigger: ['blur', 'change']}],
SPECIAL_WORK: [{
type: 'string',
required: true,
message: '请输入关联的其他特殊作业及安全作业票编号',
trigger: ['blur','change']
trigger: ['blur', 'change']
}],
RISK_IDENTIFICATION: [{
type: 'string',
required: true,
message: '请输入风险辨识结果',
trigger: ['blur', 'change']
}],
RISK_IDENTIFICATION: [{type: 'string', required: true, message: '请输入风险辨识结果', trigger: ['blur','change']}],
},
picker: {
show: false,
@ -166,11 +177,12 @@ export default {
onLoad(options) {
this.form.CORP_ID = options.CORPINFO_ID
this.form.CORP_NAME = options.CORP_NAME
this.form.type = options.type
},
methods: {
async fnGetConfinedSpaceSelectList() {
const resData = await getConfinedSpaceSelectList({TYPE: 2})
this.picker.columns = [resData.list.list]
const resData = await getConfinedSpaceSelectList({TYPE: 2, CORP_ID: this.form.CORP_ID})
this.picker.columns = [resData.varList]
},
fnSingleChoiceClick(event) {
this.picker.type = event
@ -217,7 +229,7 @@ export default {
await setSubmitForm({
form: this.form,
formItems: this.formItems,
TYPE: 'confinedSpace',
TYPE: this.type,
CORP_ID: this.form.CORP_ID
})
} catch {

View File

@ -23,7 +23,7 @@ export default {
title: '受限空间安全作业',
url: '/pages/eight_assignments/subordinate_index',
params: {
type: 'confined_space',
type: 'confinedSpace',
}
},
{
@ -31,7 +31,7 @@ export default {
title: '盲板抽堵作业',
url: '/pages/eight_assignments/subordinate_index',
params: {
type: 'blind_board',
type: 'blindBoard',
}
},
{
@ -39,7 +39,7 @@ export default {
title: '动土作业',
url: '/pages/eight_assignments/subordinate_index',
params: {
type: 'break_ground',
type: 'breakGround',
}
},
{
@ -47,7 +47,7 @@ export default {
title: '高处作业',
url: '/pages/eight_assignments/subordinate_index',
params: {
type: 'high_work',
type: 'highWork',
}
},
{
@ -71,7 +71,7 @@ export default {
title: '动火作业',
url: '/pages/eight_assignments/subordinate_index',
params: {
type: 'hot_work',
type: 'hotWork',
}
},
{
@ -79,7 +79,7 @@ export default {
title: '断路作业',
url: '/pages/eight_assignments/subordinate_index',
params: {
type: 'cut_road',
type: 'cutRoad',
}
},
]

View File

@ -1,82 +1,83 @@
<template>
<view class="content">
<view class="card">
<u-radio-group v-model="select_corp" placement="column">
<u-radio :customStyle="{marginBottom: '20rpx'}" v-for="item in list" :key="item.CORPINFO_ID"
:label="item.NAME" :name="item.CORPINFO_ID">
</u-radio>
</u-radio-group>
<view class="button_placeholder"></view>
<view class="button">
<u-button type="primary" text="确定" @click="fnConfirm"></u-button>
</view>
</view>
</view>
<view class="content">
<view class="card">
<u-radio-group v-model="select_corp" placement="column">
<u-radio :customStyle="{marginBottom: '20rpx'}" v-for="item in list" :key="item.CORPINFO_ID"
:label="item.NAME" :name="item.CORPINFO_ID">
</u-radio>
</u-radio-group>
<view class="button_placeholder"></view>
<view class="button">
<u-button type="primary" text="确定" @click="fnConfirm"></u-button>
</view>
</view>
</view>
</template>
<script>
import {
getCorpInfoList
} from '../../api'
import {
getCorpInfoList
} from '../../api'
export default {
data() {
return {
type: '',
list: [],
select_corp: ''
}
},
onLoad(options) {
this.type = options.type
this.fnGetData()
},
methods: {
async fnGetData() {
const resData = await getCorpInfoList()
this.list = resData.list.corpInfoDos
},
fnConfirm() {
if (!this.select_corp) {
uni.$u.toast('请选择作业分公司')
return;
}
const urlByTypeMap = {
'confined_space': {
'035958e685cf4850bc40151c5e0617a6': '',
'default': '/pages/eight_assignments/confined_space/apply'
}
}
const url = urlByTypeMap[this.type][this.select_corp] ?? urlByTypeMap[this.type].default
let params = {}
for (let i = 0; i < this.list.length; i++) {
if (this.list[i].CORPINFO_ID === this.select_corp) {
params = {
CORPINFO_ID: this.list[i].CORPINFO_ID,
CORP_NAME: this.list[i].NAME,
}
break
}
}
uni.$u.route({
url,
type: 'redirect',
params
})
}
}
}
export default {
data() {
return {
type: '',
list: [],
select_corp: ''
}
},
onLoad(options) {
this.type = options.type
this.fnGetData()
},
methods: {
async fnGetData() {
const resData = await getCorpInfoList()
this.list = resData.list.corpInfoDos
},
fnConfirm() {
if (!this.select_corp) {
uni.$u.toast('请选择作业分公司')
return;
}
const urlByTypeMap = {
'confinedSpace': {
'035958e685cf4850bc40151c5e0617a6': '',
'default': '/pages/eight_assignments/confined_space/apply'
}
}
const url = urlByTypeMap[this.type][this.select_corp] ?? urlByTypeMap[this.type].default
let params = {}
for (let i = 0; i < this.list.length; i++) {
if (this.list[i].CORPINFO_ID === this.select_corp) {
params = {
CORPINFO_ID: this.list[i].CORPINFO_ID,
CORP_NAME: this.list[i].NAME,
type: this.type
}
break
}
}
uni.$u.route({
url,
type: 'redirect',
params
})
}
}
}
</script>
<style scoped lang="scss">
.button_placeholder {
height: 100rpx;
}
.button_placeholder {
height: 100rpx;
}
.button {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
.button {
position: fixed;
bottom: 0;
left: 0;
right: 0;
}
</style>

View File

@ -3,11 +3,29 @@
<view class="content">
<view class="card">
<u-form labelPosition="left" :model="form" :rules="rules" ref="formRef" labelWidth="140px">
<u-form-item v-for="(item, index) in list" :key="index" :label="item.name" :prop="item.key_name"
borderBottom :required="item.isRequired === '1'" @click="fnSelect(item)">
<u-input v-model="form[item.key_name]" border="none" readonly/>
<u-icon name="arrow-right"></u-icon>
</u-form-item>
<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)"/>
@ -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_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'],
}])
})
})
},
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_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) {
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, 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 {
</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

@ -0,0 +1,96 @@
<template>
<view class="content">
<view class="card">
<u-form labelPosition="top" :model="form" :rules="rules" ref="formRef" labelWidth="140px">
<u-form-item label="审批结果" prop="APPROVAL_RESULTS" borderBottom required labelPosition="left">
<u-radio-group v-model="form.APPROVAL_RESULTS">
<u-radio label="通过" name="1"/>
<u-radio :customStyle="{marginLeft: '8px'}" label="不通过" name="0"/>
</u-radio-group>
</u-form-item>
<u-form-item label="审批意见" prop="APPROVAL_OPINIONS" borderBottom required>
<u-textarea v-model="form.APPROVAL_OPINIONS" border="none" autoHeight/>
</u-form-item>
<u-form-item label="签字" prop="SIGN" borderBottom required>
<view style="flex: 1">
<view>
<u-button type="primary" size="mini" text="签字"
:customStyle="{position: 'absolute',top: '-46upx',right: '20upx',width: '100upx'}"
@click="signVisible = true"/>
</view>
<view v-if="form.SIGN">
<u-image width="400rpx" height="200rpx" :src="form.SIGN"/>
</view>
</view>
</u-form-item>
</u-form>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000,true)"/>
</view>
</view>
<sign :signShow.sync="signVisible" @confirm="fnSign"/>
</view>
</template>
<script>
import Sign from '@/components/sign/sign.vue'
import {setTaskFile, setTaskSign} from "@/api";
import {resolveNextOperation} from "@/utils/submitHomeworkProcess";
export default {
components: {
Sign,
},
data() {
return {
EW_RU_JOB_ID: '',
TYPE: '',
taskId: '',
signVisible: false,
form: {
APPROVAL_RESULTS: '',
APPROVAL_OPINIONS: '',
SIGN: '',
},
rules: {
APPROVAL_RESULTS: [{type: 'string', required: true, message: '请选择审批结果', trigger: ['blur', 'change']}],
APPROVAL_OPINIONS: [{type: 'string', required: true, message: '请输入审批意见', trigger: ['blur', 'change']}],
SIGN: [{type: 'string', required: true, message: '请签字', trigger: ['blur', 'change']}],
},
}
},
onLoad(query) {
this.EW_RU_JOB_ID = query.EW_RU_JOB_ID
this.TYPE = query.TYPE
this.taskId = query.taskId
},
methods: {
fnSign(event) {
this.form.SIGN = event.filePath
},
async fnSubmit() {
try {
await this.$refs.formRef.validate()
try {
const {CODE} = await setTaskFile({formData: {type: 0}, name: 'files', filePath: this.form.SIGN})
await setTaskSign({
IMG_CODE: CODE,
...this.form,
SIGN: '',
EW_RU_JOB_ID: this.EW_RU_JOB_ID,
EW_RU_TASK_ID: this.taskId
})
await resolveNextOperation({}, false)
} catch {
}
} catch {
uni.$u.toast('请补全必填项')
}
}
},
}
</script>
<style scoped lang="scss">
</style>

View File

@ -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
}
},
}

View File

@ -3,7 +3,10 @@
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index">
<view class="flex-between main-title">
<text>申请人{{ item.taskName }}</text>
<text>申请人{{ item.jobName }}</text>
</view>
<view class="flex-between main-title">
<text>作业编号{{ item.id }}</text>
</view>
<view class="flex-between main-title">
<text>作业分公司{{ item.taskName }}</text>
@ -22,7 +25,7 @@
<u-button type="primary" text="审批" size="mini" class="bth-mini ml-10"
@click="$u.route({
url: '/pages/eight_assignments/view_info',
params: {taskId:item.taskId,type,title}
params: {taskId:item.taskId,jobId:item.jobId,type,title}
})"/>
</view>
</view>
@ -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;

View File

@ -1,14 +1,44 @@
<template>
<view class="content">
<view class="card"></view>
<view class="card">
<u-divider text="基本信息" textPosition="left"></u-divider>
<u-cell-group>
<block v-for="(item,index) in form">
<u-cell v-if="item.TYPE === 0" :key="index" :title="item.ITEM" :value="item.ITEM_VALUE"></u-cell>
</block>
</u-cell-group>
<u-divider text="审批人员" textPosition="left"></u-divider>
<u-cell-group>
<block v-for="(item,index) in jobs">
<u-cell :key="index" :title="item.TYPE_DESCRIBE"
:value="item.DEPARTMENT_NAME + '' + item.USER_NAME + ''"></u-cell>
</block>
</u-cell-group>
<view class="mt-10">
<u-button type="primary" text="下一步" @click="$u.debounce(fnSubmit, 1000,true)"/>
</view>
</view>
</view>
</template>
<script>
import {getTaskInfo} from "@/api";
import {resolveNextOperation} from "@/utils/submitHomeworkProcess";
export default {
data() {
return {
taskId: '',
type: '',
jobId: '',
form: [],
jobs: []
}
},
onLoad(query) {
this.taskId = query.taskId
this.type = query.type
this.jobId = query.jobId
this.fnGetData(query.taskId)
uni.setNavigationBarTitle({
title: query.title + '查看'
@ -17,7 +47,15 @@ export default {
methods: {
async fnGetData(taskId) {
let resData = await getTaskInfo({EW_RU_TASK_ID: taskId})
console.log(resData)
this.form = resData.list.form
this.jobs = resData.list.jobs.reverse()
},
async fnSubmit() {
await resolveNextOperation({
EW_RU_TASK_ID: this.taskId,
TYPE: this.type,
EW_RU_JOB_ID: this.jobId,
})
}
},
}

View File

@ -1,135 +1,111 @@
<template>
<view class="step">
<view class="step_box">
<!-- 左侧进度线 -->
<view class="step_left">
</view>
<view class="step_right">
<view class="right_content" v-for="(item,index) in stepData" :key="index">
<!-- 进度名称 -->
<block v-if="item.isNow == 0">
<view class="title" :style="{color:item.type == 1? '#202020':'#999'}">{{item.name}}</view>
</block>
<block v-if="item.isNow == 1">
<view class="title" :style="{color:item.type == 1? colors:'#999'}">{{item.name}}</view>
</block>
<!-- 进度时间 -->
<view class="times" v-if="item.type == 1">{{item.time}}</view>
<!-- 进度详情备注 -->
<view class="result" v-if="item.desc && item.desc !== ''"><text
style="color: #202020;">{{item.desc}}</text></view>
<!-- 右侧的进度点 -->
<view class="status"
:style="{background: item.isNow == 1?colors:'#ccc',borderColor: item.isNow == 1?colors:'#ccc'}">{{item.isNow == 1?"✓":''}}
</view>
</view>
</view>
</view>
</view>
<view class="step">
<view class="step_box">
<view class="step_left"></view>
<view class="step_right">
<view class="right_content" v-for="(item,index) in stepData" :key="index">
<view class="title">{{ item.NODE_DESC }}{{ item.USER_NAME }}</view>
<view class="times" v-if="item.time">{{ item.time }}</view>
<view class="result" v-if="item.desc">
<text style="color: #202020;">{{ item.desc }}</text>
</view>
<view class="status"
:style="{background: item.isNow == 1?colors:'#ccc',borderColor: item.isNow == 1?colors:'#ccc'}">
{{ item.isNow == 1 ? "✓" : '' }}
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
props: {
colors: {
type: String
},
stepData: {
type: Array
}
},
};
export default {
data() {
return {};
},
props: {
colors: {
type: String
},
stepData: {
type: Array
}
},
};
</script>
<style lang="scss" scoped>
.step {
padding: 40upx 20upx;
margin-bottom: 20upx;
}
.step {
padding: 40upx 20upx;
margin-bottom: 20upx;
}
.step_box {
margin: 0 20upx;
display: flex;
.step_box {
margin: 0 20upx;
display: flex;
.step_left {
width: 2upx;
display: block;
background-color: #DDDDDD;
overflow: hidden;
}
.step_left {
width: 2upx;
display: block;
background-color: #DDDDDD;
overflow: hidden;
}
.step_right {
margin-left: 20upx;
margin-top: -10upx;
.step_right {
margin-left: 20upx;
margin-top: -10upx;
.right_content {
position: relative;
margin-bottom: 30upx;
.right_content {
position: relative;
margin-bottom: 30upx;
.title {
font-size: 28upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
}
.title {
font-size: 28upx;
font-family: Source Han Sans CN;
font-weight: 500;
color: #333333;
}
.times {
font-size: 22upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
line-height: 36upx;
}
.times {
font-size: 22upx;
font-family: Source Han Sans CN;
font-weight: 400;
color: #999999;
line-height: 36upx;
}
.status {
width: 24upx;
height: 24upx;
border-radius: 50%;
border: 2upx solid #ccc;
position: absolute;
top: 10upx;
background-color: #ccc;
left: -36upx;
color: white;
line-height: 12px;
font-size: 10px;
text-align: center;
}
.status {
width: 24upx;
height: 24upx;
border-radius: 50%;
border: 2upx solid #ccc;
position: absolute;
top: 4upx;
background-color: #ccc;
left: -36upx;
color: white;
line-height: 12px;
font-size: 10px;
text-align: center;
}
.result {
padding: 10upx 15upx;
background-color: #F6F6F6;
font-size: 22upx;
margin-top: 10upx;
border: 1upx dashed #ddd;
}
.result {
padding: 10upx 15upx;
background-color: #F6F6F6;
font-size: 22upx;
margin-top: 10upx;
border: 1upx dashed #ddd;
}
&:last-of-type {
margin-bottom: 0;
&:last-of-type {
margin-bottom: 0;
.status {
top: 14upx;
}
&::before {
content: '';
width: 6upx;
height: 100%;
background-color: #FFFFFF;
position: absolute;
top: 22upx;
left: -24upx;
}
}
}
}
}
.status {
top: 14upx;
}
}
}
}
}
</style>

View File

@ -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'

View File

@ -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({