Quellcode durchsuchen

Merge branch 'master' of http://152.136.206.27:3000/dongjh/ems_client

dongjh vor 1 Jahr
Ursprung
Commit
ba92c87c07
36 geänderte Dateien mit 3881 neuen und 344 gelöschten Zeilen
  1. 8 1
      src/components/module_ems/UModal/UModal.vue
  2. 228 0
      src/views/module_base/client/ClientList.vue
  3. 124 0
      src/views/module_base/client/modules/ClientForm.vue
  4. 84 0
      src/views/module_base/client/modules/ClientModal.Style#Drawer.vue
  5. 60 0
      src/views/module_base/client/modules/ClientModal.vue
  6. 213 0
      src/views/module_cmms/inspect/InspectList.vue
  7. 386 0
      src/views/module_cmms/inspect/modules/InspectForm.vue
  8. 84 0
      src/views/module_cmms/inspect/modules/InspectModal.Style#Drawer.vue
  9. 57 0
      src/views/module_cmms/inspect/modules/InspectModal.vue
  10. 16 1
      src/views/module_cmms/inspectLine/modules/InspectLineForm.vue
  11. 4 8
      src/views/module_cmms/inspectLine/modules/InspectLineModal.vue
  12. 150 0
      src/views/module_cmms/inspectLine/modules/InspectLineModalAdd.vue
  13. 6 6
      src/views/module_cmms/inspectPlan/InspectPlanList.vue
  14. 0 0
      src/views/module_cmms/inspectPlan/modules/InspectPlanFormList.vue
  15. 174 0
      src/views/module_cmms/inspectPlan/modules/InspectPlanFormSet.vue
  16. 3 3
      src/views/module_cmms/inspectPlan/modules/InspectPlanModal.Style#Drawer.vue
  17. 39 13
      src/views/module_cmms/inspectPlan/modules/InspectPlanModal.vue
  18. 54 60
      src/views/module_cmms/repairMy/RepairMyList.vue
  19. 38 66
      src/views/module_cmms/repairMy/modules/RepairMyForm.vue
  20. 14 8
      src/views/module_cmms/repairMy/modules/RepairMyModal.vue
  21. 229 0
      src/views/module_cmms/submission/SubmissionList.vue
  22. 124 0
      src/views/module_cmms/submission/modules/SubmissionForm.vue
  23. 84 0
      src/views/module_cmms/submission/modules/SubmissionModal.Style#Drawer.vue
  24. 60 0
      src/views/module_cmms/submission/modules/SubmissionModal.vue
  25. 220 0
      src/views/module_cmms/submissionEquipment/SubmissionEquipmentList.vue
  26. 144 0
      src/views/module_cmms/submissionEquipment/modules/SubmissionEquipmentForm.vue
  27. 84 0
      src/views/module_cmms/submissionEquipment/modules/SubmissionEquipmentModal.Style#Drawer.vue
  28. 60 0
      src/views/module_cmms/submissionEquipment/modules/SubmissionEquipmentModal.vue
  29. 261 0
      src/views/module_cmms/upkeep/UpkeepList.vue
  30. 179 0
      src/views/module_cmms/upkeep/modules/UpkeepForm.vue
  31. 84 0
      src/views/module_cmms/upkeep/modules/UpkeepModal.Style#Drawer.vue
  32. 60 0
      src/views/module_cmms/upkeep/modules/UpkeepModal.vue
  33. 137 55
      src/views/module_cmms/upkeepPlan/UpkeepPlanList.vue
  34. 260 119
      src/views/module_cmms/upkeepPlan/modules/UpkeepPlanForm.vue
  35. 4 4
      src/views/module_cmms/upkeepPlan/modules/UpkeepPlanModal.vue
  36. 149 0
      src/views/module_cmms/upkeepPlan/modules/UpkeepPlanModalAdd.vue

+ 8 - 1
src/components/module_ems/UModal/UModal.vue

@@ -18,6 +18,9 @@
         <a-col class="left-title">
           <slot name="title">{{ title }}</slot>
         </a-col>
+        <a-col class="center-content">
+          <slot name="centerContent"></slot>
+        </a-col>
         <!-- <a-col v-if="switchFullscreen" class="right" @click="toggleFullscreen">
           <a-button class="ant-modal-close ant-modal-close-x" ghost type="link" :icon="fullscreenButtonIcon"/>
         </a-col> -->
@@ -112,6 +115,7 @@ export default {
         // 内容展现形式:居中活全屏
         isContentFull: null,
         isModalFull: false,
+        isHasTab: false,
       }
     },
     computed: {
@@ -192,7 +196,7 @@ export default {
           this.isModalFull = newV
         },
         immediate: true
-      }
+      },
     },
     methods: {
 
@@ -292,6 +296,9 @@ export default {
           //   }
           // }
         }
+        .center-content{
+          line-height: 60px;
+        }
       }
       // 内容区域
       .ant-modal-body{

+ 228 - 0
src/views/module_base/client/ClientList.vue

@@ -0,0 +1,228 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <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.clientName"></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.clientAddress"></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="联系人姓名">
+                <a-input placeholder="请输入联系人姓名" v-model="queryParam.clientPerson"></a-input>
+              </a-form-item>
+            </a-col>
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="单位类型">
+                <j-dict-select-tag placeholder="请选择单位类型" v-model="queryParam.clientType" dictCode="client_type"/>
+              </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>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('外协单位表')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <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>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <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>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <client-modal ref="modalForm" @ok="modalFormOk"></client-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import ClientModal from './modules/ClientModal'
+  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+
+  export default {
+    name: 'ClientList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      ClientModal
+    },
+    data () {
+      return {
+        description: '外协单位表管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'单位名称',
+            align:"center",
+            dataIndex: 'clientName'
+          },
+          {
+            title:'单位地址',
+            align:"center",
+            dataIndex: 'clientAddress'
+          },
+          {
+            title:'联系人姓名',
+            align:"center",
+            dataIndex: 'clientPerson'
+          },
+          {
+            title:'联系电话',
+            align:"center",
+            dataIndex: 'clientPhone'
+          },
+          {
+            title:'单位类型',
+            align:"center",
+            dataIndex: 'clientType_dictText'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/client/client/list",
+          delete: "/client/client/delete",
+          deleteBatch: "/client/client/deleteBatch",
+          exportXlsUrl: "/client/client/exportXls",
+          importExcelUrl: "client/client/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'clientName',text:'单位名称',dictCode:''})
+        fieldList.push({type:'string',value:'clientAddress',text:'单位地址',dictCode:''})
+        fieldList.push({type:'string',value:'clientPerson',text:'联系人姓名',dictCode:''})
+        fieldList.push({type:'string',value:'clientPhone',text:'联系电话',dictCode:''})
+        fieldList.push({type:'string',value:'clientType',text:'单位类型',dictCode:'client_type'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 124 - 0
src/views/module_base/client/modules/ClientForm.vue

@@ -0,0 +1,124 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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="clientName">
+              <a-input v-model="model.clientName" placeholder="请输入单位名称"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="单位地址" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clientAddress">
+              <a-input v-model="model.clientAddress" placeholder="请输入单位地址"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="联系人姓名" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clientPerson">
+              <a-input v-model="model.clientPerson" placeholder="请输入联系人姓名"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="联系电话" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clientPhone">
+              <a-input v-model="model.clientPhone" placeholder="请输入联系电话"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="单位类型" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="clientType">
+              <j-dict-select-tag type="list" v-model="model.clientType" dictCode="client_type" placeholder="请选择单位类型" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'ClientForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/client/client/add",
+          edit: "/client/client/edit",
+          queryById: "/client/client/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        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;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_base/client/modules/ClientModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <client-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></client-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import ClientForm from './ClientForm'
+
+  export default {
+    name: 'ClientModal',
+    components: {
+      ClientForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_base/client/modules/ClientModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <client-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></client-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import ClientForm from './ClientForm'
+  export default {
+    name: 'ClientModal',
+    components: {
+      ClientForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

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

@@ -0,0 +1,213 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> -->
+      <a-button type="primary" icon="download" @click="handleExportXls('巡检工单')">导出</a-button>
+      <!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload> -->
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <!-- <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> -->
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <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>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+        <!-- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" -->
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">巡检</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <!-- <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item> -->
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <inspect-modal ref="modalForm" @ok="modalFormOk"></inspect-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import InspectModal from './modules/InspectModal'
+
+  export default {
+    name: 'InspectList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      InspectModal
+    },
+    data () {
+      return {
+        description: '巡检工单管理页面',
+        // 表头
+        columns: [
+          {
+            title: '序号',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'工单编号',
+            align:"center",
+            dataIndex: 'inspectcode'
+          },
+          {
+            title:'工单名称',
+            align:"center",
+            dataIndex: 'inspectname'
+          },
+          {
+            title:'任务类型:单次任务、周期任务',
+            align:"center",
+            dataIndex: 'tasktype'
+          },
+          {
+            title:'状态',
+            align:"center",
+            dataIndex: 'status_dict'
+          },
+          {
+            title:'巡检细项',
+            align:"center",
+            dataIndex: 'inspectdetail'
+          },
+          {
+            title:'巡检计划ID',
+            align:"center",
+            dataIndex: 'inspectplanid'
+          },
+          {
+            title:'待办人',
+            align:"center",
+            dataIndex: 'chargeruser'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/cmmsInspect/cmmsInspect/list",
+          delete: "/cmmsInspect/cmmsInspect/delete",
+          deleteBatch: "/cmmsInspect/cmmsInspect/deleteBatch",
+          exportXlsUrl: "/cmmsInspect/cmmsInspect/exportXls",
+          importExcelUrl: "cmmsInspect/cmmsInspect/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
+        fieldList.push({type:'string',value:'inspectcode',text:'工单编号',dictCode:''})
+        fieldList.push({type:'string',value:'inspectname',text:'工单名称',dictCode:''})
+        fieldList.push({type:'string',value:'tasktype',text:'任务类型:单次任务、周期任务',dictCode:''})
+        fieldList.push({type:'string',value:'status',text:'状态:0待处理、1处理中、2已完成',dictCode:''})
+        fieldList.push({type:'string',value:'inspectdetail',text:'巡检细项',dictCode:''})
+        fieldList.push({type:'string',value:'inspectplanid',text:'巡检计划ID',dictCode:''})
+        fieldList.push({type:'string',value:'chargeruser',text:'待办人',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 386 - 0
src/views/module_cmms/inspect/modules/InspectForm.vue

@@ -0,0 +1,386 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <j-form-container :disabled="formDisabled">
+      <a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
+        <a-row class="inspect-order-layout">
+          <a-col :span="8" class="inspect-tree">
+            <a-tree
+              :tree-data="treeData"
+              show-icon
+              default-expand-all
+              showLine
+              :selected-keys="selectedKeys"
+              :replaceFields="replaceFields"
+              @select="onSelect"
+            >
+              <a-icon slot="switcherIcon" type="down" />
+              <a-icon slot="smile" type="smile-o" />
+              <a-icon slot="meh" type="smile-o" />
+              <template slot="custom" slot-scope="{ selected }">
+                <a-icon :type="selected ? 'frown' : 'frown-o'" />
+              </template>
+            </a-tree>
+          </a-col>
+          <a-col :span="16" class="itemList-table">
+            <a-button @click="handleFeedback">提交反馈</a-button>
+            <a-table
+              ref="table"
+              size="middle"
+              :scroll="{x:true}"
+              bordered
+              rowKey="id"
+              :columns="columns"
+              :dataSource="model.itemList"
+              :pagination="false"
+              class="j-table-force-nowrap">
+              <template slot="iresult" slot-scope="text, record,index">
+                <a-form-model-item :prop="'itemList.'+index+'.iresult'" :rules="validatorRules.iresult" style="margin-bottom: 0px;">
+                  <a-radio-group name="radioGroup" v-model="record.iresult">
+                    <a-radio value="0">
+                      正常
+                    </a-radio>
+                    <a-radio value="1">
+                      异常
+                    </a-radio>
+                  </a-radio-group>
+                </a-form-model-item>
+              </template>
+              <template slot="iremark" slot-scope="text, record,index">
+                <a-form-model-item :prop="'itemList.'+index+'.iremark'" :rules="validatorRules.iremark" style="margin-bottom: 0px;">
+                  <a-input v-model="record.iremark" placeholder="请输入点检备注"></a-input>
+                </a-form-model-item>
+              </template>
+            </a-table>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+const treeData = [
+  {
+    title: '测试123456',
+    key: '1111111111111',
+    type: '巡检路线',
+    children: [
+      {
+        title: '测试巡检点的修改NO1',
+        key: '12223333333',
+        type: '巡检点',
+        children: [
+          {
+            title: '半自动立钻Z5180C',
+            key: '55555555555',
+            type: '巡检内容',
+            ItemList: [
+              // 巡检项相关信息
+            ]
+          },
+        ],
+      },
+    ],
+  },
+  {
+    title: '测试巡检点的修改NO2',
+    key: '456293324552',
+    type: '巡检点',
+    children: [
+      {
+        title: '半自动立钻Z5180D',
+        key: '1335633666666',
+        type: '巡检内容',
+        ItemList: [
+          // 巡检项相关信息
+        ]
+      },
+    ],
+  },
+];
+
+  import { httpAction, getAction, putAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'InspectForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model: {
+          itemList: []
+        },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+          result: [
+            { required: true, message: '请输入点检结果!'},
+          ],
+        },
+        url: {
+          add: "/cmmsInspect/cmmsInspect/add",
+          edit: "/cmmsInspect/cmmsInspect/edit",
+          queryById: "/cmmsInspect/cmmsInspect/queryById",
+          queryTreeById: "/cmmsInspect/cmmsInspect/queryTreeById",
+          queryItemByCountId: "/cmmsInspect/cmmsInspect/queryItemByCountId",
+          feedback: "/cmmsInspect/cmmsInspect/feedback",
+        },
+        treeData: [],
+        selectedKeys: [], // (受控)设置选中的树节点
+        replaceFields: {
+          children:'children',
+          title:'title',
+          key:'id'
+        },
+        columns: [
+          // {
+          //   title: '#',
+          //   dataIndex: '',
+          //   key:'rowIndex',
+          //   width:60,
+          //   align:"center",
+          //   customRender:function (t,r,index) {
+          //     return parseInt(index)+1;
+          //   }
+          // },
+          {
+            title:'巡检项编号',
+            align:"center",
+            dataIndex: 'itemcode'
+          },
+          {
+            title:'巡检项名称',
+            align:"center",
+            dataIndex: 'itemname'
+          },
+          {
+            title:'标准',
+            align:"center",
+            dataIndex: 'inspectionstandards',
+          },
+          {
+            title:'巡检结果',
+            align:"center",
+            dataIndex: 'iresult',
+            scopedSlots: { customRender: 'iresult' }
+          },
+          {
+            title:'巡检备注',
+            align:"center",
+            dataIndex: 'iremark',
+            scopedSlots: { customRender: 'iremark' }
+          }
+        ],
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        this.edit(this.modelDefault);
+      },
+      edit (record) {
+        // this.model = Object.assign({}, record);
+        this.visible = true;
+        this.confirmLoading = true
+        // getAction(this.url.queryById, {id: record.id}).then((res) => {
+        //   console.log(res)
+        //   this.model = res.result
+        //   // console.log(res.result.planList)
+        //   var planList = res.result.planList
+        //   var orderData = []
+        //   if(planList.length>0){
+        //     for (let p = 0; p < planList.length; p++) {
+        //       // 巡检路线
+        //       const planItem = planList[p];
+        //       planItem.children = []
+        //       if(planItem.inspectLineVo){
+        //         for (let s = 0; s < planItem.inspectLineVo.detailList.length; s++) {
+        //           // 巡检点
+        //           const spotItem = planItem.inspectLineVo.detailList[s];
+        //           spotItem.children = []
+        //           if(spotItem.inspectContentList){
+        //             for (let i = 0; i < spotItem.inspectContentList.length; i++) {
+        //               const contentItem = spotItem.inspectContentList[i];
+        //               console.log(spotItem, contentItem)
+        //               // 巡检内容数据
+        //               if(contentItem){
+        //                 var contentNode = {
+        //                   key: contentItem.id,
+        //                   title: contentItem.equipmentname,
+        //                   slots: {
+        //                     icon: 'smile',
+        //                   },
+        //                   inspectTcontentItemList: contentItem.inspectTcontentItemList
+        //                 }
+        //                 spotItem.children.push(contentNode)
+        //               }
+        //             }
+        //           }
+        //           // 巡检点数据
+        //           var spotNode = {
+        //             key: spotItem.id,
+        //             title: spotItem.contentname,
+        //             slots: {
+        //               icon: 'smile',
+        //             },
+        //             children: spotItem.children,
+        //           }
+        //           planItem.children.push(spotNode)
+        //         }
+        //         // 路线数据
+        //         var planNode = {
+        //           key: planItem.inspectLineVo.id,
+        //           title: planItem.inspectLineVo.linename,
+        //           slots: {
+        //             icon: planItem.tasktype? 'smile': 'smile',
+        //           },
+        //           children: planItem.children,
+        //         }
+        //         orderData.push(planNode)
+        //       }
+        //     }
+        //   }
+        //   console.log(orderData)
+        //   this.treeData = orderData
+        //   // if(planList.length>0){
+        //   //   planList.map(item => {
+        //   //     var spotList = item.detailList
+        //   //     if(spotList.length > 0){
+        //   //       spotList.map(spot => {
+        //   //         var 
+        //   //         return {
+        //   //           key: item.id,
+        //   //           title: item.linename,
+        //   //           slots: {
+        //   //             icon: 'smile',
+        //   //           },
+        //   //           children: item.inspectLineVo,
+        //   //         }
+        //   //       })
+        //   //     }
+        //   //     return {
+        //   //       key: item.id,
+        //   //       title: item.linename,
+        //   //       slots: {
+        //   //         icon: 'smile',
+        //   //       },
+        //   //       children: item.inspectLineVo,
+        //   //     }
+        //   //   })
+        //   // }
+        //   this.confirmLoading = false
+        // })
+        getAction(this.url.queryTreeById, {id: record.id}).then((res) => {
+          console.log(res)
+          this.model = res.result
+          // this.model.itemList = []
+          this.treeData = res.result.children
+          this.confirmLoading = false
+        })
+      },
+      onSelect(selectedKeys, info) {
+        //  二次点击树节点时selectedKeys为空,直接return中断执行
+        if (selectedKeys.length === 0) return
+        this.selectedKeys = selectedKeys
+        // console.log('selected', selectedKeys, info);
+        // console.log(info.selectedNodes[0].data.props.inspectTcontentItemList)
+        var props = info.selectedNodes[0].data.props
+        if(props.type === '巡检内容'){
+          this.model.itemList = props.inspectTcontentItemList
+          this.$forceUpdate()
+          // this.getItemList(props.id)
+        }
+      },
+      getItemList(id){
+        getAction(this.url.queryItemByCountId, {countId: id, inspectId: this.model.id}).then((res) => {
+          console.log(res)
+          this.model.itemList = res.result
+          console.log(this.model)
+          this.$forceUpdate()
+        })
+      },
+      handleFeedback(){
+        console.log(this.model.itemList)
+        this.confirmLoading = true
+        putAction(this.url.feedback, this.model.itemList).then((res) => {
+          if(res.success){
+            this.$message.success(res.message);
+            this.edit(this.model)
+          }else{
+            this.$message.warning(res.message);
+          }
+        }).finally(() => {
+          this.confirmLoading = false;
+        })
+      },
+      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;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>
+<style lang="less" scoped>
+  .inspect-order-layout{
+    height: calc(100vh - 150px);
+    overflow: hidden;
+    .inspect-tree{
+      height: calc(100vh - 150px);
+      overflow: auto;
+    }
+    .itemList-table{
+      height: calc(100vh - 150px);
+      overflow: auto;
+    }
+  }
+</style>

+ 84 - 0
src/views/module_cmms/inspect/modules/InspectModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <inspect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></inspect-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import InspectForm from './InspectForm'
+
+  export default {
+    name: 'InspectModal',
+    components: {
+      InspectForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 57 - 0
src/views/module_cmms/inspect/modules/InspectModal.vue

@@ -0,0 +1,57 @@
+<template>
+  <u-modal
+    :title="title"
+    :visible.sync="visible"
+    contentFull
+    @ok="handleOk"
+    @cancel="handleCancel">
+    <inspect-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></inspect-form>
+  </u-modal>
+</template>
+
+<script>
+
+  import InspectForm from './InspectForm'
+  export default {
+    name: 'InspectModal',
+    components: {
+      InspectForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 16 - 1
src/views/module_cmms/inspectLine/modules/InspectLineForm.vue

@@ -2,6 +2,7 @@
   <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">
@@ -19,7 +20,12 @@
             </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>
       </a-form-model>
+      <inspect-line-modal-add ref="addSpotRef" :equipmentId="model.equipmentid" :selectData="model.cmmsInspectSpotItemList" @ok="handleOk"></inspect-line-modal-add>
     </j-form-container>
   </a-spin>
 </template>
@@ -28,10 +34,12 @@
 
   import { httpAction, getAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
+  import InspectLineModalAdd from './InspectLineModalAdd.vue'
 
   export default {
     name: 'InspectLineForm',
     components: {
+      InspectLineModalAdd,
     },
     props: {
       //表单禁用
@@ -76,6 +84,10 @@
       add () {
         this.edit(this.modelDefault);
       },
+      addInspectContent(){
+        this.$refs.addSpotRef.add();
+        this.$refs.addSpotRef.title = "选择巡检点";
+      },
       edit (record) {
         this.model = Object.assign({}, record);
         this.visible = true;
@@ -111,4 +123,7 @@
       },
     }
   }
-</script>
+</script>
+<style scoped>
+  @import '~@/assets/less/uStyle.less';
+</style>

+ 4 - 8
src/views/module_cmms/inspectLine/modules/InspectLineModal.vue

@@ -1,15 +1,11 @@
 <template>
-  <j-modal
+  <u-modal
     :title="title"
-    :width="width"
-    :visible="visible"
-    switchFullscreen
+    :visible.sync="visible"
     @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
-    @cancel="handleCancel"
-    cancelText="关闭">
+    @cancel="handleCancel">
     <inspect-line-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></inspect-line-form>
-  </j-modal>
+  </u-modal>
 </template>
 
 <script>

+ 150 - 0
src/views/module_cmms/inspectLine/modules/InspectLineModalAdd.vue

@@ -0,0 +1,150 @@
+<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:'巡检项ID',
+            align:"center",
+            dataIndex: 'id'
+          },
+          {
+            title:'巡检项编号',
+            align:"center",
+            dataIndex: 'itemcode'
+          },
+          {
+            title:'巡检项名称',
+            align:"center",
+            dataIndex: 'itemname'
+          },
+          {
+            title:'标准',
+            align:"center",
+            dataIndex: 'inspectionstandards',
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          }
+        ],
+        dataSource: [],
+        url: {
+          getList: "/cmmsInspectItem/cmmsInspectItem/getItemByEqId",
+          itemList: "/cmmsInspectItem/cmmsInspectItem/list",
+        },
+      }
+    },
+    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
+          })
+        }
+        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>

+ 6 - 6
src/views/module_cmms/inspectPlan/InspectPlanList.vue

@@ -112,7 +112,7 @@
         // 表头
         columns: [
           {
-            title: '#',
+            title: '序号',
             dataIndex: '',
             key:'rowIndex',
             width:60,
@@ -122,11 +122,6 @@
             }
           },
           {
-            title:'备注',
-            align:"center",
-            dataIndex: 'remark'
-          },
-          {
             title:'巡检计划编号',
             align:"center",
             dataIndex: 'plancode'
@@ -206,6 +201,11 @@
             dataIndex: 'ifnotice'
           },
           {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
             title: '操作',
             dataIndex: 'action',
             align:"center",

src/views/module_cmms/inspectPlan/modules/InspectPlanForm.vue → src/views/module_cmms/inspectPlan/modules/InspectPlanFormList.vue


+ 174 - 0
src/views/module_cmms/inspectPlan/modules/InspectPlanFormSet.vue

@@ -0,0 +1,174 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'InspectPlanForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/cmmsInspectPlan/cmmsInspectPlan/add",
+          edit: "/cmmsInspectPlan/cmmsInspectPlan/edit",
+          queryById: "/cmmsInspectPlan/cmmsInspectPlan/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        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;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 3 - 3
src/views/module_cmms/inspectPlan/modules/InspectPlanModal.Style#Drawer.vue

@@ -7,7 +7,7 @@
     @close="close"
     destroyOnClose
     :visible="visible">
-    <inspect-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></inspect-plan-form>
+    <inspect-plan-form-set ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></inspect-plan-form-set>
     <div class="drawer-footer">
       <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
       <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
@@ -17,12 +17,12 @@
 
 <script>
 
-  import InspectPlanForm from './InspectPlanForm'
+  import InspectPlanFormSet from './InspectPlanFormSet'
 
   export default {
     name: 'InspectPlanModal',
     components: {
-      InspectPlanForm
+      InspectPlanFormSet
     },
     data () {
       return {

+ 39 - 13
src/views/module_cmms/inspectPlan/modules/InspectPlanModal.vue

@@ -1,34 +1,46 @@
 <template>
-  <j-modal
+  <u-modal
     :title="title"
-    :width="width"
-    :visible="visible"
-    switchFullscreen
+    :visible.sync="visible"
+    contentFull
     @ok="handleOk"
-    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
-    @cancel="handleCancel"
-    cancelText="关闭">
-    <inspect-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></inspect-plan-form>
-  </j-modal>
+    @cancel="handleCancel">
+    <template slot="centerContent">
+      <div class="tabs">
+        <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>
+  </u-modal>
 </template>
 
 <script>
 
-  import InspectPlanForm from './InspectPlanForm'
+  import InspectPlanFormSet from './InspectPlanFormSet'
   export default {
     name: 'InspectPlanModal',
     components: {
-      InspectPlanForm
+      InspectPlanFormSet
     },
     data () {
       return {
         title:'',
         width:800,
         visible: false,
-        disableSubmit: false
+        disableSubmit: false,
+        tabs: [
+          { name: '计划设置', key: 'set' },
+          { name: '计划内容', key: 'list' },
+        ],
+        chooseTab: 'set'
       }
     },
     methods: {
+      handleTab(key){
+        console.log(key)
+        this.chooseTab = key
+      },
       add () {
         this.visible=true
         this.$nextTick(()=>{
@@ -57,4 +69,18 @@
       }
     }
   }
-</script>
+</script>
+<style lang="less" scoped>
+  .tabs{
+    .item{
+      font-size: 15px;
+      cursor: pointer;
+    }
+    .item:first-child{
+      margin-right: 16px;
+    }
+    .choose{
+      color: #1890FF;
+    }
+  }
+</style>

+ 54 - 60
src/views/module_cmms/repairMy/RepairMyList.vue

@@ -104,23 +104,21 @@
           </a-button>
         </template>
 
+        <span slot="priority" slot-scope="text, record">
+          <a-tag v-if="record.priority === '0'">{{ text }}</a-tag>
+          <a-tag v-if="record.priority === '1'" color="orange">{{ text }}</a-tag>
+          <a-tag v-if="record.priority === '2'" color="red">{{ text }}</a-tag>
+        </span>
+        <span slot="status" slot-scope="text, record">
+          <a-tag v-if="record.status === '0'" color="orange">{{ text }}</a-tag>
+          <a-tag v-if="record.status === '1' || record.priority === '2'" color="blue">{{ text }}</a-tag>
+          <a-tag v-if="record.status === '3'">{{ text }}</a-tag>
+        </span>
+        
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
+          <a @click="handleFeedback(record)">维修反馈</a>
           <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a @click="handleDetail(record)">详情</a>
-              </a-menu-item>
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <a @click="handleDetail(record)">详情</a>
         </span>
 
       </a-table>
@@ -159,22 +157,10 @@
             }
           },
           {
-            title:'创建者',
-            align:"center",
-            dataIndex: 'createBy'
-          },
-          {
-            title:'创建时间',
-            align:"center",
-            dataIndex: 'createTime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
-          },
-          {
-            title:'备注',
+            title:'优先级',
             align:"center",
-            dataIndex: 'remark'
+            dataIndex: 'priority_dictText',
+            scopedSlots: { customRender: 'priority' }
           },
           {
             title:'维修工单编号',
@@ -187,25 +173,15 @@
             dataIndex: 'repairname'
           },
           {
-            title:'设备ID',
-            align:"center",
-            dataIndex: 'equipmentid'
-          },
-          {
-            title:'设备编号',
-            align:"center",
-            dataIndex: 'equipmentcode'
-          },
-          {
             title:'设备名称',
             align:"center",
             dataIndex: 'equipmentname'
           },
-          {
-            title:'优先级:0普通,1紧急,2特急',
-            align:"center",
-            dataIndex: 'priority'
-          },
+          // {
+          //   title:'设备编号',
+          //   align:"center",
+          //   dataIndex: 'equipmentcode'
+          // },
           {
             title:'故障日期',
             align:"center",
@@ -220,11 +196,6 @@
             dataIndex: 'faultdesc'
           },
           {
-            title:'待办人',
-            align:"center",
-            dataIndex: 'repairuser'
-          },
-          {
             title:'维修时间',
             align:"center",
             dataIndex: 'repairdate',
@@ -238,14 +209,14 @@
             dataIndex: 'feedback'
           },
           {
-            title:'维修结果',
+            title:'维修结果',
             align:"center",
             dataIndex: 'result'
           },
           {
-            title:'状态:0待处理,1维修检查,2设备维修,3维修结束',
+            title:'工单状态',
             align:"center",
-            dataIndex: 'status'
+            dataIndex: 'repairstatus_dictText'
           },
           {
             title:'关联ID:巡检、点检、保养的ID',
@@ -253,9 +224,30 @@
             dataIndex: 'relid'
           },
           {
-            title:'维修工单状态: 0正常、1冻结、2拒绝',
+            title:'录入人',
             align:"center",
-            dataIndex: 'repairstatus'
+            dataIndex: 'createBy'
+          },
+          // {
+          //   title:'创建时间',
+          //   align:"center",
+          //   dataIndex: 'createTime',
+          //   customRender:function (text) {
+          //     return !text?"":(text.length>10?text.substr(0,10):text)
+          //   }
+          // },
+          // {
+          //   title:'备注',
+          //   align:"center",
+          //   dataIndex: 'remark'
+          // },
+          {
+            title:'维修状态',
+            align:"center",
+            fixed:"right",
+            width:80,
+            dataIndex: 'status_dictText',
+            scopedSlots: { customRender: 'status' }
           },
           {
             title: '操作',
@@ -267,11 +259,8 @@
           }
         ],
         url: {
-          list: "/cmmsRepairMy/cmmsRepairMy/list",
-          delete: "/cmmsRepairMy/cmmsRepairMy/delete",
-          deleteBatch: "/cmmsRepairMy/cmmsRepairMy/deleteBatch",
-          exportXlsUrl: "/cmmsRepairMy/cmmsRepairMy/exportXls",
-          importExcelUrl: "cmmsRepairMy/cmmsRepairMy/importExcel",
+          list: "/cmmsRepair/cmmsRepair/listMy",
+          // exportXlsUrl: "/cmmsRepairMy/cmmsRepairMy/exportXls",
           
         },
         dictOptions:{},
@@ -287,6 +276,11 @@
       },
     },
     methods: {
+      handleFeedback(record){
+        this.$refs.modalForm.title = "维修反馈";
+        this.$refs.modalForm.modalType = "feedback";
+        this.$refs.modalForm.feedback(record);
+      },
       initDictConfig(){
       },
       getSuperFieldList(){

+ 38 - 66
src/views/module_cmms/repairMy/modules/RepairMyForm.vue

@@ -3,80 +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="12">
             <a-form-model-item label="维修工单编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repaircode">
-              <a-input v-model="model.repaircode" placeholder="请输入维修工单编号"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="工单名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairname">
-              <a-input v-model="model.repairname" placeholder="请输入工单名称"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="设备ID" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
-              <a-input v-model="model.equipmentid" placeholder="请输入设备ID"  ></a-input>
+              <a-input v-model="model.repaircode" placeholder="请输入维修工单编号" disabled></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="设备编号" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentcode">
-              <a-input v-model="model.equipmentcode" placeholder="请输入设备编号"  ></a-input>
+          <a-col :span="12">
+            <a-form-model-item label="维修工单名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairname">
+              <a-input v-model="model.repairname" placeholder="请输入工单名称" disabled></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="设备名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentname">
-              <a-input v-model="model.equipmentname" placeholder="请输入设备名称"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="优先级:0普通,1紧急,2特急" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority">
-              <a-input v-model="model.priority" placeholder="请输入优先级:0普通,1紧急,2特急"  ></a-input>
+              <a-input v-model="model.equipmentname" placeholder="请输入设备名称" disabled></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="故障日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultdate">
-              <j-date placeholder="请选择故障日期" v-model="model.faultdate"  style="width: 100%" />
+              <j-date placeholder="请选择故障日期" v-model="model.faultdate"  style="width: 100%" disabled/>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
             <a-form-model-item label="故障描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="faultdesc">
-              <a-input v-model="model.faultdesc" placeholder="请输入故障描述"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="待办人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairuser">
-              <a-input v-model="model.repairuser" placeholder="请输入待办人"  ></a-input>
+              <a-input v-model="model.faultdesc" placeholder="请输入故障描述" disabled></a-input>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
-            <a-form-model-item label="维修时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairdate">
-              <j-date placeholder="请选择维修时间" v-model="model.repairdate"  style="width: 100%" />
+          <!-- <a-col :span="24">
+            <a-form-model-item label="优先级:0普通,1紧急,2特急" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="priority">
+              <a-input v-model="model.priority" placeholder="请输入优先级:0普通,1紧急,2特急"  ></a-input>
             </a-form-model-item>
-          </a-col>
+          </a-col> -->
           <a-col :span="24">
             <a-form-model-item label="维修反馈" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="feedback">
               <a-input v-model="model.feedback" placeholder="请输入维修反馈"  ></a-input>
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="维修结果" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="result">
-              <a-input v-model="model.result" placeholder="请输入维修结果"  ></a-input>
+            <a-form-model-item label="维修时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairdate">
+              <j-date placeholder="请选择维修时间" v-model="model.repairdate"  style="width: 100%" />
             </a-form-model-item>
           </a-col>
           <a-col :span="24">
-            <a-form-model-item label="状态:0待处理,1维修检查,2设备维修,3维修结束" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
-              <a-input v-model="model.status" placeholder="请输入状态:0待处理,1维修检查,2设备维修,3维修结束"  ></a-input>
+            <a-form-model-item label="是否挂单" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="status">
+              <a-switch :checked="model.status === '2' ? true : false" checked-children="是" un-checked-children="否" @change="changeStatus"/>
             </a-form-model-item>
           </a-col>
-          <a-col :span="24">
+          <!-- <a-col :span="24">
             <a-form-model-item label="维修工单状态: 0正常、1冻结、2拒绝" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repairstatus">
               <a-input v-model="model.repairstatus" placeholder="请输入维修工单状态: 0正常、1冻结、2拒绝"  ></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>
       </a-form-model>
@@ -86,7 +66,7 @@
 
 <script>
 
-  import { httpAction, getAction } from '@/api/manage'
+  import { putAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
 
   export default {
@@ -115,12 +95,6 @@
         },
         confirmLoading: false,
         validatorRules: {
-           repairname: [
-              { required: true, message: '请输入工单名称!'},
-           ],
-           faultdate: [
-              { required: true, message: '请输入故障日期!'},
-           ],
            faultdesc: [
               { required: true, message: '请输入故障描述!'},
            ],
@@ -138,8 +112,7 @@
            ],
         },
         url: {
-          add: "/cmmsRepairMy/cmmsRepairMy/add",
-          edit: "/cmmsRepairMy/cmmsRepairMy/edit",
+          feedback: "/cmmsRepair/cmmsRepair/repair",
           queryById: "/cmmsRepairMy/cmmsRepairMy/queryById"
         }
       }
@@ -154,29 +127,29 @@
       this.modelDefault = JSON.parse(JSON.stringify(this.model));
     },
     methods: {
-      add () {
-        this.edit(this.modelDefault);
-      },
-      edit (record) {
+      // add () {
+      //   this.edit(this.modelDefault);
+      // },
+      // edit (record) {
+      //   this.model = Object.assign({}, record);
+      //   this.visible = true;
+      // },
+      feedback(record){
         this.model = Object.assign({}, record);
+        console.log(this.model)
         this.visible = true;
       },
+      changeStatus(checked){
+        console.log(checked)
+        this.model.status = checked ? '2' : '3'
+      },
       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)=>{
+            putAction(this.url.feedback, this.model).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
                 that.$emit('ok');
@@ -187,7 +160,6 @@
               that.confirmLoading = false;
             })
           }
-         
         })
       },
     }

+ 14 - 8
src/views/module_cmms/repairMy/modules/RepairMyModal.vue

@@ -29,16 +29,22 @@
       }
     },
     methods: {
-      add () {
+      // add () {
+      //   this.visible=true
+      //   this.$nextTick(()=>{
+      //     this.$refs.realForm.add();
+      //   })
+      // },
+      // edit (record) {
+      //   this.visible=true
+      //   this.$nextTick(()=>{
+      //     this.$refs.realForm.edit(record);
+      //   })
+      // },
+      feedback(record){
         this.visible=true
         this.$nextTick(()=>{
-          this.$refs.realForm.add();
-        })
-      },
-      edit (record) {
-        this.visible=true
-        this.$nextTick(()=>{
-          this.$refs.realForm.edit(record);
+          this.$refs.realForm.feedback(record);
         })
       },
       close () {

+ 229 - 0
src/views/module_cmms/submission/SubmissionList.vue

@@ -0,0 +1,229 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <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.verificatePerson"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="检定方式">
+              <j-dict-select-tag placeholder="请选择检定方式" v-model="queryParam.verificateMethod" dictCode="verificate_method"/>
+            </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 placeholder="请选择检定单位" v-model="queryParam.verificateClientId" dict="base_client,client_name,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>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('送检工单表')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <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>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <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>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <cmms-submission-modal ref="modalForm" @ok="modalFormOk"></cmms-submission-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import CmmsSubmissionModal from './modules/SubmissionModal'
+  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+
+  export default {
+    name: 'CmmsSubmissionList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      CmmsSubmissionModal
+    },
+    data () {
+      return {
+        description: '送检工单表管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'送检负责人',
+            align:"center",
+            dataIndex: 'verificatePerson'
+          },
+          {
+            title:'检定方式',
+            align:"center",
+            dataIndex: 'verificateMethod_dictText'
+          },
+          {
+            title:'检定单位',
+            align:"center",
+            dataIndex: 'verificateClientId_dictText'
+          },
+          {
+            title:'送检设备数量',
+            align:"center",
+            dataIndex: 'totalNum'
+          },
+          {
+            title:'返回设备数量',
+            align:"center",
+            dataIndex: 'returnNum'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/cmmsSubmission/cmmsSubmission/list",
+          delete: "/cmmsSubmission/cmmsSubmission/delete",
+          deleteBatch: "/cmmsSubmission/cmmsSubmission/deleteBatch",
+          exportXlsUrl: "/cmmsSubmission/cmmsSubmission/exportXls",
+          importExcelUrl: "cmmsSubmission/cmmsSubmission/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'verificatePerson',text:'送检负责人',dictCode:''})
+        fieldList.push({type:'string',value:'verificateMethod',text:'检定方式',dictCode:'verificate_method'})
+        fieldList.push({type:'sel_search',value:'verificateClientId',text:'检定单位',dictTable:"base_client", dictText:'client_name', dictCode:'id'})
+        fieldList.push({type:'string',value:'totalNum',text:'送检设备数量',dictCode:''})
+        fieldList.push({type:'string',value:'returnNum',text:'返回设备数量',dictCode:''})
+        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 124 - 0
src/views/module_cmms/submission/modules/SubmissionForm.vue

@@ -0,0 +1,124 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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="equipmentids">
+              <j-search-select-tag v-model="model.equipmentids" dict="tpm_equipment,equipmentname,id"  placeholder="请选择检定设备" mode="multiple"/>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="送检负责人" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verificatePerson">
+              <a-input v-model="model.verificatePerson" placeholder="请输入送检负责人"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="检定方式" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verificateMethod">
+              <j-dict-select-tag type="list" v-model="model.verificateMethod" dictCode="verificate_method" placeholder="请选择检定方式" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="检定单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="verificateClientId">
+              <j-search-select-tag v-model="model.verificateClientId" dict="base_client,client_name,id"  placeholder="请选择检定单位" />
+            </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>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'CmmsSubmissionForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/cmmsSubmission/cmmsSubmission/add",
+          edit: "/cmmsSubmission/cmmsSubmission/edit",
+          queryById: "/cmmsSubmission/cmmsSubmission/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        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;
+            })
+          }
+
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_cmms/submission/modules/SubmissionModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <cmms-submission-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></cmms-submission-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import CmmsSubmissionForm from './SubmissionForm'
+
+  export default {
+    name: 'CmmsSubmissionModal',
+    components: {
+      CmmsSubmissionForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_cmms/submission/modules/SubmissionModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <cmms-submission-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cmms-submission-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import CmmsSubmissionForm from './SubmissionForm'
+  export default {
+    name: 'CmmsSubmissionModal',
+    components: {
+      CmmsSubmissionForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 220 - 0
src/views/module_cmms/submissionEquipment/SubmissionEquipmentList.vue

@@ -0,0 +1,220 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('送检工单设备表')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload>
+      <!-- 高级查询区域 -->
+      <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>
+      <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>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <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>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <cmms-submission-equipment-modal ref="modalForm" @ok="modalFormOk"></cmms-submission-equipment-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import CmmsSubmissionEquipmentModal from './modules/SubmissionEquipmentModal'
+  import {filterMultiDictText} from '@/components/dict/JDictSelectUtil'
+
+  export default {
+    name: 'CmmsSubmissionEquipmentList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      CmmsSubmissionEquipmentModal
+    },
+    data () {
+      return {
+        description: '送检工单设备表管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            title:'送检工单id',
+            align:"center",
+            dataIndex: 'cmmsSubmissionId'
+          },
+          {
+            title:'设备id',
+            align:"center",
+            dataIndex: 'equipmentid'
+          },
+          {
+            title:'检定日期',
+            align:"center",
+            dataIndex: 'submissionDate'
+          },
+          {
+            title:'检定结果',
+            align:"center",
+            dataIndex: 'submissionResult_dictText'
+          },
+          {
+            title:'有效日期',
+            align:"center",
+            dataIndex: 'submissionEffectiveDate'
+          },
+          {
+            title:'班组确认',
+            align:"center",
+            dataIndex: 'teamConfirm'
+          },
+          {
+            title:'备注',
+            align:"center",
+            dataIndex: 'remark'
+          },
+          {
+            title:'送检状态',
+            align:"center",
+            dataIndex: 'submissionStatus_dictText'
+          },
+          {
+            title:'送回日期',
+            align:"center",
+            dataIndex: 'submissionReturnDate'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/list",
+          delete: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/delete",
+          deleteBatch: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/deleteBatch",
+          exportXlsUrl: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/exportXls",
+          importExcelUrl: "cmmsSubmissionEquipment/cmmsSubmissionEquipment/importExcel",
+
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'cmmsSubmissionId',text:'送检工单id',dictCode:''})
+        fieldList.push({type:'string',value:'equipmentid',text:'设备id',dictCode:''})
+        fieldList.push({type:'datetime',value:'submissionDate',text:'检定日期'})
+        fieldList.push({type:'string',value:'submissionResult',text:'检定结果',dictCode:'device_verification_result'})
+        fieldList.push({type:'datetime',value:'submissionEffectiveDate',text:'有效日期'})
+        fieldList.push({type:'string',value:'teamConfirm',text:'班组确认',dictCode:''})
+        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
+        fieldList.push({type:'string',value:'submissionStatus',text:'送检状态',dictCode:'submission_status'})
+        fieldList.push({type:'datetime',value:'submissionReturnDate',text:'送回日期'})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 144 - 0
src/views/module_cmms/submissionEquipment/modules/SubmissionEquipmentForm.vue

@@ -0,0 +1,144 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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="送检工单id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="cmmsSubmissionId">
+              <a-input v-model="model.cmmsSubmissionId" placeholder="请输入送检工单id"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="设备id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
+              <a-input v-model="model.equipmentid" placeholder="请输入设备id"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="检定日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submissionDate">
+              <j-date placeholder="请选择检定日期"  v-model="model.submissionDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="检定结果" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submissionResult">
+              <j-dict-select-tag type="list" v-model="model.submissionResult" dictCode="device_verification_result" placeholder="请选择检定结果" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="有效日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submissionEffectiveDate">
+              <j-date placeholder="请选择有效日期"  v-model="model.submissionEffectiveDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="班组确认" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="teamConfirm">
+              <a-input v-model="model.teamConfirm" 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-col :span="24">
+            <a-form-model-item label="送检状态" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submissionStatus">
+              <j-dict-select-tag type="list" v-model="model.submissionStatus" dictCode="submission_status" placeholder="请选择送检状态" />
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <a-form-model-item label="送回日期" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="submissionReturnDate">
+              <j-date placeholder="请选择送回日期"  v-model="model.submissionReturnDate" :show-time="true" date-format="YYYY-MM-DD HH:mm:ss" style="width: 100%" />
+            </a-form-model-item>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'CmmsSubmissionEquipmentForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/add",
+          edit: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/edit",
+          queryById: "/cmmsSubmissionEquipment/cmmsSubmissionEquipment/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        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;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_cmms/submissionEquipment/modules/SubmissionEquipmentModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <cmms-submission-equipment-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></cmms-submission-equipment-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import CmmsSubmissionEquipmentForm from './SubmissionEquipmentForm'
+
+  export default {
+    name: 'CmmsSubmissionEquipmentModal',
+    components: {
+      CmmsSubmissionEquipmentForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_cmms/submissionEquipment/modules/SubmissionEquipmentModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <cmms-submission-equipment-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></cmms-submission-equipment-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import CmmsSubmissionEquipmentForm from './SubmissionEquipmentForm'
+  export default {
+    name: 'CmmsSubmissionEquipmentModal',
+    components: {
+      CmmsSubmissionEquipmentForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 261 - 0
src/views/module_cmms/upkeep/UpkeepList.vue

@@ -0,0 +1,261 @@
+<template>
+  <a-card :bordered="false">
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline" @keyup.enter.native="searchQuery">
+        <a-row :gutter="24">
+        </a-row>
+      </a-form>
+    </div>
+    <!-- 查询区域-END -->
+
+    <!-- 操作按钮区域 -->
+    <div class="table-operator">
+      <!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
+      <a-button type="primary" icon="download" @click="handleExportXls('保养工单')">导出</a-button>
+      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
+        <a-button type="primary" icon="import">导入</a-button>
+      </a-upload> -->
+      <!-- 高级查询区域 -->
+      <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query> -->
+      <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>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+      <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>
+
+      <a-table
+        ref="table"
+        size="middle"
+        :scroll="{x:true}"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading"
+        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
+        class="j-table-force-nowrap"
+        @change="handleTableChange">
+
+        <template slot="htmlSlot" slot-scope="text">
+          <div v-html="text"></div>
+        </template>
+        <template slot="imgSlot" slot-scope="text,record">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
+          <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
+        </template>
+        <template slot="fileSlot" slot-scope="text">
+          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
+          <a-button
+            v-else
+            :ghost="true"
+            type="primary"
+            icon="download"
+            size="small"
+            @click="downloadFile(text)">
+            下载
+          </a-button>
+        </template>
+
+        <span slot="action" slot-scope="text, record">
+          <a @click="handleEdit(record)">编辑</a>
+
+          <a-divider type="vertical" />
+          <a-dropdown>
+            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
+            <a-menu slot="overlay">
+              <a-menu-item>
+                <a @click="handleDetail(record)">详情</a>
+              </a-menu-item>
+              <a-menu-item>
+                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+                  <a>删除</a>
+                </a-popconfirm>
+              </a-menu-item>
+            </a-menu>
+          </a-dropdown>
+        </span>
+
+      </a-table>
+    </div>
+
+    <upkeep-modal ref="modalForm" @ok="modalFormOk"></upkeep-modal>
+  </a-card>
+</template>
+
+<script>
+
+  import '@/assets/less/TableExpand.less'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import UpkeepModal from './modules/UpkeepModal'
+
+  export default {
+    name: 'UpkeepList',
+    mixins:[JeecgListMixin, mixinDevice],
+    components: {
+      UpkeepModal
+    },
+    data () {
+      return {
+        description: '保养工单管理页面',
+        // 表头
+        columns: [
+          {
+            title: '#',
+            dataIndex: '',
+            key:'rowIndex',
+            width:60,
+            align:"center",
+            customRender:function (t,r,index) {
+              return parseInt(index)+1;
+            }
+          },
+          {
+            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: 'planname'
+          },
+          {
+            title:'地点',
+            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: 'chargeruser'
+          },
+          {
+            title:'描述',
+            align:"center",
+            dataIndex: 'upkeepdesc'
+          },
+          {
+            title:'状态:0待处理、1已通知、2未执行、3未完成、4已完成',
+            align:"center",
+            dataIndex: 'status'
+          },
+          {
+            title:'处理意见',
+            align:"center",
+            dataIndex: 'opinion'
+          },
+          {
+            title: '操作',
+            dataIndex: 'action',
+            align:"center",
+            fixed:"right",
+            width:147,
+            scopedSlots: { customRender: 'action' }
+          }
+        ],
+        url: {
+          list: "/cmmsUpkeep/cmmsUpkeep/list",
+          delete: "/cmmsUpkeep/cmmsUpkeep/delete",
+          deleteBatch: "/cmmsUpkeep/cmmsUpkeep/deleteBatch",
+          exportXlsUrl: "/cmmsUpkeep/cmmsUpkeep/exportXls",
+          importExcelUrl: "cmmsUpkeep/cmmsUpkeep/importExcel",
+          
+        },
+        dictOptions:{},
+        superFieldList:[],
+      }
+    },
+    created() {
+    this.getSuperFieldList();
+    },
+    computed: {
+      importExcelUrl: function(){
+        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+      },
+    },
+    methods: {
+      initDictConfig(){
+      },
+      getSuperFieldList(){
+        let fieldList=[];
+        fieldList.push({type:'string',value:'remark',text:'备注',dictCode:''})
+        fieldList.push({type:'string',value:'upkeepcode',text:'保养工单编号',dictCode:''})
+        fieldList.push({type:'string',value:'upkeepname',text:'保养名称(标题)',dictCode:''})
+        fieldList.push({type:'string',value:'upkeepplanid',text:'保养计划ID',dictCode:''})
+        fieldList.push({type:'string',value:'upkeepprojid',text:'保养工作项目ID',dictCode:''})
+        fieldList.push({type:'string',value:'projectname',text:'工作项目名称',dictCode:''})
+        fieldList.push({type:'string',value:'planname',text:'计划名称',dictCode:''})
+        fieldList.push({type:'string',value:'address',text:'地点',dictCode:''})
+        fieldList.push({type:'string',value:'supplier',text:'厂商名称',dictCode:''})
+        fieldList.push({type:'string',value:'suppliertel',text:'厂商电话',dictCode:''})
+        fieldList.push({type:'string',value:'linker',text:'联系人',dictCode:''})
+        fieldList.push({type:'string',value:'linkertel',text:'联系人电话',dictCode:''})
+        fieldList.push({type:'string',value:'chargeruser',text:'负责人',dictCode:''})
+        fieldList.push({type:'string',value:'upkeepdesc',text:'描述',dictCode:''})
+        fieldList.push({type:'string',value:'status',text:'状态:0待处理、1已通知、2未执行、3未完成、4已完成',dictCode:''})
+        fieldList.push({type:'string',value:'opinion',text:'处理意见',dictCode:''})
+        this.superFieldList = fieldList
+      }
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less';
+</style>

+ 179 - 0
src/views/module_cmms/upkeep/modules/UpkeepForm.vue

@@ -0,0 +1,179 @@
+<template>
+  <a-spin :spinning="confirmLoading">
+    <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="upkeepcode">
+              <a-input v-model="model.upkeepcode" placeholder="请输入保养工单编号"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <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-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-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-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-form-model-item label="地点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="address">
+              <a-input v-model="model.address" placeholder="请输入地点"  ></a-input>
+            </a-form-model-item>
+          </a-col>
+          <a-col :span="24">
+            <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-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-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-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-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="upkeepdesc">
+              <a-input v-model="model.upkeepdesc" placeholder="请输入描述"  ></a-input>
+            </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>
+          </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>
+          </a-col>
+        </a-row>
+      </a-form-model>
+    </j-form-container>
+  </a-spin>
+</template>
+
+<script>
+
+  import { httpAction, getAction } from '@/api/manage'
+  import { validateDuplicateValue } from '@/utils/util'
+
+  export default {
+    name: 'UpkeepForm',
+    components: {
+    },
+    props: {
+      //表单禁用
+      disabled: {
+        type: Boolean,
+        default: false,
+        required: false
+      }
+    },
+    data () {
+      return {
+        model:{
+         },
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+        confirmLoading: false,
+        validatorRules: {
+        },
+        url: {
+          add: "/cmmsUpkeep/cmmsUpkeep/add",
+          edit: "/cmmsUpkeep/cmmsUpkeep/edit",
+          queryById: "/cmmsUpkeep/cmmsUpkeep/queryById"
+        }
+      }
+    },
+    computed: {
+      formDisabled(){
+        return this.disabled
+      },
+    },
+    created () {
+       //备份model原始值
+      this.modelDefault = JSON.parse(JSON.stringify(this.model));
+    },
+    methods: {
+      add () {
+        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;
+            })
+          }
+         
+        })
+      },
+    }
+  }
+</script>

+ 84 - 0
src/views/module_cmms/upkeep/modules/UpkeepModal.Style#Drawer.vue

@@ -0,0 +1,84 @@
+<template>
+  <a-drawer
+    :title="title"
+    :width="width"
+    placement="right"
+    :closable="false"
+    @close="close"
+    destroyOnClose
+    :visible="visible">
+    <upkeep-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></upkeep-form>
+    <div class="drawer-footer">
+      <a-button @click="handleCancel" style="margin-bottom: 0;">关闭</a-button>
+      <a-button v-if="!disableSubmit"  @click="handleOk" type="primary" style="margin-bottom: 0;">提交</a-button>
+    </div>
+  </a-drawer>
+</template>
+
+<script>
+
+  import UpkeepForm from './UpkeepForm'
+
+  export default {
+    name: 'UpkeepModal',
+    components: {
+      UpkeepForm
+    },
+    data () {
+      return {
+        title:"操作",
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        });
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+/** Button按钮间距 */
+  .ant-btn {
+    margin-left: 30px;
+    margin-bottom: 30px;
+    float: right;
+  }
+  .drawer-footer{
+    position: absolute;
+    bottom: -8px;
+    width: 100%;
+    border-top: 1px solid #e8e8e8;
+    padding: 10px 16px;
+    text-align: right;
+    left: 0;
+    background: #fff;
+    border-radius: 0 0 2px 2px;
+  }
+</style>

+ 60 - 0
src/views/module_cmms/upkeep/modules/UpkeepModal.vue

@@ -0,0 +1,60 @@
+<template>
+  <j-modal
+    :title="title"
+    :width="width"
+    :visible="visible"
+    switchFullscreen
+    @ok="handleOk"
+    :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    <upkeep-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></upkeep-form>
+  </j-modal>
+</template>
+
+<script>
+
+  import UpkeepForm from './UpkeepForm'
+  export default {
+    name: 'UpkeepModal',
+    components: {
+      UpkeepForm
+    },
+    data () {
+      return {
+        title:'',
+        width:800,
+        visible: false,
+        disableSubmit: false
+      }
+    },
+    methods: {
+      add () {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.add();
+        })
+      },
+      edit (record) {
+        this.visible=true
+        this.$nextTick(()=>{
+          this.$refs.realForm.edit(record);
+        })
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        this.$refs.realForm.submitForm();
+      },
+      submitCallback(){
+        this.$emit('ok');
+        this.visible = false;
+      },
+      handleCancel () {
+        this.close()
+      }
+    }
+  }
+</script>

+ 137 - 55
src/views/module_cmms/upkeepPlan/UpkeepPlanList.vue

@@ -4,6 +4,47 @@
     <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.plancode"></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>
+          <!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">
+            <a-form-item label="设备类型">
+              <j-tree-select
+                ref="treeSelect"
+                placeholder="请选择设备类型"
+                v-model="queryParam.equipdefid"
+                dict="tpm_equipment_tree,name,id"
+                pidField="parentid"
+                pidValue="0"
+                hasChildField="has_child"
+                >
+              </j-tree-select>
+            </a-form-item>
+          </a-col> -->
+          <template v-if="toggleSearchStatus">
+            <a-col :xl="6" :lg="7" :md="8" :sm="24">
+              <a-form-item label="保养项编号">
+                <a-input placeholder="请输入保养项编号" v-model="queryParam.itemcode"></a-input>
+              </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>
@@ -47,6 +88,10 @@
         class="j-table-force-nowrap"
         @change="handleTableChange">
 
+        <template slot="status"  slot-scope="text, record">
+          <a-switch :checked= "record.status == 0 ? true : false" @click="statusChange(record,$event)" />
+        </template>
+
         <template slot="htmlSlot" slot-scope="text">
           <div v-html="text"></div>
         </template>
@@ -98,6 +143,7 @@
   import '@/assets/less/TableExpand.less'
   import { mixinDevice } from '@/utils/mixin'
   import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import { httpAction, getAction } from '@/api/manage'
   import UpkeepPlanModal from './modules/UpkeepPlanModal'
 
   export default {
@@ -122,120 +168,122 @@
             }
           },
           {
-            title:'保养计划编号',
+            title:'计划编号',
             align:"center",
             dataIndex: 'plancode'
           },
           {
-            title:'保养计划名称',
+            title:'计划名称',
             align:"center",
             dataIndex: 'planname'
           },
+          {
+            title:'设备',
+            align:"center",
+            dataIndex: 'equipmentName'
+          },
           // {
           //   title:'保养工作项目ID',
           //   align:"center",
           //   dataIndex: 'upkeepprojid'
           // },
-          {
-            title:'工作项目名称',
-            align:"center",
-            dataIndex: 'projectname'
-          },
+          // {
+          //   title:'工作项目名称',
+          //   align:"center",
+          //   dataIndex: 'projectname'
+          // },
           {
             title:'地点',
             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: 'plandesc'
+            dataIndex: 'chargeruser_dictText'
           },
+          // {
+          //   title:'描述',
+          //   align:"center",
+          //   dataIndex: 'plandesc'
+          // },
           {
             title:'开始时间',
             align:"center",
             dataIndex: 'begintime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
+            // customRender:function (text) {
+            //   return !text?"":(text.length>10?text.substr(0,10):text)
+            // }
           },
           {
-            title:'重复',
+            title:'重复间隔',
             align:"center",
             dataIndex: 'repeatnum'
           },
           {
-            title:'重复类型:年、月、周、日、时、分',
+            title:'间隔单位',
             align:"center",
             dataIndex: 'repeattype'
           },
           {
-            title:'提前通知时',
+            title:'提前通知时',
             align:"center",
             dataIndex: 'noticenum'
           },
           {
-            title:'提前通知类型:天、时、分',
+            title:'时长单位',
             align:"center",
             dataIndex: 'noticetype'
           },
+          // 状态(0启用 1停用)
           {
-            title:'状态(0启用 1停用)',
+            title:'状态',
             align:"center",
-            dataIndex: 'status'
+            dataIndex: 'status',
+            scopedSlots: { customRender: 'status' }
           },
           {
             title:'下次执行时间',
             align:"center",
             dataIndex: 'nexttime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
+            // customRender:function (text) {
+            //   return !text?"":(text.length>10?text.substr(0,10):text)
+            // }
           },
           {
             title:'下次通知时间',
             align:"center",
             dataIndex: 'noticetime',
-            customRender:function (text) {
-              return !text?"":(text.length>10?text.substr(0,10):text)
-            }
+            // customRender:function (text) {
+            //   return !text?"":(text.length>10?text.substr(0,10):text)
+            // }
           },
           {
-            title:'是否已通知:是/否',
+            title:'通知状态',
             align:"center",
             dataIndex: 'ifnotice'
           },
           {
-            title:'设备id(根据设备id查找保养项内容)',
-            align:"center",
-            dataIndex: 'equipmentid'
-          },
-          {
             title:'备注',
             align:"center",
             dataIndex: 'remark'
@@ -255,10 +303,11 @@
           deleteBatch: "/cmmsUpkeepPlan/cmmsUpkeepPlan/deleteBatch",
           exportXlsUrl: "/cmmsUpkeepPlan/cmmsUpkeepPlan/exportXls",
           importExcelUrl: "cmmsUpkeepPlan/cmmsUpkeepPlan/importExcel",
-          
+          edit: "/cmmsUpkeepPlan/cmmsUpkeepPlan/updateCmmsUpkeepPlanStatusById",
         },
         dictOptions:{},
         superFieldList:[],
+        model: {}
       }
     },
     created() {
@@ -297,6 +346,39 @@
         fieldList.push({type:'string',value:'ifnotice',text:'是否已通知:是/否',dictCode:''})
         fieldList.push({type:'string',value:'equipmentid',text:'设备id(根据设备id查找保养项内容)',dictCode:''})
         this.superFieldList = fieldList
+      },
+      statusChange(record,$event){
+        console.log(record.status,$event)
+        let text1 = record.status === "0" ? "是否确认停用“" : "是否确认使用“";
+        let text2 = record.status === "0" ? "”,请确保该设备有可使用的保养计划" : "”,若启用当前保养计划则该设备其他保养计划默认禁用";
+        const that = this
+        that.$confirm({
+          title: "提示",
+          content: text1 + record.planname + text2,
+          onOk() {
+            let httpurl = '';
+            let method = 'put';
+            httpurl+=that.url.edit;
+            if (record.status == 1) {
+              that.model.id = record.id
+              that.model.status = 0
+            } else {
+              that.model.id = record.id
+              that.model.status = 1
+            }
+            httpAction(httpurl,that.model,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.modalFormOk()
+              }else{
+                that.$message.warning(res.message);
+              }
+            })
+          },
+          onCancel() {
+            // that.modalFormOk()
+          }
+        });
       }
     }
   }

+ 260 - 119
src/views/module_cmms/upkeepPlan/modules/UpkeepPlanForm.vue

@@ -2,118 +2,149 @@
   <a-spin :spinning="confirmLoading">
     <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="保养工作项目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-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="address">
-              <a-input v-model="model.address" placeholder="请输入地点"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-          <a-col :span="24">
-            <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-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-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-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-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="plandesc">
-              <a-input v-model="model.plandesc" placeholder="请输入描述"  ></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="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="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-col :span="24">
-            <a-form-model-item label="设备id(根据设备id查找保养项内容)" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentid">
-              <a-input v-model="model.equipmentid" placeholder="请输入设备id(根据设备id查找保养项内容)"  ></a-input>
-            </a-form-model-item>
-          </a-col>
-        </a-row>
+        <div class="cmms-dialog-item-title">保养计划基本信息</div>
+        <div style="height: 100%;width:100%;display: flex;">
+          <div style="height: 100%;width:92%;">
+            <a-row>
+              <!-- <a-col :span="12">
+                <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="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="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%"/>
+                    <!-- <a-button type="primary" icon="search" /> -->
+                </a-form-model-item>
+              </a-col>
+              <!-- <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="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="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="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="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="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="12">
+                <a-form-model-item label="描述" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="plandesc">
+                  <a-input v-model="model.plandesc" placeholder="请输入描述"  ></a-input>
+                </a-form-model-item>
+              </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>
+                </a-form-model-item>
+              </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"/>
+                </a-form-model-item>
+              </a-col>
+              <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%" :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="noticenum">
+                  <a-input-number v-model="model.noticenum" :min="1" 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="12">
+                <a-form-model-item label="通知单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="noticetype">
+                  <j-dict-select-tag v-model="model.noticetype" placeholder="请选择通知单位" dictCode="plan_notice_unit"/>
+                </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" :min="1" 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="12">
+                <a-form-model-item label="间隔单位" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="repeattype">
+                  <j-dict-select-tag v-model="model.repeattype" placeholder="请选择间隔单位" dictCode="plan_cycle_unit"/>
+                </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停用)"  ></a-input>
+                </a-form-model-item>
+              </a-col> -->
+              <!-- <a-col :span="12">
+                <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="12">
+                <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="12">
+                <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-col :span="12">
+                <a-form-model-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" 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>
+          <div style="height: 100%;width:8%;padding-top:0.3%;">
+              <a-button type="primary" icon="search" />
+          </div>
+        </div>
+        <div class="cmms-dialog-item-title u-flex-jab">
+          <div>设备保养设置</div>
+          <div>
+            <a-button @click="handleAddUpkeepItem" type="link" icon="plus">保养项</a-button>
+          </div>
+        </div>
+        <a-table
+          ref="table"
+          size="middle"
+          :scroll="{x:true}"
+          bordered
+          rowKey="id"
+          :columns="columns"
+          :dataSource="model.cmmsUpkeepItemDtoList"
+          :pagination="false"
+          class="j-table-force-nowrap">
+        </a-table>
+
+        <upkeep-plan-modal-add ref="modalForm" @ok="modalFormOk" :modelForm="model" :dataList="model.cmmsUpkeepItemDtoList" @customEvent="handleCustomEvent"></upkeep-plan-modal-add>
       </a-form-model>
     </j-form-container>
   </a-spin>
@@ -123,10 +154,15 @@
 
   import { httpAction, getAction } from '@/api/manage'
   import { validateDuplicateValue } from '@/utils/util'
+  import { mixinDevice } from '@/utils/mixin'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+  import UpkeepPlanModalAdd from './UpkeepPlanModalAdd.vue'
 
   export default {
     name: 'UpkeepPlanForm',
+    mixins:[JeecgListMixin, mixinDevice],
     components: {
+        UpkeepPlanModalAdd
     },
     props: {
       //表单禁用
@@ -139,23 +175,80 @@
     data () {
       return {
         model:{
-         },
+          noticetype: '天',
+          repeattype: '天',
+          cmmsUpkeepItemDtoList: []
+        },
         labelCol: {
           xs: { span: 24 },
-          sm: { span: 5 },
+          sm: { span: 6 },
         },
         wrapperCol: {
           xs: { span: 24 },
-          sm: { span: 16 },
+          sm: { span: 18 },
         },
         confirmLoading: false,
         validatorRules: {
+          planname: [
+            { required: true, message: '请输入保养计划名称!'},
+          ],
+          equipmentid: [
+            { required: true, message: '请选择设备!'},
+          ],
+          address: [
+            { required: true, message: '请输入地点!'},
+          ],
+          chargeruser: [
+            { required: true, message: '请输入负责人!'},
+          ],
+          begintime: [
+            { required: true, message: '请选择开始时间!'},
+          ],
+          noticenum: [
+            { required: true, message: '请输入提前通知时长!'},
+          ],
+          repeatnum: [
+            { required: true, message: '请输入重复间隔!'},
+          ],
         },
         url: {
+          list: "/cmmsSpotcheckItem/cmmsSpotcheckItem/listbyequipmentid/{equipmentid}",
           add: "/cmmsUpkeepPlan/cmmsUpkeepPlan/add",
           edit: "/cmmsUpkeepPlan/cmmsUpkeepPlan/edit",
           queryById: "/cmmsUpkeepPlan/cmmsUpkeepPlan/queryById"
-        }
+        },
+        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'
+          },
+        ],
       }
     },
     computed: {
@@ -169,10 +262,25 @@
     },
     methods: {
       add () {
-        this.edit(this.modelDefault);
+        // this.edit(this.modelDefault);
+        this.model = Object.assign({}, this.modelDefault);
+        this.visible = true;
       },
       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
+            // 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 () {
@@ -186,10 +294,23 @@
             if(!this.model.id){
               httpurl+=this.url.add;
               method = 'post';
+              // 默认状态是禁用
+              this.model.status = 1
+              this.model.cmmsUpkeepItemDtoList = this.model.cmmsUpkeepItemDtoList.map((res) => {
+                return {
+                  id: res.id
+                }
+              })
             }else{
               httpurl+=this.url.edit;
                method = 'put';
+               this.model.cmmsUpkeepItemDtoList = this.model.cmmsUpkeepItemDtoList.map((res) => {
+                return {
+                  id: res.id
+                }
+              })
             }
+            console.log(999,this.model)
             httpAction(httpurl,this.model,method).then((res)=>{
               if(res.success){
                 that.$message.success(res.message);
@@ -204,6 +325,26 @@
          
         })
       },
+      // 通过已选设备获取保养项列表
+      handleAddUpkeepItem(){
+        console.log(this.model.equipmentid)
+        if (this.model.equipmentid == undefined) {
+          this.$message.error("请先选择设备!");
+        } else {
+          this.$refs.modalForm.add();
+          this.$refs.modalForm.title = "选择保养项";
+        }
+      },
+      // 处理子组件传过来的数据
+      handleCustomEvent(data) {
+        // 处理从子组件传递过来的数据
+        console.log("子组件传过来的数据:", data);
+        this.model.cmmsUpkeepItemDtoList = data;
+      }
     }
   }
-</script>
+</script>
+
+<style scoped>
+@import "~@/assets/less/uStyle.less";
+</style>

+ 4 - 4
src/views/module_cmms/upkeepPlan/modules/UpkeepPlanModal.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-plan-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></upkeep-plan-form>
-  </j-modal>
+  </u-modal>
 </template>
 
 <script>
@@ -23,7 +23,7 @@
     data () {
       return {
         title:'',
-        width:800,
+        width:1200,
         visible: false,
         disableSubmit: false
       }

+ 149 - 0
src/views/module_cmms/upkeepPlan/modules/UpkeepPlanModalAdd.vue

@@ -0,0 +1,149 @@
+<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: 'UpkeepPlanModalAdd',
+    components: {
+        
+    },
+    props: {
+      modelForm: {
+        type: Object,
+        default: function(){
+            return {} // 使用工厂函数返回默认值
+        }
+      },
+      dataList: {
+        type: Array,
+        default: function(){
+            return [] // 使用工厂函数返回默认值
+        }
+      },
+    },
+    data () {
+      return {
+        title:'',
+        width:1000,
+        visible: false,
+        /* table选中keys*/
+        selectedRowKeys: [],
+        /* table选中records*/
+        selectionRows: [],
+        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'
+          },
+        ],
+        dataSource: [],
+        url: {
+            getList: "/cmmsUpkeepItem/cmmsUpkeepItem/getCmmsUpkeepItemByEqid"
+        },
+      }
+    },
+    methods: {
+      add () {
+        this.visible = true;
+        const a = {
+            id: this.modelForm.equipmentid
+        }
+        console.log(111,a)
+        getAction(this.url.getList,a).then((res) => {
+            console.log(res)
+            this.dataSource = res.result
+        })
+        this.selectList()
+      },
+      // 将以选中的值重新在列表中选中
+      selectList() {
+        console.log(111,this.dataList)
+        this.selectionRows = this.dataList
+        this.selectedRowKeys = this.dataList.map((res) => {
+            return res.id
+        })
+      },  
+      close () {
+        this.$emit('close');
+        this.visible = false;
+        this.onClearSelected()
+        this.selectionRows = this.dataList
+        this.selectedRowKeys = this.dataList.map((res) => {
+            return res.id
+        })
+      },
+      handleOk () {
+        console.log(this.selectionRows)
+        this.$emit('customEvent', this.selectionRows);
+        this.visible = false;
+      },
+      submitCallback(){
+        this.$emit('ok');
+        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>