| | |
| | | </div> |
| | | |
| | | <template #footer> |
| | | <el-button color="#F2F3F5" @click="requester = !requester"> |
| | | 当前用户是{{ requester ? '需求方' : '服务方' }} |
| | | </el-button> |
| | | <el-button color="#F2F3F5" @click="requester = !requester">我是{{ requester ? '需求方' : '服务方' }}</el-button> |
| | | <el-button color="#F2F3F5" @click="visible = false">{{ dialogReadonly ? '关闭' : '取消' }}</el-button> |
| | | <el-button |
| | | class="save-btn" |
| | | color="#4C34FF" |
| | | v-if="!dialogReadonly" |
| | | v-if="!dialogReadonly && !formData.id" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | |
| | | 发布 |
| | | </el-button> |
| | | <template v-if="requester"> |
| | | <el-button color="#F2F3F5">拒单原因</el-button> |
| | | <el-button color="#F2F3F5">重新发布</el-button> |
| | | <template v-if="editStatus.includes(gdStatus)"> |
| | | <el-button |
| | | color="#4C34FF" |
| | | class="save-btn" |
| | | :loading="submitting" |
| | | :disabled="submitting" |
| | | @click="handleSubmit" |
| | | > |
| | | 重新发布 |
| | | </el-button> |
| | | </template> |
| | | <template v-if="gdStatus === '11'"> |
| | | <el-button color="#F2F3F5">拒单原因</el-button> |
| | | </template> |
| | | <template v-else-if="gdStatus === '20'"> |
| | | <el-button color="#F2F3F5" @click="statusChange(3)">申请取消</el-button> |
| | | <el-button color="#4C34FF" @click="statusChange(4)" class="save-btn">申请修改</el-button> |
| | | </template> |
| | | </template> |
| | | <template v-else> |
| | | <el-button color="#F2F3F5">拒绝接单</el-button> |
| | | <el-button class="save-btn" color="#4C34FF" @click="acceptOrders">接单</el-button> |
| | | <template v-if="gdStatus === '10'"> |
| | | <el-button color="#F2F3F5" @click="rejectOrders">拒绝接单</el-button> |
| | | <el-button color="#4C34FF" @click="statusChange(1)" class="save-btn">接单</el-button> |
| | | </template> |
| | | <template v-else-if="gdStatus === '22'"> |
| | | <el-button color="#F2F3F5" @click="statusChange(7)">同意修改</el-button> |
| | | <el-button color="#4C34FF" @click="statusChange(8)" class="save-btn">不同意修改</el-button> |
| | | </template> |
| | | <template v-else-if="gdStatus === '21'"> |
| | | <el-button color="#F2F3F5" @click="statusChange(5)">同意取消</el-button> |
| | | <el-button color="#4C34FF" @click="statusChange(6)" class="save-btn">不同意取消</el-button> |
| | | </template> |
| | | </template> |
| | | </template> |
| | | |
| | | <RefuseOrderDialog |
| | | ref="refuseOrderDialogRef" |
| | | v-if="rejectVisible" |
| | | v-model="rejectVisible" |
| | | @success="rejectSuccess" |
| | | /> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | |
| | | import { ElMessage } from 'element-plus' |
| | | import { dateRangeFormat, fieldRules, geomAnalysis, getDictLabel } from '@ztzf/utils' |
| | | import { gdWorkOrderDetailApi, gdWorkOrderHandleStatusApi, gdWorkOrderSaveApi } from './orderManageApi' |
| | | import { gdManageDeviceListApi, gdManageDevicePageApi } from './gdManageDeviceApi' |
| | | import { gdManageDeviceListApi } from './gdManageDeviceApi' |
| | | import { cartesian3Convert } from '@/utils/cesium/mapUtil' |
| | | import * as turf from '@turf/turf' |
| | | import * as Cesium from 'cesium' |
| | | import { DrawPolygon } from '@/utils/cesium/DrawPolygon' |
| | | import { PublicCesium } from '@/utils/cesium/publicCesium' |
| | | import { pxToRem } from '@/utils/rem' |
| | | import dayjs from 'dayjs' |
| | | import RefuseOrderDialog from '@/views/orderView/orderManage/orderManage/RefuseOrderDialog.vue' |
| | | |
| | | // 初始化表单数据 |
| | | const initForm = () => ({ |
| | |
| | | recommendDeviceIds: '', |
| | | }) |
| | | |
| | | const rejectVisible = ref(false) |
| | | const dictObj = inject('dictObj') |
| | | const dateRange = ref([]) |
| | | const emit = defineEmits(['success']) |
| | |
| | | const submitting = ref(false) // 提交中 |
| | | const dialogReadonly = computed(() => dialogMode.value === 'view') |
| | | const titleEnum = ref({ edit: '编辑', view: '查看', add: '新增' }) |
| | | const requester = ref(true) |
| | | |
| | | const deviceList = ref([]) // 设备列表 |
| | | const selectedDevices = ref([]) // 选中的设备 |
| | | const deviceTableRef = ref(null) // 设备表格实例 |
| | | const refuseOrderDialogRef = ref(null) |
| | | let viewer |
| | | let drawPolygonExample |
| | | let pointList = [] |
| | | const requester = inject('requester') |
| | | const editStatus = inject('editStatus') |
| | | |
| | | // 工单状态:0草稿、10发布中_接单中、11发布中_拒绝接单、20响应中_待拆分、21响应中_申请取消、22响应中_申请修改、23响应中_已取消、 |
| | | // 24响应中_拒绝取消、25响应中_拒绝修改 30执行中_待全部完成、31执行中_协商修改、40完成待验_待全部验收、50验收通过_待结算、60结算完成_已结算 |
| | | const gdStatus = computed(() => formData.value?.workOrderStatus) |
| | | |
| | | const rules = { |
| | | workOrderName: fieldRules(true, 50), |
| | |
| | | executeStartTime: fieldRules(true), |
| | | deviceLoadDemand: fieldRules(true), |
| | | } |
| | | |
| | | function acceptOrders() { |
| | | gdWorkOrderHandleStatusApi({ operationType: 1, workOrderId: formData.value.id }).then(res => { |
| | | ElMessage.success('接单成功') |
| | | // 操作类型:1接单,2拒接接单,3申请取消,4申请修改, 5同意取消 6不同意取消 7.同意修改 7.不同意修改 |
| | | function statusChange(operationType) { |
| | | gdWorkOrderHandleStatusApi({ operationType: operationType, workOrderId: formData.value.id }).then(res => { |
| | | visible.value = false |
| | | emit('success') |
| | | }) |
| | | } |
| | | |
| | | function rejectSuccess() { |
| | | visible.value = false |
| | | emit('success') |
| | | } |
| | | |
| | | function rejectOrders() { |
| | | rejectVisible.value = true |
| | | nextTick(() => { |
| | | refuseOrderDialogRef.value.open({ |
| | | mode: 'add', |
| | | row: { workOrderId: formData.value.id }, |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | // 获取推荐设备列表 |
| | | async function getDeviceList() { |
| | | try { |