15个文件已修改
287 ■■■■■ 已修改文件
.env.development 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.production 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/axios.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/orderWorkflow.ts 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/approveManage/tradeApproval/approve.vue 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pointsManage/personal/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pointsManage/ruleDetail/index.vue 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/pointsManage/settings/index.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/productPriceViewer/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/buyer/index.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/confirm/index.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/detail/index.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/evaluate/index.vue 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tradeManage/upload/index.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
vite.config.ts 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
.env.development
@@ -8,6 +8,7 @@
# 本地环境接口地址 - 尾部无需带'/'
VITE_AXIOS_BASE_URL = 'http://36.133.126.111:7099'
VITE_FILE_PREVIEW_URL = 'http://36.133.126.111:7098'
# VITE_AXIOS_BASE_URL = 'http://36.139.126.109:7088'
# 开发环境下跨域代理,请输入要跨域的api地址 - 尾部无需带'/'
.env.production
@@ -5,6 +5,7 @@
VITE_BASE_PATH = '/trade-api'
# 开发环境下跨域代理,请输入要跨域的api地址 - 尾部无需带'/'
VITE_AXIOS_BASE_URL = 'http://36.133.126.111:7099'
VITE_FILE_PREVIEW_URL = 'http://36.133.126.111:7098'
#VITE_BI_URL = 'https://zynlpt.ccccltd.cn'
VITE_BI_URL = 'http://36.133.126.111:7099'
#跳转iframe地址
src/utils/axios.ts
@@ -98,6 +98,10 @@
      if (config.url?.includes('common/filePreview')) {
        return response
      }
      const isFile = response.headers['content-type'] === 'application/octet-stream'
      if(isFile) {
        return response
      }
      if (response.data && response.data.code == 200) {
        return response.data
      } else {
src/utils/orderWorkflow.ts
@@ -10,7 +10,8 @@
  WAIT_APPROVAL_AUTHORIZE = '待审批授权',
  WAIT_CONFIRM = '待交易确认',     // 3
  COMPLETED = '已完成',           // 4
  EVALUATED = '已评价'            // 5 (最终状态)
  EVALUATED = '已评价',            // 5 (最终状态)
  CANCELED = '已取消'
}
// 操作类型枚举
@@ -68,6 +69,10 @@
    [OrderStatus.EVALUATED]: [
      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
      { type: ActionType.TRACK }
    ],
    [OrderStatus.CANCELED]: [
      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
      { type: ActionType.TRACK }
    ]
  },
  [PageType.BUYER_CENTER]: {
@@ -101,6 +106,10 @@
    [OrderStatus.EVALUATED]: [
      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
      { type: ActionType.TRACK }
    ],
    [OrderStatus.CANCELED]: [
      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
      { type: ActionType.TRACK }
    ]
  },
  [PageType.SELLER_CENTER]: {
@@ -128,6 +137,10 @@
    [OrderStatus.EVALUATED]: [
      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
      { type: ActionType.TRACK }
    ],
    [OrderStatus.CANCELED]: [
      { type: ActionType.VIEW, routeName: 'tradeOrderDetail' },
      { type: ActionType.TRACK }
    ]
  }
}
@@ -139,7 +152,8 @@
  [OrderStatus.WAIT_APPROVAL_AUTHORIZE]: OrderStatus.WAIT_CONFIRM,
  [OrderStatus.WAIT_CONFIRM]: OrderStatus.COMPLETED,
  [OrderStatus.COMPLETED]: OrderStatus.EVALUATED,
  [OrderStatus.EVALUATED]: null // 最终状态,无下一状态
  [OrderStatus.EVALUATED]: null, // 最终状态,无下一状态
  [OrderStatus.CANCELED]: null
}
/**
@@ -271,6 +285,8 @@
        return OrderStatus.COMPLETED
      case '已评价':
        return OrderStatus.EVALUATED
      case '已取消':
        return OrderStatus.CANCELED
      default:
        console.warn(`未知的订单状态: ${serverStatus},默认返回待授权状态`)
        return OrderStatus.WAIT_AUTHORIZE
src/views/approveManage/tradeApproval/approve.vue
@@ -272,6 +272,7 @@
import productApi from '@/api/productApi'
import sysUserService from "@/api/sysUser";
import workFlowApi from "@/api/workFlowApi";
import {queryUserDetail} from "@/api/userInfo";
const route = useRoute()
const router = useRouter()
@@ -340,7 +341,24 @@
  const orderId = String(route.params.id || '')
  console.log(route.params.taskId)
  if (!orderId) return
  // 获取用户信息
  if (!userStore.getUserId) {
    try {
      const res: any = await queryUserDetail()
      if (res?.code === 200 && res.data) {
        userStore.updateUserDetail(res.data)
      } else {
        ElMessage.error(res?.msg || '无法获取用户信息,请先登录')
        return
      }
    } catch (e) {
      console.error('获取用户详情失败:', e)
      ElMessage.error('获取用户信息失败,请稍后重试')
      return
    }
  }
  try {
    // 并行获取订单详情和协议类型检查
    const [orderRes, agreementRes] = await Promise.all([
@@ -492,7 +510,7 @@
    const orderId = String(route.params.id || '')
    console.log(String(route.params.taskId || ''))
    const taskId1 = taskId.value
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const userId = userStore.getUserId ? userStore.getUserId : undefined
    const comments = approvalForm.comments.trim()
    if (!orderId || !userId) {
@@ -574,7 +592,7 @@
    })
    
    const orderId = String(route.params.id || '')
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const userId = userStore.getUserId ?  userStore.getUserId : undefined
    const comments = approvalForm.comments.trim()
    const taskId1 = String(route.params.taskId || '')
@@ -772,7 +790,7 @@
      // 检查响应格式
      const responseData = previewResponse as any
      if (responseData && responseData.code === 200 && responseData.data) {
        previewUrl = responseData.data
        previewUrl = responseData.data.replaceAll('http://192.168.20.52:9000',import.meta.env.VITE_FILE_PREVIEW_URL)
        console.log('使用预览URL:', previewUrl)
      } else {
        console.log('预览URL获取失败,使用下载方式')
src/views/pointsManage/personal/index.vue
@@ -104,7 +104,7 @@
        <!-- 流水表格 -->
        <div class="table-section">
          <el-table :data="flowList" stripe style="width: 100%" :height="440">
            <el-table-column prop="id" label="序号" width="80" align="center" />
            <el-table-column type="index" label="序号" width="80" align="center" />
            <el-table-column prop="dataCategory" label="数据类目" width="120">
              <template #default="{ row }">
                <span>{{ getCategoryLabel(row.dataCategory) }}</span>
src/views/pointsManage/ruleDetail/index.vue
@@ -20,7 +20,7 @@
                <el-input
                  v-model="pointRuleDetial.pointsValue"
                  size="small"
                  style="width: 80px;"
                  style="width: 50px;"
                  placeholder="请输入"
                  readonly
                />
@@ -29,7 +29,7 @@
                <el-input
                  v-model="pointRuleDetial.dailyLimit"
                  size="small"
                  style="width: 80px;"
                  style="width: 50px;"
                  placeholder="请输入"
                  readonly
                   v-if="pointRuleDetial.isLimit === 1"
@@ -62,7 +62,7 @@
                <el-input
                  v-model="pointRuleDetials.pointsValue"
                  size="small"
                  style="width: 60px;"
                  style="width: 50px;"
                  placeholder="请输入"
                  readonly
                />
@@ -71,7 +71,7 @@
                  <el-input
                          v-model="pointRuleDetials.dailyLimit"
                          size="small"
                          style="width: 80px;"
                          style="width: 50px;"
                          placeholder="请输入"
                          readonly
                          v-if="pointRuleDetials.isLimit === 1"
@@ -155,9 +155,42 @@
      const res = await pointsApi.getPointsRuleById(formData)
      if (res.code === 200 && res.data) {
        res.data.getPointsRuleList.map(item => {
          item.pointsRules.map(iitem => {
            if(iitem.ruleDescription.indexOf('被') > -1){
              iitem.descSort = 0
            }else{
              iitem.descSort = 1
            }
            return iitem
          })
          item.pointsRules.sort((a,b) => {
            if(a.ruleName === b.ruleName){
              return  a.descSort - b.descSort
            }else {
              return  a.ruleName.localeCompare(b.ruleName)
            }
          })
        })
        res.data.consumePointsRuleList.map(item => {
          item.pointsRules.map(iitem => {
            if(iitem.ruleDescription.indexOf('被') > -1){
              iitem.descSort = 0
            }else{
              iitem.descSort = 1
            }
            return iitem
          })
          item.pointsRules.sort((a,b) => {
            if(a.ruleName === b.ruleName){
              return  a.descSort - b.descSort
            }else {
              return  a.ruleName.localeCompare(b.ruleName)
            }
          })
        })
        // 将后端数据映射到前端规则对象
        Object.assign(rules.value, res.data)
        console.log(rules.value)
      }
    } else {
      // 如果没有ruleId参数,则获取所有规则
src/views/pointsManage/settings/index.vue
@@ -22,7 +22,7 @@
                <el-input
                  v-model="pointRuleDetial.pointsValue"
                  size="small"
                  style="width: 80px;"
                  style="width: 50px;"
                  placeholder="请输入"
                />
                <span class="unit">积分</span>
@@ -30,7 +30,7 @@
                <el-input
                  v-model="pointRuleDetial.dailyLimit"
                  size="small"
                  style="width: 80px;"
                  style="width: 50px;"
                  placeholder="请输入"
                   v-if="pointRuleDetial.isLimit === 1"
                />
@@ -129,7 +129,7 @@
                <el-input
                  v-model="pointRuleDetials.pointsValue"
                  size="small"
                  style="width: 60px;"
                  style="width: 50px;"
                  placeholder="请输入"
                />
                <span class="unit">积分</span>
@@ -137,7 +137,7 @@
                  <el-input
                          v-model="pointRuleDetials.dailyLimit"
                          size="small"
                          style="width: 80px;"
                          style="width: 50px;"
                          placeholder="请输入"
                          v-if="pointRuleDetials.isLimit === 1"
                  />
@@ -349,6 +349,40 @@
      const res = await pointsApi.getPointsRuleById(formData)
      if (res.code === 200 && res.data) {
        res.data.getPointsRuleList.map(item => {
          item.pointsRules.map(iitem => {
            if(iitem.ruleDescription.indexOf('被') > -1){
              iitem.descSort = 0
            }else{
              iitem.descSort = 1
            }
            return iitem
          })
          item.pointsRules.sort((a,b) => {
            if(a.ruleName === b.ruleName){
             return  a.descSort - b.descSort
            }else {
              return  a.ruleName.localeCompare(b.ruleName)
            }
          })
        })
        res.data.consumePointsRuleList.map(item => {
          item.pointsRules.map(iitem => {
            if(iitem.ruleDescription.indexOf('被') > -1){
              iitem.descSort = 0
            }else{
              iitem.descSort = 1
            }
            return iitem
          })
          item.pointsRules.sort((a,b) => {
            if(a.ruleName === b.ruleName){
              return  a.descSort - b.descSort
            }else {
              return  a.ruleName.localeCompare(b.ruleName)
            }
          })
        })
        // 将后端数据映射到前端规则对象
        Object.assign(rules.value, res.data)
        console.log(rules.value)
src/views/productManage/productPriceViewer/index.vue
@@ -321,7 +321,7 @@
                <td class="value">{{ statusText(orderStatus.status) }}</td>
                <td></td>
                <td class="value link">
                  <el-link type="primary" @click="viewOrder">查看订单信息</el-link>
<!--                  <el-link type="primary" @click="viewOrder">查看订单信息</el-link>-->
                </td>
              </tr>
            </tbody>
@@ -801,7 +801,7 @@
     // 获取工作流参数
     const  wkParamsRes: any = await workFlowApi.getWorkFlowParams({
      type: type,
      unitId: '1',
      // unitId: '1',
      businessKey: type
    })
  if(wkParamsRes?.code === 200 && wkParamsRes.data?.processTemplateId){
src/views/tradeManage/buyer/index.vue
@@ -343,6 +343,7 @@
  [OrderStatus.WAIT_CONFIRM]: 'WAIT_CONFIRM',
  [OrderStatus.COMPLETED]: 'COMPLETED',
  [OrderStatus.EVALUATED]: 'EVALUATED',
  [OrderStatus.CANCELED]: 'CANCELED'
}
const formatDateTime = (val?: string) => {
@@ -454,6 +455,7 @@
    WAIT_CONFIRM: 'warning',
    COMPLETED: 'success',
    EVALUATED: 'success',
    CANCELED: 'danger'
  }
  return statusMap[status] || 'info'
}
src/views/tradeManage/confirm/index.vue
@@ -242,6 +242,7 @@
import createAxios from '@/utils/axios'
import productApi from '@/api/productApi'
import sysUserService from '@/api/sysUser'
import {queryUserDetail} from "@/api/userInfo";
const route = useRoute()
const router = useRouter()
@@ -294,7 +295,24 @@
onMounted(async () => {
  const orderId = String(route.params.id || '')
  if (!orderId) return
  // 获取用户信息
  if (!userStore.getUserId) {
    try {
      const res: any = await queryUserDetail()
      if (res?.code === 200 && res.data) {
        userStore.updateUserDetail(res.data)
      } else {
        ElMessage.error(res?.msg || '无法获取用户信息,请先登录')
        return
      }
    } catch (e) {
      console.error('获取用户详情失败:', e)
      ElMessage.error('获取用户信息失败,请稍后重试')
      return
    }
  }
  try {
    const res = (await orderApi.getOrderDetail(orderId)) as any
    const data = res?.data || {}
@@ -431,7 +449,8 @@
const submit = async () => {
  try {
    const orderId = String(route.params.id || '')
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const userId = userStore.getUserId ?  userStore.getUserId : undefined
    console.log(userId)
    
    if (!orderId || !userId) {
      ElMessage.error('订单ID或用户ID不能为空')
src/views/tradeManage/detail/index.vue
@@ -693,7 +693,8 @@
      // 检查响应格式
      const responseData = previewResponse as any
      if (responseData && responseData.code === 200 && responseData.data) {
        previewUrl = responseData.data
        previewUrl = responseData.data.replaceAll("http://192.168.20.52:9000", import.meta.env.VITE_FILE_PREVIEW_URL)
        // previewUrl = responseData.data
        console.log('使用预览URL:', previewUrl)
      } else {
        console.log('预览URL获取失败,使用下载方式')
src/views/tradeManage/evaluate/index.vue
@@ -330,6 +330,9 @@
import orderApi from '@/api/orderApi'
import { useUserInfo } from '@/stores/modules/userInfo'
import createAxios from '@/utils/axios'
import {queryUserDetail} from "@/api/userInfo";
import productApi from "@/api/productApi";
import sysUserService from "@/api/sysUser";
const route = useRoute()
const router = useRouter()
@@ -395,13 +398,61 @@
onMounted(async () => {
  const orderId = String(route.params.id || '')
  if (!orderId) return
  // 获取用户信息
  if (!userStore.getUserId) {
    try {
      const res: any = await queryUserDetail()
      if (res?.code === 200 && res.data) {
        userStore.updateUserDetail(res.data)
      } else {
        ElMessage.error(res?.msg || '无法获取用户信息,请先登录')
        return
      }
    } catch (e) {
      console.error('获取用户详情失败:', e)
      ElMessage.error('获取用户信息失败,请稍后重试')
      return
    }
  }
  try {
    const res = (await orderApi.getOrderDetail(orderId)) as any
    const data = res?.data || {}
    const statusName: string = data.orderStatus || ''
    const uiStatus = statusServerToUi[statusName] || 'INFO'
    // 根据产品id获取产品信息,更新头部展示
    try {
      if (data.productId) {
        const detailRes: any = await productApi.getProductById({ id: data.productId })
        if (detailRes?.code === 200 && detailRes.data) {
          // 用产品详情补全头信息
          data.productName = detailRes.data.name || data.productName
          data.providerName = detailRes.data.submissionUnit || data.providerName
          data.industry = detailRes.data.industrialChainName || data.industry
          data.productDesc = detailRes.data.describe || data.productDesc
          data.projectUnit = detailRes.data.importantAreaName || data.productDesc
          data.productType = detailRes.data.typeName || data.productDesc
        }
      }
    } catch (e) {
      // 忽略产品详情失败,不阻塞订单详情
    }
    // 获取用户信息
    try {
      const userRes: any = await sysUserService.getUserdetail({ userId: data.userId })
      if (userRes?.code === 200 && userRes.data) {
        // 用产品详情补全头信息
        data.unitName = userRes.data.unitName || data.unitName
        data.userName = userRes.data.name || data.userName
        data.userDept = userRes.data.departmentName || data.userDept
        data.userPhone = userRes.data.phone || data.userPhone
        data.userAccount = userRes.data.username || data.userAccount
      }
    }catch (e){
    }
    // 映射订单详情头部信息
    const head = {
@@ -498,7 +549,7 @@
const submit = async () => {
  try {
    const orderId = String(route.params.id || '')
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const userId = userStore.getUserId ? userStore.getUserId : undefined
    
    if (!orderId || !userId) {
      ElMessage.error('订单ID或用户ID不能为空')
@@ -839,7 +890,7 @@
    })
    const orderId = String(route.params.id || '')
    const userId = userStore.getUserId ? Number(userStore.getUserId) : undefined
    const userId = userStore.getUserId ?  userStore.getUserId : undefined
    const content = evaluationForm.content.trim()
    if (!orderId || !userId) {
src/views/tradeManage/upload/index.vue
@@ -255,6 +255,9 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import { useUserInfo } from '@/stores/modules/userInfo'
import createAxios from '@/utils/axios'
import productApi from "@/api/productApi";
import sysUserService from "@/api/sysUser";
import {queryUserDetail} from "@/api/userInfo";
const route = useRoute()
const router = useRouter()
@@ -310,12 +313,62 @@
    return
  }
  // 获取用户信息
  if (!userStore.getUserId) {
    try {
      const res: any = await queryUserDetail()
      if (res?.code === 200 && res.data) {
        userStore.updateUserDetail(res.data)
      } else {
        ElMessage.error(res?.msg || '无法获取用户信息,请先登录')
        return
      }
    } catch (e) {
      console.error('获取用户详情失败:', e)
      ElMessage.error('获取用户信息失败,请稍后重试')
      return
    }
  }
  try {
    const res = (await orderApi.getOrderDetail(orderId)) as any
    const data = res?.data || {}
    const statusName: string = data.orderStatus || ''
    const uiStatus = statusServerToUi[statusName] || 'INFO'
    // 根据产品id获取产品信息,更新头部展示
    try {
      if (data.productId) {
        const detailRes: any = await productApi.getProductById({ id: data.productId })
        if (detailRes?.code === 200 && detailRes.data) {
          // 用产品详情补全头信息
          data.productName = detailRes.data.name || data.productName
          data.providerName = detailRes.data.submissionUnit || data.providerName
          data.industry = detailRes.data.industrialChainName || data.industry
          data.productDesc = detailRes.data.describe || data.productDesc
          data.projectUnit = detailRes.data.importantAreaName || data.productDesc
          data.productType = detailRes.data.typeName || data.productDesc
        }
      }
    } catch (e) {
      // 忽略产品详情失败,不阻塞订单详情
    }
    // 获取用户信息
    try {
      const userRes: any = await sysUserService.getUserdetail({ userId: data.userId })
      if (userRes?.code === 200 && userRes.data) {
        // 用产品详情补全头信息
        data.unitName = userRes.data.unitName || data.unitName
        data.userName = userRes.data.name || data.userName
        data.userDept = userRes.data.departmentName || data.userDept
        data.userPhone = userRes.data.phone || data.userPhone
        data.userAccount = userRes.data.username || data.userAccount
      }
    }catch (e){
    }
    // 映射订单详情头部信息
    const head = {
@@ -756,7 +809,7 @@
      // 检查响应格式
      const responseData = previewResponse as any
      if (responseData && responseData.code === 200 && responseData.data) {
        previewUrl = responseData.data
        previewUrl = responseData.data.replaceAll("http://192.168.20.52:9000", import.meta.env.VITE_FILE_PREVIEW_URL)
        console.log('使用预览URL:', previewUrl)
      } else {
        console.log('预览URL获取失败,使用下载方式')
vite.config.ts
@@ -33,8 +33,8 @@
      // target:'http://10.209.233.16/admin',//信创正式
      // target: 'http://36.133.126.111:7099/api', //测试
      // target: 'https://zynlpt.ccccltd.cn/admin', // 正式  (要打开changeOrigin和rewrite)
         target: 'http://localhost:8089',
      // target: 'http://36.133.126.111:7099/trade-api',
      //   target: 'http://localhost:8089',
       target: 'http://36.133.126.111:7099/trade-api',
      changeOrigin: true, // 允许跨域
      rewrite: (path) => path.replace(/^\/api/, '/'), //连测试环境要注释这行,连后端个人则打开
    },