Compare commits

..

No commits in common. "e509722ac44b528362a6caa82ee38b326c8b81cb" and "7c8c584837c1af2baa323cd51c1e44268772928a" have entirely different histories.

41 changed files with 383 additions and 1195 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-03-01 20:40:47 # @LastEditTime: 2024-02-29 15:53:50
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###

View File

@ -87,7 +87,6 @@ const user = {
// 获取用户信息 // 获取用户信息
GetInfo({ commit, state }) { GetInfo({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log('GetInfo')
getInfo().then(res => { getInfo().then(res => {
// 没有 data 数据,赋予个默认值 // 没有 data 数据,赋予个默认值
if (!res) { if (!res) {
@ -97,7 +96,7 @@ const user = {
user: { user: {
id: '', id: '',
avatar: '', avatar: '',
username: '', userName: '',
nickname: '' nickname: ''
} }
} }
@ -114,7 +113,7 @@ const user = {
commit('SET_ROLES', ['ROLE_DEFAULT']) commit('SET_ROLES', ['ROLE_DEFAULT'])
} }
commit('SET_ID', user.id) commit('SET_ID', user.id)
// commit('SET_NAME', user.username) //无效调用接口未提供username值 commit('SET_NAME', user.userName)
commit('SET_NICKNAME', user.nickname) commit('SET_NICKNAME', user.nickname)
commit('SET_AVATAR', avatar) commit('SET_AVATAR', avatar)
resolve(res) resolve(res)

View File

@ -1,4 +0,0 @@
import { getDictData } from './dict';
export const groupConnectWorkshop = (groupName, workshopValue) =>
`${groupName} - ${getDictData('workshop', workshopValue)?.label}`;

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-07-19 15:18:30 * @Date: 2021-07-19 15:18:30
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-02-29 15:48:47 * @LastEditTime: 2024-02-23 16:11:33
* @Description: * @Description:
--> -->
<template> <template>
@ -715,7 +715,6 @@ export default {
qualityMonthTableProps, qualityMonthTableProps,
modelMonth: '', modelMonth: '',
qualityList1, qualityList1,
// logoutTime: 43200000,
qualityTableProps2, qualityTableProps2,
qualityList2, qualityList2,
dateType: '0', dateType: '0',

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-29 16:50:26 * @Date: 2024-01-29 16:50:26
* @LastEditTime: 2024-02-29 15:48:11 * @LastEditTime: 2024-02-23 16:11:40
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -341,9 +341,7 @@ export default {
// offsetWidth: null, // offsetWidth: null,
cxNameList, cxNameList,
cxDataList, cxDataList,
// time:12,
cutProps, cutProps,
// logoutTime: 43200000,
cutTableDataList:[], cutTableDataList:[],
clientWidth: 0, clientWidth: 0,
containerWidth: 111111, containerWidth: 111111,
@ -434,15 +432,36 @@ export default {
this.beilv2 = _this.clientWidth / 1920 this.beilv2 = _this.clientWidth / 1920
})() })()
} }
// logoutInterval = setInterval(() => { // let obj = {
// this.logoutTime -= 1000 // 'a': 11111,
// }, 1000) // 'b': 22222,
// if (this.logoutTime === 0) { // 'c': 33333,
// this.SJGInitWebSocket() // 'd': 44444,
// this.CutInitWebSocket() // 'e': 55555,
// this.funInitWebSocket()
// this.logoutTimeReset()
// } // }
// let index = 0
// for (let i in obj) {
// index++,
// console.log(index);
// }
// this.getList()
// const _this = this;
// window.onresize = () => {
// return (() => {
// _this.clientWidth = `${document.documentElement.clientWidth}`
// this.beilv2 = _this.clientWidth / 1920
// })()
// }
// this.beilv2 = window.innerWidth / 1920
// addEventListener('resize', resizeFun = () => {
// this.beilv2 = window.innerWidth / 1920
// })
// erd.listenTo(document, (element) => {
// this.beilv2 = element.offsetWidth / 1920
// // var width = element.offsetWidth;
// // var height = element.offsetHeight;
// });
}, },
// beforeDestroy() { // beforeDestroy() {
// // // //
@ -450,16 +469,13 @@ export default {
// removeEventListener('resize', resizeFun) // removeEventListener('resize', resizeFun)
// }, // },
methods: { methods: {
// logoutTimeReset() {
// this.logoutTime = this.time * 60 * 60 * 1000
// },
CutWebsocketClose(e) { CutWebsocketClose(e) {
console.log('WebSocket 断开连接', e) console.log('WebSocket 断开连接', e)
}, },
SJGWebsocketClose(e) { SJGWebsocketClose(e) {
console.log('WebSocket 断开连接', e) console.log('WebSocket 断开连接', e)
}, },
funWebSocketClose(e) { funInitWebSocket(e) {
console.log('WebSocket 断开连接', e) console.log('WebSocket 断开连接', e)
}, },
formatTime(time, option) { formatTime(time, option) {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-01 19:52:55 * @LastEditTime: 2024-02-18 13:53:09
* @Description: * @Description:
--> -->
<template> <template>
@ -33,13 +33,14 @@
<el-select <el-select
v-model="dataForm.roomNameDict" v-model="dataForm.roomNameDict"
filterable filterable
:disabled="isdetail || isedit"
style="width: 100%" style="width: 100%"
placeholder="请选择车间名称"> placeholder="请选择车间名称">
<el-option <el-option
v-for="(dict, index) in getDictDatas('workshop')" v-for="(dict, index) in getDictDatas('workshop')"
:key="index" :key="index"
:label="dict.label" :label="dict.label"
:value="Number(dict.value)" /> :value="dict.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -124,26 +125,6 @@ export default {
this.getDict() this.getDict()
}, },
methods: { methods: {
init(id) {
this.dataForm.id = id || "";
this.visible = true;
if (this.urlOptions.getOption) {
this.getArr()
}
this.$nextTick(() => {
this.$refs["dataForm"].resetFields();
if (this.dataForm.id) {
this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data
// this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
async getDict() { async getDict() {
// //
const factoryRes = await getFactoryList(); const factoryRes = await getFactoryList();

View File

@ -38,7 +38,7 @@
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
import { getworkerAll } from '@/api/base/materialUseLog'; import { getworkerAll } from '@/api/base/materialUseLog';
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import DialogForm from './DialogForm'; import DialogForm from '@/components/DialogForm';
export default { export default {
name: 'AlarmHandle', name: 'AlarmHandle',

View File

@ -1,520 +0,0 @@
<!--
filename: dialogForm.vue
author: liubin
date: 2023-08-15 10:32:36
description: 弹窗的表单组件
-->
<template>
<el-form
ref="form"
:model="form"
:label-width="`${labelWidth}px`"
:size="size"
:label-position="labelPosition"
v-loading="formLoading">
<el-row :gutter="20" v-for="(row, rindex) in rows" :key="rindex">
<el-col v-for="col in row" :key="col.label" :span="24 / row.length">
<el-form-item :label="col.label" :prop="col.prop" :rules="col.rules">
<el-input
v-if="col.input"
v-model="form[col.prop]"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
:disabled="disabled"
v-bind="col.bind" />
<el-input
v-if="col.textarea"
type="textarea"
v-model="form[col.prop]"
:disabled="disabled"
@change="$emit('update', form)"
:placeholder="`请输入${col.label}`"
v-bind="col.bind" />
<el-select
v-if="col.select"
v-model="form[col.prop]"
:placeholder="`请选择${col.label}`"
:disabled="disabled"
@change="$emit('update', form)"
v-bind="col.bind">
<el-option
v-for="opt in optionListOf[col.prop]"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
<el-date-picker
v-if="col.datetime"
v-model="form[col.prop]"
type="datetime"
:disabled="disabled"
:placeholder="`请选择${col.label}`"
value-format="timestamp"
@change="$emit('update', form)"
v-bind="col.bind"></el-date-picker>
<el-switch
v-if="col.switch"
v-model="form[col.prop]"
:disabled="disabled"
active-color="#0b58ff"
inactive-color="#e1e1e1"
@change="$emit('update', form)"
v-bind="col.bind"></el-switch>
<component
v-if="col.subcomponent"
:key="col.key"
:disabled="disabled"
:read-only="disabled"
:is="col.subcomponent"
v-model="form[col.prop]"
:inlineStyle="col.style"
@on-change="$emit('update', form)"
v-bind="col.bind"></component>
<div
class="upload-area"
:class="uploadOpen ? '' : 'height-48'"
ref="uploadArea"
:key="col.prop"
v-if="col.upload">
<span class="close-icon" :class="uploadOpen ? 'open' : ''">
<el-button
type="text"
icon="el-icon-arrow-right"
@click="handleFilesOpen" />
</span>
<!-- :file-list="uploadedFileList" -->
<el-upload
v-if="col.upload"
class="upload-in-dialog"
:key="col.prop + '__el-upload'"
: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, col.prop);
}
"
v-bind="col.bind">
<el-button
size="mini"
:disabled="disabled || col.bind?.disabled || false">
<svg-icon
icon-class="icon-upload"
style="color: inherit"></svg-icon>
上传文件
</el-button>
<div class="el-upload__tip" slot="tip" v-if="col.uploadTips">
{{ col.uploadTips || '只能上传jpg/png文件, 大小不超过2MB' }}
</div>
</el-upload>
<uploadedFile
class="file"
v-for="file in form[col.prop]"
:file="file"
:key="file.fileUrl"
:disabled="disabled"
@delete="!disabled && handleDeleteFile(file, col.prop)" />
</div>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getAccessToken } from '@/utils/auth';
import tupleImg from '@/assets/images/tuple.png';
import cache from '@/utils/cache';
/**
* 找到最长的label
* @param {*} options
*/
function findMaxLabelWidth(rows) {
let max = 0;
rows.forEach((row) => {
row.forEach((opt) => {
// debugger;
if (!opt.label) return 0;
if (opt.label.length > max) {
max = opt.label.length;
if (opt.label.includes('(')) {
max = max - 3;
}
}
});
});
return max;
}
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: { uploadedFile },
props: {
rows: {
type: Array,
default: () => [],
},
dataForm: {
type: Object,
default: () => ({}),
},
disabled: {
type: Boolean,
default: false,
},
hasFiles: {
type: Boolean | Array,
default: false,
},
labelPosition: {
type: String,
default: 'right',
},
size: {
type: String,
default: '',
},
},
data() {
return {
uploadOpen: false,
form: {},
formLoading: true,
optionListOf: {},
uploadedFileList: [],
dataLoaded: false,
uploadHeaders: { Authorization: 'Bearer ' + getAccessToken() },
uploadUrl: process.env.VUE_APP_BASE_API + '/admin-api/infra/file/upload', // headersurl
};
},
computed: {
labelWidth() {
let max = findMaxLabelWidth(this.rows);
// 20px
return max * 20;
// return max * 20 + 'px';
},
},
watch: {
rows: {
handler() {
this.$nextTick(() => {
this.handleOptions('watch');
});
},
deep: true,
immediate: false,
},
dataForm: {
handler(val) {
this.form = JSON.parse(JSON.stringify(val));
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() {
// options
this.handleOptions();
},
methods: {
/** 模拟透传 ref */
validate(cb) {
return this.$refs.form.validate(cb);
},
resetFields(args) {
return this.$refs.form.resetFields(args);
},
// getCode
async getCode(url) {
const response = await this.$axios(url);
return response.data;
},
async handleOptions(trigger = 'monuted') {
console.log('[dialogForm:handleOptions]');
const promiseList = [];
this.rows.forEach((cols) => {
cols.forEach((opt) => {
if (opt.value && !this.form[opt.prop]) {
//
this.form[opt.prop] = opt.value;
}
if (opt.options) {
this.$set(this.optionListOf, opt.prop, opt.options);
} else if (opt.url) {
// dependswatcher
if (opt.depends) {
this.$watch(
() => this.form[opt.depends],
(id) => {
console.log('<', opt.depends, '>', 'changed', id);
if (id == null) return;
//
this.form[opt.prop] = null;
//
this.$axios({
url: `${opt.url}?id=${id}`,
}).then((res) => {
this.$set(
this.optionListOf,
opt.prop,
res.data.map((item) => ({
label: item[opt.labelKey ?? 'name'],
value: item[opt.valueKey ?? 'id'],
}))
);
});
},
{
immediate: false,
}
);
return;
}
//
if (opt.select || (opt.input && !this.form?.id)) {
promiseList.push(async () => {
const response = await this.$axios(opt.url, {
method: opt.method ?? 'get',
// data: opt.method == 'post' ? opt.queryParams : null
});
// console.log('[dialogForm:handleOptions:response]', response);
if (opt.select) {
//
const list =
'list' in response.data
? response.data.list
: response.data;
if (opt.cache) {
cache.store(opt.cache, list);
}
this.$set(
this.optionListOf,
opt.prop,
list.map((item) => ({
label: item[opt.labelKey ?? 'name'],
value: item[opt.valueKey ?? 'id'],
}))
);
} else if (opt.input) {
console.log('setting code: ', response.data);
//
this.form[opt.prop] = response.data;
// dataFormcodebug
this.$emit('update', this.form);
}
});
}
}
});
});
console.log('[dialogForm:handleOptions] done!');
// watch
if (trigger == 'watch') {
this.formLoading = false;
return;
}
try {
await Promise.all(promiseList.map((fn) => fn()));
this.formLoading = false;
this.dataLoaded = true;
// console.log("[dialogForm:handleOptions:optionListOf]", this.optionListOf)
} catch (error) {
console.log('[dialogForm:handleOptions:error]', error);
this.formLoading = false;
}
if (!promiseList.length) this.formLoading = false;
},
//
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();
return checkFileSize();
},
// bind
handleUploadSuccess(response, file, prop) {
console.log('[handleUploadSuccess]', response, file, prop);
this.form[prop].push({
fileName: file.name,
fileUrl: response.data,
fileType: prop == 'files' ? 2 : 1,
});
this.$modal.msgSuccess('上传成功');
this.$emit('update', this.form);
},
getFileName(fileUrl) {
return fileUrl.split('/').pop();
},
handleFilesOpen() {
this.uploadOpen = !this.uploadOpen;
},
handleDeleteFile(file, prop) {
this.form[prop] = this.form[prop].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 {
// background: #ccc;
// display: grid;
// grid-auto-rows: 34px;
// grid-template-columns: repeat(6, minmax(32px, max-content));
// gap: 8px;
// align-items: center;
position: relative;
overflow: hidden;
transition: height 0.3s ease-out;
}
.upload-in-dialog {
// display: inline-block;
margin-right: 24px;
// background: #ccc;
position: relative;
// top: -13px;
float: left;
}
.close-icon {
// background: #ccc;
position: absolute;
top: 0;
right: 12px;
z-index: 100;
transition: transform 0.3s ease-out;
}
.close-icon.open {
transform: rotateZ(90deg);
}
</style>
<style>
.dialog__upload_component__close {
color: #ccc;
}
.dialog__upload_component__close:hover {
/* color: #777; */
color: red;
}
.height-48 {
height: 35px !important;
}
</style>

View File

@ -218,9 +218,9 @@ export default {
label: '是否采集', // 0 , 1 label: '是否采集', // 0 , 1
prop: 'collection', prop: 'collection',
bind: { bind: {
'active-value': 1, 'active-value': 1,
'inactive-value': 0, 'inactive-value': 0,
value: 1, value: 1,
}, },
}, },
], ],
@ -294,7 +294,7 @@ export default {
name: undefined, name: undefined,
enName: undefined, enName: undefined,
description: undefined, description: undefined,
collection: 1, collection: undefined,
}; };
this.resetForm('form'); this.resetForm('form');
}, },

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-01 18:57:31 * @LastEditTime: 2024-02-29 14:59:28
* @Description: * @Description:
--> -->
<template> <template>
@ -78,7 +78,7 @@
v-for="opt in inspectorOptions" v-for="opt in inspectorOptions"
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.label" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -418,7 +418,7 @@ export default {
}); });
}, },
getConfirmed() { getConfirmed() {
return this.$confirm('是否直接确认巡检', '提示', { return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -431,16 +431,10 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
this.getConfirmed().then(confirm => { this.getConfirmed().then(confirm => {
let checkPersonParam = '';
if (!this.dataForm.checkPerson || this.dataForm.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
} else {
checkPersonParam = `&checkPerson=${this.dataForm.checkPerson}`
}
this.$axios({ this.$axios({
url: url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam, '/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
method: 'put', method: 'put',
data: [this.dataForm.id], data: [this.dataForm.id],
}).then(res =>{ }).then(res =>{

View File

@ -179,13 +179,8 @@ export default {
this.$modal this.$modal
.confirm('是否确认所有选中巡检单"?') .confirm('是否确认所有选中巡检单"?')
.then(() => { .then(() => {
let checkPersonParam = '';
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
return this.$axios({ return this.$axios({
url: `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + checkPersonParam, url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId,
method: 'put', method: 'put',
data: this.$refs['waiting-list-table'].selectedPlan.map( data: this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id (item) => item.id
@ -399,17 +394,11 @@ export default {
this.$modal this.$modal
.confirm('是否确认巡检单"' + row.name + '"?') .confirm('是否确认巡检单"' + row.name + '"?')
.then(() => { .then(() => {
let checkPersonParam = '';
const nickname = this.$store.getters.nickname;
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${nickname}`;
} else {
checkPersonParam = `&checkPerson=${row.checkPerson}`
}
return this.$axios({ return this.$axios({
url: url:
`/base/equipment-check-order/confirm?confirmPerson=${nickname}` + checkPersonParam, '/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put', method: 'put',
data: [row.id], data: [row.id],
}); });

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2021-11-18 14:16:25 * @Date: 2021-11-18 14:16:25
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-03-01 19:44:59 * @LastEditTime: 2024-02-29 14:58:37
* @Description: * @Description:
--> -->
<template> <template>
@ -11,7 +11,7 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="150px"> label-width="120px">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="巡检单名称" prop="name"> <el-form-item label="巡检单名称" prop="name">
@ -27,6 +27,8 @@
placeholder="请输入巡检单编码" /> placeholder="请输入巡检单编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="部门" label="部门"
@ -55,13 +57,8 @@
style="width: 100%" /> style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> </el-row>
<el-form-item label="巡检频率(天/次)" prop="checkPeriod"> <el-row :gutter="20">
<el-input
v-model="dataForm.checkPeriod"
placeholder="请输入巡检频率(天/次)" />
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit"> <el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-input <el-input
@ -86,6 +83,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" /> <el-input v-model="dataForm.remark" placeholder="请输入备注" />
@ -122,8 +121,7 @@ export default {
planCheckTime: null, planCheckTime: null,
confirmTimeLimit: null, confirmTimeLimit: null,
groupClass: null, groupClass: null,
remark: null, remark: null
checkPeriod: null
}, },
groupOptions: [], groupOptions: [],
departmentOptions: [], departmentOptions: [],
@ -139,15 +137,6 @@ export default {
], ],
planCheckTime: [ planCheckTime: [
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' } { required: true, message: '计划巡检时间不能为空', trigger: 'blur' }
],
checkPeriod: [
{ required: true, message: '巡检频率不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字类型',
trigger: 'blur',
transform: (val) => Number(val),
}
] ]
} }
}; };

View File

@ -160,7 +160,6 @@ import Editor from "@/components/Editor";
import { getDictDatas } from "@/utils/dict"; import { getDictDatas } from "@/utils/dict";
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import { getDictDataLabel } from '@/utils/dict'; import { getDictDataLabel } from '@/utils/dict';
import tupleImg from '@/assets/images/tuple.png';
const uploadedFile = { const uploadedFile = {
name: 'UploadedFile', name: 'UploadedFile',

View File

@ -29,7 +29,7 @@
</el-col> </el-col>
<!-- 产线名 --> <!-- 产线名 -->
<!-- <el-col :span="8"> <el-col :span="8">
<el-form-item label="产线名" prop="lineId"> <el-form-item label="产线名" prop="lineId">
<el-select <el-select
v-model="formFilters.lineId" v-model="formFilters.lineId"
@ -45,10 +45,10 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<!-- 工段名 --> <!-- 工段名 -->
<!-- <el-col :span="8"> <el-col :span="8">
<el-form-item label="工段名" prop="sectionId"> <el-form-item label="工段名" prop="sectionId">
<el-select <el-select
v-model="formFilters.sectionId" v-model="formFilters.sectionId"
@ -64,7 +64,7 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<!-- 设备名称 --> <!-- 设备名称 -->
<el-col :span="8"> <el-col :span="8">
@ -234,7 +234,7 @@
v-for="opt in workerOptions" v-for="opt in workerOptions"
:key="opt.value" :key="opt.value"
:label="opt.label" :label="opt.label"
:value="opt.label" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -597,9 +597,9 @@ export default {
/** 设置默认维修工为用户自己 */ /** 设置默认维修工为用户自己 */
setInitWorker() { setInitWorker() {
/** 获取用户自身id */ /** 获取用户自身id */
const nickname = this.$store.getters.nickname; const userId = this.$store.getters.userId;
this.$nextTick(() => { this.$nextTick(() => {
this.form.repairman = [nickname]; this.form.repairman = [userId];
}); });
}, },
@ -630,8 +630,8 @@ export default {
/** 获取设备 */ /** 获取设备 */
async initEquipment() { async initEquipment() {
const response = await this.$axios('/base/core-equipment/listAll'); const response = await this.$axios('/base/core-equipment/listAll');
this.equipmentList = response.data.filter(item => item.special === false) || []; this.equipmentList = response.data || [];
this.equipmentOptions = response.data.filter(item => item.special === false) || []; this.equipmentOptions = response.data || [];
// this.allSpeicalEquipments = equipmentOptions; // this.allSpeicalEquipments = equipmentOptions;
}, },
/** 获取维修工 - 同时从用户表和员工表拉取数据 */ /** 获取维修工 - 同时从用户表和员工表拉取数据 */
@ -737,7 +737,6 @@ export default {
fileType: prop == 'files' ? 2 : 1, fileType: prop == 'files' ? 2 : 1,
}); });
this.$modal.msgSuccess('上传成功'); this.$modal.msgSuccess('上传成功');
console.log('为我', this.form.files)
this.$emit('update', this.form); this.$emit('update', this.form);
}, },

View File

@ -136,11 +136,11 @@ export default {
params.teamId = val.data.id params.teamId = val.data.id
params.teamName = val.data.name params.teamName = val.data.name
this.workOrderList.map(item => { this.workOrderList.map(item => {
if (val.data.workOrderId === item.id) { if (this.queryParams.workOrderId === item.id) {
this.workOrderName = item.name this.workOrderName = item.name
} }
}) })
params.workOrderId = val.data.workOrderId params.workOrderId = this.queryParams.workOrderId
params.workOrderName = this.workOrderName params.workOrderName = this.workOrderName
params.roomNameDict = val.data.roomNameDict params.roomNameDict = val.data.roomNameDict
this.$nextTick(() => { this.$nextTick(() => {

View File

@ -1,97 +0,0 @@
<template>
<el-form :inline="true" class="demo-form-inline">
<span class="blue-block"></span>
<el-form-item label="班次信息">
<el-select v-model="queryParams.classesId" placeholder="班次信息" style="width: 200px;" size="small" clearable>
<el-option
v-for="item in classesArr"
:key="item.id"
:label="(item.roomName?item.roomName:'')+'-'+item.name"
:value="item.id">
<span>{{ item.roomName }}-{{item.name}}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="班组信息">
<el-input v-model="queryParams.teamName" placeholder="班组信息" style="width: 200px;" clearable></el-input>
</el-form-item>
<el-form-item label="上班时间">
<el-date-picker
v-model="queryParams.tiemStr"
type="daterange"
format='yyyy-MM-dd'
value-format='yyyy-MM-dd'
range-separator='-'
style="width: 250px;"
size="small">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="search">查询</el-button>
</el-form-item>
</el-form>
</template>
<script>
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
export default {
name: 'searchArea',
data() {
return {
//
queryParams: {
classesId: '',
teamName: '',
tiemStr: ''
},
classesArr: [],
}
},
mounted() {
this.getGroupClass()
},
methods: {
getGroupClass() {
groupClassesListAll().then(res => {
this.classesArr = res.data || []
})
},
//
search() {
console.log(this.queryParams)
this.$emit('submit', this.queryParams)
}
}
}
</script>
<style lang="scss">
.demo-form-inline {
.el-date-editor .el-range__icon {
font-size: 16px;
color: #0B58FF;
}
.el-input__prefix .el-icon-date {
font-size: 16px;
color: #0B58FF;
}
}
</style>
<style lang="scss" scoped>
.separateStyle {
display: inline-block;
width: 1px;
height: 24px;
background: #E8E8E8;
vertical-align: middle;
}
.demo-form-inline {
.blue-block {
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
margin-top: 10px;
}
}
</style>

View File

@ -1,12 +1,11 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-area @submit="buttonClick"/> <search-bar
<!-- <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick"
/> --> />
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
:page="queryParams.pageNo" :page="queryParams.pageNo"
@ -35,11 +34,10 @@
</div> </div>
</template> </template>
<script> <script>
import { groupTeamSchedulingPage } from '@/api/monitoring/teamProduction' import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/teamProduction'
import { parseTime } from '@/utils/ruoyi' import { parseTime } from '@/utils/ruoyi'
import TeamProductionDetail from './components/teamProductionDetail' import TeamProductionDetail from './components/teamProductionDetail'
import { publicFormatter } from '@/utils/dict' import { publicFormatter } from '@/utils/dict'
import SearchArea from './components/searchArea'
const tableProps = [ const tableProps = [
{ {
prop: 'roomNameDict', prop: 'roomNameDict',
@ -141,11 +139,12 @@ export default {
paramVisible: false paramVisible: false
} }
}, },
components: { TeamProductionDetail, SearchArea }, components: { TeamProductionDetail },
mounted() { mounted() {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.tableH = this.tableHeight(260) this.tableH = this.tableHeight(260)
}) })
this.getGroupClass()
this.getList() this.getList()
}, },
methods: { methods: {
@ -164,6 +163,11 @@ export default {
this.total = res.data.total || 0 this.total = res.data.total || 0
}) })
}, },
getGroupClass() {
groupClassesListAll().then(res => {
this.formConfig[0].selectOptions = res.data || []
})
},
handleClick(val) { handleClick(val) {
console.log(val) console.log(val)
this.paramVisible = true this.paramVisible = true

View File

@ -236,8 +236,13 @@ export default {
btnName: '终止', btnName: '终止',
showTip: '终止', showTip: '终止',
showParam: { showParam: {
type: '&', type: '|',
data: [ data: [
{
type: 'equal',
name: 'status',
value: 2
},
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',

View File

@ -175,38 +175,16 @@ export default {
} }
if (this.isEdit) { if (this.isEdit) {
// //
orderUpdate({ orderUpdate({ ...this.form }).then((res) => {
code: this.form.code,
name: this.form.name,
planQuantity: this.form.planQuantity,
planProductId: this.form.planProductId,
priority: this.form.priority,
planStartTime: this.form.planStartTime,
planFinishTime: this.form.planFinishTime,
remark: this.form.remark,
id: this.form.id,
specifications: this.form.specifications
}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit') this.$emit('successSubmit')
} }
}) })
} else { } else {
orderCreate({ this.form.status = 1
code: this.form.code, this.form.triggerOrigin = 1
name: this.form.name, orderCreate({ ...this.form }).then((res) => {
planQuantity: this.form.planQuantity,
planProductId: this.form.planProductId,
priority: this.form.priority,
planStartTime: this.form.planStartTime,
planFinishTime: this.form.planFinishTime,
remark: this.form.remark,
id: this.form.id,
specifications: this.form.specifications,
status: 1,
triggerOrigin: 1
}).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$modal.msgSuccess("操作成功"); this.$modal.msgSuccess("操作成功");
this.$emit('successSubmit') this.$emit('successSubmit')

View File

@ -244,15 +244,20 @@ export default {
btnName: '终止', btnName: '终止',
showTip: '终止', showTip: '终止',
showParam: { showParam: {
type: '&', type: '|',
data: [ data: [
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 3 value: 2
} },
] {
} type: 'equal',
name: 'status',
value: 3
}
]
}
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:cancel') this.$auth.hasPermi('base:order-manage:cancel')

View File

@ -51,16 +51,8 @@ export default {
label: '用户名称', label: '用户名称',
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'name', valueField: 'id',
param: 'userName', param: 'userName',
},
{
type: 'select',
label: '用户昵称',
selectOptions: [],
labelField: 'name',
valueField: 'name',
param: 'nickName',
}, },
{ {
type: 'button', type: 'button',
@ -151,16 +143,10 @@ export default {
}).then((res) => { }).then((res) => {
this.searchBarFormConfig[0].selectOptions = res.data.map((item) => { this.searchBarFormConfig[0].selectOptions = res.data.map((item) => {
return { return {
id: item.username, id: item.id,
name:item.username name:item.username
} }
}) })
this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
return {
id: item.nickname,
name: item.nickname
}
})
}) })
}, },
getDataList() { getDataList() {
@ -220,9 +206,7 @@ export default {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10; this.listQuery.pageSize = 10;
this.listQuery.userName = val.userName ? val.userName : undefined; this.listQuery.inspectionDetContent = val.inspectionDetContent ? val.inspectionDetContent : undefined;
this.listQuery.nickName = val.nickName ? val.nickName : undefined;
// this.listQuery.teamId = val.teamId ? val.teamId : undefined; // this.listQuery.teamId = val.teamId ? val.teamId : undefined;
this.getDataList() this.getDataList()
break; break;

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-08 13:46:17 * @Date: 2023-12-08 13:46:17
* @LastEditTime: 2024-03-01 15:22:06 * @LastEditTime: 2024-01-22 15:29:53
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -80,9 +80,8 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item :prop="'checkValueList.' + index + '.checkValue'" label="成分含量" <el-form-item :prop="'checkValueList.' + index + '.checkValue'" label="成分含量"
:rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]"> :rules="[{ required: true, message: '成分含量不能为空', trigger: 'blur' }]">
<el-input oninput="value=value.replace(/[^\d]/g,'')" :disabled="isdetail" <el-input :disabled="isdetail" style="width: 90%;margin-right: 10px;" :max="item.maxValue"
style="width: 90%;margin-right: 10px;" :max="item.maxValue" :min='item.minValue' :min='item.minValue' v-model="dataForm.checkValueList[index].checkValue"
v-model.number="dataForm.checkValueList[index].checkValue"
@change="judgeValue(arguments[0],item.minValue,item.maxValue,index)"></el-input> @change="judgeValue(arguments[0],item.minValue,item.maxValue,index)"></el-input>
<span v-if="dataForm.checkValueList[index].showIcon"> <span v-if="dataForm.checkValueList[index].showIcon">
<!-- <i class="el-icon-success"></i> --> <!-- <i class="el-icon-success"></i> -->
@ -92,12 +91,14 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最小值"> <el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最小值"
>
<el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.minValue"></el-input> <el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.minValue"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最大值"> <el-form-item :prop="'checkValueList.' + index + '.minValue'" label="最大值"
>
<el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.maxValue"></el-input> <el-input disabled style="width: 90%;margin-right: 10px;" v-model="item.maxValue"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-03-01 10:33:48 * @LastEditTime: 2024-02-28 09:58:34
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -130,7 +130,7 @@ export default {
mounted() { mounted() {
this.getDict() this.getDict()
console.log('我看看', this.dataForm) console.log('我看看', this.dataForm)
// this.getCurrentTime() this.getCurrentTime()
this.getWorksectionById() this.getWorksectionById()
}, },
methods: { methods: {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-03-01 10:18:39 * @LastEditTime: 2024-02-28 10:13:10
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -75,7 +75,7 @@
</template> </template>
<script> <script>
import basicAdd from './basic-add'; import basicAdd from '../../../core/mixins/basic-add';
import { import {
createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList, createQualityScrapLog, updateQualityScrapLog, getQualityScrapLog, getWorkOrderList,
getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog"; getTeamList, getDetList,getLineList } from "@/api/base/qualityScrapLog";
@ -151,8 +151,8 @@ export default {
// this.dataForm.logTime = year + "-" + month + "-" + day; // this.dataForm.logTime = year + "-" + month + "-" + day;
console.log(this.dataForm.logTime); console.log(this.dataForm.logTime);
}, },
async getDict() { async getDict() {
// //
const res = await getList() const res = await getList()
this.typeList = res.data this.typeList = res.data
getWorkOrderList().then((res) => { getWorkOrderList().then((res) => {
@ -182,15 +182,16 @@ export default {
getDetList().then((res) => { getDetList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
this.detList = res.data.map((item) => { this.workOrderList = res.data.map((item) => {
return { return {
name: item.content, name: item.name,
id: item.id id: item.id
} }
}) })
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}) })
getTeamList().then((res) => { getTeamList().then((res) => {
console.log(res); console.log(res);
// console.log(response); // console.log(response);
@ -200,12 +201,29 @@ export default {
id: item.id id: item.id
} }
}) })
this.$axios({
url: '/base/core-workshop-section/listAll',
method: 'get',
// params: {
// id: lineId,
// },
}).then((res) => {
// console.log(data)
this.sectionList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
})
// if (code == 0) {
// }
// console.log(this.formConfig[0].selectOptions); // console.log(this.formConfig[0].selectOptions);
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}) })
}, },
async getWorksectionById(lineId) { async getWorksectionById(lineId) {
if (lineId) {
const { code, data } = await this.$axios({ const { code, data } = await this.$axios({
url: '/base/core-workshop-section/listByParentId', url: '/base/core-workshop-section/listByParentId',
method: 'get', method: 'get',
@ -222,24 +240,7 @@ export default {
}; };
}); });
} }
} else { }
this.$axios({
url: '/base/core-workshop-section/listAll',
method: 'get',
// params: {
// id: lineId,
// },
}).then((res) => {
// console.log(data)
this.sectionList = res.data.map((item) => {
return {
name: item.name,
id: item.id,
};
});
})
}
},
}, },
}; };
</script> </script>

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2023-08-01 14:55:51 * @Date: 2023-08-01 14:55:51
* @LastEditors: zhp * @LastEditors: zhp
* @LastEditTime: 2024-03-01 10:27:29 * @LastEditTime: 2024-02-23 09:16:24
* @Description: * @Description:
--> -->
<template> <template>
@ -124,8 +124,8 @@ export default {
label: '工单', label: '工单',
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'name', valueField: 'id',
param: 'workOrderName' param: 'workOrderId'
}, },
// { // {
// type: 'datePicker', // type: 'datePicker',
@ -233,7 +233,7 @@ export default {
buttonClick(val) { buttonClick(val) {
console.log(val) console.log(val)
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.listQuery.workOrderName = val.workOrderName ? val.workOrderName :undefined this.listQuery.workOrderId = val.workOrderId ? val.workOrderId :undefined
// this.queryParams.status = val.status // this.queryParams.status = val.status
// if (val.timeVal && val.timeVal.length != 0 ) { // if (val.timeVal && val.timeVal.length != 0 ) {
// this.listQuery.startTime = val.timeVal[0] + ' 00:00:00' // this.listQuery.startTime = val.timeVal[0] + ' 00:00:00'

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-01 15:26:38 * @LastEditTime: 2024-01-24 16:53:41
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -9,7 +9,7 @@
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item label="日" prop="reportTime"> <el-form-item label="日" prop="reportTime">
<el-date-picker v-model="dataForm.reportTime" @change="changeTime" type="date" placeholder="选择日期"> <el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button type="primary" @click="getDataList()">查询</el-button>

View File

@ -51,7 +51,10 @@
{{ scope.row.planCheckTime | timeFilter }} {{ scope.row.planCheckTime | timeFilter }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="selectedBox[3]" label="班次" prop="groupClass"> <el-table-column
v-if="selectedBox[3]"
label="班次"
prop="groupClass">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.groupClass || '---' }} {{ scope.row.groupClass || '---' }}
</template> </template>
@ -126,7 +129,7 @@ import moment from 'moment';
export default { export default {
name: 'CheckOrderListTable', name: 'CheckOrderListTable',
components: {}, components: {},
props: ['tableData', 'page', 'limit', 'permissionGuard'], props: ['tableData', 'page', 'limit'],
filters: { filters: {
timeFilter: (val) => timeFilter: (val) =>
val ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '---', val ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '---',
@ -167,7 +170,12 @@ export default {
}, },
methods: { methods: {
checkSelectable(row, index) { checkSelectable(row, index) {
return this.permissionGuard(row); return true;
// return (
// row.relatePlan == 2 ||
// (row.relatePlan == 1 &&
// (!row.confirmDueTime || +row.confirmDueTime >= new Date().getTime()))
// );
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectedOrder = val; this.selectedOrder = val;

View File

@ -121,11 +121,6 @@ export default {
showOverflowtooltip: true, showOverflowtooltip: true,
filter: parseTime, filter: parseTime,
}, },
{
prop: 'checkPeriod',
label: '巡检频率(天/次)',
showOverflowtooltip: true,
},
{ {
width: 144, width: 144,
prop: 'confirmTimeLimit', prop: 'confirmTimeLimit',

View File

@ -50,31 +50,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col>
<el-form-item label="巡检人" prop="checkPerson">
<el-select
v-model="dataForm.checkPerson"
:placeholder="`请选择巡检人`"
multiple
clearable
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>
<el-form-item label="巡检时间" prop="planCheckTime">
<el-date-picker
v-model="dataForm.planCheckTime"
type="datetime"
placeholder="请选择计划开始时间"
value-format="timestamp"></el-date-picker>
</el-form-item>
</el-col>
<!-- <el-col> <!-- <el-col>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" /> <el-input v-model="dataForm.remark" placeholder="请输入备注" />
@ -85,8 +60,6 @@
</template> </template>
<script> <script>
import { groupConnectWorkshop } from '@/utils/equipment-module';
export default { export default {
name: 'ContentAdd', name: 'ContentAdd',
data() { data() {
@ -96,9 +69,7 @@ export default {
id: null, id: null,
name: null, name: null,
departmentId: null, departmentId: null,
groupClass: [], groupClass: null,
checkPerson: [],
planCheckTime: null,
// special: true, // special: true,
}, },
dataRule: { dataRule: {
@ -109,7 +80,6 @@ export default {
equipmentOptions: [], equipmentOptions: [],
groupOptions: [], groupOptions: [],
departmentOptions: [], departmentOptions: [],
inspectorOptions: [],
}; };
}, },
mounted() { mounted() {
@ -121,9 +91,7 @@ export default {
id: null, id: null,
name: null, name: null,
departmentId: null, departmentId: null,
groupClass: [], groupClass: null,
checkPerson: [],
planCheckTime: null,
// special: true, // special: true,
}; };
}, },
@ -146,35 +114,10 @@ export default {
} }
if (grp.code == 0) { if (grp.code == 0) {
this.groupOptions = grp.data.map((item) => ({ this.groupOptions = grp.data.map((item) => ({
label: groupConnectWorkshop(item.name, item.roomNameDict), label: item.name,
value: item.id, value: item.id,
})); }));
} }
/** get user list and worker list */
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.nickname,
value: item.nickname,
}))
);
}
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.name,
}))
);
}
this.inspectorOptions = inspectorList;
/** endget */
this.formLoading = false; this.formLoading = false;
} catch (err) { } catch (err) {
this.formLoading = false; this.formLoading = false;
@ -184,8 +127,6 @@ export default {
async init(row) { async init(row) {
if (!row || !row.id) { if (!row || !row.id) {
/** 新增 */
this.dataForm.checkPerson = [this.$store.getters.nickname];
return; return;
} }
const res = await this.$axios({ const res = await this.$axios({
@ -232,8 +173,8 @@ export default {
special: true, special: true,
status: 1, status: 1,
// status: confirmed ? 2 : 1, // status: confirmed ? 2 : 1,
groupClass: this.dataForm.groupClass?.join(','), groupClass: this.dataForm.groupClass.join(','),
checkPerson: this.dataForm.checkPerson?.join(','), checkPerson: this.$store.getters.userId,
}, },
}); });
if (res.code == 0) { if (res.code == 0) {

View File

@ -268,8 +268,8 @@ export default {
} }
}, },
getConfirmed(message = '是否直接确认巡检记录') { getConfirmed() {
return this.$confirm(message, '提示', { return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -281,31 +281,25 @@ export default {
return this.$message.error('请添加巡检内容'); return this.$message.error('请添加巡检内容');
} }
/** 询问 是否保存记录 */ let confirmed = false;
try { try {
if (await this.getConfirmed('是否保存记录')) { confirmed = await this.getConfirmed();
/** 询问 是否直接确认 */ } catch (err) {
try { confirmed = false;
if (await this.getConfirmed('是否直接确认巡检记录')) { }
const res = await this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.nickname,
method: 'put',
data: [this.row.id],
});
if (res.code == 0) {
this.$message.success('已确认');
}
}
this.$emit('refreshDataList'); if (confirmed) {
this.handleCancel(); const res = await this.$axios({
} catch (err) { url:
this.handleCancel(); '/base/equipment-check-order/confirm?confirmPerson=' +
} this.$store.getters.nickname,
method: 'put',
data: [this.row.id],
});
if (res.code == 0) {
this.$message.success('已确认');
} }
} catch (err) {} }
// this.btnLoading = true; // this.btnLoading = true;
// this.$nextTick(async () => { // this.$nextTick(async () => {
@ -325,6 +319,8 @@ export default {
// this.$emit('refreshDataList'); // this.$emit('refreshDataList');
// this.handleCancel(); // this.handleCancel();
// }); // });
this.$emit('refreshDataList');
this.handleCancel();
}, },
handleEmitFun(val) { handleEmitFun(val) {

View File

@ -29,16 +29,7 @@
v-loading="formLoading"> v-loading="formLoading">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="巡检单名称" prop="name">
label="巡检单名称"
prop="name"
:rules="[
{
required: true,
message: '巡检单名称不能为空',
trigger: 'blur',
},
]">
<el-input <el-input
v-model="form.name" v-model="form.name"
:disabled="disableEdit" :disabled="disableEdit"
@ -205,7 +196,6 @@
<script> <script>
import DialogForm from '../../../components/DialogForm/index.vue'; import DialogForm from '../../../components/DialogForm/index.vue';
import { groupConnectWorkshop } from '@/utils/equipment-module';
const SmallTitle = { const SmallTitle = {
name: 'SmallTitle', name: 'SmallTitle',
@ -240,15 +230,7 @@ export default {
return { return {
visible: false, visible: false,
btnLoading: false, btnLoading: false,
form: { form: {},
id: null,
name: null,
departmentId: null,
groupClass: null,
checkPerson: null,
planCheckTime: null,
remark: null,
},
formLoading: false, formLoading: false,
departmentList: [], departmentList: [],
inspectorOptions: [], inspectorOptions: [],
@ -429,41 +411,24 @@ export default {
break; break;
} }
}, },
resetForm() {
this.form = {
id: null,
name: null,
departmentId: null,
groupClass: null,
checkPerson: null,
planCheckTime: null,
remark: null,
};
},
async handleConfirm() { async handleConfirm() {
this.btnLoading = true; this.btnLoading = true;
this.$nextTick(async () => { this.$nextTick(async () => {
try { const { code, data } = await this.$axios({
const valid = await this.$refs['form'].validate(); url: '/base/equipment-check-order/update',
if (!valid) return; method: 'put',
const { code, data } = await this.$axios({ data: {
url: '/base/equipment-check-order/update', ...this.form,
method: 'put', groupClass: this.form.groupClass.join(','),
data: { checkPerson: this.form.checkPerson.join(','),
...this.form, },
groupClass: this.form.groupClass?.join(','), });
checkPerson: this.form.checkPerson?.join(','), if (code == 0) {
}, this.$modal.msgSuccess('更新成功');
});
if (code == 0) {
this.$modal.msgSuccess('更新成功');
}
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
} catch (err) {
this.btnLoading = false;
} }
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
}); });
}, },
@ -480,25 +445,14 @@ export default {
}, },
async getInfo(row) { async getInfo(row) {
this.resetForm(); console.log('row', row);
const res = await this.$axios( const res = await this.$axios(
'/base/equipment-check-order/get?id=' + row.id '/base/equipment-check-order/get?id=' + row.id
); );
if (res.code == 0) { if (res.code == 0) {
Object.keys(this.form).forEach((key) => { this.form = res.data;
if (key == 'groupClass' || key == 'checkPerson') { this.form.groupClass = res.data.groupClass.split(',');
this.form[key] = this.form.checkPerson = res.data.checkPerson?.split(',');
(res.data[key] &&
res.data[key].trim() != '' &&
res.data[key].split(',')) ||
[];
} else {
this.form[key] = res.data[key];
}
});
if (!res.data.checkPerson || res.data.checkPerson.trim() == '') {
this.form.checkPerson = [this.$store.getters.nickname];
}
this.formLoading = false; this.formLoading = false;
} }
this.formLoading = false; this.formLoading = false;
@ -543,8 +497,8 @@ export default {
if (userlist.code == 0) { if (userlist.code == 0) {
inspectorList = inspectorList.concat( inspectorList = inspectorList.concat(
(userlist.data?.list || []).map((item) => ({ (userlist.data?.list || []).map((item) => ({
label: item.nickname, label: item.username,
value: item.nickname, value: item.id,
})) }))
); );
} }
@ -553,7 +507,7 @@ export default {
inspectorList = inspectorList.concat( inspectorList = inspectorList.concat(
workerlist.data.map((item) => ({ workerlist.data.map((item) => ({
label: item.name, label: item.name,
value: item.name, value: item.id,
})) }))
); );
} }
@ -562,7 +516,7 @@ export default {
case 'groupClass': case 'groupClass':
res = await this.$axios(urls[1]); res = await this.$axios(urls[1]);
this.groupOptions = (res.data || []).map((item) => ({ this.groupOptions = (res.data || []).map((item) => ({
label: groupConnectWorkshop(item.name, item.roomNameDict), label: item.name,
value: item.id, value: item.id,
})); }));
break; break;
@ -570,6 +524,22 @@ export default {
this.formLoading = false; 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() { handleCancel() {
this.visible = false; this.visible = false;
}, },

View File

@ -18,7 +18,6 @@
:table-data="list" :table-data="list"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
:permissionGuard="checkConfirmPermission"
@edit="handleEdit" @edit="handleEdit"
@detail="handleDetail" @detail="handleDetail"
@delete="handleDelete" @delete="handleDelete"
@ -178,7 +177,6 @@ export default {
pageSize: 10, pageSize: 10,
name: null, name: null,
status: 1, status: 1,
special: true,
}, },
// //
form: {}, form: {},
@ -257,17 +255,10 @@ export default {
this.$message.warning('请选择待确认的巡检单'); this.$message.warning('请选择待确认的巡检单');
return; return;
} }
let checkPersonParam = ''; const res = await this.$axios({
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
const res = this.$axios({
url: url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + '/base/equipment-check-order/confirm?confirmPerson=' +
checkPersonParam, this.$store.getters.userId,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put', method: 'put',
data: this.$refs['check-order-list-table'].selectedOrder.map( data: this.$refs['check-order-list-table'].selectedOrder.map(
(item) => item.id (item) => item.id
@ -305,16 +296,6 @@ export default {
}); });
}, },
/** 按钮、选择权限 */
checkConfirmPermission(row) {
const isAdmin = false; //
return (
!row.confirmDueTime ||
row.confirmDueTime >= new Date().getTime() ||
isAdmin
);
},
/** 编辑 */ /** 编辑 */
handleEdit(row, detail) { handleEdit(row, detail) {
this.editOpen = true; this.editOpen = true;
@ -329,16 +310,10 @@ export default {
this.$modal this.$modal
.confirm('是否确认巡检单"' + row.name + '"?') .confirm('是否确认巡检单"' + row.name + '"?')
.then(() => { .then(() => {
let checkPersonParam = '';
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
return this.$axios({ return this.$axios({
url: url:
`/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` + '/base/equipment-check-order/confirm?confirmPerson=' +
checkPersonParam, this.$store.getters.userId,
// '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''), // '/base/equipment-check-order/confirm?ids=' + JSON.stringify([id]).replaceAll("\"", ''),
method: 'put', method: 'put',
data: [id], data: [id],
@ -374,16 +349,16 @@ export default {
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.$modal this.$modal
.confirm('是否确认导出所有巡检?') .confirm('是否确认导出所有巡检设置?')
.then(() => { .then(() => {
this.exportLoading = true; this.exportLoading = true;
return this.$axios({ return this.$axios({
url: '/base/equipment-check-order/export-excel', url: '/base/equipment-check-order/export-excel',
params: { // params: {
name: this.queryParams.name, // name: this.queryParams.name,
status: 1, // status: 1,
special: true, // special: true,
}, // },
responseType: 'blob', responseType: 'blob',
}); });
}) })

View File

@ -30,37 +30,37 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="巡检单名称" prop="name"> <el-form-item label="巡检单名称" prop="name">
<div style="">{{ form.name }}</div> {{ form.name }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门" prop="department"> <el-form-item label="部门" prop="department">
<div style="">{{ form.department }}</div> {{ form.department }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="班次" prop="groupClass"> <el-form-item label="班次" prop="groupClass">
<div style="">{{ form.groupClass || '---' }}</div> {{ form.groupClass }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="巡检人" prop="checkPerson"> <el-form-item label="巡检人" prop="checkPerson">
<div style="">{{ form.checkPerson || '---' }}</div> {{ form.checkPerson }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="巡检时间" prop="planCheckTime"> <el-form-item label="巡检时间" prop="planCheckTime">
<div style="">{{ form.planCheckTime | parseTime }}</div> {{ form.planCheckTime | parseTime }}
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="确认人" prop="confirmPerson"> <el-form-item label="确认人" prop="confirmPerson">
<div style="">{{ form.confirmPerson || '---' }}</div> {{ form.confirmPerson }}
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -324,8 +324,8 @@ export default {
method: 'put', method: 'put',
data: { data: {
...this.form, ...this.form,
groupClass: this.form.groupClass?.join(','), groupClass: this.form.groupClass.join(','),
checkPerson: this.form.checkPerson?.join(','), checkPerson: this.form.checkPerson.join(','),
}, },
}); });
if (code == 0) { if (code == 0) {
@ -401,8 +401,8 @@ export default {
if (userlist.code == 0) { if (userlist.code == 0) {
inspectorList = inspectorList.concat( inspectorList = inspectorList.concat(
(userlist.data?.list || []).map((item) => ({ (userlist.data?.list || []).map((item) => ({
label: item.nickname, label: item.username,
value: item.nickname, value: item.id,
})) }))
); );
} }

View File

@ -15,35 +15,21 @@
v-loading="formLoading" v-loading="formLoading"
label-position="top"> label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col>
<el-form-item label="巡检单名称" prop="name"> <el-form-item label="巡检单名称" prop="name">
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" /> <el-input v-model="dataForm.name" placeholder="请输入巡检单名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col>
<el-form-item label="巡检单编码" prop="code"> <el-form-item label="巡检单编码" prop="code">
<el-input v-model="dataForm.code" placeholder="请输入巡检单编码" /> <el-input v-model="dataForm.code" placeholder="请输入巡检单编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col>
<el-form-item label="计划巡检时间" prop="planCheckTime"> <el-form-item
<el-date-picker label="部门"
v-model="dataForm.planCheckTime" prop="departmentId"
type="datetime" :rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
:placeholder="`请选择计划巡检时间`"
value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="巡检频率(天/次)" prop="checkPeriod">
<el-input
v-model="dataForm.checkPeriod"
placeholder="请输入巡检频率(天/次)" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="部门" prop="departmentId">
<el-select <el-select
v-model="dataForm.departmentId" v-model="dataForm.departmentId"
:placeholder="`请选择部门`"> :placeholder="`请选择部门`">
@ -55,6 +41,27 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col>
<el-form-item label="计划巡检时间" prop="planCheckTime">
<el-date-picker
v-model="dataForm.planCheckTime"
type="datetime"
:placeholder="`请选择计划巡检时间`"
value-format="timestamp" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-input
v-model="dataForm.confirmTimeLimit"
:placeholder="`请输入确认时限`" />
<!-- <el-date-picker
v-model="dataForm.confirmTimeLimit"
type="datetime"
:placeholder="`请选择确认时限`"
value-format="timestamp" /> -->
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="班次" prop="groupClass"> <el-form-item label="班次" prop="groupClass">
<el-select <el-select
@ -72,20 +79,6 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit">
<el-input
v-model="dataForm.confirmTimeLimit"
:placeholder="`请输入确认时限`" />
<!-- <el-date-picker
v-model="dataForm.confirmTimeLimit"
type="datetime"
:placeholder="`请选择确认时限`"
value-format="timestamp" /> -->
</el-form-item>
</el-col>
<el-col> <el-col>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="dataForm.remark" placeholder="请输入备注" /> <el-input v-model="dataForm.remark" placeholder="请输入备注" />
@ -96,8 +89,6 @@
</template> </template>
<script> <script>
import { groupConnectWorkshop } from '@/utils/equipment-module';
export default { export default {
data() { data() {
return { return {
@ -116,12 +107,6 @@ export default {
dataRule: { dataRule: {
confirmTimeLimit: [ confirmTimeLimit: [
{ required: true, message: '确认时限不能为空', trigger: 'blur' }, { required: true, message: '确认时限不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字类型',
trigger: 'blur',
transform: (val) => Number(val),
},
], ],
code: [ code: [
{ required: true, message: '巡检单编码不能为空', trigger: 'blur' }, { required: true, message: '巡检单编码不能为空', trigger: 'blur' },
@ -132,15 +117,6 @@ export default {
planCheckTime: [ planCheckTime: [
{ required: true, message: '计划巡检时间不能为空', trigger: 'blur' }, { required: true, message: '计划巡检时间不能为空', trigger: 'blur' },
], ],
checkPeriod: [
{ required: true, message: '巡检频率不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入正确的数字类型',
trigger: 'blur',
transform: (val) => Number(val),
},
],
}, },
equipmentOptions: [], equipmentOptions: [],
groupOptions: [], groupOptions: [],
@ -161,7 +137,6 @@ export default {
confirmTimeLimit: null, confirmTimeLimit: null,
groupClass: null, groupClass: null,
remark: null, remark: null,
checkPeriod: null
// special: true, // special: true,
}; };
}, },
@ -185,7 +160,7 @@ export default {
} }
if (grp.code == 0) { if (grp.code == 0) {
this.groupOptions = grp.data.map((item) => ({ this.groupOptions = grp.data.map((item) => ({
label: groupConnectWorkshop(item.name, item.roomNameDict), label: item.name,
value: item.id, value: item.id,
})); }));
} }
@ -211,10 +186,7 @@ export default {
Object.keys(this.dataForm).forEach((key) => { Object.keys(this.dataForm).forEach((key) => {
this.dataForm[key] = res.data[key]; this.dataForm[key] = res.data[key];
if (key == 'groupClass') { if (key == 'groupClass') {
this.dataForm.groupClass = this.dataForm.groupClass = res.data.groupClass.split(',')
res.data.groupClass &&
res.data.groupClass.trim() != '' &&
res.data.groupClass.split(',');
} }
}); });
} }

View File

@ -23,7 +23,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障发生时间" prop="faultTime"> <el-form-item label="故障发生时间" prop="faultTime">
<span style="color: #000a;">{{ parseTime(dataForm.faultTime) }}</span> <span>{{ parseTime(dataForm.faultTime) }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -43,7 +43,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障级别" prop="faultLevel"> <el-form-item label="故障级别" prop="faultLevel">
<span style="color: #000a;"> <span>
{{ getDictDataLabel('fault-level', dataForm.faultLevel) }} {{ getDictDataLabel('fault-level', dataForm.faultLevel) }}
</span> </span>
</el-form-item> </el-form-item>
@ -51,7 +51,7 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障类型" prop="faultType"> <el-form-item label="故障类型" prop="faultType">
<span style="color: #000a;"> <span>
{{ getDictDataLabel('fault-type', dataForm.faultType) }} {{ getDictDataLabel('fault-type', dataForm.faultType) }}
</span> </span>
</el-form-item> </el-form-item>
@ -59,19 +59,19 @@
<el-col :span="8"> <el-col :span="8">
<el-form-item label="维修工" prop="repairman"> <el-form-item label="维修工" prop="repairman">
<span style="color: #000a;">{{ dataForm.repairman }}</span> <span>{{ dataForm.repairman }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="联系方式" prop="repairmanPhone"> <el-form-item label="联系方式" prop="repairmanPhone">
<span style="color: #000a;">{{ dataForm.repairmanPhone }}</span> <span>{{ dataForm.repairmanPhone }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="维修方式" prop="repairMode"> <el-form-item label="维修方式" prop="repairMode">
<span style="color: #000a;"> <span>
{{ getDictDataLabel('repair-mode', dataForm.repairMode) }} {{ getDictDataLabel('repair-mode', dataForm.repairMode) }}
</span> </span>
</el-form-item> </el-form-item>
@ -88,25 +88,25 @@
:disabled="disabled" :disabled="disabled"
@delete="!disabled && handleDeleteFile(file, col.prop)" /> @delete="!disabled && handleDeleteFile(file, col.prop)" />
</div> </div>
<p v-else style="color: #000a;">暂无附件</p> <p v-else>暂无附件</p>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
<span style="color: #000a;">{{ parseTime(dataForm.createTime) }}</span> <span>{{ parseTime(dataForm.createTime) }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="创建人" prop="creator"> <el-form-item label="创建人" prop="creator">
<span style="color: #000a;">{{ dataForm.creator }}</span> <span>{{ dataForm.creator }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<span style="color: #000a;">{{ dataForm.remark || '- 无 -' }}</span> <span>{{ dataForm.remark }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -159,7 +159,8 @@ const uploadedFile = {
document.body.removeChild(link); document.body.removeChild(link);
}, },
}, },
mounted() {}, mounted() {
},
render: function (h) { render: function (h) {
return ( return (
<div <div
@ -337,10 +338,6 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
.drawer-body__content >>> .el-form-item__label {
font-weight: 700;
}
.drawer-body__footer { .drawer-body__footer {
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;

View File

@ -27,6 +27,7 @@
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<section> <section>
<SmallTitle>保养信息</SmallTitle>
<div class="form-part" style="margin-bottom: 32px"> <div class="form-part" style="margin-bottom: 32px">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<el-form <el-form

View File

@ -44,7 +44,10 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="部门" prop="departmentId"> <el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select <el-select
v-model="form.departmentId" v-model="form.departmentId"
:placeholder="`请选择部门`" :placeholder="`请选择部门`"
@ -81,7 +84,10 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="产线" prop="lineId"> <el-form-item
label="产线"
prop="lineId"
:rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]">
<el-select <el-select
v-model="form.lineId" v-model="form.lineId"
:placeholder="`请选择产线`" :placeholder="`请选择产线`"
@ -177,7 +183,6 @@
label="保养时长(h)" label="保养时长(h)"
prop="maintainDuration" prop="maintainDuration"
:rules="[ :rules="[
{ required: true, message: '保养时长不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入正确的数字', message: '请输入正确的数字',

View File

@ -27,6 +27,7 @@
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
<section> <section>
<SmallTitle>保养信息</SmallTitle>
<div class="form-part" style="margin-bottom: 32px"> <div class="form-part" style="margin-bottom: 32px">
<el-skeleton v-if="!showForm" animated /> <el-skeleton v-if="!showForm" animated />
<el-form <el-form
@ -129,8 +130,8 @@
width="35%" width="35%"
:append-to-body="true" :append-to-body="true"
custom-class="baseDialog" custom-class="baseDialog"
@close="detailAddVisible = false" @close="closeDetailForm"
@cancel="detailAddVisible = false" @cancel="closeDetailForm"
@confirm="submitDetailForm"> @confirm="submitDetailForm">
<DialogForm <DialogForm
v-if="detailAddVisible" v-if="detailAddVisible"
@ -237,7 +238,7 @@ export default {
detailTableProps: [ detailTableProps: [
{ prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentName', label: '设备名称' },
{ prop: 'program', label: '保养项目' }, { prop: 'program', label: '保养项目' },
// { prop: 'remark', label: '' }, { prop: 'remark', label: '备注' },
], ],
detailTableQuery: { detailTableQuery: {
pageNo: 1, pageNo: 1,
@ -317,21 +318,9 @@ export default {
value: item.id, value: item.id,
})); }));
}, },
resetForm() {
this.detailForm = {
planId: null,
equipmentId: null,
program: '',
maintenanceDes: '',
remark: '',
};
},
closeDetailForm() { closeDetailForm() {
this.detailAddVisible = false; this.detailAddVisible = false;
}, },
async submitDetailForm() { async submitDetailForm() {
// validation // validation
this.$refs.detailForm.validate(async (valid) => { this.$refs.detailForm.validate(async (valid) => {
@ -422,10 +411,7 @@ export default {
} }
}, },
handleAddDetail() { handleAddDetail() {
this.resetForm(); this.detailAddVisible = true;
this.$nextTick(() => {
this.detailAddVisible = true;
});
}, },
}, },
}; };

View File

@ -63,6 +63,7 @@
import moment from 'moment'; import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record'; import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record';
import { publicFormatter } from '@/utils/dict';
import PlanConfigAdd from './PlanConfig--add.vue'; import PlanConfigAdd from './PlanConfig--add.vue';
import PlanConfigAddContent from './PlanConfig--addContent.vue'; import PlanConfigAddContent from './PlanConfig--addContent.vue';
@ -101,13 +102,8 @@ export default {
{ prop: 'name', label: '计划名称' }, { prop: 'name', label: '计划名称' },
{ prop: 'departmentName', label: '部门' }, { prop: 'departmentName', label: '部门' },
{ width: 144, prop: 'lineName', label: '产线名' }, { width: 144, prop: 'lineName', label: '产线名' },
{ width: 132, prop: 'maintenancePeriod', label: '保养频率(天/次)' }, { width: 144, prop: 'maintenancePeriod', label: '保养频率(天/次)' },
{ { width: 144, prop: 'firstMaintenanceTime', label: '首次保养时间' },
width: 180,
prop: 'firstMaintenanceTime',
label: '首次保养时间',
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
},
{ width: 144, prop: 'maintainDuration', label: '保养时长' }, { width: 144, prop: 'maintainDuration', label: '保养时长' },
{ prop: 'maintainer', label: '计划保养人员' }, { prop: 'maintainer', label: '计划保养人员' },
{ {

View File

@ -29,7 +29,7 @@
</el-col> </el-col>
<!-- 产线名 --> <!-- 产线名 -->
<!-- <el-col :span="8"> <el-col :span="8">
<el-form-item label="产线名" prop="lineId"> <el-form-item label="产线名" prop="lineId">
<el-select <el-select
v-model="formFilters.lineId" v-model="formFilters.lineId"
@ -45,10 +45,10 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<!-- 工段名 --> <!-- 工段名 -->
<!-- <el-col :span="8"> <el-col :span="8">
<el-form-item label="工段名" prop="sectionId"> <el-form-item label="工段名" prop="sectionId">
<el-select <el-select
v-model="formFilters.sectionId" v-model="formFilters.sectionId"
@ -64,7 +64,7 @@
:value="opt.value" /> :value="opt.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> --> </el-col>
<!-- 设备名称 --> <!-- 设备名称 -->
<el-col :span="8"> <el-col :span="8">
@ -116,7 +116,16 @@
<!-- 故障级别 --> <!-- 故障级别 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="故障级别" prop="faultLevel"> <el-form-item
label="故障级别"
prop="faultLevel"
:rules="[
{
required: true,
message: '故障级别不能为空',
trigger: 'blur',
},
]">
<el-select <el-select
v-model="form.faultLevel" v-model="form.faultLevel"
placeholder="故障级别" placeholder="故障级别"
@ -207,7 +216,12 @@
<!-- 维修工 --> <!-- 维修工 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="维修工" prop="repairman"> <el-form-item
label="维修工"
prop="repairman"
:rules="[
{ required: true, message: '维修工不能为空', trigger: 'blur' },
]">
<el-select <el-select
v-model="form.repairman" v-model="form.repairman"
@change="$emit('update', form)" @change="$emit('update', form)"
@ -227,7 +241,12 @@
<!-- 联系方式 --> <!-- 联系方式 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="联系方式" prop="repairmanPhone"> <el-form-item
label="联系方式"
prop="repairmanPhone"
:rules="[
{ required: true, message: '联系方式不能为空', trigger: 'blur' },
]">
<el-input <el-input
v-model="form.repairmanPhone" v-model="form.repairmanPhone"
@change="$emit('update', form)" @change="$emit('update', form)"
@ -238,7 +257,16 @@
<!-- 维修方式 - 数据字典 --> <!-- 维修方式 - 数据字典 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item label="维修方式" prop="repairMode"> <el-form-item
label="维修方式"
prop="repairMode"
:rules="[
{
required: true,
message: '维修方式不能为空',
trigger: 'blur',
},
]">
<el-select <el-select
v-model="form.repairMode" v-model="form.repairMode"
placeholder="维修方式" placeholder="维修方式"
@ -280,7 +308,7 @@
</el-col> </el-col>
<!-- 备注 --> <!-- 备注 -->
<el-col :span="8"> <el-col :span="24">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
v-model="form.remark" v-model="form.remark"
@ -516,16 +544,16 @@ export default {
dataForm: { dataForm: {
handler(val) { handler(val) {
this.form = JSON.parse(JSON.stringify(val)); this.form = JSON.parse(JSON.stringify(val));
// if (this.form.equipmentCategory != null) { if (this.form.equipmentCategory != null) {
// setTimeout(() => { setTimeout(() => {
// this.equipmentOptions = this.equipmentList this.equipmentOptions = this.equipmentList
// .filter((item) => item.special) .filter((item) => item.special)
// .filter( .filter(
// (item) => item.specialType === this.form.equipmentCategory (item) => item.specialType === this.form.equipmentCategory
// ) )
// .map((item) => ({ label: item.name, value: item.id })); .map((item) => ({ label: item.name, value: item.id }));
// }, 1000); }, 1000);
// } }
if (this.hasFiles) { if (this.hasFiles) {
if (typeof this.hasFiles == 'boolean' && this.hasFiles) { if (typeof this.hasFiles == 'boolean' && this.hasFiles) {
this.form.files = this.form.files ?? []; this.form.files = this.form.files ?? [];
@ -563,9 +591,9 @@ export default {
this.formLoading = true; this.formLoading = true;
await this.getCode(); await this.getCode();
await this.initEquipment(); await this.initEquipment();
// await this.initLines(); await this.initLines();
await this.initWorker(); await this.initWorker();
// await this.initSections(); await this.initSections();
this.formLoading = false; this.formLoading = false;
this.isInit = false; this.isInit = false;
this.setInitWorker(); this.setInitWorker();
@ -574,37 +602,36 @@ export default {
/** 设置默认维修工为用户自己 */ /** 设置默认维修工为用户自己 */
setInitWorker() { setInitWorker() {
/** 获取用户自身id */ /** 获取用户自身id */
const nickname = this.$store.getters.nickname; const userId = this.$store.getters.userId;
this.$nextTick(() => { this.$nextTick(() => {
this.form.repairman = [nickname]; this.form.repairman = [userId];
}); });
}, },
/** 获取产线 */ /** 获取产线 */
// async initLines() { async initLines() {
// const res = await this.$axios('/base/core-production-line/listAll'); const res = await this.$axios('/base/core-production-line/listAll');
// this.lineOptions = (res.data || []).map((item) => ({ this.lineOptions = (res.data || []).map((item) => ({
// label: item.name, label: item.name,
// value: item.id, 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 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(type = 'special-equipment') { async initEquipment(type = 'special-equipment') {
const response = await this.$axios('/base/core-equipment/listAll'); const response = await this.$axios('/base/core-equipment/listAll');
@ -615,8 +642,8 @@ export default {
label: item.name, label: item.name,
value: item.id, value: item.id,
})); }));
this.equipmentOptions = [...equipmentOptions]; this.equipmentOptions = equipmentOptions;
this.allSpeicalEquipments = [...equipmentOptions]; this.allSpeicalEquipments = equipmentOptions;
}, },
/** 获取维修工 - 同时从用户表和员工表拉取数据 */ /** 获取维修工 - 同时从用户表和员工表拉取数据 */
async initWorker() { async initWorker() {
@ -631,8 +658,8 @@ export default {
}); });
list = list.concat( list = list.concat(
(userList.data?.list || []).map((item) => ({ (userList.data?.list || []).map((item) => ({
label: item.nickname, label: item.username,
value: item.nickname, value: item.id,
})) }))
); );
/** worker */ /** worker */
@ -642,7 +669,7 @@ export default {
list = list.concat( list = list.concat(
(workerList.data || []).map((item) => ({ (workerList.data || []).map((item) => ({
label: item.name, label: item.name,
value: item.name, value: item.id,
})) }))
); );
/** setting */ /** setting */

View File

@ -42,7 +42,6 @@
<base-dialog <base-dialog
:dialogTitle="title" :dialogTitle="title"
:dialogVisible="open" :dialogVisible="open"
width="60%"
@close="cancel" @close="cancel"
@cancel="cancel" @cancel="cancel"
@confirm="submitForm"> @confirm="submitForm">
@ -147,7 +146,6 @@ export default {
label: '故障明细', label: '故障明细',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true, showOverflowtooltip: true,
subcomponent: htmls,
}, },
{ {
prop: 'maintenanceStartTime', prop: 'maintenanceStartTime',
@ -174,7 +172,6 @@ export default {
label: '维修描述', label: '维修描述',
showOverflowtooltip: true, showOverflowtooltip: true,
width: 110, width: 110,
subcomponent: htmls,
}, },
{ {
prop: 'remark', prop: 'remark',