| | |
| | | <i class="el-icon-map-location"></i> 地图选点 |
| | | </el-button> |
| | | </avue-input-map> |
| | | <div v-if="form.location?.length >= 2" class="location-text">{{ form.address || '获取地址中...' }}</div> |
| | | <!-- <div v-if="form.location?.length >= 3"> |
| | | {{ form.location[2] || '获取地址中...' }} |
| | | </div> --> |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | |
| | | <el-input type="textarea" v-model="currentDetail.content" placeholder="请输入工单内容" /> |
| | | </template> |
| | | <!-- 修复工单类型为下拉框 --> |
| | | <template v-else-if="currentDetail.status === 0 && row.label2 === '工单类型'&&hasProcessingBtnPermission()"> |
| | | <template v-else-if="currentDetail.status === 0 && row.label2 === '工单类型' && hasProcessingBtnPermission()"> |
| | | <el-select v-model="currentDetail.type" placeholder="请选择工单类型"> |
| | | <el-option v-for="item in types" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | |
| | | |
| | | <!-- 上传图片 --> |
| | | <div v-if="[3, 4].includes(currentDetail.status)" class="form-section" style="margin-bottom: 32px;"> |
| | | <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">上传图片</div> |
| | | <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false" list-type="picture-card" |
| | | :on-change="handleFileChange" :on-remove="handleUploadRemove" :before-upload="beforeUpload" :file-list="[]" |
| | | :limit="1" accept="image/*"> |
| | | <div class="section-title" v-if="hasProcessedAndOverBtnPermission()">上传图片</div> |
| | | <el-upload v-if="hasProcessedAndOverBtnPermission()" ref="upload" :action="'#'" :auto-upload="false" |
| | | list-type="picture-card" :on-change="handleFileChange" :on-remove="handleUploadRemove" |
| | | :before-upload="beforeUpload" :file-list="[]" :limit="1" accept="image/*"> |
| | | <span |
| | | style="font-size: 32px; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;">+</span> |
| | | </el-upload> |
| | | <div class="el-upload__tip" style="margin-top: 12px;" v-if="hasProcessedAndOverBtnPermission()"> |
| | | <div class="el-upload__tip" style="margin-top: 12px;" v-if="hasProcessedAndOverBtnPermission()"> |
| | | 支持 jpg/png 格式图片,单张不超过 5MB |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" @click="handleBatchApprove">通过</el-button> |
| | | <el-button type="danger" @click="handleBatchReject">不通过</el-button> |
| | | <el-button type="primary" @click="handleBatchApprove">通过</el-button> |
| | | <el-button type="danger" @click="handleBatchReject">不通过</el-button> |
| | | <el-button @click="cancleBatchReject">取消</el-button> |
| | | </div> |
| | | </template> |
| | |
| | | } |
| | | } |
| | | finally { |
| | | this.submitLoading = false; |
| | | } |
| | | this.submitLoading = false; |
| | | } |
| | | }, |
| | | |
| | | async saveDraft() { |
| | |
| | | this.submitLoading = true; |
| | | try { |
| | | let handlerValue = this.form.handler; |
| | | if (!handlerValue || handlerValue === '未分配') { |
| | | handlerValue = undefined; |
| | | } |
| | | if (!handlerValue || handlerValue === '未分配') { |
| | | handlerValue = undefined; |
| | | } |
| | | const submitData = { |
| | | id: this.form.id, |
| | | eventName: this.form.name || undefined, |
| | |
| | | this.$message.error(error.message || '保存草稿失败,请稍后重试'); |
| | | } |
| | | finally { |
| | | this.submitLoading = false; |
| | | } |
| | | this.submitLoading = false; |
| | | } |
| | | }, |
| | | |
| | | async handleLocationChange(val) { |
| | | |
| | | |
| | | // 处理 Proxy 对象的值 |
| | | handleLocationChange(val) { |
| | | let locationValue = val.value; |
| | | if (locationValue && locationValue.length >= 3) { |
| | | // 确保我们获取到实际的数组值 |
| | | this.form.location = [locationValue[0], locationValue[1]]; |
| | | if (locationValue && locationValue.length >= 2) { |
| | | // 兼容第三项为地址 |
| | | this.form.location = [ |
| | | Number(locationValue[0]), |
| | | Number(locationValue[1]), |
| | | locationValue[2] || '' |
| | | ]; |
| | | this.form.address = locationValue[2] || ''; |
| | | } else { |
| | | this.form.location = []; |
| | |
| | | this.dispatchDialogVisible = true; // 打开派发对话框 |
| | | }, |
| | | hasProcessingBtnPermission() { |
| | | // undefined 或 false 都返回 false,只有 true 返回 true |
| | | console.log('权限检查:', this.permission); |
| | | return this.permission && this.permission.tickets_processing_btn === true; |
| | | }, |
| | | // undefined 或 false 都返回 false,只有 true 返回 true |
| | | console.log('权限检查:', this.permission); |
| | | return this.permission && this.permission.tickets_processing_btn === true; |
| | | }, |
| | | hasProcessedAndOverBtnPermission() { |
| | | // undefined 或 false 都返回 false,只有 true 返回 true |
| | | console.log('权限检查:', this.permission); |
| | |
| | | department: deptId, |
| | | handler: handlerId, // 使用映射后的处理人ID |
| | | algorithm: algorithmArr, // 回显为数组 |
| | | location: row.location, |
| | | address: row.address, |
| | | location: Array.isArray(row.location) && row.location.length >= 2 |
| | | ? [Number(row.location[0]), Number(row.location[1])] |
| | | : [], |
| | | address: row.address || '', |
| | | content: row.content, |
| | | photos: [], |
| | | }; |
| | | |
| | | this.form.location = Array.isArray(row.location) && row.location.length >= 2 |
| | | ? [ |
| | | Number(row.location[0]), |
| | | Number(row.location[1]), |
| | | row.location[2] || row.address || '' |
| | | ] |
| | | : []; |
| | | this.form.address = this.form.location[2] || ''; |
| | | // 设置地图中心点 |
| | | if (Array.isArray(this.form.location) && this.form.location.length >= 2) { |
| | | this.mapParams.center = [Number(this.form.location[0]), Number(this.form.location[1])]; |
| | | } else { |
| | | this.mapParams.center = null; // 没有经纬度时用默认 |
| | | } |
| | | // 如果有图片,添加到表单中 |
| | | if (row.photo_url) { |
| | | this.form.photos = [{ |