瀏覽代碼

领取列表,领取客户

Karsa 7 月之前
父節點
當前提交
8ee7382c32

+ 8 - 12
src/hooks/login/use-login.js

@@ -84,7 +84,14 @@ export function useForm() {
 }
 
 export function useLoginSuccess(res) {
-  setUserInfo(res.Data);
+  localStorage.setItem("auth", res.Data.Authorization);
+  localStorage.setItem("userName", res.Data.RealName);
+  localStorage.setItem("Role", res.Data.RoleTypeCode);
+  localStorage.setItem("RoleIdentity", res.Data.SysRoleTypeCode);
+  localStorage.setItem("RoleType", res.Data.ProductName);
+  localStorage.setItem("ManageType", res.Data.Authority);
+  localStorage.setItem("AdminId", res.Data.AdminId);
+  localStorage.setItem("AdminName", res.Data.AdminName);
 
   getOtherRolePath('myCalendar').then(path => {
       // path&&router.push({ path });
@@ -107,17 +114,6 @@ export function useQuitSystem() {
   router.replace("/login");
 }
 
-//登录成功存储信息
-const setUserInfo = (Data) => {
-  localStorage.setItem("auth", Data.Authorization);
-  localStorage.setItem("userName", Data.RealName);
-  localStorage.setItem("Role", Data.RoleTypeCode);
-  localStorage.setItem("RoleIdentity", Data.SysRoleTypeCode);
-  localStorage.setItem("RoleType", Data.ProductName);
-  localStorage.setItem("ManageType", Data.Authority);
-  localStorage.setItem("AdminId", Data.AdminId);
-  localStorage.setItem("AdminName", Data.AdminName);
-}
 
 function getOtherRolePath(pathVal){
   const { SET_DATA_AUTH } = useAppStore();

+ 25 - 22
src/router/modules/customRoutes.js

@@ -96,21 +96,23 @@ export default [
           title: '终止权限列表'
         }
       },
-      // {
-      //   path: "pickList",
-      //   name: "领取列表",
-      //   component: () => import("@/views/custom_manage/pickList.vue"),
-      //   hidden: false,
-      //   meta: {
-      //     keepAlive: false,
-      //   },
-      // },
+      {
+        path: "pickList",
+        name: "pickList",
+        component: () => import("@/views/custom_manage/custom/pickList.vue"),
+        hidden: false,
+        meta: {
+          keepAlive: false,
+          title: '领取列表'
+        },
+      },
       // {
       //   path: "addCustom",
-      //   name: "新增客户",
-      //   component: () => import("@/views/custom_manage/customList/addCustom.vue"),
+      //   name: "addCustom",
+      //   component: () => import("@/views/custom_manage/custom/addCustom.vue"),
       //   hidden: true,
       //   meta: {
+      //     title: '新增客户',
       //     pathFrom: "customList",
       //     pathName: "客户列表",
       //     keepAlive: false,
@@ -172,17 +174,18 @@ export default [
           title: '英文客户详情'
         },
       },
-      // {
-      //   path: "pickCustom",
-      //   name: "领取客户",
-      //   component: () => import("@/views/custom_manage/customList/pickCustom.vue"),
-      //   hidden: true,
-      //   meta: {
-      //     pathFrom: "pickList",
-      //     pathName: "领取列表",
-      //     keepAlive: false,
-      //   },
-      // },
+      {
+        path: "pickCustom",
+        name: "pickCustom",
+        component: () => import("@/views/custom_manage/custom/pickCustom.vue"),
+        hidden: true,
+        meta: {
+          title: '领取客户',
+          pathFrom: "pickList",
+          pathName: "领取列表",
+          keepAlive: false,
+        },
+      },
       // // 服务更新差分为 续约申请和补充协议其中 权益无补充协议
       // {
       //   path: "updateCustom",

+ 277 - 0
src/views/custom_manage/custom/addCustom.vue

@@ -0,0 +1,277 @@
+<script setup>
+import { ref } from 'vue'
+
+</script>
+<template>
+  <div class="addCustom_container">
+		<el-form 
+		@submit.prevent 
+		inline 
+		:model="dataForm" 
+		:rules="formRule"
+		hide-required-asterisk
+		ref="dataForm" 
+		label-width="100px"
+		class="demo-ruleForm">
+			<el-form-item label="所属区域" prop="cuStatus" style="marginRight:120px;">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<el-radio-group v-model="dataForm.area" size="medium" style="width:400px;">
+					<el-radio border label="国内"  style="width:184px;"></el-radio>
+					<el-radio border label="海外" style="width:184px;marginLeft:0;"></el-radio>
+				</el-radio-group>
+			</el-form-item>
+			<el-form-item label="客户全称" prop="custom_name">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<!-- <el-autocomplete
+				v-model="dataForm.custom_name"
+				:fetch-suggestions="callbackHandle"
+				placeholder="请输入公司全称"
+				@input="getCompany(dataForm.custom_name)"
+				@blur="checkCompany(dataForm.custom_name,'')"
+				style="width:400px"
+				clearable></el-autocomplete> -->
+				  <autocomplete
+						ref="auto"
+						v-model="dataForm.custom_name"
+						:fetch-suggestions="callbackHandle"
+						placeholder="请输入公司全称"
+						@blur="checkCompany"
+						@select="customNameSelect"
+						@focus="checkCompanyfocus"
+						:disabled='inquireSuccess'
+						clearable
+						value-key="value"
+						style="width:400px"
+						:popper-class="isCheck?'el-autocomplete-none':'el-autocomplete-suggestion-data-entry'"
+						class="autocomplete-input"
+						>
+					<span v-if="dataForm.custom_name.length > 3" style="color:#409EFF;cursor: pointer;" slot="suffix"  @click="$refs.auto.search(dataForm.custom_name)"> 查询</span>
+						<template slot-scope="scope">
+						<div  v-if="scope.item.KeyNo" >
+							{{scope.item.Name}}
+						</div>
+						<div v-else style="text-align:center">暂无数据</div>		 
+						</template>
+				</autocomplete>
+			</el-form-item>
+			<el-form-item label="社会信用码" prop="code" style="marginRight:120px;">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-106px;top:10%;">*</i>
+				<el-input 
+				v-model="dataForm.code"
+				placeholder="请输入社会信用码"
+				@blur="checkCompany"
+				@focus="checkCompanyfocus"
+				style="width:400px"
+				disabled
+				clearable></el-input>
+			</el-form-item>
+			<el-form-item v-if="dataForm.area==='海外'" label="所属国家" prop="Nation"
+				:rules="[{required:true,message: '所属国家不能为空', trigger: 'change' }]">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<el-select v-model="dataForm.Nation" placeholder="请选择" filterable style="width: 400px;">
+					<el-option :label="item.cnName" :value="item.cnName" v-for="item in countryData" :key="item.code" >
+					<div style="display: flex;justify-content: space-between;">
+						<span>{{ item.cnName }}</span>
+						<span style="color: #8492a6; font-size: 13px">{{ item.code }}</span>
+					</div>
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item v-else label="客户地址" prop="city"  :rules="[{
+					required:true,
+					message: '客户地址不能为空', 
+					trigger: 'change' }]">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<search-dist-picker @selected="selectRegion"/>
+			</el-form-item>
+			<el-form-item label="客户状态" prop="cuStatus" style="marginRight:120px;">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<el-radio-group v-model="dataForm.cuStatus" size="medium" style="width:400px;">
+					<el-radio border label="试用"  style="width:184px;">试用(2个月)</el-radio>
+					<el-radio border label="永续" style="width:184px;marginLeft:0;" v-if="Role=='admin'">永续</el-radio>
+				</el-radio-group>
+			</el-form-item>
+			<el-form-item label="客户来源" prop="from">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<el-select v-model="dataForm.from" placeholder="请选择客户来源" style="width:400px;" filterable>
+					<el-option
+					v-for="item in fromArr"
+					:key="item.SourceId"
+					:label="item.SourceName"
+					:value="item.SourceName">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="客户类型" prop="custype" style="marginRight:120px;">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<el-select v-model="dataForm.custype" placeholder="请选择客户类型" style="width:400px;">
+					<template>
+						<el-option
+							v-for="item in typeArr"
+							:key="item"
+							:label="item"
+							:value="item">
+						</el-option>
+					</template>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="行业" prop="trade">
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-58px;top:10%;">*</i>
+				<el-select v-model="dataForm.trade" placeholder="请选择行业" style="width:400px;" @focus="slideTrade">
+					<el-option
+					v-for="item in tradeArr"
+					:key="item"
+					:label="item.IndustryName"
+					:value="item.IndustryId">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item label="所属销售" prop="sales" style="marginRight:120px;">
+				
+				<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+				<el-select v-model="dataForm.sales" placeholder="请选择销售" style="width:400px;" filterable :disabled="Role=='rai_seller'||Role=='ficc_seller'||Role=='ficc_sell_director'">
+					<el-option
+					v-for="item in salesArr"
+					:key="item.AdminId"
+					:label="item.RealName"
+					:value="item.AdminId">
+					</el-option>
+				
+				</el-select>
+			</el-form-item>
+			<el-form-item prop="money" style="disply:block" label="管理规模" v-if="dataForm.custype=='权益'" >
+				<el-select 	style="width:400px" v-model="dataForm.money" clearable placeholder="请选择管理规模(选填)">
+					<el-option
+					v-for="item in optionsMoney"
+					:key="item.value"
+					:label="item.label"
+					:value="item.value">
+					</el-option>
+				</el-select>
+			</el-form-item>
+			<el-form-item class="textarea_item" style="width:90%;paddingLeft:26px;">
+				<label style="display:block;marginBottom:20px;fontSize:16px;position:relative;">
+					<i style="color:#f00;fontSize:20px;position:absolute;left:-15px;top:10%;">*</i>
+					权限设置
+				</label>
+				<ul class="menu_lists">
+					<li v-for="item in authList" :key="item.ClassifyName" class="menu_item">
+						<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" :disabled="setSelectPerDisabled(item)" @change="handleCheckAll(item)" style="marginRight:30px;fontWeight:bold;minWidth:90px;">{{item.ClassifyName+':'}}</el-checkbox>
+						<el-checkbox-group  v-model="item.CheckList" @change="handleChecked(item)">
+							<el-checkbox v-for="list in item.Items" :label="list.ChartPermissionId" :key="list.ChartPermissionId" class="list_item" :disabled="list.IsPublic==1">{{list.PermissionName}}</el-checkbox>
+						</el-checkbox-group>
+					</li>
+				</ul>
+			</el-form-item>
+	
+		</el-form>
+		<div style="display:flex;justify-content:center;margin:80px 0 0;">
+			<el-button type="primary" style="width:80px;marginRight:24px;" @click="saveHandle">保存</el-button>
+			<el-button type="primary" plain style="width:80px;" @click="$router.go(-1)">取消</el-button>
+		</div>
+		<!-- 添加联系人弹窗 -->
+		<Contactdia
+		:id="companyId"
+		:title="'新增联系人'"
+		:userForm="diaform"
+		:custom_name="dataForm.custom_name"
+		:isShowclose="isShowclose"
+		:isAddContact="isAddContact"
+		:regionType="regionType"
+		:isAddUser="true"
+		:needCard="true"
+		@cancel="canceldialog">
+		</Contactdia>
+		<!-- 检查客户弹窗 -->
+		<el-dialog
+		v-model="isCheck"
+		:close-on-click-modal="false"
+		:modal-append-to-body='false'
+		:show-close="false"
+		center
+		width="560px">
+      <template #header>
+        <div style="display:flex;alignItems:center;">
+          <span style="fontSize:16px;">提示</span>
+        </div>
+      </template>
+			<div style="textAlign:center;fontSize:16px;">
+				<span v-if="codeRepeat==1">该客户属于{{repeatName}}客户,是否领取?</span>
+				<span v-else>该客户已存在,请前往【客户检索】页面核实</span>
+			</div>	
+			<div style="display:flex;justify-content:center;margin:75px 0 50px;">
+				<el-button type="primary" style="width:80px;marginRight:24px;" @click="goPickHandle">{{codeRepeat==1 ?'去领取':'去核实'}}</el-button>
+				<el-button  type="primary" plain style="width:80px;" @click="closeDia">取消</el-button>
+			</div>
+		</el-dialog>
+	</div>
+</template>
+<style scoped lang="scss">
+.addCustom_container {
+	min-height: calc(100vh - 160px);
+	padding:30px 40px 60px 60px;
+	background: #fff;
+	position: relative;
+	border: 1px solid #ECECEC;
+	border-radius: 4px;
+	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+	font-size: 16px;
+	color: #666;
+	/* reset */
+	:deep(.el-form-item) {
+		margin-bottom: 30px;
+		&:last-child {
+			margin-bottom: 0;
+		}
+	}
+	.select-dist-picker{
+		width:400px;
+	}
+	:deep(.textarea_item .el-form-item__content) {
+		width: 100%;
+	}
+	.el-checkbox-group {
+		height: 40px;
+	}
+	:deep(.distpicker-address-wrapper) select {
+		width: 198px;
+	}
+	/*  */
+	.menu_lists {
+		padding: 40px 18px;
+		border: 1px dashed #AAB4CC;
+		border-radius: 4px;
+		.menu_item {
+			display: flex;
+			// align-items: center;
+			margin-bottom: 40px;
+			&:last-child {
+				margin-bottom: 0;
+			}
+			.list_item {
+				margin-right: 30px;
+				&:last-child {
+					margin-right: 0;
+				}
+			}
+		}
+	}
+}
+.el-autocomplete-suggestion-data-entry {
+	width:auto !important;
+	min-width: 400px;
+}
+.el-autocomplete-none {
+	display: none !important;
+}
+:deep(.autocomplete-input) {
+  .el-input__inner {
+	  padding-right:65px ;
+	}
+	input {
+    overflow: hidden; // 溢出隐藏
+    text-overflow: ellipsis; // 显示省略号
+    white-space: nowrap; // 不换行
+	}	
+}
+</style>

+ 1 - 1
src/views/custom_manage/custom/components/Contactdialog.vue

@@ -63,7 +63,7 @@ const props = defineProps({
     default: false
   },
   custom_name:{
-    type:Object,
+    type:String,
     default: '',
   }
 })

+ 1 - 1
src/views/custom_manage/custom/components/premissionView.vue

@@ -35,7 +35,7 @@ function getRowSpan() {
       position.value = 0;
     } else {
       if (props.lookAuthList[index].ClassifyName === props.lookAuthList[index - 1].ClassifyName) {
-        rowSpanArr.value[position] += 1; //项目名称相同,合并到同一个数组中
+        rowSpanArr.value[position.value] += 1; //项目名称相同,合并到同一个数组中
         rowSpanArr.value.push(0);
         props.lookAuthList[index].ClassifyName = props.lookAuthList[index - 1].ClassifyName;
       } else {

+ 23 - 22
src/views/custom_manage/custom/customSearch.vue

@@ -13,7 +13,7 @@ export default defineComponent({
 </script>
 
 <script setup>
-import { ref,computed,reactive,onBeforeMount } from "vue";
+import { ref,computed,reactive } from "vue";
 import { customInterence } from '@/api/api.js'
 import { useRouter,onBeforeRouteLeave, useRoute } from 'vue-router'
 import { Search,MoreFilled } from '@element-plus/icons-vue'
@@ -28,12 +28,13 @@ import CompleteInfo from './components/CompleteInfo.vue'
 import ContractInfo from './components/ContractInfo.vue'
 import PermissionDetail from './components/permissionDetail.vue'
 
-onBeforeRouteLeave(() => {
+onBeforeRouteLeave((to, form, next) => {
   let backData = {
     keyword:search_txt.value,
     page:pageinfo.page_no
   }
   sessionStorage.setItem('customSearchBack',JSON.stringify(backData))
+  next()
 })
 
 const $router = useRouter()
@@ -79,25 +80,6 @@ const {
 } = useViewRemarkCustomDia();//查看备注弹窗
 
 
-function init() {
-  /* 返回保持上次的状态 */
-  if(sessionStorage.getItem('customSearchBack')) {
-    let backData = JSON.parse(sessionStorage.getItem('customSearchBack'));
-    search_txt.value = backData.keyword;
-    pageinfo.page_no=backData.page
-    getTableData()
-  }
-  getSale();
-
-
-  search_txt.value= $route.query.name ? $route.query.name:  $route.query.code?$route.query.code : ''
-		if(search_txt.value){
-			getTableData()
-		}
-}
-init()
-
-
 /* 获取表格数据 */
 const search_txt = ref('')
 const isShowloadding = ref(false)
@@ -140,6 +122,25 @@ function handleCurrentChange(page){
 }
 
 
+function init() {
+  /* 返回保持上次的状态 */
+  if(sessionStorage.getItem('customSearchBack')) {
+    let backData = JSON.parse(sessionStorage.getItem('customSearchBack'));
+
+    search_txt.value = backData.keyword;
+    pageinfo.page_no=backData.page
+    getTableData()
+  }
+  getSale();
+
+  search_txt.value= $route.query.name ? $route.query.name:  $route.query.code?$route.query.code : ''
+		if(search_txt.value){
+			getTableData()
+		}
+}
+init()
+
+
 // 处理状态的数据
 function transformedArray(row){
   return [
@@ -920,7 +921,7 @@ function researchDetailHandle(item) {
 		:append-to-body="true"
 		@close="closeDia"
 		width="800px"
-		v-dialogDrag
+		draggable
 		center>
       <template #header>
         <div style="display:flex;alignItems:center;">

+ 0 - 0
src/views/custom_manage/custom/editCustom.vue


+ 5 - 4
src/views/custom_manage/custom/hooks/customlistHook.js

@@ -56,12 +56,12 @@ export function useList() {
 
 	/* 前往详情页 */
 	function goDetail(item) {
-		const { href } = router.resolve({
+		router.push({
 			path:'/customDetail',
 			query:{
-				id:item.CompanyId,
-			}});
-		window.open(href, '_blank');
+				id:item.CompanyId
+			}
+		})
 	}
 
 	/* 启用/暂停 */
@@ -115,6 +115,7 @@ export function useList() {
 		btnName,
 		goDetail,
 		suspendHandle,
+		editHandle,
 
 		Role,
 		RaiSellerRole,

+ 509 - 0
src/views/custom_manage/custom/pickCustom.vue

@@ -0,0 +1,509 @@
+<script setup>
+import { reactive, ref, watch } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useRoute, useRouter } from 'vue-router'
+import { customInterence } from '@/api/api.js'
+import Contactdia from './components/Contactdialog.vue'
+import { useList } from  './hooks/customlistHook'
+
+const $router = useRouter()
+const $route = useRoute()
+
+const { Role } = useList()
+
+const formRule = {
+  /* 客户名称 */
+  custom_name:[
+    { required: true, message: '客户名称不能为空', trigger: 'blur' },
+  ],
+  /* 社会信用码 */
+  code:[
+    { required: true, message: '社会信用码不能为空', trigger: 'blur' },
+  ],
+  /* 客户状态 */
+  cuStatus:[
+    { required: true, message: '客户状态不能为空', trigger: 'blur' },
+  ],
+  /* 客户类型 */
+  custype:[
+    { required: true, message: '客户类型不能为空', trigger: 'blur' },
+  ],
+  /* 行业 */
+  trade:[
+    { required: true, message: '行业不能为空', trigger: 'blur' },
+  ],
+  /* 客户来源 */
+  from:[
+    { required: true, message: '客户来源不能为空', trigger: 'blur' },
+  ],
+  /* 销售 */
+  sales:[
+    { required: true, message: '所属销售不能为空', trigger: 'blur' },
+  ],
+  /* 备注 */
+  // addreason:[
+  // 	{ required: true, message: '备注不能为空', trigger: 'blur' },
+  // ],
+}
+
+
+const companyId = ref($route.query.id)
+const activeNames = ref(['1'])//默认展开
+const regionType = ref('')
+const basicInfo = ref({})//领取的客户基本信息
+const pickForm = reactive({
+  cuStatus:'试用',
+  custype:'',
+  trade:'',
+  from:'',
+  sales:Number(localStorage.getItem('AdminId'))||'',
+  addreason:''
+})
+const authList = ref([])
+/* 获取客户详情信息 */
+function getDetail() {
+  customInterence.customDetail({
+    CompanyId:companyId.value
+  }).then(res => {
+  
+    if(res.Ret === 200) {
+      regionType.value=res.Data.Item.RegionType
+      
+      let ficcform = res.Data.FiccItem;//ficc添加的信息
+      let basicform = res.Data.Item;//客户基本信息
+      let raiform = res.Data.RaiItem;//权益添加的信息
+      /* 基础表单 */
+      basicInfo.value = {
+        custom_name:basicform.CompanyName,
+        code:basicform.CreditCode,
+        province:basicform.Province,
+        city:basicform.City,
+        CompanyProductId:res.Data.CreateAuth == 1?ficcform.CompanyProductId:raiform.CompanyProductId,
+        cuStatus:res.Data.CreateAuth == 1?ficcform.Status:raiform.Status,
+        custype:res.Data.CreateAuth == 1?'ficc':'权益',
+        trade:res.Data.CreateAuth == 1?ficcform.IndustryName:raiform.IndustryName,
+        from:res.Data.CreateAuth == 1?ficcform.Source:raiform.Source,
+        sales:res.Data.CreateAuth == 1?ficcform.SellerName:raiform.SellerName,
+        addreason:res.Data.CreateAuth == 1?ficcform.Reasons:raiform.Reasons
+      }
+
+      pickForm.custype = basicInfo.value.custype=='ficc'?'权益':'ficc';
+      if(res.Data.CreateAuth == 1) { //ficc创建客户
+        /* 处理权限列表格式 */
+        let auth = [];
+        ficcform.PermissionList.forEach(item=> {
+          let obj = {
+            checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
+            isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
+            ...item,
+          }
+          auth.push(obj)
+        })
+        authList.value = auth;
+      }else if (res.Data.CreateAuth == 2){ //权益创建客户
+        /* 处理权限列表格式 */
+        let auth = [];
+        raiform.PermissionList.forEach(item=> {
+          let obj = {
+            checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
+            isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
+            ...item,
+          }
+          auth.push(obj)
+        })
+        authList.value = auth;
+      }
+
+      getAuthBasic();
+    }
+  })
+}
+getDetail()
+
+
+/* 获取基本权限信息 */
+const authListRai = ref([])
+function getAuthBasic() {
+  customInterence.authList({
+    NoUpgrade:true
+  }).then(res => {
+    if(res.Ret === 200) {
+      let newArr = [];
+      res.Data.List.length&&res.Data.List.forEach(item => {
+        let obj = {
+          checkAll:false,
+          isIndeterminate:item.ClassifyName === '宏观经济'?true:false,
+          ...item,
+        }
+        newArr.push(obj)
+      })
+      authListRai.value = newArr;
+    }
+  })
+}
+
+
+/* 获取客户来源数据 */
+const fromArr = ref([])//客户来源
+function getCustomerSourceList(){
+  customInterence.customerSourceList().then(res=>{
+    if(res.Ret===200){
+      fromArr.value = res.Data.List
+    }
+  })
+}
+getCustomerSourceList()
+
+
+/* 获取销售 */
+const salesArr = ref([])
+function getSale() {
+  customInterence.saleslist().then(res => {
+    if(res.Ret === 200) {
+      salesArr.value = res.Data.List;
+    }
+  })
+}
+getSale()
+
+
+/* 根据类型获取行业 */
+const tradeArr = ref([])
+function getIndustry() {
+  customInterence.getindustry({
+    Classify:pickForm.custype
+  }).then(res => {
+    if(res.Ret === 200) {
+      tradeArr.value = res.Data.List || [];
+    }
+  })
+}
+
+/* 选择行业先校验是否选择了客户类型提示  */
+function slideTrade(e) {
+  if(!pickForm.custype) {
+    ElMessage.warning('请先选择客户类型!')
+  }
+}
+
+
+/* 确定 */
+const pickFormRef = ref(null)
+const diaform = ref({
+  name:'',
+  sex:1,
+  telCode:'86',
+  tel1:'',
+  tel2:'',
+  mail:'',
+  post:'',
+  desiger:'',
+  depart:'',
+  carte:'',
+  Source:'pick_custom',
+})
+const isAddContact = ref(false)//是否添加联系人
+const isShowclose = ref(false)//是否显示取消
+function saveHandle() {
+  pickFormRef.value.validate((valid) => {
+    if (valid) {
+      
+      //判断是否选择了权限,默认勾选的也算上
+      let checkArr = [];
+      authListRai.value.forEach(item => {
+        checkArr.push(...item.CheckList)
+      })
+      console.log(checkArr);
+      
+      if(!checkArr.length) {
+        ElMessage.warning('请选择权限')
+        return
+      }
+      isAddContact.value = true;
+    }
+  })
+}
+
+/* 添加联系人之后再领取客户 */
+function cancelConcatdia(type) {
+  
+  isAddContact.value = false;
+  if(type === 1) {
+    let checkArr = [];
+    authListRai.value.forEach(item => {
+      if(item.CheckList.length) {
+        checkArr.push(item.CheckList)
+      }
+    })
+    if(checkArr.length) {
+      let PermissionIds = checkArr.flat(2).join(',');
+      let params = {
+        CompanyId: Number(companyId.value),
+        IndustryId: pickForm.trade,
+        Reasons: pickForm.addreason,
+        SellsId: pickForm.sales,
+        Source: pickForm.from,
+        Status: pickForm.cuStatus,
+        CompanyType:pickForm.custype,
+        PermissionIds
+      }
+      customInterence.Pick(params).then(res => {
+        if(res.Ret === 200) {
+          ElMessage.success(res.Msg);
+          $router.go(-2);
+        }
+      })
+    }else {
+      ElMessage.warning('权限设置不能为空')
+    }
+  }else {
+    ElMessage.warning('领取失败')
+  }
+}
+
+/* 取消 */
+function cancelPick() {
+  $router.go(-1);
+}
+
+
+/* 选择全选或取消全选 */
+function handleCheckAll(item) {
+  // 取到所有的子菜单id
+  let ids = item.Items.map(item =>{
+    return item.ChartPermissionId
+  })
+  item.CheckList = item.checkAll ? ids : [];
+      item.isIndeterminate = false;
+}
+/* 复选框組选中时 */
+function handleChecked(item) {
+  let len = item.CheckList.length;
+  item.checkAll = len === item.Items.length;
+  item.isIndeterminate = len > 0 && len < item.Items.length;
+}
+
+
+watch(
+  () => pickForm.custype,
+  () => {
+    getIndustry();
+  }
+)
+
+</script>
+<template>
+  <div class="pickCustom_container">
+		<div class="left_form_cont">
+			<ul class="detail_item">
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">客户名称</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.custom_name}}</span>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">社会信用码</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.code}}</span>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">客户地址</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.province+'/'+basicInfo.city}}</span>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">客户状态</label>
+					<el-radio border :label="basicInfo.cuStatus" style="width:184px;marignRight:200px;" v-model="basicInfo.cuStatus">{{basicInfo.cuStatus=='试用'?'试用(2个月)':basicInfo.cuStatus}}</el-radio>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">客户类型</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.custype}}</span>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">行业</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.trade}}</span>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">客户来源</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.from}}</span>
+				</li>
+				<li>
+					<label style="marginRight:60px;width:80px;textAlign:right;display:inline-block;">所属销售</label>
+					<span style="width:400px;display:inline-block;">{{basicInfo.sales}}</span>
+				</li>
+				<li class="textarea_item" style="width:90%;paddingLeft:15px;">
+					<label style="display:block;marginBottom:20px;fontSize:16px;position:relative;">
+						权限设置
+					</label>
+					<ul class="menu_lists">
+						<li v-for="item in authList" :key="item.ClassifyName" class="menu_item">
+							<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" disabled style="marginRight:30px;fontWeight:bold;">{{item.ClassifyName+':'}}</el-checkbox>
+							<el-checkbox-group v-model="item.CheckList" disabled>
+								<el-checkbox v-for="list in item.Items" :label="list.ChartPermissionId" :key="list.ChartPermissionId" class="list_item">{{list.PermissionName}}</el-checkbox>
+							</el-checkbox-group>
+						</li>
+					</ul>
+				</li>
+			</ul>
+			<!-- 可折叠form -->
+			<el-collapse v-model="activeNames" style="width:93%;marginTop:50px;">
+				<el-collapse-item :title="basicInfo.custype=='ficc'?'权益属性配置':'ficc属性配置'" name="1">
+					<el-form
+					@submit.prevent 
+					inline
+					:model="pickForm" 
+					:rules="formRule"
+					hide-required-asterisk
+					ref="pickFormRef" 
+					label-width="100px" 
+					class="demo-ruleForm">
+						<el-form-item label="客户来源" prop="from" style="marginRight:120px;">
+								<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+								<el-select v-model="pickForm.from" placeholder="请选择客户来源" style="width:400px;" filterable>
+									<el-option
+										v-for="item in fromArr"
+										:key="item.SourceId"
+										:label="item.SourceName"
+										:value="item.SourceName">
+									</el-option>
+								</el-select>
+							</el-form-item>
+						<el-form-item label="客户状态" prop="cuStatus">
+							<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+							<el-radio-group v-model="pickForm.cuStatus" size="default">
+								<el-radio border label="试用" style="width:184px;">试用(2个月)</el-radio>
+							</el-radio-group>
+						</el-form-item>
+						<el-form-item label="客户类型" prop="custype" style="marginRight:120px;">
+							<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+							<span style="width:400px;display:inline-block;fontSize:16px;color:#666;">{{pickForm.custype}}</span>
+						</el-form-item>
+						<el-form-item label="行业" prop="trade">
+							<i style="color:#f00;fontSize:20px;position:absolute;left:-58px;top:10%;">*</i>
+							<el-select v-model="pickForm.trade" placeholder="请选择行业" style="width:400px;">
+								<el-option
+									v-for="item in tradeArr"
+									:key="item"
+									:label="item.IndustryName"
+									:value="item.IndustryId">
+								</el-option>
+							</el-select>
+						</el-form-item>
+						<el-form-item label="所属销售" prop="sales">
+							<i style="color:#f00;fontSize:20px;position:absolute;left:-90px;top:10%;">*</i>
+							<el-select v-model="pickForm.sales" placeholder="请选择销售" style="width:400px;" filterable :disabled="Role=='rai_seller'||Role=='ficc_seller'">
+								<el-option
+									v-for="item in salesArr"
+									:key="item.AdminId"
+									:label="item.RealName"
+									:value="item.AdminId">
+								</el-option>
+							</el-select>
+						</el-form-item>
+						
+						<el-form-item class="textarea_item" style="width:96%;paddingLeft:26px;">
+							<label style="display:block;marginBottom:20px;fontSize:16px;position:relative;color:#666;">
+								<i style="color:#f00;fontSize:20px;position:absolute;left:-15px;top:10%;">*</i>
+								权限设置
+							</label>
+							<ul class="menu_lists">
+								<li v-for="item in authListRai" :key="item.ClassifyName" class="menu_item">
+									<el-checkbox :indeterminate="item.isIndeterminate" v-model="item.checkAll" :disabled="item.ClassifyName === '宏观经济'" @change="handleCheckAll(item)" style="marginRight:30px;fontWeight:bold;">{{item.ClassifyName+':'}}</el-checkbox>
+									<el-checkbox-group v-model="item.CheckList" @change="handleChecked(item)">
+										<el-checkbox v-for="list in item.Items" :label="list.ChartPermissionId" :key="list.ChartPermissionId" class="list_item" :disabled="list.ChartPermissionId==1">{{list.PermissionName}}</el-checkbox>
+									</el-checkbox-group>
+								</li>
+							</ul>
+						</el-form-item>
+					</el-form>
+				</el-collapse-item>
+			</el-collapse>
+			<div style="display:flex;justify-content:center;margin:40px 0 0;">
+				<el-button type="primary" style="width:80px;marginRight:24px;" @click="saveHandle">确定</el-button>
+				<el-button type="primary" plain style="width:80px;" @click="cancelPick">取消</el-button>
+			</div>
+		</div>
+		<!-- 添加联系人弹窗 -->
+		<Contactdia
+      :id="companyId"
+      :title="'新增联系人'"
+      :userForm="diaform"
+      :custom_name="basicInfo.custom_name"
+      :needCard="true"
+      :isPickOther="true"
+      :isShowclose="isShowclose"
+      :regionType="regionType"
+      :isAddContact="isAddContact"
+      @cancel="cancelConcatdia"
+    />
+	</div>
+</template>
+<style scoped lang="scss">
+.pickCustom_container {
+	padding:30px 40px 60px 60px;
+	background: #fff;
+	position: relative;
+	border: 1px solid #ECECEC;
+	border-radius: 4px;
+	box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+	font-size: 16px;
+	color: #666;
+	/* reset */
+	:deep(.el-collapse) {
+		border: none;
+    .el-collapse-item__header {
+      display: block;
+      border: none;
+      font-size: 16px;
+      color: #333;
+      margin-bottom: 20px;
+      text-align: left;
+    }
+    .el-collapse-item__wrap {
+      border: none;
+    }
+	}
+	:deep(.textarea_item .el-form-item__content) {
+		width: 100%;
+	}
+	:deep(.el-form-item .el-checkbox-group) {
+		height: 40px;
+		line-height: 40px;
+	}
+	/*  */
+	.detail_item {
+		display: flex;
+		align-items: center;
+		flex-wrap: wrap;
+		li {
+			font-size: 16px;
+			color: #666;
+			margin-bottom: 30px;
+			min-width: 545px;
+			margin-right: 30px;
+			&:last-child {
+				margin-bottom: 0;
+			}
+			// display: flex;
+			// align-items: center;
+		}
+	}
+	.menu_lists {
+    width: 100%;
+		padding: 40px 18px;
+		border: 1px dashed #AAB4CC;
+		border-radius: 4px;
+		.menu_item {
+			display: flex;
+			// align-items: center;
+			margin-bottom: 40px;
+			&:last-child {
+				margin-bottom: 0;
+			}
+			.list_item {
+				margin-right: 30px;
+				&:last-child {
+					margin-right: 0;
+				}
+			}
+		}
+	}
+}
+</style>

+ 299 - 0
src/views/custom_manage/custom/pickList.vue

@@ -0,0 +1,299 @@
+<script setup>
+import { computed, reactive, ref, toRefs } from "vue";
+import { onBeforeRouteLeave, useRoute, useRouter } from "vue-router";
+import { Search } from "@element-plus/icons-vue";
+import { customInterence } from "@/api/api.js";
+import { useList } from "./hooks/customlistHook";
+import DatePicker from "vue-datepicker-next";
+
+const $router = useRouter();
+const $route = useRoute();
+
+const { goDetail } = useList();
+
+const Role = computed(() => {
+  let role = localStorage.getItem("Role") || "";
+  return role;
+});
+
+onBeforeRouteLeave((to, form, next) => {
+  let backData = {
+    page_no: filterState.page_no,
+    keyword: filterState.search_txt,
+    start_date: filterState.start_date,
+    end_date: filterState.end_date,
+    date: filterState.date,
+  };
+  sessionStorage.setItem("pickListBack", JSON.stringify(backData));
+  next();
+});
+
+const filterState = reactive({
+  date: "",
+  start_date: "", //开始日期
+  end_date: "", //结束日期
+  search_txt: "",
+  page_no: sessionStorage.getItem("pickListBack")
+    ? JSON.parse(sessionStorage.getItem("pickListBack")).page_no
+    : 1,
+  pageSize: 10,
+});
+const tableData = ref([]);
+const total = ref(0);
+/* 获取表格 */
+function getTableData() {
+  let params = {
+    PageSize: filterState.pageSize,
+    CurrentIndex: filterState.page_no,
+    StartDate: filterState.start_date,
+    EndDate: filterState.end_date,
+    KeyWord: filterState.search_txt,
+  };
+  customInterence.pickList(params).then((res) => {
+    if (res.Ret === 200) {
+      res.Data.List &&
+        res.Data.List.forEach((item) => {
+          item.StartDate = item.StartDate.replace(/-/g, ".");
+          item.EndDate = item.EndDate.replace(/-/g, ".");
+        });
+      tableData.value = res.Data.List || [];
+      total.value = res.Data.Paging.Totals;
+    }
+  });
+}
+/* 页码改变 */
+function handleCurrentChange(page) {
+  filterState.page_no = page;
+  getTableData();
+}
+
+/* 搜索客户 重置筛选条件 */
+function searchHandle() {
+  filterState.page_no = 1;
+  getTableData();
+}
+
+function init() {
+  if (sessionStorage.getItem("pickListBack")) {
+    let backData = JSON.parse(sessionStorage.getItem("pickListBack"));
+    filterState.search_txt = backData.keyword;
+    (filterState.page_no = backData.page_no),
+      (filterState.date = backData.date),
+      (filterState.start_date = backData.start_date),
+      (filterState.end_date = backData.end_date);
+  }
+  getTableData();
+}
+init();
+
+/* 选择日期 */
+function dateChange(e) {
+  if (e[0]) {
+    filterState.start_date = e[0];
+    filterState.end_date = e[1];
+  } else {
+    filterState.start_date = "";
+    filterState.end_date = "";
+  }
+  filterState.page_no = 1;
+  getTableData();
+}
+
+/* 领取客户 */
+function receiveHandle(item) {
+  $router.push({
+    path: "/pickCustom",
+    query: {
+      id: item.CompanyId,
+    },
+  });
+}
+
+const { date, search_txt, page_no, pageSize } = toRefs(filterState);
+</script>
+<template>
+  <div class="pickCustom_container">
+    <div class="customList_bot_top">
+      <div>
+        <date-picker
+          v-model:value="date"
+          type="date"
+          range
+          value-type="format"
+          placeholder="创建日期"
+          @change="dateChange"
+        ></date-picker>
+      </div>
+      <el-input
+        placeholder="客户名称/社会信用码/手机号码/邮箱"
+        v-model="search_txt"
+        style="max-width: 500px"
+        @input="searchHandle"
+        clearable
+      >
+        <template #prefix>
+          <el-icon><Search /></el-icon>
+        </template>
+      </el-input>
+    </div>
+    <div class="customList_bot">
+      <div class="bot_cont">
+        <el-table
+          ref="userTable"
+          :data="tableData"
+          v-loading="isShowloadding"
+          element-loading-text="数据加载中..."
+          highlight-current-rows
+          border
+        >
+          <el-table-column prop="CompanyName" label="客户名称" align="center">
+            <template #default="scope">
+              <span
+                style="color: #409eff; cursor: pointer"
+                @click="goDetail(scope.row)"
+                class="customName"
+                >{{ scope.row.CompanyName }}</span
+              >
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="ProductName"
+            label="客户类型"
+            align="center"
+            width="120px;"
+          >
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''">{{
+                scope.row.ProductName
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="IndustryName" label="所属行业" align="center">
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''">{{
+                scope.row.IndustryName
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="SellerName" label="所属销售" align="center">
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''">{{
+                scope.row.SellerName
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column prop="Status" label="客户状态" align="center">
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''">{{
+                scope.row.Status
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="EndDate"
+            label="服务期限"
+            align="center"
+            min-width="120px"
+          >
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''"
+                >{{ scope.row.StartDate }}-{{ scope.row.EndDate }}</span
+              >
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="ExpireDay"
+            label="到期天数"
+            align="center"
+            sortable
+          >
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''">{{
+                scope.row.ExpireDay || "--"
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="CreatedTime"
+            label="创建时间"
+            sortable
+            align="center"
+          >
+            <template #default="scope">
+              <span :style="scope.row.IsButtonShow == 8 ? 'color:#bbb' : ''">{{
+                scope.row.CreatedTime
+              }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="操作" align="center" min-width="120">
+            <template #default="scope">
+              <div style="color: #4099ef; font-size: 24px">
+                <span
+                  class="editsty"
+                  style="margin-right: 10px"
+                  @click="receiveHandle(scope.row)"
+                  >领取</span
+                >
+              </div>
+            </template>
+          </el-table-column>
+          <template #empty>
+            <div style="lineheight: 44px; margin: 60px 0; color: #999">
+              <img
+                src="~@/assets/img/cus_m/nodata.png"
+                alt=""
+                style="
+                  display: block;
+                  width: 160px;
+                  height: 128px;
+                  margin: auto;
+                "
+              />
+              <span>暂无信息</span>
+            </div>
+          </template>
+        </el-table>
+        <el-col :span="24" class="toolbar">
+          <el-pagination
+            layout="total,prev,pager,next,jumper"
+            background
+            :current-page="page_no"
+            @current-change="handleCurrentChange"
+            :page-size="pageSize"
+            @size-change="handleSizeChange"
+            :total="total"
+            style="float: right"
+          >
+          </el-pagination>
+        </el-col>
+      </div>
+    </div>
+  </div>
+</template>
+<style scoped lang="scss">
+.pickCustom_container {
+  .customList_bot_top {
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    margin-bottom: 28px;
+    padding: 20px 30px;
+    background: #fff;
+    border: 1px solid #ececec;
+    border-radius: 4px;
+    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+  }
+  .customList_bot {
+    // min-height: calc(100vh - 286px);
+    padding: 30px 30px 80px;
+    background: #fff;
+    position: relative;
+    border: 1px solid #ececec;
+    border-radius: 4px;
+    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
+    .try_style {
+      color: #bbbbbb;
+    }
+  }
+}
+</style>

+ 10 - 0
src/views/custom_manage/custom/updateServe.vue

@@ -0,0 +1,10 @@
+<script setup>
+import { ref } from 'vue'
+
+</script>
+<template>
+  <div></div>
+</template>
+<style scoped lang="scss">
+
+</style>