Browse Source

权益销售添加查看路演参会名单

cxmo 4 months ago
parent
commit
31185f89c6

+ 29 - 0
src/api/modules/roadshowApi.js

@@ -195,6 +195,35 @@ const roadshowInterence={
 		return http.get('/roadshow/matters/list',params)
 		return http.get('/roadshow/matters/list',params)
 	},
 	},
 
 
+	/**
+	 * 新增参会名单
+	 * @param {Object} params 
+	 * @param {Number} params.RsCalendarId 日程ID
+	 * @param {Number[]} params.UserId 用户ID
+	 * @returns 
+	 */
+	addMeetingUser:params=>{
+		return http.post('/roadshow/rs_calendar_meeting_user/add',params)
+	},
+	/**
+	 * 参会名单列表
+	 * @param {Object} params 
+	 * @param {Number} params.RsCalendarId
+	 * @returns 
+	 */
+	getMeetingUserList:params=>{
+		return http.get('/roadshow/rs_calendar_meeting_user/list',params)
+	},
+	/**
+	 * 删除参会名单
+	 * @param {Object} params 
+	 * @param {Number} params.RsCalendarMeetingUserId
+	 * @returns 
+	 */
+	deleteMeetingUser:params=>{
+		return http.post('/roadshow/rs_calendar_meeting_user/delete',params)
+	},
+
 	/* ==================  路演统计 ================= */
 	/* ==================  路演统计 ================= */
 	/**
 	/**
 	 * 研究员统计
 	 * 研究员统计

+ 1 - 1
src/views/roadshow_manage/compononts/addActivityCellDia.vue

@@ -572,7 +572,7 @@ export default {
       await this.$refs.form.validate();
       await this.$refs.form.validate();
 
 
       if(this.formData.companyName && !this.formData.companyId) return this.$message.warning('请选择客户');
       if(this.formData.companyName && !this.formData.companyId) return this.$message.warning('请选择客户');
-      if(this.isRaiRole&&!this.formData.District) return this.$message.warning('请选择路演城市')
+      if(this.isRaiRole&&this.formData.roadshowType==='线下'&&!this.formData.District) return this.$message.warning('请选择路演城市')
       // 设置参数
       // 设置参数
       let parmas = null;
       let parmas = null;
 
 

+ 208 - 0
src/views/roadshow_manage/compononts/addParticipateDia.vue

@@ -0,0 +1,208 @@
+<template>
+    <el-dialog
+        title="提交参会名单"
+        :visible.sync="isAddParticipateShow"
+        width="500px"
+        append-to-body
+        @close="$emit('close')"
+    >
+        <div class="partic-dialog-container">
+            <div class="inline" v-for="(item, index) in dynamicItem" :key="index">
+                <div class="inline-content">
+                    <el-autocomplete
+                        class="inline-input"
+                        v-model.trim="item.name"
+                        :fetch-suggestions="callbackHandle"
+                        placeholder="请输入姓名"
+                        @input="getCompany(item.name)"
+                        @select="selectCompany(item, index)"
+                        @blur="focusCompany(item.name)"
+                        :trigger-on-focus="false"
+                        clearable
+                    ></el-autocomplete>
+                    <img
+                        @click="deleteItem(index)"
+                        src="~@/assets/img/icons/delete-Item.png"
+                        :class="index == 0 ? 'defaultyi' : ''"
+                        alt=""
+                    />
+                </div>
+                <p v-if="item.isShow">
+                    系统中无此人,请先将其添加到对应公司的联系人列表下
+                </p>
+            </div>
+            <div @click="addItem" class="add-box">
+                <img :src="$icons.addblue" alt="" />
+                <span>添加</span>
+            </div>
+        </div>
+        <div slot="footer" class="dialog-footer" style="text-align: center;">
+            <el-button type="primary" @click="confirmPerson">确定</el-button>
+            <el-button @click="$emit('close')">取消</el-button>
+        </div>
+    </el-dialog>
+</template>
+
+<script>
+import { raiInterface,roadshowInterence } from "@/api/api.js";
+export default {
+    props:{
+        isAddParticipateShow:{
+            type:Boolean,
+            default:false
+        },
+        RsCalendarId:{
+            type:Number,
+            default:0
+        }
+    },
+    watch:{
+        isAddParticipateShow(newval){
+            if(newval){
+                this.dynamicItem = [{name:'',isShow:false}]
+            }
+        }
+    },
+    data() {
+        return {
+            dynamicItem:[{name:'',isShow:false}],
+            companyList:[],
+            timeout:0,
+            warningIsShow:false
+        };
+    },
+    methods: {
+        getCompany(query){
+            if (query.includes(",")) return;
+            if (query) {
+                raiInterface
+                .activitySignupUserList({
+                    KeyWord: query,
+                })
+                .then((res) => {
+                    if (res.Ret === 200) {
+                    let arr = [];
+                    res.Data.List &&
+                        res.Data.List.forEach((item) => {
+                        let obj = {
+                            ...item,
+                            value: item.RealName + " , " + item.Mobile + " , " + item.CompanyName,
+                        };
+                        arr.push(obj);
+                        });
+                    this.companyList = arr;
+                    }
+                });
+            } else {
+                this.companyList = [];
+            }
+        },
+        callbackHandle(data,cb){
+            let results = data
+                ? this.companyList.filter((item) => {
+                    return item.value.includes(data);
+                })
+                : this.companyList;
+            clearTimeout(this.timeout);
+            this.timeout = setTimeout(() => {
+                cb(results);
+            }, 300);
+            if (results.length == 0) {
+                this.warningIsShow = true;
+            } else {
+                this.warningIsShow = false;
+            }
+        },
+        selectCompany(val, index) {
+            this.companyList.forEach((item) => {
+                if (item.value == val.name) {
+                this.dynamicItem.splice(index, 1, { name: val.name, isShow: false, id: item.UserId});
+                }
+            });
+        },
+        focusCompany(name){
+            if ((name.length && this.companyList.length == 0) || this.warningIsShow) {
+                this.dynamicItem.forEach((item) => {
+                    if (item.name == name) {
+                        item.isShow = true;
+                    }
+                });
+            } else {
+                this.dynamicItem.forEach((item) => {
+                    if (item.name == name) {
+                        item.isShow = false;
+                    }
+                });
+            }
+        },
+        deleteItem(index){
+            this.dynamicItem.splice(index, 1);
+        },
+        addItem(){
+            this.dynamicItem.push({name:'',isShow:false})
+        },
+        confirmPerson(){
+            //校验
+            const useId = this.dynamicItem.map(i=>i.id).filter(i=>i)
+            if(!useId.length) return this.$message.error('请输入姓名')
+            roadshowInterence.addMeetingUser({
+                RsCalendarId:this.RsCalendarId,
+                UserId:useId
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success('提交成功')
+                this.$emit('confirm')
+            })
+        },
+    },
+};
+</script>
+
+<style lang="scss">
+.partic-dialog-container{
+    .inline {
+        margin-bottom: 20px;
+        width: 100%;
+        .inline-input {
+            width: 392px !important;
+        }
+        p {
+            padding-top: 5px;
+            font-size: 14px;
+            font-family: PingFang SC;
+            font-weight: 500;
+            line-height: 20px;
+            color: #ef5858;
+            opacity: 1;
+        }
+        .inline-content {
+            padding-right: 20px;
+            display: flex;
+            justify-content: space-between;
+            align-items: center;
+            img {
+                width: 14px;
+                height: 14px;
+                cursor: pointer;
+            }
+        }
+        .defaultyi {
+            display: none !important;
+        }
+        .el-input {
+            width: 392px !important;
+        }
+    }
+    .add-box {
+        display: flex;
+        align-items: center;
+        color: #5882ef;
+        cursor: pointer;
+        img {
+            width: 16px;
+            height: 16px;
+            margin-right: 10px;
+        }
+    }
+}
+</style>

+ 113 - 0
src/views/roadshow_manage/compononts/showParticipateListDia.vue

@@ -0,0 +1,113 @@
+<template>
+    <el-dialog
+        title="查看参会名单"
+        :visible.sync="isParticipateShow"
+        width="700px"
+        append-to-body
+        @close="$emit('close')"
+    >
+        <div class="partic-list-dialog-container">
+            <el-table :data="tableData" border>
+                <el-table-column align="center"
+                    prop="RealName" label="姓名"
+                ></el-table-column>
+                <el-table-column align="center"
+                    prop="Position" label="职位"
+                ></el-table-column>
+                <el-table-column label="操作" align="center">
+                    <template slot-scope="{ row }" >
+                        <span
+                        class="deletesty"
+                        @click="deleteItem(row)">
+                            删除</span>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <div @click="addItem" class="add-box">
+                <img :src="$icons.addblue" alt="" />
+                <span>添加</span>
+            </div>
+        </div>
+        <div slot="footer" class="dialog-footer" style="text-align: center;">
+            <el-button type="primary" @click="$emit('close')">确定</el-button>
+            <el-button @click="$emit('close')">取消</el-button>
+        </div>
+        <addParticipateDia 
+            :isAddParticipateShow="isAddShow"
+            :RsCalendarId="RsCalendarId"
+            @close="isAddShow=false;"
+            @confirm="getTableData();isAddShow=false;"
+        />
+    </el-dialog>
+</template>
+
+<script>
+import { roadshowInterence } from "@/api/api.js";
+import addParticipateDia from "./addParticipateDia.vue";
+export default {
+    props: {
+        isParticipateShow: {
+            type: Boolean,
+            default: false
+        },
+        RsCalendarId: {
+            type: Number,
+            default: 0
+        }
+    },
+    data() {
+        return {
+            tableData: [],
+            isAddShow:false
+        };
+    },
+    watch: {
+        isParticipateShow(newval) {
+            if (newval) {
+                this.getTableData();
+            }
+        },
+    },
+    methods: {
+        getTableData() {
+            roadshowInterence.getMeetingUserList({
+                RsCalendarId: this.RsCalendarId
+            }).then(res => {
+                if (res.Ret !== 200)
+                    return;
+                this.tableData = res.Data.List;
+            });
+        },
+        addItem() {
+            this.isAddShow = true
+        },
+        deleteItem(row){
+            roadshowInterence.deleteMeetingUser({
+                RsCalendarMeetingUserId:row.RsCalendarMeetingUserId
+            }).then(res=>{
+                if(res.Ret!==200) return 
+                this.$message.success('删除成功')
+                this.getTableData()
+            })
+        },
+    },
+    components: { addParticipateDia }
+};
+</script>
+
+<style scoped lang="scss">
+.partic-list-dialog-container{
+    .add-box {
+        margin-top:15px;
+        display: flex;
+        align-items: center;
+        color: #5882ef;
+        cursor: pointer;
+        img {
+            width: 16px;
+            height: 16px;
+            margin-right: 10px;
+        }
+    }
+}
+</style>

+ 38 - 3
src/views/roadshow_manage/myCalendar.vue

@@ -153,7 +153,20 @@
                   v-if="!row.ButtonAuth.RemoveDisabled"
                   v-if="!row.ButtonAuth.RemoveDisabled"
                   >删除</span>
                   >删除</span>
             </template>
             </template>
-
+            <!-- 提交/查看参会名单 按钮由后端控制 -->
+            <template v-if="default_tab===2">
+                  <span 
+                    class="editsty"
+                    v-if="row.SubmitButton"
+                    @click="currentRsCalendarId=row.RsCalendarId;isAddParticipateShow=true;"
+                  >提交参会名单</span>
+                  <span
+                    class="editsty"
+                    v-if="row.ViewButton"
+                    @click="currentRsCalendarId=row.RsCalendarId;isParticipateShow=true;"
+                  >查看参会名单
+                  </span>
+            </template>
 
 
             </template>
             </template>
           </el-table-column>
           </el-table-column>
@@ -279,6 +292,19 @@
             </div>
             </div>
         </div>
         </div>
     </el-dialog>
     </el-dialog>
+    <!-- 提交参会名单弹窗 -->
+    <addParticipateDia 
+        :isAddParticipateShow="isAddParticipateShow"
+        :RsCalendarId="currentRsCalendarId"
+        @close="isAddParticipateShow=false"
+        @confirm="getCalendarList();isAddParticipateShow=false;"
+    />
+    <!-- 查看参会名单弹窗 -->
+    <showParticipateListDia 
+        :isParticipateShow="isParticipateShow"
+        :RsCalendarId="currentRsCalendarId"
+        @close="isParticipateShow=false"
+    />
   </div>
   </div>
 </template>
 </template>
 
 
@@ -289,7 +315,9 @@ import { getTabs,tableColums,handleArr,ENUM_RESEARCHLIST,sellerList } from "./ro
 import addMatterDia from "./compononts/addMatterDia.vue";
 import addMatterDia from "./compononts/addMatterDia.vue";
 import addActivityCellDia from "./compononts/addActivityCellDia.vue";
 import addActivityCellDia from "./compononts/addActivityCellDia.vue";
 import addActivityBtnDia from "./compononts/addActivityBtnDia.vue";
 import addActivityBtnDia from "./compononts/addActivityBtnDia.vue";
+import addParticipateDia from "./compononts/addParticipateDia.vue";
 import mPage from "@/components/mPage.vue";
 import mPage from "@/components/mPage.vue";
+import showParticipateListDia from "./compononts/showParticipateListDia.vue";
 
 
 export default {
 export default {
   components: {
   components: {
@@ -297,8 +325,10 @@ export default {
     addMatterDia,
     addMatterDia,
     mPage,
     mPage,
     addActivityBtnDia,
     addActivityBtnDia,
-    addActivityCellDia
-  },
+    addActivityCellDia,
+    addParticipateDia,
+    showParticipateListDia
+},
   watch: {
   watch: {
     default_tab(newval) {
     default_tab(newval) {
       this.tableColums = tableColums(newval);
       this.tableColums = tableColums(newval);
@@ -338,6 +368,11 @@ export default {
       isRefuseDiaShow: false,
       isRefuseDiaShow: false,
       // 删除弹窗显示
       // 删除弹窗显示
       isDeleteDiaShow: false,
       isDeleteDiaShow: false,
+      //添加参会名单弹窗显示
+      isAddParticipateShow:false,
+      //查看参会名单弹窗显示
+      isParticipateShow:false,
+      currentRsCalendarId:0,//当前选择的路演id
       // 当前行信息
       // 当前行信息
       rowInfo: null,
       rowInfo: null,
       // 拒绝理由
       // 拒绝理由