Bu işleme şunda yer alıyor:
lb 2024-03-01 11:16:53 +08:00
ebeveyn c66e82b152
işleme 4c41d6fad9
6 değiştirilmiş dosya ile 142 ekleme ve 43 silme

Dosyayı Görüntüle

@ -121,6 +121,11 @@ export default {
showOverflowtooltip: true,
filter: parseTime,
},
{
prop: 'checkPeriod',
label: '巡检频率(天/次)',
showOverflowtooltip: true,
},
{
width: 144,
prop: 'confirmTimeLimit',

Dosyayı Görüntüle

@ -50,6 +50,31 @@
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="巡检人" prop="checkPerson">
<el-select
v-model="dataForm.checkPerson"
:placeholder="`请选择巡检人`"
multiple
clearable
filterable>
<el-option
v-for="opt in inspectorOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="巡检时间" prop="planCheckTime">
<el-date-picker
v-model="dataForm.planCheckTime"
type="datetime"
placeholder="请选择计划开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<!-- <el-col>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
@ -71,7 +96,9 @@ export default {
id: null,
name: null,
departmentId: null,
groupClass: null,
groupClass: [],
checkPerson: [],
planCheckTime: null,
// special: true,
},
dataRule: {
@ -82,6 +109,7 @@ export default {
equipmentOptions: [],
groupOptions: [],
departmentOptions: [],
inspectorOptions: [],
};
},
mounted() {
@ -93,7 +121,9 @@ export default {
id: null,
name: null,
departmentId: null,
groupClass: null,
groupClass: [],
checkPerson: [],
planCheckTime: null,
// special: true,
};
},
@ -120,6 +150,31 @@ export default {
value: item.id,
}));
}
/** get user list and worker list */
let inspectorList = [];
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.nickname,
value: item.nickname,
}))
);
}
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.name,
}))
);
}
this.inspectorOptions = inspectorList;
/** endget */
this.formLoading = false;
} catch (err) {
this.formLoading = false;
@ -129,6 +184,8 @@ export default {
async init(row) {
if (!row || !row.id) {
/** 新增 */
this.dataForm.checkPerson = [this.$store.getters.nickname];
return;
}
const res = await this.$axios({
@ -176,7 +233,7 @@ export default {
status: 1,
// status: confirmed ? 2 : 1,
groupClass: this.dataForm.groupClass?.join(','),
checkPerson: this.$store.getters.nickname,
checkPerson: this.dataForm.checkPerson?.join(','),
},
});
if (res.code == 0) {

Dosyayı Görüntüle

@ -496,6 +496,9 @@ export default {
this.form[key] = res.data[key];
}
});
if (!res.data.checkPerson || res.data.checkPerson.trim() == '') {
this.form.checkPerson = [this.$store.getters.nickname];
}
this.formLoading = false;
}
this.formLoading = false;
@ -550,7 +553,7 @@ export default {
inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({
label: item.name,
value: item.id,
value: item.name,
}))
);
}

Dosyayı Görüntüle

@ -257,10 +257,17 @@ export default {
this.$message.warning('请选择待确认的巡检单');
return;
}
const res = await this.$axios({
let checkPersonParam = '';
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
const res = this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` +
checkPersonParam,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put',
data: this.$refs['check-order-list-table'].selectedOrder.map(
(item) => item.id
@ -301,7 +308,11 @@ export default {
/** 按钮、选择权限 */
checkConfirmPermission(row) {
const isAdmin = false; //
return !row.confirmDueTime || row.confirmDueTime >= new Date().getTime() || isAdmin;
return (
!row.confirmDueTime ||
row.confirmDueTime >= new Date().getTime() ||
isAdmin
);
},
/** 编辑 */
@ -318,10 +329,16 @@ export default {
this.$modal
.confirm('是否确认巡检单"' + row.name + '"?')
.then(() => {
let checkPersonParam = '';
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
return this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.nickname,
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` +
checkPersonParam,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put',
data: [id],

Dosyayı Görüntüle

@ -30,37 +30,37 @@
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="巡检单名称" prop="name">
{{ form.name }}
<div style="">{{ form.name }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="department">
{{ form.department }}
<div style="">{{ form.department }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班次" prop="groupClass">
{{ form.groupClass }}
<div style="">{{ form.groupClass || '---' }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="巡检人" prop="checkPerson">
{{ form.checkPerson }}
<div style="">{{ form.checkPerson || '---' }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="巡检时间" prop="planCheckTime">
{{ form.planCheckTime | parseTime }}
<div style="">{{ form.planCheckTime | parseTime }}</div>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="确认人" prop="confirmPerson">
{{ form.confirmPerson }}
<div style="">{{ form.confirmPerson || '---' }}</div>
</el-form-item>
</el-col>
</el-row>

Dosyayı Görüntüle

@ -15,33 +15,17 @@
v-loading="formLoading"
label-position="top">
<el-row :gutter="20">
<el-col>
<el-col :span="12">
<el-form-item label="巡检单名称" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" />
</el-form-item>
</el-col>
<el-col>
<el-col :span="12">
<el-form-item label="巡检单编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入巡检单编码" />
</el-form-item>
</el-col>
<el-col>
<el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select
v-model="dataForm.departmentId"
:placeholder="`请选择部门`">
<el-option
v-for="opt in departmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-col :span="12">
<el-form-item label="计划巡检时间" prop="planCheckTime">
<el-date-picker
v-model="dataForm.planCheckTime"
@ -51,15 +35,24 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-form-item label="巡检频率(天/次)" prop="checkPeriod">
<el-input
v-model="dataForm.confirmTimeLimit"
:placeholder="`请输入确认时限`" />
<!-- <el-date-picker
v-model="dataForm.confirmTimeLimit"
type="datetime"
:placeholder="`请选择确认时限`"
value-format="timestamp" /> -->
v-model="dataForm.checkPeriod"
placeholder="请输入巡检频率(天/次)" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门" prop="departmentId">
<el-select
v-model="dataForm.departmentId"
:placeholder="`请选择部门`">
<el-option
v-for="opt in departmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@ -79,6 +72,20 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-input
v-model="dataForm.confirmTimeLimit"
:placeholder="`请输入确认时限`" />
<!-- <el-date-picker
v-model="dataForm.confirmTimeLimit"
type="datetime"
:placeholder="`请选择确认时限`"
value-format="timestamp" /> -->
</el-form-item>
</el-col>
<el-col>
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
@ -125,6 +132,15 @@ export default {
planCheckTime: [
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' },
],
checkPeriod: [
{ required: true, message: '巡检频率不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字类型',
trigger: 'blur',
transform: (val) => Number(val),
},
],
},
equipmentOptions: [],
groupOptions: [],
@ -145,6 +161,7 @@ export default {
confirmTimeLimit: null,
groupClass: null,
remark: null,
checkPeriod: null
// special: true,
};
},