| | |
| | | <template #menu="{ row }"> |
| | | <div v-if="row.status == 1 && userInfo.user_id != row.create_user"> |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">审核</el-button> |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> |
| | | </div> |
| | | |
| | | <div v-if="userInfo.user_id == row.create_user"> |
| | | <!--待审核状态--> |
| | | <div v-if="row.status == 1"> |
| | | <el-button type="text" icon="el-icon-view" |
| | | <el-button type="text" icon="el-icon-warning-outline" |
| | | @click="orderLogRecall(row.id)">撤回</el-button> |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> |
| | | </div> |
| | | <!--已驳回--> |
| | | <div v-if="row.status == 2"> |
| | | <el-button type="text" icon="el-icon-view" |
| | | <el-button type="text" icon="el-icon-warning-outline" |
| | | @click="rejectDetail(row.id)">驳回原因</el-button> |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> |
| | | </div> |
| | | <el-button type="text" icon="el-icon-view" @click="handleViewDetail(row)">详情</el-button> |
| | | <!--草稿--> |
| | | <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> |
| | | </template> |
| | | <template #status="{ row }"> |
| | |
| | | |
| | | <!-- 新建工单对话框 --> |
| | | <el-dialog v-model="dialogVisible" title="新建工单" width="70%" :close-on-click-modal="false" @close="resetForm"> |
| | | <el-form :model="form" :rules="rules" ref="form" label-width="100px"> |
| | | <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-button type="danger" |
| | | v-if="form.status == 0 || (form.status == 2 && userInfo.user_id == form.create_user)" |
| | | @click="submitForm(1)">发布</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 && userInfo.user_id != form.create_user" |
| | | @click="orderLogPass(form.id)">通过</el-button> |
| | | <el-button type="danger" v-if="form.status == 1 && userInfo.user_id != form.create_user" |
| | |
| | | orderLogReject, |
| | | orderLogPass, |
| | | orderLogExport, |
| | | jobStatusNum, |
| | | userPublish, |
| | | deleteOrderLog |
| | | } from '@/api/tickets/orderLog' |
| | | import { getTicketInfo } from '@/api/tickets/ticket' |
| | | import { getDictionary } from '@/api/system/dictbiz' |
| | |
| | | |
| | | tabs: [ |
| | | { label: '全部工单', name: 'all', value: null, count: 0 }, |
| | | { label: '待审核', name: 'pending', value: 1, count: 0 }, |
| | | { label: '已驳回', name: 'processing', value: 2, count: 0 }, |
| | | { label: '已通过', name: 'inProgress', value: 3, count: 0 }, |
| | | { label: '草稿', name: 'completed', value: 0, count: 0 }, |
| | | { label: '待审核', name: 'WAIT_AUDIT', value: 1, count: 0 }, |
| | | { label: '已驳回', name: 'REJECTED', value: 2, count: 0 }, |
| | | { label: '已通过', name: 'PASS', value: 3, count: 0 }, |
| | | { label: '草稿', name: 'DRAFT', value: 0, count: 0 }, |
| | | ], |
| | | filters: { |
| | | key_word: '', |
| | |
| | | return item |
| | | }) |
| | | |
| | | if (this.activeTab === 'all') { |
| | | this.updateGlobalCounts(records, total) |
| | | } |
| | | |
| | | |
| | | this.page.total = total || 0 |
| | | this.updateTabCounts() |
| | | this.updateGlobalCounts() |
| | | } catch (error) { |
| | | console.error('获取数据失败:', error) |
| | | this.$message.error(error.message || '获取数据失败') |
| | |
| | | this.page.pageSize = pageSize |
| | | }, |
| | | async submitForm (status) { |
| | | this.$refs.form.validate(async valid => { |
| | | console.log(this.$refs.testform, '111111') |
| | | this.$refs.testform.validate(async valid => { |
| | | |
| | | if (valid) { |
| | | let dateRange = this.form.date_range |
| | | console.log('dateRange' + dateRange) |
| | |
| | | this.page.currentPage = currentPage |
| | | }, |
| | | |
| | | updateGlobalCounts (records, total) { |
| | | async updateGlobalCounts () { |
| | | const counts = { |
| | | all: total, |
| | | pending: 0, |
| | | processing: 0, |
| | | inProgress: 0, |
| | | completed: 0, |
| | | closed: 0, |
| | | myTickets: 0, |
| | | all: 0, |
| | | DRAFT: 0, |
| | | WAIT_AUDIT: 0, |
| | | REJECTED: 0, |
| | | PASS: 0, |
| | | |
| | | } |
| | | |
| | | records.forEach(item => { |
| | | const tab = this.tabs.find(t => t.value === Number(item.status)) |
| | | 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); |
| | | if (tab) { |
| | | counts[tab.name] = (counts[tab.name] || 0) + 1 |
| | | tab.count=item.num; |
| | | } |
| | | }) |
| | | }); |
| | | |
| | | this.globalCounts = counts |
| | | }, |
| | | |
| | | updateTabCounts () { |
| | | if (this.activeTab === 'all') { |
| | | this.tabs.forEach(tab => { |
| | | tab.count = this.globalCounts[tab.name] || 0 |
| | | }) |
| | | } else { |
| | | this.tabs.forEach(tab => { |
| | | if (tab.name === this.activeTab) { |
| | | tab.count = this.tableData.length |
| | | } else { |
| | | tab.count = this.globalCounts[tab.name] || 0 |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | |
| | | handleAdd () { |
| | | this.form = {} |
| | |
| | | content: '', |
| | | photos: [], |
| | | } |
| | | if (this.$refs.form) { |
| | | this.$refs.form.resetFields() |
| | | if (this.$refs.testform) { |
| | | this.$refs.testform.resetFields() |
| | | } |
| | | }, |
| | | |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | //自己点发布 |
| | | userPublishPush (id) { |
| | | this.$confirm('确定发布吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | let response= userPublish(id); |
| | | this.$message.success('发布成功'); |
| | | this.fetchTableData(); |
| | | |
| | | }) |
| | | }, |
| | | |
| | | //删除 |
| | | deleteOrderLog(id){ |
| | | this.$confirm('确定删除吗?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | }).then(() => { |
| | | let response= deleteOrderLog(id); |
| | | this.$message.success('删除'); |
| | | this.fetchTableData(); |
| | | |
| | | }) |
| | | }, |
| | | refreshChange () { |
| | | this.fetchTableData() |
| | | }, |
| | |
| | | watch: { |
| | | tableData: { |
| | | handler () { |
| | | this.updateTabCounts() |
| | | // this.updateTabCounts() |
| | | }, |
| | | deep: true, |
| | | }, |