|
@@ -83,11 +83,11 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="设备分类" prop="classify">
|
|
|
|
|
|
|
+ <el-form-item label="设备分类" prop="categoryLevelId">
|
|
|
<ele-tree-select
|
|
<ele-tree-select
|
|
|
clearable
|
|
clearable
|
|
|
:data="classifyTree"
|
|
:data="classifyTree"
|
|
|
- v-model="addForm.classify"
|
|
|
|
|
|
|
+ v-model="addForm.categoryLevelId"
|
|
|
placeholder="请选择"
|
|
placeholder="请选择"
|
|
|
default-expand-all
|
|
default-expand-all
|
|
|
labelKey="name"
|
|
labelKey="name"
|
|
@@ -147,12 +147,13 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8" v-if="addForm.autoOrder">
|
|
<el-col :span="8" v-if="addForm.autoOrder">
|
|
|
- <el-form-item :label="formLabel + '人员'" prop="executeId">
|
|
|
|
|
|
|
+ <el-form-item :label="formLabel + '人员'" prop="executeIdList">
|
|
|
<el-select
|
|
<el-select
|
|
|
- v-model="addForm.executeId"
|
|
|
|
|
|
|
+ v-model="addForm.executeIdList"
|
|
|
size="small"
|
|
size="small"
|
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
- :disabled="isBindPlan"
|
|
|
|
|
|
|
+ :disabled="isBindPlan"
|
|
|
|
|
+ multiple
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="item in executorList"
|
|
v-for="item in executorList"
|
|
@@ -341,8 +342,7 @@ import AddSpareDialog from '@/components/addSpareDialog'
|
|
|
// import { mapGetters } from 'vuex'
|
|
// import { mapGetters } from 'vuex'
|
|
|
// import { getRuleNameList } from '@/api/stockManagement/stocking'
|
|
// import { getRuleNameList } from '@/api/stockManagement/stocking'
|
|
|
import {deepClone} from "@/utils"
|
|
import {deepClone} from "@/utils"
|
|
|
-
|
|
|
|
|
- import { getRule , getCategory , getAssetList , saveOrUpdate } from '@/api/ruleManagement/plan';
|
|
|
|
|
|
|
+ import { getRule , getCategory , getAssetList , saveOrUpdate , getInfoById } from '@/api/ruleManagement/plan';
|
|
|
import { getDetail , getCode } from '@/api/ruleManagement/matter';
|
|
import { getDetail , getCode } from '@/api/ruleManagement/matter';
|
|
|
import { listOrganizations , getUserPage } from '@/api/system/organization';
|
|
import { listOrganizations , getUserPage } from '@/api/system/organization';
|
|
|
import { getTreeByType } from '@/api/classifyManage'
|
|
import { getTreeByType } from '@/api/classifyManage'
|
|
@@ -395,13 +395,12 @@ export default {
|
|
|
categoryId: '', // 设备类别id
|
|
categoryId: '', // 设备类别id
|
|
|
approvalUserId: '', // 审核人id
|
|
approvalUserId: '', // 审核人id
|
|
|
groupId: '', // 巡点检部门code
|
|
groupId: '', // 巡点检部门code
|
|
|
- executeId: '', // 巡点检人员id
|
|
|
|
|
|
|
+ executeIdList: [], // 巡点检人员id
|
|
|
executorPhone: '',
|
|
executorPhone: '',
|
|
|
status: 1, // 状态
|
|
status: 1, // 状态
|
|
|
remark: '', // 备注
|
|
remark: '', // 备注
|
|
|
urgent:'',
|
|
urgent:'',
|
|
|
bizType:0
|
|
bizType:0
|
|
|
- // planRuleType: 'PATROL', // 计划规则类型 巡点检: 'PATROL', 保养: 'MAINTAIN', 盘点: 'INVENTORY'
|
|
|
|
|
},
|
|
},
|
|
|
// 计划规则设备列表
|
|
// 计划规则设备列表
|
|
|
planRuleEquiList: [
|
|
planRuleEquiList: [
|
|
@@ -431,7 +430,7 @@ export default {
|
|
|
duration: [
|
|
duration: [
|
|
|
{ required: true, message: '请输入计划完成时长', trigger: 'blur' }
|
|
{ required: true, message: '请输入计划完成时长', trigger: 'blur' }
|
|
|
],
|
|
],
|
|
|
- classify:[
|
|
|
|
|
|
|
+ categoryLevelId:[
|
|
|
{ required: true, message: '请选择设备分类', trigger: 'change' }
|
|
{ required: true, message: '请选择设备分类', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
categoryId: [
|
|
categoryId: [
|
|
@@ -440,7 +439,7 @@ export default {
|
|
|
groupId: [
|
|
groupId: [
|
|
|
{ required: true, message: '请选择巡点检部门', trigger: 'change' }
|
|
{ required: true, message: '请选择巡点检部门', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
- executeId: [
|
|
|
|
|
|
|
+ executeIdList: [
|
|
|
{ required: true, message: '请选择巡点检人员', trigger: 'change' }
|
|
{ required: true, message: '请选择巡点检人员', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
urgent: [
|
|
urgent: [
|
|
@@ -471,12 +470,6 @@ export default {
|
|
|
: this.dialogTitle.includes('保养')
|
|
: this.dialogTitle.includes('保养')
|
|
|
? '保养'
|
|
? '保养'
|
|
|
: '盘点'
|
|
: '盘点'
|
|
|
- // const planRuleTypeObj = {
|
|
|
|
|
- // 巡点检: 'PATROL',
|
|
|
|
|
- // 保养: 'MAINTAIN',
|
|
|
|
|
- // 盘点: 'INVENTORY'
|
|
|
|
|
- // }
|
|
|
|
|
- // this.addForm.planRuleType = planRuleTypeObj[this.formLabel]
|
|
|
|
|
// 获取审核人列表数据
|
|
// 获取审核人列表数据
|
|
|
this.getUserList()
|
|
this.getUserList()
|
|
|
// 获取部门
|
|
// 获取部门
|
|
@@ -485,8 +478,6 @@ export default {
|
|
|
this._getRuleNameList()
|
|
this._getRuleNameList()
|
|
|
// 获取设备分类树
|
|
// 获取设备分类树
|
|
|
this.getClassifyTree()
|
|
this.getClassifyTree()
|
|
|
- // 获取计划配置单号
|
|
|
|
|
- this.getOrderCode()
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -543,6 +534,40 @@ export default {
|
|
|
created(){
|
|
created(){
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ async init(row){
|
|
|
|
|
+ if(row){
|
|
|
|
|
+ this.getInfo(row.id)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ // 获取计划配置单号
|
|
|
|
|
+ this.getOrderCode()
|
|
|
|
|
+ this.planRuleEquiList = []
|
|
|
|
|
+ this.matterRulesList = []
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ async getInfo(id){
|
|
|
|
|
+ const res = await getInfoById(id)
|
|
|
|
|
+ console.log('ree',res)
|
|
|
|
|
+ this.addForm = res
|
|
|
|
|
+ this.categoryEquipment(res.categoryLevelId)
|
|
|
|
|
+ const params = { groupId: res.groupId }
|
|
|
|
|
+ this.getUserList(params)
|
|
|
|
|
+ this._getEquipmentList(res.categoryId)
|
|
|
|
|
+ this._getMatterRulesDetails(res.ruleId)
|
|
|
|
|
+ this.$set(this.addForm,'code',res.code)
|
|
|
|
|
+ this.$set(this.addForm,'urgent', JSON.stringify(res.urgent) )
|
|
|
|
|
+ this.$set(this.addForm,'executeIdList',res.executeId.split(','))
|
|
|
|
|
+ this.$set(this.addForm,'imageUrl',{})
|
|
|
|
|
+ let keys = []
|
|
|
|
|
+ res.deviceInfo.map(item=>{
|
|
|
|
|
+ keys.push(item.substanceId)
|
|
|
|
|
+ })
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.equiListTree.setCheckedKeys(keys)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
handleClose () {
|
|
handleClose () {
|
|
|
this.addPatrolConfigDialog = false
|
|
this.addPatrolConfigDialog = false
|
|
|
this.$refs.addFormRef.resetFields()
|
|
this.$refs.addFormRef.resetFields()
|
|
@@ -560,29 +585,16 @@ export default {
|
|
|
categoryId: '', // 设备类别
|
|
categoryId: '', // 设备类别
|
|
|
approvalUserId: '', // 审核人id
|
|
approvalUserId: '', // 审核人id
|
|
|
groupId: '', // 巡点检部门code
|
|
groupId: '', // 巡点检部门code
|
|
|
- executeId: '', // 巡点检人员id
|
|
|
|
|
|
|
+ executeIdList: [], // 巡点检人员id
|
|
|
executorPhone: '',
|
|
executorPhone: '',
|
|
|
status: 1, // 状态
|
|
status: 1, // 状态
|
|
|
remark: '', // 备注
|
|
remark: '', // 备注
|
|
|
urgent:'',
|
|
urgent:'',
|
|
|
bizType:0,
|
|
bizType:0,
|
|
|
- // planRuleType: 'PATROL', // 计划规则类型 巡点检: 'PATROL', 保养: 'MAINTAIN', 盘点: 'INVENTORY'
|
|
|
|
|
- }
|
|
|
|
|
- // // 计划规则设备列表
|
|
|
|
|
- // planRuleEquiList: [
|
|
|
|
|
- // {
|
|
|
|
|
- // equiTypeId: '', // 设备分类Id
|
|
|
|
|
- // equiTypeName: '', // 设备分类名字
|
|
|
|
|
- // equiCode: '', // 设备编码 equCode
|
|
|
|
|
- // equiName: '', // 设备名称 name
|
|
|
|
|
- // equiModel: '', // 设备型号 specifications
|
|
|
|
|
- // equiLocation: '', // 设备位置
|
|
|
|
|
- // equiLocationCode: '', // 设备位置 code
|
|
|
|
|
- // // 设备备品备件 - 巡点检不需要备品备件,保养需要
|
|
|
|
|
- // partJson: [],
|
|
|
|
|
- // totalCost:0
|
|
|
|
|
- // }
|
|
|
|
|
- // ]
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ this.equipmentList = []
|
|
|
|
|
+ // deptData:[], //部门树
|
|
|
|
|
+ // classifyTree:[], //设备分类树
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
// 设备分类选择
|
|
// 设备分类选择
|
|
@@ -846,13 +858,17 @@ export default {
|
|
|
if (valid) {
|
|
if (valid) {
|
|
|
try {
|
|
try {
|
|
|
const selectList = this.$refs.equiListTree.getCheckedNodes();
|
|
const selectList = this.$refs.equiListTree.getCheckedNodes();
|
|
|
- console.log('selectList',selectList)
|
|
|
|
|
|
|
+ // console.log('selectList',selectList)
|
|
|
this.addForm.deviceInfo = selectList.map(
|
|
this.addForm.deviceInfo = selectList.map(
|
|
|
item => {
|
|
item => {
|
|
|
|
|
+ const { equiLocation, equiLocationCode } = this.getEquiLocation(item)
|
|
|
return {
|
|
return {
|
|
|
substanceName: item.name,
|
|
substanceName: item.name,
|
|
|
substanceId: item.id,
|
|
substanceId: item.id,
|
|
|
sparePart: item.partJson?item.partJson:[],
|
|
sparePart: item.partJson?item.partJson:[],
|
|
|
|
|
+ substanceCode: item.code,
|
|
|
|
|
+ mode: item.category.modelType,
|
|
|
|
|
+ position: equiLocation
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
@@ -883,6 +899,7 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
// this.planRuleEquiList = newArr
|
|
// this.planRuleEquiList = newArr
|
|
|
|
|
+ this.addForm.executeId = this.addForm.executeIdList.join(',')
|
|
|
const res = await saveOrUpdate(this.addForm)
|
|
const res = await saveOrUpdate(this.addForm)
|
|
|
if (res) {
|
|
if (res) {
|
|
|
const type = this.dialogTitle.includes('新增') ? '新增' : '编辑'
|
|
const type = this.dialogTitle.includes('新增') ? '新增' : '编辑'
|