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

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

parent 072e77a0
...@@ -3,7 +3,7 @@ const ProcessGroupEnum = { ...@@ -3,7 +3,7 @@ const ProcessGroupEnum = {
/** /**
* 单据类型 AE * 单据类型 AE
*/ */
AE:'1', AE: '1',
/** /**
* 单据类型 MC * 单据类型 MC
...@@ -87,12 +87,12 @@ export function getProcessInstanceStatus(instanceId) { ...@@ -87,12 +87,12 @@ export function getProcessInstanceStatus(instanceId) {
// 1. 工具点检_根据流程实例id查找流程实例审批详情 // 1. 工具点检_根据流程实例id查找流程实例审批详情
export function getToolProcessDetail(businessId) { export function getToolProcessDetail(businessId) {
return request({ return request({
url: '/toolInspectMonitor/getDetail/'+businessId, url: '/toolInspectMonitor/getDetail/' + businessId,
method: 'get', method: 'get',
}) })
} }
// 2. 工具点检_工具点检流程审批 // 2. 工具点检_工具点检流程审批
export function toolProcessGxApproval(approve) { export function toolProcessGxApproval(approve) {
return request({ return request({
url: '/toolInspectMonitor/processToolApproval', url: '/toolInspectMonitor/processToolApproval',
method: 'post', method: 'post',
...@@ -101,29 +101,29 @@ export function getToolProcessDetail(businessId) { ...@@ -101,29 +101,29 @@ export function getToolProcessDetail(businessId) {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型 'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
} }
}) })
} }
// 1. 生产辅材_根据流程实例id查找流程实例审批详情 // 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',
...@@ -132,8 +132,8 @@ export function getTpmProcessDetail(businessId) { ...@@ -132,8 +132,8 @@ export function getTpmProcessDetail(businessId) {
'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',
...@@ -142,8 +142,8 @@ export function getTpmProcessDetail(businessId) { ...@@ -142,8 +142,8 @@ export function getTpmProcessDetail(businessId) {
'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',
...@@ -152,14 +152,14 @@ export function getTpmProcessDetail(businessId) { ...@@ -152,14 +152,14 @@ export function getTpmProcessDetail(businessId) {
'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',
...@@ -168,4 +168,32 @@ export function getTpmProcessDetail(businessId) { ...@@ -168,4 +168,32 @@ export function getTpmProcessDetail(businessId) {
'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型 'Content-Type': 'application/json;charset=UTF-8' // 接口修改传参类型
} }
}) })
}
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="审批详情"
:left-icon-color="'#fff'"
:bg-style="'#333399'"
:title-style="'color: #fff;font-weight: 500;font-size: 35rpx;'"
/>
<view class="container"> <view class="container">
<view class="title"> <view class="title">
基础数据变更({{ label }} {{ processName }}
</view> </view>
<!-- 步骤图区 --> <!-- 步骤图区 -->
<view class="step-container"> <view class="step-container">
<vertical-steps :steps="steps" :current-step="1"> <vertical-steps :steps="steps" :current-step="1">
<!-- 自定义内容 --> <!-- 自定义内容 -->
<template v-for="(step, index) in steps" #[`content-${index}`]> <template v-for="(step, index) in steps" #[`content-${index}`]>
<!-- 发起人 --> <!-- 发起人 -->
...@@ -18,27 +21,33 @@ ...@@ -18,27 +21,33 @@
<view class="custom-table"> <view class="custom-table">
<view class="subTitleClass"> <view class="subTitleClass">
<view class="subRow"> <view class="subRow">
<view class="subTitle"> <view class="subTitle"> 追溯批次号 </view>
员工姓名
</view>
<view class="subContent"> <view class="subContent">
{{ step.content.userName }} {{ instanceDetail.formDto.traceableNumber || '-' }}
</view> </view>
</view> </view>
<view class="subRow"> <view class="subRow">
<view class="subTitle"> <view class="subTitle"> 发起科室 </view>
员工职级
</view>
<view class="subContent"> <view class="subContent">
{{ getLabelByValue(jobLevelList, step.content.rank) }} {{ getLabelByValue(
initiateDepartmentList,
instanceDetail.formDto.initiateDepartment
) || '-' }}
</view> </view>
</view> </view>
<view class="subRow"> <view class="subRow">
<view class="subTitle"> <view class="subTitle"> 发起人 </view>
创建日期 <view class="subContent">
{{ instanceDetail.formDto.initiateUserName }}
</view> </view>
</view>
<view class="subRow">
<view class="subTitle"> 追溯部品类型 </view>
<view class="subContent"> <view class="subContent">
{{ parseTimeA(step.content.createTime, 'YYYY/MM/DD HH:mm') }} {{getLabelByValue(
traceablePartsTypeList,
instanceDetail.formDto.partType
) }}
</view> </view>
</view> </view>
</view> </view>
...@@ -46,95 +55,278 @@ ...@@ -46,95 +55,278 @@
</template> </template>
<!-- 审批人 --> <!-- 审批人 -->
<template v-else> <template v-else>
<view class="custom-table"> <u-collapse
<view class="subTitleClass"> v-for="(item) in step.content"
<view class="subRow"> :border="false"
<view class="subTitle"> @change="change"
部门 @close="close"
</view> @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>
</u-collapse-item>
</u-collapse>
</template> </template>
</template> </template>
</vertical-steps> </vertical-steps>
</view> </view>
<!-- 步骤图完成 --> <!-- 步骤图完成 -->
<!-- 备注区 --> <!-- 排出位置 -->
<view class="title"> <u-form ref="paichuForm" :model="paichuForm" labelWidth="120" :rules="rules">
备注信息 <view class="title"> 排出位置 </view>
<template v-for="(item, index) in paichuForm.interceptPoints">
<view class="change-container">
<!-- 计划标定日期 -->
<u-form-item
prop="proLineName"
borderBottom
label="产线名称"
>
{{item.proLineName || '-'}}
</u-form-item>
<u-form-item
: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> </view>
<view class="remark-container"> </template>
<u-form :model="instanceDetail"> <view class="title"> 追溯赋牌 </view>
<u-form-item label="访问区域" prop="remark" labelPosition="top" labelWidth="80"> <view class="change-container">
<u-textarea disabled v-model="instanceDetail.remarks" placeholder="-"></u-textarea> <u-form-item
prop="proLineName"
borderBottom
label="追溯状态"
@click="showTraceabilityMark"
>
<u--input
:value="devMap[paichuForm.traceabilityMark]"
disabled
disabledColor="#ffffff"
placeholder="请选择追溯状态"
border="none"
></u--input>
<u-icon
slot="right"
name="arrow-right"
></u-icon>
</u-form-item> </u-form-item>
</u-form>
</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 class="title">
变更内容 追溯清单
</view> </view>
<view class="change-container"> <view class="remark-container">
<view class="change-item"> <u-collapse
请登录PC端查看变更详情 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> </view>
<view class="subRow-collapse">
<!-- 按钮区域 --> <view class="subTitle"> 当前产线 </view>
<view v-if="isView === '0' && status === 'true'" class="btns-container"> <view class="subContent">
<view class="btn reject-btn" @click="approveByAdmin('REJECT')"> {{ item.proLineName || '-' }}
驳回
</view> </view>
<view class="btn approve-btn" @click="approveByAdmin('CONSENT')"> </view>
通过 <view class="subRow-collapse">
<view class="subTitle"> 当前位置 </view>
<view class="subContent">
{{ item.currentPosition || '-' }}
</view> </view>
</view> </view>
<view class="subRow-collapse">
<view class="subTitle"> 品质状态 </view>
<view class="subContent">
{{ qualityStatusMap[item.qualityStatus] || '-' }}
</view> </view>
</view> </view>
</template> <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>
</template>
<script> <script>
import VerticalSteps from '@/components/vertical-steps/vertical-steps' import VerticalSteps from '@/components/vertical-steps/vertical-steps';
import { getProcessNodeByInstanceId, approveByAdmin, getProcessInstanceStatus } from '../../api/system/approve' import {
import { parseTime } from '../../api/utils/ruoyi' getCompletionDetail,
import { getDicts } from "../../api/system/baseConfig"; processCompletionApproval,
import { toast } from '../../utils/common' getTraceabilityDetail,
export default { processCalibrationApproval
name: "baseDetail", } from '../../api/system/approve';
onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数 import { parseTime } from '../../api/utils/ruoyi';
import { getDicts } from '../../api/system/baseConfig';
import { baseUrl } from '../../config'
import { getToken } from '@/utils/auth'
export default {
name: 'baseDetail',
onLoad: function (option) {
//option为object类型,会序列化上个页面传递的参数
// processId, processCode, processStatus, allowApprove, processName // processId, processCode, processStatus, allowApprove, processName
this.processId = option.processId; this.processId = option.processId;
this.processCode = option.processCode; this.processCode = option.processCode;
this.processStatus = option.processStatus; this.processStatus = option.processStatus;
this.isUpdate = option.allowApprove; this.isUpdate = option.allowApprove && option.processStatus === '0';
this.processName = option.processName; this.processName = option.processName;
this.getList(); this.getList();
this.toProcessInstanceInfo(); this.getInstanceDetail();
}, },
components: { VerticalSteps }, components: { VerticalSteps },
data() { data() {
return { return {
devOptions: [
[
{
text: '正常',
businessId: '2',
dmpDeviceNumber: '追溯黄'
},
{
text: '不正常',
businessId: '3',
dmpDeviceNumber: '追溯红'
}
]
],
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: '', processId: '',
processCode: '', processCode: '',
processStatus: '', processStatus: '',
...@@ -142,180 +334,300 @@ ...@@ -142,180 +334,300 @@
processName: '', processName: '',
processType: '', processType: '',
label: '', label: '',
instanceDetail: {}, 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: { formData: {
remark: '' remark: '',
}, },
steps: [], steps: [],
jobLevelList: [], jobLevelList: [],
isView: '', isView: '',
status: '', status: '',
// url };
urlList: [
{
value: '0001',
url: '/staff/processApproval'
}, },
{ computed: {
value: '1001', pointShow () {
url: '/aeclassesinfo/processApproval' return (data) => {
}, return this.gxOptions[data]
{ }
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',
url: '/aeenginemodel/processApproval'
},
{
value: '1031',
url: '/aeenginemodelextend/processApproval'
},
{
value: '1032',
url: '/aemodelgx/processApproval'
},
{
value: '1043',
url: '/aeunit/processApproval'
}, },
{
value: '1042', // 根据processCode进行动态页面渲染
url: '/aepartinformation/processApproval' // 所有预警告警不显示处理结果
getFlag() {
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'
);
}, },
{ // 计算属性
value: '1040', parseTimeA() {
url: '/aetool/processApproval' return (time, format) => {
return parseTime(time, format || '{m}-{d} {h}:{i}:{s}');
};
}, },
{
value: '1004',
url: '/aeprolineinfo/processApproval'
}, },
{ methods: {
value: '1005', showPointMark(proLineId,index) {
url: '/aeprolinesegment/processApproval' if (this.isUpdate && this.processStatus === '0') {
this.showPoint = true;
this.currentGxOptions = [this.gxOptions[proLineId]]
this.currnetIndex = index
}
}, },
{ markSelect(e) {
value: '1006', console.log('confirm', e)
url: '/aeprolinegx/processGxApproval' 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() {
value: '1041', if (this.isUpdate && this.processStatus === '0') {
url: '/aeauxiliarymaterial/processApproval' this.showMarkSelect = true;
}
}, },
{ afterRead(event) {
value: '1009', console.log('event',event);
url: '/aeprolinetray/processApproval' 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('上传文件失败,请重试')
}
}
});
}, },
{ // 删除图片
value: '1007', deletePic() {
url: '/aetechequipment/processApproval' this.fileList = [];
}, },
{ blur() {
value: '1008', this.approve.formResult = this.approve.formResultTwo
url: '/aetechassembly/processApproval'
}, },
{ formResultOneConfirm(e) {
value: '1010', this.showFormResultOne = false;
url: '/aetechequipment/all/processApproval' this.approve.formResultOne = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
this.approve.formResult = this.approve.formResultOne;
}, },
{ formResultOneClose() {
value: '1011', this.showFormResultOne = false;
url: '/aetechassembly/all/processApproval'
}, },
{ hideKeyboard() {
value: '1021', uni.hideKeyboard();
url: '/aeequipmentinfo/processApproval'
}, },
{ getProcessType() {
value: '1044', if (
url: '/aegroupproject/processApproval' 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') {
computed: { return '工具';
// 计算属性 }
parseTimeA() { if (this.processCode === '00012' || this.processCode === '00013') {
return (time, format) => { return '辅材';
return parseTime(time, format || '{m}-{d} {h}:{i}:{s}')
} }
}, },
},
methods: {
/** /**
* 获取审批url * 获取流程实例详情
* @returns {string}
*/ */
getUrl() { async getInstanceDetail () {
const type = this.instanceDetail.processType this.isLoading = true
let url = '' getTraceabilityDetail(this.processId).then(res => {
this.urlList.forEach(item => { if (res.code === 200) {
if (item.value === type) { this.instanceDetail = res.data
url = item.url 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)
})
}) })
return url }
}, },
async approveByAdmin(type) { /**
* 审批
* @returns {Promise<void>}
*/
handleConfirm() {
this.$refs.paichuForm.validate().then(async res => {
console.log('111111111111111111111111')
this.btnLoading = true this.btnLoading = true
// 审批 this.instanceDetail.approves.forEach(item => {
await approveByAdmin({ if (item.currentNode === '1') {
instanceId: this.processId, this.approve.instanceApproveId = item.businessId
approveId: this.instanceDetail.currentApprove.businessId, this.approve.processInstanceId = item.instanceId
approveControl: type, }
url: this.getUrl(), })
processGroup: '1' this.paichuForm.interceptPoints.forEach(item => {
}).catch(() => { if (item['interceptMehtod'] === '1') {
this.isView = '' item.point = null
}
}) })
// 回调获取流程实例的状态 this.approve['interceptPoints'] = this.paichuForm.interceptPoints
const { data } = await getProcessInstanceStatus(this.processId) this.approve['jobNums'] = this.instanceDetail.formDto.jobNums
// 异常结束 this.approve['traceabilityMark'] = this.paichuForm.traceabilityMark
if (data === '6') { this.approve['partType'] = this.instanceDetail.formDto.partType
toast('流程异常结束,请检查对应流程') console.log('this.approve', this.approve)
await processCalibrationApproval(this.approve)
.then(res => {
if (res.code === 200) {
uni.$u.toast('审批成功')
} else { } else {
toast('审批成功') uni.$u.toast(res.message)
this.$tab.reLaunch('/pages/index')
} }
})
.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() {
this.$tab.reLaunch('/pages/index')
}, },
/** 查询字典数据列表 */ /** 查询字典数据列表 */
getList() { getList() {
getDicts('sys_job_level').then(response => { getDicts('initiate_department').then(response => {
// console.log("查询数据字段狗",response) // console.log("查询数据字段狗",response)
const jobLevelForm = response.data const jobLevelForm = response.data;
for (const item of jobLevelForm) { for (const item of jobLevelForm) {
const result = { const result = {
value: item.dictValue, value: item.dictValue,
label: item.dictLabel label: item.dictLabel,
};
this.initiateDepartmentList.push(result);
} }
this.jobLevelList.push(result) });
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 * 指定列表,根据值,取label
*/ */
getLabelByValue(list, value, key = 'value', label = 'label') { getLabelByValue(list, value, key = 'value', label = 'label') {
const item = list.find(item => item[key] === value) const item = list.find(item => item[key] === value);
return item ? item[label] : '-' return item ? item[label] : '-';
}, },
/** /**
* 获取审批节点详情 * 获取审批节点详情
...@@ -323,41 +635,43 @@ ...@@ -323,41 +635,43 @@
toProcessInstanceInfo() { toProcessInstanceInfo() {
// 非追溯完成度异常 // 非追溯完成度异常
if (this.processCode === '00016' || this.processCode === '00017') { if (this.processCode === '00016' || this.processCode === '00017') {
console.log('1', this.processCode) console.log('1', this.processCode);
drawerShowEngineTrace.value = true drawerShowEngineTrace.value = true;
} else if (this.processCode !== '00019') { } else if (this.processCode !== '00019') {
console.log('2', this.processCode) console.log('2', this.processCode);
drawerShow.value = true drawerShow.value = true;
// drawerShowTraceError.value = true // drawerShowTraceError.value = true
} else { } else {
console.log('3', this.processCode) console.log('3', this.processCode);
// 追溯完成度异常 // 追溯完成度异常
drawerShowTraceError.value = true drawerShowTraceError.value = true;
}
} }
} },
} },
</script> };
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.base-detail { .base-detail {
background: #FFFFFF; background: #ffffff;
min-height: 100vh; min-height: 100vh;
// height: 100vh; // height: 100vh;
.container { .container {
.title { .title {
font-family: PingFangSC, PingFang SC; font-family:
PingFangSC,
PingFang SC;
font-weight: 500; font-weight: 500;
font-size: 40rpx; font-size: 40rpx;
color: #0B0B0B; color: #0b0b0b;
text-align: left; text-align: left;
font-style: normal; font-style: normal;
text-transform: none; text-transform: none;
padding: 52rpx 32rpx 20rpx 32rpx; padding: 52rpx 32rpx 20rpx 32rpx;
border-bottom: 2rpx solid #F2F2F2; border-bottom: 2rpx solid #f2f2f2;
} }
} }
...@@ -367,16 +681,18 @@ ...@@ -367,16 +681,18 @@
} }
.custom-table { .custom-table {
background: #F9F9F9; background: #f9f9f9;
border-radius: 10rpx; border-radius: 10rpx;
padding: 32rpx; padding: 32rpx;
} }
.subTitleClass { .subTitleClass {
font-family: PingFangSC, PingFang SC; 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;
...@@ -388,10 +704,12 @@ ...@@ -388,10 +704,12 @@
margin-bottom: 12rpx; margin-bottom: 12rpx;
.subTitle { .subTitle {
font-family: PingFangSC, PingFang SC; 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;
...@@ -399,7 +717,9 @@ ...@@ -399,7 +717,9 @@
} }
.subContent { .subContent {
font-family: PingFangSC, PingFang SC; font-family:
PingFangSC,
PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #222222; color: #222222;
...@@ -408,12 +728,96 @@ ...@@ -408,12 +728,96 @@
text-transform: none; text-transform: none;
} }
} }
.custom-table-collapse {
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-size: 28rpx;
color: #9a9a9a;
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: #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 { .remark-container {
padding: 28rpx 46rpx 0 48rpx; padding: 28rpx 46rpx 0 48rpx;
border-radius: 10rpx;
margin: 0 auto;
.upload-finish {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
.file-title{
font-family: PingFangSC, PingFang SC;
font-weight: 500;
color: #333399;
font-style: normal;
}
.file-status{
font-family: PingFangSC, PingFang SC;
font-weight: 400;
color: #999999;
font-style: normal;
}
}
// 新增卡片间距
& > view {
margin-bottom: 20rpx;
&:last-child {
margin-bottom: 0;
}
}
::v-deep .u-form-item__body__left__content__label { ::v-deep .u-form-item__body__left__content__label {
font-family: PingFangSC, PingFang SC; font-family:
PingFangSC,
PingFang SC;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #111111; color: #111111;
...@@ -422,6 +826,57 @@ ...@@ -422,6 +826,57 @@
text-transform: none; text-transform: none;
margin-bottom: 14rpx; margin-bottom: 14rpx;
} }
.rmark-card {
background: #f9f9f9;
border-radius: 20rpx;
padding: 0rpx 40rpx 0 38rpx;
.subRow {
display: flex;
justify-content: space-between;
margin-bottom: 12rpx;
border-bottom: 2rpx solid #e9e9e9;
padding-bottom: 12rpx;
align-items: center;
&:last-child {
border-bottom: none;
padding-bottom: 0;
}
height: 96rpx;
.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;
}
}
}
} }
.change-container { .change-container {
...@@ -433,18 +888,29 @@ ...@@ -433,18 +888,29 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: #FFFBF0; background: #fffbf0;
font-family: PingFangSC, PingFang SC; font-family:
PingFangSC,
PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #F4850E; color: #f4850e;
line-height: 36rpx; line-height: 36rpx;
font-style: normal; font-style: normal;
} }
} }
::v-deep .u-upload__wrap{
justify-content: center;
uni-view{
align-items: center;
}
} }
.u-collapse+.u-collapse{
margin-top: 20rpx;
}
}
.btns-container { .btns-container {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 16rpx; gap: 16rpx;
...@@ -454,7 +920,9 @@ ...@@ -454,7 +920,9 @@
width: 312rpx; width: 312rpx;
height: 96rpx; height: 96rpx;
border-radius: 56rpx; border-radius: 56rpx;
font-family: PingFangSC, PingFang SC; font-family:
PingFangSC,
PingFang SC;
font-weight: 400; font-weight: 400;
font-size: 34rpx; font-size: 34rpx;
line-height: 48rpx; line-height: 48rpx;
...@@ -472,7 +940,7 @@ ...@@ -472,7 +940,7 @@
.approve-btn { .approve-btn {
background: #333399; background: #333399;
color: #FFFFFF; color: #ffffff;
}
} }
</style> }
\ No newline at end of file </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