无人机管理后台前端(已迁走)
shuishen
2025-04-29 8a22c9bb675e14ebf2e5ba78e1a7b9cd101cccce
智飞工单审核详情显示
1 files modified
653 ■■■■ changed files
src/views/tickets/orderLog.vue 653 ●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2025-04-15 20:02:29
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2025-04-15 21:56:14
 * @LastEditTime: 2025-04-28 11:38:16
 * @FilePath: \drone-web-manage\src\views\tickets\orderLog.vue
 * @Description: 
 * 
@@ -11,12 +11,13 @@
<template>
    <basic-container>
        <el-tabs v-model="activeTab" @tab-click="handleTabChange">
            <el-tab-pane v-for="tab in filteredTabs" :key="tab.name" :label="`${tab.label} (${tab.count})`" :name="tab.name">
            <el-tab-pane v-for="tab in filteredTabs" :key="tab.name" :label="`${tab.label} (${tab.count})`"
                :name="tab.name">
                <div class="tab-content">
                    <!-- 查询条件筛选栏 -->
                    <div class="filter-bar">
                        <el-input v-model="filters.key_word" placeholder="输入工单编号/名称/内容/姓名" class="filter-item" clearable
                            @keyup.enter="handleSearch" />
                        <el-input style="width: 250px" v-model="filters.key_word" placeholder="输入工单编号/名称/内容/姓名"
                            class="filter-item" clearable @keyup.enter="handleSearch" />
                        <el-select placeholder="请选择所属单位" v-model="filters.create_dept" @change="handleDepartmentChange"
                            class="filter-item" clearable>
@@ -25,8 +26,10 @@
                        </el-select>
                        <el-date-picker v-model="filters.dateRange" type="datetimerange" range-separator="至"
                            start-placeholder="开始日期" end-placeholder="结束日期" class="filter-item" style="width: 100px" />
                        <el-select v-model="filters.file_id" placeholder="请选择关联航线" class="filter-item" clearable>
                            start-placeholder="开始日期" end-placeholder="结束日期" class="filter-item" style="width: 100px"
                            :default-value="datePickerDefaultVal" />
                        <el-select v-model="filters.file_id" placeholder="请选择关联航线" class="filter-item frequency"
                            clearable>
                            <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
                                :value="item.wayline_id" />
                        </el-select>
@@ -48,11 +51,11 @@
                        </el-select>
                        <el-date-picker v-model="filters.cycleDateRange" type="datetimerange" range-separator="至"
                            start-placeholder="工单周期开始日期" end-placeholder="工单周期结束时间日期" class="filter-item"
                            style="width: 240px !important" />
                        <el-select v-model="filters.rep_fre_type" placeholder="请选择频次" class="filter-item">
                            :default-value="datePickerDefaultVal" style="width: 220px !important" />
                        <el-select v-model="filters.rep_fre_type" placeholder="请选择频次" class="filter-item frequency">
                            <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
                        </el-select>
                        <el-time-picker style="width: 100px" v-model="filters.deal_time" placeholder="请选择执行时间"
                        <el-time-picker style="width: 150px" v-model="filters.deal_time" placeholder="请选择执行时间"
                            prop="deal_time" value-format="HH:mm" :picker-options="{
                                selectableRange: '00:00 - 23:59',
                            }" />
@@ -67,42 +70,43 @@
                        :table-loading="loading" @current-change="currentChange" @refresh-change="refreshChange"
                        @on-load="onLoad" @search-change="searchChange" @size-change="sizeChange">
                        <template #menu-left>
                            <el-button v-if="hasAddBtnPermission()&&activeTab!='WAIT_AUDIT'" type="primary" icon="el-icon-plus" @click="handleAdd" >新建工单</el-button>
                            <el-button v-if="hasAddBtnPermission() && activeTab != 'WAIT_AUDIT'" type="primary"
                                icon="el-icon-plus" @click="handleAdd">新建工单</el-button>
                            <el-button type="success" plain icon="el-icon-download" @click="exportData">导出</el-button>
                        </template>
                        <template #menu="{ row }">
                            <div v-if="row.status == 1">
                                <el-button v-if="hasPaddingBtnPermission()" type="text" icon="el-icon-view" @click="handleCheckDetail(row)">审核</el-button>
                            </div>
                            <div v-if="userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()">
                                <!--待审核状态-->
                            <div class="menu-custom-box">
                                <div v-if="row.status == 1">
                                    <el-button type="text" icon="el-icon-warning-outline"
                                    <el-button class="audit-btn" v-if="hasPaddingBtnPermission()" type="text"
                                        icon="el-icon-view" @click="handleCheckDetail(row)">审核</el-button>
                                </div>
                                <div
                                    v-if="(userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) && row.status == 1">
                                    <!--待审核状态-->
                                    <el-button class="withdraw-btn" type="text" icon="el-icon-warning"
                                        @click="orderLogRecall(row.id)">撤回</el-button>
                                </div>
                                <!--已驳回-->
                                <div v-if="row.status == 2">
                                    <el-button class="reject-reason-btn" type="text" icon="el-icon-warning"
                                        @click="rejectDetail(row.id)">驳回原因</el-button>
                                </div>
                                <!--草稿-->
                                <div v-if="row.status == 0 && userInfo.user_id == row.create_user">
                                    <el-button class="edit-btn" type="text" icon="el-icon-edit-outline"
                                        @click="handleViewDetail(row)">编辑</el-button>
                                    <el-button class="publish-btn" type="text" icon="el-icon-position"
                                        @click="userPublishPush(row.id)">发布</el-button>
                                    <el-button class="delete-btn" type="text" icon="el-icon-delete"
                                        @click="deleteOrderLog(row.id)">删除</el-button>
                                </div>
                                <div v-if="row.status == 3 || row.status == 1 || row.status == 2">
                                    <el-button class="detail-btn" type="text" icon="el-icon-view"
                                        @click="handleViewDetail(row)">详情</el-button>
                                </div>
                            </div>
                            <!--已驳回-->
                            <div v-if="row.status == 2">
                                <el-button type="text" icon="el-icon-warning-outline"
                                    @click="rejectDetail(row.id)">驳回原因</el-button>
                            </div>
                            <!--草稿-->
                            <div v-if="row.status == 0 && userInfo.user_id == row.create_user">
                                <el-button type="text" icon="el-icon-edit-outline"
                                    @click="handleViewDetail(row)">编辑</el-button>
                                <el-button type="text" icon="el-icon-position"
                                    @click="userPublishPush(row.id)">发布</el-button>
                                <el-button type="text" icon="el-icon-delete"
                                    @click="deleteOrderLog(row.id)">删除</el-button>
                            </div>
                        <div v-if="row.status == 3 || row.status == 1 || row.status == 2">
                              <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button>
                            </div>
                        </template>
                        <template #status="{ row }">
                            <el-tag :type="getStatusTagType(row.status)">{{ mapStatus(row.status) }}</el-tag>
@@ -117,15 +121,16 @@
            </el-tab-pane>
        </el-tabs>
        <!-- 新建工单 -->
        <el-dialog  v-model="dialogVisible" title="新建工单" width="70%" :close-on-click-modal="false" @close="resetForm">
        <!-- 新建工单对话框 -->
        <el-dialog v-model="dialogVisible" title="新建工单" width="70%" :close-on-click-modal="false" @close="resetForm">
            <el-form :model="form" :rules="rules" ref="testform" label-width="100px">
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="工单名称" prop="name">
                            <el-input v-model="form.name" placeholder="请输入工单名称"  maxlength="100" show-word-limit></el-input>
                            <el-input v-model="form.name" placeholder="请输入工单名称" maxlength="100"
                                show-word-limit></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
@@ -140,14 +145,10 @@
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="关联机巢" prop="device_sns">
                            <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple>
                                <el-option
                                    v-for="item in device_sns"
                                    :key="item.device_sn"
                                    :label="item.nickname"
                                    :value="item.device_sn"
                                />
                                <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
                                    :value="item.device_sn" />
                            </el-select>
                        </el-form-item>
                    </el-col>
@@ -164,14 +165,8 @@
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="工单内容" prop="content">
                            <el-input
                                type="textarea"
                                v-model="form.content"
                                rows="4"
                                placeholder="请输入工单内容"
                                maxlength="255"
                                show-word-limit
                            ></el-input>
                            <el-input type="textarea" v-model="form.content" rows="4" placeholder="请输入工单内容"
                                maxlength="255" show-word-limit></el-input>
                        </el-form-item>
                    </el-col>
@@ -181,8 +176,6 @@
                                start-placeholder="开始日期" end-placeholder="结束日期" class="date-picker" />
                        </el-form-item>
                        <el-button type="danger" @click="submitForm(1)">发布</el-button>
                        <el-button type="primary" @click="submitForm(0)">存草稿</el-button>
                    </el-col>
                    <el-col :span="3">
                        <el-select v-model="form.rep_fre_type" placeholder="请选择频次">
@@ -205,12 +198,20 @@
                    </el-col>
                </el-row>
                <el-row>
                    <div class="add-box-btns">
                        <el-button type="danger" @click="submitForm(1)">发布</el-button>
                        <el-button type="primary" @click="submitForm(0)">存草稿</el-button>
                    </div>
                </el-row>
            </el-form>
        </el-dialog>
        <!-- 工单详情对话框 -->
        <el-dialog v-model="detailVisible" :title="detailTitle" width="70%" :close-on-click-modal="false" @close="resetForm" >
              <div class="event-title-center">{{ form.name}}</div>
        <el-dialog v-model="detailVisible" :title="detailTitle" width="70%" :close-on-click-modal="false"
            @close="resetForm">
            <div class="event-title-center">{{ form.name }}</div>
            <el-form :model="form" ref="testform" label-width="100px">
                <div class="custom-steps-container">
                    <!-- 标题行 -->
@@ -268,12 +269,8 @@
                    <el-col :span="12">
                        <el-form-item label="关联机巢" prop="device_sns">
                            <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple>
                                <el-option
                                    v-for="item in device_sns"
                                    :key="item.device_sn"
                                    :label="item.nickname"
                                    :value="item.device_sn"
                                />
                                <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
                                    :value="item.device_sn" />
                            </el-select>
                        </el-form-item>
                    </el-col>
@@ -290,14 +287,8 @@
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="工单内容" prop="content">
                            <el-input
                                type="textarea"
                                v-model="form.content"
                                rows="4"
                                placeholder="请输入工单内容"
                                maxlength="255"
                                show-word-limit
                            ></el-input>
                            <el-input type="textarea" v-model="form.content" rows="4" placeholder="请输入工单内容"
                                maxlength="255" show-word-limit></el-input>
                        </el-form-item>
                    </el-col>
@@ -343,29 +334,28 @@
            </el-form>
        </el-dialog>
        <!-- 工单详情 -->
        <el-dialog v-model="detailVisibleCopy" title="工单详情" width="70%" :close-on-click-modal="false" @close="resetForm">
  <div class="event-title-center">{{ form.name }}</div>
  <el-form :model="form" ref="testform" label-width="100px">
    <div class="custom-steps-container">
      <!-- 标题行 -->
      <div class="steps-titles">
        <div v-for="(record, index) in form.record_list" :class="{ active: record.user_id >= 0 }"
          :key="index" class="step-title">
          {{ record.status_str }}
        </div>
      </div>
        <el-dialog v-model="detailVisibleCopy" title="工单详情" width="70%" :close-on-click-modal="false"
            @close="resetForm">
            <div class="event-title-center">{{ form.name }}</div>
            <el-form :model="form" ref="testform" label-width="100px">
                <div class="custom-steps-container">
                    <!-- 标题行 -->
                    <div class="steps-titles">
                        <div v-for="(record, index) in form.record_list" :class="{ active: record.user_id >= 0 }"
                            :key="index" class="step-title">
                            {{ record.status_str }}
                        </div>
                    </div>
      <!-- Element Steps 组件 -->
      <el-steps :active="form.active" align-center class="custom-steps">
        <el-step v-for="(record, index) in form.record_list" :key="index">
          <template #description>
            <span class="step-description" style="position: relative; display: inline-block;">
              {{ record.user_name }}
            </span>
            <span style="
                    <!-- Element Steps 组件 -->
                    <el-steps :active="form.active" align-center class="custom-steps">
                        <el-step v-for="(record, index) in form.record_list" :key="index">
                            <template #description>
                                <span class="step-description" style="position: relative; display: inline-block;">
                                    {{ record.user_name }}
                                </span>
                                <span style="
              position: absolute;
              left: 80%;  
              top: 50%;
@@ -375,68 +365,64 @@
              color: #666;
              font-size: 12px;
            ">
              {{ record.interval_time_str }}
            </span>
            <div class="step-description">
              {{ record.create_time_str }}
            </div>
          </template>
        </el-step>
      </el-steps>
    </div>
                                    {{ record.interval_time_str }}
                                </span>
                                <div class="step-description">
                                    {{ record.create_time_str }}
                                </div>
                            </template>
                        </el-step>
                    </el-steps>
                </div>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="工单名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入工单名称" :disabled="true"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="关联航线" prop="file_id">
          <el-select v-model="form.file_id" placeholder="请选择航线" :disabled="true">
            <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
              :value="item.wayline_id" />
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
    <el-row :gutter="20">
      <el-col :span="12">
        <el-form-item label="关联机巢" prop="device_sns">
          <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple :disabled="true">
            <el-option
              v-for="item in device_sns"
              :key="item.device_sn"
              :label="item.nickname"
              :value="item.device_sn"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="12">
        <el-form-item label="关联算法" prop="ai_types">
          <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple :disabled="true">
            <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue"
              :value="item.dictKey" />
          </el-select>
        </el-form-item>
      </el-col>
    </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="工单名称" prop="name">
                            <el-input v-model="form.name" placeholder="请输入工单名称" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="关联航线" prop="file_id">
                            <el-select v-model="form.file_id" placeholder="请选择航线" :disabled="true">
                                <el-option v-for="item in wayLineList" :key="item.wayline_id" :label="item.name"
                                    :value="item.wayline_id" />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="关联机巢" prop="device_sns">
                            <el-select v-model="form.device_sns" placeholder="请选择机巢" multiple :disabled="true">
                                <el-option v-for="item in device_sns" :key="item.device_sn" :label="item.nickname"
                                    :value="item.device_sn" />
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="关联算法" prop="ai_types">
                            <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple :disabled="true">
                                <el-option v-for="item in ai_types" :key="item.dictKey" :label="item.dictValue"
                                    :value="item.dictKey" />
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
    <el-row :gutter="20">
         <el-col :span="12"  prop="statusStr">
            <el-form-item label="当前状态">
                      {{statusStr}}
            </el-form-item>
      </el-col>
                 <el-col :span="6">
                <el-row :gutter="20">
                    <el-col :span="12" prop="statusStr">
                        <el-form-item label="当前状态">
                            {{ statusStr }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="周期频次" prop="date_range">
                            <el-date-picker v-model="form.date_range" type="daterange" range-separator="至"
                                start-placeholder="开始日期" end-placeholder="结束日期" class="date-picker" :disabled="true"/>
                                start-placeholder="开始日期" end-placeholder="结束日期" class="date-picker" :disabled="true" />
                        </el-form-item>
                        </el-col>
                    </el-col>
                    <el-col :span="3">
                        <el-select v-model="form.rep_fre_type" placeholder="请选择频次" :disabled="true">
                            <el-option v-for="item in cycles" :key="item" :label="item" :value="item" />
@@ -449,25 +435,17 @@
                                selectableRange: '00:00 - 23:59',
                            }" />
                    </el-col>
   </el-row>
      <el-row :gutter="20">
         <el-col :span="12">
        <el-form-item label="工单内容" prop="content">
          <el-input
            type="textarea"
            v-model="form.content"
            rows="2"
            placeholder="请输入工单内容"
            maxlength="255"
            show-word-limit
            :readonly="true"
            :disabled="true"
          ></el-input>
        </el-form-item>
      </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="12">
                        <el-form-item label="工单内容" prop="content">
                            <el-input type="textarea" v-model="form.content" rows="2" placeholder="请输入工单内容"
                                maxlength="255" show-word-limit :readonly="true" :disabled="true"></el-input>
                        </el-form-item>
                    </el-col>
       <el-col :span="12">
                    <el-col :span="12">
                        <el-button type="danger"
                            v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)"
@@ -479,21 +457,19 @@
                            @click="orderLogPass(form.id)">通过</el-button>
                        <el-button type="danger" v-if="form.status == 1 && hasRejectionBtnPermission()"
                            @click="orderLogReject(form.id)">驳回</el-button>
       </el-col>
      </el-row>
    <el-row :gutter="20" style="height: 400px">
      <el-col :span="24">
        <map-container v-if='detailVisible' ref="MapContainer"></map-container>
      </el-col>
    </el-row>
  </el-form>
</el-dialog>
                    </el-col>
                </el-row>
                <el-row :gutter="20" style="height: 400px">
                    <el-col :span="24">
                        <map-container v-if='detailVisible' ref="MapContainer"></map-container>
                    </el-col>
                </el-row>
            </el-form>
        </el-dialog>
    </basic-container>
</template>
@@ -523,7 +499,27 @@
export default {
    name: 'TicketPage',
    data() {
    data () {
        const calculateDefaultRange = () => {
            const now = new Date()
            const currentYear = now.getFullYear()
            const currentMonth = now.getMonth() // 0-11
            // 计算上个月
            let lastMonthYear = currentYear
            let lastMonth = currentMonth - 1
            if (lastMonth < 0) {
                lastMonth = 11
                lastMonthYear = currentYear - 1
            }
            // 设置默认范围 [上个月, 当前月]
            return [
                new Date(lastMonthYear, lastMonth, 1),
                new Date(currentYear, currentMonth, 1)
            ]
        }
        return {
            activeTab: 'all',
@@ -549,7 +545,7 @@
            device_sns: [],
            ai_types: [],
            wayLineList: [],
            detailTitle:"编辑工单",
            detailTitle: "编辑工单",
            detailVisibleCopy: false,
            statuses: [
@@ -563,9 +559,11 @@
            tableData: [],
            option: {
                indexFixed: true,
                align: 'center',
                border: true,
                stripe: true,
                menuWidth: 150,
                searchShow: true,
                searchBtnText: '搜索',
                searchMenuSpan: 6,
@@ -574,34 +572,35 @@
                viewBtn: false,
                editBtn: false,
                delBtn: false,
                menu: true,
                cancelBtn: true,
                cancelBtnText: '取消',
                menu: true,
                menuWidth: 210,
                menuClassName: 'cur-menu',
                column: [
                    { label: '序号', prop: 'id', width: 50, ellipsis: true },
                    { label: '序号', prop: 'id', width: 72, ellipsis: true },
                    { label: '工单编号', prop: 'job_info_num', width: 100, ellipsis: true, overHidden: true },
                    { label: '工单名称', prop: 'name', width: 100, ellipsis: true, overHidden: true },
                    { label: '所属单位', prop: 'dept_name', width: 100, ellipsis: true },
                    { label: '发起时间', prop: 'create_time', width: 100, ellipsis: true },
                    { label: '发起时间', prop: 'create_time', width: 144, ellipsis: true },
                    { label: '工单内容', prop: 'content', width: 160, ellipsis: true, overHidden: true },
                    { label: '关联航线', prop: 'wayline_name', width: 100, ellipsis: true, overHidden: true },
                    { label: '关联算法', prop: 'ai_type_str', width: 100, ellipsis: true, overHidden: true },
                    { label: '关联机巢', prop: 'device_names', width: 100, ellipsis: true, overHidden: true },
                    { label: '创建人', prop: 'creator_name', width: 50, ellipsis: true, overHidden: true },
                    { label: '关联机巢', prop: 'device_names', width: 80, ellipsis: true, overHidden: true },
                    { label: '创建人', prop: 'creator_name', width: 96, ellipsis: true, overHidden: true },
                    { label: '关联机巢', prop: 'device_names', width: 112, ellipsis: true, overHidden: true },
                    {
                        label: '工单周期频次',
                        prop: '',
                        width: 108,
                        width: 110,
                        formatter: row => this.formatCycleTime(row),
                        html: true,
                        ellipsis: true, overHidden: true
                        ellipsis: true,
                        // overHidden: true
                    },
                    { label: '工单状态', prop: 'status', width: 60 },
                    { label: '工单状态', prop: 'status', width: 96 },
                ],
            },
@@ -616,7 +615,7 @@
            form: {},
            rules: {
                name: [{ required: true, message: '请输入工单名称', trigger: 'blur' },
                          { max: 100, message: '工单名称不能超过100个字', trigger: 'blur' },
                { max: 100, message: '工单名称不能超过100个字', trigger: 'blur' },
                ],
                file_id: [{ required: true, message: '需要选择航线', trigger: 'change' }],
                device_sns: [{ required: true, message: '请选择机巢', trigger: 'change' }],
@@ -632,13 +631,16 @@
            loading: false,
            globalCounts: {},
            mapLoaded: false,
            // 配置时间选择器默认配置
            datePickerDefaultVal: calculateDefaultRange()
        }
    },
    async created() {
    async created () {
        var response = await getDictionaryByCode('SF')
        var word_order_typeResponse = await getDictionaryByCode('WORK_ORDER_TYPE' )
        var word_order_typeResponse = await getDictionaryByCode('WORK_ORDER_TYPE')
        this.ai_types = response.data.data['SF']
        this.types = word_order_typeResponse.data.data['WORK_ORDER_TYPE'];
        this.types = word_order_typeResponse.data.data['WORK_ORDER_TYPE']
        //获取航线
        this.asyncgetWaylineFileListByArea()
        const response2 = await getTicketInfo()
@@ -648,28 +650,28 @@
            value: item.id,
        }))
    },
    mounted() {
    mounted () {
        this.fetchTableData()
    },
    computed: {
        ...mapGetters(['userInfo', 'permission']),
        filteredTabs() {
            const canShowRejectAndDraft = this.permission?.rejection_and_draft === true;
        filteredTabs () {
            // rejection_and_draft 权限控制“已驳回”和“草稿”tab
            const canShowRejectAndDraft = this.permission?.rejection_and_draft === true
            return this.tabs.map(tab => {
                if (tab.name === 'DRAFT') {
                    return { ...tab, isShow: canShowRejectAndDraft };
                    return { ...tab, isShow: canShowRejectAndDraft }
                }
                if (tab.name === 'REJECTED') {
                    return { ...tab, isShow: canShowRejectAndDraft };
                    return { ...tab, isShow: canShowRejectAndDraft }
                }
                return { ...tab, isShow: true };
            }).filter(tab => tab.isShow);
                return { ...tab, isShow: true }
            }).filter(tab => tab.isShow)
        },
    },
    methods: {
        searchChange(params, done) {
        searchChange (params, done) {
            console.log('searchChange')
            this.query = params
            this.parentId = ''
@@ -677,7 +679,7 @@
            this.onLoad(this.page, params)
            done()
        },
        async onLoad(page, params = {}) {
        async onLoad (page, params = {}) {
            this.loading = true
            getList(
                null,
@@ -692,11 +694,11 @@
        },
        selectionClear() {
        selectionClear () {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        async loadAMapScripts() {
        async loadAMapScripts () {
            try {
                // await loadAMap();
                // await loadAMapUI();
@@ -706,11 +708,11 @@
                this.$message.error('地图加载失败,请检查网络或API Key配置')
            }
        },
        formatCycleTime(row) {
            return row.cycle_time_value;
        formatCycleTime (row) {
            return `${row.cycle_time_value}`
        },
        async fetchTableData() {
        async fetchTableData () {
            this.loading = true
            try {
                let params = this.getQueryParam()
@@ -726,7 +728,7 @@
                })
                console.log('权限检查:', this.permission);
                console.log('权限检查:', this.permission)
                this.page.total = total || 0
                this.updateGlobalCounts()
            } catch (error) {
@@ -739,7 +741,7 @@
            }
        },
        getQueryParam() {
        getQueryParam () {
            const currentTab = this.tabs.find(tab => tab.name === this.activeTab)
            if (this.filters.dateRange) {
                console.log(
@@ -778,11 +780,11 @@
            }
            return params
        },
        sizeChange(pageSize) {
        sizeChange (pageSize) {
            this.page.pageSize = pageSize
        },
        async submitForm(status) {
        async submitForm (status) {
            this.$refs.testform.validate(async valid => {
                if (valid) {
@@ -811,7 +813,7 @@
            })
        },
        //驳回原因显示
        async rejectDetail(id) {
        async rejectDetail (id) {
            const response = await orderLogDetails(id)
            let data = response.data.data
            this.$confirm(data.remark, '驳回原因', {
@@ -825,7 +827,7 @@
                this.detailVisible = true
            })
        },
        formatDate(date) {
        formatDate (date) {
            if (!date) return undefined
            const d = new Date(date)
            return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(
@@ -833,7 +835,7 @@
            ).padStart(2, '0')} 00:00:00`
        },
        mapStatus(status) {
        mapStatus (status) {
            const statusTextMap = {
                0: '草稿',
                1: '待审核',
@@ -843,30 +845,30 @@
            return statusTextMap[status] || '未知状态'
        },
        getStatusTagType(status) {
        getStatusTagType (status) {
            const statusMap = {
                1: 'warning',
                2: 'info',
                 3: 'primary',
                3: 'primary',
                4: 'success',
                5: 'danger',
            }
            return statusMap[status] || 'info'
        },
        handleTabChange(tab) {
        handleTabChange (tab) {
            this.activeTab = tab.props?.name || tab.name
            this.filters.status = ''
            this.page.currentPage = 1
            this.fetchTableData()
        },
        handleSearch() {
        handleSearch () {
            this.page.currentPage = 1
            this.fetchTableData()
        },
        handleReset() {
        handleReset () {
            this.filters = {
                keyword: '',
                department: '',
@@ -878,11 +880,11 @@
            this.fetchTableData()
        },
        currentChange(currentPage) {
        currentChange (currentPage) {
            this.page.currentPage = currentPage
        },
        async updateGlobalCounts() {
        async updateGlobalCounts () {
            const counts = {
                all: 0,
                DRAFT: 0,
@@ -891,26 +893,26 @@
                PASS: 0,
            }
            var reponse = await jobStatusNum();
            console.log("统计" + reponse.data.data);
            var reponse = await jobStatusNum()
            console.log("统计" + reponse.data.data)
            reponse.data.data.forEach(item => {
                const tab = this.tabs.find(t => t.name === item.dict_key);
                const tab = this.tabs.find(t => t.name === item.dict_key)
                if (tab) {
                    tab.count = item.num;
                    tab.count = item.num
                }
            });
            })
        },
        handleAdd() {
        handleAdd () {
            this.form = {}
            this.dialogVisible = true
            //航线列表
            this.asyncgetWaylineFileListByArea()
        },
        resetForm() {
        resetForm () {
            this.form = {
                name: '',
                type: '',
@@ -920,52 +922,52 @@
                address: '',
                content: '',
                photos: [],
                status : null,
            }
            if (this.$refs.testform) {
                this.$refs.testform.resetFields()
            }
        },
        formatLocation(location) {
        formatLocation (location) {
            if (!Array.isArray(location)) {
                return '未知位置'
            }
            return `${location[0].toFixed(6)}, ${location[1].toFixed(6)}`
        },
        async handleViewDetail(row) {
            const response = await orderLogDetails(row.id);
            const data = response.data.data;
        async handleViewDetail (row) {
            console.log("工单名称1111:")
            const response = await orderLogDetails(row.id)
            const data = response.data.data
            this.form = {
                ...data,
            };
            }
            this.detailVisible = true;
            this.detailVisible = true
            // 更新机巢列表
            this.device_sns = data.device_list;
          (this.permission && (this.permission.order_log_review  || this.permission.order_log_recall))&& (data.status==1||data.status==3||data.status==2) ? this.detailTitle="工单详情":this.detailTitle="编辑工单";
          console.log("工单名称:"+this.detailTitle);
            (this.permission && (this.permission.order_log_review || this.permission.order_log_recall)) && (data.status == 1 || data.status == 3 || data.status == 2) ? this.detailTitle = "工单详情" : this.detailTitle = "编辑工单"
            console.log("工单名称:" + this.detailTitle)
        },
           async handleCheckDetail(row) {
            const response = await orderLogDetails(row.id);
            const data = response.data.data;
        async handleCheckDetail (row) {
            const response = await orderLogDetails(row.id)
            const data = response.data.data
            this.form = {
                ...data,
            };
            }
            this.detailVisibleCopy = true;
            this.statusStr = this.mapStatus(data.status);
            this.detailVisibleCopy = true
            this.statusStr = this.mapStatus(data.status)
            // 更新机巢列表
            this.device_sns = data.device_list;
            this.device_sns = data.device_list
        },
        //导出
        async exportData() {
        async exportData () {
            this.$confirm('是否智飞工单数据?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -979,66 +981,66 @@
                })
            })
        },
        hasAddBtnPermission() {
        hasAddBtnPermission () {
            // undefined 或 false 都返回 false,只有 true 返回 true
            console.log('this.permission.order_log_add :', this.permission.order_log_add );
            return this.permission && this.permission.order_log_add === true;
            console.log('this.permission.order_log_add :', this.permission.order_log_add)
            return this.permission && this.permission.order_log_add === true
        },
        hasPaddingBtnPermission() {
        hasPaddingBtnPermission () {
            // undefined 或 false 都返回 false,只有 true 返回 true
            console.log('权限检查:', this.permission);
            return this.permission && this.permission.order_log_review === true;
            console.log('权限检查:', this.permission)
            return this.permission && this.permission.order_log_review === true
        },
            hasRecallPaddingBtnPermission() {
        hasRecallPaddingBtnPermission () {
            // undefined 或 false 都返回 false,只有 true 返回 true
            console.log('权限检查:', this.permission);
            return this.permission && this.permission.order_log_recall === true;
            console.log('权限检查:', this.permission)
            return this.permission && this.permission.order_log_recall === true
        },
        //驳回按钮权限
          hasRejectionBtnPermission() {
        hasRejectionBtnPermission () {
            // undefined 或 false 都返回 false,只有 true 返回 true
            console.log('权限检查:', this.permission);
            return this.permission && this.permission.rejection_btn === true;
            console.log('权限检查:', this.permission)
            return this.permission && this.permission.rejection_btn === true
        },
        //自己点发布
        userPublishPush(id) {
        userPublishPush (id) {
            this.$confirm('确定发布吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
            }).then(() => {
                let response = userPublish(id);
                this.$message.success('发布成功');
                this.fetchTableData();
                let response = userPublish(id)
                this.$message.success('发布成功')
                this.fetchTableData()
            })
        },
        //删除
        deleteOrderLog(id) {
        deleteOrderLog (id) {
            this.$confirm('确定删除吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning',
            }).then(() => {
                let response = deleteOrderLog(id);
                this.$message.success('删除');
                this.fetchTableData();
                let response = deleteOrderLog(id)
                this.$message.success('删除')
                this.fetchTableData()
            })
        },
        refreshChange() {
        refreshChange () {
            this.fetchTableData()
        },
        //获取航线列表
        async asyncgetWaylineFileListByArea(name) {
        async asyncgetWaylineFileListByArea (name) {
            var wayLineListResponse = await getWaylineFileListByArea(this.userInfo.detail.areaCode)
            this.wayLineList = wayLineListResponse.data.data
            this.initMapLine()
        },
        initMapLine() {
        initMapLine () {
            let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id)
            if (!currentLine) return
@@ -1080,7 +1082,7 @@
        //可飞行机巢列表
        async getFlyingNestBy(waylineId) {
        async getFlyingNestBy (waylineId) {
            this.initMapLine()
            //按照航线来
@@ -1093,7 +1095,7 @@
        },
        //撤回
        async orderLogRecall(id) {
        async orderLogRecall (id) {
            this.$confirm('确定撤回则到草稿箱。', '是否撤回?', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -1103,13 +1105,13 @@
                this.handleSearch()
            })
        },
        onLoad() {
        onLoad () {
            this.fetchTableData()
        },
        /**
         * 通过
         */
        async orderLogPass(id) {
        async orderLogPass (id) {
            let response = await orderLogPass(id)
            let data = response.data.data
            this.$message.success('审核通过')
@@ -1118,14 +1120,14 @@
        /**
         * 驳回
         */
        async orderLogReject(id) {
        async orderLogReject (id) {
            this.$prompt('', '驳回原因', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
            }).then(async ({ value }) => {
                let response = await orderLogReject(id, value)
                let data = response.data.data
                this.$message.success('驳回成功')
                this.$message.success('驳回成果')
                this.detailVisibleCopy = false
            })
        },
@@ -1133,7 +1135,7 @@
    watch: {
        tableData: {
            handler() {
            handler () {
                // this.updateTabCounts()
            },
            deep: true,
@@ -1141,22 +1143,36 @@
    },
}
</script>
<style></style>
<style lang="scss" scoped>
:deep(.el-textarea__inner) {
    padding: 8px 12px;
}
:deep(.el-input__inner),
:deep(.el-select),
:deep(.el-select .el-input) {
    width: 100%; // 确保所有输入框和选择框宽度一致
}
.tab-content {
    padding: 10px;
}
.filter-bar {
    display: flex;
    align-items: center;
    // align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    .filter-item {
        margin-right: 10px;
        margin-right: 20px;
        margin-bottom: 10px;
        width: 200px;
    }
    .frequency {
        margin-left: 20px;
    }
    .date-picker {
@@ -1264,13 +1280,58 @@
    color: #666;
    line-height: 1.5;
}
.event-title-center {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 12px;
  color: #333;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
}
.cur-menu {
    .menu-custom-box {
        display: flex;
        justify-content: center;
        &>div {
            flex: 1;
        }
        .audit-btn {
            color: #1BA0FF;
        }
        .withdraw-btn {
            color: #FF5D9E;
        }
        .reject-reason-btn {
            color: #FF6A00;
        }
        .edit-btn {
            color: #00B187;
        }
        .publish-btn {
            color: #5E00FF;
        }
        .delete-btn {
            color: #FE0202;
        }
        .detail-btn {
            color: #1F4AFF;
        }
    }
}
.add-box-btns {
    width: 100%;
    display: flex;
    justify-content: center;
}
</style>
```
`