xiongchao 3 years ago
parent
commit
8e5cb62c9e

+ 13 - 0
src/api/check/checkstandard.js

@@ -100,6 +100,19 @@ export function updateCheckStandard (parameter) {
   })
 }
 
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateCheckStandardNo () {
+  return axios({
+    url: '/check/standards/no',
+    method: 'PUT'
+  })
+}
+
 /**
  * update func
  * parameter: { }

+ 14 - 2
src/views/check/checkstandard/CheckStandard.vue

@@ -54,6 +54,10 @@
         icon="download"
         @click="doExport">导出
       </a-button>
+      <a-button style="margin-left:8px;" type="primary" @click="doUpdateNo">
+        <a-icon type="upload"/>
+        初始化编码
+      </a-button>
       <a-dropdown v-action:edit v-if="selectedRowKeys.length > 0 && ($auth('check-spot-standards-del')||$auth('check-polling-standards-del'))">
         <a-menu slot="overlay">
           <a-popconfirm title="是否要删除所选数据?" @confirm="batchDelete()">
@@ -116,6 +120,7 @@ import ImportFormAdd from './modules/ImportFormAdd'
 import {
   getCheckStandardPage,
   deleteCheckStandards,
+  updateCheckStandardNo,
   fetchCheckStandard,
   exportCheckStandard
 } from '@/api/check/checkstandard'
@@ -168,8 +173,8 @@ export default {
           width: '150px'
         },
         {
-          title: '设备新号',
-          dataIndex: 'sbNo',
+          title: '标准编码',
+          dataIndex: 'no',
           checked: true,
           width: '150px'
         },
@@ -332,6 +337,13 @@ export default {
         this.$refs.table.clearSelected()
       })
     },
+    doUpdateNo (record) {
+      updateCheckStandardNo().then(res => {
+        this.$message.info('编码生成成功')
+        this.handleOk()
+        this.$refs.table.clearSelected()
+      })
+    },
     handleEdit (record) {
       const modal = this.$refs.baseModal
       modal.base(record)

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

@@ -15,7 +15,7 @@
       </a-form-item>
 
       <row-list :col="2">
-        <!--        <row-item>
+        <row-item>
           <a-form-item
             label="编码"
             :labelCol="BaseTool.Constant.labelCol"
@@ -25,7 +25,7 @@
               disabled
               v-decorator="['no', {rules: [{required: false, message: '编码不能为空'}]}]"/>
           </a-form-item>
-        </row-item>-->
+        </row-item>
         <row-item>
           <a-form-item
             label="设备编号"

+ 6 - 0
src/views/check/checkstandard/modules/CheckStandardSelectModal.vue

@@ -145,6 +145,12 @@ export default {
           checked: true,
           width: '200px'
         },
+        {
+          title: '标准编码',
+          dataIndex: 'no',
+          checked: true,
+          width: '120px'
+        },
         {
           title: '维护等级',
           dataIndex: 'level',

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

@@ -9,7 +9,7 @@
     <detail-list title="" :col="2">
       <!--      <detail-list-item term="标准名称">{{ model.name }}</detail-list-item>-->
       <detail-list-item term="排序">{{ model.sort }}</detail-list-item>
-      <!--      <detail-list-item term="编码">{{ model.no }}</detail-list-item>-->
+      <detail-list-item term="编码">{{ model.no }}</detail-list-item>
       <detail-list-item term="检查类型">{{ BaseTool.Object.getField(typeMap,model.type) }}</detail-list-item>
       <detail-list-item term="维护等级">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
       <detail-list-item term="计划周期">{{ model.period }}{{ BaseTool.Object.getField(periodTypeMap,model.periodType) }}</detail-list-item>

+ 3 - 6
src/views/check/checkstandard/modules/DetailSbCheck.vue

@@ -122,13 +122,10 @@ export default {
       // 表头
       columns: [
         {
-          title: '序号',
-          dataIndex: 'index',
-          width: '100px',
+          title: '标准编码',
+          dataIndex: 'no',
           checked: true,
-          customRender: (text, record, index) => {
-            return index + 1
-          }
+          width: '120px'
         },
         {
           title: '维护部位',