Explorar el Código

Merge remote-tracking branch 'origin/dev' into dev

2545307760@qq.com hace 8 meses
padre
commit
0e0579a416

+ 11 - 0
server/api/v1/admin/finance.go

@@ -126,6 +126,17 @@ func (fa *FinanceApi) QueryDailyFileList(c *gin.Context) {
 	}, "获取成功", c)
 }
 
+func (fa *FinanceApi) QueryProjectFinance(c *gin.Context) {
+	code := c.Query("code")
+	finance, err := financeService.QueryProjectFinance(code)
+	if err != nil {
+		response.FailWithMessage("失败", c)
+		global.GVA_LOG.Error("QueryProjectFinance ====== " + err.Error())
+		return
+	}
+	response.OkWithData(finance, c)
+}
+
 func (fa *FinanceApi) CreateDailyExpenses(c *gin.Context) {
 	var expenses dao.DailyExpenses
 	err := c.ShouldBindJSON(&expenses)

+ 44 - 0
server/api/v1/admin/project.go

@@ -124,6 +124,28 @@ func (pa *ProjectApi) QueryWorkingHours(c *gin.Context) {
 	response.OkWithData(hours, c)
 }
 
+func (pa *ProjectApi) QueryWorkingHoursList(c *gin.Context) {
+	var info request.SearchProjectList
+	err := c.ShouldBindJSON(&info)
+	if err != nil {
+		response.FailWithMessage("失败", c)
+		global.GVA_LOG.Error("QueryWorkingHoursList ====== " + err.Error())
+		return
+	}
+	list, total, err := projectService.QueryWorkingHoursList(info)
+	if err != nil {
+		response.FailWithMessage("失败", c)
+		global.GVA_LOG.Error("QueryWorkingHoursList ====== " + err.Error())
+		return
+	}
+	response.OkWithDetailed(response.PageResult{
+		List:     list,
+		Total:    total,
+		Page:     info.PageInfo.Page,
+		PageSize: info.PageInfo.PageSize,
+	}, "获取成功", c)
+}
+
 func (pa *ProjectApi) QueryCollections(c *gin.Context) {
 	code := c.Query("code")
 	collections, err := projectService.QueryCollections(code)
@@ -135,6 +157,28 @@ func (pa *ProjectApi) QueryCollections(c *gin.Context) {
 	response.OkWithData(collections, c)
 }
 
+func (pa *ProjectApi) QueryCollectionList(c *gin.Context) {
+	var info request.SearchProjectList
+	err := c.ShouldBindJSON(&info)
+	if err != nil {
+		response.FailWithMessage("失败", c)
+		global.GVA_LOG.Error("QueryCollectionList ====== " + err.Error())
+		return
+	}
+	list, total, err := projectService.QueryCollectionList(info)
+	if err != nil {
+		response.FailWithMessage("失败", c)
+		global.GVA_LOG.Error("QueryCollectionList ====== " + err.Error())
+		return
+	}
+	response.OkWithDetailed(response.PageResult{
+		List:     list,
+		Total:    total,
+		Page:     info.PageInfo.Page,
+		PageSize: info.PageInfo.PageSize,
+	}, "获取成功", c)
+}
+
 func (pa *ProjectApi) QueryReimbursementList(c *gin.Context) {
 	var info request.SearchProjectList
 	err := c.ShouldBindJSON(&info)

+ 1 - 1
server/config.yaml

@@ -196,7 +196,7 @@ system:
     db-type: mysql
     oss-type: local
     router-prefix: ""
-    addr: 8888
+    addr: 8220
     iplimit-count: 15000
     iplimit-time: 3600
     use-multipoint: false

+ 20 - 3
server/dao/collection.go

@@ -7,9 +7,10 @@ import (
 
 type Collection struct {
 	global.GVA_MODEL
-	ProjectCode string          `json:"projectCode" from:"projectCode" gorm:"comment:项目编码"`
-	Price       decimal.Decimal `json:"price" from:"price" gorm:"type:decimal(10,2);not null;comment:收款金额"`
-	Time        string          `json:"time" from:"time" gorm:"comment:收款日期;type:datetime"`
+	ProjectCode    string          `json:"projectCode" from:"projectCode" gorm:"comment:项目编码"`
+	Price          decimal.Decimal `json:"price" from:"price" gorm:"type:decimal(10,2);not null;comment:收款金额"`
+	Remarks        string          `json:"remarks" from:"remarks" gorm:"comment:备注"`
+	CollectionTime string          `json:"collectionTime" from:"collectionTime" gorm:"comment:收款日期;type:datetime"`
 }
 
 func (Collection) TableName() string {
@@ -24,6 +25,22 @@ func QueryCollection(code string) (collection []Collection, err error) {
 	return collection, err
 }
 
+// QueryCollectionList 查询报销列表
+func QueryCollectionList(limit, offset int, code, time string) (collection []Collection, total int64, err error) {
+	// 创建db
+	db := global.GVA_DB.Model(&Collection{}).Where("project_code = ?", code)
+	// 如果有条件搜索 下方会自动创建搜索语句
+	if time != "" {
+		db = db.Where("DATE_FORMAT(collection_time, '%Y-%m') = ?", time)
+	}
+	err = db.Count(&total).Error
+	if err != nil {
+		return
+	}
+	err = db.Order("id desc").Limit(limit).Offset(offset).Find(&collection).Error
+	return collection, total, err
+}
+
 // TODO:收款新增
 
 // CreateCollection 新增收款

+ 2 - 2
server/dao/feeDetails.go

@@ -11,11 +11,11 @@ type FeeDetails struct {
 	Genre           string          `json:"genre" form:"genre" gorm:"comment:项目类型"`
 	Subject         string          `json:"subject" form:"subject" gorm:"comment:科目"`
 	Remarks         string          `json:"remarks" form:"remarks" gorm:"comment:备注"`
-	Price           decimal.Decimal `json:"price" form:"price" gorm:"comment:报销金额"`
+	Price           decimal.Decimal `json:"price" form:"price" gorm:"comment:报销金额;type:decimal(10,2)"`
 }
 
 func (FeeDetails) TableName() string {
-	return "feeDetails"
+	return "fee_details"
 }
 
 // TODO:费用详情查询

+ 2 - 1
server/dao/project.go

@@ -22,6 +22,7 @@ type Project struct {
 	Files          []ProjectFile         `json:"files" form:"files" gorm:"-"`
 	WorkingHours   []ProjectWorkingHours `json:"workingHours" form:"workingHours" gorm:"-"`
 	Collection     []Collection          `json:"collection" form:"collection" gorm:"-"`
+	Reimbursement  []Reimbursement       `json:"reimbursement" form:"reimbursement" gorm:"-"`
 }
 
 func (Project) TableName() string {
@@ -54,7 +55,7 @@ func QueryProjectList(limit, offset, state int, name, time string) (project []Pr
 
 // QueryProjectByCode 查询单个项目  按编号
 func QueryProjectByCode(code string) (project Project, err error) {
-	err = global.GVA_DB.Model(&Project{}).Where("code = ?", code).First(&project).Error
+	err = global.GVA_DB.Model(&Project{}).Where("code = ?", code).Preload("ProjectState").First(&project).Error
 	return
 }
 

+ 16 - 0
server/dao/projectWorkingHours.go

@@ -19,6 +19,22 @@ func (ProjectWorkingHours) TableName() string {
 
 // TODO:工时查询
 
+// QueryWorkingHoursList 查询工时列表
+func QueryWorkingHoursList(limit, offset int, code, name string) (projectWorkingHours []ProjectWorkingHours, total int64, err error) {
+	// 创建db
+	db := global.GVA_DB.Model(&ProjectWorkingHours{}).Where("project_code = ?", code)
+	// 如果有条件搜索 下方会自动创建搜索语句
+	if name != "" {
+		db = db.Where("people LIKE ?", "%"+name+"%")
+	}
+	err = db.Count(&total).Error
+	if err != nil {
+		return
+	}
+	err = db.Order("id desc").Limit(limit).Offset(offset).Find(&projectWorkingHours).Error
+	return projectWorkingHours, total, err
+}
+
 // QueryWorkingHours 查询工时
 func QueryWorkingHours(code string) (workingHours []ProjectWorkingHours, err error) {
 	err = global.GVA_DB.Model(&ProjectWorkingHours{}).Where("project_code = ?", code).Find(&workingHours).Error

+ 17 - 12
server/dao/reimbursement.go

@@ -8,13 +8,15 @@ import (
 
 type Reimbursement struct {
 	global.GVA_MODEL
-	ProjectCode string          `json:"projectCode" form:"projectCode" gorm:"comment:项目编号"`
-	Name        string          `json:"name" form:"name" gorm:"comment:项目名称"`
-	Applicant   string          `json:"applicant" form:"applicant" gorm:"comment:报销申请人"`
-	Approval    string          `json:"approval" form:"approval" gorm:"comment:报销审批人"`
-	Price       decimal.Decimal `json:"price" form:"price" gorm:"comment:项目金额"`
-	Genre       string          `json:"genre" form:"genre" gorm:"comment:项目类型"`
-	FeeDetails  []FeeDetails    `json:"feeDetails" form:"feeDetails" gorm:"-"`
+	ProjectCode     string          `json:"projectCode" form:"projectCode" gorm:"comment:项目编号"`
+	Name            string          `json:"name" form:"name" gorm:"comment:项目名称"`
+	Applicant       string          `json:"applicant" form:"applicant" gorm:"comment:报销申请人"`
+	ApplicationTime string          `json:"applicationTime" form:"applicationTime" gorm:"comment:申请日期"`
+	Approval        int             `json:"approval" form:"approval" gorm:"comment:报销审批人"`
+	User            SysUser         `json:"user" form:"user" gorm:"foreignKey:Approval;references:id;"`
+	Price           decimal.Decimal `json:"price" form:"price" gorm:"comment:项目金额;type:decimal(10,2)"`
+	Genre           string          `json:"genre" form:"genre" gorm:"comment:费用类型"`
+	FeeDetails      []FeeDetails    `json:"feeDetails" form:"feeDetails" gorm:"-"`
 }
 
 func (Reimbursement) TableName() string {
@@ -23,24 +25,27 @@ func (Reimbursement) TableName() string {
 
 // TODO:报销查询
 
-// QueryReimbursementList 查询报销
-func QueryReimbursementList(limit, offset int, code, name string) (reimbursement []Reimbursement, total int64, err error) {
+// QueryReimbursementList 查询报销列表
+func QueryReimbursementList(limit, offset int, code, name, time string) (reimbursement []Reimbursement, total int64, err error) {
 	// 创建db
-	db := global.GVA_DB.Model(&Project{}).Where("project_code = ?", code)
+	db := global.GVA_DB.Model(&Reimbursement{}).Where("project_code = ?", code)
 	// 如果有条件搜索 下方会自动创建搜索语句
 	if name != "" {
 		db = db.Where("name LIKE ?", "%"+name+"%")
 	}
+	if time != "" {
+		db = db.Where("DATE_FORMAT(application_time, '%Y-%m') = ?", time)
+	}
 	err = db.Count(&total).Error
 	if err != nil {
 		return
 	}
-	err = db.Order("id desc").Limit(limit).Offset(offset).Find(&reimbursement).Error
+	err = db.Order("id desc").Limit(limit).Offset(offset).Preload("User").Find(&reimbursement).Error
 	return reimbursement, total, err
 }
 
 func QueryReimbursement(code string) (reimbursement []Reimbursement, err error) {
-	err = global.GVA_DB.Model(&Reimbursement{}).Where("project_code = ?", code).Find(&reimbursement).Error
+	err = global.GVA_DB.Model(&Reimbursement{}).Where("project_code = ?", code).Preload("User").Find(&reimbursement).Error
 	return reimbursement, err
 }
 

+ 2 - 0
server/initialize/gorm.go

@@ -58,6 +58,8 @@ func RegisterTables() {
 		dao.DailyExpenses{},
 		dao.DailyFeeDetails{},
 		dao.DailyFile{},
+		dao.Reimbursement{},
+		dao.FeeDetails{},
 	)
 	if err != nil {
 		global.GVA_LOG.Error("register table failed", zap.Error(err))

+ 1 - 0
server/model/common/request/common.go

@@ -41,6 +41,7 @@ type SearchProjectList struct {
 	PageInfo PageInfo `json:"pageInfo" form:"pageInfo"`
 	Code     string   `json:"code" form:"code"`
 	Name     string   `json:"name" form:"name"`
+	Time     string   `json:"time" form:"time"`
 }
 
 type SearchProjectFileList struct {

+ 1 - 0
server/router/admin/finance.go

@@ -34,5 +34,6 @@ func (s *ProjectRouter) InitFinanceRouter(Router *gin.RouterGroup) {
 		financeRouterWithoutRecord.POST("queryBorrowingList", financeApi.QueryBorrowingList)
 		financeRouterWithoutRecord.GET("queryBorrowing", financeApi.QueryBorrowing)
 		financeRouterWithoutRecord.POST("queryDailyFileList", financeApi.QueryDailyFileList)
+		financeRouterWithoutRecord.GET("queryProjectFinance", financeApi.QueryProjectFinance)
 	}
 }

+ 3 - 1
server/router/admin/project.go

@@ -42,7 +42,9 @@ func (s *ProjectRouter) InitProjectRouter(Router *gin.RouterGroup) {
 		projectRouterWithoutRecord.GET("queryProjectsInfo", projectApi.QueryProjectsInfo)
 		projectRouterWithoutRecord.GET("queryWorkingHours", projectApi.QueryWorkingHours)
 		projectRouterWithoutRecord.GET("queryCollection", projectApi.QueryCollections)
-		projectRouterWithoutRecord.GET("queryReimbursementList", projectApi.QueryReimbursementList)
+		projectRouterWithoutRecord.POST("queryWorkingHoursList", projectApi.QueryWorkingHoursList)
+		projectRouterWithoutRecord.POST("queryCollectionList", projectApi.QueryCollectionList)
+		projectRouterWithoutRecord.POST("queryReimbursementList", projectApi.QueryReimbursementList)
 		projectRouterWithoutRecord.GET("queryReimbursement", projectApi.QueryReimbursement)
 		projectRouterWithoutRecord.POST("projectFilesDownload", projectApi.ProjectFilesDownload)
 		projectRouterWithoutRecord.GET("queryProjectState", projectApi.QueryProjectState)

+ 31 - 0
server/service/admin/finance.go

@@ -49,6 +49,37 @@ func (fs *FinanceService) QueryDailyFileList(info request.SearchIdNameGenre) (li
 	return dailyFiles, total, err
 }
 
+func (fs *FinanceService) QueryProjectFinance(code string) (dao.Project, error) {
+	project, err := dao.QueryProjectByCode(code)
+	if err != nil {
+		return dao.Project{}, err
+	}
+	collection, err := dao.QueryCollection(code)
+	if err != nil {
+		return dao.Project{}, err
+	}
+	workingHours, err := dao.QueryWorkingHours(code)
+	if err != nil {
+		return dao.Project{}, err
+	}
+	reimbursements, err := dao.QueryReimbursement(code)
+	if err != nil {
+		return dao.Project{}, err
+	}
+	for i, reimbursement := range reimbursements {
+		details, err := dao.QueryFeeDetails(int(reimbursement.ID))
+		if err != nil {
+			return dao.Project{}, err
+		}
+		reimbursements[i].FeeDetails = details
+	}
+	project.Collection = collection
+	project.WorkingHours = workingHours
+	project.Reimbursement = reimbursements
+
+	return project, err
+}
+
 func (fs *FinanceService) CreateDailyExpenses(expenses dao.DailyExpenses) error {
 	return expenses.CreateDailyExpenses()
 }

+ 13 - 1
server/service/admin/project.go

@@ -80,14 +80,25 @@ func (ps *ProjectService) QueryWorkingHours(code string) ([]dao.ProjectWorkingHo
 	return dao.QueryWorkingHours(code)
 }
 
+func (ps *ProjectService) QueryWorkingHoursList(info request.SearchProjectList) (list interface{}, total int64, err error) {
+	limit := info.PageInfo.PageSize
+	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
+	return dao.QueryWorkingHoursList(limit, offset, info.Code, info.Name)
+}
+
 func (ps *ProjectService) QueryCollections(code string) ([]dao.Collection, error) {
 	return dao.QueryCollection(code)
 }
 
+func (ps *ProjectService) QueryCollectionList(info request.SearchProjectList) (list interface{}, total int64, err error) {
+	limit := info.PageInfo.PageSize
+	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
+	return dao.QueryCollectionList(limit, offset, info.Code, info.Time)
+}
 func (ps *ProjectService) QueryReimbursementList(info request.SearchProjectList) (list interface{}, total int64, err error) {
 	limit := info.PageInfo.PageSize
 	offset := info.PageInfo.PageSize * (info.PageInfo.Page - 1)
-	return dao.QueryReimbursementList(limit, offset, info.Code, info.Name)
+	return dao.QueryReimbursementList(limit, offset, info.Code, info.Name, info.Time)
 }
 
 func (ps *ProjectService) QueryReimbursement(code string) ([]dao.Reimbursement, error) {
@@ -124,6 +135,7 @@ func (ps *ProjectService) CreateOrUpdateWorkingHours(workingHours dao.ProjectWor
 		// 新增工时+已有工时
 		zongHours := hours.Days + workingHours.Days
 		workingHours.Days = zongHours
+		workingHours.Price = hours.Price
 
 		err = workingHours.UpdateWorkingHours()
 		return err

+ 6 - 3
web/.env.development

@@ -1,11 +1,14 @@
 ENV = 'development'
+
 VITE_CLI_PORT = 8080
 VITE_SERVER_PORT = 8220
 VITE_BASE_API = /api
 VITE_FILE_API = /api
-VITE_BASE_PATH = http://192.168.110.116
+VITE_BASE_PATH = http://127.0.0.1
 VITE_POSITION = close
-VITE_EDITOR = vscode
+VITE_EDITOR = webstorm
+
+
 // VITE_EDITOR = webstorm 如果使用webstorm开发且要使用dom定位到代码行功能 请先自定添加 webstorm到环境变量 再将VITE_EDITOR值修改为webstorm
 // 如果使用docker-compose开发模式,设置为下面的地址或本机主机IP
-//VITE_BASE_PATH = http://177.7.0.12
+//VITE_BASE_PATH = http://106.52.134.22

+ 0 - 1
web/src/pinia/project/project.js

@@ -18,7 +18,6 @@ export const editorData = defineStore('counter', () => {
   const getTypeList = () => {
     getFileType().then(res => {
       if (res.code === 0) {
-        console.log(res.data)
         typeList.length = 0
         typeList.push(...res.data)
       }

+ 31 - 0
web/src/utils/common.js

@@ -0,0 +1,31 @@
+export const numToChinese = (num) => {
+  const fraction = ['角', '分']
+  const digit = [
+    '零', '壹', '贰', '叁', '肆',
+    '伍', '陆', '柒', '捌', '玖'
+  ]
+  const unit = [
+    ['元', '万', '亿'],
+    ['', '拾', '佰', '仟']
+  ]
+  const head = num < 0 ? '欠' : ''
+  num = Math.abs(num)
+
+  let s = ''
+  for (let i = 0; i < fraction.length; i++) {
+    s += (digit[Math.floor(num * 10 * Math.pow(10, i)) % 10] + fraction[i]).replace(/零./, '')
+  }
+  s = s || '整'
+  num = Math.floor(num)
+
+  for (let i = 0; i < unit[0].length && num > 0; i++) {
+    let p = ''
+    for (let j = 0; j < unit[1].length && num > 0; j++) {
+      p = digit[num % 10] + unit[1][j] + p
+      num = Math.floor(num / 10)
+    }
+    s = p.replace(/(零.)*零$/, '').replace(/^$/, '零') + unit[0][i] + s
+  }
+
+  return head + s.replace(/(零.)*零元/, '元').replace(/(零.)+/g, '零').replace(/^整$/, '零元整')
+}

+ 12 - 3
web/src/view/projectManage/projectApproval/projectApproval.vue

@@ -87,9 +87,18 @@
                 v-model="basicMessage.level"
                 @change="changeUrgency"
               >
-                <el-radio :value="1">正常</el-radio>
-                <el-radio :value="2">重要</el-radio>
-                <el-radio :value="3">紧急</el-radio>
+                <el-radio
+                  :value="1"
+                  :label="1"
+                >正常</el-radio>
+                <el-radio
+                  :value="2"
+                  :label="2"
+                >重要</el-radio>
+                <el-radio
+                  :value="3"
+                  :label="3"
+                >紧急</el-radio>
               </el-radio-group>
             </el-form-item>
           </el-col>

+ 28 - 15
web/src/view/projectManage/projectDetails/projectDetails.vue

@@ -389,9 +389,18 @@
             v-model="editData.level"
             @change="changeUrgency"
           >
-            <el-radio :value="1">正常</el-radio>
-            <el-radio :value="2">重要</el-radio>
-            <el-radio :value="3">紧急</el-radio>
+            <el-radio
+              :value="1"
+              :label="1"
+            >正常</el-radio>
+            <el-radio
+              :value="2"
+              :label="2"
+            >重要</el-radio>
+            <el-radio
+              :value="3"
+              :label="3"
+            >紧急</el-radio>
           </el-radio-group>
         </el-form-item>
         <el-form-item label="项目状态">
@@ -463,6 +472,9 @@ import { ElMessage, ElMessageBox } from 'element-plus'
 import OptionEdit from './components/optionEdit.vue'
 import { editorData } from '@/pinia/project/project'
 import { fileDownload } from '@/api/dailyFile'
+import { useRoute, useRouter } from 'vue-router'
+const router = useRouter()
+const route = useRoute()
 
 defineOptions({
   name: 'ProjectDetails'
@@ -471,7 +483,7 @@ defineOptions({
 // 数据
 const editor = editorData()
 const fileCondition = reactive({
-  code: 'LCZM202407161229',
+  code: route.query.code,
   name: '',
   genre: 0,
   pageInfo: {
@@ -525,7 +537,7 @@ const projectState = computed(() => {
 // .............................................
 // 方法
 onMounted(() => {
-  projectMessage('LCZM202407161229')
+  projectMessage(route.query.code)
   queryFile()
   editor.getStateList()
   editor.getTypeList()
@@ -553,7 +565,7 @@ const projectMessage = (code) => {
 
 // 重置
 const resetData = () => {
-  fileCondition.code = 'LCZM202407161229'
+  fileCondition.code = route.query.code
   fileCondition.name = ''
   fileCondition.genre = 0
   fileCondition.pageInfo = {
@@ -590,7 +602,7 @@ const queryFile = () => {
 const editBasicMessage = () => {
   const data = {
     id: editData.ID,
-    code: 'LCZM202407161229',
+    code: route.query.code,
     name: editData.name,
     principal: editData.principal,
     price: parseInt(editData.price),
@@ -619,14 +631,15 @@ const editBasicMessage = () => {
         duration: 2000
       })
       messagePopupShow.value = false
-      projectMessage('LCZM202407161229')
+      projectMessage(route.query.code)
     }
   })
 }
 
 const messageEdit = () => {
-  messagePopupShow.value = true
   Object.assign(editData, information)
+  console.log(editData)
+  messagePopupShow.value = true
 }
 // 上传文件
 const fileDialogClose = () => {
@@ -662,7 +675,7 @@ const supplementFile = () => {
       formData.append('file', item.raw)
     })
     formData.append('genre', uploadFileType.value)
-    formData.append('code', 'LCZM202407161229')
+    formData.append('code', route.query.code)
     console.log(formData.get('genre'))
     createProjectFile(formData).then(res => {
       if (res.code === 0) {
@@ -690,7 +703,7 @@ const downloadTips = () => {
     .then(() => {
       const type = fileType.value === '' ? 0 : fileType.value
       const data = {
-        code: 'LCZM202407161229',
+        code: route.query.code,
         genre: type,
         name: fileCondition.name
       }
@@ -699,7 +712,7 @@ const downloadTips = () => {
         const link = document.createElement('a')
         const href = window.URL.createObjectURL(res) // 创建下载的链接
         link.href = href
-        link.download = 'LCZM202407161229.zip' // 下载后文件名
+        link.download = route.query.code + '.zip' // 下载后文件名
         document.body.appendChild(link)
         link.click() // 点击下载
         document.body.removeChild(link) // 下载完成移除元素
@@ -771,7 +784,7 @@ const projectDeletes = async() => {
     .then(async() => {
       const type = fileType.value === '' ? 0 : fileType.value
       const data = {
-        code: 'LCZM202407161229',
+        code: route.query.code,
         genre: type,
         name: fileCondition.name
       }
@@ -813,8 +826,8 @@ const headSelect = () => {
 }
 
 //
-const changeUrgency = () => {
-  console.log(editData.level)
+const changeUrgency = (v) => {
+  console.log(v)
 }
 
 const changeFilePage = (value) => {

+ 21 - 3
web/src/view/projectManage/projectList/projectList.vue

@@ -55,7 +55,7 @@
           <el-button
             type="primary"
             :icon="DocumentCopy"
-            @click="queryProject"
+            @click="jumpProjectApproval"
           >立项
           </el-button>
           <el-button
@@ -224,7 +224,7 @@
             >
               <template #default="scope">
                 <el-button
-                  @click="projectEdit(scope.$index, scope.row)"
+                  @click="jumpProjectDetails(scope.row)"
                 >
                   详情
                 </el-button>
@@ -262,6 +262,9 @@ import { DocumentCopy, RefreshLeft, Search } from '@element-plus/icons-vue'
 import { getProjectList, projectDataScreen, deleteProject } from '@/api/project'
 import { reactive, ref, onMounted } from 'vue'
 import { ElMessage, ElMessageBox } from 'element-plus'
+import { useRoute, useRouter } from 'vue-router'
+const router = useRouter()
+const route = useRoute()
 
 defineOptions({
   name: 'ProjectList'
@@ -305,7 +308,14 @@ const changeState = (value) => {
     }
   })
 }
-const projectEdit = (index, row) => {
+const jumpProjectDetails = (row) => {
+  const { href } = router.resolve({
+    path: '/layout/projectManage/projectDetails', // 路径
+    query: {
+      code: row.code,
+    }// 传参
+  })
+  location.href = (href)
 }
 const projectDelete = (index, row) => {
   ElMessageBox.confirm(
@@ -398,6 +408,14 @@ const queryProject = () => {
 const changePage = (value) => {
   console.log(value)
 }
+
+const jumpProjectApproval = () => {
+  const { href } = router.resolve({
+    path: '/layout/projectManage/projectApproval', // 路径
+  })
+  location.href = (href)
+}
+
 </script>
 
 <style scoped lang="less">

+ 3 - 2
web/vite.config.js

@@ -15,7 +15,7 @@ import { svgBuilder } from './vitePlugin/svgIcon/svgIcon.js'
 // @see https://cn.vitejs.dev/config/
 export default ({
   command,
-  mode
+  mode,
 }) => {
   const NODE_ENV = mode || 'development'
   const envFiles = [
@@ -56,7 +56,8 @@ export default ({
       alias,
     },
     define: {
-      'process.env': {}
+      'process.env': {},
+      __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
     },
     server: {
       // 如果使用docker-compose开发模式,设置为false