update 群里反馈的

This commit is contained in:
lb 2024-02-29 14:07:18 +08:00
parent 2c87e3f3b8
commit a41db38229
9 changed files with 91 additions and 50 deletions

View File

@ -0,0 +1,4 @@
import { getDictData } from './dict';
export const groupConnectWorkshop = (groupName, workshopValue) =>
`${groupName} - ${getDictData('workshop', workshopValue)?.label}`;

View File

@ -60,6 +60,8 @@
</template> </template>
<script> <script>
import { groupConnectWorkshop } from '@/utils/equipment-module';
export default { export default {
name: 'ContentAdd', name: 'ContentAdd',
data() { data() {
@ -114,7 +116,7 @@ export default {
} }
if (grp.code == 0) { if (grp.code == 0) {
this.groupOptions = grp.data.map((item) => ({ this.groupOptions = grp.data.map((item) => ({
label: item.name, label: groupConnectWorkshop(item.name, item.roomNameDict),
value: item.id, value: item.id,
})); }));
} }

View File

@ -268,8 +268,8 @@ export default {
} }
}, },
getConfirmed() { getConfirmed(message = '是否直接确认巡检记录') {
return this.$confirm('是否直接确认巡检记录', '提示', { return this.$confirm(message, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -281,25 +281,31 @@ export default {
return this.$message.error('请添加巡检内容'); return this.$message.error('请添加巡检内容');
} }
let confirmed = false; /** 询问 是否保存记录 */
try { try {
confirmed = await this.getConfirmed(); if (await this.getConfirmed('是否保存记录')) {
} catch (err) { /** 询问 是否直接确认 */
confirmed = false; try {
} if (await this.getConfirmed('是否直接确认巡检记录')) {
const res = await this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.nickname,
method: 'put',
data: [this.row.id],
});
if (res.code == 0) {
this.$message.success('已确认');
}
}
if (confirmed) { this.$emit('refreshDataList');
const res = await this.$axios({ this.handleCancel();
url: } catch (err) {
'/base/equipment-check-order/confirm?confirmPerson=' + this.handleCancel();
this.$store.getters.nickname, }
method: 'put',
data: [this.row.id],
});
if (res.code == 0) {
this.$message.success('已确认');
} }
} } catch (err) {}
// this.btnLoading = true; // this.btnLoading = true;
// this.$nextTick(async () => { // this.$nextTick(async () => {
@ -319,8 +325,6 @@ export default {
// this.$emit('refreshDataList'); // this.$emit('refreshDataList');
// this.handleCancel(); // this.handleCancel();
// }); // });
this.$emit('refreshDataList');
this.handleCancel();
}, },
handleEmitFun(val) { handleEmitFun(val) {

View File

@ -29,7 +29,16 @@
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="name"> <el-form-item
label="巡检单名称"
prop="name"
:rules="[
{
required: true,
message: '巡检单名称不能为空',
trigger: 'blur',
},
]">
<el-input <el-input
v-model="form.name" v-model="form.name"
:disabled="disableEdit" :disabled="disableEdit"
@ -196,6 +205,7 @@
<script> <script>
import DialogForm from '../../../components/DialogForm/index.vue'; import DialogForm from '../../../components/DialogForm/index.vue';
import { groupConnectWorkshop } from '@/utils/equipment-module';
const SmallTitle = { const SmallTitle = {
name: 'SmallTitle', name: 'SmallTitle',
@ -414,21 +424,28 @@ export default {
async handleConfirm() { async handleConfirm() {
this.btnLoading = true; this.btnLoading = true;
this.$nextTick(async () => { this.$nextTick(async () => {
const { code, data } = await this.$axios({ try {
url: '/base/equipment-check-order/update', const valid = await this.$refs['form'].validate();
method: 'put', if (!valid) return;
data: { const { code, data } = await this.$axios({
...this.form, url: '/base/equipment-check-order/update',
groupClass: this.form.groupClass.join(','), method: 'put',
checkPerson: this.form.checkPerson.join(','), data: {
}, ...this.form,
}); groupClass: this.form.groupClass?.join(','),
if (code == 0) { checkPerson: this.form.checkPerson?.join(','),
this.$modal.msgSuccess('更新成功'); },
});
if (code == 0) {
this.$modal.msgSuccess('更新成功');
}
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
} catch (err) {
console.log('..................................err', err);
this.btnLoading = false;
} }
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
}); });
}, },
@ -451,8 +468,14 @@ export default {
); );
if (res.code == 0) { if (res.code == 0) {
this.form = res.data; this.form = res.data;
this.form.groupClass = res.data.groupClass.split(','); this.form.groupClass =
this.form.checkPerson = res.data.checkPerson?.split(','); res.data.groupClass &&
res.data.groupClass.trim() != '' &&
res.data.groupClass.split(',');
this.form.checkPerson =
res.data.checkPerson &&
res.data.checkPerson.trim() != '' &&
res.data.checkPerson.split(',');
this.formLoading = false; this.formLoading = false;
} }
this.formLoading = false; this.formLoading = false;
@ -516,7 +539,7 @@ export default {
case 'groupClass': case 'groupClass':
res = await this.$axios(urls[1]); res = await this.$axios(urls[1]);
this.groupOptions = (res.data || []).map((item) => ({ this.groupOptions = (res.data || []).map((item) => ({
label: item.name, label: groupConnectWorkshop(item.name, item.roomNameDict),
value: item.id, value: item.id,
})); }));
break; break;

View File

@ -349,16 +349,16 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.$modal this.$modal
.confirm('是否确认导出所有巡检设置?') .confirm('是否确认导出所有巡检?')
.then(() => { .then(() => {
this.exportLoading = true; this.exportLoading = true;
return this.$axios({ return this.$axios({
url: '/base/equipment-check-order/export-excel', url: '/base/equipment-check-order/export-excel',
// params: { params: {
// name: this.queryParams.name, name: this.queryParams.name,
// status: 1, status: 1,
// special: true, special: true,
// }, },
responseType: 'blob', responseType: 'blob',
}); });
}) })

View File

@ -89,6 +89,8 @@
</template> </template>
<script> <script>
import { groupConnectWorkshop } from '@/utils/equipment-module';
export default { export default {
data() { data() {
return { return {
@ -107,6 +109,12 @@ export default {
dataRule: { dataRule: {
confirmTimeLimit: [ confirmTimeLimit: [
{ required: true, message: '确认时限不能为空', trigger: 'blur' }, { required: true, message: '确认时限不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字类型',
trigger: 'blur',
transform: (val) => Number(val),
},
], ],
code: [ code: [
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' }, { required: true, message: '巡检单编码不能为空', trigger: 'blur' },
@ -160,7 +168,7 @@ export default {
} }
if (grp.code == 0) { if (grp.code == 0) {
this.groupOptions = grp.data.map((item) => ({ this.groupOptions = grp.data.map((item) => ({
label: item.name, label: groupConnectWorkshop(item.name, item.roomNameDict),
value: item.id, value: item.id,
})); }));
} }
@ -186,7 +194,10 @@ export default {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
this.dataForm[key] = res.data[key]; this.dataForm[key] = res.data[key];
if (key == 'groupClass') { if (key == 'groupClass') {
this.dataForm.groupClass = res.data.groupClass.split(',') this.dataForm.groupClass =
res.data.groupClass &&
res.data.groupClass.trim() != '' &&
res.data.groupClass.split(',');
} }
}); });
} }

View File

@ -27,7 +27,6 @@
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<section> <section>
<SmallTitle>保养信息</SmallTitle>
<div class="form-part" style="margin-bottom: 32px"> <div class="form-part" style="margin-bottom: 32px">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<el-form <el-form

View File

@ -27,7 +27,6 @@
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<section> <section>
<SmallTitle>保养信息</SmallTitle>
<div class="form-part" style="margin-bottom: 32px"> <div class="form-part" style="margin-bottom: 32px">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<el-form <el-form

View File

@ -63,7 +63,6 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'; import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record';
import { publicFormatter } from '@/utils/dict';
import PlanConfigAdd from './PlanConfig--add.vue'; import PlanConfigAdd from './PlanConfig--add.vue';
import PlanConfigAddContent from './PlanConfig--addContent.vue'; import PlanConfigAddContent from './PlanConfig--addContent.vue';