Merge branch 'projects/mes-test' into projects/mes-dy
This commit is contained in:
@@ -310,7 +310,7 @@ export default {
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
@@ -198,26 +198,23 @@ export default {
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{ width: 240, prop: 'code', label: '报警编码' },
|
||||
{ prop: 'code', label: '报警编码' },
|
||||
{
|
||||
width: 100,
|
||||
prop: 'type',
|
||||
label: '报警类型',
|
||||
filter: (val) =>
|
||||
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
|
||||
},
|
||||
{
|
||||
width: 90,
|
||||
prop: 'grade',
|
||||
label: '报警级别',
|
||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
||||
},
|
||||
{ width: 180, prop: 'alarmCode', label: '设备报警编码' },
|
||||
{ width: 128, prop: 'plcParamName', label: '参数列名' },
|
||||
{ width: 128, prop: 'alarmContent', label: '报警内容' },
|
||||
{ prop: 'alarmCode', label: '设备报警编码' },
|
||||
{ prop: 'plcParamName', label: '参数列名' },
|
||||
{ prop: 'alarmContent', label: '报警内容' },
|
||||
],
|
||||
alarmForm: {
|
||||
id: undefined,
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { deleteCheck } from "@/api/equipment/base/inspection/settings";
|
||||
import { deleteCheck } from '@/api/equipment/base/inspection/settings';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -128,15 +128,21 @@ export default {
|
||||
label: '巡检内容编号',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-check/getCode',
|
||||
rules: [{ required: true, message: '巡检内容编号不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{
|
||||
required: true,
|
||||
message: '巡检内容编号不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '巡检项目',
|
||||
prop: 'program',
|
||||
rules: [{ required: true, message: '巡检项目不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -144,10 +150,10 @@ export default {
|
||||
input: true,
|
||||
label: '巡检内容',
|
||||
prop: 'content',
|
||||
rules: [{ required: true, message: '巡检内容不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '巡检内容不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
@@ -168,7 +174,7 @@ export default {
|
||||
code: '',
|
||||
program: '',
|
||||
id: undefined,
|
||||
content: ''
|
||||
content: '',
|
||||
},
|
||||
basePath: '/base/equipment-check',
|
||||
mode: null,
|
||||
@@ -271,10 +277,10 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除巡检项目名称为"' + row.program + '"的数据项?')
|
||||
.confirm('是否确认删除该巡检项目?')
|
||||
.then(function () {
|
||||
// return this.delete({ id });
|
||||
return deleteCheck(id)
|
||||
// return this.del({ id });
|
||||
return deleteCheck(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
@@ -105,6 +105,7 @@ export default {
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
|
||||
@@ -54,7 +54,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import addOrUpdata from './add-or-updata.vue';
|
||||
// import { publicFormatter } from '@/utils/dict';
|
||||
@@ -101,9 +100,9 @@ export default {
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'equipmentCode', label: '描述' },
|
||||
{ prop: 'checkNumber', label: '巡检条数' } // TODO: 操作 选项,四个,群里询问
|
||||
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@@ -151,14 +150,18 @@ export default {
|
||||
input: true,
|
||||
label: '配置名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '配置编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-check-config/getCode',
|
||||
rules: [{ required: true, message: '配置编码不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '配置编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -167,7 +170,9 @@ export default {
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
@@ -288,9 +293,9 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
.confirm('是否确认删除该巡检记录?')
|
||||
.then(() => {
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
@@ -317,14 +322,14 @@ export default {
|
||||
},
|
||||
handleDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "详情";
|
||||
this.addOrEditTitle = '详情';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
},
|
||||
handleAddDetail({ id }) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.addOrEditTitle = "添加巡检";
|
||||
this.addOrEditTitle = '添加巡检';
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
|
||||
@@ -107,37 +107,37 @@ export default {
|
||||
param: 'equipmentName',
|
||||
},
|
||||
// 时间段
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
// valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'createTime',
|
||||
// defaultSelect: [
|
||||
// new Date(y, m, d)
|
||||
// .toLocaleString()
|
||||
// .split('/')
|
||||
// .map((item, index) => {
|
||||
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// return item;
|
||||
// })
|
||||
// .join('-'),
|
||||
// new Date(y, m, d, 23, 59, 59)
|
||||
// .toLocaleString()
|
||||
// .split('/')
|
||||
// .map((item, index) => {
|
||||
// if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// return item;
|
||||
// })
|
||||
// .join('-'),
|
||||
// ],
|
||||
},
|
||||
// {
|
||||
// type: 'datePicker',
|
||||
// label: '时间段',
|
||||
// dateType: 'daterange', // datetimerange
|
||||
// format: 'yyyy-MM-dd',
|
||||
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
// // valueFormat: 'timestamp',
|
||||
// rangeSeparator: '-',
|
||||
// startPlaceholder: '开始日期',
|
||||
// endPlaceholder: '结束日期',
|
||||
// defaultTime: ['00:00:00', '23:59:59'],
|
||||
// param: 'createTime',
|
||||
// // defaultSelect: [
|
||||
// // new Date(y, m, d)
|
||||
// // .toLocaleString()
|
||||
// // .split('/')
|
||||
// // .map((item, index) => {
|
||||
// // if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// // return item;
|
||||
// // })
|
||||
// // .join('-'),
|
||||
// // new Date(y, m, d, 23, 59, 59)
|
||||
// // .toLocaleString()
|
||||
// // .split('/')
|
||||
// // .map((item, index) => {
|
||||
// // if (index == 1 || index == 2) return item.padStart(2, '0');
|
||||
// // return item;
|
||||
// // })
|
||||
// // .join('-'),
|
||||
// // ],
|
||||
// },
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
|
||||
@@ -121,14 +121,14 @@ export default {
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '保养计划',
|
||||
placeholder: '请选择保养计划',
|
||||
label: '计划名称',
|
||||
placeholder: '请选择计划名称',
|
||||
param: 'maintainPlanId',
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
label: '保养开始时间',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
|
||||
@@ -129,6 +129,7 @@ export default {
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list'
|
||||
import { deleteSparePart } from '@/api/equipment/base/spare-parts/list';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -95,7 +95,7 @@ export default {
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '关键字',
|
||||
label: '备件名称',
|
||||
placeholder: '请输入备件名称',
|
||||
param: 'name',
|
||||
},
|
||||
@@ -132,20 +132,33 @@ export default {
|
||||
input: true,
|
||||
label: '备件名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '备件名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '备件名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '备件型号',
|
||||
prop: 'model',
|
||||
label: '备件编码',
|
||||
prop: 'code',
|
||||
url: '/base/equipment-spare-part/getCode',
|
||||
rules: [
|
||||
{ required: true, message: '备件编码不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备件型号',
|
||||
prop: 'model',
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '规格',
|
||||
prop: 'specifications',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '供应商',
|
||||
@@ -155,10 +168,10 @@ export default {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '供应商不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '物料类型',
|
||||
@@ -169,8 +182,12 @@ export default {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '物料类型不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '物料类型不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '使用寿命',
|
||||
@@ -184,14 +201,14 @@ export default {
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '单位',
|
||||
prop: 'unit', // 数据字典
|
||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
|
||||
@@ -72,10 +72,10 @@ const remainBox = {
|
||||
},
|
||||
computed: {
|
||||
value() {
|
||||
const temp = this.injectData[this.injectData.prop] || null
|
||||
const temp = this.injectData[this.injectData.prop] || null;
|
||||
if (temp) {
|
||||
console.log('12', temp)
|
||||
return temp === 'Green' ? 'green' : 'red'
|
||||
console.log('12', temp);
|
||||
return temp === 'Green' ? 'green' : 'red';
|
||||
}
|
||||
return this.injectData[this.injectData.prop] || null;
|
||||
},
|
||||
@@ -83,7 +83,7 @@ const remainBox = {
|
||||
if (this.value) {
|
||||
// const v = +this.value;
|
||||
// return v < 0 ? 'red' : v >= 0 && v < 2 ? 'yellow' : 'green';
|
||||
return this.value
|
||||
return this.value;
|
||||
}
|
||||
return 'unset';
|
||||
},
|
||||
@@ -95,8 +95,7 @@ const remainBox = {
|
||||
this.color
|
||||
// this.color == 'Green' ? 'green' : this.color == 'Red' ? 'red' : 'yellow'
|
||||
}; position:absolute; inset: 0; padding: 0 10px; display: flex; align-items: center; color: ${
|
||||
'unset'
|
||||
// this.color == 'red' ? '#fff' : 'unset'
|
||||
this.color == 'red' || this.color == 'green' ? '#fff' : 'unset'
|
||||
}`}>
|
||||
{this.injectData[this.injectData.prop] || ''}
|
||||
</div>
|
||||
@@ -112,7 +111,10 @@ const btn = {
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', { action: this.injectData.name, value: this.injectData });
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.name,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
@@ -124,8 +126,6 @@ const btn = {
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
name: 'EquipmentSparePartsMonitor',
|
||||
components: { addSparts },
|
||||
@@ -162,7 +162,12 @@ export default {
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'color', label: '是否超期', subcomponent: remainBox },
|
||||
{ prop: 'opt1', label: '备件更换', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '更换记录', name: '更新记录', subcomponent: btn }, // TODO: 是否换成按钮, 群里问
|
||||
{
|
||||
prop: 'opt2',
|
||||
label: '更换记录',
|
||||
name: '更新记录',
|
||||
subcomponent: btn,
|
||||
}, // TODO: 是否换成按钮, 群里问
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -171,12 +176,14 @@ export default {
|
||||
label: '产线',
|
||||
placeholder: '请选择产线',
|
||||
param: 'lineId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '设备',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -211,7 +218,9 @@ export default {
|
||||
input: true,
|
||||
label: '配置名称',
|
||||
prop: 'name',
|
||||
rules: [{ required: true, message: '配置名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '配置名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -224,7 +233,9 @@ export default {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
@@ -281,29 +292,29 @@ export default {
|
||||
}
|
||||
},
|
||||
eqOperation({ id }) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
updateLog({ id }) {
|
||||
this.addOrUpdateVisible = true
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id, true);
|
||||
});
|
||||
},
|
||||
initSearchBar() {
|
||||
// 产线列表
|
||||
getCorePLList().then(res => {
|
||||
getCorePLList().then((res) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
'selectOptions',
|
||||
res.data.map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
})
|
||||
});
|
||||
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[1],
|
||||
@@ -319,7 +330,11 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.http('/base/equipment-spare-part-config/monitor', 'get', this.queryParams).then((response) => {
|
||||
this.http(
|
||||
'/base/equipment-spare-part-config/monitor',
|
||||
'get',
|
||||
this.queryParams
|
||||
).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
@@ -338,7 +353,7 @@ export default {
|
||||
name: null,
|
||||
equipmentId: null,
|
||||
description: null,
|
||||
responsible: null
|
||||
responsible: null,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
@@ -397,7 +412,7 @@ export default {
|
||||
this.$modal
|
||||
.confirm('是否确认删除记录"' + row.name + '"?')
|
||||
.then(function () {
|
||||
return this.delete({ id });
|
||||
return this.del({ id });
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
|
||||
Reference in New Issue
Block a user