Forráskód Böngészése

工单列表添加时间范围查询

HD_wangm 3 hónapja
szülő
commit
eb271449ef

+ 22 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtRepairOrder.java

@@ -296,6 +296,12 @@ public class GxtRepairOrder extends BaseEntity
 
     private Long userId;
 
+    /** 实际发生时间开始 */
+    private String beginOccurTime;
+
+    /** 实际发生时间结束 */
+    private String endOccurTime;
+
     public void setId(Long id) 
     {
         this.id = id;
@@ -1023,6 +1029,22 @@ public class GxtRepairOrder extends BaseEntity
         this.userId = userId;
     }
 
+    public String getBeginOccurTime() {
+        return beginOccurTime;
+    }
+
+    public void setBeginOccurTime(String beginOccurTime) {
+        this.beginOccurTime = beginOccurTime;
+    }
+
+    public String getEndOccurTime() {
+        return endOccurTime;
+    }
+
+    public void setEndOccurTime(String endOccurTime) {
+        this.endOccurTime = endOccurTime;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 22 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtWorkOrder.java

@@ -306,6 +306,12 @@ public class GxtWorkOrder extends BaseEntity
 
     private Long userId;
 
+    /** 实际创建时间开始 */
+    private String beginCreateTime;
+
+    /** 实际创建时间结束 */
+    private String endCreateTime;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -1015,6 +1021,22 @@ public class GxtWorkOrder extends BaseEntity
         this.userId = userId;
     }
 
+    public String getBeginCreateTime() {
+        return beginCreateTime;
+    }
+
+    public void setBeginCreateTime(String beginCreateTime) {
+        this.beginCreateTime = beginCreateTime;
+    }
+
+    public String getEndCreateTime() {
+        return endCreateTime;
+    }
+
+    public void setEndCreateTime(String endCreateTime) {
+        this.endCreateTime = endCreateTime;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 2 - 0
ygtx-gxt/src/main/resources/mapper/gxt/GxtRepairOrderMapper.xml

@@ -216,6 +216,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="realFailureReason != null  and realFailureReason != ''"> and real_failure_reason = #{realFailureReason}</if>
             <if test="lostPower != null"> and lost_power = #{lostPower}</if>
             <if test="workPermitNum != null and workPermitNum != ''"> and work_permit_num = #{workPermitNum}</if>
+            <if test="beginOccurTime != null and beginOccurTime != ''"> and date_format(occur_time,'%y%m%d') &gt;= date_format(#{beginOccurTime},'%y%m%d')</if>
+            <if test="endOccurTime != null and endOccurTime != ''"> and date_format(occur_time,'%y%m%d') &lt;= date_format(#{endOccurTime},'%y%m%d')</if>
 
             <!-- 业务特定数据权限过滤条件 -->
             <if test="params.businessDataScope != null and params.businessDataScope != ''">

+ 2 - 0
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

@@ -168,6 +168,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="infoEntry != null and infoEntry != ''"> and info_entry = #{infoEntry}</if>
             <if test="lostPower != null"> and lost_power = #{lostPower}</if>
             <if test="workPermitNum != null and workPermitNum != ''"> and work_permit_num = #{workPermitNum}</if>
+            <if test="beginCreateTime != null and beginCreateTime != ''"> and date_format(t.create_time,'%y%m%d') &gt;= date_format(#{beginCreateTime},'%y%m%d')</if>
+            <if test="endCreateTime != null and endCreateTime != ''"> and date_format(t.create_time,'%y%m%d') &lt;= date_format(#{endCreateTime},'%y%m%d')</if>
             <!-- 业务特定数据权限过滤条件 -->
             <if test="params.businessDataScope != null and params.businessDataScope != ''">
                 ${params.businessDataScope}

+ 1 - 1
ygtx-ui/src/assets/styles/index.scss

@@ -226,7 +226,7 @@ aside {
 // }
 .el-form--inline.el-form--label-top{
   display: grid;
-  grid-template-columns: repeat(7, 1fr); /* 创建4列,每列平分空间 */
+  grid-template-columns: repeat(8, 1fr); /* 创建4列,每列平分空间 */
   gap: 3px; /* 设置列与列之间的间隔 */
 }
 

+ 2 - 0
ygtx-ui/src/components/misInfoSelect/single.vue

@@ -219,6 +219,8 @@ function handleQuery() {
 function resetQuery() {
   proxy.resetForm("queryRef");
   realEndTimeRange.value = []
+  queryParams.beginRealEndTime = undefined
+  queryParams.endRealEndTime = undefined
   handleQuery();
 }
 

+ 1 - 1
ygtx-ui/src/components/repairOrder/view.vue

@@ -101,7 +101,7 @@
                     <el-form-item label="MIS工单编码">{{ formData.misOrderNo || '-' }}</el-form-item>
                   </el-col>
                   <el-col :span="24">
-                    <el-form-item label="工票编号">{{ formData.workPermitNum || '-' }}</el-form-item>
+                    <el-form-item label="工票编号">{{ formData.workPermitNum || '-' }}</el-form-item>
                   </el-col>
                   <el-col :span="24">
                     <el-form-item label="开始时间">{{ parseTime(formData.realStartTime, '{y}-{m}-{d} {h}:{i}') || '-' }}</el-form-item>

+ 31 - 2
ygtx-ui/src/views/gxt/gxtOrder/index.vue

@@ -76,6 +76,18 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="创建时间" prop="createTime">
+        <el-date-picker
+            v-model="createTimeRange"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="YYYY-MM-DD"
+            style="width: 240px"
+            @change="handleDateChange"
+        />
+      </el-form-item>
 <!--      <el-form-item label-position="top">-->
 <!--          <div class="item-search">&nbsp;</div>-->
 <!--          <div class="item-search">-->
@@ -1271,9 +1283,10 @@ import ApproveDialog from "@/components/gxtOrder/approve.vue";
 import ShutdownDialog from "@/components/gxtOrder/shutdown.vue";
 import BackfillFinalizeDialog from '@/components/gxtOrder/backfillFinalize.vue'
 import { useRoute } from 'vue-router';
-import { watch } from 'vue';
+import {ref, watch} from 'vue';
 const route = useRoute(); // 获取当前路由信息
 
+const createTimeRange = ref([]) // 用于存储日期范围选择的值
 // 初始化禁用状态为 false(单选框默认可用)
 const infoEntryDisabled = ref(false);
 // 工作负责人快速检索相关响应式数据
@@ -1621,7 +1634,9 @@ const data = reactive({
     workOrderStatus: undefined,
     gxtCenter: undefined,
     pcsStationName: undefined,
-    orderSource: undefined
+    orderSource: undefined,
+    beginCreateTime: undefined, // 添加开始时间参数
+    endCreateTime: undefined,    // 添加结束时间参数
   },
   rules: {
 
@@ -2059,6 +2074,17 @@ function reset() {
   proxy.resetForm("orderRef")
 }
 
+/** 处理日期范围变化 */
+function handleDateChange(val) {
+  if (val && val.length === 2) {
+    queryParams.value.beginCreateTime = val[0]
+    queryParams.value.endCreateTime = val[1]
+  } else {
+    queryParams.value.beginCreateTime = undefined
+    queryParams.value.endCreateTime = undefined
+  }
+}
+
 /** 搜索按钮操作 */
 function handleQuery() {
   queryParams.value.pageNum = 1
@@ -2068,6 +2094,9 @@ function handleQuery() {
 /** 重置按钮操作 */
 function resetQuery() {
   proxy.resetForm("queryRef")
+  queryParams.value.beginCreateTime = undefined
+  queryParams.value.endCreateTime = undefined
+  createTimeRange.value = []
   handleQuery()
 }
 

+ 37 - 5
ygtx-ui/src/views/gxt/repairOrder/index.vue

@@ -86,6 +86,18 @@
           />
         </el-select>
       </el-form-item>
+      <el-form-item label="发生时间" prop="occurTime">
+        <el-date-picker
+            v-model="occurTimeRange"
+            type="daterange"
+            range-separator="-"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            value-format="YYYY-MM-DD"
+            style="width: 240px"
+            @change="handleDateChange"
+        />
+      </el-form-item>
     </el-form>
     <div style="float: right;">
       <el-button icon="Refresh" @click="resetQuery">重置</el-button>
@@ -562,10 +574,12 @@
                 <div
                     v-for="item in quickFaultDescList"
                     :key="item.id"
-                    class="quick-select-item"
                     @click="handleFaultDescQuickSelect(item)">
-                  <span class="user-name">{{ item.faultCode }}</span>
-                  <span class="user-name">{{ item.faultBarcode }}</span>
+<!--                  <span class="user-name">{{ item.faultCode }}</span>-->
+<!--                  <span class="user-name">{{ item.faultBarcode }}</span>-->
+                  <div class="quick-select-item" v-if="item.faultDescription">
+                  <span class="user-name" >{{ item.faultDescription }}</span>
+                  </div>
                 </div>
               </div>
               <div class="quick-select-dropdown no-data" v-show="showFaultDescQuickSelect && quickFaultDescList.length === 0 && form.faultDesc && !faultDescLoading">
@@ -1313,7 +1327,7 @@ import {listAutoMisInfo, listMisInfo, listWorkPerson} from "@/api/gxt/misInfo.js
 import {listGxtOrder} from "@/api/gxt/gxtOrder.js";
 import useUserStore from '@/store/modules/user'
 import { useRoute } from 'vue-router'
-import { watch } from 'vue'
+import {ref, watch} from 'vue'
 import { decryptParams } from '@/utils/encrypt'
 import ResetDialog from '@/components/repairOrder/reset.vue'
 import FinalizeDialog from '@/components/repairOrder/finalize.vue'
@@ -1329,6 +1343,7 @@ const { gxt_maintenance_type, gxt_work_order_status, gxt_order_priority_type,gxt
 
 // 数据列表相关
 const repairOrderList = ref([])
+const occurTimeRange = ref([]) // 用于存储日期范围选择的值
 
 const openDialog = ref(false)
 const viewDialogVisible = ref(false)
@@ -2091,6 +2106,8 @@ const queryParams = ref({
   reviewContent: null,
   maintenanceType: null,
   outTimeParam: null,
+  beginOccurTime: undefined, // 添加开始时间参数
+  endOccurTime: undefined,    // 添加结束时间参数
 })
 
 // 表单验证规则
@@ -2708,9 +2725,21 @@ function reset() {
   proxy.resetForm("repairOrderRef")
 }
 
+/** 处理日期范围变化 */
+function handleDateChange(val) {
+  if (val && val.length === 2) {
+    queryParams.value.beginOccurTime = val[0]
+    queryParams.value.endOccurTime = val[1]
+  } else {
+    queryParams.value.beginOccurTime = undefined
+    queryParams.value.endOccurTime = undefined
+  }
+}
+
 /** 搜索按钮操作 */
 function handleQuery() {
   queryParams.value.pageNum = 1
+  debugger
   getList()
 }
 
@@ -2748,6 +2777,9 @@ function onEquipmentSelected(row) {
 function resetQuery() {
   resetTimeOutOrder();
   proxy.resetForm("queryRef")
+  queryParams.value.beginOccurTime = undefined
+  queryParams.value.endOccurTime = undefined
+  occurTimeRange.value = []
   handleQuery()
 }
 
@@ -4111,7 +4143,7 @@ function handleAutoGenChange(){
 }
 
 .quick-select-item:last-child {
-  border-bottom: none;
+  //border-bottom: none;
 }
 
 .mis-no {