projects/mesxc-zhp #215
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2024-02-24 18:51:54
|
||||
* @LastEditTime: 2024-02-26 09:29:53
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -103,3 +103,20 @@ export function deleteCheckOrderDet(id) {
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检计划单
|
||||
export function getEqCheckOrder(id) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检单分页
|
||||
export function getCheckOrderPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
26
src/api/equipment/base/maintain/confirm.js
Normal file
26
src/api/equipment/base/maintain/confirm.js
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2024-02-26 15:01:48
|
||||
* @LastEditTime: 2024-02-26 18:09:39
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获得设备保养记录分页
|
||||
export function getLogDetPage(query) {
|
||||
return request({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 获得设备巡检单
|
||||
export function getCheckOrder(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/get',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: Do not edit
|
||||
* @Date: 2023-11-08 15:56:52
|
||||
* @LastEditTime: 2024-02-24 16:53:33
|
||||
* @LastEditTime: 2024-02-26 17:02:53
|
||||
* @LastEditors: DY
|
||||
* @Description:
|
||||
*/
|
||||
@ -43,6 +43,16 @@ export function exportMaintainLogExcel(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 导出巡检单
|
||||
export function exportCheckOrderExcel(query) {
|
||||
return request({
|
||||
url: '/base/equipment-check-order/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得保养记录
|
||||
export function getLog(query) {
|
||||
return request({
|
||||
|
@ -68,7 +68,7 @@ export default {
|
||||
getUserMsg() {
|
||||
let id = this.$store.getters.userId
|
||||
getUserSimple(id).then(res => {
|
||||
this.dept = res.data.deptName ? res.data.dept.deptName : '---'
|
||||
this.dept = res.data.deptName ? res.data.deptName : '---'
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
|
65
src/views/equipment/base/inspection/Confirm/SmallTitle.vue
Normal file
65
src/views/equipment/base/inspection/Confirm/SmallTitle.vue
Normal file
@ -0,0 +1,65 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2023-08-01 15:27:31
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-08-01 16:25:54
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="[className, { 'p-0': noPadding }]">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
size: {
|
||||
// 取值范围: xl lg md sm
|
||||
type: String,
|
||||
default: 'de',
|
||||
validator: function (val) {
|
||||
return ['xl', 'lg', 'de', 'md', 'sm'].indexOf(val) !== -1;
|
||||
},
|
||||
},
|
||||
noPadding: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
className: function () {
|
||||
return `${this.size}-title`;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
$pxls: (xl, 28px) (lg, 24px) (de, 20px) (md, 18px) (sm, 16px);
|
||||
$mgr: 8px;
|
||||
@each $size, $height in $pxls {
|
||||
.#{$size}-title {
|
||||
font-size: 18px;
|
||||
line-height: $height;
|
||||
color: #000;
|
||||
font-weight: 500;
|
||||
font-family: '微软雅黑', 'Microsoft YaHei', Arial, Helvetica, sans-serif;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: $height + 2px;
|
||||
border-radius: 1px;
|
||||
margin-right: $mgr;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.p-0 {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
251
src/views/equipment/base/inspection/Confirm/WaitingListTable.vue
Normal file
251
src/views/equipment/base/inspection/Confirm/WaitingListTable.vue
Normal file
@ -0,0 +1,251 @@
|
||||
<!--
|
||||
filename: WaitingListTable.vue
|
||||
author: liubin
|
||||
date: 2024-02-05 16:12:55
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableDataWithIndex"
|
||||
:border="true"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{
|
||||
background: '#f2f4f9',
|
||||
color: '#606266',
|
||||
}"
|
||||
class="waiting-list-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
:width="50"
|
||||
:selectable="checkSelectable" />
|
||||
<el-table-column prop="_pageIndex" width="80" align="center">
|
||||
<template slot="header">
|
||||
<el-popover placement="bottom-start" width="300" trigger="click">
|
||||
<div class="setting-box" style="max-height: 400px; overflow-y: auto">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in tablePropsLabelList"
|
||||
:key="'cb' + index"
|
||||
v-model="selectedBox[index]"
|
||||
:label="item.label" />
|
||||
</div>
|
||||
<i slot="reference" class="el-icon-s-tools" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[0]"
|
||||
label="巡检单名称"
|
||||
prop="name"></el-table-column>
|
||||
<el-table-column v-if="selectedBox[1]" label="部门" prop="planName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.department || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[2]"
|
||||
label="巡检时间"
|
||||
prop="planCheckTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planCheckTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[3]"
|
||||
label="班次"
|
||||
prop="groupClass">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.groupClass || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[4]"
|
||||
label="确认截止时间"
|
||||
prop="confirmDueTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.confirmDueTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[5]"
|
||||
width="150"
|
||||
label="备注"
|
||||
prop="remark">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.remark }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="selectedBox[10]" width="60" label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handelDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- btns -->
|
||||
<el-table-column width="188" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="确认" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
:disabled="!checkSelectable(scope.row)"
|
||||
@click="$emit('confirm', scope.row)">
|
||||
确认
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('detail', scope.row)">
|
||||
<i class="iconfont icon-detail primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('edit', scope.row)">
|
||||
<i class="iconfont icon-edit primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('delete', scope.row)">
|
||||
<i class="iconfont icon-delete delete-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
name: 'WaitingListTable',
|
||||
components: {},
|
||||
props: ['tableData', 'page', 'limit'],
|
||||
filters: {
|
||||
timeFilter: (val) =>
|
||||
val ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '---',
|
||||
relatePlanFilter: (val) =>
|
||||
val != null ? ['-', '计划型', '非计划型'][val] : '-',
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tablePropsLabelList: [
|
||||
{
|
||||
label: '巡检单名称',
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
},
|
||||
{
|
||||
label: '巡检时间',
|
||||
},
|
||||
{
|
||||
label: '班次',
|
||||
},
|
||||
{
|
||||
label: '确认截止时间',
|
||||
},
|
||||
{
|
||||
label: '备注',
|
||||
},
|
||||
],
|
||||
selectedBox: [
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true
|
||||
],
|
||||
selectedPlan: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tableDataWithIndex() {
|
||||
return this.tableData.map((item, index) => ({
|
||||
...item,
|
||||
_pageIndex: (this.page - 1) * this.limit + index + 1,
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row, index) {
|
||||
return true;
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectedPlan = val;
|
||||
},
|
||||
handleDelete(row) {},
|
||||
handleDetail(row) {},
|
||||
handleEdit(row) {},
|
||||
handleConfirm(row) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './iconfont/iconfont.css';
|
||||
.delete-color {
|
||||
color: #ff5454;
|
||||
}
|
||||
.primary-color {
|
||||
color: #0b58ff;
|
||||
}
|
||||
|
||||
.baseTable .show-col-btn {
|
||||
margin-right: 5px;
|
||||
line-height: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.baseTable .el-icon-refresh {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.waiting-list-table .el-table__body tr.current-row > td.el-table__cell {
|
||||
background-color: #eaf1fc;
|
||||
}
|
||||
.waiting-list-table.el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
.waiting-list-table .addButton {
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
border-top: none;
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
border-radius: 0;
|
||||
}
|
||||
.waiting-list-table .addButton:hover {
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
.waiting-list-table .addButton:focus {
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.el-tooltip__popper.is-dark {
|
||||
background: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
.el-tooltip__popper .popper__arrow,
|
||||
.el-tooltip__popper .popper__arrow::after {
|
||||
border-top-color: rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
</style>
|
498
src/views/equipment/base/inspection/Confirm/add-or-updata.vue
Normal file
498
src/views/equipment/base/inspection/Confirm/add-or-updata.vue
Normal file
@ -0,0 +1,498 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-27 08:58:08
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="isdetail"
|
||||
class="drawer"
|
||||
size="60%">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ isdetail ? '详情' : !dataForm.id ? '新增' : '编辑' }}
|
||||
</small-title>
|
||||
<div class="content">
|
||||
<div class="visual-part">
|
||||
<el-form
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
ref="dataForm"
|
||||
@keyup.enter.native="dataFormSubmit()"
|
||||
label-width="100px"
|
||||
label-position="top">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="巡检单名称" prop="name">
|
||||
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="部门" prop="departmentId">
|
||||
<el-select
|
||||
v-model="dataForm.departmentId"
|
||||
:placeholder="`请选择部门`">
|
||||
<el-option
|
||||
v-for="opt in departmentOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="班次" prop="groupClass">
|
||||
<el-select
|
||||
v-model="dataForm.groupClass"
|
||||
filterable
|
||||
clearable
|
||||
multiple
|
||||
:disabled="isedit"
|
||||
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="8">
|
||||
<el-form-item label="巡检人" prop="checkPerson">
|
||||
<el-select
|
||||
v-model="dataForm.checkPerson"
|
||||
:placeholder="`请选择巡检人`"
|
||||
multiple
|
||||
clearable
|
||||
:disabled="isedit"
|
||||
filterable>
|
||||
<el-option
|
||||
v-for="opt in inspectorOptions"
|
||||
: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="planCheckTime">
|
||||
<el-date-picker
|
||||
v-model="dataForm.planCheckTime"
|
||||
type="datetime"
|
||||
:disabled="isedit"
|
||||
placeholder="请选择巡检时间"
|
||||
value-format="timestamp"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
|
||||
<div class="attr-list" v-if="idAttrShow">
|
||||
<small-title
|
||||
style="margin: 16px 0; padding-left: 8px"
|
||||
:no-padding="true">
|
||||
巡检内容
|
||||
</small-title>
|
||||
|
||||
<div v-if="!isdetail">
|
||||
<div>
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="attr-search-bar"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
</div>
|
||||
<!-- <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> -->
|
||||
</div>
|
||||
<base-table
|
||||
:table-props="tableProps"
|
||||
:page="listQuery.pageNo"
|
||||
:limit="listQuery.pageSize"
|
||||
:table-data="detList">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-if="!isdetail" class="drawer-body__footer">
|
||||
<el-button @click="goback()">取消</el-button>
|
||||
<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</div>
|
||||
|
||||
<attr-add
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
:order-id="dataForm.id"
|
||||
@refreshDataList="getList" />
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import basicAdd from './../../../../core/mixins/basic-add';
|
||||
import { createCheckOrder, updateCheckOrder, getCheckOrder } from "@/api/equipment/base/inspection/settings";
|
||||
import { getCheckOrderDetPage, deleteCheckOrderDet } from "@/api/equipment/base/inspection/record";
|
||||
import SmallTitle from './SmallTitle';
|
||||
import { parseTime } from '@/utils/ruoyi';
|
||||
import attrAdd from './attr-add';
|
||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
|
||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
|
||||
|
||||
const tableBtn = [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
];
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称'
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '巡检项目',
|
||||
},
|
||||
{
|
||||
prop: 'checkResult',
|
||||
label: '巡检结果',
|
||||
},
|
||||
];
|
||||
|
||||
const topBtnConfig = [
|
||||
{
|
||||
type: 'add',
|
||||
btnName: 'btn.add'
|
||||
}
|
||||
]
|
||||
|
||||
export default {
|
||||
mixins: [basicAdd],
|
||||
components: { SmallTitle, attrAdd },
|
||||
data() {
|
||||
return {
|
||||
tableBtn,
|
||||
tableProps,
|
||||
topBtnConfig,
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
createURL: createCheckOrder,
|
||||
updateURL: updateCheckOrder,
|
||||
infoURL: getCheckOrder,
|
||||
},
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
color: 'success',
|
||||
plain: true
|
||||
}
|
||||
],
|
||||
listQuery: {
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
total: 0,
|
||||
equipmentName: undefined
|
||||
},
|
||||
dataForm: {
|
||||
id: undefined,
|
||||
name: '',
|
||||
departmentId: undefined,
|
||||
groupClass: undefined,
|
||||
checkPerson: undefined,
|
||||
planCheckTime: undefined
|
||||
},
|
||||
detList: [],
|
||||
groupOptions: [],
|
||||
// departmentList: [],
|
||||
departmentOptions: [],
|
||||
inspectorOptions: [],
|
||||
visible: false,
|
||||
isdetail: false,
|
||||
isedit: false,
|
||||
idAttrShow: false,
|
||||
dataRule: {
|
||||
name: [{ required: true, message: "巡检单名称不能为空", trigger: "blur" }]
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
// 班次列表
|
||||
const res = await groupClassesListAll();
|
||||
this.groupOptions = res.data || [];
|
||||
// 部门列表
|
||||
const res1 = await getCoreDepartmentList();
|
||||
this.departmentOptions = res1.data || []
|
||||
// 巡检人
|
||||
let inspectorList = [];
|
||||
const userlist = await this.$axios({
|
||||
url: '/system/user/page',
|
||||
params: { pageNo: 1, pageSize: 100 },
|
||||
});
|
||||
if (userlist.code == 0) {
|
||||
inspectorList = inspectorList.concat(
|
||||
(userlist.data?.list || []).map((item) => ({
|
||||
label: item.username,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
const workerlist = await this.$axios('/base/core-worker/listAll');
|
||||
if (workerlist.code == 0) {
|
||||
inspectorList = inspectorList.concat(
|
||||
workerlist.data.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
}
|
||||
this.inspectorOptions = inspectorList;
|
||||
// const res1 = await groupClassesListAll();
|
||||
// this.groupOptions = res1.data || [];
|
||||
// const res = await getEquipmentAll()
|
||||
// this.eqList = res.data
|
||||
},
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.equipmentName = btn.equipmentName;
|
||||
this.getList();
|
||||
break;
|
||||
case 'add':
|
||||
this.addNew()
|
||||
break;
|
||||
}
|
||||
},
|
||||
initData() {
|
||||
this.detList.splice(0);
|
||||
this.listQuery.total = 0;
|
||||
},
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`是否确认删除巡检项目名为"${raw.data.program}"的数据项?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteCheckOrderDet(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
getList() {
|
||||
// 获取设备巡检单详细
|
||||
getCheckOrderDetPage({
|
||||
...this.listQuery,
|
||||
orderId: this.dataForm.id,
|
||||
}).then((response) => {
|
||||
this.detList = response.data.list;
|
||||
this.listQuery.total = response.data.total;
|
||||
});
|
||||
},
|
||||
init(id, isdetail) {
|
||||
this.initData();
|
||||
this.isdetail = isdetail || false;
|
||||
this.dataForm.id = id || undefined;
|
||||
this.isedit = id ? true : false;
|
||||
console.log('你好', this.isedit)
|
||||
this.visible = true;
|
||||
if (id) {
|
||||
this.idAttrShow = true
|
||||
} else {
|
||||
this.idAttrShow = false
|
||||
}
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取巡检单详情
|
||||
this.urlOptions.infoURL(id).then(response => {
|
||||
this.dataForm = response.data
|
||||
});
|
||||
// 获取巡检内容列表
|
||||
this.getList();
|
||||
} else {
|
||||
if (this.urlOptions.isGetCode) {
|
||||
this.getCode()
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
goback() {
|
||||
this.$emit('refreshDataList');
|
||||
this.visible = false;
|
||||
this.initData();
|
||||
},
|
||||
goEdit() {
|
||||
this.isdetail = false;
|
||||
},
|
||||
// 新增 / 修改
|
||||
addNew(id) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(id);
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs["dataForm"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return false;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
this.urlOptions.updateURL({
|
||||
...this.dataForm,
|
||||
groupClass: this.dataForm.groupClass.join(','),
|
||||
checkPerson: this.dataForm.checkPerson.join(','),
|
||||
special: false,
|
||||
status: 1
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.urlOptions.createURL({
|
||||
...this.dataForm,
|
||||
groupClass: this.dataForm.groupClass.join(','),
|
||||
checkPerson: this.dataForm.checkPerson.join(','),
|
||||
special: false,
|
||||
status: 1
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
// this.idAttrShow = true
|
||||
this.dataForm.id = response.data
|
||||
this.visible = false;
|
||||
this.$emit("refreshDataList");
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .el-form-item__label {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
}
|
||||
.drawer >>> .el-drawer__body {
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.drawer >>> .content {
|
||||
padding: 30px 24px;
|
||||
/* flex: 1; */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* height: 100%; */
|
||||
}
|
||||
|
||||
.drawer >>> .visual-part {
|
||||
flex: 1 auto;
|
||||
max-height: 76vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
padding-right: 10px; /* 调整滚动条样式 */
|
||||
}
|
||||
|
||||
.drawer >>> .el-form,
|
||||
.drawer >>> .attr-list {
|
||||
padding: 0 16px;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.action_btn {
|
||||
float: right;
|
||||
margin: -32px 15px 0;
|
||||
font-size: 14px;
|
||||
}
|
||||
.add {
|
||||
color: #0b58ff;
|
||||
}
|
||||
</style>
|
172
src/views/equipment/base/inspection/Confirm/attr-add.vue
Normal file
172
src/views/equipment/base/inspection/Confirm/attr-add.vue
Normal file
@ -0,0 +1,172 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
:visible.sync="visible"
|
||||
:width="'35%'"
|
||||
:append-to-body="true"
|
||||
:close-on-click-modal="false"
|
||||
class="dialog">
|
||||
<template #title>
|
||||
<slot name="title">
|
||||
<div class="titleStyle">
|
||||
{{ !dataForm.id ? '新增' : '编辑' }}
|
||||
</div>
|
||||
</slot>
|
||||
</template>
|
||||
|
||||
<el-form
|
||||
ref="dataForm"
|
||||
:model="dataForm"
|
||||
:rules="dataRule"
|
||||
label-width="100px"
|
||||
@keyup.enter.native="dataFormSubmit()">
|
||||
<el-form-item label="设备名称" prop="equipmentId">
|
||||
<el-select
|
||||
v-model="dataForm.equipmentId"
|
||||
filterable
|
||||
clearable
|
||||
placeholder="请选择设备名称"
|
||||
style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in eqList"
|
||||
:key="dict.id"
|
||||
:label="dict.name"
|
||||
:value="dict.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检项目" prop="program">
|
||||
<el-input
|
||||
v-model="dataForm.program"
|
||||
placeholder="请输入巡检项目"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="巡检结果" prop="checkResult">
|
||||
<el-input
|
||||
v-model="dataForm.checkResult"
|
||||
placeholder="请输入巡检结果"
|
||||
clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row style="text-align: right">
|
||||
<el-button @click="visible = false">取消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createCheckOrderDet, updateCheckOrderDet, getCheckOrderDet } from "@/api/equipment/base/inspection/settings";
|
||||
import { getEquipmentPage } from '@/api/base/equipment'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
orderId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
dataForm: {
|
||||
id: null,
|
||||
equipmentId: null,
|
||||
program: null,
|
||||
checkResult: null
|
||||
},
|
||||
eqList: [],
|
||||
dataRule: {
|
||||
equipmentId: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
program: [
|
||||
{ required: true, message: '巡检项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
checkResult: [
|
||||
{ required: true, message: '巡检结果不能为空', trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
async getDict() {
|
||||
const res = await getEquipmentPage({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false
|
||||
})
|
||||
this.eqList = res.data.list
|
||||
},
|
||||
init(id) {
|
||||
this.dataForm.id = id || '';
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['dataForm'].resetFields();
|
||||
if (this.dataForm.id) {
|
||||
getCheckOrderDet(this.dataForm.id).then((res) => {
|
||||
const { equipmentId, program, checkResult } = res.data;
|
||||
this.dataForm.equipmentId = equipmentId;
|
||||
this.dataForm.program = program;
|
||||
this.dataForm.checkResult = checkResult;
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit() {
|
||||
this.$refs['dataForm'].validate((valid) => {
|
||||
if (valid) {
|
||||
// 修改的提交
|
||||
if (this.dataForm.id) {
|
||||
updateCheckOrderDet({
|
||||
...this.dataForm,
|
||||
orderId: this.orderId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createCheckOrderDet({
|
||||
...this.dataForm,
|
||||
orderId: this.orderId,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.dialog >>> .el-dialog__body {
|
||||
padding: 30px 24px;
|
||||
}
|
||||
.dialog >>> .el-dialog__header {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 0.85);
|
||||
font-weight: 500;
|
||||
padding: 13px 24px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
}
|
||||
.dialog >>> .el-dialog__header .titleStyle::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 4px;
|
||||
height: 16px;
|
||||
background-color: #0b58ff;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
top: 2px;
|
||||
}
|
||||
</style>
|
539
src/views/equipment/base/inspection/Confirm/iconfont/demo.css
Normal file
539
src/views/equipment/base/inspection/Confirm/iconfont/demo.css
Normal file
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3821755 */
|
||||
src: url('iconfont.eot?t=1689233106339'); /* IE9 */
|
||||
src: url('iconfont.eot?t=1689233106339#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAARgAAsAAAAACcAAAAQUAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDKAqGSIUsATYCJAMYCw4ABCAFhGcHVBtUCMiuMG7hiaIkox1FaBhxvd1fpwAN4YKo1v7tWTr8hBRkBQgO7yqKUJKPUKzDjkixjn7/q0vlANCkEHCJtsMvx2eQn04h5rHEE8593TK2y1SC5nbvNG5gqgZBNEWTqFUQLGVFNnVu1TjyMm3SafEsC3y0myW12KdEh2x+deP/zzHTJeG3AVBm4lrnAxpQN0US7s3ijuSE6Jbh1UGv08cgQEivMg5z6m49Qj77TVxDEZww6gXicNkviSbkxgswNeGCj+CgMw1yFRpAnUNegSv+8+UfU/igsBpjnRV3rRV9+Su8Fk1Agv6CW4eAeyvAAhronJlI1tcrVnIMHZ0cCcsUTrRTnQ0CP50B4KfgEub9Lw80BougQBwGI8bYJU4LPwUbBw0/HXAw8NORUM90wsT9JeIMFACux9QckHyQ9FDYTobcGi+FLSjwMxDe3L5s+w9THFYeEs8H303FWMnZ1JuBWFgNPh3bd5wOvJmKI9aTqXeD8eJ66HnfnV1dJPE8cy4EgqT+s/SbdSWbp9Pn24NbZ1MnGw7CDbvT6+lL1CXVh++hcH56umDT9vOviL/grQ6srHjE57uLHdQn+dtO9x2v94WN6+eXm0HWlZOzta3tUDp1JWjymsiD8r0ViWGkC+n4GeH5aODSM+9COnilpdfdZsRIvMerLmS0uICTplrOnb99LT3NkJNeajPfpDznblq6bXH8efBjlPIUxhQcX+U0qEdt4bjxy6rMdOkbEn0/3mlvrXZL60ysxdwcn/qKLJ/82pnzGS61z5rBeGmrxf33ZXN/IBWUvb8KSvnttbwwq+YTkweZHue0M0+c0ssZGY/Rs+aVF8+3GaW07CkvLC/KcBvP8c2uGpsdm0THlazwlPE22Kdi9ZK4Hdsmtw9eHVQwPjG0p33Q7tGMJ6TUJ2VK1MMw6ftI6qPPtruCvEPmLZqiHcj1Aw3Rup/sdzj+lt/w3f5TrAHgx++nD7A+8xaD4CL8m60Q+KWYO7CgUY3gTFl+OwUBHKteh00BoWmGDIYm301frAJwKAg+BTEoPCpA41OPNNh2sET0g8NnCkI61M6PKKBzREwANBtGIOS6BEU2D0CT6xvSYP+Apdg/cOT6DyErI68W0RzbqhmYOFixuRNLFqoRi839Zh+A2KqYWJH1CTC7hM04My0j664HDVgXY+xtYhbnBBNGVVzH7geKQrHOqA0sPK2Fc70oPZ2UPSTNQlVUjQEmHLDCzDphEgtKQ9zCPP16DwBRK4UJAyKfyBg7jaeaxzKlyQAg6xkaKO9M2tu1EWXhOEL3IxhKhdWpMqCYDgrTy7vZAAsuTUsLm65IOlWIQBlp47PUS9wAhBgHOFGixYgVJx7+dtqutZuY1eXTvXYncJOkOF1Wicd+CnBACA==') format('woff2'),
|
||||
url('iconfont.woff?t=1689233106339') format('woff'),
|
||||
url('iconfont.ttf?t=1689233106339') format('truetype'),
|
||||
url('iconfont.svg?t=1689233106339#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-downward:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.icon-upward:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.icon-detail:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-edit:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.icon-delete:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "3821755",
|
||||
"name": "component",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "封装的组件中的icon",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "36426261",
|
||||
"name": "downward",
|
||||
"font_class": "downward",
|
||||
"unicode": "e604",
|
||||
"unicode_decimal": 58884
|
||||
},
|
||||
{
|
||||
"icon_id": "36426301",
|
||||
"name": "upward",
|
||||
"font_class": "upward",
|
||||
"unicode": "e605",
|
||||
"unicode_decimal": 58885
|
||||
},
|
||||
{
|
||||
"icon_id": "33347867",
|
||||
"name": "detail",
|
||||
"font_class": "detail",
|
||||
"unicode": "e601",
|
||||
"unicode_decimal": 58881
|
||||
},
|
||||
{
|
||||
"icon_id": "33347918",
|
||||
"name": "edit",
|
||||
"font_class": "edit",
|
||||
"unicode": "e602",
|
||||
"unicode_decimal": 58882
|
||||
},
|
||||
{
|
||||
"icon_id": "33347930",
|
||||
"name": "delete",
|
||||
"font_class": "delete",
|
||||
"unicode": "e603",
|
||||
"unicode_decimal": 58883
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Created by iconfont</metadata>
|
||||
<defs>
|
||||
<font id="iconfont" horiz-adv-x="1024">
|
||||
<font-face
|
||||
font-family="iconfont"
|
||||
font-weight="400"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="downward" unicode="" d="M556.942222 144.099556l363.064889 401.806222c24.860444 21.617778 24.860444 56.263111 0 77.880889a68.437333 68.437333 0 0 1-44.942222 16.156444c-16.896 0-33.052444-5.859556-44.885333-16.156444L512 260.949333l-318.236444 362.951111a68.437333 68.437333 0 0 1-44.942223 16.099556c-16.896 0-33.109333-5.802667-44.942222-16.156444-24.746667-21.617778-24.746667-56.206222 0-77.824l363.121778-401.749334c5.973333-5.290667 13.141333-9.443556 21.048889-12.231111 23.722667-8.305778 51.029333-3.527111 68.892444 12.060445z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="upward" unicode="" d="M556.942222 623.900444l363.064889-401.806222c24.860444-21.617778 24.860444-56.263111 0-77.880889a68.437333 68.437333 0 0 0-44.942222-16.156444c-16.896 0-33.052444 5.859556-44.885333 16.156444L512 507.050667l-318.236444-362.951111a68.437333 68.437333 0 0 0-44.942223-16.099556c-16.896 0-33.109333 5.802667-44.942222 16.156444-24.746667 21.617778-24.746667 56.206222 0 77.824L467.057778 623.729778c5.973333 5.290667 13.141333 9.443556 21.048889 12.231111 23.722667 8.305778 51.029333 3.527111 68.892444-12.060445z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="detail" unicode="" d="M902.428444 705.251556H332.401778a7.964444 7.964444 0 0 1-7.793778-8.021334v-56.206222a7.964444 7.964444 0 0 1 7.793778-8.078222h570.026666A7.964444 7.964444 0 0 1 910.222222 641.024v56.206222a7.964444 7.964444 0 0 1-7.793778 8.021334z m0-285.127112H332.401778a7.964444 7.964444 0 0 1-7.793778-7.964444v-56.32a7.964444 7.964444 0 0 1 7.793778-7.964444h570.026666a7.964444 7.964444 0 0 1 7.793778 7.964444v56.32a7.964444 7.964444 0 0 1-7.793778 7.964444z m0-285.070222H332.401778a7.964444 7.964444 0 0 1-7.793778-8.078222v-56.206222a7.964444 7.964444 0 0 1 7.793778-8.021334h570.026666a7.964444 7.964444 0 0 1 7.793778 8.021334v56.206222a7.964444 7.964444 0 0 1-7.793778 8.078222zM113.777778 669.127111c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0 56.547556 56.547556 0 0 1 27.306666 48.696889 56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0A56.547556 56.547556 0 0 1 113.777778 669.127111zM113.777778 384c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0A56.547556 56.547556 0 0 1 223.061333 384a56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0A56.547556 56.547556 0 0 1 113.777778 384z m0-285.127111c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0 56.547556 56.547556 0 0 1 27.306666 48.696889 56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0 56.547556 56.547556 0 0 1-27.363555-48.696889z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="edit" unicode="" d="M873.016889 395.264a32.824889 32.824889 0 0 0 65.649778 0v-273.806222a164.124444 164.124444 0 0 0-164.124445-164.124445h-525.084444A164.124444 164.124444 0 0 0 85.333333 121.457778v525.084444A164.124444 164.124444 0 0 0 249.457778 810.666667h312.32a32.824889 32.824889 0 1 0 0-65.649778h-312.32a98.417778 98.417778 0 0 1-98.474667-98.417778v-525.141333c0-54.385778 44.088889-98.474667 98.417778-98.474667h525.141333a98.417778 98.417778 0 0 1 98.474667 98.417778V395.320889z m-14.222222 362.097778a32.824889 32.824889 0 0 0 48.014222-44.771556L548.750222 328.533333a32.824889 32.824889 0 1 0-48.014222 44.771556l358.115556 384.056889z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="delete" unicode="" d="M601.024 146.24a29.632 29.632 0 0 0-29.696 29.696V503.04a29.632 29.632 0 1 0 59.456 0v-326.848a29.76 29.76 0 0 0-29.76-29.888z m-178.24 0a29.632 29.632 0 0 0-29.696 29.696V503.04a29.632 29.632 0 1 0 59.392 0v-326.848a29.76 29.76 0 0 0-29.696-29.888z m475.52 505.216h-148.544v59.456c0 49.152-39.616 89.088-88.512 89.088H363.392c-49.216 0-89.152-39.936-89.152-89.088v-59.456H125.696a29.632 29.632 0 1 1 0-59.392h772.608a29.632 29.632 0 1 1 0 59.392z m-564.608 59.456c0 16.256 13.44 29.696 29.696 29.696h297.856c16.32 0 29.056-13.12 29.056-29.696v-59.456H333.696v59.456zM720-32h-416a89.152 89.152 0 0 0-89.088 89.088V503.232a29.632 29.632 0 1 0 59.456 0v-446.08c0-16.512 13.44-29.76 29.696-29.76h416.064a29.632 29.632 0 0 1 29.696 29.696V502.144a29.632 29.632 0 1 0 59.456 0v-445.056A89.536 89.536 0 0 0 720-32z" horiz-adv-x="1024" />
|
||||
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
530
src/views/equipment/base/inspection/Confirm/index.vue
Normal file
530
src/views/equipment/base/inspection/Confirm/index.vue
Normal file
@ -0,0 +1,530 @@
|
||||
<!--
|
||||
filename: MaintainRecord.vue
|
||||
author: DY
|
||||
date: 2023-12-12 13:54:53
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChange"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<WaitingListTable
|
||||
ref="waiting-list-table"
|
||||
:table-data="list"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
@edit="handleEdit"
|
||||
@detail="handleDetail"
|
||||
@delete="handleDelete"
|
||||
@confirm="handleConfirm" />
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<!-- <base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="60%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogFormUnplanned
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'" />
|
||||
<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> -->
|
||||
|
||||
<!-- 编辑 -->
|
||||
<!-- <UnplannedEditDrawer
|
||||
ref="unplanned"
|
||||
v-if="openUnplannedDrawer"
|
||||
@refreshDataList="getList"
|
||||
@destroy="openUnplannedDrawer = false" />
|
||||
<PlannedEditDrawer
|
||||
ref="planned"
|
||||
v-if="openPlannedDrawer"
|
||||
@refreshDataList="getList"
|
||||
@destroy="openPlannedDrawer = false" />
|
||||
|
||||
<RecordDetail
|
||||
v-if="recordDetailVisible"
|
||||
ref="recordDetailDrawer"
|
||||
@destroy="recordDetailVisible = false" /> -->
|
||||
<add-or-update
|
||||
v-if="addOrUpdateVisible"
|
||||
ref="addOrUpdate"
|
||||
@refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
// import DialogFormUnplanned from './WaitingList--add--unplanned.vue';
|
||||
// import UnplannedEditDrawer from './WaitingListUnplanned--edit.vue';
|
||||
// import PlannedEditDrawer from './WaitingListPlanned--edit.vue';
|
||||
import {
|
||||
exportCheckOrderExcel,
|
||||
} from '@/api/equipment/base/maintain/record';
|
||||
import WaitingListTable from './WaitingListTable.vue';
|
||||
// import RecordDetail from './Record--detail.vue';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
const btn = {
|
||||
name: 'tableBtn',
|
||||
props: ['injectData'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.label,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
return (
|
||||
<el-button type="text" onClick={this.handleClick}>
|
||||
{this.injectData.name}
|
||||
</el-button>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Confirm',
|
||||
components: {
|
||||
WaitingListTable,
|
||||
AddOrUpdate
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
recordDetailVisible: false,
|
||||
searchBarKeys: [
|
||||
'name'
|
||||
],
|
||||
tobeConfirmedIdList: [],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '巡检单名称',
|
||||
placeholder: '请输入巡检单名称',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '批量确认',
|
||||
name: 'batchConfirm',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:check-setting:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:maintain-record:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// plain: true,
|
||||
// color: 'success',
|
||||
// },
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
maintainPlanId: null,
|
||||
startTime: null,
|
||||
special: false,
|
||||
status: 1,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-order',
|
||||
mode: null,
|
||||
allSpecialEquipments: [],
|
||||
openPlannedDrawer: false,
|
||||
openUnplannedDrawer: false,
|
||||
openPlannedDrawer: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
tobeConfirmedIdList: {
|
||||
handler(val) {
|
||||
if (val.length == this.list.length) {
|
||||
this.$refs['table'].toggleAllSelection();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 批量确认 */
|
||||
async searchBarClicked(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'batchConfirm':
|
||||
const ids = this.$refs['waiting-list-table'].selectedPlan.map(
|
||||
(item) => item.id
|
||||
)
|
||||
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
||||
this.$message.warning('请选择待确认的设备巡检单');
|
||||
return;
|
||||
}
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId + '&ids=' + ids,
|
||||
method: 'put',
|
||||
// data: this.$refs['waiting-list-table'].selectedPlan.map(
|
||||
// (item) => item.id
|
||||
// ),
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message.success('确认成功');
|
||||
this.getList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleSelectionChange(list) {
|
||||
if (this.tobeConfirmedIdList.length) {
|
||||
this.tobeConfirmedIdList = [];
|
||||
this.list.forEach((item) => {
|
||||
this.handleEmitFun({
|
||||
action: 'row-selected',
|
||||
value: { row: item, selected: false },
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
'清空选择列表',
|
||||
this.list.map((item) => item._selection)
|
||||
);
|
||||
} else {
|
||||
this.tobeConfirmedIdList = list.map((item) => item.id);
|
||||
this.list.forEach((item) => {
|
||||
this.handleEmitFun({
|
||||
action: 'row-selected',
|
||||
value: { row: item, selected: true },
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
'全选',
|
||||
this.list.map((item) => item._selection)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
handleEmitFun({ action, value }) {
|
||||
switch (action) {
|
||||
case '详情':
|
||||
this.recordDetailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.recordDetailDrawer.show({
|
||||
id: value.id,
|
||||
planMaintainWorker: value.planMaintainWorker,
|
||||
maintainWorker: value.maintainWorker,
|
||||
});
|
||||
});
|
||||
break;
|
||||
case 'row-selected':
|
||||
if (value.selected) {
|
||||
this.tobeConfirmedIdList.push(value.row.id);
|
||||
value.row._selection = 0b11;
|
||||
} else {
|
||||
const index = this.tobeConfirmedIdList.indexOf(value.row.id);
|
||||
if (index != -1) {
|
||||
this.tobeConfirmedIdList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
console.log('tobeConfirmedIdList', this.tobeConfirmedIdList);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleSearchBarChange({ param, value }) {
|
||||
console.log('122', param)
|
||||
// if ('specialType' === param) {
|
||||
// if (!value) {
|
||||
// this.setSearchBarEquipmentList(this.allSpecialEquipments);
|
||||
// return;
|
||||
// }
|
||||
// this.setSearchBarEquipmentList(
|
||||
// this.allSpecialEquipments.filter((item) => item.specialType == value)
|
||||
// );
|
||||
// }
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv({
|
||||
...this.queryParams
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
relatePlan: null,
|
||||
maintainWorker: [],
|
||||
maintainOrderNumber: null,
|
||||
departmentId: null,
|
||||
lineId: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
planStartTime: null,
|
||||
planEndTime: null,
|
||||
confirmed: false,
|
||||
remark: null,
|
||||
special: false,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
// this.reset();
|
||||
// this.open = true;
|
||||
// this.title = '添加待确认保养记录';
|
||||
// this.addOrEditTitle = '新增';
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init();
|
||||
});
|
||||
},
|
||||
|
||||
// 新增 / 修改
|
||||
// addOrUpdateHandle(id) {
|
||||
// this.addOrUpdateVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.addOrUpdate.init(id);
|
||||
// });
|
||||
// },
|
||||
|
||||
getConfirmed() {
|
||||
return this.$confirm('是否直接确认保养记录', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加的提交
|
||||
this.getConfirmed()
|
||||
.then((confirmed) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: true,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: false,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 确认 */
|
||||
async handleConfirm(row) {
|
||||
console.log('111', this.$store.getters.userId)
|
||||
this.$modal
|
||||
.confirm('是否确认巡检单"' + row.name + '"?')
|
||||
.then(() => {
|
||||
return this.$axios({
|
||||
url:
|
||||
'/base/equipment-check-order/confirm?confirmPerson=' +
|
||||
this.$store.getters.userId + '&ids=' + [row.id],
|
||||
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
|
||||
method: 'put',
|
||||
// data: [row.id],
|
||||
});
|
||||
})
|
||||
.then((res) => {
|
||||
this.getList();
|
||||
res.code == 0 && this.$modal.msgSuccess('确认成功');
|
||||
res.code != 0 && this.$modal.msgError('确认失败');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 编辑 */
|
||||
async handleEdit(row) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row.id);
|
||||
});
|
||||
// this.reset();
|
||||
// if (row.relatePlan == 1) {
|
||||
// // 计划型
|
||||
// // const res = await this.info({ id: row.id });
|
||||
// // this.form = res.data;
|
||||
// // this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
// this.openPlannedDrawer = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.planned.init(row);
|
||||
// });
|
||||
// } else {
|
||||
// this.openUnplannedDrawer = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.unplanned.init(row);
|
||||
// });
|
||||
// }
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm(
|
||||
'是否确认删除巡检单名称为"' + row.name + '"的数据项?'
|
||||
)
|
||||
.then(() => {
|
||||
return this.$axios({
|
||||
url: '/base/equipment-check-order/delete?id=' + row.id,
|
||||
method: 'delete',
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(console.error);
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.addOrUpdateVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.addOrUpdate.init(row.id, true);
|
||||
});
|
||||
// this.recordDetailVisible = true;
|
||||
// this.$nextTick(() => {
|
||||
// this.$refs.recordDetailDrawer.show({
|
||||
// id: row.id,
|
||||
// planMaintainWorker: row.planMaintainWorker,
|
||||
// maintainWorker: row.maintainWorker,
|
||||
// });
|
||||
// });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有巡检单?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportCheckOrderExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备巡检单.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2021-11-18 14:16:25
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-02-24 19:02:14
|
||||
* @LastEditTime: 2024-02-26 09:25:10
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@ -20,29 +20,29 @@
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检单名称</div>
|
||||
<div class="lightTip">{{ dataForm.planMaintainWorker }}</div>
|
||||
<div class="lightTip">{{ dataForm.name }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">部门</div>
|
||||
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
|
||||
<div class="lightTip">{{ dataForm.department }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">班次</div>
|
||||
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
|
||||
<div class="lightTip">{{ dataForm.groupClass }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检人</div>
|
||||
<div class="lightTip">{{ dataForm.responsible }}</div>
|
||||
<div class="lightTip">{{ dataForm.checkPerson }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">巡检时间</div>
|
||||
<div class="lightTip">{{ parseTime(dataForm.actualTime) }}</div>
|
||||
<div class="lightTip">{{ parseTime(dataForm.actualCheckTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">确认人</div>
|
||||
<div class="lightTip">{{ dataForm.maintainWorker }}</div>
|
||||
<div class="lightTip">{{ dataForm.confirmPerson }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -100,7 +100,7 @@
|
||||
|
||||
<script>
|
||||
import basicAdd from '../../../../core/mixins/basic-add';
|
||||
import { getEqCheckLog, deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
|
||||
import { getEqCheckOrder, deleteCheckOrderDet, getCheckOrderDetPage } from '@/api/equipment/base/inspection/record';
|
||||
// import { listData } from "@/api/system/dict/data";
|
||||
import SmallTitle from '../../maintain/PlanConfig/SmallTitle.vue';
|
||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||
@ -142,7 +142,7 @@ export default {
|
||||
addOrUpdateVisible: false,
|
||||
urlOptions: {
|
||||
isGetCode: false,
|
||||
infoURL: getEqCheckLog
|
||||
infoURL: getEqCheckOrder
|
||||
},
|
||||
listQuery: {
|
||||
pageSize: 99,
|
||||
|
@ -95,7 +95,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
addOrUpdateVisible: false,
|
||||
searchBarKeys: ['equipmentId', 'actualTime'],
|
||||
addContent: false,
|
||||
searchBarKeys: ['name', 'actualCheckTime'],
|
||||
tableBtn: [
|
||||
// this.$auth.hasPermi('equipment:check-record:detail')
|
||||
// ? {
|
||||
@ -133,7 +134,7 @@ export default {
|
||||
type: 'select',
|
||||
label: '巡检单名称',
|
||||
placeholder: '请选择巡检单',
|
||||
param: 'equipmentId',
|
||||
param: 'name',
|
||||
filterable: true
|
||||
},
|
||||
// 开始结束时间
|
||||
@ -147,7 +148,7 @@ export default {
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'actualTime',
|
||||
param: 'actualCheckTime',
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
@ -245,13 +246,13 @@ export default {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
special: false,
|
||||
maintenanceStatus: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
name: null,
|
||||
actualCheckTime: null,
|
||||
status: 2
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-check-log',
|
||||
basePath: '/base/equipment-check-order',
|
||||
mode: null,
|
||||
};
|
||||
},
|
||||
|
444
src/views/equipment/base/maintain/Confirm/Record--detail.vue
Normal file
444
src/views/equipment/base/maintain/Confirm/Record--detail.vue
Normal file
@ -0,0 +1,444 @@
|
||||
<!--
|
||||
filename: PlanConfig--addContent.vue
|
||||
author: liubin
|
||||
date: 2024-02-04 09:40:04
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible.sync="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="true"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%">
|
||||
<SmallTitle slot="title">
|
||||
{{
|
||||
mode.includes('detail')
|
||||
? '详情'
|
||||
: mode.includes('edit')
|
||||
? '编辑'
|
||||
: '新增'
|
||||
}}
|
||||
</SmallTitle>
|
||||
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<section>
|
||||
<!-- <SmallTitle>保养信息</SmallTitle> -->
|
||||
<div class="form-part" style="margin-bottom: 32px">
|
||||
<el-skeleton v-if="!showForm" animated />
|
||||
<el-form
|
||||
v-else
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-position="top"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">计划保养人员</div>
|
||||
<div class="lightTip">{{ form.planMaintainWorker }}</div>
|
||||
<!-- <el-form-item label="计划保养人员" prop="planMaintainWorker">
|
||||
<span>{{ form.planMaintainWorker }}</span>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">实际保养人员</div>
|
||||
<div class="lightTip">{{ form.maintainWorker }}</div>
|
||||
<!-- <el-form-item label="实际保养人员" prop="maintainWorker">
|
||||
<span>{{ form.maintainWorker }}</span>
|
||||
</el-form-item> -->
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-divider />
|
||||
|
||||
<section>
|
||||
<SmallTitle>保养详情</SmallTitle>
|
||||
<div style="margin-top: 12px; position: relative">
|
||||
<base-table
|
||||
v-loading="detailLoading"
|
||||
:table-props="detailTableProps"
|
||||
:page="detailTableQuery.pageNo || 1"
|
||||
:limit="detailTableQuery.pageSize || 10"
|
||||
:table-data="detailList"
|
||||
@emitFun="handleDetailTableAction">
|
||||
<!-- <method-btn
|
||||
slot="handleBtn"
|
||||
label="操作"
|
||||
width="100"
|
||||
:method-list="detailTableBtns"
|
||||
@clickBtn="handleDetailTableBtnClicked" /> -->
|
||||
</base-table>
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="detailTotal > 0"
|
||||
:total="detailTotal"
|
||||
:page.sync="detailTableQuery.pageNo"
|
||||
:limit.sync="detailTableQuery.pageSize"
|
||||
@pagination="refreshDetailList" />
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="drawer-body__footer"> -->
|
||||
<!-- <el-button style="" @click="cancel">返回</el-button> -->
|
||||
<!-- <el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button v-else type="primary" @click="confirm">保存</el-button> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<base-dialog
|
||||
dialogTitle="保养详情"
|
||||
:dialogVisible="detailAddVisible"
|
||||
width="35%"
|
||||
:append-to-body="true"
|
||||
custom-class="baseDialog"
|
||||
@close="closeDetailForm"
|
||||
@cancel="closeDetailForm"
|
||||
@confirm="submitDetailForm">
|
||||
<DialogForm
|
||||
v-if="detailAddVisible"
|
||||
ref="detailForm"
|
||||
v-model="detailForm"
|
||||
:rows="detailRows" />
|
||||
</base-dialog>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DialogForm from '@/components/DialogForm';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'PlanConfig--addContent',
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['maintainData'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
mode: 'detail',
|
||||
showForm: false,
|
||||
form: {
|
||||
id: null,
|
||||
maintainWorker: null,
|
||||
planMaintainWorker: null,
|
||||
},
|
||||
formLoading: false,
|
||||
equipmentOptions: [],
|
||||
detailList: [],
|
||||
detailAddVisible: false,
|
||||
detailPageProps: ['equipmentName', 'program'],
|
||||
detailForm: {
|
||||
planId: null,
|
||||
equipmentId: null,
|
||||
program: '',
|
||||
maintenanceDes: '',
|
||||
remark: '',
|
||||
},
|
||||
detailRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备',
|
||||
prop: 'equipmentId',
|
||||
options: [],
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
prop: 'program',
|
||||
rules: [
|
||||
{ required: true, message: '保养项目不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养描述',
|
||||
prop: 'maintenanceDes',
|
||||
rules: [
|
||||
{ required: true, message: '包养描述不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
],
|
||||
detailLoading: false,
|
||||
detailTableProps: [
|
||||
{ prop: 'equipmentName', label: '设备名称' },
|
||||
{ prop: 'program', label: '保养项目' },
|
||||
{ prop: 'maintenanceDes', label: '保养描述' },
|
||||
// { prop: 'remark', label: '备注' },
|
||||
],
|
||||
detailTableQuery: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
},
|
||||
detailTableBtns: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
],
|
||||
detailTotal: 0,
|
||||
detailList: [],
|
||||
equipmentList: [],
|
||||
};
|
||||
},
|
||||
computed: {},
|
||||
mounted() {
|
||||
this.loadEquipments();
|
||||
},
|
||||
methods: {
|
||||
handleColse() {},
|
||||
show({ planMaintainWorker, id, maintainWorker }) {
|
||||
this.form = Object.assign(
|
||||
{},
|
||||
{
|
||||
planMaintainWorker,
|
||||
id,
|
||||
maintainWorker,
|
||||
}
|
||||
);
|
||||
this.$nextTick(() => {
|
||||
this.refreshDetailList();
|
||||
});
|
||||
this.visible = true;
|
||||
this.showForm = true;
|
||||
},
|
||||
cancel() {
|
||||
this.visible = false;
|
||||
setTimeout(() => {
|
||||
this.$emit('closed');
|
||||
}, 500);
|
||||
},
|
||||
confirm() {
|
||||
this.cancel();
|
||||
},
|
||||
toggleEdit() {
|
||||
this.mode == 'edit' ? 'detail' : 'edit';
|
||||
},
|
||||
async loadEquipments() {
|
||||
// TODO: 很有可能此处要改成动态刷新/获取/加载设备列表,当总的特殊设备数量大于100的时候...
|
||||
const res = await this.$axios('/base/core-equipment/page', {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false,
|
||||
},
|
||||
});
|
||||
this.equipmentList = res.data?.list || [];
|
||||
this.detailRows[0][0].options = (res.data?.list || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
closeDetailForm() {
|
||||
this.detailAddVisible = false;
|
||||
},
|
||||
async submitDetailForm() {
|
||||
// validation
|
||||
this.$refs.detailForm.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
const res = await this.$axios[this.detailForm.id ? 'put' : 'post'](
|
||||
`/base/equipment-maintain-log-det/create/${
|
||||
this.detailForm.id ? 'update' : 'create'
|
||||
}`,
|
||||
{
|
||||
...this.detailForm,
|
||||
logId: this.form.id,
|
||||
}
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.detailAddVisible = false;
|
||||
this.$message.success('添加成功');
|
||||
this.refreshDetailList();
|
||||
} else {
|
||||
this.detailAddVisible = false;
|
||||
this.$message.error('出错');
|
||||
}
|
||||
});
|
||||
},
|
||||
async refreshDetailList() {
|
||||
this.detailLoading = true;
|
||||
if (!this.form.id) {
|
||||
this.$message.info('没有找到保养计划相关信息...');
|
||||
this.detailLoading = false;
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await this.$axios(
|
||||
'/base/equipment-maintain-log-det/page',
|
||||
{
|
||||
params: {
|
||||
pageNo: this.detailTableQuery.pageNo,
|
||||
pageSize: this.detailTableQuery.pageSize,
|
||||
// planId: this.form.id,
|
||||
logId: this.form.id,
|
||||
},
|
||||
}
|
||||
);
|
||||
this.detailList = res.data?.list || [];
|
||||
this.detailTotal = res.data?.total || 0;
|
||||
this.detailLoading = false;
|
||||
} catch (err) {
|
||||
this.detailLoading = false;
|
||||
}
|
||||
},
|
||||
//
|
||||
handleDetailTableAction() {},
|
||||
handleDetailTableBtnClicked({ data, type }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
const { id, equipmentId, planId, program, maintenanceDes, remark } =
|
||||
data;
|
||||
this.detailAddVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.detailForm = Object.assign(
|
||||
{},
|
||||
{
|
||||
id,
|
||||
equipmentId,
|
||||
planId,
|
||||
program,
|
||||
maintenanceDes,
|
||||
remark,
|
||||
}
|
||||
);
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
if (!data.id) return;
|
||||
this.$confirm('确认移除该详情吗?', '提示', {
|
||||
confirmButtonText: '确 认',
|
||||
cancelButtonText: '取 消',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios.delete(
|
||||
'/base/equipment-maintain-plan-det/delete',
|
||||
{
|
||||
params: {
|
||||
id: data.id,
|
||||
},
|
||||
}
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!');
|
||||
this.refreshDetailList();
|
||||
}
|
||||
})
|
||||
.catch(console.error);
|
||||
break;
|
||||
case 'detail':
|
||||
this.handleDetail(data);
|
||||
break;
|
||||
default:
|
||||
this.handleTableActions({ data, type });
|
||||
}
|
||||
},
|
||||
handleAddDetail() {
|
||||
this.detailAddVisible = true;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: calc(100% - 72px);
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.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>
|
@ -0,0 +1,373 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<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="[
|
||||
{ required: true, message: '请输入保养计划单号', trigger: 'blur' },
|
||||
]">
|
||||
<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="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="[
|
||||
{ required: true, message: '请选择设备大类', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.equipmentCategory"
|
||||
:placeholder="`请选择设备大类`"
|
||||
:disabled="disabled"
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in equipmentTypeOptions"
|
||||
: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="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="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-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-col :span="12">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择实际保养人员', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.maintainWorker"
|
||||
: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
|
||||
v-model="form.remark"
|
||||
@change="$emit('update', form)"
|
||||
:placeholder="`请输入备注`"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: {},
|
||||
props: {
|
||||
rows: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
edit: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
hasFiles: {
|
||||
type: Boolean | Array,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: 'right',
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
formLoading: true,
|
||||
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
|
||||
.filter((item) => item.special)
|
||||
.filter(
|
||||
(item) => item.specialType === this.form.equipmentCategory
|
||||
)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
}, 1000);
|
||||
}
|
||||
if (this.hasFiles) {
|
||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
} else if (Array.isArray(this.hasFiles)) {
|
||||
this.hasFiles.forEach((prop) => {
|
||||
this.form[prop] = this.form[prop] ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
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,
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
// getCode
|
||||
async getCode(url) {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios(url);
|
||||
this.formLoading = false;
|
||||
this.form.code = response.data || '';
|
||||
},
|
||||
// initialize
|
||||
async getEquipmentList() {
|
||||
this.formLoading = true;
|
||||
const response = await this.$axios('/base/core-equipment/listAll');
|
||||
this.equipmentList = response.data || [];
|
||||
this.equipmentOptions = (response.data || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
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) {
|
||||
this.form.equipmentId = null;
|
||||
if (type) {
|
||||
this.equipmentOptions = this.equipmentList
|
||||
.filter((item) => item.special)
|
||||
.filter((item) => item.specialType === type)
|
||||
.map((item) => ({ label: item.name, value: item.id }));
|
||||
} else
|
||||
this.equipmentOptions = this.equipmentList.map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// this.$emit('update', this.form)
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,758 @@
|
||||
<!--
|
||||
filename: WaitingListUnplanned--edit.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@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="[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入保养计划单号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]" -->
|
||||
<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="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-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-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="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="[
|
||||
{
|
||||
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-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-col :span="8">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际保养人员',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<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-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>
|
||||
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<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>
|
||||
import DialogForm from '../../../../../components/DialogForm/index.vue';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
btnLoading: false,
|
||||
form: {},
|
||||
formLoading: false,
|
||||
lineList: [],
|
||||
maintainerList: [],
|
||||
departmentList: [],
|
||||
attrTableProps: [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '保养项目',
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceDes',
|
||||
label: '保养描述',
|
||||
},
|
||||
],
|
||||
attrList: [],
|
||||
attrTotal: 0,
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
logId: null,
|
||||
program: null,
|
||||
maintenanceDes: null,
|
||||
remark: null,
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
// pageNo: 1,
|
||||
// pageSize: 100,
|
||||
// special: true,
|
||||
// },
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
prop: 'program',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养描述',
|
||||
prop: 'maintenanceDes',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
},
|
||||
}, // 属性列表的请求
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
// syncFileListFlag: null,
|
||||
tableBtn: [
|
||||
{
|
||||
type: 'edit',
|
||||
btnName: '编辑',
|
||||
},
|
||||
{
|
||||
type: 'delete',
|
||||
btnName: '删除',
|
||||
},
|
||||
],
|
||||
row: null,
|
||||
};
|
||||
},
|
||||
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,
|
||||
}));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList('maintainer');
|
||||
this.getList('department');
|
||||
this.getList('line');
|
||||
},
|
||||
methods: {
|
||||
handleSearchBarBtnClick(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.attrQuery.params.equipmentName = btn.equipmentName;
|
||||
this.getAttrList();
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
this.btnLoading = true;
|
||||
this.$nextTick(async () => {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/base/equipment-maintain-log/update',
|
||||
method: 'put',
|
||||
data: {
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
planMaintainWorker: this.form.planMaintainWorker?.join(','),
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
}
|
||||
this.btnLoading = false;
|
||||
this.$emit('refreshDataList');
|
||||
this.handleCancel();
|
||||
});
|
||||
},
|
||||
|
||||
handleEmitFun(val) {
|
||||
console.log('handleEmitFun', val);
|
||||
},
|
||||
|
||||
init(row) {
|
||||
this.visible = true;
|
||||
this.row = row;
|
||||
this.getInfo(row);
|
||||
this.getAttrList(row);
|
||||
},
|
||||
|
||||
async getInfo(row) {
|
||||
this.formLoading = true;
|
||||
const res = await this.$axios(
|
||||
'/base/equipment-maintain-log/get?id=' + row.id
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.form = res.data;
|
||||
this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
this.form.planMaintainWorker = res.data.planMaintainWorker?.split(',');
|
||||
this.formLoading = false;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
async getAttrList(row, condition = {}) {
|
||||
if (!row) row = this.row;
|
||||
this.attrListLoading = true;
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...this.attrQuery.params,
|
||||
logId: row.id,
|
||||
...condition,
|
||||
},
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrList = res.data.list;
|
||||
this.attrTotal = res.data.total;
|
||||
}
|
||||
this.attrListLoading = 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;
|
||||
},
|
||||
|
||||
// 保存表单
|
||||
handleSave() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
await this.$axios({
|
||||
url: '/urlupdate', // this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: 'post', // isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
resetAttrform() {
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
logId: this.row.id,
|
||||
maintenanceDes: '',
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
},
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||
this.resetAttrform();
|
||||
this.attrTitle = '添加属性';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
// 编辑属性
|
||||
async handleEditAttr(attrId) {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/get',
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该保养内容?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/delete?id=' + attrId,
|
||||
method: 'delete',
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit
|
||||
? '/base/equipment-maintain-log-det/update'
|
||||
: '/base/equipment-maintain-log-det/create',
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
});
|
||||
this.attrFormSubmitting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
this.attrFormVisible = false;
|
||||
},
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-date-editor,
|
||||
.drawer >>> .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
307
src/views/equipment/base/maintain/Confirm/WaitingListTable.vue
Normal file
307
src/views/equipment/base/maintain/Confirm/WaitingListTable.vue
Normal file
@ -0,0 +1,307 @@
|
||||
<!--
|
||||
filename: WaitingListTable.vue
|
||||
author: liubin
|
||||
date: 2024-02-05 16:12:55
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableDataWithIndex"
|
||||
:border="true"
|
||||
@selection-change="handleSelectionChange"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{
|
||||
background: '#f2f4f9',
|
||||
color: '#606266',
|
||||
}"
|
||||
class="waiting-list-table">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
:width="50"
|
||||
:selectable="checkSelectable" />
|
||||
<el-table-column prop="_pageIndex" width="80" align="center">
|
||||
<template slot="header">
|
||||
<el-popover placement="bottom-start" width="300" trigger="click">
|
||||
<div class="setting-box" style="max-height: 400px; overflow-y: auto">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in tablePropsLabelList"
|
||||
:key="'cb' + index"
|
||||
v-model="selectedBox[index]"
|
||||
:label="item.label" />
|
||||
</div>
|
||||
<i slot="reference" class="el-icon-s-tools" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[0]"
|
||||
width="128"
|
||||
label="设备保养单号"
|
||||
prop="maintainOrderNumber"></el-table-column>
|
||||
<el-table-column v-if="selectedBox[1]" width="128" label="保养计划名称" prop="planName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planName || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="selectedBox[2]" label="部门" prop="departmentName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.departmentName || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="selectedBox[3]" label="产线名" prop="lineName">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.lineName || '---' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[4]"
|
||||
width="150"
|
||||
label="计划开始时间"
|
||||
prop="planStartTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planStartTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[5]"
|
||||
width="150"
|
||||
label="计划结束时间"
|
||||
prop="planEndTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.planEndTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[6]"
|
||||
width="150"
|
||||
label="实际开始时间"
|
||||
prop="startTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.startTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[7]"
|
||||
width="150"
|
||||
label="实际结束时间"
|
||||
prop="endTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.endTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[8]"
|
||||
width="150"
|
||||
label="确认截止时间"
|
||||
prop="confirmDueTime">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.confirmDueTime | timeFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
v-if="selectedBox[9]"
|
||||
width="150"
|
||||
label="保养计划类型"
|
||||
prop="relatePlan">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.relatePlan | relatePlanFilter }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column v-if="selectedBox[10]" width="60" label="详情">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="handelDetail(scope.row)">详情</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<!-- btns -->
|
||||
<el-table-column width="188" label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-tooltip content="确认" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
:disabled="!checkSelectable(scope.row)"
|
||||
@click="$emit('confirm', scope.row)">
|
||||
确认
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="查看详情" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('detail', scope.row)">
|
||||
<i class="iconfont icon-detail primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="编辑" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('edit', scope.row)">
|
||||
<i class="iconfont icon-edit primary-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
<!-- line -->
|
||||
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
type="text"
|
||||
style="margin: 5px 0; padding: 0"
|
||||
@click="$emit('delete', scope.row)">
|
||||
<i class="iconfont icon-delete delete-color" />
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
|
||||
export default {
|
||||
name: 'WaitingListTable',
|
||||
components: {},
|
||||
props: ['tableData', 'page', 'limit'],
|
||||
filters: {
|
||||
timeFilter: (val) =>
|
||||
val ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '---',
|
||||
relatePlanFilter: (val) =>
|
||||
val != null ? ['-', '计划型', '非计划型'][val] : '-',
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tablePropsLabelList: [
|
||||
{
|
||||
label: '设备保养单号',
|
||||
},
|
||||
{
|
||||
label: '保养计划名称',
|
||||
},
|
||||
{
|
||||
label: '部门',
|
||||
},
|
||||
{
|
||||
label: '产线名',
|
||||
},
|
||||
{
|
||||
label: '计划开始时间',
|
||||
},
|
||||
{
|
||||
label: '计划结束时间',
|
||||
},
|
||||
{
|
||||
label: '实际开始时间',
|
||||
},
|
||||
{
|
||||
label: '实际结束时间',
|
||||
},
|
||||
{
|
||||
label: '确认截止时间',
|
||||
},
|
||||
{
|
||||
label: '保养计划类型',
|
||||
},
|
||||
{
|
||||
label: '详情',
|
||||
},
|
||||
],
|
||||
selectedBox: [
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
],
|
||||
selectedPlan: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tableDataWithIndex() {
|
||||
return this.tableData.map((item, index) => ({
|
||||
...item,
|
||||
_pageIndex: (this.page - 1) * this.limit + index + 1,
|
||||
}));
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row, index) {
|
||||
return (
|
||||
row.relatePlan == 2 ||
|
||||
(row.relatePlan == 1 &&
|
||||
(!row.confirmDueTime || +row.confirmDueTime >= new Date().getTime()))
|
||||
);
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.selectedPlan = val;
|
||||
},
|
||||
handleDelete(row) {},
|
||||
handleDetail(row) {},
|
||||
handleEdit(row) {},
|
||||
handleConfirm(row) {},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@import './iconfont/iconfont.css';
|
||||
.delete-color {
|
||||
color: #ff5454;
|
||||
}
|
||||
.primary-color {
|
||||
color: #0b58ff;
|
||||
}
|
||||
|
||||
.baseTable .show-col-btn {
|
||||
margin-right: 5px;
|
||||
line-height: inherit;
|
||||
cursor: pointer;
|
||||
}
|
||||
.baseTable .el-icon-refresh {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.waiting-list-table .el-table__body tr.current-row > td.el-table__cell {
|
||||
background-color: #eaf1fc;
|
||||
}
|
||||
.waiting-list-table.el-table .el-table__cell {
|
||||
padding: 0;
|
||||
height: 35px;
|
||||
}
|
||||
.waiting-list-table .addButton {
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
border-top: none;
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
border-radius: 0;
|
||||
}
|
||||
.waiting-list-table .addButton:hover {
|
||||
color: #0b58ff;
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
.waiting-list-table .addButton:focus {
|
||||
border-color: #ebeef5;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.el-tooltip__popper.is-dark {
|
||||
background: rgba(0, 0, 0, 0.6) !important;
|
||||
}
|
||||
.el-tooltip__popper .popper__arrow,
|
||||
.el-tooltip__popper .popper__arrow::after {
|
||||
border-top-color: rgba(0, 0, 0, 0.4) !important;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,734 @@
|
||||
<!--
|
||||
filename: WaitingListUnplanned--edit.vue
|
||||
author: liubin
|
||||
date: 2023-08-22 14:38:56
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-drawer
|
||||
:visible="visible"
|
||||
:show-close="false"
|
||||
:wrapper-closable="false"
|
||||
class="drawer"
|
||||
custom-class="mes-drawer"
|
||||
size="60%"
|
||||
@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="[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入保养计划单号',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.maintainOrderNumber"
|
||||
:placeholder="`请输入保养计划单号`" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="保养计划名称" prop="name">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="部门"
|
||||
prop="departmentId"
|
||||
:rules="[
|
||||
{ required: true, message: '请选择部门', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.departmentId"
|
||||
:placeholder="`请选择部门`"
|
||||
clearable
|
||||
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="[
|
||||
{ required: true, message: '请选择产线', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.lineId"
|
||||
:placeholder="`请选择产线`"
|
||||
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-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
||||
<el-input value="---" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<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-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-col :span="8">
|
||||
<el-form-item
|
||||
label="实际保养人员"
|
||||
prop="maintainWorker"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择实际保养人员',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<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-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>
|
||||
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<!-- 属性对话框 -->
|
||||
<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>
|
||||
import DialogForm from '../../../../../components/DialogForm/index.vue';
|
||||
|
||||
const SmallTitle = {
|
||||
name: 'SmallTitle',
|
||||
props: ['size'],
|
||||
components: {},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {},
|
||||
render: function (h) {
|
||||
return h(
|
||||
'span',
|
||||
{
|
||||
class: 'small-title',
|
||||
style: {
|
||||
fontSize: '18px',
|
||||
lineHeight:
|
||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
||||
fontWeight: 500,
|
||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
||||
},
|
||||
},
|
||||
this.$slots.default
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
components: { SmallTitle, DialogForm },
|
||||
props: ['dataId'], // dataId 作为一个通用的存放id的字段
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
btnLoading: false,
|
||||
form: {},
|
||||
formLoading: false,
|
||||
lineList: [],
|
||||
maintainerList: [],
|
||||
departmentList: [],
|
||||
attrTableProps: [
|
||||
{
|
||||
prop: 'equipmentName',
|
||||
label: '设备名称',
|
||||
},
|
||||
{
|
||||
prop: 'program',
|
||||
label: '保养项目',
|
||||
},
|
||||
{
|
||||
prop: 'maintenanceDes',
|
||||
label: '保养描述',
|
||||
},
|
||||
],
|
||||
attrList: [],
|
||||
attrTotal: 0,
|
||||
attrTitle: '',
|
||||
attrForm: {
|
||||
id: null,
|
||||
logId: null,
|
||||
program: null,
|
||||
maintenanceDes: null,
|
||||
remark: null,
|
||||
},
|
||||
attrFormVisible: false,
|
||||
attrRows: [
|
||||
[
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
url: '/base/core-equipment/page?pageNo=1&pageSize=100&special=false',
|
||||
// method: 'post',
|
||||
// queryParams: {
|
||||
// pageNo: 1,
|
||||
// pageSize: 100,
|
||||
// special: true,
|
||||
// },
|
||||
rules: [
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养项目',
|
||||
prop: 'program',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '保养描述',
|
||||
prop: 'maintenanceDes',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '备注',
|
||||
prop: 'remark',
|
||||
},
|
||||
],
|
||||
],
|
||||
attrQuery: {
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
equipmentName: null,
|
||||
},
|
||||
}, // 属性列表的请求
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '设备',
|
||||
placeholder: '请输入设备名称',
|
||||
param: 'equipmentName',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
],
|
||||
attrFormSubmitting: false,
|
||||
attrListLoading: false,
|
||||
// syncFileListFlag: null,
|
||||
tableBtn: [],
|
||||
row: null,
|
||||
};
|
||||
},
|
||||
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,
|
||||
}));
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList('maintainer');
|
||||
this.getList('department');
|
||||
this.getList('line');
|
||||
},
|
||||
methods: {
|
||||
handleSearchBarBtnClick(btn) {
|
||||
console.log('btn', btn);
|
||||
switch (btn.btnName) {
|
||||
case 'search':
|
||||
this.attrQuery.params.equipmentName = btn.equipmentName;
|
||||
this.getAttrList();
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleTableBtnClick({ type, data }) {
|
||||
switch (type) {
|
||||
case 'edit':
|
||||
this.handleEditAttr(data.id);
|
||||
break;
|
||||
case 'delete':
|
||||
this.handleDeleteAttr(data.id);
|
||||
break;
|
||||
}
|
||||
},
|
||||
async handleConfirm() {
|
||||
this.btnLoading = true;
|
||||
this.$nextTick(async () => {
|
||||
const { code, data } = await this.$axios({
|
||||
url: '/base/equipment-maintain-log/update',
|
||||
method: 'put',
|
||||
data: {
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(',')
|
||||
},
|
||||
});
|
||||
if (code == 0) {
|
||||
this.$modal.msgSuccess('更新成功');
|
||||
}
|
||||
this.btnLoading = false;
|
||||
this.$emit('refreshDataList');
|
||||
this.handleCancel();
|
||||
});
|
||||
},
|
||||
|
||||
handleEmitFun(val) {
|
||||
console.log('handleEmitFun', val);
|
||||
},
|
||||
|
||||
init(row) {
|
||||
this.visible = true;
|
||||
this.row = row;
|
||||
this.getInfo(row);
|
||||
this.getAttrList(row);
|
||||
},
|
||||
|
||||
async getInfo(row) {
|
||||
this.formLoading = true;
|
||||
const res = await this.$axios(
|
||||
'/base/equipment-maintain-log/get?id=' + row.id
|
||||
);
|
||||
if (res.code == 0) {
|
||||
this.form = res.data;
|
||||
this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
this.formLoading = false;
|
||||
}
|
||||
this.formLoading = false;
|
||||
},
|
||||
|
||||
async getAttrList(row, condition = {}) {
|
||||
if (!row) row = this.row;
|
||||
this.attrListLoading = true;
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/page',
|
||||
method: 'get',
|
||||
params: {
|
||||
...this.attrQuery.params,
|
||||
logId: row.id,
|
||||
...condition,
|
||||
},
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrList = res.data.list;
|
||||
this.attrTotal = res.data.total;
|
||||
}
|
||||
this.attrListLoading = 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;
|
||||
},
|
||||
|
||||
// 保存表单
|
||||
handleSave() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
await this.$axios({
|
||||
url: '/urlupdate', // this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
||||
method: 'post', // isEdit ? 'put' : 'post',
|
||||
data: this.form,
|
||||
});
|
||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
||||
this.visible = false;
|
||||
this.$emit('refreshDataList');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleCancel() {
|
||||
this.visible = false;
|
||||
},
|
||||
|
||||
resetAttrform() {
|
||||
this.attrForm = {
|
||||
id: null,
|
||||
logId: this.row.id,
|
||||
maintenanceDes: '',
|
||||
program: null,
|
||||
remark: null,
|
||||
};
|
||||
},
|
||||
|
||||
// 新增属性
|
||||
handleAddAttr() {
|
||||
if (!this.row.id) return this.$message.error('请先选中保养记录');
|
||||
this.resetAttrform();
|
||||
this.attrTitle = '添加设备属性';
|
||||
this.attrFormVisible = true;
|
||||
},
|
||||
|
||||
// 编辑属性
|
||||
async handleEditAttr(attrId) {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log-det/get',
|
||||
method: 'get',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.attrForm = res.data;
|
||||
this.attrTitle = '编辑设备属性';
|
||||
this.attrFormVisible = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 删除属性
|
||||
handleDeleteAttr(attrId) {
|
||||
this.$confirm('确定删除该属性?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
})
|
||||
.then(async () => {
|
||||
const res = await this.$axios({
|
||||
url: 'url delete', // this.sections[1].urlDelete,
|
||||
method: 'delete',
|
||||
params: { id: attrId },
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
|
||||
// 提交属性表
|
||||
submitAttrForm() {
|
||||
this.$refs['attrForm'].validate(async (valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const isEdit = this.attrForm.id != null;
|
||||
this.attrFormSubmitting = true;
|
||||
const res = await this.$axios({
|
||||
url: isEdit
|
||||
? '/base/equipment-maintain-log-det/update'
|
||||
: '/base/equipment-maintain-log-det/create',
|
||||
method: isEdit ? 'put' : 'post',
|
||||
data: this.attrForm,
|
||||
});
|
||||
|
||||
if (res.code == 0) {
|
||||
this.closeAttrForm();
|
||||
this.$message({
|
||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getAttrList();
|
||||
},
|
||||
});
|
||||
}
|
||||
this.attrFormSubmitting = false;
|
||||
} catch (err) {
|
||||
this.$message({
|
||||
message: err,
|
||||
type: 'error',
|
||||
duration: 1500,
|
||||
});
|
||||
this.attrFormSubmitting = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAttrForm() {
|
||||
this.attrFormVisible = false;
|
||||
},
|
||||
|
||||
handleClick(raw) {
|
||||
if (raw.type === 'delete') {
|
||||
this.$confirm(
|
||||
`确定对${
|
||||
raw.data.name
|
||||
? '[名称=' + raw.data.name + ']'
|
||||
: '[序号=' + raw.data._pageIndex + ']'
|
||||
}进行删除操作?`,
|
||||
'提示',
|
||||
{
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
}
|
||||
)
|
||||
.then(() => {
|
||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
||||
this.$message({
|
||||
message: '操作成功',
|
||||
type: 'success',
|
||||
duration: 1500,
|
||||
onClose: () => {
|
||||
this.getList();
|
||||
},
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
} else {
|
||||
this.addNew(raw.data.id);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drawer >>> .el-drawer {
|
||||
border-radius: 8px 0 0 8px;
|
||||
}
|
||||
|
||||
.drawer >>> .el-date-editor,
|
||||
.drawer >>> .el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.drawer >>> .el-drawer__header {
|
||||
margin: 0;
|
||||
padding: 32px 32px 24px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
.small-title::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
width: 4px;
|
||||
height: 22px;
|
||||
border-radius: 1px;
|
||||
margin-right: 8px;
|
||||
background-color: #0b58ff;
|
||||
}
|
||||
|
||||
.drawer-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.drawer-body__content {
|
||||
flex: 1;
|
||||
/* background: #eee; */
|
||||
padding: 20px 30px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.drawer-body__footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
</style>
|
539
src/views/equipment/base/maintain/Confirm/iconfont/demo.css
Normal file
539
src/views/equipment/base/maintain/Confirm/iconfont/demo.css
Normal file
@ -0,0 +1,539 @@
|
||||
/* Logo 字体 */
|
||||
@font-face {
|
||||
font-family: "iconfont logo";
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
|
||||
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
|
||||
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-family: "iconfont logo";
|
||||
font-size: 160px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
/* tabs */
|
||||
.nav-tabs {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.nav-tabs .nav-more {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
#tabs {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
#tabs li {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
border-bottom: 2px solid transparent;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: -1px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
|
||||
#tabs .active {
|
||||
border-bottom-color: #f00;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.tab-container .content {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 页面布局 */
|
||||
.main {
|
||||
padding: 30px 100px;
|
||||
width: 960px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.main .logo {
|
||||
color: #333;
|
||||
text-align: left;
|
||||
margin-bottom: 30px;
|
||||
line-height: 1;
|
||||
height: 110px;
|
||||
margin-top: -50px;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.main .logo a {
|
||||
font-size: 160px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.helps {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.helps pre {
|
||||
padding: 20px;
|
||||
margin: 10px 0;
|
||||
border: solid 1px #e7e1cd;
|
||||
background-color: #fffdef;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.icon_lists {
|
||||
width: 100% !important;
|
||||
overflow: hidden;
|
||||
*zoom: 1;
|
||||
}
|
||||
|
||||
.icon_lists li {
|
||||
width: 100px;
|
||||
margin-bottom: 10px;
|
||||
margin-right: 20px;
|
||||
text-align: center;
|
||||
list-style: none !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.icon_lists li .code-name {
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.icon_lists .icon {
|
||||
display: block;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
font-size: 42px;
|
||||
margin: 10px auto;
|
||||
color: #333;
|
||||
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
-moz-transition: font-size 0.25s linear, width 0.25s linear;
|
||||
transition: font-size 0.25s linear, width 0.25s linear;
|
||||
}
|
||||
|
||||
.icon_lists .icon:hover {
|
||||
font-size: 100px;
|
||||
}
|
||||
|
||||
.icon_lists .svg-icon {
|
||||
/* 通过设置 font-size 来改变图标大小 */
|
||||
width: 1em;
|
||||
/* 图标和文字相邻时,垂直对齐 */
|
||||
vertical-align: -0.15em;
|
||||
/* 通过设置 color 来改变 SVG 的颜色/fill */
|
||||
fill: currentColor;
|
||||
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
|
||||
normalize.css 中也包含这行 */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.icon_lists li .name,
|
||||
.icon_lists li .code-name {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* markdown 样式 */
|
||||
.markdown {
|
||||
color: #666;
|
||||
font-size: 14px;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
color: #404040;
|
||||
font-weight: 500;
|
||||
line-height: 40px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown h2,
|
||||
.markdown h3,
|
||||
.markdown h4,
|
||||
.markdown h5,
|
||||
.markdown h6 {
|
||||
color: #404040;
|
||||
margin: 1.6em 0 0.6em 0;
|
||||
font-weight: 500;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.markdown h2 {
|
||||
font-size: 22px;
|
||||
}
|
||||
|
||||
.markdown h3 {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.markdown h4 {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.markdown h5 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown h6 {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.markdown hr {
|
||||
height: 1px;
|
||||
border: 0;
|
||||
background: #e9e9e9;
|
||||
margin: 16px 0;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.markdown p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown>p,
|
||||
.markdown>blockquote,
|
||||
.markdown>.highlight,
|
||||
.markdown>ol,
|
||||
.markdown>ul {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.markdown ul>li {
|
||||
list-style: circle;
|
||||
}
|
||||
|
||||
.markdown>ul li,
|
||||
.markdown blockquote ul>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown>ul li p,
|
||||
.markdown>ol li p {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
|
||||
.markdown ol>li {
|
||||
list-style: decimal;
|
||||
}
|
||||
|
||||
.markdown>ol li,
|
||||
.markdown blockquote ol>li {
|
||||
margin-left: 20px;
|
||||
padding-left: 4px;
|
||||
}
|
||||
|
||||
.markdown code {
|
||||
margin: 0 3px;
|
||||
padding: 0 5px;
|
||||
background: #eee;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.markdown strong,
|
||||
.markdown b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
border: 1px solid #e9e9e9;
|
||||
width: 95%;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
white-space: nowrap;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.markdown>table th,
|
||||
.markdown>table td {
|
||||
border: 1px solid #e9e9e9;
|
||||
padding: 8px 16px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.markdown>table th {
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
.markdown blockquote {
|
||||
font-size: 90%;
|
||||
color: #999;
|
||||
border-left: 4px solid #e9e9e9;
|
||||
padding-left: 0.8em;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
.markdown blockquote p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.markdown .anchor {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.markdown .waiting {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.markdown h1:hover .anchor,
|
||||
.markdown h2:hover .anchor,
|
||||
.markdown h3:hover .anchor,
|
||||
.markdown h4:hover .anchor,
|
||||
.markdown h5:hover .anchor,
|
||||
.markdown h6:hover .anchor {
|
||||
opacity: 1;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.markdown>br,
|
||||
.markdown>p>br {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
|
||||
.hljs {
|
||||
display: block;
|
||||
background: white;
|
||||
padding: 0.5em;
|
||||
color: #333333;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.hljs-comment,
|
||||
.hljs-meta {
|
||||
color: #969896;
|
||||
}
|
||||
|
||||
.hljs-string,
|
||||
.hljs-variable,
|
||||
.hljs-template-variable,
|
||||
.hljs-strong,
|
||||
.hljs-emphasis,
|
||||
.hljs-quote {
|
||||
color: #df5000;
|
||||
}
|
||||
|
||||
.hljs-keyword,
|
||||
.hljs-selector-tag,
|
||||
.hljs-type {
|
||||
color: #a71d5d;
|
||||
}
|
||||
|
||||
.hljs-literal,
|
||||
.hljs-symbol,
|
||||
.hljs-bullet,
|
||||
.hljs-attribute {
|
||||
color: #0086b3;
|
||||
}
|
||||
|
||||
.hljs-section,
|
||||
.hljs-name {
|
||||
color: #63a35c;
|
||||
}
|
||||
|
||||
.hljs-tag {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.hljs-title,
|
||||
.hljs-attr,
|
||||
.hljs-selector-id,
|
||||
.hljs-selector-class,
|
||||
.hljs-selector-attr,
|
||||
.hljs-selector-pseudo {
|
||||
color: #795da3;
|
||||
}
|
||||
|
||||
.hljs-addition {
|
||||
color: #55a532;
|
||||
background-color: #eaffea;
|
||||
}
|
||||
|
||||
.hljs-deletion {
|
||||
color: #bd2c00;
|
||||
background-color: #ffecec;
|
||||
}
|
||||
|
||||
.hljs-link {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* 代码高亮 */
|
||||
/* PrismJS 1.15.0
|
||||
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
|
||||
/**
|
||||
* prism.js default theme for JavaScript, CSS and HTML
|
||||
* Based on dabblet (http://dabblet.com)
|
||||
* @author Lea Verou
|
||||
*/
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
color: black;
|
||||
background: none;
|
||||
text-shadow: 0 1px white;
|
||||
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
||||
text-align: left;
|
||||
white-space: pre;
|
||||
word-spacing: normal;
|
||||
word-break: normal;
|
||||
word-wrap: normal;
|
||||
line-height: 1.5;
|
||||
|
||||
-moz-tab-size: 4;
|
||||
-o-tab-size: 4;
|
||||
tab-size: 4;
|
||||
|
||||
-webkit-hyphens: none;
|
||||
-moz-hyphens: none;
|
||||
-ms-hyphens: none;
|
||||
hyphens: none;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::-moz-selection,
|
||||
pre[class*="language-"] ::-moz-selection,
|
||||
code[class*="language-"]::-moz-selection,
|
||||
code[class*="language-"] ::-moz-selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
pre[class*="language-"]::selection,
|
||||
pre[class*="language-"] ::selection,
|
||||
code[class*="language-"]::selection,
|
||||
code[class*="language-"] ::selection {
|
||||
text-shadow: none;
|
||||
background: #b3d4fc;
|
||||
}
|
||||
|
||||
@media print {
|
||||
|
||||
code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
text-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Code blocks */
|
||||
pre[class*="language-"] {
|
||||
padding: 1em;
|
||||
margin: .5em 0;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
:not(pre)>code[class*="language-"],
|
||||
pre[class*="language-"] {
|
||||
background: #f5f2f0;
|
||||
}
|
||||
|
||||
/* Inline code */
|
||||
:not(pre)>code[class*="language-"] {
|
||||
padding: .1em;
|
||||
border-radius: .3em;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.token.comment,
|
||||
.token.prolog,
|
||||
.token.doctype,
|
||||
.token.cdata {
|
||||
color: slategray;
|
||||
}
|
||||
|
||||
.token.punctuation {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.namespace {
|
||||
opacity: .7;
|
||||
}
|
||||
|
||||
.token.property,
|
||||
.token.tag,
|
||||
.token.boolean,
|
||||
.token.number,
|
||||
.token.constant,
|
||||
.token.symbol,
|
||||
.token.deleted {
|
||||
color: #905;
|
||||
}
|
||||
|
||||
.token.selector,
|
||||
.token.attr-name,
|
||||
.token.string,
|
||||
.token.char,
|
||||
.token.builtin,
|
||||
.token.inserted {
|
||||
color: #690;
|
||||
}
|
||||
|
||||
.token.operator,
|
||||
.token.entity,
|
||||
.token.url,
|
||||
.language-css .token.string,
|
||||
.style .token.string {
|
||||
color: #9a6e3a;
|
||||
background: hsla(0, 0%, 100%, .5);
|
||||
}
|
||||
|
||||
.token.atrule,
|
||||
.token.attr-value,
|
||||
.token.keyword {
|
||||
color: #07a;
|
||||
}
|
||||
|
||||
.token.function,
|
||||
.token.class-name {
|
||||
color: #DD4A68;
|
||||
}
|
||||
|
||||
.token.regex,
|
||||
.token.important,
|
||||
.token.variable {
|
||||
color: #e90;
|
||||
}
|
||||
|
||||
.token.important,
|
||||
.token.bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.token.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.token.entity {
|
||||
cursor: help;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 3821755 */
|
||||
src: url('iconfont.eot?t=1689233106339'); /* IE9 */
|
||||
src: url('iconfont.eot?t=1689233106339#iefix') format('embedded-opentype'), /* IE6-IE8 */
|
||||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAARgAAsAAAAACcAAAAQUAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACDKAqGSIUsATYCJAMYCw4ABCAFhGcHVBtUCMiuMG7hiaIkox1FaBhxvd1fpwAN4YKo1v7tWTr8hBRkBQgO7yqKUJKPUKzDjkixjn7/q0vlANCkEHCJtsMvx2eQn04h5rHEE8593TK2y1SC5nbvNG5gqgZBNEWTqFUQLGVFNnVu1TjyMm3SafEsC3y0myW12KdEh2x+deP/zzHTJeG3AVBm4lrnAxpQN0US7s3ijuSE6Jbh1UGv08cgQEivMg5z6m49Qj77TVxDEZww6gXicNkviSbkxgswNeGCj+CgMw1yFRpAnUNegSv+8+UfU/igsBpjnRV3rRV9+Su8Fk1Agv6CW4eAeyvAAhronJlI1tcrVnIMHZ0cCcsUTrRTnQ0CP50B4KfgEub9Lw80BougQBwGI8bYJU4LPwUbBw0/HXAw8NORUM90wsT9JeIMFACux9QckHyQ9FDYTobcGi+FLSjwMxDe3L5s+w9THFYeEs8H303FWMnZ1JuBWFgNPh3bd5wOvJmKI9aTqXeD8eJ66HnfnV1dJPE8cy4EgqT+s/SbdSWbp9Pn24NbZ1MnGw7CDbvT6+lL1CXVh++hcH56umDT9vOviL/grQ6srHjE57uLHdQn+dtO9x2v94WN6+eXm0HWlZOzta3tUDp1JWjymsiD8r0ViWGkC+n4GeH5aODSM+9COnilpdfdZsRIvMerLmS0uICTplrOnb99LT3NkJNeajPfpDznblq6bXH8efBjlPIUxhQcX+U0qEdt4bjxy6rMdOkbEn0/3mlvrXZL60ysxdwcn/qKLJ/82pnzGS61z5rBeGmrxf33ZXN/IBWUvb8KSvnttbwwq+YTkweZHue0M0+c0ssZGY/Rs+aVF8+3GaW07CkvLC/KcBvP8c2uGpsdm0THlazwlPE22Kdi9ZK4Hdsmtw9eHVQwPjG0p33Q7tGMJ6TUJ2VK1MMw6ftI6qPPtruCvEPmLZqiHcj1Aw3Rup/sdzj+lt/w3f5TrAHgx++nD7A+8xaD4CL8m60Q+KWYO7CgUY3gTFl+OwUBHKteh00BoWmGDIYm301frAJwKAg+BTEoPCpA41OPNNh2sET0g8NnCkI61M6PKKBzREwANBtGIOS6BEU2D0CT6xvSYP+Apdg/cOT6DyErI68W0RzbqhmYOFixuRNLFqoRi839Zh+A2KqYWJH1CTC7hM04My0j664HDVgXY+xtYhbnBBNGVVzH7geKQrHOqA0sPK2Fc70oPZ2UPSTNQlVUjQEmHLDCzDphEgtKQ9zCPP16DwBRK4UJAyKfyBg7jaeaxzKlyQAg6xkaKO9M2tu1EWXhOEL3IxhKhdWpMqCYDgrTy7vZAAsuTUsLm65IOlWIQBlp47PUS9wAhBgHOFGixYgVJx7+dtqutZuY1eXTvXYncJOkOF1Wicd+CnBACA==') format('woff2'),
|
||||
url('iconfont.woff?t=1689233106339') format('woff'),
|
||||
url('iconfont.ttf?t=1689233106339') format('truetype'),
|
||||
url('iconfont.svg?t=1689233106339#iconfont') format('svg');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-family: "iconfont" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-downward:before {
|
||||
content: "\e604";
|
||||
}
|
||||
|
||||
.icon-upward:before {
|
||||
content: "\e605";
|
||||
}
|
||||
|
||||
.icon-detail:before {
|
||||
content: "\e601";
|
||||
}
|
||||
|
||||
.icon-edit:before {
|
||||
content: "\e602";
|
||||
}
|
||||
|
||||
.icon-delete:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
BIN
src/views/equipment/base/maintain/Confirm/iconfont/iconfont.eot
Normal file
BIN
src/views/equipment/base/maintain/Confirm/iconfont/iconfont.eot
Normal file
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,44 @@
|
||||
{
|
||||
"id": "3821755",
|
||||
"name": "component",
|
||||
"font_family": "iconfont",
|
||||
"css_prefix_text": "icon-",
|
||||
"description": "封装的组件中的icon",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "36426261",
|
||||
"name": "downward",
|
||||
"font_class": "downward",
|
||||
"unicode": "e604",
|
||||
"unicode_decimal": 58884
|
||||
},
|
||||
{
|
||||
"icon_id": "36426301",
|
||||
"name": "upward",
|
||||
"font_class": "upward",
|
||||
"unicode": "e605",
|
||||
"unicode_decimal": 58885
|
||||
},
|
||||
{
|
||||
"icon_id": "33347867",
|
||||
"name": "detail",
|
||||
"font_class": "detail",
|
||||
"unicode": "e601",
|
||||
"unicode_decimal": 58881
|
||||
},
|
||||
{
|
||||
"icon_id": "33347918",
|
||||
"name": "edit",
|
||||
"font_class": "edit",
|
||||
"unicode": "e602",
|
||||
"unicode_decimal": 58882
|
||||
},
|
||||
{
|
||||
"icon_id": "33347930",
|
||||
"name": "delete",
|
||||
"font_class": "delete",
|
||||
"unicode": "e603",
|
||||
"unicode_decimal": 58883
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Created by iconfont</metadata>
|
||||
<defs>
|
||||
<font id="iconfont" horiz-adv-x="1024">
|
||||
<font-face
|
||||
font-family="iconfont"
|
||||
font-weight="400"
|
||||
font-stretch="normal"
|
||||
units-per-em="1024"
|
||||
ascent="896"
|
||||
descent="-128"
|
||||
/>
|
||||
<missing-glyph />
|
||||
|
||||
<glyph glyph-name="downward" unicode="" d="M556.942222 144.099556l363.064889 401.806222c24.860444 21.617778 24.860444 56.263111 0 77.880889a68.437333 68.437333 0 0 1-44.942222 16.156444c-16.896 0-33.052444-5.859556-44.885333-16.156444L512 260.949333l-318.236444 362.951111a68.437333 68.437333 0 0 1-44.942223 16.099556c-16.896 0-33.109333-5.802667-44.942222-16.156444-24.746667-21.617778-24.746667-56.206222 0-77.824l363.121778-401.749334c5.973333-5.290667 13.141333-9.443556 21.048889-12.231111 23.722667-8.305778 51.029333-3.527111 68.892444 12.060445z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="upward" unicode="" d="M556.942222 623.900444l363.064889-401.806222c24.860444-21.617778 24.860444-56.263111 0-77.880889a68.437333 68.437333 0 0 0-44.942222-16.156444c-16.896 0-33.052444 5.859556-44.885333 16.156444L512 507.050667l-318.236444-362.951111a68.437333 68.437333 0 0 0-44.942223-16.099556c-16.896 0-33.109333 5.802667-44.942222 16.156444-24.746667 21.617778-24.746667 56.206222 0 77.824L467.057778 623.729778c5.973333 5.290667 13.141333 9.443556 21.048889 12.231111 23.722667 8.305778 51.029333 3.527111 68.892444-12.060445z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="detail" unicode="" d="M902.428444 705.251556H332.401778a7.964444 7.964444 0 0 1-7.793778-8.021334v-56.206222a7.964444 7.964444 0 0 1 7.793778-8.078222h570.026666A7.964444 7.964444 0 0 1 910.222222 641.024v56.206222a7.964444 7.964444 0 0 1-7.793778 8.021334z m0-285.127112H332.401778a7.964444 7.964444 0 0 1-7.793778-7.964444v-56.32a7.964444 7.964444 0 0 1 7.793778-7.964444h570.026666a7.964444 7.964444 0 0 1 7.793778 7.964444v56.32a7.964444 7.964444 0 0 1-7.793778 7.964444z m0-285.070222H332.401778a7.964444 7.964444 0 0 1-7.793778-8.078222v-56.206222a7.964444 7.964444 0 0 1 7.793778-8.021334h570.026666a7.964444 7.964444 0 0 1 7.793778 8.021334v56.206222a7.964444 7.964444 0 0 1-7.793778 8.078222zM113.777778 669.127111c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0 56.547556 56.547556 0 0 1 27.306666 48.696889 56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0A56.547556 56.547556 0 0 1 113.777778 669.127111zM113.777778 384c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0A56.547556 56.547556 0 0 1 223.061333 384a56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0A56.547556 56.547556 0 0 1 113.777778 384z m0-285.127111c0-20.081778 10.410667-38.684444 27.306666-48.696889a53.361778 53.361778 0 0 1 54.670223 0 56.547556 56.547556 0 0 1 27.306666 48.696889 56.547556 56.547556 0 0 1-27.306666 48.696889 53.361778 53.361778 0 0 1-54.613334 0 56.547556 56.547556 0 0 1-27.363555-48.696889z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="edit" unicode="" d="M873.016889 395.264a32.824889 32.824889 0 0 0 65.649778 0v-273.806222a164.124444 164.124444 0 0 0-164.124445-164.124445h-525.084444A164.124444 164.124444 0 0 0 85.333333 121.457778v525.084444A164.124444 164.124444 0 0 0 249.457778 810.666667h312.32a32.824889 32.824889 0 1 0 0-65.649778h-312.32a98.417778 98.417778 0 0 1-98.474667-98.417778v-525.141333c0-54.385778 44.088889-98.474667 98.417778-98.474667h525.141333a98.417778 98.417778 0 0 1 98.474667 98.417778V395.320889z m-14.222222 362.097778a32.824889 32.824889 0 0 0 48.014222-44.771556L548.750222 328.533333a32.824889 32.824889 0 1 0-48.014222 44.771556l358.115556 384.056889z" horiz-adv-x="1024" />
|
||||
|
||||
<glyph glyph-name="delete" unicode="" d="M601.024 146.24a29.632 29.632 0 0 0-29.696 29.696V503.04a29.632 29.632 0 1 0 59.456 0v-326.848a29.76 29.76 0 0 0-29.76-29.888z m-178.24 0a29.632 29.632 0 0 0-29.696 29.696V503.04a29.632 29.632 0 1 0 59.392 0v-326.848a29.76 29.76 0 0 0-29.696-29.888z m475.52 505.216h-148.544v59.456c0 49.152-39.616 89.088-88.512 89.088H363.392c-49.216 0-89.152-39.936-89.152-89.088v-59.456H125.696a29.632 29.632 0 1 1 0-59.392h772.608a29.632 29.632 0 1 1 0 59.392z m-564.608 59.456c0 16.256 13.44 29.696 29.696 29.696h297.856c16.32 0 29.056-13.12 29.056-29.696v-59.456H333.696v59.456zM720-32h-416a89.152 89.152 0 0 0-89.088 89.088V503.232a29.632 29.632 0 1 0 59.456 0v-446.08c0-16.512 13.44-29.76 29.696-29.76h416.064a29.632 29.632 0 0 1 29.696 29.696V502.144a29.632 29.632 0 1 0 59.456 0v-445.056A89.536 89.536 0 0 0 720-32z" horiz-adv-x="1024" />
|
||||
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
BIN
src/views/equipment/base/maintain/Confirm/iconfont/iconfont.ttf
Normal file
BIN
src/views/equipment/base/maintain/Confirm/iconfont/iconfont.ttf
Normal file
Binary file not shown.
BIN
src/views/equipment/base/maintain/Confirm/iconfont/iconfont.woff
Normal file
BIN
src/views/equipment/base/maintain/Confirm/iconfont/iconfont.woff
Normal file
Binary file not shown.
Binary file not shown.
558
src/views/equipment/base/maintain/Confirm/index.vue
Normal file
558
src/views/equipment/base/maintain/Confirm/index.vue
Normal file
@ -0,0 +1,558 @@
|
||||
<!--
|
||||
filename: MaintainRecord.vue
|
||||
author: DY
|
||||
date: 2023-12-12 13:54:53
|
||||
description:
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<SearchBar
|
||||
:formConfigs="searchBarFormConfig"
|
||||
ref="search-bar"
|
||||
@select-changed="handleSearchBarChange"
|
||||
@headBtnClick="handleSearchBarBtnClick" />
|
||||
<WaitingListTable
|
||||
ref="waiting-list-table"
|
||||
:table-data="list"
|
||||
:page="queryParams.pageNo"
|
||||
:limit="queryParams.pageSize"
|
||||
@edit="handleEdit"
|
||||
@detail="handleDetail"
|
||||
@delete="handleDelete"
|
||||
@confirm="handleConfirm" />
|
||||
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 对话框(添加) -->
|
||||
<base-dialog
|
||||
:dialogTitle="title"
|
||||
:dialogVisible="open"
|
||||
width="60%"
|
||||
@close="cancel"
|
||||
@cancel="cancel"
|
||||
@confirm="submitForm">
|
||||
<DialogFormUnplanned
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'" />
|
||||
<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>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<UnplannedEditDrawer
|
||||
ref="unplanned"
|
||||
v-if="openUnplannedDrawer"
|
||||
@refreshDataList="getList"
|
||||
@destroy="openUnplannedDrawer = false" />
|
||||
<PlannedEditDrawer
|
||||
ref="planned"
|
||||
v-if="openPlannedDrawer"
|
||||
@refreshDataList="getList"
|
||||
@destroy="openPlannedDrawer = false" />
|
||||
|
||||
<RecordDetail
|
||||
v-if="recordDetailVisible"
|
||||
ref="recordDetailDrawer"
|
||||
@destroy="recordDetailVisible = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from 'moment';
|
||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
import DialogFormUnplanned from './WaitingList--add--unplanned.vue';
|
||||
import UnplannedEditDrawer from './WaitingListUnplanned--edit.vue';
|
||||
import PlannedEditDrawer from './WaitingListPlanned--edit.vue';
|
||||
import {
|
||||
exportMaintainLogExcel,
|
||||
} from '@/api/equipment/base/maintain/record';
|
||||
import WaitingListTable from './WaitingListTable.vue';
|
||||
import RecordDetail from './Record--detail.vue';
|
||||
|
||||
const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
const btn = {
|
||||
name: 'tableBtn',
|
||||
props: ['injectData'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleClick() {
|
||||
this.$emit('emitData', {
|
||||
action: this.injectData.label,
|
||||
value: this.injectData,
|
||||
});
|
||||
},
|
||||
},
|
||||
render: function (h) {
|
||||
return (
|
||||
<el-button type="text" onClick={this.handleClick}>
|
||||
{this.injectData.name}
|
||||
</el-button>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'Confirm',
|
||||
components: {
|
||||
DialogFormUnplanned,
|
||||
WaitingListTable,
|
||||
RecordDetail,
|
||||
UnplannedEditDrawer,
|
||||
PlannedEditDrawer
|
||||
},
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
recordDetailVisible: false,
|
||||
searchBarKeys: [
|
||||
'maintainPlanId',
|
||||
'startTime',
|
||||
],
|
||||
tobeConfirmedIdList: [],
|
||||
searchBarFormConfig: [
|
||||
{
|
||||
type: 'select',
|
||||
label: '保养计划名称',
|
||||
placeholder: '请选择保养计划名称',
|
||||
param: 'maintainPlanId',
|
||||
defaultSelect: null,
|
||||
},
|
||||
// 开始结束时间
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '实际开始时间',
|
||||
dateType: 'daterange', // datetimerange
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始日期',
|
||||
endPlaceholder: '结束日期',
|
||||
defaultTime: ['00:00:00', '23:59:59'],
|
||||
param: 'startTime',
|
||||
defaultSelect: null,
|
||||
// width: 350,
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '新增',
|
||||
name: 'add',
|
||||
plain: true,
|
||||
color: 'success',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '批量确认',
|
||||
name: 'batchConfirm',
|
||||
color: 'primary',
|
||||
plain: true,
|
||||
},
|
||||
{
|
||||
type: this.$auth.hasPermi('equipment:maintain-record:export')
|
||||
? 'button'
|
||||
: '',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
plain: true,
|
||||
color: 'primary',
|
||||
},
|
||||
// {
|
||||
// type: this.$auth.hasPermi('equipment:maintain-record:create')
|
||||
// ? 'button'
|
||||
// : '',
|
||||
// btnName: '新增',
|
||||
// name: 'add',
|
||||
// plain: true,
|
||||
// color: 'success',
|
||||
// },
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
maintainPlanId: null,
|
||||
startTime: null,
|
||||
special: false,
|
||||
confirmed: false,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
basePath: '/base/equipment-maintain-log',
|
||||
mode: null,
|
||||
allSpecialEquipments: [],
|
||||
openPlannedDrawer: false,
|
||||
openUnplannedDrawer: false,
|
||||
openPlannedDrawer: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
tobeConfirmedIdList: {
|
||||
handler(val) {
|
||||
if (val.length == this.list.length) {
|
||||
this.$refs['table'].toggleAllSelection();
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.initSearchBar();
|
||||
// if (this.$route.query) {
|
||||
// this.queryParams.specialType =
|
||||
// this.$route.query?.specialType ?? undefined;
|
||||
// this.queryParams.equipmentId =
|
||||
// this.$route.query?.equipmentId ?? undefined;
|
||||
// this.queryParams.maintainPlanId =
|
||||
// this.$route.query?.maintainPlanId ?? undefined;
|
||||
// this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
|
||||
// this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
|
||||
// this.searchBarFormConfig[0].defaultSelect =
|
||||
// this.$route.query.specialType ?? undefined;
|
||||
// this.searchBarFormConfig[1].defaultSelect =
|
||||
// this.$route.query.equipmentId ?? undefined;
|
||||
// this.searchBarFormConfig[2].defaultSelect =
|
||||
// this.$route.query.maintainPlanId ?? undefined;
|
||||
// this.searchBarFormConfig[3].defaultSelect =
|
||||
// this.$route.query?.createTime ?? undefined;
|
||||
// this.searchBarFormConfig[4].defaultSelect =
|
||||
// Number(this.$route.query.relatePlan) ?? undefined;
|
||||
// }
|
||||
this.getList();
|
||||
// if (this.$route.query.addRecord) {
|
||||
// this.handleAdd();
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
/** 批量确认 */
|
||||
async searchBarClicked(btn) {
|
||||
switch (btn.btnName) {
|
||||
case 'batchConfirm':
|
||||
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
|
||||
this.$message.warning('请选择待确认的设备保养记录');
|
||||
return;
|
||||
}
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log/confirm',
|
||||
method: 'put',
|
||||
data: this.$refs['waiting-list-table'].selectedPlan.map(
|
||||
(item) => item.id
|
||||
),
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message.success('确认成功');
|
||||
this.getList();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleSelectionChange(list) {
|
||||
if (this.tobeConfirmedIdList.length) {
|
||||
this.tobeConfirmedIdList = [];
|
||||
this.list.forEach((item) => {
|
||||
this.handleEmitFun({
|
||||
action: 'row-selected',
|
||||
value: { row: item, selected: false },
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
'清空选择列表',
|
||||
this.list.map((item) => item._selection)
|
||||
);
|
||||
} else {
|
||||
this.tobeConfirmedIdList = list.map((item) => item.id);
|
||||
this.list.forEach((item) => {
|
||||
this.handleEmitFun({
|
||||
action: 'row-selected',
|
||||
value: { row: item, selected: true },
|
||||
});
|
||||
});
|
||||
console.log(
|
||||
'全选',
|
||||
this.list.map((item) => item._selection)
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
handleEmitFun({ action, value }) {
|
||||
switch (action) {
|
||||
case '详情':
|
||||
this.recordDetailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.recordDetailDrawer.show({
|
||||
id: value.id,
|
||||
planMaintainWorker: value.planMaintainWorker,
|
||||
maintainWorker: value.maintainWorker,
|
||||
});
|
||||
});
|
||||
break;
|
||||
case 'row-selected':
|
||||
if (value.selected) {
|
||||
this.tobeConfirmedIdList.push(value.row.id);
|
||||
value.row._selection = 0b11;
|
||||
} else {
|
||||
const index = this.tobeConfirmedIdList.indexOf(value.row.id);
|
||||
if (index != -1) {
|
||||
this.tobeConfirmedIdList.splice(index, 1);
|
||||
}
|
||||
}
|
||||
console.log('tobeConfirmedIdList', this.tobeConfirmedIdList);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
handleSearchBarChange({ param, value }) {
|
||||
console.log('122', param)
|
||||
// if ('specialType' === param) {
|
||||
// if (!value) {
|
||||
// this.setSearchBarEquipmentList(this.allSpecialEquipments);
|
||||
// return;
|
||||
// }
|
||||
// this.setSearchBarEquipmentList(
|
||||
// this.allSpecialEquipments.filter((item) => item.specialType == value)
|
||||
// );
|
||||
// }
|
||||
},
|
||||
initSearchBar() {
|
||||
// this.http('/base/core-equipment/listAll', 'get').then(({ data }) => {
|
||||
// this.allSpecialEquipments = data.filter((item) => item.special);
|
||||
// this.setSearchBarEquipmentList(data.filter((item) => item.special));
|
||||
// });
|
||||
this.http('/base/equipment-maintain-plan/page', 'get', {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
special: false,
|
||||
}).then(({ data }) => {
|
||||
this.$set(
|
||||
this.searchBarFormConfig[0],
|
||||
// this.searchBarFormConfig[2],
|
||||
'selectOptions',
|
||||
(data?.list || []).map((item) => ({
|
||||
name: item.name,
|
||||
id: item.id,
|
||||
}))
|
||||
);
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
this.recv({
|
||||
...this.queryParams,
|
||||
special: false,
|
||||
// relatePlan: 2,
|
||||
confirmed: false,
|
||||
}).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.mode = null;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
relatePlan: null,
|
||||
maintainWorker: [],
|
||||
maintainOrderNumber: null,
|
||||
departmentId: null,
|
||||
lineId: null,
|
||||
startTime: null,
|
||||
endTime: null,
|
||||
planStartTime: null,
|
||||
planEndTime: null,
|
||||
confirmed: false,
|
||||
remark: null,
|
||||
special: false,
|
||||
};
|
||||
this.resetForm('form');
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = '添加待确认保养记录';
|
||||
},
|
||||
|
||||
getConfirmed() {
|
||||
return this.$confirm('是否直接确认保养记录', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
},
|
||||
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 添加的提交
|
||||
this.getConfirmed()
|
||||
.then((confirmed) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: true,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
maintainWorker: this.form.maintainWorker.join(','),
|
||||
special: false,
|
||||
relatePlan: 2,
|
||||
confirmed: false,
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 确认 */
|
||||
async handleConfirm(row) {
|
||||
const res = await this.$axios({
|
||||
url: '/base/equipment-maintain-log/confirm',
|
||||
method: 'put',
|
||||
data: [row.id],
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$message.success('确认成功');
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
/** 编辑 */
|
||||
async handleEdit(row) {
|
||||
this.reset();
|
||||
if (row.relatePlan == 1) {
|
||||
// 计划型
|
||||
// const res = await this.info({ id: row.id });
|
||||
// this.form = res.data;
|
||||
// this.form.maintainWorker = res.data.maintainWorker.split(',');
|
||||
this.openPlannedDrawer = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.planned.init(row);
|
||||
});
|
||||
} else {
|
||||
this.openUnplannedDrawer = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.unplanned.init(row);
|
||||
});
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm(
|
||||
'是否确认删除设备保养单号为"' + row.maintainOrderNumber + '"的数据项?'
|
||||
)
|
||||
.then(() => {
|
||||
return this.$axios({
|
||||
url: '/base/equipment-maintain-log/delete?id=' + row.id,
|
||||
method: 'delete',
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess('删除成功');
|
||||
})
|
||||
.catch(console.error);
|
||||
},
|
||||
handleDetail(row) {
|
||||
this.recordDetailVisible = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.recordDetailDrawer.show({
|
||||
id: row.id,
|
||||
planMaintainWorker: row.planMaintainWorker,
|
||||
maintainWorker: row.maintainWorker,
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有保养记录?')
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportMaintainLogExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, '设备保养记录.xls');
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -1,40 +1,3 @@
|
||||
|
||||
首页
|
||||
工单管理
|
||||
合并请求
|
||||
里程碑
|
||||
探索
|
||||
通知469
|
||||
创建…
|
||||
个人信息和配置
|
||||
mt-fe-group / yudao-dev
|
||||
取消关注
|
||||
11
|
||||
点赞
|
||||
0
|
||||
派生
|
||||
0
|
||||
代码
|
||||
工单
|
||||
0
|
||||
合并请求
|
||||
0
|
||||
版本发布
|
||||
0
|
||||
百科
|
||||
动态
|
||||
559 提交
|
||||
25 分支
|
||||
145 MiB
|
||||
分支: projects/mes-test
|
||||
yudao-dev/src/views/equipment/base/repair/CustomDialogForm.vue
|
||||
346 行
|
||||
8.9 KiB
|
||||
原始文件
|
||||
永久链接
|
||||
Blame
|
||||
文件历史
|
||||
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
@ -44,53 +7,74 @@ Blame
|
||||
|
||||
<template>
|
||||
<el-drawer :visible.sync="visible" :show-close="false" :wrapper-closable="disabled" class="drawer"
|
||||
custom-class="mes-drawer" size="65%" @closed="$emit('destroy')">
|
||||
custom-class="mes-drawer" size="50%" @closed="$emit('destroy')">
|
||||
<small-title slot="title" :no-padding="true">
|
||||
{{ disabled ? '查看详情' : !dataForm.maintenanceStatus ? '修改' : '完成' }}
|
||||
</small-title>
|
||||
<div class="drawer-body flex">
|
||||
<div class="drawer-body__content">
|
||||
<el-form ref="form" :model="dataForm" label-width="100px" label-position="top" v-loading="formLoading">
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修单号" prop="repairOrderNumber">
|
||||
<span>{{ dataForm.repairOrderNumber }}</span>
|
||||
</el-form-item>
|
||||
<div class="blodTip">故障发生时间</div>
|
||||
<div class="lightTip">{{ parseTime(dataForm.faultTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="设备名称" prop="equipmentName">
|
||||
<span>{{ dataForm.equipmentName }}</span>
|
||||
</el-form-item>
|
||||
<div class="blodTip">故障级别</div>
|
||||
<div class="lightTip">{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="维修工" prop="repairman">
|
||||
<span>{{ dataForm.repairman }}</span>
|
||||
</el-form-item>
|
||||
<div class="blodTip">故障类型</div>
|
||||
<div class="lightTip">{{ getDictDataLabel('fault-type', dataForm.faultType) }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障发生时间" prop="faultTime">
|
||||
<span>{{ parseTime(dataForm.faultTime) }}</span>
|
||||
</el-form-item>
|
||||
<div class="blodTip">维修工</div>
|
||||
<div class="lightTip">{{ dataForm.repairman }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="故障级别" prop="faultLevel">
|
||||
<span>{{ getDictDataLabel('fault-level', dataForm.faultLevel) }}</span>
|
||||
</el-form-item>
|
||||
<div class="blodTip">联系方式</div>
|
||||
<div class="lightTip">{{ dataForm.repairmanPhone }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="联系方式" prop="repairmanPhone">
|
||||
<span>{{ dataForm.repairmanPhone }}</span>
|
||||
</el-form-item>
|
||||
<div class="blodTip">维修方式</div>
|
||||
<div class="lightTip">{{ getDictDataLabel('repair-mode', dataForm.repairMode) }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider style="margin-top: -10px" />
|
||||
|
||||
<el-row>
|
||||
<div class="blodTip">维修附件</div>
|
||||
<div v-if="dataForm.files && dataForm.files.length > 0">
|
||||
<uploadedFile
|
||||
class="file"
|
||||
v-for="file in dataForm.files"
|
||||
:file="file"
|
||||
:key="file.fileUrl"
|
||||
:disabled="disabled"
|
||||
@delete="!disabled && handleDeleteFile(file, col.prop)" />
|
||||
</div>
|
||||
<p v-else>暂无附件</p>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">创建时间</div>
|
||||
<div class="lightTip">{{ parseTime(dataForm.createTime) }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="blodTip">创建人</div>
|
||||
<div class="lightTip">{{ dataForm.creator }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<div class="blodTip">备注</div>
|
||||
<div class="lightTip">{{ dataForm.remark }}</div>
|
||||
</el-row>
|
||||
</div>
|
||||
<!-- <el-divider style="margin-top: -10px" />
|
||||
<small-title style="margin: 16px 0; padding-left: 8px" :no-padding="true">
|
||||
{{ '设备维修信息' }}
|
||||
</small-title>
|
||||
</small-title> -->
|
||||
<!-- <el-form ref="form" :model="dataForm" label-width="100px" label-position="top" v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="维修开始时间" prop="maintenanceStartTime"
|
||||
@ -129,7 +113,6 @@ Blame
|
||||
<el-col>
|
||||
<el-form-item label="故障明细" prop="faultDetail"
|
||||
:rules="[{ required: true, message: '故障明细不能为空', trigger: 'blur' }]">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.faultDetail" :read-only="disabled" :min-height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -138,7 +121,6 @@ Blame
|
||||
<el-row :gutter="20">
|
||||
<el-col>
|
||||
<el-form-item label="维修记录" prop="maintenanceDetail">
|
||||
<!-- // 富文本 -->
|
||||
<editor v-model="dataForm.maintenanceDetail" :read-only="disabled" :min-height="150" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@ -159,7 +141,7 @@ Blame
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-form> -->
|
||||
|
||||
<div v-if="!disabled" class="drawer-body__footer">
|
||||
<el-button style="" @click="goback()">取消</el-button>
|
||||
@ -174,11 +156,73 @@ Blame
|
||||
import SmallTitle from '../../base/alarm/Record/SmallTitle.vue';
|
||||
import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair'
|
||||
import Editor from "@/components/Editor";
|
||||
import FileUpload from "@/components/FileUpload";
|
||||
// import FileUpload from "@/components/FileUpload";
|
||||
import { getDictDatas } from "@/utils/dict";
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { getDictDataLabel } from '@/utils/dict';
|
||||
|
||||
const uploadedFile = {
|
||||
name: 'UploadedFile',
|
||||
props: ['file', 'disabled'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleDelete() {
|
||||
this.$emit('delete', this.file);
|
||||
},
|
||||
async handleDownload() {
|
||||
const data = await this.$axios({
|
||||
url: this.file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
|
||||
await this.$message.success('开始下载');
|
||||
// create download link
|
||||
const url = window.URL.createObjectURL(data);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = this.file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
title={this.file.fileName}
|
||||
onClick={this.handleDownload}
|
||||
style={{
|
||||
background: `url(${tupleImg}) no-repeat`,
|
||||
backgroundSize: '14px',
|
||||
backgroundPosition: '0 55%',
|
||||
paddingLeft: '20px',
|
||||
paddingRight: '24px',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
cursor: 'pointer',
|
||||
display: 'inline-block',
|
||||
}}>
|
||||
{this.file.fileName}
|
||||
{!this.disabled && (
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
|
||||
class="dialog__upload_component__close"
|
||||
onClick={this.handleDelete}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
@ -186,7 +230,7 @@ export default {
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { SmallTitle, Editor, FileUpload },
|
||||
components: { SmallTitle, Editor, uploadedFile },
|
||||
props: {
|
||||
// dataForm: {
|
||||
// type: Object,
|
||||
@ -237,18 +281,18 @@ export default {
|
||||
this.visible = true;
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
// this.$refs['form'].resetFields();
|
||||
|
||||
if (this.dataForm.id) {
|
||||
// 获取设备维修
|
||||
getEqRepair(this.dataForm.id).then(response => {
|
||||
this.formLoading = false
|
||||
this.dataForm = response.data;
|
||||
this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
|
||||
if (this.dataForm.files.length > 0) {
|
||||
this.file = this.dataForm.files[0].fileUrl
|
||||
this.fileName = this.dataForm.files[0].fileName
|
||||
}
|
||||
// this.dataForm.maintenanceStatus = row.maintenanceStatus || 0
|
||||
// if (this.dataForm.files.length > 0) {
|
||||
// this.file = this.dataForm.files[0].fileUrl
|
||||
// this.fileName = this.dataForm.files[0].fileName
|
||||
// }
|
||||
});
|
||||
} else {
|
||||
// if (this.urlOptions.isGetCode) {
|
||||
@ -337,4 +381,18 @@ export default {
|
||||
justify-content: flex-end;
|
||||
padding: 18px;
|
||||
}
|
||||
.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>
|
||||
|
799
src/views/equipment/base/repair/Repair--add.vue
Normal file
799
src/views/equipment/base/repair/Repair--add.vue
Normal file
@ -0,0 +1,799 @@
|
||||
<!--
|
||||
filename: dialogForm.vue
|
||||
author: liubin
|
||||
date: 2023-08-15 10:32:36
|
||||
description: 弹窗的表单组件
|
||||
-->
|
||||
|
||||
<template>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:label-position="labelPosition"
|
||||
v-loading="formLoading">
|
||||
<el-row :gutter="20">
|
||||
<!-- 维修单号 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修单号"
|
||||
prop="repairOrderNumber"
|
||||
:rules="[
|
||||
{ required: true, message: '维修单号不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.repairOrderNumber"
|
||||
@change="$emit('update', form)"
|
||||
placeholder="请输入维修单号"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 产线名 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="产线名" prop="lineId">
|
||||
<el-select
|
||||
v-model="formFilters.lineId"
|
||||
:placeholder="`请选择产线`"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
filterable
|
||||
@change="initSections">
|
||||
<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="sectionId">
|
||||
<el-select
|
||||
v-model="formFilters.sectionId"
|
||||
:placeholder="`请选择工段`"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in sectionOptions"
|
||||
: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="equipmentId"
|
||||
:rules="[
|
||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.equipmentId"
|
||||
:placeholder="`请选择设备`"
|
||||
:disabled="disabled"
|
||||
filterable
|
||||
clearable
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in equipmentOptions"
|
||||
:key="opt.id"
|
||||
:label="opt.name"
|
||||
:value="opt.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 故障发生时间 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="故障发生时间"
|
||||
prop="faultTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '故障发生时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.faultTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
:placeholder="`请选择故障发生时间`"
|
||||
value-format="timestamp"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
clearable
|
||||
@change="$emit('update', form)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 故障级别 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="故障级别"
|
||||
prop="faultLevel"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '故障级别不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.faultLevel"
|
||||
placeholder="故障级别"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas(DICT_TYPE.FAULT_LEVEL)"
|
||||
: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="faultType"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '故障类型不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.faultType"
|
||||
placeholder="故障类型"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas(DICT_TYPE.FAULT_TYPE)"
|
||||
: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="maintenanceStartTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修开始时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.maintenanceStartTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
:placeholder="`请选择维修开始时间`"
|
||||
value-format="timestamp"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
clearable
|
||||
@change="$emit('update', form)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 维修结束时间 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修结束时间"
|
||||
prop="maintenanceFinishTime"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修结束时间不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-date-picker
|
||||
v-model="form.maintenanceFinishTime"
|
||||
type="datetime"
|
||||
:disabled="disabled"
|
||||
:placeholder="`请选择维修结束时间`"
|
||||
value-format="timestamp"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
clearable
|
||||
@change="$emit('update', form)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 维修工 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修工"
|
||||
prop="repairman"
|
||||
:rules="[
|
||||
{ required: true, message: '维修工不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.repairman"
|
||||
@change="$emit('update', form)"
|
||||
placeholder="请选择维修工"
|
||||
filterable
|
||||
clearable
|
||||
multiple
|
||||
:disabled="disabled">
|
||||
<el-option
|
||||
v-for="opt in workerOptions"
|
||||
: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="repairmanPhone"
|
||||
:rules="[
|
||||
{ required: false, message: '联系方式不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-input
|
||||
v-model="form.repairmanPhone"
|
||||
@change="$emit('update', form)"
|
||||
placeholder="请输入联系方式"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 维修方式 - 数据字典 -->
|
||||
<el-col :span="8">
|
||||
<el-form-item
|
||||
label="维修方式"
|
||||
prop="repairMode"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修方式不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.repairMode"
|
||||
placeholder="维修方式"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas(DICT_TYPE.REPAIR_MODE)"
|
||||
: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="maintenanceResult"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '维修结果不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.maintenanceResult"
|
||||
placeholder="维修结果"
|
||||
:disabled="disabled"
|
||||
@change="$emit('update', form)">
|
||||
<el-option
|
||||
v-for="opt in getDictDatas(DICT_TYPE.REPAIR_RESULT)"
|
||||
: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
|
||||
v-model="form.remark"
|
||||
@change="$emit('update', form)"
|
||||
placeholder="请输入备注"
|
||||
:disabled="disabled" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 故障明细 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="故障明细"
|
||||
prop="faultDetail"
|
||||
:rules="[
|
||||
{
|
||||
required: true,
|
||||
message: '故障明细不能为空',
|
||||
trigger: 'blur',
|
||||
},
|
||||
]">
|
||||
<Editor
|
||||
key="fault-detail"
|
||||
:height="200"
|
||||
v-model="form.faultDetail"
|
||||
@on-change="$emit('update', form)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 维修描述 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="维修描述" prop="maintenanceDetail">
|
||||
<Editor
|
||||
key="maintenance-detail"
|
||||
:height="200"
|
||||
v-model="form.maintenanceDetail"
|
||||
@on-change="$emit('update', form)" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 维修附件 -->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="维修附件" prop="files">
|
||||
<div
|
||||
class="upload-area"
|
||||
:class="uploadOpen ? '' : 'height-48'"
|
||||
ref="uploadArea">
|
||||
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-arrow-right"
|
||||
@click="uploadOpen = !uploadOpen" />
|
||||
</span>
|
||||
<!-- :file-list="uploadedFileList" -->
|
||||
<el-upload
|
||||
class="upload-in-dialog"
|
||||
:action="uploadUrl"
|
||||
:headers="uploadHeaders"
|
||||
:show-file-list="false"
|
||||
icon="el-icon-upload2"
|
||||
:disabled="disabled"
|
||||
:before-upload="beforeUpload"
|
||||
:on-success="
|
||||
(response, file, fileList) => {
|
||||
handleUploadSuccess(response, file, 'files');
|
||||
}
|
||||
">
|
||||
<el-button size="mini" :disabled="disabled || false">
|
||||
<svg-icon
|
||||
icon-class="icon-upload"
|
||||
style="color: inherit"></svg-icon>
|
||||
上传文件
|
||||
</el-button>
|
||||
<div class="el-upload__tip" slot="tip">
|
||||
只能上传jpg/png文件, 大小不超过2MB
|
||||
</div>
|
||||
</el-upload>
|
||||
|
||||
<uploadedFile
|
||||
class="file"
|
||||
v-for="file in form.files"
|
||||
:file="file"
|
||||
:key="file.fileUrl"
|
||||
:disabled="disabled"
|
||||
@delete="!disabled && handleDeleteFile(file, col.prop)" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 设备大类 -->
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item
|
||||
label="设备大类"
|
||||
prop="equipmentCategory"
|
||||
:rules="[
|
||||
{ required: true, message: '设备大类不能为空', trigger: 'blur' },
|
||||
]">
|
||||
<el-select
|
||||
v-model="form.equipmentCategory"
|
||||
:placeholder="`请选择设备大类`"
|
||||
:disabled="disabled"
|
||||
clearable
|
||||
filterable
|
||||
@change="handleEqTypeChange">
|
||||
<el-option
|
||||
v-for="opt in equipmentTypeOptions"
|
||||
:key="opt.value"
|
||||
:label="opt.label"
|
||||
:value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Editor from '@/components/Editor';
|
||||
import { getAccessToken } from '@/utils/auth';
|
||||
import tupleImg from '@/assets/images/tuple.png';
|
||||
|
||||
const uploadedFile = {
|
||||
name: 'UploadedFile',
|
||||
props: ['file', 'disabled'],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
methods: {
|
||||
handleDelete() {
|
||||
this.$emit('delete', this.file);
|
||||
},
|
||||
async handleDownload() {
|
||||
const data = await this.$axios({
|
||||
url: this.file.fileUrl,
|
||||
method: 'get',
|
||||
responseType: 'blob',
|
||||
});
|
||||
|
||||
await this.$message.success('开始下载');
|
||||
// create download link
|
||||
const url = window.URL.createObjectURL(data);
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = this.file.fileName;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
},
|
||||
mounted() {},
|
||||
render: function (h) {
|
||||
return (
|
||||
<div
|
||||
title={this.file.fileName}
|
||||
onClick={this.handleDownload}
|
||||
style={{
|
||||
background: `url(${tupleImg}) no-repeat`,
|
||||
backgroundSize: '14px',
|
||||
backgroundPosition: '0 55%',
|
||||
paddingLeft: '20px',
|
||||
paddingRight: '24px',
|
||||
textOverflow: 'ellipsis',
|
||||
whiteSpace: 'nowrap',
|
||||
overflow: 'hidden',
|
||||
cursor: 'pointer',
|
||||
display: 'inline-block',
|
||||
}}>
|
||||
{this.file.fileName}
|
||||
{!this.disabled && (
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-close"
|
||||
style="float: right; position: relative; top: 2px; left: 8px; z-index: 100"
|
||||
class="dialog__upload_component__close"
|
||||
onClick={this.handleDelete}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'DialogForm',
|
||||
model: {
|
||||
prop: 'dataForm',
|
||||
event: 'update',
|
||||
},
|
||||
emits: ['update'],
|
||||
components: { Editor, uploadedFile },
|
||||
props: {
|
||||
dataForm: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
labelPosition: {
|
||||
type: String,
|
||||
default: 'top',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isInit: true,
|
||||
// allSpeicalEquipments: [],
|
||||
form: {},
|
||||
formFilters: {
|
||||
lineId: null,
|
||||
sectionId: null,
|
||||
},
|
||||
formLoading: true,
|
||||
dataLoaded: false,
|
||||
equipmentList: [],
|
||||
equipmentOptions: [],
|
||||
workerOptions: [],
|
||||
planOptions: [],
|
||||
sectionOptions: [],
|
||||
lineOptions: [],
|
||||
uploadOpen: false,
|
||||
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // 上传有关的headers,url都是固定的
|
||||
uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() },
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
dataForm: {
|
||||
handler(val) {
|
||||
this.form = JSON.parse(JSON.stringify(val));
|
||||
// if (this.form.equipmentCategory != null) {
|
||||
// setTimeout(() => {
|
||||
// this.equipmentOptions = this.equipmentList
|
||||
// .filter((item) => item.special)
|
||||
// .filter(
|
||||
// (item) => item.specialType === this.form.equipmentCategory
|
||||
// )
|
||||
// .map((item) => ({ label: item.name, value: item.id }));
|
||||
// }, 1000);
|
||||
// }
|
||||
if (this.hasFiles) {
|
||||
if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
|
||||
this.form.files = this.form.files ?? [];
|
||||
} else if (Array.isArray(this.hasFiles)) {
|
||||
this.hasFiles.forEach((prop) => {
|
||||
this.form[prop] = this.form[prop] ?? [];
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true,
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.initOptions();
|
||||
},
|
||||
methods: {
|
||||
/** 模拟透传 ref */
|
||||
validate(cb) {
|
||||
return this.$refs.form.validate(cb);
|
||||
},
|
||||
resetFields(args) {
|
||||
return this.$refs.form.resetFields(args);
|
||||
},
|
||||
|
||||
// getCode
|
||||
async getCode() {
|
||||
const response = await this.$axios('/base/equipment-repair-log/getCode');
|
||||
this.form.repairOrderNumber = response.data || '';
|
||||
},
|
||||
|
||||
// initialize
|
||||
async initOptions() {
|
||||
this.formLoading = true;
|
||||
await this.getCode();
|
||||
await this.initEquipment();
|
||||
await this.initLines();
|
||||
await this.initWorker();
|
||||
await this.initSections();
|
||||
this.formLoading = false;
|
||||
this.isInit = false;
|
||||
this.setInitWorker();
|
||||
},
|
||||
|
||||
/** 设置默认维修工为用户自己 */
|
||||
setInitWorker() {
|
||||
/** 获取用户自身id */
|
||||
const userId = this.$store.getters.userId;
|
||||
this.$nextTick(() => {
|
||||
this.form.repairman = [userId];
|
||||
});
|
||||
},
|
||||
|
||||
/** 获取产线 */
|
||||
async initLines() {
|
||||
const res = await this.$axios('/base/core-production-line/listAll');
|
||||
this.lineOptions = (res.data || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
},
|
||||
|
||||
/** 获取工段 */
|
||||
async initSections(byLineId) {
|
||||
this.formLoading = !this.isInit && true;
|
||||
const res = await this.$axios({
|
||||
url:
|
||||
byLineId && !this.isInit
|
||||
? '/base/core-workshop-section/listByParentId?id=' + byLineId
|
||||
: '/base/core-workshop-section/listAll',
|
||||
});
|
||||
this.sectionOptions = (res.data || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
this.formLoading = !this.isInit && false;
|
||||
},
|
||||
/** 获取设备 */
|
||||
async initEquipment() {
|
||||
const response = await this.$axios('/base/core-equipment/listAll');
|
||||
this.equipmentList = response.data || [];
|
||||
this.equipmentOptions = response.data || [];
|
||||
// this.allSpeicalEquipments = equipmentOptions;
|
||||
},
|
||||
/** 获取维修工 - 同时从用户表和员工表拉取数据 */
|
||||
async initWorker() {
|
||||
let list = [];
|
||||
/** user */
|
||||
const userList = await this.$axios({
|
||||
url: '/system/user/page',
|
||||
params: {
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
},
|
||||
});
|
||||
list = list.concat(
|
||||
(userList.data?.list || []).map((item) => ({
|
||||
label: item.username,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
/** worker */
|
||||
const workerList = await this.$axios({
|
||||
url: '/base/core-worker/listAll',
|
||||
});
|
||||
list = list.concat(
|
||||
(workerList.data || []).map((item) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
);
|
||||
/** setting */
|
||||
this.workerOptions = list;
|
||||
},
|
||||
|
||||
beforeUpload(file) {
|
||||
const checkFileSize = () => {
|
||||
const isLt2M = file.size / 1024 / 1024 < 2;
|
||||
if (!isLt2M) {
|
||||
this.$modal.msgError('上传文件大小不能超过 2MB!');
|
||||
}
|
||||
return isLt2M;
|
||||
};
|
||||
const checkFileType = () => {
|
||||
const isJPG =
|
||||
file.type === 'image/jpeg' ||
|
||||
file.type === 'image/png' ||
|
||||
file.type === 'image/jpg';
|
||||
return isJPG;
|
||||
};
|
||||
return checkFileSize() && checkFileType();
|
||||
},
|
||||
|
||||
// handlers
|
||||
handleEqTypeChange(type) {
|
||||
this.form.equipmentId = null;
|
||||
console.log('111', type)
|
||||
this.equipmentOptions = this.equipmentList
|
||||
// if (type) {
|
||||
// this.equipmentOptions = this.equipmentList
|
||||
// .filter((item) => item.special)
|
||||
// .filter((item) => item.specialType === type)
|
||||
// .map((item) => ({ label: item.name, value: item.id }));
|
||||
// } else
|
||||
// this.equipmentOptions = this.equipmentList.map((item) => ({
|
||||
// label: item.name,
|
||||
// value: item.id,
|
||||
// }));
|
||||
// this.$emit('update', this.form)
|
||||
},
|
||||
|
||||
handleEqChange() {
|
||||
this.$emit('update', this.form);
|
||||
},
|
||||
|
||||
// 修改 是否计划保养 时
|
||||
handlePlanChange(val) {
|
||||
console.log('handlePlanChange', val);
|
||||
// this.form.equipmentCategory = null;
|
||||
this.form.equipmentId = null;
|
||||
this.$emit('update', { ...this.form, relatePlan: val });
|
||||
this.initEquipment(val == 1 ? 'special-equipment' : null);
|
||||
},
|
||||
|
||||
handleEditorInput(html) {
|
||||
this.$emit('update', {
|
||||
...this.form,
|
||||
maintenanceDes: html,
|
||||
});
|
||||
},
|
||||
|
||||
// upload
|
||||
handleFilesOpen() {},
|
||||
|
||||
handleUploadSuccess(response, file, prop) {
|
||||
console.log('response', response);
|
||||
if (response.code != 0) {
|
||||
this.$modal.msgError('上传失败: ', response.msg || '-');
|
||||
return;
|
||||
}
|
||||
this.form.files.push({
|
||||
fileName: file.name,
|
||||
fileUrl: response.data,
|
||||
fileType: prop == 'files' ? 2 : 1,
|
||||
});
|
||||
this.$modal.msgSuccess('上传成功');
|
||||
this.$emit('update', this.form);
|
||||
},
|
||||
|
||||
handleDeleteFile(file, prop) {
|
||||
this.form.files = this.form.files.filter(
|
||||
(item) => item.fileUrl != file.fileUrl
|
||||
);
|
||||
this.$emit('update', this.form);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.el-date-editor,
|
||||
.el-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.upload-area {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: height 0.3s ease-out;
|
||||
}
|
||||
|
||||
.upload-in-dialog {
|
||||
margin-right: 24px;
|
||||
position: relative;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.close-icon {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 12px;
|
||||
z-index: 100;
|
||||
transition: transform 0.3s ease-out;
|
||||
}
|
||||
|
||||
.close-icon.open {
|
||||
transform: rotateZ(90deg);
|
||||
}
|
||||
|
||||
.dialog__upload_component__close {
|
||||
color: #ccc;
|
||||
}
|
||||
.dialog__upload_component__close:hover {
|
||||
/* color: #777; */
|
||||
color: red;
|
||||
}
|
||||
|
||||
.height-48 {
|
||||
height: 35px !important;
|
||||
}
|
||||
|
||||
:deep(.record-add__editor) {
|
||||
.ql-picker-label {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -41,9 +41,7 @@
|
||||
v-if="open"
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:disabled="mode == 'detail'"
|
||||
:has-files="true"
|
||||
:rows="rows" />
|
||||
:disabled="mode == 'detail'" />
|
||||
</base-dialog>
|
||||
<CustomDialogForm
|
||||
v-if="addOrUpdateVisible"
|
||||
@ -59,11 +57,12 @@ import CustomDialogForm from './CustomDialogForm.vue';
|
||||
import { deleteRepair, exportRepairLogExcel } from '@/api/equipment/base/repair'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import htmls from './htmls.vue'
|
||||
import DialogForm from './Repair--add.vue';
|
||||
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
|
||||
|
||||
export default {
|
||||
name: 'EquipmentRepair',
|
||||
components: { CustomDialogForm },
|
||||
components: { CustomDialogForm, DialogForm },
|
||||
mixins: [basicPageMixin],
|
||||
data() {
|
||||
return {
|
||||
@ -107,7 +106,7 @@ export default {
|
||||
{ prop: 'lineName', label: '产线名' },
|
||||
{ prop: 'sectionName', label: '工段名' },
|
||||
{ prop: 'equipmentName', label: '设备名称', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'faultDetail', label: '故障明细' },
|
||||
{ prop: 'faultDetail', label: '故障明细', subcomponent: htmls },
|
||||
// { prop: 'maintenanceDetail', label: '维修明细', subcomponent: htmls, minWidth: 100, showOverflowtooltip: true },
|
||||
{
|
||||
prop: 'maintenanceStartTime',
|
||||
@ -126,7 +125,7 @@ export default {
|
||||
filter: (v) => (v != null ? ['成功', '失败'][v] : ''),
|
||||
},
|
||||
// { prop: 'maintenanceDuration', label: '维修时长(h)' },
|
||||
{ prop: 'remark', label: '维修描述' }, // 没有参数
|
||||
{ prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // 没有参数
|
||||
// { prop: 'repairman', label: '维修工', minWidth: 100, showOverflowtooltip: true },
|
||||
// { prop: 'repairmanPhone', label: '联系方式', minWidth: 100, showOverflowtooltip: true },
|
||||
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true }
|
||||
@ -187,71 +186,6 @@ export default {
|
||||
color: 'success',
|
||||
},
|
||||
],
|
||||
rows: [
|
||||
[
|
||||
{
|
||||
input: true,
|
||||
label: '维修单号',
|
||||
prop: 'repairOrderNumber',
|
||||
rules: [{ required: true, message: '维修单号不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '设备名称',
|
||||
prop: 'equipmentId',
|
||||
// url: '/base/core-equipment/listAll',
|
||||
url: '/base/core-equipment/page?special=false&pageNo=1&pageSize=99',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
},
|
||||
rules: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }],
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
// TODO: 和班组联动
|
||||
// select: true,
|
||||
input: true,
|
||||
label: '维修工',
|
||||
prop: 'repairman',
|
||||
// url: '/base/core-worker/listAll',
|
||||
// valueKey: 'name',
|
||||
bind: {
|
||||
filterable: true,
|
||||
clearable: true,
|
||||
// multiple: true,
|
||||
},
|
||||
// options: [{ label: 'test', value: 'test' }],
|
||||
rules: [{ required: true, message: '维修工不能为空', trigger: 'blur' }],
|
||||
},
|
||||
{
|
||||
input: true,
|
||||
label: '联系方式',
|
||||
prop: 'repairmanPhone',
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
datetime: true,
|
||||
label: '故障发生时间',
|
||||
prop: 'faultTime',
|
||||
rules: [{ required: true, message: '故障发生时间不能为空', trigger: 'blur' }],
|
||||
bind: {
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
'value-format': 'timestamp',
|
||||
// 'value-format': 'yyyy-MM-dd HH:mm:ss',
|
||||
clearable: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
select: true,
|
||||
label: '故障级别',
|
||||
prop: 'faultLevel', // 数据字典
|
||||
options: this.getDictDatas(this.DICT_TYPE.FAULT_LEVEL),
|
||||
},
|
||||
],
|
||||
],
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
@ -262,6 +196,7 @@ export default {
|
||||
maintenanceResult: null,
|
||||
createTime: null,
|
||||
equipmentId: null,
|
||||
special: false
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -387,7 +322,10 @@ export default {
|
||||
// }
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
this.put(this.form).then((response) => {
|
||||
this.put({
|
||||
...this.form,
|
||||
repairman: this.form.repairman.join(',')
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('修改成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
@ -395,7 +333,10 @@ export default {
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
this.post(this.form).then((response) => {
|
||||
this.post({
|
||||
...this.form,
|
||||
repairman: this.form.repairman.join(',')
|
||||
}).then((response) => {
|
||||
this.$modal.msgSuccess('新增成功');
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
@ -44,7 +44,7 @@
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">加工平方数(平方米)</div>
|
||||
<div class="lightTip">{{orderGroupMsg.actualArea}}</div>
|
||||
<div class="lightTip">{{orderGroupMsg.planArea}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">状态</div>
|
||||
@ -70,7 +70,7 @@
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">废片数量</div>
|
||||
<div class="lightTip">该字段未绑定</div>
|
||||
<div class="lightTip">{{orderGroupMsg.nokQuantity}}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -114,7 +114,7 @@
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">加工平方数(平方米)</div>
|
||||
<div class="lightTip">{{item.actualArea}}</div>
|
||||
<div class="lightTip">{{item.planArea}}</div>
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">预计用时(时)</div>
|
||||
@ -144,7 +144,7 @@
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">废片数量</div>
|
||||
<div class="lightTip">该字段未绑定</div>
|
||||
<div class="lightTip">{{item.nokQuantity}}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@ -247,7 +247,7 @@ export default {
|
||||
orderGroupId: '',
|
||||
tableProps,
|
||||
orderMsg: [],
|
||||
tableH: this.tableHeight(510) / 2,
|
||||
tableH: 150,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
@ -257,9 +257,6 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = this.tableHeight(510) / 2
|
||||
})
|
||||
this.orderGroupId = location.href.split('?')[1].split('=')[1]
|
||||
this.getMsg()
|
||||
},
|
||||
|
@ -202,8 +202,8 @@ export default {
|
||||
processFlowList: [],
|
||||
productLineList: [],
|
||||
workOrderTypeList: [
|
||||
{id: 1,name:'标准工单'},
|
||||
{id: 2, name:'特殊工单'}
|
||||
{id: 1,name:'普通'},
|
||||
{id: 2, name:'特殊'}
|
||||
],
|
||||
planStartTime: '',
|
||||
planFinishTime: '',
|
||||
@ -291,12 +291,12 @@ export default {
|
||||
_this.$modal.msgSuccess("操作成功")
|
||||
let name = this.form.name
|
||||
_this.$emit('addWorkOrderSubmit')
|
||||
// 询问是否添加预使用主原料
|
||||
_this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
||||
_this.$router.push({
|
||||
path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
||||
})
|
||||
})
|
||||
// // 询问是否添加预使用主原料
|
||||
// _this.$modal.confirm('是否添加预使用主原料信息?').then(function() {
|
||||
// _this.$router.push({
|
||||
// path: '/core/core-work-order?workOrderName='+encodeURI(name)
|
||||
// })
|
||||
// })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
@ -401,9 +401,9 @@ export default {
|
||||
},
|
||||
// 完成,终止,作废
|
||||
handleEditStatus(val, tip, status) {
|
||||
console.log(val)
|
||||
let _this = this
|
||||
if (val.workOrderNum > 0) {//有下级工单
|
||||
this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
|
||||
_this.$confirm('是否将"'+tip+'"操作同步至下级工单?','确认信息', {
|
||||
type: 'warning',
|
||||
distinguishCancelAndClose: true,
|
||||
confirmButtonText: '同步',
|
||||
@ -411,26 +411,26 @@ export default {
|
||||
}).then(function() {
|
||||
console.log('同步')
|
||||
orderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}).catch(action => {
|
||||
if (action === 'cancel') {
|
||||
console.log('不同步')
|
||||
orderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
})
|
||||
}else {
|
||||
return console.log('关闭')
|
||||
}
|
||||
})
|
||||
}else{// 无下级工单
|
||||
this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
|
||||
_this.$modal.confirm('是否确认"'+tip+'"厂务订单名称为"' + val.name + '"的数据项?').then(function() {
|
||||
return orderStatusSet({ id: val.id, status: status})
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("操作成功");
|
||||
_this.getList();
|
||||
_this.$modal.msgSuccess("操作成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
},
|
||||
|
@ -74,7 +74,7 @@
|
||||
</el-col>
|
||||
<el-col :span='4'>
|
||||
<div class="blodTip">废片数量</div>
|
||||
<div class="lightTip">该字段未绑定</div>
|
||||
<div class="lightTip">{{orderMsg.nokQuantity}}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user