update 群里反馈的

This commit is contained in:
lb 2024-02-29 14:07:18 +08:00
vanhempi 2c87e3f3b8
commit a41db38229
9 muutettua tiedostoa jossa 91 lisäystä ja 50 poistoa

Näytä tiedosto

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

Näytä tiedosto

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

Näytä tiedosto

@ -268,8 +268,8 @@ export default {
}
},
getConfirmed() {
return this.$confirm('是否直接确认巡检记录', '提示', {
getConfirmed(message = '是否直接确认巡检记录') {
return this.$confirm(message, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
@ -281,25 +281,31 @@ export default {
return this.$message.error('请添加巡检内容');
}
let confirmed = false;
/** 询问 是否保存记录 */
try {
confirmed = await this.getConfirmed();
} catch (err) {
confirmed = false;
}
if (await this.getConfirmed('是否保存记录')) {
/** 询问 是否直接确认 */
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) {
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('已确认');
this.$emit('refreshDataList');
this.handleCancel();
} catch (err) {
this.handleCancel();
}
}
}
} catch (err) {}
// this.btnLoading = true;
// this.$nextTick(async () => {
@ -319,8 +325,6 @@ export default {
// this.$emit('refreshDataList');
// this.handleCancel();
// });
this.$emit('refreshDataList');
this.handleCancel();
},
handleEmitFun(val) {

Näytä tiedosto

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

Näytä tiedosto

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

Näytä tiedosto

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

Näytä tiedosto

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

Näytä tiedosto

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

Näytä tiedosto

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