|
@@ -25,26 +25,38 @@
|
|
|
<div @click="addInspectSpot"><a-icon type="plus"/>巡检点</div>
|
|
|
</div>
|
|
|
<a-table
|
|
|
- ref="table"
|
|
|
size="middle"
|
|
|
- bordered
|
|
|
rowKey="id"
|
|
|
- :columns="columns"
|
|
|
+ :columns="spotColumns"
|
|
|
:dataSource="model.inspectSpotList"
|
|
|
:pagination="false"
|
|
|
- class="j-table-force-nowrap">
|
|
|
- <div slot="expandedRowRender" slot-scope="record">
|
|
|
- <a-table
|
|
|
- ref="table"
|
|
|
- size="middle"
|
|
|
- bordered
|
|
|
- rowKey="id"
|
|
|
- :columns="innerColumns"
|
|
|
- :dataSource="record.inspectContentList"
|
|
|
- :pagination="false"
|
|
|
- class="j-table-force-nowrap">
|
|
|
- </a-table>
|
|
|
- </div>
|
|
|
+ class="line-spot-table">
|
|
|
+ <template slot="expandedRowRender" slot-scope="record">
|
|
|
+ <div class="spot-content-container">
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="contentColumns"
|
|
|
+ :dataSource="record.inspectContentList"
|
|
|
+ :pagination="false"
|
|
|
+ class="spot-content-table">
|
|
|
+ <template slot="expandedRowRender" slot-scope="record">
|
|
|
+ <div class="item-container">
|
|
|
+ <!-- bordered -->
|
|
|
+ <a-table
|
|
|
+ size="middle"
|
|
|
+ rowKey="id"
|
|
|
+ :columns="itemColumns"
|
|
|
+ :dataSource="record.cmmsInspectContentItemList"
|
|
|
+ :pagination="false"
|
|
|
+ class="item-table">
|
|
|
+ <!-- :showHeader="false" -->
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </a-table>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</a-table>
|
|
|
</a-form-model>
|
|
|
<inspect-line-modal-add ref="addSpotRef" :selectData="model.inspectSpotList" @ok="handleOk"></inspect-line-modal-add>
|
|
@@ -86,23 +98,85 @@
|
|
|
},
|
|
|
confirmLoading: false,
|
|
|
validatorRules: {
|
|
|
+ linename: [
|
|
|
+ { required: true, message: '请输入巡检路线名称!'},
|
|
|
+ ],
|
|
|
},
|
|
|
url: {
|
|
|
add: "/cmmsInspectLine/cmmsInspectLine/add",
|
|
|
edit: "/cmmsInspectLine/cmmsInspectLine/edit",
|
|
|
queryById: "/cmmsInspectLine/cmmsInspectLine/queryById"
|
|
|
},
|
|
|
- columns: [
|
|
|
- // {
|
|
|
- // title: '',
|
|
|
- // dataIndex: '',
|
|
|
- // key:'rowIndex',
|
|
|
- // width:60,
|
|
|
- // align:"center",
|
|
|
- // customRender:function (t,r,index) {
|
|
|
- // return parseInt(index)+1;
|
|
|
- // }
|
|
|
- // },
|
|
|
+ // columns: [
|
|
|
+ // // {
|
|
|
+ // // title: '',
|
|
|
+ // // dataIndex: '',
|
|
|
+ // // key:'rowIndex',
|
|
|
+ // // width:60,
|
|
|
+ // // align:"center",
|
|
|
+ // // customRender:function (t,r,index) {
|
|
|
+ // // return parseInt(index)+1;
|
|
|
+ // // }
|
|
|
+ // // },
|
|
|
+ // {
|
|
|
+ // title:'巡检点编号',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'contentcode'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title:'巡检点名称',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'contentname'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title:'备注',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'remark'
|
|
|
+ // },
|
|
|
+ // ],
|
|
|
+ // innerColumns: [
|
|
|
+ // // {
|
|
|
+ // // title: '#',
|
|
|
+ // // dataIndex: '',
|
|
|
+ // // key:'rowIndex',
|
|
|
+ // // width:60,
|
|
|
+ // // align:"center",
|
|
|
+ // // customRender:function (t,r,index) {
|
|
|
+ // // return parseInt(index)+1;
|
|
|
+ // // }
|
|
|
+ // // },
|
|
|
+ // {
|
|
|
+ // title:'巡检项目编号',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'contentcode'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title:'巡检项目名称',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'contentname'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title:'巡检项目类型',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'itemname'
|
|
|
+ // },
|
|
|
+ // {
|
|
|
+ // title:'巡检设备',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'equipmentname'
|
|
|
+ // },
|
|
|
+ // // {
|
|
|
+ // // title:'标准',
|
|
|
+ // // align:"center",
|
|
|
+ // // dataIndex: 'inspectionstandards',
|
|
|
+ // // },
|
|
|
+ // {
|
|
|
+ // title:'备注',
|
|
|
+ // align:"center",
|
|
|
+ // dataIndex: 'remark'
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ spotColumns: [
|
|
|
{
|
|
|
title:'巡检点编号',
|
|
|
align:"center",
|
|
@@ -119,48 +193,85 @@
|
|
|
dataIndex: 'remark'
|
|
|
},
|
|
|
],
|
|
|
- innerColumns: [
|
|
|
- // {
|
|
|
- // title: '#',
|
|
|
- // dataIndex: '',
|
|
|
- // key:'rowIndex',
|
|
|
- // width:60,
|
|
|
- // align:"center",
|
|
|
- // customRender:function (t,r,index) {
|
|
|
- // return parseInt(index)+1;
|
|
|
- // }
|
|
|
- // },
|
|
|
+ contentColumns: [
|
|
|
{
|
|
|
- title:'巡检项目编号',
|
|
|
+ title:'巡检内容编号',
|
|
|
align:"center",
|
|
|
- dataIndex: 'contentcode'
|
|
|
+ dataIndex: 'contentcode',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 4}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
{
|
|
|
- title:'巡检项目名称',
|
|
|
+ title:'巡检内容名称',
|
|
|
align:"center",
|
|
|
- dataIndex: 'contentname'
|
|
|
+ dataIndex: 'contentname',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 0}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
{
|
|
|
- title:'巡检项目类型',
|
|
|
+ title:'设备名称',
|
|
|
align:"center",
|
|
|
- dataIndex: 'itemname'
|
|
|
+ dataIndex: 'equipmentname',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 0}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
},
|
|
|
{
|
|
|
- title:'巡检设备',
|
|
|
+ title:'备注',
|
|
|
align:"center",
|
|
|
- dataIndex: 'equipmentname'
|
|
|
+ dataIndex: 'remark',
|
|
|
+ // customRender: (text, row, index) => {
|
|
|
+ // return {
|
|
|
+ // children: text,
|
|
|
+ // attrs: {colSpan: 0}
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ itemColumns: [
|
|
|
+ {
|
|
|
+ title:'巡检项编号',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'itemcode'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'名称',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'itemname'
|
|
|
},
|
|
|
// {
|
|
|
- // title:'标准',
|
|
|
+ // title:'设备类型',
|
|
|
// align:"center",
|
|
|
- // dataIndex: 'inspectionstandards',
|
|
|
+ // dataIndex: 'equipdefname'
|
|
|
// },
|
|
|
{
|
|
|
+ title:'巡检标准',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'inspectionstandards'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title:'巡检项类型',
|
|
|
+ align:"left",
|
|
|
+ dataIndex: 'classification_dictText'
|
|
|
+ },
|
|
|
+ {
|
|
|
title:'备注',
|
|
|
- align:"center",
|
|
|
- dataIndex: 'remark'
|
|
|
- }
|
|
|
- ],
|
|
|
+ align:"left",
|
|
|
+ width: 80,
|
|
|
+ dataIndex: 'remark',
|
|
|
+ },
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -181,8 +292,14 @@
|
|
|
this.$refs.addSpotRef.title = "选择巡检点";
|
|
|
},
|
|
|
edit (record) {
|
|
|
- this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
+ this.confirmLoading = true
|
|
|
+ // this.model = Object.assign({}, record);
|
|
|
+ getAction(this.url.queryById, {id: record.id}).then((res) => {
|
|
|
+ this.model = res.result
|
|
|
+ console.log(res)
|
|
|
+ this.confirmLoading = false
|
|
|
+ })
|
|
|
},
|
|
|
submitForm () {
|
|
|
const that = this;
|
|
@@ -225,4 +342,38 @@
|
|
|
</script>
|
|
|
<style scoped>
|
|
|
@import '~@/assets/less/uStyle.less';
|
|
|
+</style>
|
|
|
+<style lang="less" scoped>
|
|
|
+ .line-spot-table{
|
|
|
+ background-color: #ecf3ef;
|
|
|
+ // tr > td{
|
|
|
+ // border: none;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ // 巡检点下的巡检内容
|
|
|
+ /deep/ .spot-content-container{
|
|
|
+ background-color: #fff;
|
|
|
+ border: 1px solid #e6ebf5;
|
|
|
+ padding: 20px;
|
|
|
+ .spot-content-table{
|
|
|
+ background-color: #e6f7ff;
|
|
|
+ // tr > td{
|
|
|
+ // border: none;
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ .item-container{
|
|
|
+ background: #fff;
|
|
|
+ padding: 20px;
|
|
|
+ border: 1px solid #e6ebf5;
|
|
|
+ .item-table{
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .spot-content-container:hover{
|
|
|
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
|
|
|
+ }
|
|
|
+ // 表格悬浮颜色
|
|
|
+ /deep/ tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > td{
|
|
|
+ background-color: rgba(255,255,255,.4);
|
|
|
+ }
|
|
|
</style>
|