xiongchao 3 éve
szülő
commit
0cb35b1bce

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

@@ -33,6 +33,22 @@ export function getMeasureWarn (parameter) {
   })
 }
 
+/**
+ * 获取子设备的数量
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryChildNumSbInfo (parameter) {
+  return axios({
+    url: '/sb/infos/child/num?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * page func
  * parameter: { }
@@ -147,6 +163,41 @@ export function updateSbInfo (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSbInfoChildBatch (parameter) {
+  return axios({
+    url: '/sb/infos/child/batch',
+    method: 'PUT',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSbInfoChildCancel (parameter) {
+  return axios({
+    url: '/sb/infos/cancel/' + parameter.id,
+    method: 'PUT',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * fetch single func
  * parameter: { }

+ 3 - 3
src/utils/dict.js

@@ -526,9 +526,9 @@ DictCache.VALUE = {
     TZSB: 5// 特种设备
   },
   SB_IS_CHILD: {
-    IS_CHILD: "1", // 子类
-    IS_PARENT: "2", // 父类
-    IS_NORMAL: "3" // 普通设备
+    IS_CHILD: '1', // 子类
+    IS_PARENT: '2', // 父类
+    IS_NORMAL: '3' // 普通设备
   },
   /**
    * 设备状态

+ 58 - 15
src/views/sb/info/MeasureSbInfo.vue

@@ -49,7 +49,7 @@
           </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>
@@ -108,7 +108,7 @@
 
       </a-col>
     </a-row>
-<!--    <base-form ref="baseModal" :useType="4" @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"/>
@@ -121,9 +121,9 @@
 
 <script>
 import { STable, Ellipsis } from '@/components'
-/*import BaseForm from './modules/BaseForm'*/
+/* import BaseForm from './modules/BaseForm' */
 import BaseFormMeasureRelation from './modules/BaseFormMeasureRelation'
-/*import Detail from './modules/Detail'*/
+/* import Detail from './modules/Detail' */
 import Detail from './modules/DetailMeasureRelation'
 import DownloadModal from '@/views/download/DownloadModal'
 import PreviewModal from '@/views/preview/PreviewModal'
@@ -177,6 +177,7 @@ export default {
         {
           title: '序号',
           dataIndex: 'index',
+          width: 50,
           checked: true,
           customRender: (text, record, index) => {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
@@ -185,22 +186,20 @@ export default {
         {
           title: '设备名称',
           checked: true,
+          width: 200,
           dataIndex: 'name'
         },
         {
           title: '设备编号',
           dataIndex: 'no',
+          width: 100,
           checked: true
         },
-   /*     {
-          title: '规格型号',
-          checked: true,
-          dataIndex: 'model'
-        },*/
         {
           title: '设备类型',
           checked: true,
           dataIndex: 'type',
+          width: 100,
           customRender: (text, record, index) => {
             return record.typeName
           }
@@ -209,6 +208,7 @@ export default {
           title: '设备等级',
           checked: true,
           dataIndex: 'level',
+          width: 100,
           customRender: (text, record, index) => {
             return this.BaseTool.Object.getField(this.levelMap, text)
           }
@@ -216,35 +216,78 @@ export default {
         {
           title: '设备原值',
           dataIndex: 'initialValue',
+          width: 100,
           customRender: (text, record, index) => {
             return this.BaseTool.Amount.formatter(text)
           }
         },
         {
           title: '购置日期',
-          dataIndex: 'buyDate'
+          dataIndex: 'buyDate',
+          width: 100,
+          checked: true
         },
         {
           title: '投用日期',
-          dataIndex: 'startDate'
+          dataIndex: 'startDate',
+          width: 100,
+          checked: true
         },
         {
-          title: '下次检定日期',
-          dataIndex: 'nextCheckDate'
+          title: '检定日期',
+          dataIndex: 'checkDate',
+          width: 150,
+          checked: true
+        },
+        {
+          title: '检定周期',
+          dataIndex: 'checkPeriod',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return text + '月'
+            }
+          }
+        },
+        {
+          title: '检定有效期',
+          dataIndex: 'nextCheckDate',
+          width: 150,
+          fixed: 'right',
+          checked: true
+        },
+        {
+          title: '检定截止',
+          dataIndex: 'restDay',
+          width: 100,
+          fixed: 'right',
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
+            }
+          }
         },
-
         {
           title: '状态',
           checked: true,
           dataIndex: 'status',
+          width: 100,
+          fixed: 'right',
           scopedSlots: { customRender: 'status' }
         },
         {
           title: '操作',
           key: 'action',
           checked: true,
+          fixed: 'right',
           align: 'center',
-          width: '300',
+          width: '100',
           scopedSlots: { customRender: 'action' }
         }
       ],

+ 0 - 2
src/views/sb/info/ParentSbInfo.vue

@@ -51,8 +51,6 @@
           <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">

+ 81 - 17
src/views/sb/info/SbInfo.vue

@@ -1,7 +1,7 @@
 <template>
   <a-card :bordered="false">
     <a-row :gutter="8" v-show="visible">
-      <a-col :span="4">
+<!--      <a-col :span="4">
         <a-tree
           @expand="onExpand"
           :expandedKeys="expandedKeys"
@@ -10,8 +10,8 @@
           :selectedKeys="selectedKeys"
           :treeData="treeData"
         />
-      </a-col>
-      <a-col :span="20">
+      </a-col>-->
+      <a-col :span="24">
         <div>
           <div class="table-page-search-wrapper">
             <a-form layout="inline">
@@ -26,7 +26,21 @@
                     <a-input v-model="queryParam.zbh" placeholder="请输入设备旧号"/>
                   </a-form-item>
                 </a-col>
-                <a-col :md="8" :sm="24">
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="设备类型">
+                    <a-tree-select
+                      style="width: 100%"
+                      :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+                      :treeData="treeData"
+                      :treeNodeFilterProp="'title'"
+                      :showSearch="true"
+                      v-model="queryParam.parentId"
+                      placeholder="请选择"
+                    >
+                    </a-tree-select>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="6" :sm="24">
                   <a-form-item label="设备状态">
                     <a-select v-model="queryParam.status" placeholder="请选择">
                       <a-select-option
@@ -38,6 +52,15 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
+                <a-col :md="6" :sm="24">
+                  <a-form-item label="主子设备">
+                    <a-select v-model="queryParam.isChild" placeholder="请选择">
+                      <a-select-option value="1">子设备</a-select-option>
+                      <a-select-option value="2">父设备</a-select-option>
+                      <a-select-option value="3">普通设备</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>
@@ -195,6 +218,7 @@ export default {
         {
           title: '序号',
           dataIndex: 'index',
+          width: 50,
           checked: true,
           customRender: (text, record, index) => {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
@@ -203,21 +227,20 @@ export default {
         {
           title: '设备名称',
           checked: true,
+          width: 200,
           dataIndex: 'name'
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'no',
+          width: 100,
           checked: true
         },
-        {
-          title: '设备旧号',
-          dataIndex: 'zbh'
-        },
         {
           title: '设备类型',
           checked: true,
           dataIndex: 'type',
+          width: 100,
           customRender: (text, record, index) => {
             return record.typeName
           }
@@ -226,45 +249,86 @@ export default {
           title: '设备等级',
           checked: true,
           dataIndex: 'level',
+          width: 100,
           customRender: (text, record, index) => {
             return this.BaseTool.Object.getField(this.levelMap, text)
           }
         },
         {
           title: '设备原值',
-          checked: true,
           dataIndex: 'initialValue',
+          width: 100,
           customRender: (text, record, index) => {
             return this.BaseTool.Amount.formatter(text)
           }
         },
         {
           title: '购置日期',
-          checked: true,
-          dataIndex: 'buyDate'
+          dataIndex: 'buyDate',
+          width: 100,
+          checked: true
         },
         {
           title: '投用日期',
+          dataIndex: 'startDate',
+          width: 100,
+          checked: true
+        },
+        {
+          title: '检定日期',
+          dataIndex: 'checkDate',
+          width: 150,
+          checked: true
+        },
+        {
+          title: '检定周期',
+          dataIndex: 'checkPeriod',
+          width: 100,
           checked: true,
-          dataIndex: 'startDate'
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return text + '月'
+            }
+          }
         },
         {
-          title: '下次检定日期',
-          dataIndex: 'nextCheckDate'
+          title: '检定有效期',
+          dataIndex: 'nextCheckDate',
+          width: 150,
+          fixed: 'right',
+          checked: true
+        },
+        {
+          title: '检定截止',
+          dataIndex: 'restDay',
+          width: 100,
+          fixed: 'right',
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
+            }
+          }
         },
-
         {
           title: '状态',
           checked: true,
           dataIndex: 'status',
+          width: 100,
+          fixed: 'right',
           scopedSlots: { customRender: 'status' }
         },
         {
           title: '操作',
           key: 'action',
           checked: true,
+          fixed: 'right',
           align: 'center',
-          width: '300',
+          width: '100',
           scopedSlots: { customRender: 'action' }
         }
       ],

+ 27 - 3
src/views/sb/info/modules/BaseForm.vue

@@ -225,9 +225,10 @@
           >
             <a-input
               disabled
-              style="width: 80%"
+              style="width: 60%"
               v-decorator="['parentSbName']"/>
             <a-button type="primary" style="width: 20%" @click="handleSbSelect">选择</a-button>
+            <a-button type="default" style="width: 20%" @click="clearParent">清空</a-button>
           </a-form-item>
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
@@ -236,7 +237,7 @@
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
-            <a-select v-decorator="['isChild']" placeholder="请选择">
+            <a-select @change="childChange" v-decorator="['isChild']" placeholder="请选择">
               <a-select-option value="1">子设备</a-select-option>
               <a-select-option value="2">父设备</a-select-option>
               <a-select-option value="3">普通设备</a-select-option>
@@ -704,7 +705,7 @@
         <a-row class="form-row" :gutter="BaseTool.Constant.row.gutter">
           <a-col :lg="12" :md="24" :sm="24">
             <a-form-item
-              label="有效期至"
+              label="检定有效期至"
               :labelCol="BaseTool.Constant.labelCol"
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
@@ -1270,6 +1271,29 @@ export default {
         return []
       }
     },
+    clearParent () {
+      const { form: { setFieldsValue } } = this
+      // 日期处理
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign({
+          'parentId': null,
+          'parentSbName': null
+        }))
+      })
+    },
+    // 主子设备切换
+    childChange (value) {
+      if (value === this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT || value === this.DictCache.VALUE.SB_IS_CHILD.IS_NORMAL) {
+        const { form: { setFieldsValue } } = this
+        // 日期处理
+        this.$nextTick(() => {
+          setFieldsValue(Object.assign({
+            'parentId': null,
+            'parentSbName': null
+          }))
+        })
+      }
+    },
     handleSbSelect () {
       this.$refs.sbInfoSelectModal.base({}, { isChild: this.DictCache.VALUE.SB_IS_CHILD.IS_PARENT })
     },

+ 68 - 14
src/views/sb/info/modules/BaseFormMeasureRelation.vue

@@ -26,7 +26,7 @@
             <a-input
               disabled
               style='width:70%'
-              v-decorator="['no', {rules: [{required: true, message: '不能为空'}]}]" />
+              v-decorator="['no', {rules: [{required: true, message: '请选择关联设备'}]}]" />
             <a-button style="width: 30%" type="primary" @click="handleSbSelect">选择</a-button>
           </a-form-item>
         </a-col>
@@ -38,7 +38,7 @@
           >
             <a-input
               disabled
-              v-decorator="['zbh', {rules: [{required: false, message: '不能为空'}]}]" />
+              v-decorator="['zbh']" />
           </a-form-item>
         </a-col>
       </a-row>
@@ -51,7 +51,7 @@
           >
             <a-input
               disabled
-              v-decorator="['name', {rules: [{required: true, message: '设备名称不能为空'}]}]" />
+              v-decorator="['name']" />
           </a-form-item>
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
@@ -62,7 +62,51 @@
           >
             <a-input
               disabled
-              v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
+              v-decorator="['model']" />
+          </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="['zzh']" />
+          </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="['saveUserName']" />
+          </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="['positionId']" />
+          </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="['producerName']" />
           </a-form-item>
         </a-col>
       </a-row>
@@ -168,6 +212,16 @@
       <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="['guigeId', {rules: [{required: true, message: '请填写原计量系统主键'}]}]" />
+            </a-form-item>
+          </a-col>
           <a-col :lg="12" :md="24" :sm="24">
             <a-form-item
               label="测量设备编号"
@@ -175,7 +229,7 @@
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
               <a-input
-                v-decorator="['cardNo']" />
+                v-decorator="['cardNo', {rules: [{required: true, message: '请选择关联设备'}]}]" />
             </a-form-item>
           </a-col>
           <a-col :lg="12" :md="24" :sm="24">
@@ -185,7 +239,7 @@
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
               <a-input
-                v-decorator="['fdjxh']" />
+                v-decorator="['fdjxh', {rules: [{required: true, message: '请填写准确度等级'}]}]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -207,7 +261,7 @@
               :wrapperCol="BaseTool.Constant.wrapperCol"
             >
               <a-input
-                v-decorator="['zaiz']" />
+                v-decorator="['zaiz', {rules: [{required: true, message: '请填写检定人'}]}]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -268,7 +322,7 @@
                 :step="0.01"
                 :formatter="BaseTool.Amount.formatter"
                 :parser="BaseTool.Amount.parser"
-                v-decorator="['seatNumber']" />
+                v-decorator="['seatNumber', {rules: [{required: true, message: '请填写预警天数'}]}]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -282,7 +336,7 @@
               <a-date-picker
                 style="width: 100%"
                 :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
-                v-decorator="['checkDate']" />
+                v-decorator="['checkDate', {rules: [{required: true, message: '请填写检定日期'}]}]" />
             </a-form-item>
           </a-col>
           <a-col :lg="12" :md="24" :sm="24">
@@ -296,21 +350,21 @@
                 suffix="月"
                 :formatter="BaseTool.Amount.formatter"
                 :parser="BaseTool.Amount.parser"
-                v-decorator="['checkPeriod']" />
+                v-decorator="['checkPeriod', {rules: [{required: true, 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="有效期至"
+              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']" />
+                v-decorator="['nextCheckDate', {rules: [{required: true, message: '请填写检定有效期'}]}]" />
             </a-form-item>
           </a-col>
         </a-row>
@@ -599,6 +653,8 @@ export default {
           'model',
           'positionId',
           'producerName',
+          'saveUserName',
+          'zzh',
           'useArea',
           'useCompany',
           'useProject',
@@ -622,12 +678,10 @@ export default {
           // 'sbImage',
           'status',
           'remark',
-          'zzh',
           'zz',
           'zjm',
           'jbdh',
           'useType',
-
           'cardNo',
           'fdjxh',
           'checkDate',

+ 30 - 7
src/views/sb/info/modules/Detail.vue

@@ -4,6 +4,9 @@
       <a-row :gutter="48" slot="extra">
         <a-col :md="48" :sm="48">
           <span class="table-page-search-submitButtons" style="float: right">
+            <a-badge :count="numChildSbInfo" title="子设备总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewChildSbInfo()">子设备</a-button>
+            </a-badge>
             <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>
@@ -36,16 +39,21 @@
         <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.model }}</detail-list-item>
         <detail-list-item term="ABC 标识">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
         <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.isShow?'显示':'不显示' }}</detail-list-item>
+        <detail-list-item v-show="model.isChild == 1" term="是否子设备">子设备</detail-list-item>
+        <detail-list-item v-show="model.isChild == 2" term="是否子设备">父设备</detail-list-item>
+        <detail-list-item v-show="model.isChild == 3" term="是否子设备">独立设备</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>
@@ -55,8 +63,8 @@
         <detail-list-item term="购置日期">{{ model.buyDate }}</detail-list-item>
         <detail-list-item term="投用日期">{{ model.startDate }}</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">
+      <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>
@@ -67,12 +75,12 @@
         <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 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.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>
@@ -132,6 +140,7 @@
     <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
     <detail-sb-check-job ref="detailSbCheckJobModal" @ok="handleOk"/>
     <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
+    <detail-sb-info ref="detailSbInfoModal" @ok="handleOk"/>
     <part-info-list ref="partInfoList" />
     <!--    <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
   </a-card>
@@ -147,6 +156,7 @@ 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 { queryChildNumSbInfo } from '@/api/sb/info'
 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'
@@ -155,6 +165,7 @@ import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
 import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
 import DetailSbCheckJob from '@/views/check/checkjob/modules/DetailSbCheckJob'
 import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheck'
+import DetailSbInfo from '@/views/sb/info/modules/DetailSbInfo'
 import PartInfoList from '@/views/part/info/modules/PartInfoList'
 const DetailListItem = DetailList.Item
 
@@ -173,7 +184,8 @@ export default {
     DetailSbCheck,
     DetailSbCheckJob,
     PartInfoList,
-    DetailSbMeasure
+    DetailSbMeasure,
+    DetailSbInfo
   },
   data () {
     return {
@@ -265,6 +277,7 @@ export default {
       numNumCheckjob: 0,
       numModelbom: 0,
       numPartInfo: 0,
+      numChildSbInfo: 0,
       firmProducerLevelMap: {},
       firmSupplier: {},
       firmProducer: {},
@@ -308,6 +321,11 @@ export default {
       const modal = this.$refs.detailSbBomModal
       modal.base(this.model)
     },
+    handleViewChildSbInfo () {
+      this.visible = false
+      const modal = this.$refs.detailSbInfoModal
+      modal.base(this.model)
+    },
     handleViewCheck (record) {
       this.visible = false
       const modal = this.$refs.detailSbCheckModal
@@ -343,6 +361,11 @@ export default {
           this.numCheckStandard = values[2].data
           this.numNumCheckjob = values[3].data
         })
+
+      // 如果是父设备,则要获取子设备的数量,并点击后可以看到子设备的情况
+      queryChildNumSbInfo({ parentId: this.model.id }).then(res => {
+        this.numChildSbInfo = res.data
+      })
     },
     changeTab (activeKey) {
       this.activeKey = activeKey
@@ -425,4 +448,4 @@ export default {
   margin: 5px;
   display: inline-block;
 }
-</style>
+</style>

+ 1 - 1
src/views/sb/info/modules/DetailBak.vue

@@ -53,7 +53,7 @@
         <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.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>

+ 9 - 3
src/views/sb/info/modules/DetailMeasureRelation.vue

@@ -11,10 +11,16 @@
       </a-row>
       <title-divider title="基本信息" width="90px"></title-divider>
       <detail-list title="" :col="3">
+        <detail-list-item term="系统主键(原计量系统主键)">{{ model.guigeId }}</detail-list-item>
         <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.name }}</detail-list-item>
+        <detail-list-item term="系列号(出厂编号)">{{ model.zzh }}</detail-list-item>
+        <detail-list-item term="规格型号">{{ model.model }}</detail-list-item>
+        <detail-list-item term="使用部门">{{ model.saveUserName }}</detail-list-item>
+        <detail-list-item term="使用地点">{{ model.positionId }}</detail-list-item>
+        <detail-list-item term="生产厂商">{{ model.producerName }}</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  v-show="model.useType == 5" title="特种信息" width="90px"></title-divider>
@@ -34,7 +40,7 @@
         <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.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>

+ 305 - 0
src/views/sb/info/modules/DetailSbInfo.vue

@@ -0,0 +1,305 @@
+<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>
+    <title-divider title="子设备" width="90px"></title-divider>
+    <div class="table-operator" style="margin-bottom:8px;">
+      <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
+        <a-icon type="plus"/>
+        添加子设备
+      </a-button>
+    </div>
+    <a-table
+      :data-source="data"
+      :columns="columns"
+      size="default"
+      :scroll="{x: 1500 }"
+      tableLayout="auto"
+      rowKey="id">
+      <span slot="action" slot-scope="record">
+        <template>
+          <a-popconfirm v-if="$auth('sb-infos-del')" title="是否要取消关联?" @confirm="batchCancel(record.id)">
+            <a>取消</a>
+          </a-popconfirm>
+        </template>
+      </span>
+    </a-table>
+    <sb-info-select-modal :type="'checkbox'" ref="sbInfoSelectModal" @selected="handleSbSelected"/>
+  </div>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+import { updateSbInfoChildBatch, updateSbInfoChildCancel, querySbInfo, deleteSbInfos, fetchSbInfo, exportSbInfo } from '@/api/sb/info'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'DetailSbCheck',
+  components: {
+    DetailList,
+    DetailListItem,
+    SbInfoSelectModal
+  },
+  props: {
+    /**
+     * 检查类型: 1-点检 2-巡检
+     */
+    checkType: {
+      type: Number,
+      default: 2
+    }
+  },
+  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',
+          checked: true,
+          customRender: (text, record, index) => {
+            return index + 1
+          }
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          width: 250,
+          dataIndex: 'name'
+        },
+        {
+          title: '设备编号',
+          dataIndex: 'no',
+          width: 150,
+          checked: true
+        },
+        {
+          title: '设备类型',
+          checked: true,
+          dataIndex: 'type',
+          width: 150,
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '设备等级',
+          checked: true,
+          dataIndex: 'level',
+          width: 150,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '购置日期',
+          dataIndex: 'buyDate',
+          width: 100,
+          checked: true
+        },
+        {
+          title: '投用日期',
+          dataIndex: 'startDate',
+          width: 100,
+          checked: true
+        },
+        {
+          title: '检定日期',
+          dataIndex: 'checkDate',
+          width: 150,
+          checked: true
+        },
+        {
+          title: '检定周期',
+          dataIndex: 'checkPeriod',
+          width: 100,
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return text + '月'
+            }
+          }
+        },
+        {
+          title: '检定有效期',
+          dataIndex: 'nextCheckDate',
+          width: 150,
+          fixed: 'right',
+          checked: true
+        },
+        {
+          title: '检定截止',
+          dataIndex: 'restDay',
+          width: 100,
+          fixed: 'right',
+          checked: true,
+          customRender: (text, record, index) => {
+            if (record.nextCheckDate == null) {
+              return '未知'
+            } else {
+              return this.BaseTool.Date.getCountBetween(new Date(), record.nextCheckDate, 1) + '天'
+            }
+          }
+        },
+        {
+          title: '状态',
+          checked: true,
+          dataIndex: 'status',
+          width: 100,
+          fixed: 'right',
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          align: 'center',
+          width: 100,
+          fixed: 'right',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      data: []
+    }
+  },
+  created () {
+    // 下拉框map
+    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: {
+    base (record) {
+      this.visible = true
+      this.model = record
+      this.modalTitle = '详情2'
+      querySbInfo({ parentId: record.id }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleOk () {
+      querySbInfo({ parentId: this.model.id, type: this.checkType }).then(res => {
+        this.data = res.data
+      })
+    },
+    handleAdd () {
+      const modal = this.$refs.baseModal
+      modal.base(null, this.model.id)
+    },
+    handleView (record) {
+      fetchSbInfo({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        res.data.partName = record.partName
+        modal.base(res.data)
+      })
+    },
+    handleEdit (record) {
+      fetchSbInfo({ 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]
+      }
+      deleteSbInfos(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+      })
+    },
+    batchCancel (id) {
+      if (this.BaseTool.String.isBlank(id)) {
+        this.$message.info('请选择要取消的记录')
+        return
+      }
+      updateSbInfoChildCancel({ id: id }).then(res => {
+        this.$message.info('取消成功')
+        this.handleOk()
+      })
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      parameter.modelId = this.model.id
+      exportSbInfo(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    handleSbSelected (keys, rows) {
+      const data = []
+      for (let i = 0; i < rows.length; i++) {
+        data.push({ parentId: this.model.id, id: rows[i].id })
+      }
+      updateSbInfoChildBatch(data)
+        .then((response) => {
+          this.$message.info('绑定成功')
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    }
+  }
+}
+</script>

+ 3 - 0
src/views/sb/info/modules/SbInfoSelectModal.vue

@@ -138,6 +138,7 @@ export default {
         {
           title: '设备类型',
           dataIndex: 'type',
+          checked: true,
           width: 200,
           customRender: (text, record, index) => {
             return record.typeName
@@ -146,6 +147,7 @@ export default {
         {
           title: '设备等级',
           dataIndex: 'level',
+          checked: true,
           width: 200,
           customRender: (text, record, index) => {
             return this.BaseTool.Object.getField(this.levelMap, text)
@@ -154,6 +156,7 @@ export default {
         {
           title: '状态',
           dataIndex: 'status',
+          checked: true,
           width: 200,
           scopedSlots: { customRender: 'status' }
         },