xiongchao 3 years ago
parent
commit
9e18e7d750

+ 9 - 0
src/utils/dict.js

@@ -116,6 +116,7 @@ DictCache.TYPE = {
   SPARE_RESTORE_FORM_TYPE: 'SPARE_RESTORE_FORM_TYPE', // 退库类型,
   SPARE_RESTORE_FORM_STATUS: 'SPARE_RESTORE_FORM_STATUS', // 退库登记单状态,
   REPAIR_APPLICATION_FORM_SOURCE: 'REPAIR_APPLICATION_FORM_SOURCE', // 报修来源
+  REPAIR_APPLICATION_FORM_CATEGORY: 'REPAIR_APPLICATION_FORM_CATEGORY', // 维修类别
   REPAIR_APPLICATION_FORM_LEVEL: 'REPAIR_APPLICATION_FORM_LEVEL', // 紧急等级
   REPAIR_APPLICATION_FORM_STATUS: 'REPAIR_APPLICATION_FORM_STATUS', // 报修状态
   REPAIR_REASON_STATUS: 'REPAIR_REASON_STATUS', // 分析措施状态
@@ -750,6 +751,14 @@ DictCache.VALUE = {
     LUBRICATION: 2, // 维修人员
     SCENE: 1 // 使用人员
   },
+  /**
+   * 报修类别
+   */
+  REPAIR_APPLICATION_FORM_CATEGORY: {
+    PLAN: 1, // 计划性
+    PLAN_NOT: 2, // 非计划性
+    OTHER: 3 // 其他
+  },
   /**
    * 是否
    */

+ 331 - 0
src/views/check/checkjob/modules/DetailStandardCheckJob.vue

@@ -0,0 +1,331 @@
+<template>
+  <div v-show="visible">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+    <div class="table-operator" style="margin-bottom:8px;">
+      <a-button type="primary" @click="handleExecuteBatch" v-if="selectedRowKeys.length > 0">
+        <a-icon style="margin-left: 8px" type="plus"/>
+        批量接收
+      </a-button>
+      <a-button style="margin-left: 8px" type="primary" v-if="selectedRowKeys.length > 0" @click="handleFinishBatch">
+        <a-icon type="plus"/>
+        批量完成
+      </a-button>
+      <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>
+      <a-select
+        style="margin-left: 8px;width:100px;"
+        @change="statusChange"
+        placeholder="请选择">
+        <a-select-option
+          v-for="(label,value) in statusMap"
+          :key="value"
+          :label="label"
+          :value="parseInt(value)">{{ label }}
+        </a-select-option>
+      </a-select>
+      <a-select
+        style="margin-left: 8px;width:100px;"
+        @change="levelChange"
+        placeholder="请选择">
+        <a-select-option
+          v-for="(label,value) in standardLevelMap"
+          :key="value"
+          :label="label"
+          :value="parseInt(value)">{{ label }}
+        </a-select-option>
+      </a-select>
+    </div>
+    <a-table
+      :data-source="data"
+      :columns="columns"
+      tableLayout="auto"
+      :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
+      :scroll="{x: 1500, y: BaseTool.Constant.scrollY }"
+      rowKey="id">
+      <span slot="action" slot-scope="record">
+        <template>
+          <a v-if="$auth('sb-infos-edit')" @click="handleView(record)">查看</a>
+          <a-divider type="vertical" />
+          <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+          <a-divider type="vertical" />
+          <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
+            <a>删除</a>
+          </a-popconfirm>
+          <a-divider type="vertical" />
+          <a @click="handleGenerate(record)">插入任务</a>
+        </template>
+      </span>
+      <span slot="status" slot-scope="text">
+        <badge
+          :status="DictCache.COLOR.JOB_STATUS[text]"
+          :text="statusMap[text]" />
+      </span>
+    </a-table>
+    <base-form ref="baseModal" :check-type="checkType" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+
+  </div>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { queryCheckJob, deleteCheckJobs, fetchCheckJob, exportCheckJob, executeJobBatch, finishJobBatch } from '@/api/check/checkjob'
+import BaseForm from './BaseForm'
+import Detail from './Detail'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'DetailSbCheck',
+  components: {
+    DetailList,
+    DetailListItem,
+    BaseForm,
+    Detail,
+    SbInfoSelectModal
+  },
+  props: {
+    /**
+     * 检查类型: 1-点检 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 2
+    }
+  },
+  data () {
+    return {
+      status: null,
+      selectedRowKeys: [], // Check here to configure the default column
+      optionAlertShow: false,
+      confirmLoading: false,
+      mdl: {},
+      model: {
+        'id': null,
+        'modelId': null,
+        'no': null,
+        'zbh': null,
+        'name': null,
+        'nameModel': null,
+        'unit': null,
+        'level': null,
+        'useType': null
+      },
+      modalTitle: null,
+      visible: false,
+      typeMap: {},
+      standardLevelMap: {},
+      statusMap: {},
+      actionTypeMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          checked: true,
+          width: '100px',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '任务要求',
+          dataIndex: 'requirement',
+          checked: true,
+          width: '300px'
+        },
+        {
+          title: '负责人',
+          dataIndex: 'checkUserName',
+          checked: true,
+          width: '100px'
+        },
+        {
+          title: '设备',
+          dataIndex: 'sbName',
+          checked: true,
+          width: '100px'
+        },
+        {
+          title: '部位',
+          dataIndex: 'partName',
+          checked: true,
+          width: '100px'
+        },
+        {
+          title: '维护等级',
+          dataIndex: 'standardLevel',
+          width: '100px',
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.standardLevelMap, text)
+          }
+        },
+        {
+          title: '执行日期',
+          dataIndex: 'startTime',
+          checked: true,
+          width: '200px'
+        },
+        {
+          title: '截至日期',
+          dataIndex: 'endTime',
+          checked: true,
+          width: '200px'
+        },
+        {
+          title: '开始时间',
+          dataIndex: 'actualStartTime',
+          width: '200px'
+        },
+        {
+          title: '完成时间',
+          dataIndex: 'actualEndTime',
+          width: '200px'
+        },
+        {
+          title: '任务状态',
+          dataIndex: 'status',
+          checked: true,
+          width: '100px',
+          fixed: 'right',
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '250px',
+          align: 'center',
+          fixed: 'right',
+          scopedSlots: { customRender: 'action' },
+          checked: true
+        }
+      ],
+      data: []
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
+    this.standardLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      this.modalTitle = '保养记录'
+      queryCheckJob({ standardId: record.id, type: this.checkType, statusList: [this.DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE, this.DictCache.VALUE.CHECK_JOB_STATUS.EXECUTING, this.DictCache.VALUE.CHECK_JOB_STATUS.OUT_OF_DATE].join(',') }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleOk () {
+      queryCheckJob({ standardId: this.model.id, type: this.checkType, statusList: [this.DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE, this.DictCache.VALUE.CHECK_JOB_STATUS.EXECUTING, this.DictCache.VALUE.CHECK_JOB_STATUS.OUT_OF_DATE].join(',') }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleAdd () {
+      const modal = this.$refs.baseModal
+      modal.base(null, this.model.id)
+    },
+    handleView (record) {
+      fetchCheckJob({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        res.data.partName = record.partName
+        modal.base(res.data)
+      })
+    },
+    handleEdit (record) {
+      fetchCheckJob({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleGenerate (record) {
+      const modal = this.$refs.baseModalInsert
+      modal.base(null, record.id)
+    },
+    handleCancel () {
+      this.visible = false
+      this.selectedRowKeys = []
+      this.confirmLoading = false
+      this.$emit('ok')
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteCheckJobs(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+      })
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      parameter.modelId = this.model.id
+      exportCheckJob(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    onSelectChange (selectedRowKeys) {
+      this.selectedRowKeys = selectedRowKeys
+    },
+    handleExecuteBatch () {
+      let ids = []
+      const length = this.selectedRowKeys.length
+      if (length === 0) {
+        this.$message.info('请选择记录')
+        return
+      }
+      console.log(this.selectedRowKeys)
+      ids = this.selectedRowKeys
+      executeJobBatch(ids).then(res => {
+        this.$message.info('接收成功')
+        this.handleOk()
+      })
+    },
+    handleFinishBatch () {
+      let ids = []
+      const length = this.selectedRowKeys.length
+      if (length === 0) {
+        this.$message.info('请选择记录')
+        return
+      }
+      ids = this.selectedRowKeys
+      finishJobBatch(ids).then(res => {
+        this.$message.info('完成成功')
+        this.handleOk()
+      })
+    },
+    statusChange (value) {
+      queryCheckJob({ sbId: this.model.id, type: this.checkType, status: value }).then(res => {
+        this.data = res.data
+      })
+    },
+    levelChange (value) {
+      queryCheckJob({ sbId: this.model.id, type: this.checkType, level: value }).then(res => {
+        this.data = res.data
+      })
+    }
+  }
+}
+</script>

+ 116 - 102
src/views/check/checkstandard/CheckStandard.vue

@@ -1,111 +1,116 @@
 <template>
   <a-card :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline">
-        <a-row :gutter="48">
-          <a-col :md="6" :sm="24">
-            <a-form-item label="标准名称">
-              <a-input v-model="queryParam.keyword" placeholder="请输入标准名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="设备新号">
-              <a-input v-model="queryParam.sbNo" placeholder="请输入设备新号"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="24">
-            <a-form-item label="设备名称">
-              <a-input v-model="queryParam.sbName" placeholder="请输入设备名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6 || 24" :sm="24">
-            <span class="table-page-search-submitButtons">
-              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
-              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
-            </span>
-          </a-col>
-        </a-row>
-      </a-form>
-    </div>
+    <div v-show="visible">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="6" :sm="24">
+              <a-form-item label="标准名称">
+                <a-input v-model="queryParam.keyword" placeholder="请输入标准名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备新号">
+                <a-input v-model="queryParam.sbNo" placeholder="请输入设备新号"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6" :sm="24">
+              <a-form-item label="设备名称">
+                <a-input v-model="queryParam.sbName" placeholder="请输入设备名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="6 || 24" :sm="24">
+              <span class="table-page-search-submitButtons">
+                <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+                <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+              </span>
+            </a-col>
+          </a-row>
+        </a-form>
+      </div>
 
-    <div class="table-operator">
-      <a-button
-        v-if="($auth('check-spot-standards-add') || $auth('check-polling-standards-add'))"
-        type="primary"
-        icon="plus"
-        @click="$refs.baseModal.base()">新增
-      </a-button>
-      <a-button style="margin-left:8px;" type="primary" @click="doImport">
-        <a-icon type="upload"/>
-        新增导入
-      </a-button>
-      <a-button style="margin-left:8px;" type="primary" @click="doImportOldVersion">
-        <a-icon type="upload"/>
-        老版本导入
-      </a-button>
-      <a-button style="margin-left:8px;" type="primary" @click="doImportByUpdate">
-        <a-icon type="upload"/>
-        修改导入
-      </a-button>
-      <a-button
-        style="margin-left: 8px"
-        v-if="($auth('check-spot-standards-export')||$auth('check-polling-standards-export'))"
-        type="primary"
-        icon="download"
-        @click="doExport">导出
-      </a-button>
-<!--      <a-button :confirmLoading="confirmLoading" style="margin-left:8px;" type="primary" @click="doUpdateNo">
+      <div class="table-operator">
+        <a-button
+          v-if="($auth('check-spot-standards-add') || $auth('check-polling-standards-add'))"
+          type="primary"
+          icon="plus"
+          @click="$refs.baseModal.base()">新增
+        </a-button>
+        <a-button style="margin-left:8px;" type="primary" @click="doImport">
+          <a-icon type="upload"/>
+          新增导入
+        </a-button>
+        <a-button style="margin-left:8px;" type="primary" @click="doImportOldVersion">
+          <a-icon type="upload"/>
+          老版本导入
+        </a-button>
+        <a-button style="margin-left:8px;" type="primary" @click="doImportByUpdate">
+          <a-icon type="upload"/>
+          修改导入
+        </a-button>
+        <a-button
+          style="margin-left: 8px"
+          v-if="($auth('check-spot-standards-export')||$auth('check-polling-standards-export'))"
+          type="primary"
+          icon="download"
+          @click="doExport">导出
+        </a-button>
+        <!--      <a-button :confirmLoading="confirmLoading" style="margin-left:8px;" type="primary" @click="doUpdateNo">
         <a-icon type="upload"/>
         初始化编码
       </a-button>-->
-      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-standards-del')||$auth('check-polling-standards-del'))">
-        <a-menu slot="overlay">
-          <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
-            <a-menu-item key="1">
-              <a-icon type="delete"/>
-              <a>删除</a></a-menu-item>
-          </a-popconfirm>
-        </a-menu>
-        <a-button style="margin-left: 8px">
-          批量操作
-          <a-icon type="down"/>
-        </a-button>
-      </a-dropdown>
-    </div>
+        <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-standards-del')||$auth('check-polling-standards-del'))">
+          <a-menu slot="overlay">
+            <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
+              <a-menu-item key="1">
+                <a-icon type="delete"/>
+                <a>删除</a></a-menu-item>
+            </a-popconfirm>
+          </a-menu>
+          <a-button style="margin-left: 8px">
+            批量操作
+            <a-icon type="down"/>
+          </a-button>
+        </a-dropdown>
+      </div>
 
-    <s-table
-      ref="table"
-      size="default"
-      rowKey="id"
-      :columns="columns"
-      :scroll="{x: 1500, y: BaseTool.Constant.scrollY }"
-      :data="loadData"
-      :alert="options.alert"
-      :rowSelection="options.rowSelection"
-      showPagination="auto"
-    >
-      <span slot="enable" slot-scope="text">
-        <badge
-          :status="DictCache.COLOR.YES_NO[text]"
-          :text="enableMap[text]" />
-      </span>
-      <span slot="action" slot-scope="record">
-        <template>
-          <a @click="handleView(record)">查看</a>
-          <a-divider type="vertical"/>
-          <a v-if="($auth('check-spot-standards-edit')||$auth('check-polling-standards-edit'))" @click="handleEdit(record)">修改</a>
-          <a-divider type="vertical"/>
-          <a-popconfirm
-            v-if="($auth('check-spot-standards-del')||$auth('check-polling-standards-del'))"
-            title="是否要删除该条数据?"
-            @confirm="batchDelete(record.id)">
-            <a>删除</a>
-          </a-popconfirm>
-          <a-divider type="vertical" />
-          <a @click="handleCopy(record)">复制</a>
-        </template>
-      </span>
-    </s-table>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :scroll="{x: 1500, y: BaseTool.Constant.scrollY }"
+        :data="loadData"
+        :alert="options.alert"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+      >
+        <span slot="enable" slot-scope="text">
+          <badge
+            :status="DictCache.COLOR.YES_NO[text]"
+            :text="enableMap[text]" />
+        </span>
+        <span slot="action" slot-scope="record">
+          <template>
+            <a @click="handleView(record)">查看</a>
+            <a-divider type="vertical"/>
+            <a @click="handleViewCheckJob(record)">保养任务</a>
+            <a-divider type="vertical"/>
+            <a v-if="($auth('check-spot-standards-edit')||$auth('check-polling-standards-edit'))" @click="handleEdit(record)">修改</a>
+            <a-divider type="vertical"/>
+            <a-popconfirm
+              v-if="($auth('check-spot-standards-del')||$auth('check-polling-standards-del'))"
+              title="是否要删除该条数据?"
+              @confirm="batchDelete(record.id)">
+              <a>删除</a>
+            </a-popconfirm>
+            <a-divider type="vertical" />
+            <a @click="handleCopy(record)">复制</a>
+          </template>
+        </span>
+      </s-table>
+    </div>
+    <detail-standard-check-job ref="detailSbCheckJobModal" @ok="handleOk"/>
     <base-form ref="baseModal" :check-type="checkType" @ok="handleOk"/>
     <detail ref="detailModal"/>
     <import-form-add ref="importModal" @ok="handleOk"/>
@@ -124,6 +129,7 @@ import {
   fetchCheckStandard,
   exportCheckStandard
 } from '@/api/check/checkstandard'
+import DetailStandardCheckJob from '@/views/check/checkjob/modules/DetailStandardCheckJob'
 
 export default {
   name: 'CheckStandardList',
@@ -132,7 +138,8 @@ export default {
     Ellipsis,
     BaseForm,
     Detail,
-    ImportFormAdd
+    ImportFormAdd,
+    DetailStandardCheckJob
   },
   props: {
     /**
@@ -146,6 +153,7 @@ export default {
   data () {
     return {
       // 查询参数
+      visible: true,
       confirmLoading: false,
       queryParam: {
         type: this.checkType
@@ -357,6 +365,11 @@ export default {
         modal.base(res.data)
       })
     },
+    handleViewCheckJob (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbCheckJobModal
+      modal.base(record)
+    },
     handleCopy (record) {
       fetchCheckStandard({ id: record.id }).then(res => {
         const modal = this.$refs.baseModal
@@ -365,6 +378,7 @@ export default {
       })
     },
     handleOk () {
+      this.visible = true
       this.$refs.table.refresh()
     },
     onSelectChange (selectedRowKeys, selectedRows) {

+ 16 - 32
src/views/check/checkstandard/modules/BaseForm.vue

@@ -64,16 +64,16 @@
         </row-item>
         <row-item>
           <a-form-item
-            label="执行人方式"
+            label="维护等级"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-select
-              @change="changeCheckUserType"
-              v-decorator="['checkUserType', {initialValue: 1,rules: [{required: true, message: '执行人方式不能为空'}]}]"
+              @change="changeLevel"
+              v-decorator="['level', {rules: [{required: true, message: '维护等级不能为空'}]}]"
               placeholder="请选择">
               <a-select-option
-                v-for="(label,value) in checkUserTypeMap"
+                v-for="(label,value) in levelMap"
                 :key="value"
                 :label="label"
                 :value="parseInt(value)">{{ label }}
@@ -81,33 +81,18 @@
             </a-select>
           </a-form-item>
         </row-item>
-<!--        <row-item v-show="checkUserType === 3">
-          <a-form-item
-            label="指定执行人"
-            :labelCol="BaseTool.Constant.labelCol"
-            :wrapperCol="BaseTool.Constant.wrapperCol"
-          >
-            <a-select v-decorator="['checkUserId']" placeholder="请选择">
-              <a-select-option
-                v-for="({userId, realName}) in userList"
-                :key="userId"
-                :label="realName"
-                :value="userId">{{ realName }}
-              </a-select-option>
-            </a-select>
-          </a-form-item>
-        </row-item>-->
         <row-item>
           <a-form-item
-            label="维护等级"
+            label="执行人方式"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-select
-              v-decorator="['level', {rules: [{required: true, message: '维护等级不能为空'}]}]"
+              disabled
+              v-decorator="['checkUserType', {rules: [{required: true, message: '执行人方式不能为空'}]}]"
               placeholder="请选择">
               <a-select-option
-                v-for="(label,value) in levelMap"
+                v-for="(label,value) in checkUserTypeMap"
                 :key="value"
                 :label="label"
                 :value="parseInt(value)">{{ label }}
@@ -126,13 +111,13 @@
               <a-input-number
                 style="width: 100%"
                 :min="1"
-                v-decorator="['period', {initialValue: 1,rules: [{required: true, message: '计划周期不能为空'}]}]"/>
+                v-decorator="['period', {rules: [{required: true, message: '计划周期不能为空'}]}]"/>
             </a-form-item>
             <a-form-item
               :style="{ display: 'inline-block', width: '30%' }"
             >
               <a-select
-                v-decorator="['periodType', {initialValue: 1,rules: [{required: true, message: '周期类型不能为空'}]}]"
+                v-decorator="['periodType', {rules: [{required: true, message: '周期类型不能为空'}]}]"
                 placeholder="请选择">
                 <a-select-option
                   v-for="(label,value) in periodTypeMap"
@@ -152,7 +137,7 @@
           >
             <a-input
               v-decorator="['standardHours']"
-              suffix="分钟"/>
+              suffix="小时"/>
           </a-form-item>
         </row-item>
         <!--        <row-item>
@@ -385,7 +370,7 @@ export default {
       visible: false,
       sbId: null,
       levelMap: {},
-      checkUserType: null,
+      level: null,
       // 下拉框map
       typeMap: {},
       actionTypeMap: {},
@@ -478,7 +463,6 @@ export default {
         this.modalTitle = '添加'
         this.data = []
         this.cacheData = []
-        this.checkUserType = 1
         if (sbId != null) {
           this.sbId = sbId
           const { form: { setFieldsValue } } = this
@@ -494,7 +478,7 @@ export default {
         this.modalTitle = '复制'
       }
       this.sbId = record.sbId
-      this.checkUserType = record.checkUserType
+      this.level = record.level
       // 查询列表
       fetchCheckStandard({ id: record.id }).then(res => {
         this.data = res.data.detailList
@@ -690,12 +674,12 @@ export default {
       const data = [...this.data]
       this.data = data.filter(item => record.bomId !== item.bomId)
     },
-    changeCheckUserType (value) {
-      this.checkUserType = value
+    changeLevel (value) {
+      this.level = value
       const { form: { setFieldsValue } } = this
       // 日期处理
       this.$nextTick(() => {
-        setFieldsValue({ level: value })
+        setFieldsValue({ checkUserType: value })
       })
     },
     onQuantityChange (e, id, attr) {

+ 27 - 1
src/views/dashboard/CheckJobReport.vue

@@ -14,6 +14,14 @@
                 :value="item.value">{{ item.label }}
               </a-select-option>
             </a-select>
+            <a-select style="margin-left: 8px" @change="changeLevel" v-model="queryParam.standardLevel" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in levelMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
           </div>
           <a-tab-pane loading="true" tab="图形统计" key="1">
             <a-row>
@@ -63,9 +71,11 @@ export default {
       loading: false,
       serverData: [],
       queryParam: {
-        year: 2021
+        year: 2021,
+        standardLevel: 2
       },
       years: [],
+      levelMap: {},
       visible: true,
       chart: null, // 创建一个chart变量
       chartsData: [],
@@ -100,6 +110,7 @@ export default {
     }
   },
   created () {
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
     this.initSelectYear()
   },
   mounted () {
@@ -129,6 +140,21 @@ export default {
           this.getCharts('container', groupData)// 调用统计图
         })
     },
+    changeLevel (value) {
+      this.queryParam.standardLevel = value
+      getMonthReport(this.queryParam)
+        .then(res => {
+          this.chartsData = res.data
+
+          // 需要将数据分组:总数,完成数
+          const groupData = []
+          this.chartsData.forEach(function (data) {
+            groupData.push({ name: '总数', month: data.month, num: data.totalNum })
+            groupData.push({ name: '完成数', month: data.month, num: data.totalFinishNum })
+          })
+          this.getCharts('container', groupData)// 调用统计图
+        })
+    },
     getCharts (id, data) {
       this.chart && this.chart.destroy()// 防止点击搜索按钮新增一个
       this.chart = new Chart({

+ 20 - 1
src/views/dashboard/CheckJobReportWeek.vue

@@ -14,6 +14,14 @@
                 :value="item.value">{{ item.label }}
               </a-select-option>
             </a-select>
+            <a-select style="margin-left: 8px" @change="changeLevel" v-model="queryParam.standardLevel" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in levelMap"
+                :key="value"
+                :label="label"
+                :value="parseInt(value)">{{ label }}
+              </a-select-option>
+            </a-select>
           </div>
           <a-tab-pane loading="true" tab="图形统计" key="1">
             <a-row>
@@ -63,9 +71,11 @@ export default {
       loading: false,
       serverData: [],
       queryParam: {
-        year: 2021
+        year: 2021,
+        standardLevel: 2
       },
       years: [],
+      levelMap: {},
       visible: true,
       chart: null, // 创建一个chart变量
       chartsData: [],
@@ -85,6 +95,7 @@ export default {
     }
   },
   created () {
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_LEVEL)
     this.initSelectYear()
   },
   mounted () {
@@ -114,6 +125,14 @@ export default {
           this.getCharts('container', this.chartsData)// 调用统计图
         })
     },
+    changeLevel (value) {
+      this.queryParam.standardLevel = value
+      getWeekReport(this.queryParam)
+        .then(res => {
+          this.chartsData = res.data
+          this.getCharts('container', this.chartsData)// 调用统计图
+        })
+    },
     getCharts (id, data) {
       this.chart && this.chart.destroy()// 防止点击搜索按钮新增一个
       this.chart = new Chart({

+ 2 - 1
src/views/repair/application-form/RepairApplicationForm.vue

@@ -284,6 +284,7 @@ export default {
       levelMap: {},
       statusMap: {},
       needStopMap: {},
+      planFlagMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
@@ -319,7 +320,7 @@ export default {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     // 获取浏览器的请求参数:报修单编号:no
     const no = this.$route.query.no
     if (no != null) {

+ 2 - 0
src/views/repair/application-form/RepairCheckForm.vue

@@ -262,6 +262,7 @@ export default {
       levelMap: {},
       statusMap: {},
       needStopMap: {},
+      planFlagMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
@@ -296,6 +297,7 @@ export default {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     // 获取浏览器的请求参数:报修单编号:no
     const no = this.$route.query.no
     if (no != null) {

+ 2 - 1
src/views/repair/application-form/RepairForm.vue

@@ -295,6 +295,7 @@ export default {
       levelMap: {},
       statusMap: {},
       needStopMap: {},
+      planFlagMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
@@ -330,7 +331,7 @@ export default {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     // 获取浏览器的请求参数:报修单编号:no
     const no = this.$route.query.no
     if (no != null) {

+ 2 - 1
src/views/repair/application-form/RepairOut.vue

@@ -190,6 +190,7 @@ export default {
       levelMap: {},
       statusMap: {},
       needStopMap: {},
+      needStopMap: {},
       // 加载数据方法 必须为 Promise 对象
       loadData: parameter => {
         parameter = {
@@ -225,7 +226,7 @@ export default {
     this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     this.tableOption()
   },
   methods: {

+ 19 - 13
src/views/repair/application-form/modules/BaseForm.vue

@@ -40,11 +40,11 @@
         </row-item>
         <row-item>
           <a-form-item
-            label="是否计划性维修"
+            label="维修类别"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select @change="changePlanFlag" v-decorator="['planFlag', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
+            <a-select @change="changePlanFlag" v-decorator="['category', {rules: [{required: true, message: '计划性维修不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in planFlagMap"
                 :key="value"
@@ -60,7 +60,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select @change="changeNeedStop" v-decorator="['needStop', {rules: [{required: true, message: '是否停机不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['needStop', {rules: [{required: true, message: '是否停机不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in needStopMap"
                 :key="value"
@@ -70,7 +70,7 @@
             </a-select>
           </a-form-item>
         </row-item>
-        <row-item v-show="planFlag === 0">
+        <row-item v-show="category === 1">
           <a-form-item
             label="要求日期"
             :labelCol="BaseTool.Constant.labelCol"
@@ -82,7 +82,7 @@
               v-decorator="['limitDate']" />
           </a-form-item>
         </row-item>
-        <row-item>
+        <row-item v-show="category === 2">
           <a-form-item
             label="要求时间"
             :labelCol="BaseTool.Constant.labelCol"
@@ -268,7 +268,7 @@ export default {
       treeData: [],
       needStop: null,
       needStopMap: {},
-      planFlag: 0,
+      category: 0,
       planFlagMap: {},
       statusMap: {},
       userInfo: this.$store.getters.userInfo,
@@ -298,7 +298,7 @@ export default {
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
     this.questionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     this.getUsers()
   },
   methods: {
@@ -369,7 +369,7 @@ export default {
           'status',
           'sbName',
           'needStop',
-          'planFlag',
+          'category',
           'partName',
           'remark'
         ])))
@@ -413,7 +413,17 @@ export default {
       })
     },
     changePlanFlag (value) {
-      this.planFlag = value
+      this.category = value
+      const { form: { setFieldsValue } } = this
+      if (this.category === 1) {
+        this.$nextTick(() => {
+          setFieldsValue({ needStop: 1 })
+        })
+      } else {
+        this.$nextTick(() => {
+          setFieldsValue({ needStop: 0 })
+        })
+      }
     },
     handleCancel (values) {
       this.visible = false
@@ -469,11 +479,7 @@ export default {
         this.$message.error('上传失败')
         return []
       }
-    },
-    changeNeedStop (value) {
-      this.needStop = value
     }
-
   }
 }
 </script>

+ 3 - 3
src/views/repair/application-form/modules/Detail.vue

@@ -18,7 +18,7 @@
             <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
             <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
             <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
-            <detail-list-item term="计划性维修">{{ BaseTool.Object.getField(planFlagMap,model.planFlag) }}</detail-list-item>
+            <detail-list-item term="计划性维修">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</detail-list-item>
             <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
 
             <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
@@ -338,7 +338,7 @@ export default {
         'partId': null,
         'repairUserId': null,
         'needStop': null,
-        'planFlag': null,
+        'category': null,
         'no': null,
         'source': null,
         'applyTime': null,
@@ -368,7 +368,7 @@ export default {
     this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
     this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
     this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
-    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
     this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
     this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
     this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)

+ 3 - 2
src/views/repair/application-form/modules/DetailCheck.vue

@@ -24,7 +24,7 @@
             <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
             <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
             <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
-            <detail-list-item term="计划性维修">{{ BaseTool.Object.getField(planFlagMap,model.planFlag) }}</detail-list-item>
+            <detail-list-item term="计划性维修">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</detail-list-item>
             <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
             <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
             <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
@@ -374,7 +374,7 @@ export default {
         'partId': null,
         'repairUserId': null,
         'needStop': null,
-        'planFlag': null,
+        'category': null,
         'no': null,
         'source': null,
         'applyTime': null,
@@ -409,6 +409,7 @@ export default {
     this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
     this.typeReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
   },
   methods: {
     base (record) {

+ 3 - 2
src/views/repair/application-form/modules/DetailRepair.vue

@@ -30,7 +30,7 @@
             <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
             <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
             <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
-            <detail-list-item term="计划性维修">{{ BaseTool.Object.getField(planFlagMap,model.planFlag) }}</detail-list-item>
+            <detail-list-item term="计划性维修">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</detail-list-item>
             <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
             <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
             <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
@@ -447,7 +447,7 @@ export default {
         'partId': null,
         'repairUserId': null,
         'needStop': null,
-        'planFlag': null,
+        'category': null,
         'no': null,
         'source': null,
         'applyTime': null,
@@ -482,6 +482,7 @@ export default {
     this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
     this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
     this.typeReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
+    this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
   },
   methods: {
     base (record) {

+ 1 - 2
src/views/sb/info/modules/Detail.vue

@@ -175,7 +175,6 @@ import RepairApplicationFormTable from '@/views/repair/application-form/modules/
 import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
 import SbStatusLogTable from '@/views/sb/status-log/modules/SbStatusLogTable'
 import SbStopLogTable from '@/views/sb/stop-logs/modules/SbStopLogTable'
-// import CheckJobTableWaitDo from '@/views/check/checkjob/modules/CheckJobTableWaitDo'
 import { fetchFirmProducer } from '@/api/firm/producer'
 import { queryNumCheckStandard } from '@/api/check/checkstandard'
 import { queryNumCheckjob, queryTuiCalendarIgnores } from '@/api/check/checkjob'
@@ -393,7 +392,7 @@ export default {
         queryNumPartInfo({ sbId: this.model.id }),
         queryNumModelbom({ sbId: this.model.id }),
         queryNumCheckStandard({ sbId: this.model.id }),
-        queryNumCheckjob({ sbId: this.model.id, status: this.DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE }),
+        queryNumCheckjob({ sbId: this.model.id }),
         queryNumRepairReason({ sbId: this.model.id })
       ])
         .then((values) => {