|
|
@@ -85,16 +85,6 @@
|
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
|
<el-form-item label="设备分类" prop="categoryLevelId">
|
|
|
- <!-- <ele-tree-select
|
|
|
- clearable
|
|
|
- :data="classifyTree"
|
|
|
- v-model="addForm.categoryLevelId"
|
|
|
- placeholder="请选择"
|
|
|
- default-expand-all
|
|
|
- labelKey="name"
|
|
|
- valueKey="id"
|
|
|
- @change="chooseClassify"
|
|
|
- /> -->
|
|
|
<equipmentSelect v-model="addForm.categoryLevelId" @changeNode="chooseClassify" @setRootId="getRootId"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -139,16 +129,6 @@
|
|
|
<el-col :span="8" v-if="addForm.autoOrder">
|
|
|
<el-form-item :label="formLabel + '部门'" prop="groupId">
|
|
|
<deptSelect v-model="addForm.groupId" @changeGroup="searchDeptNodeClick"/>
|
|
|
- <!-- <ele-tree-select
|
|
|
- clearable
|
|
|
- :data="deptData"
|
|
|
- v-model="addForm.groupId"
|
|
|
- placeholder="请选择"
|
|
|
- default-expand-all
|
|
|
- labelKey="name"
|
|
|
- valueKey="id"
|
|
|
- @change="searchDeptNodeClick"
|
|
|
- /> -->
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="8" v-if="addForm.autoOrder">
|
|
|
@@ -239,7 +219,7 @@
|
|
|
</div>
|
|
|
<!-- 添加操作事项 -->
|
|
|
<div>
|
|
|
- <el-button type="text">操作事项</el-button>
|
|
|
+ <div class="box_tips">操作事项</div>
|
|
|
<el-table
|
|
|
:data="matterRulesList"
|
|
|
border
|
|
|
@@ -278,10 +258,10 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="型号" align="center" prop="model">
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="所需数量" align="center" prop="num">
|
|
|
+ <el-table-column label="所需数量" align="center" prop="needNum">
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
- v-model.number="scope.row.num"
|
|
|
+ v-model.number="scope.row.needNum"
|
|
|
size="small"
|
|
|
oninput="value=value.replace(/[^\d]/g,'')"
|
|
|
style="width: 100%"
|
|
|
@@ -294,7 +274,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="费用" align="center">
|
|
|
<template slot-scope="scope">
|
|
|
- {{scope.row.num*scope.row.unitPrice?scope.row.num*scope.row.unitPrice:'0'}}{{scope.row.parValue=='wanyuan'?'万元':'元'}}
|
|
|
+ {{scope.row.needNum*scope.row.unitPrice?scope.row.needNum*scope.row.unitPrice:'0'}}{{scope.row.parValue=='wanyuan'?'万元':'元'}}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作" align="center" width="70">
|
|
|
@@ -387,19 +367,15 @@ export default {
|
|
|
executorPhone: '',
|
|
|
status: 1, // 状态
|
|
|
remark: '', // 备注
|
|
|
- urgent:'',
|
|
|
- bizType:0
|
|
|
+ urgent:''
|
|
|
},
|
|
|
// 计划规则设备列表
|
|
|
planRuleEquiList: [
|
|
|
{
|
|
|
- equiTypeId: '', // 设备分类Id
|
|
|
- equiTypeName: '', // 设备分类名字
|
|
|
equiCode: '', // 设备编码 equCode
|
|
|
equiName: '', // 设备名称 name
|
|
|
equiModel: '', // 设备型号 specifications
|
|
|
equiLocation: '', // 设备位置
|
|
|
- equiLocationCode: '', // 设备位置code
|
|
|
// 设备备品备件 - 巡点检不需要备品备件,保养需要
|
|
|
sparePart: [ ],
|
|
|
totalCost:0,
|
|
|
@@ -437,8 +413,6 @@ export default {
|
|
|
ruleNameList:[],
|
|
|
addDialogLoading:false,
|
|
|
equipmentList:[],
|
|
|
- // deptData:[], //部门树
|
|
|
- // classifyTree:[], //设备分类树
|
|
|
rootId:null,
|
|
|
}
|
|
|
},
|
|
|
@@ -482,12 +456,12 @@ export default {
|
|
|
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',{})
|
|
|
+ this._getEquipmentList(res.categoryId)
|
|
|
let keys = []
|
|
|
res.deviceInfo.map(item=>{
|
|
|
keys.push(item.substanceId)
|
|
|
@@ -521,8 +495,7 @@ export default {
|
|
|
executorPhone: '',
|
|
|
status: 1, // 状态
|
|
|
remark: '', // 备注
|
|
|
- urgent:'',
|
|
|
- bizType:0
|
|
|
+ urgent:''
|
|
|
}
|
|
|
this.equipmentList = []
|
|
|
},
|
|
|
@@ -543,34 +516,28 @@ export default {
|
|
|
})
|
|
|
this.currentEquItemIndex = 0
|
|
|
const item = this.planRuleEquiList[0]
|
|
|
- const { equiLocation, equiLocationCode } = this.getEquiLocation(item)
|
|
|
+ const equiLocation = this.getEquiLocation(item)
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.equiListTree.setCurrentKey(item.id)
|
|
|
this.equipmentInfo = {
|
|
|
- equiTypeId: this.addForm.categoryId,
|
|
|
equiCode: item.code,
|
|
|
equiName: item.name,
|
|
|
equiModel: item.category.modelType,
|
|
|
- equiLocation: equiLocation,
|
|
|
- equiLocationCode: equiLocationCode
|
|
|
+ equiLocation: equiLocation
|
|
|
}
|
|
|
- this.currentEquItemIndex = 0
|
|
|
this.planRuleEquiList[0]['equiLocation'] = equiLocation
|
|
|
- this.planRuleEquiList[0]['equiLocationCode'] = equiLocationCode
|
|
|
|
|
|
// 对比详情返回的数据和设备分类下面所有的设备列表,将sparePart同步过去
|
|
|
if(this.addForm.deviceInfo){
|
|
|
for (let i = 0; i < this.planRuleEquiList.length; i++) {
|
|
|
for (let j = 0; j < this.addForm.deviceInfo.length; j++) {
|
|
|
- if ( this.planRuleEquiList[i].code === this.addForm.deviceInfo[j].substanceCode ) {
|
|
|
- this.planRuleEquiList[i]['sparePart'] = this.addForm.deviceInfo[j]['sparePart']
|
|
|
- // this.$set(this.planRuleEquiList[i],'totalCost',this.addForm.deviceInfo[j]['totalCost'])
|
|
|
- // this.planRuleEquiList[i]['totalCost'] = this.addForm.deviceInfo[j]['totalCost']
|
|
|
+ if ( this.planRuleEquiList[i].code === this.addForm.deviceInfo[j].substance.code ) {
|
|
|
+ this.$set(this.planRuleEquiList[i],'sparePart',this.addForm.deviceInfo[j].sparePart)
|
|
|
+ this.$set(this.planRuleEquiList[i],'totalCost',this.addForm.deviceInfo[j].totalCost)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
})
|
|
|
} catch (error) {
|
|
|
this.planRuleEquiList = []
|
|
|
@@ -643,20 +610,17 @@ export default {
|
|
|
arry.push(item.name)
|
|
|
})
|
|
|
const equiLocation = arry.join('/')
|
|
|
- // 设备位置编码
|
|
|
- const equiLocationCode = data.position[0].pathIds
|
|
|
- return { equiLocation, equiLocationCode }
|
|
|
+ return equiLocation
|
|
|
},
|
|
|
// 设备列表树点击
|
|
|
handleNodeClick (data, node) {
|
|
|
- const { equiLocation, equiLocationCode } = this.getEquiLocation(data)
|
|
|
+ const equiLocation = this.getEquiLocation(data)
|
|
|
this.equipmentInfo = {
|
|
|
equiCode: data.code,
|
|
|
equiName: data.name,
|
|
|
equiId: data.id,
|
|
|
equiModel: data.category.modelType,
|
|
|
- equiLocation: equiLocation,
|
|
|
- equiLocationCode: equiLocationCode
|
|
|
+ equiLocation: equiLocation
|
|
|
}
|
|
|
// 保存当前点击的设备列表某节点的index,在添加操作事项的时候,可以将事项list放到对应的节点对象中,以及切换节点的时候回显事项list
|
|
|
this.currentEquItemIndex = this.planRuleEquiList.findIndex(
|
|
|
@@ -664,18 +628,17 @@ export default {
|
|
|
)
|
|
|
this.clickedTreeNode = true
|
|
|
this.planRuleEquiList[this.currentEquItemIndex]['equiLocation'] = equiLocation
|
|
|
- this.planRuleEquiList[this.currentEquItemIndex]['equiLocationCode'] = equiLocationCode
|
|
|
},
|
|
|
// 获取规则名列表
|
|
|
async _getRuleNameList () {
|
|
|
if(this.dialogTitle==='新增保养计划配置'||this.dialogTitle==='编辑保养计划配置'){
|
|
|
- const res = await getRule({type:2,pageNum:1,size:-1})
|
|
|
+ const res = await getRule({status:1,type:2,pageNum:1,size:-1})
|
|
|
if (res.list) {
|
|
|
this.ruleNameList = res.list || []
|
|
|
}
|
|
|
}
|
|
|
if (this.dialogTitle==='新增巡点检计划配置'||this.dialogTitle==='编辑巡点检计划配置'){
|
|
|
- const res = await getRule({type:1,pageNum:1,size:-1})
|
|
|
+ const res = await getRule({status:1,type:1,pageNum:1,size:-1})
|
|
|
if (res.list) {
|
|
|
this.ruleNameList = res.list || []
|
|
|
}
|
|
|
@@ -748,6 +711,7 @@ export default {
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+ item.cost = item.needNum*item.unitPrice*item.chengs
|
|
|
total = total + item.needNum*item.unitPrice*item.chengs
|
|
|
}
|
|
|
})
|
|
|
@@ -762,7 +726,6 @@ export default {
|
|
|
const selectList = this.$refs.equiListTree.getCheckedNodes();
|
|
|
this.addForm.deviceInfo = selectList.map(
|
|
|
item => {
|
|
|
- const { equiLocation, equiLocationCode } = this.getEquiLocation(item)
|
|
|
return {
|
|
|
substanceId: item.id,
|
|
|
sparePart: item.sparePart?item.sparePart:[],
|
|
|
@@ -793,7 +756,7 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-::v-deep .el-form {
|
|
|
+:deep(.el-form) {
|
|
|
.el-form-item {
|
|
|
margin-bottom: 14px;
|
|
|
}
|
|
|
@@ -866,4 +829,8 @@ export default {
|
|
|
.dialog_footer {
|
|
|
text-align: center;
|
|
|
}
|
|
|
+.box_tips{
|
|
|
+ color:#1890ff;
|
|
|
+ margin:10px 0;
|
|
|
+}
|
|
|
</style>
|