| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="" class="col-17"> |
| | | <el-select v-model="query.unitProject" placeholder="请选择单位工程" clearable style="width: 100%"> |
| | | <el-option v-for="item in unitProjectOptions" :key="item.value" :label="item.label" :value="item.value" /> |
| | | </el-select> |
| | | <!-- <el-select v-model="query.unitProject" placeholder="请选择单位工程" clearable style="width: 100%">--> |
| | | <!-- <el-option v-for="item in unitProjectOptions" :key="item.value" :label="item.label" :value="item.value" />--> |
| | | <!-- </el-select>--> |
| | | <el-tree-select |
| | | ref="areaIdTreeRef" |
| | | v-model="query.unitProject" |
| | | :data="unitProjectOptions" |
| | | placeholder="请选择单位工程" |
| | | multiple |
| | | collapse-tags |
| | | collapse-tags-tooltip |
| | | clearable |
| | | :default-expand-all="true" |
| | | :render-after-expand="false" |
| | | show-checkbox |
| | | style="width: 170px;" |
| | | @change="importantAreaCh" |
| | | @clear="importantAreaClear" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="交易状态" class="col-30"> |
| | | <el-select v-model="query.status" placeholder="全部" style="width: 100%"> |
| | |
| | | <!-- 第三行:操作按钮(右对齐) --> |
| | | <div class="form-row actions"> |
| | | <el-form-item class="row-actions"> |
| | | <el-button type="primary" @click="handleSearch" :icon="Search">查询</el-button> |
| | | <el-button @click="reset" :icon="Refresh">重置</el-button> |
| | | <el-button type="primary" @click="handleSearch" icon="Search">查询</el-button> |
| | | <el-button @click="reset" icon="Refresh">重置</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | </el-form> |
| | |
| | | 交易确认 |
| | | </el-button> |
| | | <el-button |
| | | v-else-if="action.type === ActionType.EVALUATE" |
| | | v-else-if="action.type === ActionType.EVALUATE && row.parentOrder.isEvaluate === '未评价'" |
| | | type="primary" |
| | | link |
| | | size="small" |
| | |
| | | <script setup lang="ts"> |
| | | import { onMounted, reactive, ref } from 'vue' |
| | | import { useRouter } from 'vue-router' |
| | | import { Search, Refresh } from '@element-plus/icons-vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import orderApi from '@/api/orderApi' |
| | | import productApi from '@/api/productApi' |
| | | import { useUserInfo } from '@/stores/modules/userInfo' |
| | | import ProductOrderStatusDialog from '@/views/productManage/productOrderStatusDialog/index.vue' |
| | | import { OrderWorkflowController, OrderStatus, ActionType, PageType, StatusMapper } from '@/utils/orderWorkflow' |
| | | import { queryUserDetail } from '@/api/userInfo' |
| | | |
| | | const router = useRouter() |
| | | const userStore = useUserInfo() |
| | | |
| | | const areaIdTreeRef=ref() |
| | | |
| | | // 状态选项(更新为新的工作流程状态) |
| | | const statusOptions = [ |
| | |
| | | const query = reactive({ |
| | | productName: '', |
| | | industry: '', |
| | | unitProject: '', |
| | | unitProject: [], |
| | | productType: '', |
| | | productSubType: '', |
| | | importantDistrictIdList: [], |
| | | orderNo: '', |
| | | status: '', |
| | | dateRange: [], |
| | |
| | | [OrderStatus.WAIT_CONFIRM]: 'WAIT_CONFIRM', |
| | | [OrderStatus.COMPLETED]: 'COMPLETED', |
| | | [OrderStatus.EVALUATED]: 'EVALUATED', |
| | | [OrderStatus.CANCELED]: 'CANCELED' |
| | | } |
| | | |
| | | const formatDateTime = (val?: string) => { |
| | |
| | | if (/(协议|agreement)/i.test(s)) return 'agreement' |
| | | if (/(免费|free)/i.test(s)) return 'free' |
| | | return 'currency' |
| | | } |
| | | |
| | | |
| | | const importantAreaCh=()=>{ |
| | | let checkedKeys = areaIdTreeRef.value!.getCheckedNodes(false, true) |
| | | if(checkedKeys&&checkedKeys.length>0&& query.unitProject.length>0){ |
| | | query.importantDistrictIdList=[] |
| | | checkedKeys.forEach((item:any)=>{ |
| | | if(item.children&&item.children.length>0){ |
| | | query.importantDistrictIdList.push(item.value) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | const importantAreaClear=()=>{ |
| | | query.unitProject = [] |
| | | query.importantDistrictIdList = [] |
| | | areaIdTreeRef.value.setCheckedKeys([]) |
| | | } |
| | | |
| | | // 获取行业领域选项 |
| | |
| | | try { |
| | | const res = await productApi.getCategoryByParent({ parentId: industryCode }) |
| | | if (res?.code === 200 && res.data) { |
| | | unitProjectOptions.value = res.data.map((item: any) => ({ |
| | | label: item.name, |
| | | value: item.id |
| | | })) |
| | | unitProjectOptions.value = handleIndustryData(res.data) |
| | | } |
| | | } catch (error) { |
| | | console.error('获取单位工程选项失败:', error) |
| | | unitProjectOptions.value = [] |
| | | } |
| | | } |
| | | |
| | | const handleIndustryData=(list:any)=>{ |
| | | if(list&& list.length>0){ |
| | | let data=list.map((item:any)=>{ |
| | | return { |
| | | label:item.name, |
| | | value:item.id, |
| | | parentId:item.parentId, |
| | | parentName:item.parentName, |
| | | children:item.childrenList?handleIndustryChildData(item,item.childrenList):[] |
| | | } |
| | | }) |
| | | return data |
| | | } |
| | | } |
| | | const handleIndustryChildData=(parentItem:any,childList:any)=>{ |
| | | if(childList&& childList.length>0){ |
| | | let data=childList.map((item:any)=>{ |
| | | return { |
| | | parentId:parentItem.id, |
| | | parentName:parentItem.name, |
| | | label:item.name, |
| | | value:item.id, |
| | | children:item.childrenList?handleIndustryChildData(item,item.childrenList):[] |
| | | } |
| | | }) |
| | | return data |
| | | } |
| | | } |
| | | |
| | |
| | | WAIT_CONFIRM: 'warning', |
| | | COMPLETED: 'success', |
| | | EVALUATED: 'success', |
| | | CANCELED: 'danger' |
| | | } |
| | | return statusMap[status] || 'info' |
| | | } |
| | |
| | | |
| | | // 添加产品条件查询 |
| | | if (query.industry) payload.industryId = query.industry |
| | | if (query.unitProject) payload.unitProjectId = query.unitProject |
| | | if (query.unitProject.length > 0) payload.unitProjectId = query.unitProject |
| | | if (query.importantDistrictIdList.length > 0) payload.importantDistrictId = query.importantDistrictIdList |
| | | if (query.productType) payload.productTypeId = query.productType |
| | | if (query.productSubType) payload.productSubTypeId = query.productSubType |
| | | |
| | | // 根据是否有产品条件选择不同的API |
| | | const hasProductConditions = query.industry || query.unitProject || query.productType || query.productSubType |
| | | const hasProductConditions = query.industry || query.unitProject.length > 0 || query.productType || query.productSubType |
| | | const apiMethod = hasProductConditions ? orderApi.getBuyerOrderPageWithProductConditions : orderApi.getBuyerOrderPage |
| | | |
| | | const res = (await apiMethod(payload)) as any |
| | |
| | | status: uiStatus, |
| | | statusName: order.orderStatus || '', |
| | | orderStatus: StatusMapper.toUIStatus(order.orderStatus), // 转换为标准状态枚举 |
| | | workFlowId: order.workflowId || '' |
| | | workFlowId: order.workflowId || '', |
| | | isEvaluate: order.isEvaluate || '' |
| | | } |
| | | const subOrders: any[] = Array.isArray(order?.orderDetails) |
| | | ? order.orderDetails.map((d: any, i: number) => ({ |