|
@@ -135,13 +135,13 @@
|
|
|
<el-col :span="8" v-if="addForm.autoOrder">
|
|
<el-col :span="8" v-if="addForm.autoOrder">
|
|
|
<el-form-item :label="formLabel + '部门'" prop="groupId">
|
|
<el-form-item :label="formLabel + '部门'" prop="groupId">
|
|
|
<ele-tree-select
|
|
<ele-tree-select
|
|
|
- clearable
|
|
|
|
|
- :data="deptData"
|
|
|
|
|
- v-model="addForm.groupId"
|
|
|
|
|
- placeholder="请选择"
|
|
|
|
|
- default-expand-all
|
|
|
|
|
- labelKey="name"
|
|
|
|
|
- valueKey="id"
|
|
|
|
|
|
|
+ clearable
|
|
|
|
|
+ :data="deptData"
|
|
|
|
|
+ v-model="addForm.groupId"
|
|
|
|
|
+ placeholder="请选择"
|
|
|
|
|
+ default-expand-all
|
|
|
|
|
+ labelKey="name"
|
|
|
|
|
+ valueKey="id"
|
|
|
@change="searchDeptNodeClick"
|
|
@change="searchDeptNodeClick"
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -163,6 +163,12 @@
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="紧急程度" prop="urgent">
|
|
|
|
|
+ <DictSelection dictName="紧急程度" clearable v-model="addForm.urgent">
|
|
|
|
|
+ </DictSelection>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="状态" prop="status">
|
|
<el-form-item label="状态" prop="status">
|
|
|
<el-switch
|
|
<el-switch
|
|
@@ -195,7 +201,7 @@
|
|
|
<div class="equipment_list_title">设备列表</div>
|
|
<div class="equipment_list_title">设备列表</div>
|
|
|
<div class="equipment_tree">
|
|
<div class="equipment_tree">
|
|
|
<el-tree
|
|
<el-tree
|
|
|
- :data="addForm.planRuleEquiList"
|
|
|
|
|
|
|
+ :data="planRuleEquiList"
|
|
|
:props="defaultProps"
|
|
:props="defaultProps"
|
|
|
ref="equiListTree"
|
|
ref="equiListTree"
|
|
|
highlight-current
|
|
highlight-current
|
|
@@ -252,7 +258,7 @@
|
|
|
>添加备品备件</el-button
|
|
>添加备品备件</el-button
|
|
|
>
|
|
>
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="addForm.planRuleEquiList[currentEquItemIndex]&&addForm.planRuleEquiList[currentEquItemIndex].partJson"
|
|
|
|
|
|
|
+ :data="planRuleEquiList[currentEquItemIndex]&&planRuleEquiList[currentEquItemIndex].partJson"
|
|
|
height="300"
|
|
height="300"
|
|
|
:key='currentEquItemIndex'
|
|
:key='currentEquItemIndex'
|
|
|
border
|
|
border
|
|
@@ -297,7 +303,7 @@
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
<div style="text-align: center">备件总费用:
|
|
<div style="text-align: center">备件总费用:
|
|
|
- {{addForm.planRuleEquiList[currentEquItemIndex]&&addForm.planRuleEquiList[currentEquItemIndex].totalCost?addForm.planRuleEquiList[currentEquItemIndex].totalCost:'-'}}
|
|
|
|
|
|
|
+ {{planRuleEquiList[currentEquItemIndex]&&planRuleEquiList[currentEquItemIndex].totalCost?planRuleEquiList[currentEquItemIndex].totalCost:'-'}}
|
|
|
元
|
|
元
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -380,6 +386,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
treeData:[],
|
|
treeData:[],
|
|
|
addForm: {
|
|
addForm: {
|
|
|
|
|
+ code:'', // 计划配置单号
|
|
|
name: '', // 计划配置名称
|
|
name: '', // 计划配置名称
|
|
|
autoOrder: 1, // 自动派单
|
|
autoOrder: 1, // 自动派单
|
|
|
ruleId: '', // 规则id
|
|
ruleId: '', // 规则id
|
|
@@ -392,23 +399,25 @@ export default {
|
|
|
executorPhone: '',
|
|
executorPhone: '',
|
|
|
status: 1, // 状态
|
|
status: 1, // 状态
|
|
|
remark: '', // 备注
|
|
remark: '', // 备注
|
|
|
- planRuleType: 'PATROL', // 计划规则类型 巡点检: 'PATROL', 保养: 'MAINTAIN', 盘点: 'INVENTORY'
|
|
|
|
|
- // 计划规则设备列表
|
|
|
|
|
- planRuleEquiList: [
|
|
|
|
|
- {
|
|
|
|
|
- equiTypeId: '', // 设备分类Id
|
|
|
|
|
- equiTypeName: '', // 设备分类名字
|
|
|
|
|
- equiCode: '', // 设备编码 equCode
|
|
|
|
|
- equiName: '', // 设备名称 name
|
|
|
|
|
- equiModel: '', // 设备型号 specifications
|
|
|
|
|
- equiLocation: '', // 设备位置
|
|
|
|
|
- equiLocationCode: '', // 设备位置code
|
|
|
|
|
- // 设备备品备件 - 巡点检不需要备品备件,保养需要
|
|
|
|
|
- partJson: [ ],
|
|
|
|
|
- totalCost:0,
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ urgent:'',
|
|
|
|
|
+ bizType:0
|
|
|
|
|
+ // planRuleType: 'PATROL', // 计划规则类型 巡点检: 'PATROL', 保养: 'MAINTAIN', 盘点: 'INVENTORY'
|
|
|
},
|
|
},
|
|
|
|
|
+ // 计划规则设备列表
|
|
|
|
|
+ planRuleEquiList: [
|
|
|
|
|
+ {
|
|
|
|
|
+ equiTypeId: '', // 设备分类Id
|
|
|
|
|
+ equiTypeName: '', // 设备分类名字
|
|
|
|
|
+ equiCode: '', // 设备编码 equCode
|
|
|
|
|
+ equiName: '', // 设备名称 name
|
|
|
|
|
+ equiModel: '', // 设备型号 specifications
|
|
|
|
|
+ equiLocation: '', // 设备位置
|
|
|
|
|
+ equiLocationCode: '', // 设备位置code
|
|
|
|
|
+ // 设备备品备件 - 巡点检不需要备品备件,保养需要
|
|
|
|
|
+ partJson: [ ],
|
|
|
|
|
+ totalCost:0,
|
|
|
|
|
+ }
|
|
|
|
|
+ ],
|
|
|
addFormRules: {
|
|
addFormRules: {
|
|
|
name: [
|
|
name: [
|
|
|
{ required: true, message: '请输入计划配置名称', trigger: 'blur' }
|
|
{ required: true, message: '请输入计划配置名称', trigger: 'blur' }
|
|
@@ -429,11 +438,14 @@ export default {
|
|
|
{ required: true, message: '请选择设备类别', trigger: 'change' }
|
|
{ required: true, message: '请选择设备类别', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
groupId: [
|
|
groupId: [
|
|
|
- { required: true, message: '请选择选择巡点检部门', trigger: 'change' }
|
|
|
|
|
|
|
+ { required: true, message: '请选择巡点检部门', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
executeId: [
|
|
executeId: [
|
|
|
- { required: true, message: '请选择选择巡点检人员', trigger: 'change' }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ { required: true, message: '请选择巡点检人员', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
|
|
+ urgent: [
|
|
|
|
|
+ { required: true, message: '请选择紧急程度', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
ruleNameList:[],
|
|
ruleNameList:[],
|
|
|
addDialogLoading:false,
|
|
addDialogLoading:false,
|
|
@@ -494,7 +506,7 @@ export default {
|
|
|
this.getUserList(params)
|
|
this.getUserList(params)
|
|
|
// 回显设备事项
|
|
// 回显设备事项
|
|
|
await this._getEquipmentList(val.categoryId)
|
|
await this._getEquipmentList(val.categoryId)
|
|
|
- const item = this.addForm.planRuleEquiList[0]
|
|
|
|
|
|
|
+ const item = this.planRuleEquiList[0]
|
|
|
console.log('item',item)
|
|
console.log('item',item)
|
|
|
// 默认选中列表第一条树节点
|
|
// 默认选中列表第一条树节点
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
@@ -504,23 +516,23 @@ export default {
|
|
|
this.equipmentInfo = {
|
|
this.equipmentInfo = {
|
|
|
equiCode: item.code,
|
|
equiCode: item.code,
|
|
|
equiName: item.name,
|
|
equiName: item.name,
|
|
|
- equiModel: item.modelType,
|
|
|
|
|
|
|
+ equiModel: item.category.modelType,
|
|
|
equiLocation: equiLocation,
|
|
equiLocation: equiLocation,
|
|
|
equiLocationCode: equiLocationCode
|
|
equiLocationCode: equiLocationCode
|
|
|
}
|
|
}
|
|
|
this.currentEquItemIndex = 0
|
|
this.currentEquItemIndex = 0
|
|
|
- this.addForm.planRuleEquiList[0]['equiLocation'] = equiLocation
|
|
|
|
|
- this.addForm.planRuleEquiList[0]['equiLocationCode'] = equiLocationCode
|
|
|
|
|
|
|
+ this.planRuleEquiList[0]['equiLocation'] = equiLocation
|
|
|
|
|
+ this.planRuleEquiList[0]['equiLocationCode'] = equiLocationCode
|
|
|
// 对比详情返回的数据和设备分类下面所有的设备列表,将itemJson同步过去
|
|
// 对比详情返回的数据和设备分类下面所有的设备列表,将itemJson同步过去
|
|
|
- // for (let i = 0; i < this.addForm.planRuleEquiList.length; i++) {
|
|
|
|
|
|
|
+ // for (let i = 0; i < this.planRuleEquiList.length; i++) {
|
|
|
// for (let j = 0; j < tempPlanRuleEquiList.length; j++) {
|
|
// for (let j = 0; j < tempPlanRuleEquiList.length; j++) {
|
|
|
// if (
|
|
// if (
|
|
|
- // this.addForm.planRuleEquiList[i].code ===
|
|
|
|
|
|
|
+ // this.planRuleEquiList[i].code ===
|
|
|
// tempPlanRuleEquiList[j].equiCode
|
|
// tempPlanRuleEquiList[j].equiCode
|
|
|
// ) {
|
|
// ) {
|
|
|
- // this.addForm.planRuleEquiList[i]['itemJson'] =
|
|
|
|
|
|
|
+ // this.planRuleEquiList[i]['itemJson'] =
|
|
|
// tempPlanRuleEquiList[j]['itemJson']
|
|
// tempPlanRuleEquiList[j]['itemJson']
|
|
|
- // this.addForm.planRuleEquiList[i]['partJson'] =
|
|
|
|
|
|
|
+ // this.planRuleEquiList[i]['partJson'] =
|
|
|
// tempPlanRuleEquiList[j]['partJson']
|
|
// tempPlanRuleEquiList[j]['partJson']
|
|
|
// break
|
|
// break
|
|
|
// }
|
|
// }
|
|
@@ -540,7 +552,7 @@ export default {
|
|
|
this.currentEquItemIndex = 0
|
|
this.currentEquItemIndex = 0
|
|
|
this.equipmentInfo = {}
|
|
this.equipmentInfo = {}
|
|
|
this.addForm = {
|
|
this.addForm = {
|
|
|
- // planRuleCode: getRuleNo('PL'), // 计划配置单号
|
|
|
|
|
|
|
+ code:'', // 计划配置单号
|
|
|
name: '', // 计划配置名称
|
|
name: '', // 计划配置名称
|
|
|
autoOrder: 1, // 自动派单
|
|
autoOrder: 1, // 自动派单
|
|
|
ruleId: '', // 规则id
|
|
ruleId: '', // 规则id
|
|
@@ -552,23 +564,26 @@ export default {
|
|
|
executorPhone: '',
|
|
executorPhone: '',
|
|
|
status: 1, // 状态
|
|
status: 1, // 状态
|
|
|
remark: '', // 备注
|
|
remark: '', // 备注
|
|
|
- planRuleType: 'PATROL', // 计划规则类型 巡点检: 'PATROL', 保养: 'MAINTAIN', 盘点: 'INVENTORY'
|
|
|
|
|
- // 计划规则设备列表
|
|
|
|
|
- planRuleEquiList: [
|
|
|
|
|
- {
|
|
|
|
|
- equiTypeId: '', // 设备分类Id
|
|
|
|
|
- equiTypeName: '', // 设备分类名字
|
|
|
|
|
- equiCode: '', // 设备编码 equCode
|
|
|
|
|
- equiName: '', // 设备名称 name
|
|
|
|
|
- equiModel: '', // 设备型号 specifications
|
|
|
|
|
- equiLocation: '', // 设备位置
|
|
|
|
|
- equiLocationCode: '', // 设备位置 code
|
|
|
|
|
- // 设备备品备件 - 巡点检不需要备品备件,保养需要
|
|
|
|
|
- partJson: [],
|
|
|
|
|
- totalCost:0
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ urgent:'',
|
|
|
|
|
+ bizType:0,
|
|
|
|
|
+ // planRuleType: 'PATROL', // 计划规则类型 巡点检: 'PATROL', 保养: 'MAINTAIN', 盘点: 'INVENTORY'
|
|
|
}
|
|
}
|
|
|
|
|
+ // // 计划规则设备列表
|
|
|
|
|
+ // planRuleEquiList: [
|
|
|
|
|
+ // {
|
|
|
|
|
+ // equiTypeId: '', // 设备分类Id
|
|
|
|
|
+ // equiTypeName: '', // 设备分类名字
|
|
|
|
|
+ // equiCode: '', // 设备编码 equCode
|
|
|
|
|
+ // equiName: '', // 设备名称 name
|
|
|
|
|
+ // equiModel: '', // 设备型号 specifications
|
|
|
|
|
+ // equiLocation: '', // 设备位置
|
|
|
|
|
+ // equiLocationCode: '', // 设备位置 code
|
|
|
|
|
+ // // 设备备品备件 - 巡点检不需要备品备件,保养需要
|
|
|
|
|
+ // partJson: [],
|
|
|
|
|
+ // totalCost:0
|
|
|
|
|
+ // }
|
|
|
|
|
+ // ]
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
// 设备分类选择
|
|
// 设备分类选择
|
|
|
async handleEquipmentClassChange (item) {
|
|
async handleEquipmentClassChange (item) {
|
|
@@ -581,12 +596,12 @@ export default {
|
|
|
const params = { pageNum: 1,size: -1, categoryId: val, rootCategoryLevelId: this.rootId }
|
|
const params = { pageNum: 1,size: -1, categoryId: val, rootCategoryLevelId: this.rootId }
|
|
|
try {
|
|
try {
|
|
|
const res = await getAssetList(params)
|
|
const res = await getAssetList(params)
|
|
|
- this.addForm.planRuleEquiList = res.list
|
|
|
|
|
- this.addForm.planRuleEquiList.map(item=>{
|
|
|
|
|
|
|
+ this.planRuleEquiList = res.list
|
|
|
|
|
+ this.planRuleEquiList.map(item=>{
|
|
|
item.showName = item.name+'('+item.code+')'
|
|
item.showName = item.name+'('+item.code+')'
|
|
|
})
|
|
})
|
|
|
this.currentEquItemIndex = 0
|
|
this.currentEquItemIndex = 0
|
|
|
- const item = this.addForm.planRuleEquiList[0]
|
|
|
|
|
|
|
+ const item = this.planRuleEquiList[0]
|
|
|
const { equiLocation, equiLocationCode } = this.getEquiLocation(item)
|
|
const { equiLocation, equiLocationCode } = this.getEquiLocation(item)
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.$refs.equiListTree.setCurrentKey(item.id)
|
|
this.$refs.equiListTree.setCurrentKey(item.id)
|
|
@@ -594,13 +609,13 @@ export default {
|
|
|
equiTypeId: this.addForm.categoryId,
|
|
equiTypeId: this.addForm.categoryId,
|
|
|
equiCode: item.code,
|
|
equiCode: item.code,
|
|
|
equiName: item.name,
|
|
equiName: item.name,
|
|
|
- equiModel: item.specifications,
|
|
|
|
|
|
|
+ equiModel: item.category.modelType,
|
|
|
equiLocation: equiLocation,
|
|
equiLocation: equiLocation,
|
|
|
equiLocationCode: equiLocationCode
|
|
equiLocationCode: equiLocationCode
|
|
|
}
|
|
}
|
|
|
this.currentEquItemIndex = 0
|
|
this.currentEquItemIndex = 0
|
|
|
- this.addForm.planRuleEquiList[0]['equiLocation'] = equiLocation
|
|
|
|
|
- this.addForm.planRuleEquiList[0]['equiLocationCode'] = equiLocationCode
|
|
|
|
|
|
|
+ this.planRuleEquiList[0]['equiLocation'] = equiLocation
|
|
|
|
|
+ this.planRuleEquiList[0]['equiLocationCode'] = equiLocationCode
|
|
|
// if(this.addForm.planRuleEquiList[this.currentEquItemIndex].partJson){
|
|
// if(this.addForm.planRuleEquiList[this.currentEquItemIndex].partJson){
|
|
|
// this.tableList = this.addForm.planRuleEquiList[this.currentEquItemIndex].partJson
|
|
// this.tableList = this.addForm.planRuleEquiList[this.currentEquItemIndex].partJson
|
|
|
// }else{
|
|
// }else{
|
|
@@ -608,7 +623,7 @@ export default {
|
|
|
// }
|
|
// }
|
|
|
})
|
|
})
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
- this.addForm.planRuleEquiList = []
|
|
|
|
|
|
|
+ this.planRuleEquiList = []
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -672,7 +687,7 @@ export default {
|
|
|
// 获取计划配置单号
|
|
// 获取计划配置单号
|
|
|
async getOrderCode () {
|
|
async getOrderCode () {
|
|
|
const data = await getCode('patrolconfig_code');
|
|
const data = await getCode('patrolconfig_code');
|
|
|
- this.$set(this.formData, 'code', data);
|
|
|
|
|
|
|
+ this.$set(this.addForm, 'code', data);
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 封装 - 获取设备位置名称和code方法
|
|
// 封装 - 获取设备位置名称和code方法
|
|
@@ -700,12 +715,12 @@ export default {
|
|
|
equiLocationCode: equiLocationCode
|
|
equiLocationCode: equiLocationCode
|
|
|
}
|
|
}
|
|
|
// 保存当前点击的设备列表某节点的index,在添加操作事项的时候,可以将事项list放到对应的节点对象中,以及切换节点的时候回显事项list
|
|
// 保存当前点击的设备列表某节点的index,在添加操作事项的时候,可以将事项list放到对应的节点对象中,以及切换节点的时候回显事项list
|
|
|
- this.currentEquItemIndex = this.addForm.planRuleEquiList.findIndex(
|
|
|
|
|
|
|
+ this.currentEquItemIndex = this.planRuleEquiList.findIndex(
|
|
|
item => item.code === data.code
|
|
item => item.code === data.code
|
|
|
)
|
|
)
|
|
|
this.clickedTreeNode = true
|
|
this.clickedTreeNode = true
|
|
|
- this.addForm.planRuleEquiList[this.currentEquItemIndex]['equiLocation'] = equiLocation
|
|
|
|
|
- this.addForm.planRuleEquiList[this.currentEquItemIndex]['equiLocationCode'] = equiLocationCode
|
|
|
|
|
|
|
+ this.planRuleEquiList[this.currentEquItemIndex]['equiLocation'] = equiLocation
|
|
|
|
|
+ this.planRuleEquiList[this.currentEquItemIndex]['equiLocationCode'] = equiLocationCode
|
|
|
},
|
|
},
|
|
|
// 获取规则名列表
|
|
// 获取规则名列表
|
|
|
async _getRuleNameList () {
|
|
async _getRuleNameList () {
|
|
@@ -737,11 +752,11 @@ export default {
|
|
|
// 从事项弹窗将数据丢到事项配置
|
|
// 从事项弹窗将数据丢到事项配置
|
|
|
// ruleItemSelectionSubmit (list) {
|
|
// ruleItemSelectionSubmit (list) {
|
|
|
// if (
|
|
// if (
|
|
|
- // !this.addForm.planRuleEquiList[this.currentEquItemIndex]['itemJson']
|
|
|
|
|
|
|
+ // !this.planRuleEquiList[this.currentEquItemIndex]['itemJson']
|
|
|
// ) {
|
|
// ) {
|
|
|
- // this.addForm.planRuleEquiList[this.currentEquItemIndex]['itemJson'] = []
|
|
|
|
|
|
|
+ // this.planRuleEquiList[this.currentEquItemIndex]['itemJson'] = []
|
|
|
// }
|
|
// }
|
|
|
- // this.addForm.planRuleEquiList[this.currentEquItemIndex]['itemJson'] =
|
|
|
|
|
|
|
+ // this.planRuleEquiList[this.currentEquItemIndex]['itemJson'] =
|
|
|
// list.map(item => {
|
|
// list.map(item => {
|
|
|
// return {
|
|
// return {
|
|
|
// id: item.id,
|
|
// id: item.id,
|
|
@@ -764,9 +779,9 @@ export default {
|
|
|
return this.$message.warning('请选择规则名称!')
|
|
return this.$message.warning('请选择规则名称!')
|
|
|
}
|
|
}
|
|
|
this.$refs.addSpareDialogRef.open()
|
|
this.$refs.addSpareDialogRef.open()
|
|
|
- if (this.addForm.planRuleEquiList[this.currentEquItemIndex]['partJson']) {
|
|
|
|
|
|
|
+ if (this.planRuleEquiList[this.currentEquItemIndex]['partJson']) {
|
|
|
this.selectedSpare =
|
|
this.selectedSpare =
|
|
|
- this.addForm.planRuleEquiList[this.currentEquItemIndex]['partJson']
|
|
|
|
|
|
|
+ this.planRuleEquiList[this.currentEquItemIndex]['partJson']
|
|
|
} else {
|
|
} else {
|
|
|
this.selectedSpare = []
|
|
this.selectedSpare = []
|
|
|
}
|
|
}
|
|
@@ -775,7 +790,7 @@ export default {
|
|
|
// 从备品备件弹窗将数据丢到备品备件配置
|
|
// 从备品备件弹窗将数据丢到备品备件配置
|
|
|
spareItemSelectSubmit (list) {
|
|
spareItemSelectSubmit (list) {
|
|
|
console.log('list',list)
|
|
console.log('list',list)
|
|
|
- this.addForm.planRuleEquiList[this.currentEquItemIndex]['partJson'] = list.map(item => {
|
|
|
|
|
|
|
+ this.planRuleEquiList[this.currentEquItemIndex]['partJson'] = list.map(item => {
|
|
|
return {
|
|
return {
|
|
|
name: item.informationName,
|
|
name: item.informationName,
|
|
|
model: item.modelType,
|
|
model: item.modelType,
|
|
@@ -795,7 +810,7 @@ export default {
|
|
|
|
|
|
|
|
// 删除备品备件
|
|
// 删除备品备件
|
|
|
handleDeleteSpareItem (index) {
|
|
handleDeleteSpareItem (index) {
|
|
|
- this.addForm.planRuleEquiList[this.currentEquItemIndex][
|
|
|
|
|
|
|
+ this.planRuleEquiList[this.currentEquItemIndex][
|
|
|
'partJson'
|
|
'partJson'
|
|
|
].splice(index, 1)
|
|
].splice(index, 1)
|
|
|
this.changeNum()
|
|
this.changeNum()
|
|
@@ -803,7 +818,7 @@ export default {
|
|
|
|
|
|
|
|
// 改变input数据重新计算总费用
|
|
// 改变input数据重新计算总费用
|
|
|
changeNum(){
|
|
changeNum(){
|
|
|
- let applayList = this.addForm.planRuleEquiList[this.currentEquItemIndex].partJson
|
|
|
|
|
|
|
+ let applayList = this.planRuleEquiList[this.currentEquItemIndex].partJson
|
|
|
let total = 0
|
|
let total = 0
|
|
|
applayList.map(item=>{
|
|
applayList.map(item=>{
|
|
|
if(item.hasOwnProperty('num')&&item.num!=''){
|
|
if(item.hasOwnProperty('num')&&item.num!=''){
|
|
@@ -822,7 +837,7 @@ export default {
|
|
|
total = total + item.num*item.amount*item.chengs
|
|
total = total + item.num*item.amount*item.chengs
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- this.$set(this.addForm.planRuleEquiList[this.currentEquItemIndex],'totalCost',total)
|
|
|
|
|
|
|
+ this.$set(this.planRuleEquiList[this.currentEquItemIndex],'totalCost',total)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
// 提交
|
|
// 提交
|
|
@@ -841,7 +856,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
- // this.addForm.planRuleEquiList = this.addForm.planRuleEquiList.map(
|
|
|
|
|
|
|
+ // this.planRuleEquiList = this.planRuleEquiList.map(
|
|
|
// item => {
|
|
// item => {
|
|
|
// return {
|
|
// return {
|
|
|
// substanceName: item.name,
|
|
// substanceName: item.name,
|
|
@@ -855,25 +870,25 @@ export default {
|
|
|
// this.planRuleTypeObj[this.addForm.planRuleType.code]
|
|
// this.planRuleTypeObj[this.addForm.planRuleType.code]
|
|
|
// }
|
|
// }
|
|
|
// let arr = []
|
|
// let arr = []
|
|
|
- // this.addForm.planRuleEquiList.map((item)=>{
|
|
|
|
|
|
|
+ // this.planRuleEquiList.map((item)=>{
|
|
|
// if(item.partJson.length){
|
|
// if(item.partJson.length){
|
|
|
// arr.push(item)
|
|
// arr.push(item)
|
|
|
// }
|
|
// }
|
|
|
// })
|
|
// })
|
|
|
- // this.addForm.planRuleEquiList = arr
|
|
|
|
|
- // let newArr = JSON.parse(JSON.stringify(this.addForm.planRuleEquiList))
|
|
|
|
|
|
|
+ // this.planRuleEquiList = arr
|
|
|
|
|
+ // let newArr = JSON.parse(JSON.stringify(this.planRuleEquiList))
|
|
|
// for (let i = 0; i < newArr.length; i++) {
|
|
// for (let i = 0; i < newArr.length; i++) {
|
|
|
// for (let j = 0; j < newArr[i].partJson.length; j++) {
|
|
// for (let j = 0; j < newArr[i].partJson.length; j++) {
|
|
|
// newArr[i].partJson[j].equipmentCode = newArr[i].equiCode
|
|
// newArr[i].partJson[j].equipmentCode = newArr[i].equiCode
|
|
|
// }
|
|
// }
|
|
|
// }
|
|
// }
|
|
|
- // this.addForm.planRuleEquiList = newArr
|
|
|
|
|
|
|
+ // this.planRuleEquiList = newArr
|
|
|
const res = await saveOrUpdate(this.addForm)
|
|
const res = await saveOrUpdate(this.addForm)
|
|
|
- if (res.success) {
|
|
|
|
|
|
|
+ if (res) {
|
|
|
const type = this.dialogTitle.includes('新增') ? '新增' : '编辑'
|
|
const type = this.dialogTitle.includes('新增') ? '新增' : '编辑'
|
|
|
this.handleClose()
|
|
this.handleClose()
|
|
|
this.$message.success(type + '成功!')
|
|
this.$message.success(type + '成功!')
|
|
|
- this.$emit('refreshList')
|
|
|
|
|
|
|
+ this.$emit('done')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} catch (error) {}
|
|
} catch (error) {}
|