From f08739f46afe856f60ebb1d21ab23d72947629ed Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期日, 21 十二月 2025 00:03:12 +0800
Subject: [PATCH] feat:优化任务搜索查询 app
---
app/pages/index.vue | 99 +
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskCreateVO.java | 28
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysEmergencyTaskServiceImpl.java | 9
sql/remove_is_head_push_from_sys_task.sql | 5
app/pagesTask/components/DepartmentSelector.vue | 3
ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml | 10
app/pages/task/index.vue | 2074 +++++++++++++++++++++++++---------------------
ruoyi-common/src/main/java/com/ruoyi/common/utils/IntegerUtil.java | 27
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java | 17
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskQueryVO.java | 11
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java | 22
sql/add_vip_and_hq_fields_to_sys_task_emergency.sql | 20
ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml | 9
app/pagesTask/edit-emergency.vue | 164 +++
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTaskEmergency.java | 22
app/pagesTask/detail.vue | 79 +
ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTask.java | 11
ruoyi-system/src/main/resources/mapper/system/LegacyTransferSyncMapper.xml | 8
18 files changed, 1,582 insertions(+), 1,036 deletions(-)
diff --git a/app/pages/index.vue b/app/pages/index.vue
index 6579435..d86d564 100644
--- a/app/pages/index.vue
+++ b/app/pages/index.vue
@@ -101,7 +101,8 @@
<view class="task-header">
<view class="task-title">
{{ getTaskTypeText(task.type) }} - {{ task.vehicle }}
- <text v-if="task.isHeadPush === '1'" class="head-push-tag">鎬�</text>
+ <text v-if="task.emergencyInfo && task.emergencyInfo.serviceOrdVip === '1'" class="vip-tag">VIP</text>
+ <text v-if="task.emergencyInfo && task.emergencyInfo.fromHq2Is === '1'" class="hq-tag">骞挎��</text>
</view>
<view
class="task-status"
@@ -127,9 +128,10 @@
</view>
</view>
- <!-- 浠诲姟缂栧彿鍗曠嫭涓�琛� -->
+ <!-- 浠诲姟缂栧彿鍜屽紑濮嬫椂闂村湪鍚屼竴琛屾樉绀猴紝浣嗗垎寮�涓�浜� -->
<view class="task-code-row">
<text class="task-code">{{ task.showTaskCode }}</text>
+ <text class="task-time">{{ task.startTime }}</text>
</view>
<!-- 浠诲姟璇︾粏淇℃伅 -->
@@ -137,18 +139,18 @@
<view class="info-row">
<view class="info-item">
<view class="label">鍑哄彂鍦�:</view>
- <view class="value">{{ task.startLocation }}</view>
+ <view class="value">{{ getStartLocationDisplay(task) }}</view>
</view>
- <view class="info-item">
- <view class="label">鐩殑鍦�:</view>
- <view class="value">{{ task.endLocation }}</view>
- </view>
+
</view>
<view class="info-row">
<view class="info-item">
- <view class="label">鍑哄彂鏃堕棿:</view>
- <view class="value">{{ task.startTime }}</view>
+ <view class="label">鐩殑鍦�:</view>
+ <view class="value">{{ getEndLocationDisplay(task) }}</view>
</view>
+ </view>
+ <view class="info-row">
+
<view class="info-item">
<view class="label">鎵ц浜哄憳:</view>
<view class="value">{{ task.assignee }}</view>
@@ -505,12 +507,8 @@
type: task.taskType,
vehicle: vehicleInfo,
vehicleList: task.assignedVehicles || [],
- startLocation: this.formatAddress(
- task.departureAddress || task.startLocation || "鏈缃�"
- ),
- endLocation: this.formatAddress(
- task.destinationAddress || task.endLocation || "鏈缃�"
- ),
+ startLocation: task.departureAddress || task.startLocation || "鏈缃�",
+ endLocation: task.destinationAddress || task.endLocation || "鏈缃�",
startTime: task.plannedStartTime
? formatDateTime(task.plannedStartTime, "YYYY-MM-DD HH:mm")
: "鏈缃�",
@@ -553,6 +551,33 @@
return address.substring(0, dashIndex);
}
return address;
+ },
+
+ // 鑾峰彇鍑哄彂鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞嚭鍖婚櫌鍚嶇О锛�
+ getStartLocationDisplay(task) {
+ // 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+ if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo && task.emergencyInfo.hospitalOutName) {
+ return task.emergencyInfo.hospitalOutName;
+ }
+ // 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨剆tartLocation
+ return this.formatAddress(task.startLocation || "鏈缃�");
+ },
+
+ // 鑾峰彇鐩殑鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞叆鍖婚櫌鍚嶇О鎴栬缁嗗湴鍧�锛�
+ getEndLocationDisplay(task) {
+ // 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+ if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo) {
+ // 浼樺厛鏄剧ず杞叆鍖婚櫌鍚嶇О
+ if (task.emergencyInfo.hospitalInName) {
+ if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
+ return task.emergencyInfo.destinationAddress;
+ }
+ return task.emergencyInfo.hospitalInName;
+ }
+
+ }
+ // 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨別ndLocation
+ return this.formatAddress(task.endLocation || "鏈缃�");
},
// 杞崲鐘舵�佹牸寮忥紙灏嗘暟鎹簱鐘舵�佽浆鎹负UI浣跨敤鐨勭姸鎬侊級
@@ -824,17 +849,6 @@
* {
-ms-overflow-style: none; /* IE 10+ */
}
-}
-
-// 鎬婚儴鎺ㄩ�佹爣璁版牱寮�
-.head-push-tag {
- color: #ff0000;
- font-size: 24rpx;
- font-weight: bold;
- margin-left: 10rpx;
- padding: 2rpx 8rpx;
- border: 1rpx solid #ff0000;
- border-radius: 4rpx;
}
// 鐢ㄦ埛淇℃伅鍖哄煙
@@ -1115,13 +1129,22 @@
}
}
- // 浠诲姟缂栧彿鍗曠嫭涓�琛�
+ // 浠诲姟缂栧彿鍜屾椂闂村湪鍚屼竴琛屾樉绀�
.task-code-row {
margin-bottom: 15rpx;
padding: 10rpx 0;
border-bottom: 1rpx dashed #e0e0e0;
+ display: flex;
+ justify-content: space-between;
.task-code {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 500;
+ font-family: monospace;
+ }
+
+ .task-time {
font-size: 28rpx;
color: #333;
font-weight: 500;
@@ -1220,6 +1243,28 @@
color: #666;
}
}
+
+ .vip-tag {
+ display: inline-block;
+ padding: 2rpx 8rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background-color: #ff0000;
+ border-radius: 4rpx;
+ margin-left: 10rpx;
+ vertical-align: middle;
+ }
+
+ .hq-tag {
+ display: inline-block;
+ padding: 2rpx 8rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background-color: #5856d6;
+ border-radius: 4rpx;
+ margin-left: 10rpx;
+ vertical-align: middle;
+ }
}
}
</style>
\ No newline at end of file
diff --git a/app/pages/task/index.vue b/app/pages/task/index.vue
index 36fdbb6..4bc55ec 100644
--- a/app/pages/task/index.vue
+++ b/app/pages/task/index.vue
@@ -6,98 +6,105 @@
<view class="header-title">浠诲姟鍒楄〃</view>
<view class="header-actions">
<button class="search-toggle-btn" @click="toggleSearch">
- <uni-icons :type="showSearch ? 'close' : 'search'" size="20"></uni-icons>
+ <uni-icons
+ :type="showSearch ? 'close' : 'search'"
+ size="20"
+ ></uni-icons>
</button>
<button class="refresh-btn" @click="refreshList">
<uni-icons type="refresh" size="20"></uni-icons>
</button>
</view>
</view>
-
+
<!-- 鏌ヨ鏉′欢鍖哄煙 -->
<view class="search-section" v-show="showSearch">
<view class="search-form">
<view class="form-item">
<view class="form-label">浠诲姟鐘舵��</view>
- <picker mode="selector" :range="statusOptions" @change="onStatusChange">
+ <picker
+ mode="selector"
+ :range="statusOptions"
+ @change="onStatusChange"
+ >
<view class="form-input picker-input">
- {{ selectedStatusText || '鍏ㄩ儴鐘舵��' }}
+ {{ selectedStatusText || "鍏ㄩ儴鐘舵��" }}
<uni-icons type="arrowright" size="16" color="#999"></uni-icons>
</view>
</picker>
</view>
-
+
<view class="form-item">
<view class="form-label">浠诲姟鏃堕棿</view>
<view class="date-range">
<!-- 浣跨敤uni-datetime-picker缁勪欢 -->
- <uni-datetime-picker
- v-model="startDate"
- type="date"
+ <uni-datetime-picker
+ v-model="startDate"
+ type="date"
:placeholder="'寮�濮嬫椂闂�'"
class="date-input"
/>
<text class="divider">鑷�</text>
<!-- 浣跨敤uni-datetime-picker缁勪欢 -->
- <uni-datetime-picker
- v-model="endDate"
- type="date"
+ <uni-datetime-picker
+ v-model="endDate"
+ type="date"
:placeholder="'缁撴潫鏃堕棿'"
class="date-input"
/>
</view>
</view>
-
+
<view class="form-item">
<view class="form-label">杞︾墝鍙�</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ヨ溅鐗屽彿"
+ <input
+ class="form-input"
+ placeholder="璇疯緭鍏ヨ溅鐗屽彿"
v-model="searchForm.vehicle"
/>
</view>
-
+
<view class="form-item">
<view class="form-label">浠诲姟缂栧彿</view>
- <input
- class="form-input"
- placeholder="璇疯緭鍏ヤ换鍔$紪鍙�"
+ <input
+ class="form-input"
+ placeholder="璇疯緭鍏ヤ换鍔$紪鍙�"
v-model="searchForm.taskNo"
/>
</view>
-
+
<view class="form-actions">
<button class="search-btn" @click="handleSearch">鏌ヨ</button>
<button class="reset-btn" @click="resetSearch">閲嶇疆</button>
</view>
</view>
</view>
-
+
<view class="task-filter">
<scroll-view class="filter-tabs" scroll-x="true">
- <view
- class="filter-item"
+ <view
+ class="filter-item"
:class="{ active: currentFilter === 'all' }"
@click="changeFilter('all')"
>
鍏ㄩ儴
</view>
- <view
- class="filter-item"
+ <view
+ class="filter-item"
:class="{ active: currentFilter === 'pending' }"
@click="changeFilter('pending')"
>
寰呭鐞�
</view>
- <view
- class="filter-item"
+ <view
+ class="filter-item"
:class="{ active: currentFilter === 'processing' }"
@click="changeFilter('processing')"
>
澶勭悊涓�
</view>
- <view
- class="filter-item"
+ <view
+ class="filter-item"
:class="{ active: currentFilter === 'completed' }"
@click="changeFilter('completed')"
>
@@ -105,44 +112,80 @@
</view>
</scroll-view>
</view>
-
+
<scroll-view class="task-list-scroll" scroll-y="true">
<view class="task-list">
- <view class="task-item" v-for="task in filteredTaskList" :key="task.taskId">
+ <view
+ class="task-item"
+ v-for="task in filteredTaskList"
+ :key="task.taskId"
+ >
<view class="task-main" @click="viewTaskDetail(task)">
<!-- 浠诲姟澶撮儴锛氭爣棰樺拰鐘舵�佹爣绛� -->
<view class="task-header">
<view class="task-title">
{{ getTaskTypeText(task.taskType) }} - {{ task.vehicle }}
- <text v-if="task.isHeadPush === '1'" class="head-push-tag">鎬�</text>
+ <text
+ v-if="
+ task.emergencyInfo &&
+ task.emergencyInfo.serviceOrdVip === '1'
+ "
+ class="vip-tag"
+ >VIP</text
+ >
+ <text
+ v-if="
+ task.emergencyInfo && task.emergencyInfo.fromHq2Is === '1'
+ "
+ class="hq-tag"
+ >骞挎��</text
+ >
</view>
- <view class="task-status" :class="task.taskStatus === 'PENDING' ? 'status-pending' : task.taskStatus === 'DEPARTING' ? 'status-departing' : task.taskStatus === 'ARRIVED' ? 'status-arrived' : task.taskStatus === 'RETURNING' ? 'status-returning' : task.taskStatus === 'COMPLETED' ? 'status-completed' : task.taskStatus === 'CANCELLED' ? 'status-cancelled' : task.taskStatus === 'IN_PROGRESS' ? 'status-in-progress' : 'status-default'">
+ <view
+ class="task-status"
+ :class="
+ task.taskStatus === 'PENDING'
+ ? 'status-pending'
+ : task.taskStatus === 'DEPARTING'
+ ? 'status-departing'
+ : task.taskStatus === 'ARRIVED'
+ ? 'status-arrived'
+ : task.taskStatus === 'RETURNING'
+ ? 'status-returning'
+ : task.taskStatus === 'COMPLETED'
+ ? 'status-completed'
+ : task.taskStatus === 'CANCELLED'
+ ? 'status-cancelled'
+ : task.taskStatus === 'IN_PROGRESS'
+ ? 'status-in-progress'
+ : 'status-default'
+ "
+ >
{{ getStatusText(task.taskStatus) }}
</view>
</view>
-
- <!-- 浠诲姟缂栧彿鍗曠嫭涓�琛� -->
+
+ <!-- 浠诲姟缂栧彿鍜屽紑濮嬫椂闂村湪鍚屼竴琛屾樉绀猴紝浣嗗垎寮�涓�浜� -->
<view class="task-code-row">
<text class="task-code">{{ task.showTaskCode }}</text>
+ <text class="task-time">鍑哄彂鏃堕棿:{{ task.startTime }}</text>
</view>
-
+
<!-- 浠诲姟璇︾粏淇℃伅 -->
<view class="task-info">
<view class="info-row">
<view class="info-item">
<view class="label">鍑哄彂鍦�:</view>
- <view class="value">{{ task.startLocation }}</view>
- </view>
- <view class="info-item">
- <view class="label">鐩殑鍦�:</view>
- <view class="value">{{ task.endLocation }}</view>
+ <view class="value">{{ getStartLocationDisplay(task) }}</view>
</view>
</view>
<view class="info-row">
<view class="info-item">
- <view class="label">鍑哄彂鏃堕棿:</view>
- <view class="value">{{ task.startTime }}</view>
+ <view class="label">鐩殑鍦�:</view>
+ <view class="value">{{ getEndLocationDisplay(task) }}</view>
</view>
+ </view>
+ <view class="info-row">
<view class="info-item">
<view class="label">鎵ц浜哄憳:</view>
<view class="value">{{ task.assignee }}</view>
@@ -150,65 +193,65 @@
</view>
</view>
</view>
-
+
<!-- 鎿嶄綔鎸夐挳 -->
<view class="task-actions">
<!-- 寰呭鐞嗙姸鎬�: 鏄剧ず鍑哄彂銆佸彇娑� -->
<template v-if="task.taskStatus === 'PENDING'">
- <button
- class="action-btn primary"
+ <button
+ class="action-btn primary"
@click="handleTaskAction(task, 'depart')"
>
鍑哄彂
</button>
- <button
- class="action-btn cancel"
+ <button
+ class="action-btn cancel"
@click="handleTaskAction(task, 'cancel')"
>
鍙栨秷
</button>
</template>
-
+
<!-- 鍑哄彂涓姸鎬�: 鏄剧ず宸插埌杈俱�佸己鍒剁粨鏉� -->
<template v-else-if="task.taskStatus === 'DEPARTING'">
- <button
- class="action-btn primary"
+ <button
+ class="action-btn primary"
@click="handleTaskAction(task, 'arrive')"
>
宸插埌杈�
</button>
- <button
- class="action-btn cancel"
+ <button
+ class="action-btn cancel"
@click="handleTaskAction(task, 'forceCancel')"
>
寮哄埗缁撴潫
</button>
</template>
-
+
<!-- 宸插埌杈剧姸鎬�: 鏄剧ず宸茶繑绋� -->
<template v-else-if="task.taskStatus === 'ARRIVED'">
- <button
- class="action-btn primary"
+ <button
+ class="action-btn primary"
@click="handleTaskAction(task, 'return')"
>
宸茶繑绋�
</button>
</template>
-
+
<!-- 杩旂▼涓姸鎬�: 鏄剧ず宸插畬鎴� -->
<template v-else-if="task.taskStatus === 'RETURNING'">
- <button
- class="action-btn primary"
+ <button
+ class="action-btn primary"
@click="handleTaskAction(task, 'complete')"
>
宸插畬鎴�
</button>
</template>
-
+
<!-- 宸插畬鎴�/宸插彇娑�: 涓嶆樉绀烘寜閽� -->
</view>
</view>
-
+
<view class="no-data" v-if="filteredTaskList.length === 0">
<uni-icons type="info" size="40" color="#ccc"></uni-icons>
<text>鏆傛棤浠诲姟鏁版嵁</text>
@@ -218,7 +261,10 @@
<uni-icons type="spinner-cycle" size="20" color="#999"></uni-icons>
<text>姝e湪鍔犺浇鏇村鏁版嵁...</text>
</view>
- <view class="load-more no-more" v-else-if="filteredTaskList.length > 0 && !hasMore">
+ <view
+ class="load-more no-more"
+ v-else-if="filteredTaskList.length > 0 && !hasMore"
+ >
<text>娌℃湁鏇村鏁版嵁浜�</text>
</view>
</view>
@@ -228,749 +274,828 @@
</template>
<script>
- import uniDatetimePicker from '@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
- import { listTask, changeTaskStatus } from '@/api/task'
- import { mapState } from 'vuex'
- import { formatDateTime } from '@/utils/common'
- import { checkTaskCanDepart } from '@/utils/taskValidator'
-
- export default {
- components: {
- uniDatetimePicker
+import uniDatetimePicker from "@/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue";
+import { listTask, changeTaskStatus } from "@/api/task";
+import { mapState } from "vuex";
+import { formatDateTime } from "@/utils/common";
+import { checkTaskCanDepart } from "@/utils/taskValidator";
+
+export default {
+ components: {
+ uniDatetimePicker,
+ },
+ data() {
+ return {
+ // 鎺у埗鏌ヨ鐣岄潰鏄剧ず/闅愯棌
+ showSearch: false,
+
+ // 鏌ヨ鏉′欢
+ searchForm: {
+ vehicle: "",
+ taskNo: "",
+ },
+ statusOptions: ["鍏ㄩ儴鐘舵��", "寰呭鐞�", "澶勭悊涓�", "宸插畬鎴�"],
+ statusValues: ["", "pending", "processing", "completed"],
+ selectedStatus: "",
+ selectedStatusText: "",
+ startDate: "",
+ endDate: "",
+ currentFilter: "all",
+
+ // 浠诲姟鍒楄〃
+ taskList: [],
+ loading: false,
+ refreshing: false,
+
+ // 鍒嗛〉鐩稿叧
+ currentPage: 1,
+ pageSize: 10,
+ total: 0,
+ hasMore: true,
+ };
+ },
+ computed: {
+ ...mapState({
+ currentUser: (state) => state.user,
+ }),
+ filteredTaskList() {
+ // 娉ㄦ剰锛氳繖閲屼笉鍐嶈繘琛屽墠绔繃婊わ紝鑰屾槸鐩存帴杩斿洖浠庢湇鍔″櫒鍔犺浇鐨勬暟鎹�
+ // 瀹為檯鐨勭瓫閫夊皢鍦ㄨ姹傛湇鍔″櫒鏃跺畬鎴�
+ return this.taskList;
},
- data() {
- return {
- // 鎺у埗鏌ヨ鐣岄潰鏄剧ず/闅愯棌
- showSearch: false,
-
- // 鏌ヨ鏉′欢
- searchForm: {
- vehicle: '',
- taskNo: ''
- },
- statusOptions: ['鍏ㄩ儴鐘舵��', '寰呭鐞�', '澶勭悊涓�', '宸插畬鎴�'],
- statusValues: ['', 'pending', 'processing', 'completed'],
- selectedStatus: '',
- selectedStatusText: '',
- startDate: '',
- endDate: '',
- currentFilter: 'all',
-
- // 浠诲姟鍒楄〃
- taskList: [],
- loading: false,
- refreshing: false,
-
- // 鍒嗛〉鐩稿叧
- currentPage: 1,
- pageSize: 10,
- total: 0,
- hasMore: true
- }
+ },
+ onLoad() {
+ this.loadTaskList();
+
+ // 鐩戝惉浠诲姟鍒楄〃鍒锋柊浜嬩欢
+ uni.$on("refreshTaskList", this.handleRefreshEvent);
+ },
+ onShow() {
+ // 椤甸潰鏄剧ず鏃跺埛鏂板垪琛紙浠庡叾浠栭〉闈㈣繑鍥炴椂锛�
+ this.loadTaskList();
+ },
+ onUnload() {
+ // 椤甸潰閿�姣佹椂绉婚櫎浜嬩欢鐩戝惉
+ uni.$off("refreshTaskList", this.handleRefreshEvent);
+ },
+ onPullDownRefresh() {
+ this.refreshList();
+ },
+ // 鐩戝惉婊氬姩鍒板簳閮ㄤ簨浠�
+ onReachBottom() {
+ if (this.hasMore && !this.loading) {
+ this.loadMore();
+ }
+ },
+ methods: {
+ // 澶勭悊鍒锋柊浜嬩欢
+ handleRefreshEvent() {
+ console.log("鏀跺埌鍒锋柊浠诲姟鍒楄〃浜嬩欢");
+ this.refreshList();
},
- computed: {
- ...mapState({
- currentUser: state => state.user
- }),
- filteredTaskList() {
- let filtered = this.taskList;
-
- // 搴旂敤绛涢�夊櫒
- if (this.currentFilter !== 'all') {
- filtered = filtered.filter(task => {
- if (this.currentFilter === 'pending') return task.taskStatus === 'PENDING';
- if (this.currentFilter === 'processing') return ['DEPARTING', 'ARRIVED', 'RETURNING', 'IN_PROGRESS'].includes(task.taskStatus);
- if (this.currentFilter === 'completed') return task.taskStatus === 'COMPLETED';
- return true;
- });
- }
-
- // 搴旂敤鐘舵�佺瓫閫�
+
+ // 鍔犺浇浠诲姟鍒楄〃
+ loadTaskList() {
+ this.loading = true;
+ // 閲嶇疆鍒嗛〉鍙傛暟
+ this.currentPage = 1;
+ this.hasMore = true;
+ this.taskList = [];
+
+ // 鍚庣浼氳嚜鍔ㄨ幏鍙栧綋鍓嶇敤鎴蜂俊鎭紝瀹炵幇缁煎悎鏌ヨ
+ // 缁煎悎鏌ヨ锛氬綋鍓嶇敤鎴锋墍鍦ㄦ満鏋勪换鍔� + 褰撳墠鐢ㄦ埛鍒涘缓鐨勪换鍔� + 鍒嗛厤缁欏綋鍓嶇敤鎴风殑浠诲姟
+ const queryParams = {
+ pageNum: this.currentPage,
+ pageSize: this.pageSize,
+ orderByColumn: "create_time",
+ isAsc: "desc",
+ };
+
+ // 鏍规嵁绛涢�夋潯浠舵坊鍔犵姸鎬佸弬鏁帮紙浼樺厛浣跨敤椤堕儴tab绛涢�夋潯浠讹級
+ if (this.currentFilter === "pending") {
+ queryParams.taskStatus = "PENDING";
+ } else if (this.currentFilter === "processing") {
+ queryParams.taskStatusList = [
+ "DEPARTING",
+ "ARRIVED",
+ "RETURNING",
+ "IN_PROGRESS",
+ ].join(",");
+ } else if (this.currentFilter === "completed") {
+ queryParams.taskStatus = "COMPLETED";
+ } else {
+ // 濡傛灉娌℃湁浣跨敤椤堕儴tab绛涢�夛紝鍒欎娇鐢ㄦ煡璇㈡潯浠朵腑鐨勭姸鎬佺瓫閫�
if (this.selectedStatus) {
const statusMap = {
- 'pending': ['PENDING'],
- 'processing': ['DEPARTING', 'ARRIVED', 'RETURNING', 'IN_PROGRESS'],
- 'completed': ['COMPLETED']
- }
- const validStatuses = statusMap[this.selectedStatus];
- if (validStatuses) {
- filtered = filtered.filter(task => validStatuses.includes(task.taskStatus));
- }
- }
-
- // 搴旂敤杞︾墝鍙风瓫閫� - 鎼滅储assignedVehicles鏁扮粍涓殑杞﹁締
- if (this.searchForm.vehicle) {
- filtered = filtered.filter(task => {
- // 鍦ㄨ溅杈嗗垪琛ㄤ腑鏌ユ壘鍖归厤鐨勮溅鐗屽彿
- if (task.vehicleList && task.vehicleList.length > 0) {
- return task.vehicleList.some(vehicle =>
- vehicle.vehicleNo && vehicle.vehicleNo.includes(this.searchForm.vehicle)
- )
+ pending: "PENDING",
+ processing: [
+ "DEPARTING",
+ "ARRIVED",
+ "RETURNING",
+ "IN_PROGRESS",
+ ].join(","),
+ completed: "COMPLETED",
+ };
+ if (statusMap[this.selectedStatus]) {
+ if (
+ this.selectedStatus === "pending" ||
+ this.selectedStatus === "completed"
+ ) {
+ queryParams.taskStatus = statusMap[this.selectedStatus];
+ } else {
+ queryParams.taskStatusList = statusMap[this.selectedStatus];
}
- return false
- });
+ }
}
-
- // 搴旂敤浠诲姟缂栧彿绛涢�� - 浣跨敤taskCode鑰屼笉鏄痶askNo
- if (this.searchForm.taskNo) {
- filtered = filtered.filter(task =>
- task.showTaskCode && task.showTaskCode.includes(this.searchForm.taskNo)
- );
- }
-
- // 搴旂敤鏃堕棿鑼冨洿绛涢��
- if (this.startDate) {
- filtered = filtered.filter(task =>
- task.plannedStartTime && task.plannedStartTime >= this.startDate
- );
- }
-
- if (this.endDate) {
- // 缁撴潫鏃ユ湡鍔犱竴澶╋紝浠ヤ究鍖呭惈褰撳ぉ鐨勬暟鎹�
- const end = new Date(this.endDate);
- end.setDate(end.getDate() + 1);
- const endDateStr = end.toISOString().split('T')[0];
-
- filtered = filtered.filter(task =>
- task.plannedStartTime && task.plannedStartTime < endDateStr
- );
- }
-
- return filtered;
}
- },
- onLoad() {
- this.loadTaskList()
-
- // 鐩戝惉浠诲姟鍒楄〃鍒锋柊浜嬩欢
- uni.$on('refreshTaskList', this.handleRefreshEvent)
- },
- onShow() {
- // 椤甸潰鏄剧ず鏃跺埛鏂板垪琛紙浠庡叾浠栭〉闈㈣繑鍥炴椂锛�
- this.loadTaskList()
- },
- onUnload() {
- // 椤甸潰閿�姣佹椂绉婚櫎浜嬩欢鐩戝惉
- uni.$off('refreshTaskList', this.handleRefreshEvent)
- },
- onPullDownRefresh() {
- this.refreshList()
- },
- // 鐩戝惉婊氬姩鍒板簳閮ㄤ簨浠�
- onReachBottom() {
- if (this.hasMore && !this.loading) {
- this.loadMore()
+
+ if (this.searchForm.vehicle) {
+ queryParams.vehicleNo = this.searchForm.vehicle;
}
- },
- methods: {
- // 澶勭悊鍒锋柊浜嬩欢
- handleRefreshEvent() {
- console.log('鏀跺埌鍒锋柊浠诲姟鍒楄〃浜嬩欢')
- this.refreshList()
- },
-
- // 鍔犺浇浠诲姟鍒楄〃
- loadTaskList() {
- this.loading = true
- // 閲嶇疆鍒嗛〉鍙傛暟
- this.currentPage = 1
- this.hasMore = true
- this.taskList = []
-
- // 鍚庣浼氳嚜鍔ㄨ幏鍙栧綋鍓嶇敤鎴蜂俊鎭紝瀹炵幇缁煎悎鏌ヨ
- // 缁煎悎鏌ヨ锛氬綋鍓嶇敤鎴锋墍鍦ㄦ満鏋勪换鍔� + 褰撳墠鐢ㄦ埛鍒涘缓鐨勪换鍔� + 鍒嗛厤缁欏綋鍓嶇敤鎴风殑浠诲姟
- const queryParams = {
- pageNum: this.currentPage,
- pageSize: this.pageSize,
- orderByColumn: 'create_time',
- isAsc: 'desc'
- }
-
- listTask(queryParams).then(response => {
- this.loading = false
- const data = response.data || response.rows || []
+
+ if (this.searchForm.taskNo) {
+ queryParams.showTaskCode = this.searchForm.taskNo;
+ }
+
+ if (this.startDate) {
+ queryParams.startDate = this.startDate;
+ }
+
+ if (this.endDate) {
+ queryParams.endDate = this.endDate;
+ }
+
+ listTask(queryParams)
+ .then((response) => {
+ this.loading = false;
+ const data = response.data || response.rows || [];
// 璁剧疆鎬绘暟鍜屾槸鍚︽湁鏇村鏁版嵁
- this.total = response.total || data.length || 0
- this.hasMore = data.length === this.pageSize
-
- this.taskList = data.map(task => {
+ this.total = response.total || data.length || 0;
+ this.hasMore = data.length === this.pageSize;
+
+ this.taskList = data.map((task) => {
// 浠巃ssignedVehicles鏁扮粍涓幏鍙栬溅杈嗕俊鎭�
- let vehicleInfo = '鏈垎閰嶈溅杈�'
+ let vehicleInfo = "鏈垎閰嶈溅杈�";
if (task.assignedVehicles && task.assignedVehicles.length > 0) {
// 濡傛灉鏈夊涓溅杈�,鏄剧ず绗竴涓�,骞舵爣娉ㄦ暟閲�
- const firstVehicle = task.assignedVehicles[0]
- vehicleInfo = firstVehicle.vehicleNo || '鏈煡杞︾墝'
+ const firstVehicle = task.assignedVehicles[0];
+ vehicleInfo = firstVehicle.vehicleNo || "鏈煡杞︾墝";
if (task.assignedVehicles.length > 1) {
- vehicleInfo += ` 绛�${task.assignedVehicles.length}杈哷
+ vehicleInfo += ` 绛�${task.assignedVehicles.length}杈哷;
}
}
-
+
return {
...task,
// 鏍煎紡鍖栨樉绀哄瓧娈� - 浣跨敤鍚庣杩斿洖鐨刟ssignedVehicles鏁版嵁
vehicle: vehicleInfo,
vehicleList: task.assignedVehicles || [],
- startLocation: this.formatAddress(task.departureAddress || task.startLocation || '鏈缃�'),
- endLocation: this.formatAddress(task.destinationAddress || task.endLocation || '鏈缃�'),
- startTime: task.plannedStartTime ? formatDateTime(task.plannedStartTime, 'YYYY-MM-DD HH:mm') : '鏈缃�',
- assignee: task.assigneeName || '鏈垎閰�'
- }
- })
- }).catch(error => {
- this.loading = false
- console.error('鍔犺浇浠诲姟鍒楄〃澶辫触:', error)
- this.$modal.showToast('鍔犺浇浠诲姟鍒楄〃澶辫触')
+ startLocation: this.formatAddress(
+ task.departureAddress || task.startLocation || "鏈缃�"
+ ),
+ endLocation: this.formatAddress(
+ task.destinationAddress || task.endLocation || "鏈缃�"
+ ),
+ startTime: task.plannedStartTime
+ ? formatDateTime(task.plannedStartTime, "YYYY-MM-DD HH:mm")
+ : "鏈缃�",
+ assignee: task.assigneeName || "鏈垎閰�",
+ };
+ });
})
- },
-
- // 鍔犺浇鏇村鏁版嵁
- loadMore() {
- if (!this.hasMore || this.loading) return
-
- this.loading = true
- this.currentPage++
-
- const queryParams = {
- pageNum: this.currentPage,
- pageSize: this.pageSize,
- orderByColumn: 'create_time',
- isAsc: 'desc'
- }
-
- listTask(queryParams).then(response => {
- this.loading = false
- const data = response.data || response.rows || []
- // 鏇存柊鏄惁鏈夋洿澶氭暟鎹�
- this.hasMore = data.length === this.pageSize
-
- const newTasks = data.map(task => {
- // 浠巃ssignedVehicles鏁扮粍涓幏鍙栬溅杈嗕俊鎭�
- let vehicleInfo = '鏈垎閰嶈溅杈�'
- if (task.assignedVehicles && task.assignedVehicles.length > 0) {
- // 濡傛灉鏈夊涓溅杈�,鏄剧ず绗竴涓�,骞舵爣娉ㄦ暟閲�
- const firstVehicle = task.assignedVehicles[0]
- vehicleInfo = firstVehicle.vehicleNo || '鏈煡杞︾墝'
- if (task.assignedVehicles.length > 1) {
- vehicleInfo += ` 绛�${task.assignedVehicles.length}杈哷
- }
- }
-
- return {
- ...task,
- // 鏍煎紡鍖栨樉绀哄瓧娈� - 浣跨敤鍚庣杩斿洖鐨刟ssignedVehicles鏁版嵁
- vehicle: vehicleInfo,
- vehicleList: task.assignedVehicles || [],
- startLocation: this.formatAddress(task.departureAddress || task.startLocation || '鏈缃�'),
- endLocation: this.formatAddress(task.destinationAddress || task.endLocation || '鏈缃�'),
- startTime: task.plannedStartTime ? formatDateTime(task.plannedStartTime, 'YYYY-MM-DD HH:mm') : '鏈缃�',
- assignee: task.assigneeName || '鏈垎閰�'
- }
- })
-
- // 灏嗘柊鏁版嵁杩藉姞鍒扮幇鏈夊垪琛ㄤ腑
- this.taskList = [...this.taskList, ...newTasks]
- }).catch(error => {
- this.loading = false
- this.currentPage-- // 鍑洪敊鏃跺洖閫�椤电爜
- console.error('鍔犺浇鏇村浠诲姟澶辫触:', error)
- this.$modal.showToast('鍔犺浇鏇村浠诲姟澶辫触')
- })
- },
-
- // 鏍煎紡鍖栧湴鍧� - 鍙樉绀�-鍓嶉潰鐨勯儴鍒�
- formatAddress(address) {
- if (!address) return '鏈缃�'
- // 濡傛灉鍦板潃鍖呭惈-锛屽彧杩斿洖-鍓嶉潰鐨勯儴鍒�
- const dashIndex = address.indexOf('-')
- if (dashIndex > 0) {
- return address.substring(0, dashIndex)
- }
- return address
- },
-
- // 鍒囨崲鏌ヨ鐣岄潰鏄剧ず/闅愯棌
- toggleSearch() {
- this.showSearch = !this.showSearch;
- },
-
- // 鐘舵�侀�夋嫨
- onStatusChange(e) {
- this.selectedStatus = this.statusValues[e.detail.value];
- this.selectedStatusText = this.statusOptions[e.detail.value];
- },
-
- // 鏌ヨ
- handleSearch() {
- this.loadTaskList()
- this.$modal.showToast('鏌ヨ鎴愬姛');
- // 鏌ヨ瀹屾垚鍚庨殣钘忔煡璇㈢晫闈�
- this.showSearch = false;
- },
-
- // 閲嶇疆鏌ヨ鏉′欢
- resetSearch() {
- this.selectedStatus = '';
- this.selectedStatusText = '';
- this.startDate = '';
- this.endDate = '';
- this.searchForm.vehicle = '';
- this.searchForm.taskNo = '';
- },
-
- // 鍒锋柊鍒楄〃
- refreshList() {
- this.refreshing = true
- this.loadTaskList()
- setTimeout(() => {
- this.refreshing = false
- // this.$modal.showToast('鍒楄〃宸插埛鏂�');
- // 鍋滄涓嬫媺鍒锋柊
- uni.stopPullDownRefresh()
- }, 1000)
- },
-
- // 绛涢��
- changeFilter(filter) {
- this.currentFilter = filter;
- },
-
- // 鏌ョ湅浠诲姟璇︽儏
- viewTaskDetail(task) {
- // 闃插尽鎬ф鏌�
- if (!task || !task.taskId) {
- console.error('浠诲姟鏁版嵁鏃犳晥:', task)
- this.$modal.showToast('浠诲姟鏁版嵁寮傚父')
- return
- }
-
- // 璺宠浆鍒颁换鍔¤鎯呴〉闈� - 浣跨敤uni.navigateTo
- uni.navigateTo({
- url: `/pagesTask/detail?id=${task.taskId}`
+ .catch((error) => {
+ this.loading = false;
+ console.error("鍔犺浇浠诲姟鍒楄〃澶辫触:", error);
+ this.$modal.showToast("鍔犺浇浠诲姟鍒楄〃澶辫触");
});
- },
-
- // 澶勭悊浠诲姟鎿嶄綔
- async handleTaskAction(task, action) {
- switch (action) {
- case 'depart':
- // 鍑哄彂 -> 鐘舵�佸彉涓哄嚭鍙戜腑
- // 鏄剧ず鍔犺浇鎻愮ず
- uni.showLoading({
- title: '妫�鏌ヤ换鍔$姸鎬�...'
- });
-
- try {
- // 璋冪敤宸ュ叿绫绘鏌ヤ换鍔℃槸鍚﹀彲浠ュ嚭鍙戯紙鍖呭惈鍩烘湰鏍¢獙鍜屽啿绐佹鏌ワ級
- const checkResult = await checkTaskCanDepart(task)
-
- uni.hideLoading();
-
- console.log('鍑哄彂妫�鏌ョ粨鏋�:', checkResult);
- console.log('valid:', checkResult.valid);
- console.log('conflicts:', checkResult.conflicts);
-
- if (!checkResult.valid) {
- // 鏍¢獙澶辫触锛屾樉绀烘彁绀轰俊鎭苟鎻愪緵璺宠浆閫夐」
- const conflicts = checkResult.conflicts || [];
- const conflictInfo = conflicts.length > 0 ? conflicts[0] : null;
-
- console.log('鍐茬獊淇℃伅:', conflictInfo);
-
- // 濡傛灉鏈夊啿绐佷换鍔′俊鎭紝鎻愪緵璺宠浆鎸夐挳
- if (conflictInfo && conflictInfo.taskId) {
- console.log('鏄剧ず甯﹁烦杞寜閽殑寮圭獥锛屼换鍔D:', conflictInfo.taskId);
-
- const conflictTaskId = conflictInfo.taskId;
- const message = checkResult.message || conflictInfo.message || '瀛樺湪鍐茬獊浠诲姟';
-
- uni.showModal({
- title: '鎻愮ず',
- content: message,
- confirmText: '鍘诲鐞�',
- cancelText: '鐭ラ亾浜�',
- success: function(res) {
- console.log('寮圭獥鐐瑰嚮缁撴灉:', res);
- if (res.confirm) {
- // 鐢ㄦ埛鐐瑰嚮"鐜板湪鍘诲鐞�"锛岃烦杞埌鍐茬獊浠诲姟璇︽儏椤�
- console.log('鍑嗗璺宠浆鍒颁换鍔¤鎯呴〉:', conflictTaskId);
- uni.navigateTo({
- url: `/pagesTask/detail?id=${conflictTaskId}`
- });
- }
- },
- fail: function(err) {
- console.error('鏄剧ず寮圭獥澶辫触:', err);
- }
- });
- } else {
- // 娌℃湁鍐茬獊浠诲姟ID锛屽彧鏄剧ず鎻愮ず
- console.log('鏄剧ず鏅�氭彁绀哄脊绐�');
- uni.showModal({
- title: '鎻愮ず',
- content: checkResult.message || '浠诲姟鏍¢獙澶辫触',
- showCancel: false,
- confirmText: '鐭ラ亾浜�',
- fail: function(err) {
- console.error('鏄剧ず寮圭獥澶辫触:', err);
- }
- });
- }
- return;
- }
-
- // 鎵�鏈夋鏌ラ�氳繃锛屽彲浠ュ嚭鍙�
- this.$modal.confirm('纭畾瑕佸嚭鍙戝悧锛�').then(() => {
- this.updateTaskStatus(task.taskId, 'DEPARTING', '浠诲姟宸插嚭鍙�')
- }).catch(() => {});
-
- } catch (error) {
- uni.hideLoading();
- console.error('妫�鏌ヤ换鍔$姸鎬佸け璐�:', error);
- // 妫�鏌ュけ璐ユ椂锛屼粛鐒跺厑璁稿嚭鍙�
- this.$modal.confirm('妫�鏌ヤ换鍔$姸鎬佸け璐ワ紝鏄惁缁х画鍑哄彂锛�').then(() => {
- this.updateTaskStatus(task.taskId, 'DEPARTING', '浠诲姟宸插嚭鍙�')
- }).catch(() => {});
+ },
+
+ // 鍔犺浇鏇村鏁版嵁
+ loadMore() {
+ if (!this.hasMore || this.loading) return;
+
+ this.loading = true;
+ this.currentPage++;
+
+ const queryParams = {
+ pageNum: this.currentPage,
+ pageSize: this.pageSize,
+ orderByColumn: "create_time",
+ isAsc: "desc",
+ };
+
+ // 鏍规嵁绛涢�夋潯浠舵坊鍔犵姸鎬佸弬鏁帮紙浼樺厛浣跨敤椤堕儴tab绛涢�夋潯浠讹級
+ if (this.currentFilter === "pending") {
+ queryParams.taskStatus = "PENDING";
+ } else if (this.currentFilter === "processing") {
+ queryParams.taskStatusList = [
+ "DEPARTING",
+ "ARRIVED",
+ "RETURNING",
+ "IN_PROGRESS",
+ ].join(",");
+ } else if (this.currentFilter === "completed") {
+ queryParams.taskStatus = "COMPLETED";
+ } else {
+ // 濡傛灉娌℃湁浣跨敤椤堕儴tab绛涢�夛紝鍒欎娇鐢ㄦ煡璇㈡潯浠朵腑鐨勭姸鎬佺瓫閫�
+ if (this.selectedStatus) {
+ const statusMap = {
+ pending: "PENDING",
+ processing: [
+ "DEPARTING",
+ "ARRIVED",
+ "RETURNING",
+ "IN_PROGRESS",
+ ].join(","),
+ completed: "COMPLETED",
+ };
+ if (statusMap[this.selectedStatus]) {
+ if (
+ this.selectedStatus === "pending" ||
+ this.selectedStatus === "completed"
+ ) {
+ queryParams.taskStatus = statusMap[this.selectedStatus];
+ } else {
+ queryParams.taskStatusList = statusMap[this.selectedStatus];
}
- break;
-
- case 'cancel':
- // 鍙栨秷 -> 浜屾纭鍚庣姸鎬佸彉涓哄凡鍙栨秷
- this.$modal.confirm('纭畾瑕佸彇娑堟浠诲姟鍚楋紵').then(() => {
- this.updateTaskStatus(task.taskId, 'CANCELLED', '浠诲姟宸插彇娑�')
- }).catch(() => {});
- break;
-
- case 'arrive':
- // 宸插埌杈� -> 鐘舵�佸彉涓哄凡鍒拌揪
- this.$modal.confirm('纭宸插埌杈剧洰鐨勫湴锛�').then(() => {
- this.updateTaskStatus(task.taskId, 'ARRIVED', '宸插埌杈剧洰鐨勫湴')
- }).catch(() => {});
- break;
-
- case 'forceCancel':
- // 寮哄埗缁撴潫 -> 鐘舵�佸彉涓哄凡鍙栨秷
- this.$modal.confirm('纭畾瑕佸己鍒剁粨鏉熸浠诲姟鍚楋紵').then(() => {
- this.updateTaskStatus(task.taskId, 'CANCELLED', '浠诲姟宸插己鍒剁粨鏉�')
- }).catch(() => {});
- break;
-
- case 'return':
- // 宸茶繑绋� -> 鐘舵�佸彉涓鸿繑绋嬩腑
- this.$modal.confirm('纭寮�濮嬭繑绋嬶紵').then(() => {
- this.updateTaskStatus(task.taskId, 'RETURNING', '宸插紑濮嬭繑绋�')
- }).catch(() => {});
- break;
-
- case 'complete':
- // 宸插畬鎴� -> 鐘舵�佸彉涓哄凡瀹屾垚
- this.$modal.confirm('纭浠诲姟宸插畬鎴愶紵').then(() => {
- this.updateTaskStatus(task.taskId, 'COMPLETED', '浠诲姟宸插畬鎴�')
- }).catch(() => {});
- break;
+ }
}
- },
-
- // 鏇存柊浠诲姟鐘舵��
- updateTaskStatus(taskId, status, remark) {
- // 鑾峰彇GPS浣嶇疆淇℃伅
- this.getLocationAndUpdateStatus(taskId, status, remark)
- },
-
- // 鑾峰彇浣嶇疆淇℃伅骞舵洿鏂扮姸鎬�
- getLocationAndUpdateStatus(taskId, status, remark) {
- const that = this
-
- // 浣跨敤uni.getLocation鑾峰彇GPS浣嶇疆
- uni.getLocation({
- type: 'gcj02',
- geocode: true,
- altitude: true,
- success: function(res) {
- console.log('GPS瀹氫綅鎴愬姛:', res)
-
- const statusData = {
- taskStatus: status,
- remark: remark,
- latitude: res.latitude,
- longitude: res.longitude,
- locationAddress: res.address ? res.address.street || res.address.poiName || '' : '',
- locationProvince: res.address ? res.address.province || '' : '',
- locationCity: res.address ? res.address.city || '' : '',
- locationDistrict: res.address ? res.address.district || '' : '',
- gpsAccuracy: res.accuracy,
- altitude: res.altitude,
- speed: res.speed,
- heading: res.direction || res.heading
+ }
+
+ if (this.searchForm.vehicle) {
+ queryParams.vehicleNo = this.searchForm.vehicle;
+ }
+
+ if (this.searchForm.taskNo) {
+ queryParams.showTaskCode = this.searchForm.taskNo;
+ }
+
+ if (this.startDate) {
+ queryParams.startDate = this.startDate;
+ }
+
+ if (this.endDate) {
+ queryParams.endDate = this.endDate;
+ }
+
+ listTask(queryParams)
+ .then((response) => {
+ this.loading = false;
+ const data = response.data || response.rows || [];
+ // 鏇存柊鏄惁鏈夋洿澶氭暟鎹�
+ this.hasMore = data.length === this.pageSize;
+
+ const newTasks = data.map((task) => {
+ // 浠巃ssignedVehicles鏁扮粍涓幏鍙栬溅杈嗕俊鎭�
+ let vehicleInfo = "鏈垎閰嶈溅杈�";
+ if (task.assignedVehicles && task.assignedVehicles.length > 0) {
+ // 濡傛灉鏈夊涓溅杈�,鏄剧ず绗竴涓�,骞舵爣娉ㄦ暟閲�
+ const firstVehicle = task.assignedVehicles[0];
+ vehicleInfo = firstVehicle.vehicleNo || "鏈煡杞︾墝";
+ if (task.assignedVehicles.length > 1) {
+ vehicleInfo += ` 绛�${task.assignedVehicles.length}杈哷;
+ }
}
-
- changeTaskStatus(taskId, statusData).then(response => {
- that.$modal.showToast('鐘舵�佹洿鏂版垚鍔�')
- // 鍒锋柊浠诲姟鍒楄〃
- that.loadTaskList()
- }).catch(error => {
- console.error('鏇存柊浠诲姟鐘舵�佸け璐�:', error)
- that.$modal.showToast('鐘舵�佹洿鏂板け璐ワ紝璇烽噸璇�')
+
+ return {
+ ...task,
+ // 鏍煎紡鍖栨樉绀哄瓧娈� - 浣跨敤鍚庣杩斿洖鐨刟ssignedVehicles鏁版嵁
+ vehicle: vehicleInfo,
+ vehicleList: task.assignedVehicles || [],
+ startLocation: this.formatAddress(
+ task.departureAddress || task.startLocation || "鏈缃�"
+ ),
+ endLocation: this.formatAddress(
+ task.destinationAddress || task.endLocation || "鏈缃�"
+ ),
+ startTime: task.plannedStartTime
+ ? formatDateTime(task.plannedStartTime, "YYYY-MM-DD HH:mm")
+ : "鏈缃�",
+ assignee: task.assigneeName || "鏈垎閰�",
+ };
+ });
+
+ // 灏嗘柊鏁版嵁杩藉姞鍒扮幇鏈夊垪琛ㄤ腑
+ this.taskList = [...this.taskList, ...newTasks];
+ })
+ .catch((error) => {
+ this.loading = false;
+ this.currentPage--; // 鍑洪敊鏃跺洖閫�椤电爜
+ console.error("鍔犺浇鏇村浠诲姟澶辫触:", error);
+ this.$modal.showToast("鍔犺浇鏇村浠诲姟澶辫触");
+ });
+ },
+
+ // 鏍煎紡鍖栧湴鍧� - 鍙樉绀�-鍓嶉潰鐨勯儴鍒�
+ formatAddress(address) {
+ if (!address) return "鏈缃�";
+ // 濡傛灉鍦板潃鍖呭惈-锛屽彧杩斿洖-鍓嶉潰鐨勯儴鍒�
+ const dashIndex = address.indexOf("-");
+ if (dashIndex > 0) {
+ return address.substring(0, dashIndex);
+ }
+ return address;
+ },
+
+ // 鑾峰彇鍑哄彂鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞嚭鍖婚櫌鍚嶇О锛�
+ getStartLocationDisplay(task) {
+ // 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+ if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo && task.emergencyInfo.hospitalOutName) {
+ return task.emergencyInfo.hospitalOutName;
+ }
+ // 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨剆tartLocation
+ return this.formatAddress(task.startLocation || "鏈缃�");
+ },
+
+ // 鑾峰彇鐩殑鍦版樉绀哄唴瀹癸紙杞繍浠诲姟鏄剧ず杞叆鍖婚櫌鍚嶇О鎴栬缁嗗湴鍧�锛�
+ getEndLocationDisplay(task) {
+ // 濡傛灉鏄浆杩愪换鍔′笖鏈塭mergencyInfo淇℃伅
+ if (task.taskType === 'EMERGENCY_TRANSFER' && task.emergencyInfo) {
+ // 浼樺厛鏄剧ず杞叆鍖婚櫌鍚嶇О
+ if (task.emergencyInfo.hospitalInName) {
+ if(task.emergencyInfo.hospitalInName.includes("瀹朵腑")){
+ return task.emergencyInfo.destinationAddress;
+ }
+ return task.emergencyInfo.hospitalInName;
+ }
+ }
+ // 鍏朵粬鎯呭喌浣跨敤鍘熸潵鐨別ndLocation
+ return this.formatAddress(task.endLocation || "鏈缃�");
+ },
+
+ // 鍒囨崲鏌ヨ鐣岄潰鏄剧ず/闅愯棌
+ toggleSearch() {
+ this.showSearch = !this.showSearch;
+ },
+
+ // 鐘舵�侀�夋嫨
+ onStatusChange(e) {
+ this.selectedStatus = this.statusValues[e.detail.value];
+ this.selectedStatusText = this.statusOptions[e.detail.value];
+ },
+
+ // 鏌ヨ
+ handleSearch() {
+ this.loadTaskList();
+ this.$modal.showToast("鏌ヨ鎴愬姛");
+ // 鏌ヨ瀹屾垚鍚庨殣钘忔煡璇㈢晫闈�
+ this.showSearch = false;
+ },
+
+ // 閲嶇疆鏌ヨ鏉′欢
+ resetSearch() {
+ this.selectedStatus = "";
+ this.selectedStatusText = "";
+ this.startDate = "";
+ this.endDate = "";
+ this.searchForm.vehicle = "";
+ this.searchForm.taskNo = "";
+ },
+
+ // 鍒锋柊鍒楄〃
+ refreshList() {
+ this.refreshing = true;
+ this.loadTaskList();
+ setTimeout(() => {
+ this.refreshing = false;
+ // this.$modal.showToast('鍒楄〃宸插埛鏂�');
+ // 鍋滄涓嬫媺鍒锋柊
+ uni.stopPullDownRefresh();
+ }, 1000);
+ },
+
+ // 绛涢��
+ changeFilter(filter) {
+ this.currentFilter = filter;
+ // 閲嶆柊鍔犺浇鏁版嵁
+ this.loadTaskList();
+ },
+
+ // 鏌ョ湅浠诲姟璇︽儏
+ viewTaskDetail(task) {
+ // 闃插尽鎬ф鏌�
+ if (!task || !task.taskId) {
+ console.error("浠诲姟鏁版嵁鏃犳晥:", task);
+ this.$modal.showToast("浠诲姟鏁版嵁寮傚父");
+ return;
+ }
+
+ // 璺宠浆鍒颁换鍔¤鎯呴〉闈� - 浣跨敤uni.navigateTo
+ uni.navigateTo({
+ url: `/pagesTask/detail?id=${task.taskId}`,
+ });
+ },
+
+ // 澶勭悊浠诲姟鎿嶄綔
+ async handleTaskAction(task, action) {
+ switch (action) {
+ case "depart":
+ // 鍑哄彂 -> 鐘舵�佸彉涓哄嚭鍙戜腑
+ // 鏄剧ず鍔犺浇鎻愮ず
+ uni.showLoading({
+ title: "妫�鏌ヤ换鍔$姸鎬�...",
+ });
+
+ try {
+ // 璋冪敤宸ュ叿绫绘鏌ヤ换鍔℃槸鍚﹀彲浠ュ嚭鍙戯紙鍖呭惈鍩烘湰鏍¢獙鍜屽啿绐佹鏌ワ級
+ const checkResult = await checkTaskCanDepart(task);
+
+ uni.hideLoading();
+
+ console.log("鍑哄彂妫�鏌ョ粨鏋�:", checkResult);
+ console.log("valid:", checkResult.valid);
+ console.log("conflicts:", checkResult.conflicts);
+
+ if (!checkResult.valid) {
+ // 鏍¢獙澶辫触锛屾樉绀烘彁绀轰俊鎭苟鎻愪緵璺宠浆閫夐」
+ const conflicts = checkResult.conflicts || [];
+ const conflictInfo = conflicts.length > 0 ? conflicts[0] : null;
+
+ console.log("鍐茬獊淇℃伅:", conflictInfo);
+
+ // 濡傛灉鏈夊啿绐佷换鍔′俊鎭紝鎻愪緵璺宠浆鎸夐挳
+ if (conflictInfo && conflictInfo.taskId) {
+ console.log(
+ "鏄剧ず甯﹁烦杞寜閽殑寮圭獥锛屼换鍔D:",
+ conflictInfo.taskId
+ );
+
+ const conflictTaskId = conflictInfo.taskId;
+ const message =
+ checkResult.message || conflictInfo.message || "瀛樺湪鍐茬獊浠诲姟";
+
+ uni.showModal({
+ title: "鎻愮ず",
+ content: message,
+ confirmText: "鍘诲鐞�",
+ cancelText: "鐭ラ亾浜�",
+ success: function (res) {
+ console.log("寮圭獥鐐瑰嚮缁撴灉:", res);
+ if (res.confirm) {
+ // 鐢ㄦ埛鐐瑰嚮"鐜板湪鍘诲鐞�"锛岃烦杞埌鍐茬獊浠诲姟璇︽儏椤�
+ console.log("鍑嗗璺宠浆鍒颁换鍔¤鎯呴〉:", conflictTaskId);
+ uni.navigateTo({
+ url: `/pagesTask/detail?id=${conflictTaskId}`,
+ });
+ }
+ },
+ fail: function (err) {
+ console.error("鏄剧ず寮圭獥澶辫触:", err);
+ },
+ });
+ } else {
+ // 娌℃湁鍐茬獊浠诲姟ID锛屽彧鏄剧ず鎻愮ず
+ console.log("鏄剧ず鏅�氭彁绀哄脊绐�");
+ uni.showModal({
+ title: "鎻愮ず",
+ content: checkResult.message || "浠诲姟鏍¢獙澶辫触",
+ showCancel: false,
+ confirmText: "鐭ラ亾浜�",
+ fail: function (err) {
+ console.error("鏄剧ず寮圭獥澶辫触:", err);
+ },
+ });
+ }
+ return;
+ }
+
+ // 鎵�鏈夋鏌ラ�氳繃锛屽彲浠ュ嚭鍙�
+ this.$modal
+ .confirm("纭畾瑕佸嚭鍙戝悧锛�")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "DEPARTING", "浠诲姟宸插嚭鍙�");
+ })
+ .catch(() => {});
+ } catch (error) {
+ uni.hideLoading();
+ console.error("妫�鏌ヤ换鍔$姸鎬佸け璐�:", error);
+ // 妫�鏌ュけ璐ユ椂锛屼粛鐒跺厑璁稿嚭鍙�
+ this.$modal
+ .confirm("妫�鏌ヤ换鍔$姸鎬佸け璐ワ紝鏄惁缁х画鍑哄彂锛�")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "DEPARTING", "浠诲姟宸插嚭鍙�");
+ })
+ .catch(() => {});
+ }
+ break;
+
+ case "cancel":
+ // 鍙栨秷 -> 浜屾纭鍚庣姸鎬佸彉涓哄凡鍙栨秷
+ this.$modal
+ .confirm("纭畾瑕佸彇娑堟浠诲姟鍚楋紵")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "CANCELLED", "浠诲姟宸插彇娑�");
})
- },
- fail: function(err) {
- console.error('GPS瀹氫綅澶辫触:', err)
-
- that.$modal.confirm('GPS瀹氫綅澶辫触锛屾槸鍚︾户缁洿鏂扮姸鎬侊紵').then(() => {
+ .catch(() => {});
+ break;
+
+ case "arrive":
+ // 宸插埌杈� -> 鐘舵�佸彉涓哄凡鍒拌揪
+ this.$modal
+ .confirm("纭宸插埌杈剧洰鐨勫湴锛�")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "ARRIVED", "宸插埌杈剧洰鐨勫湴");
+ })
+ .catch(() => {});
+ break;
+
+ case "forceCancel":
+ // 寮哄埗缁撴潫 -> 鐘舵�佸彉涓哄凡鍙栨秷
+ this.$modal
+ .confirm("纭畾瑕佸己鍒剁粨鏉熸浠诲姟鍚楋紵")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "CANCELLED", "浠诲姟宸插己鍒剁粨鏉�");
+ })
+ .catch(() => {});
+ break;
+
+ case "return":
+ // 宸茶繑绋� -> 鐘舵�佸彉涓鸿繑绋嬩腑
+ this.$modal
+ .confirm("纭寮�濮嬭繑绋嬶紵")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "RETURNING", "宸插紑濮嬭繑绋�");
+ })
+ .catch(() => {});
+ break;
+
+ case "complete":
+ // 宸插畬鎴� -> 鐘舵�佸彉涓哄凡瀹屾垚
+ this.$modal
+ .confirm("纭浠诲姟宸插畬鎴愶紵")
+ .then(() => {
+ this.updateTaskStatus(task.taskId, "COMPLETED", "浠诲姟宸插畬鎴�");
+ })
+ .catch(() => {});
+ break;
+ }
+ },
+
+ // 鏇存柊浠诲姟鐘舵��
+ updateTaskStatus(taskId, status, remark) {
+ // 鑾峰彇GPS浣嶇疆淇℃伅
+ this.getLocationAndUpdateStatus(taskId, status, remark);
+ },
+
+ // 鑾峰彇浣嶇疆淇℃伅骞舵洿鏂扮姸鎬�
+ getLocationAndUpdateStatus(taskId, status, remark) {
+ const that = this;
+
+ // 浣跨敤uni.getLocation鑾峰彇GPS浣嶇疆
+ uni.getLocation({
+ type: "gcj02",
+ geocode: true,
+ altitude: true,
+ success: function (res) {
+ console.log("GPS瀹氫綅鎴愬姛:", res);
+
+ const statusData = {
+ taskStatus: status,
+ remark: remark,
+ latitude: res.latitude,
+ longitude: res.longitude,
+ locationAddress: res.address
+ ? res.address.street || res.address.poiName || ""
+ : "",
+ locationProvince: res.address ? res.address.province || "" : "",
+ locationCity: res.address ? res.address.city || "" : "",
+ locationDistrict: res.address ? res.address.district || "" : "",
+ gpsAccuracy: res.accuracy,
+ altitude: res.altitude,
+ speed: res.speed,
+ heading: res.direction || res.heading,
+ };
+
+ changeTaskStatus(taskId, statusData)
+ .then((response) => {
+ that.$modal.showToast("鐘舵�佹洿鏂版垚鍔�");
+ // 鍒锋柊浠诲姟鍒楄〃
+ that.loadTaskList();
+ })
+ .catch((error) => {
+ console.error("鏇存柊浠诲姟鐘舵�佸け璐�:", error);
+ that.$modal.showToast("鐘舵�佹洿鏂板け璐ワ紝璇烽噸璇�");
+ });
+ },
+ fail: function (err) {
+ console.error("GPS瀹氫綅澶辫触:", err);
+
+ that.$modal
+ .confirm("GPS瀹氫綅澶辫触锛屾槸鍚︾户缁洿鏂扮姸鎬侊紵")
+ .then(() => {
const statusData = {
taskStatus: status,
- remark: remark
- }
-
- changeTaskStatus(taskId, statusData).then(response => {
- that.$modal.showToast('鐘舵�佹洿鏂版垚鍔�')
- // 鍒锋柊浠诲姟鍒楄〃
- that.loadTaskList()
- }).catch(error => {
- console.error('鏇存柊浠诲姟鐘舵�佸け璐�:', error)
- that.$modal.showToast('鐘舵�佹洿鏂板け璐ワ紝璇烽噸璇�')
- })
- }).catch(() => {})
- }
- })
- },
-
- getStatusText(status) {
- const statusMap = {
- 'PENDING': '寰呭鐞�',
- 'DEPARTING': '鍑哄彂涓�',
- 'ARRIVED': '宸插埌杈�',
- 'RETURNING': '杩旂▼涓�',
- 'COMPLETED': '宸插畬鎴�',
- 'CANCELLED': '宸插彇娑�',
- 'IN_PROGRESS': '澶勭悊涓�' // 鍏煎鏃ф暟鎹�
- }
- return statusMap[status] || '鏈煡'
- },
-
- // 鑾峰彇鐘舵�佹牱寮忕被
- getStatusClass(status) {
- const statusClassMap = {
- 'PENDING': 'status-pending',
- 'DEPARTING': 'status-departing',
- 'ARRIVED': 'status-arrived',
- 'RETURNING': 'status-returning',
- 'COMPLETED': 'status-completed',
- 'CANCELLED': 'status-cancelled',
- 'IN_PROGRESS': 'status-in-progress'
- }
- return statusClassMap[status] || 'status-default'
- },
-
- getTaskTypeText(type) {
- const typeMap = {
- 'MAINTENANCE': '缁翠慨淇濆吇',
- 'FUEL': '鍔犳补',
- 'OTHER': '鍏朵粬',
- 'EMERGENCY_TRANSFER': '杞繍浠诲姟',
- 'WELFARE': '绂忕杞�'
- }
- return typeMap[type] || '鏈煡绫诲瀷'
- }
- }
- }
+ remark: remark,
+ };
+
+ changeTaskStatus(taskId, statusData)
+ .then((response) => {
+ that.$modal.showToast("鐘舵�佹洿鏂版垚鍔�");
+ // 鍒锋柊浠诲姟鍒楄〃
+ that.loadTaskList();
+ })
+ .catch((error) => {
+ console.error("鏇存柊浠诲姟鐘舵�佸け璐�:", error);
+ that.$modal.showToast("鐘舵�佹洿鏂板け璐ワ紝璇烽噸璇�");
+ });
+ })
+ .catch(() => {});
+ },
+ });
+ },
+
+ getStatusText(status) {
+ const statusMap = {
+ PENDING: "寰呭鐞�",
+ DEPARTING: "鍑哄彂涓�",
+ ARRIVED: "宸插埌杈�",
+ RETURNING: "杩旂▼涓�",
+ COMPLETED: "宸插畬鎴�",
+ CANCELLED: "宸插彇娑�",
+ IN_PROGRESS: "澶勭悊涓�", // 鍏煎鏃ф暟鎹�
+ };
+ return statusMap[status] || "鏈煡";
+ },
+
+ // 鑾峰彇鐘舵�佹牱寮忕被
+ getStatusClass(status) {
+ const statusClassMap = {
+ PENDING: "status-pending",
+ DEPARTING: "status-departing",
+ ARRIVED: "status-arrived",
+ RETURNING: "status-returning",
+ COMPLETED: "status-completed",
+ CANCELLED: "status-cancelled",
+ IN_PROGRESS: "status-in-progress",
+ };
+ return statusClassMap[status] || "status-default";
+ },
+
+ getTaskTypeText(type) {
+ const typeMap = {
+ MAINTENANCE: "缁翠慨淇濆吇",
+ FUEL: "鍔犳补",
+ OTHER: "鍏朵粬",
+ EMERGENCY_TRANSFER: "杞繍浠诲姟",
+ WELFARE: "绂忕杞�",
+ };
+ return typeMap[type] || "鏈煡绫诲瀷";
+ },
+ },
+};
</script>
<style lang="scss">
- .task-container {
- padding: 20rpx;
- background-color: #f5f5f5;
- height: 100vh;
- display: flex;
- flex-direction: column;
- // 闅愯棌婊氬姩鏉′絾淇濇寔婊氬姩鍔熻兘
- ::-webkit-scrollbar {
- display: none;
- width: 0 !important;
- height: 0 !important;
- background: transparent;
- }
-
- // Firefox婊氬姩鏉¢殣钘�
- * {
- scrollbar-width: none; /* Firefox */
- }
-
- // IE/Edge婊氬姩鏉¢殣钘�
- * {
- -ms-overflow-style: none; /* IE 10+ */
- }
+.task-container {
+ padding: 20rpx;
+ background-color: #f5f5f5;
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ // 闅愯棌婊氬姩鏉′絾淇濇寔婊氬姩鍔熻兘
+ ::-webkit-scrollbar {
+ display: none;
+ width: 0 !important;
+ height: 0 !important;
+ background: transparent;
}
-
- // 鎬婚儴鎺ㄩ�佹爣璁版牱寮�
- .head-push-tag {
- color: #ff0000;
- font-size: 24rpx;
+
+ // Firefox婊氬姩鏉¢殣钘�
+ * {
+ scrollbar-width: none; /* Firefox */
+ }
+
+ // IE/Edge婊氬姩鏉¢殣钘�
+ * {
+ -ms-overflow-style: none; /* IE 10+ */
+ }
+}
+
+// 浠诲姟鍒楄〃鍖哄煙
+.task-list-section {
+ flex: 1;
+ background-color: white;
+ border-radius: 15rpx;
+ padding: 30rpx;
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+ display: flex;
+ flex-direction: column;
+}
+
+.task-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 20rpx 0;
+ flex-shrink: 0; // 闃叉鏀剁缉
+
+ .header-title {
+ font-size: 36rpx;
font-weight: bold;
- margin-left: 10rpx;
- padding: 2rpx 8rpx;
- border: 1rpx solid #ff0000;
- border-radius: 4rpx;
}
-
- // 浠诲姟鍒楄〃鍖哄煙
- .task-list-section {
- flex: 1;
- background-color: white;
- border-radius: 15rpx;
- padding: 30rpx;
- box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+
+ .header-actions {
display: flex;
- flex-direction: column;
- }
-
- .task-header {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 20rpx 0;
- flex-shrink: 0; // 闃叉鏀剁缉
-
- .header-title {
- font-size: 36rpx;
- font-weight: bold;
- }
-
- .header-actions {
+
+ .search-toggle-btn,
+ .refresh-btn {
+ width: 60rpx;
+ height: 60rpx;
+ border-radius: 50%;
+ background-color: #f0f0f0;
display: flex;
-
- .search-toggle-btn, .refresh-btn {
- width: 60rpx;
- height: 60rpx;
- border-radius: 50%;
- background-color: #f0f0f0;
+ align-items: center;
+ justify-content: center;
+ margin-left: 20rpx;
+ }
+ }
+}
+
+// 鏌ヨ鏉′欢鍖哄煙
+.search-section {
+ background-color: #f9f9f9;
+ border-radius: 15rpx;
+ padding: 30rpx;
+ margin: 20rpx 0;
+ box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
+ flex-shrink: 0; // 闃叉鏀剁缉
+
+ .form-item {
+ margin-bottom: 30rpx;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .form-label {
+ font-size: 28rpx;
+ margin-bottom: 15rpx;
+ color: #333;
+ }
+
+ .form-input {
+ height: 70rpx;
+ padding: 0 20rpx;
+ border: 1rpx solid #eee;
+ border-radius: 10rpx;
+ font-size: 28rpx;
+
+ &.picker-input {
display: flex;
align-items: center;
- justify-content: center;
- margin-left: 20rpx;
+ justify-content: space-between;
}
}
- }
-
- // 鏌ヨ鏉′欢鍖哄煙
- .search-section {
- background-color: #f9f9f9;
- border-radius: 15rpx;
- padding: 30rpx;
- margin: 20rpx 0;
- box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
- flex-shrink: 0; // 闃叉鏀剁缉
-
- .form-item {
- margin-bottom: 30rpx;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- .form-label {
- font-size: 28rpx;
- margin-bottom: 15rpx;
- color: #333;
- }
-
- .form-input {
+
+ .date-range {
+ display: flex;
+ align-items: center;
+
+ .date-input {
+ flex: 1;
height: 70rpx;
padding: 0 20rpx;
border: 1rpx solid #eee;
border-radius: 10rpx;
font-size: 28rpx;
-
- &.picker-input {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- }
-
- .date-range {
display: flex;
align-items: center;
-
- .date-input {
- flex: 1;
- height: 70rpx;
- padding: 0 20rpx;
- border: 1rpx solid #eee;
- border-radius: 10rpx;
- font-size: 28rpx;
- display: flex;
- align-items: center;
- }
-
- .divider {
- margin: 0 20rpx;
- color: #999;
- }
}
- }
-
- .form-actions {
- display: flex;
- margin-top: 20rpx;
-
- .search-btn, .reset-btn {
- flex: 1;
- height: 70rpx;
- border-radius: 10rpx;
- font-size: 28rpx;
- margin: 0 10rpx;
- }
-
- .search-btn {
- background-color: #007AFF;
- color: white;
+
+ .divider {
+ margin: 0 20rpx;
+ color: #999;
}
}
}
-
- .task-filter {
- margin-bottom: 30rpx;
- flex-shrink: 0; // 闃叉鏀剁缉
-
- .filter-tabs {
- white-space: nowrap;
- padding: 10rpx 0;
- // 闅愯棌婊氬姩鏉′絾淇濇寔婊氬姩鍔熻兘
- ::-webkit-scrollbar {
- display: none;
- width: 0 !important;
- height: 0 !important;
- background: transparent;
- }
-
- // Firefox婊氬姩鏉¢殣钘�
- * {
- scrollbar-width: none; /* Firefox */
- }
-
- // IE/Edge婊氬姩鏉¢殣钘�
- * {
- -ms-overflow-style: none; /* IE 10+ */
- }
-
- .filter-item {
- display: inline-block;
- padding: 15rpx 30rpx;
- margin-right: 20rpx;
- background-color: #f5f5f5;
- border-radius: 30rpx;
- font-size: 28rpx;
-
- &.active {
- background-color: #007AFF;
- color: white;
- }
- }
+
+ .form-actions {
+ display: flex;
+ margin-top: 20rpx;
+
+ .search-btn,
+ .reset-btn {
+ flex: 1;
+ height: 70rpx;
+ border-radius: 10rpx;
+ font-size: 28rpx;
+ margin: 0 10rpx;
+ }
+
+ .search-btn {
+ background-color: #007aff;
+ color: white;
}
}
-
- .task-list-scroll {
- flex: 1;
+}
+
+.task-filter {
+ margin-bottom: 30rpx;
+ flex-shrink: 0; // 闃叉鏀剁缉
+
+ .filter-tabs {
+ white-space: nowrap;
+ padding: 10rpx 0;
// 闅愯棌婊氬姩鏉′絾淇濇寔婊氬姩鍔熻兘
::-webkit-scrollbar {
display: none;
@@ -978,205 +1103,272 @@
height: 0 !important;
background: transparent;
}
-
+
// Firefox婊氬姩鏉¢殣钘�
* {
scrollbar-width: none; /* Firefox */
}
-
+
// IE/Edge婊氬姩鏉¢殣钘�
* {
-ms-overflow-style: none; /* IE 10+ */
}
- }
-
- .task-list {
- .task-item {
- background-color: #fafafa;
- border-radius: 15rpx;
- margin-bottom: 30rpx;
- overflow: hidden;
-
- .task-main {
- padding: 30rpx;
- border-bottom: 1rpx solid #f0f0f0;
-
- // 浠诲姟澶撮儴锛氭爣棰樺拰鐘舵��
- .task-header {
- display: flex;
- justify-content: space-between;
- align-items: flex-start;
- margin-bottom: 15rpx;
-
- .task-title {
- flex: 1;
- font-size: 32rpx;
- font-weight: bold;
- padding-right: 20rpx;
- line-height: 1.4;
- }
-
- .task-status {
- padding: 8rpx 20rpx;
- border-radius: 30rpx;
- font-size: 24rpx;
- white-space: nowrap;
- flex-shrink: 0;
-
- // 寰呭鐞� - 姗欒壊
- &.status-pending {
- background-color: #fff3e0;
- color: #ff9500;
- }
-
- // 鍑哄彂涓� - 钃濊壊
- &.status-departing {
- background-color: #e3f2fd;
- color: #007AFF;
- }
-
- // 宸插埌杈� - 绱壊
- &.status-arrived {
- background-color: #f3e5f5;
- color: #9c27b0;
- }
-
- // 杩旂▼涓� - 闈掕壊
- &.status-returning {
- background-color: #e0f2f1;
- color: #009688;
- }
-
- // 宸插畬鎴� - 缁胯壊
- &.status-completed {
- background-color: #e8f5e9;
- color: #34C759;
- }
-
- // 宸插彇娑� - 鐏拌壊
- &.status-cancelled {
- background-color: #f5f5f5;
- color: #999;
- }
-
- // 澶勭悊涓� (鍏煎鏃ф暟鎹�) - 钃濊壊
- &.status-in-progress {
- background-color: #e3f2fd;
- color: #007AFF;
- }
-
- // 榛樿鏍峰紡
- &.status-default {
- background-color: #f5f5f5;
- color: #666;
- }
- }
- }
-
- // 浠诲姟缂栧彿鍗曠嫭涓�琛�
- .task-code-row {
- margin-bottom: 15rpx;
- padding: 10rpx 0;
- border-bottom: 1rpx dashed #e0e0e0;
-
- .task-code {
- font-size: 28rpx;
- color: #333;
- font-weight: 500;
- font-family: monospace;
- }
- }
-
- .task-info {
- .info-row {
- display: flex;
- margin-bottom: 15rpx;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- .info-item {
- flex: 1;
- display: flex;
-
- .label {
- font-size: 26rpx;
- color: #666;
- margin-right: 10rpx;
- white-space: nowrap;
- }
-
- .value {
- font-size: 26rpx;
- flex: 1;
- word-break: break-all;
- }
- }
- }
- }
- }
-
- .task-actions {
- display: flex;
- padding: 20rpx;
-
- .action-btn {
- flex: 1;
- height: 70rpx;
- border-radius: 10rpx;
- font-size: 26rpx;
- margin: 0 5rpx;
- background-color: #f0f0f0;
- color: #333;
-
- &.primary {
- background-color: #007AFF;
- color: white;
- }
-
- &.cancel {
- background-color: #ff3b30;
- color: white;
- }
-
- &.disabled {
- opacity: 0.5;
- }
-
- &:first-child {
- margin-left: 0;
- }
-
- &:last-child {
- margin-right: 0;
- }
- }
- }
- }
-
- .no-data {
- text-align: center;
- padding: 100rpx 0;
- color: #999;
-
- text {
- display: block;
- margin-top: 20rpx;
- }
- }
-
- .load-more {
- display: flex;
- justify-content: center;
- align-items: center;
- padding: 20rpx 0;
- color: #999;
+
+ .filter-item {
+ display: inline-block;
+ padding: 15rpx 30rpx;
+ margin-right: 20rpx;
+ background-color: #f5f5f5;
+ border-radius: 30rpx;
font-size: 28rpx;
-
- &.no-more {
- color: #666;
+
+ &.active {
+ background-color: #007aff;
+ color: white;
}
}
}
+}
+
+.task-list-scroll {
+ flex: 1;
+ // 闅愯棌婊氬姩鏉′絾淇濇寔婊氬姩鍔熻兘
+ ::-webkit-scrollbar {
+ display: none;
+ width: 0 !important;
+ height: 0 !important;
+ background: transparent;
+ }
+
+ // Firefox婊氬姩鏉¢殣钘�
+ * {
+ scrollbar-width: none; /* Firefox */
+ }
+
+ // IE/Edge婊氬姩鏉¢殣钘�
+ * {
+ -ms-overflow-style: none; /* IE 10+ */
+ }
+}
+
+.task-list {
+ .task-item {
+ background-color: #fafafa;
+ border-radius: 15rpx;
+ margin-bottom: 30rpx;
+ overflow: hidden;
+
+ .task-main {
+ padding: 30rpx;
+ border-bottom: 1rpx solid #f0f0f0;
+
+ // 浠诲姟澶撮儴锛氭爣棰樺拰鐘舵��
+ .task-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: flex-start;
+ margin-bottom: 15rpx;
+
+ .task-title {
+ flex: 1;
+ font-size: 32rpx;
+ font-weight: bold;
+ padding-right: 20rpx;
+ line-height: 1.4;
+ }
+
+ .task-status {
+ padding: 8rpx 20rpx;
+ border-radius: 30rpx;
+ font-size: 24rpx;
+ white-space: nowrap;
+ flex-shrink: 0;
+
+ // 寰呭鐞� - 姗欒壊
+ &.status-pending {
+ background-color: #fff3e0;
+ color: #ff9500;
+ }
+
+ // 鍑哄彂涓� - 钃濊壊
+ &.status-departing {
+ background-color: #e3f2fd;
+ color: #007aff;
+ }
+
+ // 宸插埌杈� - 绱壊
+ &.status-arrived {
+ background-color: #f3e5f5;
+ color: #9c27b0;
+ }
+
+ // 杩旂▼涓� - 闈掕壊
+ &.status-returning {
+ background-color: #e0f2f1;
+ color: #009688;
+ }
+
+ // 宸插畬鎴� - 缁胯壊
+ &.status-completed {
+ background-color: #e8f5e9;
+ color: #34c759;
+ }
+
+ // 宸插彇娑� - 鐏拌壊
+ &.status-cancelled {
+ background-color: #f5f5f5;
+ color: #999;
+ }
+
+ // 澶勭悊涓� (鍏煎鏃ф暟鎹�) - 钃濊壊
+ &.status-in-progress {
+ background-color: #e3f2fd;
+ color: #007aff;
+ }
+
+ // 榛樿鏍峰紡
+ &.status-default {
+ background-color: #f5f5f5;
+ color: #666;
+ }
+ }
+ }
+
+ // 浠诲姟缂栧彿鍜屾椂闂村湪鍚屼竴琛屾樉绀�
+ .task-code-row {
+ margin-bottom: 15rpx;
+ padding: 10rpx 0;
+ border-bottom: 1rpx dashed #e0e0e0;
+ display: flex;
+ justify-content: space-between;
+
+ .task-code {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 500;
+ font-family: monospace;
+ }
+
+ .task-time {
+ font-size: 28rpx;
+ color: #333;
+ font-weight: 500;
+ font-family: monospace;
+ }
+ }
+
+ .task-info {
+ .info-row {
+ display: flex;
+ margin-bottom: 15rpx;
+
+ &:last-child {
+ margin-bottom: 0;
+ }
+
+ .info-item {
+ flex: 1;
+ display: flex;
+
+ .label {
+ font-size: 26rpx;
+ color: #666;
+ margin-right: 10rpx;
+ white-space: nowrap;
+ }
+
+ .value {
+ font-size: 26rpx;
+ flex: 1;
+ word-break: break-all;
+ }
+ }
+ }
+ }
+ }
+
+ .task-actions {
+ display: flex;
+ padding: 20rpx;
+
+ .action-btn {
+ flex: 1;
+ height: 70rpx;
+ border-radius: 10rpx;
+ font-size: 26rpx;
+ margin: 0 5rpx;
+ background-color: #f0f0f0;
+ color: #333;
+
+ &.primary {
+ background-color: #007aff;
+ color: white;
+ }
+
+ &.cancel {
+ background-color: #ff3b30;
+ color: white;
+ }
+
+ &.disabled {
+ opacity: 0.5;
+ }
+
+ &:first-child {
+ margin-left: 0;
+ }
+
+ &:last-child {
+ margin-right: 0;
+ }
+ }
+ }
+ }
+
+ .no-data {
+ text-align: center;
+ padding: 100rpx 0;
+ color: #999;
+
+ text {
+ display: block;
+ margin-top: 20rpx;
+ }
+ }
+
+ .load-more {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ padding: 20rpx 0;
+ color: #999;
+ font-size: 28rpx;
+
+ &.no-more {
+ color: #666;
+ }
+ }
+
+ .vip-tag {
+ display: inline-block;
+ padding: 2rpx 8rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background-color: #ff0000;
+ border-radius: 4rpx;
+ margin-left: 10rpx;
+ vertical-align: middle;
+ }
+
+ .hq-tag {
+ display: inline-block;
+ padding: 2rpx 8rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background-color: #5856d6;
+ border-radius: 4rpx;
+ margin-left: 10rpx;
+ vertical-align: middle;
+ }
+}
</style>
\ No newline at end of file
diff --git a/app/pagesTask/components/DepartmentSelector.vue b/app/pagesTask/components/DepartmentSelector.vue
index a6c7544..98b2f1f 100644
--- a/app/pagesTask/components/DepartmentSelector.vue
+++ b/app/pagesTask/components/DepartmentSelector.vue
@@ -226,4 +226,5 @@
color: #999;
}
}
-}
\ No newline at end of file
+}
+</style>
\ No newline at end of file
diff --git a/app/pagesTask/detail.vue b/app/pagesTask/detail.vue
index 8cf97d9..771094a 100644
--- a/app/pagesTask/detail.vue
+++ b/app/pagesTask/detail.vue
@@ -14,7 +14,8 @@
<view class="label">浠诲姟缂栧彿</view>
<view class="value">
{{ taskDetail.showTaskCode }}
- <text v-if="taskDetail.isHeadPush === '1'" class="head-push-tag">鎬�</text>
+ <text v-if="taskDetail.emergencyInfo && taskDetail.emergencyInfo.serviceOrdVip === '1'" class="vip-tag">VIP</text>
+ <text v-if="taskDetail.emergencyInfo && taskDetail.emergencyInfo.fromHq2Is === '1'" class="hq-tag">骞挎��</text>
</view>
</view>
<view class="info-item">
@@ -54,21 +55,12 @@
<view class="assignee-role">
<view
class="role-tag"
- :class="{
- 'role-driver': assignee.userType === 'driver',
- 'role-doctor': assignee.userType === 'doctor',
- 'role-nurse': assignee.userType === 'nurse'
- }"
- >
+ :class="{'role-driver': assignee.userType === 'driver','role-doctor': assignee.userType === 'doctor','role-nurse': assignee.userType === 'nurse'}">
{{ getUserTypeLabel(assignee.userType) }}
</view>
<view
class="ready-badge"
- :class="{
- 'ready': isAssigneeReady(assignee),
- 'unready': !isAssigneeReady(assignee)
- }"
- >
+ :class="{'ready': isAssigneeReady(assignee),'unready': !isAssigneeReady(assignee)}">
{{ isAssigneeReady(assignee) ? '宸插氨缁�' : '鏈氨缁�' }}
</view>
</view>
@@ -105,13 +97,13 @@
<view class="section-title">浣嶇疆淇℃伅</view>
<!-- 杞繍浠诲姟锛氭樉绀鸿浆鍑�/杞叆鍖婚櫌鍦板潃 -->
<template v-if="taskDetail.taskType === 'EMERGENCY_TRANSFER' && taskDetail.emergencyInfo">
- <view class="info-item" v-if="taskDetail.emergencyInfo.hospitalOutAddress">
+ <view class="info-item" v-if="taskDetail.emergencyInfo.hospitalOutName">
<view class="label">杞嚭鍖婚櫌</view>
- <view class="value">{{ taskDetail.emergencyInfo.hospitalOutAddress }}</view>
+ <view class="value">{{ taskDetail.emergencyInfo.hospitalOutName }}</view>
</view>
- <view class="info-item" v-if="taskDetail.emergencyInfo.hospitalInAddress">
+ <view class="info-item" v-if="taskDetail.emergencyInfo.hospitalInName">
<view class="label">杞叆鍖婚櫌</view>
- <view class="value">{{ taskDetail.emergencyInfo.hospitalInAddress }}</view>
+ <view class="value">{{ taskDetail.emergencyInfo.hospitalInName }}</view>
</view>
</template>
<!-- 绂忕杞︿换鍔★細鏄剧ず鎺ラ��/鐩殑鍦板潃 -->
@@ -499,7 +491,19 @@
}
return ['COMPLETED', 'CANCELLED'].includes(this.taskDetail.taskStatus)
},
- // 鏄剧ず浠诲姟绫诲瀷
+
+ // 鐢熸垚鎵ц浜哄憳瑙掕壊鏍囩鐨勭被鍚�
+ getRoleTagClass() {
+ return (userType) => {
+ const baseClass = 'role-tag'
+ const roleClasses = {
+ 'driver': 'role-driver',
+ 'doctor': 'role-doctor',
+ 'nurse': 'role-nurse'
+ }
+ return [baseClass, roleClasses[userType] || '']
+ }
+ }, // 鏄剧ず浠诲姟绫诲瀷
displayTaskType() {
if (!this.taskDetail || !this.taskDetail.taskType) {
return '鏈缃�'
@@ -594,13 +598,7 @@
getTask(this.taskId).then(response => {
this.taskDetail = response.data || response
- // 璋冭瘯锛氭墦鍗拌繑鍥炵殑鏁版嵁
- // console.log('浠诲姟璇︽儏瀹屾暣鏁版嵁:', JSON.stringify(this.taskDetail, null, 2))
- // console.log('浠诲姟绫诲瀷瀛楁鍊�:', this.taskDetail.taskType)
- // console.log('浠诲姟鐘舵�佸瓧娈靛��:', this.taskDetail.taskStatus)
- // console.log('鍑哄彂鍦板潃:', this.taskDetail.departureAddress)
- // console.log('鐩殑鍦板潃:', this.taskDetail.destinationAddress)
- // console.log('杞繍浠诲姟淇℃伅 (emergencyInfo):', this.taskDetail.emergencyInfo)
+
// 濡傛灉鏄浆杩愪换鍔★紝鍔犺浇鏀粯淇℃伅
if (this.taskDetail.taskType === 'EMERGENCY_TRANSFER') {
@@ -1464,17 +1462,6 @@
}
}
- // 鎬婚儴鎺ㄩ�佹爣璁版牱寮�
- .head-push-tag {
- color: #ff0000;
- font-size: 24rpx;
- font-weight: bold;
- margin-left: 10rpx;
- padding: 2rpx 8rpx;
- border: 1rpx solid #ff0000;
- border-radius: 4rpx;
- }
-
.detail-content {
padding: 20rpx;
height: calc(100vh - 220rpx); // 鍑忓幓header(100rpx)鍜屾寜閽尯鍩�(120rpx)鐨勯珮搴�
@@ -1816,5 +1803,27 @@
}
}
}
+
+ .vip-tag {
+ display: inline-block;
+ padding: 2rpx 8rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background-color: #ff0000;
+ border-radius: 4rpx;
+ margin-left: 10rpx;
+ vertical-align: middle;
+ }
+
+ .hq-tag {
+ display: inline-block;
+ padding: 2rpx 8rpx;
+ font-size: 20rpx;
+ color: #fff;
+ background-color: #5856d6;
+ border-radius: 4rpx;
+ margin-left: 10rpx;
+ vertical-align: middle;
+ }
}
</style>
\ No newline at end of file
diff --git a/app/pagesTask/edit-emergency.vue b/app/pagesTask/edit-emergency.vue
index 24f3a97..7911a84 100644
--- a/app/pagesTask/edit-emergency.vue
+++ b/app/pagesTask/edit-emergency.vue
@@ -39,6 +39,26 @@
/>
<view class="form-item">
+ <view class="form-label required">浠诲姟绫诲瀷</view>
+ <picker mode="selector" :range="emergencyTaskTypeOptions" range-key="text" @change="onEmergencyTaskTypeChange">
+ <view class="form-input picker-input">
+ {{ selectedEmergencyTaskType || '璇烽�夋嫨浠诲姟绫诲瀷' }}
+ <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
+ </view>
+ </picker>
+ </view>
+
+ <view class="form-item">
+ <view class="form-label required">鍗曟嵁绫诲瀷</view>
+ <picker mode="selector" :range="documentTypeOptions" range-key="text" @change="onDocumentTypeChange">
+ <view class="form-input picker-input">
+ {{ selectedDocumentType || '璇烽�夋嫨鍗曟嵁绫诲瀷' }}
+ <uni-icons type="arrowright" size="16" color="#999"></uni-icons>
+ </view>
+ </picker>
+ </view>
+
+ <view class="form-item">
<view class="form-label required">杞繍鏃堕棿</view>
<uni-datetime-picker
v-model="taskForm.transferTime"
@@ -233,6 +253,7 @@
import { getTask, updateTask } from "@/api/task"
import { tiandituDistanceByAddress } from "@/api/map"
import { calculateTransferPrice } from "@/api/price"
+import { getServiceOrdAreaTypes, getServiceOrderTypes } from "@/api/dictionary"
import MapSelector from './components/map-selector.vue'
import VehicleSelector from './components/VehicleSelector.vue'
import OrganizationSelector from './components/OrganizationSelector.vue'
@@ -280,6 +301,17 @@
departureLatitude: null,
selectedDiseases: [], // 宸查�夋嫨鐨勭梾鎯呭垪琛紙纭繚鍒濆鍖栦负绌烘暟缁勶級
selectedStaff: [], // 宸查�夋嫨鐨勪汉鍛樺垪琛紙纭繚鍒濆鍖栦负绌烘暟缁勶級
+ // 浠诲姟绫诲瀷鍜屽崟鎹被鍨嬬浉鍏�
+ selectedEmergencyTaskType: '', // 閫変腑鐨勪换鍔$被鍨嬫枃鏈�
+ selectedEmergencyTaskTypeId: null, // 閫変腑鐨勪换鍔$被鍨婭D
+ selectedDocumentType: '', // 閫変腑鐨勫崟鎹被鍨嬫枃鏈�
+ selectedDocumentTypeId: null, // 閫変腑鐨勫崟鎹被鍨婭D
+ pendingTaskTypeId: null, // 绛夊緟璁剧疆鐨勪换鍔$被鍨婭D
+ pendingDocumentTypeId: null, // 绛夊緟璁剧疆鐨勫崟鎹被鍨婭D
+ emergencyTaskTypes: [], // 浠诲姟绫诲瀷鍒楄〃锛堜粠 SQL Server 鍔ㄦ�佸姞杞斤級
+ emergencyTaskTypeOptions: [], // 浠诲姟绫诲瀷閫夐」锛堢敤浜巔icker鏄剧ず锛�
+ documentTypes: [], // 鍗曟嵁绫诲瀷鍒楄〃
+ documentTypeOptions: [], // 鍗曟嵁绫诲瀷閫夐」锛堢敤浜巔icker鏄剧ず锛�
taskForm: {
transferTime: '',
patient: {
@@ -326,6 +358,10 @@
if (options.id) {
this.taskId = options.id
this.loadTaskDetail()
+ // 鍔犺浇浠诲姟绫诲瀷鏁版嵁
+ this.loadEmergencyTaskTypes()
+ // 鍔犺浇鍗曟嵁绫诲瀷鏁版嵁
+ this.loadDocumentTypes()
} else {
this.$modal.showToast('浠诲姟ID涓嶈兘涓虹┖')
setTimeout(() => {
@@ -420,6 +456,31 @@
// 杞繍璺濈鍜屼环鏍�
this.taskForm.transferDistance = info.transferDistance ? String(info.transferDistance) : ''
this.taskForm.price = info.transferPrice ? String(info.transferPrice) : ''
+
+ // 浠诲姟绫诲瀷鍜屽崟鎹被鍨�
+ if (info.taskTypeId) {
+ // 鐩存帴璁剧疆浠诲姟绫诲瀷锛屽鏋滈�夐」杩樻湭鍔犺浇瀹屾垚锛屽垯鍦ㄥ姞杞藉畬鎴愬悗鍐嶆璁剧疆
+ const taskType = this.emergencyTaskTypeOptions.find(option => option.id == info.taskTypeId)
+ if (taskType) {
+ this.selectedEmergencyTaskType = taskType.text
+ this.selectedEmergencyTaskTypeId = taskType.id
+ } else {
+ // 濡傛灉閫夐」杩樻湭鍔犺浇瀹屾垚锛屾爣璁伴渶瑕佽缃殑ID
+ this.pendingTaskTypeId = info.taskTypeId
+ }
+ }
+
+ if (info.documentTypeId) {
+ // 鐩存帴璁剧疆鍗曟嵁绫诲瀷锛屽鏋滈�夐」杩樻湭鍔犺浇瀹屾垚锛屽垯鍦ㄥ姞杞藉畬鎴愬悗鍐嶆璁剧疆
+ const docType = this.documentTypeOptions.find(option => option.id == info.documentTypeId)
+ if (docType) {
+ this.selectedDocumentType = docType.text
+ this.selectedDocumentTypeId = docType.id
+ } else {
+ // 濡傛灉閫夐」杩樻湭鍔犺浇瀹屾垚锛屾爣璁伴渶瑕佽缃殑ID
+ this.pendingDocumentTypeId = info.documentTypeId
+ }
+ }
} else {
console.warn('浠诲姟璇︽儏涓病鏈塭mergencyInfo瀛楁锛屽皾璇曚粠涓诲璞¤幏鍙栨暟鎹�')
// 鍏煎澶勭悊锛氬鏋渆mergencyInfo涓嶅瓨鍦紝灏濊瘯浠庝富瀵硅薄鑾峰彇
@@ -509,6 +570,92 @@
// 杞﹁締閫夋嫨鍙樺寲
onVehicleChange(vehicle) {
console.log('閫変腑杞﹁締:', vehicle)
+ },
+
+ // 鍔犺浇浠诲姟绫诲瀷鏁版嵁锛堜粠 SQL Server锛�
+ loadEmergencyTaskTypes() {
+ getServiceOrderTypes().then(response => {
+ const list = response.data || []
+ this.emergencyTaskTypes = list
+ this.emergencyTaskTypeOptions = list.map(item => ({
+ id: item.vID,
+ text: item.vtext
+ }))
+
+ // 濡傛灉浠诲姟璇︽儏宸插姞杞斤紝璁剧疆褰撳墠閫変腑鐨勪换鍔$被鍨�
+ if (this.taskDetail && this.taskDetail.emergencyInfo && this.taskDetail.emergencyInfo.taskTypeId) {
+ const currentType = this.emergencyTaskTypeOptions.find(option => option.id == this.taskDetail.emergencyInfo.taskTypeId)
+ if (currentType) {
+ this.selectedEmergencyTaskType = currentType.text
+ this.selectedEmergencyTaskTypeId = currentType.id
+ }
+ }
+
+ // 妫�鏌ユ槸鍚︽湁寰呰缃殑浠诲姟绫诲瀷ID
+ if (this.pendingTaskTypeId) {
+ const pendingType = this.emergencyTaskTypeOptions.find(option => option.id == this.pendingTaskTypeId)
+ if (pendingType) {
+ this.selectedEmergencyTaskType = pendingType.text
+ this.selectedEmergencyTaskTypeId = pendingType.id
+ this.pendingTaskTypeId = null
+ }
+ }
+ }).catch(error => {
+ console.error('鍔犺浇浠诲姟绫诲瀷澶辫触:', error)
+ this.emergencyTaskTypes = []
+ this.emergencyTaskTypeOptions = []
+ })
+ },
+
+ // 浠诲姟绫诲瀷閫夋嫨
+ onEmergencyTaskTypeChange(e) {
+ const index = e.detail.value
+ const selected = this.emergencyTaskTypeOptions[index]
+ this.selectedEmergencyTaskType = selected.text
+ this.selectedEmergencyTaskTypeId = selected.id
+ },
+
+ // 鍔犺浇鍗曟嵁绫诲瀷鏁版嵁
+ loadDocumentTypes() {
+ getServiceOrdAreaTypes().then(response => {
+ const list = response.data || []
+ this.documentTypes = list
+ this.documentTypeOptions = list.map(item => ({
+ id: item.vID,
+ text: item.vtext
+ }))
+
+ // 濡傛灉浠诲姟璇︽儏宸插姞杞斤紝璁剧疆褰撳墠閫変腑鐨勫崟鎹被鍨�
+ if (this.taskDetail && this.taskDetail.emergencyInfo && this.taskDetail.emergencyInfo.documentTypeId) {
+ const currentType = this.documentTypeOptions.find(option => option.id == this.taskDetail.emergencyInfo.documentTypeId)
+ if (currentType) {
+ this.selectedDocumentType = currentType.text
+ this.selectedDocumentTypeId = currentType.id
+ }
+ }
+
+ // 妫�鏌ユ槸鍚︽湁寰呰缃殑鍗曟嵁绫诲瀷ID
+ if (this.pendingDocumentTypeId) {
+ const pendingType = this.documentTypeOptions.find(option => option.id == this.pendingDocumentTypeId)
+ if (pendingType) {
+ this.selectedDocumentType = pendingType.text
+ this.selectedDocumentTypeId = pendingType.id
+ this.pendingDocumentTypeId = null
+ }
+ }
+ }).catch(error => {
+ console.error('鍔犺浇鍗曟嵁绫诲瀷澶辫触:', error)
+ this.documentTypes = []
+ this.documentTypeOptions = []
+ })
+ },
+
+ // 鍗曟嵁绫诲瀷閫夋嫨
+ onDocumentTypeChange(e) {
+ const index = e.detail.value
+ const selected = this.documentTypeOptions[index]
+ this.selectedDocumentType = selected.text
+ this.selectedDocumentTypeId = selected.id
},
// 鍔犺浇鎵�鏈夋満鏋処D
@@ -815,6 +962,16 @@
return false
}
+ if (!this.selectedEmergencyTaskType) {
+ this.$modal.showToast('璇烽�夋嫨浠诲姟绫诲瀷')
+ return false
+ }
+
+ if (!this.selectedDocumentType) {
+ this.$modal.showToast('璇烽�夋嫨鍗曟嵁绫诲瀷')
+ return false
+ }
+
if (!this.taskForm.patient.contact) {
this.$modal.showToast('璇疯緭鍏ヨ仈绯讳汉')
return false
@@ -940,6 +1097,9 @@
deptId: this.selectedOrganizationId,
vehicleIds: this.selectedVehicleId ? [this.selectedVehicleId] : [],
plannedStartTime: this.taskForm.transferTime,
+ // 浠诲姟绫诲瀷鍜屽崟鎹被鍨�
+ taskTypeId: this.selectedEmergencyTaskTypeId,
+ documentTypeId: this.selectedDocumentTypeId,
// 鍑哄彂鍦板湴鍧�鍜屽潗鏍囷紙浣跨敤杞嚭鍖婚櫌鍦板潃锛�
departureAddress: this.departureAddress || this.taskForm.hospitalOut.address,
@@ -1178,6 +1338,7 @@
}
}
}
+
</script>
<style lang="scss" scoped>
@@ -1389,4 +1550,5 @@
}
}
}
-}
\ No newline at end of file
+}
+</style>
\ No newline at end of file
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/IntegerUtil.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/IntegerUtil.java
new file mode 100644
index 0000000..c3dbf25
--- /dev/null
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/IntegerUtil.java
@@ -0,0 +1,27 @@
+package com.ruoyi.common.utils;
+
+import com.sun.org.apache.xpath.internal.operations.Bool;
+
+public class IntegerUtil {
+ public static Boolean isInteger(String str) {
+ try {
+ Integer.parseInt(str);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ /**
+ * 涓虹┖鎴栧皬浜�0
+ * @param integer
+ * @return
+ */
+ public static Boolean isEmpty(Integer integer){
+ return integer==null || integer<=0;
+ }
+
+ public static Boolean isNotEmpty(Integer integer){
+ return !isEmpty(integer);
+ }
+}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTask.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTask.java
index b6e913e..da2a3c4 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTask.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTask.java
@@ -32,18 +32,7 @@
@Excel(name = "浠诲姟鐘舵��", readConverterExp = "PENDING=寰呭紑濮�,IN_PROGRESS=浠诲姟涓�,COMPLETED=宸插畬鎴�,CANCELLED=宸插彇娑�")
private String taskStatus;
- /** 鏄惁鎬婚儴鎺ㄩ�� */
- @Excel(name = "鏄惁鎬婚儴鎺ㄩ��", readConverterExp = "0=鍚�,1=鏄�")
- private String isHeadPush;
-
- public void setIsHeadPush(String isHeadPush) {
- this.isHeadPush = isHeadPush;
- }
-
- public String getIsHeadPush() {
- return isHeadPush;
- }
/** 浠诲姟鎻忚堪 */
@Excel(name = "浠诲姟鎻忚堪")
private String taskDescription;
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTaskEmergency.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTaskEmergency.java
index 42876da..3d641c5 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTaskEmergency.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/SysTaskEmergency.java
@@ -150,6 +150,12 @@
/** 鏃х郴缁熸湇鍔″崟鍒嗙被 */
private String legacyServiceOrdClass;
+
+ /** 鏄惁VIP瀹㈡埛锛�0鍚� 1鏄級 */
+ private String serviceOrdVip;
+
+ /** 鏄惁骞垮窞鎬婚儴鎺ㄩ�侊紙0鍚� 1鏄級 */
+ private String fromHq2Is;
public String getServiceCode(){
if(this.legacyServiceOrdClass!=null && this.legacyServiceNsTime!=null && this.legacyServiceOrdNo!=null) {
@@ -540,6 +546,22 @@
this.legacyServiceOrdClass = legacyServiceOrdClass;
}
+ public String getServiceOrdVip() {
+ return serviceOrdVip;
+ }
+
+ public void setServiceOrdVip(String serviceOrdVip) {
+ this.serviceOrdVip = serviceOrdVip;
+ }
+
+ public String getFromHq2Is() {
+ return fromHq2Is;
+ }
+
+ public void setFromHq2Is(String fromHq2Is) {
+ this.fromHq2Is = fromHq2Is;
+ }
+
@Override
public String toString() {
return "SysTaskEmergency{" +
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskCreateVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskCreateVO.java
index 6647b55..1229e0b 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskCreateVO.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskCreateVO.java
@@ -141,6 +141,34 @@
private String taskStatus;
+ private String serviceOrdVIP;
+ public String getServiceOrdVIP() {
+ if(serviceOrdVIP != null)
+ return serviceOrdVIP;
+ else {
+ return "0";
+ }
+ }
+ public void setServiceOrdVIP(String serviceOrdVIP) {
+ this.serviceOrdVIP = serviceOrdVIP;
+ }
+
+ /** 鏃х郴缁熸槸鍚︽潵鑷狧Q2 */
+ private String FromHQ2_is;
+
+ public String getFromHQ2_is() {
+ if(FromHQ2_is != null)
+ return FromHQ2_is;
+ else {
+ return "0";
+ }
+
+ }
+ public void setFromHQ2_is(String fromHQ2_is) {
+ FromHQ2_is = fromHQ2_is;
+ }
+
+
// 鎵ц浜哄憳淇℃伅鍐呴儴绫�
public static class AssigneeInfo {
/** 鐢ㄦ埛ID */
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskQueryVO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskQueryVO.java
index d899481..f3bf3c3 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskQueryVO.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/TaskQueryVO.java
@@ -23,6 +23,9 @@
/** 浠诲姟鐘舵�� */
private String taskStatus;
+ /** 浠诲姟鐘舵�佸垪琛� */
+ private String taskStatusList;
+
/** 杞︾墝鍙� */
private String vehicleNo;
@@ -160,4 +163,12 @@
public void setOverdue(Boolean overdue) {
this.overdue = overdue;
}
+
+ public String getTaskStatusList() {
+ return taskStatusList;
+ }
+
+ public void setTaskStatusList(String taskStatusList) {
+ this.taskStatusList = taskStatusList;
+ }
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java
index 96f03eb..0298175 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/LegacyTransferSyncServiceImpl.java
@@ -2,10 +2,7 @@
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.common.utils.DateUtils;
-import com.ruoyi.common.utils.LongUtil;
-import com.ruoyi.common.utils.MapValueUtils;
-import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.*;
import com.ruoyi.system.domain.SysTaskEmergency;
import com.ruoyi.system.domain.VehicleInfo;
import com.ruoyi.system.domain.enums.TaskStatus;
@@ -471,8 +468,21 @@
createTaskVo.setTaskTypeId(serviceOrdType);
}
- // 璁剧疆鍖哄煙绫诲瀷
- String serviceOrdAreaType = MapValueUtils.getStringValue(order, "ServiceOrdAreaType");
+
+
+ String serviceOrdVIP = MapValueUtils.getStringValue(order, "ServiceOrdVIP");
+ if(serviceOrdVIP!=null){
+ createTaskVo.setServiceOrdVIP(serviceOrdVIP);
+ }else{
+ createTaskVo.setServiceOrdVIP("0");
+ }
+
+ Integer FromHQ2_is = MapValueUtils.getIntegerValue(order, "FromHQ2_is");
+ if(IntegerUtil.isNotEmpty(FromHQ2_is)){
+ createTaskVo.setFromHQ2_is("1");
+ }else{
+ createTaskVo.setFromHQ2_is("0");
+ }
// 璁剧疆鐢ㄦ埛ID
Long serviceOrdUserID = MapValueUtils.getLongValue(order, "ServiceOrdUserID");
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysEmergencyTaskServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysEmergencyTaskServiceImpl.java
index 50eb36f..54d7964 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysEmergencyTaskServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysEmergencyTaskServiceImpl.java
@@ -44,6 +44,8 @@
Long serviceOrderId, Long dispatchOrderId, String serviceOrdNo) {
SysTaskEmergency emergencyInfo = new SysTaskEmergency();
emergencyInfo.setTaskId(taskId);
+ emergencyInfo.setServiceOrdVip(createVO.getServiceOrdVIP());
+ emergencyInfo.setFromHq2Is(createVO.getFromHQ2_is());
if (createVO.getPatient() != null) {
emergencyInfo.setPatientContact(createVO.getPatient().getContact());
@@ -307,6 +309,9 @@
oldEmergency.setLegacyServiceOrdClass(updateVO.getLegacyServiceOrdClass());
}
+ oldEmergency.setFromHq2Is(updateVO.getFromHQ2_is());
+ oldEmergency.setServiceOrdVip(updateVO.getServiceOrdVIP());
+
sysTaskEmergencyMapper.updateSysTaskEmergency(oldEmergency);
}
@@ -472,7 +477,9 @@
if(createVO.getLegacyServiceOrdClass() != null){
existingInfo.setLegacyServiceOrdClass(createVO.getLegacyServiceOrdClass());
}
-
+
+ existingInfo.setServiceOrdVip(createVO.getServiceOrdVIP());
+ existingInfo.setFromHq2Is(createVO.getFromHQ2_is());
// 鎵ц鏇存柊
sysTaskEmergencyMapper.updateSysTaskEmergency(existingInfo);
}
diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java
index 0159840..07c68f0 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTaskServiceImpl.java
@@ -256,6 +256,7 @@
task.setPlannedStartTime(createVO.getPlannedStartTime());
task.setPlannedEndTime(createVO.getPlannedEndTime());
task.setAssigneeId(createVO.getAssigneeId());
+
task.setCreatorId(userId);
// 浼樺厛浣跨敤鍓嶇浼犲叆鐨勯儴闂↖D锛屽鏋滄病鏈夊垯浣跨敤褰撳墠鐢ㄦ埛鐨勯儴闂↖D
task.setDeptId(createVO.getDeptId() != null ? createVO.getDeptId() : SecurityUtils.getDeptId());
@@ -266,7 +267,7 @@
task.setRemark(createVO.getRemark());
task.setDelFlag("0");
- task.setIsHeadPush(isTaskHeaderPush(userId,task.getDeptId())?"1":"0");
+// task.setIsHeadPush(isTaskHeaderPush(userId,task.getDeptId())?"1":"0");
// 璁剧疆鍦板潃鍜屽潗鏍囦俊鎭�
setAddressAndCoordinatesFromVO(task, createVO);
@@ -371,12 +372,12 @@
task.setRemark(createVO.getRemark());
task.setDelFlag("0");
- Boolean isHeadPush=this.isTaskHeaderPush(userId, deptId);
- if(isHeadPush){
- task.setIsHeadPush("1");
- }else{
- task.setIsHeadPush("0");
- }
+// Boolean isHeadPush=this.isTaskHeaderPush(userId, deptId);
+// if(isHeadPush){
+// task.setIsHeadPush("1");
+// }else{
+// task.setIsHeadPush("0");
+// }
@@ -519,7 +520,7 @@
}
Boolean hasSetDepartureFlag=false;
//璁剧疆鎬婚儴鎺ㄩ��
- task.setIsHeadPush(this.isTaskHeaderPush(task.getCreatorId(), task.getDeptId())?"1":"0");
+// task.setIsHeadPush(this.isTaskHeaderPush(task.getCreatorId(), task.getDeptId())?"1":"0");
// 鑷姩鑾峰彇鍑哄彂鍦癎PS鍧愭爣锛堝鏋滄洿鏂颁簡鍦板潃浣嗙己澶卞潗鏍囷級
if (updateVO.getDepartureAddress() != null &&
(updateVO.getDepartureLongitude() == null || updateVO.getDepartureLatitude() == null) &&
diff --git a/ruoyi-system/src/main/resources/mapper/system/LegacyTransferSyncMapper.xml b/ruoyi-system/src/main/resources/mapper/system/LegacyTransferSyncMapper.xml
index 050beae..5ecdb9a 100644
--- a/ruoyi-system/src/main/resources/mapper/system/LegacyTransferSyncMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/LegacyTransferSyncMapper.xml
@@ -46,6 +46,8 @@
<result property="DispatchOrdState" column="DispatchOrdState" />
<result property="DispatchOrdNo" column="DispatchOrdNo" />
<result property="DispatchOrdClass" column="DispatchOrdClass" />
+ <result property="ServiceOrdVIP" column="ServiceOrdVIP" />
+ <result property="FromHQ2_is" column="FromHQ2_is" />
<result property="DispatchOrd_NS_Time" column="DispatchOrd_NS_Time" />
</resultMap>
@@ -63,6 +65,8 @@
a.ServiceOrdID,
a.Old_ServiceOrdID_TXT,
a.ServiceOrdNo,
+ a.FromHQ2_is,
+ a.ServiceOrdVIP,
a.ServiceOrdTraVia,
a.ServiceOrdApptDate,
a.ServiceOrd_NS_ID,
@@ -115,6 +119,8 @@
a.ServiceOrdID,
a.Old_ServiceOrdID_TXT,
a.ServiceOrdTraVia,
+ a.FromHQ2_is,
+ a.ServiceOrdVIP,
a.ServiceOrdNo,
a.ServiceOrdApptDate,
a.ServiceOrdUserID,
@@ -165,6 +171,8 @@
SELECT
a.ServiceOrdID,
a.Old_ServiceOrdID_TXT,
+ a.FromHQ2_is,
+ a.ServiceOrdVIP,
a.ServiceOrdTraVia,
a.ServiceOrdNo,
a.ServiceOrdApptDate,
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
index d5f526f..30e4c75 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskEmergencyMapper.xml
@@ -51,6 +51,8 @@
<result property="legacyDispatchNsTime" column="legacy_dispatch_ns_time" />
<result property="legacyDispatchOrdClass" column="legacy_dispatch_ord_class" />
<result property="legacyServiceOrdClass" column="legacy_service_ord_class" />
+ <result property="serviceOrdVip" column="service_ord_vip" />
+ <result property="fromHq2Is" column="from_hq2_is" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
@@ -65,7 +67,7 @@
hospital_in_department_id, hospital_in_bed_number, hospital_in_address, hospital_in_longitude,
hospital_in_latitude, transfer_distance, transfer_price, passenger_contact,
passenger_phone, disease_ids, document_type_id, task_type_id, legacy_service_ord_id, legacy_dispatch_ord_id,
- sync_status, sync_time, sync_error_msg, dispatch_sync_status, dispatch_sync_time, dispatch_sync_error_msg, need_resync, legacy_service_ord_no, legacy_dispatch_ord_no, legacy_service_ns_time, legacy_dispatch_ns_time, legacy_dispatch_ord_class, legacy_service_ord_class,
+ sync_status, sync_time, sync_error_msg, dispatch_sync_status, dispatch_sync_time, dispatch_sync_error_msg, need_resync, legacy_service_ord_no, legacy_dispatch_ord_no, legacy_service_ns_time, legacy_dispatch_ns_time, legacy_dispatch_ord_class, legacy_service_ord_class, service_ord_vip, from_hq2_is,
create_time, update_time, create_by, update_by
from sys_task_emergency
</sql>
@@ -128,6 +130,8 @@
<if test="legacyDispatchNsTime != null">legacy_dispatch_ns_time,</if>
<if test="legacyDispatchOrdClass != null">legacy_dispatch_ord_class,</if>
<if test="legacyServiceOrdClass != null">legacy_service_ord_class,</if>
+ <if test="serviceOrdVip != null">service_ord_vip,</if>
+ <if test="fromHq2Is != null">from_hq2_is,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
@@ -179,6 +183,8 @@
<if test="legacyDispatchNsTime != null">#{legacyDispatchNsTime},</if>
<if test="legacyDispatchOrdClass != null">#{legacyDispatchOrdClass},</if>
<if test="legacyServiceOrdClass != null">#{legacyServiceOrdClass},</if>
+ <if test="serviceOrdVip != null">#{serviceOrdVip},</if>
+ <if test="fromHq2Is != null">#{fromHq2Is},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
@@ -233,6 +239,8 @@
<if test="legacyDispatchNsTime != null">legacy_dispatch_ns_time = #{legacyDispatchNsTime},</if>
<if test="legacyDispatchOrdClass != null">legacy_dispatch_ord_class = #{legacyDispatchOrdClass},</if>
<if test="legacyServiceOrdClass != null">legacy_service_ord_class = #{legacyServiceOrdClass},</if>
+ <if test="serviceOrdVip != null">service_ord_vip = #{serviceOrdVip},</if>
+ <if test="fromHq2Is != null">from_hq2_is = #{fromHq2Is},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
diff --git a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
index 6fb4112..dd017b9 100644
--- a/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
+++ b/ruoyi-system/src/main/resources/mapper/system/SysTaskMapper.xml
@@ -35,7 +35,6 @@
<result property="assigneeName" column="assignee_name" />
<result property="deptName" column="dept_name" />
<result property="vehicleNo" column="vehicle_no" />
- <result property="isHeadPush" column="is_head_push" />
<collection property="assignedVehicles" ofType="SysTaskVehicle">
<result property="id" column="tv_id" />
<result property="taskId" column="tv_task_id" />
@@ -58,7 +57,6 @@
t.planned_start_time, t.planned_end_time,
t.actual_start_time, t.actual_end_time, t.creator_id, t.assignee_id, t.dept_id,
t.create_time, t.update_time, t.create_by, t.update_by, t.remark, t.del_flag, t.legacy_synced,
- t.is_head_push,
u1.nick_name as creator_name, u2.nick_name as assignee_name, d.dept_name,
(
select v2.vehicle_no
@@ -88,6 +86,11 @@
<if test="taskCode != null and taskCode != ''"> and t.task_code like concat('%', #{taskCode}, '%')</if>
<if test="taskType != null and taskType != ''"> and t.task_type = #{taskType}</if>
<if test="taskStatus != null and taskStatus != ''"> and t.task_status = #{taskStatus}</if>
+ <if test="taskStatusList != null and taskStatusList != ''"> and t.task_status in
+ <foreach collection="taskStatusList.split(',')" item="status" open="(" separator="," close=")">
+ #{status}
+ </foreach>
+ </if>
<if test="vehicleNo != null and vehicleNo != ''"> and v.vehicle_no like concat('%', #{vehicleNo}, '%')</if>
<!-- 缁煎悎鏌ヨ锛氬綋鍓嶇敤鎴锋墍鍦ㄦ満鏋� OR 褰撳墠鐢ㄦ埛鍒涘缓 OR 鍒嗛厤缁欏綋鍓嶇敤鎴� -->
<if test="(creatorId != null and creatorId != 0) or (assigneeId != null and assigneeId != 0) or (deptId != null and deptId != 0) or (deptIds != null and deptIds.size() > 0)">
@@ -236,7 +239,6 @@
<if test="creatorId != null">creator_id,</if>
<if test="assigneeId != null">assignee_id,</if>
<if test="deptId != null">dept_id,</if>
- <if test="isHeadPush != null">is_head_push,</if>
<if test="createTime != null">create_time,</if>
update_time,
<if test="createBy != null">create_by,</if>
@@ -294,7 +296,6 @@
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="assigneeId != null">assignee_id = #{assigneeId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
- <if test="isHeadPush != null">is_head_push = #{isHeadPush},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if>
diff --git a/sql/add_vip_and_hq_fields_to_sys_task_emergency.sql b/sql/add_vip_and_hq_fields_to_sys_task_emergency.sql
new file mode 100644
index 0000000..d9e5e38
--- /dev/null
+++ b/sql/add_vip_and_hq_fields_to_sys_task_emergency.sql
@@ -0,0 +1,20 @@
+-- ----------------------------
+-- 鍦� sys_task_emergency 琛ㄤ腑澧炲姞 ServiceOrdVIP 鍜� FromHQ2_is 瀛楁
+-- ServiceOrdVIP锛氭槸鍚IP瀹㈡埛锛�0琛ㄧず闈濾IP锛�1琛ㄧずVIP锛�
+-- FromHQ2_is锛氭槸鍚﹀箍宸炴�婚儴鎺ㄩ�佹爣璁帮紙绌烘垨0琛ㄧず闈炲箍宸炴�婚儴鎺ㄩ�侊紝1琛ㄧず骞垮窞鎬婚儴鎺ㄩ�侊級
+-- ----------------------------
+
+-- 娣诲姞 ServiceOrdVIP 瀛楁
+ALTER TABLE sys_task_emergency
+ADD COLUMN service_ord_vip CHAR(1) DEFAULT '0' COMMENT '鏄惁VIP瀹㈡埛锛�0鍚� 1鏄級';
+
+-- 娣诲姞 FromHQ2_is 瀛楁
+ALTER TABLE sys_task_emergency
+ADD COLUMN from_hq2_is CHAR(1) DEFAULT '0' COMMENT '鏄惁骞垮窞鎬婚儴鎺ㄩ�侊紙0鍚� 1鏄級';
+
+-- 娣诲姞绱㈠紩浠ユ彁楂樻煡璇㈡�ц兘
+ALTER TABLE sys_task_emergency
+ADD INDEX idx_service_ord_vip (service_ord_vip);
+
+ALTER TABLE sys_task_emergency
+ADD INDEX idx_from_hq2_is (from_hq2_is);
\ No newline at end of file
diff --git a/sql/remove_is_head_push_from_sys_task.sql b/sql/remove_is_head_push_from_sys_task.sql
new file mode 100644
index 0000000..7f1cf2f
--- /dev/null
+++ b/sql/remove_is_head_push_from_sys_task.sql
@@ -0,0 +1,5 @@
+-- 鍒犻櫎 sys_task 琛ㄤ腑鐨� is_head_push 瀛楁
+-- 鐢ㄤ簬绉婚櫎浠诲姟鏄惁鐢辨�婚儴鎺ㄩ�佺殑鏍囪
+
+ALTER TABLE sys_task
+DROP COLUMN is_head_push;
\ No newline at end of file
--
Gitblit v1.9.1