p-honggang.li
2 天以前 349091f54dab47b15ca81613f02765490a2ce7d0
修改买家中心卖家中心产品类型等条件查询问题
8个文件已修改
302 ■■■■ 已修改文件
src/App.vue 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/approveManage/tradeApproval/list.vue 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/price/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/productPriceViewer/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/buyer/index.vue 89 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/detail/index.vue 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/seller/index.vue 85 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 补丁 | 查看 | 原始文档 | blame | 历史
src/App.vue
@@ -123,5 +123,14 @@
.rowBtnDiv .normal-btn,.action-btns .normal-btn{
    padding: 8px 4px !important;
  }
/* Tooltip 宽度与换行控制(Element Plus Teleport 到 body,需要 deep 选择器) */
.tooltip-wrap{
  max-width: 340px !important;
}
.tooltip-wrap .el-tooltip__content {
  max-width: 340px !important;
  white-space: normal !important;
  word-break: break-word;
  overflow-wrap: anywhere;
}
</style>
src/views/approveManage/tradeApproval/list.vue
@@ -14,9 +14,25 @@
            </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%">
@@ -317,6 +333,7 @@
const router = useRouter()
const userStore = useUserInfo()
const areaIdTreeRef=ref()
// 状态选项(更新为新的工作流程状态)
const statusOptions = [
@@ -339,9 +356,10 @@
const query = reactive({
  productName: '',
  industry: '',
  unitProject: '',
  unitProject: [],
  productType: '',
  productSubType: '',
  importantDistrictIdList: [],
  orderNo: '',
  status: '',
  dateRange: [],
@@ -396,6 +414,24 @@
  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([])
}
// 获取行业领域选项
const getIndustryOptions = async () => {
  try {
@@ -435,14 +471,40 @@
  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
  }
}
@@ -595,12 +657,13 @@
  
  // 添加产品条件查询
  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 ? fetchApprovalPageWithProductConditions : fetchApprovalPage
  
  const res = (await apiMethod(payload)) as any
src/views/productManage/price/index.vue
@@ -13,7 +13,7 @@
            <el-icon class="section-icon"><Goods /></el-icon>
            <span>产品基本信息</span>
          </div>
          <div class="id-info">产品ID:{{ currentProductId || '未提供' }}</div>
<!--          <div class="id-info">产品ID:{{ currentProductId || '未提供' }}</div>-->
        </div>
      </template>
@@ -856,7 +856,7 @@
function handleToggleEnableStatus(row: any) {
  const newStatus = row.enableStatus === 'ENABLED' ? 'DISABLED' : 'ENABLED'
  ElMessageBox.confirm(
    `确认要${newStatus === 'ENABLED' ? '启用' : '停用'}该价格(ID: ${row.id})吗?`,
    `确认要${newStatus === 'ENABLED' ? '启用' : '停用'}该定价标准吗?`,
    '状态变更',
    { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }
  )
src/views/productManage/productPriceViewer/index.vue
@@ -548,6 +548,7 @@
  try {
    await removeFromCart(String(suite.id))
    orderSuites.value.splice(index, 1)
    selectedSuiteIds.value.delete(suite.id)
  } catch (e) {
  }
}
src/views/tradeManage/buyer/index.vue
@@ -14,9 +14,25 @@
            </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%">
@@ -57,8 +73,8 @@
        <!-- 第三行:操作按钮(右对齐) -->
        <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>
@@ -290,6 +306,8 @@
const router = useRouter()
const userStore = useUserInfo()
const areaIdTreeRef=ref()
// 状态选项(更新为新的工作流程状态)
const statusOptions = [
  { label: '全部', value: '' },
@@ -310,9 +328,10 @@
const query = reactive({
  productName: '',
  industry: '',
  unitProject: '',
  unitProject: [],
  productType: '',
  productSubType: '',
  importantDistrictIdList: [],
  orderNo: '',
  status: '',
  dateRange: [],
@@ -360,6 +379,25 @@
  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([])
}
// 获取行业领域选项
const getIndustryOptions = async () => {
  try {
@@ -400,14 +438,40 @@
  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
  }
}
@@ -556,12 +620,13 @@
  // 添加产品条件查询
  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
src/views/tradeManage/detail/index.vue
@@ -68,10 +68,16 @@
        </el-descriptions-item>
        <el-descriptions-item label="提供者">{{ detail.supplier }}</el-descriptions-item>
        <el-descriptions-item label="行业领域">{{ detail.industry }}</el-descriptions-item>
        <el-descriptions-item label="单位工程">{{ detail.projectUnit }}</el-descriptions-item>
        <el-descriptions-item label="单位工程">
          <el-tooltip effect="dark" :content="detail.projectUnit || '-'" placement="top" :disabled="!(detail.projectUnit && String(detail.projectUnit).trim())" popper-class="tooltip-wrap">
            <div class="ellipsis-1">{{ detail.projectUnit || '-' }}</div>
          </el-tooltip>
        </el-descriptions-item>
        <el-descriptions-item label="产品类型">{{ detail.productType || '-' }}</el-descriptions-item>
        <el-descriptions-item label="产品简介">
          <div class="desc-wrap">{{ detail.productDesc }}</div>
          <el-tooltip effect="dark" :content="detail.productDesc || '-'" placement="top" :disabled="!(detail.productDesc && String(detail.productDesc).trim())" popper-class="tooltip-wrap" trigger="click">
            <div class="desc-wrap ellipsis-3">{{ detail.productDesc || '-' }}</div>
          </el-tooltip>
        </el-descriptions-item>
      </el-descriptions>
@@ -1011,6 +1017,25 @@
  line-height: 22px;
}
/* 单行省略(用于“单位工程”) */
.ellipsis-1 {
  max-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 多行省略(用于“产品简介”,固定为3行,可按需调整) */
.ellipsis-3 {
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 审批追踪标签页样式 */
.approval-tabs {
  margin-top: 15px;
src/views/tradeManage/seller/index.vue
@@ -14,9 +14,25 @@
            </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.productType" placeholder="请选择产品类型" clearable style="width: 100%" @change="handleProductTypeChange">
@@ -254,6 +270,7 @@
const router = useRouter()
const userStore = useUserInfo()
const areaIdTreeRef=ref()
// 状态选项(更新为新的工作流程状态)
const statusOptions = [
@@ -275,9 +292,10 @@
const query = reactive({
  productName: '',
  industry: '',
  unitProject: '',
  unitProject: [],
  productType: '',
  productSubType: '',
  importantDistrictIdList: [],
  orderNo: '',
  status: '',
  dateRange: [],
@@ -363,14 +381,40 @@
  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
  }
}
@@ -394,6 +438,24 @@
  }
}
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([])
}
// 处理行业领域变化
const handleIndustryChange = async (value: string) => {
  // 清空单位工程选择
@@ -409,8 +471,6 @@
  // 获取对应的产品子级选项
 // await getProductSubTypeOptions(value)
}
// 获取状态类型
const getStatusType = (status: string) => {
@@ -525,12 +585,13 @@
    // 添加产品条件查询
    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.getSellerOrderPageWithProductConditions : orderApi.getSellerOrderPage
    const res = (await apiMethod(payload)) as any
vite.config.ts