<template>
|
<j-modal
|
:title="title"
|
:width="800"
|
:visible="visible"
|
:confirmLoading="confirmLoading"
|
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
|
switchFullscreen
|
@ok="handleOk"
|
@cancel="handleCancel"
|
centered
|
cancelText="关闭"
|
>
|
|
<a-spin :spinning="spinning">
|
<a-form-model
|
ref="form"
|
:model="model"
|
:rules="validatorRules"
|
>
|
<a-divider
|
orientation="center"
|
style="font-size: large;font-style: italic;color: #66aeed;"
|
> 封存信息
|
</a-divider>
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="code"
|
label="单据号"
|
>
|
<a-input
|
v-model="model.code"
|
disabled
|
/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="equipmentId"
|
label="设备编码"
|
>
|
<lx-search-equipment-select
|
placeholder="请输入设备编号或名称搜索"
|
v-model="model.equipmentId"
|
disabled
|
></lx-search-equipment-select>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="sealUpReason"
|
label="封存原因"
|
>
|
<a-textarea
|
v-model="model.sealUpReason"
|
disabled
|
/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="reportUser_dictText"
|
label="申请人"
|
>
|
<a-input
|
v-model="model.reportUser_dictText"
|
disabled
|
/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
<a-row :gutter="24">
|
<a-col :span="24">
|
<a-form-model-item
|
:labelCol="labelColLong"
|
:wrapperCol="wrapperColLong"
|
prop="remark"
|
label="备注"
|
>
|
<a-textarea
|
v-model="model.remark"
|
disabled
|
/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
<div v-if="approvalDisable">
|
<a-divider
|
orientation="center"
|
style="font-size: large;font-style: italic;color: #66aeed;"
|
> 管理员封存审核
|
</a-divider>
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="approvalDealType"
|
label="审批类型"
|
>
|
<j-dict-select-tag
|
type="radio"
|
v-model="model.approvalDealType"
|
dictCode="approved_rejected"
|
placeholder="请选择处理类型"
|
:disabled="disableSubmit || returnDisable"
|
/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="approvalComment"
|
label="审批意见"
|
>
|
<a-textarea
|
placeholder="请输入意见"
|
v-model="model.approvalComment"
|
:disabled="disableSubmit || returnDisable"
|
/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</div>
|
<div v-if="confirmDisable">
|
<a-divider
|
orientation="center"
|
style="font-size: large;font-style: italic;color: #66aeed;"
|
> 管理员启封审核
|
</a-divider>
|
<a-row :gutter="24">
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="unsealApprovalDealType"
|
label="审批类型"
|
>
|
<j-dict-select-tag
|
type="radio"
|
v-model="model.unsealApprovalDealType"
|
dictCode="approved_rejected"
|
placeholder="请选择处理类型"
|
:disabled="disableSubmit || completionDisable"
|
/>
|
</a-form-model-item>
|
</a-col>
|
<a-col :span="12">
|
<a-form-model-item
|
:labelCol="labelCol"
|
:wrapperCol="wrapperCol"
|
prop="unsealApprovalComment"
|
label="审批意见"
|
>
|
<a-textarea
|
placeholder="请输入意见"
|
v-model="model.unsealApprovalComment"
|
:disabled="disableSubmit || completionDisable"
|
/>
|
</a-form-model-item>
|
</a-col>
|
</a-row>
|
</div>
|
</a-form-model>
|
</a-spin>
|
</j-modal>
|
</template>
|
|
<script>
|
import { getAction, httpAction } from '@/api/manage'
|
import LxSearchEquipmentSelect from '@views/eam/equipment/modules/LxSearchEquipmentSelect.vue'
|
|
export default {
|
name: 'EquipmentLeanOutApprovalModal',
|
components: {
|
LxSearchEquipmentSelect
|
},
|
props: {
|
selectShenpiData: {
|
type: Object
|
}
|
},
|
data() {
|
return {
|
title: '操作',
|
visible: false,
|
editable: false,
|
model: {},
|
treeData: [],
|
labelCol: {
|
xs: { span: 24 },
|
sm: { span: 5 }
|
},
|
wrapperCol: {
|
xs: { span: 24 },
|
sm: { span: 18 }
|
},
|
labelColLong: {
|
xs: { span: 24 },
|
sm: { span: 2 }
|
},
|
wrapperColLong: {
|
xs: { span: 24 },
|
sm: { span: 21 }
|
},
|
confirmLoading: false,
|
spinning: false,
|
imageSrc: null,
|
validatorRules: {
|
approvalDealType: [
|
{ required: true, message: '请选择通过或驳回!' }
|
],
|
unsealApprovalDealType: [
|
{ required: true, message: '请选择通过或驳回!' }
|
],
|
approvalComment: [
|
{ required: true, message: '请输入审批意见!' }
|
],
|
unsealApprovalComment: [
|
{ required: true, message: '请输入审批意见!' }
|
],
|
returnComment: [
|
{ required: true, message: '请输入归还备注!' }
|
],
|
confirmComment: [
|
{ required: true, message: '请输入确认意见!' }
|
]
|
},
|
url: {
|
queryById: '/eam/eamEquipmentSealUp/queryById',
|
approval: '/eam/eamEquipmentSealUp/approval',
|
loadProductionOptions: '/mdc/mdcProduction/loadProductionTreeOptions'
|
},
|
disableSubmit: false
|
}
|
},
|
created() {
|
this.loadAllProductionTree()
|
},
|
computed: {
|
approvalDisable: function () {
|
return ['WAIT_CHECK', 'SEALED', 'WAIT_UNSEALING_AUDIT', 'COMPLETE'].includes(this.model.sealStatus)
|
},
|
returnDisable: function () {
|
return ['SEALED', 'WAIT_UNSEALING_AUDIT', 'COMPLETE'].includes(this.model.sealStatus)
|
},
|
confirmDisable: function () {
|
return ['WAIT_UNSEALING_AUDIT', 'COMPLETE'].includes(this.model.sealStatus)
|
},
|
completionDisable: function () {
|
return ['COMPLETE'].includes(this.model.leanStatus)
|
}
|
},
|
methods: {
|
async handleDetail(item) {
|
this.initParams()
|
this.model = {}
|
let res = await getAction(this.url.queryById, { id: item.dataId })
|
this.model = Object.assign({}, res.result)
|
this.model.dataId = item.dataId
|
this.model.taskId = item.id
|
this.model.userId = item.assignee
|
this.model.instanceId = item.procInstId
|
this.model.values = item.variables
|
this.spinning = false;
|
},
|
|
recordDetail(record) {
|
console.log('record', record)
|
this.initParams()
|
this.model = Object.assign({}, record)
|
},
|
|
initParams() {
|
this.visible = true
|
this.spinning = true
|
},
|
|
async handleOk() {
|
const that = this
|
// 触发表单验证
|
this.$refs.form.validate(valid => {
|
if (valid) {
|
that.confirmLoading = that.spinning = true
|
let httpurl = this.url.approval
|
let method = 'put'
|
httpAction(httpurl, this.model, method).then((res) => {
|
if (res.success) {
|
that.$message.success(res.message)
|
that.$emit('searchReset')
|
that.close()
|
} else {
|
that.$message.warning(res.message)
|
}
|
}).finally(() => {
|
that.confirmLoading = that.spinning = false
|
})
|
} else {
|
return false
|
}
|
})
|
},
|
handleCancel() {
|
this.close()
|
},
|
|
close() {
|
this.$emit('close')
|
this.visible = false
|
this.$refs.form.clearValidate()
|
},
|
loadAllProductionTree() {
|
//加载车间选择树
|
getAction(this.url.loadProductionOptions).then(res => {
|
if (res.success) {
|
this.treeData = [...res.result]
|
} else {
|
that.$message.warning(res.message)
|
}
|
})
|
}
|
}
|
}
|
</script>
|
|
<style lang="less" scoped>
|
</style>
|