| | |
| | | <!-- |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2025-04-15 20:02:29 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2025-04-28 11:38:16 |
| | | * @FilePath: \drone-web-manage\src\views\tickets\orderLog.vue |
| | | * @Description: |
| | | * |
| | | * Copyright (c) 2025 by shuishen, All Rights Reserved. |
| | | --> |
| | | <template> |
| | | <basic-container> |
| | | <el-tabs v-model="activeTab" @tab-click="handleTabChange"> |
| | |
| | | :label="`${tab.label} (${tab.count})`" |
| | | :name="tab.name" |
| | | > |
| | | <div class="tab-content"> |
| | | <basic-main-content> |
| | | <!-- 查询条件筛选栏 --> |
| | | <div class="filter-bar"> |
| | | <div class="search-bar-box"> |
| | |
| | | /> |
| | | </div> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable> |
| | | <el-option |
| | | v-for="dept in departments" |
| | | :key="dept.value" |
| | | :label="dept.label" |
| | | :value="dept.value" |
| | | /> |
| | | </el-select> |
| | | </div> |
| | | <!-- <div class="search-bar-box-item">--> |
| | | <!-- <el-select placeholder="请选择所属单位" v-model="filters.create_dept" clearable>--> |
| | | <!-- <el-option v-for="dept in departments" :key="dept.value" :label="dept.label" :value="dept.value" />--> |
| | | <!-- </el-select>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-date-picker |
| | | @change="handleSearch" |
| | | v-model="filters.dateRange" |
| | | type="daterange" |
| | | range-separator="至" |
| | |
| | | </div> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-select v-model="filters.file_id" placeholder="请选择关联航线" clearable> |
| | | <el-select |
| | | @change="handleSearch" |
| | | v-model="filters.file_id" |
| | | placeholder="请选择关联航线" |
| | | filterable |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in wayLineList" |
| | | :key="item.wayline_id" |
| | |
| | | </div> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-select v-model="filters.ai_types" placeholder="关联算法" clearable> |
| | | <el-select |
| | | @change="handleSearch" |
| | | v-model="filters.ai_types" |
| | | placeholder="关联算法" |
| | | clearable |
| | | > |
| | | <el-option |
| | | v-for="item in ai_types" |
| | | :key="item.dictKey" |
| | |
| | | </el-select> |
| | | </div> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <!-- <div class="search-bar-box-item"> |
| | | <el-select v-model="filters.type" placeholder="请选择工单类型" clearable> |
| | | <el-option |
| | | v-for="item in types" |
| | | :key="item.dictValue" |
| | | :label="item.dictValue" |
| | | :value="item.dictKey" |
| | | /> |
| | | <el-option v-for="item in types" :key="item.dictValue" :label="item.dictValue" |
| | | :value="item.dictKey" /> |
| | | </el-select> |
| | | </div> |
| | | </div> --> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-select v-model="filters.status" placeholder="请选择工单状态" clearable> |
| | | <el-select |
| | | @change="handleSearch" |
| | | v-model="filters.status" |
| | | placeholder="请选择工单状态" |
| | | clearable |
| | | :disabled="activeTab !== 'all'" |
| | | > |
| | | <el-option |
| | | v-for="item in statuses" |
| | | :key="item.value" |
| | |
| | | <div class="search-bar-box"> |
| | | <div class="search-bar-box-item flex-2"> |
| | | <el-date-picker |
| | | @change="handleSearch" |
| | | v-model="filters.cycleDateRange" |
| | | type="daterange" |
| | | range-separator="至" |
| | |
| | | </div> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-select v-model="filters.rep_fre_type" placeholder="请选择频次"> |
| | | <el-select |
| | | @change="handleSearch" |
| | | v-model="filters.rep_fre_type" |
| | | placeholder="请选择频次" |
| | | clearable |
| | | > |
| | | <el-option v-for="item in cycles" :key="item" :label="item" :value="item" /> |
| | | </el-select> |
| | | </div> |
| | | |
| | | <div class="search-bar-box-item"> |
| | | <el-time-picker |
| | | @change="handleSearch" |
| | | v-model="filters.deal_time" |
| | | placeholder="请选择执行时间" |
| | | prop="deal_time" |
| | |
| | | |
| | | <!-- 表格部分 --> |
| | | <avue-crud |
| | | class="ztzf-public-general-avue-crud" |
| | | :data="tableData" |
| | | :option="option" |
| | | v-model:page="page" |
| | |
| | | @on-load="onLoad" |
| | | @search-change="searchChange" |
| | | @size-change="sizeChange" |
| | | v-if="activeTab === tab.name" |
| | | > |
| | | <template #job_info_num="{ row }"> |
| | | <el-tooltip-copy :content="row.job_info_num" :showCopyText="true" textAlign="left"> |
| | | {{ row.job_info_num }} |
| | | </el-tooltip-copy> |
| | | </template> |
| | | |
| | | <template #name="{ row }"> |
| | | <el-tooltip-copy :content="row.name" :showCopyText="true" textAlign="left"> |
| | | {{ row.name }} |
| | | </el-tooltip-copy> |
| | | </template> |
| | | |
| | | <template #menu-left> |
| | | <el-button |
| | | v-if="hasAddBtnPermission() && activeTab != 'WAIT_AUDIT'" |
| | |
| | | >审核</el-button |
| | | > |
| | | </template> |
| | | <template |
| | | v-if=" |
| | | <!-- v-if=" |
| | | (userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) && |
| | | row.status == 1 |
| | | " |
| | | > |
| | | " --> |
| | | <template v-if="row.status == 1"> |
| | | <!--待审核状态--> |
| | | <el-button type="text" icon="el-icon-warning" @click="orderLogRecall(row.id)" |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-warning" |
| | | v-if="hasRecallPaddingBtnPermission()" |
| | | @click="orderLogRecall(row.id)" |
| | | >撤回</el-button |
| | | > |
| | | <!-- <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> --> |
| | | </template> |
| | | <!--已驳回--> |
| | | <template v-if="row.status == 2"> |
| | | <el-button type="text" icon="el-icon-warning" @click="rejectDetail(row.id)" |
| | | >驳回原因</el-button |
| | | > |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)" |
| | | <el-button |
| | | v-if="userInfo.user_id == row.create_user" |
| | | type="text" |
| | | icon="el-icon-view" |
| | | @click="handleViewDetail(row)" |
| | | >编辑</el-button |
| | | > |
| | | <el-button v-else type="text" icon="el-icon-view" @click="handleViewDetail(row)" |
| | | >详情</el-button |
| | | > |
| | | </template> |
| | |
| | | </el-tooltip> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | </basic-main-content> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联航线" prop="file_id"> |
| | | <el-select v-model="form.file_id" placeholder="请选择航线" @change="getFlyingNestBy"> |
| | | <el-select |
| | | v-model="form.file_id" |
| | | placeholder="请选择航线" |
| | | filterable |
| | | @change="getFlyingNestBy" |
| | | > |
| | | <el-option |
| | | v-for="item in wayLineList" |
| | | :key="item.wayline_id" |
| | |
| | | <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-select |
| | | v-model="form.device_sns" |
| | | placeholder="请选择机巢" |
| | | multiple |
| | | :disabled="!device_sns.length" |
| | | > |
| | | <el-option |
| | | v-for="item in device_sns" |
| | | :key="item.device_sn" |
| | |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :disabled-date="disabledDate" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <div class="add-box-btns"> |
| | | <el-button type="danger" @click="submitForm(1)">发起</el-button> |
| | | <el-button type="primary" @click="submitForm(0)">存草稿</el-button> |
| | | <el-button @click="dialogVisible = false">取消</el-button> |
| | | </div> |
| | | </el-row> |
| | | </el-form> |
| | |
| | | |
| | | <!-- 工单详情对话框 --> |
| | | <el-dialog |
| | | align-center |
| | | v-model="detailVisible" |
| | | :title="detailTitle" |
| | | width="70%" |
| | |
| | | @close="resetForm" |
| | | > |
| | | <div class="event-title-center">{{ form.name }}</div> |
| | | <el-form :model="form" ref="testform" label-width="100px"> |
| | | <el-form :model="form" :rules="rules" ref="testform" label-width="100px"> |
| | | <div class="custom-steps-container"> |
| | | <!-- 标题行 --> |
| | | <div class="steps-titles"> |
| | | <div class="steps-titles" v-if="filters.status !== '0'"> |
| | | <div |
| | | v-for="(record, index) in form.record_list" |
| | | :class="{ active: record.user_id >= 0 }" |
| | |
| | | </div> |
| | | |
| | | <!-- Element Steps 组件 --> |
| | | <el-steps :active="form.active" align-center class="custom-steps"> |
| | | <el-steps |
| | | :active="form.active" |
| | | align-center |
| | | class="custom-steps" |
| | | v-if="filters.status !== '0'" |
| | | > |
| | | <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%; |
| | | transform: translateY(-50%); |
| | | width: 100px; |
| | | margin-left: 4px; |
| | | color: #666; |
| | | font-size: 12px; |
| | | " |
| | | > |
| | | <span class="step-timer"> |
| | | {{ record.interval_time_str }} |
| | | </span> |
| | | <div class="step-description"> |
| | |
| | | <el-row :gutter="20"> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工单名称" prop="name"> |
| | | <el-input v-model="form.name" placeholder="请输入工单名称"></el-input> |
| | | <el-input |
| | | v-model="form.name" |
| | | placeholder="请输入工单名称" |
| | | :disabled="detailTitle === '工单详情'" |
| | | ></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="请选择航线" @change="getFlyingNestBy"> |
| | | <el-select |
| | | v-model="form.file_id" |
| | | placeholder="请选择航线" |
| | | @change="getFlyingNestBy" |
| | | filterable |
| | | :disabled="detailTitle === '工单详情'" |
| | | > |
| | | <el-option |
| | | v-for="item in wayLineList" |
| | | :key="item.wayline_id" |
| | |
| | | <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-select |
| | | v-model="form.device_sns" |
| | | placeholder="请选择机巢" |
| | | multiple |
| | | :disabled="detailTitle === '工单详情'" |
| | | > |
| | | <el-option |
| | | v-for="item in device_sns" |
| | | :key="item.device_sn" |
| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="关联算法" prop="ai_types"> |
| | | <el-select v-model="form.ai_types" placeholder="请选择关联算法" multiple> |
| | | <el-select |
| | | v-model="form.ai_types" |
| | | placeholder="请选择关联算法" |
| | | multiple |
| | | :disabled="detailTitle === '工单详情'" |
| | | > |
| | | <el-option |
| | | v-for="item in ai_types" |
| | | :key="item.dictKey" |
| | |
| | | range-separator="至" |
| | | start-placeholder="开始日期" |
| | | end-placeholder="结束日期" |
| | | :disabled-date="disabledDate" |
| | | :disabled="detailTitle === '工单详情'" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="3"> |
| | | <el-select v-model="form.rep_fre_type" placeholder="请选择频次"> |
| | | <el-select |
| | | v-model="form.rep_fre_type" |
| | | placeholder="请选择频次" |
| | | :disabled="detailTitle === '工单详情'" |
| | | > |
| | | <el-option v-for="item in cycles" :key="item" :label="item" :value="item" /> |
| | | </el-select> |
| | | </el-col> |
| | |
| | | :picker-options="{ |
| | | selectableRange: '00:00 - 23:59', |
| | | }" |
| | | :disabled="detailTitle === '工单详情'" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | |
| | | placeholder="请输入工单内容" |
| | | maxlength="255" |
| | | show-word-limit |
| | | :disabled="detailTitle === '工单详情'" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | @click="submitForm(1)" |
| | | >发布</el-button |
| | | > |
| | | <el-button |
| | | type="primary" |
| | | v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)" |
| | | @click="submitForm(0)" |
| | | >保存</el-button |
| | | > |
| | | <!-- <el-button type="primary" v-if="form.status == 0 || userInfo.user_id == form.create_user" |
| | | @click="submitForm(0)">保存</el-button> --> |
| | | |
| | | <el-button |
| | | type="primary" |
| | | v-if="form.status == 1 && this.permission.orderLogpass" |
| | | v-if="form.status == 1 && hasPaddingBtnPermission()" |
| | | @click="orderLogPass(form.id)" |
| | | >通过</el-button |
| | | > |
| | |
| | | |
| | | <!-- 工单详情 --> |
| | | <el-dialog |
| | | align-center |
| | | v-model="detailVisibleCopy" |
| | | title="工单详情" |
| | | width="70%" |
| | |
| | | <el-form :model="form" ref="testform" label-width="100px"> |
| | | <div class="custom-steps-container"> |
| | | <!-- 标题行 --> |
| | | <div class="steps-titles"> |
| | | <div class="steps-titles" v-if="filters.status !== '0'"> |
| | | <div |
| | | v-for="(record, index) in form.record_list" |
| | | :class="{ active: record.user_id >= 0 }" |
| | |
| | | </div> |
| | | |
| | | <!-- Element Steps 组件 --> |
| | | <el-steps :active="form.active" align-center class="custom-steps"> |
| | | <el-steps |
| | | :active="form.active" |
| | | align-center |
| | | class="custom-steps" |
| | | v-if="filters.status !== '0'" |
| | | > |
| | | <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%; |
| | | transform: translateY(-50%); |
| | | width: 100px; |
| | | margin-left: 4px; |
| | | color: #666; |
| | | font-size: 12px; |
| | | " |
| | | > |
| | | <span class="step-timer"> |
| | | {{ record.interval_time_str }} |
| | | </span> |
| | | <div class="step-description"> |
| | |
| | | |
| | | <el-button |
| | | type="primary" |
| | | v-if="form.status == 1 && this.permission.orderLogpass" |
| | | v-if="form.status == 1 && hasPaddingBtnPermission()" |
| | | @click="orderLogPass(form.id)" |
| | | >通过</el-button |
| | | > |
| | |
| | | import { downloadXls } from '@/utils/util'; |
| | | import 'nprogress/nprogress.css'; |
| | | import { analyzeKmzFile, removeTextKey, XMLToJSON } from '@/utils/cesium/kmz'; |
| | | import dayjs from 'dayjs'; |
| | | import 'dayjs/locale/zh-cn'; // 导入中文语言包 |
| | | import weekday from 'dayjs/plugin/weekday'; |
| | | import elTooltipCopy from '@/components/ElTooltipCopy.vue'; |
| | | |
| | | dayjs.extend(weekday); |
| | | dayjs.locale('zh-cn'); |
| | | |
| | | export default { |
| | | components: { elTooltipCopy }, |
| | | name: 'TicketPage', |
| | | data() { |
| | | return { |
| | |
| | | { label: '已通过', value: '3' }, |
| | | ], |
| | | //周期 |
| | | cycles: ['周一', '周二', '周三', '周四', '周五', '周六', '周末', '周天', '工作日', '每天'], |
| | | cycles: ['每天', '周一', '周二', '周三', '周四', '周五', '周六', '周末', '周天', '工作日'], |
| | | |
| | | tableData: [], |
| | | option: { |
| | |
| | | |
| | | align: 'center', |
| | | border: true, |
| | | stripe: true, |
| | | stripe: false, |
| | | searchShow: true, |
| | | searchBtnText: '搜索', |
| | | searchMenuSpan: 6, |
| | |
| | | menu: true, |
| | | menuWidth: 210, |
| | | menuClassName: 'cur-menu', |
| | | column: [ |
| | | { label: '工单编号', prop: 'job_info_num', width: 100, ellipsis: true, overHidden: true }, |
| | | { label: '工单名称', prop: 'name', width: 100, ellipsis: true, overHidden: true }, |
| | | { label: '工单状态', prop: 'status', width: 88 }, |
| | | { label: '所属单位', prop: 'dept_name', width: 100, ellipsis: true }, |
| | | { label: '发起时间', prop: 'create_time', width: 144, ellipsis: true }, |
| | | { label: '已执行次数', prop: 'job_num', width: 96, ellipsis: true }, |
| | | { label: '工单内容', prop: 'content', 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: 96, ellipsis: true, overHidden: true }, |
| | | { label: '关联机巢', prop: 'device_names', width: 112, ellipsis: true, overHidden: true }, |
| | | height: 'auto', |
| | | calcHeight: 196, |
| | | |
| | | column: [ |
| | | { |
| | | label: '工单编号', |
| | | prop: 'job_info_num', |
| | | width: 150, |
| | | }, |
| | | { |
| | | label: '工单名称', |
| | | prop: 'name', |
| | | width: 100, |
| | | ellipsis: true, |
| | | overHidden: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '工单状态', |
| | | prop: 'status', |
| | | width: 88, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '所属单位', |
| | | prop: 'dept_name', |
| | | ellipsis: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '创建时间', |
| | | prop: 'create_time', |
| | | width: 144, |
| | | ellipsis: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '已执行次数', |
| | | prop: 'job_num', |
| | | width: 70, |
| | | ellipsis: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '工单内容', |
| | | prop: 'content', |
| | | ellipsis: true, |
| | | overHidden: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '关联航线', |
| | | prop: 'wayline_name', |
| | | ellipsis: true, |
| | | overHidden: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '关联算法', |
| | | prop: 'ai_type_str', |
| | | width: 100, |
| | | ellipsis: true, |
| | | overHidden: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | { |
| | | label: '关联机巢', |
| | | prop: 'device_names', |
| | | width: 100, |
| | | ellipsis: true, |
| | | overHidden: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | |
| | | { |
| | | label: '创建人', |
| | | prop: 'creator_name', |
| | | width: 96, |
| | | ellipsis: true, |
| | | overHidden: true, |
| | | showOverflowTooltip: true, |
| | | }, |
| | | // { |
| | | // label: '关联机巢', prop: 'device_names', width: 112, ellipsis: true, overHidden: true, |
| | | // showOverflowTooltip: true, |
| | | // }, |
| | | { |
| | | label: '工单周期频次', |
| | | prop: '', |
| | |
| | | formatter: row => this.formatCycleTime(row), |
| | | html: true, |
| | | ellipsis: true, |
| | | showOverflowTooltip: true, |
| | | // overHidden: true |
| | | }, |
| | | ], |
| | |
| | | ], |
| | | file_id: [{ required: true, message: '需要选择航线', trigger: 'change' }], |
| | | device_sns: [{ required: true, message: '请选择机巢', trigger: 'change' }], |
| | | ai_types: [{ required: true, message: '请选择算法', trigger: 'change' }], |
| | | content: [ |
| | | { required: true, message: '请输入工单内容', trigger: 'blur' }, |
| | | { max: 255, message: '工单内容不能超过255个字', trigger: 'blur' }, |
| | |
| | | mounted() { |
| | | this.fetchTableData(); |
| | | const id = this.$route.query.id; |
| | | console.log('idddddd', id); |
| | | |
| | | if (id) { |
| | | // 确保 id 存在 |
| | | this.handleViewDetail({ id }); |
| | | const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/orderLog'); |
| | | find && (find.query = {}); |
| | | } else { |
| | | console.error('工单ID不存在!'); |
| | | } |
| | |
| | | ...mapGetters(['userInfo', 'permission']), |
| | | filteredTabs() { |
| | | // rejection_and_draft 权限控制“已驳回”和“草稿”tab |
| | | // console.log(this.permission, '权限信息') |
| | | // console.log(this.userInfo, '权限信息22') |
| | | const canShowRejectAndDraft = this.permission?.rejection_and_draft === true; |
| | | return this.tabs |
| | | .map(tab => { |
| | |
| | | }, |
| | | |
| | | methods: { |
| | | handleCellClick(row, column) { |
| | | if (column.no === 1) { |
| | | navigator.clipboard.writeText(row.job_info_num).then(() => { |
| | | this.$message.success('复制工单编号成功'); |
| | | }); |
| | | } else if (column.no === 2) { |
| | | navigator.clipboard.writeText(row.name).then(() => { |
| | | this.$message.success('复制工单名称成功'); |
| | | }); |
| | | } else if (column.no === 4) { |
| | | navigator.clipboard.writeText(row.dept_name).then(() => { |
| | | this.$message.success('复制所属单位成功'); |
| | | }); |
| | | } else if (column.no === 8) { |
| | | navigator.clipboard.writeText(row.wayline_name).then(() => { |
| | | this.$message.success('复制关联航线成功'); |
| | | }); |
| | | } else if (column.no === 9) { |
| | | navigator.clipboard.writeText(row.ai_type_str).then(() => { |
| | | this.$message.success('复制关联算法成功'); |
| | | }); |
| | | } |
| | | }, |
| | | disabledDate(time) { |
| | | return time.getTime() < Date.now() - 8.64e7; // 86400000 = 24 * 60 * 60 * 1000 |
| | | }, |
| | | searchChange(params, done) { |
| | | // console.log('searchChange') |
| | | this.query = params; |
| | |
| | | this.form.begin_time = this.formatDate(dateRange[0]); |
| | | this.form.end_time = this.formatDate(dateRange[1]); |
| | | |
| | | // 如果选中日期包含当前天,那么选中的时间点不能小于当前时间 |
| | | if (this.form.deal_time) { |
| | | const selectedDate = dayjs(this.form.date_range[0]).format('YYYY-MM-DD'); |
| | | const selectedTime = dayjs(selectedDate + ' ' + this.form.deal_time).toDate(); |
| | | const now = new Date(); |
| | | |
| | | if (selectedDate === dayjs().format('YYYY-MM-DD') && selectedTime < now) { |
| | | return this.$message.warning('任务时间不能小于当前时间'); |
| | | } |
| | | } |
| | | |
| | | const submitData = { |
| | | ...this.form, |
| | | |
| | | status: status, |
| | | ai_types: this.form.ai_types?.length ? this.form.ai_types : [], |
| | | }; |
| | | // 判断该值this.form.date_range[0] 周几 和rep_fre_type 是不是相等 |
| | | // if (this.form.deal_time) { |
| | | // const weekday = dayjs(this.form.date_range[0]).format('dddd'); |
| | | // console.log('444', weekday) |
| | | // // form.rep_fre_type |
| | | // const now = new Date() |
| | | // const today = now.toDateString() |
| | | // const selectedDate = new Date(this.form.date_range[0]).toDateString() |
| | | |
| | | // if (today === selectedDate) { |
| | | // const [hours, minutes] = this.form.deal_time.split(':') |
| | | // const selectedTime = new Date() |
| | | // selectedTime.setHours(parseInt(hours), parseInt(minutes)) |
| | | |
| | | // if (selectedTime < now) { |
| | | // return this.$message.warning('任务时间不能小于当前时间') |
| | | |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | await saveUpdateOrderLog(submitData); |
| | | let id = this.form.id; |
| | | if (id) { |
| | |
| | | this.form = { |
| | | ...response.data.data, |
| | | }; |
| | | this.detailVisible = true; |
| | | // this.detailVisible = true |
| | | this.handleViewDetail(data); |
| | | }); |
| | | }, |
| | | formatDate(date) { |
| | |
| | | handleTabChange(tab) { |
| | | this.activeTab = tab.props?.name || tab.name; |
| | | this.filters.status = ''; |
| | | if (tab.props?.name === 'WAIT_AUDIT') { |
| | | this.filters.status = '1'; |
| | | } else if (tab.props?.name === 'REJECTED') { |
| | | this.filters.status = '2'; |
| | | } else if (tab.props?.name === 'PASS') { |
| | | this.filters.status = '3'; |
| | | } else if (tab.props?.name === 'DRAFT') { |
| | | this.filters.status = '0'; |
| | | } |
| | | this.page.currentPage = 1; |
| | | this.fetchTableData(); |
| | | }, |
| | |
| | | handleAdd() { |
| | | this.form = {}; |
| | | this.dialogVisible = true; |
| | | |
| | | this.$nextTick(() => { |
| | | if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) { |
| | | this.$refs.MapContainer.initAddEntity('initPosition'); |
| | | } |
| | | }); |
| | | |
| | | //航线列表 |
| | | this.asyncgetWaylineFileListByArea(); |
| | | }, |
| | |
| | | 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) |
| | | (data.status == 1 || |
| | | data.status == 3 || |
| | | (data.status == 2 && this.userInfo.user_id !== this.form.create_user)) |
| | | ? (this.detailTitle = '工单详情') |
| | | : (this.detailTitle = '编辑工单'); |
| | | |
| | | this.detailVisible = true; |
| | | // 更新航线列表,追加 wayline_file_region_vo 数据 |
| | | if (data.wayline_file_region_vo) { |
| | | const newWayline = data.wayline_file_region_vo; |
| | | |
| | | // 检查是否已经存在于 this.wayLineList 中 |
| | | const isDuplicate = this.wayLineList.some( |
| | | item => item.wayline_id === newWayline.wayline_id |
| | | ); |
| | | |
| | | if (!isDuplicate) { |
| | | this.wayLineList.push(newWayline); |
| | | } |
| | | } |
| | | |
| | | this.initMapLine(data.device_map_infos); |
| | | const find = this.$store.state.tags.bsTagList.find(i => i.path === '/tickets/orderLog'); |
| | | find && (find.query = {}); |
| | | }, |
| | | async handleCheckDetail(row) { |
| | | const response = await orderLogDetails(row.id); |
| | |
| | | this.form = { |
| | | ...data, |
| | | }; |
| | | // 更新航线列表,追加 wayline_file_region_vo 数据 |
| | | // 更新航线列表,追加 wayline_file_region_vo 数据 |
| | | if (data.wayline_file_region_vo) { |
| | | const newWayline = data.wayline_file_region_vo; |
| | | |
| | | // 检查是否已经存在于 this.wayLineList 中 |
| | | const isDuplicate = this.wayLineList.some( |
| | | item => item.wayline_id === newWayline.wayline_id |
| | | ); |
| | | |
| | | if (!isDuplicate) { |
| | | this.wayLineList.push(newWayline); |
| | | } |
| | | } |
| | | // 更新机巢列表 |
| | | this.device_sns = data.device_list; |
| | | this.detailVisibleCopy = true; |
| | |
| | | this.initMapLine(); |
| | | }, |
| | | |
| | | initMapLine(infos = {}) { |
| | | initMapLine(infos = {}, cb = () => {}) { |
| | | let currentLine = this.wayLineList.find(item => item.wayline_id == this.form.file_id); |
| | | |
| | | if (!currentLine) return; |
| | | |
| | | // 异步解析kmz文件 |
| | | const analysis = async url => { |
| | | return new Promise(async resolve => { |
| | | const res = await analyzeKmzFile(`${url}?_t=${new Date().getTime()}`); |
| | | const templateXML = await res.fileInfoObj['wpmz/template.kml']; |
| | | const templateXMLJSON = XMLToJSON(templateXML)?.['Document']; |
| | | const templateXMLObj = removeTextKey(templateXMLJSON.Folder); |
| | | resolve(templateXMLObj); |
| | | }); |
| | | }; |
| | | |
| | | const drawLine = async () => { |
| | | let prexUrl = ref(import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key); |
| | | const res = await analysis(prexUrl.value); |
| | | if (!res.Placemark.length) return; |
| | | renderingLine(res); |
| | | }; |
| | | |
| | | const renderingLine = lineObj => { |
| | | const positions = lineObj.Placemark.map(item => { |
| | | return item.Point.coordinates.split(','); |
| | | }); |
| | | |
| | | if (JSON.stringify(infos) != '{}') |
| | | positions.unshift([infos[0].longitude, infos[0].latitude]); |
| | | |
| | | this.$nextTick(() => { |
| | | if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) { |
| | | this.$refs.MapContainer.initAddEntity('polyline', positions); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | | drawLine(); |
| | | this.$nextTick(() => { |
| | | if (this.$refs.MapContainer && this.$refs.MapContainer.initAddEntity) { |
| | | this.$refs.MapContainer.initAddEntity('polyline', { |
| | | url: `${ |
| | | import.meta.env.VITE_APP_AIRLINE_URL + currentLine.object_key |
| | | }?_t=${new Date().getTime()}`, |
| | | type: currentLine.wayline_type, |
| | | cb, |
| | | infos, |
| | | }); |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | //可飞行机巢列表 |
| | | async getFlyingNestBy(waylineId) { |
| | | this.initMapLine(); |
| | | const that = this; |
| | | |
| | | //按照航线来 |
| | | const params = { |
| | | type: 0, |
| | | wayline_id: waylineId, |
| | | }; |
| | | var wayLineListResponse = await getFlyingNestBy(params); |
| | | this.device_sns = wayLineListResponse.data.data; |
| | | // 先清空 |
| | | that.form.device_sns = []; |
| | | that.device_sns = []; |
| | | |
| | | this.initMapLine({}, async polygon => { |
| | | const currentLine = that.wayLineList.find(item => item.wayline_id === waylineId); |
| | | |
| | | //按照航线来 |
| | | const params = { |
| | | type: [2, 4, 5].includes(currentLine.wayline_type) ? 2 : 0, |
| | | wayline_id: waylineId, |
| | | polygon, |
| | | }; |
| | | var wayLineListResponse = await getFlyingNestBy(params); |
| | | // 再赋值 |
| | | that.device_sns = wayLineListResponse.data.data; |
| | | }); |
| | | }, |
| | | |
| | | //撤回 |
| | |
| | | let data = response.data.data; |
| | | this.$message.success('审核通过'); |
| | | this.detailVisibleCopy = false; |
| | | |
| | | this.detailVisible = false; |
| | | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, this.query); |
| | | // this.handleViewDetail() |
| | | }, |
| | | /** |
| | | * 驳回 |
| | |
| | | }).then(async ({ value }) => { |
| | | let response = await orderLogReject(id, value); |
| | | let data = response.data.data; |
| | | this.$message.success('驳回成果'); |
| | | this.$message.success('驳回成功'); |
| | | this.detailVisibleCopy = false; |
| | | |
| | | // this.detailVisible = false |
| | | |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, this.query); |
| | | }); |
| | | }, |
| | | }, |
| | |
| | | }, |
| | | }; |
| | | </script> |
| | | <style></style> |
| | | |
| | | <style lang="scss" scoped> |
| | | :deep(.el-textarea__inner) { |
| | | padding: 8px 12px; |
| | | } |
| | | ::v-deep(.el-tabs) { |
| | | height: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | :deep(.el-input__inner), |
| | | :deep(.el-select), |
| | | :deep(.el-select .el-input) { |
| | | width: 100%; // 确保所有输入框和选择框宽度一致 |
| | | } |
| | | .el-tabs__header { |
| | | order: 1; |
| | | } |
| | | |
| | | .tab-content { |
| | | padding: 10px; |
| | | .el-tabs__content { |
| | | order: 2; |
| | | } |
| | | |
| | | .el-tabs__content { |
| | | height: 0; |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | |
| | | .el-tab-pane { |
| | | height: 0; |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .filter-bar { |
| | |
| | | } |
| | | } |
| | | |
| | | :deep(.el-pagination .el-select) { |
| | | width: 128px !important; |
| | | } |
| | | |
| | | .step-timer { |
| | | position: absolute; |
| | | left: 80%; |
| | | top: 50%; |
| | | transform: translateY(-50%); |
| | | width: 100px; |
| | | margin-left: 4px; |
| | | color: #666; |
| | | font-size: 12px; |
| | | } |
| | | |
| | | :deep(.el-textarea__inner) { |
| | | padding: 8px 12px; |
| | | } |
| | | |
| | | :deep(.el-input__inner), |
| | | :deep(.el-select), |
| | | :deep(.el-select .el-input) { |
| | | width: 100%; // 确保所有输入框和选择框宽度一致 |
| | | } |
| | | |
| | | :deep(.el-textarea__inner) { |
| | | resize: none; |
| | | } |
| | | |
| | | .action-bar { |
| | | margin-bottom: 16px; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | .tab-content { |
| | | min-height: 200px; |
| | | } |
| | | |
| | | .detail-form { |
| | | :deep(.el-form-item) { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | :deep(.el-form-item__label) { |
| | | color: #606266; |
| | | font-weight: normal; |
| | | } |
| | | |
| | | :deep(.el-form-item__content) { |
| | | color: #303133; |
| | | } |
| | | } |
| | | |
| | | .el-dialog { |
| | | .el-form-item { |
| | | margin-bottom: 20px; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | & > ::v-deep(.el-button) { |
| | | flex: 1; |
| | | max-width: 44px; |
| | | |
| | | &:nth-child(4n) { |
| | | margin-left: 0; |
| | | } |
| | | margin-left: 0; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |