Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

LLL 1 rok temu
rodzic
commit
e07ce95360

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

+ 21 - 6
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>
@@ -122,11 +137,6 @@
             }
           },
           {
-            title:'备注',
-            align:"center",
-            dataIndex: 'remark'
-          },
-          {
             title:'巡检路线编号',
             align:"center",
             dataIndex: 'linecode'
@@ -137,6 +147,11 @@
             dataIndex: 'linename'
           },
           {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
             title: '操作',
             dataIndex: 'action',
             align:"center",
@@ -180,4 +195,4 @@
 </script>
 <style scoped>
   @import '~@assets/less/common.less';
-</style>
+</style>

+ 214 - 62
src/views/module_cmms/inspectLine/modules/InspectLineForm.vue

@@ -11,12 +11,12 @@
           </a-col> -->
           <a-col :span="24">
             <a-form-model-item label="巡检路线名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="linename">
-              <a-input v-model="model.linename" placeholder="请输入巡检路线名称"  ></a-input>
+              <a-input v-model="model.linename" placeholder="请输入巡检路线名称" ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
-              <a-input v-model="model.remark" placeholder="请输入备注"  ></a-input>
+              <a-input v-model="model.remark" placeholder="请输入备注"></a-input>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -25,29 +25,41 @@
           <div @click="addInspectSpot"><a-icon type="plus"/>巡检点</div>
         </div>
         <a-table
-          ref="table"
           size="middle"
-          bordered
           rowKey="id"
-          :columns="columns"
-          :dataSource="model.inspectSpotList"
+          :columns="spotColumns"
+          :dataSource="model.detailList"
           :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>
+      <inspect-line-modal-add ref="addSpotRef" :selectData="model.detailList" @ok="handleOk"></inspect-line-modal-add>
     </j-form-container>
   </a-spin>
 </template>
@@ -74,7 +86,7 @@
     data () {
       return {
         model:{
-          inspectSpotList: []
+          detailList: []
         },
         labelCol: {
           xs: { span: 24 },
@@ -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: {
@@ -174,15 +285,22 @@
     },
     methods: {
       add () {
-        this.edit(this.modelDefault);
+        // this.edit(this.modelDefault);
+        this.visible = true;
       },
       addInspectSpot(){
         this.$refs.addSpotRef.add();
         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;
@@ -215,14 +333,48 @@
       },
       handleOk(data){
         console.log(data)
-        data.map(res=>{
-
+        this.model.detailList = data.map(item=>{
+          item.inspectspotid = item.id
+          return item
         })
-        this.model.inspectSpotList = data;
       },
     }
   }
 </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>

+ 2 - 2
src/views/module_cmms/inspectLine/modules/InspectLineModalAdd.vue

@@ -100,7 +100,7 @@
         this.selectionRows = this.selectData
         console.log(this.selectData)
         this.selectedRowKeys = this.selectData.map((res) => {
-          return res.id
+          return res.inspectspotid
         })
       },
       close () {
@@ -109,7 +109,7 @@
         this.onClearSelected()
         this.selectionRows = this.selectData
         this.selectedRowKeys = this.selectData.map((res) => {
-          return res.id
+          return res.inspectspotid
         })
         this.dataSource = []
       },

+ 73 - 21
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>
@@ -67,6 +82,11 @@
           </a-button>
         </template>
 
+        <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">
           <a @click="handleEdit(record)">编辑</a>
 
@@ -94,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'
@@ -132,7 +152,7 @@
             dataIndex: 'planname'
           },
           {
-            title:'是否开启时间设置:Y是、N否',
+            title:'是否开启时间设置',
             align:"center",
             dataIndex: 'iftimeset'
           },
@@ -141,33 +161,40 @@
             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)
             }
           },
           {
-            title:'重复',
-            align:"center",
-            dataIndex: 'repeatnum'
-          },
-          {
-            title:'重复类型:年、月、周、日、时、分',
+            title:'重复周期',
             align:"center",
-            dataIndex: 'repeattype'
+            dataIndex: 'repeatnum',
+            customRender:function (t, r, index) {
+              return r.iftimeset === 'Y' ? r.repeatnum + r.repeattype : '-'
+            }
           },
+          // {
+          //   title:'重复类型:年、月、周、日、时、分',
+          //   align:"center",
+          //   dataIndex: 'repeattype'
+          // },
           {
             title:'提前通知时间',
             align:"center",
-            dataIndex: 'noticenum'
-          },
-          {
-            title:'提前通知类型:天、时、分',
-            align:"center",
-            dataIndex: 'noticetype'
+            dataIndex: 'noticenum',
+            customRender:function (t, r, index) {
+              return r.iftimeset === 'Y' ? r.noticenum + r.noticetype : '-'
+            }
           },
+          // {
+          //   title:'通知单位',
+          //   align:"center",
+          //   dataIndex: 'noticetype'
+          // },
           {
-            title:'状态(0启用 1停用)',
+            title:'状态',
             align:"center",
-            dataIndex: 'status'
+            dataIndex: 'status',
+            scopedSlots: { customRender: 'status' }
           },
           {
             title:'待办人',
@@ -179,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)
             }
           },
           {
@@ -192,11 +219,11 @@
             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)
             }
           },
           {
-            title:'是否已通知:是/否',
+            title:'是否已通知',
             align:"center",
             dataIndex: 'ifnotice'
           },
@@ -220,6 +247,7 @@
           deleteBatch: "/cmmsInspectPlan/cmmsInspectPlan/deleteBatch",
           exportXlsUrl: "/cmmsInspectPlan/cmmsInspectPlan/exportXls",
           importExcelUrl: "cmmsInspectPlan/cmmsInspectPlan/importExcel",
+          updateStatus: "cmmsInspectPlan/cmmsInspectPlan/updateStatus",
           
         },
         dictOptions:{},
@@ -235,6 +263,30 @@
       },
     },
     methods: {
+      changeStatus(record){
+        // console.log(record.status)
+        const that = this
+        that.$confirm({
+          title: "提示",
+          content: record.status ==='0'?'确定停用吗?':'确定启用吗?',
+          onOk() {
+            var status = {
+              id: record.id,
+              status: record.status ==='0' ? '1' : '0',
+            }
+            httpAction(that.url.updateStatus,status,'put').then((res)=>{
+              if(res.success){
+                that.loadData()
+                that.$message.success(res.message);
+              }else{
+                that.$message.warning(res.message);
+              }
+            })
+          },
+          onCancel() {
+          }
+        });
+      },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 125 - 30
src/views/module_cmms/inspectPlan/modules/InspectPlanFormList.vue

@@ -20,12 +20,12 @@
         class="plan-table">
         <!-- :loading="loading" -->
         <template slot="expandedRowRender" slot-scope="record">
-          <div v-if="record.type === '巡检路线'" class="line-spot-container">
+          <div v-if="record.tasktype === '巡检路线'" class="line-spot-container">
             <a-table
               size="middle"
               rowKey="id"
-              :columns="columns"
-              :dataSource="record.sonList"
+              :columns="spotColumns"
+              :dataSource="record.inspectLineVo.detailList"
               :pagination="false"
               :showHeader="false"
               class="line-spot-table">
@@ -35,7 +35,7 @@
                     size="middle"
                     rowKey="id"
                     :columns="contentColumns"
-                    :dataSource="record.sonList"
+                    :dataSource="record.inspectContentList"
                     :pagination="false"
                     class="spot-content-table">
                     <template slot="expandedRowRender" slot-scope="record">
@@ -57,12 +57,12 @@
               </template>
             </a-table>
           </div>
-          <div v-if="record.type === '巡检点'" class="spot-content-container">
+          <div v-if="record.tasktype === '巡检点'" class="spot-content-container">
             <a-table
               size="middle"
               rowKey="id"
               :columns="contentColumns"
-              :dataSource="record.sonList"
+              :dataSource="record.inspectSpotVo.inspectContentList"
               :pagination="false"
               class="spot-content-table">
               <template slot="expandedRowRender" slot-scope="record">
@@ -84,8 +84,8 @@
         </template>
       </a-table>
 
-      <inspect-plan-modal-add-line ref="addLineRef" :selectData="inspectLineList" @ok="handleOk"></inspect-plan-modal-add-line>
-      <inspect-plan-modal-add-spot ref="addSpotRef" :selectData="inspectSpotList" @ok="handleOk"></inspect-plan-modal-add-spot>
+      <inspect-plan-modal-add-line ref="addLineRef" :selectData="inspectLineList" @ok="handleLineOk"></inspect-plan-modal-add-line>
+      <inspect-plan-modal-add-spot ref="addSpotRef" :selectData="inspectSpotList" @ok="handleSpotOk"></inspect-plan-modal-add-spot>
     </div>
   </a-spin>
 </template>
@@ -115,7 +115,6 @@
       return {
         inspectLineList: [],
         inspectSpotList: [],
-        addType: '巡检点',
         // model:{
         // },
         labelCol: {
@@ -135,7 +134,7 @@
           queryById: "/cmmsInspectPlan/cmmsInspectPlan/queryById",
           queryTreeById: "/cmmsInspectPlan/cmmsInspectPlan/queryTreeById"
         },
-        tableData: [],
+        tableData: [], // 获取或页面展示的数据和格式
         columns: [
           // {
           //   title: '序号',
@@ -150,21 +149,36 @@
           {
             title:'巡检类型',
             align:"center",
-            dataIndex: 'type'
+            dataIndex: 'tasktype'
           },
           {
             title:'名称',
             align:"center",
-            dataIndex: 'title',
-            // dataIndex: 'inspectLineVo',
-            // customRender:function (scope) {
-            //   return scope.linename
-            // }
+            // dataIndex: 'title',
+            dataIndex: 'linename',
+            customRender:function (t,r,index) {
+              // console.log(t,r,index)
+              if(r.tasktype === '巡检路线'){
+                return r.inspectLineVo.linename
+              }
+              if(r.tasktype === '巡检点'){
+                return r.inspectSpotVo.contentname
+              }
+            }
           },
           {
             title:'编号',
             align:"center",
-            dataIndex: ''
+            ddataIndex: 'linecode',
+            customRender:function (t,r,index) {
+              // console.log(t,r,index)
+              if(r.tasktype === '巡检路线'){
+                return r.inspectLineVo.linecode
+              }
+              if(r.tasktype === '巡检点'){
+                return r.inspectSpotVo.contentcode
+              }
+            }
           },
           // {
           //   title:'是否必须执行',
@@ -174,9 +188,35 @@
           {
             title:'备注',
             align:"center",
-            dataIndex: 'remark'
+            dataIndex: 'remark',
+            customRender:function (t,r,index) {
+              // console.log(t,r,index)
+              if(r.tasktype === '巡检路线'){
+                return r.inspectLineVo.remark
+              }
+              if(r.tasktype === '巡检点'){
+                return r.inspectSpotVo.remark
+              }
+            }
           }
         ],
+        spotColumns: [
+          {
+            title:'巡检点编号',
+            align:"center",
+            dataIndex: 'contentcode'
+          },
+          {
+            title:'巡检点名称',
+            align:"center",
+            dataIndex: 'contentname'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+        ],
         contentColumns: [
           {
             title:'巡检内容编号',
@@ -269,10 +309,10 @@
     },
     methods: {
       setRowClassName(record){
-        if(record.type === '巡检路线'){
+        if(record.tasktype === '巡检路线'){
           return 'line-bg'
         }
-        if(record.type === '巡检点'){
+        if(record.tasktype === '巡检点'){
           return 'spot-bg'
         }
       },
@@ -284,26 +324,81 @@
         this.confirmLoading = true
         // this.model = Object.assign({}, record);
         getAction(this.url.queryById, {id: record.id}).then((res) => {
-          this.tableData = res.result.sonList
-          console.log(res)
-          this.confirmLoading = false
+          if(res.success){
+            this.tableData = JSON.parse(JSON.stringify(res.result.taskList))
+          } else {
+            this.$message.warning(res.message);
+          }
+        }).finally(() => {
+          this.confirmLoading = false;
         })
       },
       // 维护巡检路线
       handleAddLine(){
+        this.inspectLineList = this.tableData.filter(item => item.tasktype === '巡检路线').map(i => i.inspectLineVo)
+        this.$refs.addLineRef.add();
+        this.$refs.addLineRef.title = "选择巡检路线";
+      },
+      handleLineOk(data){
+        // console.log(data) // 新获取的巡检路线数据
+        // console.log(this.inspectLineList) // 原来巡检路线数据
+        // 添加--获取最新巡检路线数据中原来巡检点没有的数据
+        var addData = data.filter(item => !this.inspectLineList.some(i=>i.id === item.id))
+        console.log(addLines)
+        var addLines = addData.map(item=>{
+          return {
+            inspectLineVo: item, // 不需要传给后端,前端显示用的
+            tasktype: '巡检路线', // 需要传后端的
+            ifmustexec: 1, // 需要传后端的
+            relid: item.id, // 需要传后端的(所选择的巡检路线或巡检点的真正id)
+          }
+        })
+        this.tableData.push(...addLines)
+        // 删除--原来的数据最新的数据中没有了
+        var delLines = this.inspectLineList.filter(item => !data.some(i=>i.id === item.id))
+        console.log('delLines', delLines)
+        
+        delLines.forEach(item => {
+          var i = this.tableData.findIndex(t => t.tasktype === '巡检路线' && t.inspectLineVo.id === item.id)
+          this.tableData.splice(i, 1)
+        });
+
+        console.log(this.tableData)
       },
       // 维护巡检点
       handleAddSpot(){
-        this.addType = '巡检点'
+        this.inspectSpotList = this.tableData.filter(item => item.tasktype === '巡检点').map(i => i.inspectSpotVo)
         this.$refs.addSpotRef.add();
         this.$refs.addSpotRef.title = "选择巡检点";
+        console.log(this.inspectSpotList)
+      },
+      handleSpotOk(data){
+        // console.log(data) // 新获取的巡检点数据
+        // console.log(this.inspectSpotList) // 原来巡检点数据
+        // 添加--获取最新巡检点数据中原来巡检点没有的数据
+        var addData = data.filter(item => !this.inspectSpotList.some(i=>i.id === item.id))
+        console.log(addSpots)
+        var addSpots = addData.map(item=>{
+          return {
+            inspectSpotVo: item, // 不需要传给后端,前端显示用的
+            tasktype: '巡检点', // 需要传后端的
+            ifmustexec: 1, // 需要传后端的
+            relid: item.id, // 需要传后端的(所选择的巡检路线或巡检点的真正id)
+          }
+        })
+        this.tableData.push(...addSpots)
+        // 删除--原来的数据最新的数据中没有了
+        var delSpots = this.inspectSpotList.filter(item => !data.some(i=>i.id === item.id))
+        console.log('delSpots', delSpots)
+        
+        delSpots.forEach(item => {
+          var i = this.tableData.findIndex(t => t.tasktype === '巡检点' && t.inspectSpotVo.id === item.id)
+          this.tableData.splice(i, 1)
+        });
+
+        // this.tableData.filter(item => item.tasktype === '巡检路线' || (item.tasktype === '巡检点' && !delSpots.some(i=>i.id === item.inspectSpotVo.id)))
+        console.log(this.tableData)
       },
-      handleOk(data){
-        console.log(data)
-        if(this.addType === '巡检点'){
-          this.inspectSpotList = data
-        }
-      }
     }
   }
 </script>

+ 32 - 8
src/views/module_cmms/inspectPlan/modules/InspectPlanFormSet.vue

@@ -15,7 +15,8 @@
           </a-col>
           <a-col :span="12">
             <a-form-model-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
-              <a-input v-model="model.chargeruser" placeholder="请输入待办人"  ></a-input>
+              <!-- <a-input v-model="model.chargeruser" placeholder="请输入待办人"  ></a-input> -->
+              <j-dict-select-tag v-model="model.chargeruser" placeholder="请选择负责人" dictCode="sys_user,realname,username"/>
             </a-form-model-item>
           </a-col>
           <a-col :span="12">
@@ -28,14 +29,14 @@
               <j-dict-select-tag v-model="model.status"  type="radio" dictCode="common_status"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="12">
+          <a-col :span="12" v-if="model.iftimeset === 'Y'">
             <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="begintime">
-              <j-date placeholder="请选择开始时间" v-model="model.begintime"  style="width: 100%" />
+              <j-date placeholder="请选择开始时间" v-model="model.begintime"  style="width: 100%" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" />
             </a-form-model-item>
           </a-col>
-          <a-col :span="12">
-            <a-form-model-item label="重复" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeatnum">
-              <a-input-number v-model="model.repeatnum" placeholder="请输入重复" style="width: 40%;"/>
+          <a-col :span="12" v-if="model.iftimeset === 'Y'">
+            <a-form-model-item label="重复周期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeatnum">
+              <a-input-number v-model="model.repeatnum" placeholder="请输入重复周期" style="width: 40%;"/>
               <j-dict-select-tag  v-model="model.repeattype"  placeholder="请选择重复单位" dictCode="plan_cycle_unit" style="width: 30%;"/>
             </a-form-model-item>
           </a-col>
@@ -44,7 +45,7 @@
               
             </a-form-model-item>
           </a-col> -->
-          <a-col :span="12">
+          <a-col :span="12" v-if="model.iftimeset === 'Y'">
             <a-form-model-item label="提前通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticenum">
               <a-input-number v-model="model.noticenum" placeholder="请输入提前通知时间" style="width: 40%" />
               <j-dict-select-tag v-model="model.noticetype" placeholder="请选择提前通知单位" dictCode="plan_notice_unit" style="width: 30%;"/>
@@ -85,6 +86,8 @@
     data () {
       return {
         model:{
+          iftimeset: 'Y',
+          status: '0',
           noticetype: '天',
           repeattype: '日',
         },
@@ -98,6 +101,21 @@
         },
         confirmLoading: false,
         validatorRules: {
+          planname: [
+            { required: true, message: '请输入巡检计划名称!'},
+          ],
+          chargeruser: [
+            { required: true, message: '请选择负责人!'},
+          ],
+          begintime: [
+            { required: true, message: '请选择开始时间!'},
+          ],
+          repeatnum: [
+            { required: true, message: '请输入重复周期!'},
+          ],
+          noticenum: [
+            { required: true, message: '请输入提前通知时间!'},
+          ],
         },
         url: {
           add: "/cmmsInspectPlan/cmmsInspectPlan/add",
@@ -123,8 +141,14 @@
         this.model = Object.assign({}, record);
         this.visible = true;
       },
-      submitForm () {
+      submitForm (list) {
+        console.log(list)
         const that = this;
+        if(list.length === 0){
+          that.$message.warning('计划列表未填写');
+          return
+        }
+        this.model.taskList = list
         // 触发表单验证
         this.$refs.form.validate(valid => {
           if (valid) {

+ 1 - 1
src/views/module_cmms/inspectPlan/modules/InspectPlanModal.vue

@@ -61,7 +61,7 @@
         this.visible = false;
       },
       handleOk () {
-        this.$refs.realForm.submitForm();
+        this.$refs.realForm.submitForm(this.$refs.realList.tableData);
       },
       submitCallback(){
         this.$emit('ok');

+ 14 - 6
src/views/module_cmms/inspectPlan/modules/InspectPlanModalAddLine.vue

@@ -64,14 +64,14 @@
           //   }
           // },
           {
-            title:'巡检编号',
+            title:'巡检路线编号',
             align:"center",
-            dataIndex: 'contentcode'
+            dataIndex: 'linecode'
           },
           {
-            title:'巡检名称',
+            title:'巡检路线名称',
             align:"center",
-            dataIndex: 'contentname'
+            dataIndex: 'linename'
           },
           {
             title:'备注',
@@ -82,7 +82,15 @@
         dataSource: [],
         url: {
           getList: "/cmmsInspectItem/cmmsInspectItem/getItemByEqId",
-          spotList: "/cmmsInspectSpot/cmmsInspectSpot/listDetails",
+          lineList: "/cmmsInspectLine/cmmsInspectLine/listDetails",
+        },
+      }
+    },
+    watch: {
+      selectData: {
+        handler(newV, oldV){
+          console.log(newV, oldV)
+          this.selectList()
         },
       }
     },
@@ -90,7 +98,7 @@
       add () {
         this.visible = true;
         //  {status: '0'}
-        getAction(this.url.spotList).then((res) => {
+        getAction(this.url.lineList).then((res) => {
           this.dataSource = res.result.records
         })
         this.selectList()

+ 8 - 0
src/views/module_cmms/inspectPlan/modules/InspectPlanModalAddSpot.vue

@@ -86,6 +86,14 @@
         },
       }
     },
+    watch: {
+      selectData: {
+        handler(newV, oldV){
+          console.log(newV, oldV)
+          this.selectList()
+        },
+      }
+    },
     methods: {
       add () {
         this.visible = true;

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

+ 1 - 1
src/views/module_cmms/inspectSpot/modules/InspectSpotForm.vue

@@ -228,7 +228,7 @@
       },
       handleOk(data){
         data.map(res=>{
-
+          
         })
         this.model.inspectContentList = data;
       },

+ 2 - 0
src/views/module_cmms/spotcheck/modules/SpotcheckForm.vue

@@ -323,6 +323,8 @@
                   url: res
                 }
               })
+            }else{
+              this.model.files = []
             }
             httpAction(httpurl,this.model,method).then((res)=>{
               if(res.success){

+ 101 - 64
src/views/module_cmms/upkeep/UpkeepList.vue

@@ -4,6 +4,38 @@
     <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.upkeepcode"></a-input>
+            </a-form-item>
+          </a-col>
+          <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>
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="设备">
+                <j-search-select-tag v-model="queryParam.equipmentid" dict="tpm_equipment,equipmentname,id"  placeholder="请选择设备"/>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="负责人">
+                <j-dict-select-tag v-model="queryParam.chargeruser" placeholder="请选择负责人" dictCode="sys_user,realname,id"/>
+              </a-form-item>
+            </a-col>
+          </template>
+          <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>
@@ -18,20 +50,20 @@
       </a-upload> -->
       <!-- 高级查询区域 -->
       <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
-      <a-dropdown v-if="selectedRowKeys.length > 0">
+      <!-- <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
-      </a-dropdown>
+      </a-dropdown> -->
     </div>
 
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
+      <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
         <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
         <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
+      </div> -->
 
       <a-table
         ref="table"
@@ -43,7 +75,6 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
         class="j-table-force-nowrap"
         @change="handleTableChange">
 
@@ -68,10 +99,11 @@
         </template>
 
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
+          <a @click="handleEdit(record)">反馈</a>
+          <!-- <a @click="handleEdit(record)">编辑</a> -->
 
-          <a-divider type="vertical" />
-          <a-dropdown>
+          <!-- <a-divider type="vertical" /> -->
+          <!-- <a-dropdown>
             <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
             <a-menu slot="overlay">
               <a-menu-item>
@@ -83,7 +115,7 @@
                 </a-popconfirm>
               </a-menu-item>
             </a-menu>
-          </a-dropdown>
+          </a-dropdown> -->
         </span>
 
       </a-table>
@@ -122,35 +154,30 @@
             }
           },
           {
-            title:'备注',
-            align:"center",
-            dataIndex: 'remark'
-          },
-          {
             title:'保养工单编号',
             align:"center",
             dataIndex: 'upkeepcode'
           },
-          {
-            title:'保养名称(标题)',
-            align:"center",
-            dataIndex: 'upkeepname'
-          },
-          {
-            title:'保养计划ID',
-            align:"center",
-            dataIndex: 'upkeepplanid'
-          },
-          {
-            title:'保养工作项目ID',
-            align:"center",
-            dataIndex: 'upkeepprojid'
-          },
-          {
-            title:'工作项目名称',
-            align:"center",
-            dataIndex: 'projectname'
-          },
+          // {
+          //   title:'保养名称(标题)',
+          //   align:"center",
+          //   dataIndex: 'upkeepname'
+          // },
+          // {
+          //   title:'保养计划ID',
+          //   align:"center",
+          //   dataIndex: 'upkeepplanid'
+          // },
+          // {
+          //   title:'保养工作项目ID',
+          //   align:"center",
+          //   dataIndex: 'upkeepprojid'
+          // },
+          // {
+          //   title:'工作项目名称',
+          //   align:"center",
+          //   dataIndex: 'projectname'
+          // },
           {
             title:'计划名称',
             align:"center",
@@ -161,46 +188,51 @@
             align:"center",
             dataIndex: 'address'
           },
-          {
-            title:'厂商名称',
-            align:"center",
-            dataIndex: 'supplier'
-          },
-          {
-            title:'厂商电话',
-            align:"center",
-            dataIndex: 'suppliertel'
-          },
-          {
-            title:'联系人',
-            align:"center",
-            dataIndex: 'linker'
-          },
-          {
-            title:'联系人电话',
-            align:"center",
-            dataIndex: 'linkertel'
-          },
+          // {
+          //   title:'厂商名称',
+          //   align:"center",
+          //   dataIndex: 'supplier'
+          // },
+          // {
+          //   title:'厂商电话',
+          //   align:"center",
+          //   dataIndex: 'suppliertel'
+          // },
+          // {
+          //   title:'联系人',
+          //   align:"center",
+          //   dataIndex: 'linker'
+          // },
+          // {
+          //   title:'联系人电话',
+          //   align:"center",
+          //   dataIndex: 'linkertel'
+          // },
           {
             title:'负责人',
             align:"center",
-            dataIndex: 'chargeruser'
-          },
-          {
-            title:'描述',
-            align:"center",
-            dataIndex: 'upkeepdesc'
+            dataIndex: 'chargeruser_dictText'
           },
+          // {
+          //   title:'描述',
+          //   align:"center",
+          //   dataIndex: 'upkeepdesc'
+          // },
           {
-            title:'状态:0待处理、1已通知、2未执行、3未完成、4已完成',
+            title:'状态',
             align:"center",
-            dataIndex: 'status'
+            dataIndex: 'status_dictText'
           },
           {
-            title:'处理意见',
+            title:'备注',
             align:"center",
-            dataIndex: 'opinion'
+            dataIndex: 'remark'
           },
+          // {
+          //   title:'处理意见',
+          //   align:"center",
+          //   dataIndex: 'opinion'
+          // },
           {
             title: '操作',
             dataIndex: 'action',
@@ -231,6 +263,11 @@
       },
     },
     methods: {
+      handleEdit: function (record) {
+        this.$refs.modalForm.edit(record);
+        this.$refs.modalForm.title = "反馈";
+        this.$refs.modalForm.disableSubmit = false;
+      },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 148 - 37
src/views/module_cmms/upkeep/modules/UpkeepForm.vue

@@ -2,88 +2,118 @@
   <a-spin :spinning="confirmLoading">
     <j-form-container :disabled="formDisabled">
       <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <div class="cmms-dialog-item-title">保养工单基本信息</div>
         <a-row>
-          <a-col :span="24">
-            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
-              <a-input v-model="model.remark" placeholder="请输入备注"  ></a-input>
+          <a-col :span="12">
+            <a-form-model-item label="保养工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepcode">
+              <!-- {{model.upkeepcode}} -->
+              <a-input v-model="model.upkeepcode" placeholder="请输入保养工单编号" :disabled="true" ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="保养工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepcode">
-              <a-input v-model="model.upkeepcode" placeholder="请输入保养工单编号"  ></a-input>
+          <a-col :span="12">
+            <a-form-model-item label="计划名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planname">
+              <!-- {{model.planname}} -->
+              <a-input v-model="model.planname" placeholder="请输入计划名称" :disabled="true" ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="12">
             <a-form-model-item label="保养名称(标题)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepname">
               <a-input v-model="model.upkeepname" placeholder="请输入保养名称(标题)"  ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <a-col :span="12">
             <a-form-model-item label="保养计划ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepplanid">
               <a-input v-model="model.upkeepplanid" placeholder="请输入保养计划ID"  ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <a-col :span="12">
             <a-form-model-item label="保养工作项目ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepprojid">
               <a-input v-model="model.upkeepprojid" placeholder="请输入保养工作项目ID"  ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <a-col :span="12">
             <a-form-model-item label="工作项目名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="projectname">
               <a-input v-model="model.projectname" placeholder="请输入工作项目名称"  ></a-input>
             </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="计划名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="planname">
-              <a-input v-model="model.planname" placeholder="请输入计划名称"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
+          </a-col> -->
+          <a-col :span="12">
             <a-form-model-item label="地点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
-              <a-input v-model="model.address" placeholder="请输入地点"  ></a-input>
+              <!-- {{model.address}} -->
+              <a-input v-model="model.address" placeholder="请输入地点" :disabled="true" ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="12">
             <a-form-model-item label="厂商名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="supplier">
               <a-input v-model="model.supplier" placeholder="请输入厂商名称"  ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <a-col :span="12">
             <a-form-model-item label="厂商电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="suppliertel">
               <a-input v-model="model.suppliertel" placeholder="请输入厂商电话"  ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <a-col :span="12">
             <a-form-model-item label="联系人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="linker">
               <a-input v-model="model.linker" placeholder="请输入联系人"  ></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <a-col :span="12">
             <a-form-model-item label="联系人电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="linkertel">
               <a-input v-model="model.linkertel" placeholder="请输入联系人电话"  ></a-input>
             </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
+          </a-col> -->
+          <a-col :span="12">
             <a-form-model-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
-              <a-input v-model="model.chargeruser" placeholder="请输入负责人"  ></a-input>
+              <!-- {{model.chargeruser_dictText}} -->
+              <j-dict-select-tag v-model="model.chargeruser" placeholder="请选择负责人" dictCode="sys_user,realname,id" :disabled="true"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <!-- <a-input v-model="model.status" placeholder="请输入状态:0待处理、1已通知、2未执行、3未完成、4已完成"  ></a-input> -->
+              <j-dict-select-tag v-model="model.status" placeholder="请选择状态" dictCode="upkeep_state"/>
             </a-form-model-item>
           </a-col>
+          <a-col :span="12">
+            <a-form-model-item label="选择设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <j-search-select-tag v-model="model.equipmentid" dict="tpm_equipment,equipmentname,id"  style="width: 100%" :disabled="true"/>
+                <!-- <a-button type="primary" icon="search" /> -->
+            </a-form-model-item>
+          </a-col>
+          <!-- <a-col :span="24">
+            <a-form-model-item label="描述" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="upkeepdesc">
+              <a-textarea v-model="model.upkeepdesc" placeholder="请输入描述"  :auto-size="{ minRows: 2, maxRows: 2 }"></a-textarea>
+            </a-form-model-item>
+          </a-col> -->
           <a-col :span="24">
-            <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="upkeepdesc">
-              <a-input v-model="model.upkeepdesc" placeholder="请输入描述"  ></a-input>
+            <a-form-model-item label="照片" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="remark">
+              <j-image-upload text="上传" v-model="model.files" isMultiple></j-image-upload>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="状态:0待处理、1已通知、2未执行、3未完成、4已完成" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
-              <a-input v-model="model.status" placeholder="请输入状态:0待处理、1已通知、2未执行、3未完成、4已完成"  ></a-input>
+            <a-form-model-item label="处理意见" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="opinion">
+              <a-textarea v-model="model.opinion" placeholder="请输入处理意见"  :auto-size="{ minRows: 2, maxRows: 2 }"></a-textarea>
+              <!-- <a-input v-model="model.opinion" placeholder="请输入处理意见"  ></a-input> -->
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="处理意见" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="opinion">
-              <a-input v-model="model.opinion" placeholder="请输入处理意见"  ></a-input>
+            <a-form-model-item label="备注" :labelCol="labelCol2" :wrapperCol="wrapperCol2" prop="remark">
+              <a-textarea v-model="model.remark" placeholder="请输入备注"  :auto-size="{ minRows: 2, maxRows: 2 }"></a-textarea>
             </a-form-model-item>
           </a-col>
         </a-row>
+        <div class="cmms-dialog-item-title">设备保养设置</div>
+        <a-table
+          ref="table"
+          size="middle"
+          :scroll="{x:true}"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="model.cmmsUpkeepItemList"
+          :pagination="false"
+          class="j-table-force-nowrap">
+        </a-table>
       </a-form-model>
     </j-form-container>
   </a-spin>
@@ -109,18 +139,68 @@
     data () {
       return {
         model:{
-         },
+          cmmsUpkeepItemList: []
+        },
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 5 },
+          sm: { span: 6 },
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 16 },
+          sm: { span: 12 },
+        },
+        labelCol2: {
+          xs: { span: 24 },
+          sm: { span: 3 },
+        },
+        wrapperCol2: {
+          xs: { span: 24 },
+          sm: { span: 18 },
         },
         confirmLoading: false,
         validatorRules: {
+          status: [
+            { required: true, message: '请选择状态!'},
+          ],
+          upkeepdesc: [
+            { required: true, message: '请输入描述!'},
+          ],
+          opinion: [
+            { required: true, message: '请输入处理意见!'},
+          ],
         },
+        columns: [
+          {
+            title:'保养项ID',
+            align:"center",
+            dataIndex: 'id'
+          },
+          {
+            title:'保养项名称',
+            align:"center",
+            dataIndex: 'itemname'
+          },
+          // {
+          //   title:'设备类型',
+          //   align:"center",
+          //   dataIndex: 'equiptypeName'
+          // },
+          {
+            title:'保养项编号',
+            align:"center",
+            dataIndex: 'itemcode'
+          },
+          {
+            title:'保养项标准',
+            align:"center",
+            dataIndex: 'itemcontent'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+        ],
         url: {
           add: "/cmmsUpkeep/cmmsUpkeep/add",
           edit: "/cmmsUpkeep/cmmsUpkeep/edit",
@@ -142,7 +222,24 @@
         this.edit(this.modelDefault);
       },
       edit (record) {
-        this.model = Object.assign({}, record);
+        // this.model = Object.assign({}, record);
+        getAction(this.url.queryById, record).then((res) => {
+            console.log(88,res)
+            this.model = res.result
+            const b = res.result.files.map((res) => {
+              return res.url
+            })
+            this.model.files = b.join(',')
+            // this.model.cmmsUpkeepItemDtoList = this.model.cmmsUpkeepItemDtoList.map((res) => {
+            //   return {
+            //     id: id,
+            //     itemcode: res.itemcode,
+            //     itemname: res.itemname,
+            //     itemcontent: res.itemcontent,
+            //     remark: res.remark
+            //   }
+            // })
+        })
         this.visible = true;
       },
       submitForm () {
@@ -158,7 +255,17 @@
               method = 'post';
             }else{
               httpurl+=this.url.edit;
-               method = 'put';
+              method = 'put';
+            }
+            if (this.model.files.length != 0) {
+              const a  = this.model.files.split(',')
+              this.model.files = a.map((res) => {
+                return {
+                  url: res
+                }
+              })
+            }else{
+              this.model.files = []
             }
             httpAction(httpurl,this.model,method).then((res)=>{
               if(res.success){
@@ -176,4 +283,8 @@
       },
     }
   }
-</script>
+</script>
+
+<style scoped>
+@import "~@/assets/less/uStyle.less";
+</style>

+ 4 - 4
src/views/module_cmms/upkeep/modules/UpkeepModal.vue

@@ -1,15 +1,15 @@
 <template>
-  <j-modal
+  <u-modal
     :title="title"
     :width="width"
     :visible="visible"
-    switchFullscreen
+    contentFull
     @ok="handleOk"
     :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
     @cancel="handleCancel"
     cancelText="关闭">
     <upkeep-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></upkeep-form>
-  </j-modal>
+  </u-modal>
 </template>
 
 <script>
@@ -23,7 +23,7 @@
     data () {
       return {
         title:'',
-        width:800,
+        width:1000,
         visible: false,
         disableSubmit: false
       }

+ 1 - 1
src/views/module_cmms/upkeepPlan/UpkeepPlanList.vue

@@ -6,7 +6,7 @@
         <a-row :gutter="24">
           <a-col :xl="6" :lg="7" :md="8" :sm="24">
             <a-form-item label="计划编号">
-              <a-input placeholder="请输入计划名称" v-model="queryParam.plancode"></a-input>
+              <a-input placeholder="请输入计划编号" v-model="queryParam.plancode"></a-input>
             </a-form-item>
           </a-col>
           <a-col :xl="6" :lg="7" :md="8" :sm="24">

+ 1 - 1
src/views/module_cmms/upkeepPlan/modules/UpkeepPlanForm.vue

@@ -65,7 +65,7 @@
               </a-col>
               <a-col :span="12">
                 <a-form-model-item label="负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
-                  <j-dict-select-tag v-model="model.chargeruser" placeholder="请输入负责人" dictCode="sys_user,realname,id"/>
+                  <j-dict-select-tag v-model="model.chargeruser" placeholder="请选择负责人" dictCode="sys_user,realname,id"/>
                 </a-form-model-item>
               </a-col>
               <a-col :span="12">