Explorar o código

修改需求发布

zs hai 11 meses
pai
achega
22d023a5a1
Modificáronse 2 ficheiros con 20 adicións e 2 borrados
  1. 14 2
      src/views/release/index.vue
  2. 6 0
      src/views/release/parts/demand.vue

+ 14 - 2
src/views/release/index.vue

@@ -23,6 +23,7 @@ const user = computed(() => userStore.user)
 // 接口
 import { AchievementStore } from '@/store/api/platform/achievement'
 import { DemandStore } from '@/store/api/platform/demand'
+import { SupplyStore } from '@/store/api/platform/supply'
 import { ProjectStore } from '@/store/api/platform/project'
 import { MatchStore } from '@/store/api/platform/match'
 import { DictDataStore } from '@/store/api/system/dictData'
@@ -31,6 +32,7 @@ const demandStore = DemandStore()
 const projectStore = ProjectStore()
 const matchStore = MatchStore()
 const dictDataStore = DictDataStore()
+const supplyStore = SupplyStore()
 // 组件
 import demand from './parts/demand.vue'
 import project from './parts/project.vue'
@@ -44,6 +46,7 @@ const router = useRouter()
 const type = ref('0')
 const routeType = ref('0')
 const form = ref({})
+const typeDemand = ref('0')
 // 字典表
 const fieldList = ref([])
 const statusList = ref([])
@@ -111,14 +114,22 @@ const search = async (query = { skip: 0, limit }) => {
   }
   let res
   if (routeType.value == 'achievement') res = await achieveStore.query(info)
-  else if (routeType.value == 'demand') res = await demandStore.query(info)
-  else if (routeType.value == 'project') res = await projectStore.query(info)
+  else if (routeType.value == 'demand') {
+    if (typeDemand.value == '0') res = await demandStore.query(info)
+    else if (typeDemand.value == '1') res = await supplyStore.query(info)
+  } else if (routeType.value == 'project') res = await projectStore.query(info)
   else if (routeType.value == 'match') res = await matchStore.query(info)
   if (res.errcode == '0') {
     list.value = res.data
     total.value = res.total
   }
 }
+const handleClick = async (tab) => {
+  typeDemand.value = tab.props.name
+  loading.value = true
+  await search({ skip, limit })
+  loading.value = false
+}
 const searchOther = async () => {
   let result
   // 技术领域
@@ -262,6 +273,7 @@ provide('total', total)
 provide('currentPage', currentPage)
 provide('sizeChange', sizeChange)
 provide('changePage', changePage)
+provide('handleClick', handleClick)
 </script>
 <style scoped lang="scss">
 .main {

+ 6 - 0
src/views/release/parts/demand.vue

@@ -5,6 +5,10 @@
         <el-button type="primary" @click="toCommon('1')">发布需求</el-button>
       </el-col>
       <el-col :span="24" class="one_2">
+        <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
+          <el-tab-pane label="需求" name="0"></el-tab-pane>
+          <el-tab-pane label="供给" name="1"></el-tab-pane>
+        </el-tabs>
         <List></List>
       </el-col>
     </el-col>
@@ -123,6 +127,7 @@ const type = inject('type')
 const DemandRules = ref()
 const toCommon = inject('toCommon')
 const submitForm = inject('submitForm')
+const handleClick = inject('handleClick')
 // 字典表
 const isUseList = ref([])
 const statusList = ref([])
@@ -154,6 +159,7 @@ onMounted(async () => {
   })
   await searchOther()
 })
+
 const searchOther = async () => {
   let result
   // 是否使用