|
@@ -37,11 +37,11 @@
|
|
bordered
|
|
bordered
|
|
rowKey="id"
|
|
rowKey="id"
|
|
:columns="columns"
|
|
:columns="columns"
|
|
- :dataSource="model.itemList"
|
|
|
|
|
|
+ :dataSource="model.allItemList"
|
|
:pagination="false"
|
|
:pagination="false"
|
|
class="j-table-force-nowrap">
|
|
class="j-table-force-nowrap">
|
|
<template slot="iresult" slot-scope="text, record,index">
|
|
<template slot="iresult" slot-scope="text, record,index">
|
|
- <a-form-model-item :prop="'itemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
|
|
|
|
|
|
+ <a-form-model-item :prop="'allItemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
|
|
<a-radio-group name="radioGroup" v-model="record.iresult">
|
|
<a-radio-group name="radioGroup" v-model="record.iresult">
|
|
<a-radio value="0">
|
|
<a-radio value="0">
|
|
正常
|
|
正常
|
|
@@ -53,7 +53,7 @@
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</template>
|
|
</template>
|
|
<template slot="iremark" slot-scope="text, record,index">
|
|
<template slot="iremark" slot-scope="text, record,index">
|
|
- <a-form-model-item :prop="'itemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
|
|
|
|
|
|
+ <a-form-model-item :prop="'allItemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
|
|
<a-input v-model="record.iremark" placeholder="请输入点检备注"></a-input>
|
|
<a-input v-model="record.iremark" placeholder="请输入点检备注"></a-input>
|
|
</a-form-model-item>
|
|
</a-form-model-item>
|
|
</template>
|
|
</template>
|
|
@@ -67,56 +67,6 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
|
-const treeData1 = [
|
|
|
|
- {
|
|
|
|
- title: '测试123456',
|
|
|
|
- key: '1111111111111',
|
|
|
|
- type: '巡检路线',
|
|
|
|
- completionStatus: '0',
|
|
|
|
- slots: { icon: 'parent', },
|
|
|
|
- // ⚠️重点这这里⚠️每一条数据上都添加scopedSlots属性
|
|
|
|
- scopedSlots:{ title:"handle" },
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- title: '测试巡检点的修改NO1',
|
|
|
|
- key: '12223333333',
|
|
|
|
- type: '巡检点',
|
|
|
|
- slots: { icon: 'child', },
|
|
|
|
- // ⚠️重点这这里⚠️每一条数据上都添加scopedSlots属性
|
|
|
|
- scopedSlots:{ title:"handle" },
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- title: '半自动立钻Z5180C',
|
|
|
|
- key: '55555555555',
|
|
|
|
- type: '巡检内容',
|
|
|
|
- scopedSlots:{ title:"handle" },
|
|
|
|
- ItemList: [
|
|
|
|
- // 巡检标准相关信息
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- title: '测试巡检点的修改NO2',
|
|
|
|
- key: '456293324552',
|
|
|
|
- type: '巡检点',
|
|
|
|
- completionStatus: '1',
|
|
|
|
- scopedSlots:{ title:"handle" },
|
|
|
|
- children: [
|
|
|
|
- {
|
|
|
|
- title: '半自动立钻Z5180D',
|
|
|
|
- key: '1335633666666',
|
|
|
|
- type: '巡检内容',
|
|
|
|
- ItemList: [
|
|
|
|
- // 巡检标准相关信息
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- ],
|
|
|
|
- },
|
|
|
|
-];
|
|
|
|
-
|
|
|
|
import { httpAction, getAction, putAction } from '@/api/manage'
|
|
import { httpAction, getAction, putAction } from '@/api/manage'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
|
|
|
@@ -135,7 +85,8 @@ const treeData1 = [
|
|
data () {
|
|
data () {
|
|
return {
|
|
return {
|
|
model: {
|
|
model: {
|
|
- itemList: []
|
|
|
|
|
|
+ itemList: [],
|
|
|
|
+ allItemList: []
|
|
},
|
|
},
|
|
labelCol: {
|
|
labelCol: {
|
|
xs: { span: 24 },
|
|
xs: { span: 24 },
|
|
@@ -158,6 +109,7 @@ const treeData1 = [
|
|
queryTreeById: "/cmmsInspect/cmmsInspect/queryTreeById",
|
|
queryTreeById: "/cmmsInspect/cmmsInspect/queryTreeById",
|
|
queryItemByCountId: "/cmmsInspect/cmmsInspect/queryItemByCountId",
|
|
queryItemByCountId: "/cmmsInspect/cmmsInspect/queryItemByCountId",
|
|
feedback: "/cmmsInspect/cmmsInspect/feedback",
|
|
feedback: "/cmmsInspect/cmmsInspect/feedback",
|
|
|
|
+ list: "/cmmsInspect/cmmsInspect/list",
|
|
},
|
|
},
|
|
treeData: [],
|
|
treeData: [],
|
|
selectedKeys: [], // (受控)设置选中的树节点
|
|
selectedKeys: [], // (受控)设置选中的树节点
|
|
@@ -233,6 +185,7 @@ const treeData1 = [
|
|
created () {
|
|
created () {
|
|
//备份model原始值
|
|
//备份model原始值
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
|
+ var _this = this
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
edit (record) {
|
|
edit (record) {
|
|
@@ -240,9 +193,7 @@ const treeData1 = [
|
|
this.visible = true;
|
|
this.visible = true;
|
|
this.confirmLoading = true
|
|
this.confirmLoading = true
|
|
// getAction(this.url.queryById, {id: record.id}).then((res) => {
|
|
// getAction(this.url.queryById, {id: record.id}).then((res) => {
|
|
- // console.log(res)
|
|
|
|
// this.model = res.result
|
|
// this.model = res.result
|
|
- // // console.log(res.result.planList)
|
|
|
|
// var planList = res.result.planList
|
|
// var planList = res.result.planList
|
|
// var orderData = []
|
|
// var orderData = []
|
|
// if(planList.length>0){
|
|
// if(planList.length>0){
|
|
@@ -258,7 +209,6 @@ const treeData1 = [
|
|
// if(spotItem.inspectContentList){
|
|
// if(spotItem.inspectContentList){
|
|
// for (let i = 0; i < spotItem.inspectContentList.length; i++) {
|
|
// for (let i = 0; i < spotItem.inspectContentList.length; i++) {
|
|
// const contentItem = spotItem.inspectContentList[i];
|
|
// const contentItem = spotItem.inspectContentList[i];
|
|
- // console.log(spotItem, contentItem)
|
|
|
|
// // 巡检内容数据
|
|
// // 巡检内容数据
|
|
// if(contentItem){
|
|
// if(contentItem){
|
|
// var contentNode = {
|
|
// var contentNode = {
|
|
@@ -297,7 +247,6 @@ const treeData1 = [
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
- // console.log(orderData)
|
|
|
|
// this.treeData = orderData
|
|
// this.treeData = orderData
|
|
// // if(planList.length>0){
|
|
// // if(planList.length>0){
|
|
// // planList.map(item => {
|
|
// // planList.map(item => {
|
|
@@ -328,13 +277,14 @@ const treeData1 = [
|
|
// this.confirmLoading = false
|
|
// this.confirmLoading = false
|
|
// })
|
|
// })
|
|
getAction(this.url.queryTreeById, {id: record.id}).then((res) => {
|
|
getAction(this.url.queryTreeById, {id: record.id}).then((res) => {
|
|
- console.log(res)
|
|
|
|
if(this.selectedKeys.length === 0){
|
|
if(this.selectedKeys.length === 0){
|
|
this.model = res.result
|
|
this.model = res.result
|
|
}
|
|
}
|
|
// this.model.itemList = []
|
|
// this.model.itemList = []
|
|
this.treeData = this.setIcon(res.result.children)
|
|
this.treeData = this.setIcon(res.result.children)
|
|
this.confirmLoading = false
|
|
this.confirmLoading = false
|
|
|
|
+ this.getAllItem();
|
|
|
|
+ console.log("allItemList", this.model.allItemList);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 设置树结构图标
|
|
// 设置树结构图标
|
|
@@ -356,8 +306,6 @@ const treeData1 = [
|
|
// 二次点击树节点时selectedKeys为空,直接return中断执行
|
|
// 二次点击树节点时selectedKeys为空,直接return中断执行
|
|
if (selectedKeys.length === 0) return
|
|
if (selectedKeys.length === 0) return
|
|
this.selectedKeys = selectedKeys
|
|
this.selectedKeys = selectedKeys
|
|
- // console.log('selected', selectedKeys, info);
|
|
|
|
- console.log(info.selectedNodes[0].data.props)
|
|
|
|
var props = info.selectedNodes[0].data.props
|
|
var props = info.selectedNodes[0].data.props
|
|
if(props.type === '巡检内容'){
|
|
if(props.type === '巡检内容'){
|
|
// this.model.itemList = props.inspectTcontentItemList
|
|
// this.model.itemList = props.inspectTcontentItemList
|
|
@@ -371,16 +319,36 @@ const treeData1 = [
|
|
// this.getItemList(props.id)
|
|
// this.getItemList(props.id)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ getAllItem() {
|
|
|
|
+ var _this = this
|
|
|
|
+ _this.model.allItemList = [];
|
|
|
|
+ this.treeData.forEach(option =>{
|
|
|
|
+ if (option.type == "巡检点") {
|
|
|
|
+ option.children.forEach(address => {
|
|
|
|
+ address.inspectTcontentItemList.forEach(item => {
|
|
|
|
+ item.equipmentname = props.equipmentname
|
|
|
|
+ _this.model.allItemList.push(item)
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ else if (option.type == "巡检路线") {
|
|
|
|
+ option.children.forEach(line => {
|
|
|
|
+ line.children.forEach(address => {
|
|
|
|
+ address.inspectTcontentItemList.forEach(item => {
|
|
|
|
+ _this.model.allItemList.push(item)
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
getItemList(id){
|
|
getItemList(id){
|
|
getAction(this.url.queryItemByCountId, {countId: id, inspectId: this.model.id}).then((res) => {
|
|
getAction(this.url.queryItemByCountId, {countId: id, inspectId: this.model.id}).then((res) => {
|
|
- console.log(res)
|
|
|
|
this.model.itemList = res.result
|
|
this.model.itemList = res.result
|
|
- console.log(this.model)
|
|
|
|
this.$forceUpdate()
|
|
this.$forceUpdate()
|
|
})
|
|
})
|
|
},
|
|
},
|
|
handleFeedback(){
|
|
handleFeedback(){
|
|
- console.log(this.model.itemList)
|
|
|
|
this.confirmLoading = true
|
|
this.confirmLoading = true
|
|
putAction(this.url.feedback, this.model.itemList).then((res) => {
|
|
putAction(this.url.feedback, this.model.itemList).then((res) => {
|
|
if(res.success){
|
|
if(res.success){
|