wuguojie 1 год назад
Родитель
Сommit
7be17b36c5

+ 5 - 5
src/components/Table/index.vue

@@ -39,13 +39,13 @@
             <slot name="search" :slotData="column"></slot>
           </template>
           <template #default="scope">
-            
-          
-              
+
+
+
               <component v-if="column.formatter" :is="column.formatter(scope.row, column, scope.row[column.prop], scope.$index)" class="routerlick" />
               <span v-else>{{ scope.row[column.prop] }}</span>
-            
-            
+
+
           </template>
         </el-table-column>
         <el-table-column label="操作" v-if="showOperation">

+ 1 - 1
src/router/modules/externalAgreement.ts

@@ -29,7 +29,7 @@ const routes: RouteRecordRaw = {
             activeMenu: '/personnel/member',
           },
         },
-       
+
       ]
     },
     {

+ 3 - 1
src/router/modules/quoteConfig.ts

@@ -51,7 +51,7 @@ const routes: RouteRecordRaw = {
         // },
       ]
     },
-    
+
     {
       path: 'costManagement',
       name: 'CostManagement',
@@ -61,6 +61,7 @@ const routes: RouteRecordRaw = {
         // auth:['role.add','role.view','role.delete','role.edit']
       },
     },
+
     {
       path: 'insuranceCompanyAccount',
       name: 'InsuranceCompanyAccount',
@@ -82,6 +83,7 @@ const routes: RouteRecordRaw = {
         }
       ]
     },
+
     {
       path: 'project',
       name: 'Project',

+ 37 - 11
src/views/contentManagement/advertisement.vue

@@ -4,16 +4,16 @@
       <el-form label-position="left" label-width="auto">
         <el-row :gutter="24">
           <el-col :span="6">
-            <el-form-item label="成员信息">
+            <el-form-item label="发布信息">
               <el-input
                 v-model="form.searchValue"
-                placeholder="输入成员信息查找"
+                placeholder="输入标题查找"
                 :prefix-icon="Search"
               />
             </el-form-item>
           </el-col>
           <el-col :span="6">
-            <el-form-item label="归属机构">
+            <el-form-item label="发布机构">
               <el-cascader
                 clearable
                 style="width: 100%"
@@ -50,10 +50,9 @@
             <!-- <el-button type="primary" @click="add(ruleFormRef)">
               <el-icon><Plus /></el-icon>添加机构</el-button
             > -->
-            <el-button
-              @click="router.push({ path: '/content/advertisement/advertisementEdit' })"
-              ><el-icon><Position /></el-icon>发布新的广告图</el-button
-            >
+            <el-button @click="router.push({ path: '/content/advertisement/advertisementEdit' })">
+              <el-icon><Position /></el-icon>发布新的广告图
+            </el-button>
           </div>
         </template>
         <template v-slot:operation="scope">
@@ -86,6 +85,15 @@
       >
       </Table>
     </el-dialog>
+    <el-dialog
+      v-model="imageShow"
+      title="图片查看"
+      width="500"
+    >
+      <div class="image-box">
+        <img :src="imageUrl"/>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -140,6 +148,9 @@ const tableProps = ref({
   children: "children",
   checkStrictly: true,
 });
+// 图片查看
+let imageShow = ref(false)
+let imageUrl = ref('')
 const typeformatter = (row: any, column: any, cellValue: any) => {
   return () =>
     h("div", null, [
@@ -148,7 +159,7 @@ const typeformatter = (row: any, column: any, cellValue: any) => {
         {
           onClick: () =>
             router.push({
-              path: "/content/message/messageEdit",
+              path: "/content/advertisement/advertisementEdit",
               query: {
                 id: row.id,
               },
@@ -168,7 +179,10 @@ const columns = [
   { prop: "name", label: "发布消息", formatter: typeformatter, width: 500 },
   { prop: "deptName", label: "广告图",
     formatter: (row: any, column: any, cellValue: any) => {
-      return () => h("img", {src:row.previewUrl}, );
+      return () => h("img", {src:row.previewUrl, onClick: () => {
+          imageShow.value = true
+          imageUrl.value = row.previewUrl
+        }}, );
     },
    },
 
@@ -225,7 +239,7 @@ const contentId = ref("");
 
 const pageInfo = {
   pageNum: 1,
-  pageSize: 10,
+  pageSize: 5,
   sizes: [10, 20, 30, 40, 50],
   total: 0,
   show: true,
@@ -274,6 +288,8 @@ const getContentList = () => {
     .posterQuery({
       ...form,
       ...pageInfo,
+      pages: pageInfo.pageNum,
+      size: pageInfo.pageSize
     })
     .then((res: any) => {
       if (res.code === 200) {
@@ -294,7 +310,7 @@ function editor(item: any) {
 }
 
 function del(item: any) {
-  
+
   ElMessageBox.confirm("确认要删除当前数据吗?", "提示", {
     confirmButtonText: "确认",
     cancelButtonText: "取消",
@@ -316,6 +332,9 @@ function del(item: any) {
 
 const reset = (item: any) => {
   // ElMessage({})
+  form.searchValue = ''
+  form.sendDeptId = ''
+  getContentList()
 };
 
 onMounted(() => {
@@ -385,6 +404,13 @@ onMounted(() => {
     box-sizing: border-box;
   }
 }
+
+.image-box{
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
 :deep(.el-dropdown-link) {
   cursor: pointer;
   color: var(--el-color-primary);

+ 3 - 0
src/views/contentManagement/message.vue

@@ -326,6 +326,9 @@ function del(item: any) {
 
 const reset = (item: any) => {
   // ElMessage({})
+  form.searchValue = ''
+  form.sendDeptId = ''
+  getContentList()
 };
 
 onMounted(() => {

+ 9 - 9
src/views/contentManagement/modules/addAdvertisement.vue

@@ -45,7 +45,7 @@
             </el-radio-group>
           </el-form-item>
         </el-col>
-        
+
       </el-row>
 
       <el-form-item label="广告图" prop="image">
@@ -87,7 +87,7 @@ import { useRoute } from "vue-router";
 
 
 function uploadImg(file:any){
- 
+
   ruleForm.image=file.id
 }
 
@@ -115,7 +115,7 @@ onMounted(() => {
   // console.log(route)
   if(route.query?.id){
     api.advertisementApi.getById({id:route.query?.id}).then(res=>{
-      
+
       if(res.code===200){
         ruleForm.title=res.data.title
         ruleForm.orgId=res.data.orgId
@@ -177,7 +177,7 @@ function deptChange(e:any){
 }
 
 const submitForm = async (formEl: FormInstance | undefined) => {
- 
+
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
@@ -204,8 +204,8 @@ const submitForm = async (formEl: FormInstance | undefined) => {
         })
       }
 
-      
-    } 
+
+    }
   });
 };
 
@@ -228,11 +228,11 @@ function getID(json:any, id:string) {
     //核心:利用arry.forEach(function(currentValue),index,arr)遍历数组
     json.forEach(function(item:any) {
     //if用来判断外层,else if用来判断里层,调用递归函数的有2个判断条件在“有goods属性并且不为空”情况下才调用
-    
+
         if (item.id == id) {
-     
+
           return  o = item;
-          
+
         } else if (item.children && item.children.length > 0) {
             o = getID(item.children, id)//递归
         }

+ 37 - 27
src/views/contentManagement/modules/addMessage.vue

@@ -77,15 +77,15 @@ import {ElMessage} from "element-plus"
 import type { ComponentSize, FormInstance, FormRules, } from "element-plus";
 import api from "@/api";
 import router from "@/router";
-import { useRoute } from "vue-router";
+import { useRoute, useRouter } from "vue-router";
 
 interface RuleForm {
   title: string;
   sendDeptId: string;
   sendDeptName: string;
   content: string;
-  isChildren: string;
-  isForce: string;
+  isChildren: string | number;
+  isForce: string | number;
 }
 const tableProps = ref({
   value: "id",
@@ -94,12 +94,13 @@ const tableProps = ref({
   checkStrictly: true,
 });
 const route=useRoute()
+const myRouter = useRouter()
 onMounted(() => {
   getInstitutionList(); //机构列表
   console.log(route)
   if(route.query?.id){
     api.contentApi.noticeGet({id:route.query?.id}).then(res=>{
-      
+
       if(res.code===200){
         ruleForm.title=res.data.title
         ruleForm.sendDeptId=res.data.sendDeptId
@@ -108,7 +109,7 @@ onMounted(() => {
         ruleForm.sendDeptName=res.data.sendDeptName
         ruleForm.isForce=res.data.isForce
         ruleForm.content=res.data.content
-        
+
       }
     })
   }
@@ -120,8 +121,8 @@ const ruleForm = reactive<RuleForm>({
   title: "",
   sendDeptId: "",
   sendDeptName: "",
-  isChildren: "",
-  isForce: "",
+  isChildren: 0,
+  isForce: 0,
   content: "",
 });
 
@@ -151,16 +152,14 @@ const sendDeptId=ref('')
 function deptChange(e:any){
   if(e){
     sendDeptId.value=e[e.length-1]
-
-    ruleForm.sendDeptName=getID(institutionList.value,sendDeptId.value).name
-    // console.log(getID(institutionList.value,sendDeptId.value))
+    ruleForm.sendDeptName=getID(institutionList.value,e[e.length-1]).name
   }else{
     sendDeptId.value=''
   }
 }
 
 const submitForm = async (formEl: FormInstance | undefined) => {
- 
+
   if (!formEl) return;
   await formEl.validate((valid, fields) => {
     if (valid) {
@@ -187,14 +186,17 @@ const submitForm = async (formEl: FormInstance | undefined) => {
         })
       }
 
-      
-    } 
+
+    }
   });
 };
 
 const resetForm = (formEl: FormInstance | undefined) => {
-  if (!formEl) return;
-  formEl.resetFields();
+  // if (!formEl) return;
+  // formEl.resetFields();
+  myRouter.push({
+    path: '/content/message'
+  })
 };
 
 //机构列表
@@ -209,18 +211,26 @@ function getID(json:any, id:string) {
     var o = {}; //专门用来保存筛选后的数组
     //定义一个函数getID(json,id),形参json用来接受传入的数组,形参id用来接受id号
     //核心:利用arry.forEach(function(currentValue),index,arr)遍历数组
-    json.forEach(function(item:any) {
-    //if用来判断外层,else if用来判断里层,调用递归函数的有2个判断条件在“有goods属性并且不为空”情况下才调用
-    
-        if (item.id == id) {
-     
-          return  o = item;
-          
-        } else if (item.children && item.children.length > 0) {
-            o = getID(item.children, id)//递归
-        }
-    });
-    return o; //全部遍历完之后返回对象o
+    // json.forEach(function(item:any) {
+    //   console.log(123, item)
+    // //if用来判断外层,else if用来判断里层,调用递归函数的有2个判断条件在“有goods属性并且不为空”情况下才调用
+    //     if (item.id == id) {
+    //       o = item
+    //       return o;
+    //     } else if (item.children && item.children.length > 0) {
+    //       o = getID(item.children, id)//递归
+    //     }
+    // });
+    // return o; //全部遍历完之后返回对象o
+  for (let i=0; i<json.length-1; i++) {
+    if(json[i].id === id) {
+      o = json[i]
+      break
+    } else if(json[i].children && json[i].children.length > 0) {
+      getID(json[i].children, id)
+    }
+  }
+  return o;
 }
 </script>
 <style lang="scss" scoped>

+ 7 - 4
src/views/marketingManagement/configurate.vue

@@ -103,7 +103,7 @@
             </el-descriptions-item>
           </el-descriptions>
           <div class="btns">
-            <el-button plain @click="cancelFirst">取消</el-button>
+            <el-button plain @click="cancelFirst(BasicFormRef)">取消</el-button>
             <el-button type="primary" @click="confirmFirst(BasicFormRef)">下一步</el-button>
           </div>
         </el-col>
@@ -285,7 +285,8 @@ let option = ref([])
 const cascaderProps = {
   value: 'id',
   label: 'name',
-  children: 'children'
+  children: 'children',
+  checkStrictly: true,
 }
 const institutionList = () => {
   api.institutionApi.institutionList({ name: '', system: '' }).then(res => {
@@ -301,8 +302,10 @@ const institutionList = () => {
 }
 
 // 第一步取消
-const cancelFirst = () => {
-
+const cancelFirst = (BasicFormRef: FormInstance) => {
+  router.push({
+    path: '/marketingManagement/lottery'
+  })
 }
 const confirmFirst = async (BasicFormRef: FormInstance) => {
   if(!BasicFormRef) {

+ 2 - 2
src/views/operationManagement/modules/addOperation.vue

@@ -99,7 +99,7 @@
               <el-col :span="10">
                 <el-form-item prop="leaderId" label="管理人">
                   <el-select v-model="operationForm.leaderId" filterable placeholder="请选择管理人" @change="(e) => {operationForm.leaderNumber = e}">
-                    <el-option v-for="(item, index) in userList" :key="item.id" :value="item.id" :label="item.name"></el-option>
+                    <el-option v-for="(item, index) in recommendList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
@@ -113,7 +113,7 @@
               <el-col :span="10">
                 <el-form-item prop="referrerId" label="推荐人">
                   <el-select v-model="operationForm.referrerId" filterable placeholder="请选择推荐人" @change="(e) => {operationForm.referrerNumber = e}">
-                    <el-option v-for="(item, index) in recommendList" :key="item.id" :value="item.id" :label="item.name"></el-option>
+                    <el-option v-for="(item, index) in userList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>