| | |
| | | :close-on-click-modal="false" |
| | | > |
| | | <div class="content" style="display: flex"> |
| | | <div class="processBox" v-if="dialogMode !== 'add'"> |
| | | <div class="processBox" v-if="dialogMode !== 'add' && processList.length"> |
| | | <el-steps direction="vertical" :active="processList.length"> |
| | | <el-step v-for="item in processList" :title="item.flowName" :description="item.flowDesc" /> |
| | | </el-steps> |
| | |
| | | v-model="formData.deviceLoadDemand" |
| | | placeholder="请选择" |
| | | clearable |
| | | @change="loadDemandChange" |
| | | > |
| | | <el-option |
| | | v-for="item in dictObj.deviceLoadDemand" |
| | |
| | | </div> |
| | | <div class="rightBox" v-if="!dialogReadonly"> |
| | | <div class="detail-title">推荐设备</div> |
| | | <el-table ref="deviceTableRef" :data="deviceList" row-key="id" @selection-change="handleDeviceSelectionChange"> |
| | | <el-table-column type="selection" width="55" :reserve-selection="true" /> |
| | | <el-table-column prop="nickname" label="设备名称" /> |
| | | <el-table-column prop="deviceName" label="设备型号" /> |
| | | <el-table-column prop="devicePayload" label="设备负载" /> |
| | | </el-table> |
| | | <template v-if="formData.deviceLoadDemand && pointList.length"> |
| | | <el-table ref="deviceTableRef" :data="deviceList" row-key="id" @selection-change="handleDeviceSelectionChange"> |
| | | <el-table-column type="selection" width="55" :reserve-selection="true" /> |
| | | <el-table-column prop="nickname" label="设备名称" /> |
| | | <el-table-column prop="deviceName" label="设备型号" /> |
| | | <el-table-column prop="devicePayload" label="设备负载" /> |
| | | </el-table> |
| | | </template> |
| | | <div v-else>请先选择设备需求并绘制范围</div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | > |
| | | 发布 |
| | | </el-button> |
| | | <el-button color="#F2F3F5" v-if="gdStatus === '11'">拒单原因</el-button> |
| | | <el-button color="#F2F3F5" v-if="gdStatus === '11'" @click="addDescription(2,'view')">拒单原因</el-button> |
| | | <el-button color="#F2F3F5" @click="statusChange(3)" v-if="gdStatus === '20'">申请取消</el-button> |
| | | <el-button color="#4C34FF" @click="requestModification" v-if="gdStatus === '20'" class="save-btn"> |
| | | 申请修改 |
| | | </el-button> |
| | | </template> |
| | | <template v-else> |
| | | <el-button color="#F2F3F5" v-if="gdStatus === '10'" @click="rejectOrders">拒绝接单</el-button> |
| | | <el-button color="#F2F3F5" v-if="gdStatus === '10'" @click="addDescription(2)">拒绝接单</el-button> |
| | | <el-button color="#4C34FF" v-if="gdStatus === '10'" @click="statusChange(1)" class="save-btn">接单</el-button> |
| | | <el-button color="#F2F3F5" v-if="gdStatus === '22'" @click="statusChange(7)">同意修改</el-button> |
| | | <el-button color="#4C34FF" v-if="gdStatus === '22'" @click="statusChange(8)" class="save-btn"> |
| | |
| | | <el-button color="#4C34FF" v-if="gdStatus === '21'" @click="statusChange(6)" class="save-btn"> |
| | | 不同意取消 |
| | | </el-button> |
| | | <el-button color="#F2F3F5" v-if="gdStatus === '30'" @click="addDescription(9)">协商修改</el-button> |
| | | </template> |
| | | </template> |
| | | </template> |
| | |
| | | const refuseOrderDialogRef = ref(null) |
| | | let viewer |
| | | let drawPolygonExample |
| | | let pointList = [] |
| | | let pointList = ref([]) |
| | | const requester = inject('requester') |
| | | const editStatus = inject('editStatus') |
| | | |
| | |
| | | executeStartTime: fieldRules(true), |
| | | deviceLoadDemand: fieldRules(true), |
| | | } |
| | | // 操作类型:1接单,2拒接接单,3申请取消,4申请修改, 5同意取消 6不同意取消 7.同意修改 7.不同意修改 |
| | | // 操作类型:1接单,2拒接接单,3申请取消,4申请修改, 5同意取消 6不同意取消 7.同意修改 8.不同意修改 9.协商修改 |
| | | function statusChange(operationType) { |
| | | gdWorkOrderHandleStatusApi({ operationType: operationType, workOrderId: formData.value.id }).then(res => { |
| | | visible.value = false |
| | |
| | | emit('success') |
| | | } |
| | | |
| | | function rejectOrders() { |
| | | // 填写说明 |
| | | function addDescription(type,mode = 'add') { |
| | | let formLabel = '' |
| | | switch ( type) { |
| | | case 2: |
| | | formLabel = '拒绝原因'; |
| | | break |
| | | case 9: |
| | | formLabel = '修改原因'; |
| | | break |
| | | } |
| | | rejectVisible.value = true |
| | | nextTick(() => { |
| | | refuseOrderDialogRef.value.open({ |
| | | mode: 'add', |
| | | mode, |
| | | row: { workOrderId: formData.value.id }, |
| | | type, |
| | | formLabel, |
| | | }) |
| | | }) |
| | | } |
| | |
| | | // 获取推荐设备列表 |
| | | async function getDeviceList() { |
| | | try { |
| | | const res = await gdManageDeviceListApi({ current: 1, size: 1000, ids: formData.value.recommendDeviceIds }) |
| | | const res = await gdManageDeviceListApi({ |
| | | current: 1, |
| | | size: 1000, |
| | | ids: formData.value.recommendDeviceIds, |
| | | devicePayload: dialogMode.value === 'add' ? formData.value.deviceLoadDemand : '', |
| | | }) |
| | | deviceList.value = res?.data?.data ?? [] |
| | | } catch (error) { |
| | | console.error('获取设备列表失败:', error) |
| | | } |
| | | } |
| | | |
| | | function loadDemandChange() { |
| | | console.log('loadDemandChange') |
| | | formData.value.recommendDeviceIds = '' |
| | | getDeviceList() |
| | | syncSelection() |
| | | } |
| | | |
| | | // 设备选择变化 |
| | |
| | | async function handleSubmit() { |
| | | const isValid = await formRef.value?.validate().catch(() => false) |
| | | if (!isValid) return |
| | | if (!pointList.length) { |
| | | if (!pointList.value.length) { |
| | | ElMessage.warning('请绘制范围') |
| | | return |
| | | } |
| | | submitting.value = true |
| | | try { |
| | | const str = [...pointList, pointList[0]].map(item => `${item.longitude} ${item.latitude}`).join(',') |
| | | const str = [...pointList.value, pointList.value[0]].map(item => `${item.longitude} ${item.latitude}`).join(',') |
| | | formData.value.geom = `POLYGON((${str}))` |
| | | if (!formData.value.id) { |
| | | formData.value.workOrderStatus = '10' |
| | |
| | | |
| | | // 绘制完成回调 |
| | | const drawFinished = async data => { |
| | | pointList = _.cloneDeep(data).map(item => { |
| | | pointList.value = _.cloneDeep(data).map(item => { |
| | | const val = cartesian3Convert(item, viewer) |
| | | return { ...val, lng: val.longitude, lat: val.latitude } |
| | | }) |
| | |
| | | // 编辑面 |
| | | function editPolygon() { |
| | | if (!formData.value?.geom) return |
| | | pointList = geomAnalysis(formData.value.geom) |
| | | pointList.value = geomAnalysis(formData.value.geom) |
| | | drawPolygonExample?.destroy() |
| | | drawPolygonExample = new DrawPolygon(viewer) |
| | | let noClosedList = _.cloneDeep(pointList) |
| | | let noClosedList = _.cloneDeep(pointList.value) |
| | | noClosedList.pop() |
| | | drawPolygonExample.initPolygon( |
| | | viewer, |
| | |
| | | // 查看面 |
| | | function viewPolygon() { |
| | | if (!formData.value?.geom) return |
| | | pointList = geomAnalysis(formData.value.geom) |
| | | const result = pointList.map(item => [item.longitude, item.latitude]).flat() |
| | | pointList.value = geomAnalysis(formData.value.geom) |
| | | const result = pointList.value.map(item => [item.longitude, item.latitude]).flat() |
| | | viewPlane = viewer.entities?.add({ |
| | | customType: 'control_group', |
| | | position: Cesium.Cartesian3.fromDegrees(result[0], result[1]), |
| | |
| | | }, |
| | | }) |
| | | flyVisual({ |
| | | positionsData: pointList.map(i => [i.longitude, i.latitude, i.height || 0]), |
| | | positionsData: pointList.value.map(i => [i.longitude, i.latitude, i.height || 0]), |
| | | viewer, |
| | | }) |
| | | } |
| | |
| | | function syncSelection() { |
| | | if (!deviceTableRef.value) return |
| | | deviceTableRef.value.clearSelection() |
| | | console.log(formData.value) |
| | | const deviceIds = formData.value.recommendDeviceIds.split(',') |
| | | deviceList.value.forEach(device => { |
| | | if (deviceIds.includes(String(device.id))) { |