解决冲突

This commit is contained in:
‘937886381’ 2024-03-01 15:28:12 +08:00
commit f685a65a1f
47 changed files with 1065 additions and 541 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-02-29 08:34:48 # @LastEditTime: 2024-03-01 15:27:52
# @LastEditors: zhp # @LastEditors: zhp
# @Description: # @Description:
### ###

View File

@ -153,3 +153,12 @@ export function createConCoreWOr(data) {
data: data data: data
}) })
} }
// 修改分配产量
export function updateConCoreWOr(data) {
return request({
url: '/base/core-order-con-work-order/update',
method: 'put',
data: data
})
}

View File

@ -1,7 +1,7 @@
/* /*
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-11-08 15:56:52 * @Date: 2023-11-08 15:56:52
* @LastEditTime: 2024-02-26 09:29:53 * @LastEditTime: 2024-02-28 18:16:56
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
*/ */
@ -52,6 +52,17 @@ export function exportCheckLogExcel(query) {
}) })
} }
// 导出设备巡检单记录
export function exportCheckOrderExcel(query) {
return request({
url: '/base/equipment-check-order/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
// 根据设备获得所有巡检配置列表 // 根据设备获得所有巡检配置列表
export function getcheckConfigByEqList(query) { export function getcheckConfigByEqList(query) {
return request({ return request({

View File

@ -87,6 +87,7 @@ 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) {
@ -96,7 +97,7 @@ const user = {
user: { user: {
id: '', id: '',
avatar: '', avatar: '',
userName: '', username: '',
nickname: '' nickname: ''
} }
} }
@ -113,7 +114,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) // commit('SET_NAME', user.username) //无效调用接口未提供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

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

View File

@ -83,20 +83,14 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="工段排序" label="工段排序"
prop="sort" prop="sort">
:rules="[ <el-input-number
{
type: 'number',
trigger: 'change',
message: '请输入正确的数字类型',
transform: (val) => Number(val),
},
]">
<el-input
v-model="dataForm.sort" v-model="dataForm.sort"
clearable clearable
controls-position="right"
@change="$emit('update', dataForm)" @change="$emit('update', dataForm)"
placeholder="请输入工段排序" /> placeholder="请输入工段排序"
style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>

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-02-27 15:38:04 * @LastEditTime: 2024-02-29 15:01:25
* @Description: * @Description:
--> -->
<template> <template>
@ -325,7 +325,7 @@ export default {
init(row, isdetail) { init(row, isdetail) {
this.initData(); this.initData();
this.isdetail = isdetail || false; this.isdetail = isdetail || false;
this.dataForm.id = row.id || undefined; this.dataForm.id = row?.id || undefined;
this.isedit = row?.id && row?.externalCode ? true : false; this.isedit = row?.id && row?.externalCode ? true : false;
console.log('你好', this.isedit) console.log('你好', this.isedit)
this.visible = true; this.visible = true;

View File

@ -253,7 +253,9 @@ export default {
if (this.dataForm.priority !== undefined) { if (this.dataForm.priority !== undefined) {
this.dataForm.priority = String(this.dataForm.priority) this.dataForm.priority = String(this.dataForm.priority)
} }
this.dataForm.priority if (this.dataForm.roomNameDict !== undefined) {
this.dataForm.roomNameDict = String(this.dataForm.roomNameDict)
}
}); });
} else { } else {
if (this.urlOptions.isGetCode) { if (this.urlOptions.isGetCode) {

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: 2023-11-16 09:14:35 * @LastEditTime: 2024-02-29 10:01:52
* @Description: * @Description:
--> -->
<template> <template>
@ -41,12 +41,12 @@
<el-table-column prop="priority" label="优先级" /> <el-table-column prop="priority" label="优先级" />
<el-table-column prop="planAssignmentQuantity" label="计划分配数量" > <el-table-column prop="planAssignmentQuantity" label="计划分配数量" >
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input> <el-input v-model="scope.row.planAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="actualAssignmentQuantity" label="实际分配数量"> <el-table-column prop="actualAssignmentQuantity" label="实际分配数量">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.actualAssignmentQuantity"></el-input> <el-input v-model="scope.row.actualAssignmentQuantity" :disabled="scope.row.isallocation"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作"> <el-table-column label="操作">
@ -104,7 +104,7 @@
<script> <script>
import basicAdd from '../../core/mixins/basic-add'; import basicAdd from '../../core/mixins/basic-add';
import { getConOrderList, createConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder'; import { getConOrderList, updateConCoreWOr, getCoreWO } from '@/api/base/coreWorkOrder';
import SmallTitle from '../material/SmallTitle'; import SmallTitle from '../material/SmallTitle';
// import { parseTime } from '../../core/mixins/code-filter'; // import { parseTime } from '../../core/mixins/code-filter';
// import attrAdd from './attr-add'; // import attrAdd from './attr-add';
@ -159,8 +159,8 @@ export default {
// }); // });
// return; // return;
} }
// //
createConCoreWOr({ updateConCoreWOr({
...row, ...row,
workOrderId: this.dataForm.id workOrderId: this.dataForm.id
}).then((response) => { }).then((response) => {
@ -173,16 +173,17 @@ export default {
} }
}, },
getList() { getList() {
// Bom //
getConOrderList({ getConOrderList({
...this.listQuery, ...this.listQuery,
workOrderId: this.dataForm.id workOrderId: this.dataForm.id
}).then((response) => { }).then((response) => {
this.tableData = response.data.map(item => { this.tableData = response.data.map(item => {
item.isEdit = false item.isEdit = false
item.isallocation = item.actualAssignmentQuantity ? true : false
return item return item
}); });
this.listQuery.total = response.data.total; this.listQuery.total = response.data.length;
}); });
}, },
// //

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: 2023-12-26 16:59:25 * @LastEditTime: 2024-02-29 15:35:02
* @Description: * @Description:
--> -->
<template> <template>
@ -45,7 +45,7 @@
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<div class="blodTip">工单来源</div> <div class="blodTip">工单来源</div>
<div class="lightTip">{{ dataForm.triggerOrigin === 1 ? 'MES' : dataForm.triggerOrigin === 2 ? 'ERP' : ''}}</div> <div class="lightTip">{{ dataForm.triggerOrigin === 1 ? 'MES-手动' : dataForm.triggerOrigin === 2 ? 'MES-订单下发' : 'ERP'}}</div>
</el-col> </el-col>
<el-col :span="3"> <el-col :span="3">
<div class="blodTip">所属订单</div> <div class="blodTip">所属订单</div>
@ -218,7 +218,7 @@
<script> <script>
// import basicAdd from '../../core/mixins/basic-add'; // import basicAdd from '../../core/mixins/basic-add';
import { getCoreWO, getMaterialBomPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder"; import { getCoreWO, getCoreWOMaPage, getConOrderList, getCoreWOListById } from "@/api/base/coreWorkOrder";
// import { orderList } from "@/api/base/orderManage"; // import { orderList } from "@/api/base/orderManage";
import { getProcessFlowList } from '@/api/base/orderManage' import { getProcessFlowList } from '@/api/base/orderManage'
import SmallTitle from './SmallTitle'; import SmallTitle from './SmallTitle';
@ -261,8 +261,9 @@ const tableProps = [
const tableProps1 = [ const tableProps1 = [
{ {
prop: 'materialName', prop: 'material',
label: '物料名称' label: '物料名称',
filter: publicFormatter('material')
}, },
{ {
prop: 'unit', prop: 'unit',
@ -270,7 +271,7 @@ const tableProps1 = [
filter: publicFormatter('unit_dict') filter: publicFormatter('unit_dict')
}, },
{ {
prop: 'num', prop: 'remaining',
label: '剩余生产预计消耗' label: '剩余生产预计消耗'
}, },
]; ];
@ -431,11 +432,17 @@ export default {
// this.listQuery.total = response.data.total; // this.listQuery.total = response.data.total;
}); });
// 使 // 使
if (this.dataForm.planProductId) { console.log()
getMaterialBomPage({ if (this.dataForm.id) {
productId: this.dataForm.planProductId, getCoreWOMaPage({
workOrderId: this.dataForm.id,
pageNo: 1,
pageSize: 100
}).then((response) => { }).then((response) => {
this.materialList = response.data; this.materialList = response.data.records.map((item) => {
item.remaining = item?.num * this.dataForm.remainingQuantity || 0
return item
});
// this.listQuery.total = response.data.length; // this.listQuery.total = response.data.length;
}); });
} }

View File

@ -197,17 +197,7 @@ export default {
{ {
name: 'status', name: 'status',
type: 'equal', type: 'equal',
value: 2 value: 1
},
{
name: 'status',
type: 'equal',
value: 3
},
{
name: 'status',
type: 'equal',
value: 4
} }
] ]
} }
@ -241,6 +231,11 @@ export default {
name: 'status', name: 'status',
type: 'equal', type: 'equal',
value: 2 value: 2
},
{
name: 'status',
type: 'equal',
value: 3
} }
] ]
} }
@ -266,23 +261,23 @@ export default {
] ]
} }
} }
: undefined,
this.$auth.hasPermi(`base:core-work-order:delete`)
? {
type: 'delete',
btnName: '删除',
showParam: {
type: '|',
data: [
{
name: 'status',
type: 'equal',
value: 1
}
]
}
}
: undefined : undefined
// this.$auth.hasPermi(`base:core-work-order:delete`)
// ? {
// type: 'delete',
// btnName: '',
// showParam: {
// type: '|',
// data: [
// {
// name: 'status',
// type: 'equal',
// value: 1
// }
// ]
// }
// }
// : undefined
].filter((v)=>v), ].filter((v)=>v),
tableData: [], tableData: [],
formConfig: [ formConfig: [

View File

@ -233,10 +233,6 @@ export default {
// //
emitButtonClick1() { emitButtonClick1() {
let n = this.tableData1.length let n = this.tableData1.length
if (n >=3) {
this.$modal.msgWarning('最多可添加3档计价')
return false
}
let obj = {} let obj = {}
obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime obj.startTime = n === 0 ? '' : this.tableData1[n-1].endTime
obj.endTime = '' obj.endTime = ''
@ -245,10 +241,6 @@ export default {
}, },
emitButtonClick2() { emitButtonClick2() {
let n = this.tableData2.length let n = this.tableData2.length
// if (n >=3) {
// this.$modal.msgWarning('3')
// return false
// }
let obj = {} let obj = {}
obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed obj.startUsed = n === 0 ? 0 : this.tableData2[n-1].endUsed
obj.endUsed = 0 obj.endUsed = 0

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-02-27 09:41:00 * @LastEditTime: 2024-02-29 14:59:28
* @Description: * @Description:
--> -->
<template> <template>
@ -27,13 +27,14 @@
<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">
<el-input v-model="dataForm.name" placeholder="请输入巡检单名称" /> <el-input v-model="dataForm.name" :disabled="isdetail" placeholder="请输入巡检单名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="部门" prop="departmentId"> <el-form-item label="部门" prop="departmentId">
<el-select <el-select
v-model="dataForm.departmentId" v-model="dataForm.departmentId"
:disabled="isdetail"
:placeholder="`请选择部门`"> :placeholder="`请选择部门`">
<el-option <el-option
v-for="opt in departmentOptions" v-for="opt in departmentOptions"
@ -50,14 +51,14 @@
filterable filterable
clearable clearable
multiple multiple
:disabled="isedit" :disabled="isdetail"
style="width: 100%" style="width: 100%"
placeholder="请选择班次"> placeholder="请选择班次">
<el-option <el-option
v-for="d in groupOptions" v-for="d in groupOptions"
:key="d.id" :key="d.id"
:label="d.name" :label="d.label"
:value="d.id" /> :value="d.label" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -70,8 +71,9 @@
:placeholder="`请选择巡检人`" :placeholder="`请选择巡检人`"
multiple multiple
clearable clearable
:disabled="isedit" :disabled="isdetail"
filterable> filterable
style="width: 100%">
<el-option <el-option
v-for="opt in inspectorOptions" v-for="opt in inspectorOptions"
:key="opt.value" :key="opt.value"
@ -85,7 +87,7 @@
<el-date-picker <el-date-picker
v-model="dataForm.planCheckTime" v-model="dataForm.planCheckTime"
type="datetime" type="datetime"
:disabled="isedit" :disabled="isdetail"
placeholder="请选择巡检时间" placeholder="请选择巡检时间"
value-format="timestamp"></el-date-picker> value-format="timestamp"></el-date-picker>
</el-form-item> </el-form-item>
@ -142,7 +144,8 @@
<div v-if="!isdetail" class="drawer-body__footer"> <div v-if="!isdetail" class="drawer-body__footer">
<el-button @click="goback()">取消</el-button> <el-button @click="goback()">取消</el-button>
<!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> --> <!-- <el-button :disabled="isdetail" @click="init(dataForm.id)">重置</el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button v-if="isshowConfirm" type="primary" @click="confirmIns()">保存</el-button>
<el-button v-else type="primary" @click="dataFormSubmit()">保存</el-button>
</div> </div>
<attr-add <attr-add
@ -163,6 +166,7 @@ import attrAdd from './attr-add';
import {DICT_TYPE, getDictDatas} from "@/utils/dict"; import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import { getCoreDepartmentList } from "@/api/base/coreDepartment"; import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { groupClassesListAll } from '@/api/monitoring/teamProduction' import { groupClassesListAll } from '@/api/monitoring/teamProduction'
import { getDictDataLabel } from '@/utils/dict';
const tableBtn = [ const tableBtn = [
{ {
@ -205,6 +209,7 @@ export default {
tableProps, tableProps,
topBtnConfig, topBtnConfig,
addOrUpdateVisible: false, addOrUpdateVisible: false,
isshowConfirm: false,
urlOptions: { urlOptions: {
isGetCode: false, isGetCode: false,
createURL: createCheckOrder, createURL: createCheckOrder,
@ -242,8 +247,8 @@ export default {
id: undefined, id: undefined,
name: '', name: '',
departmentId: undefined, departmentId: undefined,
groupClass: undefined, groupClass: [],
checkPerson: undefined, checkPerson: [],
planCheckTime: undefined planCheckTime: undefined
}, },
detList: [], detList: [],
@ -267,7 +272,10 @@ export default {
async getDict() { async getDict() {
// //
const res = await groupClassesListAll(); const res = await groupClassesListAll();
this.groupOptions = res.data || []; this.groupOptions = res.data.map((item) => {
item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
return item
}) || [];
// //
const res1 = await getCoreDepartmentList(); const res1 = await getCoreDepartmentList();
this.departmentOptions = res1.data || [] this.departmentOptions = res1.data || []
@ -314,6 +322,7 @@ export default {
initData() { initData() {
this.detList.splice(0); this.detList.splice(0);
this.listQuery.total = 0; this.listQuery.total = 0;
this.isshowConfirm = false;
}, },
handleClick(raw) { handleClick(raw) {
if (raw.type === 'delete') { if (raw.type === 'delete') {
@ -373,6 +382,16 @@ export default {
// //
this.urlOptions.infoURL(id).then(response => { this.urlOptions.infoURL(id).then(response => {
this.dataForm = response.data this.dataForm = response.data
if (this.dataForm.groupClass && this.dataForm.groupClass !== ''){
this.dataForm.groupClass = response.data?.groupClass.split(',')
} else {
this.dataForm.groupClass = []
}
if (this.dataForm.checkPerson && this.dataForm.checkPerson !== '') {
this.dataForm.checkPerson = response.data?.checkPerson.split(',')
} else {
this.dataForm.checkPerson = []
}
}); });
// //
this.getList(); this.getList();
@ -398,6 +417,41 @@ export default {
this.$refs.addOrUpdate.init(id); this.$refs.addOrUpdate.init(id);
}); });
}, },
getConfirmed() {
return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
},
async confirmIns() {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return;
}
this.$nextTick(() => {
this.getConfirmed().then(confirm => {
this.$axios({
url:
'/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId,
method: 'put',
data: [this.dataForm.id],
}).then(res =>{
if (res.code == 0) {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('已确认');
}
})
}).catch(() => {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('取消确认');
})
})
});
},
// //
dataFormSubmit() { dataFormSubmit() {
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
@ -429,6 +483,7 @@ export default {
}).then(response => { }).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.idAttrShow = true this.idAttrShow = true
this.isshowConfirm = true
this.dataForm.id = response.data this.dataForm.id = response.data
// this.visible = false; // this.visible = false;
this.$emit("refreshDataList"); this.$emit("refreshDataList");

View File

@ -172,24 +172,27 @@ export default {
async searchBarClicked(btn) { async searchBarClicked(btn) {
switch (btn.btnName) { switch (btn.btnName) {
case 'batchConfirm': case 'batchConfirm':
const ids = this.$refs['waiting-list-table'].selectedPlan.map(
(item) => item.id
)
if (this.$refs['waiting-list-table'].selectedPlan.length == 0) { if (this.$refs['waiting-list-table'].selectedPlan.length == 0) {
this.$message.warning('请选择待确认的设备巡检单'); this.$message.warning('请选择待确认的设备巡检单');
return; return;
} }
const res = await this.$axios({ this.$modal
url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId + '&ids=' + ids, .confirm('是否确认所有选中巡检单"?')
method: 'put', .then(() => {
// data: this.$refs['waiting-list-table'].selectedPlan.map( return this.$axios({
// (item) => item.id url: '/base/equipment-check-order/confirm?confirmPerson=' + this.$store.getters.userId,
// ), method: 'put',
}); data: this.$refs['waiting-list-table'].selectedPlan.map(
if (res.code == 0) { (item) => item.id
this.$message.success('确认成功'); ),
this.getList(); });
} })
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
break; break;
} }
}, },
@ -328,7 +331,7 @@ export default {
// }, // },
getConfirmed() { getConfirmed() {
return this.$confirm('是否直接确认保养记录', '提示', { return this.$confirm('是否直接确认巡检记录', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -388,17 +391,16 @@ export default {
}, },
/** 确认 */ /** 确认 */
async handleConfirm(row) { async handleConfirm(row) {
console.log('111', this.$store.getters.userId)
this.$modal this.$modal
.confirm('是否确认巡检单"' + row.name + '"?') .confirm('是否确认巡检单"' + row.name + '"?')
.then(() => { .then(() => {
return this.$axios({ return this.$axios({
url: url:
'/base/equipment-check-order/confirm?confirmPerson=' + '/base/equipment-check-order/confirm?confirmPerson=' +
this.$store.getters.userId + '&ids=' + [row.id], 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: [row.id], data: [row.id],
}); });
}) })
.then((res) => { .then((res) => {

View File

@ -63,7 +63,7 @@ import moment from 'moment';
import basicPageMixin from '@/mixins/lb/basicPageMixin'; import basicPageMixin from '@/mixins/lb/basicPageMixin';
import addRecord from './addRecord.vue'; import addRecord from './addRecord.vue';
import AddContent from './addContent.vue'; import AddContent from './addContent.vue';
import { exportCheckLogExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record' import { exportCheckOrderExcel, deleteEqCheckLog } from '@/api/equipment/base/inspection/record'
import { parseTime } from '../../../../core/mixins/code-filter'; import { parseTime } from '../../../../core/mixins/code-filter';
// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); // const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss');
@ -130,19 +130,25 @@ export default {
// { prop: 'responsible', label: '' }, // { prop: 'responsible', label: '' },
], ],
searchBarFormConfig: [ searchBarFormConfig: [
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'name',
// filterable: true
// },
{ {
type: 'select', type: 'input',
label: '巡检单名称', label: '巡检单名称',
placeholder: '请选择巡检单', placeholder: '请输入巡检单',
param: 'name', param: 'name'
filterable: true
}, },
// //
{ {
type: 'datePicker', type: 'datePicker',
label: '巡检时间', label: '巡检时间',
dateType: 'daterange', // datetimerange dateType: 'datetimerange', // datetimerange
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始日期', startPlaceholder: '开始日期',
@ -257,7 +263,12 @@ export default {
}; };
}, },
created() { created() {
this.initSearchBar(); let end = moment().format('YYYY-MM-DD 08:00:00')
const current = new Date()
let start = parseTime(new Date(current.getFullYear(), current.getMonth(), current.getDate() - 3, 8, 0, 0))
this.searchBarFormConfig[1].defaultSelect = [start, end]
this.queryParams.actualCheckTime = [start, end]
// this.initSearchBar();
this.getList(); this.getList();
}, },
methods: { methods: {
@ -272,22 +283,23 @@ export default {
break; break;
} }
}, },
initSearchBar() { // initSearchBar() {
this.http('/base/core-equipment/page', 'get', { // this.http('/base/equipment-check-order/page', 'get', {
special: false, // special: false,
pageNo: 1, // pageNo: 1,
pageSize: 99, // pageSize: 99,
}).then(({ data }) => { // status: 2
this.$set( // }).then(({ data }) => {
this.searchBarFormConfig[0], // this.$set(
'selectOptions', // this.searchBarFormConfig[0],
(data?.list || []).map((item) => ({ // 'selectOptions',
name: item.name, // (data?.list || []).map((item) => ({
id: item.id, // name: item.name,
})) // id: item.id,
); // }))
}); // );
}, // });
// },
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;
@ -419,7 +431,7 @@ export default {
.confirm('是否确认导出所有设备巡检记录?') .confirm('是否确认导出所有设备巡检记录?')
.then(() => { .then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportCheckLogExcel(params); return exportCheckOrderExcel(params);
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '设备巡检记录.xls'); this.$download.excel(response, '设备巡检记录.xls');

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-02-24 20:50:51 * @LastEditTime: 2024-02-29 14:58:37
* @Description: * @Description:
--> -->
<template> <template>
@ -53,6 +53,7 @@
type="datetime" type="datetime"
:placeholder="`请选择计划巡检时间`" :placeholder="`请选择计划巡检时间`"
value-format="timestamp" value-format="timestamp"
:default-time="'8:00:00'"
style="width: 100%" /> style="width: 100%" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -77,8 +78,8 @@
<el-option <el-option
v-for="d in groupOptions" v-for="d in groupOptions"
:key="d.id" :key="d.id"
:label="d.name" :label="d.label"
:value="d.id" /> :value="d.label" />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -98,6 +99,7 @@ import basicAdd from '../../../../core/mixins/basic-add';
import { getCheckOrder, getOrderCode, createCheckOrder, updateCheckOrder } from "@/api/equipment/base/inspection/settings"; import { getCheckOrder, getOrderCode, createCheckOrder, updateCheckOrder } from "@/api/equipment/base/inspection/settings";
import { getCoreDepartmentList } from "@/api/base/coreDepartment"; import { getCoreDepartmentList } from "@/api/base/coreDepartment";
import { groupClassesListAll } from '@/api/monitoring/teamProduction' import { groupClassesListAll } from '@/api/monitoring/teamProduction'
import { getDictDataLabel } from '@/utils/dict';
// import { getEquipmentAll } from '@/api/base/equipment' // import { getEquipmentAll } from '@/api/base/equipment'
export default { export default {
@ -139,16 +141,48 @@ export default {
} }
}; };
}, },
created() {
const currenttime = new Date()
this.dataForm.planCheckTime = new Date(currenttime.getFullYear(), currenttime.getMonth(), currenttime.getDate(), 8, 0, 0).getTime()
console.log('11', this.dataForm.planCheckTime, currenttime)
},
mounted() { mounted() {
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
if (response.data.groupClass === '') {
this.dataForm.groupClass = []
} else {
this.dataForm.groupClass = response.data?.groupClass.split(',') || undefined
}
});
} else {
if (this.urlOptions.isGetCode) {
this.getCode()
}
}
});
},
async getDict() { async getDict() {
// //
const res = await getCoreDepartmentList(); const res = await getCoreDepartmentList();
this.departmentOptions = res.data || []; this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll(); const res1 = await groupClassesListAll();
this.groupOptions = res1.data || []; this.groupOptions = res1.data.map((item) => {
item.label = item.name + ' - ' + getDictDataLabel('workshop', item.roomNameDict)
return item
}) || [];
// const res = await getEquipmentAll() // const res = await getEquipmentAll()
// this.eqList = res.data // this.eqList = res.data
}, },

View File

@ -97,11 +97,11 @@ export default {
{ prop: 'name', label: '巡检单名称', width: 110, showOverflowtooltip: true }, { prop: 'name', label: '巡检单名称', width: 110, showOverflowtooltip: true },
{ prop: 'code', label: '巡检单编码', minWidth: 150, showOverflowtooltip: true }, { prop: 'code', label: '巡检单编码', minWidth: 150, showOverflowtooltip: true },
{ prop: 'department', label: '部门', showOverflowtooltip: true }, { prop: 'department', label: '部门', showOverflowtooltip: true },
{ prop: 'planCheckTime', label: '计划巡检时间', filter: parseTime }, { prop: 'planCheckTime', label: '计划巡检时间', width: 150, filter: parseTime },
{ prop: 'confirmTimeLimit', label: '确认时限', showOverflowtooltip: true }, { prop: 'confirmTimeLimit', label: '确认时限', showOverflowtooltip: true },
{ prop: 'groupClass', label: '班次', showOverflowtooltip: true }, { prop: 'groupClass', label: '班次', showOverflowtooltip: true },
{ prop: 'checkPerson', label: '创建人', minWidth: 150, showOverflowtooltip: true }, { prop: 'creator', label: '创建人', showOverflowtooltip: true },
{ prop: 'createTime', label: '创建时间', filter: parseTime }, { prop: 'createTime', label: '创建时间', width: 150, filter: parseTime },
// { prop: 'responsible', label: '' }, // { prop: 'responsible', label: '' },
{ prop: 'remark', label: '备注' } // TODO: { prop: 'remark', label: '备注' } // TODO:
], ],
@ -195,17 +195,20 @@ export default {
pageSize: 10, pageSize: 10,
equipmentId: null, equipmentId: null,
name: null, name: null,
special: false special: false,
status: 0
}, },
// //
form: {}, form: {},
basePath: '/base/equipment-check-order', basePath: '/base/equipment-check-order',
mode: null, mode: null,
groupList: []
}; };
}, },
created() { created() {
this.initSearchBar(); this.initSearchBar();
this.getList(); this.getList();
this.getGroup();
}, },
methods: { methods: {
handleConfirm() { handleConfirm() {
@ -227,6 +230,11 @@ export default {
); );
}); });
}, },
getGroup() {
groupClassesListAll().then(res => {
this.groupList = res.data || []
})
},
/** 查询列表 */ /** 查询列表 */
getList() { getList() {
this.loading = true; this.loading = true;

View File

@ -15,10 +15,10 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item
label="保养计划单号" label="设备保养单号"
prop="maintainOrderNumber" prop="maintainOrderNumber"
:rules="[ :rules="[
{ required: true, message: '请输入保养计划单号', trigger: 'blur' }, { required: true, message: '请输入设备保养单号', trigger: 'blur' },
]"> ]">
<el-input <el-input
v-model="form.maintainOrderNumber" v-model="form.maintainOrderNumber"
@ -227,11 +227,6 @@ export default {
return { return {
form: {}, form: {},
formLoading: true, formLoading: true,
equipmentTypeOptions: [
{ label: '安全设备', value: 1 },
{ label: '消防设备', value: 2 },
{ label: '特种设备', value: 3 },
],
lineList: [], lineList: [],
maintainerList: [], maintainerList: [],
departmentList: [], departmentList: [],
@ -268,7 +263,7 @@ export default {
}, },
}, },
mounted() { mounted() {
// !this.edit && this.getCode('/base/equipment-maintain-plan/getCode'); // !this.edit && this.getCode('/base/equipment-maintain-log/getCode');
this.getList('maintainer'); this.getList('maintainer');
this.getList('department'); this.getList('department');
this.getList('line'); this.getList('line');
@ -309,7 +304,7 @@ export default {
this.formLoading = true; this.formLoading = true;
const response = await this.$axios(url); const response = await this.$axios(url);
this.formLoading = false; this.formLoading = false;
this.form.code = response.data || ''; this.form.maintainOrderNumber = response.data || '';
}, },
// initialize // initialize
async getEquipmentList() { async getEquipmentList() {

View File

@ -14,7 +14,7 @@
custom-class="mes-drawer" custom-class="mes-drawer"
size="60%" size="60%"
@closed="$emit('destroy')"> @closed="$emit('destroy')">
<SmallTitle slot="title">编辑</SmallTitle> <SmallTitle slot="title">{{ showTable ? '编辑' : '新增' }}</SmallTitle>
<div class="drawer-body flex"> <div class="drawer-body flex">
<div class="drawer-body__content"> <div class="drawer-body__content">
@ -184,49 +184,53 @@
</el-form> </el-form>
</div> </div>
<SmallTitle>保养内容</SmallTitle> <div v-if="showTable">
<SmallTitle>保养内容</SmallTitle>
<div style="margin-top: 12px; position: relative"> <div style="margin-top: 12px; position: relative">
<SearchBar <SearchBar
:formConfigs="searchBarFormConfig" :formConfigs="searchBarFormConfig"
ref="attr-search-bar" ref="attr-search-bar"
@headBtnClick="handleSearchBarBtnClick" /> @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> </div>
<base-table
v-loading="attrListLoading"
:table-props="attrTableProps"
:page="attrQuery?.params.pageNo || 1"
:limit="attrQuery?.params.pageSize || 10"
:table-data="attrList"
@emitFun="handleEmitFun">
<method-btn
slot="handleBtn"
label="操作"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
<!-- 分页组件 --> <div style="margin-top: 12px; position: relative">
<pagination <div style="position: absolute; top: -40px; right: 0">
v-show="attrTotal > 0" <el-button @click="handleAddAttr" type="text">
:total="attrTotal" <i class="el-icon-plus"></i>
:page.sync="attrQuery.params.pageNo" 添加属性
:limit.sync="attrQuery.params.pageSize" </el-button>
@pagination="getAttrList" /> </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>
</div> </div>
<div class="drawer-body__footer"> <div class="drawer-body__footer">
<el-button style="" @click="handleCancel">取消</el-button> <el-button style="" @click="handleCancel">取消</el-button>
<el-button type="primary" @click="handleConfirm">保存</el-button> <!-- 新增可确认 -->
<el-button v-if="isAdd" type="primary" @click="addConfirm">保存</el-button>
<el-button v-else type="primary" @click="handleConfirm">保存</el-button>
<!-- sections的第二项必须是 属性列表 --> <!-- sections的第二项必须是 属性列表 -->
<!-- <el-button <!-- <el-button
v-if="sections[1].allowAdd" v-if="sections[1].allowAdd"
@ -292,6 +296,8 @@ export default {
return { return {
visible: false, visible: false,
btnLoading: false, btnLoading: false,
showTable: false,
isAdd: false,
form: {}, form: {},
formLoading: false, formLoading: false,
lineList: [], lineList: [],
@ -387,7 +393,7 @@ export default {
attrListLoading: false, attrListLoading: false,
// syncFileListFlag: null, // syncFileListFlag: null,
tableBtn: [], tableBtn: [],
row: null, row: {},
}; };
}, },
computed: { computed: {
@ -414,11 +420,19 @@ export default {
}, },
}, },
mounted() { mounted() {
!this.edit && this.getCode('/base/equipment-maintain-plan/getCode');
this.getList('maintainer'); this.getList('maintainer');
this.getList('department'); this.getList('department');
this.getList('line'); this.getList('line');
}, },
methods: { methods: {
// getCode
async getCode(url) {
this.formLoading = true;
const response = await this.$axios(url);
this.formLoading = false;
this.form.maintainOrderNumber = response.data || '';
},
handleSearchBarBtnClick(btn) { handleSearchBarBtnClick(btn) {
console.log('btn', btn); console.log('btn', btn);
switch (btn.btnName) { switch (btn.btnName) {
@ -438,23 +452,106 @@ export default {
break; break;
} }
}, },
async addConfirm() {
console.log('11', this.showTable)
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
this.$nextTick(() => {
this.getConfirmed().then(confirm => {
console.log('111', confirm)
this.$axios({
url:
'/base/equipment-maintain-log/confirm?confirmPerson=' +
this.$store.getters.userId,
method: 'put',
data: [this.form.id],
}).then(res =>{
if (res.code == 0) {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('已确认');
}
})
}).catch(() => {
this.visible = false;
this.$emit("refreshDataList");
this.$message.success('取消确认');
})
})
});
},
getConfirmed() {
return this.$confirm('是否直接确认保养记录', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
});
},
async handleConfirm() { async handleConfirm() {
this.btnLoading = true; this.btnLoading = true;
this.$nextTick(async () => { // this.$nextTick(async () => {
const { code, data } = await this.$axios({ // const { code, data } = await this.$axios({
url: '/base/equipment-maintain-log/update', // url: '/base/equipment-maintain-log/update',
method: 'put', // method: 'put',
// data: {
// ...this.form,
// maintainWorker: this.form.maintainWorker.join(',')
// },
// });
// if (code == 0) {
// this.$modal.msgSuccess('');
// }
// this.btnLoading = false;
// this.$emit('refreshDataList');
// this.handleCancel();
// });
this.$refs['form'].validate((valid) => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
this.$axios({
url: '/base/equipment-maintain-log/update',
method: 'put',
data: {
...this.form,
maintainWorker: this.form.maintainWorker.join(','),
special: false,
relatePlan: 2
}
}).then((response) => {
this.$modal.msgSuccess('修改成功');
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
});
return;
}
//
this.$axios({
url: '/base/equipment-maintain-log/create',
method: 'post',
data: { data: {
...this.form, ...this.form,
maintainWorker: this.form.maintainWorker.join(',') maintainWorker: this.form.maintainWorker.join(','),
}, special: false,
relatePlan: 2,
confirmed: false,
}
}).then((response) => {
this.$modal.msgSuccess('新增成功');
this.btnLoading = false;
this.form.id = response.data
this.row.id = response.data
this.showTable = true
this.isAdd = true
this.$emit('refreshDataList');
// this.handleCancel();
}); });
if (code == 0) {
this.$modal.msgSuccess('更新成功');
}
this.btnLoading = false;
this.$emit('refreshDataList');
this.handleCancel();
}); });
}, },
@ -464,15 +561,22 @@ export default {
init(row) { init(row) {
this.visible = true; this.visible = true;
this.row = row; if (row) {
this.getInfo(row); this.row = row;
this.getAttrList(row); this.showTable = row ? true : false;
this.$nextTick(() => {
if (row.id) {
this.getInfo(row.id);
this.getAttrList(row.id);
}
})
}
}, },
async getInfo(row) { async getInfo(id) {
this.formLoading = true; this.formLoading = true;
const res = await this.$axios( const res = await this.$axios(
'/base/equipment-maintain-log/get?id=' + row.id '/base/equipment-maintain-log/get?id=' + id
); );
if (res.code == 0) { if (res.code == 0) {
this.form = res.data; this.form = res.data;
@ -482,15 +586,15 @@ export default {
this.formLoading = false; this.formLoading = false;
}, },
async getAttrList(row, condition = {}) { async getAttrList(id, condition = {}) {
if (!row) row = this.row; if (!id) id = this.row.id;
this.attrListLoading = true; this.attrListLoading = true;
const res = await this.$axios({ const res = await this.$axios({
url: '/base/equipment-maintain-log-det/page', url: '/base/equipment-maintain-log-det/page',
method: 'get', method: 'get',
params: { params: {
...this.attrQuery.params, ...this.attrQuery.params,
logId: row.id, logId: id,
...condition, ...condition,
}, },
}); });

View File

@ -258,17 +258,27 @@ export default {
this.$message.warning('请选择待确认的设备保养记录'); this.$message.warning('请选择待确认的设备保养记录');
return; return;
} }
const res = await this.$axios({ this.$modal
url: '/base/equipment-maintain-log/confirm', .confirm('是否确认所有选中保养单"?')
method: 'put', .then(() => {
data: this.$refs['waiting-list-table'].selectedPlan.map( return this.$axios({
(item) => item.id url: '/base/equipment-maintain-log/confirm',
), method: 'put',
}); data: this.$refs['waiting-list-table'].selectedPlan.map(
if (res.code == 0) { (item) => item.id
this.$message.success('确认成功'); ),
this.getList(); });
} // if (res.code == 0) {
// this.$message.success('');
// this.getList();
// }
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
break; break;
} }
}, },
@ -412,9 +422,13 @@ export default {
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset(); // this.reset();
this.open = true; // this.open = true;
this.title = '添加待确认保养记录'; // this.title = '';
this.openUnplannedDrawer = true;
this.$nextTick(() => {
this.$refs.unplanned.init();
});
}, },
getConfirmed() { getConfirmed() {
@ -478,15 +492,25 @@ export default {
}, },
/** 确认 */ /** 确认 */
async handleConfirm(row) { async handleConfirm(row) {
const res = await this.$axios({ this.$modal
url: '/base/equipment-maintain-log/confirm', .confirm('是否确认保养单"' + row.maintainOrderNumber + '"?')
method: 'put', .then(() => {
data: [row.id], return this.$axios({
}); url: '/base/equipment-maintain-log/confirm',
if (res.code == 0) { method: 'put',
this.$message.success('确认成功'); data: [row.id],
this.getList(); });
} // if (res.code == 0) {
// this.$message.success('');
// this.getList();
// }
})
.then((res) => {
this.getList();
res.code == 0 && this.$modal.msgSuccess('确认成功');
res.code != 0 && this.$modal.msgError('确认失败');
})
.catch(() => {});
}, },
/** 编辑 */ /** 编辑 */
async handleEdit(row) { async handleEdit(row) {

View File

@ -47,6 +47,7 @@
<add-content <add-content
v-if="addContent" v-if="addContent"
ref="addContent" ref="addContent"
:plan="true"
@refreshDataList="addContent = false" /> @refreshDataList="addContent = false" />
</div> </div>
</template> </template>
@ -141,7 +142,7 @@ export default {
label: '上次实际保养时间', label: '上次实际保养时间',
filter: parseTime, filter: parseTime,
}, },
{ prop: 'nextMaintainTime', label: '下次计划保养时间', filter: parseTime }, { prop: 'nextPlanMaintainTime', label: '下次计划保养时间', filter: parseTime },
{ prop: 'maintainer', label: '计划保养人员' }, { prop: 'maintainer', label: '计划保养人员' },
// { prop: 'equipmentName', label: '' }, // { prop: 'equipmentName', label: '' },
// { prop: 'equipmentCode', label: '' }, // { prop: 'equipmentCode', label: '' },
@ -219,13 +220,13 @@ export default {
params.pageNo = undefined; params.pageNo = undefined;
params.pageSize = undefined; params.pageSize = undefined;
this.$modal this.$modal
.confirm('是否确认导出所有设备保养监控数据项?') .confirm('是否确认导出所有设备保养计划数据项?')
.then(() => { .then(() => {
this.exportLoading = true; this.exportLoading = true;
return exportMaintainMonitorExcel(params); return exportMaintainMonitorExcel(params);
}) })
.then((response) => { .then((response) => {
this.$download.excel(response, '设备保养监控.xls'); this.$download.excel(response, '设备保养计划.xls');
this.exportLoading = false; this.exportLoading = false;
}) })
.catch(() => { }); .catch(() => { });

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-02-27 10:33:31 * @LastEditTime: 2024-02-28 19:52:13
* @Description: * @Description:
--> -->
<template> <template>
@ -22,7 +22,6 @@
:rules="dataRule" :rules="dataRule"
ref="dataForm" ref="dataForm"
@keyup.enter.native="dataFormSubmit()" @keyup.enter.native="dataFormSubmit()"
label-width="100px"
label-position="top"> label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
@ -62,19 +61,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养频率" prop="maintenancePeriod"> <el-form-item label="保养频率(天/次)" prop="maintenancePeriod">
<el-input-number v-model="dataForm.maintenancePeriod" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入保养频率" /> <el-input-number v-model="dataForm.maintenancePeriod" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入保养频率" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="确认时限" prop="confirmTimeLimit"> <el-form-item label="确认时限(h)" prop="confirmTimeLimit">
<el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" /> <el-input-number v-model="dataForm.confirmTimeLimit" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入单位平方数" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="保养时长" prop="maintainDuration"> <el-form-item label="保养时长(h)" prop="maintainDuration">
<el-input-number v-model="dataForm.maintainDuration" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入保养时长" /> <el-input-number v-model="dataForm.maintainDuration" :min="0" controls-position="right" style="width: 100%" :disabled="isdetail" clearable placeholder="请输入保养时长" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -220,6 +219,12 @@ export default {
// //
this.urlOptions.infoURL({ id: this.dataForm.id }).then(response => { this.urlOptions.infoURL({ id: this.dataForm.id }).then(response => {
this.dataForm = response.data this.dataForm = response.data
if (response.data?.maintainer) {
this.dataForm.maintainer = response.data?.maintainer.split(',') || undefined
} else {
this.$set(this.dataForm, 'maintainer', undefined)
this.dataForm.maintainer = undefined
}
}); });
// //
// this.getList(); // this.getList();

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-02-23 19:48:12 * @LastEditTime: 2024-02-28 19:37:19
* @Description: * @Description:
--> -->
<template> <template>
@ -13,7 +13,7 @@
class="drawer" class="drawer"
size="60%"> size="60%">
<small-title slot="title" :no-padding="true"> <small-title slot="title" :no-padding="true">
{{ '添加内容' }} {{ plan ? '详情' : '添加内容' }}
</small-title> </small-title>
<div class="content"> <div class="content">
<div class="visual-part"> <div class="visual-part">
@ -62,7 +62,7 @@
</template> </template>
</div> </div>
<base-table <base-table
:table-props="tableProps" :table-props="plan ? tableProps1 : tableProps"
:page="listQuery.pageNo" :page="listQuery.pageNo"
:limit="listQuery.pageSize" :limit="listQuery.pageSize"
:table-data="planList"> :table-data="planList">
@ -85,7 +85,7 @@
<div v-if="!isdetail" class="drawer-body__footer"> <div v-if="!isdetail" class="drawer-body__footer">
<el-button style="" @click="goback()">取消</el-button> <el-button style="" @click="goback()">取消</el-button>
<el-button type="primary" @click="dataFormSubmit()">确定</el-button> <el-button type="primary" @click="goback()">确定</el-button>
</div> </div>
</div> </div>
@ -128,13 +128,35 @@ const tableProps = [
}, },
]; ];
const tableProps1 = [
{
prop: 'equipmentName',
label: '设备名称',
},
{
prop: 'program',
label: '保养项目',
},
{
prop: 'maintenanceDes',
label: '保养描述',
},
];
export default { export default {
mixins: [basicAdd], mixins: [basicAdd],
components: { SmallTitle, attrAdd }, components: { SmallTitle, attrAdd },
props: {
plan: {
type: Boolean,
default: false
}
},
data() { data() {
return { return {
tableBtn, tableBtn,
tableProps, tableProps,
tableProps1,
addOrUpdateVisible: false, addOrUpdateVisible: false,
urlOptions: { urlOptions: {
isGetCode: false, isGetCode: false,

View File

@ -160,6 +160,7 @@ export default {
label: '保养计划名称', label: '保养计划名称',
placeholder: '请选择计划名称', placeholder: '请选择计划名称',
param: 'maintainPlanId', param: 'maintainPlanId',
filterable: true
}, },
// //
{ {
@ -339,6 +340,7 @@ export default {
startTime: null, startTime: null,
relatePlan: null, relatePlan: null,
equipmentId: null, equipmentId: null,
confirmed: true
}, },
// //
form: {}, form: {},
@ -349,20 +351,20 @@ export default {
created() { created() {
this.initSearchBar(); this.initSearchBar();
if (this.$route.query) { if (this.$route.query) {
this.queryParams.equipmentId = // this.queryParams.equipmentId =
this.$route.query?.equipmentId ?? undefined; // this.$route.query?.equipmentId ?? undefined;
this.queryParams.maintainPlanId = this.queryParams.maintainPlanId =
this.$route.query?.maintainPlanId ?? undefined; this.$route.query?.maintainPlanId ?? undefined;
this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined; // this.queryParams.relatePlan = this.$route.query?.relatePlan ?? undefined;
this.queryParams.startTime = this.$route.query?.createTime ?? undefined; this.queryParams.startTime = this.$route.query?.createTime ?? undefined;
// this.searchBarFormConfig[0].defaultSelect =
// this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[0].defaultSelect = this.searchBarFormConfig[0].defaultSelect =
this.$route.query.equipmentId ?? undefined;
this.searchBarFormConfig[1].defaultSelect =
this.$route.query.maintainPlanId ?? undefined; this.$route.query.maintainPlanId ?? undefined;
this.searchBarFormConfig[2].defaultSelect = this.searchBarFormConfig[1].defaultSelect =
this.$route.query?.createTime ?? undefined; this.$route.query?.createTime ?? undefined;
this.searchBarFormConfig[3].defaultSelect = // this.searchBarFormConfig[3].defaultSelect =
Number(this.$route.query.relatePlan) ?? undefined; // Number(this.$route.query.relatePlan) ?? undefined;
} }
this.getList(); this.getList();
if (this.$route.query.addRecord) { if (this.$route.query.addRecord) {
@ -383,26 +385,27 @@ export default {
} }
}, },
initSearchBar() { initSearchBar() {
this.http('/base/core-equipment/page', 'get', { // this.http('/base/core-equipment/page', 'get', {
special: false, // special: false,
pageNo: 1, // pageNo: 1,
pageSize: 99 // pageSize: 99
}).then(({ data }) => { // }).then(({ data }) => {
this.$set( // this.$set(
this.searchBarFormConfig[0], // this.searchBarFormConfig[0],
'selectOptions', // 'selectOptions',
(data?.list || []).map((item) => ({ // (data?.list || []).map((item) => ({
name: item.name, // name: item.name,
id: item.id, // id: item.id,
})) // }))
); // );
}); // });
this.http('/base/equipment-maintain-plan/page', 'get', { this.http('/base/equipment-maintain-plan/page', 'get', {
pageNo: 1, pageNo: 1,
pageSize: 100, pageSize: 100,
special: false
}).then(({ data }) => { }).then(({ data }) => {
this.$set( this.$set(
this.searchBarFormConfig[1], this.searchBarFormConfig[0],
'selectOptions', 'selectOptions',
(data?.list || []).map((item) => ({ (data?.list || []).map((item) => ({
name: item.name, name: item.name,
@ -544,6 +547,7 @@ export default {
let params = { ...this.queryParams }; let params = { ...this.queryParams };
params.pageNo = undefined; params.pageNo = undefined;
params.pageSize = undefined; params.pageSize = undefined;
params.confirmed = true;
this.$modal this.$modal
.confirm('是否确认导出所有保养记录?') .confirm('是否确认导出所有保养记录?')
.then(() => { .then(() => {

View File

@ -680,7 +680,8 @@ export default {
file.type === 'image/jpg'; file.type === 'image/jpg';
return isJPG; return isJPG;
}; };
return checkFileSize() && checkFileType(); return checkFileSize();
// return checkFileSize() && checkFileType();
}, },
// handlers // handlers

View File

@ -17,7 +17,7 @@
v-if="tableBtn.length" v-if="tableBtn.length"
slot="handleBtn" slot="handleBtn"
label="操作" label="操作"
:width="180" :width="90"
:method-list="tableBtn" :method-list="tableBtn"
@clickBtn="handleTableBtnClick" /> @clickBtn="handleTableBtnClick" />
</base-table> </base-table>
@ -111,11 +111,13 @@ export default {
{ {
prop: 'maintenanceStartTime', prop: 'maintenanceStartTime',
label: '维修开始时间', label: '维修开始时间',
width: 150,
filter: parseTime, filter: parseTime,
}, },
{ {
prop: 'maintenanceFinishTime', prop: 'maintenanceFinishTime',
label: '维修结束时间', label: '维修结束时间',
width: 150,
filter: parseTime, filter: parseTime,
}, },
// { prop: 'maintenanceStartTime', label: '', filter: parseTime }, // { prop: 'maintenanceStartTime', label: '', filter: parseTime },
@ -128,7 +130,7 @@ export default {
{ prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, // { prop: 'maintenanceDetail', label: '维修描述', subcomponent: htmls }, //
// { prop: 'repairman', label: '', minWidth: 100, showOverflowtooltip: true }, // { prop: 'repairman', label: '', minWidth: 100, showOverflowtooltip: true },
// { prop: 'repairmanPhone', label: '', minWidth: 100, showOverflowtooltip: true }, // { prop: 'repairmanPhone', label: '', minWidth: 100, showOverflowtooltip: true },
{ prop: 'remark', label: '备注', minWidth: 120, showOverflowtooltip: true } { prop: 'remark', label: '备注', minWidth: 90, showOverflowtooltip: true }
], ],
searchBarFormConfig: [ searchBarFormConfig: [
{ {

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 (this.queryParams.workOrderId === item.id) { if (val.data.workOrderId === item.id) {
this.workOrderName = item.name this.workOrderName = item.name
} }
}) })
params.workOrderId = this.queryParams.workOrderId params.workOrderId = val.data.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

@ -0,0 +1,97 @@
<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,11 +1,12 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<search-bar <search-area @submit="buttonClick"/>
<!-- <search-bar
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" @headBtnClick="buttonClick"
/> /> -->
<!-- 列表 --> <!-- 列表 -->
<base-table <base-table
:page="queryParams.pageNo" :page="queryParams.pageNo"
@ -34,10 +35,11 @@
</div> </div>
</template> </template>
<script> <script>
import { groupTeamSchedulingPage, groupClassesListAll } from '@/api/monitoring/teamProduction' import { groupTeamSchedulingPage } 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',
@ -139,12 +141,11 @@ export default {
paramVisible: false paramVisible: false
} }
}, },
components: { TeamProductionDetail }, components: { TeamProductionDetail, SearchArea },
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: {
@ -163,11 +164,6 @@ 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,13 +236,8 @@ 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',
@ -283,7 +278,7 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 3 value: 2
} }
] ]
} }
@ -383,9 +378,9 @@ export default {
}, },
// , // ,
handleEditStatus(val, tip, status) { handleEditStatus(val, tip, status) {
console.log(val) let _this = this
if (val.orderIdNum > 0) {// if (val.orderIdNum > 0) {//
this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', { _this.$confirm('是否将"'+tip+'"操作同步至下级订单和工单?','确认信息', {
type: 'warning', type: 'warning',
distinguishCancelAndClose: true, distinguishCancelAndClose: true,
confirmButtonText: '同步', confirmButtonText: '同步',
@ -393,26 +388,26 @@ export default {
}).then(function() { }).then(function() {
console.log('同步') console.log('同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => { groupOrderStatusSet({ id: val.id, status: status, isSync: true}).then(() => {
this.getList(); _this.getList();
this.$modal.msgSuccess("操作成功"); _this.$modal.msgSuccess("操作成功");
}) })
}).catch(action => { }).catch(action => {
if (action === 'cancel') { if (action === 'cancel') {
console.log('不同步') console.log('不同步')
groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => { groupOrderStatusSet({ id: val.id, status: status, isSync: false}).then(() => {
this.getList(); _this.getList();
this.$modal.msgSuccess("操作成功"); _this.$modal.msgSuccess("操作成功");
}) })
}else { }else {
return console.log('关闭') return console.log('关闭')
} }
}) })
}else{// }else{//
this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() { _this.$modal.confirm('是否确认"'+tip+'"集团订单名称为"' + val.name + '"的数据项?').then(function() {
return groupOrderStatusSet({ id: val.id, status: status}) return groupOrderStatusSet({ id: val.id, status: status})
}).then(() => { }).then(() => {
this.getList(); _this.getList();
this.$modal.msgSuccess("操作成功"); _this.$modal.msgSuccess("操作成功");
}).catch(() => {}); }).catch(() => {});
} }
}, },

View File

@ -175,16 +175,38 @@ export default {
} }
if (this.isEdit) { if (this.isEdit) {
// //
orderUpdate({ ...this.form }).then((res) => { orderUpdate({
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 {
this.form.status = 1 orderCreate({
this.form.triggerOrigin = 1 code: this.form.code,
orderCreate({ ...this.form }).then((res) => { 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,
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,20 +244,15 @@ export default {
btnName: '终止', btnName: '终止',
showTip: '终止', showTip: '终止',
showParam: { showParam: {
type: '|', type: '&',
data: [ data: [
{ {
type: 'equal', type: 'equal',
name: 'status', name: 'status',
value: 2 value: 3
}, }
{ ]
type: 'equal', }
name: 'status',
value: 3
}
]
}
} }
: undefined, : undefined,
this.$auth.hasPermi('base:order-manage:cancel') this.$auth.hasPermi('base:order-manage:cancel')
@ -293,7 +288,7 @@ export default {
{ {
type: 'less', type: 'less',
name: 'status', name: 'status',
value: 3 value: 2
} }
] ]
} }

View File

@ -51,10 +51,7 @@
{{ scope.row.planCheckTime | timeFilter }} {{ scope.row.planCheckTime | timeFilter }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column v-if="selectedBox[3]" label="班次" prop="groupClass">
v-if="selectedBox[3]"
label="班次"
prop="groupClass">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.groupClass || '---' }} {{ scope.row.groupClass || '---' }}
</template> </template>
@ -129,7 +126,7 @@ import moment from 'moment';
export default { export default {
name: 'CheckOrderListTable', name: 'CheckOrderListTable',
components: {}, components: {},
props: ['tableData', 'page', 'limit'], props: ['tableData', 'page', 'limit', 'permissionGuard'],
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') : '---',
@ -170,12 +167,7 @@ export default {
}, },
methods: { methods: {
checkSelectable(row, index) { checkSelectable(row, index) {
return true; return this.permissionGuard(row);
// 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,6 +121,11 @@ 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,6 +50,31 @@
</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="请输入备注" />
@ -60,6 +85,8 @@
</template> </template>
<script> <script>
import { groupConnectWorkshop } from '@/utils/equipment-module';
export default { export default {
name: 'ContentAdd', name: 'ContentAdd',
data() { data() {
@ -69,7 +96,9 @@ export default {
id: null, id: null,
name: null, name: null,
departmentId: null, departmentId: null,
groupClass: null, groupClass: [],
checkPerson: [],
planCheckTime: null,
// special: true, // special: true,
}, },
dataRule: { dataRule: {
@ -80,6 +109,7 @@ export default {
equipmentOptions: [], equipmentOptions: [],
groupOptions: [], groupOptions: [],
departmentOptions: [], departmentOptions: [],
inspectorOptions: [],
}; };
}, },
mounted() { mounted() {
@ -91,7 +121,9 @@ export default {
id: null, id: null,
name: null, name: null,
departmentId: null, departmentId: null,
groupClass: null, groupClass: [],
checkPerson: [],
planCheckTime: null,
// special: true, // special: true,
}; };
}, },
@ -114,10 +146,35 @@ export default {
} }
if (grp.code == 0) { if (grp.code == 0) {
this.groupOptions = grp.data.map((item) => ({ this.groupOptions = grp.data.map((item) => ({
label: item.name, label: groupConnectWorkshop(item.name, item.roomNameDict),
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;
@ -127,6 +184,8 @@ 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({
@ -173,8 +232,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.$store.getters.userId, checkPerson: this.dataForm.checkPerson?.join(','),
}, },
}); });
if (res.code == 0) { if (res.code == 0) {

View File

@ -268,8 +268,8 @@ export default {
} }
}, },
getConfirmed() { getConfirmed(message = '是否直接确认巡检记录') {
return this.$confirm('是否直接确认巡检记录', '提示', { return this.$confirm(message, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning', type: 'warning',
@ -281,25 +281,31 @@ export default {
return this.$message.error('请添加巡检内容'); return this.$message.error('请添加巡检内容');
} }
let confirmed = false; /** 询问 是否保存记录 */
try { try {
confirmed = await this.getConfirmed(); if (await this.getConfirmed('是否保存记录')) {
} catch (err) { /** 询问 是否直接确认 */
confirmed = false; try {
} 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('已确认');
}
}
if (confirmed) { this.$emit('refreshDataList');
const res = await this.$axios({ this.handleCancel();
url: } catch (err) {
'/base/equipment-check-order/confirm?confirmPerson=' + this.handleCancel();
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 () => {
@ -319,8 +325,6 @@ export default {
// this.$emit('refreshDataList'); // this.$emit('refreshDataList');
// this.handleCancel(); // this.handleCancel();
// }); // });
this.$emit('refreshDataList');
this.handleCancel();
}, },
handleEmitFun(val) { handleEmitFun(val) {

View File

@ -29,7 +29,16 @@
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 label="巡检单名称" prop="name"> <el-form-item
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"
@ -196,6 +205,7 @@
<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',
@ -230,7 +240,15 @@ 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: [],
@ -411,24 +429,41 @@ 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 () => {
const { code, data } = await this.$axios({ try {
url: '/base/equipment-check-order/update', const valid = await this.$refs['form'].validate();
method: 'put', if (!valid) return;
data: { const { code, data } = await this.$axios({
...this.form, url: '/base/equipment-check-order/update',
groupClass: this.form.groupClass.join(','), method: 'put',
checkPerson: this.form.checkPerson.join(','), data: {
}, ...this.form,
}); groupClass: this.form.groupClass?.join(','),
if (code == 0) { checkPerson: this.form.checkPerson?.join(','),
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();
}); });
}, },
@ -445,14 +480,25 @@ export default {
}, },
async getInfo(row) { async getInfo(row) {
console.log('row', row); this.resetForm();
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) {
this.form = res.data; Object.keys(this.form).forEach((key) => {
this.form.groupClass = res.data.groupClass.split(','); if (key == 'groupClass' || key == 'checkPerson') {
this.form.checkPerson = res.data.checkPerson?.split(','); this.form[key] =
(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;
@ -497,8 +543,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.username, label: item.nickname,
value: item.id, value: item.nickname,
})) }))
); );
} }
@ -507,7 +553,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.id, value: item.name,
})) }))
); );
} }
@ -516,7 +562,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: item.name, label: groupConnectWorkshop(item.name, item.roomNameDict),
value: item.id, value: item.id,
})); }));
break; break;
@ -524,22 +570,6 @@ 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,6 +18,7 @@
: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"
@ -177,6 +178,7 @@ export default {
pageSize: 10, pageSize: 10,
name: null, name: null,
status: 1, status: 1,
special: true,
}, },
// //
form: {}, form: {},
@ -255,10 +257,17 @@ export default {
this.$message.warning('请选择待确认的巡检单'); this.$message.warning('请选择待确认的巡检单');
return; return;
} }
const res = await this.$axios({ let checkPersonParam = '';
if (!row.checkPerson || row.checkPerson.trim() == '') {
/** 如有必要,更新巡检人 */
checkPersonParam = `&checkPerson=${this.$store.getters.nickname}`;
}
const res = this.$axios({
url: url:
'/base/equipment-check-order/confirm?confirmPerson=' + `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` +
this.$store.getters.userId, checkPersonParam,
// '/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
@ -296,6 +305,16 @@ 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;
@ -310,10 +329,16 @@ 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=' + `/base/equipment-check-order/confirm?confirmPerson=${this.$store.getters.nickname}` +
this.$store.getters.userId, checkPersonParam,
// '/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],
@ -349,16 +374,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">
{{ form.name }} <div style="">{{ form.name }}</div>
</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">
{{ form.department }} <div style="">{{ form.department }}</div>
</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">
{{ form.groupClass }} <div style="">{{ form.groupClass || '---' }}</div>
</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">
{{ form.checkPerson }} <div style="">{{ form.checkPerson || '---' }}</div>
</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">
{{ form.planCheckTime | parseTime }} <div style="">{{ form.planCheckTime | parseTime }}</div>
</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">
{{ form.confirmPerson }} <div style="">{{ form.confirmPerson || '---' }}</div>
</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.username, label: item.nickname,
value: item.id, value: item.nickname,
})) }))
); );
} }

View File

@ -15,33 +15,17 @@
v-loading="formLoading" v-loading="formLoading"
label-position="top"> label-position="top">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col> <el-col :span="12">
<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> <el-col :span="12">
<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> <el-col :span="12">
<el-form-item
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select
v-model="dataForm.departmentId"
:placeholder="`请选择部门`">
<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>
<el-form-item label="计划巡检时间" prop="planCheckTime"> <el-form-item label="计划巡检时间" prop="planCheckTime">
<el-date-picker <el-date-picker
v-model="dataForm.planCheckTime" v-model="dataForm.planCheckTime"
@ -51,15 +35,24 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="确认时限 (时)" prop="confirmTimeLimit"> <el-form-item label="巡检频率(天/次)" prop="checkPeriod">
<el-input <el-input
v-model="dataForm.confirmTimeLimit" v-model="dataForm.checkPeriod"
:placeholder="`请输入确认时限`" /> placeholder="请输入巡检频率(天/次)" />
<!-- <el-date-picker </el-form-item>
v-model="dataForm.confirmTimeLimit" </el-col>
type="datetime"
:placeholder="`请选择确认时限`" <el-col :span="12">
value-format="timestamp" /> --> <el-form-item label="部门" prop="departmentId">
<el-select
v-model="dataForm.departmentId"
:placeholder="`请选择部门`">
<el-option
v-for="opt in departmentOptions"
:key="opt.value"
:label="opt.label"
:value="opt.value" />
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
@ -79,6 +72,20 @@
</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="请输入备注" />
@ -89,6 +96,8 @@
</template> </template>
<script> <script>
import { groupConnectWorkshop } from '@/utils/equipment-module';
export default { export default {
data() { data() {
return { return {
@ -107,6 +116,12 @@ 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' },
@ -117,6 +132,15 @@ 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: [],
@ -137,6 +161,7 @@ export default {
confirmTimeLimit: null, confirmTimeLimit: null,
groupClass: null, groupClass: null,
remark: null, remark: null,
checkPeriod: null
// special: true, // special: true,
}; };
}, },
@ -160,7 +185,7 @@ export default {
} }
if (grp.code == 0) { if (grp.code == 0) {
this.groupOptions = grp.data.map((item) => ({ this.groupOptions = grp.data.map((item) => ({
label: item.name, label: groupConnectWorkshop(item.name, item.roomNameDict),
value: item.id, value: item.id,
})); }));
} }
@ -186,7 +211,10 @@ 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 = res.data.groupClass.split(',') this.dataForm.groupClass =
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>{{ parseTime(dataForm.faultTime) }}</span> <span style="color: #000a;">{{ 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> <span style="color: #000a;">
{{ 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> <span style="color: #000a;">
{{ 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>{{ dataForm.repairman }}</span> <span style="color: #000a;">{{ 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>{{ dataForm.repairmanPhone }}</span> <span style="color: #000a;">{{ 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> <span style="color: #000a;">
{{ 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>暂无附件</p> <p v-else style="color: #000a;">暂无附件</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>{{ parseTime(dataForm.createTime) }}</span> <span style="color: #000a;">{{ 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>{{ dataForm.creator }}</span> <span style="color: #000a;">{{ 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>{{ dataForm.remark }}</span> <span style="color: #000a;">{{ dataForm.remark || '- 无 -' }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -159,8 +159,7 @@ const uploadedFile = {
document.body.removeChild(link); document.body.removeChild(link);
}, },
}, },
mounted() { mounted() {},
},
render: function (h) { render: function (h) {
return ( return (
<div <div
@ -338,6 +337,10 @@ 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,7 +27,6 @@
<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,10 +44,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="部门" prop="departmentId">
label="部门"
prop="departmentId"
:rules="[{ required: true, message: '请选择部门', trigger: 'blur' }]">
<el-select <el-select
v-model="form.departmentId" v-model="form.departmentId"
:placeholder="`请选择部门`" :placeholder="`请选择部门`"
@ -84,10 +81,7 @@
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item <el-form-item label="产线" prop="lineId">
label="产线"
prop="lineId"
:rules="[{ required: true, message: '请选择产线', trigger: 'blur' }]">
<el-select <el-select
v-model="form.lineId" v-model="form.lineId"
:placeholder="`请选择产线`" :placeholder="`请选择产线`"
@ -183,6 +177,7 @@
label="保养时长(h)" label="保养时长(h)"
prop="maintainDuration" prop="maintainDuration"
:rules="[ :rules="[
{ required: true, message: '保养时长不能为空', trigger: 'blur' },
{ {
type: 'number', type: 'number',
message: '请输入正确的数字', message: '请输入正确的数字',

View File

@ -27,7 +27,6 @@
<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
@ -130,8 +129,8 @@
width="35%" width="35%"
:append-to-body="true" :append-to-body="true"
custom-class="baseDialog" custom-class="baseDialog"
@close="closeDetailForm" @close="detailAddVisible = false"
@cancel="closeDetailForm" @cancel="detailAddVisible = false"
@confirm="submitDetailForm"> @confirm="submitDetailForm">
<DialogForm <DialogForm
v-if="detailAddVisible" v-if="detailAddVisible"
@ -238,7 +237,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,
@ -318,9 +317,21 @@ 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) => {
@ -411,7 +422,10 @@ export default {
} }
}, },
handleAddDetail() { handleAddDetail() {
this.detailAddVisible = true; this.resetForm();
this.$nextTick(() => {
this.detailAddVisible = true;
});
}, },
}, },
}; };

View File

@ -63,7 +63,6 @@
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';
@ -102,8 +101,13 @@ 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: 144, prop: 'maintenancePeriod', label: '保养频率(天/次)' }, { width: 132, 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,16 +116,7 @@
<!-- 故障级别 --> <!-- 故障级别 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="故障级别" prop="faultLevel">
label="故障级别"
prop="faultLevel"
:rules="[
{
required: true,
message: '故障级别不能为空',
trigger: 'blur',
},
]">
<el-select <el-select
v-model="form.faultLevel" v-model="form.faultLevel"
placeholder="故障级别" placeholder="故障级别"
@ -216,12 +207,7 @@
<!-- 维修工 --> <!-- 维修工 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="维修工" prop="repairman">
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)"
@ -241,12 +227,7 @@
<!-- 联系方式 --> <!-- 联系方式 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="联系方式" prop="repairmanPhone">
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)"
@ -257,16 +238,7 @@
<!-- 维修方式 - 数据字典 --> <!-- 维修方式 - 数据字典 -->
<el-col :span="8"> <el-col :span="8">
<el-form-item <el-form-item label="维修方式" prop="repairMode">
label="维修方式"
prop="repairMode"
:rules="[
{
required: true,
message: '维修方式不能为空',
trigger: 'blur',
},
]">
<el-select <el-select
v-model="form.repairMode" v-model="form.repairMode"
placeholder="维修方式" placeholder="维修方式"
@ -308,7 +280,7 @@
</el-col> </el-col>
<!-- 备注 --> <!-- 备注 -->
<el-col :span="24"> <el-col :span="8">
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input <el-input
v-model="form.remark" v-model="form.remark"
@ -544,16 +516,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 ?? [];
@ -591,9 +563,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();
@ -602,36 +574,37 @@ export default {
/** 设置默认维修工为用户自己 */ /** 设置默认维修工为用户自己 */
setInitWorker() { setInitWorker() {
/** 获取用户自身id */ /** 获取用户自身id */
const userId = this.$store.getters.userId; const nickname = this.$store.getters.nickname;
this.$nextTick(() => { this.$nextTick(() => {
this.form.repairman = [userId]; this.form.repairman = [nickname];
}); });
}, },
/** 获取产线 */ /** 获取产线 */
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');
@ -642,8 +615,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() {
@ -658,8 +631,8 @@ export default {
}); });
list = list.concat( list = list.concat(
(userList.data?.list || []).map((item) => ({ (userList.data?.list || []).map((item) => ({
label: item.username, label: item.nickname,
value: item.id, value: item.nickname,
})) }))
); );
/** worker */ /** worker */
@ -669,7 +642,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.id, value: item.name,
})) }))
); );
/** setting */ /** setting */

View File

@ -42,6 +42,7 @@
<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">
@ -146,6 +147,7 @@ export default {
label: '故障明细', label: '故障明细',
minWidth: 120, minWidth: 120,
showOverflowtooltip: true, showOverflowtooltip: true,
subcomponent: htmls,
}, },
{ {
prop: 'maintenanceStartTime', prop: 'maintenanceStartTime',
@ -172,6 +174,7 @@ export default {
label: '维修描述', label: '维修描述',
showOverflowtooltip: true, showOverflowtooltip: true,
width: 110, width: 110,
subcomponent: htmls,
}, },
{ {
prop: 'remark', prop: 'remark',