zs 3 months ago
parent
commit
74d9282aa6

+ 21 - 0
src/store/api/platform/matchExt.js

@@ -78,6 +78,23 @@ export const MatchExtStore = defineStore('matchExt', () => {
     const res = await axios.$get(`${url}/step5/sms/${payload}`)
     return res
   }
+  const step5Sup = async (payload) => {
+    const id = get(payload, 'id', get(payload, '_id'))
+    const res = await axios.$post(`${url}/step5/supplement/${id}`, payload)
+    return res
+  }
+  const step6 = async (payload) => {
+    const res = await axios.$post(`${url}/step6`, payload)
+    return res
+  }
+  const step7 = async (payload) => {
+    const res = await axios.$post(`${url}/step7`, payload)
+    return res
+  }
+  const step8 = async (payload) => {
+    const res = await axios.$post(`${url}/step8`, payload)
+    return res
+  }
   return {
     query,
     fetch,
@@ -94,6 +111,10 @@ export const MatchExtStore = defineStore('matchExt', () => {
     step5,
     step5Time,
     step5Sms,
+    step5Sup,
+    step6,
+    step7,
+    step8,
     del
   }
 })

+ 5 - 0
src/store/api/platform/matchReg.js

@@ -30,11 +30,16 @@ export const MatchRegStore = defineStore('matchReg', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const exportReg = async (payload) => {
+    const res = await axios.$get(`${url}/export/${payload}`)
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
+    exportReg,
     del
   }
 })

+ 68 - 3
src/views/home/index.vue

@@ -29,7 +29,7 @@
         <div class="content">
           <one v-if="info.ext_status == '0'" :info="info" @toExamtion="toExamtion" @toExport="toExport"></one>
           <two v-if="info.ext_status == '1' || info.ext_status == '2' || info.ext_status == '3' || info.ext_status == '4'" :info="info" @toStep2="toStep2" @stepFill="stepFill" @toStep3="toStep3" @toStep4="toStep4" @toExport="toExport" @step4Score="step4Score" @toStep5="toStep5" @toFinals="toFinals"></two>
-          <thr v-if="info.ext_status == '5' || info.ext_status == '6' || info.ext_status == '7' || info.ext_status == '8'" :info="info" @toExport="toExport" @step5Time="step5Time" @toMessage="toMessage"></thr>
+          <thr v-if="info.ext_status == '5' || info.ext_status == '6' || info.ext_status == '7' || info.ext_status == '8'" :info="info" @toExport="toExport" @step5Time="step5Time" @toMessage="toMessage" @toStep6="toStep6" @toPerson="toPerson" @toStep7="toStep7" @toStep8="toStep8"></thr>
         </div>
       </div>
     </div>
@@ -47,6 +47,8 @@ const user = computed(() => userStore.user)
 import { DictDataStore } from '@/store/api/system/dictData'
 import { MatchStore } from '@/store/api/platform/match'
 import { MatchExtStore } from '@/store/api/platform/matchExt'
+import { MatchRegStore } from '@/store/api/platform/matchReg'
+const matchRegStore = MatchRegStore()
 const matchExtStore = MatchExtStore()
 const dictDataStore = DictDataStore()
 const store = MatchStore()
@@ -183,8 +185,11 @@ const toStep4 = () => {
     .catch(() => {})
 }
 // 导出
-const toExport = (selectionList) => {
-  console.log(selectionList)
+const toExport = async () => {
+  const res = await matchRegStore.exportReg(route.query.id)
+  if ($checkRes(res, true)) {
+    window.open(res.data)
+  }
 }
 // 上传初审分数
 const step4Score = async (data) => {
@@ -254,6 +259,66 @@ const toMessage = () => {
     })
     .catch(() => {})
 }
+// 进入决赛名单公示阶段
+const toStep6 = () => {
+  ElMessageBox.confirm('是否确定进入决赛名单公示阶段?', '赛事进行', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      const res = await matchExtStore.step6({ match_id: route.query.id })
+      if ($checkRes(res, true)) {
+        search()
+      }
+    })
+    .catch(() => {})
+}
+// 补充决赛人员
+const toPerson = (data) => {
+  ElMessageBox.confirm('是否确定补充该人员参加决赛?', '赛事进行', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      const res = await matchExtStore.step5Sup({ id: route.query.id, user_id: data.user_id })
+      if ($checkRes(res, true)) {
+        search()
+      }
+    })
+    .catch(() => {})
+}
+// 进入决赛赛事进行阶段
+const toStep7 = () => {
+  ElMessageBox.confirm('是否确定进入决赛赛事进行阶段?', '赛事进行', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      const res = await matchExtStore.step7({ match_id: route.query.id })
+      if ($checkRes(res, true)) {
+        search()
+      }
+    })
+    .catch(() => {})
+}
+// 进入决赛赛事结束阶段
+const toStep8 = () => {
+  ElMessageBox.confirm('是否确定进入决赛赛事结束阶段?', '赛事进行', {
+    confirmButtonText: '确认',
+    cancelButtonText: '取消',
+    type: 'warning'
+  })
+    .then(async () => {
+      const res = await matchExtStore.step8({ match_id: route.query.id })
+      if ($checkRes(res, true)) {
+        search()
+      }
+    })
+    .catch(() => {})
+}
 provide('extList', extList)
 provide('isUseList', isUseList)
 </script>

+ 1 - 8
src/views/match/one.vue

@@ -188,14 +188,7 @@ const sizeChange = (limits) => {
 }
 // 导出
 const toExport = () => {
-  if (selectionList.value && selectionList.value.length > 0) {
-    emits('toExport', selectionList)
-  } else {
-    ElMessage({
-      message: '请选择要导出的数据!',
-      type: 'warning'
-    })
-  }
+  emits('toExport')
 }
 const toClose = async () => {
   is_look.value = false

+ 62 - 25
src/views/match/thr.vue

@@ -4,7 +4,7 @@
       <el-col :span="10">
         <el-form ref="ruleFormRef" :model="timeForm" :rules="rules" label-width="auto" class="form" label-position="left">
           <el-form-item label="设置决赛时间" prop="start_time">
-            <el-date-picker format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" v-model="timeForm.start_time" type="datetime" placeholder="请选择决赛时间" style="width: 50%" />
+            <el-date-picker format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" v-model="timeForm.start_time" type="datetime" placeholder="请选择决赛时间" style="width: 90%" />
           </el-form-item>
         </el-form>
       </el-col>
@@ -17,7 +17,8 @@
     </el-row>
     <el-col :span="14" class="export">
       <div class="one_left" @click="toExport">导出</div>
-      <div class="one_left" @click="toMessage">对已经设置决赛时间的报名用户发送消息提示</div>
+      <div class="one_left" @click="toMessage" v-if="info.ext_status == '5'">发送消息提示</div>
+      <div class="one_left" @click="toSupplement" v-if="info.ext_status == '5'">补充决赛人员</div>
     </el-col>
     <el-col :span="24" class="two">
       <el-table :data="list" style="width: 100%" size="large" :header-cell-style="{ backgroundColor: '#edf3ff' }" @selection-change="handleSelectionChange">
@@ -41,16 +42,11 @@
             {{ getDict(scope.row.final_confirm, 'final_confirm') || '暂无' }}
           </template>
         </el-table-column>
-        <el-table-column prop="status" align="center" label="状态" width="100">
-          <template #default="scope">
-            <el-tag v-if="scope.row.status == '0'" type="primary">待审核</el-tag>
-            <el-tag v-else-if="scope.row.status == '1'" type="success">已通过</el-tag>
-            <el-tag v-else type="info">已退回</el-tag>
-          </template>
-        </el-table-column>
+        <el-table-column prop="order_no" align="center" label="排序"> </el-table-column>
         <el-table-column align="center" label="操作" width="160">
           <template #default="{ row }">
             <el-link :underline="false" type="primary" size="mini" @click="toView(row, true)" style="margin-right: 10px">查看</el-link>
+            <el-link :underline="false" v-if="info.ext_status == '7'" type="primary" size="mini" @click="toScore(row)">上传决赛分数</el-link>
           </template>
         </el-table-column>
       </el-table>
@@ -59,7 +55,9 @@
       <el-pagination background layout="prev, pager, next" :total="total" :page-size="limit" v-model:current-page="currentPage" @current-change="changePage" @size-change="sizeChange" />
     </el-col>
     <el-col :span="24" class="button">
-      <el-button type="primary" @click="toStep6">进入决赛名单公示阶段</el-button>
+      <el-button type="primary" @click="toStep6" v-if="info.ext_status == '5'">进入决赛名单公示阶段</el-button>
+      <el-button type="primary" @click="toStep7" v-if="info.ext_status == '6'">进入决赛赛事进行阶段</el-button>
+      <el-button type="primary" @click="toStep8" v-if="info.ext_status == '7'">决赛赛事结束</el-button>
     </el-col>
     <el-dialog v-model="dialog.show" :title="dialog.title" :destroy-on-close="false" @close="toClose">
       <div v-if="dialog.type == '1'">
@@ -106,6 +104,26 @@
           </div>
         </el-form>
       </div>
+      <div v-else-if="dialog.type == '3'">
+        <el-table :data="supplementList" style="width: 100%" size="large" :header-cell-style="{ backgroundColor: '#edf3ff' }">
+          <template #empty>
+            <el-empty description="暂无数据" />
+          </template>
+          <el-table-column prop="no" align="center" label="编号" width="100"> </el-table-column>
+          <el-table-column prop="user_name" align="center" label="用户"> </el-table-column>
+          <el-table-column prop="time" align="center" label="报名时间" />
+          <el-table-column prop="ext_status" align="center" label="流程状态">
+            <template #default="scope">
+              {{ getDict(scope.row.ext_status, 'ext_status') || '暂无' }}
+            </template>
+          </el-table-column>
+          <el-table-column align="center" label="操作" width="160">
+            <template #default="{ row }">
+              <el-link :underline="false" type="primary" size="mini" @click="toPerson(row)" style="margin-right: 10px">确定补充</el-link>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
     </el-dialog>
   </div>
 </template>
@@ -160,8 +178,10 @@ const scoreFormRef = ref()
 const scoreRules = reactive({
   score: [{ required: true, message: '请输入初审分数', trigger: 'blur' }]
 })
+// 补充人员列表
+const supplementList = ref([])
 
-const emits = defineEmits(['step5Time', 'toExport', 'toMessage'])
+const emits = defineEmits(['step5Time', 'toExport', 'toMessage', 'toStep6', 'toPerson', 'toStep7', 'toStep8'])
 
 const search = async (query = { skip, limit }) => {
   skip = query.skip
@@ -215,17 +235,16 @@ const toView = (data, is_no) => {
   extInfo.value = data.info
   dialog.value = { type: '1', show: true, title: '报名信息' }
 }
+// 图片处理
+const getUrl = (e) => {
+  if (e) return `${import.meta.env.VITE_APP_HOST}${get(e, 'uri')}`
+}
 // 上传决赛分数
 const toScore = (data) => {
   scoreForm.value = data
   dialog.value = { type: '2', show: true, title: '上传决赛分数' }
 }
-// 图片处理
-const getUrl = (e) => {
-  if (e) return `${import.meta.env.VITE_APP_HOST}${get(e, 'uri')}`
-}
-
-// 保存初审分数
+// 保存决赛分数
 const onSubmit = async (formEl) => {
   if (!formEl) return
   await formEl.validate((valid, fields) => {
@@ -249,19 +268,37 @@ const sizeChange = (limits) => {
 }
 // 导出
 const toExport = () => {
-  if (selectionList.value && selectionList.value.length > 0) {
-    emits('toExport', selectionList)
-  } else {
-    ElMessage({
-      message: '请选择要导出的数据!',
-      type: 'warning'
-    })
-  }
+  emits('toExport')
 }
 // 发送短信提醒
 const toMessage = () => {
   emits('toMessage')
 }
+// 进入决赛名单公示阶段
+const toStep6 = () => {
+  emits('toStep6')
+}
+// 进入决赛名单赛事进行
+const toStep7 = () => {
+  emits('toStep7')
+}
+// 进入决赛赛事结束
+const toStep8 = () => {
+  emits('toStep8')
+}
+// 补充决赛人员
+const toSupplement = async () => {
+  const res = await store.query({ match_id: id.value, ext_status: '4' })
+  if (res.errcode == '0') {
+    supplementList.value = res.data
+    dialog.value = { type: '3', show: true, title: '补充决赛人员' }
+  }
+}
+// 补充决赛人员
+const toPerson = (data) => {
+  emits('toPerson', data)
+  toClose()
+}
 const toClose = async () => {
   is_look.value = false
   form.value = {}

+ 3 - 20
src/views/match/two.vue

@@ -4,7 +4,7 @@
       <el-col :span="10">
         <el-form ref="ruleFormRef" :model="timeForm" :rules="rules" label-width="auto" class="form" label-position="left">
           <el-form-item label="设置初审时间" prop="start_time">
-            <el-date-picker format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" v-model="timeForm.start_time" type="datetime" placeholder="请选择初审时间" style="width: 50%" />
+            <el-date-picker format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" v-model="timeForm.start_time" type="datetime" placeholder="请选择初审时间" style="width: 90%" />
           </el-form-item>
         </el-form>
       </el-col>
@@ -17,7 +17,7 @@
     </el-row>
     <el-col :span="6" class="export">
       <div class="one_left" @click="toExport">导出</div>
-      <div class="one_left" :disabled="selectionList && selectionList.length > 0 ? false : true" @click="toFinals">选择决赛名单</div>
+      <div class="one_left" :disabled="selectionList && selectionList.length > 0 ? false : true" @click="toFinals">选择初审名单</div>
     </el-col>
     <el-col :span="24" class="two">
       <el-table :data="list" style="width: 100%" size="large" :header-cell-style="{ backgroundColor: '#edf3ff' }" @selection-change="handleSelectionChange">
@@ -35,13 +35,6 @@
             {{ getDict(scope.row.ext_status, 'ext_status') || '暂无' }}
           </template>
         </el-table-column>
-        <el-table-column prop="status" align="center" label="状态" width="100">
-          <template #default="scope">
-            <el-tag v-if="scope.row.status == '0'" type="primary">待审核</el-tag>
-            <el-tag v-else-if="scope.row.status == '1'" type="success">已通过</el-tag>
-            <el-tag v-else type="info">已退回</el-tag>
-          </template>
-        </el-table-column>
         <el-table-column align="center" label="操作" width="160">
           <template #default="{ row }">
             <el-link :underline="false" type="primary" size="mini" @click="toView(row, true)" style="margin-right: 10px">查看</el-link>
@@ -170,9 +163,6 @@ const search = async (query = { skip, limit }) => {
     match_id: id.value,
     ext_status: match.value.ext_status
   }
-  if (match.value.ext_status == '2' || match.value.ext_status == '3' || match.value.ext_status == '4') {
-    data.status = '0'
-  }
   const res = await store.query(data)
   if (res.errcode == '0') {
     list.value = res.data
@@ -265,14 +255,7 @@ const sizeChange = (limits) => {
 }
 // 导出
 const toExport = () => {
-  if (selectionList.value && selectionList.value.length > 0) {
-    emits('toExport', selectionList)
-  } else {
-    ElMessage({
-      message: '请选择要导出的数据!',
-      type: 'warning'
-    })
-  }
+  emits('toExport')
 }
 // 选择决赛名单
 const toFinals = () => {