hfxc226 3 years ago
parent
commit
1c671e93ef

+ 49 - 11
src/views/sb/measure/MeasureSbInfo.vue

@@ -8,30 +8,35 @@
               <a-row :gutter="48">
                 <a-col :md="8" :sm="24">
                   <a-form-item label="关键字">
-                    <a-input v-model="queryParam.keyword" placeholder="请输入名称"/>
+                    <a-input v-model.trim="queryParam.keyword" placeholder="请输入设备名称"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
                   <a-form-item label="设备新号">
-                    <a-input v-model="queryParam.no"/>
+                    <a-input v-model.trim="queryParam.no"/>
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="设备型号">
+                    <a-input v-model.trim="queryParam.model"/>
                   </a-form-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
                   <a-form-item label="测量设备编号">
-                    <a-input v-model="queryParam.cardNo" />
+                    <a-input v-model.trim="queryParam.cardNo" />
                   </a-form-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
                   <a-form-item label="使用部门">
-                    <a-input v-model="queryParam.useDept" />
+                    <a-input v-model.trim="queryParam.useDept" />
                   </a-form-item>
                 </a-col>
                 <a-col :md="8" :sm="24">
                   <a-form-item label="出厂编号">
-                    <a-input v-model="queryParam.zzh"/>
+                    <a-input v-model.trim="queryParam.zzh"/>
                   </a-form-item>
                 </a-col>
-                <a-col :md="6" :sm="24">
+                <a-col :md="8" :sm="24">
                   <a-form-item label="管理状态">
                     <a-select v-model="queryParam.status" placeholder="请选择">
                       <a-select-option
@@ -43,8 +48,13 @@
                     </a-select>
                   </a-form-item>
                 </a-col>
-                <a-col :md="10" :sm="24">
-                  <a-form-item label="有效日期">
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="检定日期范围">
+                    <a-range-picker v-model="dateRangeCheck" :style="{width: '256px'}" />
+                  </a-form-item>
+                </a-col>
+                <a-col :md="8" :sm="24">
+                  <a-form-item label="有效日期范围">
                     <a-range-picker v-model="dateRange" :style="{width: '256px'}" />
                   </a-form-item>
                 </a-col>
@@ -94,7 +104,7 @@
                   <a-dropdown>
                     <a-menu slot="overlay">
                       <a-menu-item key="0">
-                        <a @click="handleView(record)">查看</a>
+                        <a @click="handleMeasure(record)">查看</a>
                       </a-menu-item>
                       <a-menu-item key="1">
                         <a v-if="$auth('sb-infos-edit')" @click="handleEdit(record)">修改</a>
@@ -161,15 +171,23 @@ export default {
     seatNumber: {
       type: Number,
       default: null
+    },
+    statusList: {
+      type: Array,
+      default: () => {
+        return null
+      }
     }
   },
   data () {
     return {
       dateRange: [],
+      dateRangeCheck: [],
       deptUserList: [],
       // 查询参数
       queryParam: {
-        seatNumber: this.seatNumber
+        seatNumber: this.seatNumber,
+        statusList: this.statusList
       },
       depreciationTypeMap: {},
       visible: true,
@@ -493,6 +511,12 @@ export default {
         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
       }
+      if (this.dateRangeCheck != null) {
+        this.queryParam.checkDateStart = this.dateRangeCheck[0]
+        this.queryParam.checkDateEnd = this.dateRangeCheck[1]
+        this.queryParam.checkDateStart = this.queryParam.checkDateStart ? this.queryParam.checkDateStart.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+        this.queryParam.checkDateEnd = this.queryParam.checkDateEnd ? this.queryParam.checkDateEnd.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+      }
       this.$refs.table.refresh()
     },
     onSelectChange (selectedRowKeys, selectedRows) {
@@ -501,9 +525,11 @@ export default {
     },
     resetSearchForm () {
       this.queryParam = {
-        seatNumber: this.seatNumber
+        seatNumber: this.seatNumber,
+        statusList: this.statusList
       }
       this.dateRange = []
+      this.dateRangeCheck = []
       this.visible = true
       this.$refs.table.refresh(true)
     },
@@ -514,6 +540,12 @@ export default {
         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
       }
+      if (this.dateRangeCheck != null) {
+        this.queryParam.checkDateStart = this.dateRangeCheck[0]
+        this.queryParam.checkDateEnd = this.dateRangeCheck[1]
+        this.queryParam.checkDateStart = this.queryParam.checkDateStart ? this.queryParam.checkDateStart.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+        this.queryParam.checkDateEnd = this.queryParam.checkDateEnd ? this.queryParam.checkDateEnd.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+      }
       const parameter = {
         ...this.queryParam
       }
@@ -528,6 +560,12 @@ export default {
         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
       }
+      if (this.dateRangeCheck != null) {
+        this.queryParam.checkDateStart = this.dateRangeCheck[0]
+        this.queryParam.checkDateEnd = this.dateRangeCheck[1]
+        this.queryParam.checkDateStart = this.queryParam.checkDateStart ? this.queryParam.checkDateStart.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+        this.queryParam.checkDateEnd = this.queryParam.checkDateEnd ? this.queryParam.checkDateEnd.format(this.BaseTool.Date.PICKER_NORM_DATE_PATTERN) : null
+      }
       const parameter = {
         ...this.queryParam
       }

+ 1 - 1
src/views/sb/measure/MeasureSbInfoWarn.vue

@@ -1,5 +1,5 @@
 <template>
-  <MeasureSbInfo :seat-number="30"/>
+  <MeasureSbInfo :seat-number="30" :status-list="[1,2]"/>
 </template>
 
 <script>

+ 3 - 2
src/views/sb/measure/modules/BaseForm.vue

@@ -56,7 +56,7 @@
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-input
-              v-decorator="['model', {rules: [{required: true, message: '设备型号不能为空'}]}]" />
+              v-decorator="['model', {rules: [{required: false, message: '设备型号不能为空'}]}]" />
           </a-form-item>
         </a-col>
 
@@ -281,12 +281,13 @@
 
         <a-col :lg="12" :md="24" :sm="24">
           <a-form-item
-            label="检定有效期"
+            label="检定有效期"
             :labelCol="BaseTool.Constant.labelCol"
             :wrapperCol="BaseTool.Constant.wrapperCol"
           >
             <a-date-picker
               style="width: 100%"
+              disabled
               :format="BaseTool.Date.PICKER_NORM_DATE_PATTERN"
               v-decorator="['nextCheckDate']" />
           </a-form-item>