Merge branch 'projects/mes-test' into projects/mes-lb
This commit is contained in:
@@ -77,9 +77,9 @@
|
||||
<el-form-item label="巡检时间" prop="actualTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.actualTime"
|
||||
type="date"
|
||||
type="datetime"
|
||||
:disabled="isdetail"
|
||||
format='yyyy-MM-dd'
|
||||
format='yyyy-MM-dd HH:mm:ss'
|
||||
value-format="timestamp"
|
||||
placeholder="选择巡检时间" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['equipmentId', 'createTime'],
|
||||
searchBarKeys: ['equipmentId', 'actualTime'],
|
||||
tableBtn: [
|
||||
this.$auth.hasPermi('equipment:check-record:detail')
|
||||
? {
|
||||
@@ -113,12 +113,12 @@ export default {
|
||||
label: '时间段',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'startTime',
|
||||
param: 'actualTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2023-11-09 11:09:26
|
||||
* @LastEditTime: 2023-11-24 18:38:22
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -52,11 +52,10 @@
|
||||
|
||||
<div v-if="!isdetail" class="action_btn">
|
||||
<template>
|
||||
<span style="display: inline-block;" @click="addNew()">
|
||||
<svg-icon style="width: 14px; height: 14px" class="item-icon" icon-class="table_add" />
|
||||
<span class="add">添加</span>
|
||||
</span>
|
||||
</template>
|
||||
<span style="display: inline-block;">
|
||||
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
@@ -290,7 +289,7 @@ export default {
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
max-height: 16vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
@@ -308,7 +307,7 @@ export default {
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: 5px 15px;
|
||||
margin: -40px 15px;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
|
||||
@@ -101,7 +101,7 @@ export default {
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'equipmentName', label: '设备' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
// { prop: 'responsible', label: '负责人' },
|
||||
{ prop: 'checkNumber', label: '巡检条数' }, // TODO: 操作 选项,四个,群里询问
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -116,6 +116,7 @@ export default {
|
||||
label: '设备名称',
|
||||
placeholder: '请选择设备',
|
||||
param: 'equipmentId',
|
||||
filterable: true,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -170,8 +171,12 @@ export default {
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/listAll',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'blur' },
|
||||
{ required: true, message: '设备名称不能为空', trigger: 'change' },
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -52,6 +52,7 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
|
||||
const remainBox = {
|
||||
name: 'RemainBox',
|
||||
@@ -99,7 +100,7 @@ const btn = {
|
||||
render: function (h) {
|
||||
return (
|
||||
<el-button type="text" onClick={this.handleClick}>
|
||||
{this.injectData.label}
|
||||
{this.injectData.name}
|
||||
</el-button>
|
||||
);
|
||||
},
|
||||
@@ -113,16 +114,16 @@ export default {
|
||||
return {
|
||||
searchBarKeys: ['planId', 'equipmentId'],
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
// {
|
||||
// prop: 'createTime',
|
||||
// label: '添加时间',
|
||||
// fixed: true,
|
||||
// width: 180,
|
||||
// filter: parseTime(createTime),
|
||||
// },
|
||||
{ prop: 'name', label: '保养计划' },
|
||||
{ prop: 'lineName', label: '产线' },
|
||||
{ prop: 'sectionName', label: '工段' },
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'sectionName', label: '工段名' },
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率' },
|
||||
@@ -134,16 +135,16 @@ export default {
|
||||
{
|
||||
prop: 'lastMaintainTime',
|
||||
label: '上次保养时间',
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间' },
|
||||
{ prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime },
|
||||
{
|
||||
prop: 'remainDays',
|
||||
label: '距离保养时间(天)',
|
||||
subcomponent: remainBox,
|
||||
},
|
||||
{ prop: 'opt1', label: '设备保养', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', subcomponent: btn },
|
||||
{ prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn },
|
||||
{ prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
@@ -243,15 +244,16 @@ export default {
|
||||
switch (action) {
|
||||
// 查看详情
|
||||
case '设备保养':
|
||||
this.$router.push({ path: '/equipment/base/maintain/plan-config',query: {
|
||||
equipmentId: value.equipmentId,
|
||||
equipmentName: value.equipmentName
|
||||
this.$router.push({ path: '/equipment/base/maintain/record',query: {
|
||||
addRecord: 1,
|
||||
row: value
|
||||
} })
|
||||
break;
|
||||
case '保养记录':
|
||||
const queryData = {
|
||||
equipmentId: value.equipmentId,
|
||||
maintainPlanId: value.id
|
||||
maintainPlanId: value.id,
|
||||
relatePlan: value.lastMaintainTime ? 1 : 2
|
||||
}
|
||||
this.$router.push({ path: '/equipment/base/maintain/record',query: queryData })
|
||||
break;
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'PlanConfig',
|
||||
@@ -95,7 +96,7 @@ export default {
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'maintainDuration', label: '计划保养用时(h)' },
|
||||
{ prop: 'maintenancePeriod', label: '保养频率(天/次)' },
|
||||
{ prop: 'maintainType', label: '保养类型' },
|
||||
{ prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') },
|
||||
{ prop: 'remark', label: '备注' },
|
||||
],
|
||||
searchBarFormConfig: [
|
||||
@@ -224,6 +225,17 @@ export default {
|
||||
rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
switch: true,
|
||||
label: '启用状态',
|
||||
prop: 'enabled',
|
||||
bind: {
|
||||
'active-value': 1,
|
||||
'inactive-value': 0,
|
||||
},
|
||||
}
|
||||
],
|
||||
[{ input: true, label: '备注', prop: 'remark' }],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
@@ -300,7 +312,8 @@ export default {
|
||||
const queryData = {
|
||||
equipmentId: row.equipmentId,
|
||||
maintainPlanId: row.id,
|
||||
relatePlan: row.enabled
|
||||
isAdd: 1
|
||||
// relatePlan: row.enabled
|
||||
}
|
||||
if (this.queryParams.createTime) {
|
||||
queryData.createTime = this.queryParams.createTime
|
||||
|
||||
@@ -45,6 +45,11 @@
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
<el-row v-if="mode === 'detail'" slot="footer" type="flex" justify="end">
|
||||
<el-col :span="12">
|
||||
<el-button size="small" class="btnTextStyle" @click="cancel">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</base-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -53,7 +58,7 @@
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import Editor from '@/components/Editor';
|
||||
import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record';
|
||||
import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
@@ -311,13 +316,16 @@ export default {
|
||||
this.searchBarFormConfig[0].defaultSelect =
|
||||
this.$route.query.equipmentId ?? undefined;
|
||||
this.searchBarFormConfig[1].defaultSelect =
|
||||
Number(this.$route.query.maintainPlanId) ?? undefined;
|
||||
this.$route.query.maintainPlanId ?? undefined;
|
||||
this.searchBarFormConfig[2].defaultSelect =
|
||||
this.$route.query?.createTime ?? undefined;
|
||||
this.searchBarFormConfig[3].defaultSelect =
|
||||
Number(this.$route.query.relatePlan) ?? undefined;
|
||||
}
|
||||
this.getList();
|
||||
if (this.$route.query.addRecord) {
|
||||
this.handleAdd()
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
initSearchBar() {
|
||||
@@ -398,6 +406,19 @@ export default {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
if (this.$route.query.addRecord) {
|
||||
// 赋值
|
||||
const tempRow = this.$route.query.row
|
||||
this.form.equipmentId = tempRow.equipmentId
|
||||
this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2
|
||||
this.form.startTime = tempRow.nextMaintainTime
|
||||
this.form.maintainPlanId = tempRow.id
|
||||
}
|
||||
if (this.$route.query.isAdd) {
|
||||
// 赋值
|
||||
this.form.equipmentId = this.$route.query.equipmentId
|
||||
this.form.maintainPlanId = this.$route.query.maintainPlanId
|
||||
}
|
||||
this.open = true;
|
||||
this.title = '添加保养记录';
|
||||
},
|
||||
@@ -440,7 +461,7 @@ export default {
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm('是否删除设备名称为"' + row.equipmentName + '"的数据项?')
|
||||
.confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteEqMaintainLog(id);
|
||||
})
|
||||
@@ -456,7 +477,7 @@ export default {
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = '修改保养记录';
|
||||
this.title = '查看保养记录详情';
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@@ -469,10 +490,10 @@ export default {
|
||||
.confirm('是否确认导出所有保养记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
return exportMaintainLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '保养记录.xls');
|
||||
this.$download.excel(response, '设备保养记录.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -41,12 +41,12 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ dataForm.faultTime }}</span>
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ dataForm.faultLevel }}</span>
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -164,11 +164,11 @@
|
||||
</el-form>
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
<el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
<el-button style="" @click="goback()">{{ disabled ? '返回' : '取消' }}</el-button>
|
||||
<!-- <el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-button> -->
|
||||
<el-button v-if="!disabled" type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
@@ -179,6 +179,8 @@ import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
|
||||
import Editor from "@/components/Editor";
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
import { getDictDatas } from "@/utils/dict";
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
|
||||
@@ -53,12 +53,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
// import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import CustomDialogForm from './CustomDialogForm.vue';
|
||||
import { deleteRepair } from '@/api/equipment/base/repair'
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentRepair',
|
||||
@@ -100,14 +100,14 @@ export default {
|
||||
label: '添加时间',
|
||||
fixed: true,
|
||||
width: 180,
|
||||
filter: timeFilter,
|
||||
filter: parseTime,
|
||||
},
|
||||
{ prop: 'repairOrderNumber', label: '设备维修单号' },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: timeFilter },
|
||||
{ prop: 'maintenanceStartTime', label: '开始时间', filter: parseTime },
|
||||
{
|
||||
prop: 'maintenanceFinishTime',
|
||||
label: '结束时间',
|
||||
filter: timeFilter,
|
||||
filter: parseTime,
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceStatus',
|
||||
@@ -418,10 +418,10 @@ export default {
|
||||
.confirm('是否确认导出所有维修记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportEquipmentTypeExcel(params);
|
||||
return exportRepairLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '维修记录.xls');
|
||||
this.$download.excel(response, '设备维修.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
|
||||
@@ -75,9 +75,6 @@
|
||||
|
||||
<div class="drawer-body__footer">
|
||||
<el-button type="primary" @click="goback()">关闭</el-button>
|
||||
<el-button v-if="disabled" type="primary" @click="goEdit()">
|
||||
编辑
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@@ -79,21 +79,13 @@ export default {
|
||||
this.partList = res.data.list;
|
||||
})
|
||||
},
|
||||
cancel() {
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.visible = false
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
// this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs['dataForm'].resetFields();
|
||||
// if (this.dataForm.id) {
|
||||
// getCoreProductAttr({
|
||||
// id: this.dataForm.id
|
||||
// }).then((res) => {
|
||||
// const { name, value } = res.data;
|
||||
// this.dataForm.name = name;
|
||||
// this.dataForm.value = value;
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
@@ -117,6 +109,7 @@ export default {
|
||||
configId: this.configId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$refs['dataForm'].resetFields()
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
|
||||
36
src/views/equipment/base/spareParts/Config/htmls.vue
Normal file
36
src/views/equipment/base/spareParts/Config/htmls.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-11-08 14:00:52
|
||||
* @LastEditTime: 2023-11-24 09:12:36
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div v-html="content" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
injectData: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getContent()
|
||||
console.log('12', this.injectData)
|
||||
},
|
||||
|
||||
methods: {
|
||||
getContent() {
|
||||
this.content = this.injectData.description ?? ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -60,8 +60,9 @@ import { publicFormatter } from '@/utils/dict';
|
||||
import Editor from '@/components/Editor';
|
||||
import addSparts from './addSparts.vue';
|
||||
import { deleteConfig } from '@/api/equipment/base/spare-parts/config'
|
||||
import htmls from './htmls.vue'
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentSparePartsConfig',
|
||||
@@ -111,7 +112,7 @@ export default {
|
||||
{ prop: 'equipmentCode', label: '设备编码' },
|
||||
{ prop: 'responsible', label: '负责人' },
|
||||
// { prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') },
|
||||
{ prop: 'description', label: '描述' },
|
||||
{ prop: 'description', label: '描述', subcomponent: htmls },
|
||||
{ prop: 'sparePartNumber', label: '备品备件数量' },
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
|
||||
@@ -301,6 +301,12 @@ export default {
|
||||
const id = row.id;
|
||||
this.info({ id }).then((response) => {
|
||||
this.form = response.data;
|
||||
if (this.form.unit !== undefined) {
|
||||
this.form.unit = String(this.form.unit)
|
||||
}
|
||||
if (this.form.type !== undefined) {
|
||||
this.form.type = String(this.form.type)
|
||||
}
|
||||
this.open = true;
|
||||
this.title = '修改备品备件';
|
||||
});
|
||||
|
||||
@@ -310,7 +310,8 @@ export default {
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'change') {
|
||||
// 更换
|
||||
this.addNew();
|
||||
console.log(raw)
|
||||
this.addNew(raw.data.sparePartId);
|
||||
} else {}
|
||||
},
|
||||
getList() {
|
||||
@@ -320,7 +321,7 @@ export default {
|
||||
configId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.list = response.data;
|
||||
this.listQuery.total = response.data.total;
|
||||
this.listQuery.total = response.data.length;
|
||||
});
|
||||
},
|
||||
getList1() {
|
||||
@@ -334,10 +335,10 @@ export default {
|
||||
});
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
addNew(sparePartId) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
this.$refs.addOrUpdate.init(sparePartId);
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
|
||||
@@ -25,10 +25,27 @@
|
||||
clearable
|
||||
placeholder="请输入操作人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更换耗时(min)" prop="timeUsed">
|
||||
<el-input-number
|
||||
v-model="dataForm.timeUsed"
|
||||
controls-position="right"
|
||||
clearable
|
||||
placeholder="请输入更换耗时"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更换时间" prop="replacementTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.replacementTime"
|
||||
type="date"
|
||||
format='yyyy-MM-dd'
|
||||
value-format='timestamp'
|
||||
placeholder="选择入更换时间"
|
||||
style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@@ -49,11 +66,15 @@ export default {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
responsible: ''
|
||||
responsible: '',
|
||||
timeUsed: 0,
|
||||
sparePartId: '',
|
||||
replacementTime: undefined
|
||||
},
|
||||
partList: [],
|
||||
dataRule: {
|
||||
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }]
|
||||
responsible: [{ required: true, message: '操作人不能为空', trigger: 'blur' }],
|
||||
replacementTime: [{ required: true, message: '更换时间不能为空', trigger: 'blur' }]
|
||||
},
|
||||
};
|
||||
},
|
||||
@@ -66,9 +87,13 @@ export default {
|
||||
// this.partList = res.data
|
||||
// },
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.dataForm.sparePartId = id || undefined;
|
||||
this.visible = true;
|
||||
},
|
||||
cancel() {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
this.visible = false;
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
@@ -91,6 +116,7 @@ export default {
|
||||
configId: this.configId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.$refs['dataForm'].resetFields();
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user