update 特种设备维修

This commit is contained in:
lb 2024-02-20 17:00:56 +08:00
parent 9f8d604456
commit eb0445f479
2 changed files with 262 additions and 58 deletions

View File

@ -13,7 +13,7 @@
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<!-- 维修单号 --> <!-- 维修单号 -->
<el-col :span="12"> <el-col :span="8">
<el-form-item <el-form-item
label="维修单号" label="维修单号"
prop="repairOrderNumber" prop="repairOrderNumber"
@ -28,39 +28,37 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 维修工 --> <!-- 产线名 -->
<el-col :span="12"> <el-col :span="8">
<el-form-item <el-form-item label="产线名" prop="lineId">
label="维修工"
prop="repairman"
:rules="[
{ required: true, message: '维修工不能为空', trigger: 'blur' },
]">
<el-input
v-model="form.repairman"
@change="$emit('update', form)"
placeholder="请输入维修工"
:disabled="disabled" />
</el-form-item>
</el-col>
<!-- 设备大类 -->
<el-col :span="12">
<el-form-item
label="设备大类"
prop="equipmentCategory"
:rules="[
{ required: true, message: '设备大类不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="form.equipmentCategory" v-model="formFilters.lineId"
:placeholder="`请选择设备大类`" :placeholder="`请选择产线`"
:disabled="disabled" :disabled="disabled"
clearable clearable
filterable filterable
@change="handleEqTypeChange"> @change="handleEqTypeChange">
<el-option <el-option
v-for="opt in equipmentTypeOptions" v-for="opt in lineOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 工段名 -->
<el-col :span="8">
<el-form-item label="工段名" prop="sectionId">
<el-select
v-model="formFilters.sectionId"
:placeholder="`请选择工段`"
:disabled="disabled"
clearable
filterable
@change="handleEqTypeChange">
<el-option
v-for="opt in sectionOptions"
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.value" /> :value="opt.value" />
@ -69,7 +67,7 @@
</el-col> </el-col>
<!-- 设备名称 --> <!-- 设备名称 -->
<el-col :span="12"> <el-col :span="8">
<el-form-item <el-form-item
label="设备名称" label="设备名称"
prop="equipmentId" prop="equipmentId"
@ -93,7 +91,7 @@
</el-col> </el-col>
<!-- 故障发生时间 --> <!-- 故障发生时间 -->
<el-col :span="12"> <el-col :span="8">
<el-form-item <el-form-item
label="故障发生时间" label="故障发生时间"
prop="faultTime" prop="faultTime"
@ -117,7 +115,7 @@
</el-col> </el-col>
<!-- 故障级别 --> <!-- 故障级别 -->
<el-col :span="12"> <el-col :span="8">
<el-form-item <el-form-item
label="故障级别" label="故障级别"
prop="faultLevel" prop="faultLevel"
@ -142,8 +140,98 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 故障类型 - 数据字典 -->
<el-col :span="8">
<el-form-item
label="故障类型"
prop="faultType"
:rules="[
{
required: true,
message: '故障类型不能为空',
trigger: 'blur',
},
]">
<el-select
v-model="form.faultType"
placeholder="故障类型"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 维修开始时间 -->
<el-col :span="8">
<el-form-item
label="维修开始时间"
prop="maintenanceStartTime"
:rules="[
{
required: true,
message: '维修开始时间不能为空',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.maintenanceStartTime"
type="datetime"
:disabled="disabled"
:placeholder="`请选择维修开始时间`"
value-format="timestamp"
format="yyyy-MM-dd HH:mm:ss"
clearable
@change="$emit('update', form)" />
</el-form-item>
</el-col>
<!-- 维修结束时间 -->
<el-col :span="8">
<el-form-item
label="维修结束时间"
prop="maintenanceFinishTime"
:rules="[
{
required: true,
message: '维修结束时间不能为空',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.maintenanceFinishTime"
type="datetime"
:disabled="disabled"
:placeholder="`请选择维修结束时间`"
value-format="timestamp"
format="yyyy-MM-dd HH:mm:ss"
clearable
@change="$emit('update', form)" />
</el-form-item>
</el-col>
<!-- 维修工 -->
<el-col :span="8">
<el-form-item
label="维修工"
prop="repairman"
:rules="[
{ required: true, message: '维修工不能为空', trigger: 'blur' },
]">
<el-input
v-model="form.repairman"
@change="$emit('update', form)"
placeholder="请输入维修工"
:disabled="disabled" />
</el-form-item>
</el-col>
<!-- 联系方式 --> <!-- 联系方式 -->
<el-col :span="24"> <el-col :span="8">
<el-form-item <el-form-item
label="联系方式" label="联系方式"
prop="repairmanPhone" prop="repairmanPhone"
@ -157,6 +245,117 @@
:disabled="disabled" /> :disabled="disabled" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<!-- 维修方式 - 数据字典 -->
<el-col :span="8">
<el-form-item
label="维修方式"
prop="repairMode"
:rules="[
{
required: true,
message: '维修方式不能为空',
trigger: 'blur',
},
]">
<el-select
v-model="form.repairMode"
placeholder="维修方式"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 维修结果 - 数据字典 -->
<el-col :span="8">
<el-form-item
label="维修结果"
prop="maintenanceResult"
:rules="[
{
required: true,
message: '维修结果不能为空',
trigger: 'blur',
},
]">
<el-select
v-model="form.maintenanceResult"
placeholder="维修结果"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<!-- 备注 -->
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
@change="$emit('update', form)"
placeholder="请输入备注"
:disabled="disabled" />
</el-form-item>
</el-col>
<!-- 故障明细 -->
<el-col :span="24">
<el-form-item
label="故障明细"
prop="faultDetail"
:rules="[
{
required: true,
message: '故障明细不能为空',
trigger: 'blur',
},
]"></el-form-item>
</el-col>
<!-- 维修描述 -->
<el-col :span="24">
<el-form-item label="维修描述" prop="maintenanceDetail"></el-form-item>
</el-col>
<!-- 维修附件 -->
<el-col :span="24">
<el-form-item label="维修附件" prop="files"></el-form-item>
</el-col>
<!-- 设备大类 -->
<!-- <el-col :span="8">
<el-form-item
label="设备大类"
prop="equipmentCategory"
:rules="[
{ required: true, message: '设备大类不能为空', trigger: 'blur' },
]">
<el-select
v-model="form.equipmentCategory"
:placeholder="`请选择设备大类`"
:disabled="disabled"
clearable
filterable
@change="handleEqTypeChange">
<el-option
v-for="opt in equipmentTypeOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col> -->
</el-row> </el-row>
</el-form> </el-form>
</template> </template>
@ -189,6 +388,10 @@ export default {
allSpeicalEquipments: [], allSpeicalEquipments: [],
uploadOpen: false, uploadOpen: false,
form: {}, form: {},
formFilters: {
lineId: null,
sectionId: null,
},
formLoading: true, formLoading: true,
dataLoaded: false, dataLoaded: false,
equipmentList: [], equipmentList: [],
@ -200,6 +403,8 @@ export default {
], ],
workerOptions: [], workerOptions: [],
planOptions: [], planOptions: [],
sectionOptions: [],
lineOptions: [],
}; };
}, },
watch: { watch: {

View File

@ -51,7 +51,7 @@
v-model="form" v-model="form"
:disabled="mode == 'detail'" /> :disabled="mode == 'detail'" />
</base-dialog> </base-dialog>
<CustomDialogForm <DetailDrawer
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getList" @refreshDataList="getList"
@ -61,7 +61,7 @@
<script> <script>
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import CustomDialogForm from './CustomDialogForm.vue'; import DetailDrawer from './CustomDialogForm.vue';
import { import {
deleteRepair, deleteRepair,
exportRepairLogExcel, exportRepairLogExcel,
@ -72,13 +72,13 @@ import DialogForm from './Repair--add.vue';
export default { export default {
name: 'SpecialEquipmentRepair', name: 'SpecialEquipmentRepair',
components: { CustomDialogForm, DialogForm }, components: { DetailDrawer, DialogForm },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
addOrUpdateVisible: false, addOrUpdateVisible: false,
searchBarKeys: [ searchBarKeys: [
'maintenanceStatus', 'maintenanceResult',
'createTime', 'createTime',
'equipmentId', 'equipmentId',
'specialType', 'specialType',
@ -167,7 +167,6 @@ export default {
filter: (v) => (v != null ? ['成功', '失败'][v] : ''), filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
}, },
{ prop: 'maintenanceDetail', label: '维修描述', width: 110 }, { prop: 'maintenanceDetail', label: '维修描述', width: 110 },
{ prop: '_detail', label: '查看详情', width: 110 },
{ {
prop: 'remark', prop: 'remark',
label: '备注', label: '备注',
@ -207,19 +206,19 @@ export default {
// }, // },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ // {
type: 'select', // type: 'select',
label: '设备大类', // label: '',
placeholder: '请选择设备大类', // placeholder: '',
param: 'specialType', // param: 'specialType',
onchange: true, // onchange: true,
selectOptions: [ // selectOptions: [
{ id: 1, name: '安全设备' }, // { id: 1, name: '' },
{ id: 2, name: '消防设备' }, // { id: 2, name: '' },
{ id: 3, name: '特种设备' }, // { id: 3, name: '' },
], // ],
filterable: true, // filterable: true,
}, // },
{ {
type: 'select', type: 'select',
label: '设备', label: '设备',
@ -229,13 +228,12 @@ export default {
}, },
{ {
type: 'select', type: 'select',
label: '状态', label: '维修结果',
placeholder: '请选择状态', placeholder: '请选择维修结果',
param: 'maintenanceStatus', param: 'maintenanceResult',
selectOptions: [ selectOptions: [
{ name: '未完成', id: '0' }, { name: '成功', id: '0' },
{ name: '完成', id: '1' }, { name: '失败', id: '1' },
{ name: '进行中', id: '2' },
], ],
}, },
// //
@ -282,7 +280,8 @@ export default {
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
maintenanceStatus: null, // maintenanceStatus: null,
maintenanceResult: null,
createTime: null, createTime: null,
equipmentId: null, equipmentId: null,
special: true, special: true,
@ -488,7 +487,7 @@ export default {
}, },
setSearchBarEquipmentList(eqList) { setSearchBarEquipmentList(eqList) {
this.$set( this.$set(
this.searchBarFormConfig[1], this.searchBarFormConfig[0],
'selectOptions', 'selectOptions',
eqList.map((item) => ({ eqList.map((item) => ({
name: item.name, name: item.name,