Ver Fonte

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

408249787 há 2 anos atrás
pai
commit
eb18f64911

+ 39 - 24
src/views/sb/change-record/SbChangeRecord.vue

@@ -58,9 +58,11 @@
         size="default"
         rowKey="id"
         :columns="columns"
+        :widthSpace="true"
         :data="loadData"
         :alert="options.alert"
         :rowSelection="options.rowSelection"
+        :scroll="{x: 1500, y: BaseTool.Constant.scrollY}"
         showPagination="auto"
       >
         <span slot="action" slot-scope="record">
@@ -114,63 +116,76 @@ export default {
         {
           title: '序号',
           dataIndex: 'index',
+          width: 100,
+          checked: true,
           customRender: (text, record, index) => {
             return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
           }
         },
         {
           title: '记录人',
+          width: 100,
+          checked: true,
           dataIndex: 'createdUserName'
         },
         {
-          title: '设备ID',
-          dataIndex: 'sbId'
+          title: '设备',
+          width: 130,
+          checked: true,
+          dataIndex: 'sbName'
         },
         {
-          title: '更改内容',
-          dataIndex: 'content'
-        },
-        {
-          title: '原设备位置',
-          dataIndex: 'oldPositionId'
-        },
-        {
-          title: '修改后设备位置',
-          dataIndex: 'positionId'
-        },
-        {
-          title: '位号',
+          title: '设备位号',
+          width: 130,
+          checked: true,
           dataIndex: 'sbNoId'
         },
         {
-          title: '原父设备ID',
-          dataIndex: 'oldParentId'
+          title: '更改类型',
+          width: 130,
+          checked: true,
+          dataIndex: 'changeType',
+          customRender: (text, record, index) => {
+            if (text === 1) {
+              return '设备位置变更'
+            } else if (text === 2) {
+              return '设备位号变更'
+            } else {
+              return '父设备变更'
+            }
+          }
         },
         {
-          title: '修改后父设备ID',
-          dataIndex: 'parentId'
+          title: '更改内容',
+          width: 200,
+          checked: true,
+          dataIndex: 'content'
         },
         {
           title: '记录时间',
+          width: 150,
+          checked: true,
           dataIndex: 'createdTime'
         },
         {
           title: '开始时间',
+          width: 150,
+          checked: true,
           dataIndex: 'startTime'
         },
         {
           title: '结束时间',
+          width: 150,
+          checked: true,
           dataIndex: 'endTime'
         },
-        {
-          title: '更改类型 1 位置 2 位号 3 父设备',
-          dataIndex: 'changeType'
-        },
         {
           title: '操作',
           key: 'action',
           width: '200px',
           align: 'center',
+          fixed: 'right',
+          checked: true,
           scopedSlots: { customRender: 'action' }
         }
       ],
@@ -182,7 +197,7 @@ export default {
           ...this.queryParam,
           dataScope: {
             sortBy: 'desc',
-            sortName: 'update_time'
+            sortName: 'created_time'
           }
         }
         return getSbChangeRecordPage(Object.assign(parameter, this.queryParam))

+ 21 - 0
src/views/sb/measure/MeasureSbInfo.vue

@@ -513,6 +513,9 @@ export default {
         this.queryParam.nextCheckDateEnd = this.dateRange[1]
         this.queryParam.nextCheckDateStart = this.queryParam.nextCheckDateStart ? this.queryParam.nextCheckDateStart.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
         this.queryParam.nextCheckDateEnd = this.queryParam.nextCheckDateEnd ? this.queryParam.nextCheckDateEnd.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+      } else {
+        this.$message.error('请选择有效日期范围')
+        return
       }
       if (this.dateRangeCheck != null) {
         this.queryParam.checkDateStart = this.dateRangeCheck[0]
@@ -577,9 +580,27 @@ export default {
         ...this.queryParam
       }
       exportSbInfoMeasureTwo(parameter).then(file => {
+        console.log(file)
+        if (file.data.type === 'application/json') {
+          this.handleResponseError(file.data)
+          return
+        }
         this.BaseTool.UPLOAD.downLoadExportExcel(file)
       })
     },
+    handleResponseError (data) {
+      const _this = this
+      const fileReader = new FileReader()
+      fileReader.onload = function () {
+        try {
+          const jsonData = JSON.parse(fileReader.result)
+          _this.$message.error(jsonData.message)
+        } catch (err) {
+          console.log('返回文件流,正确的')
+        }
+      }
+      fileReader.readAsText(data)
+    },
     setTree (record = {}) {
       fetchSbTypeTree().then(res => {
         this.treeData = res.data

+ 1 - 1
src/views/sb/measurelog/MeasureLog.vue

@@ -163,7 +163,7 @@ export default {
         },
         {
           title: '检定单位',
-          dataIndex: 'dph'
+          dataIndex: 'requirement'
         },
         {
           title: '检定编号',