Bläddra i källkod

Merge remote-tracking branch 'origin/master'

wyh 1 år sedan
förälder
incheckning
cb6df2c8b8

+ 112 - 13
src/views/module_cmms/inspectLine/modules/InspectLineForm.vue

@@ -4,28 +4,50 @@
       <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-form-model-item>
-          </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="24">
             <a-form-model-item label="巡检路线编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="linecode">
               <a-input v-model="model.linecode" placeholder="请输入巡检路线编号"  ></a-input>
             </a-form-model-item>
-          </a-col>
+          </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-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-form-model-item>
+          </a-col>
         </a-row>
         <div class="cmms-dialog-item-title u-flex-jab">
-          <div>巡检项目设置</div>
-          <div @click="addInspectContent"><a-icon type="plus"/>巡检项目</div>
+          <div>巡检设置</div>
+          <div @click="addInspectSpot"><a-icon type="plus"/>巡检点</div>
         </div>
+        <a-table
+          ref="table"
+          size="middle"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :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>
+        </a-table>
       </a-form-model>
-      <inspect-line-modal-add ref="addSpotRef" :equipmentId="model.equipmentid" :selectData="model.cmmsInspectSpotItemList" @ok="handleOk"></inspect-line-modal-add>
+      <inspect-line-modal-add ref="addSpotRef" :selectData="model.inspectSpotList" @ok="handleOk"></inspect-line-modal-add>
     </j-form-container>
   </a-spin>
 </template>
@@ -52,7 +74,8 @@
     data () {
       return {
         model:{
-         },
+          inspectSpotList: []
+        },
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -68,7 +91,76 @@
           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;
+          //   }
+          // },
+          {
+            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'
+          }
+        ],
       }
     },
     computed: {
@@ -84,7 +176,7 @@
       add () {
         this.edit(this.modelDefault);
       },
-      addInspectContent(){
+      addInspectSpot(){
         this.$refs.addSpotRef.add();
         this.$refs.addSpotRef.title = "选择巡检点";
       },
@@ -121,6 +213,13 @@
          
         })
       },
+      handleOk(data){
+        console.log(data)
+        data.map(res=>{
+
+        })
+        this.model.inspectSpotList = data;
+      },
     }
   }
 </script>

+ 10 - 25
src/views/module_cmms/inspectLine/modules/InspectLineModalAdd.vue

@@ -64,50 +64,35 @@
           //   }
           // },
           {
-            title:'巡检项ID',
+            title:'巡检点编号',
             align:"center",
-            dataIndex: 'id'
+            dataIndex: 'contentcode'
           },
           {
-            title:'巡检项编号',
+            title:'巡检点名称',
             align:"center",
-            dataIndex: 'itemcode'
-          },
-          {
-            title:'巡检项名称',
-            align:"center",
-            dataIndex: 'itemname'
-          },
-          {
-            title:'标准',
-            align:"center",
-            dataIndex: 'inspectionstandards',
+            dataIndex: 'contentname'
           },
           {
             title:'备注',
             align:"center",
             dataIndex: 'remark'
-          }
+          },
         ],
         dataSource: [],
         url: {
           getList: "/cmmsInspectItem/cmmsInspectItem/getItemByEqId",
-          itemList: "/cmmsInspectItem/cmmsInspectItem/list",
+          spotList: "/cmmsInspectSpot/cmmsInspectSpot/listDetails",
         },
       }
     },
     methods: {
       add () {
         this.visible = true;
-        if(this.type === '1'){
-          getAction(this.url.getList, {eqid: this.equipmentId}).then((res) => {
-            this.dataSource = res.result
-          })
-        } else {
-          getAction(this.url.itemList, {classification: this.type}).then((res) => {
-            this.dataSource = res.result.records
-          })
-        }
+        //  {status: '0'}
+        getAction(this.url.spotList).then((res) => {
+          this.dataSource = res.result.records
+        })
         this.selectList()
       },
       // 将以选中的值重新在列表中选中

+ 303 - 114
src/views/module_cmms/inspectPlan/modules/InspectPlanFormList.vue

@@ -1,86 +1,92 @@
 <template>
   <a-spin :spinning="confirmLoading">
-    <j-form-container :disabled="formDisabled">
+    <!-- <j-form-container :disabled="formDisabled">
       <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
-        <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-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="巡检计划编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="plancode">
-              <a-input v-model="model.plancode" 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-form-model-item label="是否开启时间设置:Y是、N否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iftimeset">
-              <a-input v-model="model.iftimeset" placeholder="请输入是否开启时间设置:Y是、N否"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="begintime">
-              <j-date placeholder="请选择开始时间" v-model="model.begintime"  style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="重复" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeatnum">
-              <a-input-number v-model="model.repeatnum" placeholder="请输入重复" style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="重复类型:年、月、周、日、时、分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeattype">
-              <a-input v-model="model.repeattype" placeholder="请输入重复类型:年、月、周、日、时、分"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="提前通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticenum">
-              <a-input-number v-model="model.noticenum" placeholder="请输入提前通知时间" style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="提前通知类型:天、时、分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetype">
-              <a-input v-model="model.noticetype" placeholder="请输入提前通知类型:天、时、分"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="状态(0启用 1停用)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
-              <a-input v-model="model.status" placeholder="请输入状态(0启用 1停用)"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="待办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
-              <a-input v-model="model.chargeruser" placeholder="请输入待办人"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="下次执行时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nexttime">
-              <j-date placeholder="请选择下次执行时间" v-model="model.nexttime"  style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="任务数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tasknum">
-              <a-input-number v-model="model.tasknum" placeholder="请输入任务数量" style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="下次通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetime">
-              <j-date placeholder="请选择下次通知时间" v-model="model.noticetime"  style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="是否已通知:是/否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ifnotice">
-              <a-input v-model="model.ifnotice" placeholder="请输入是否已通知:是/否"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
       </a-form-model>
-    </j-form-container>
+    </j-form-container> -->
+    <div class="table-operator">
+      <a-button @click="handleAddLine" type="primary" icon="plus">维护巡检路线</a-button>
+      <a-button @click="handleAddSpot" type="primary" icon="plus">维护巡检点</a-button>
+    </div>
+    <div class="inspect-plan-form-list">
+      <a-table
+        ref="table"
+        size="middle"
+        rowKey="id"
+        :columns="columns"
+        :dataSource="tableData"
+        :pagination="false"
+        :rowClassName="setRowClassName"
+        class="plan-table">
+        <!-- :loading="loading" -->
+        <template slot="expandedRowRender" slot-scope="record">
+          <div v-if="record.type === '巡检路线'" class="line-spot-container">
+            <a-table
+              size="middle"
+              rowKey="id"
+              :columns="columns"
+              :dataSource="record.sonList"
+              :pagination="false"
+              :showHeader="false"
+              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.sonList"
+                    :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>
+          </div>
+          <div v-if="record.type === '巡检点'" class="spot-content-container">
+            <a-table
+              size="middle"
+              rowKey="id"
+              :columns="contentColumns"
+              :dataSource="record.sonList"
+              :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>
+
+      <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>
+    </div>
   </a-spin>
 </template>
 
@@ -88,10 +94,14 @@
 
   import { httpAction, getAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
+  import InspectPlanModalAddLine from './InspectPlanModalAddLine.vue'
+  import InspectPlanModalAddSpot from './InspectPlanModalAddSpot.vue'
 
   export default {
     name: 'InspectPlanForm',
     components: {
+      InspectPlanModalAddLine,
+      InspectPlanModalAddSpot
     },
     props: {
       //表单禁用
@@ -103,8 +113,11 @@
     },
     data () {
       return {
-        model:{
-         },
+        inspectLineList: [],
+        inspectSpotList: [],
+        addType: '巡检点',
+        // model:{
+        // },
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },
@@ -119,8 +132,130 @@
         url: {
           add: "/cmmsInspectPlan/cmmsInspectPlan/add",
           edit: "/cmmsInspectPlan/cmmsInspectPlan/edit",
-          queryById: "/cmmsInspectPlan/cmmsInspectPlan/queryById"
-        }
+          queryById: "/cmmsInspectPlan/cmmsInspectPlan/queryById",
+          queryTreeById: "/cmmsInspectPlan/cmmsInspectPlan/queryTreeById"
+        },
+        tableData: [],
+        columns: [
+          // {
+          //   title: '序号',
+          //   dataIndex: '',
+          //   key:'rowIndex',
+          //   width:60,
+          //   align:"center",
+          //   customRender:function (t,r,index) {
+          //     return parseInt(index)+1;
+          //   }
+          // },
+          {
+            title:'巡检类型',
+            align:"center",
+            dataIndex: 'type'
+          },
+          {
+            title:'名称',
+            align:"center",
+            dataIndex: 'title',
+            // dataIndex: 'inspectLineVo',
+            // customRender:function (scope) {
+            //   return scope.linename
+            // }
+          },
+          {
+            title:'编号',
+            align:"center",
+            dataIndex: ''
+          },
+          // {
+          //   title:'是否必须执行',
+          //   align:"center",
+          //   dataIndex: 'equipmentname'
+          // },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          }
+        ],
+        contentColumns: [
+          {
+            title:'巡检内容编号',
+            align:"center",
+            dataIndex: 'contentcode',
+            // customRender: (text, row, index) => {
+            //   return {
+            //     children: text,
+            //     attrs: {colSpan: 4}
+            //   }
+            // }
+          },
+          {
+            title:'巡检内容名称',
+            align:"center",
+            dataIndex: 'contentname',
+            // customRender: (text, row, index) => {
+            //   return {
+            //     children: text,
+            //     attrs: {colSpan: 0}
+            //   }
+            // }
+          },
+          {
+            title:'设备名称',
+            align:"center",
+            dataIndex: 'equipmentname',
+            // customRender: (text, row, index) => {
+            //   return {
+            //     children: text,
+            //     attrs: {colSpan: 0}
+            //   }
+            // }
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark',
+            // customRender: (text, row, index) => {
+            //   return {
+            //     children: text,
+            //     attrs: {colSpan: 0}
+            //   }
+            // }
+          },
+        ],
+        itemColumns: [
+          {
+            title:'巡检项编号',
+            align:"left",
+            dataIndex: 'itemcode'
+          },
+          {
+            title:'名称',
+            align:"left",
+            dataIndex: 'itemname'
+          },
+          // {
+          //   title:'设备类型',
+          //   align:"center",
+          //   dataIndex: 'equipdefname'
+          // },
+          {
+            title:'巡检标准',
+            align:"left",
+            dataIndex: 'inspectionstandards'
+          },
+          {
+            title:'巡检项类型',
+            align:"left",
+            dataIndex: 'classification_dictText'
+          },
+          {
+            title:'备注',
+            align:"left",
+            width: 80,
+            dataIndex: 'remark',
+          },
+        ]
       }
     },
     computed: {
@@ -133,42 +268,96 @@
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
     },
     methods: {
+      setRowClassName(record){
+        if(record.type === '巡检路线'){
+          return 'line-bg'
+        }
+        if(record.type === '巡检点'){
+          return 'spot-bg'
+        }
+      },
       add () {
-        this.edit(this.modelDefault);
+        // this.edit(this.modelDefault);
       },
       edit (record) {
-        this.model = Object.assign({}, record);
         this.visible = true;
-      },
-      submitForm () {
-        const that = this;
-        // 触发表单验证
-        this.$refs.form.validate(valid => {
-          if (valid) {
-            that.confirmLoading = true;
-            let httpurl = '';
-            let method = '';
-            if(!this.model.id){
-              httpurl+=this.url.add;
-              method = 'post';
-            }else{
-              httpurl+=this.url.edit;
-               method = 'put';
-            }
-            httpAction(httpurl,this.model,method).then((res)=>{
-              if(res.success){
-                that.$message.success(res.message);
-                that.$emit('ok');
-              }else{
-                that.$message.warning(res.message);
-              }
-            }).finally(() => {
-              that.confirmLoading = false;
-            })
-          }
-         
+        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
         })
       },
+      // 维护巡检路线
+      handleAddLine(){
+      },
+      // 维护巡检点
+      handleAddSpot(){
+        this.addType = '巡检点'
+        this.$refs.addSpotRef.add();
+        this.$refs.addSpotRef.title = "选择巡检点";
+      },
+      handleOk(data){
+        console.log(data)
+        if(this.addType === '巡检点'){
+          this.inspectSpotList = data
+        }
+      }
+    }
+  }
+</script>
+<style lang="less" scoped>
+  .inspect-plan-form-list{
+    .plan-table{
+      /deep/ .line-bg{
+        background-color: #f5f2eb; // 黄色
+      }
+      /deep/ .spot-bg{
+        background-color: #ecf3ef; // 绿色
+        // background-color: #e6f7ff; // 蓝色
+      }
+    }
+    // 巡检路线下的巡检点
+    /deep/ .line-spot-container{
+      // background-color: #fff;
+      border: 1px solid #e6ebf5;
+      // padding: 20px;
+      .line-spot-table{
+        background-color: #ecf3ef;
+        // tr > td{
+        //   border: none;
+        // }
+      }
+    }
+    .line-spot-container:hover{
+      box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
+    }
+    // 巡检点下的巡检内容
+    /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);
     }
   }
-</script>
+</style>

+ 37 - 54
src/views/module_cmms/inspectPlan/modules/InspectPlanFormSet.vue

@@ -3,79 +3,60 @@
     <j-form-container :disabled="formDisabled">
       <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
         <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-form-model-item>
-          </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="24">
             <a-form-model-item label="巡检计划编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="plancode">
               <a-input v-model="model.plancode" 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="planname">
-              <a-input v-model="model.planname" placeholder="请输入巡检计划名称"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="是否开启时间设置:Y是、N否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iftimeset">
-              <a-input v-model="model.iftimeset" placeholder="请输入是否开启时间设置:Y是、N否"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="begintime">
-              <j-date placeholder="请选择开始时间" v-model="model.begintime"  style="width: 100%" />
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="重复" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeatnum">
-              <a-input-number v-model="model.repeatnum" placeholder="请输入重复" style="width: 100%" />
+              <a-input v-model="model.planname" placeholder="请输入巡检计划名称"></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="重复类型:年、月、周、日、时、分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeattype">
-              <a-input v-model="model.repeattype" placeholder="请输入重复类型:年、月、周、日、时、分"  ></a-input>
+          <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-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="提前通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticenum">
-              <a-input-number v-model="model.noticenum" placeholder="请输入提前通知时间" style="width: 100%" />
+          <a-col :span="12">
+            <a-form-model-item label="是否开启时间设置" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="iftimeset">
+              <j-dict-select-tag v-model="model.iftimeset"  placeholder="" type="radio" dictCode="common_yes_no"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="提前通知类型:天、时、分" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetype">
-              <a-input v-model="model.noticetype" placeholder="请输入提前通知类型:天、时、分"  ></a-input>
+          <a-col :span="12">
+            <a-form-model-item label="状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <j-dict-select-tag v-model="model.status"  type="radio" dictCode="common_status"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="状态(0启用 1停用)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
-              <a-input v-model="model.status" placeholder="请输入状态(0启用 1停用)"  ></a-input>
+          <a-col :span="12">
+            <a-form-model-item label="开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="begintime">
+              <j-date placeholder="请选择开始时间" v-model="model.begintime"  style="width: 100%" />
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="待办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="chargeruser">
-              <a-input v-model="model.chargeruser" placeholder="请输入待办人"  ></a-input>
+          <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%;"/>
+              <j-dict-select-tag  v-model="model.repeattype"  placeholder="请选择重复单位" dictCode="plan_cycle_unit" style="width: 30%;"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="下次执行时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="nexttime">
-              <j-date placeholder="请选择下次执行时间" v-model="model.nexttime"  style="width: 100%" />
+          <!-- <a-col :span="24">
+            <a-form-model-item label="重复类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeattype">
+              
             </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="任务数量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="tasknum">
-              <a-input-number v-model="model.tasknum" placeholder="请输入任务数量" style="width: 100%" />
+          </a-col> -->
+          <a-col :span="12">
+            <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%;"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="下次通知时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetime">
-              <j-date placeholder="请选择下次通知时间" v-model="model.noticetime"  style="width: 100%" />
+          <!-- <a-col :span="24">
+            <a-form-model-item label="提前通知类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetype">
             </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="是否已通知:是/否" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="ifnotice">
-              <a-input v-model="model.ifnotice" placeholder="请输入是否已通知:是/否"  ></a-input>
+          </a-col> -->
+          <a-col :span="12">
+            <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="remark">
+              <a-input v-model="model.remark" placeholder="请输入备注"  ></a-input>
             </a-form-model-item>
           </a-col>
         </a-row>
@@ -104,7 +85,9 @@
     data () {
       return {
         model:{
-         },
+          noticetype: '天',
+          repeattype: '日',
+        },
         labelCol: {
           xs: { span: 24 },
           sm: { span: 5 },

+ 9 - 6
src/views/module_cmms/inspectPlan/modules/InspectPlanModal.vue

@@ -10,18 +10,19 @@
         <span v-for="(item, index) in tabs" :key="index" @click="handleTab(item.key)" class="item" :class="item.key === chooseTab ? 'choose':''">{{ item.name }}</span>
       </div>
     </template>
-    <inspect-plan-form-set v-if="chooseTab==='set'" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></inspect-plan-form-set>
-    <div v-if="chooseTab==='list'" ></div>
+    <inspect-plan-form-set v-show="chooseTab==='set'" ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></inspect-plan-form-set>
+    <inspect-plan-form-list v-show="chooseTab==='list'" ref="realList" @ok="submitCallback"></inspect-plan-form-list>
   </u-modal>
 </template>
 
 <script>
-
+  import InspectPlanFormList from './InspectPlanFormList.vue'
   import InspectPlanFormSet from './InspectPlanFormSet'
   export default {
     name: 'InspectPlanModal',
     components: {
-      InspectPlanFormSet
+      InspectPlanFormSet,
+      InspectPlanFormList
     },
     data () {
       return {
@@ -45,12 +46,14 @@
         this.visible=true
         this.$nextTick(()=>{
           this.$refs.realForm.add();
+          this.$refs.realList.add();
         })
       },
       edit (record) {
         this.visible=true
         this.$nextTick(()=>{
           this.$refs.realForm.edit(record);
+          this.$refs.realList.edit(record);
         })
       },
       close () {
@@ -66,7 +69,7 @@
       },
       handleCancel () {
         this.close()
-      }
+      },
     }
   }
 </script>
@@ -77,7 +80,7 @@
       cursor: pointer;
     }
     .item:first-child{
-      margin-right: 16px;
+      margin-right: 22px;
     }
     .choose{
       color: #1890FF;

+ 135 - 0
src/views/module_cmms/inspectPlan/modules/InspectPlanModalAddLine.vue

@@ -0,0 +1,135 @@
+<template>
+  <j-modal
+  :title="title"
+  :width="width"
+  :visible="visible"
+  @ok="handleOk"
+  @cancel="handleCancel"
+  cancelText="关闭">
+    <a-table
+      ref="table"
+      size="middle"
+      :scroll="{x:true}"
+      bordered
+      rowKey="id"
+      :columns="columns"
+      :dataSource="dataSource"
+      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+      :pagination="false"
+      class="j-table-force-nowrap">
+    </a-table>
+  </j-modal>
+</template>
+
+<script>
+  import { httpAction, getAction } from '@/api/manage'
+  
+  export default {
+    name: 'InspectLineModalAdd',
+    components: {
+        
+    },
+    props: {
+      //表单禁用
+      equipmentId: {
+        type: String,
+        default: ''
+      },
+      selectData: {
+        type: Array,
+        default: function(){
+          return [] // 使用工厂函数返回默认值
+        }
+      },
+    },
+    data () {
+      return {
+        title:'',
+        width: 1000,
+        visible: false,
+        type: '',
+        /* table选中keys*/
+        selectedRowKeys: [],
+        /* table选中records*/
+        selectionRows: [],
+        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'
+          },
+        ],
+        dataSource: [],
+        url: {
+          getList: "/cmmsInspectItem/cmmsInspectItem/getItemByEqId",
+          spotList: "/cmmsInspectSpot/cmmsInspectSpot/listDetails",
+        },
+      }
+    },
+    methods: {
+      add () {
+        this.visible = true;
+        //  {status: '0'}
+        getAction(this.url.spotList).then((res) => {
+          this.dataSource = res.result.records
+        })
+        this.selectList()
+      },
+      // 将以选中的值重新在列表中选中
+      selectList() {
+        this.selectionRows = this.selectData
+        console.log(this.selectData)
+        this.selectedRowKeys = this.selectData.map((res) => {
+          return res.id
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+        this.onClearSelected()
+        this.selectionRows = this.selectData
+        this.selectedRowKeys = this.selectData.map((res) => {
+          return res.id
+        })
+        this.dataSource = []
+      },
+      handleOk () {
+        console.log(this.selectionRows)
+        this.$emit('ok', this.selectionRows);
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      },
+      onSelectChange(selectedRowKeys, selectionRows) {
+        this.selectedRowKeys = selectedRowKeys;
+        this.selectionRows = selectionRows;
+        console.log(this.selectedRowKeys,this.selectionRows)
+      },
+      onClearSelected() {
+        this.selectedRowKeys = [];
+        this.selectionRows = [];
+      },
+    }
+  }
+</script>

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

@@ -0,0 +1,135 @@
+<template>
+  <j-modal
+  :title="title"
+  :width="width"
+  :visible="visible"
+  @ok="handleOk"
+  @cancel="handleCancel"
+  cancelText="关闭">
+    <a-table
+      ref="table"
+      size="middle"
+      :scroll="{x:true}"
+      bordered
+      rowKey="id"
+      :columns="columns"
+      :dataSource="dataSource"
+      :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+      :pagination="false"
+      class="j-table-force-nowrap">
+    </a-table>
+  </j-modal>
+</template>
+
+<script>
+  import { httpAction, getAction } from '@/api/manage'
+  
+  export default {
+    name: 'InspectLineModalAdd',
+    components: {
+        
+    },
+    props: {
+      //表单禁用
+      equipmentId: {
+        type: String,
+        default: ''
+      },
+      selectData: {
+        type: Array,
+        default: function(){
+          return [] // 使用工厂函数返回默认值
+        }
+      },
+    },
+    data () {
+      return {
+        title:'',
+        width: 1000,
+        visible: false,
+        type: '',
+        /* table选中keys*/
+        selectedRowKeys: [],
+        /* table选中records*/
+        selectionRows: [],
+        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'
+          },
+        ],
+        dataSource: [],
+        url: {
+          getList: "/cmmsInspectItem/cmmsInspectItem/getItemByEqId",
+          spotList: "/cmmsInspectSpot/cmmsInspectSpot/listDetails",
+        },
+      }
+    },
+    methods: {
+      add () {
+        this.visible = true;
+        //  {status: '0'}
+        getAction(this.url.spotList).then((res) => {
+          this.dataSource = res.result.records
+        })
+        this.selectList()
+      },
+      // 将以选中的值重新在列表中选中
+      selectList() {
+        this.selectionRows = this.selectData
+        console.log(this.selectData)
+        this.selectedRowKeys = this.selectData.map((res) => {
+          return res.id
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+        this.onClearSelected()
+        this.selectionRows = this.selectData
+        this.selectedRowKeys = this.selectData.map((res) => {
+          return res.id
+        })
+        this.dataSource = []
+      },
+      handleOk () {
+        console.log(this.selectionRows)
+        this.$emit('ok', this.selectionRows);
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      },
+      onSelectChange(selectedRowKeys, selectionRows) {
+        this.selectedRowKeys = selectedRowKeys;
+        this.selectionRows = selectionRows;
+        console.log(this.selectedRowKeys,this.selectionRows)
+      },
+      onClearSelected() {
+        this.selectedRowKeys = [];
+        this.selectionRows = [];
+      },
+    }
+  }
+</script>