无人机管理后台前端(已迁走)
shuishen
2025-04-28 0cc06dc3332df46a3e60398138f5188cc2fb966b
智飞工单显示样式调整
1 files modified
132 ■■■■■ changed files
src/views/tickets/orderLog.vue 132 ●●●●● patch | view | raw | blame | history
src/views/tickets/orderLog.vue
@@ -76,32 +76,32 @@
                        <template #menu="{ row }">
                            <div class="menu-custom-box">
                                <div v-if="row.status == 1">
                                    <el-button v-if="hasPaddingBtnPermission()" type="text" icon="el-icon-view"
                                        @click="handleViewDetail(row)">审核</el-button>
                                    <el-button class="audit-btn" v-if="hasPaddingBtnPermission()" type="text"
                                        icon="el-icon-view" @click="handleViewDetail(row)">审核</el-button>
                                </div>
                                <div
                                    v-if="(userInfo.user_id == row.create_user || hasRecallPaddingBtnPermission()) && row.status == 1">
                                    <!--待审核状态-->
                                    <el-button type="text" icon="el-icon-warning"
                                    <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 type="text" icon="el-icon-warning"
                                    <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 type="text" icon="el-icon-edit-outline"
                                    <el-button class="edit-btn" type="text" icon="el-icon-edit-outline"
                                        @click="handleViewDetail(row)">编辑</el-button>
                                    <el-button type="text" icon="el-icon-position"
                                    <el-button class="publish-btn" type="text" icon="el-icon-position"
                                        @click="userPublishPush(row.id)">发布</el-button>
                                    <el-button type="text" icon="el-icon-delete"
                                    <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 type="text" icon="el-icon-view"
                                    <el-button class="detail-btn" type="text" icon="el-icon-view"
                                        @click="handleViewDetail(row)">详情</el-button>
                                </div>
                            </div>
@@ -360,7 +360,7 @@
export default {
    name: 'TicketPage',
    data () {
    data() {
        return {
            activeTab: 'all',
@@ -434,7 +434,7 @@
                    {
                        label: '工单周期频次',
                        prop: '',
                        width: 140,
                        width: 110,
                        formatter: row => this.formatCycleTime(row),
                        html: true,
                        ellipsis: true,
@@ -473,7 +473,7 @@
            mapLoaded: false,
        }
    },
    async created () {
    async created() {
        var response = await getDictionaryByCode('SF')
        var word_order_typeResponse = await getDictionaryByCode('WORK_ORDER_TYPE')
        this.ai_types = response.data.data['SF']
@@ -487,12 +487,12 @@
            value: item.id,
        }))
    },
    mounted () {
    mounted() {
        this.fetchTableData()
    },
    computed: {
        ...mapGetters(['userInfo', 'permission']),
        filteredTabs () {
        filteredTabs() {
            // rejection_and_draft 权限控制“已驳回”和“草稿”tab
            const canShowRejectAndDraft = this.permission?.rejection_and_draft === true
            return this.tabs.map(tab => {
@@ -508,7 +508,7 @@
    },
    methods: {
        searchChange (params, done) {
        searchChange(params, done) {
            console.log('searchChange')
            this.query = params
            this.parentId = ''
@@ -516,7 +516,7 @@
            this.onLoad(this.page, params)
            done()
        },
        async onLoad (page, params = {}) {
        async onLoad(page, params = {}) {
            this.loading = true
            getList(
                null,
@@ -531,11 +531,11 @@
        },
        selectionClear () {
        selectionClear() {
            this.selectionList = []
            this.$refs.crud.toggleSelection()
        },
        async loadAMapScripts () {
        async loadAMapScripts() {
            try {
                // await loadAMap();
                // await loadAMapUI();
@@ -545,12 +545,11 @@
                this.$message.error('地图加载失败,请检查网络或API Key配置')
            }
        },
        formatCycleTime (row) {
            return `${row.begin_time} ~ <br/>
            ${row.end_time} ${row.rep_rule_val}`
        formatCycleTime(row) {
            return `${row.cycle_time_value}`
        },
        async fetchTableData () {
        async fetchTableData() {
            this.loading = true
            try {
                let params = this.getQueryParam()
@@ -579,7 +578,7 @@
            }
        },
        getQueryParam () {
        getQueryParam() {
            const currentTab = this.tabs.find(tab => tab.name === this.activeTab)
            if (this.filters.dateRange) {
                console.log(
@@ -618,10 +617,10 @@
            }
            return params
        },
        sizeChange (pageSize) {
        sizeChange(pageSize) {
            this.page.pageSize = pageSize
        },
        async submitForm (status) {
        async submitForm(status) {
            this.$refs.testform.validate(async valid => {
@@ -651,7 +650,7 @@
            })
        },
        //驳回原因显示
        async rejectDetail (id) {
        async rejectDetail(id) {
            const response = await orderLogDetails(id)
            let data = response.data.data
            this.$confirm(data.remark, '驳回原因', {
@@ -665,7 +664,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(
@@ -673,7 +672,7 @@
            ).padStart(2, '0')} 00:00:00`
        },
        mapStatus (status) {
        mapStatus(status) {
            const statusTextMap = {
                0: '草稿',
                1: '待审核',
@@ -683,7 +682,7 @@
            return statusTextMap[status] || '未知状态'
        },
        getStatusTagType (status) {
        getStatusTagType(status) {
            const statusMap = {
                1: 'warning',
                2: 'info',
@@ -694,19 +693,19 @@
            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: '',
@@ -718,11 +717,11 @@
            this.fetchTableData()
        },
        currentChange (currentPage) {
        currentChange(currentPage) {
            this.page.currentPage = currentPage
        },
        async updateGlobalCounts () {
        async updateGlobalCounts() {
            const counts = {
                all: 0,
                DRAFT: 0,
@@ -743,14 +742,14 @@
        },
        handleAdd () {
        handleAdd() {
            this.form = {}
            this.dialogVisible = true
            //航线列表
            this.asyncgetWaylineFileListByArea()
        },
        resetForm () {
        resetForm() {
            this.form = {
                name: '',
                type: '',
@@ -766,13 +765,13 @@
            }
        },
        formatLocation (location) {
        formatLocation(location) {
            if (!Array.isArray(location)) {
                return '未知位置'
            }
            return `${location[0].toFixed(6)}, ${location[1].toFixed(6)}`
        },
        async handleViewDetail (row) {
        async handleViewDetail(row) {
            console.log("工单名称1111:")
            const response = await orderLogDetails(row.id)
            const data = response.data.data
@@ -790,7 +789,7 @@
            console.log("工单名称:" + this.detailTitle)
        },
        //导出
        async exportData () {
        async exportData() {
            this.$confirm('是否智飞工单数据?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -804,29 +803,29 @@
                })
            })
        },
        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
        },
        hasPaddingBtnPermission () {
        hasPaddingBtnPermission() {
            // undefined 或 false 都返回 false,只有 true 返回 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
        },
        //驳回按钮权限
        hasRejectionBtnPermission () {
        hasRejectionBtnPermission() {
            // undefined 或 false 都返回 false,只有 true 返回 true
            console.log('权限检查:', this.permission)
            return this.permission && this.permission.rejection_btn === true
        },
        //自己点发布
        userPublishPush (id) {
        userPublishPush(id) {
            this.$confirm('确定发布吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -840,7 +839,7 @@
        },
        //删除
        deleteOrderLog (id) {
        deleteOrderLog(id) {
            this.$confirm('确定删除吗?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -852,18 +851,18 @@
            })
        },
        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
@@ -905,7 +904,7 @@
        //可飞行机巢列表
        async getFlyingNestBy (waylineId) {
        async getFlyingNestBy(waylineId) {
            this.initMapLine()
            //按照航线来
@@ -918,7 +917,7 @@
        },
        //撤回
        async orderLogRecall (id) {
        async orderLogRecall(id) {
            this.$confirm('确定撤回则到草稿箱。', '是否撤回?', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -928,13 +927,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('审核通过')
@@ -943,7 +942,7 @@
        /**
         * 驳回
         */
        async orderLogReject (id) {
        async orderLogReject(id) {
            this.$prompt('', '驳回原因', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
@@ -958,7 +957,7 @@
    watch: {
        tableData: {
            handler () {
            handler() {
                // this.updateTabCounts()
            },
            deep: true,
@@ -1106,6 +1105,33 @@
        &>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;
       }
    }
}