修改bug

This commit is contained in:
‘937886381’ 2024-11-14 08:45:45 +08:00
parent a492fe4c87
commit 43d0a2668d
15 changed files with 525 additions and 3185 deletions

View File

@ -6,7 +6,7 @@
"license": "MIT",
"scripts": {
"local": "vue-cli-service serve --mode local",
"dev": "vue-cli-service serve --mode dev",
"dev": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --mode dev",
"front": "vue-cli-service serve --mode front",
"build:prod": "vue-cli-service build --mode prod",
"build:stage": "vue-cli-service build --mode stage",

View File

@ -3,7 +3,7 @@
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-30 14:37:28
* @LastEditors: DY
* @Description:
* @Description:
*/
import request from '@/utils/request'
@ -65,4 +65,11 @@ export function getCoreDepartmentList(query) {
method: 'get',
params: query
})
}
}
export function getDepartmentList(query) {
return request({
url: '/system/dept/list',
method: 'get',
params: query
})
}

View File

@ -5,13 +5,6 @@
* @LastEditors: zhp
* @Description:
*/
/*
* @Author: zhp
* @Date: 2024-07-12 15:31:41
* @LastEditTime: 2024-07-22 09:33:20
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
@ -26,7 +19,7 @@ export function getItemPageData(data) {
return request({
url: '/base/equipment-check-program/page',
method: 'get',
data
params: data
})
}

View File

@ -252,7 +252,7 @@ export default {
computed: {},
created() {
this.fillLineOptions();
this.fillProductOptions();
// this.fillProductOptions();
},
mounted() {
// window.addEventListener('resize', () => {
@ -284,23 +284,23 @@ export default {
);
},
async fillProductOptions() {
const { data } = await this.$axios({
url: '/base/core-product/listAll',
method: 'get',
});
const cfg = this.searchBarFormConfig.find(
(item) => item.__index == 'product'
);
this.$set(
cfg,
'selectOptions',
data.map((item) => ({
id: item.id,
name: item.name,
}))
);
},
// async fillProductOptions() {
// const { data } = await this.$axios({
// url: '/base/core-product/listAll',
// method: 'get',
// });
// const cfg = this.searchBarFormConfig.find(
// (item) => item.__index == 'product'
// );
// this.$set(
// cfg,
// 'selectOptions',
// data.map((item) => ({
// id: item.id,
// name: item.name,
// }))
// );
// },
async getList() {
const { data } = await this.$axios({

View File

@ -6,84 +6,60 @@
* @Description:
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="true"
class="drawer"
size="50%">
<small-title slot="title" :no-padding="true">
<!-- {{ isdetail ? '详情' : '添加巡检' }} -->
{{ '添加内容' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer" size="50%">
<small-title slot="title" :no-padding="true">
<!-- {{ isdetail ? '详情' : '添加巡检' }} -->
{{ '添加内容' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-row :gutter="20">
<el-col :span="8">
<div class="blodTip">巡检单名称</div>
<div class="lightTip">{{ dataForm.name }}</div>
</el-col>
<el-col :span="8">
<el-col :span="8">
<div class="blodTip">部门</div>
<div class="lightTip">{{ dataForm.department }}</div>
</el-col>
<el-col :span="8">
<div class="blodTip">巡检时间</div>
<el-col :span="8">
<div class="blodTip">计划巡检时间</div>
<div class="lightTip">{{ parseTime(dataForm.planCheckTime) }}</div>
</el-col>
</el-row>
</div>
</div>
<el-divider />
<el-divider />
<div class="attr-list">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
巡检内容
</small-title>
<div class="attr-list">
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
巡检内容
</small-title>
<div v-if="!isdetail" class="action_btn">
<template>
<div v-if="!isdetail" class="action_btn">
<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"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="checkDetList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div>
<base-table :table-props="tableProps" :page="listQuery.pageNo" :limit="listQuery.pageSize"
:table-data="checkDetList">
<method-btn v-if="!isdetail" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination v-show="listQuery.total > 0" :total="listQuery.total" :page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize" :page-sizes="[5, 10, 15]" @pagination="getList" />
<!-- <div class="drawer-body__footer">
<!-- <div class="drawer-body__footer">
<el-button type="primary" @click="goback()">关闭</el-button>
</div> -->
</div>
</div>
</div>
</div>
<attr-add
v-if="addOrUpdateVisible"
ref="addOrUpdate"
:order-id="dataForm.id"
@refreshDataList="getList" />
</el-drawer>
<attr-add v-if="addOrUpdateVisible" ref="addOrUpdate" :order-id="dataForm.id" @refreshDataList="getList" />
</el-drawer>
</template>
<script>
@ -111,8 +87,13 @@ const tableProps = [
},
{
prop: 'program',
label: '检查项目',
}
label: '巡检项目',
},
{
prop: 'checkResult',
label: '巡检结果',
},
];
export default {

View File

@ -36,7 +36,7 @@ const tableProps = [
align:'center',
},
{
prop: 'maintainResult',
prop: 'checkResult',
label: '默认巡检结果',
align: 'center',
},
@ -102,7 +102,8 @@ export default {
getDataList(id) {
this.dataListLoading = true;
this.queryParams.equipmentTypeId = id
this.urlOptions.getDataListURL(this.listQuery).then(response => {
console.log(id);
this.urlOptions.getDataListURL(this.queryParams).then(response => {
this.tableData = response.data.list;
this.listQuery.total = response.data.total;
this.dataListLoading = false

View File

@ -6,55 +6,32 @@
-->
<template>
<el-form
ref="form"
:model="form"
:size="size"
:label-position="labelPosition"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item
label="设备保养单号"
prop="maintainOrderNumber"
:rules="[
<el-form ref="form" :model="form" :size="size" :label-position="labelPosition" v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="设备保养单号" prop="maintainOrderNumber" :rules="[
{ required: true, message: '请输入设备保养单号', trigger: 'blur' },
]">
<el-input
v-model="form.maintainOrderNumber"
@change="$emit('update', form)"
:placeholder="`请输入保养计划单号`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-input v-model="form.maintainOrderNumber" @change="$emit('update', form)" :placeholder="`请输入保养计划单号`"
:disabled="disabled" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保养计划名称" prop="name">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="保养计划名称" prop="name">
<el-input value="---" 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-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
<!-- <el-form-item
label="设备大类"
prop="equipmentCategory"
:rules="[
@ -72,89 +49,59 @@
:value="opt.value" />
</el-select>
</el-form-item> -->
</el-col>
</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-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-col>
<el-col :span="12">
<el-form-item label="计划保养人员" prop="maintainer">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划保养人员" prop="maintainer">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划开始时间" prop="planStartTime">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划开始时间" prop="planStartTime">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划结束时间" prop="planEndTime">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划结束时间" prop="planEndTime">
<el-input value="---" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="实际开始时间"
prop="startTime"
:rules="[
<el-col :span="12">
<el-form-item label="实际开始时间" prop="startTime" :rules="[
{ required: true, message: '请选择实际开始时间', trigger: 'blur' },
]">
<el-date-picker
v-model="form.startTime"
type="datetime"
:disabled="edit"
placeholder="请选择实际开始时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-date-picker v-model="form.startTime" 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="endTime"
:rules="[
<el-col :span="12">
<el-form-item label="实际结束时间" prop="endTime" :rules="[
{ required: true, message: '请选择实际结束时间', trigger: 'blur' },
]">
<el-date-picker
v-model="form.endTime"
type="datetime"
:disabled="edit"
placeholder="请选择实际结束时间"
@change="$emit('update', form)"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-date-picker v-model="form.endTime" 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="maintainWorker"
:rules="[
{ required: false, message: '请选择实际保养人员', trigger: 'blur' },
<el-col :span="12">
<el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
{ required: false, message: '请输入实际保养人员', trigger: 'blur' },
]">
<el-select
<el-input v-model="form.maintainWorker" @change="$emit('update', form)" :placeholder="`请输入实际保养人员`" :disabled="disabled" />
<!-- <el-select
v-model="form.maintainWorker"
:placeholder="`请选择实际保养人员`"
:disabled="disabled"
@ -167,21 +114,17 @@
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input
v-model="form.remark"
@change="$emit('update', form)"
:placeholder="`请输入备注`"
:disabled="disabled" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" @change="$emit('update', form)" :placeholder="`请输入备注`" :disabled="disabled" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
@ -321,7 +264,6 @@ export default {
const urls = [
'/base/core-production-line/listAll',
'/system/dept/list-all-simple',
'/base/core-worker/listAll',
];
let res;
switch (source) {
@ -329,10 +271,6 @@ export default {
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 || [];

View File

@ -6,177 +6,116 @@
-->
<template>
<el-drawer
:visible.sync="visible"
:show-close="false"
:wrapper-closable="true"
class="drawer"
custom-class="mes-drawer"
size="60%"
:before-close="beforeClose"
@closed="$emit('destroy')">
<SmallTitle slot="title">编辑</SmallTitle>
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="true" class="drawer"
custom-class="mes-drawer" size="60%" :before-close="beforeClose" @closed="$emit('destroy')">
<SmallTitle slot="title">编辑</SmallTitle>
<div class="drawer-body flex">
<div class="drawer-body__content">
<div class="form-part" style="margin-bottom: 32px">
<!-- <el-skeleton v-if="!showForm" animated /> -->
<el-form
class="equipment-info-form"
ref="form"
:model="form"
label-width="200px"
label-position="top"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="保养计划单号" prop="maintainOrderNumber">
<!-- :rules="[
<div class="drawer-body flex">
<div class="drawer-body__content">
<div class="form-part" style="margin-bottom: 32px">
<!-- <el-skeleton v-if="!showForm" animated /> -->
<el-form class="equipment-info-form" ref="form" :model="form" label-width="200px" label-position="top"
v-loading="formLoading">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="保养计划单号" prop="maintainOrderNumber">
<!-- :rules="[
{
required: true,
message: '请输入保养计划单号',
trigger: 'blur',
},
]" -->
<el-input
v-model="form.maintainOrderNumber"
disabled
:placeholder="`请输入保养计划单号`" />
</el-form-item>
</el-col>
<el-input v-model="form.maintainOrderNumber" disabled :placeholder="`请输入保养计划单号`" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养计划名称" prop="planName">
<el-input
v-model="form.planName"
placeholder="请输入保养计划名称"
disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="保养计划名称" prop="planName">
<el-input v-model="form.planName" placeholder="请输入保养计划名称" disabled />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="部门" prop="departmentId">
<!-- :rules="[
<el-col :span="8">
<el-form-item label="部门" prop="departmentId">
<!-- :rules="[
{ required: true, message: '请选择部门', trigger: 'blur' },
]" -->
<el-select
v-model="form.departmentId"
:placeholder="`请选择部门`"
clearable
disabled
filterable>
<el-option
v-for="opt in departmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-select v-model="form.departmentId" :placeholder="`请选择部门`" clearable disabled filterable>
<el-option v-for="opt in departmentOptions" :key="opt.value" :label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<!-- :rules="[
<el-col :span="8">
<el-form-item label="产线" prop="lineId">
<!-- :rules="[
{ required: true, message: '请选择产线', trigger: 'blur' },
]" -->
<el-select
v-model="form.lineId"
:placeholder="`请选择产线`"
disabled
clearable
filterable>
<el-option
v-for="opt in lineOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-select v-model="form.lineId" :placeholder="`请选择产线`" disabled clearable filterable>
<el-option v-for="opt in lineOptions" :key="opt.value" :label="opt.label" :value="opt.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer">
<el-select
v-model="form.planMaintainWorker"
placeholder="请选择计划保养人员"
disabled
clearable
filterable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划保养人员" prop="maintainer">
<el-select v-model="form.planMaintainWorker" placeholder="请选择计划保养人员" disabled clearable filterable />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划开始时间" prop="planStartTime">
<el-date-picker
v-model="form.planStartTime"
type="datetime"
disabled
placeholder="请选择计划开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划开始时间" prop="planStartTime">
<el-date-picker v-model="form.planStartTime" type="datetime" disabled placeholder="请选择计划开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划结束时间" prop="planEndTime">
<el-date-picker
v-model="form.planEndTime"
type="datetime"
disabled
placeholder="请选择计划结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="计划结束时间" prop="planEndTime">
<el-date-picker v-model="form.planEndTime" type="datetime" disabled placeholder="请选择计划结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="实际开始时间"
prop="startTime"
:rules="[
<el-col :span="8">
<el-form-item label="实际开始时间" prop="startTime" :rules="[
{
required: true,
message: '请选择实际开始时间',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.startTime"
type="datetime"
placeholder="请选择实际开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-date-picker v-model="form.startTime" type="datetime" placeholder="请选择实际开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="实际结束时间"
prop="endTime"
:rules="[
<el-col :span="8">
<el-form-item label="实际结束时间" prop="endTime" :rules="[
{
required: true,
message: '请选择实际结束时间',
trigger: 'blur',
},
]">
<el-date-picker
v-model="form.endTime"
type="datetime"
placeholder="请选择实际结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-date-picker v-model="form.endTime" type="datetime" placeholder="请选择实际结束时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item
label="实际保养人员"
prop="maintainWorker"
:rules="[
<el-col :span="8">
<el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
{
required: false,
message: '请选择实际保养人员',
message: '请输入实际保养人员',
trigger: 'blur',
},
]">
<el-select
<el-input v-model="form.maintainWorker" :placeholder="`请输入实际保养人员`" />
<!-- <el-select
v-model="form.maintainWorker"
:placeholder="`请选择实际保养人员`"
multiple
@ -187,89 +126,62 @@
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item>
</el-col>
</el-select> -->
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-col :span="24">
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" :placeholder="`请输入备注`" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<SmallTitle>保养内容</SmallTitle>
<SmallTitle>保养内容</SmallTitle>
<div style="margin-top: 12px; position: relative">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" />
</div>
<div style="margin-top: 12px; position: relative">
<SearchBar :formConfigs="searchBarFormConfig" ref="attr-search-bar" @headBtnClick="handleSearchBarBtnClick" />
</div>
<div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
<base-table
v-loading="attrListLoading"
:table-props="attrTableProps"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<div style="margin-top: 12px; position: relative">
<div style="position: absolute; top: -40px; right: 0">
<el-button @click="handleAddAttr" type="text">
<i class="el-icon-plus"></i>
添加属性
</el-button>
</div>
<base-table v-loading="attrListLoading" :table-props="attrTableProps" :page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10" :table-data="attrList" @emitFun="handleEmitFun">
<method-btn slot="handleBtn" label="操作" :method-list="tableBtn" @clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 -->
<pagination
v-show="attrTotal > 0"
:total="attrTotal"
:page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize"
@pagination="getAttrList" />
</div>
</div>
<!-- 分页组件 -->
<pagination v-show="attrTotal > 0" :total="attrTotal" :page.sync="attrQuery.params.pageNo"
:limit.sync="attrQuery.params.pageSize" @pagination="getAttrList" />
</div>
</div>
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
<div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 -->
<!-- <el-button
v-if="sections[1].allowAdd"
type="primary"
@click="handleAddAttr">
添加属性
</el-button> -->
</div>
</div>
</div>
</div>
<!-- 属性对话框 -->
<base-dialog
:dialogTitle="attrTitle"
:dialogVisible="attrFormVisible"
width="35%"
:append-to-body="true"
custom-class="baseDialog"
@close="closeAttrForm"
@cancel="closeAttrForm"
@confirm="submitAttrForm">
<DialogForm
v-if="attrFormVisible"
ref="attrForm"
v-model="attrForm"
:rows="attrRows" />
</base-dialog>
</el-drawer>
<!-- 属性对话框 -->
<base-dialog :dialogTitle="attrTitle" :dialogVisible="attrFormVisible" width="35%" :append-to-body="true"
custom-class="baseDialog" @close="closeAttrForm" @cancel="closeAttrForm" @confirm="submitAttrForm">
<DialogForm v-if="attrFormVisible" ref="attrForm" v-model="attrForm" :rows="attrRows" />
</base-dialog>
</el-drawer>
</template>
<script>
@ -541,7 +453,7 @@ export default {
const urls = [
'/base/core-production-line/listAll',
'system/dept/list-all-simple',
'/base/core-worker/listAll',
// '/base/core-worker/listAll',
];
let res;
switch (source) {
@ -549,10 +461,10 @@ export default {
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 'maintainer':
// res = await this.$axios(urls[2]);
// this.maintainerList = res.data || [];
// break;
case 'line':
res = await this.$axios(urls[0]);
this.lineList = res.data || [];

View File

@ -105,14 +105,16 @@
<el-form-item label="实际保养人员" prop="maintainWorker" :rules="[
{
required: false,
message: '请选择实际保养人员',
message: '请输入实际保养人员',
trigger: 'blur',
},
]">
<el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable>
<el-input v-model="form.maintainWorker" :placeholder="`请输入实际保养人员`" />
<!-- <el-select v-model="form.maintainWorker" :placeholder="`请选择实际保养人员`" multiple clearable filterable>
<el-option v-for="opt in maintainerOptions" :key="opt.value" :label="opt.label"
:value="opt.value" />
</el-select>
</el-select> -->
</el-form-item>
</el-col>
@ -445,7 +447,7 @@ export default {
method: 'put',
data: {
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
maintainWorker: this.form.maintainWorker ? this.form.maintainWorker.join(',') :null,
special: false,
relatePlan: 2
}
@ -463,8 +465,8 @@ export default {
url: '/base/equipment-maintain-log/create',
method: 'post',
data: {
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
...this.form,
maintainWorker: this.form.maintainWorker ? this.form.maintainWorker.join(',') : null,
special: false,
relatePlan: 2,
confirmed: false,
@ -536,7 +538,7 @@ export default {
const urls = [
'/base/core-production-line/listAll',
'/system/dept/list-all-simple',
'/base/core-worker/listAll',
// '/base/core-worker/listAll',
];
let res;
switch (source) {
@ -544,10 +546,10 @@ export default {
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 'maintainer':
// res = await this.$axios(urls[2]);
// this.maintainerList = res.data || [];
// break;
case 'line':
res = await this.$axios(urls[0]);
this.lineList = res.data || [];

View File

@ -135,7 +135,7 @@ export default {
maintainDuration: undefined,
remark: undefined,
firstMaintenanceTime: undefined,
maintainer: undefined
maintainer: null
},
menuOptions: [],
proLineList: [],
@ -175,8 +175,8 @@ export default {
const resline = await getCorePLList();
this.proLineList = resline.data;
//
const personres = await getWorkerList()
this.personList = personres.data || []
// const personres = await getWorkerList()
// this.personList = personres.data || []
},
getList() {
//
@ -259,7 +259,8 @@ export default {
if (this.dataForm.id) {
this.urlOptions.updateURL({
...this.dataForm,
maintainer: this.dataForm.maintainer.join(',')
maintainer: this.dataForm.maintainer ? this.dataForm.maintainer.join(',') : null,
}).then(response => {
this.$modal.msgSuccess("修改成功");
this.visible = false;
@ -270,7 +271,7 @@ export default {
//
this.urlOptions.createURL({
...this.dataForm,
maintainer: this.dataForm.maintainer.join(',')
maintainer: this.dataForm.maintainer ? this.dataForm.maintainer.join(',') : null,
}).then(response => {
this.$modal.msgSuccess("新增成功");
// this.idAttrShow = true

View File

@ -17,7 +17,7 @@
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="默认保养结果" prop="resultType">
<el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果">
<el-select v-model="dataForm.resultType" placeholder="请选择默认保养结果" @change="handleClear">
<el-option v-for="dict in resultList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
@ -39,13 +39,16 @@
</el-col>
</el-row>
<el-row v-else-if="dataForm.resultType === 2" :gutter="24">
<el-col :span="12">
<el-col :span="11">
<el-form-item prop="minValue">
<el-input oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.minValue" placeholder="请输入最小值" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="maxValue">
<el-col :span="4">
</el-col>
<el-col :span="9">
<el-form-item prop="maxValue" label-width="20">
<el-input @change="handleChange" oninput="value=value.replace(/[^\-\d.]/g, '')" v-model="dataForm.maxValue"
placeholder="请输入最大值" />
</el-form-item>
@ -102,7 +105,9 @@ export default {
dataRule: {
// materialId: [{ required: true, message: "", trigger: "blur" }],
program: [{ required: true, message: "保养项目不能为空", trigger: "blur" }],
maintainResult: [{ required: true, message: "默认保养结果不能为空", trigger: "blur" }],
maintainResult: [{ required: true, message: "文本或数值不能为空不能为空", trigger: "blur" }],
resultType: [{ required: true, message: "默认保养结果不能为空", trigger: "blur" }],
minValue: [{ required: true, message: "最小值不能为空", trigger: "blur" }],
maxValue: [{ required: true, message: "最大值不能为空", trigger: "blur" }],
@ -114,7 +119,12 @@ export default {
this.getDict()
console.log('我看看', this.dataForm)
},
methods: {
methods: {
handleClear() {
this.dataForm.minValue = undefined
this.dataForm.maxValue = undefined
this.dataForm.maintainResult = undefined
},
async getDict() {
//
const res = await getList();

View File

@ -223,15 +223,13 @@ export default {
},
methods: {
initSearchBar() {
this.http('/base/core-equipment/page', 'get', {
special: false,
pageNo: 1,
pageSize: 999,
}).then(({ data }) => {
this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
console.log('data', data);
this.$set(
this.searchBarFormConfig[0],
'selectOptions',
(data?.list || []).map((item) => ({
(data || []).map((item) => ({
name: item.name,
id: item.id,
}))

View File

@ -184,16 +184,17 @@ export default {
],
[
{
select: true, // TODO: or INPUT instead of SELECT
input: true, // TODO: or INPUT instead of SELECT
label: '负责人',
prop: 'responsible',
url: '/base/core-worker/listAll', // TODO:
valueKey: 'name',
bind: {
filterable: true,
clearable: true,
multiple: true
},
// url: 'system/user/page', // TODO:
// valueKey: 'id',
// labelKey:'username',
// bind: {
// filterable: true,
// clearable: true,
// multiple: true
// },
},
],
[

View File

@ -135,8 +135,9 @@ export default {
{
select: true,
label: '备件名称',
prop: 'productMaterialId',
options: [],
prop: 'productMaterialId',
url: '/base/core-product-material/listAll', // TODO:
// options: [],
bind: {
filterable: true,
clearable: false,

2925
yarn.lock

File diff suppressed because it is too large Load Diff