From a4b3ee325c7354579d495bc74a777e494e5ec38c Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Fri, 06 Feb 2026 18:18:44 +0800
Subject: [PATCH] 商品可以价格面议 选择走访时显示输入走访企业名 分会添加活动时要总会审核 分类添加人数限制,添加活动选择了填写人数限制的分类时活动名额下显示该分类人数限制为15 同一个企业30天内只能走访一次,在30天内走访同一个企业时提示该企业已被走访xx天后才可以从新走访

---
 shop_vue/src/views/branch/activity/index.vue |  104 +++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 99 insertions(+), 5 deletions(-)

diff --git a/shop_vue/src/views/branch/activity/index.vue b/shop_vue/src/views/branch/activity/index.vue
index b3d0eb2..2602e83 100644
--- a/shop_vue/src/views/branch/activity/index.vue
+++ b/shop_vue/src/views/branch/activity/index.vue
@@ -1,6 +1,13 @@
 <template>
   <div>
-    <div class="common-level-rail"><el-button size="small" type="primary" icon="el-icon-plus" @click="add">添加活动</el-button></div>
+    <div class="common-level-rail">
+      <el-button size="small" type="primary" icon="el-icon-plus" @click="add">添加活动</el-button>
+      <el-select v-model="searchForm.audit_status" placeholder="审核状态" clearable @change="handleSearch">
+        <el-option label="待审核" :value="0"></el-option>
+        <el-option label="已通过" :value="10"></el-option>
+        <el-option label="已驳回" :value="20"></el-option>
+      </el-select>
+    </div>
     <div class="table-wrap">
       <el-table :data="tableData" style="width: 100%" v-loading="loading">
         <el-table-column prop="activity_id" label="活动ID" width="60"></el-table-column>
@@ -9,7 +16,12 @@
             <img v-img-url="'image.file_path',scope.row" width="40" height="40" />
           </template>
         </el-table-column>
-        <el-table-column prop="name" label="活动标题" min-width="120"></el-table-column>
+        <el-table-column prop="name" label="活动标题" min-width="120">
+          <template slot-scope="{ row }">
+            <div>{{ row.name }}</div>
+            <el-tag size="small">{{ row.branch.name }}</el-tag>
+          </template>
+        </el-table-column>
         <el-table-column prop="category.name" label="活动分类" width="120"></el-table-column>
         <el-table-column prop="fee" label="活动费用" width="90"></el-table-column>
         <el-table-column prop="limit_num" label="已报人数/总人数" width="120">
@@ -27,16 +39,24 @@
             <el-tag :type="tagType(row.status_text.status)">{{ row.status_text.status_text }}</el-tag>
           </template>
         </el-table-column>
+        <el-table-column prop="audit_status" label="审核状态" width="100">
+          <template slot-scope="{ row }">
+            <el-tag :type="auditStatusType(row.audit_status_text.status)">
+              {{ row.audit_status_text.text }}
+            </el-tag>
+          </template>
+        </el-table-column>
         <el-table-column prop="create_time" label="创建时间" width="140"></el-table-column>
         <el-table-column prop="status" label="是否显示" width="100">
             <template slot-scope="scope">
                 <el-switch v-model="scope.row.status" :active-value="1" :inactive-value="0" active-text="显示" inactive-text="隐藏" :width="55" @change="statusSet($event, scope.row)"></el-switch>
             </template>
         </el-table-column>
-        <el-table-column prop="name" label="操作" width="140">
+        <el-table-column prop="name" label="操作" width="220">
           <template slot-scope="scope">
             <el-button @click="onDetail(scope.row.activity_id, false)" type="text" size="small">查看</el-button>
             <el-button @click="qrcode(scope.row)" type="text" size="small">核销码</el-button>
+            <el-button @click="showAuditDialog(scope.row)" type="text" size="small" v-if="scope.row.audit_status === 0">审核</el-button>
             <el-button @click="onDetail(scope.row.activity_id, true)" type="text" size="small">编辑</el-button>
             <el-button @click="onDelete(scope.row)" type="text" size="small">删除</el-button>
           </template>
@@ -60,6 +80,29 @@
     <Detail ref="activityDetail" :open="open_detail" @getList="getTableList" @close="closeDrawerDetail"></Detail>
     <!-- 核销码 -->
     <Qrcode :open='isQrcode' :code_id='code_id' @close="closeQrcode"></Qrcode>
+    <!-- 审核对话框 -->
+    <el-dialog title="审核活动" :visible.sync="auditDialogVisible" width="500px">
+      <el-form :model="auditForm" label-width="80px">
+        <el-form-item label="审核结果">
+          <el-radio-group v-model="auditForm.audit_status">
+            <el-radio :label="10">通过</el-radio>
+            <el-radio :label="20">驳回</el-radio>
+          </el-radio-group>
+        </el-form-item>
+        <el-form-item label="审核备注" v-if="auditForm.audit_status === 20">
+          <el-input
+            type="textarea"
+            :rows="4"
+            v-model="auditForm.audit_remark"
+            placeholder="请输入驳回原因"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer">
+        <el-button @click="auditDialogVisible = false">取消</el-button>
+        <el-button type="primary" @click="submitAudit">确定</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -96,6 +139,17 @@
       open_detail: false,
       isQrcode: false,
       code_id: '',
+      /*审核相关*/
+      auditDialogVisible: false,
+      auditForm: {
+        activity_id: 0,
+        audit_status: 10,
+        audit_remark: ''
+      },
+      /*搜索条件*/
+      searchForm: {
+        audit_status: ''
+      },
     };
   },
   created() {
@@ -109,6 +163,10 @@
       let Params = {};
       Params.page = self.curPage;
       Params.list_rows = self.pageSize;
+      // 添加审核状态筛选
+      if (self.searchForm.audit_status !== '') {
+        Params.audit_status = self.searchForm.audit_status;
+      }
       BranchApi.activityList(Params, true)
         .then(data => {
           self.loading = false;
@@ -167,9 +225,9 @@
         })
         .then(() => {
           self.loading = true;
-          BranchApi.delete(
+          BranchApi.deleteActivity(
             {
-              activity_id: e
+              activity_id: e.activity_id
             },
             true
           )
@@ -204,6 +262,11 @@
       return this.tagTypeData[e];
     },
 
+    auditStatusType(e) {
+      const typeMap = { 0: 'warning', 10: 'success', 20: 'danger' };
+      return typeMap[e] || 'info';
+    },
+
     qrcode(row){
       this.code_id = row.activity_id;
       this.isQrcode = true;
@@ -211,6 +274,37 @@
     closeQrcode(){
       this.isQrcode = false;
     },
+
+    /*显示审核对话框*/
+    showAuditDialog(row) {
+      this.auditForm = {
+        activity_id: row.activity_id,
+        audit_status: 10,
+        audit_remark: ''
+      };
+      this.auditDialogVisible = true;
+    },
+
+    /*提交审核*/
+    submitAudit() {
+      if (this.auditForm.audit_status === 20 && !this.auditForm.audit_remark) {
+        this.$message.warning('请输入驳回原因');
+        return;
+      }
+      BranchApi.auditActivity(this.auditForm, true)
+        .then(data => {
+          this.$message.success(data.msg);
+          this.auditDialogVisible = false;
+          this.getTableList();
+        })
+        .catch(error => {});
+    },
+
+    /*搜索*/
+    handleSearch() {
+      this.curPage = 1;
+      this.getTableList();
+    },
   }
 };
 </script>

--
Gitblit v1.9.2