projects/mesxc-lb #222

Merged
juzi merged 5 commits from projects/mesxc-lb into projects/mesxc-test 2024-02-29 17:04:21 +08:00
3 changed files with 68 additions and 89 deletions
Showing only changes of commit 889f4472e6 - Show all commits

View File

@ -23,7 +23,7 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="故障发生时间" prop="faultTime">
<span>{{ parseTime(dataForm.faultTime) }}</span>
<span style="color: #000a;">{{ parseTime(dataForm.faultTime) }}</span>
</el-form-item>
</el-col>
@ -43,7 +43,7 @@
<el-col :span="8">
<el-form-item label="故障级别" prop="faultLevel">
<span>
<span style="color: #000a;">
{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}
</span>
</el-form-item>
@ -51,7 +51,7 @@
<el-col :span="8">
<el-form-item label="故障类型" prop="faultType">
<span>
<span style="color: #000a;">
{{ getDictDataLabel('fault-type', dataForm.faultType) }}
</span>
</el-form-item>
@ -59,19 +59,19 @@
<el-col :span="8">
<el-form-item label="维修工" prop="repairman">
<span>{{ dataForm.repairman }}</span>
<span style="color: #000a;">{{ dataForm.repairman }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="联系方式" prop="repairmanPhone">
<span>{{ dataForm.repairmanPhone }}</span>
<span style="color: #000a;">{{ dataForm.repairmanPhone }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="维修方式" prop="repairMode">
<span>
<span style="color: #000a;">
{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}
</span>
</el-form-item>
@ -88,25 +88,25 @@
:disabled="disabled"
@delete="!disabled && handleDeleteFile(file, col.prop)" />
</div>
<p v-else>暂无附件</p>
<p v-else style="color: #000a;">暂无附件</p>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建时间" prop="createTime">
<span>{{ parseTime(dataForm.createTime) }}</span>
<span style="color: #000a;">{{ parseTime(dataForm.createTime) }}</span>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="创建人" prop="creator">
<span>{{ dataForm.creator }}</span>
<span style="color: #000a;">{{ dataForm.creator }}</span>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<span>{{ dataForm.remark }}</span>
<span style="color: #000a;">{{ dataForm.remark || '- 无 -' }}</span>
</el-form-item>
</el-col>
</el-row>
@ -159,8 +159,7 @@ const uploadedFile = {
document.body.removeChild(link);
},
},
mounted() {
},
mounted() {},
render: function (h) {
return (
<div
@ -338,6 +337,10 @@ export default {
overflow-y: auto;
}
.drawer-body__content >>> .el-form-item__label {
font-weight: 700;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;

View File

@ -29,7 +29,7 @@
</el-col>
<!-- 产线名 -->
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="产线名" prop="lineId">
<el-select
v-model="formFilters.lineId"
@ -45,10 +45,10 @@
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<!-- 工段名 -->
<el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="工段名" prop="sectionId">
<el-select
v-model="formFilters.sectionId"
@ -64,7 +64,7 @@
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-col> -->
<!-- 设备名称 -->
<el-col :span="8">
@ -116,16 +116,7 @@
<!-- 故障级别 -->
<el-col :span="8">
<el-form-item
label="故障级别"
prop="faultLevel"
:rules="[
{
required: true,
message: '故障级别不能为空',
trigger: 'blur',
},
]">
<el-form-item label="故障级别" prop="faultLevel">
<el-select
v-model="form.faultLevel"
placeholder="故障级别"
@ -216,12 +207,7 @@
<!-- 维修工 -->
<el-col :span="8">
<el-form-item
label="维修工"
prop="repairman"
:rules="[
{ required: true, message: '维修工不能为空', trigger: 'blur' },
]">
<el-form-item label="维修工" prop="repairman">
<el-select
v-model="form.repairman"
@change="$emit('update', form)"
@ -241,12 +227,7 @@
<!-- 联系方式 -->
<el-col :span="8">
<el-form-item
label="联系方式"
prop="repairmanPhone"
:rules="[
{ required: true, message: '联系方式不能为空', trigger: 'blur' },
]">
<el-form-item label="联系方式" prop="repairmanPhone">
<el-input
v-model="form.repairmanPhone"
@change="$emit('update', form)"
@ -257,16 +238,7 @@
<!-- 维修方式 - 数据字典 -->
<el-col :span="8">
<el-form-item
label="维修方式"
prop="repairMode"
:rules="[
{
required: true,
message: '维修方式不能为空',
trigger: 'blur',
},
]">
<el-form-item label="维修方式" prop="repairMode">
<el-select
v-model="form.repairMode"
placeholder="维修方式"
@ -308,7 +280,7 @@
</el-col>
<!-- 备注 -->
<el-col :span="24">
<el-col :span="8">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
@ -544,16 +516,16 @@ export default {
dataForm: {
handler(val) {
this.form = JSON.parse(JSON.stringify(val));
if (this.form.equipmentCategory != null) {
setTimeout(() => {
this.equipmentOptions = this.equipmentList
.filter((item) => item.special)
.filter(
(item) => item.specialType === this.form.equipmentCategory
)
.map((item) => ({ label: item.name, value: item.id }));
}, 1000);
}
// if (this.form.equipmentCategory != null) {
// setTimeout(() => {
// this.equipmentOptions = this.equipmentList
// .filter((item) => item.special)
// .filter(
// (item) => item.specialType === this.form.equipmentCategory
// )
// .map((item) => ({ label: item.name, value: item.id }));
// }, 1000);
// }
if (this.hasFiles) {
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
this.form.files = this.form.files ?? [];
@ -591,9 +563,9 @@ export default {
this.formLoading = true;
await this.getCode();
await this.initEquipment();
await this.initLines();
// await this.initLines();
await this.initWorker();
await this.initSections();
// await this.initSections();
this.formLoading = false;
this.isInit = false;
this.setInitWorker();
@ -602,36 +574,37 @@ export default {
/** 设置默认维修工为用户自己 */
setInitWorker() {
/** 获取用户自身id */
const userId = this.$store.getters.userId;
const nickname = this.$store.getters.nickname;
this.$nextTick(() => {
this.form.repairman = [userId];
this.form.repairman = [nickname];
});
},
/** 获取产线 */
async initLines() {
const res = await this.$axios('/base/core-production-line/listAll');
this.lineOptions = (res.data || []).map((item) => ({
label: item.name,
value: item.id,
}));
},
// async initLines() {
// const res = await this.$axios('/base/core-production-line/listAll');
// this.lineOptions = (res.data || []).map((item) => ({
// label: item.name,
// value: item.id,
// }));
// },
// /** */
// async initSections(byLineId) {
// this.formLoading = !this.isInit && true;
// const res = await this.$axios({
// url:
// byLineId && !this.isInit
// ? '/base/core-workshop-section/listByParentId?id=' + byLineId
// : '/base/core-workshop-section/listAll',
// });
// this.sectionOptions = (res.data || []).map((item) => ({
// label: item.name,
// value: item.id,
// }));
// this.formLoading = !this.isInit && false;
// },
/** 获取工段 */
async initSections(byLineId) {
this.formLoading = !this.isInit && true;
const res = await this.$axios({
url:
byLineId && !this.isInit
? '/base/core-workshop-section/listByParentId?id=' + byLineId
: '/base/core-workshop-section/listAll',
});
this.sectionOptions = (res.data || []).map((item) => ({
label: item.name,
value: item.id,
}));
this.formLoading = !this.isInit && false;
},
/** 获取设备 */
async initEquipment(type = 'special-equipment') {
const response = await this.$axios('/base/core-equipment/listAll');
@ -642,8 +615,8 @@ export default {
label: item.name,
value: item.id,
}));
this.equipmentOptions = equipmentOptions;
this.allSpeicalEquipments = equipmentOptions;
this.equipmentOptions = [...equipmentOptions];
this.allSpeicalEquipments = [...equipmentOptions];
},
/** 获取维修工 - 同时从用户表和员工表拉取数据 */
async initWorker() {
@ -659,7 +632,7 @@ export default {
list = list.concat(
(userList.data?.list || []).map((item) => ({
label: item.nickname,
value: item.id,
value: item.nickname,
}))
);
/** worker */
@ -669,7 +642,7 @@ export default {
list = list.concat(
(workerList.data || []).map((item) => ({
label: item.name,
value: item.id,
value: item.name,
}))
);
/** setting */

View File

@ -42,6 +42,7 @@
<base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="60%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
@ -146,6 +147,7 @@ export default {
label: '故障明细',
minWidth: 120,
showOverflowtooltip: true,
subcomponent: htmls,
},
{
prop: 'maintenanceStartTime',
@ -172,6 +174,7 @@ export default {
label: '维修描述',
showOverflowtooltip: true,
width: 110,
subcomponent: htmls,
},
{
prop: 'remark',