Browse Source

Merge remote-tracking branch 'origin/master'

ouyj 5 months ago
parent
commit
6c4b740fc2

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

@@ -187,6 +187,9 @@ public class GxtRepairOrder extends BaseEntity
     /** 终评系数 */
     private BigDecimal finalCoefficient;
 
+    /** 工单类型 */
+    private Long orderType;
+
     private List<GxtRepairOrderPerson> repairOrderPersonList;
 
     private List<GxtRepairOrderFlow> repairOrderFlowList;
@@ -672,6 +675,14 @@ public class GxtRepairOrder extends BaseEntity
         this.finalCoefficient = finalCoefficient;
     }
 
+    public Long getOrderType() {
+        return orderType;
+    }
+
+    public void setOrderType(Long orderType) {
+        this.orderType = orderType;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -715,6 +726,7 @@ public class GxtRepairOrder extends BaseEntity
             .append("approvalStatus", getApprovalStatus())
             .append("rejectionReason", getRejectionReason())
             .append("finalizationRemark", getFinalizationRemark())
+            .append("orderType", getOrderType())
             .toString();
     }
 }

+ 1 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtRepairOrderServiceImpl.java

@@ -141,6 +141,7 @@ public class GxtRepairOrderServiceImpl implements IGxtRepairOrderService
             gxtRepairOrder.setAssignUserId(SecurityUtils.getUserId());
             gxtRepairOrder.setAssignUserName(nickName);
         }
+        gxtRepairOrder.setOrderType(1L);
         gxtRepairOrder.setCreateBy(SecurityUtils.getUsername());
         gxtRepairOrder.setCreateTime(DateUtils.getNowDate());
         int result = gxtRepairOrderMapper.insertGxtRepairOrder(gxtRepairOrder);

+ 1 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtWorkOrderServiceImpl.java

@@ -148,6 +148,7 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
             throw new ServiceException("新增失败!" + gxtWorkOrder.getPcsStationName()+"不存在!");
         }
 
+        gxtWorkOrder.setOrderType(2L);
         gxtWorkOrder.setCreateTime(DateUtils.getNowDate());
         int result = gxtWorkOrderMapper.insertGxtWorkOrder(gxtWorkOrder);
         String actionType = null;

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

@@ -205,7 +205,7 @@
     <select id="selectMobileUnionOrderList" resultMap="OrderScoreInfoResult">
         SELECT * FROM (
         SELECT
-        1 as order_type,
+        order_type,
         id as id,
         work_order_project_no as work_order_project_no,
         work_order_status as work_order_status,
@@ -278,7 +278,7 @@
         UNION ALL
 
         SELECT
-        2 as order_type,
+        order_type,
         id as id,
         work_order_project_no as work_order_project_no,
         work_order_status as work_order_status,

+ 6 - 1
ygtx-gxt/src/main/resources/mapper/gxt/GxtRepairOrderMapper.xml

@@ -58,6 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="attachmentUrls"    column="attachment_urls"    />
         <result property="reviewScoreNum"    column="review_score_num"    />
         <result property="finalCoefficient"    column="final_coefficient"    />
+        <result property="orderType"    column="order_type"    />
     </resultMap>
 
     <resultMap type="GxtRepairOrder" id="GxtRepairOrderWithPersonResult" extends="GxtRepairOrderResult">
@@ -81,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                accept_user_id, accept_user_name, real_start_time, real_end_time, team_leader_id, team_leader_name, work_group_member_id,
                work_group_member_name, t.create_by, t.create_time, t.update_by, t.update_time, t.remark, content, plan_hour, priority_type, score,
                review_content, maintenance_type, occur_time, fault_barcode, suspend_reason, suspend_description, approval_status,
-               rejection_reason, modify_reason, finalization_remark, related_order_code, related_order_content, mis_order_no, restart_time, scoring_status, pcs_station_pid, attachment_urls, review_score_num, final_coefficient
+               rejection_reason, modify_reason, finalization_remark, related_order_code, related_order_content, mis_order_no, restart_time, scoring_status, pcs_station_pid, attachment_urls, review_score_num, final_coefficient, order_type
         from gxt_repair_order t
         left join sys_user u on u.user_name = t.create_by
         left join sys_dept d on u.dept_id = d.dept_id
@@ -137,6 +138,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="attachmentUrls != null  and attachmentUrls != ''"> and attachment_urls = #{attachmentUrls}</if>
             <if test="reviewScoreNum != null "> and review_score_num = #{reviewScoreNum}</if>
             <if test="finalCoefficient != null "> and final_coefficient = #{finalCoefficient}</if>
+            <if test="orderType != null "> and order_type = #{orderType}</if>
 
             <!-- 业务特定数据权限过滤条件 -->
             <if test="params.businessDataScope != null and params.businessDataScope != ''">
@@ -211,6 +213,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="attachmentUrls != null and attachmentUrls != ''">attachment_urls,</if>
             <if test="reviewScoreNum != null">review_score_num,</if>
             <if test="finalCoefficient != null">final_coefficient,</if>
+            <if test="orderType != null">order_type,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="workOrderProjectNo != null and workOrderProjectNo != ''">#{workOrderProjectNo},</if>
@@ -265,6 +268,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="attachmentUrls != null and attachmentUrls != ''">#{attachmentUrls},</if>
             <if test="reviewScoreNum != null">#{reviewScoreNum},</if>
             <if test="finalCoefficient != null">#{finalCoefficient},</if>
+            <if test="orderType != null">#{orderType},</if>
          </trim>
     </insert>
 
@@ -323,6 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="attachmentUrls != null and attachmentUrls != ''">attachment_urls = #{attachmentUrls},</if>
             <if test="reviewScoreNum != null">review_score_num = #{reviewScoreNum},</if>
             <if test="finalCoefficient != null">final_coefficient = #{finalCoefficient},</if>
+            <if test="orderType != null">order_type = #{orderType},</if>
         </trim>
         where id = #{id}
     </update>

+ 75 - 34
ygtx-ui/src/views/gxt/gxtOrder/index.vue

@@ -287,15 +287,28 @@
                 <el-input v-model="form.workOrderProjectNo" maxlength="50" show-word-limit v-chinese-limit readonly/>
               </el-form-item>
             </el-col>
+            <el-col :span="12">
+              <el-form-item label="风机编号" prop="pcsDeviceName">
+                <el-input v-model="form.pcsDeviceName" readonly>
+                  <template #append>
+                    <el-button @click="handleSelectEquipment" icon="Search"></el-button>
+                  </template>
+                </el-input>
+              </el-form-item>
+            </el-col>
+            <!-- MIS选择组件 -->
+            <MisInfoSelectSingle :key="commonKey" v-model="misInfoSelectVisible" @onSelected="onMisInfoSelected" :pcsDeviceName="form.pcsDeviceName"></MisInfoSelectSingle>
+          </el-row>
+          <el-row :gutter="20">
             <el-col :span="12">
               <el-form-item label="MIS工单编码" prop="misNo">
                 <el-input v-model="form.misNo"
-                  placeholder="请输入MIS工单编码或点击搜索选择"
-                  clearable
-                  @focus="handleMisNoInputFocus"
-                  @blur="handleMisNoInputBlur"
-                  @input="handleMisNoInput"
-                  @clear="handleMisNoClear"
+                          placeholder="请输入MIS工单编码或点击搜索选择"
+                          clearable
+                          @focus="handleMisNoInputFocus"
+                          @blur="handleMisNoInputBlur"
+                          @input="handleMisNoInput"
+                          @clear="handleMisNoClear"
                 >
                   <template #append>
                     <el-button @click="handleSelectMisInfo" icon="Search"></el-button>
@@ -309,10 +322,10 @@
                       class="quick-select-item"
                       @click="handleMisNoQuickSelect(item)">
                     <span class="mis-no">{{ item.misNo }}</span>
-<!--                    <span class="mis-info">-->
-<!--                    <span class="device">{{ item.pcsDeviceName }}</span>-->
-<!--                    <span class="station">{{ item.pcsStationName }}</span>-->
-<!--                    </span>-->
+                    <!--                    <span class="mis-info">-->
+                    <!--                    <span class="device">{{ item.pcsDeviceName }}</span>-->
+                    <!--                    <span class="station">{{ item.pcsStationName }}</span>-->
+                    <!--                    </span>-->
                   </div>
                 </div>
                 <div class="quick-select-dropdown no-data" v-show="showMisNoQuickSelect && quickMisNoList.length === 0 && form.misNo">
@@ -320,15 +333,6 @@
                 </div>
               </el-form-item>
             </el-col>
-            <!-- MIS选择组件 -->
-            <MisInfoSelectSingle :key="commonKey" v-model="misInfoSelectVisible" @onSelected="onMisInfoSelected"></MisInfoSelectSingle>
-          </el-row>
-          <el-row :gutter="20">
-            <el-col :span="12">
-              <el-form-item label="风机编号" prop="pcsDeviceName">
-                <el-input v-model="form.pcsDeviceName" readonly />
-              </el-form-item>
-            </el-col>
             <el-col :span="12">
               <el-form-item label="维保中心" prop="gxtCenter">
                 <el-input v-model="form.gxtCenter" readonly />
@@ -1423,6 +1427,8 @@
         </div>
       </template>
     </el-dialog>
+    <!-- 设备选择组件 -->
+    <equipment-select-single v-model="equipmentSelectVisible" @onSelected="onEquipmentSelected"></equipment-select-single>
   </div>
 </template>
 
@@ -1461,6 +1467,7 @@ import MisInfoSelectSingle from "@/components/misInfoSelect/single.vue";
 import {genCode} from "@/api/system/autocode/rule.js";
 import {listMisInfo, listWorkPerson} from "@/api/gxt/misInfo.js";
 import {ElMessageBox} from "element-plus";
+import EquipmentSelectSingle from "@/components/equipmentSelect/single.vue";
 
 // 工作负责人快速检索相关响应式数据
 const showTeamLeaderQuickSelect = ref(false)
@@ -1649,8 +1656,8 @@ const searchMisNoList = async (keyword) => {
       pageNum: 1,
       // pageSize: 10, // 只显示前10条结果
       misNo: keyword,
-      pcsDeviceName: keyword,
-      pcsStationName: keyword
+      pcsDeviceName: form.value.pcsDeviceName,
+      // pcsStationName: keyword
       // 注意:这里假设后端API支持这些字段的模糊查询
       // 如果后端不支持多字段同时查询,可能需要调整
     })
@@ -1734,6 +1741,7 @@ const flowDialogVisible = ref(false)
 const detailDialogVisible = ref(false)
 const acceptDialogVisible = ref(false)
 const restartDialogVisible = ref(false)
+const equipmentSelectVisible = ref(false)
 const userList = ref([])
 const flowList = ref([])
 const detailData = ref({})
@@ -1778,7 +1786,9 @@ const personUpload = reactive({
 })
 
 const data = reactive({
-  form: {},
+  form: {
+    // pcsDeviceName: undefined,
+  },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
@@ -2642,7 +2652,6 @@ function handleSelectMisInfo() {
 
 /** 设备MIS信息回调 */
 function onMisInfoSelected(row) {
-  debugger
   if (row) {
     listGxtOrder({pageNum: 1, pageSize: 10, misNo: row.misNo }).then(response => {
       const  gxtOrders= response.rows
@@ -2651,22 +2660,24 @@ function onMisInfoSelected(row) {
         return
       }
       form.value.misNo = row.misNo
-      form.value.pcsDeviceName = row.pcsDeviceName
-      form.value.pcsStationName = row.pcsStationName
       form.value.content = row.content
       form.value.realStartTime = row.realStartTime
       form.value.realEndTime = row.realEndTime
       form.value.planStartTime = row.planStartTime
       form.value.planEndTime = row.planEndTime
-      listEquipment({ station: row.pcsStationName, equipmentCode: row.pcsDeviceName }).then(response => {
-        const equipments = response.rows
-        if (equipments) {
-          form.value.pcsDeviceId = equipments[0].equipmentId
-          form.value.gxtCenter = equipments[0].maintenanceCenter
-          form.value.brand = equipments[0].brand
-          form.value.model = equipments[0].model
-        }
-      });
+      if (!form.value.pcsDeviceId) {
+        form.value.pcsDeviceName = row.pcsDeviceName
+        form.value.pcsStationName = row.pcsStationName
+        listEquipment({station: row.pcsStationName, equipmentCode: row.pcsDeviceName}).then(response => {
+          const equipments = response.rows
+          if (equipments) {
+            form.value.pcsDeviceId = equipments[0].equipmentId
+            form.value.gxtCenter = equipments[0].maintenanceCenter
+            form.value.brand = equipments[0].brand
+            form.value.model = equipments[0].model
+          }
+        });
+      }
       misInfoSelectVisible.value = false
     })
   }
@@ -2679,6 +2690,36 @@ function handleAutoGenChange(){
     });
 }
 
+/** 打开设备选择对话框 */
+function handleSelectEquipment() {
+  equipmentSelectVisible.value = true
+}
+
+/** 设备选择回调 */
+function onEquipmentSelected(row) {
+  if (row) {
+    // 检查维保中心ID和场站ID是否存在
+    if (!row.maintenanceCenterId) {
+      proxy.$modal.msgError("该设备的维保中心没有对应的部门,请完善部门信息后再更新设备数据!");
+      return;
+    }
+    if (!row.stationId) {
+      proxy.$modal.msgError("该设备的场站没有对应的部门,请完善部门信息后再更新设备数据!");
+      return;
+    }
+    form.value.pcsDeviceId = row.equipmentId
+    form.value.pcsDeviceName = row.equipmentCode
+    form.value.gxtCenterId = row.maintenanceCenterId
+    form.value.gxtCenter = row.maintenanceCenter
+    form.value.pcsStationId = row.stationId
+    form.value.pcsStationName = row.station
+    form.value.brand = row.brand
+    form.value.model = row.model
+  }
+  equipmentSelectVisible.value = false
+  commonKey++
+}
+
 getList()
 </script>
 <style scoped>