customAllList.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. <template>
  2. <!-- 全量客户列表 是customList的阉割版 -->
  3. <div class="customList_container" ref="cusContainer">
  4. <div class="customList_bot_top">
  5. <div>
  6. <a :href="exportUrlDl" download>
  7. <el-button type="primary" plain style="width:100px;marginRight:10px;">导出客户</el-button>
  8. </a>
  9. <a :href="exportUserDl" download>
  10. <el-button type="primary" plain style="width:110px;">导出联系人</el-button>
  11. </a>
  12. </div>
  13. <el-input placeholder="客户名称/社会信用码/手机号码/邮箱" v-model="search_txt" style="max-width:520px"
  14. @input="searchHandle" clearable>
  15. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  16. </el-input>
  17. </div>
  18. <div class="customList_bot">
  19. <div class="customList_top">
  20. <el-row :span="24">
  21. <el-select v-model="type" placeholder="请选择客户类型"
  22. style="width:200px;marginRight:10px;marginBottom:8px;" clearable
  23. v-if="Role=='finance'||Role=='admin'" @change="changeType">
  24. <el-option v-for="item in typeArr" :key="item" :label="item.name" :value="item.name">
  25. </el-option>
  26. </el-select>
  27. <el-select v-model="trade" placeholder="请选择行业"
  28. style="width:200px;marginRight:10px;marginBottom:8px;" clearable @change="changeTrade">
  29. <el-option v-for="item in tradeArr" :key="item.IndustryId" :label="item.IndustryName"
  30. :value="item.IndustryId">
  31. </el-option>
  32. </el-select>
  33. <el-cascader v-model="sales" placeholder="请选择销售"
  34. style="width:200px;marginRight:10px;marginBottom:8px;" :options="salesArr"
  35. :props="defaultSalesProps" :show-all-levels="false" collapse-tags clearable filterable
  36. @change="changeSales">
  37. </el-cascader>
  38. <el-select v-model="setmealSelect" placeholder="请选择套餐类型"
  39. style="width:200px;marginRight:10px;marginBottom:8px;" clearable @change="changeTrade">
  40. <el-option v-for="item in setmealArr" :key="item.id" :label="item.name" :value="item.id">
  41. </el-option>
  42. </el-select>
  43. <el-cascader v-model="variety" placeholder="请选择已购品种"
  44. style="width:200px;marginRight:10px;marginBottom:8px;" :options="varietyArr"
  45. :props="defaultprops" :show-all-levels="false" collapse-tags clearable filterable
  46. @change="changeVariety">
  47. </el-cascader>
  48. <el-cascader v-model="variety_red" placeholder="请选择阅读权限"
  49. style="width:200px;marginRight:10px;marginBottom:8px;" :options="varietyArr"
  50. :props="defaultprops" :show-all-levels="false" collapse-tags clearable filterable
  51. @change="changeVariety">
  52. </el-cascader>
  53. <el-cascader v-model="valueLocation" collapse-tags :props="locationProps" clearable
  54. :options="locationOptions" @change="handleChangeLocation" placeholder="请选择客户地址"
  55. style="width:200px;marginRight:10px;marginBottom:8px;">
  56. </el-cascader>
  57. <date-picker v-model="date" type="date" range value-type="format" placeholder="服务日期"
  58. @change="dateChange" style="width:200px;marginRight:10px;marginBottom:8px;">
  59. </date-picker>
  60. <date-picker v-model="createdate" type="date" range value-type="format" placeholder="创建时间"
  61. @change="dateChange2" style="width:200px;marginRight:10px;marginBottom:8px;">
  62. </date-picker>
  63. </el-row>
  64. </div>
  65. <ul class="tabs_cont">
  66. <li :class="['tab',{'act':act_status === item.Status}]" v-for="(item,index) in tabs" :key="index"
  67. @click="changeStatus(item,index)">
  68. {{item.Status+'('+item.Count+')'}}
  69. </li>
  70. </ul>
  71. <ul class="tabs_cont trial-ul" v-if="act_status === '试用'">
  72. <li :class="['trial-item',{'act':act_trialTag === item.TryStage}]" v-for="item in trialTagArr"
  73. :key="item.TryStage" @click="changeTagStatus(item)">
  74. {{item.TryStageStr+'('+item.Count+')'}}
  75. </li>
  76. </ul>
  77. <div class="bot_cont">
  78. <el-table ref="userTable" :data="tableData" v-loading="isShowloadding" element-loading-text="数据加载中..."
  79. @sort-change="sortChangeHandle" border>
  80. <el-table-column prop="CompanyName" label="客户名称" align="center" min-width="7.14%">
  81. <template slot-scope="scope" :class="{'isShared':scope.row.IsShared}">
  82. <span v-if="scope.row.IsSuspend ===1 || scope.row.Status=='潜在'" @click="goDetail(scope.row)"
  83. class="mouse-enter"
  84. :class="{'color-red':act_status==='正式'&&scope.row.Status.includes('正式')&&scope.row.WeekViewActive===0}"
  85. :style="scope.row.Status=='潜在'?'':'color:#bbb;cursor:pointer'">
  86. {{scope.row.CompanyName}}
  87. </span>
  88. <span v-else style="color:#409EFF;cursor:pointer;" @click="goDetail(scope.row)"
  89. class="customName"
  90. :class="{'isShared':scope.row.IsShared,'color-red':act_status==='正式'&&scope.row.Status.includes('正式')&&scope.row.WeekViewActive===0}">{{scope.row.CompanyName}}</span>
  91. <img width="15" src="../../../assets/img/icons/remark.png" alt=""
  92. v-if="scope.row.RenewalReason||(scope.row.Status==='冻结'&&scope.row.FreezeReason)">
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="DL" prop="deadline" align="center" min-width="5%" sortable="custom">
  96. <template slot="header" slot-scope="{}">
  97. <div class="todolabel" :class="{sort:sort_param==='deadline'}"
  98. style="display:inline-block;">
  99. <span>DL</span>
  100. <el-tooltip effect="dark" placement="top-start" content="未完成To Do任务的截止日期-当前日期">
  101. <i class="el-icon-info" />
  102. </el-tooltip>
  103. </div>
  104. </template>
  105. <template slot-scope="{row}">
  106. <span>{{row.Deadline||'--'}}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column prop="CompanyType" label="类型" align="center" min-width="4.14%">
  110. <template slot-scope="{row}">
  111. <template v-if="row.CompanyType.indexOf('/')!==-1">
  112. <span
  113. :style="row.IsSuspend===1?'color:#bbb':''">{{row.CompanyType.split('/')[0]}}</span><br />
  114. <span v-if="row.FiccPackageType"
  115. class="ficc-package">{{row.FiccPackageType == 1 ? '大套餐': '小套餐'}}</span>
  116. <br v-if="row.FiccPackageType" />
  117. <span
  118. :style="row.IsSuspend===1?'color:#bbb':''">{{row.CompanyType.split('/')[1]}}</span>
  119. </template>
  120. <template v-else>
  121. <span :style="row.IsSuspend===1?'color:#bbb':''">{{row.CompanyType}}</span>
  122. <span v-if="row.FiccPackageType&&row.CompanyType.includes('ficc')"
  123. class="ficc-package">{{row.FiccPackageType == 1 ? '大套餐': '小套餐'}}</span>
  124. </template>
  125. </template>
  126. </el-table-column>
  127. <el-table-column prop="IndustryName" label="所属行业" min-width="6.14%" align="center">
  128. <template slot-scope="scope">
  129. <div :style="scope.row.IsSuspend===1?'color:#bbb':''">
  130. <p :style="scope.row.IsSuspend===1?'color:#bbb':''"
  131. v-for="item in scope.row.IndustryName.split('/')" :key="item">{{item}}</p>
  132. </div>
  133. </template>
  134. </el-table-column>
  135. <el-table-column prop="City" label="客户地址" min-width="6.14%" align="center">
  136. <template slot-scope="scope">
  137. <span v-if="scope.row.Province && scope.row.City"
  138. :style="scope.row.IsSuspend===1?'color:#bbb':''">{{scope.row.Province}}<br />{{scope.row.City}}</span>
  139. <span v-else
  140. :style="scope.row.IsSuspend===1?'color:#bbb':''">{{scope.row.RegionType}}</span>
  141. </template>
  142. </el-table-column>
  143. <el-table-column prop="SellerName" label="销售" min-width="6.14%" align="center">
  144. <template slot-scope="scope">
  145. <p :style="scope.row.IsSuspend===1?'color:#bbb':''"
  146. v-for="item in scope.row.SellerName.split('/')" :key="item">{{item}}</p>
  147. </template>
  148. </el-table-column>
  149. <el-table-column prop="Status" label="状态" min-width="7.14%" align="center"
  150. :sortable="act_status==='试用'&&act_trialTag===0?'custom':false" style="background:red">
  151. <template slot="header" slot-scope="{}">
  152. <div class="todolabel" :class="{sort:sort_param==='tryStage'}"
  153. style="display:inline-block;">
  154. <span>状态</span>
  155. </div>
  156. </template>
  157. <template slot-scope="scope">
  158. <p :style="scope.row.IsSuspend===1?'color:#bbb;margin:3px 0':'margin:3px 0'"
  159. v-for="(item,index) in scope.row.Status.split('/')" :key="item">
  160. {{ item }}
  161. <template v-if="item === '试用' && scope.row.TryStageSlice">
  162. <el-select v-model="scope.row.TryStageSlice[index].TryStage"
  163. v-if="scope.row.Status === '试用/试用'"
  164. :disabled="!scope.row.TryStageSlice[index].HasPermission" size="mini"
  165. style="width: 50px" placeholder=""
  166. @change="changeTrialHandle(scope.row,scope.row.TryStageSlice[index])">
  167. <el-option v-for="item in trialTags" :key="item.value" :label="item.label"
  168. :value="item.value">
  169. </el-option>
  170. </el-select>
  171. <el-select v-model="scope.row.TryStageSlice[0].TryStage"
  172. :disabled="!scope.row.TryStageSlice[0].HasPermission" v-else size="mini"
  173. style="width: 50px" placeholder=""
  174. @change="changeTrialHandle(scope.row,scope.row.TryStageSlice[0])">
  175. <el-option v-for="item in trialTags" :key="item.value" :label="item.label"
  176. :value="item.value">
  177. </el-option>
  178. </el-select>
  179. </template>
  180. </p>
  181. </template>
  182. </el-table-column>
  183. <el-table-column label="累计试用天数" align="center" min-width="5.14%" prop="tryOutDay" sortable="custom">
  184. <template slot-scope="{row}">
  185. <el-tooltip :disabled="row.IsSuspend===1||(row.FiccTryOutDay+row.RaiTryOutDay===0)">
  186. <div slot="content">
  187. <p v-if="row.FiccTryOutDay">FICC累计试用天数:{{row.FiccTryOutDay}}</p>
  188. <p v-if="row.RaiTryOutDay">权益累计试用天数:{{row.RaiTryOutDay}}</p>
  189. </div>
  190. <span :style="row.IsSuspend===1?'color:#bbb':'color:#409EFF;cursor:pointer;'"
  191. @click="handleTotalDayClick(row)">
  192. {{row.FiccTryOutDay+row.RaiTryOutDay}}
  193. </span>
  194. </el-tooltip>
  195. </template>
  196. </el-table-column>
  197. <el-table-column label="阅读" align="center" min-width="5.14%" prop="viewTotal" sortable="custom">
  198. <template slot-scope="{row}">
  199. <el-tooltip :disabled="row.IsSuspend===1 || (row.FiccView+row.RaiView)===0">
  200. <div slot="content">
  201. <p v-if="row.FiccView">FICC报告阅读次数:{{row.FiccView}}</p>
  202. <p v-if="row.RaiView">权益报告阅读次数:{{row.RaiView}}</p>
  203. </div>
  204. <span :style="row.IsSuspend===1?'color:#bbb':'color:#409EFF;cursor:pointer;'">
  205. <!-- {{row.FiccView+row.RaiView}} -->
  206. <!-- 阅读次数拆分 -->
  207. {{row.AllViewTotal}}
  208. </span>
  209. </el-tooltip>
  210. </template>
  211. </el-table-column>
  212. <el-table-column label="路演" align="center" min-width="5.14%" prop="roadShowTotal" sortable="custom">
  213. <template slot-scope="scope">
  214. <span :style="scope.row.IsSuspend===1?'color:#bbb':''"
  215. @click="accumulativeFrequencyClick(scope)" class="editsty"
  216. v-if="scope.row.RoadShowTotal > 0">{{scope.row.RoadShowTotal}}</span>
  217. <span :style="scope.row.IsSuspend===1?'color:#bbb':''"
  218. v-else>{{scope.row.RoadShowTotal}}</span>
  219. </template>
  220. </el-table-column>
  221. <el-table-column label="最近阅读" min-width="8.14%" align="center" prop="viewTime" sortable="custom">
  222. <template slot-scope="scope">
  223. <p v-if="scope.row.FiccLastViewTime" :style="scope.row.IsSuspend===1?'color:#bbb':''">ficc:
  224. {{$moment(scope.row.FiccLastViewTime).format('YYYY.MM.DD')}}</p>
  225. <p v-else-if="scope.row.RaiLastViewTime" :style="scope.row.IsSuspend===1?'color:#bbb':''">
  226. 权益: {{$moment(scope.row.RaiLastViewTime).format('YYYY.MM.DD')}}</p>
  227. <p v-else :style="scope.row.IsSuspend===1?'color:#bbb':''">--</p>
  228. </template>
  229. </el-table-column>
  230. <el-table-column prop="EndDate" :label="act_status=='冻结'?'冻结期限':'服务期限'" align="center"
  231. min-width="6.14%">
  232. <template slot-scope="scope">
  233. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  234. <!-- 正常的时间显示 -->
  235. <template v-if="scope.row.StartDate.indexOf('/')==-1">
  236. <template v-if="act_status=='流失'">
  237. 创建时间:{{scope.row.CreatedTime|formatTime}}
  238. </template>
  239. <template v-else-if="scope.row.Status == '永续'">
  240. 永久
  241. </template>
  242. <template v-else-if="act_status == '冻结'">
  243. {{scope.row.FreezeStartDate}}~{{scope.row.FreezeEndDate}}
  244. </template>
  245. <template v-else>
  246. {{scope.row.StartDate}}~{{scope.row.EndDate}}
  247. </template>
  248. </template>
  249. <!-- 公用客户的时间显示 -->
  250. <template v-else>
  251. {{scope.row.StartDate.substr(0,10)}}~{{scope.row.EndDate.substr(0,10)}}/{{scope.row.StartDate.substr(11)}}~{{scope.row.EndDate.substr(11)}}
  252. </template>
  253. </span>
  254. </template>
  255. </el-table-column>
  256. <el-table-column prop="expireDay" :label="act_status=='冻结'?'解冻':'到期'" align="center"
  257. min-width="5.14%" sortable="custom">
  258. <template slot-scope="scope">
  259. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  260. <template v-if="act_status=='冻结'">
  261. {{scope.row.FreezeExpireDays||'--'}}
  262. </template>
  263. <template v-else>
  264. {{scope.row.ExpireDay||'--'}}
  265. </template>
  266. </span>
  267. </template>
  268. </el-table-column>
  269. <el-table-column prop="createTime"
  270. :label="act_status=='冻结'?'冻结时间':act_status=='正式'?'转正时间':act_status=='流失'?'流失时间':'创建时间'"
  271. sortable="custom" align="center" min-width="6.14%">
  272. <template slot-scope="scope">
  273. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  274. <template v-if="act_status=='冻结'">
  275. {{$moment(scope.row.FreezeTime).format('YYYY.MM.DD')}}
  276. </template>
  277. <template v-else-if="act_status=='正式'">
  278. {{$moment(scope.row.FormalTime).format('YYYY.MM.DD')}}
  279. </template>
  280. <template v-else-if="act_status=='流失'">
  281. <!-- {{scope.row.LossTime?$moment(scope.row.LossTime.replaceAll('.','-')).format('YYYY.MM.DD'):''}} -->
  282. {{scope.row.LossTime
  283. ?(`${scope.row.LossTime.split('/')[0].substr(0,10)}`)
  284. :''}}
  285. {{scope.row.LossTime&&scope.row.IsShared&&scope.row.LossTime.split('/')[1]
  286. ? `/${scope.row.LossTime.split('/')[1].substr(0,10)}`
  287. :''}}
  288. </template>
  289. <template v-else>
  290. {{$moment(scope.row.CreatedTime).format('YYYY.MM.DD')}}
  291. </template>
  292. </span>
  293. </template>
  294. </el-table-column>
  295. <el-table-column label="操作" align="center" min-width="7.14%">
  296. <template slot-scope="scope" v-if="!scope.row.ApproveStatus">
  297. <div class="tool" style="display: flex;flex-direction: column;">
  298. <span class="editsty" style="white-space: nowrap;"
  299. @click="itemclickHandle({type:'查看权限',data:scope.row})">
  300. 查看权限
  301. </span>
  302. </div>
  303. </template>
  304. </el-table-column>
  305. <div slot="empty" style="lineHeight:44px;margin:60px 0;color:#999;">
  306. <img src="~@/assets/img/cus_m/nodata.png" alt=""
  307. style="display:block;width:160px;height:128px;margin: auto;">
  308. <span>暂无信息</span>
  309. </div>
  310. </el-table>
  311. <div class="toolbar fixedbar">
  312. <el-pagination layout="prev,pager,next" background :current-page="page_no"
  313. @current-change="handleCurrentChange" :page-size="pageSize" @size-change="handleSizeChange"
  314. :total="total" style="float:right;">
  315. </el-pagination>
  316. </div>
  317. </div>
  318. </div>
  319. <!-- 查看权限弹窗 -->
  320. <permissionView :isLook.sync="isLook" :lookTitle="lookTitle" :lookAuthList="lookAuthList"
  321. :lookAuthListEquity="lookAuthListEquity" @closeDia="closeDia"></permissionView>
  322. <!-- 累计试用天数弹窗 -->
  323. <total-day-dialog :isTotalDayDialogShow.sync="isTotalDayDialogShow" :customInfo.sync="customInfo" />
  324. <!-- 路演业阅读的弹框 -->
  325. <accumulative-frequency-dlg :accumulativeFrequencyDlg.sync="accumulativeFrequencyDlg"
  326. :accumulativeFrequencyItem.sync="accumulativeFrequencyItem" />
  327. </div>
  328. </template>
  329. <script>
  330. import {
  331. customInterence
  332. } from '@/api/api.js'
  333. import{customAllInterence} from '@/api/modules/crmApi.js'
  334. import {
  335. locationOptions
  336. } from "./location"
  337. import TotalDayDialog from '../compontents/TotalDayDialog.vue'
  338. import AccumulativeFrequencyDlg from '../compontents/accumulativeFrequencyDlg.vue'
  339. import permissionView from './components/permissionView.vue'
  340. import mixin from './mixins/customlistMixin';
  341. export default {
  342. name: '',
  343. mixins: [mixin],
  344. components: {
  345. AccumulativeFrequencyDlg,
  346. TotalDayDialog,
  347. permissionView,
  348. },
  349. computed: {
  350. Role() {
  351. let role = localStorage.getItem('Role') || '';
  352. return role;
  353. },
  354. RoleType() {
  355. let type = localStorage.getItem('RoleType') || '';
  356. return type;
  357. },
  358. SellerAdminId() {
  359. let type = localStorage.getItem('AdminId') || '';
  360. return type;
  361. },
  362. //管理权限
  363. ManageType() {
  364. return localStorage.getItem('ManageType') || '';
  365. },
  366. RoleIdentity() {
  367. let role = localStorage.getItem('RoleIdentity') || '';
  368. return role;
  369. },
  370. /* 导出客户地址 */
  371. exportUrlDl() {
  372. let url = this.exportUrl;
  373. /* 处理品种结构 */
  374. let param_arr = [];
  375. let param_arr_red = []
  376. //已购权限
  377. if (this.variety.length) {
  378. param_arr = this.variety.map(item => {
  379. return item[1];
  380. })
  381. }
  382. //阅读权限
  383. if (this.variety_red.length) {
  384. param_arr_red = this.variety_red.map(item => {
  385. return item[1]
  386. })
  387. }
  388. let param_token = localStorage.getItem('auth') || '';
  389. let param_variety = param_arr.join(',');
  390. let param_variety_red = param_arr_red.join(',')
  391. // let param_sale = this.sales.length?this.sales.join(','):'';
  392. let param_saleArr = this.sales.length ? this.sales.map(item => {
  393. return item[item.length - 1]
  394. }) : [];
  395. let param_sale = param_saleArr.length ? param_saleArr.join(',') : ''
  396. let param_trade = this.trade ? Number(this.trade) : '';
  397. let param_package = this.setmealSelect ? Number(this.setmealSelect) : 0
  398. return `${url}?Status=${this.act_status}` +
  399. `&IsFullCompany=1`+
  400. `&CompanyType=${this.type}` +
  401. `&PackageType=${param_package}` +
  402. `&IndustryId=${param_trade}` +
  403. `&AdminId=${param_sale}` +
  404. `&Province=${this.provinceValue}` +
  405. `&City=${this.cityValue}` +
  406. `&ChartPermissionIds=${param_variety_red}` +
  407. `&ContractPermissionIds=${param_variety}` +
  408. `&StartDate=${this.start_date}` +
  409. `&EndDate=${this.end_date}` +
  410. `&CreateStartDate=${this.createdate.length ? this.createdate[0]:''}` +
  411. `&CreateEndDate=${this.createdate.length ? this.createdate[1]:''}` +
  412. `&KeyWord=${this.search_txt}&${param_token}`
  413. },
  414. /* 导出联系人地址 */
  415. exportUserDl() {
  416. let url = this.exportUser;
  417. /* 处理品种结构 */
  418. let param_arr = [];
  419. let param_arr_red = []
  420. //已购品种
  421. if (this.variety.length) {
  422. param_arr = this.variety.map(item => {
  423. return item[1];
  424. })
  425. }
  426. //阅读权限
  427. if (this.variety_red.length) {
  428. param_arr_red = this.variety_red.map(item => {
  429. return item[1]
  430. })
  431. }
  432. let param_token = localStorage.getItem('auth') || '';
  433. let param_variety = param_arr.join(',');
  434. let param_variety_red = param_arr_red.join(',')
  435. // let param_sale = this.sales.length?this.sales.join(','):'';
  436. let param_saleArr = this.sales.length ? this.sales.map(item => {
  437. return item[item.length - 1]
  438. }) : [];
  439. let param_sale = param_saleArr.length ? param_saleArr.join(',') : ''
  440. let param_trade = this.trade ? Number(this.trade) : '';
  441. let param_package = this.setmealSelect ? Number(this.setmealSelect) : 0
  442. return `${url}?Status=${this.act_status}` +
  443. `&IsFullCompany=1`+
  444. `&CompanyType=${this.type}` +
  445. `&Province=${this.provinceValue}` +
  446. `&City=${this.cityValue}` +
  447. `&PackageType=${param_package}` +
  448. `&IndustryId=${param_trade}` +
  449. `&AdminId=${param_sale}` +
  450. `&ChartPermissionIds=${param_variety_red}` +
  451. `&ContractPermissionIds=${param_variety}` +
  452. `&StartDate=${this.start_date}` +
  453. `&EndDate=${this.end_date}` +
  454. `&CreateStartDate=${this.createdate.length ? this.createdate[0]:''}` +
  455. `&CreateEndDate=${this.createdate.length ? this.createdate[1]:''}` +
  456. `&KeyWord=${this.search_txt}&${param_token}`
  457. }
  458. },
  459. data() {
  460. return {
  461. exportUrl: process.env.API_ROOT + '/custom/full/export', //导出数据
  462. exportUser: process.env.API_ROOT + '/custom/full/user/export', //导出联系人
  463. defaultprops: {
  464. multiple: true,
  465. label: 'ClassifyName',
  466. children: 'Items',
  467. value: 'ChartPermissionId'
  468. }, //块级选择器配置
  469. tabs: [],
  470. act_status: '全部', //状态
  471. type: '', //类型
  472. typeArr: [{
  473. name: 'ficc'
  474. }, {
  475. name: '权益'
  476. }], //类型
  477. setmealArr: [{
  478. name: '大套餐',
  479. id: 1
  480. }, {
  481. name: '小套餐',
  482. id: 2
  483. }],
  484. setmealSelect: '', //套餐的选择
  485. trade: '',
  486. tradeArr: [], //行业
  487. sales: '',
  488. salesArr: [], //销售
  489. defaultSalesProps: {
  490. multiple: true,
  491. label: 'RealName',
  492. children: 'ChildrenList',
  493. value: 'AdminId'
  494. }, //销售级联配置
  495. variety: [], //已购品种
  496. variety_red: [], //阅读权限
  497. varietyArr: [],
  498. date: '',
  499. start_date: '', //开始日期
  500. end_date: '', //结束日期
  501. createdate: '', //创建日期
  502. tableData: [],
  503. isShowloadding: false,
  504. search_txt: '',
  505. total: 1,
  506. page_no: 1,
  507. pageSize: 10,
  508. isLook: false, //权限弹窗
  509. lookTitle: '', //权限弹窗标题
  510. lookAuthList: [], //查看的权限
  511. lookAuthListEquity: [], //权益
  512. authList: [], //现有权限列表
  513. citiesListEquity: [], //权益//现有权限列表
  514. citiesListpitchOn: [], //权益//现有权限列表
  515. citiesEquity: [], //权益//现有权限列表
  516. sort_type: '', //自定义排序方式
  517. sort_param: '', //自定义排序方式的哪一个
  518. locationOptions,
  519. valueLocation: [],
  520. provinceValue: '',
  521. cityValue: '',
  522. locationProps: {
  523. multiple: true,
  524. value: 'name',
  525. children: 'city',
  526. label: 'name'
  527. },
  528. lookRemarkTitle: '', //查看备注标题
  529. lookRemarkList: [], //查看备注列表
  530. lookRemarkTextarea: '', //备注的文本框
  531. isRemarkLook: false, ////查看备注弹窗
  532. lookRemarkItem: {}, ////查看备注的item项
  533. accumulativeFrequencyDlg: false, //路演业阅读的弹框
  534. accumulativeFrequencyItem: {}, ////
  535. SortByTodo: false,
  536. AddCompanyBtn: false, //控制新增客户按钮是否显示
  537. };
  538. },
  539. watch: {
  540. 'type': {
  541. handler(newval) {
  542. this.getIndustry();
  543. this.getVariety();
  544. }
  545. },
  546. },
  547. methods: {
  548. handleChangeLocation() {
  549. // const arr =[]
  550. const provinceArr = []
  551. const cityArr = []
  552. this.valueLocation.forEach(item => {
  553. // arr.push(item.join(''))
  554. // 省
  555. provinceArr.push(item[0])
  556. // 市
  557. cityArr.push(item[1])
  558. })
  559. //provinceArr需要去重
  560. this.provinceValue = [...new Set(provinceArr)].join(',')
  561. this.cityValue = cityArr.join(',')
  562. this.page_no = 1;
  563. this.getTableData();
  564. },
  565. /* 获取表格 */
  566. getTableData() {
  567. this.isShowloadding = true;
  568. /* 处理品种结构 和 阅读权限 */
  569. let param_arr = [];
  570. let variety_red_arr = []
  571. if (this.variety.length) {
  572. param_arr = this.variety.map(item => {
  573. return item[1];
  574. })
  575. }
  576. if (this.variety_red.length) {
  577. variety_red_arr = this.variety_red.map(item => {
  578. return item[1];
  579. })
  580. }
  581. // 处理销售筛选
  582. let salesArr = []
  583. if (this.sales.length) {
  584. salesArr = this.sales.map(item => {
  585. return item[item.length - 1]
  586. })
  587. }
  588. let params = {
  589. SortParam: this.sort_param, //自定义排序字段
  590. SortType: this.sort_type, //排序方式
  591. PageSize: this.pageSize,
  592. CurrentIndex: this.page_no,
  593. Status: this.act_status,
  594. CompanyType: this.type,
  595. IndustryId: this.trade ? Number(this.trade) : '',
  596. AdminId: salesArr.join(','),
  597. ChartPermissionIds: variety_red_arr.join(','), //阅读权限
  598. ContractPermissionIds: param_arr.join(','), //已购权限
  599. StartDate: this.start_date,
  600. EndDate: this.end_date,
  601. CreateStartDate: this.createdate[0] ? this.createdate[0] : '',
  602. CreateEndDate: this.createdate[0] ? this.createdate[1] : '',
  603. KeyWord: this.search_txt,
  604. Province: this.provinceValue,
  605. City: this.cityValue,
  606. PackageType: this.setmealSelect ? Number(this.setmealSelect) : 0,
  607. TodoStatus: this.todoType,
  608. SortByTodo: this.SortByTodo,
  609. TryStage: this.act_trialTag
  610. }
  611. customAllInterence.customList(params).then(res => {
  612. if (res.Ret === 200) {
  613. res.Data.List && res.Data.List.forEach(item => {
  614. item.StartDate = item.StartDate.replace(/-/g, '.');
  615. item.EndDate = item.EndDate.replace(/-/g, '.');
  616. item.FreezeStartDate = item.FreezeStartDate ? item.FreezeStartDate.replace(
  617. /-/g, '.') : '';
  618. item.FreezeEndDate = item.FreezeEndDate ? item.FreezeEndDate.replace(/-/g,
  619. '.') : '';
  620. item.LossTime = item.LossTime ? item.LossTime.replace(/-/g, '.') : '';
  621. item.ApproveStatus = item.ApproveStatus == '待审批' ? '待审批' : ''
  622. })
  623. this.tabs = res.Data.StatusCount;
  624. console.log(this.tabs);
  625. this.total = res.Data.Paging.Totals;
  626. this.trialTagArr = res.Data.TryStageCount ? res.Data.TryStageCount.sort((x, y) => x
  627. .TryStage - y.TryStage) : []
  628. if (this.trialTagArr.length) {
  629. const [x, y, ...res] = this.trialTagArr;
  630. this.trialTagArr = [x, ...res, y];
  631. }
  632. this.tableData = res.Data.List || [];
  633. this.AddCompanyBtn = res.Data.AddCompanyBtn
  634. this.isShowloadding = false;
  635. }
  636. })
  637. },
  638. /* 获取品种信息 */
  639. getVariety() {
  640. customInterence.getvariety({
  641. CompanyType: this.type
  642. }).then(res => {
  643. if (res.Ret === 200) {
  644. this.varietyArr = res.Data.List;
  645. }
  646. })
  647. },
  648. /* 根据类型获取行业 */
  649. getIndustry() {
  650. customInterence.getindustry({
  651. Classify: this.type
  652. }).then(res => {
  653. if (res.Ret === 200) {
  654. this.tradeArr = res.Data.List || [];
  655. }
  656. })
  657. },
  658. /* 获取销售 */
  659. getSale() {
  660. let status = 0;
  661. if (this.act_status == '流失') {
  662. status = 1;
  663. }
  664. customInterence.getSale({
  665. "Status": status
  666. }).then(res => {
  667. if (res.Ret === 200) {
  668. this.salesArr = res.Data.List;
  669. }
  670. })
  671. },
  672. /* 前往详情页 */
  673. goDetail(item) {
  674. const {
  675. href
  676. } = this.$router.resolve({
  677. path: '/customDetail',
  678. query: {
  679. id: item.CompanyId,
  680. IsFullCompany:1
  681. }
  682. });
  683. window.open(href, '_blank');
  684. },
  685. /* 搜索客户 重置筛选条件 */
  686. searchHandle() {
  687. this.init();
  688. this.getTableData();
  689. },
  690. /* 重置 */
  691. init() {
  692. this.act_status = '全部';
  693. if (this.Role == 'admin' || this.Role == 'finance') {
  694. this.type = '';
  695. }
  696. this.trade = '';
  697. this.sales = '';
  698. this.variety = '';
  699. this.date = '';
  700. this.valueLocation = []
  701. this.provinceValue = ''
  702. this.cityValue = ''
  703. this.start_date = ''; //开始日期
  704. this.end_date = ''; //结束日期
  705. this.page_no = 1;
  706. },
  707. /* 选择类型时 */
  708. changeType() {
  709. this.trade = '';
  710. //this.variety= this.type=='ficc'?[[100,1]]:[];
  711. this.variety = []
  712. this.page_no = 1;
  713. this.getTableData()
  714. },
  715. /* 选择行业 */
  716. changeTrade() {
  717. this.page_no = 1;
  718. this.getTableData();
  719. },
  720. /* 选择销售时 */
  721. changeSales() {
  722. this.page_no = 1;
  723. this.getTableData();
  724. },
  725. /* 选择品种 */
  726. changeVariety() {
  727. this.page_no = 1;
  728. this.getTableData();
  729. },
  730. /* 选择服务日期 */
  731. dateChange(e) {
  732. if (e[0]) {
  733. this.start_date = e[0];
  734. this.end_date = e[1];
  735. } else {
  736. this.start_date = '';
  737. this.end_date = '';
  738. }
  739. this.page_no = 1;
  740. this.getTableData();
  741. },
  742. /* 选择日期 */
  743. dateChange2(e) {
  744. // console.log(e[0]);
  745. if (!e[0]) {
  746. this.createdate = []
  747. }
  748. this.page_no = 1;
  749. this.getTableData();
  750. },
  751. /* 切换状态 表格重置 */
  752. changeStatus(item, index) {
  753. this.act_status = item.Status;
  754. this.act_trialTag = 0;
  755. this.$refs.userTable.clearSort()
  756. this.sort_type = '';
  757. this.sort_param = '';
  758. this.SortByTodo = false
  759. this.page_no = 1;
  760. this.getTableData()
  761. /* this.sales=''; */
  762. //重新获取销售信息
  763. this.getSale();
  764. },
  765. /* 下拉菜单操作 */
  766. async itemclickHandle(query) {
  767. if (query.type == '查看权限') {
  768. this.lookHandle(query.data)
  769. }
  770. },
  771. /* 查看权限 */
  772. lookHandle(item) {
  773. this.lookTitle = item.CompanyName;
  774. customAllInterence.lookauth({
  775. CompanyId: item.CompanyId,
  776. }).then(res => {
  777. if (res.Ret === 200) {
  778. this.isLook = true;
  779. let auth = [];
  780. res.Data.List ? res.Data.List.forEach(item => {
  781. auth.push(item.Items)
  782. }) : ''
  783. this.lookAuthList = auth.flat(Infinity);
  784. let authEquity = [] //权益
  785. res.Data.ListRai ? res.Data.ListRai.forEach(item => { //权益
  786. // 过滤没有权限的套餐
  787. authEquity.push(item.Items.filter(it => item.CheckList.includes(it
  788. .ChartPermissionId)))
  789. }) : ''
  790. this.lookAuthListEquity = authEquity.flat(Infinity) //权益
  791. }
  792. })
  793. },
  794. /* 页码改变 */
  795. handleCurrentChange(page) {
  796. this.page_no = page;
  797. this.getTableData();
  798. },
  799. /* 关闭查看权限弹窗 */
  800. closeDia() {
  801. this.lookTitle = '';
  802. this.resetEquity()
  803. this.isLook = false;
  804. },
  805. /* 关闭弹框后重置 */
  806. resetEquity() {
  807. this.lookAuthList = [];
  808. this.lookAuthListEquity = []
  809. },
  810. /* 到期天数排序发生变化 全局排序 */
  811. sortChangeHandle(item) {
  812. if (item.column.label === 'To-Do') {
  813. this.SortByTodo = !this.SortByTodo
  814. this.sort_type = ''
  815. this.sort_param = ''
  816. } else if (item.prop === 'Status') {
  817. this.SortByTodo = false
  818. this.sort_type = 'asc'
  819. this.sort_param = this.sort_param === 'tryStage' ? '' : 'tryStage'
  820. } else if (item.prop === 'deadline') {
  821. this.SortByTodo = false
  822. this.sort_type = 'asc'
  823. this.sort_param = this.sort_param === 'deadline' ? '' : 'deadline'
  824. } else {
  825. this.SortByTodo = false
  826. this.sort_type = item.order === 'ascending' ? 'asc' : item.order === 'descending' ? 'desc' : '';
  827. this.sort_param = item.column.label == '转正时间' ? 'formalTime' : item.column.label == '冻结时间' ?
  828. 'freezeTime' : item.column.label == '流失时间' ? 'lossTime' : item.prop;
  829. }
  830. this.page_no = 1;
  831. this.getTableData();
  832. },
  833. accumulativeFrequencyClick(item) {
  834. this.accumulativeFrequencyDlg = true
  835. this.accumulativeFrequencyItem = item.row
  836. },
  837. changeSort() {
  838. this.SortByTodo = !this.SortByTodo
  839. this.page_no = 1;
  840. //自定义排序规则互斥,把其他的排序设置成默认值
  841. this.sort_type = ''
  842. this.getTableData()
  843. },
  844. },
  845. created() {
  846. /* 除admin账号 客户类型默认 */
  847. if (!(this.Role == 'admin' || this.Role == 'finance')) {
  848. this.type = this.RoleType;
  849. }
  850. this.variety = this.type == 'ficc' ? [
  851. [100, 1]
  852. ] : []
  853. },
  854. mounted() {
  855. this.getSale();
  856. this.getTableData();
  857. },
  858. }
  859. </script>
  860. <style lang='scss'>
  861. .ficc-package {
  862. display: inline-block;
  863. font-size: 12px;
  864. padding: 0 5px;
  865. border-radius: 5px;
  866. color: #3994fb;
  867. background-color: #dcecfc;
  868. }
  869. .color-red {
  870. color: red !important;
  871. }
  872. .isShared::after {
  873. content: '共享';
  874. font-size: 12px;
  875. // padding: 0px 0px 0px 2px;
  876. width: 30px;
  877. color: #3994fb;
  878. background-color: #dcecfc;
  879. position: absolute;
  880. left: 0;
  881. bottom: 0;
  882. border-top-right-radius: 5px;
  883. }
  884. .customList_container {
  885. .mx-datepicker {
  886. width: 200px !important;
  887. }
  888. .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner {
  889. background-color: #409EFF !important;
  890. border-color: #409EFF;
  891. }
  892. .el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner {
  893. background-color: #409EFF !important;
  894. border-color: #409EFF;
  895. }
  896. .customList_bot_top {
  897. display: flex;
  898. justify-content: space-between;
  899. align-items: center;
  900. margin-bottom: 28px;
  901. padding: 20px 30px;
  902. background: #fff;
  903. border: 1px solid #ECECEC;
  904. border-radius: 4px;
  905. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  906. }
  907. .customList_bot {
  908. min-height: calc(100vh - 324px);
  909. padding: 20px 30px 80px;
  910. background: #fff;
  911. position: relative;
  912. border: 1px solid #ECECEC;
  913. border-radius: 4px;
  914. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  915. .customList_top {
  916. padding: 20px 0 30px;
  917. background: #fff;
  918. .el-cascader__search-input {
  919. min-width: 30px;
  920. }
  921. }
  922. .tabs_cont {
  923. display: flex;
  924. align-items: center;
  925. color: #333;
  926. margin-bottom: 30px;
  927. &.trial-ul {
  928. padding: 0 30px;
  929. }
  930. .tab {
  931. width: 129px;
  932. height: 22px;
  933. line-height: 22px;
  934. text-align: center;
  935. font-size: 14px;
  936. border-right: 1px solid #707070;
  937. cursor: pointer;
  938. transition-delay: 0.05s;
  939. &:hover {
  940. color: #409EFF;
  941. }
  942. &.act {
  943. // padding: 9px 24px;
  944. height: 40px;
  945. line-height: 40px;
  946. background: #409EFF;
  947. border-radius: 4px;
  948. color: #fff;
  949. border-color: #409EFF;
  950. transform: scale(1.014);
  951. }
  952. &:last-child {
  953. border: none;
  954. }
  955. }
  956. .trial-item {
  957. cursor: pointer;
  958. margin-right: 30px;
  959. &:hover {
  960. color: #409EFF;
  961. }
  962. &.act {
  963. color: #409EFF;
  964. position: relative;
  965. &::after {
  966. content: "";
  967. width: 100%;
  968. height: 2px;
  969. position: absolute;
  970. bottom: -10px;
  971. left: 50%;
  972. transform: translateX(-50%);
  973. background: #409EFF;
  974. }
  975. }
  976. }
  977. }
  978. .try_style {
  979. color: #BBBBBB;
  980. }
  981. .bot_cont {
  982. //padding-bottom: 20px;
  983. .fixedbar {
  984. position: fixed;
  985. right: 45px;
  986. bottom: 20px;
  987. background-color: transparent;
  988. z-index: 2;
  989. }
  990. }
  991. }
  992. .menu_lists {
  993. padding: 40px 18px;
  994. border-radius: 4px;
  995. .menu_item {
  996. display: flex;
  997. // align-items: center;
  998. margin-bottom: 30px;
  999. &:last-child {
  1000. margin-bottom: 0;
  1001. }
  1002. .list_item {
  1003. margin-right: 20px;
  1004. margin-bottom: 10px;
  1005. &:last-child {
  1006. margin-right: 0;
  1007. }
  1008. }
  1009. }
  1010. }
  1011. .mouse-enter {
  1012. &:hover {
  1013. text-decoration: underline;
  1014. }
  1015. }
  1016. }
  1017. </style>
  1018. <style lang="scss">
  1019. .customList_container {
  1020. .el-input--mini {
  1021. .el-input__inner {
  1022. padding: 0 6px !important;
  1023. height: 24px;
  1024. line-height: 24px;
  1025. color: #409EFF;
  1026. background: #ECF5FF;
  1027. border-color: #409EFF;
  1028. text-align: center;
  1029. }
  1030. .el-input__suffix {
  1031. right: -22px;
  1032. }
  1033. &.is-disabled {
  1034. .el-input__inner {
  1035. border-color: #E4E7ED;
  1036. }
  1037. .el-input__suffix {
  1038. display: none;
  1039. }
  1040. }
  1041. }
  1042. }
  1043. </style>