update 巡检待确认

This commit is contained in:
lb 2024-02-23 11:20:04 +08:00
parent 4d1b72fae7
commit 99b225e3dc
3 changed files with 96 additions and 164 deletions

View File

@ -21,10 +21,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col> <el-col>
<el-form-item <el-form-item label="部门" prop="departmentId">
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select <el-select
v-model="dataForm.departmentId" v-model="dataForm.departmentId"
:placeholder="`请选择部门`"> :placeholder="`请选择部门`">

View File

@ -29,41 +29,20 @@
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养计划单号" prop="maintainOrderNumber"> <el-form-item label="巡检单名称" prop="name">
<!-- :rules="[
{
required: true,
message: '请输入保养计划单号',
trigger: 'blur',
},
]" -->
<el-input <el-input
v-model="form.maintainOrderNumber" v-model="form.name"
disabled placeholder="请输入巡检单名称" />
:placeholder="`请输入保养计划单号`" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养计划名称" prop="planName">
<el-input
v-model="form.planName"
placeholder="请输入保养计划名称"
disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门" prop="departmentId"> <el-form-item label="部门" prop="departmentId">
<!-- :rules="[
{ required: true, message: '请选择部门', trigger: 'blur' },
]" -->
<el-select <el-select
v-model="form.departmentId" v-model="form.departmentId"
:placeholder="`请选择部门`" filterable
clearable clearable
disabled :placeholder="`请选择部门`">
filterable>
<el-option <el-option
v-for="opt in departmentOptions" v-for="opt in departmentOptions"
:key="opt.value" :key="opt.value"
@ -74,18 +53,42 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="产线" prop="lineId"> <el-form-item label="班次" prop="groupClass">
<!-- :rules="[
{ required: true, message: '请选择产线', trigger: 'blur' },
]" -->
<el-select <el-select
v-model="form.lineId" v-model="form.groupClass"
:placeholder="`请选择产线`" filterable
disabled clearable
multiple
style="width: 100%"
placeholder="请选择班次">
<el-option
v-for="d in groupOptions"
:key="d.value"
:label="d.label"
:value="d.label" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="巡检人"
prop="checkPerson"
:rules="[
{
required: true,
message: '请选择巡检人',
trigger: 'blur',
},
]">
<el-select
v-model="form.checkPerson"
:placeholder="`请选择巡检人`"
multiple
clearable clearable
filterable> filterable>
<el-option <el-option
v-for="opt in lineOptions" v-for="opt in inspectorOptions"
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.value" /> :value="opt.value" />
@ -94,112 +97,25 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer"> <el-form-item label="巡检时间" prop="planStartTime">
<el-select
v-model="form.planMaintainWorker"
placeholder="请选择计划保养人员"
disabled
clearable
filterable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划开始时间" prop="planStartTime">
<el-date-picker <el-date-picker
v-model="form.planStartTime" v-model="form.planStartTime"
type="datetime" type="datetime"
disabled
placeholder="请选择计划开始时间" placeholder="请选择计划开始时间"
value-format="timestamp"></el-date-picker> value-format="timestamp"></el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <!-- <el-col :span="24">
<el-form-item label="计划结束时间" prop="planEndTime">
<el-date-picker
v-model="form.planEndTime"
type="datetime"
disabled
placeholder="请选择计划结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="实际开始时间"
prop="startTime"
:rules="[
{
required: true,
message: '请选择实际开始时间',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="请选择实际开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="实际结束时间"
prop="endTime"
:rules="[
{
required: true,
message: '请选择实际结束时间',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.endTime"
type="datetime"
placeholder="请选择实际结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="实际保养人员"
prop="maintainWorker"
:rules="[
{
required: true,
message: '请选择实际保养人员',
trigger: 'blur',
},
]">
<el-select
v-model="form.maintainWorker"
:placeholder="`请选择实际保养人员`"
multiple
clearable
filterable>
<el-option
v-for="opt in maintainerOptions"
: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-form-item label="备注" prop="remark">
<el-input v-model="form.remark" :placeholder="`请输入备注`" /> <el-input v-model="form.remark" :placeholder="`请输入备注`" />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
</el-row> </el-row>
</el-form> </el-form>
</div> </div>
<SmallTitle>保养内容</SmallTitle> <SmallTitle>巡检内容</SmallTitle>
<div style="margin-top: 12px; position: relative"> <div style="margin-top: 12px; position: relative">
<SearchBar <SearchBar
@ -212,7 +128,7 @@
<div style="position: absolute; top: -40px; right: 0"> <div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text"> <el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
添加属性 添加内容
</el-button> </el-button>
</div> </div>
<base-table <base-table
@ -302,9 +218,8 @@ export default {
btnLoading: false, btnLoading: false,
form: {}, form: {},
formLoading: false, formLoading: false,
lineList: [],
maintainerList: [],
departmentList: [], departmentList: [],
inspectorOptions: [],
attrTableProps: [ attrTableProps: [
{ {
prop: 'equipmentName', prop: 'equipmentName',
@ -312,11 +227,11 @@ export default {
}, },
{ {
prop: 'program', prop: 'program',
label: '保养项目', label: '巡检项目',
}, },
{ {
prop: 'maintenanceDes', prop: 'maintenanceDes',
label: '保养描述', label: '巡检结果',
}, },
], ],
attrList: [], attrList: [],
@ -405,6 +320,7 @@ export default {
}, },
], ],
row: null, row: null,
groupOptions: [],
}; };
}, },
computed: { computed: {
@ -415,25 +331,11 @@ export default {
value: item.id, value: item.id,
})); }));
}, },
lineOptions() {
return (this.lineList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.id,
}));
},
maintainerOptions() {
return (this.maintainerList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.name,
}));
},
}, },
mounted() { mounted() {
this.getList('maintainer');
this.getList('department'); this.getList('department');
this.getList('line'); this.getList('groupClass');
this.getList('inspector');
}, },
methods: { methods: {
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
@ -480,10 +382,11 @@ export default {
}, },
init(row) { init(row) {
console.log('row', row);
this.visible = true; this.visible = true;
this.row = row; this.row = row;
this.getInfo(row); // this.getInfo(row);
this.getAttrList(row); // this.getAttrList(row);
}, },
async getInfo(row) { async getInfo(row) {
@ -521,22 +424,42 @@ export default {
async getList(source = 'department') { async getList(source = 'department') {
const urls = [ const urls = [
'/base/core-production-line/listAll',
'/base/core-department/listAll', '/base/core-department/listAll',
'/base/core-worker/listAll', '/base/group-classes/listAll',
]; ];
let res; let res;
switch (source) { switch (source) {
case 'department': case 'department':
res = await this.$axios(urls[1]); res = await this.$axios(urls[0]);
this.departmentList = res.data || []; this.departmentList = res.data || [];
break; break;
case 'maintainer': case 'inspector':
res = await this.$axios(urls[2]); let inspectorList = [];
this.maintainerList = res.data || []; const userlist = await this.$axios({
url: '/system/user/page',
params: { pageNo: 1, pageSize: 100 },
});
if (userlist.code == 0) {
inspectorList = inspectorList.concat(
(userlist.data?.list || []).map((item) => ({
label: item.username,
value: item.id,
}))
);
}
const workerlist = await this.$axios('/base/core-worker/listAll');
if (workerlist.code == 0) {
inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({
label: item.name,
value: item.id,
}))
);
}
this.inspectorOptions = inspectorList;
break; break;
case 'line': case 'groupClass':
res = await this.$axios(urls[0]); res = await this.$axios(urls[1]);
this.lineList = res.data || []; this.lineList = res.data || [];
break; break;
} }

View File

@ -57,11 +57,18 @@
@confirm="handleSubmit"> @confirm="handleSubmit">
<add ref="add" @refreshDataList="successSubmit" /> <add ref="add" @refreshDataList="successSubmit" />
</base-dialog> </base-dialog>
<!-- 添加巡检查看详情 --> <!-- 添加巡检查看详情 -->
<addOrUpdata <addOrUpdata
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
@refreshDataList="getList" /> @refreshDataList="getList" />
<edit
ref="content-edit"
v-if="editOpen"
@refreshDataList="getList"
@destroy="editOpen = false" />
</div> </div>
</template> </template>
@ -71,13 +78,15 @@ import addOrUpdata from './add-or-updata.vue';
import add from './Content-add.vue'; import add from './Content-add.vue';
import { parseTime } from '../../core/mixins/code-filter'; import { parseTime } from '../../core/mixins/code-filter';
import CheckOrderListTable from './CheckOrderListTable.vue'; import CheckOrderListTable from './CheckOrderListTable.vue';
import edit from './Content-edit.vue';
export default { export default {
name: 'SpecialEquipmentCheckConfig', name: 'SpecialEquipmentCheckConfig',
components: { addOrUpdata, add, CheckOrderListTable }, components: { addOrUpdata, add, edit, CheckOrderListTable },
mixins: [basicPageMixin], mixins: [basicPageMixin],
data() { data() {
return { return {
editOpen: false,
addOrUpdateVisible: false, addOrUpdateVisible: false,
addOrEditTitle: '', addOrEditTitle: '',
searchBarKeys: ['name'], searchBarKeys: ['name'],
@ -307,7 +316,12 @@ export default {
}); });
}, },
/** 编辑 */ /** 编辑 */
handleEdit(row) {}, handleEdit(row) {
this.editOpen = true;
this.$nextTick(() => {
this.$refs['content-edit'].init(row);
});
},
/** 确认巡检单 */ /** 确认巡检单 */
handleConfirm(row) {}, handleConfirm(row) {},
/** 删除巡检单 */ /** 删除巡检单 */
@ -376,5 +390,3 @@ export default {
}, },
}; };
</script> </script>