Commit 430057e8 authored by 刘怀志's avatar 刘怀志

feat(审批详情):追溯审批完

parent 072e77a0
import request from '@/utils/request' import request from '@/utils/request'
const ProcessGroupEnum = { const ProcessGroupEnum = {
/** /**
* 单据类型 AE * 单据类型 AE
*/ */
AE:'1', AE: '1',
/** /**
* 单据类型 MC * 单据类型 MC
*/ */
MC: '2', MC: '2',
/** /**
* 单据类型 DC * 单据类型 DC
*/ */
DC: '3' DC: '3'
} }
/** /**
* Ae流程实例 - 分页查询 * Ae流程实例 - 分页查询
...@@ -21,11 +21,11 @@ const ProcessGroupEnum = { ...@@ -21,11 +21,11 @@ const ProcessGroupEnum = {
* @returns {*} * @returns {*}
*/ */
export function queryInstanceListAeByPage(query) { export function queryInstanceListAeByPage(query) {
return request({ return request({
url: '/sysprocessinstance/page/ae', url: '/sysprocessinstance/page/ae',
method: 'get', method: 'get',
params: query params: query
}) })
} }
/** /**
* 查询流程列表 * 查询流程列表
...@@ -33,11 +33,11 @@ export function queryInstanceListAeByPage(query) { ...@@ -33,11 +33,11 @@ export function queryInstanceListAeByPage(query) {
* @returns {AxiosPromise} * @returns {AxiosPromise}
*/ */
export function queryInstanceByPage(params) { export function queryInstanceByPage(params) {
return request({ return request({
url: `/process/instance/list`, url: `/process/instance/list`,
method: 'get', method: 'get',
params params
}) })
} }
/** /**
* 流程实例 - 获取详情 * 流程实例 - 获取详情
...@@ -45,10 +45,10 @@ export function queryInstanceByPage(params) { ...@@ -45,10 +45,10 @@ export function queryInstanceByPage(params) {
* @returns {*} * @returns {*}
*/ */
export function getProcessNodeByInstanceId(instanceId) { export function getProcessNodeByInstanceId(instanceId) {
return request({ return request({
url: `/sysprocessbasic/getProcessNode/${instanceId}`, url: `/sysprocessbasic/getProcessNode/${instanceId}`,
method: 'get' method: 'get'
}) })
} }
/** /**
* 管理员审批 * 管理员审批
...@@ -56,116 +56,144 @@ export function getProcessNodeByInstanceId(instanceId) { ...@@ -56,116 +56,144 @@ export function getProcessNodeByInstanceId(instanceId) {
* @returns {*} * @returns {*}
*/ */
export function approveByAdmin(query) { export function approveByAdmin(query) {
// 需要根据传回的url判断是哪个接口 // 需要根据传回的url判断是哪个接口
const { url } = query const { url } = query
if (query.processGroup === ProcessGroupEnum.MC) { if (query.processGroup === ProcessGroupEnum.MC) {
return MCService({ return MCService({
url: url, url: url,
method: 'post', method: 'post',
params: query params: query
})
} else if (query.processGroup === ProcessGroupEnum.DC) {
return DCService({
url: url,
method: 'post',
params: query
})
} else {
return request({
url: url,
method: 'post',
params: query
})
}
}
export function getProcessInstanceStatus(instanceId) {
return request({
url: `/sysprocessbasic/getProcessInstanceStatus/${instanceId}`,
method: 'get'
}) })
} } else if (query.processGroup === ProcessGroupEnum.DC) {
// 1. 工具点检_根据流程实例id查找流程实例审批详情 return DCService({
export function getToolProcessDetail(businessId) { url: url,
return request({ method: 'post',
url: '/toolInspectMonitor/getDetail/'+businessId, params: query
method: 'get',
}) })
} } else {
// 2. 工具点检_工具点检流程审批
export function toolProcessGxApproval(approve) {
return request({ return request({
url: '/toolInspectMonitor/processToolApproval', url: url,
method: 'post', method: 'post',
data: approve, params: query
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
}) })
} }
// 1. 生产辅材_根据流程实例id查找流程实例审批详情 }
export function getProcessInstanceStatus(instanceId) {
return request({
url: `/sysprocessbasic/getProcessInstanceStatus/${instanceId}`,
method: 'get'
})
}
// 1. 工具点检_根据流程实例id查找流程实例审批详情
export function getToolProcessDetail(businessId) {
return request({
url: '/toolInspectMonitor/getDetail/' + businessId,
method: 'get',
})
}
// 2. 工具点检_工具点检流程审批
export function toolProcessGxApproval(approve) {
return request({
url: '/toolInspectMonitor/processToolApproval',
method: 'post',
data: approve,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
// 1. 生产辅材_根据流程实例id查找流程实例审批详情
export function getMateriaProcessDetail(businessId) { export function getMateriaProcessDetail(businessId) {
return request({ return request({
url: '/aeauxiliarymaterial/getDetail/'+businessId, url: '/aeauxiliarymaterial/getDetail/' + businessId,
method: 'get', method: 'get',
}) })
} }
// 1. 设备标定_根据流程实例id查找流程实例审批详情 // 1. 设备标定_根据流程实例id查找流程实例审批详情
export function getSignProcessDetail(businessId) { export function getSignProcessDetail(businessId) {
return request({ return request({
url: '/qc/equipment/sign/getDetail/'+businessId, url: '/qc/equipment/sign/getDetail/' + businessId,
method: 'get', method: 'get',
}) })
} }
// 1. 设备TPM_根据流程实例id查找流程实例审批详情 // 1. 设备TPM_根据流程实例id查找流程实例审批详情
export function getTpmProcessDetail(businessId) { export function getTpmProcessDetail(businessId) {
return request({ return request({
url: '/qc/equipment/tpm/getDetail/'+businessId, url: '/qc/equipment/tpm/getDetail/' + businessId,
method: 'get', method: 'get',
}) })
} }
export function materiaProcessGxApproval(approve) { export function materiaProcessGxApproval(approve) {
return request({ return request({
url: '/aeauxiliarymaterial/processMaterialApproval', url: '/aeauxiliarymaterial/processMaterialApproval',
method: 'post', method: 'post',
data: approve, data: approve,
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型 'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
} }
}) })
} }
export function signProcessGxApproval(approve) { export function signProcessGxApproval(approve) {
return request({ return request({
url: '/qc/equipment/sign/processCalibrationApproval', url: '/qc/equipment/sign/processCalibrationApproval',
method: 'post', method: 'post',
data: approve, data: approve,
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型 'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
} }
}) })
} }
export function tpmProcessGxApproval(approve) { export function tpmProcessGxApproval(approve) {
return request({ return request({
url: '/qc/equipment/tpm/processTpmApproval', url: '/qc/equipment/tpm/processTpmApproval',
method: 'post', method: 'post',
data: approve, data: approve,
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型 'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
} }
}) })
} }
export function getCompletionDetail(businessId) { export function getCompletionDetail(businessId) {
return request({ return request({
url: '/traceability/getCompletion/'+businessId, url: '/traceability/getCompletion/' + businessId,
method: 'get', method: 'get',
}) })
} }
export function processCompletionApproval(approve) { export function processCompletionApproval(approve) {
return request({ return request({
url: '/traceability/processCompletionApproval', url: '/traceability/processCompletionApproval',
method: 'post', method: 'post',
data: approve, data: approve,
headers: { headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型 'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
} }
}) })
} }
\ No newline at end of file export function getTraceabilityDetail(businessId) {
return request({
url: '/traceability/getDetail/' + businessId,
method: 'get',
})
}
/**
* 根据产线id查询工序
* @param query
* @returns {AxiosPromise}
*/
export function getGxByProLinId(query) {
return request({
url: '/aeprolinegx/getGxByProLinId',
method: 'get',
params: query
})
}
export function processCalibrationApproval(approve) {
return request({
url: '/traceability/processCalibrationApproval',
method: 'post',
data: approve,
headers: {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
}
})
}
\ No newline at end of file
<!-- 00016(铸造科对发动机装配科发起追溯) 00017(机加工科对发动机装配科发起追溯) 审批详情 --> <!-- 00016(铸造科对发动机装配科发起追溯) 00017(机加工科对发动机装配科发起追溯) 审批详情 -->
<template> <template>
<view class="base-detail"> <view class="base-detail">
<ya-navbar title="审批详情drawerShowEngineTrace" :left-icon-color="'#fff'" :bg-style="'#333399'" <ya-navbar
:title-style="'color: #fff;font-weight: 500;font-size: 35rpx;'" /> title="审批详情"
<view class="container"> :left-icon-color="'#fff'"
<view class="title"> :bg-style="'#333399'"
基础数据变更({{ label }} :title-style="'color: #fff;font-weight: 500;font-size: 35rpx;'"
</view> />
<!-- 步骤图区 --> <view class="container">
<view class="step-container"> <view class="title">
<vertical-steps :steps="steps" :current-step="1"> {{ processName }}
</view>
<!-- 自定义内容 --> <!-- 步骤图区 -->
<template v-for="(step, index) in steps" #[`content-${index}`]> <view class="step-container">
<!-- 发起人 --> <vertical-steps :steps="steps" :current-step="1">
<template v-if="index === 0"> <!-- 自定义内容 -->
<view class="custom-table"> <template v-for="(step, index) in steps" #[`content-${index}`]>
<view class="subTitleClass"> <!-- 发起人 -->
<view class="subRow"> <template v-if="index === 0">
<view class="subTitle"> <view class="custom-table">
员工姓名 <view class="subTitleClass">
</view> <view class="subRow">
<view class="subContent"> <view class="subTitle"> 追溯批次号 </view>
{{ step.content.userName }} <view class="subContent">
</view> {{ instanceDetail.formDto.traceableNumber || '-' }}
</view> </view>
<view class="subRow"> </view>
<view class="subTitle"> <view class="subRow">
员工职级 <view class="subTitle"> 发起科室 </view>
</view> <view class="subContent">
<view class="subContent"> {{ getLabelByValue(
{{ getLabelByValue(jobLevelList, step.content.rank) }} initiateDepartmentList,
</view> instanceDetail.formDto.initiateDepartment
) || '-' }}
</view> </view>
<view class="subRow"> </view>
<view class="subTitle"> <view class="subRow">
创建日期 <view class="subTitle"> 发起人 </view>
</view> <view class="subContent">
<view class="subContent"> {{ instanceDetail.formDto.initiateUserName }}
{{ parseTimeA(step.content.createTime, 'YYYY/MM/DD HH:mm') }} </view>
</view> </view>
<view class="subRow">
<view class="subTitle"> 追溯部品类型 </view>
<view class="subContent">
{{getLabelByValue(
traceablePartsTypeList,
instanceDetail.formDto.partType
) }}
</view> </view>
</view> </view>
</view> </view>
</template> </view>
<!-- 审批人 --> </template>
<template v-else> <!-- 审批人 -->
<view class="custom-table"> <template v-else>
<view class="subTitleClass"> <u-collapse
<view class="subRow"> v-for="(item) in step.content"
<view class="subTitle"> :border="false"
部门 @change="change"
</view> @close="close"
@open="open"
>
<u-collapse-item
:title="item.configApproveUserName"
name="configApproveUserName"
>
<view class="custom-table-collapse">
<view class="subTitleClass-collapse">
<view class="subRow-collapse">
<view class="subTitle"> 部门 </view>
<view class="subContent"> <view class="subContent">
{{ step.content.approveDeptName }} {{ item.configApproveDeptName }}
</view> </view>
</view> </view>
<view class="subRow"> <view class="subRow-collapse">
<view class="subTitle"> <view class="subTitle"> 生产角色 </view>
生产角色
</view>
<view class="subContent"> <view class="subContent">
{{ step.content.approveRoleName || '无' }} {{ item.configApproveRoleName || '无' }}
</view> </view>
</view> </view>
<view class="subRow"> <view class="subRow-collapse">
<view class="subTitle"> <view class="subTitle"> 处理结果 </view>
员工姓名
</view>
<view class="subContent"> <view class="subContent">
{{ step.content.approveUser || '无' }} {{ item.approveResult || '无' }}
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</template> </u-collapse-item>
</u-collapse>
</template> </template>
</vertical-steps> </template>
</view> </vertical-steps>
<!-- 步骤图完成 --> </view>
<!-- 备注区 --> <!-- 步骤图完成 -->
<view class="title"> <!-- 排出位置 -->
备注信息 <u-form ref="paichuForm" :model="paichuForm" labelWidth="120" :rules="rules">
</view> <view class="title"> 排出位置 </view>
<view class="remark-container"> <template v-for="(item, index) in paichuForm.interceptPoints">
<u-form :model="instanceDetail"> <view class="change-container">
<u-form-item label="访问区域" prop="remark" labelPosition="top" labelWidth="80"> <!-- 计划标定日期 -->
<u-textarea disabled v-model="instanceDetail.remarks" placeholder="-"></u-textarea> <u-form-item
</u-form-item> prop="proLineName"
</u-form> borderBottom
</view> label="产线名称"
<!-- 备注区完成 --> >
<!-- 变更内容区 --> {{item.proLineName || '-'}}
<view class="title"> </u-form-item>
变更内容 <u-form-item
</view> :prop="'interceptPoints.' + index + '.point'"
borderBottom
label="拦截点位"
@click="showPointMark(item.proLineId,index)"
>
<u--input
:value="item.point"
disabled
disabledColor="#ffffff"
placeholder="请选择拦截点位"
border="none"
></u--input>
<u-icon
slot="right"
name="arrow-right"
></u-icon>
</u-form-item>
</view>
</template>
<view class="title"> 追溯赋牌 </view>
<view class="change-container"> <view class="change-container">
<view class="change-item"> <u-form-item
请登录PC端查看变更详情 prop="proLineName"
</view> borderBottom
</view> label="追溯状态"
@click="showTraceabilityMark"
<!-- 按钮区域 --> >
<view v-if="isView === '0' && status === 'true'" class="btns-container"> <u--input
<view class="btn reject-btn" @click="approveByAdmin('REJECT')"> :value="devMap[paichuForm.traceabilityMark]"
驳回 disabled
</view> disabledColor="#ffffff"
<view class="btn approve-btn" @click="approveByAdmin('CONSENT')"> placeholder="请选择追溯状态"
通过 border="none"
</view> ></u--input>
<u-icon
slot="right"
name="arrow-right"
></u-icon>
</u-form-item>
</view> </view>
</u-form>
<u-picker
:show="showMarkSelect"
:columns="devOptions"
keyName="dmpDeviceNumber"
@cancel="showMarkSelect = false"
@confirm="markSelect"
>
</u-picker>
<u-picker
:show="showPoint"
:columns="currentGxOptions"
keyName="gxName"
@cancel="showPoint = false"
@confirm="pointSelect"
>
</u-picker>
<view class="title">
追溯清单
</view>
<view class="remark-container">
<u-collapse
v-for="(item) in traceabilityVos"
:border="false"
@change="change"
@close="close"
@open="open"
>
<u-collapse-item
:title="item.jobNum?item.jobNum:'-'"
name="jobNum"
>
<view class="custom-table-collapse">
<view class="subTitleClass-collapse">
<view class="subRow-collapse">
<view class="subTitle"> 部品类型 </view>
<view class="subContent">
{{ getLabelByValue(traceablePartsTypeList, instanceDetail.formDto.partType)}}
</view>
</view>
<view class="subRow-collapse">
<view class="subTitle"> 当前产线 </view>
<view class="subContent">
{{ item.proLineName || '-' }}
</view>
</view>
<view class="subRow-collapse">
<view class="subTitle"> 当前位置 </view>
<view class="subContent">
{{ item.currentPosition || '-' }}
</view>
</view>
<view class="subRow-collapse">
<view class="subTitle"> 品质状态 </view>
<view class="subContent">
{{ qualityStatusMap[item.qualityStatus] || '-' }}
</view>
</view>
<view class="subRow-collapse">
<view class="subTitle"> 工件状态 </view>
<view class="subContent">
{{ isNormalOfflineMap[item.isNormalOffline] || '-' }}
</view>
</view>
</view>
</view>
</u-collapse-item>
</u-collapse>
</view>
<!-- 按钮区域 -->
<view class="btns-container">
<view class="btn reject-btn" v-if="processStatus && isUpdate" @click="handleClose('REJECT')"> 返回 </view>
<view class="btn approve-btn" v-if="processStatus && isUpdate" :loading="btnLoading" @click="handleConfirm('CONSENT')"> 确定 </view>
</view> </view>
</view> </view>
</template> </view>
</template>
<script>
import VerticalSteps from '@/components/vertical-steps/vertical-steps' <script>
import { getProcessNodeByInstanceId, approveByAdmin, getProcessInstanceStatus } from '../../api/system/approve' import VerticalSteps from '@/components/vertical-steps/vertical-steps';
import { parseTime } from '../../api/utils/ruoyi' import {
import { getDicts } from "../../api/system/baseConfig"; getCompletionDetail,
import { toast } from '../../utils/common' processCompletionApproval,
export default { getTraceabilityDetail,
name: "baseDetail", processCalibrationApproval
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 } from '../../api/system/approve';
// processId, processCode, processStatus, allowApprove, processName import { parseTime } from '../../api/utils/ruoyi';
this.processId = option.processId; import { getDicts } from '../../api/system/baseConfig';
this.processCode = option.processCode; import { baseUrl } from '../../config'
this.processStatus = option.processStatus; import { getToken } from '@/utils/auth'
this.isUpdate = option.allowApprove; export default {
this.processName = option.processName; name: 'baseDetail',
this.getList(); onLoad: function (option) {
this.toProcessInstanceInfo(); //option为object类型,会序列化上个页面传递的参数
}, // processId, processCode, processStatus, allowApprove, processName
components: { VerticalSteps }, this.processId = option.processId;
data() { this.processCode = option.processCode;
return { this.processStatus = option.processStatus;
processId: '', this.isUpdate = option.allowApprove && option.processStatus === '0';
processCode: '', this.processName = option.processName;
processStatus: '', this.getList();
allowApprove: '', this.getInstanceDetail();
processName: '', },
processType: '', components: { VerticalSteps },
label: '', data() {
instanceDetail: {}, return {
formData: { devOptions: [
remark: '' [
},
steps: [],
jobLevelList: [],
isView: '',
status: '',
// url
urlList: [
{
value: '0001',
url: '/staff/processApproval'
},
{
value: '1001',
url: '/aeclassesinfo/processApproval'
},
{
value: '1002',
url: '/accreditpostvalidity/processPostApproval'
},
{
value: '0002',
url: '/sysRoleMamager/processApproval'
},
{
value: '0004',
url: '/sysRoleMamager/non_processApproval'
},
{
value: '0003',
url: '/organization/processApproval'
},
{
value: '1020',
url: '/aeequipmenttype/processApproval'
},
{ {
value: '1030', text: '正常',
url: '/aeenginemodel/processApproval' businessId: '2',
dmpDeviceNumber: '追溯黄'
}, },
{ {
value: '1031', text: '不正常',
url: '/aeenginemodelextend/processApproval' businessId: '3',
}, dmpDeviceNumber: '追溯红'
{
value: '1032',
url: '/aemodelgx/processApproval'
},
{
value: '1043',
url: '/aeunit/processApproval'
},
{
value: '1042',
url: '/aepartinformation/processApproval'
},
{
value: '1040',
url: '/aetool/processApproval'
},
{
value: '1004',
url: '/aeprolineinfo/processApproval'
},
{
value: '1005',
url: '/aeprolinesegment/processApproval'
},
{
value: '1006',
url: '/aeprolinegx/processGxApproval'
},
{
value: '1041',
url: '/aeauxiliarymaterial/processApproval'
},
{
value: '1009',
url: '/aeprolinetray/processApproval'
},
{
value: '1007',
url: '/aetechequipment/processApproval'
},
{
value: '1008',
url: '/aetechassembly/processApproval'
},
{
value: '1010',
url: '/aetechequipment/all/processApproval'
},
{
value: '1011',
url: '/aetechassembly/all/processApproval'
},
{
value: '1021',
url: '/aeequipmentinfo/processApproval'
},
{
value: '1044',
url: '/aegroupproject/processApproval'
} }
] ]
],
devMap: {
'2': '追溯黄',
'3': '追溯红'
},
showMarkSelect: false,
showPoint: false,
currentGxOptions: [],
qualityStatusMap: {
'1': '正常',
'2': '品质黄',
'3': '品质红'
},
isNormalOfflineMap: {
'0': '正常下线',
'1': '未正常下线'
},
rules: {
traceabilityMark: [
{ required: true, message: '请选择追溯状态', trigger: 'change' }
]
},
gxOptions: {},
paichuForm: {
interceptPoints: [],
traceabilityMark: null
},
// 文件上传路径前缀
temp: 'project',
// 水桶
bucket: 'qms-ae',
baseUrl,
fileIcon: require('../../static/images/fileIcon.png'),
initiateDepartmentList: [],
traceablePartsTypeList: [],
currnetIndex: 0,
fileList: [],
traceabilityVos: null,
btnLoading:false,
rules: {
formResultOne: [
{ required: true, message: '请选择日期' },
],
},
showApproval: false,
selectOptions: [
{ label: '本次强制开机', value: '本次强制开机' },
{ label: '本次禁止开机', value: '本次禁止开机' },
{ label: '改正后开机', value: '改正后开机' },
],
tpmOptions: [
{ label: '本次强制开机', value: '本次强制开机' },
{ label: '本次禁止开机', value: '本次禁止开机' },
{ label: '改正后开机', value: '改正后开机' },
],
formResultOne: null,
showFormResultOne: false,
isLoading: false,
processId: '',
processCode: '',
processStatus: '',
allowApprove: '',
processName: '',
processType: '',
label: '',
instanceDetail: {
approves: [],
toolCheckDto: {},
materialDto: {},
tmpInfoDTO: {},
},
// 发起时间
initiateDate: '',
approve: {
processInstanceId: null,
instanceApproveId: null,
hasConfirm: true,
formResult: null,
formResultOne: null,
formResultTwo: null,
approveOpinion: 1,
selectOption: null,
},
// 流程实例详情列表
instanceDetailList: [],
formData: {
remark: '',
},
steps: [],
jobLevelList: [],
isView: '',
status: '',
};
},
computed: {
pointShow () {
return (data) => {
return this.gxOptions[data]
} }
}, },
computed: {
// 计算属性 // 根据processCode进行动态页面渲染
parseTimeA() { // 所有预警告警不显示处理结果
return (time, format) => { getFlag() {
return parseTime(time, format || '{m}-{d} {h}:{i}:{s}') return !(
} this.processCode === '00003' ||
this.processCode === '00006' ||
this.processCode === '00010' ||
this.processCode === '00013' ||
this.processCode === '00002' ||
this.processCode === '00005' ||
this.processCode === '00009' ||
this.processCode === '00012'
);
},
// 计算属性
parseTimeA() {
return (time, format) => {
return parseTime(time, format || '{m}-{d} {h}:{i}:{s}');
};
},
},
methods: {
showPointMark(proLineId,index) {
if (this.isUpdate && this.processStatus === '0') {
this.showPoint = true;
this.currentGxOptions = [this.gxOptions[proLineId]]
this.currnetIndex = index
}
},
markSelect(e) {
console.log('confirm', e)
this.paichuForm.traceabilityMark = e.value[0].businessId;
console.log('this.paichuForm.traceabilityMark', this.paichuForm.traceabilityMark);
this.showMarkSelect = false;
},
pointSelect(e) {
console.log('pointSelectconfirm', e)
const data = e.value[0].businessId
const temp = this.paichuForm.interceptPoints[this.currnetIndex]
temp.point = data;
if (data == 'null') {
temp['interceptMehtod'] = '1'
} else {
temp['interceptMehtod'] = '2'
}
this.showMarkSelect = false;
},
showTraceabilityMark() {
if (this.isUpdate && this.processStatus === '0') {
this.showMarkSelect = true;
}
},
afterRead(event) {
console.log('event',event);
console.log('this.baseUrl',this.baseUrl);
const uploadFileUrl= `${this.baseUrl}/common/fileUpload?temp=${
this.temp
}&bucket=${this.bucket}`;
const file = event.file[0]; // 获取上传的文件对象
uni.uploadFile({
url: uploadFileUrl, //仅为示例,非真实的接口地址
filePath: file.url,
name: 'file', // 与后端约定的文件字段名
header: {
Authorization: 'Bearer ' + getToken()
}, },
success: (res) => {
const data = JSON.parse(res.data);
if (data.code === 200) {
const {
data: { url, path, originalName, businessId }
} = data
this.fileList.push({ url, path, name: originalName, businessId })
uni.$u.toast('上传成功')
} else {
uni.$u.toast('上传文件失败,请重试')
}
}
});
}, },
methods: { // 删除图片
/** deletePic() {
* 获取审批url this.fileList = [];
* @returns {string}
*/
getUrl() {
const type = this.instanceDetail.processType
let url = ''
this.urlList.forEach(item => {
if (item.value === type) {
url = item.url
}
})
return url
}, },
async approveByAdmin(type) { blur() {
this.btnLoading = true this.approve.formResult = this.approve.formResultTwo
// 审批
await approveByAdmin({
instanceId: this.processId,
approveId: this.instanceDetail.currentApprove.businessId,
approveControl: type,
url: this.getUrl(),
processGroup: '1'
}).catch(() => {
this.isView = ''
})
// 回调获取流程实例的状态
const { data } = await getProcessInstanceStatus(this.processId)
// 异常结束
if (data === '6') {
toast('流程异常结束,请检查对应流程')
} else {
toast('审批成功')
this.$tab.reLaunch('/pages/index')
}
}, },
/** 查询字典数据列表 */ formResultOneConfirm(e) {
getList() { this.showFormResultOne = false;
getDicts('sys_job_level').then(response => { this.approve.formResultOne = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
// console.log("查询数据字段狗",response) this.approve.formResult = this.approve.formResultOne;
const jobLevelForm = response.data },
for (const item of jobLevelForm) { formResultOneClose() {
const result = { this.showFormResultOne = false;
value: item.dictValue, },
label: item.dictLabel hideKeyboard() {
} uni.hideKeyboard();
this.jobLevelList.push(result) },
} getProcessType() {
if (
this.processCode === '00002' ||
this.processCode === '00003' ||
this.processCode === '00004'
) {
return '标定';
}
if (
this.processCode === '00005' ||
this.processCode === '00006' ||
this.processCode === '00007'
) {
return 'TPM';
}
if (this.processCode === '00009' || this.processCode === '00010') {
return '工具';
}
if (this.processCode === '00012' || this.processCode === '00013') {
return '辅材';
}
},
/**
* 获取流程实例详情
*/
async getInstanceDetail () {
this.isLoading = true
getTraceabilityDetail(this.processId).then(res => {
if (res.code === 200) {
this.instanceDetail = res.data
this.instanceDetailList.push(res.data.formDto)
this.processName = res.data.formDto.processName
this.initiateDate = res.data.formDto.initiateDate
this.traceabilityVos = res.data.traceabilityVos
this.paichuForm.interceptPoints = res.data.formDto.interceptPoints ? res.data.formDto.interceptPoints : []
this.paichuForm.traceabilityMark = res.data.formDto.traceabilityMark
this.fileList = res.data.formDto.attachment ? [JSON.parse(res.data.formDto.attachment)] : []
this.getLineById(this.paichuForm.interceptPoints)
this.updateInterceptPointsRules()
// 统一处理步骤生成
if (res.data) {
this.steps = [
{ title: '发起', content: {} },
{ title: '综合审批', content: this.instanceDetail.approves},
];
}
}
})
this.isLoading = false
},
updateInterceptPointsRules() {
const interceptPointsRules = {};
if ( this.paichuForm.interceptPoints && this.paichuForm.interceptPoints.length > 0) {
this.paichuForm.interceptPoints.forEach((item, index) => {
interceptPointsRules[`interceptPoints.${index}.point`] = [
{ required: true, message: '请选择拦截点位', trigger: 'change' }
];
});
this.rules = {
...this.rules,
...interceptPointsRules
};
}
},
// 根据工件查询产线
getLineById (data) {
if (data && data.length > 0) {
// 根据PROLINEID循环调用查询工序options
data.forEach(item => {
getGxByProLinId({
prolineIds: item.proLineId,
gxTypes: '4'
}).then(gxRes => {
this.$set(this.gxOptions, item.proLineId, [{businessId: 'null', gxName: '发现即拦截'}, ...gxRes.data])
console.log('gxOptions', this.gxOptions)
})
}) })
}
},
/**
* 审批
* @returns {Promise<void>}
*/
handleConfirm() {
this.$refs.paichuForm.validate().then(async res => {
console.log('111111111111111111111111')
this.btnLoading = true
this.instanceDetail.approves.forEach(item => {
if (item.currentNode === '1') {
this.approve.instanceApproveId = item.businessId
this.approve.processInstanceId = item.instanceId
}
})
this.paichuForm.interceptPoints.forEach(item => {
if (item['interceptMehtod'] === '1') {
item.point = null
}
})
this.approve['interceptPoints'] = this.paichuForm.interceptPoints
this.approve['jobNums'] = this.instanceDetail.formDto.jobNums
this.approve['traceabilityMark'] = this.paichuForm.traceabilityMark
this.approve['partType'] = this.instanceDetail.formDto.partType
console.log('this.approve', this.approve)
await processCalibrationApproval(this.approve)
.then(res => {
if (res.code === 200) {
uni.$u.toast('审批成功')
} else {
uni.$u.toast(res.message)
}
})
.catch(() => {
this.isUpdate = false
this.btnLoading = false
})
this.handleClose()
// 关闭所有的loading
this.btnLoading = false
this.isUpdate = false
this.$emit('success')
}).catch(errors => {
uni.$u.toast('校验失败')
})
}, },
/** handleClose() {
* 指定列表,根据值,取label this.$tab.reLaunch('/pages/index')
*/ },
getLabelByValue(list, value, key = 'value', label = 'label') { /** 查询字典数据列表 */
const item = list.find(item => item[key] === value) getList() {
return item ? item[label] : '-' getDicts('initiate_department').then(response => {
}, // console.log("查询数据字段狗",response)
/** const jobLevelForm = response.data;
* 获取审批节点详情 for (const item of jobLevelForm) {
*/ const result = {
toProcessInstanceInfo() { value: item.dictValue,
// 非追溯完成度异常 label: item.dictLabel,
if (this.processCode === '00016' || this.processCode === '00017') { };
console.log('1', this.processCode) this.initiateDepartmentList.push(result);
drawerShowEngineTrace.value = true
} else if (this.processCode !== '00019') {
console.log('2', this.processCode)
drawerShow.value = true
// drawerShowTraceError.value = true
} else {
console.log('3', this.processCode)
// 追溯完成度异常
drawerShowTraceError.value = true
} }
});
getDicts('traceable_parts_type').then(response => {
// console.log("查询数据字段狗",response)
const jobLevelForm = response.data;
for (const item of jobLevelForm) {
const result = {
value: item.dictValue,
label: item.dictLabel,
};
this.traceablePartsTypeList.push(result);
}
});
},
/**
* 指定列表,根据值,取label
*/
getLabelByValue(list, value, key = 'value', label = 'label') {
const item = list.find(item => item[key] === value);
return item ? item[label] : '-';
},
/**
* 获取审批节点详情
*/
toProcessInstanceInfo() {
// 非追溯完成度异常
if (this.processCode === '00016' || this.processCode === '00017') {
console.log('1', this.processCode);
drawerShowEngineTrace.value = true;
} else if (this.processCode !== '00019') {
console.log('2', this.processCode);
drawerShow.value = true;
// drawerShowTraceError.value = true
} else {
console.log('3', this.processCode);
// 追溯完成度异常
drawerShowTraceError.value = true;
} }
},
},
};
</script>
<style lang="scss" scoped>
.base-detail {
background: #ffffff;
min-height: 100vh;
// height: 100vh;
.container {
.title {
font-family:
PingFangSC,
PingFang SC;
font-weight: 500;
font-size: 40rpx;
color: #0b0b0b;
text-align: left;
font-style: normal;
text-transform: none;
padding: 52rpx 32rpx 20rpx 32rpx;
border-bottom: 2rpx solid #f2f2f2;
} }
} }
</script>
.step-container {
<style lang="scss" scoped> padding-left: 44rpx;
.base-detail { padding-right: 26rpx;
background: #FFFFFF; }
min-height: 100vh;
.custom-table {
// height: 100vh; background: #f9f9f9;
.container { border-radius: 10rpx;
.title { padding: 32rpx;
font-family: PingFangSC, PingFang SC; }
font-weight: 500;
font-size: 40rpx; .subTitleClass {
color: #0B0B0B; font-family:
text-align: left; PingFangSC,
font-style: normal; PingFang SC;
text-transform: none; font-weight: 400;
padding: 52rpx 32rpx 20rpx 32rpx; font-size: 28rpx;
border-bottom: 2rpx solid #F2F2F2; color: #9a9a9a;
} text-align: left;
} font-style: normal;
text-transform: none;
.step-container { }
padding-left: 44rpx;
padding-right: 26rpx; .subRow {
display: flex;
justify-content: space-between;
margin-bottom: 12rpx;
.subTitle {
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #9a9a9a;
text-align: left;
font-style: normal;
text-transform: none;
min-width: 120rpx;
} }
.custom-table { .subContent {
background: #F9F9F9; font-family:
border-radius: 10rpx; PingFangSC,
padding: 32rpx; PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #222222;
text-align: right;
font-style: normal;
text-transform: none;
} }
}
.subTitleClass { .custom-table-collapse {
font-family: PingFangSC, PingFang SC;
padding: 32rpx;
}
.subTitleClass-collapse {
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #9a9a9a;
text-align: left;
font-style: normal;
text-transform: none;
}
.subRow-collapse {
display: flex;
justify-content: space-between;
margin-bottom: 12rpx;
.subTitle {
font-family:
PingFangSC,
PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #9A9A9A; color: #9a9a9a;
text-align: left; text-align: left;
font-style: normal; font-style: normal;
text-transform: none; text-transform: none;
min-width: 120rpx;
} }
.subRow { .subContent {
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #222222;
text-align: right;
font-style: normal;
text-transform: none;
}
}
::v-deep .u-collapse-item__content__text{
padding: 0;
}
::v-deep .u-collapse-item {
background: #f9f9f9;
border-radius: 10rpx;
}
.remark-container {
padding: 28rpx 46rpx 0 48rpx;
border-radius: 10rpx;
margin: 0 auto;
.upload-finish {
display: flex; display: flex;
justify-content: space-between; justify-content: center;
margin-bottom: 12rpx; flex-direction: column;
align-items: center;
.subTitle { .file-title{
font-family: PingFangSC, PingFang SC; font-family: PingFangSC, PingFang SC;
font-weight: 400; font-weight: 500;
font-size: 28rpx; color: #333399;
color: #9A9A9A; font-style: normal;
text-align: left; }
font-style: normal; .file-status{
text-transform: none; font-family: PingFangSC, PingFang SC;
min-width: 120rpx; font-weight: 400;
} color: #999999;
font-style: normal;
.subContent { }
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #222222;
text-align: right;
font-style: normal;
text-transform: none;
}
} }
.remark-container { // 新增卡片间距
padding: 28rpx 46rpx 0 48rpx; & > view {
margin-bottom: 20rpx;
::v-deep .u-form-item__body__left__content__label {
font-family: PingFangSC, PingFang SC; &:last-child {
font-weight: 500; margin-bottom: 0;
font-size: 28rpx;
color: #111111;
text-align: left;
font-style: normal;
text-transform: none;
margin-bottom: 14rpx;
} }
} }
.change-container { ::v-deep .u-form-item__body__left__content__label {
padding: 28rpx 46rpx 0 48rpx; font-family:
PingFangSC,
.change-item { PingFang SC;
width: 684rpx; font-weight: 500;
height: 140rpx; font-size: 28rpx;
color: #111111;
text-align: left;
font-style: normal;
text-transform: none;
margin-bottom: 14rpx;
}
.rmark-card {
background: #f9f9f9;
border-radius: 20rpx;
padding: 0rpx 40rpx 0 38rpx;
.subRow {
display: flex; display: flex;
justify-content: space-between;
margin-bottom: 12rpx;
border-bottom: 2rpx solid #e9e9e9;
padding-bottom: 12rpx;
align-items: center; align-items: center;
justify-content: center;
background: #FFFBF0; &:last-child {
font-family: PingFangSC, PingFang SC; border-bottom: none;
font-weight: 400; padding-bottom: 0;
font-size: 28rpx; }
color: #F4850E;
line-height: 36rpx; height: 96rpx;
font-style: normal;
.subTitle {
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #666666;
text-align: left;
font-style: normal;
text-transform: none;
min-width: 120rpx;
}
.subContent {
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #111111;
text-align: right;
font-style: normal;
text-transform: none;
}
.expire-color {
color: red !important;
}
} }
} }
} }
.btns-container { .change-container {
display: flex; padding: 28rpx 46rpx 0 48rpx;
justify-content: center;
gap: 16rpx; .change-item {
padding: 40rpx 0; width: 684rpx;
height: 140rpx;
.btn {
width: 312rpx;
height: 96rpx;
border-radius: 56rpx;
font-family: PingFangSC, PingFang SC;
font-weight: 400;
font-size: 34rpx;
line-height: 48rpx;
text-align: center;
font-style: normal;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: #fffbf0;
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 28rpx;
color: #f4850e;
line-height: 36rpx;
font-style: normal;
} }
}
.reject-btn { ::v-deep .u-upload__wrap{
border: 2rpx solid #333399; justify-content: center;
color: #333399; uni-view{
} align-items: center;
.approve-btn {
background: #333399;
color: #FFFFFF;
} }
} }
</style> .u-collapse+.u-collapse{
\ No newline at end of file margin-top: 20rpx;
}
}
.btns-container {
display: flex;
justify-content: center;
gap: 16rpx;
padding: 40rpx 0;
.btn {
width: 312rpx;
height: 96rpx;
border-radius: 56rpx;
font-family:
PingFangSC,
PingFang SC;
font-weight: 400;
font-size: 34rpx;
line-height: 48rpx;
text-align: center;
font-style: normal;
display: flex;
align-items: center;
justify-content: center;
}
.reject-btn {
border: 2rpx solid #333399;
color: #333399;
}
.approve-btn {
background: #333399;
color: #ffffff;
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment