Просмотр исходного кода

Merge remote-tracking branch 'origin/wuguojie' into dev

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

+ 2 - 1
src/api/modules/lottery.ts

@@ -47,7 +47,8 @@ const lotteryApi = (axiosInstance: ApiInstance) => ({
   deleteActivity: (data: { id: string }) => axiosInstance.post('/activity/deleteActivity', data),
   endActivity: (data: { id: string }) => axiosInstance.post('/activity/endActivity', data),
   getActivityRecord: (data: GetActivityRecord) => axiosInstance.post('/activity/getActivityRecord', data),
-  exportActivityRecord: (data: string[]) => axiosInstance.post('/activity/exportActivityRecord', data)
+  exportActivityRecord: (data: string[]) => axiosInstance.post('/activity/exportActivityRecord', data),
+  checkActivityDept: (data:{ deptIds: string[] }) => axiosInstance.post('/activity/checkActivityDept', data),
 })
 
 export default lotteryApi

+ 1 - 2
src/api/modules/operation.ts

@@ -13,7 +13,7 @@ export interface AddOperation {
   leaderId: string,
   referrerId: string,
 
-  sex?: string,
+  sex?: string | null,
   birthday?: string,
   nations?: string,
   koseki?: string,
@@ -35,7 +35,6 @@ export interface AddOperation {
   salaryLevel?: string,
   bankCardId?: string,
   bankName?: string,
-
   sfz1?: string,
   sfz2?: string,
   qualification?: string,

+ 29 - 1
src/views/marketingManagement/configurate.vue

@@ -308,7 +308,35 @@ const confirmFirst = async (BasicFormRef: FormInstance) => {
   await BasicFormRef.validate((valid) => {
     if(valid) {
       if(basicForm.value.deptIds.length>0) {
-        active.value = 1
+        api.lotteryApi.checkActivityDept({
+          deptIds: basicForm.value.deptIds
+        }).then(res => {
+          if(res.code == 200) {
+            if(res.data == '1') {
+              ElMessageBox({
+                title: '提示',
+                message: '选择的参与机构存在有效的抽奖活动,发布后新的抽奖活动将覆盖机构的抽奖活动,请确认是否继续发布',
+                type: 'warning',
+                showCancelButton: true,
+                confirmButtonText: '继续发布',
+                cancelButtonText: '取消',
+              }).then((  action ) => {
+                if(action === 'confirm') {
+                  active.value = 1
+                } else {
+                  active.value = 0
+                }
+              })
+            } else {
+              active.value = 1
+            }
+          } else {
+            ElMessage({
+              message: res.msg,
+              type: 'warning'
+            })
+          }
+        })
       } else {
         ElMessage({
           message: '请勾选参与机构!',

+ 1 - 1
src/views/operationManagement/channel.vue

@@ -243,7 +243,7 @@ const treeNodeCommend = (item, e) => {
     case '编辑':
       addTeamShow.value = true
       nextTick(() => {
-        AddTeamRef.value.initEdit(item, true)
+        AddTeamRef.value.initEdit(item, true, 2)
       })
       break;
     case '删除':

+ 44 - 40
src/views/operationManagement/modules/addOperation.vue

@@ -29,7 +29,7 @@
                 </el-form-item>
               </el-col>
               <el-col :span="10">
-                <el-form-item prop="deptId" label="所属团队" v-if="operationForm.typeAttr!='6'">
+                <el-form-item prop="organizationId" label="所属团队" v-if="operationForm.typeAttr!='6'">
                   <el-select v-model="operationForm.organizationId" placeholder="请选择所属团队" @change="deptChange">
                     <el-option v-for="item in teamList" :key="item.id" :value="item.id" :label="item.name"></el-option>
                   </el-select>
@@ -463,10 +463,12 @@ import { ElMessage } from "element-plus";
 
 interface OperationFormProps extends AddOperation {
   organization: string
+  organizationId: string,
   leaderNumber: string,
   referrerNumber: string,
   address?: string[],
-  id?: string
+  id?: string,
+  // [key: string]: any;
 }
 
 let emits = defineEmits(['closeDialog'])
@@ -476,48 +478,47 @@ const OperationFormRef = ref<FormInstance>()
 let operationForm = ref<OperationFormProps>({
   typeAttr: '',
   deptId: '',
-  organizationId: '',
   name: '',
   mobile: '',
   identity: '',
   identityTimeStart: '',
   identityTimeEnd: '',
   leaderId: '',
-  leaderNumber: '',
   referrerId: '',
+  sex: '',
+  birthday: '',
+  nations: '',
+  koseki: '',
+  maritalStatus: '',
+  politicsStatus: '',
+  health: '',
+  province: '',
+  city: '',
+  district: '',
+  liveAddress: '',
+  postalCode: '',
+  education: '',
+  graduationTime: '',
+  school: '',
+  isComputer: '',
+  emergencyContactName: '',
+  emergencyContactTel: '',
+  salary: '',
+  salaryLevel: '',
+  bankCardId: '',
+  bankName: '',
+  sfz1: '',
+  sfz2: '',
+  qualification: '',
+  contract: '',
+  applicant: '',
+  salaryTable: '',
+  leaveTable: '',
+  organizationId: '',
+  organization: '',
+  leaderNumber: '',
   referrerNumber: '',
-
-  sex: null,
-  birthday: null,
-  nations: null,
-  koseki: null,
-  maritalStatus: null,
-  politicsStatus: null,
-  health: null,
-  province: null,
-  city: null,
-  district: null,
   address: [],
-  liveAddress: null,
-  postalCode: null,
-  education: null,
-  graduationTime: null,
-  school: null,
-  isComputer: null,
-  emergencyContactName: null,
-  emergencyContactTel: null,
-  salary: null,
-  salaryLevel: null,
-  bankCardId: null,
-  bankName: null,
-
-  sfz1: null,
-  sfz2: null,
-  qualification: null,
-  contract: null,
-  applicant: null,
-  salaryTable: null,
-  leaveTable: null
 })
 // 机构数据渲染格式
 const cascaderProps = {
@@ -530,7 +531,7 @@ const operationRules = ref<FormRules>({
   typeAttr: [
     { required: true, trigger: "change", message: "请选择业务员类型" }
   ],
-  deptId: [
+  organizationId: [
     { required: true, trigger: "change", message: "请选择所属团队" }
   ],
   name: [
@@ -637,10 +638,10 @@ const disabledDateEnd = (time: Date) => {
 // 编辑时初始化数据
 // 编辑的id
 let editId = ref('')
-const initEditData = (id) => {
-  if(id) {
+const initEditData = (id, ids) => {
+  if(ids) {
     editId.value = id
-    api.operationApi.operationDetail(id).then(res => {
+    api.operationApi.operationDetail(ids).then(res => {
       if(res?.code == 200) {
         let formData = res.data
         initTeamData(formData?.typeAttr==='5'?'1':formData?.typeAttr==='8'?'2':formData?.typeAttr==='7'?'3':'')
@@ -1094,6 +1095,7 @@ const typeAttrChange = async (e) => {
   operationForm.value.leaderNumber = ''
   operationForm.value.referrerId = ''
   operationForm.value.referrerNumber = ''
+  operationForm.value.organizationId = ''
   if(e != '6') {
     initTeamData(e==='5'?'1':e==='8'?'2':e==='7'?'3':'')
   } else {
@@ -1112,6 +1114,7 @@ const deptChange = (e) => {
 // 机构切换
 const deptIdChange = (e) => {
   if(e) {
+    operationForm.value.deptId = e[e.length - 1]
     getUser(e[e.length - 1])
     getRecommend(e[e.length - 1])
   }
@@ -1160,7 +1163,8 @@ onMounted(() => {
 })
 
 defineExpose({
-  initEditData
+  initEditData,
+  operationForm
 })
 
 

+ 2 - 1
src/views/operationManagement/modules/addTeam.vue

@@ -72,9 +72,10 @@ let teamRules = ref<FormRules>({
 
 // 编辑初始化数据
 let isEdit = ref(false)
-const initEdit = (data, bool) => {
+const initEdit = (data, bool, type) => {
   isEdit.value = bool
   teamForm.value = data
+  teamForm.value.attribute = type
   institutionList()
   getUser(data.deptId)
 }

+ 1 - 1
src/views/operationManagement/operation.vue

@@ -542,7 +542,7 @@ const tableDataCommand = (scope, e) => {
     case '编辑':
       dialogShow.value = true
       nextTick(() => {
-        AddOperationRef.value.initEditData(scope.row.userId)
+        AddOperationRef.value.initEditData(scope.row.userId, scope.row.id)
       })
       title.value = '编辑'
       break;

+ 2 - 2
src/views/operationManagement/operationDetail.vue

@@ -269,7 +269,7 @@ const closeAllocation = (type: boolean) => {
 let activeName = ref('msg')
 
 // 银行卡信息
-let bankCardInfo = ref(null)
+let bankCardInfo = ref({})
 let bankTitle = ref('添加银行卡')
 // 添加银行卡弹框
 let bankCardDialogShow = ref(false)
@@ -437,7 +437,7 @@ const imageView = (type) => {
 // 详情
 let dataDetail = ref(null)
 const initDetail = () => {
-  let id = myRoute.query?.id
+  let id = myRoute.query?.ids
   api.operationApi.operationDetail(id).then(res => {
     if(res?.code == 200) {
       dataDetail.value = res.data

+ 1 - 1
src/views/operationManagement/team.vue

@@ -243,7 +243,7 @@ const treeNodeCommend = (item, e) => {
     case '编辑':
       addTeamShow.value = true
       nextTick(() => {
-        AddTeamRef.value.initEdit(item, true)
+        AddTeamRef.value.initEdit(item, true, 1)
       })
       break;
     case '删除':

+ 1 - 1
src/views/operationManagement/telemarketing.vue

@@ -243,7 +243,7 @@ const treeNodeCommend = (item, e) => {
     case '编辑':
       addTeamShow.value = true
       nextTick(() => {
-        AddTeamRef.value.initEdit(item, true)
+        AddTeamRef.value.initEdit(item, true, 3)
       })
       break;
     case '删除':

+ 38 - 9
src/views/personnel/modules/editInstitution.vue

@@ -118,7 +118,7 @@
       <el-button type="primary" @click="confirm(ruleFormRef)">
         保 存
       </el-button>
-      
+
     </div>
   </div>
 </template>
@@ -156,17 +156,23 @@ onMounted(() => {
     // form.parentId=[route.query.id]
   }
 
-  setTimeout(() => {
-    disabledTree(tableData.value);
-  }, 1000);
+  if(route.query.id) {
+    setTimeout(() => {
+      disabledEditTree(tableData.value);
+    }, 1000);
+  } else {
+    setTimeout(() => {
+      disabledAddTree(tableData.value);
+    }, 1000);
+  }
 });
 
 //禁用机构选择
-function disabledTree(list: tableType) {
+function disabledEditTree(list: tableType) {
   for (let i = 0; i < list.length; i++) {
     const node = list[i];
     if (route.query.id) {
-      if (list[i].id != route.query.id) {
+      if (list[i].id === route.query.id || list[i].parentId == '0') {
         list[i].disabled = true;
       }
     } else {
@@ -174,7 +180,20 @@ function disabledTree(list: tableType) {
     }
 
     if (node.children && node.children.length > 0) {
-      disabledTree(node.children);
+      disabledEditTree(node.children);
+    }
+  }
+}
+const disabledAddTree = (list: tableType) => {
+  for (let i = 0; i < list.length; i++) {
+    const node = list[i];
+    if (list[i].parentId == '0') {
+      list[i].disabled = true;
+    } else {
+      list[i].disabled = false;
+    }
+    if (node.children && node.children.length > 0) {
+      disabledAddTree(node.children);
     }
   }
 }
@@ -256,6 +275,17 @@ const tableProps = ref({
   label: "name",
   children: "children",
   checkStrictly: true,
+  // displayRender({node}) {
+  //   // 返回 VNode,实现复杂样式
+  //   return h(
+  //     'span',
+  //     null,
+  //     [
+  //       node.label,
+  //       h('span', {style: 'color: red;'}, '(自定义样式)'),
+  //     ]
+  //   );
+  // },
 });
 
 const getAreaList = () => {
@@ -307,11 +337,10 @@ const getInstitutionList = () => {
     // if(res.code===200){
 
     // }
-    tableData.value = res.data;
+    tableData.value = res.data
   });
   // pageInfo.pageSize=item.pageSize
 };
-
 const confirm = async (formEl: FormInstance | undefined) => {
   if (!formEl) return;
   await formEl.validate((valid, fields) => {