Browse Source

Merge remote-tracking branch 'origin/master'

wyh 1 year ago
parent
commit
602a4c8a2b

+ 15 - 0
src/views/module_cmms/inspect/InspectList.vue

@@ -4,6 +4,21 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="巡检计划名称">
+              <a-input placeholder="请输入巡检计划名称" v-model="queryParam.planname"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
         </a-row>
       </a-form>
     </div>

+ 16 - 1
src/views/module_cmms/inspectLine/InspectLineList.vue

@@ -4,6 +4,21 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="巡检计划名称">
+              <a-input placeholder="请输入巡检计划名称" v-model="queryParam.planname"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
         </a-row>
       </a-form>
     </div>
@@ -180,4 +195,4 @@
 </script>
 <style scoped>
   @import '~@assets/less/common.less';
-</style>
+</style>

+ 204 - 53
src/views/module_cmms/inspectLine/modules/InspectLineForm.vue

@@ -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>

+ 30 - 20
src/views/module_cmms/inspectPlan/InspectPlanList.vue

@@ -4,6 +4,21 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="巡检计划名称">
+              <a-input placeholder="请输入巡检计划名称" v-model="queryParam.planname"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
         </a-row>
       </a-form>
     </div>
@@ -69,6 +84,7 @@
 
         <template slot="status" slot-scope="text, record">
           <a-switch :checked="record.status === '0' ? true : false" checked-children="启动" un-checked-children="停用" @click="changeStatus(record)"/>
+          <!--  checked-children="启动" un-checked-children="停用" -->
         </template>
 
         <span slot="action" slot-scope="text, record">
@@ -98,7 +114,7 @@
 </template>
 
 <script>
-
+  import { httpAction, getAction } from '@/api/manage'
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
@@ -145,7 +161,7 @@
             align:"center",
             dataIndex: 'begintime',
             customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
+              return !text?"-":(text.length>10?text.substr(0,10):text)
             }
           },
           {
@@ -153,7 +169,7 @@
             align:"center",
             dataIndex: 'repeatnum',
             customRender:function (t, r, index) {
-              return r.repeatnum + r.repeattype
+              return r.iftimeset === 'Y' ? r.repeatnum + r.repeattype : '-'
             }
           },
           // {
@@ -166,7 +182,7 @@
             align:"center",
             dataIndex: 'noticenum',
             customRender:function (t, r, index) {
-              return r.noticenum + r.noticetype
+              return r.iftimeset === 'Y' ? r.noticenum + r.noticetype : '-'
             }
           },
           // {
@@ -175,7 +191,7 @@
           //   dataIndex: 'noticetype'
           // },
           {
-            title:'状态(0启用 1停用)',
+            title:'状态',
             align:"center",
             dataIndex: 'status',
             scopedSlots: { customRender: 'status' }
@@ -190,7 +206,7 @@
             align:"center",
             dataIndex: 'nexttime',
             customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
+              return !text?"-":(text.length>10?text.substr(0,10):text)
             }
           },
           {
@@ -203,7 +219,7 @@
             align:"center",
             dataIndex: 'noticetime',
             customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
+              return !text?"-":(text.length>10?text.substr(0,10):text)
             }
           },
           {
@@ -231,6 +247,7 @@
           deleteBatch: "/cmmsInspectPlan/cmmsInspectPlan/deleteBatch",
           exportXlsUrl: "/cmmsInspectPlan/cmmsInspectPlan/exportXls",
           importExcelUrl: "cmmsInspectPlan/cmmsInspectPlan/importExcel",
+          updateStatus: "cmmsInspectPlan/cmmsInspectPlan/updateStatus",
           
         },
         dictOptions:{},
@@ -247,33 +264,26 @@
     },
     methods: {
       changeStatus(record){
-        console.log(record.status)
+        // console.log(record.status)
         const that = this
         that.$confirm({
           title: "提示",
           content: record.status ==='0'?'确定停用吗?':'确定启用吗?',
           onOk() {
-            let httpurl = '';
-            let method = 'put';
-            httpurl+=that.url.edit;
-            if (record.status == 1) {
-              that.model = record
-              that.model.status = 0
-            } else {
-              that.model = record
-              that.model.status = 1
+            var status = {
+              id: record.id,
+              status: record.status ==='0' ? '1' : '0',
             }
-            httpAction(httpurl,that.model,method).then((res)=>{
+            httpAction(that.url.updateStatus,status,'put').then((res)=>{
               if(res.success){
+                that.loadData()
                 that.$message.success(res.message);
-                that.modalFormOk()
               }else{
                 that.$message.warning(res.message);
               }
             })
           },
           onCancel() {
-            // that.modalFormOk()
           }
         });
       },

+ 15 - 0
src/views/module_cmms/inspectSpot/InspectSpotList.vue

@@ -4,6 +4,21 @@
     <div class="table-page-search-wrapper">
       <a-form layout="inline" @keyup.enter.native="searchQuery">
         <a-row :gutter="24">
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="巡检计划名称">
+              <a-input placeholder="请输入巡检计划名称" v-model="queryParam.planname"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+              <a @click="handleToggleSearch" style="margin-left: 8px">
+                {{ toggleSearchStatus ? '收起' : '展开' }}
+                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
+              </a>
+            </span>
+          </a-col>
         </a-row>
       </a-form>
     </div>