projects/mesxc-dy #206

Merged
juzi merged 3 commits from projects/mesxc-dy into projects/mesxc-test 2024-02-26 10:44:08 +08:00
5 changed files with 318 additions and 156 deletions
Showing only changes of commit 0abf628377 - Show all commits

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-08 15:56:52 * @Date: 2023-11-08 15:56:52
* @LastEditTime: 2023-11-25 16:22:49 * @LastEditTime: 2024-02-25 22:23:54
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -100,3 +100,63 @@ export function updateCheckConfig(data) {
data: data data: data
}) })
} }
// 创建巡检单
export function createCheckOrder(data) {
return request({
url: '/base/equipment-check-order/create',
method: 'post',
data: data
})
}
// 更新巡检单
export function updateCheckOrder(data) {
return request({
url: '/base/equipment-check-order/update',
method: 'put',
data: data
})
}
// 获得设备巡检单code
export function getOrderCode() {
return request({
url: '/base/equipment-check-order/getCode',
method: 'get'
})
}
// 获得巡检单
export function getCheckOrder(id) {
return request({
url: '/base/equipment-check-order/get?id=' + id,
method: 'get'
})
}
// 获得巡检单详细
export function getCheckOrderDet(id) {
return request({
url: '/base/equipment-check-order-det/get?id=' + id,
method: 'get'
})
}
// 创建巡检单详情
export function createCheckOrderDet(data) {
return request({
url: '/base/equipment-check-order-det/create',
method: 'post',
data: data
})
}
// 更新巡检单详情
export function updateCheckOrderDet(data) {
return request({
url: '/base/equipment-check-order-det/update',
method: 'put',
data: data
})
}

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-12-01 11:02:43 * @LastEditTime: 2024-02-26 08:40:22
* @Description: * @Description:
--> -->
<template> <template>
@ -13,34 +13,25 @@
class="drawer" class="drawer"
size="50%"> size="50%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ isdetail ? '详情' : '添加巡检' }} <!-- {{ isdetail ? '详情' : '添加巡检' }} -->
{{ '添加内容' }}
</small-title> </small-title>
<div class="content"> <div class="content">
<div class="visual-part"> <div class="visual-part">
<el-form <el-row :gutter="20">
:model="dataForm" <el-col :span="8">
:rules="dataRule" <div class="blodTip">巡检单名称</div>
ref="dataForm" <div class="lightTip">{{ dataForm.name }}</div>
@keyup.enter.native="dataFormSubmit()" </el-col>
label-width="100px" <el-col :span="8">
label-position="top"> <div class="blodTip">部门</div>
<el-row :gutter="20"> <div class="lightTip">{{ dataForm.department }}</div>
<el-col :span="12"> </el-col>
<el-form-item label="设备名称" prop="equipmentName"> <el-col :span="8">
<el-input v-model="dataForm.equipmentName" disabled clearable placeholder="请输入设备名称" /> <div class="blodTip">巡检时间</div>
</el-form-item> <div class="lightTip">{{ parseTime(dataForm.planCheckTime) }}</div>
</el-col> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="设备编码" prop="equipmentCode">
<el-input
v-model="dataForm.equipmentCode"
clearable
disabled
placeholder="请输入设备编码" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div> </div>
<el-divider /> <el-divider />
@ -49,7 +40,7 @@
<small-title <small-title
style="margin: 16px 0; padding-left: 8px" style="margin: 16px 0; padding-left: 8px"
:no-padding="true"> :no-padding="true">
巡检项目 巡检内容
</small-title> </small-title>
<div v-if="!isdetail" class="action_btn"> <div v-if="!isdetail" class="action_btn">
@ -90,16 +81,18 @@
<attr-add <attr-add
v-if="addOrUpdateVisible" v-if="addOrUpdateVisible"
ref="addOrUpdate" ref="addOrUpdate"
:config-id="dataForm.id" :order-id="dataForm.id"
@refreshDataList="getList" /> @refreshDataList="getList" />
</el-drawer> </el-drawer>
</template> </template>
<script> <script>
import { getEqCheck, getCheckDetPage, deleteCheckDet } from "@/api/equipment/base/inspection/settings"; import { getCheckOrder } from "@/api/equipment/base/inspection/settings";
import { deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import attrAdd from './attr-add'; import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import { parseTime } from '../../../../core/mixins/code-filter';
const tableBtn = [ const tableBtn = [
{ {
@ -112,22 +105,14 @@ const tableBtn = [
}, },
]; ];
const tableProps = [ const tableProps = [
{
prop: 'equipmentName',
label: '设备名称',
},
{ {
prop: 'program', prop: 'program',
label: '巡检项目', label: '检查项目',
}, }
{
prop: 'content',
label: '巡检内容',
},
{
prop: 'code',
label: '巡检内容编码',
},
{
prop: 'description',
label: '备注',
},
]; ];
export default { export default {
@ -138,7 +123,7 @@ export default {
tableProps, tableProps,
addOrUpdateVisible: false, addOrUpdateVisible: false,
urlOptions: { urlOptions: {
infoURL: getEqCheck, infoURL: getCheckOrder,
}, },
listQuery: { listQuery: {
pageSize: 10, pageSize: 10,
@ -147,26 +132,13 @@ export default {
}, },
dataForm: { dataForm: {
id: undefined, id: undefined,
code: undefined, name: undefined,
name: '', department: undefined,
materialType: undefined, planCheckTime: undefined
productType: undefined,
area: undefined,
specifications: undefined,
processTime: 0,
remark: undefined,
unit: undefined
}, },
checkDetList: [], checkDetList: [],
visible: false, visible: false,
isdetail: false, isdetail: false
dataRule: {
code: [{ required: true, message: "物料编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "物料名称不能为空", trigger: "blur" }],
materialType: [{ required: true, message: "物料类型不能为空", trigger: "change" }],
productType: [{ required: true, message: "产品类型不能为空", trigger: "change" }],
processTime: [{ required: true, message: "产线生产单位用时不能为空", trigger: "blur" }]
}
}; };
}, },
mounted() {}, mounted() {},
@ -187,7 +159,7 @@ export default {
} }
) )
.then(() => { .then(() => {
deleteCheckDet(raw.data.id).then(({ data }) => { deleteCheckOrderDet(raw.data.id).then(({ data }) => {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
@ -205,9 +177,9 @@ export default {
}, },
getList() { getList() {
// //
getCheckDetPage({ getCheckOrderDetPage({
...this.listQuery, ...this.listQuery,
configId: this.dataForm.id, orderId: this.dataForm.id,
}).then((response) => { }).then((response) => {
this.checkDetList = response.data.list; this.checkDetList = response.data.list;
this.listQuery.total = response.data.total; this.listQuery.total = response.data.total;
@ -220,7 +192,7 @@ export default {
this.visible = true; this.visible = true;
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); // this.$refs['dataForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
// //
@ -287,7 +259,7 @@ export default {
.drawer >>> .visual-part { .drawer >>> .visual-part {
flex: 1 auto; flex: 1 auto;
max-height: 16vh; max-height: 10vh;
overflow: hidden; overflow: hidden;
overflow-y: scroll; overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */ padding-right: 10px; /* 调整滚动条样式 */
@ -311,4 +283,18 @@ export default {
.add { .add {
color: #0b58ff; color: #0b58ff;
} }
.blodTip {
height: 16px;
font-size: 14px;
font-weight: 600;
color: rgba(0,0,0,0.85);
margin-bottom: 8px;
}
.lightTip {
/* height: 16px; */
font-size: 14px;
font-weight: 400;
color: rgba(102,102,102,0.75);
margin-bottom: 12px;
}
</style> </style>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2023-11-25 16:23:13 * @LastEditTime: 2024-02-24 20:50:51
* @Description: * @Description:
--> -->
<template> <template>
@ -11,44 +11,83 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="80px"> label-width="120px">
<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 <el-input
v-model="dataForm.name" v-model="dataForm.name"
placeholder="请输入配置名称" /> 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 <el-input
v-model="dataForm.code" v-model="dataForm.code"
placeholder="请输入配置编码" /> placeholder="请输入巡检单编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备名称" prop="equipmentId"> <el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select <el-select
v-model="dataForm.equipmentId" v-model="dataForm.departmentId"
filterable :placeholder="`请选择部门`"
style="width: 100%" style="width: 100%">
placeholder="请选择设备名称"
@change="setCode">
<el-option <el-option
v-for="dict in eqList" v-for="opt in departmentOptions"
:key="dict.id" :key="opt.id"
:label="dict.name" :label="opt.name"
:value="dict.id" /> :value="opt.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="设备编码" prop="equipmentCode"> <el-form-item label="计划巡检时间" prop="planCheckTime">
<el-input v-model="dataForm.equipmentCode" disabled placeholder="请输入设备编码" /> <el-date-picker
</el-form-item> v-model="dataForm.planCheckTime"
type="datetime"
:placeholder="`请选择计划巡检时间`"
value-format="timestamp"
style="width: 100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-input
v-model="dataForm.confirmTimeLimit"
:placeholder="`请输入确认时限`" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="班次" prop="groupClass">
<el-select
v-model="dataForm.groupClass"
filterable
clearable
multiple
style="width: 100%"
placeholder="请选择班次">
<el-option
v-for="d in groupOptions"
:key="d.id"
:label="d.name"
:value="d.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" />
</el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
@ -56,8 +95,10 @@
<script> <script>
import basicAdd from '../../../../core/mixins/basic-add'; import basicAdd from '../../../../core/mixins/basic-add';
import { getEqCheck, getCode, createCheckConfig, updateCheckConfig } from "@/api/equipment/base/inspection/settings"; import { getCheckOrder, getOrderCode, createCheckOrder, updateCheckOrder } from "@/api/equipment/base/inspection/settings";
import { getEquipmentAll } from '@/api/base/equipment' import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
// import { getEquipmentAll } from '@/api/base/equipment'
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
@ -65,23 +106,36 @@ export default {
return { return {
urlOptions: { urlOptions: {
isGetCode: true, isGetCode: true,
codeURL: getCode, codeURL: getOrderCode,
createURL: createCheckConfig, createURL: createCheckOrder,
updateURL: updateCheckConfig, updateURL: updateCheckOrder,
infoURL: getEqCheck, infoURL: getCheckOrder,
}, },
dataForm: { dataForm: {
id: undefined, id: null,
code: undefined, code: null,
name: undefined, name: null,
equipmentId: undefined, departmentId: null,
equipmentCode: undefined planCheckTime: null,
confirmTimeLimit: null,
groupClass: null,
remark: null
}, },
eqList: [], groupOptions: [],
departmentOptions: [],
dataRule: { dataRule: {
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }], confirmTimeLimit: [
code: [{ required: true, message: "配置编码不能为空", trigger: "blur" }], { required: true, message: '确认时限不能为空', trigger: 'blur' }
name: [{ required: true, message: "配置名称不能为空", trigger: "blur" }], ],
code: [
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' }
],
name: [
{ required: true, message: '巡检单名称不能为空', trigger: 'blur' }
],
planCheckTime: [
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' }
]
} }
}; };
}, },
@ -90,16 +144,47 @@ export default {
}, },
methods: { methods: {
async getDict() { async getDict() {
// //
const res = await getEquipmentAll() const res = await getCoreDepartmentList();
this.eqList = res.data this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll();
this.groupOptions = res1.data || [];
// const res = await getEquipmentAll()
// this.eqList = res.data
}, },
setCode() { //
const chooseM = this.eqList.filter(item => { dataFormSubmit() {
return item.id === this.dataForm.equipmentId this.$refs["dataForm"].validate((valid) => {
}) if (!valid) {
this.dataForm.equipmentCode = chooseM[0].code return false;
} }
//
if (this.dataForm.id) {
this.urlOptions.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,
special: false,
status: 0,
groupClass: this.dataForm.groupClass.join(',')
}).then(response => {
this.$modal.msgSuccess("新增成功");
this.visible = false;
this.$emit("refreshDataList");
});
});
},
}, },
}; };
</script> </script>

View File

@ -17,18 +17,32 @@
ref="dataForm" ref="dataForm"
:model="dataForm" :model="dataForm"
:rules="dataRule" :rules="dataRule"
label-width="60px" label-width="90px"
@keyup.enter.native="dataFormSubmit()"> @keyup.enter.native="dataFormSubmit()">
<el-form-item label="巡检" prop="checkId"> <el-form-item label="设备名称" prop="equipmentId">
<el-select v-model="dataForm.checkId" filterable placeholder="请选择巡检" style="width: 100%"> <el-select
<el-option v-for="dict in checkList" :key="dict.id" :label="dict.content" v-model="dataForm.equipmentId"
filterable
clearable
placeholder="请选择设备名称"
style="width: 100%">
<el-option
v-for="dict in equipmentOptions"
:key="dict.id"
:label="dict.name"
:value="dict.id" /> :value="dict.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="备注" prop="description"> <el-form-item label="巡检项目" prop="program">
<el-input <el-input
v-model="dataForm.description" v-model="dataForm.program"
placeholder="请输入备注" placeholder="请输入巡检项目"
clearable />
</el-form-item>
<el-form-item label="巡检结果" prop="checkResult">
<el-input
v-model="dataForm.checkResult"
placeholder="请输入巡检结果"
clearable /> clearable />
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -41,11 +55,12 @@
</template> </template>
<script> <script>
import { getCheckDet, createCheckDet, updateCheckDet, getcheckList } from "@/api/equipment/base/inspection/settings"; import { getCheckOrderDet, createCheckOrderDet, updateCheckOrderDet } from "@/api/equipment/base/inspection/settings";
import { getEquipmentPage } from '@/api/base/equipment'
export default { export default {
props: { props: {
configId: { orderId: {
type: String, type: String,
default: '', default: '',
}, },
@ -54,14 +69,22 @@ export default {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
id: undefined, id: null,
checkId: undefined, equipmentId: null,
configId: undefined, program: null,
description: '' checkResult: null
}, },
checkList: [], equipmentOptions: [],
dataRule: { dataRule: {
checkId: [{ required: true, message: '巡检不能为空', trigger: 'blur' }], equipmentId: [
{ required: true, message: '设备不能为空', trigger: 'blur' }
],
program: [
{ required: true, message: '巡检项目不能为空', trigger: 'blur' }
],
checkResult: [
{ required: true, message: '巡检结果不能为空', trigger: 'blur' }
]
}, },
}; };
}, },
@ -70,8 +93,12 @@ export default {
}, },
methods: { methods: {
async getDict() { async getDict() {
const res = await getcheckList() const res = await getEquipmentPage({
this.checkList = res.data pageNo: 1,
pageSize: 100,
special: false
})
this.equipmentOptions = res.data.list
}, },
init(id) { init(id) {
this.dataForm.id = id || ''; this.dataForm.id = id || '';
@ -79,7 +106,7 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields(); this.$refs['dataForm'].resetFields();
if (this.dataForm.id) { if (this.dataForm.id) {
getCheckDet(this.dataForm.id).then((res) => { getCheckOrderDet(this.dataForm.id).then((res) => {
// const { name, value } = res.data; // const { name, value } = res.data;
// this.dataForm.name = name; // this.dataForm.name = name;
// this.dataForm.value = value; // this.dataForm.value = value;
@ -94,9 +121,9 @@ export default {
if (valid) { if (valid) {
// //
if (this.dataForm.id) { if (this.dataForm.id) {
updateCheckDet({ updateCheckOrderDet({
...this.dataForm, ...this.dataForm,
configId: this.configId orderId: this.orderId
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('修改成功'); this.$modal.msgSuccess('修改成功');
this.visible = false; this.visible = false;
@ -105,9 +132,9 @@ export default {
return; return;
} }
// //
createCheckDet({ createCheckOrderDet({
...this.dataForm, ...this.dataForm,
configId: this.configId, orderId: this.orderId,
}).then((response) => { }).then((response) => {
this.$modal.msgSuccess('新增成功'); this.$modal.msgSuccess('新增成功');
this.visible = false; this.visible = false;

View File

@ -53,6 +53,7 @@
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 { 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');
@ -79,12 +80,12 @@ export default {
btnName: '修改', btnName: '修改',
} }
: undefined, : undefined,
this.$auth.hasPermi('equipment:check-setting:update') // this.$auth.hasPermi('equipment:check-setting:update')
? { // ? {
type: 'detail', // type: 'detail',
btnName: '查看详情', // btnName: '',
} // }
: undefined, // : undefined,
this.$auth.hasPermi('equipment:check-setting:delete') this.$auth.hasPermi('equipment:check-setting:delete')
? { ? {
type: 'delete', type: 'delete',
@ -93,29 +94,31 @@ export default {
: undefined, : undefined,
].filter((v) => v), ].filter((v) => v),
tableProps: [ tableProps: [
{ prop: 'name', label: '配置名', width: 110, showOverflowtooltip: true }, { prop: 'name', label: '巡检单名称', width: 110, showOverflowtooltip: true },
{ prop: 'code', label: '编码', minWidth: 150, showOverflowtooltip: true }, { prop: 'code', label: '巡检单编码', minWidth: 150, showOverflowtooltip: true },
{ prop: 'lineName', label: '产线', showOverflowtooltip: true }, { prop: 'department', label: '部门', showOverflowtooltip: true },
{ prop: 'sectionName', label: '工段', showOverflowtooltip: true }, { prop: 'planCheckTime', label: '计划巡检时间', filter: parseTime },
{ prop: 'equipmentName', label: '设备', showOverflowtooltip: true }, { prop: 'confirmTimeLimit', label: '确认时限', showOverflowtooltip: true },
{ prop: 'equipmentCode', label: '设备编码', minWidth: 150, showOverflowtooltip: true }, { prop: 'groupClass', label: '班次', showOverflowtooltip: true },
{ prop: 'checkPerson', label: '创建人', minWidth: 150, showOverflowtooltip: true },
{ prop: 'createTime', label: '创建时间', filter: parseTime },
// { prop: 'responsible', label: '' }, // { prop: 'responsible', label: '' },
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: { prop: 'remark', label: '备注' } // TODO:
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'input', type: 'input',
label: '配置名称', label: '巡检单名称',
placeholder: '请输入配置名称', placeholder: '请输入巡检单名称',
param: 'name', param: 'name',
}, },
{ // {
type: 'select', // type: 'select',
label: '设备名称', // label: '',
placeholder: '请选择设备', // placeholder: '',
param: 'equipmentId', // param: 'equipmentId',
filterable: true, // filterable: true,
}, // },
{ {
type: 'button', type: 'button',
btnName: '查询', btnName: '查询',
@ -133,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'
@ -192,10 +195,11 @@ export default {
pageSize: 10, pageSize: 10,
equipmentId: null, equipmentId: null,
name: null, name: null,
special: false
}, },
// //
form: {}, form: {},
basePath: '/base/equipment-check-config', basePath: '/base/equipment-check-order',
mode: null, mode: null,
}; };
}, },