Forráskód Böngészése

Merge remote-tracking branch 'origin/master'

chenyuehu 3 éve
szülő
commit
dbd34e1e40
30 módosított fájl, 5839 hozzáadás és 414 törlés
  1. 1 1
      public/big-screen/big.html
  2. 16 0
      src/api/sb/info.js
  3. 190 0
      src/api/sb/measurelog.js
  4. 14 0
      src/api/store/instoreform.js
  5. 14 0
      src/api/store/outstoreform.js
  6. 6 1
      src/router/generator-platform-routers.js
  7. 1 1
      src/views/Login.vue
  8. 104 99
      src/views/check/checkjob/CheckJob.vue
  9. 255 0
      src/views/check/checkjob/CheckJobCalendar.vue
  10. 81 23
      src/views/check/checkjob/modules/Detail.vue
  11. 1 1
      src/views/check/checkstandard/modules/BaseForm.vue
  12. 1 1
      src/views/check/checkstandard/modules/Detail.vue
  13. 22 22
      src/views/repair/application-form/modules/DetailRepair.vue
  14. 34 151
      src/views/sb/info/MeasureSbInfo.vue
  15. 442 0
      src/views/sb/info/MeasureSbInfoWarn.vue
  16. 40 54
      src/views/sb/info/SbInfo.vue
  17. 513 0
      src/views/sb/info/SpecialSbInfo.vue
  18. 339 32
      src/views/sb/info/modules/BaseForm.vue
  19. 937 0
      src/views/sb/info/modules/BaseFormMeasureRelation.vue
  20. 73 26
      src/views/sb/info/modules/Detail.vue
  21. 362 0
      src/views/sb/info/modules/DetailBak.vue
  22. 369 0
      src/views/sb/info/modules/DetailMeasureRelation.vue
  23. 316 0
      src/views/sb/measurelog/MeasureLog.vue
  24. 637 0
      src/views/sb/measurelog/modules/BaseForm.vue
  25. 336 0
      src/views/sb/measurelog/modules/BaseFormInsert.vue
  26. 318 0
      src/views/sb/measurelog/modules/CheckStandardSelectModal.vue
  27. 163 0
      src/views/sb/measurelog/modules/Detail.vue
  28. 238 0
      src/views/sb/measurelog/modules/DetailSbCheck.vue
  29. 11 1
      src/views/store/instoreform/InStoreForm.vue
  30. 5 1
      src/views/store/outstoreform/OutStoreForm.vue

+ 1 - 1
public/big-screen/big.html

@@ -4,7 +4,7 @@
 	<head>
 		<meta charset="utf-8" />
 		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
-		<title>西安建工资管集团大数据综合展示</title>
+		<title>大数据综合展示</title>
 		<link rel="stylesheet" type="text/css" href="static/big/css/app.css" />
     <link rel="stylesheet" type="text/css" href="static/big/css/power-float/common.css" />
     <link rel="stylesheet" type="text/css" href="static/big/css/power-float/powerFloat.css" />

+ 16 - 0
src/api/sb/info.js

@@ -17,6 +17,22 @@ export function getSbInfoPage (parameter) {
   })
 }
 
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getMeasureWarn (parameter) {
+  return axios({
+    url: '/sb/infos/warn/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * page func
  * parameter: { }

+ 190 - 0
src/api/sb/measurelog.js

@@ -0,0 +1,190 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getCheckStandardPage (parameter) {
+  return axios({
+    url: '/sb/measure-logs/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function copy (parameter) {
+  return axios({
+    url: '/sb/measure-logs/copy',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function generateJobByCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs/generate',
+    method: 'PUT',
+    data: parameter,
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryNumCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs/num?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * fetch list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchCheckStandardListByProjectId (parameter) {
+  return axios({
+    url: '/sb/measure-logs/project' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * delete batch func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteCheckStandards (parameter) {
+  return axios({
+    url: '/sb/measure-logs',
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * delete single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+  * @returns {*}
+ */
+export function exportCheckStandard (parameter) {
+  return axios({
+    url: '/sb/measure-logs/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}

+ 14 - 0
src/api/store/instoreform.js

@@ -15,6 +15,20 @@ export function updateStore (parameter) {
   })
 }
 
+/**
+ * 更新库存
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateStoreBack (parameter) {
+  return axios({
+    url: '/store/in-store-forms/in/back/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * page func
  * parameter: { }

+ 14 - 0
src/api/store/outstoreform.js

@@ -63,6 +63,20 @@ export function updateStore (parameter) {
   })
 }
 
+/**
+ * 更新库存
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateStoreBack (parameter) {
+  return axios({
+    url: '/store/out-store-forms/out/back/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }

+ 6 - 1
src/router/generator-platform-routers.js

@@ -76,6 +76,10 @@ const constantRouterComponents = {
   'SbInfo': () => import('@/views/sb/info/SbInfo'),
   // 测量设备基础信息
   'MeasureSbInfo': () => import('@/views/sb/info/MeasureSbInfo'),
+  // 测量设备预警台账
+  'MeasureSbInfoWarn': () => import('@/views/sb/info/MeasureSbInfoWarn'),
+  // 特种设备基础信息
+  'SpecialSbInfo': () => import('@/views/sb/info/SpecialSbInfo'),
   // 父子设备树
   'ParentSbInfo': () => import('@/views/sb/info/ParentSbInfo'),
   // 设别型号库
@@ -281,7 +285,8 @@ const constantRouterComponents = {
   // 设备盘点
   'SbStoreCheckPlan': () => import('@/views/sb/storecheckplan/StoreCheckPlan'),
   'SbStoreCheckJob': () => import('@/views/sb/storecheckjob/StoreCheckJob'),
-
+  // 保养任务日程表
+  'CheckJobCalendar': () => import('@/views/check/checkjob/CheckJobCalendar')
 }
 
 // 前端未找到页面路由(固定不用改)

+ 1 - 1
src/views/Login.vue

@@ -2,7 +2,7 @@
   <div>
     <div class="fh-login">
       <div class="fh-login-left">
-        <h2 style='padding-bottom: 0px'>CNTHB HITCH ABB</h2>
+        <h2 style='padding-bottom: 0px'>CNTHB</h2>
         <h2 style='font-size:30px'>设备管理系统</h2>
       </div>
       <div class="fh-login-right">

+ 104 - 99
src/views/check/checkjob/CheckJob.vue

@@ -1,97 +1,99 @@
 <template>
   <a-card :bordered="false">
-    <div class="table-page-search-wrapper">
-      <a-form layout="inline">
-        <a-row :gutter="48">
-          <a-col :md="8" :sm="24">
-            <a-form-item label="计划名称">
-              <a-input v-model="queryParam.planName" placeholder="请输入计划名称"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="8" :sm="24">
-            <a-form-item label="负责人">
-              <a-input v-model="queryParam.keyword" placeholder="请输入负责人"/>
-            </a-form-item>
-          </a-col>
-          <a-col :md="8" :sm="24">
-            <a-form-item label="任务状态">
-              <a-select
-                v-model="queryParam.status"
-                placeholder="请选择">
-                <a-select-option
-                  v-for="(label,value) in statusMap"
-                  :key="value"
-                  :label="label"
-                  :value="parseInt(value)">{{ label }}
-                </a-select-option>
-              </a-select>
-            </a-form-item>
-          </a-col>
-          <a-col :md="8 || 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="8" :sm="24">
+              <a-form-item label="计划名称">
+                <a-input v-model="queryParam.planName" placeholder="请输入计划名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="负责人">
+                <a-input v-model="queryParam.keyword" placeholder="请输入负责人"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8" :sm="24">
+              <a-form-item label="任务状态">
+                <a-select
+                  v-model="queryParam.status"
+                  placeholder="请选择">
+                  <a-select-option
+                    v-for="(label,value) in statusMap"
+                    :key="value"
+                    :label="label"
+                    :value="parseInt(value)">{{ label }}
+                  </a-select-option>
+                </a-select>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8 || 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-jobs-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
-      <a-button style="margin-left: 8px" v-if="($auth('check-spot-jobs-export') || $auth('check-polling-jobs-export'))" type="primary" icon="download" @click="doExport">导出</a-button>
-      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-jobs-finish') || $auth('check-polling-jobs-finish'))">
-        <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>-->
+      <!-- <div class="table-operator">
+             <a-button v-if="$auth('check-jobs-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+        <a-button style="margin-left: 8px" v-if="($auth('check-spot-jobs-export') || $auth('check-polling-jobs-export'))" type="primary" icon="download" @click="doExport">导出</a-button>
+        <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-jobs-finish') || $auth('check-polling-jobs-finish'))">
+          <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"
-      :data="loadData"
-      :alert="options.alert"
-      :rowSelection="options.rowSelection"
-      showPagination="auto"
-    >
-      <span slot="action" slot-scope="record">
-        <template>
-          <a @click="handleView(record)">查看</a>
-          <template v-if="record.status === DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
-            <a-divider  type="vertical" />
-            <a  @click="handleFinish(record)">完成</a>
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+      >
+        <span slot="action" slot-scope="record">
+          <template>
+            <a @click="handleView(record)">查看</a>
+            <template v-if="record.status === DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
+              <a-divider  type="vertical" />
+              <a  @click="handleFinish(record)">完成</a>
+            </template>
+            <template v-if="record.status != DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
+               <a-divider  type="vertical" />
+               <a  @click="handleEdit(record)">修改</a>
+             </template>
+            <!--          <a-divider type="vertical" />-->
+            <!--          <a-popconfirm v-if="$auth('check-jobs-del')" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">-->
+            <!--            <a>删除</a>-->
+            <!--          </a-popconfirm>-->
           </template>
-          <template v-if="record.status != DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE">
-             <a-divider  type="vertical" />
-             <a  @click="handleEdit(record)">修改</a>
-           </template>
-          <!--          <a-divider type="vertical" />-->
-          <!--          <a-popconfirm v-if="$auth('check-jobs-del')" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">-->
-          <!--            <a>删除</a>-->
-          <!--          </a-popconfirm>-->
-        </template>
-      </span>
-      <span slot="status" slot-scope="text">
-        <badge
-          :status="DictCache.COLOR.JOB_STATUS[text]"
-          :text="statusMap[text]" />
-      </span>
-      <span slot="stopFlag" slot-scope="text">
-        <badge
-          :status="DictCache.COLOR.YES_NO[text]"
-          :text="sbStatusMap[text]" />
-      </span>
-    </s-table>
+        </span>
+        <span slot="status" slot-scope="text">
+          <badge
+            :status="DictCache.COLOR.JOB_STATUS[text]"
+            :text="statusMap[text]" />
+        </span>
+        <span slot="stopFlag" slot-scope="text">
+          <badge
+            :status="DictCache.COLOR.YES_NO[text]"
+            :text="sbStatusMap[text]" />
+        </span>
+      </s-table>
+    </div>
     <base-form :check-type="checkType" ref="baseModal" @ok="handleOk"/>
-    <detail :check-type="checkType" ref="detailModal"/>
+    <detail :check-type="checkType" ref="detailModal"  @ok="handleOk"/>
   </a-card>
 </template>
 
@@ -125,7 +127,7 @@ export default {
   data () {
     this.names = ['负责', '巡检']
     return {
-
+      visible: true,
       // 查询参数
       queryParam: {
         type: this.checkType,
@@ -141,6 +143,11 @@ export default {
           },
           checked: true
         },
+        {
+          title: '设备',
+          dataIndex: 'sbName',
+          checked: true
+        },
         //{
          // title: '计划单号',
          // dataIndex: 'planNo',
@@ -151,21 +158,17 @@ export default {
           dataIndex: 'name',
           checked: true
         },
-        {
+/*        {
           title: '计划名称',
           dataIndex: 'planName',
           checked: true
-        },
+        },*/
         {
           title: '负责人',
           dataIndex: 'checkUserName',
           checked: true
         },
-        {
-          title: '设备',
-          dataIndex: 'sbName',
-          checked: true
-        },
+
         //{
          // title: '负责部件',
          // dataIndex: 'partName',
@@ -176,11 +179,11 @@ export default {
           dataIndex: 'startTime',
           checked: true
         },
-        {
+/*        {
           title: '截至日期',
           dataIndex: 'endTime',
           checked: true
-        },
+        },*/
         {
           title: '标准工时',
           dataIndex: 'standardHours'
@@ -237,7 +240,7 @@ export default {
           ...this.queryParam,
           dataScope: {
             sortBy: 'desc',
-            sortName: 'update_time'
+            sortName: 'start_time'
           }
         }
         return getCheckJobPage(Object.assign(parameter, this.queryParam))
@@ -325,12 +328,14 @@ export default {
       })
     },
     handleView (record) {
+      this.visible = false
       fetchCheckJob({ id: record.id }).then(res => {
         const modal = this.$refs.detailModal
         modal.base(res.data)
       })
     },
     handleOk () {
+      this.visible = true
       this.$refs.table.refresh()
     },
     onSelectChange (selectedRowKeys, selectedRows) {

+ 255 - 0
src/views/check/checkjob/CheckJobCalendar.vue

@@ -0,0 +1,255 @@
+<template>
+  <a-calendar class="custom" @select="onSelect" @panelChange="onPanelChange">
+    <ul slot="dateCellRender" slot-scope="value" class="events">
+      <li v-for="item in getListData(value)" :key="item.id">
+        <a-badge :status="item.status" :text="item.name" />
+      </li>
+    </ul>
+    <template slot="monthCellRender" slot-scope="value">
+      <div v-if="getMonthData(value)" class="notes-month">
+        <section>{{ getMonthData(value) }}</section>
+        <span>Backlog number</span>
+      </div>
+    </template>
+  </a-calendar>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import { queryCheckJob, getCheckJobPage, deleteCheckJobs, fetchCheckJob, exportCheckJob, executeJob } from '@/api/check/checkjob'
+import BaseTool from '@/utils/tool'
+
+export default {
+  name: 'CheckJobList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  props: {
+    /**
+     * 检查类型: 1-负责 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 2
+    },
+    filter: {
+      type: Number,
+      default: -1
+    }
+  },
+  data () {
+    return {
+      panelChange: true,
+      // 查询参数
+      queryParam: {
+        type: this.checkType,
+        filter: this.filter
+      },
+      data: [],
+      // 下拉框map
+      statusMap: {},
+      sbStatusMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getCheckJobPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+      preListData: [],
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
+    this.sbStatusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.tableOption()
+  },
+  methods: {
+    onSelect (value) {
+      this.panelChange = false
+      console.log('onSelect: ' + BaseTool.Date.formatter(value, BaseTool.Date.PICKER_NORM_DATE_PATTERN))
+      this.value = value
+      this.selectedValue = value
+      // this.queryParam.searchDay = BaseTool.Date.formatter(value, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+    },
+    onPanelChange (value) {
+      this.panelChange = true
+      console.log('onPanelChange: ' + BaseTool.Date.formatter(value, BaseTool.Date.PICKER_NORM_DATE_PATTERN))
+      this.value = value
+      this.queryParam.searchMonth = BaseTool.Date.formatter(value, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      queryCheckJob(this.queryParam)
+        .then(res => {
+          this.data = res.data
+          for (var i = 0; i < this.data.length; i++) {
+            if (this.data[i].status === 1) {
+              this.data[i].status = 'warning'
+            } else if (this.data[i].status === 2) {
+              this.data[i].status = 'processing'
+            } else if (this.data[i].status === 3) {
+              this.data[i].status = 'success'
+            } else {
+              this.data[i].status = 'error'
+            }
+          }
+        })
+    },
+    getListData (value) {
+      console.log('getListData: ' + BaseTool.Date.formatter(value, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN))
+      const listData = []
+      for (var i = 0; i < this.data.length; i++) {
+        console.log('value: ' + BaseTool.Date.formatter(value, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN))
+        console.log('this.data[i]: ' + BaseTool.Date.formatter(this.data[i].startTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN))
+        if (BaseTool.Date.formatter(value, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) === BaseTool.Date.formatter(this.data[i].startTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)) {
+          console.log('this.data[i].name: ' + this.data[i].name)
+          listData.push(this.data[i])
+        }
+      }
+      this.preListData = listData
+      return listData || []
+    },
+    getMonthData (value) {
+      if (value.month() === 8) {
+        return 1394
+      }
+    },
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        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()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchCheckJob({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleFinish (record) {
+      fetchCheckJob({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleExecute (record) {
+      executeJob({ id: record.id }).then(res => {
+        this.handleOk()
+      })
+    },
+    handleView (record) {
+      fetchCheckJob({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportCheckJob(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    }
+  }
+}
+</script>
+<style scoped>
+.events {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+}
+.events .ant-badge-status {
+  overflow: hidden;
+  white-space: nowrap;
+  width: 100%;
+  text-overflow: ellipsis;
+  font-size: 12px;
+}
+.notes-month {
+  text-align: center;
+  font-size: 28px;
+}
+.notes-month section {
+  font-size: 28px;
+}
+.ant-fullcalendar-header .ant-radio-group-default {
+  display:none !important
+}
+
+.custom .ant-fullcalendar-header .ant-radio-group-default {
+  display:none !important
+}
+</style>

+ 81 - 23
src/views/check/checkjob/modules/Detail.vue

@@ -1,19 +1,49 @@
 <template>
-  <a-modal
-    :title="modalTitle"
-    :width="850"
-    :visible="visible"
-    :confirmLoading="confirmLoading"
-    class="ant-modal2"
-    @cancel="handleCancel"
-  >
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <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: 16px"  v-if="model.status === DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE" type="default" @click="handleExecute()">接收</a-button>
+            <a-button style="margin-left: 16px"  v-if="model.status === DictCache.VALUE.CHECK_JOB_STATUS.EXECUTING" type="default" @click="handleFinish()">完成</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
+          </span>
+      </a-col>
+    </a-row>
+    <title-divider title="标准信息" width="90px"></title-divider>
     <detail-list title="" :col="2">
-      <detail-list-item term="任务名称">{{ model.name }}</detail-list-item>
-      <detail-list-item term="计划名称">{{ model.planName }}</detail-list-item>
-      <detail-list-item :term="names[checkType-1]+'设备'">{{ model.sbName }}</detail-list-item>
-      <!--<detail-list-item :term="names[checkType-1]+'部件'">{{ model.partName }}</detail-list-item>
-      <detail-list-item term="部件编号">{{ model.partNo}}</detail-list-item>-->
-      <detail-list-item term="标准工时">{{ model.standardHours }}</detail-list-item>
+      <detail-list-item term="标准名称">{{ modelStandard.name }}</detail-list-item>
+      <detail-list-item term="编码">{{ modelStandard.no }}</detail-list-item>
+      <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,modelStandard.type) }}</detail-list-item>
+      <detail-list-item term="计划周期">{{ modelStandard.period }}{{ BaseTool.Object.getField(periodTypeMap,modelStandard.periodType) }}</detail-list-item>
+      <detail-list-item term="标准工时">{{ modelStandard.standardHours }}</detail-list-item>
+      <detail-list-item term="动作类型">{{ BaseTool.Object.getField(actionTypeMap,modelStandard.actionType) }}</detail-list-item>
+      <detail-list-item term="部位">{{ modelStandard.partName }}</detail-list-item>
+      <!--      <detail-list-item term="更新人">{{ model.updateUserName }}</detail-list-item>
+            <detail-list-item term="创建时间">{{ model.updateTime }}</detail-list-item>
+            <detail-list-item term="更新时间">{{ model.updateTime }}</detail-list-item>-->
+    </detail-list>
+    <detail-list title="" :col="1">
+      <detail-list-item term="要求">{{ modelStandard.requirement }}</detail-list-item>
+      <detail-list-item term="备注">{{ modelStandard.remark }}</detail-list-item>
+    </detail-list>
+    <title-divider title="标准图片" width="90px"></title-divider>
+    <detail-list title="" :col="6">
+      <detail-list-item v-for="item in modelStandard.checkImgList" term="">
+        <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
+      </detail-list-item>
+    </detail-list>
+    <title-divider title="标准文件" width="90px"></title-divider>
+    <detail-list title="" :col="8">
+      <detail-list-item term="">
+        <a-upload
+          :multiple="true"
+          :fileList="BaseTool.UPLOAD.transImg(modelStandard.checkFileList)"
+        >
+        </a-upload>
+      </detail-list-item>
+    </detail-list>
+    <title-divider title="任务信息" width="90px"></title-divider>
+    <detail-list title="" :col="3">
       <detail-list-item term="实际工时">{{ model.realHours }}</detail-list-item>
       <detail-list-item term="执行日期">{{ model.startTime }}</detail-list-item>
       <detail-list-item term="截至日期">{{ model.endTime }}</detail-list-item>
@@ -23,26 +53,25 @@
       <detail-list-item term="任务状态"><badge :status="DictCache.COLOR.CHECK_JOB_STATUS[model.status]" :text="statusMap[model.status]" /></detail-list-item>
     </detail-list>
     <detail-list title="" :col="1">
-      <detail-list-item :term="names[checkType-1]+'要求'">{{ model.requirement }}</detail-list-item>
-      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
       <detail-list-item term="检查结果">{{ model.feedback }}</detail-list-item>
     </detail-list>
-
-    <template slot="footer">
-      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
-    </template>
-  </a-modal>
+    <base-form :check-type="checkType" ref="baseModal" @ok="handleOk"/>
+  </a-card>
 </template>
 
 <script>
 import DetailList from '@/components/tools/DetailList'
+import { fetchCheckStandard } from '@/api/check/checkstandard'
+import { executeJob, fetchCheckJob } from '@/api/check/checkjob'
+import BaseForm from '@/views/check/checkjob/modules/BaseForm'
 const DetailListItem = DetailList.Item
 
 export default {
   name: 'CheckJobDetail',
   components: {
     DetailList,
-    DetailListItem
+    DetailListItem,
+    BaseForm
   },
   props: {
     /**
@@ -63,6 +92,11 @@ export default {
       // 下拉框map
       statusMap: {},
       sbStatusMap: {},
+      periodTypeMap: {},
+      actionTypeMap: {},
+      typeMap: {},
+      enableMap: {},
+      modelStandard: {},
       model: {
         'planId': null,
         'startTime': null,
@@ -85,18 +119,42 @@ export default {
     // 下拉框map
     this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_JOB_STATUS)
     this.sbStatusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
   },
   methods: {
     base (record) {
       this.visible = true
       this.modalTitle = '详情'
       this.model = record
+      fetchCheckStandard({ id: record.standardId }).then(res => {
+        this.modelStandard = res.data
+      })
     },
     handleCancel () {
       this.visible = false
       this.confirmLoading = false
+      this.$emit('ok')
+    },
+    handleFinish () {
+      fetchCheckJob({ id: this.model.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleExecute () {
+      executeJob({ id: this.model.id }).then(res => {
+        this.$message.info('接收成功')
+        this.handleOk()
+      })
+    },
+    handleOk () {
+      fetchCheckJob({ id: this.model.id }).then(res => {
+        this.model = res.data
+      })
     }
-
   }
 }
 </script>

+ 1 - 1
src/views/check/checkstandard/modules/BaseForm.vue

@@ -101,7 +101,7 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input
-              v-decorator="['standardHours']" suffix="小时"/>
+              v-decorator="['standardHours']" suffix="分钟"/>
           </a-form-item>
         </row-item>
         <row-item>

+ 1 - 1
src/views/check/checkstandard/modules/Detail.vue

@@ -24,7 +24,7 @@
       <detail-list-item term="要求">{{ model.requirement }}</detail-list-item>
       <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
     </detail-list>
-    <detail-list title="图片" :col="8">
+    <detail-list title="标准图片" :col="8">
       <detail-list-item v-for="item in model.checkImgList" term="">
         <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
       </detail-list-item>

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

@@ -34,8 +34,8 @@
             <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
             <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
           </detail-list>
-          <detail-list title="修图片:" :col="6">
-            <upload-image-detail :images-list="model.repairFileList"/>
+          <detail-list title="修图片:" :col="6">
+            <upload-image-detail :images-list="model.applicationFileList"/>
           </detail-list>
           <a-divider orientation="left">维修详情</a-divider>
           <detail-list title="" :col="3">
@@ -81,26 +81,26 @@
           </div>
         </a-layout-sider>
       </a-layout>
-      <!--    <title-divider title="维修项目" width="90px"></title-divider>-->
-      <!--    <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">-->
-      <!--      <a-button type="primary" @click="handleRepairProjectSelect">-->
-      <!--        <a-icon type="plus"/>-->
-      <!--        添加-->
-      <!--      </a-button>-->
-      <!--    </div>-->
-      <!--    <a-table-->
-      <!--      :data-source="data"-->
-      <!--      :columns="columns"-->
-      <!--      tableLayout="auto"-->
-      <!--      rowKey="id">-->
-      <!--      <span slot="action" slot-scope="record">-->
-      <!--        <template>-->
-      <!--          <a-popconfirm v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要删除该条数据?" @confirm="batchDelete(record.relationId)">-->
-      <!--            <a>删除</a>-->
-      <!--          </a-popconfirm>-->
-      <!--        </template>-->
-      <!--      </span>-->
-      <!--    </a-table>-->
+        <title-divider title="维修项目" width="90px"></title-divider>
+        <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
+          <a-button type="primary" @click="handleRepairProjectSelect">
+            <a-icon type="plus"/>
+            添加
+          </a-button>
+        </div>
+        <a-table
+          :data-source="data"
+          :columns="columns"
+          tableLayout="auto"
+          rowKey="id">
+          <span slot="action" slot-scope="record">
+            <template>
+              <a-popconfirm v-if="$auth('repair-application-forms-finish') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" title="是否要删除该条数据?" @confirm="batchDelete(record.relationId)">
+                <a>删除</a>
+              </a-popconfirm>
+            </template>
+          </span>
+          </a-table>
       <title-divider title="备件清单" width="90px"></title-divider>
       <div class="table-operator" v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status">
         <a-button type="primary" @click="handleSpareStoreSelect">

+ 34 - 151
src/views/sb/info/MeasureSbInfo.vue

@@ -49,7 +49,8 @@
           </div>
 
           <div class="table-operator">
-            <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
+<!--            <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>-->
+            <a-button v-if="$auth('sb-infos-add')" type="primary" icon="plus" @click="handleAddRelate">关联</a-button>
             <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
             <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="doImport">初始化导入</a-button>
             <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="doImportDe">折旧导入</a-button>
@@ -80,25 +81,22 @@
           >
             <span slot="action" slot-scope="record">
               <template>
-                <a @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="handleCopy(record)">复制</a>-->
-                <a-divider v-if="record.status != 2" type="vertical" />
-                <a-popconfirm v-if="record.status != 2" title="是否要启用该设备?" @confirm="handleStart(record)">
-                  <a>启用</a>
-                </a-popconfirm>
-                <a-divider v-if="record.status != 7" type="vertical" />
-                <a-popconfirm v-if="record.status != 7" title="是否要停用该设备?" @confirm="handleStop(record)">
-                  <a>停用</a>
-                </a-popconfirm>
-                <a-divider type="vertical" />
-                <a @click="printQcode(record)">打印</a>
+                <div>
+                  <a-dropdown>
+                    <a-menu slot="overlay">
+                      <a-menu-item key="0">
+                        <a @click="handleView(record)">查看</a>
+                      </a-menu-item>
+                      <a-menu-item key="1">
+                        <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+                      </a-menu-item>
+                      <a-menu-item key="4">
+                        <a @click="printQcode(record)">打印</a>
+                      </a-menu-item>
+                    </a-menu>
+                    <a-button> 操作 <a-icon type="down" /> </a-button>
+                  </a-dropdown>
+                </div>
               </template>
             </span>
             <span slot="status" slot-scope="text">
@@ -106,33 +104,13 @@
                 :status="DictCache.COLOR.SB_INFO_STATUS[text]"
                 :text="statusMap[text]" />
             </span>
-            <span slot="wbFile" slot-scope="record">
-              <template>
-                <a @click="handleRepairFilePreview(record)">预览</a>
-                <a-divider type="vertical" />
-                <a @click="handleRepairFileDownload(record)">下载</a>
-              </template>
-            </span>
-            <span slot="useFile" slot-scope="record">
-              <template>
-                <a @click="handleUseFilePreview(record)">预览</a>
-                <a-divider type="vertical" />
-                <a @click="handleUseFileDownload(record)">下载</a>
-              </template>
-            </span>
-            <span slot="checkFile" slot-scope="record">
-              <template>
-                <a @click="handleCheckFilePreview(record)">预览</a>
-                <a-divider type="vertical" />
-                <a @click="handleCheckFileDownload(record)">下载</a>
-              </template>
-            </span>
           </s-table>
         </div>
 
       </a-col>
     </a-row>
-    <base-form ref="baseModal" @ok="handleOk"/>
+<!--    <base-form ref="baseModal" :useType="4" @ok="handleOk"/>-->
+    <base-form-measure-relation ref="baseModalMeasureRelation" :useType="4" @ok="handleOk"/>
     <detail ref="detailModal" @ok="handleOk"/>
     <download-modal ref="downloadModal"/>
     <preview-modal ref="previewModal"/>
@@ -145,22 +123,24 @@
 <script>
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
-import Detail from './modules/Detail'
+import BaseFormMeasureRelation from './modules/BaseFormMeasureRelation'
+/*import Detail from './modules/Detail'*/
+import Detail from './modules/DetailMeasureRelation'
 import DownloadModal from '@/views/download/DownloadModal'
 import PreviewModal from '@/views/preview/PreviewModal'
-import { updateSbInfo, getSbInfoPage, deleteSbInfos, fetchSbInfo, exportSbInfo } from '@/api/sb/info'
+import { getSbInfoPage, deleteSbInfos, fetchSbInfo, exportSbInfo } from '@/api/sb/info'
 import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
-import BaseTool from '../../../utils/tool'
 import { fetchSbTypeTree } from '@/api/sb/type'
 import ImportFormAdd from './modules/ImportFormAdd'
 import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
 
 export default {
-  name: 'SbInfoList',
+  name: 'MeasureSbInfoList',
   components: {
     STable,
     Ellipsis,
     BaseForm,
+    BaseFormMeasureRelation,
     Detail,
     DownloadModal,
     PreviewModal,
@@ -178,7 +158,7 @@ export default {
       // 查询参数
       queryParam: {
         filter: this.filter,
-        useType: this.DictCache.VALUE.SB_USE_TYPE.BGCL
+        useType: 4
       },
       depreciationTypeMap: {},
       visible: true,
@@ -214,25 +194,11 @@ export default {
           dataIndex: 'no',
           checked: true
         },
-        {
-          title: '自编号',
-          checked: true,
-          dataIndex: 'zbh'
-        },
-        {
-          title: '车牌号',
-          checked: true,
-          dataIndex: 'cph'
-        },
-        {
+   /*     {
           title: '规格型号',
           checked: true,
           dataIndex: 'model'
-        },
-        {
-          title: '财务编码',
-          dataIndex: 'financingNo'
-        },
+        },*/
         {
           title: '设备类型',
           checked: true,
@@ -241,14 +207,6 @@ export default {
             return record.typeName
           }
         },
-        {
-          title: '自定义类型',
-          checked: true,
-          dataIndex: 'useType',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Object.getField(this.useTypeMap, text)
-          }
-        },
         {
           title: '设备等级',
           checked: true,
@@ -264,17 +222,6 @@ export default {
             return this.BaseTool.Amount.formatter(text)
           }
         },
-        {
-          title: '计量单位',
-          dataIndex: 'unit',
-          customRender: (text, record, index) => {
-            return BaseTool.Object.getField(this.unitMap, text)
-          }
-        },
-        {
-          title: '保管人',
-          dataIndex: 'saveUser'
-        },
         {
           title: '购置日期',
           dataIndex: 'buyDate'
@@ -287,36 +234,7 @@ export default {
           title: '下次检定日期',
           dataIndex: 'nextCheckDate'
         },
-        {
-          title: '总行驶里程',
-          dataIndex: 'totalMiles'
-        },
-        {
-          title: '总行驶小时',
-          dataIndex: 'totalHours'
-        },
-        {
-          title: '保修截至日期',
-          dataIndex: 'guaranteeDate'
 
-        },
-        {
-          title: '预计工作年限',
-          dataIndex: 'workYear'
-
-        },
-        {
-          title: '预计报废日期',
-          dataIndex: 'retirementDate'
-
-        },
-        {
-          title: '折旧方式',
-          dataIndex: 'depreciationType',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Object.getField(this.depreciationTypeMap, text)
-          }
-        },
         {
           title: '状态',
           checked: true,
@@ -328,7 +246,7 @@ export default {
           key: 'action',
           checked: true,
           align: 'center',
-          // fixed: 'right',
+          width: '300',
           scopedSlots: { customRender: 'action' }
         }
       ],
@@ -435,22 +353,14 @@ export default {
       }
       this.$refs.printSbCode.base(recordList)
     },
-    handleStart (record) {
-      record.status = 2
-      updateSbInfo(record).then(res => {
-        this.$message.info('已启用')
-      })
-    },
-    handleStop (record) {
-      record.status = 7
-      updateSbInfo(record).then(res => {
-        this.$message.info('已停用')
-      })
-    },
     handleAdd () {
       this.visible = false
       this.$refs.baseModal.base()
     },
+    handleAddRelate () {
+      this.visible = false
+      this.$refs.baseModalMeasureRelation.base()
+    },
     handleView (record) {
       fetchSbInfo({ id: record.id }).then(res => {
         this.visible = false
@@ -478,14 +388,6 @@ export default {
         this.groupList = res.data
       })
     },
-    handleCopy (record) {
-      this.visible = false
-      fetchSbInfo({ id: record.id }).then(res => {
-        const modal = this.$refs.baseModal
-        res.data.id = null
-        modal.base(res.data)
-      })
-    },
     handleOk () {
       this.visible = true
       this.setTree()
@@ -527,25 +429,6 @@ export default {
       this.expandedKeys = expandedKeys
       this.autoExpandParent = false
     },
-    handleRepairFilePreview (record) {
-      console.log(record, 87878)
-      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE)
-    },
-    handleRepairFileDownload (record) {
-      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE, getDownloadUrl(record.id))
-    },
-    handleUseFilePreview (record) {
-      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE)
-    },
-    handleUseFileDownload (record) {
-      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE, getDownloadUrl(record.id))
-    },
-    handleCheckFilePreview (record) {
-      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE)
-    },
-    handleCheckFileDownload (record) {
-      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE, getDownloadUrl(record.id))
-    },
     doImport () {
       if (this.queryParam.useCompany == null) {
         this.$message.error('请先选择公司')

+ 442 - 0
src/views/sb/info/MeasureSbInfoWarn.vue

@@ -0,0 +1,442 @@
+<template>
+  <a-card :bordered="false">
+    <a-row :gutter="8" v-show="visible">
+      <a-col :span="4">
+        <a-tree
+          @expand="onExpand"
+          :expandedKeys="expandedKeys"
+          :autoExpandParent="true"
+          @select="onSelect"
+          :selectedKeys="selectedKeys"
+          :treeData="treeData"
+        />
+      </a-col>
+      <a-col :span="20">
+        <div>
+          <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.zbh" placeholder="请输入设备旧号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="设备状态">
+                    <a-select @change="handleDeptChange" v-model="queryParam.status" placeholder="请选择">
+                      <a-select-option
+                        v-for="(label,value) in statusMap"
+                        :key="value"
+                        :label="label"
+                        :value="parseInt(value)">{{ label }}
+                      </a-select-option>
+                    </a-select>
+                  </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('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="doImport">初始化导入</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="doImportDe">折旧导入</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="printQcode()">打印</a-button>
+            <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-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"
+            :widthSpace="true"
+            :columns="columns"
+            :data="loadData"
+            :alert="options.alert"
+            :rowSelection="options.rowSelection"
+            :scroll="{x: BaseTool.Constant.scrollX, y: BaseTool.Constant.scrollY }"
+            showPagination="auto"
+          >
+            <span slot="action" slot-scope="record">
+              <template>
+                <div>
+                  <a-dropdown>
+                    <a-menu slot="overlay">
+                      <a-menu-item key="0">
+                        <a @click="handleView(record)">查看</a>
+                      </a-menu-item>
+                      <a-menu-item key="1">
+                        <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+                      </a-menu-item>
+                      <a-menu-item key="4">
+                        <a @click="printQcode(record)">打印</a>
+                      </a-menu-item>
+                    </a-menu>
+                    <a-button> 操作 <a-icon type="down" /> </a-button>
+                  </a-dropdown>
+                </div>
+              </template>
+            </span>
+            <span slot="status" slot-scope="text">
+              <badge
+                :status="DictCache.COLOR.SB_INFO_STATUS[text]"
+                :text="statusMap[text]" />
+            </span>
+          </s-table>
+        </div>
+
+      </a-col>
+    </a-row>
+    <base-form ref="baseModal" :useType="4" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+    <download-modal ref="downloadModal"/>
+    <preview-modal ref="previewModal"/>
+    <import-form-add ref="importModal" @ok="handleOk"/>
+    <print-sb-code ref="printSbCode"/>
+  </a-card>
+
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+/*import Detail from './modules/Detail'*/
+import Detail from './modules/DetailMeasureRelation'
+import DownloadModal from '@/views/download/DownloadModal'
+import PreviewModal from '@/views/preview/PreviewModal'
+import { getMeasureWarn, deleteSbInfos, fetchSbInfo, exportSbInfo } from '@/api/sb/info'
+import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
+import { fetchSbTypeTree } from '@/api/sb/type'
+import ImportFormAdd from './modules/ImportFormAdd'
+import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
+
+export default {
+  name: 'MeasureSbInfoList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail,
+    DownloadModal,
+    PreviewModal,
+    PrintSbCode,
+    ImportFormAdd
+  },
+  props: {
+    filter: {
+      type: Number,
+      default: -1
+    }
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        filter: this.filter,
+        useType: 4
+      },
+      depreciationTypeMap: {},
+      visible: true,
+      levelMap: {},
+      unitMap: {},
+      areaList: {},
+      companyList: {},
+      projectList: {},
+      deptList: {},
+      useTypeMap: {},
+      statusMap: {},
+      expandedKeys: [],
+      selectedKeys: [],
+      sourceTypeMap: {},
+      treeData: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          dataIndex: 'name'
+        },
+        {
+          title: '设备编号',
+          dataIndex: 'no',
+          checked: true
+        },
+   /*     {
+          title: '规格型号',
+          checked: true,
+          dataIndex: 'model'
+        },*/
+        {
+          title: '设备类型',
+          checked: true,
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '设备等级',
+          checked: true,
+          dataIndex: 'level',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '设备原值',
+          dataIndex: 'initialValue',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '购置日期',
+          dataIndex: 'buyDate'
+        },
+        {
+          title: '投用日期',
+          dataIndex: 'startDate'
+        },
+        {
+          title: '下次检定日期',
+          dataIndex: 'nextCheckDate'
+        },
+
+        {
+          title: '状态',
+          checked: true,
+          dataIndex: 'status',
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          align: 'center',
+          width: '300',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getMeasureWarn(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    this.tableOption()
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+  },
+  methods: {
+    tableOption () {
+      this.setTree()
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteSbInfos(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    printQcode (record) {
+      let recordList = []
+      console.log(record, this.selectedRows)
+      if (this.BaseTool.String.isBlank(record)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要打印的记录')
+          return
+        }
+        recordList = this.selectedRows
+      } else {
+        recordList = [record]
+      }
+      this.$refs.printSbCode.base(recordList)
+    },
+    handleAdd () {
+      this.visible = false
+      this.$refs.baseModal.base()
+    },
+    handleView (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleAreaChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+        this.companyList = res.data
+      })
+    },
+    handleCompanyChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+        this.projectList = res.data
+      })
+    },
+    handleProjectChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+        this.deptList = res.data
+      })
+    },
+    handleDeptChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+        this.groupList = res.data
+      })
+    },
+    handleOk () {
+      this.visible = true
+      this.setTree()
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+        filter: this.filter
+      }
+      this.visible = true
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbInfo(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    setTree (record = {}) {
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+      fetchSbTypeTree().then(res => {
+        this.treeData = res.data
+      })
+    },
+    onSelect: function (selectedKeys, info) {
+      this.selectedKeys = selectedKeys
+      this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
+      this.$refs.table.refresh(true)
+    },
+    onExpand (expandedKeys) {
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    doImport () {
+      if (this.queryParam.useCompany == null) {
+        this.$message.error('请先选择公司')
+        return
+      }
+      if (this.queryParam.useProject == null) {
+        this.$message.error('请先选择项目部')
+        return
+      }
+      this.$refs.importModal.base(this.queryParam.useCompany, this.queryParam.useProject)
+    },
+    doImportDe () {
+      this.queryParam.useCompany = null
+      this.queryParam.useProject = null
+      this.$refs.importModal.base()
+    }
+  }
+}
+</script>

+ 40 - 54
src/views/sb/info/SbInfo.vue

@@ -78,25 +78,38 @@
           >
             <span slot="action" slot-scope="record">
               <template>
-                <a @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="handleCopy(record)">复制</a>-->
-                <a-divider v-if="record.status != 2" type="vertical" />
-                <a-popconfirm v-if="record.status != 2" title="是否要启用该设备?" @confirm="handleStart(record)">
-                  <a>启用</a>
-                </a-popconfirm>
-                <a-divider v-if="record.status != 7" type="vertical" />
-                <a-popconfirm v-if="record.status != 7" title="是否要停用该设备?" @confirm="handleStop(record)">
-                  <a>停用</a>
-                </a-popconfirm>
-                <a-divider type="vertical" />
-                <a @click="printQcode(record)">打印</a>
+                <div>
+                  <!--<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="handleCopy(record)">复制</a>-->
+                  <a-dropdown>
+                    <a-menu slot="overlay">
+                      <a-menu-item key="0">
+                        <a @click="handleView(record)">查看</a>
+                      </a-menu-item>
+                      <a-menu-item key="1">
+                         <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+                      </a-menu-item>
+                      <a-menu-item v-if="record.status != 2" key="2">
+                         <a-popconfirm  title="是否要启用该设备?" @confirm="handleStart(record)">
+                          <a>启用</a>
+                        </a-popconfirm>
+                      </a-menu-item>
+                      <a-menu-item v-if="record.status != 7"  key="3">
+                         <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
+                          <a>停用</a>
+                        </a-popconfirm>
+                      </a-menu-item>
+                       <a-menu-item key="4">
+                         <a @click="printQcode(record)">打印</a>
+                      </a-menu-item>
+                    </a-menu>
+                    <a-button> 操作 <a-icon type="down" /> </a-button>
+                  </a-dropdown>
+                </div>
               </template>
             </span>
             <span slot="status" slot-scope="text">
@@ -171,6 +184,7 @@ export default {
       sourceTypeMap: {},
       treeData: [],
       // 表头
+      // 表头
       columns: [
         {
           title: '序号',
@@ -186,24 +200,10 @@ export default {
           dataIndex: 'name'
         },
         {
-          title: '号',
+          title: '设备编号',
           dataIndex: 'no',
           checked: true
         },
-        {
-          title: '旧号',
-          dataIndex: 'zbh',
-          checked: true
-        },
-        {
-          title: '规格型号',
-          checked: true,
-          dataIndex: 'model'
-        },
-        {
-          title: '资产编码',
-          dataIndex: 'financingNo'
-        },
         {
           title: '设备类型',
           checked: true,
@@ -212,14 +212,6 @@ export default {
             return record.typeName
           }
         },
-     /*   {
-          title: '自定义类型',
-          checked: true,
-          dataIndex: 'useType',
-          customRender: (text, record, index) => {
-            return this.BaseTool.Object.getField(this.useTypeMap, text)
-          }
-        },*/
         {
           title: '设备等级',
           checked: true,
@@ -235,17 +227,6 @@ export default {
             return this.BaseTool.Amount.formatter(text)
           }
         },
-        {
-          title: '计量单位',
-          dataIndex: 'unit',
-          customRender: (text, record, index) => {
-            return BaseTool.Object.getField(this.unitMap, text)
-          }
-        },
-        {
-          title: '保管人',
-          dataIndex: 'saveUser'
-        },
         {
           title: '购置日期',
           dataIndex: 'buyDate'
@@ -254,6 +235,11 @@ export default {
           title: '投用日期',
           dataIndex: 'startDate'
         },
+        {
+          title: '下次检定日期',
+          dataIndex: 'nextCheckDate'
+        },
+
         {
           title: '状态',
           checked: true,
@@ -265,7 +251,7 @@ export default {
           key: 'action',
           checked: true,
           align: 'center',
-          width: 200,
+          width: '300',
           scopedSlots: { customRender: 'action' }
         }
       ],

+ 513 - 0
src/views/sb/info/SpecialSbInfo.vue

@@ -0,0 +1,513 @@
+<template>
+  <a-card :bordered="false">
+    <a-row :gutter="8" v-show="visible">
+      <a-col :span="4">
+        <a-tree
+          @expand="onExpand"
+          :expandedKeys="expandedKeys"
+          :autoExpandParent="true"
+          @select="onSelect"
+          :selectedKeys="selectedKeys"
+          :treeData="treeData"
+        />
+      </a-col>
+      <a-col :span="20">
+        <div>
+          <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.zbh" placeholder="请输入设备旧号"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="设备状态">
+                    <a-select @change="handleDeptChange" v-model="queryParam.status" placeholder="请选择">
+                      <a-select-option
+                        v-for="(label,value) in statusMap"
+                        :key="value"
+                        :label="label"
+                        :value="parseInt(value)">{{ label }}
+                      </a-select-option>
+                    </a-select>
+                  </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('sb-infos-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="doImport">初始化导入</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="doImportDe">折旧导入</a-button>
+            <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="upload" @click="printQcode()">打印</a-button>
+            <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-infos-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"
+            :widthSpace="true"
+            :columns="columns"
+            :data="loadData"
+            :alert="options.alert"
+            :rowSelection="options.rowSelection"
+            :scroll="{x: BaseTool.Constant.scrollX, y: BaseTool.Constant.scrollY }"
+            showPagination="auto"
+          >
+            <span slot="action" slot-scope="record">
+              <template>
+                <div>
+                  <!--<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="handleCopy(record)">复制</a>-->
+                  <a-dropdown>
+                    <a-menu slot="overlay">
+                      <a-menu-item key="0">
+                        <a @click="handleView(record)">查看</a>
+                      </a-menu-item>
+                      <a-menu-item key="1">
+                         <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
+                      </a-menu-item>
+                      <a-menu-item v-if="record.status != 2" key="2">
+                         <a-popconfirm  title="是否要启用该设备?" @confirm="handleStart(record)">
+                          <a>启用</a>
+                        </a-popconfirm>
+                      </a-menu-item>
+                      <a-menu-item v-if="record.status != 7"  key="3">
+                         <a-popconfirm title="是否要停用该设备?" @confirm="handleStop(record)">
+                          <a>停用</a>
+                        </a-popconfirm>
+                      </a-menu-item>
+                       <a-menu-item key="4">
+                         <a @click="printQcode(record)">打印</a>
+                      </a-menu-item>
+                    </a-menu>
+                    <a-button> 操作 <a-icon type="down" /> </a-button>
+                  </a-dropdown>
+                </div>
+              </template>
+            </span>
+            <span slot="status" slot-scope="text">
+              <badge
+                :status="DictCache.COLOR.SB_INFO_STATUS[text]"
+                :text="statusMap[text]" />
+            </span>
+            <span slot="wbFile" slot-scope="record">
+              <template>
+                <a @click="handleRepairFilePreview(record)">预览</a>
+                <a-divider type="vertical" />
+                <a @click="handleRepairFileDownload(record)">下载</a>
+              </template>
+            </span>
+            <span slot="useFile" slot-scope="record">
+              <template>
+                <a @click="handleUseFilePreview(record)">预览</a>
+                <a-divider type="vertical" />
+                <a @click="handleUseFileDownload(record)">下载</a>
+              </template>
+            </span>
+            <span slot="checkFile" slot-scope="record">
+              <template>
+                <a @click="handleCheckFilePreview(record)">预览</a>
+                <a-divider type="vertical" />
+                <a @click="handleCheckFileDownload(record)">下载</a>
+              </template>
+            </span>
+          </s-table>
+        </div>
+
+      </a-col>
+    </a-row>
+    <base-form ref="baseModal" :useType="5" @ok="handleOk"/>
+    <detail ref="detailModal" @ok="handleOk"/>
+    <download-modal ref="downloadModal"/>
+    <preview-modal ref="previewModal"/>
+    <import-form-add ref="importModal" @ok="handleOk"/>
+    <print-sb-code ref="printSbCode"/>
+  </a-card>
+
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import DownloadModal from '@/views/download/DownloadModal'
+import PreviewModal from '@/views/preview/PreviewModal'
+import { updateSbInfo, getSbInfoPage, deleteSbInfos, fetchSbInfo, exportSbInfo } from '@/api/sb/info'
+import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
+import BaseTool from '../../../utils/tool'
+import { fetchSbTypeTree } from '@/api/sb/type'
+import ImportFormAdd from './modules/ImportFormAdd'
+import PrintSbCode from '@/views/sb/info/modules/PrintSbCode'
+
+export default {
+  name: 'SpecialSbInfoList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail,
+    DownloadModal,
+    PreviewModal,
+    PrintSbCode,
+    ImportFormAdd
+  },
+  props: {
+    filter: {
+      type: Number,
+      default: -1
+    }
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        filter: this.filter,
+        useType: this.DictCache.VALUE.SB_USE_TYPE.TZSB
+      },
+      depreciationTypeMap: {},
+      visible: true,
+      levelMap: {},
+      unitMap: {},
+      areaList: {},
+      companyList: {},
+      projectList: {},
+      deptList: {},
+      useTypeMap: {},
+      statusMap: {},
+      expandedKeys: [],
+      selectedKeys: [],
+      sourceTypeMap: {},
+      treeData: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          dataIndex: 'name'
+        },
+        {
+          title: '设备编号',
+          dataIndex: 'no',
+          checked: true
+        },
+        {
+          title: '设备类型',
+          checked: true,
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '设备等级',
+          checked: true,
+          dataIndex: 'level',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '设备原值',
+          dataIndex: 'initialValue',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '购置日期',
+          dataIndex: 'buyDate'
+        },
+        {
+          title: '投用日期',
+          dataIndex: 'startDate'
+        },
+        {
+          title: '下次检定日期',
+          dataIndex: 'nextCheckDate'
+        },
+
+        {
+          title: '状态',
+          checked: true,
+          dataIndex: 'status',
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          align: 'center',
+          width: '300',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSbInfoPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    this.tableOption()
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+  },
+  methods: {
+    tableOption () {
+      this.setTree()
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteSbInfos(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    printQcode (record) {
+      let recordList = []
+      console.log(record, this.selectedRows)
+      if (this.BaseTool.String.isBlank(record)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要打印的记录')
+          return
+        }
+        recordList = this.selectedRows
+      } else {
+        recordList = [record]
+      }
+      this.$refs.printSbCode.base(recordList)
+    },
+    handleStart (record) {
+      record.status = 2
+      updateSbInfo(record).then(res => {
+        this.$message.info('已启用')
+      })
+    },
+    handleStop (record) {
+      record.status = 7
+      updateSbInfo(record).then(res => {
+        this.$message.info('已停用')
+      })
+    },
+    handleAdd () {
+      this.visible = false
+      this.$refs.baseModal.base()
+    },
+    handleView (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        this.visible = false
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleAreaChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+        this.companyList = res.data
+      })
+    },
+    handleCompanyChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+        this.projectList = res.data
+      })
+    },
+    handleProjectChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+        this.deptList = res.data
+      })
+    },
+    handleDeptChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+        this.groupList = res.data
+      })
+    },
+    handleCopy (record) {
+      this.visible = false
+      fetchSbInfo({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        res.data.id = null
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.visible = true
+      this.setTree()
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+        filter: this.filter
+      }
+      this.visible = true
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbInfo(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    setTree (record = {}) {
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+      fetchSbTypeTree().then(res => {
+        this.treeData = res.data
+      })
+    },
+    onSelect: function (selectedKeys, info) {
+      this.selectedKeys = selectedKeys
+      this.queryParam.typeId = selectedKeys.length > 0 ? selectedKeys[0] : ''
+      this.$refs.table.refresh(true)
+    },
+    onExpand (expandedKeys) {
+      this.expandedKeys = expandedKeys
+      this.autoExpandParent = false
+    },
+    handleRepairFilePreview (record) {
+      console.log(record, 87878)
+      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE)
+    },
+    handleRepairFileDownload (record) {
+      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_REPAIRFILE, getDownloadUrl(record.id))
+    },
+    handleUseFilePreview (record) {
+      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE)
+    },
+    handleUseFileDownload (record) {
+      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_USEFILE, getDownloadUrl(record.id))
+    },
+    handleCheckFilePreview (record) {
+      this.$refs.previewModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE)
+    },
+    handleCheckFileDownload (record) {
+      // this.$refs.downloadModal.base(record.id, this.DictCache.VALUE.FILE_MODULE.SBINFO_RECHECKFILE, getDownloadUrl(record.id))
+    },
+    doImport () {
+      if (this.queryParam.useCompany == null) {
+        this.$message.error('请先选择公司')
+        return
+      }
+      if (this.queryParam.useProject == null) {
+        this.$message.error('请先选择项目部')
+        return
+      }
+      this.$refs.importModal.base(this.queryParam.useCompany, this.queryParam.useProject)
+    },
+    doImportDe () {
+      this.queryParam.useCompany = null
+      this.queryParam.useProject = null
+      this.$refs.importModal.base()
+    }
+  }
+}
+</script>

+ 339 - 32
src/views/sb/info/modules/BaseForm.vue

@@ -120,7 +120,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['useType', {rules: [{required: true, message: '自定义类型不能为空'}]}]" placeholder="请选择">
+            <a-select @change="handleChange" v-decorator="['useType', {rules: [{required: true, message: '自定义类型不能为空'}]}]" placeholder="请选择">
               <a-select-option
                 v-for="(label,value) in useTypeMap"
                 :key="value"
@@ -172,7 +172,7 @@
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="系列号"
+            label="系列号(出厂编号)"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
@@ -216,7 +216,6 @@
           </a-form-item>
         </a-col>
       </a-row>
-      <title-divider title="基本信息" width="90px"></title-divider>
       <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
@@ -306,8 +305,23 @@
               v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]" />
           </a-form-item>
         </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="使用机台"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-select v-decorator="['saveUser', {rules: [{required: true, message: '项目部不能为空'}]}]" 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>
+        </a-col>
       </a-row>
-      <title-divider title="使用信息" width="90px"></title-divider>
       <!--      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
@@ -396,11 +410,11 @@
         </a-col>-->
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="保管人"
+            label="维修人"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['saveUser', {rules: [{required: true, message: '项目部不能为空'}]}]" placeholder="请选择">
+            <a-select v-decorator="['repairUser']" placeholder="请选择">
               <a-select-option
                 v-for="({userId, realName}) in userList"
                 :key="userId"
@@ -412,11 +426,11 @@
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="维修人"
+            label="第二维修人"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['repairUser']" placeholder="请选择">
+            <a-select v-decorator="['repairUserSecond']" placeholder="请选择">
               <a-select-option
                 v-for="({userId, realName}) in userList"
                 :key="userId"
@@ -427,7 +441,6 @@
           </a-form-item>
         </a-col>
       </a-row>
-      <title-divider title="日期信息" width="90px"></title-divider>
       <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
@@ -454,6 +467,255 @@
           </a-form-item>
         </a-col>
       </a-row>
+      <title-divider v-show="useType == 5" title="特种信息" width="90px"></title-divider>
+      <div v-show="useType == 5" >
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="注册代码"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['registerNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="介质属性"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['characterType']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="设备批号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['batchNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="使用登记证编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['usedNo']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="维护供应商"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['supplier']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="登记日期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['registerDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="预计工作年限"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                style="width: 100%"
+                suffix="年"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['workYear']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="设计到期年限"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['retirementDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </div>
+      <title-divider v-show="useType == 4" title="计量信息" width="90px"></title-divider>
+      <div v-show="useType == 4" >
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="测量设备编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['cardNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="准确度等级"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['fdjxh']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定单位"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['dph']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定人"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['zaiz']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定结论"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['rlType']" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in rlTypeMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="是否周检查"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['color']" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in colorMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定证书编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['sbdh']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="预警天数"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input-number
+                style="width: 100%"
+                :min="0"
+                :step="0.01"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['seatNumber']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定日期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['checkDate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定周期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                style="width: 100%"
+                suffix="月"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['checkPeriod']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="有效日期至"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['nextCheckDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </div>
       <title-divider title="文件信息" width="90px"></title-divider>
       <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
         <a-col :lg="12" :md="24" :sm="24">
@@ -564,14 +826,12 @@ export default {
       confirmLoading: false,
       modalTitle: null,
       form: this.$form.createForm(this),
-
       areaList: {},
       companyList: {},
       projectList: {},
       deptList: {},
       groupList: {},
       visible: false,
-
       sbTypeTreeData: [],
       // sbInfoTreeData: [],
       // sourceSbInfoTreeData: [],
@@ -603,6 +863,10 @@ export default {
     }
   },
   props: {
+    useType: {
+      type: Number,
+      default: 3
+    }
   },
   created () {
     this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
@@ -627,6 +891,7 @@ export default {
         this.clearFileList()
         return
       }
+      this.useType = record.useType
       this.modalTitle = '编辑'
       this.qrcodesrc = record.qrCode
       this.repairFileList = record.repairFileList
@@ -663,46 +928,59 @@ export default {
 
       const { form: { setFieldsValue } } = this
       // 日期处理
-      if (this.BaseTool.Object.isBlank(record.buyDate)) {
-        record.buyDate = '2017-04-19'
-      }
-      record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-      record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-      record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-      record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-      record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
 
       // record.lastRepaireTime = this.BaseTool.Moment(record.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
       // record.lastBaoyangTime = this.BaseTool.Moment(record.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
-      if (record.jbdDate != null) {
-        record.jbdDate = this.BaseTool.Moment(record.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.buyDate != null) {
+        record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         this.$nextTick(() => {
           setFieldsValue(Object.assign(pick(record, [
-            'jbdDate'
+            'buyDate'
           ])))
         })
       }
-      if (record.sbdDate != null) {
-        record.sbdDate = this.BaseTool.Moment(record.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.startDate != null) {
+        record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         this.$nextTick(() => {
           setFieldsValue(Object.assign(pick(record, [
-            'sbdDate'
+            'startDate'
           ])))
         })
       }
-      if (record.sbDate != null) {
-        record.sbDate = this.BaseTool.Moment(record.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.checkDate != null) {
+        record.checkDate = this.BaseTool.Moment(record.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         this.$nextTick(() => {
           setFieldsValue(Object.assign(pick(record, [
-            'sbDate'
+            'checkDate'
           ])))
         })
       }
-      if (record.spDate != null) {
-        record.spDate = this.BaseTool.Moment(record.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.nextCheckDate != null) {
+        record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         this.$nextTick(() => {
           setFieldsValue(Object.assign(pick(record, [
-            'spDate'
+            'nextCheckDate'
+          ])))
+        })
+      }
+      if (record.retirementDate != null) {
+        record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'retirementDate'
+          ])))
+        })
+      }
+      if (record.registerDate != null) {
+        record.registerDate = this.BaseTool.Moment(record.registerDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'registerDate'
           ])))
         })
       }
@@ -749,7 +1027,30 @@ export default {
           'zz',
           'zjm',
           'jbdh',
-          'useType'
+          'useType',
+
+          'cardNo',
+          'fdjxh',
+          'checkDate',
+          'checkPeriod',
+          'nextCheckDate',
+          'dph',
+          'zaiz',
+          'rlType',
+          'color',
+          'sbdh',
+          'seatNumber',
+
+          'registerNo',
+          'characterType',
+          'usedNo',
+          'supplier',
+          'repairUserSecond',
+          'batchNo',
+          'workYear',
+          'retirementDate',
+          'registerDate'
+
         ])))
       })
     },
@@ -764,6 +1065,7 @@ export default {
         // 日期数据的处理
         values.buyDate = BaseTool.Date.formatter(values.buyDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.startDate = BaseTool.Date.formatter(values.startDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.checkDate = BaseTool.Date.formatter(values.checkDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
         values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
@@ -780,6 +1082,8 @@ export default {
         values.useFileList = this.useFileList
         values.recheckFileList = this.recheckFileList
         values.sbFileList = this.sbFileList
+
+        values.useType = this.useType
         if (this.BaseTool.String.isBlank(values.id)) {
           addSbInfo(values)
             .then(() => {
@@ -972,6 +1276,9 @@ export default {
         }))
       })
     },
+    handleChange (value) {
+      this.useType = value
+    },
     handleProducerSelect () {
       const modal = this.$refs.producerSelectModal
       modal.base({}, { type: 1 })

+ 937 - 0
src/views/sb/info/modules/BaseFormMeasureRelation.vue

@@ -0,0 +1,937 @@
+<template>
+  <a-card :bordered="false" v-show="visible" class="card" :title="modalTitle">
+    <a-row :gutter="48" slot="extra">
+      <a-col :md="48" :sm="48">
+        <span class="table-page-search-submitButtons" style="float: right">
+          <a-button type="primary" @click="save()">提交</a-button>
+          <a-button style="margin-left: 8px" @click="handleCancel()">返回</a-button>
+        </span>
+      </a-col>
+    </a-row>
+
+    <title-divider title="基本信息" width="90px"></title-divider>
+    <a-form :form="form">
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['parentId']" type="hidden"/>
+      </a-form-item>
+
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备(新号)"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              style='width:70%'
+              v-decorator="['no', {rules: [{required: true, message: '不能为空'}]}]" />
+            <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备(旧号)"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              v-decorator="['zbh', {rules: [{required: false, message: '不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备名称"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              v-decorator="['name', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="型号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <title-divider v-show="useType == 5" title="特种信息" width="90px"></title-divider>
+      <div v-show="useType == 5" >
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="注册代码"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['registerNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="介质属性"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['characterType']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="设备批号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['batchNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="使用登记证编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['usedNo']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="维护供应商"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['supplier']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="登记日期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['registerDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="预计工作年限"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                style="width: 100%"
+                suffix="年"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['workYear']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="设计到期年限"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['retirementDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </div>
+      <title-divider v-show="useType == 4" title="计量信息" width="90px"></title-divider>
+      <div v-show="useType == 4" >
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="测量设备编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['cardNo']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="准确度等级"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['fdjxh']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定单位"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['dph']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定人"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['zaiz']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定结论"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['rlType']" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in rlTypeMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="是否周检查"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-select v-decorator="['color']" placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in colorMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定证书编号"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                v-decorator="['sbdh']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="预警天数"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input-number
+                style="width: 100%"
+                :min="0"
+                :step="0.01"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['seatNumber']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定日期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['checkDate']" />
+            </a-form-item>
+          </a-col>
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="检定周期"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-input
+                style="width: 100%"
+                suffix="月"
+                :formatter="BaseTool.Amount.formatter"
+                :parser="BaseTool.Amount.parser"
+                v-decorator="['checkPeriod']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+        <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+          <a-col :lg="12" :md="24" :sm="24">
+            <a-form-item
+              label="有效日期至"
+              :labelCol="BaseTool.Constant.labelCol"
+              :wrapperCol="BaseTool.Constant.wrapperCol"
+            >
+              <a-date-picker
+                style="width: 100%"
+                :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+                v-decorator="['nextCheckDate']" />
+            </a-form-item>
+          </a-col>
+        </a-row>
+      </div>
+<!--      <title-divider title="文件信息" width="90px"></title-divider>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="维保手册"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :file-list="this.defaultRepairFileList"
+              @change="handleRepairFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="使用手册"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="this.defaultUseFileList"
+              @change="handleUseFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+      </a-row>
+      <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="验收文件"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="false"
+              :file-list="this.defaultRecheckFileList"
+              @change="handleRecheckFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+        <a-col :lg="12" :md="24" :sm="24">
+          <a-form-item
+            label="设备图片"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="this.defaultSbFileList"
+              @change="handleSbFileChange"
+              accept="image/*"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </a-col>
+      </a-row>-->
+    </a-form>
+    <sb-model-select-modal ref="sbModelSelectModal" @selected="handleSbModelSelected"/>
+    <sb-info-select-modal ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+    <firm-producer-select-modal ref="producerSelectModal" @selected="handleProducerSelected"/>
+  </a-card>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addSbInfo, updateSbInfo } from '@/api/sb/info'
+import { fetchSbTypeTree } from '@/api/sb/type'
+import FirmProducerSelectModal from '@/views/firm/producer/modules/FirmProducerSelectModal'
+import SbGuigeSelectModal from '@/views/sb/guige/modules/SbGuigeSelectModal'
+import SbModelSelectModal from '@/views/sb/model/modules/SbModelSelectModal'
+import BaseTool from '../../../../utils/tool'
+import { queryUserDeptByUserDeptId } from '@/api/upms/user-dept'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import Vue from 'vue'
+import { uploadUrl } from '@/api/upms/file'
+import { queryDept, getDeptsAllByParentId } from '@/api/upms/dept'
+import { queryUser } from '@/api/upms/user'
+
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+
+export default {
+  name: 'BaseSbInfoMeasureRelation',
+  components: {
+    FirmProducerSelectModal,
+    SbGuigeSelectModal,
+    SbModelSelectModal,
+    SbInfoSelectModal
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      areaList: {},
+      companyList: {},
+      projectList: {},
+      deptList: {},
+      groupList: {},
+      visible: false,
+      sbTypeTreeData: [],
+      // sbInfoTreeData: [],
+      // sourceSbInfoTreeData: [],
+      // sbPositionTreeData: [],
+      depreciationTypeMap: {},
+      sourceTypeMap: {},
+      levelMap: {},
+      rlTypeMap: {},
+      colorMap: {},
+      useTypeMap: {},
+      statusMap: {},
+      userList: {},
+      unitMap: {},
+      sbInfoSelectType: null,
+      repairFileList: [], // 维修手册
+      defaultRepairFileList: [],
+      defaultUseFileList: [],
+      defaultRecheckFileList: [],
+      defaultSbFileList: [],
+      useFileList: [], // 使用手册
+      recheckFileList: [], // 验收手册
+      sbFileList: [], // 设备图片,
+      uploadUrl: uploadUrl,
+      qrcodesrc: null,
+      fileList: [],
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      }
+    }
+  },
+  props: {
+    useType: {
+      type: Number,
+      default: 3
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+  },
+  methods: {
+    base (record) {
+      this.setTree(record)
+      // 清除文件列表
+      this.visible = true
+      // 选择框查询条件
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.qrcodesrc = null
+        this.modalTitle = '添加关联'
+        this.clearFileList()
+        return
+      }
+      this.useType = record.useType
+      this.modalTitle = '编辑关联'
+      this.qrcodesrc = record.qrCode
+      this.repairFileList = record.repairFileList
+      this.useFileList = record.useFileList
+      this.recheckFileList = record.recheckFileList
+      this.sbFileList = record.sbFileList
+      this.defaultRepairFileList = this.BaseTool.UPLOAD.transImg(this.repairFileList)
+      this.defaultUseFileList = this.BaseTool.UPLOAD.transImg(this.useFileList)
+      this.defaultRecheckFileList = this.BaseTool.UPLOAD.transImg(this.recheckFileList)
+      this.defaultSbFileList = this.BaseTool.UPLOAD.transImg(this.sbFileList)
+
+      // if (this.BaseTool.Object.isBlank(record.id)) {
+      // this.modalTitle = '复制'
+      // this.qrcodesrc = null
+      // record.no = null
+      // this.clearFileList()
+      // }
+      if (record.isChild === 1) {
+        record.isChild = '1'
+      }
+      if (record.isChild === 2) {
+        record.isChild = '2'
+      }
+      if (record.isChild === 3) {
+        record.isChild = '3'
+      }
+
+      if (record.isShow === 0) {
+        record.isShow = '0'
+      }
+      if (record.isShow === 1) {
+        record.isShow = '1'
+      }
+
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      // record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.guaranteeDate = this.BaseTool.Moment(record.guaranteeDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+      // record.lastRepaireTime = this.BaseTool.Moment(record.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      // record.lastBaoyangTime = this.BaseTool.Moment(record.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+      if (record.buyDate != null) {
+        record.buyDate = this.BaseTool.Moment(record.buyDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'buyDate'
+          ])))
+        })
+      }
+      if (record.startDate != null) {
+        record.startDate = this.BaseTool.Moment(record.startDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'startDate'
+          ])))
+        })
+      }
+      if (record.checkDate != null) {
+        record.checkDate = this.BaseTool.Moment(record.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'checkDate'
+          ])))
+        })
+      }
+      if (record.nextCheckDate != null) {
+        record.nextCheckDate = this.BaseTool.Moment(record.nextCheckDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'nextCheckDate'
+          ])))
+        })
+      }
+      if (record.retirementDate != null) {
+        record.retirementDate = this.BaseTool.Moment(record.retirementDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'retirementDate'
+          ])))
+        })
+      }
+      if (record.registerDate != null) {
+        record.registerDate = this.BaseTool.Moment(record.registerDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'registerDate'
+          ])))
+        })
+      }
+      record.unitName = this.BaseTool.Object.getField(this.unitMap, record.unit)
+      record.useTypeName = this.BaseTool.Object.getField(this.useTypeMap, record.useType)
+
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'no',
+          'parentId',
+          'parentSbName',
+          'isChild',
+          'isShow',
+          'financingNo',
+          'name',
+          'model',
+          'positionId',
+          'producerName',
+          'useArea',
+          'useCompany',
+          'useProject',
+          'useDept',
+          'saveUser',
+          'repairUser',
+          'useGroup',
+          'typeId',
+          'level',
+          'initialValue',
+          // 'cutValue',
+          'producerId',
+          // 'sourceType',
+          'unit',
+          'buyDate',
+          'startDate',
+          'zbh',
+          // 'wbFile',
+          // 'useFile',
+          // 'checkFile',
+          // 'sbImage',
+          'status',
+          'remark',
+          'zzh',
+          'zz',
+          'zjm',
+          'jbdh',
+          'useType',
+
+          'cardNo',
+          'fdjxh',
+          'checkDate',
+          'checkPeriod',
+          'nextCheckDate',
+          'dph',
+          'zaiz',
+          'rlType',
+          'color',
+          'sbdh',
+          'seatNumber',
+
+          'registerNo',
+          'characterType',
+          'usedNo',
+          'supplier',
+          'repairUserSecond',
+          'batchNo',
+          'workYear',
+          'retirementDate',
+          'registerDate'
+
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        // 日期数据的处理
+        values.buyDate = BaseTool.Date.formatter(values.buyDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.startDate = BaseTool.Date.formatter(values.startDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.checkDate = BaseTool.Date.formatter(values.checkDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.nextCheckDate = BaseTool.Date.formatter(values.nextCheckDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.guaranteeDate = BaseTool.Date.formatter(values.guaranteeDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.retirementDate = BaseTool.Date.formatter(values.retirementDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+        values.lastRepaireTime = this.BaseTool.Date.formatter(values.lastRepaireTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.lastBaoyangTime = this.BaseTool.Date.formatter(values.lastBaoyangTime, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.spDate = this.BaseTool.Date.formatter(values.spDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.jbdDate = this.BaseTool.Date.formatter(values.jbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.sbdDate = this.BaseTool.Date.formatter(values.sbdDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        values.sbDate = this.BaseTool.Date.formatter(values.sbDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+
+        // 上传文件
+        values.repairFileList = this.repairFileList
+        values.useFileList = this.useFileList
+        values.recheckFileList = this.recheckFileList
+        values.sbFileList = this.sbFileList
+
+        values.useType = this.useType
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addSbInfo(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateSbInfo(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    getQrcodeSrc () {
+      console.log(111, 22)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      this.$emit('ok')
+    },
+    setTree (record = {}) {
+      fetchSbTypeTree().then(res => {
+        this.sbTypeTreeData = res.data
+      })
+      // getSbInfoTree({ id: record.id }).then(res => {
+      //  this.sbInfoTreeData = res.data
+      //  this.sourceSbInfoTreeData = res.data
+      // })
+      // getSbPositionTree().then(res => {
+      //  this.sbPositionTreeData = res.data
+      // })
+      queryDept({ nature: this.DictCache.VALUE.SYS_DEPT_NATURE.JITUAN }).then(res => {
+        this.areaList = res.data
+      })
+
+      if (record.useArea != null) {
+        getDeptsAllByParentId({ deptId: record.useArea, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+          this.companyList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useCompany, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+          this.projectList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useProject, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+          this.deptList = res.data
+        })
+        getDeptsAllByParentId({ deptId: record.useDept, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+          this.groupList = res.data
+        })
+        queryUser({ }).then(res => {
+          this.userList = res.data
+        })
+      }
+      queryUser({ }).then(res => {
+        this.userList = res.data
+      })
+    },
+    handleSbModelSelect () {
+      const modal = this.$refs.sbModelSelectModal
+      modal.base()
+    },
+    handleSbModelSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+
+      this.$nextTick(() => {
+        setFieldsValue({
+          'modelId': key,
+          'name': row.name,
+          'model': row.model,
+          'nameModel': row.nameModel,
+          'typeId': row.typeId,
+          'typeName': row.typeName,
+          'level': row.level,
+          'initialValue': row.value,
+          'useType': row.useType,
+          'useTypeName': this.BaseTool.Object.getField(this.useTypeMap, row.useType),
+          'producerId': row.producerId,
+          'producerName': row.producerName,
+          'unit': row.unit,
+          'unitName': this.BaseTool.Object.getField(this.unitMap, row.unit)
+        })
+      })
+    },
+
+    beforeRecheckFileListUpload (file) {
+      const reg = /\.(xls|xlsx)(\?.*)?$/
+      return new Promise((resolve, reject) => {
+        if (reg.test(file.name)) {
+          this.recheckFileList = [file]
+          return true
+        } else {
+          this.$message.error(`请上传正确的xls|xlsx文件`)
+          reject(new Error('请上传正确的xls|xlsx文件'))
+          return false
+        }
+      })
+    },
+    beforeUploadPic (file) {
+      const reg = /\.(jpg|jpeg|png)(\?.*)?$/
+      return new Promise((resolve, reject) => {
+        if (reg.test(file.name)) {
+          this.sbFileList = [file]
+          return true
+        } else {
+          this.$message.error(`请上传正确的jpg|jpeg|png文件`)
+          reject(new Error('请上传正确的jpg|jpeg|png文件'))
+          return false
+        }
+      })
+    },
+    clearFileList () {
+      this.repairFileList = []
+      this.useFileList = []
+      this.recheckFileList = []
+      this.sbFileList = []
+    },
+    handleRepairFileChange (info) {
+      this.defaultRepairFileList = info.fileList
+      this.repairFileList = this.setFileList(info, 1)
+    },
+    handleUseFileChange (info) {
+      this.defaultUseFileList = info.fileList
+      this.useFileList = this.setFileList(info, 2)
+    },
+    handleAreaChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.FEN_GONG_SI }).then(res => {
+        this.companyList = res.data
+      })
+    },
+    handleCompanyChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.XIANG_MU_BU }).then(res => {
+        this.projectList = res.data
+      })
+    },
+    handleProjectChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BU_MEN }).then(res => {
+        this.deptList = res.data
+      })
+    },
+    handleDeptChange (value) {
+      getDeptsAllByParentId({ deptId: value, nature: this.DictCache.VALUE.SYS_DEPT_NATURE.BAN_ZU }).then(res => {
+        this.groupList = res.data
+      })
+    },
+    handleGroupChange (value) {
+      queryUserDeptByUserDeptId({ deptId: value }).then(res => {
+        this.userList = res.data
+      })
+    },
+    handleRecheckFileChange (info) {
+      this.defaultRecheckFileList = info.fileList
+      this.recheckFileList = this.setFileList(info, 3)
+    },
+    handleSbFileChange (info) {
+      this.defaultSbFileList = info.fileList
+      this.sbFileList = this.setFileList(info, 4)
+    },
+    setFileList1 (info, type) {
+      const fileList = [...info.fileList]
+      const file = [...info.file]
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return []
+      }
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base({}, {})
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'id': key,
+          'no': row.no,
+          'zbh': row.zbh,
+          'name': row.name,
+          'model': row.model
+        }))
+      })
+    },
+    handleChange (value) {
+      this.useType = value
+    },
+    handleProducerSelect () {
+      const modal = this.$refs.producerSelectModal
+      modal.base({}, { type: 1 })
+    },
+    handleProducerSelected (record, selectedRowKeys, selectedRow) {
+      const { form: { setFieldsValue } } = this
+      const [ key ] = selectedRowKeys
+      const [ row ] = selectedRow
+      setFieldsValue({
+        'producerId': key,
+        'producerName': row.name
+      })
+    },
+    setFileList (info, type) {
+      // { file, fileList }
+
+      const file = info.file
+      const fileList = info.fileList
+      // fileList = fileList.slice(-2)
+      // console.log(111, this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type))
+
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return null
+      }
+
+      // return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+
+      // 1. Limit the number of uploaded files
+      //    Only to show two recent uploaded files, and old ones will be replaced by the new
+      // fileList = fileList.slice(-2)
+
+      // 2. read from response and show file link
+      // fileList = fileList.map(file => {
+      //   if (file.response) {
+      //     // Component will show file.url as link
+      //     const { response: { data } } = file
+      //     file.url = data.url
+      //     file.fileName = data.fileName
+      //     file.fileFormat = data.fileFormat
+      //     file.name = data.name
+      //     file.type = type
+      //   }
+      //   return file
+      // })
+      // console.log(6666, fileList)
+      // return fileList
+    }
+  }
+}
+</script>

+ 73 - 26
src/views/sb/info/modules/Detail.vue

@@ -16,19 +16,26 @@
             <!--            <a-badge :count="numNumCheckjob" title="待保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
               <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="checkJobTableWaitDoListView()">待保养任务</a-button>
             </a-badge>-->
+            <a-button style="margin-left: 8px" type="primary" @click="handleMeasure()">检定记录</a-button>
             <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
           </span>
         </a-col>
       </a-row>
       <title-divider title="图片信息" width="90px"></title-divider>
+      <a-carousel effect="fade">
+        <div v-for="item in model.sbFileList">
+          <h3>
+            <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
+          </h3>
+        </div>
+      </a-carousel>
       <detail-list title="" :col="3">
-        <detail-list-item v-for="item in model.sbFileList" term="">
-          <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
-        </detail-list-item>
+        <!--        <detail-list-item v-for="item in model.sbFileList" term="">
+                  <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
+                </detail-list-item>-->
         <detail-list-item>
           <img-code :src="model.qrCode" :code-id="model.id" :width="200"></img-code>
         </detail-list-item>
-
       </detail-list>
 
       <title-divider title="基本信息" width="90px"></title-divider>
@@ -41,33 +48,44 @@
         <detail-list-item term="设备类型">{{ model.typeName }}</detail-list-item>
         <detail-list-item term="自定义类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</detail-list-item>
         <detail-list-item term="生产商">{{ model.producerName }}</detail-list-item>
-
         <detail-list-item term="大小尺寸">{{ model.zz }}</detail-list-item>
-        <detail-list-item term="系列号">{{ model.zzh }}</detail-list-item>
+        <detail-list-item term="系列号(出厂编号)">{{ model.zzh }}</detail-list-item>
         <detail-list-item term="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></detail-list-item>
         <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
       </detail-list>
-
-      <title-divider title="使用信息" width="90px"></title-divider>
       <detail-list title="" :col="3">
         <detail-list-item term="使用人">{{ model.saveUserName }}</detail-list-item>
         <detail-list-item term="维修人">{{ model.repairUserName }}</detail-list-item>
+        <detail-list-item term="第二维修人">{{ model.repairUserSecondName }}</detail-list-item>
       </detail-list>
-      <title-divider title="日期信息" width="90px"></title-divider>
       <detail-list title="" :col="3">
         <detail-list-item term="购置日期">{{ model.buyDate }}</detail-list-item>
         <detail-list-item term="投用日期">{{ model.startDate }}</detail-list-item>
-
       </detail-list>
-
-      <title-divider title="生产商" width="90px"></title-divider>
-      <detail-list title="" :col="3" >
-        <detail-list-item v-if="firmProducer != null" term="名称">{{ firmProducer.name }}</detail-list-item>
-        <detail-list-item v-if="firmProducer != null" term="等级">{{ BaseTool.Object.getField(firmProducerLevelMap,firmProducer.level) }}</detail-list-item>
-        <detail-list-item v-if="firmProducer != null" term="联系人">{{ firmProducer.contactPerson }}</detail-list-item>
-        <detail-list-item v-if="firmProducer != null" term="联系电话">{{ firmProducer.phone }}</detail-list-item>
-        <detail-list-item v-if="firmProducer != null" term="联系地址">{{ firmProducer.registerAddress }}</detail-list-item>
-        <detail-list-item v-if="firmProducer != null" term="备注">{{ firmProducer.remark }}</detail-list-item>
+      <title-divider  v-show="model.useType == 5" title="特种信息" width="90px"></title-divider>
+      <detail-list  v-show="model.useType == 5" title="" :col="3">
+        <detail-list-item term="注册代码">{{ model.registerNo }}</detail-list-item>
+        <detail-list-item term="介质属性">{{ model.characterType }}</detail-list-item>
+        <detail-list-item term="使用登记证编号">{{ model.usedNo }}</detail-list-item>
+        <detail-list-item term="维护供应商">{{ model.supplier }}</detail-list-item>
+        <detail-list-item term="设备批号">{{ model.batchNo }}</detail-list-item>
+        <detail-list-item term="预计工作年限">{{ model.workYear }}</detail-list-item>
+        <detail-list-item term="设计到期年限">{{ model.retirementDate }}</detail-list-item>
+        <detail-list-item term="登记日期">{{ model.registerDate }}</detail-list-item>
+      </detail-list>
+      <title-divider v-show="model.useType == 4" title="计量信息" width="90px"></title-divider>
+      <detail-list  v-show="model.useType == 4" title="" :col="3">
+        <detail-list-item term="测量设备编号">{{ model.cardNo }}</detail-list-item>
+        <detail-list-item term="准确度等级">{{ model.fdjxh }}</detail-list-item>
+        <detail-list-item term="检定日期">{{ model.checkDate }}</detail-list-item>
+        <detail-list-item term="检定周期">{{ model.checkPeriod }}</detail-list-item>
+        <detail-list-item term="有效日期">{{ model.nextCheckDate }}</detail-list-item>
+        <detail-list-item term="检定单位">{{ model.dph }}</detail-list-item>
+        <detail-list-item term="检定人">{{ model.zaiz }}</detail-list-item>
+        <detail-list-item term="检定结论">{{ BaseTool.Object.getField(rlTypeMap,model.rlType) }}</detail-list-item>
+        <detail-list-item term="是否周检查">{{ BaseTool.Object.getField(colorMap,model.color) }}</detail-list-item>
+        <detail-list-item term="检定证书编号">{{ model.sbdh }}</detail-list-item>
+        <detail-list-item term="预警天数">{{ model.seatNumber }}</detail-list-item>
       </detail-list>
       <title-divider title="文件信息" width="90px"></title-divider>
       <detail-list title="" :col="4">
@@ -108,6 +126,7 @@
     </div>
     <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
     <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
+    <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
     <part-info-list ref="partInfoList" />
     <!--    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
   </a-card>
@@ -129,6 +148,7 @@ import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
 import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
 import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
 import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
+import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheck'
 import PartInfoList from '@/views/part/info/modules/PartInfoList'
 const DetailListItem = DetailList.Item
 
@@ -145,7 +165,8 @@ export default {
     SbInspectionFillPageTable,
     DetailSbBom,
     DetailSbCheck,
-    PartInfoList
+    PartInfoList,
+    DetailSbMeasure
   },
   data () {
     return {
@@ -209,8 +230,6 @@ export default {
         'qrCode': null,
         'status': null,
         'remark': null,
-        'createdUserId': null,
-        'updateTime': null,
         'parentName': null,
         'createdUserName': null,
         'typeName': null,
@@ -224,10 +243,16 @@ export default {
         'rlType': null,
         'color': null,
         'seatNumber': null,
-        'zjm': null,
-        'jbdh': null,
-        'sbdh': null,
-        'bxgs': null
+
+        'registerNo': null,
+        'characterType': null,
+        'usedNo': null,
+        'supplier': null,
+        'repairUserSecond': null,
+        'batchNo': null,
+        'workYear': null,
+        'retirementDate': null,
+        'registerDate': null
       },
       numCheckStandard: 0,
       numNumCheckjob: 0,
@@ -269,6 +294,11 @@ export default {
       const modal = this.$refs.detailSbCheckModal
       modal.base(this.model)
     },
+    handleMeasure (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbMeasureModal
+      modal.base(this.model)
+    },
     base (record) {
       this.visible = true
       this.visibleDetail = true
@@ -348,3 +378,20 @@ export default {
   }
 }
 </script>
+<style scoped>
+/* For demo */
+.ant-carousel {
+  width: 300px;
+  height: 300px;
+}
+.ant-carousel >>> .slick-slide {
+  text-align: center;
+  height: 300px;
+  line-height: 300px;
+  overflow: hidden;
+}
+
+.ant-carousel >>> .slick-slide h3 {
+  color: #fff;
+}
+</style>

+ 362 - 0
src/views/sb/info/modules/DetailBak.vue

@@ -0,0 +1,362 @@
+<template>
+  <a-card :bordered="false" v-show="visibleDetail" class="card" :title="modalTitle">
+    <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-badge :count="numPartInfo" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="partInfoListView()">设备部位</a-button>
+            </a-badge>
+            <a-badge :count="numModelbom" title="备件总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
+            </a-badge>
+            <a-badge :count="numCheckStandard" title="保养项目总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
+            </a-badge>
+            <!--            <a-badge :count="numNumCheckjob" title="待保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="checkJobTableWaitDoListView()">待保养任务</a-button>
+            </a-badge>-->
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
+          </span>
+        </a-col>
+      </a-row>
+
+      <a-descriptions bordered title="基本信息">
+        <a-descriptions-item label="设备(新号)">{{ model.no }}</a-descriptions-item>
+        <a-descriptions-item label="设备(旧号)">{{ model.zbh }}</a-descriptions-item>
+        <a-descriptions-item label="设备描述">{{ model.name }}</a-descriptions-item>
+        <a-descriptions-item label="型号">{{ model.model }}</a-descriptions-item>
+        <a-descriptions-item label="ABC 标识">{{ BaseTool.Object.getField(levelMap,model.level) }}</a-descriptions-item>
+        <a-descriptions-item label="设备类型">{{ model.typeName }}</a-descriptions-item>
+        <a-descriptions-item label="自定义类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</a-descriptions-item>
+        <a-descriptions-item label="生产商">{{ model.producerName }}</a-descriptions-item>
+        <a-descriptions-item label="大小尺寸">{{ model.zz }}</a-descriptions-item>
+        <a-descriptions-item label="系列号(出厂编号)">{{ model.zzh }}</a-descriptions-item>
+        <a-descriptions-item label="使用人">{{ model.saveUserName }}</a-descriptions-item>
+        <a-descriptions-item label="维修人">{{ model.repairUserName }}</a-descriptions-item>
+        <a-descriptions-item label="第二维修人">{{ model.repairUserSecondName }}</a-descriptions-item>
+        <a-descriptions-item label="购置日期">{{ model.buyDate }}</a-descriptions-item>
+        <a-descriptions-item label="投用日期">{{ model.startDate }}</a-descriptions-item>
+        <a-descriptions-item label="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></a-descriptions-item>
+        <a-descriptions-item label="备注">{{ model.remark }}</a-descriptions-item>
+        <a-descriptions-item v-show="model.useType == 5" label="注册代码">{{ model.registerNo }}</a-descriptions-item>
+        <a-descriptions-item label="介质属性">{{ model.characterType }}</a-descriptions-item>
+        <a-descriptions-item label="使用登记证编号">{{ model.usedNo }}</a-descriptions-item>
+        <a-descriptions-item label="维护供应商">{{ model.supplier }}</a-descriptions-item>
+        <a-descriptions-item label="设备批号">{{ model.batchNo }}</a-descriptions-item>
+        <a-descriptions-item label="预计工作年限">{{ model.workYear }}</a-descriptions-item>
+        <a-descriptions-item label="设计到期年限">{{ model.retirementDate }}</a-descriptions-item>
+        <a-descriptions-item label="登记日期">{{ model.registerDate }}</a-descriptions-item>
+      </a-descriptions>
+      <a-descriptions bordered v-show="model.useType == 4" title="计量信息">
+        <a-descriptions-item label="测量设备编号">{{ model.cardNo }}</a-descriptions-item>
+        <a-descriptions-item label="准确度等级">{{ model.fdjxh }}</a-descriptions-item>
+        <a-descriptions-item label="检定日期">{{ model.checkDate }}</a-descriptions-item>
+        <a-descriptions-item label="检定周期">{{ model.checkPeriod }}</a-descriptions-item>
+        <a-descriptions-item label="有效日期">{{ model.nextCheckDate }}</a-descriptions-item>
+        <a-descriptions-item label="检定单位">{{ model.dph }}</a-descriptions-item>
+        <a-descriptions-item label="检定人">{{ model.zaiz }}</a-descriptions-item>
+        <a-descriptions-item label="检定结论">{{ BaseTool.Object.getField(rlTypeMap,model.rlType) }}</a-descriptions-item>
+        <a-descriptions-item label="是否周检查">{{ BaseTool.Object.getField(colorMap,model.color) }}</a-descriptions-item>
+        <a-descriptions-item label="检定证书编号">{{ model.sbdh }}</a-descriptions-item>
+        <a-descriptions-item label="预警天数">{{ model.seatNumber }}</a-descriptions-item>
+      </a-descriptions>
+      <a-descriptions bordered title="文件信息">
+        <a-descriptions-item label="维保手册">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.repairFileList)"
+          >
+          </a-upload>
+        </a-descriptions-item>
+        <a-descriptions-item label="使用手册">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.useFileList)"
+          >
+          </a-upload>
+        </a-descriptions-item>
+        <a-descriptions-item label="验收文件">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.recheckFileList)"
+          >
+          </a-upload>
+        </a-descriptions-item>
+      </a-descriptions>
+      <title-divider title="相关数据" width="90px"></title-divider>
+      <q-tabs :activeKey="activeKey" @change="changeTab">
+        <q-tab-pane key="1" tab="报修记录">
+          <repair-application-form-table :type="2" :table-params="{sbId: model.id, sbName: model.name}" ref="repairApplicationFormTable" />
+        </q-tab-pane>
+        <q-tab-pane key="2" tab="配件记录">
+          <spare-part-used-select-table :type="2" :table-params="{sbId: model.id, modelId: model.modelId}" ref="sparePartUsedSelectTable"/>
+        </q-tab-pane>
+        <q-tab-pane key="3" tab="保养任务">
+          <check-job-table :type="2" :check-type="2" :table-params="{sbId: model.id}" ref="spotJobTable" />
+        </q-tab-pane>
+      </q-tabs>
+    </div>
+    <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
+    <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
+    <part-info-list ref="partInfoList" />
+    <!--    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
+  </a-card>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
+import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
+// import CheckJobTableWaitDo from '@/views/check/checkjob/modules/CheckJobTableWaitDo'
+import { fetchFirmProducer } from '@/api/firm/producer'
+import { queryNumCheckStandard } from '@/api/check/checkstandard'
+import { queryNumCheckjob } from '@/api/check/checkjob'
+import { queryNumPartInfo } from '@/api/part/info'
+import { queryNumModelbom } from '@/api/sb/modelbom'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
+import SbOilPageTable from '@/views/sb/oil/modules/SbOilPageTable'
+import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
+import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
+import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
+import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
+import PartInfoList from '@/views/part/info/modules/PartInfoList'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'SbInfoDetail',
+  components: {
+    DetailList,
+    DetailListItem,
+    RepairApplicationFormTable,
+    CheckJobTable,
+    SparePartUsedSelectTable,
+    SbOilPageTable,
+    SbRunFillPageTable,
+    SbInspectionFillPageTable,
+    DetailSbBom,
+    DetailSbCheck,
+    PartInfoList
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      visibleDetail: false,
+      activeKey: '3',
+      collapseActiveKey: '1',
+      model: {
+        'no': null,
+        'financingNo': null,
+        'name': null,
+        'modelId': null,
+        'typeId': null,
+        'isShow': null,
+        'isChild': null,
+        'parentId': null,
+        'level': null,
+        'useType': null,
+        'rate': null,
+        'month': null,
+        'usedMonth': null,
+        'initialValue': null,
+        'currentValue': null,
+        'cutValue': null,
+        'producerId': null,
+        // 'sourceType': null,
+        // 'sourceSbId': null,
+        // 'parentId': null,
+        'unit': null,
+        // 'position': null,
+        // 'guigeId': null,
+        'useCompanyName': null,
+        'useProjectName': null,
+        'useDeptName': null,
+        'useGroupName': null,
+        'useUserName': null,
+        'saveDeptName': null,
+        'saveUserName': null,
+        'repairUserName': null,
+        'totalMiles': null,
+        'totalHours': null,
+        // 'lastBaoyangTime': null,
+        // 'lastBaoyangMiles': null,
+        // 'lastBaoyangHours': null,
+        // 'baoyangTimes': null,
+        'buyDate': null,
+        'startDate': null,
+        // 'nextCheckDate': null,
+        // 'guaranteeDate': null,
+        // 'workYear': null,
+        // 'retirementDate': null,
+        // 'depreciationType': null,
+        'wbFile': null,
+        'useFile': null,
+        'checkFile': null,
+        'sbImage': null,
+        'sbFileList': null,
+        'qrCode': null,
+        'status': null,
+        'remark': null,
+        'parentName': null,
+        'createdUserName': null,
+        'typeName': null,
+        'producerName': null,
+        'zzh': null,
+        'fdjxh': null,
+        'fdjh': null,
+        'cph': null,
+        'dph': null,
+        'zz': null,
+        'rlType': null,
+        'color': null,
+        'seatNumber': null,
+
+        'registerNo': null,
+        'characterType': null,
+        'usedNo': null,
+        'supplier': null,
+        'repairUserSecond': null,
+        'batchNo': null,
+        'workYear': null,
+        'retirementDate': null,
+        'registerDate': null
+      },
+      numCheckStandard: 0,
+      numNumCheckjob: 0,
+      numModelbom: 0,
+      numPartInfo: 0,
+      firmProducerLevelMap: {},
+      firmSupplier: {},
+      firmProducer: {},
+      statusMap: {},
+      useTypeMap: {},
+      levelMap: {},
+      unitMap: {},
+      colorMap: {},
+      rlTypeMap: {},
+      sourceTypeMap: {}
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.firmProducerLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FIRM_PRODUCER_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+  },
+  computed: {
+  },
+  methods: {
+    handleViewBom (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbBomModal
+      modal.base(this.model)
+    },
+    handleViewCheck (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbCheckModal
+      modal.base(this.model)
+    },
+    base (record) {
+      this.visible = true
+      this.visibleDetail = true
+      this.modalTitle = '详情'
+      this.model = record
+      this.activeKey = '1'
+      this.collapseActiveKey = '0'
+      this.fetchNum()
+      fetchFirmProducer({ id: this.model.producerId }).then(res => {
+        this.firmProducer = res.data
+      })
+    },
+    fetchNum () {
+      Promise.all([queryNumPartInfo({ sbId: this.model.id }), queryNumModelbom({ sbId: this.model.id }), queryNumCheckStandard({ sbId: this.model.id }), queryNumCheckjob({ sbId: this.model.id })])
+        .then((values) => {
+          this.numPartInfo = values[0].data
+          this.numModelbom = values[1].data
+          this.numCheckStandard = values[2].data
+          this.numNumCheckjob = values[3].data
+        })
+    },
+    changeTab (activeKey) {
+      this.activeKey = activeKey
+      if (this.activeKey === '1' && this.BaseTool.Object.isNotBlank(this.$refs.repairApplicationFormTable)) {
+        this.$refs.repairApplicationFormTable.handleOk()
+        return
+      }
+      if (this.activeKey === '2' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
+        this.$refs.sparePartUsedSelectTable.handleOk()
+        return
+      }
+      if (this.activeKey === '3' && this.BaseTool.Object.isNotBlank(this.$refs.spotJobTable)) {
+        this.$refs.spotJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.pollingJobTable)) {
+        this.$refs.pollingJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '5' && this.BaseTool.Object.isNotBlank(this.$refs.spotCheckJobTable)) {
+        this.$refs.spotCheckJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '6' && this.BaseTool.Object.isNotBlank(this.$refs.spotCheckJobTable)) {
+        this.$refs.spotCheckJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '7' && this.BaseTool.Object.isNotBlank(this.$refs.sbOilPageTable)) {
+        this.$refs.sbOilPageTable.handleOk()
+        return
+      }
+      if (this.activeKey === '8' && this.BaseTool.Object.isNotBlank(this.$refs.sbInspectionFillPageTable)) {
+        this.$refs.sbInspectionFillPageTable.handleOk()
+      }
+    },
+    getQrcodeSrc: (dom) => {
+      console.log(11, 22)
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.visibleDetail = false
+      this.confirmLoading = false
+      this.$emit('ok', values)
+    },
+    handleOk () {
+      this.visible = true
+      this.fetchNum()
+    },
+    partInfoListView () {
+      const modal = this.$refs.partInfoList
+      modal.base({ sbId: this.model.id }, { sbId: this.model.id })
+    },
+    checkJobTableWaitDoListView () {
+      const modal = this.$refs.checkJobTableWaitDo
+      modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })
+    }
+  }
+}
+</script>
+<style scoped>
+/* For demo */
+.ant-carousel {
+  width: 300px;
+  height: 300px;
+}
+.ant-carousel >>> .slick-slide {
+  text-align: center;
+  height: 300px;
+  line-height: 300px;
+  overflow: hidden;
+}
+
+.ant-carousel >>> .slick-slide h3 {
+  color: #fff;
+}
+</style>

+ 369 - 0
src/views/sb/info/modules/DetailMeasureRelation.vue

@@ -0,0 +1,369 @@
+<template>
+  <a-card :bordered="false" v-show="visibleDetail" class="card" :title="modalTitle">
+    <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" type="primary" @click="handleMeasure()">检定记录</a-button>
+            <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
+          </span>
+        </a-col>
+      </a-row>
+      <title-divider title="图片信息" width="90px"></title-divider>
+      <a-carousel effect="fade">
+        <div v-for="item in model.sbFileList">
+          <h3>
+            <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
+          </h3>
+        </div>
+      </a-carousel>
+      <detail-list title="" :col="3">
+        <!--        <detail-list-item v-for="item in model.sbFileList" term="">
+                  <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
+                </detail-list-item>-->
+        <detail-list-item>
+          <img-code :src="model.qrCode" :code-id="model.id" :width="200"></img-code>
+        </detail-list-item>
+      </detail-list>
+
+      <title-divider title="基本信息" width="90px"></title-divider>
+      <detail-list title="" :col="3">
+        <detail-list-item term="设备(新号)">{{ model.no }}</detail-list-item>
+        <detail-list-item term="设备(旧号)">{{ model.zbh }}</detail-list-item>
+        <detail-list-item term="设备描述">{{ model.name }}</detail-list-item>
+        <detail-list-item term="型号">{{ model.model }}</detail-list-item>
+        <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+      </detail-list>
+      <title-divider  v-show="model.useType == 5" title="特种信息" width="90px"></title-divider>
+      <detail-list  v-show="model.useType == 5" title="" :col="3">
+        <detail-list-item term="注册代码">{{ model.registerNo }}</detail-list-item>
+        <detail-list-item term="介质属性">{{ model.characterType }}</detail-list-item>
+        <detail-list-item term="使用登记证编号">{{ model.usedNo }}</detail-list-item>
+        <detail-list-item term="维护供应商">{{ model.supplier }}</detail-list-item>
+        <detail-list-item term="设备批号">{{ model.batchNo }}</detail-list-item>
+        <detail-list-item term="预计工作年限">{{ model.workYear }}</detail-list-item>
+        <detail-list-item term="设计到期年限">{{ model.retirementDate }}</detail-list-item>
+        <detail-list-item term="登记日期">{{ model.registerDate }}</detail-list-item>
+      </detail-list>
+      <title-divider v-show="model.useType == 4" title="计量信息" width="90px"></title-divider>
+      <detail-list  v-show="model.useType == 4" title="" :col="3">
+        <detail-list-item term="测量设备编号">{{ model.cardNo }}</detail-list-item>
+        <detail-list-item term="准确度等级">{{ model.fdjxh }}</detail-list-item>
+        <detail-list-item term="检定日期">{{ model.checkDate }}</detail-list-item>
+        <detail-list-item term="检定周期">{{ model.checkPeriod }}个月</detail-list-item>
+        <detail-list-item term="有效日期">{{ model.nextCheckDate }}</detail-list-item>
+        <detail-list-item term="检定单位">{{ model.dph }}</detail-list-item>
+        <detail-list-item term="检定人">{{ model.zaiz }}</detail-list-item>
+        <detail-list-item term="检定结论">{{ BaseTool.Object.getField(rlTypeMap,model.rlType) }}</detail-list-item>
+        <detail-list-item term="是否周检查">{{ BaseTool.Object.getField(colorMap,model.color) }}</detail-list-item>
+        <detail-list-item term="检定证书编号">{{ model.sbdh }}</detail-list-item>
+        <detail-list-item term="预警天数">{{ model.seatNumber }}天</detail-list-item>
+      </detail-list>
+<!--      <title-divider title="文件信息" width="90px"></title-divider>
+      <detail-list title="" :col="4">
+        <detail-list-item term="维保手册">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.repairFileList)"
+          >
+          </a-upload>
+        </detail-list-item>
+        <detail-list-item term="使用手册">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.useFileList)"
+          >
+          </a-upload>
+        </detail-list-item>
+        <detail-list-item term="验收文件">
+          <a-upload
+            :multiple="true"
+            :fileList="BaseTool.UPLOAD.transImg(model.recheckFileList)"
+          >
+          </a-upload>
+        </detail-list-item>
+      </detail-list>
+      <title-divider title="相关数据" width="90px"></title-divider>
+      <q-tabs :activeKey="activeKey" @change="changeTab">
+        <q-tab-pane key="1" tab="报修记录">
+          <repair-application-form-table :type="2" :table-params="{sbId: model.id, sbName: model.name}" ref="repairApplicationFormTable" />
+        </q-tab-pane>
+        <q-tab-pane key="2" tab="配件记录">
+          <spare-part-used-select-table :type="2" :table-params="{sbId: model.id, modelId: model.modelId}" ref="sparePartUsedSelectTable"/>
+        </q-tab-pane>
+        <q-tab-pane key="3" tab="保养任务">
+          <check-job-table :type="2" :check-type="2" :table-params="{sbId: model.id}" ref="spotJobTable" />
+        </q-tab-pane>
+      </q-tabs>-->
+    </div>
+    <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
+    <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
+    <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
+    <part-info-list ref="partInfoList" />
+    <!--    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
+  </a-card>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
+import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
+// import CheckJobTableWaitDo from '@/views/check/checkjob/modules/CheckJobTableWaitDo'
+import { fetchFirmProducer } from '@/api/firm/producer'
+import { queryNumCheckStandard } from '@/api/check/checkstandard'
+import { queryNumCheckjob } from '@/api/check/checkjob'
+import { queryNumPartInfo } from '@/api/part/info'
+import { queryNumModelbom } from '@/api/sb/modelbom'
+import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
+import SbOilPageTable from '@/views/sb/oil/modules/SbOilPageTable'
+import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
+import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
+import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
+import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
+import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheck'
+import PartInfoList from '@/views/part/info/modules/PartInfoList'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'SbInfoDetailMeasureRelation',
+  components: {
+    DetailList,
+    DetailListItem,
+    RepairApplicationFormTable,
+    CheckJobTable,
+    SparePartUsedSelectTable,
+    SbOilPageTable,
+    SbRunFillPageTable,
+    SbInspectionFillPageTable,
+    DetailSbBom,
+    DetailSbCheck,
+    PartInfoList,
+    DetailSbMeasure
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      visibleDetail: false,
+      activeKey: '3',
+      collapseActiveKey: '1',
+      model: {
+        'no': null,
+        'financingNo': null,
+        'name': null,
+        'modelId': null,
+        'typeId': null,
+        'isShow': null,
+        'isChild': null,
+        'parentId': null,
+        'level': null,
+        'useType': null,
+        'rate': null,
+        'month': null,
+        'usedMonth': null,
+        'initialValue': null,
+        'currentValue': null,
+        'cutValue': null,
+        'producerId': null,
+        // 'sourceType': null,
+        // 'sourceSbId': null,
+        // 'parentId': null,
+        'unit': null,
+        // 'position': null,
+        // 'guigeId': null,
+        'useCompanyName': null,
+        'useProjectName': null,
+        'useDeptName': null,
+        'useGroupName': null,
+        'useUserName': null,
+        'saveDeptName': null,
+        'saveUserName': null,
+        'repairUserName': null,
+        'totalMiles': null,
+        'totalHours': null,
+        // 'lastBaoyangTime': null,
+        // 'lastBaoyangMiles': null,
+        // 'lastBaoyangHours': null,
+        // 'baoyangTimes': null,
+        'buyDate': null,
+        'startDate': null,
+        // 'nextCheckDate': null,
+        // 'guaranteeDate': null,
+        // 'workYear': null,
+        // 'retirementDate': null,
+        // 'depreciationType': null,
+        'wbFile': null,
+        'useFile': null,
+        'checkFile': null,
+        'sbImage': null,
+        'sbFileList': null,
+        'qrCode': null,
+        'status': null,
+        'remark': null,
+        'parentName': null,
+        'createdUserName': null,
+        'typeName': null,
+        'producerName': null,
+        'zzh': null,
+        'fdjxh': null,
+        'fdjh': null,
+        'cph': null,
+        'dph': null,
+        'zz': null,
+        'rlType': null,
+        'color': null,
+        'seatNumber': null,
+
+        'registerNo': null,
+        'characterType': null,
+        'usedNo': null,
+        'supplier': null,
+        'repairUserSecond': null,
+        'batchNo': null,
+        'workYear': null,
+        'retirementDate': null,
+        'registerDate': null
+      },
+      numCheckStandard: 0,
+      numNumCheckjob: 0,
+      numModelbom: 0,
+      numPartInfo: 0,
+      firmProducerLevelMap: {},
+      firmSupplier: {},
+      firmProducer: {},
+      statusMap: {},
+      useTypeMap: {},
+      levelMap: {},
+      unitMap: {},
+      colorMap: {},
+      rlTypeMap: {},
+      sourceTypeMap: {}
+    }
+  },
+  created () {
+    this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
+    this.firmProducerLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FIRM_PRODUCER_LEVEL)
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
+    this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
+  },
+  computed: {
+  },
+  methods: {
+    handleViewBom (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbBomModal
+      modal.base(this.model)
+    },
+    handleViewCheck (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbCheckModal
+      modal.base(this.model)
+    },
+    handleMeasure (record) {
+      this.visible = false
+      const modal = this.$refs.detailSbMeasureModal
+      modal.base(this.model)
+    },
+    base (record) {
+      this.visible = true
+      this.visibleDetail = true
+      this.modalTitle = '详情'
+      this.model = record
+      this.activeKey = '1'
+      this.collapseActiveKey = '0'
+      this.fetchNum()
+      fetchFirmProducer({ id: this.model.producerId }).then(res => {
+        this.firmProducer = res.data
+      })
+    },
+    fetchNum () {
+      Promise.all([queryNumPartInfo({ sbId: this.model.id }), queryNumModelbom({ sbId: this.model.id }), queryNumCheckStandard({ sbId: this.model.id }), queryNumCheckjob({ sbId: this.model.id })])
+        .then((values) => {
+          this.numPartInfo = values[0].data
+          this.numModelbom = values[1].data
+          this.numCheckStandard = values[2].data
+          this.numNumCheckjob = values[3].data
+        })
+    },
+    changeTab (activeKey) {
+      this.activeKey = activeKey
+      if (this.activeKey === '1' && this.BaseTool.Object.isNotBlank(this.$refs.repairApplicationFormTable)) {
+        this.$refs.repairApplicationFormTable.handleOk()
+        return
+      }
+      if (this.activeKey === '2' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
+        this.$refs.sparePartUsedSelectTable.handleOk()
+        return
+      }
+      if (this.activeKey === '3' && this.BaseTool.Object.isNotBlank(this.$refs.spotJobTable)) {
+        this.$refs.spotJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.pollingJobTable)) {
+        this.$refs.pollingJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '5' && this.BaseTool.Object.isNotBlank(this.$refs.spotCheckJobTable)) {
+        this.$refs.spotCheckJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '6' && this.BaseTool.Object.isNotBlank(this.$refs.spotCheckJobTable)) {
+        this.$refs.spotCheckJobTable.handleOk()
+        return
+      }
+      if (this.activeKey === '7' && this.BaseTool.Object.isNotBlank(this.$refs.sbOilPageTable)) {
+        this.$refs.sbOilPageTable.handleOk()
+        return
+      }
+      if (this.activeKey === '8' && this.BaseTool.Object.isNotBlank(this.$refs.sbInspectionFillPageTable)) {
+        this.$refs.sbInspectionFillPageTable.handleOk()
+      }
+    },
+    getQrcodeSrc: (dom) => {
+      console.log(11, 22)
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.visibleDetail = false
+      this.confirmLoading = false
+      this.$emit('ok', values)
+    },
+    handleOk () {
+      this.visible = true
+      this.fetchNum()
+    },
+    partInfoListView () {
+      const modal = this.$refs.partInfoList
+      modal.base({ sbId: this.model.id }, { sbId: this.model.id })
+    },
+    checkJobTableWaitDoListView () {
+      const modal = this.$refs.checkJobTableWaitDo
+      modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })
+    }
+  }
+}
+</script>
+<style scoped>
+/* For demo */
+.ant-carousel {
+  width: 300px;
+  height: 300px;
+}
+.ant-carousel >>> .slick-slide {
+  text-align: center;
+  height: 300px;
+  line-height: 300px;
+  overflow: hidden;
+}
+
+.ant-carousel >>> .slick-slide h3 {
+  color: #fff;
+}
+</style>

+ 316 - 0
src/views/sb/measurelog/MeasureLog.vue

@@ -0,0 +1,316 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="工作名称">
+              <a-input v-model="queryParam.keyword" placeholder="请输入工作名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8 || 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"
+        v-if="($auth('check-spot-standards-export')||$auth('check-polling-standards-export'))"
+        type="primary"
+        icon="download"
+        @click="doExport">导出
+      </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>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :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>
+    <base-form ref="baseModal" :check-type="checkType" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import {
+  getCheckStandardPage,
+  deleteCheckStandards,
+  fetchCheckStandard,
+  exportCheckStandard
+} from '@/api/sb/measurelog'
+
+export default {
+  name: 'SbMeasureLogList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  props: {
+    /**
+     * 检查类型: 1-点检 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 1
+    }
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        type: this.checkType
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name'
+        },
+        // {
+        //  title: '编码',
+        // dataIndex: 'no'
+        // },
+        {
+          title: '部位',
+          dataIndex: 'part'
+        },
+        {
+          title: '内容',
+          dataIndex: 'requirement'
+        },
+        {
+          title: '计划周期',
+          dataIndex: 'period',
+          customRender: (text, record, index) => {
+            return text + this.BaseTool.Table.getMapText(this.periodTypeMap, record.periodType)
+          }
+        },
+        {
+          title: '动作类型',
+          dataIndex: 'actionType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.actionTypeMap, record.actionType)
+          }
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark'
+        },
+        {
+          title: '是否启用',
+          dataIndex: 'enable',
+          scopedSlots: { customRender: 'enable' }
+        },
+        {
+          title: '创建人名称',
+          dataIndex: 'createdUserName'
+        },
+        {
+          title: '创建时间',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      typeMap: {},
+      enableMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+          }
+        }
+        return getCheckStandardPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: {
+          show: true,
+          clear: () => {
+            this.selectedRowKeys = []
+          }
+        },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    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.tableOption()
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: {
+            show: true,
+            clear: () => {
+              this.selectedRowKeys = []
+            }
+          },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    batchDelete (id) {
+      let ids = []
+      if (this.BaseTool.String.isBlank(id)) {
+        const length = this.selectedRows.length
+        if (length === 0) {
+          this.$message.info('请选择要删除的记录')
+          return
+        }
+        ids = this.selectedRows.map(item => item.id)
+      } else {
+        ids = [id]
+      }
+      deleteCheckStandards(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchCheckStandard({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchCheckStandard({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      fetchCheckStandard({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        res.data.id = null
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {}
+      this.$refs.table.refresh(true)
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportCheckStandard(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    }
+  }
+}
+</script>

+ 637 - 0
src/views/sb/measurelog/modules/BaseForm.vue

@@ -0,0 +1,637 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false">
+        <a-input v-decorator="['id']" type="hidden"/>
+        <a-input v-decorator="['sbId']" type="hidden"/>
+        <a-input v-decorator="['part']" type="hidden"/>
+      </a-form-item>
+
+      <row-list :col="2">
+        <row-item>
+          <a-form-item
+            label="检定单号"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['no', {rules: [{required: false, message: '检定单号不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="检定日期"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-date-picker
+              style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+              v-decorator="['lastDate', {rules: [{required: false, message: '检定日期不能为空'}]}]" />
+          </a-form-item>
+        </row-item>
+<!--        <row-item>
+          <a-form-item
+            label="检查部位"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              disabled
+              style="width: 80%"
+              v-decorator="['partName', {rules: [{required: false, message: '检查部位不能为空'}]}]"/>
+            <a-button type="primary" style="width: 20%" @click="handlePartSelect">选择</a-button>
+          </a-form-item>
+        </row-item>-->
+        <row-item>
+          <a-form-item
+            label="检定人"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-input
+              v-decorator="['name']"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+      <row-list :col="1">
+        <row-item>
+          <a-form-item
+            label="备注"
+            :labelCol="BaseTool.Constant.labelCol2"
+            :wrapperCol="BaseTool.Constant.wrapperCol2"
+          >
+            <a-textarea
+              :rows="4"
+              v-decorator="['requirement', {rules: [{required: true, message: '备注不能为空'}]}]"/>
+          </a-form-item>
+        </row-item>
+      </row-list>
+      <row-list :col="2">
+        <row-item>
+          <a-form-item
+            label="图片"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="false"
+              list-type="picture"
+              accept="image/*"
+              :file-list="this.defaultCheckImgList"
+              @change="handleCheckImgChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传图片 </a-button>
+            </a-upload>
+          </a-form-item>
+        </row-item>
+        <row-item>
+          <a-form-item
+            label="文件"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-upload
+              :action="uploadUrl"
+              :multiple="true"
+              :file-list="this.defaultCheckFileList"
+              @change="handleCheckFileChange"
+              :headers="headers"
+            >
+              <a-button> <a-icon type="upload" /> 选择上传文件 </a-button>
+            </a-upload>
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+<!--    <a-tabs type="card" default-active-key="1">
+      <a-tab-pane key="1" tab="点检标准参数">
+        <div class="table-operator">
+          <a-button size="small" type="primary" @click="handleAdd">
+            <a-icon type="plus"/>
+            添加
+          </a-button>
+          <a-button class="margin-left8" size="small" type="danger" @click="handleDel">
+            <a-icon type="delete"/>
+            删除
+          </a-button>
+        </div>
+        <a-table
+          bordered
+          :data-source="data"
+          :columns="columns"
+          tableLayout="auto"
+          rowKey="id"
+          :row-selection="rowSelection">
+          <template
+            slot="name"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-input
+                class="my-form-item-required"
+                v-if="record.editable"
+                style="margin: -5px 0"
+                :value="text"
+                @change="e => handleChange(e.target.value, record.id, 'name')"
+              />
+              <template v-else>
+                {{ text }}
+              </template>
+            </div>
+          </template>
+
+          <template
+            slot="type"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-select
+                v-if="record.editable"
+                style="width: 80px"
+                :defaultValue="1"
+                @change="e => handleChange(e, record.id, 'type')"
+                placeholder="请选择">
+                <a-select-option
+                  v-for="(label,value) in paramTypeMap"
+                  :key="value"
+                  :label="label"
+                  :value="parseInt(value)">{{ label }}
+                </a-select-option>
+              </a-select>
+              <template v-else>
+                {{ BaseTool.Table.getMapText(paramTypeMap, text) }}
+              </template>
+            </div>
+          </template>
+
+          <template
+            slot="upperLimit"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-input
+                v-if="record.editable"
+                style="margin: -5px 0"
+                :value="text"
+                @change="e => handleChange(e.target.value, record.id, 'upperLimit')"
+              />
+              <template v-else>
+                {{ text }}
+              </template>
+            </div>
+          </template>
+
+          <template
+            slot="lowerrLimit"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-input
+                v-if="record.editable"
+                style="margin: -5px 0"
+                :value="text"
+                @change="e => handleChange(e.target.value, record.id, 'lowerrLimit')"
+              />
+              <template v-else>
+                {{ text }}
+              </template>
+            </div>
+          </template>
+
+          <template
+            slot="referenceValue"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-input
+                v-if="record.editable"
+                style="margin: -5px 0"
+                :value="text"
+                @change="e => handleChange(e.target.value, record.id, 'referenceValue')"
+              />
+              <template v-else>
+                {{ text }}
+              </template>
+            </div>
+          </template>
+
+          <template
+            slot="normalSelection"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-input
+                v-if="record.editable"
+                style="margin: -5px 0"
+                :value="text"
+                @change="e => handleChange(e.target.value, record.id, 'normalSelection')"
+              />
+              <template v-else>
+                {{ text }}
+              </template>
+            </div>
+          </template>
+
+          <template
+            slot="instruction"
+            slot-scope="text, record, index"
+          >
+            <div>
+              <a-input
+                v-if="record.editable"
+                style="margin: -5px 0"
+                :value="text"
+                @change="e => handleChange(e.target.value, record.id, 'instruction')"
+              />
+              <template v-else>
+                {{ text }}
+              </template>
+            </div>
+          </template>
+
+          <template slot="operation" slot-scope="text, record, index">
+            <div class="editable-row-operations">
+              <span v-if="record.editable">
+                <a @click="() => saveParam(record.id)">保存</a>
+                <a-divider type="vertical"/>
+                <a-popconfirm title="确定取消吗?" @confirm="() => cancel(record.id)">
+                  <a>取消</a>
+                </a-popconfirm>
+              </span>
+              <span v-else>
+                <a :disabled="editingKey !== ''" @click="() => edit(record.id)">编辑</a>
+              </span>
+            </div>
+          </template>
+        </a-table>
+      </a-tab-pane>
+    </a-tabs>-->
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+    <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { STable, Ellipsis } from '@/components'
+import { addCheckStandard, updateCheckStandard } from '@/api/sb/measurelog'
+import BaseTool from '../../../../utils/tool'
+import { queryUser } from '@/api/upms/user'
+import { uploadUrl } from '@/api/upms/file'
+import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+
+export default {
+  name: 'BaseCheckStandard',
+  components: {
+    STable,
+    Ellipsis,
+    PartInfoSelectModal
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      typeMap: {},
+      actionTypeMap: {},
+      paramTypeMap: {},
+      enableMap: {},
+      periodTypeMap: {},
+      checkImgList: [], // 图片
+      checkFileList: [], // 文档
+      defaultCheckImgList: [],
+      defaultCheckFileList: [],
+      uploadUrl: uploadUrl,
+      userList: {},
+      editingKey: '',
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      },
+      rowSelection: {
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys
+          this.selectedRows = selectedRows
+        }
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name',
+          scopedSlots: { customRender: 'name' }
+        },
+        {
+          title: '类型',
+          dataIndex: 'type',
+          scopedSlots: { customRender: 'type' }
+        },
+        {
+          title: '上限',
+          dataIndex: 'upperLimit',
+          scopedSlots: { customRender: 'upperLimit' }
+        },
+        {
+          title: '下限',
+          dataIndex: 'lowerrLimit',
+          scopedSlots: { customRender: 'lowerrLimit' }
+        },
+        {
+          title: '参考值',
+          dataIndex: 'referenceValue',
+          scopedSlots: { customRender: 'referenceValue' }
+        },
+        {
+          title: '正常选型',
+          dataIndex: 'normalSelection',
+          scopedSlots: { customRender: 'normalSelection' }
+        },
+        {
+          title: '说明',
+          dataIndex: 'instruction',
+          scopedSlots: { customRender: 'instruction' }
+        },
+        {
+          title: '操作',
+          dataIndex: 'operation',
+          width: 150,
+          scopedSlots: { customRender: 'operation' }
+        }
+      ],
+      data: [],
+      cacheData: [],
+      selectedRowKeys: [],
+      selectedRows: [],
+      options: {
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys
+        }
+      }
+    }
+  },
+  props: {
+  },
+  created () {
+    // 下拉框map
+    this.paramTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_PARAM_TYPE)
+    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.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+  },
+  methods: {
+    base (record, sbId) {
+      this.visible = true
+      queryUser({}).then(res => {
+        this.userList = res.data
+      })
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.data = []
+        this.cacheData = []
+        if (sbId != null) {
+          const { form: { setFieldsValue } } = this
+          // 日期处理
+          this.$nextTick(() => {
+            setFieldsValue({ sbId: sbId })
+          })
+        }
+        return
+      }
+      this.modalTitle = '编辑'
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        this.modalTitle = '复制'
+      }
+      this.checkImgList = record.checkImgList
+      this.checkFileList = record.checkFileList
+      this.defaultCheckImgList = this.BaseTool.UPLOAD.transImg(this.checkImgList)
+      this.defaultCheckFileList = this.BaseTool.UPLOAD.transImg(this.checkFileList)
+      const { form: { setFieldsValue } } = this
+      if (record.lastDate != null) {
+        record.lastDate = this.BaseTool.Moment(record.lastDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign(pick(record, [
+            'lastDate'
+          ])))
+        })
+      }
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'sbId',
+          'name',
+          'no',
+          'type',
+          'period',
+          'part',
+          'partName',
+          'checkUserId',
+          'periodType',
+          'actionType',
+          'enable',
+          'requirement',
+          'remark'
+        ])))
+      })
+      this.data = BaseTool.Object.copy(record.paramList)
+      this.cacheData = BaseTool.Object.copy(record.paramList)
+      this.editingKey = ''
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values.paramList = this.data
+        // 上传文件
+        values.checkImgList = this.checkImgList
+        values.checkFileList = this.checkFileList
+        // 日期数据的处理
+        values.lastDate = BaseTool.Date.formatter(values.lastDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN)
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addCheckStandard(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateCheckStandard(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    },
+    handleChange (value, key, column) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      if (target) {
+        target[column] = value
+        this.data = newData
+      }
+    },
+    edit (key) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      this.editingKey = key
+      if (target) {
+        target.editable = true
+        this.data = newData
+      }
+    },
+    saveParam (key) {
+      const newData = [...this.data]
+      const newCacheData = [...this.cacheData]
+      const target = newData.filter(item => key === item.id)[0]
+      // 校验数据
+      if (!this.checkParams(target)) {
+        return false
+      }
+      const targetCache = newCacheData.filter(item => key === item.id)[0]
+      console.log(targetCache, 686688)
+      if (target && targetCache) {
+        delete target.editable
+        this.data = newData
+        Object.assign(targetCache, target)
+        this.cacheData = newCacheData
+      }
+      this.editingKey = ''
+    },
+    checkParams (param) {
+      if (BaseTool.Object.isBlank(param.name)) {
+        this.$message.error('参数名称不能为空')
+        return false
+      }
+      return true
+    },
+    cancel (key) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      this.editingKey = ''
+      if (!this.checkParams(target)) {
+        const data = [...this.data]
+        const cacheData = [...this.cacheData]
+        this.data = data.filter(item => item.id !== key)
+        this.cacheData = cacheData.filter(item => item.id !== key)
+        return
+      }
+      if (target) {
+        Object.assign(target, this.cacheData.filter(item => key === item.id)[0])
+        console.log(target, 'target')
+        delete target.editable
+        this.data = newData
+      }
+    },
+    handleAdd () {
+      if (this.editingKey !== '') {
+        this.$message.error('请保存后再添加')
+        return false
+      }
+      const { data, cacheData } = this
+      console.log(this.data, this.cacheData)
+      const newParam = this.getNewParam()
+      const newCache = { ...newParam }
+      data.push(newParam)
+      cacheData.push(newCache)
+    },
+    handleDel () {
+      const data = [...this.data]
+      const cacheData = [...this.cacheData]
+      this.data = data.filter(item => !this.selectedRowKeys.includes(item.id))
+      this.cacheData = cacheData.filter(item => !this.selectedRowKeys.includes(item.id))
+      if (this.selectedRowKeys.includes(this.editingKey)) {
+        this.editingKey = ''
+      }
+    },
+    getNewParam () {
+      const newParam = {
+        name: '',
+        type: '1',
+        upperLimit: '',
+        lowerrLimit: '',
+        referenceValue: '',
+        normalSelection: '',
+        instruction: ''
+      }
+      newParam.id = new Date().getTime()
+      newParam.editable = true
+      this.editingKey = newParam.id
+      console.log(newParam, 'newparam')
+      return newParam
+    },
+    handlePartSelect () {
+      const sbId = this.form.getFieldValue('sbId')
+      this.$refs.partInfoSelectModal.base({ sbId })
+    },
+    handlePartSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'part': key,
+          'partName': row.name
+        }))
+      })
+    },
+    handleCheckImgChange (info) {
+      this.defaultCheckImgList = info.fileList
+      this.checkImgList = this.setFileList(info, 31)
+    },
+    handleCheckFileChange (info) {
+      this.defaultCheckFileList = info.fileList
+      this.checkFileList = this.setFileList(info, 32)
+    },
+    setFileList (info, type) {
+      const file = info.file
+      const fileList = info.fileList
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return null
+      }
+    }
+  }
+}
+</script>

+ 336 - 0
src/views/sb/measurelog/modules/BaseFormInsert.vue

@@ -0,0 +1,336 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="600"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false">
+        <a-input v-decorator="['standardId']" type="hidden"/>
+      </a-form-item>
+
+      <row-list :col="2">
+        <row-item>
+          <a-form-item
+            label="任务时间"
+            :labelCol="BaseTool.Constant.labelCol"
+            :wrapperCol="BaseTool.Constant.wrapperCol"
+          >
+            <a-date-picker
+              style="width: 100%"
+              :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
+              v-decorator="['startTime']" />
+          </a-form-item>
+        </row-item>
+      </row-list>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+    <part-info-select-modal ref="partInfoSelectModal" @selected="handlePartSelected"/>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { STable, Ellipsis } from '@/components'
+import BaseTool from '../../../../utils/tool'
+import { uploadUrl } from '@/api/upms/file'
+import PartInfoSelectModal from '@/views/part/info/modules/PartInfoSelectModal'
+import Vue from 'vue'
+import { ACCESS_TOKEN } from '@/store/mutation-types'
+import { generateJobByCheckStandard } from '@/api/check/checkstandard'
+
+export default {
+  name: 'BaseCheckStandard',
+  components: {
+    STable,
+    Ellipsis,
+    PartInfoSelectModal
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      // 下拉框map
+      typeMap: {},
+      actionTypeMap: {},
+      paramTypeMap: {},
+      enableMap: {},
+      periodTypeMap: {},
+      checkImgList: [], // 图片
+      checkFileList: [], // 文档
+      defaultCheckImgList: [],
+      defaultCheckFileList: [],
+      uploadUrl: uploadUrl,
+      userList: {},
+      editingKey: '',
+      headers: {
+        Authorization: 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
+      },
+      rowSelection: {
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys
+          this.selectedRows = selectedRows
+        }
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '名称',
+          dataIndex: 'name',
+          scopedSlots: { customRender: 'name' }
+        },
+        {
+          title: '类型',
+          dataIndex: 'type',
+          scopedSlots: { customRender: 'type' }
+        },
+        {
+          title: '上限',
+          dataIndex: 'upperLimit',
+          scopedSlots: { customRender: 'upperLimit' }
+        },
+        {
+          title: '下限',
+          dataIndex: 'lowerrLimit',
+          scopedSlots: { customRender: 'lowerrLimit' }
+        },
+        {
+          title: '参考值',
+          dataIndex: 'referenceValue',
+          scopedSlots: { customRender: 'referenceValue' }
+        },
+        {
+          title: '正常选型',
+          dataIndex: 'normalSelection',
+          scopedSlots: { customRender: 'normalSelection' }
+        },
+        {
+          title: '说明',
+          dataIndex: 'instruction',
+          scopedSlots: { customRender: 'instruction' }
+        },
+        {
+          title: '操作',
+          dataIndex: 'operation',
+          width: 150,
+          scopedSlots: { customRender: 'operation' }
+        }
+      ],
+      data: [],
+      cacheData: [],
+      selectedRowKeys: [],
+      selectedRows: [],
+      options: {
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys
+        }
+      }
+    }
+  },
+  props: {
+    /**
+     * 检查类型: 1-点检 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 1
+    }
+  },
+  created () {
+    // 下拉框map
+    this.paramTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_PARAM_TYPE)
+    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.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+  },
+  methods: {
+    base (record, standardId) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.data = []
+        this.cacheData = []
+        if (standardId != null) {
+          const { form: { setFieldsValue } } = this
+          // 日期处理
+          this.$nextTick(() => {
+            setFieldsValue({ standardId: standardId })
+          })
+        }
+        return
+      }
+      this.modalTitle = '编辑'
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        this.modalTitle = '复制'
+      }
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id'
+        ])))
+      })
+      this.data = BaseTool.Object.copy(record.paramList)
+      this.cacheData = BaseTool.Object.copy(record.paramList)
+      this.editingKey = ''
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values.startTime = BaseTool.Date.formatter(values.startTime, BaseTool.Date.PICKER_NORM_DATETIME_PATTERN)
+        if (this.BaseTool.String.isBlank(values.id)) {
+          generateJobByCheckStandard(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          generateJobByCheckStandard(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    },
+    handleChange (value, key, column) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      if (target) {
+        target[column] = value
+        this.data = newData
+      }
+    },
+    edit (key) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      this.editingKey = key
+      if (target) {
+        target.editable = true
+        this.data = newData
+      }
+    },
+    cancel (key) {
+      const newData = [...this.data]
+      const target = newData.filter(item => key === item.id)[0]
+      this.editingKey = ''
+      if (!this.checkParams(target)) {
+        const data = [...this.data]
+        const cacheData = [...this.cacheData]
+        this.data = data.filter(item => item.id !== key)
+        this.cacheData = cacheData.filter(item => item.id !== key)
+        return
+      }
+      if (target) {
+        Object.assign(target, this.cacheData.filter(item => key === item.id)[0])
+        console.log(target, 'target')
+        delete target.editable
+        this.data = newData
+      }
+    },
+    handleAdd () {
+      if (this.editingKey !== '') {
+        this.$message.error('请保存后再添加')
+        return false
+      }
+      const { data, cacheData } = this
+      console.log(this.data, this.cacheData)
+      const newParam = this.getNewParam()
+      const newCache = { ...newParam }
+      data.push(newParam)
+      cacheData.push(newCache)
+    },
+    handleDel () {
+      const data = [...this.data]
+      const cacheData = [...this.cacheData]
+      this.data = data.filter(item => !this.selectedRowKeys.includes(item.id))
+      this.cacheData = cacheData.filter(item => !this.selectedRowKeys.includes(item.id))
+      if (this.selectedRowKeys.includes(this.editingKey)) {
+        this.editingKey = ''
+      }
+    },
+    getNewParam () {
+      const newParam = {
+        name: '',
+        type: '1',
+        upperLimit: '',
+        lowerrLimit: '',
+        referenceValue: '',
+        normalSelection: '',
+        instruction: ''
+      }
+      newParam.id = new Date().getTime()
+      newParam.editable = true
+      this.editingKey = newParam.id
+      console.log(newParam, 'newparam')
+      return newParam
+    },
+    handlePartSelect () {
+      const sbId = this.form.getFieldValue('sbId')
+      this.$refs.partInfoSelectModal.base({ sbId })
+    },
+    handlePartSelected (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'part': key,
+          'partName': row.name
+        }))
+      })
+    },
+    handleCheckImgChange (info) {
+      this.defaultCheckImgList = info.fileList
+      this.checkImgList = this.setFileList(info, 1)
+    },
+    handleCheckFileChange (info) {
+      this.defaultCheckFileList = info.fileList
+      this.checkFileList = this.setFileList(info, 2)
+    },
+    setFileList (info, type) {
+      const file = info.file
+      const fileList = info.fileList
+      if (file.status === 'done') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'removed') {
+        return this.BaseTool.UPLOAD.getUploadFileDTO(fileList, type)
+      } else if (file.status === 'error') {
+        this.$message.error('上传失败')
+        return null
+      }
+    }
+  }
+}
+</script>

+ 318 - 0
src/views/sb/measurelog/modules/CheckStandardSelectModal.vue

@@ -0,0 +1,318 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1000"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+  >
+    <a-card :bordered="false">
+      <div class="table-page-search-wrapper">
+        <a-form layout="inline">
+          <a-row :gutter="48">
+            <a-col :md="8" :sm="24">
+              <a-form-item label="标准名称">
+                <a-input v-model="queryParam.keyword" placeholder="请输入标准名称"/>
+              </a-form-item>
+            </a-col>
+            <a-col :md="8 || 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">
+      </div>
+
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :customRow="options.customRow"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+      >
+        <span slot="action" slot-scope="record1">
+          <template>
+            <a @click="handleView(record1)">查看</a>
+          </template>
+        </span>
+        <span slot="enable" slot-scope="text">
+          <badge
+            :status="DictCache.COLOR.YES_NO[text]"
+            :text="enableMap[text]" />
+        </span>
+      </s-table>
+      <detail ref="detailModal"/>
+    </a-card>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">取消</a-button>
+      <a-button :loading="confirmLoading" type="primary" @click="handleSelect()">选择</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import Detail from './Detail'
+import { getCheckStandardPage, fetchCheckStandard } from '@/api/check/checkstandard'
+
+export default {
+  name: 'CheckStandardSelectModal',
+  components: {
+    STable,
+    Ellipsis,
+    Detail
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'radio'
+    },
+    selectedRowKey: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    selectedRow: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    /**
+     * 检查类型: 1-点检 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 1
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      periodTypeMap: {},
+      actionTypeMap: {},
+      record: null,
+      // 查询参数
+      queryParam: {
+        type: this.checkType
+      },
+      extraQueryParam: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '标准名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '检查类型',
+          dataIndex: 'type',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.typeMap, text)
+          }
+        },
+        {
+          title: '周期',
+          dataIndex: 'periodType',
+          customRender: (text, record, index) => {
+            return text + this.BaseTool.Table.getMapText(this.periodTypeMap, text)
+          }
+        },
+        {
+          title: '检查类型',
+          dataIndex: 'actionType',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Table.getMapText(this.actionTypeMap, text)
+          }
+        },
+        {
+          title: '部位',
+          dataIndex: 'part'
+        },
+        {
+          title: '要求',
+          dataIndex: 'requirement'
+        },
+
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 下拉框map
+      typeMap: {},
+      enableMap: {},
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          ...this.extraQueryParam,
+          dataScope: {
+          }
+        }
+        return getCheckStandardPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: {
+          show: true,
+          clear: () => {
+            this.selectedRowKeys = []
+          }
+        },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false,
+      isCreated: false
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
+
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: {
+            show: true,
+            clear: () => {
+              this.selectedRowKeys = []
+            }
+          },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            type: this.type,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id
+              }
+            })
+          },
+          customRow: (record) => {
+            return {
+              on: { // 事件
+                click: (event) => { // 点击行
+                  // 选择对象
+                  this.mySelect([record.id], [record])
+                },
+                dblclick: (event) => {
+                  this.mySelect([record.id], [record])
+                  this.handleSelect()
+                }
+              }
+            }
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleView (record) {
+      fetchCheckStandard({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {}
+      this.$refs.table.refresh(true)
+    },
+    base (record, queryParam = {}) {
+      this.visible = true
+      this.modalTitle = '选择信息'
+      this.extraQueryParam = queryParam
+      this.record = record
+      if (this.isCreated) {
+        this.$refs.table.clearSelected()
+        this.options.rowSelection.type = this.type
+        this.handleOk()
+      } else {
+        this.tableOption()
+        this.isCreated = true
+      }
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    handleSelect () {
+      if (this.selectedRowKeys.length === 0) {
+        this.$message.warn('请至少选择一项信息')
+      } else {
+        this.confirmLoading = true
+        this.$emit('selected', this.record, this.selectedRowKeys, this.selectedRows)
+        this.confirmLoading = false
+        this.visible = false
+      }
+    },
+    mySelect (selectedRowKeys, selectedRows) {
+      if (this.type === 'radio') {
+        this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
+        this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
+      } else {
+        let mySelectedRowKeys
+        let mySelectedRows = this.selectedRows.filter(item => item.id !== selectedRowKeys[0])
+        if (this.selectedRowKeys.includes(selectedRowKeys[0])) {
+          mySelectedRowKeys = this.selectedRowKeys.filter(item => item !== selectedRowKeys[0])
+        } else {
+          mySelectedRowKeys = [...selectedRowKeys, ...this.selectedRowKeys]
+          mySelectedRows = [...mySelectedRows, ...selectedRows]
+        }
+        this.$refs.table.updateSelect(mySelectedRowKeys, mySelectedRows)
+        this.$refs.table.rowSelection.onChange(mySelectedRowKeys, mySelectedRows)
+      }
+    }
+  }
+}
+</script>

+ 163 - 0
src/views/sb/measurelog/modules/Detail.vue

@@ -0,0 +1,163 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <detail-list title="" :col="2">
+      <detail-list-item term="检定单号">{{ model.no }}</detail-list-item>
+      <detail-list-item term="检定人">{{ model.name }}</detail-list-item>
+      <detail-list-item term="检定日期">{{ model.lastDate }}</detail-list-item>
+      <detail-list-item term="创建时间">{{ model.createdTime }}</detail-list-item>
+    </detail-list>
+    <detail-list title="" :col="1">
+      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+    </detail-list>
+    <detail-list title="标准图片" :col="8">
+      <detail-list-item v-for="item in model.checkImgList" term="">
+        <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
+      </detail-list-item>
+    </detail-list>
+    <detail-list title="" :col="8">
+      <detail-list-item term="文件">
+        <a-upload
+          :multiple="true"
+          :fileList="BaseTool.UPLOAD.transImg(model.checkFileList)"
+        >
+        </a-upload>
+      </detail-list-item>
+    </detail-list>
+<!--    <a-tabs type="card" default-active-key="1">
+      <a-tab-pane key="1" tab="点检标准参数">
+        <a-table
+          bordered
+          :data-source="data"
+          :columns="columns"
+          tableLayout="auto"
+          rowKey="id"
+        >
+        </a-table>
+      </a-tab-pane>
+    </a-tabs>-->
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'CheckStandardDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      // 下拉框map
+      typeMap: {},
+      periodTypeMap: {},
+      actionTypeMap: {},
+      enableMap: {},
+      model: {
+        'name': null,
+        'no': null,
+        'type': null,
+        'part': null,
+        'enable': null,
+        'requirement': null,
+        'standardHours': null,
+        'remark': null,
+        'createdUserId': null,
+        'updateUserId': null,
+        'updateUserName': null,
+        'updateTime': null
+      },
+      rowSelection: {
+        onChange: (selectedRowKeys, selectedRows) => {
+          this.selectedRowKeys = selectedRowKeys
+          this.selectedRows = selectedRows
+        }
+      },
+      // 表头
+      columns: [
+        {
+          title: '名称',
+          dataIndex: 'name',
+          scopedSlots: { customRender: 'name' }
+        },
+        {
+          title: '类型',
+          dataIndex: 'type',
+          scopedSlots: { customRender: 'type' }
+          // customRender: (text, record, index) => {
+          //   return this.BaseTool.Table.getMapText(this.typeMap, text)
+          // }
+        },
+        {
+          title: '上限',
+          dataIndex: 'upperLimit',
+          scopedSlots: { customRender: 'upperLimit' }
+        },
+        {
+          title: '下限',
+          dataIndex: 'lowerrLimit',
+          scopedSlots: { customRender: 'lowerrLimit' }
+        },
+        {
+          title: '参考值',
+          dataIndex: 'referenceValue',
+          scopedSlots: { customRender: 'referenceValue' }
+        },
+        {
+          title: '正常选型',
+          dataIndex: 'normalSelection',
+          scopedSlots: { customRender: 'normalSelection' }
+        },
+        {
+          title: '说明',
+          dataIndex: 'instruction',
+          scopedSlots: { customRender: 'instruction' }
+        }
+      ],
+      data: [],
+      options: {
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys
+        }
+      }
+    }
+  },
+  created () {
+    // 下拉框map
+    this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_STANDARD_TYPE)
+    this.enableMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
+    this.periodTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_PERIOD_TYPE)
+    this.actionTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.CHECK_PLAN_ACTION_TYPE)
+
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+      this.data = record.paramList
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    }
+
+  }
+}
+</script>

+ 238 - 0
src/views/sb/measurelog/modules/DetailSbCheck.vue

@@ -0,0 +1,238 @@
+<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>
+    <title-divider title="设备信息" width="90px"></title-divider>
+    <detail-list title="" :col="3">
+      <detail-list-item term="设备新号">{{ model.no }}</detail-list-item>
+      <detail-list-item term="设备旧号">{{ model.zbh }}</detail-list-item>
+      <detail-list-item term="型号">{{ model.model }}</detail-list-item>
+      <detail-list-item term="设备名称">{{ model.name }}</detail-list-item>
+      <detail-list-item term="检定日期">{{ model.checkDate }}</detail-list-item>
+      <detail-list-item term="检定周期">{{ model.checkPeriod }}个月</detail-list-item>
+      <detail-list-item term="检定有效期">{{ model.nextCheckDate }}</detail-list-item>
+      <detail-list-item term="预警天数">{{ model.seatNumber }}天</detail-list-item>
+    </detail-list>
+    <title-divider title="检定信息" width="90px"></title-divider>
+    <div class="table-operator">
+      <a-button type="primary" @click="handleAdd">
+        <a-icon type="plus"/>
+        添加
+      </a-button>
+      <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
+        <a-icon type="plus"/>
+        复制
+      </a-button>
+      <!--      <a-button style="margin-left: 8px" type="primary" icon="download" @click="doExport">导出</a-button>-->
+    </div>
+    <a-table
+      :data-source="data"
+      :columns="columns"
+      tableLayout="auto"
+      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>
+        </template>
+      </span>
+    </a-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <base-form-insert ref="baseModalInsert" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+    <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+
+  </div>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import {
+  queryCheckStandard,
+  deleteCheckStandards,
+  exportCheckStandard,
+  fetchCheckStandard
+} from '@/api/sb/measurelog'
+import BaseForm from './BaseForm'
+import BaseFormInsert from './BaseFormInsert'
+import Detail from './Detail'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+import { fetchSbInfo } from '@/api/sb/info'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'DetailSbMeasure',
+  components: {
+    DetailList,
+    DetailListItem,
+    BaseForm,
+    Detail,
+    SbInfoSelectModal,
+    BaseFormInsert
+  },
+  props: {
+  },
+  data () {
+    return {
+      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: {},
+      actionTypeMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '检定单号',
+          dataIndex: 'no'
+        },
+        {
+          title: '检定人',
+          dataIndex: 'name'
+        },
+        {
+          title: '检定日期',
+          dataIndex: 'lastDate'
+        },
+        {
+          title: '创建日期',
+          dataIndex: 'createdTime'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          align: 'center',
+          // fixed: 'right',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      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)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      this.modalTitle = '详情2'
+      queryCheckStandard({ sbId: record.id }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleOk () {
+      queryCheckStandard({ sbId: this.model.id }).then(res => {
+        this.data = res.data
+      })
+      fetchSbInfo({ id: this.model.id }).then(res => {
+        this.model = res.data
+      })
+    },
+    handleAdd () {
+      const modal = this.$refs.baseModal
+      modal.base(null, this.model.id)
+    },
+    handleView (record) {
+      fetchCheckStandard({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        res.data.partName = record.partName
+        modal.base(res.data)
+      })
+    },
+    handleEdit (record) {
+      fetchCheckStandard({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      const modal = this.$refs.baseModal
+      const data = record
+      data.id = null
+      modal.base(data)
+    },
+    handleGenerate (record) {
+      const modal = this.$refs.baseModalInsert
+      modal.base(null, record.id)
+    },
+    handleCancel () {
+      this.visible = false
+      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]
+      }
+      deleteCheckStandards(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+      })
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      parameter.modelId = this.model.id
+      exportCheckStandard(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    handleSbSelectd (keys, rows) {
+      const [ key ] = keys
+      const [ row ] = rows
+      // 日期处理
+      copy({ sbId: this.model.id, copySbId: row.id })
+        .then((response) => {
+          this.$message.info(response.data)
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    }
+  }
+}
+</script>

+ 11 - 1
src/views/store/instoreform/InStoreForm.vue

@@ -68,6 +68,10 @@
           <a-popconfirm v-if="$auth('store-in-store-forms-del')&& record.status==1" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
             <a>删除</a>
           </a-popconfirm>
+          <a-divider v-if="record.status==2" type="vertical" />
+          <a-popconfirm v-if="record.status==2" title="是否要撤销?" @confirm="updateStoreBack(record.id)">
+            <a>撤销</a>
+          </a-popconfirm>
         </template>
       </span>
        <span slot="status" slot-scope="text">
@@ -85,7 +89,7 @@
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
 import Detail from './modules/Detail'
-import { getInStoreFormPage, deleteInStoreForms, fetchInStoreForm, updateStore, exportInStoreForm } from '@/api/store/instoreform'
+import { getInStoreFormPage, deleteInStoreForms, fetchInStoreForm, updateStore, updateStoreBack, exportInStoreForm } from '@/api/store/instoreform'
 
 export default {
   name: 'InStoreFormList',
@@ -254,6 +258,12 @@ export default {
         this.$refs.table.refresh()
       })
     },
+    updateStoreBack(id){
+      updateStoreBack({id:id}).then(res => {
+        this.$message.info('撤销成功')
+        this.$refs.table.refresh()
+      })
+    },
     handleView (record) {
       fetchInStoreForm({ id: record.id }).then(res => {
         const modal = this.$refs.detailModal

+ 5 - 1
src/views/store/outstoreform/OutStoreForm.vue

@@ -70,6 +70,10 @@
             <a-popconfirm v-if="$auth('store-out-store-forms-del')&&record.status==1" title="是否要删除该条数据?" @confirm="batchDelete(record.id)">
               <a>删除</a>
             </a-popconfirm>
+            <a-divider v-if="record.status==2" type="vertical" />
+            <a-popconfirm v-if="record.status==2" title="是否要撤销?" @confirm="updateStoreBack(record.id)">
+              <a>撤销</a>
+            </a-popconfirm>
           </template>
         </span>
         <span slot="status" slot-scope="text">
@@ -88,7 +92,7 @@
 import { STable, Ellipsis } from '@/components'
 import BaseForm from './modules/BaseForm'
 import Detail from './modules/Detail'
-import { updateStore, getOutStoreFormPage, deleteOutStoreForms, fetchOutStoreForm, exportOutStoreForm } from '@/api/store/outstoreform'
+import { updateStore, updateStoreBack, getOutStoreFormPage, deleteOutStoreForms, fetchOutStoreForm, exportOutStoreForm } from '@/api/store/outstoreform'
 import { fetchInStoreForm } from '@/api/store/instoreform'
 
 export default {