Kaynağa Gözat

合同台账跳转到项目详情页面

songxy 1 yıl önce
ebeveyn
işleme
05b641c61d

+ 8 - 1
client/src/views/OaSystem/financialManagement/ptbxPage/index.vue

@@ -150,7 +150,13 @@ import { dateFormatter2 } from '@/utils/formatTime'
 import TableLayout from '../../oaViews/layout/TableLayout.vue'
 
 defineOptions({ name: 'CommonCost' })
-const router = useRouter()
+
+// const isThird = ref<boolean>(true)
+// const route = useRoute()
+// const { projectId, applyDate } = route.query
+// if (projectId) {
+//   isThird.value = false
+// }
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
@@ -209,6 +215,7 @@ const handleQuery = () => {
 }
 
 const operateClick = (row: any) => {
+  const router = useRouter()
   router.push({
     path: '/processLook',
     query: {

+ 1 - 2
client/src/views/OaSystem/projectCenter/projectBook/deptProject.vue

@@ -132,7 +132,7 @@
       <div class="pageBox">
         <el-pagination
           v-model:current-page="queryParams.pageNo"
-          :page-size="10"
+          :page-size="queryParams.pageSize"
           background
           layout="total, prev, pager, next, jumper"
           :total="total"
@@ -156,7 +156,6 @@ const xmztMap: any = { 0: '立项申请中', 1: '进行中', 2: '已结项', 3:
 const router = useRouter()
 const { wsCache } = useCache()
 const user = wsCache.get(CACHE_KEY.USER)
-const userId = user.user.id ? user.user.id : ''
 const deptId = user.user.deptId ? user.user.deptId : ''
 const tableRef: any = ref(null)
 const tableHeight: any = ref(0)

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectBook/myProject.vue

@@ -132,7 +132,7 @@
       <div class="pageBox">
         <el-pagination
           v-model:current-page="queryParams.pageNo"
-          :page-size="15"
+          :page-size="queryParams.pageSize"
           background
           layout="total, prev, pager, next, jumper"
           :total="total"

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectBook/projectBook.vue

@@ -134,7 +134,7 @@
       <div class="pageBox">
         <el-pagination
           v-model:current-page="queryParams.pageNo"
-          :page-size="15"
+          :page-size="queryParams.pageSize"
           background
           layout="total, prev, pager, next, jumper"
           :total="total"

+ 9 - 1
client/src/views/OaSystem/projectCenter/projectDetail/components/xmcb/index.vue

@@ -114,7 +114,6 @@
 <script setup lang="ts">
 import { useRoute } from 'vue-router'
 import request from '@/config/axios'
-import ModalBtn from '@/components/Modal/ModalBtn.vue'
 import { getProjectWithChildrenById } from '@/service/project'
 import NormalCost from './normalCost.vue'
 import TravelCost from './travelCost.vue'
@@ -215,6 +214,15 @@ const costVisible = ref<boolean>(false)
 const costIndex = ref<number>(0)
 const costTitle = ref<string>('项目普通报销成本查看')
 const clickHandler = (index: number) => {
+  // const router = useRouter()
+  // if (index === 0) {
+  //   router.push({
+  //     path: 'oaSystem/financialManagement/ptbxPage',
+  //     query: {
+  //       projectId: projectId.value,
+  //     }
+  //   })
+  // }
   costVisible.value = true
   costIndex.value = index
   costTitle.value =

+ 46 - 6
client/src/views/OaSystem/projectCenter/projectDetail/components/xmxx/AddSubProject.vue

@@ -2,6 +2,8 @@
 import { toReactive } from '@vueuse/core'
 import { ProjectId } from '@/interface/project'
 import { useMutation } from '@tanstack/vue-query'
+import { ElMessageBox } from 'element-plus'
+import type { Action } from 'element-plus'
 import { postSubProject } from '@/service/project'
 import UserOrgTree from '@/views/OaSystem/components/UserOrgTree/index.vue'
 import DeptTree from '@/views/OaSystem/components/DeptTree/index.vue'
@@ -43,6 +45,12 @@ const _projectChildFormSource = {
   projectTypeName: '',
   xzqdm: ''
 }
+const rules = reactive({
+  xmmc: [{ required: true, message: '请输入项目名称', trigger: 'blur' }],
+  xmjlId: [{ required: true, message: '请选择项目经理', trigger: 'change' }],
+  zrbmId: [{ required: true, message: '请选择责任部门', trigger: 'change' }]
+})
+const ruleFormRef = ref<FormInstance>()
 const projectChildForm = ref(_projectChildFormSource)
 const { mutate: addSubProject } = useMutation(postSubProject, {
   onSuccess: () => {
@@ -50,6 +58,7 @@ const { mutate: addSubProject } = useMutation(postSubProject, {
     projectChildForm.value = _projectChildFormSource
   }
 })
+const message = useMessage() // 消息弹窗
 const submitProjectChild = () => {
   projectChildForm.value.xmbh = projectNo.value
   projectChildForm.value.shareRatio = props.parentData.shareRatio
@@ -60,7 +69,24 @@ const submitProjectChild = () => {
     pid: props.parentData.mainProjectId,
     ...projectChildForm.value
   }
-  addSubProject(sendData)
+  if (sendData.xmmc === '') {
+    message.error('项目名称不能为空!')
+    return
+  }
+  if (sendData.xmjlId === '') {
+    message.error('项目经理不能为空!')
+    return
+  }
+  if (sendData.zrbmId === '') {
+    message.error('责任部门不能为空!')
+    return
+  }
+  ElMessageBox.alert('添加子项目后将无法撤销,确认是否添加子项目?', '提交确认', {
+    confirmButtonText: 'OK',
+    callback: (action: Action) => {
+      if (action === 'confirm') addSubProject(sendData)
+    }
+  })
 }
 const nodeClickHandler = (data: any) => {
   projectChildForm.value.zrbm = data.label
@@ -79,27 +105,27 @@ const xmjlNodeClickHandler = (data: any) => {
     <div class="tabContent">
       <div class="tabContentOne">
         <div class="formBox">
-          <el-form :model="projectChildForm">
+          <el-form :model="projectChildForm" ref="ruleFormRef" :rules="rules">
             <h4>基本信息</h4>
             <el-row>
               <el-col :span="24">
-                <el-form-item label="项目名称">
+                <el-form-item label="项目名称" class="required">
                   <el-input v-model="projectChildForm.xmmc" />
                 </el-form-item>
               </el-col>
             </el-row>
             <el-row :gutter="24">
               <el-col :span="12">
-                <el-form-item label="项目经理">
+                <el-form-item label="项目经理" class="required">
                   <UserOrgTree v-model="projectChildForm.xmjlId" @node-click="xmjlNodeClickHandler"
                 /></el-form-item>
               </el-col>
               <el-col :span="12">
-                <el-form-item label="责任部门">
+                <el-form-item label="责任部门" class="required">
                   <DeptTree
                     class="form-item-disable-style"
                     @node-click="nodeClickHandler"
-                    v-model="projectChildForm['zrbmId']"
+                    v-model="projectChildForm.zrbmId"
                   />
                 </el-form-item>
               </el-col>
@@ -228,5 +254,19 @@ const xmjlNodeClickHandler = (data: any) => {
     text-align: right;
     padding-right: 20px;
   }
+  .required {
+    position: relative;
+    &::before {
+      content: '*';
+      position: absolute;
+      left: -10px;
+      top: 12px;
+      transform: translateY(-50%);
+      width: 10px;
+      height: 10px;
+      color: #f00;
+      border-radius: 50%;
+    }
+  }
 }
 </style>

+ 1 - 1
client/src/views/OaSystem/projectCenter/purchaseContract/deptContract.vue

@@ -249,7 +249,7 @@ const handleCurrentChange = (pageNo: number) => {
 }
 const operateClick = (row: any) => {
   router.push({
-    path: '/oaSystem/projectCenter/projectDetail',
+    path: '/projectDetail',
     query: { id: row.projectId, contractId: row.id }
   })
 }

+ 1 - 1
client/src/views/OaSystem/projectCenter/purchaseContract/myContract.vue

@@ -249,7 +249,7 @@ const handleCurrentChange = (pageNo: number) => {
 }
 const operateClick = (row: any) => {
   router.push({
-    path: '/oaSystem/projectCenter/projectDetail',
+    path: '/projectDetail',
     query: { id: row.projectId, contractId: row.id }
   })
 }

+ 1 - 2
client/src/views/OaSystem/projectCenter/purchaseContract/purchaseContract.vue

@@ -233,9 +233,8 @@ const handleCurrentChange = (pageNo: number) => {
   queryContractListAjax()
 }
 const operateClick = (row: any) => {
-  console.log('hhhhhh')
   router.push({
-    path: '/oaSystem/projectCenter/projectDetail',
+    path: '/projectDetail',
     query: { id: row.projectId, contractId: row.id }
   })
 }