瀏覽代碼

完善opc

hfxc226 2 年之前
父節點
當前提交
6674f6095e
共有 3 個文件被更改,包括 27 次插入18 次删除
  1. 2 8
      src/utils/dict.js
  2. 15 0
      src/views/sb/info/SbInfo.vue
  3. 10 10
      src/views/sb/info/modules/BaseFormMeasure.vue

+ 2 - 8
src/utils/dict.js

@@ -1367,14 +1367,8 @@ DictCache.COLOR = {
    * 计量设备状态
    */
   SB_MEASURE_STATUS: {
-    1: 'success', // 在用
-    2: 'warning', // 检定
-    3: 'gray', // 备用
-    4: 'error', // 维修
-    5: 'gray', // 停用
-    6: 'gray', // 丢失
-    7: 'gray', // 转出
-    8: 'gray' // 报废
+    1: 'error', // 需要检定了
+    0: 'success' // 正常
   },
   /**
    * 改进措施状态

+ 15 - 0
src/views/sb/info/SbInfo.vue

@@ -245,6 +245,11 @@
                   :status="DictCache.COLOR.SB_INFO_STATUS[text]"
                   :text="statusMap[text]" />
               </span>
+              <span slot="measureStatus" slot-scope="text">
+                <badge
+                  :status="DictCache.COLOR.SB_MEASURE_STATUS[text]"
+                  :text="yesNoMap[text]" />
+              </span>
             </s-table>
           </div>
         </a-col>
@@ -368,6 +373,7 @@ export default {
       confirmLoading: false,
       useTypeMap: {},
       statusMap: {},
+      yesNoMap: {},
       expandedKeys: [],
       selectedKeys: [],
       sourceTypeMap: {},
@@ -566,6 +572,14 @@ export default {
           width: 100,
           scopedSlots: { customRender: 'status' }
         },
+        {
+          title: '检定状态',
+          checked: true,
+          dataIndex: 'measureStatus',
+          fixed: 'right',
+          width: 100,
+          scopedSlots: { customRender: 'measureStatus' }
+        },
         {
           title: '操作',
           key: 'action',
@@ -618,6 +632,7 @@ export default {
     this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
     this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
     this.lineMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REMOTE_LINE)
+    this.yesNoMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
     querySbPosition().then(res => {
       this.sbPositionData = res.data
     })

+ 10 - 10
src/views/sb/info/modules/BaseFormMeasure.vue

@@ -19,13 +19,13 @@
             <tr>
               <th width="100px">序号</th>
               <th width="150px">是否在库</th>
+              <th width="150px">设备位号</th>
               <th width="150px">设备名称</th>
               <th width="150px">型号</th>
               <th width="150px">原厂编号</th>
               <th width="150px">是否是子设备</th>
               <th width="150px">设备位置</th>
               <th width="350px">选择父设备</th>
-              <th width="150px">设备位号</th>
               <th width="150px">检定周期</th>
               <th width="150px">检定日期</th>
               <th width="150px">下次检定日期</th>
@@ -42,6 +42,15 @@
                 <a-icon slot="checkedChildren" type="check" />
                 <a-icon slot="unCheckedChildren" type="close" />
               </a-switch></td>
+              <td>
+                <div v-if="item.sbStatus"> {{ item.sbPositionNo }}</div>
+                <div v-else style="width:250px">
+                  <a-input
+                    style="width: 60%"
+                    v-model="item.sbPositionNo"/>
+                  <a-button v-if="item.isChild === 1" type="primary" @click="handleSbNoSelect(item.sbParentId,i)">选择</a-button>
+                </div>
+              </td>
               <td>{{ item.sbName }}</td>
               <td>{{ item.sbModel }}</td>
               <td><div v-if="item.sbStatus"> {{ item.zzh }}</div><a-input style="width: 150px" v-else v-model="item.zzh" /></td>
@@ -71,15 +80,6 @@
                 <div v-else>无</div>
               </td>
 
-              <td>
-                <div v-if="item.sbStatus"> {{ item.sbPositionNo }}</div>
-                <div v-else style="width:250px">
-                  <a-input
-                    style="width: 60%"
-                    v-model="item.sbPositionNo"/>
-                  <a-button v-if="item.isChild === 1" type="primary" @click="handleSbNoSelect(item.sbParentId,i)">选择</a-button>
-                </div>
-              </td>
               <td><div v-if="item.sbStatus"> {{ item.checkPeriod }}月</div><a-input v-else v-model="item.checkPeriod" suffix="月" /></td>
               <td>
                 <div v-if="item.sbStatus"> {{ item.lastDate instanceof Object? BaseTool.Date.formatter(item.lastDate, BaseTool.Date.PICKER_NORM_DATE_PATTERN): item.lastDate }}</div>