Browse Source

opc优化

hfxc226 2 năm trước cách đây
mục cha
commit
82851ed810

+ 16 - 0
src/api/remote/opc.js

@@ -65,6 +65,22 @@ export function fetchRemoteOpc (parameter) {
   })
 }
 
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchRemoteOpcByPositionNum (parameter) {
+  return axios({
+    url: '/remote/opcs/positionNum/' + parameter.positionNum,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
 /**
  * query list func
  * parameter: { }

+ 53 - 55
src/api/tool/tool.js

@@ -8,13 +8,13 @@ import { stringify } from 'qs'
  * @returns {*}
  */
 export function getToolPage (parameter) {
-    return axios({
-        url: '/tool/tools/page?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/tool/tools/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -24,15 +24,15 @@ export function getToolPage (parameter) {
  * @returns {*}
  */
 export function addTool (parameter) {
-    return axios({
-        url: '/tool/tools',
-        method: 'POST',
-        headers: {
-            'Accept': 'application/json',
-            'Content-Type': 'application/json;charset=UTF-8'
-        },
-        data: parameter
-    })
+  return axios({
+    url: '/tool/tools',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
 }
 
 /**
@@ -42,14 +42,13 @@ export function addTool (parameter) {
  * @returns {*}
  */
 export function updateTool (parameter) {
-    return axios({
-        url: '/tool/tools/' + parameter.id,
-        method: 'PUT',
-        data: parameter
-    })
+  return axios({
+    url: '/tool/tools/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
 }
 
-                                                                                        
 /**
  * fetch single func
  * parameter: { }
@@ -57,13 +56,13 @@ export function updateTool (parameter) {
  * @returns {*}
  */
 export function fetchTool (parameter) {
-    return axios({
-        url: '/tool/tools/' + parameter.id,
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/tool/tools/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -73,13 +72,13 @@ export function fetchTool (parameter) {
  * @returns {*}
  */
 export function queryTool (parameter) {
-    return axios({
-        url: '/tool/tools?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        }
-    })
+  return axios({
+    url: '/tool/tools?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
 }
 
 /**
@@ -89,11 +88,11 @@ export function queryTool (parameter) {
  * @returns {*}
  */
 export function deleteTools (parameter) {
-    return axios({
-        url: '/tool/tools',
-        method: 'DELETE',
-        data: parameter
-    })
+  return axios({
+    url: '/tool/tools',
+    method: 'DELETE',
+    data: parameter
+  })
 }
 
 /**
@@ -103,14 +102,13 @@ export function deleteTools (parameter) {
  * @returns {*}
  */
 export function deleteTool (parameter) {
-    return axios({
-        url: '/tool/tools/' + parameter.id,
-        method: 'DELETE',
-        data: parameter
-    })
+  return axios({
+    url: '/tool/tools/' + parameter.id,
+    method: 'DELETE',
+    data: parameter
+  })
 }
 
-
 /**
  * export file
  * parameter: { }
@@ -118,12 +116,12 @@ export function deleteTool (parameter) {
  * @returns {*}
  */
 export function exportTool (parameter) {
-    return axios({
-        url: '/tool/tools/export?' + stringify(parameter),
-        method: 'get',
-        headers: {
-            'Content-Type': 'application/json;charset=UTF-8'
-        },
-        responseType: 'blob'
-    })
+  return axios({
+    url: '/tool/tools/export?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    responseType: 'blob'
+  })
 }

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

@@ -22,7 +22,7 @@
               <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>

+ 8 - 4
src/views/tool/tool-log/ToolLog.vue

@@ -105,6 +105,14 @@ export default {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
+        {
+          title: '工器具名称',
+          dataIndex: 'toolName'
+        },
+        {
+          title: '规格型号',
+          dataIndex: 'ggxh'
+        },
         {
           title: '检验人',
           dataIndex: 'checkUserId'
@@ -125,10 +133,6 @@ export default {
           title: '创建时间',
           dataIndex: 'createdTime'
         },
-        {
-          title: '工器具id',
-          dataIndex: 'toolId'
-        },
         {
           title: '检测日期',
           dataIndex: 'checkDate'

+ 8 - 6
src/views/tool/tool/modules/BaseFormMeasure.vue

@@ -41,7 +41,7 @@
                   show-time
                   placeholder="日期"
                   style="width: 150px"
-                  :format="BaseTool.Date.PICKER_NORM_DATETIME_PATTERN"
+                  :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
                   v-model="item.checkDate" />
               </td>
               <td><a-input style="width: 150px" v-model="item.remark" /></td>
@@ -146,16 +146,17 @@ export default {
     base (record) {
       this.visible = true
       this.model = record
-      console.log(record)
+      // console.log(record)
       this.ListForm = record.map(item => {
         const data = {
+          toolId: item.id,
           name: item.name,
           ggxh: item.ggxh,
           position: item.position,
           no: item.no,
           requirement: '',
           remark: '',
-          checkDate: this.BaseTool.Date.formatter(new Date(), this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN),
+          checkDate: this.BaseTool.Date.formatter(new Date(), this.BaseTool.Date.PICKER_NORM_DATE_PATTERN),
           checkImgList: [],
           checkFileList: []
         }
@@ -215,7 +216,7 @@ export default {
       }
     },
     save () {
-      console.log(this.ListForm)
+      // console.log(this.ListForm)
       let status = false
       const params = this.ListForm.map(item => {
         switch (true) {
@@ -233,20 +234,21 @@ export default {
             return
         }
         return {
+          toolId: item.toolId,
           name: item.name,
           ggxh: item.ggxh,
           position: item.position,
           no: item.no,
           requirement: item.requirement,
           remark: item.remark,
-          checkDate: this.BaseTool.Date.formatter(item.checkDate, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN),
+          checkDate: this.BaseTool.Date.formatter(item.checkDate, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN),
           checkUserId: this.username,
           imgPath: item.checkImgList.length > 0 ? item.checkImgList[0].url : '',
           filePath: item.checkImgList.length > 0 ? item.checkImgList[0].url : ''
         }
       })
       if (status) return
-      addToolLogBatch(params).then(res => {
+      addToolLogBatch({ toolLogDTOList: params }).then(res => {
         this.$message.success('检定完成!')
         this.handleCancel()
       })