| | |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="工单类型" prop="type"> |
| | | <el-select v-model="form.type" placeholder="请选择工单类型" class="full-width"> |
| | | |
| | | <el-select @change="handleTypeChange" v-model="form.type" placeholder="请选择工单类型" class="full-width" > |
| | | <el-option |
| | | v-for="item in types" |
| | | :key="item.value" |
| | |
| | | multiple |
| | | placeholder="请选择关联算法" |
| | | class="full-width" |
| | | :disabled="!form.type" |
| | | > |
| | | <el-option |
| | | v-for="item in algorithms" |
| | |
| | | <el-button type="infoprimary" plain :loading="draftLoading" @click="saveDraft" |
| | | >存草稿</el-button |
| | | > |
| | | <el-button @click="dialogVisible = false">取 消</el-button> |
| | | |
| | | |
| | | <el-button @click="handleCancel">取 消</el-button> |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | |
| | | }, |
| | | departments: [], |
| | | types: [], |
| | | allAlgorithms: [], |
| | | handlers: [ |
| | | { label: '处理人A', value: 'handlerA' }, |
| | | { label: '处理人B', value: 'handlerB' }, |
| | |
| | | const subAreaCode = areaCode ? areaCode.substring(0, 6) : ''; |
| | | const adcodeObj = getAdcodeObj(geoJson, 'adcode', subAreaCode); |
| | | |
| | | console.log('区域代码:', subAreaCode); |
| | | // console.log('区域代码:', subAreaCode); |
| | | |
| | | // 直接从返回对象中获取正确的路径 |
| | | const center = adcodeObj?.payload?.objects?.collection?.geometries?.[0]?.properties?.center; |
| | |
| | | async fetchDropdownData() { |
| | | try { |
| | | const response = await getTicketInfo(); |
| | | const { dept_data, event_type, ai_type } = response.data.data; |
| | | |
| | | const { dept_data, event_type, ai_type,info } = response.data.data; |
| | | |
| | | this.departments = dept_data.map(item => ({ |
| | | label: item.dept_name, |
| | |
| | | |
| | | const columnType = this.findObject(this.option.column, 'type'); |
| | | columnType.dicData = this.types; |
| | | this.allAlgorithms = info |
| | | |
| | | // console.log('工单类型',this.types); |
| | | // console.log('关联算法',this.allAlgorithms ); |
| | | // 确保算法数据的映射一致 |
| | | this.algorithms = |
| | | ai_type?.map(item => ({ |
| | | dict_key: item.dict_key, |
| | | dict_value: item.dict_value, |
| | | // 同时添加 label 和 value 以兼容两处使用 |
| | | label: item.dict_value, |
| | | value: item.dict_key, |
| | | })) || []; |
| | | // this.algorithms = |
| | | // ai_type?.map(item => ({ |
| | | // dict_key: item.dict_key, |
| | | // dict_value: item.dict_value, |
| | | // // 同时添加 label 和 value 以兼容两处使用 |
| | | // label: item.dict_value, |
| | | // value: item.dict_key, |
| | | // })) || []; |
| | | |
| | | // 构建用户ID和名称的映射关系 |
| | | this.userNameToIdMap = {}; |
| | |
| | | } catch (error) { |
| | | this.$message.error('加载下拉框数据失败'); |
| | | } |
| | | }, |
| | | // 工单类型变化时触发 |
| | | handleTypeChange(typeValue) { |
| | | if (!typeValue) { |
| | | // 未选择类型时清空算法列表 |
| | | this.algorithms = []; |
| | | return; |
| | | } |
| | | |
| | | const matchedCategory = this.allAlgorithms.find( |
| | | category => category.dict_key === typeValue |
| | | ); |
| | | |
| | | if (!matchedCategory || !matchedCategory.algorithms || matchedCategory.algorithms.length === 0) { |
| | | // 无匹配的算法时清空 |
| | | this.algorithms = []; |
| | | this.$message.info('该工单类型暂无关联算法'); |
| | | return; |
| | | } |
| | | |
| | | this.algorithms = matchedCategory.algorithms.map(algo => ({ |
| | | label: algo.dict_value, |
| | | value: algo.dict_key, |
| | | dict_key: algo.dict_key, |
| | | dict_value: algo.dict_value |
| | | })); |
| | | |
| | | }, |
| | | |
| | | async fetchTableData() { |
| | |
| | | this.draftLoading = false; |
| | | } |
| | | }, |
| | | |
| | | handleCancel (){ |
| | | this.resetForm(); |
| | | this.dialogVisible = false; |
| | | }, |
| | | handleLocationChange(val) { |
| | | let locationValue = val.value; |
| | | if (locationValue && locationValue.length >= 2) { |
| | |
| | | |
| | | // 获取工单类型值 - 从types中找到匹配的值 |
| | | const typeValue = |
| | | this.types.find(t => t.label === row.type)?.value || row.work_order_type_dict_key; |
| | | |
| | | this.types.find(t => t.value === row.type)?.value || row.work_order_type_dict_key; |
| | | // 获取处理人ID - 使用userNameToIdMap映射 |
| | | const handlerId = this.userNameToIdMap[row.handler] || row.handler; |
| | | |