Compare commits

..

No commits in common. "da5596766c33f5f0defcc69afd4e069aefae289a" and "4a68467d88baa1cfe7e377be51983190964bcbb4" have entirely different histories.

9 changed files with 148 additions and 401 deletions

View File

@ -14,8 +14,7 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'

View File

@ -106,8 +106,6 @@ export default {
case 'detail':
this.handleDetail(data);
break;
default:
this.handleTableActions({data, type});
}
},
// 处理搜索栏按钮

View File

@ -59,11 +59,10 @@
</base-dialog>
<!-- 设备 详情 - 编辑 -->
<EquipmentDrawer
<!-- <EquipmentDrawer
v-if="editVisible"
ref="drawer"
:mode="editMode"
:isFireEquipment="true"
@update-mode="editMode = $event"
:data-id="form.id"
:sections="[
@ -109,7 +108,7 @@
]"
@refreshDataList="getList"
@cancel="cancelEdit"
@destroy="cancelEdit" />
@destroy="cancelEdit" /> -->
</div>
</template>
@ -404,41 +403,25 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form.id = row.id;
this.showUploadComponents = false;
this.editMode = 'edit';
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();
const id = row.id;
getEquipment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改设备';
});
// this.reset();
// this.showUploadComponents = false;
// this.editMode = 'edit';
// const id = row.id;
// getEquipment(id).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = '';
// });
},
handleDetail(row, mode='detail') {
const {id} = row;
this.form.id = id;
//
this.editMode = mode;
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();
})
// this.reset();
// this.showUploadComponents = false;
// const id = row.id;
// this.editMode = 'detail';
// getEquipment(id).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = '';
// });
handleDetail(row) {
this.reset();
this.showUploadComponents = false;
const id = row.id;
this.editMode = 'detail';
getEquipment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '查看详情';
});
},
/** 提交按钮 */
submitForm() {

View File

@ -59,7 +59,7 @@
</base-dialog>
<!-- 设备 详情 - 编辑 -->
<EquipmentDrawer
<!-- <EquipmentDrawer
v-if="editVisible"
ref="drawer"
:mode="editMode"
@ -108,7 +108,7 @@
]"
@refreshDataList="getList"
@cancel="cancelEdit"
@destroy="cancelEdit" />
@destroy="cancelEdit" /> -->
</div>
</template>
@ -388,41 +388,25 @@ export default {
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.form.id = row.id;
this.showUploadComponents = false;
this.editMode = 'edit';
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();
const id = row.id;
getEquipment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '修改设备';
});
// this.reset();
// this.showUploadComponents = false;
// this.editMode = 'edit';
// const id = row.id;
// getEquipment(id).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = '';
// });
},
handleDetail(row, mode='detail') {
const {id} = row;
this.form.id = id;
//
this.editMode = mode;
this.editVisible = true;
this.$nextTick(() => {
this.$refs['drawer'].init();
})
// this.reset();
// this.showUploadComponents = false;
// const id = row.id;
// this.editMode = 'detail';
// getEquipment(id).then((response) => {
// this.form = response.data;
// this.open = true;
// this.title = '';
// });
handleDetail(row) {
this.reset();
this.showUploadComponents = false;
const id = row.id;
this.editMode = 'detail';
getEquipment(id).then((response) => {
this.form = response.data;
this.open = true;
this.title = '查看详情';
});
},
/** 提交按钮 */
submitForm() {

View File

@ -37,7 +37,6 @@
<EquipmentInfoForm
key="drawer-dialog-form"
v-if="showForm"
:isFireEquipment="isFireEquipment"
:disabled="mode.includes('detail')"
:sync-filelist="syncFileListFlag"
v-model="form" />
@ -150,7 +149,7 @@ const SmallTitle = {
export default {
components: { SmallTitle, DialogForm, EquipmentInfoForm },
props: ['sections', 'mode', 'dataId', 'isFireEquipment'], // dataId id
props: ['sections', 'mode', 'dataId'], // dataId id
data() {
return {
visible: false,
@ -280,7 +279,7 @@ export default {
}
this.btnLoading = false;
this.$emit('refreshDataList');
this.$emit('refreshDataList')
this.handleCancel();
});
},

View File

@ -121,16 +121,6 @@
</el-col> -->
</el-row>
<el-row :gutter="20">
<el-col v-if="isFireEquipment" :span="12">
<el-form-item label="有效期至" prop="dueDate" :rules="[]">
<el-date-picker
v-model="form.dueDate"
:disabled="disabled"
type="datetime"
placeholder="请选择生产日期"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="生产日期" prop="productionTime" :rules="[]">
<el-date-picker
@ -140,8 +130,8 @@
placeholder="请选择生产日期"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col> -->
<!-- <el-col :span="8">
</el-col>
<el-col :span="8">
<el-form-item label="进场日期" prop="enterTime" :rules="[]">
<el-date-picker
v-model="form.enterTime"
@ -284,10 +274,6 @@ export default {
default: null,
required: false,
},
isFireEquipment: {
type: Boolean,
default: false
}
},
data() {
@ -310,7 +296,6 @@ export default {
description: '',
assets: [],
pics: [],
dueDate: ''
},
rpList: [],
dataLoaded: false,

View File

@ -15,55 +15,34 @@
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="保养计划名称"
label="计划名称"
prop="name"
:rules="[
{ required: true, message: '请输入保养计划名称', trigger: 'blur' },
{ required: true, message: '请输入计划名称', trigger: 'blur' },
]">
<el-input
v-model="form.name"
@change="$emit('update', form)"
:placeholder="`请输入保养计划名称`"
:placeholder="`请输入计划名称`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="保养计划编号"
label="计划编号"
prop="code"
:rules="[
{ required: true, message: '请输入保养计划编号', trigger: 'blur' },
{ required: true, message: '请输入计划编号', trigger: 'blur' },
]">
<el-input
v-model="form.code"
@change="$emit('update', form)"
:placeholder="`请输入保养计划编号`"
:placeholder="`请输入计划编号`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select
v-model="form.departmentId"
:placeholder="`请选择部门`"
:disabled="disabled"
clearable
filterable
@change="$emit('update', form)">
<el-option
v-for="opt in departmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
<!-- <el-form-item
label="设备大类"
prop="equipmentCategory"
:rules="[
@ -80,29 +59,10 @@
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item> -->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="产线"
prop="lineId"
:rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]">
<el-select
v-model="form.lineId"
:placeholder="`请选择产线`"
:disabled="disabled"
clearable
filterable
@change="$emit('update', form)">
<el-option
v-for="opt in lineOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
<!-- <el-form-item
label="设备"
prop="equipmentId"
:rules="[{ required: true, message: '请选择设备', trigger: 'blur' }]">
@ -117,9 +77,42 @@
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item> -->
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保养类型" prop="maintainType">
<el-select
v-model="form.maintainType"
:placeholder="`请选择保养类型`"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.MAINTAIN_TYPE)"
:key="opt.value"
:label="opt.label"
:value="+opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="保养时长(h)"
prop="maintainDuration"
:rules="[
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.maintainDuration"
@change="$emit('update', form)"
:placeholder="`请输入保养时长`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="保养频率(天/次)"
@ -140,100 +133,6 @@
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="确认时限(h)"
prop="confirmTimeLimit"
:rules="[
{ required: true, message: '请输入确认时限', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.confirmTimeLimit"
@change="$emit('update', form)"
:placeholder="`请输入确认时限(小时)`"
:disabled="disabled" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="保养类型" prop="maintainType">
<el-select
v-model="form.maintainType"
:placeholder="`请选择保养类型`"
:disabled="disabled"
@change="$emit('update', form)">
<el-option
v-for="opt in getDictDatas(DICT_TYPE.MAINTAIN_TYPE)"
:key="opt.value"
:label="opt.label"
:value="+opt.value" />
</el-select>
</el-form-item>
</el-col> -->
<el-col :span="12">
<el-form-item
label="保养时长(h)"
prop="maintainDuration"
:rules="[
{
type: 'number',
message: '请输入正确的数字',
trigger: 'blur',
transform: (val) => Number(val),
},
]">
<el-input
v-model="form.maintainDuration"
@change="$emit('update', form)"
:placeholder="`请输入保养时长(小时)`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="首次保养时间" prop="firstMaintenanceTime">
<el-date-picker
v-model="form.firstMaintenanceTime"
type="datetime"
:disabled="edit"
:placeholder="`请选择首次保养时间`"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="计划保养人员"
prop="maintainer"
:rules="[
{ required: true, message: '请选择计划保养人员', trigger: 'blur' },
]">
<el-select
v-model="form.maintainer"
:placeholder="`请选择计划保养人员`"
:disabled="disabled"
multiple
clearable
filterable
@change="$emit('update', form)">
<el-option
v-for="opt in maintainerOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
@ -269,10 +168,6 @@ export default {
type: Boolean,
default: false,
},
edit: {
type: Boolean,
default: false,
},
hasFiles: {
type: Boolean | Array,
default: false,
@ -290,21 +185,20 @@ export default {
return {
form: {},
formLoading: true,
dataLoaded: false,
equipmentList: [],
equipmentOptions: [],
equipmentTypeOptions: [
{ label: '安全设备', value: 1 },
{ label: '消防设备', value: 2 },
{ label: '特种设备', value: 3 },
],
lineList: [],
maintainerList: [],
departmentList: []
};
},
watch: {
dataForm: {
handler(val) {
this.form = JSON.parse(JSON.stringify(val));
if (typeof val.maintainer == 'string') this.form.maintainer = val.maintainer.split(',')
if (this.form.equipmentCategory != null) {
setTimeout(() => {
this.equipmentOptions = this.equipmentList
@ -330,33 +224,8 @@ export default {
},
},
mounted() {
!this.edit && this.getCode('/base/equipment-maintain-plan/getCode');
this.getList('maintainer');
this.getList('department');
this.getList('line');
},
computed: {
departmentOptions() {
return (this.departmentList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.id,
}));
},
lineOptions() {
return (this.lineList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.id,
}));
},
maintainerOptions() {
return (this.maintainerList || []).map((item) => ({
id: item.id,
label: item.name,
value: item.name,
}));
},
this.getEquipmentList();
this.getCode('/base/equipment-maintain-plan/getCode');
},
methods: {
/** 模拟透传 ref */
@ -384,29 +253,6 @@ export default {
}));
this.formLoading = false;
},
async getList(source = 'department') {
const urls = [
'/base/core-production-line/listAll',
'/base/core-department/listAll',
'/base/core-worker/listAll',
];
let res;
switch (source) {
case 'department':
res = await this.$axios(urls[1]);
this.departmentList = res.data || [];
break;
case 'maintainer':
res = await this.$axios(urls[2]);
this.maintainerList = res.data || [];
break;
case 'line':
res = await this.$axios(urls[0]);
this.lineList = res.data || [];
break;
}
this.formLoading = false;
},
// handlers
handleEqTypeChange(type) {

View File

@ -24,7 +24,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="180"
:width="120"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -44,7 +44,7 @@
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" :edit="form.id != null" v-model="form" :has-files="false" />
<DialogForm v-if="open" ref="form" v-model="form" :has-files="false" />
</base-dialog>
</div>
</template>
@ -64,15 +64,11 @@ export default {
const t = new Date();
const [y, m, d] = [t.getFullYear(), t.getMonth(), t.getDate()];
return {
searchBarKeys: ['planName'], // 'specialType', 'equipmentName', 'createTime'],
searchBarKeys: ['equipmentName', 'specialType', 'createTime'],
tableBtn: [
// {
// type: 'detail',
// btnName: '',
// },
{
type: 'addContent',
btnName: '添加内容',
type: 'detail',
btnName: '保养记录',
},
this.$auth.hasPermi('equipment:plan-config:update')
? {
@ -88,23 +84,6 @@ export default {
: undefined,
].filter((v) => v),
tableProps: [
{ prop: 'name', label: '计划名称' },
{ prop: 'departmentName', label: '部门' },
{ width: 144, prop: 'lineName', label: '产线名' },
{ width: 144, prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ width: 144, prop: 'firstMaintenanceTime', label: '首次保养时间' },
{ width: 144, prop: 'maintainDuration', label: '保养时长' },
{ prop: 'maintainer', label: '计划保养人员' },
{
width: 144,
prop: 'confirmTimeLimit',
label: '确认时限',
filter: (val) =>
val != null && val > 24
? `${(val - (val % 24)) / 24}${val % 24}小时`
: `${val}小时`,
},
{ prop: 'remark', label: '备注' },
// {
// prop: 'createTime',
// label: '',
@ -112,64 +91,59 @@ export default {
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
// { prop: 'code', label: '' },
// {
// prop: 'enabled',
// label: '',
// filter: (val) => ['', ''][val],
// },
// {
// prop: 'equipmentCategory',
// label: '',
// filter: (val) =>
// val != null ? ['-', '', '', ''][val] : '-',
// },
// { prop: 'equipmentName', label: '' },
// { width: 144, prop: 'maintainDuration', label: '(h)' },
// {
// prop: 'maintainType',
// label: '',
// filter: publicFormatter('maintain_type'),
// },
{ prop: 'name', label: '计划名称' },
{ prop: 'code', label: '计划编号' },
{
prop: 'enabled',
label: '启用状态',
filter: (val) => ['停用', '启用'][val],
},
{ prop: 'lineName', label: '产线' },
{
prop: 'equipmentCategory',
label: '设备大类',
filter: (val) =>
val != null ? ['-', '安全', '消防', '特种'][val] : '-',
},
{ prop: 'equipmentName', label: '设备名称' },
{ width: 144, prop: 'maintainDuration', label: '计划保养用时(h)' },
{ width: 144, prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{
prop: 'maintainType',
label: '保养类型',
filter: publicFormatter('maintain_type'),
},
{ prop: 'remark', label: '备注' },
],
searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// selectOptions: [
// { id: 1, name: '' },
// { id: 2, name: '' },
// { id: 3, name: '' },
// ],
// placeholder: '',
// param: 'specialType',
// },
{
type: 'select',
label: '设备大类',
selectOptions: [
{ id: 1, name: '安全设备' },
{ id: 2, name: '消防设备' },
{ id: 3, name: '特种设备' },
],
placeholder: '请选择设备大类',
param: 'specialType',
},
{
type: 'input',
label: '保养计划名称',
placeholder: '请输入保养计划名称',
param: 'planName',
// selectOptions: [
// {name: 1, id: 1}
// ]
label: '设备名',
placeholder: '请输入设备名称',
param: 'equipmentName',
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'createTime',
},
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'equipmentName',
// },
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange',
// format: 'yyyy-MM-dd',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// param: 'createTime',
// },
{
type: 'button',
btnName: '查询',
@ -297,10 +271,9 @@ export default {
queryParams: {
pageNo: 1,
pageSize: 10,
// equipmentName: null,
// createTime: null,
equipmentName: null,
createTime: null,
specialType: null,
planName: null,
},
//
form: {},
@ -338,33 +311,19 @@ export default {
/** 表单重置 */
reset() {
this.form = {
id: null,
code: null,
name: null,
// equipmentId: null,
maintainer: null,
lineId: null,
departmentId: null,
// enabled: null,
equipmentId: null,
enabled: null,
maintenancePeriod: null,
maintainDuration: null,
maintainType: null,
remark: null,
confirmTimeLimit: null,
firstMaintenanceTime: null,
speical: false,
// equipmentCategory: null,
enabled: 1,
equipmentCategory: null,
};
this.resetForm('form');
},
handleTableActions({data, type}) {
switch(type) {
case 'addContent':
//
alert('添加内容...')
break;
}
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
@ -405,6 +364,7 @@ export default {
const id = row.id;
this.info({ id }).then((response) => {
this.form = response.data;
debugger;
this.open = true;
this.title = '修改保养计划';
});
@ -417,10 +377,7 @@ export default {
}
//
if (this.form.id != null) {
this.put({
...this.form,
maintainer: this.form.maintainer.join(','),
}).then((response) => {
this.put(this.form).then((response) => {
this.$modal.msgSuccess('修改成功');
this.open = false;
this.getList();
@ -428,11 +385,7 @@ export default {
return;
}
//
this.post({
...this.form,
special: true,
maintainer: this.form.maintainer.join(','),
}).then((response) => {
this.post(this.form).then((response) => {
this.$modal.msgSuccess('新增成功');
this.open = false;
this.getList();