Compare commits

..

No commits in common. "063532567ba6f32b73df311fa3aa9a0cafb369e9" and "b2c6a5fae9d1c11d7cd5a7842b8b64000959d40e" have entirely different histories.

5 changed files with 115 additions and 155 deletions

View File

@ -15,12 +15,16 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="巡检单名称" prop="name"> <el-form-item label="巡检单名称" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" /> <el-input
v-model="dataForm.name"
placeholder="请输入巡检单名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="巡检单编码" prop="code"> <el-form-item label="巡检单编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入巡检单编码" /> <el-input
v-model="dataForm.code"
placeholder="请输入巡检单编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -93,14 +97,9 @@
<script> <script>
import basicAdd from '../../../../core/mixins/basic-add'; import basicAdd from '../../../../core/mixins/basic-add';
import { import { getCheckOrder, getOrderCode, createCheckOrder, updateCheckOrder } from "@/api/equipment/base/inspection/settings";
getCheckOrder, import { getCoreDepartmentList } from "@/api/base/coreDepartment";
getOrderCode, import { groupClassesListAll } from '@/api/monitoring/teamProduction'
createCheckOrder,
updateCheckOrder,
} from '@/api/equipment/base/inspection/settings';
import { getCoreDepartmentList } from '@/api/base/coreDepartment';
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
import { getDictDataLabel } from '@/utils/dict'; import { getDictDataLabel } from '@/utils/dict';
// import { getEquipmentAll } from '@/api/base/equipment' // import { getEquipmentAll } from '@/api/base/equipment'
@ -109,14 +108,14 @@ export default {
data() { data() {
return { return {
urlOptions: { urlOptions: {
isGetCode: true, isGetCode: true,
codeURL: getOrderCode, codeURL: getOrderCode,
createURL: createCheckOrder, createURL: createCheckOrder,
updateURL: updateCheckOrder, updateURL: updateCheckOrder,
infoURL: getCheckOrder, infoURL: getCheckOrder,
}, },
dataForm: { dataForm: {
id: null, id: null,
code: null, code: null,
name: null, name: null,
departmentId: null, departmentId: null,
@ -130,13 +129,13 @@ export default {
departmentOptions: [], departmentOptions: [],
dataRule: { dataRule: {
confirmTimeLimit: [ confirmTimeLimit: [
{ required: true, message: '确认时限不能为空', trigger: 'blur' }, { required: true, message: '确认时限不能为空', trigger: 'blur' }
], ],
code: [ code: [
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' }, { required: true, message: '巡检单编码不能为空', trigger: 'blur' }
], ],
name: [ name: [
{ required: true, message: '巡检单名称不能为空', trigger: 'blur' }, { required: true, message: '巡检单名称不能为空', trigger: 'blur' }
], ],
planCheckTime: [ planCheckTime: [
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' } { required: true, message: '计划巡检时间不能为空', trigger: 'blur' }
@ -154,96 +153,83 @@ export default {
}; };
}, },
created() { created() {
const currenttime = new Date(); const currenttime = new Date()
this.dataForm.planCheckTime = new Date( this.dataForm.planCheckTime = new Date(currenttime.getFullYear(), currenttime.getMonth(), currenttime.getDate(), 8, 0, 0).getTime()
currenttime.getFullYear(), console.log('11', this.dataForm.planCheckTime, currenttime)
currenttime.getMonth(),
currenttime.getDate(),
8,
0,
0
).getTime();
}, },
mounted() { mounted() {
this.getDict(); this.getDict()
}, },
methods: { methods: {
init(id) { init(id) {
this.dataForm.id = id || ''; this.dataForm.id = id || "";
this.visible = true; this.visible = true;
if (this.urlOptions.getOption) { if (this.urlOptions.getOption) {
this.getArr(); this.getArr()
} }
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs["dataForm"].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions.infoURL(id).then((response) => { this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data; this.dataForm = response.data
if (response.data?.groupClass === '') { if (response.data.groupClass === '') {
this.dataForm.groupClass = []; this.dataForm.groupClass = []
} else { } else {
this.dataForm.groupClass = this.dataForm.groupClass = response.data?.groupClass.split(',') || undefined
response.data?.groupClass?.split(',') || undefined;
} }
}); });
} else { } else {
if (this.urlOptions.isGetCode) { if (this.urlOptions.isGetCode) {
this.getCode(); this.getCode()
} }
} }
}); });
}, },
async getDict() { async getDict() {
// //
const res = await getCoreDepartmentList(); const res = await getCoreDepartmentList();
this.departmentOptions = res.data || []; this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll(); const res1 = await groupClassesListAll();
this.groupOptions = this.groupOptions = res1.data.map((item) => {
res1.data.map((item) => { item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
item.label = return item
item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict); }) || [];
return item;
}) || [];
// const res = await getEquipmentAll() // const res = await getEquipmentAll()
// this.eqList = res.data // this.eqList = res.data
}, },
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (!valid) { if (!valid) {
return false; return false;
} }
// //
if (this.dataForm.id) { if (this.dataForm.id) {
this.urlOptions this.urlOptions.updateURL({
.updateURL({
...this.dataForm,
special: false,
status: 0,
groupClass: this.dataForm.groupClass?.join(','),
})
.then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
});
return;
}
//
this.urlOptions
.createURL({
...this.dataForm, ...this.dataForm,
special: false, special: false,
status: 0, status: 0,
groupClass: this.dataForm.groupClass?.join(','), groupClass: this.dataForm.groupClass.join(',')
}) }).then(response => {
.then((response) => { this.$modal.msgSuccess("修改成功");
this.$modal.msgSuccess('新增成功'); this.visible = false;
this.visible = false; this.$emit("refreshDataList");
this.$emit('refreshDataList'); });
}); return;
}); }
}, //
this.urlOptions.createURL({
...this.dataForm,
special: false,
status: 0,
groupClass: this.dataForm.groupClass.join(',')
}).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
}, },
}; };
</script> </script>

View File

@ -37,7 +37,9 @@
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="handleConfirm"> @confirm="handleConfirm">
<add ref="add" @refreshDataList="successSubmit" /> <add
ref="add"
@refreshDataList="successSubmit" />
</base-dialog> </base-dialog>
<!-- 添加巡检查看详情 --> <!-- 添加巡检查看详情 -->
<addOrUpdata <addOrUpdata
@ -50,7 +52,7 @@
<script> <script>
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addOrUpdata from './add-or-updata.vue'; import addOrUpdata from './add-or-updata.vue';
import add from './add.vue'; import add from './add.vue'
import { parseTime } from '../../../../core/mixins/code-filter'; import { parseTime } from '../../../../core/mixins/code-filter';
// import { publicFormatter } from '@/utils/dict'; // import { publicFormatter } from '@/utils/dict';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -69,14 +71,14 @@ export default {
? { ? {
type: 'add', type: 'add',
btnName: '添加', btnName: '添加',
showTip: '添加巡检', showTip: '添加巡检'
} }
: undefined, : undefined,
this.$auth.hasPermi('equipment:check-setting:update') this.$auth.hasPermi('equipment:check-setting:update')
? { ? {
type: 'edit', type: 'edit',
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
// this.$auth.hasPermi('equipment:check-setting:update') // this.$auth.hasPermi('equipment:check-setting:update')
// ? { // ? {
@ -88,44 +90,20 @@ export default {
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ { prop: 'name', label: '巡检单名称', width: 110, showOverflowtooltip: true },
prop: 'name', { prop: 'code', label: '巡检单编码', minWidth: 150, showOverflowtooltip: true },
label: '巡检单名称',
width: 110,
showOverflowtooltip: true,
},
{
prop: 'code',
label: '巡检单编码',
minWidth: 150,
showOverflowtooltip: true,
},
{ prop: 'department', label: '部门', showOverflowtooltip: true }, { prop: 'department', label: '部门', showOverflowtooltip: true },
{ { prop: 'planCheckTime', label: '计划巡检时间', width: 150, filter: parseTime },
prop: 'planCheckTime', { prop: 'confirmTimeLimit', label: '确认时限', showOverflowtooltip: true },
label: '计划巡检时间',
width: 150,
filter: parseTime,
},
{
prop: 'confirmTimeLimit',
label: '确认时限',
showOverflowtooltip: true,
},
{ prop: 'groupClass', label: '班次', showOverflowtooltip: true }, { prop: 'groupClass', label: '班次', showOverflowtooltip: true },
{ prop: 'creator', label: '创建人', showOverflowtooltip: true }, { prop: 'creator', label: '创建人', showOverflowtooltip: true },
{ { prop: 'createTime', label: '创建时间', width: 150, filter: parseTime },
prop: 'createTime',
label: '创建时间',
width: 150,
filter: parseTime,
},
// { prop: 'responsible', label: '' }, // { prop: 'responsible', label: '' },
{ prop: 'remark', label: '备注' }, // TODO: { prop: 'remark', label: '备注' } // TODO:
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
@ -158,7 +136,7 @@ export default {
name: 'add', name: 'add',
plain: true, plain: true,
color: 'success', color: 'success',
}, }
// { // {
// type: this.$auth.hasPermi('equipment:check-setting:export') // type: this.$auth.hasPermi('equipment:check-setting:export')
// ? 'button' // ? 'button'
@ -199,11 +177,7 @@ export default {
clearable: true, clearable: true,
}, },
rules: [ rules: [
{ { required: true, message: '设备名称不能为空', trigger: 'change' },
required: true,
message: '设备名称不能为空',
trigger: 'change',
},
], ],
}, },
{ {
@ -222,13 +196,13 @@ export default {
equipmentId: null, equipmentId: null,
name: null, name: null,
special: false, special: false,
status: 0, status: 0
}, },
// //
form: {}, form: {},
basePath: '/base/equipment-check-order', basePath: '/base/equipment-check-order',
mode: null, mode: null,
groupList: [], groupList: []
}; };
}, },
created() { created() {
@ -238,12 +212,12 @@ export default {
}, },
methods: { methods: {
handleConfirm() { handleConfirm() {
this.$refs.add.dataFormSubmit(); this.$refs.add.dataFormSubmit()
}, },
successSubmit() { successSubmit() {
this.cancel(); this.cancel()
this.getList(); this.getList()
}, },
initSearchBar() { initSearchBar() {
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => { this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
this.$set( this.$set(
@ -257,9 +231,9 @@ export default {
}); });
}, },
getGroup() { getGroup() {
groupClassesListAll().then((res) => { groupClassesListAll().then(res => {
this.groupList = res.data || []; this.groupList = res.data || []
}); })
}, },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
@ -273,9 +247,9 @@ export default {
}, },
/** 取消按钮 */ /** 取消按钮 */
cancel() { cancel() {
this.$refs.add.formClear(); this.$refs.add.formClear()
this.open = false; this.open = false;
this.title = ''; this.title = ''
// this.reset(); // this.reset();
}, },
/** 表单重置 */ /** 表单重置 */

View File

@ -86,7 +86,7 @@ export default {
? { ? {
type: 'edit', type: 'edit',
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
{ {
type: 'detail', type: 'detail',
@ -96,7 +96,7 @@ export default {
? { ? {
type: 'delete', type: 'delete',
btnName: '删除', btnName: '删除',
} }
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
@ -257,14 +257,16 @@ export default {
this.$message.warning('请选择待确认的巡检单'); this.$message.warning('请选择待确认的巡检单');
return; return;
} }
//let checkPersonParam = ''; let checkPersonParam = '';
//if (!row.checkPerson || row.checkPerson.trim() == '') { if (!row.checkPerson || row.checkPerson.trim() == '') {
// checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`; /** 如有必要,更新巡检人 */
//} checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
const res = this.$axios({ const res = this.$axios({
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, url:
// +checkPersonParam, `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` +
checkPersonParam,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''), // '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put', method: 'put',
data: this.$refs['check-order-list-table'].selectedOrder.map( data: this.$refs['check-order-list-table'].selectedOrder.map(
@ -335,8 +337,8 @@ export default {
return this.$axios({ return this.$axios({
url: url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}`, `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` +
// + checkPersonParam, checkPersonParam,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''), // '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put', method: 'put',
data: [id], data: [id],

View File

@ -123,7 +123,7 @@
type: 'number', type: 'number',
message: '请输入正确的数字', message: '请输入正确的数字',
trigger: 'blur', trigger: 'blur',
transform: (val) => Number(val) && parseInt(val) === Number(val), transform: (val) => Number(val),
}, },
{ required: true, message: '保养频率不能为空', trigger: 'blur' }, { required: true, message: '保养频率不能为空', trigger: 'blur' },
]"> ]">

View File

@ -409,8 +409,7 @@ const uploadedFile = {
return {}; return {};
}, },
methods: { methods: {
handleDelete(e) { handleDelete() {
e.stopPropagation();
this.$emit('delete', this.file); this.$emit('delete', this.file);
}, },
async handleDownload() { async handleDownload() {
@ -611,8 +610,7 @@ export default {
const response = await this.$axios('/base/core-equipment/listAll'); const response = await this.$axios('/base/core-equipment/listAll');
this.equipmentList = response.data || []; this.equipmentList = response.data || [];
const equipmentOptions = (response.data || []) const equipmentOptions = (response.data || [])
// .filter((item) => (type == 'special-equipment' ? item.special : true)) .filter((item) => (type == 'special-equipment' ? item.special : true))
.filter((item) => item.special == true)
.map((item) => ({ .map((item) => ({
label: item.name, label: item.name,
value: item.id, value: item.id,