Przeglądaj źródła

Merge branch 'demo_' of http://123.60.19.203:8088/hitch/hitch-antd into demo_

408249787 2 lat temu
rodzic
commit
d4f60a8257
39 zmienionych plików z 2328 dodań i 69 usunięć
  1. 173 0
      src/api/sb/location.js
  2. 5 1
      src/router/generator-platform-routers.js
  3. 3 3
      src/views/check/checkjob/CheckJob.vue
  4. 2 2
      src/views/check/checkjob/modules/DetailSbCheckJob.vue
  5. 3 3
      src/views/check/checkstandard/CheckStandard.vue
  6. 2 2
      src/views/check/checkstandard/modules/CheckStandardSelectModal.vue
  7. 2 2
      src/views/check/checkstandard/modules/DetailSbCheck.vue
  8. 1 1
      src/views/check/checkstandard/modules/ImportFormAdd.vue
  9. 1 1
      src/views/dashboard/modules/DetailCheckJobReport.vue
  10. 1 1
      src/views/excel/modules/ImportFormAdd.vue
  11. 1 1
      src/views/remote/degree/modules/ImportFormAdd.vue
  12. 3 3
      src/views/repair/application-form/RepairApplicationForm.vue
  13. 3 3
      src/views/repair/application-form/RepairCheckForm.vue
  14. 3 3
      src/views/repair/application-form/RepairForm.vue
  15. 2 2
      src/views/repair/fee/RepairFee.vue
  16. 5 5
      src/views/sb/info/ParentSbInfo.vue
  17. 16 5
      src/views/sb/info/SbInfo.vue
  18. 4 4
      src/views/sb/info/SbInfoDebug.vue
  19. 468 0
      src/views/sb/info/SbInfoForLocation.vue
  20. 2 2
      src/views/sb/info/SbInfoForPartInfo.vue
  21. 4 4
      src/views/sb/info/SbInfoStandard.vue
  22. 4 4
      src/views/sb/info/SbInfoTestRun.vue
  23. 16 2
      src/views/sb/info/modules/Detail.vue
  24. 2 2
      src/views/sb/info/modules/DetailSbInfo.vue
  25. 1 1
      src/views/sb/info/modules/ImportFormAdd.vue
  26. 1 1
      src/views/sb/info/modules/ImportFormAddStandard.vue
  27. 1 1
      src/views/sb/info/modules/ImportFormUpdate.vue
  28. 272 0
      src/views/sb/location/Location.vue
  29. 226 0
      src/views/sb/location/modules/BaseForm.vue
  30. 101 0
      src/views/sb/location/modules/Detail.vue
  31. 307 0
      src/views/sb/location/modules/LocationList.vue
  32. 286 0
      src/views/sb/location/modules/LocationSelectModal.vue
  33. 397 0
      src/views/sb/location/modules/LocationTable.vue
  34. 2 2
      src/views/sb/measure/MeasureSbInfo.vue
  35. 1 1
      src/views/sb/measure/modules/ImportFormAdd.vue
  36. 1 1
      src/views/sb/measure/modules/MeasureSbInfoSelectModal.vue
  37. 1 1
      src/views/sb/measurelog/modules/DetailSbCheck.vue
  38. 3 3
      src/views/sb/scrap/SbInfoScrap.vue
  39. 2 2
      src/views/sb/scrap/modules/BaseForm.vue

+ 173 - 0
src/api/sb/location.js

@@ -0,0 +1,173 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function queryNumSbLocation (parameter) {
+  return axios({
+    url: '/sb/locations/num?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getSbLocationPage (parameter) {
+  return axios({
+    url: '/sb/locations/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addSbLocation (parameter) {
+  return axios({
+    url: '/sb/locations',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateSbLocation (parameter) {
+  return axios({
+    url: '/sb/locations/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function copy (parameter) {
+  return axios({
+    url: '/sb/locations/copy',
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchSbLocation (parameter) {
+  return axios({
+    url: '/sb/locations/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function querySbLocation (parameter) {
+  return axios({
+    url: '/sb/locations?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * delete batch func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteSbLocations (parameter) {
+  return axios({
+    url: '/sb/locations',
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * delete single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function deleteSbLocation (parameter) {
+  return axios({
+    url: '/sb/locations/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
+}
+
+/**
+ * export file
+ * parameter: { }
+ * @param parameter :
+ * @returns {*}
+ */
+export function exportSbLocation (parameter) {
+  return axios({
+    url: '/sb/locations/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
+}
+
+/**
+ * query list func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchSbLocationOptions (parameter) {
+  return axios({
+    url: '/sb/locations/options?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

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

@@ -82,8 +82,12 @@ const constantRouterComponents = {
   'PartType': () => import('@/views/part/type/PartType'),
   // 部位信息
   'PartInfo': () => import('@/views/part/info/PartInfo'),
-  // 部位信息
+  // 设备部位信息
   'SbInfoForPartInfo': () => import('@/views/sb/info/SbInfoForPartInfo'),
+  // 位号信息
+  'Location': () => import('@/views/sb/location/Location'),
+  // 设备位号信息
+  'SbInfoForLocation': () => import('@/views/sb/info/SbInfoForLocation'),
   // 备件类别
   'SpareType': () => import('@/views/sqarepartmanage/sparetype/SpareType'),
   // 备件基础信息和报表

+ 3 - 3
src/views/check/checkjob/CheckJob.vue

@@ -10,8 +10,8 @@
               </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 label="设备自编号">
+                <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -283,7 +283,7 @@ export default {
           width: '150px'
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'sbNo',
           checked: true,
           width: '150px'

+ 2 - 2
src/views/check/checkjob/modules/DetailSbCheckJob.vue

@@ -9,8 +9,8 @@
     </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.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>

+ 3 - 3
src/views/check/checkstandard/CheckStandard.vue

@@ -10,8 +10,8 @@
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
-              <a-form-item label="设备号">
-                <a-input v-model="queryParam.sbNo" placeholder="请输入设备号"/>
+              <a-form-item label="设备号">
+                <a-input v-model="queryParam.sbNo" placeholder="请输入设备号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">
@@ -231,7 +231,7 @@ export default {
           }
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'sbNo',
           checked: true,
           width: '100px'

+ 2 - 2
src/views/check/checkstandard/modules/CheckStandardSelectModal.vue

@@ -122,7 +122,7 @@ export default {
           }
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'sbNo',
           checked: true,
           width: '100px'
@@ -134,7 +134,7 @@ export default {
           width: '150px'
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'sbNo',
           checked: true,
           width: '150px'

+ 2 - 2
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -9,8 +9,8 @@
     </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.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>

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

@@ -33,7 +33,7 @@
       rowKey="id">
     </a-table>
     <p style="color: red">注意事项:<br/>
-      1:请确保文件中对应设备号已经设置<br/>
+      1:请确保文件中对应设备号已经设置<br/>
       2:请确保保养对应的设备部位、指定的人员员均已在系统中设置<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>

+ 1 - 1
src/views/dashboard/modules/DetailCheckJobReport.vue

@@ -74,7 +74,7 @@ export default {
           }
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'sbNo',
           checked: true,
           width: '150px'

+ 1 - 1
src/views/excel/modules/ImportFormAdd.vue

@@ -18,7 +18,7 @@
       </a-form-item>
     </a-form>
     <!--    <p style="color: red">注意事项:<br/>
-      1:请确保设备号、名称、型号的准确填写<br/>
+      1:请确保设备号、名称、型号的准确填写<br/>
       2:请确保数据都未导入,重新导入成功不会覆盖原有数据,导致存在多台同样设备<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>-->

+ 1 - 1
src/views/remote/degree/modules/ImportFormAdd.vue

@@ -18,7 +18,7 @@
       </a-form-item>
     </a-form>
     <p style="color: red">注意事项:<br/>
-      1:请确保设备号、名称、型号的准确填写<br/>
+      1:请确保设备号、名称、型号的准确填写<br/>
       2:请确保数据都未导入,重新导入成功不会覆盖原有数据,导致存在多台同样设备<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>

+ 3 - 3
src/views/repair/application-form/RepairApplicationForm.vue

@@ -6,12 +6,12 @@
           <a-row :gutter="48">
             <a-col :md="6" :sm="24">
               <a-form-item label="关键字">
-                <a-input v-model.trim="queryParam.keyword" placeholder="请输入设备名称/设备号"/>
+                <a-input v-model.trim="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 label="设备自编号">
+                <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 3 - 3
src/views/repair/application-form/RepairCheckForm.vue

@@ -6,12 +6,12 @@
           <a-row :gutter="48">
             <a-col :md="6" :sm="24">
               <a-form-item label="关键字">
-                <a-input v-model.trim="queryParam.keyword" placeholder="请输入设备名称/设备号"/>
+                <a-input v-model.trim="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 label="设备自编号">
+                <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 3 - 3
src/views/repair/application-form/RepairForm.vue

@@ -6,12 +6,12 @@
           <a-row :gutter="48">
             <a-col :md="6" :sm="24">
               <a-form-item label="关键字">
-                <a-input v-model.trim="queryParam.keyword" placeholder="请输入设备名称/设备号"/>
+                <a-input v-model.trim="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 label="设备自编号">
+                <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
               </a-form-item>
             </a-col>
             <a-col :md="6" :sm="24">

+ 2 - 2
src/views/repair/fee/RepairFee.vue

@@ -9,8 +9,8 @@
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">
-            <a-form-item label="设备号">
-              <a-input v-model="queryParam.sbNo" placeholder="请输入设备号"/>
+            <a-form-item label="设备号">
+              <a-input v-model="queryParam.sbNo" placeholder="请输入设备号"/>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="24">

+ 5 - 5
src/views/sb/info/ParentSbInfo.vue

@@ -8,12 +8,12 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/设备号"/>
+                    <a-input v-model.trim="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 label="设备自编号">
+                    <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -202,13 +202,13 @@ export default {
           dataIndex: 'name'
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'no',
           width: 100,
           checked: true
         },
         {
-          title: '设备号',
+          title: '设备自编号',
           dataIndex: 'zbh',
           width: 120,
           checked: true

+ 16 - 5
src/views/sb/info/SbInfo.vue

@@ -19,12 +19,17 @@
                 <a-row :gutter="48">
                   <a-col :md="6" :sm="24">
                     <a-form-item label="关键字">
-                      <a-input v-model.trim="queryParam.keyword" placeholder="名称/设备新号"/>
+                      <a-input v-model.trim="queryParam.keyword" placeholder="名称/设备编号"/>
+                    </a-form-item>
+                  </a-col>
+                  <a-col :md="6" :sm="24">
+                    <a-form-item label="设备位号">
+                      <a-input v-model.trim="queryParam.positionNo" 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 label="设备自编号">
+                      <a-input v-model="queryParam.zbh" placeholder="设备自编号"/>
                     </a-form-item>
                   </a-col>-->
                   <a-col :md="6" :sm="24">
@@ -351,8 +356,14 @@ export default {
           width: 200,
           dataIndex: 'name'
         },
+        {
+          title: '设备位号',
+          dataIndex: 'positionNo',
+          width: 150,
+          checked: true
+        },
         /* {
-          title: '设备旧号',
+          title: '设备自编号',
           dataIndex: 'zbh',
           width: 120,
           checked: true
@@ -378,7 +389,7 @@ export default {
         {
           title: '规格型号',
           dataIndex: 'model',
-          width: 250,
+          width: 150,
           checked: true
         },
         {

+ 4 - 4
src/views/sb/info/SbInfoDebug.vue

@@ -18,12 +18,12 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/设备号"/>
+                    <a-input v-model.trim="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 label="设备自编号">
+                    <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -225,7 +225,7 @@ export default {
           dataIndex: 'name'
         },
         {
-          title: '设备号',
+          title: '设备自编号',
           dataIndex: 'zbh',
           width: 120,
           checked: true

+ 468 - 0
src/views/sb/info/SbInfoForLocation.vue

@@ -0,0 +1,468 @@
+<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.trim="queryParam.keyword" placeholder="请输入名称/编码"/>
+            </a-form-item>
+          </a-col>
+<!--          <a-col :md="8" :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="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" style="margin-bottom: 8px;">
+      <a-button style="margin-left: 8px" v-if="$auth('sb-infos-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+    </div>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data="loadData"
+      :alert="options.alert"
+      :rowSelection="options.rowSelection"
+      :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
+      showPagination="auto"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="locationListView(record)">位号列表</a>
+        </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>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+    <download-modal ref="downloadModal"/>
+    <preview-modal ref="previewModal"/>
+    <location-list ref="locationList" />
+  </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 { getSbInfoPage, exportSbInfo } from '@/api/sb/info'
+import LocationList from '@/views/sb/location/modules/LocationList'
+
+// 以设备为维度操作位号
+export default {
+  name: 'SbInfoForPartInfo',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    LocationList,
+    Detail,
+    DownloadModal,
+    PreviewModal
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        id: this.$route.query.id
+      },
+      depreciationTypeMap: {},
+      levelMap: {},
+      statusMap: {},
+      unitMap: {},
+      sourceTypeMap: {},
+      treeData: [],
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 80,
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '设备编号',
+          checked: true,
+          dataIndex: 'no',
+          width: 200
+        },
+        {
+          title: '设备位号',
+          checked: true,
+          dataIndex: 'positionNo',
+          width: 200
+        },
+        {
+          title: '设备名称',
+          checked: true,
+          dataIndex: 'name',
+          width: 200
+        },
+        {
+          title: '设备类型',
+          checked: true,
+          dataIndex: 'type',
+          width: 200,
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '设备等级',
+          checked: true,
+          dataIndex: 'level',
+          width: 200,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '设备原值',
+          dataIndex: 'initialValue',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '当前价值',
+          dataIndex: 'currentValue',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '已折旧价值',
+          dataIndex: 'cutValue',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Amount.formatter(text)
+          }
+        },
+        {
+          title: '生产商',
+          dataIndex: 'producerId',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return record.producerName
+          }
+        },
+        {
+          title: '设备来源方式',
+          dataIndex: 'sourceType',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.sourceTypeMap, text)
+          }
+        },
+        {
+          title: '来源设备id',
+          dataIndex: 'sourceSbId',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return record.sourceSbName
+          }
+        },
+        {
+          title: '上级设备',
+          dataIndex: 'parentId',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return record.parentName
+          }
+        },
+        {
+          title: '计量单位',
+          dataIndex: 'unit',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.unitMap, text)
+          }
+        },
+        {
+          title: '设备位置',
+          dataIndex: 'positionId',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return record.positionName
+          }
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'guigeId',
+          width: 200,
+          checked: true,
+          customRender: (text, record, index) => {
+            return record.guigeName
+          }
+        },
+        {
+          title: '保管人',
+          dataIndex: 'saveUser',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '购置日期',
+          dataIndex: 'buyDate',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '投用日期',
+          dataIndex: 'startDate',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '下次检定日期',
+          dataIndex: 'nextCheckDate',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '保修截至日期',
+          dataIndex: 'guaranteeDate',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '预计工作年限',
+          dataIndex: 'workYear',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '预计报废日期',
+          dataIndex: 'retirementDate',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '折旧方式',
+          dataIndex: 'depreciationType',
+          checked: true,
+          width: 200,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.depreciationTypeMap, text)
+          }
+        },
+        {
+          title: '维保手册',
+          dataIndex: 'wbFile',
+          checked: true,
+          width: 200,
+          scopedSlots: { customRender: 'wbFile' }
+        },
+        {
+          title: '使用手册',
+          dataIndex: 'useFile',
+          width: 200,
+          checked: true,
+          scopedSlots: { customRender: 'useFile' }
+        },
+        {
+          title: '验收文件',
+          dataIndex: 'checkFile',
+          width: 200,
+          checked: true,
+          scopedSlots: { customRender: 'checkFile' }
+        },
+        {
+          title: '状态',
+          checked: true,
+          dataIndex: 'status',
+          width: 200,
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '创建日期',
+          dataIndex: 'createdTime',
+          checked: true,
+          width: 200
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          width: '200px',
+          align: 'center',
+          fixed: 'right',
+          scopedSlots: { width: 200, 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)
+  },
+  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
+      }
+    },
+    locationListView (record) {
+      const modal = this.$refs.locationList
+      modal.base({ sbId: record.id }, { sbId: record.id })
+    },
+    handleOk () {
+      this.setTree()
+      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
+      }
+      exportSbInfo(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    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))
+    }
+  }
+}
+</script>

+ 2 - 2
src/views/sb/info/SbInfoForPartInfo.vue

@@ -8,7 +8,7 @@
               <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/编码"/>
             </a-form-item>
           </a-col>
-          <a-col :md="8" :sm="24">
+<!--          <a-col :md="8" :sm="24">
             <a-form-item label="上层设备类型">
               <a-tree-select
                 style="width: 100%"
@@ -21,7 +21,7 @@
               >
               </a-tree-select>
             </a-form-item>
-          </a-col>
+          </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>

+ 4 - 4
src/views/sb/info/SbInfoStandard.vue

@@ -18,12 +18,12 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/设备号"/>
+                    <a-input v-model.trim="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 label="设备自编号">
+                    <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -253,7 +253,7 @@ export default {
           checked: true
         },
         {
-          title: '设备号',
+          title: '设备自编号',
           dataIndex: 'zbh',
           width: 120,
           checked: true

+ 4 - 4
src/views/sb/info/SbInfoTestRun.vue

@@ -18,12 +18,12 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/设备号"/>
+                    <a-input v-model.trim="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 label="设备自编号">
+                    <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">
@@ -225,7 +225,7 @@ export default {
           dataIndex: 'name'
         },
         {
-          title: '设备号',
+          title: '设备自编号',
           dataIndex: 'zbh',
           width: 120,
           checked: true

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

@@ -8,9 +8,12 @@
               <a-badge :count="numChildSbInfo" title="子设备总数" :number-style="{ backgroundColor: '#52c41a' }">
                 <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="handleViewChildSbInfo()">子设备</a-button>
               </a-badge>
-              <a-badge :count="numPartInfo" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
+              <a-badge :count="numPartInfo" title="部位总数" :number-style="{ backgroundColor: '#52c41a' }">
                 <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="partInfoListView()">设备部位</a-button>
               </a-badge>
+              <a-badge :count="numLocation" title="位号总数" :number-style="{ backgroundColor: '#52c41a' }">
+                <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="locationListView()">设备位号</a-button>
+              </a-badge>
               <a-badge :count="numModelbom" title="备件总数" :number-style="{ backgroundColor: '#52c41a' }">
                 <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
               </a-badge>
@@ -302,6 +305,7 @@ import { queryNumCheckStandard } from '@/api/check/checkstandard'
 import { queryNumCheckjob, queryTuiCalendarIgnores } from '@/api/check/checkjob'
 import { queryNumRepairReason } from '@/api/repair/repair-reason'
 import { queryNumPartInfo } from '@/api/part/info'
+import { queryNumSbLocation } from '@/api/sb/location'
 import { queryNumModelbom } from '@/api/sb/modelbom'
 import { fetchSbInfo, queryChildNumSbInfo } from '@/api/sb/info'
 import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
@@ -453,6 +457,7 @@ export default {
       numRepairReason: 0,
       numModelbom: 0,
       numPartInfo: 0,
+      numLocation: 0,
       numChildSbInfo: 0,
       firmProducerLevelMap: {},
       firmSupplier: {},
@@ -603,7 +608,8 @@ export default {
         queryNumCheckStandard({ sbId: this.model.id, type: 3 }),
         queryNumCheckjob({ sbId: this.model.id, type: 1 }),
         queryNumCheckjob({ sbId: this.model.id, type: 2 }),
-        queryNumCheckjob({ sbId: this.model.id, type: 3 })
+        queryNumCheckjob({ sbId: this.model.id, type: 3 }),
+        queryNumSbLocation({ sbId: this.model.id })
       ])
         .then((values) => {
           this.numPartInfo = values[0].data
@@ -615,6 +621,7 @@ export default {
           this.numCheckjob1 = values[6].data
           this.numCheckjob2 = values[7].data
           this.numCheckjob3 = values[8].data
+          this.numLocation = values[9].data
         })
 
       // 如果是父设备,则要获取子设备的数量,并点击后可以看到子设备的情况
@@ -677,6 +684,13 @@ export default {
       const routeUrl = this.$router.resolve({ path: '/sb/info/for/part/info', query: { id: this.model.id } })
       window.open(routeUrl.href, '_blank')
     },
+    locationListView () {
+      // const modal = this.$refs.partInfoList
+      // modal.base({ sbId: this.model.id }, { sbId: this.model.id })
+      // const routeUrl = this.$router.resolve({ path: '/part/info', query: { id: this.model.id } })
+      const routeUrl = this.$router.resolve({ path: '/sb/info/for/location', query: { id: this.model.id } })
+      window.open(routeUrl.href, '_blank')
+    },
     checkJobTableWaitDoListView () {
       const modal = this.$refs.checkJobTableWaitDo
       modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })

+ 2 - 2
src/views/sb/info/modules/DetailSbInfo.vue

@@ -9,8 +9,8 @@
     </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.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>

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

@@ -18,7 +18,7 @@
       </a-form-item>
     </a-form>
     <p style="color: red">注意事项:<br/>
-      1:请确保设备号、名称、型号的准确填写<br/>
+      1:请确保设备号、名称、型号的准确填写<br/>
       2:请确保数据都未导入,重新导入成功不会覆盖原有数据,导致存在多台同样设备<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>

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

@@ -18,7 +18,7 @@
       </a-form-item>
     </a-form>
     <p style="color: red">注意事项:<br/>
-      1:请确保设备号、名称、型号的准确填写<br/>
+      1:请确保设备号、名称、型号的准确填写<br/>
       2:请确保数据都未导入,重新导入成功不会覆盖原有数据,导致存在多台同样设备<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>

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

@@ -18,7 +18,7 @@
       </a-form-item>
     </a-form>
     <p style="color: red">注意事项:<br/>
-      1:请确保设备号、名称、型号的准确填写<br/>
+      1:请确保设备号、名称、型号的准确填写<br/>
       2:请确保文件从系统中导出,并未修改格式,重新导入成功的数据将覆盖原有数据的属性<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>

+ 272 - 0
src/views/sb/location/Location.vue

@@ -0,0 +1,272 @@
+<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.trim="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" style="margin-bottom: 8px;">
+      <a-button v-if="$auth('sb-locations-add')" type="primary" icon="plus" @click="handleAdd">新增</a-button>
+      <a-button style="margin-left: 8px" v-if="$auth('sb-locations-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-locations-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="action" slot-scope="record">
+        <a @click="handleView(record)">查看</a>
+
+        <operation-button
+          v-if="$auth('sb-locations-edit')"
+          @click="handleEdit(record)" >修改</operation-button>
+
+        <operation-button
+          v-if="$auth('sb-locations-del')"
+          :type="2"
+          title="是否要删除该条数据?"
+          @confirm="batchDelete(record.id)" >删除</operation-button>
+
+        <operation-button
+          @click="handleCopy(record)" >复制</operation-button>
+      </span>
+      <span slot="status" slot-scope="text">
+        <badge
+          :status="DictCache.COLOR.PART_STATUS[text]"
+          :text="statusMap[text]" />
+      </span>
+    </s-table>
+    <base-form ref="baseModal" @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 { getSbLocationPage, deleteSbLocations, fetchSbLocation, exportSbLocation } from '@/api/sb/location'
+
+export default {
+  name: 'SbLocationList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+        sbId: this.$route.query.id
+      },
+      statusMap: {},
+      unitMap: {},
+      levelMap: {},
+      sourceTypeMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '位号编号',
+          dataIndex: 'no'
+        },
+        {
+          title: '位号名称',
+          dataIndex: 'name'
+        },
+        {
+          title: '位号类别',
+          dataIndex: 'typeId',
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '位号等级',
+          dataIndex: 'level',
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '所属设备',
+          dataIndex: 'sbId',
+          customRender: (text, record, index) => {
+            return record.sbName
+          }
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '300px',
+          align: 'center',
+          fixed: 'right',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        this.sbId = this.queryParam.sbId
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSbLocationPage(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.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+  },
+  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
+      }
+    },
+    handleAdd () {
+      const param = { sbId: this.sbId }
+      this.$refs.baseModal.base(param)
+    },
+    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]
+      }
+      deleteSbLocations(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      fetchSbLocation({ 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
+      }
+      exportSbLocation(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    }
+  }
+}
+</script>

+ 226 - 0
src/views/sb/location/modules/BaseForm.vue

@@ -0,0 +1,226 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @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-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
+              v-decorator="['no', {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
+              v-decorator="['name', {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-tree-select
+              style="width: 100%"
+              :dropdownStyle="{ maxHeight: '400px', overflow: 'auto' }"
+              :treeData="sbTypeTreeData"
+              :treeNodeFilterProp="'title'"
+              :showSearch="true"
+              v-decorator="['typeId', {rules: [{required: true, message: '设备类型不能为空'}]}]"
+              placeholder="请选择"
+            >
+            </a-tree-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="['level', {rules: [{required: true, message: '设备等级不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in levelMap"
+                :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="['repairDeptId', {rules: [{required: true, message: '维修部门不能为空'}]}]" placeholder="请选择">
+              <a-select-option
+                v-for="(label,value) in repairDeptMap"
+                :key="value"
+                :label="label"
+                :value="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-input
+              v-decorator="['remark', {rules: [{required: false, message: '备注不能为空'}]}]" />
+          </a-form-item>
+        </a-col>
+      </a-row>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addSbLocation, updateSbLocation } from '@/api/sb/location'
+import { fetchPartTypeTree } from '@/api/part/type'
+
+export default {
+  name: 'BaseLocation',
+  components: {
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      type: 1,
+      sbTypeTreeData: [],
+      producers: [],
+      statusMap: {},
+      unitMap: {},
+      levelMap: {},
+      sourceTypeMap: {},
+      guiges: [],
+      repairDeptMap: {},
+      sbId: null
+    }
+  },
+  props: {
+  },
+  created () {
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
+    this.setOptions()
+    this.setTree()
+  },
+  methods: {
+    base (record, type) {
+      this.visible = true
+      // 1新增,2复制
+      this.type = type == null ? 1 : 2
+      const { form: { setFieldsValue } } = this
+      this.sbId = record.sbId
+      // 如果是空标识添加
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'sbId',
+          'repairDeptId'
+        ])))
+      })
+      if (this.BaseTool.Object.isBlank(record.id)) {
+        if (type === 1) {
+          this.modalTitle = '添加'
+          return
+        } else {
+          this.modalTitle = '复制'
+        }
+      }
+      if (this.BaseTool.Object.isNotBlank(record.id)) {
+        this.modalTitle = '修改'
+      }
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'no',
+          'name',
+          'typeId',
+          'level',
+          'sbId',
+          'unit',
+          'status',
+          'remark',
+          'repairDeptId'
+        ])))
+      })
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addSbLocation(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateSbLocation(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)
+      }
+    },
+    setTree () {
+      fetchPartTypeTree().then(res => {
+        this.sbTypeTreeData = res.data
+      })
+    },
+    setOptions () {
+    }
+  }
+}
+</script>

+ 101 - 0
src/views/sb/location/modules/Detail.vue

@@ -0,0 +1,101 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="850"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @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.typeName }}</detail-list-item>
+      <detail-list-item term="位号等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
+      <detail-list-item term="所属设备">{{ model.sbName }}</detail-list-item>
+      <detail-list-item term="创建人">{{ model.createdUserName }}</detail-list-item>
+      <detail-list-item term="更新日期">{{ model.updateTime }}</detail-list-item>
+      <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
+    </detail-list>
+
+    <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: 'LocationDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      repairDeptMap: {},
+      model: {
+        'no': null,
+        'name': null,
+        'typeId': null,
+        'level': null,
+        'producerId': null,
+        'sourceType': null,
+        'sourceSbId': null,
+        'sbId': null,
+        'unit': null,
+        'guigeId': null,
+        'buyDate': null,
+        'startDate': null,
+        'nextCheckDate': null,
+        'guaranteeDate': null,
+        'workYear': null,
+        'retirementDate': null,
+        'sbImage': null,
+        'status': null,
+        'remark': null,
+        'createdUserId': null,
+        'updateUserId': null,
+        'updateTime': null,
+        'sbName': null,
+        'createUserName': null,
+        'producerName': null,
+        'guigeName': null,
+        'typeName': null,
+        'sourceSbName': null,
+        'repairDeptId': null
+      },
+      statusMap: {},
+      unitMap: {},
+      sourceTypeMap: {},
+      levelMap: {}
+    }
+  },
+  created () {
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+    this.repairDeptMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_DEPT_CATEGORY)
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    }
+
+  }
+}
+</script>

+ 307 - 0
src/views/sb/location/modules/LocationList.vue

@@ -0,0 +1,307 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    class="ant-modal2"
+    @cancel="handleCancel"
+    :footer="false"
+  >
+    <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.trim="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" style="margin-bottom: 8px;">
+        <a-button v-if="$auth('sb-locations-add')" type="primary" icon="plus" @click="$refs.baseModal.base(dataParam,1)">新增</a-button>
+<!--        <a-button style="margin-left:8px;" type="primary" @click="handleSbSelect">
+          <a-icon type="plus"/>
+          复制
+        </a-button>-->
+        <!--        <a-button style="margin-left: 8px" v-if="$auth('sb-locations-export')" type="primary" icon="download" @click="doExport">导出</a-button>-->
+        <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && $auth('sb-locations-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"
+        :scroll="{y: BaseTool.Constant.scrollY }"
+      >
+        <span slot="action" slot-scope="record">
+          <template>
+            <operation-button :show-divider="false" @click="handleView(record)" >查看</operation-button>
+            <operation-button
+              v-if="$auth('sb-locations-edit')"
+              @click="handleEdit(record)" >修改</operation-button>
+            <operation-button
+              v-if="$auth('sb-locations-del')"
+              :type="2"
+              title="是否要删除该条数据?"
+              @confirm="batchDelete(record.id)">删除</operation-button>
+            <operation-button
+              v-if="$auth('sb-locations-copy')"
+              @click="handleCopy(record)" >复制</operation-button>
+          </template>
+        </span>
+        <span slot="status" slot-scope="text">
+          <badge
+            :status="DictCache.COLOR.PART_STATUS[text]"
+            :text="statusMap[text]" />
+        </span>
+      </s-table>
+      <base-form ref="baseModal" @ok="handleOk"/>
+      <detail ref="detailModal"/>
+      <sb-info-select-modal :type="'radio'" ref="sbInfoSelectModal" @selected="handleSbSelectd"/>
+    </a-card>
+  </a-modal>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './BaseForm'
+import Detail from './Detail'
+import { getSbLocationPage, copy, deleteSbLocations, fetchSbLocation, exportSbLocation } from '@/api/sb/location'
+import SbInfoSelectModal from '@/views/sb/info/modules/SbInfoSelectModal'
+
+export default {
+  name: 'LocationList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail,
+    SbInfoSelectModal
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      dataParam: {},
+      statusMap: {},
+      levelMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 50,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '位号编号',
+          dataIndex: 'no',
+          checked: true
+        },
+        {
+          title: '位号名称',
+          dataIndex: 'name',
+          checked: true
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark',
+          checked: true
+        },
+        {
+          title: '创建日期',
+          dataIndex: 'createdTime',
+          checked: true
+        },
+        {
+          title: '操作',
+          key: 'action',
+          checked: true,
+          width: '200px',
+          align: 'center',
+          fixed: 'right',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSbLocationPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+      sbId: null,
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false,
+      isCreated: false
+    }
+  },
+  created () {
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+  },
+  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
+      }
+    },
+    base (dataParam = {}, queryParam = {}) {
+      this.visible = true
+      this.modalTitle = '位号列表'
+      this.queryParam = queryParam
+      this.sbId = queryParam.sbId
+      this.dataParam = dataParam
+      if (this.isCreated) {
+        this.$refs.table.clearSelected()
+        this.handleOk()
+      } else {
+        this.tableOption()
+        this.isCreated = true
+      }
+      // this.mySelect(this.selectedRowKeys, this.selectedRows)
+    },
+    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]
+      }
+      deleteSbLocations(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        res.data.id = null
+        modal.base(res.data, 2)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    doExport () {
+      const parameter = {
+        ...this.queryParam
+      }
+      exportSbLocation(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    },
+    handleSbSelect () {
+      this.$refs.sbInfoSelectModal.base()
+    },
+    handleSbSelectd (keys, rows) {
+      const [ row ] = rows
+      // 日期处理
+      copy({ sbId: this.sbId, copySbId: row.id })
+        .then((response) => {
+          this.$message.info(response.data)
+          this.handleOk()
+        }).catch(() => {
+          this.confirmLoading = false
+        })
+    }
+  }
+}
+</script>

+ 286 - 0
src/views/sb/location/modules/LocationSelectModal.vue

@@ -0,0 +1,286 @@
+<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.trim="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" style="margin-bottom: 8px;">
+      </div>
+
+      <s-table
+        ref="table"
+        size="default"
+        rowKey="id"
+        :columns="columns"
+        :data="loadData"
+        :alert="options.alert"
+        :customRow="options.customRow"
+        :rowSelection="options.rowSelection"
+        showPagination="auto"
+        :scroll="{ x: 1000, y: BaseTool.Constant.scrollY }"
+      >
+        <span slot="action" slot-scope="record">
+          <template>
+            <a @click="handleView(record)">查看</a>
+          </template>
+        </span>
+        <span slot="status" slot-scope="text">
+          <badge
+            :status="DictCache.COLOR.PART_STATUS[text]"
+            :text="statusMap[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 { getSbLocationPage, fetchSbLocation } from '@/api/sb/location'
+
+export default {
+  name: 'LocationSelectModal',
+  components: {
+    STable,
+    Ellipsis,
+    Detail
+  },
+  props: {
+    type: {
+      type: String,
+      default: 'radio'
+    },
+    selectedRowKey: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    },
+    selectedRow: {
+      type: Array,
+      default: () => {
+        return []
+      }
+    }
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      // 查询参数
+      queryParam: {
+      },
+      statusMap: {},
+      unitMap: {},
+      levelMap: {},
+      sourceTypeMap: {},
+      // 表头
+      columns: [
+        // {
+        //   title: '序号',
+        //   dataIndex: 'index',
+        //   width: 50,
+        //   customRender: (text, record, index) => {
+        //     return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+        //   }
+        // },
+        {
+          title: '位号编号',
+          dataIndex: 'no',
+          width: 300
+        },
+        {
+          title: '位号名称',
+          dataIndex: 'name',
+          width: 300
+        },
+        {
+          title: '位号类别',
+          dataIndex: 'typeId',
+          width: 300,
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '位号等级',
+          dataIndex: 'level',
+          width: 300,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '所属设备',
+          dataIndex: 'sbId',
+          width: 300,
+          customRender: (text, record, index) => {
+            return record.sbName
+          }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          fixed: 'right',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSbLocationPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: this.selectedRowKey,
+      selectedRows: this.selectedRow,
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false,
+      isCreated: false
+    }
+  },
+  created () {
+    this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+  },
+  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) {
+      fetchSbLocation({ 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 (queryParam = {}) {
+      this.visible = true
+      this.modalTitle = '选择位号'
+      this.queryParam = queryParam
+      if (this.isCreated) {
+        this.$refs.table.clearSelected()
+        this.options.rowSelection.type = this.type
+        this.handleOk()
+      } else {
+        this.tableOption()
+        this.isCreated = true
+      }
+      // this.mySelect(this.selectedRowKeys, this.selectedRows)
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    handleSelect () {
+      if (this.selectedRowKeys.length === 0) {
+        this.$message.warn('请至少选择一项信息')
+      } else {
+        this.confirmLoading = true
+        this.$emit('selected', this.selectedRowKeys, this.selectedRows)
+        this.confirmLoading = false
+        this.visible = false
+      }
+    },
+    mySelect (selectedRowKeys, selectedRows) {
+      this.$refs.table.updateSelect(selectedRowKeys, selectedRows)
+      this.$refs.table.rowSelection.onChange(selectedRowKeys, selectedRows)
+    }
+  }
+}
+</script>

+ 397 - 0
src/views/sb/location/modules/LocationTable.vue

@@ -0,0 +1,397 @@
+<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.trim="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" style="margin-bottom: 8px;">
+      <a-button v-if="[1,2].includes(type) && $auth('sb-locations-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+      <a-button style="margin-left: 8px" v-if="[1,2].includes(type) && $auth('sb-locations-export')" type="primary" icon="download" @click="doExport">导出</a-button>
+      <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && [1,2].includes(type) && $auth('sb-locations-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"
+      showPagination="auto"
+      :scroll="{y: BaseTool.Constant.scrollY }"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">查看</a>
+
+          <template v-if="[1,2].includes(type)">
+            <operation-button
+              v-if="$auth('sb-locations-edit')"
+              @click="handleEdit(record)" >修改</operation-button>
+
+            <operation-button
+              v-if="$auth('sb-locations-del')"
+              :type="2"
+              title="是否要删除该条数据?"
+              @confirm="batchDelete(record)" >删除</operation-button>
+
+            <operation-button
+              v-if="$auth('sb-locations-add')"
+              @click="handleCopy(record)" >复制</operation-button>
+          </template>
+        </template>
+      </span>
+      <span slot="status" slot-scope="text">
+        <badge
+          :status="DictCache.COLOR.PART_STATUS[text]"
+          :text="statusMap[text]" />
+      </span>
+    </s-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal"/>
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './BaseForm'
+import Detail from './Detail'
+import { getSbLocationPage, deleteSbLocations, fetchSbLocation, exportSbLocation } from '@/api/sb/location'
+
+export default {
+  name: 'LocationTable',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  props: {
+    type: {
+      type: Number,
+      default: 1
+    },
+    tableParams: {
+      type: Object,
+      default: () => ({})
+    },
+    modelParams: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  watch: {
+    tableParams: {
+      // deep: true, // 深度监听
+      handler (newVal, oldVal) {
+        if (newVal.sbId !== oldVal.sbId) {
+          this.handleOk()
+        }
+      }
+    }
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      statusMap: {},
+      unitMap: {},
+      levelMap: {},
+      sourceTypeMap: {},
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          width: 80,
+          checked: true,
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '位号编号',
+          checked: true,
+          dataIndex: 'no',
+          width: 200
+        },
+        {
+          title: '位号名称',
+          checked: true,
+          dataIndex: 'name'
+          // width: 20
+        },
+        {
+          title: '位号类别',
+          dataIndex: 'typeId',
+          checked: true,
+          width: 150,
+          customRender: (text, record, index) => {
+            return record.typeName
+          }
+        },
+        {
+          title: '位号等级',
+          dataIndex: 'level',
+          width: 150,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.levelMap, text)
+          }
+        },
+        {
+          title: '生产商',
+          dataIndex: 'producerId',
+          width: 300,
+          customRender: (text, record, index) => {
+            return record.producerName
+          }
+        },
+        {
+          title: '设备来源方式',
+          dataIndex: 'sourceType',
+          width: 300,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.sourceTypeMap, text)
+          }
+        },
+        {
+          title: '来源设备',
+          dataIndex: 'sourceSbId',
+          width: 300,
+          customRender: (text, record, index) => {
+            return record.sourceSbName
+          }
+        },
+        {
+          title: '所属设备',
+          dataIndex: 'sbId',
+          width: 300,
+          customRender: (text, record, index) => {
+            return record.sbName
+          }
+        },
+        {
+          title: '计量单位',
+          dataIndex: 'unit',
+          width: 300,
+          customRender: (text, record, index) => {
+            return this.BaseTool.Object.getField(this.unitMap, text)
+          }
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'guigeId',
+          width: 300,
+          customRender: (text, record, index) => {
+            return record.guigeName
+          }
+        },
+        {
+          title: '购置日期',
+          dataIndex: 'buyDate',
+          width: 300
+        },
+        {
+          title: '投用日期',
+          dataIndex: 'startDate',
+          width: 300
+        },
+        {
+          title: '下次检定日期',
+          dataIndex: 'nextCheckDate',
+          width: 300
+        },
+        {
+          title: '保修截至日期',
+          dataIndex: 'guaranteeDate',
+          width: 300
+        },
+        {
+          title: '预计工作年限',
+          dataIndex: 'workYear',
+          width: 300
+        },
+        {
+          title: '预计报废日期',
+          dataIndex: 'retirementDate',
+          width: 300
+        },
+        {
+          title: '设备图片',
+          dataIndex: 'sbImage',
+          width: 300
+        },
+        {
+          title: '备注',
+          dataIndex: 'remark',
+          width: 300
+        },
+        {
+          title: '创建日期',
+          dataIndex: 'createdTime',
+          width: 300
+        },
+        {
+          title: '状态',
+          dataIndex: 'status',
+          checked: true,
+          width: 150,
+          scopedSlots: { customRender: 'status' }
+        },
+        {
+          title: '操作',
+          key: 'action',
+          width: '200px',
+          align: 'center',
+          checked: true,
+          // fixed: 'right',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          ...this.queryParam,
+          ...this.tableParams,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getSbLocationPage(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.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_STATUS)
+    this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
+    this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.PART_LEVEL)
+    this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
+  },
+  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]
+      }
+      deleteSbLocations(ids).then(res => {
+        this.$message.info('删除成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
+    handleEdit (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchSbLocation({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleCopy (record) {
+      fetchSbLocation({ 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
+      }
+      exportSbLocation(parameter).then(file => {
+        this.BaseTool.UPLOAD.downLoadExportExcel(file)
+      })
+    }
+  }
+}
+</script>

+ 2 - 2
src/views/sb/measure/MeasureSbInfo.vue

@@ -12,7 +12,7 @@
                   </a-form-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
-                  <a-form-item label="设备号">
+                  <a-form-item label="设备号">
                     <a-input v-model.trim="queryParam.no"/>
                   </a-form-item>
                 </a-col>
@@ -363,7 +363,7 @@ export default {
           checked: true
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'no',
           width: 150,
           checked: true

+ 1 - 1
src/views/sb/measure/modules/ImportFormAdd.vue

@@ -18,7 +18,7 @@
       </a-form-item>
     </a-form>
     <p style="color: red">注意事项:<br/>
-      1:请确保设备号、名称、型号的准确填写<br/>
+      1:请确保设备号、名称、型号的准确填写<br/>
       2:请确保数据都未导入,重新导入成功不会覆盖原有数据,导致存在多台同样设备<br/>
       3:导入如出现问题,请及时联系<br/>
     </p>

+ 1 - 1
src/views/sb/measure/modules/MeasureSbInfoSelectModal.vue

@@ -265,7 +265,7 @@ export default {
           checked: true
         },
         {
-          title: '设备号',
+          title: '设备号',
           dataIndex: 'no',
           width: 150,
           checked: true

+ 1 - 1
src/views/sb/measurelog/modules/DetailSbCheck.vue

@@ -9,7 +9,7 @@
     </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.no }}</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>

+ 3 - 3
src/views/sb/scrap/SbInfoScrap.vue

@@ -8,12 +8,12 @@
               <a-row :gutter="48">
                 <a-col :md="6" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model.trim="queryParam.keyword" placeholder="请输入名称/设备号"/>
+                    <a-input v-model.trim="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 label="设备自编号">
+                    <a-input v-model="queryParam.zbh" placeholder="请输入设备自编号"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="6" :sm="24">

+ 2 - 2
src/views/sb/scrap/modules/BaseForm.vue

@@ -114,7 +114,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"
           >
@@ -125,7 +125,7 @@
         </a-col>
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="设备号"
+            label="设备自编号"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >