customShareList.vue 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105
  1. <!-- 页面在客户列表上进行的二次修改,若后续有和客户列表相似的功能,请查看客户列表页面 -->
  2. <template>
  3. <div class="customList_container" id="customList_container" ref="cusContainer">
  4. <div class="customList_bot">
  5. <div class="customList_bot_search">
  6. <div style="margin-bottom: 8px;" v-if="!IsShareGroup">
  7. <el-select v-model="status" placeholder="请选择状态" @change="getTableData" style="width: 214px; margin-right: 20px;">
  8. <el-option :label="item.label" :value="item.value" v-for="(item,index) in statusList" :key="index" ></el-option>
  9. </el-select>
  10. <el-cascader
  11. v-model="originalSales"
  12. placeholder="请选择原销售"
  13. style="width:240px;marginRight:10px;marginBottom:8px;"
  14. :options="originalSalesArr"
  15. :props="defaultSalesProps"
  16. :show-all-levels="false"
  17. collapse-tags
  18. clearable
  19. filterable
  20. @change="getTableData"
  21. />
  22. <el-select v-model="sales" placeholder="请选择分配销售" style="width: 214px; margin-right: 20px;"
  23. clearable filterable multiple collapse-tags @change="getTableData">
  24. <el-option :label="item.RealName" :value="item.AdminId" v-for="item in salesArr" :key="item.AdminId" ></el-option>
  25. </el-select>
  26. </div>
  27. <div v-else>
  28. <el-button type="primary" @click="$router.push('/customCityList')">查看同城客户</el-button>
  29. <el-cascader
  30. v-model="originalSales"
  31. placeholder="请选择原销售"
  32. style="width:200px;marginRight:10px;marginBottom:8px;"
  33. :options="originalSalesArr"
  34. :props="defaultSalesProps"
  35. :show-all-levels="false"
  36. collapse-tags
  37. clearable
  38. filterable
  39. @change="getTableData"
  40. />
  41. </div>
  42. <el-input
  43. placeholder="客户名称/社会信用码/手机号码/邮箱"
  44. v-model="search_txt"
  45. style="max-width:531px;margin-bottom: 8px;"
  46. @input="getTableData"
  47. clearable>
  48. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  49. </el-input>
  50. </div>
  51. <div class="bot_cont">
  52. <el-table
  53. ref="userTable"
  54. :data="tableData"
  55. v-loading="isShowloadding"
  56. element-loading-text="数据加载中..."
  57. @sort-change="sortChangeHandle"
  58. border>
  59. <el-table-column
  60. prop="CompanyName"
  61. label="客户名称"
  62. align="center"
  63. min-width="7.14%"
  64. >
  65. <template slot-scope="scope">
  66. <span
  67. v-if="scope.row.IsSuspend ===1 || scope.row.Status=='潜在'"
  68. @click="goDetail(scope.row)"
  69. class="mouse-enter"
  70. :class="{'color-red':scope.row.Status.includes('正式')&&scope.row.WeekViewActive===0}"
  71. :style="scope.row.Status=='潜在'?'':'color:#bbb;cursor:pointer'">
  72. {{scope.row.CompanyName}}
  73. </span>
  74. <span v-else style="color:#409EFF;cursor:pointer;" @click="goDetail(scope.row)" class="customName"
  75. :class="{'isShared':scope.row.IsShared,'color-red':scope.row.Status.includes('正式')&&scope.row.WeekViewActive===0}"
  76. >{{scope.row.CompanyName}}</span>
  77. <img width="15" src="../../../assets/img/icons/remark.png" alt="" v-if="scope.row.RenewalReason||(scope.row.Status==='冻结'&&scope.row.FreezeReason)">
  78. </template>
  79. </el-table-column>
  80. <el-table-column
  81. prop="CompanyType"
  82. label="类型"
  83. align="center"
  84. min-width="4.14%"
  85. >
  86. <template slot-scope="{row}">
  87. <template v-if="row.CompanyType.indexOf('/')!==-1">
  88. <span :style="row.IsSuspend===1?'color:#bbb':''">{{row.CompanyType.split('/')[0]}}</span><br/>
  89. <span v-if="row.FiccPackageType" class="ficc-package">{{row.FiccPackageType == 1 ? '大套餐': '小套餐'}}</span>
  90. <br v-if="row.FiccPackageType"/>
  91. <span :style="row.IsSuspend===1?'color:#bbb':''">{{row.CompanyType.split('/')[1]}}</span>
  92. </template>
  93. <template v-else>
  94. <span :style="row.IsSuspend===1?'color:#bbb':''">{{row.CompanyType}}</span>
  95. <span v-if="row.FiccPackageType&&row.CompanyType.includes('ficc')" class="ficc-package">{{row.FiccPackageType == 1 ? '大套餐': '小套餐'}}</span>
  96. </template>
  97. </template>
  98. </el-table-column>
  99. <el-table-column
  100. prop="IndustryName"
  101. label="所属行业"
  102. min-width="6.14%"
  103. align="center">
  104. <template slot-scope="scope">
  105. <div :style="scope.row.IsSuspend===1?'color:#bbb':''">
  106. <p :style="scope.row.IsSuspend===1?'color:#bbb':''" v-for="item in scope.row.IndustryName.split('/')" :key="item">{{item}}</p>
  107. </div>
  108. </template>
  109. </el-table-column>
  110. <el-table-column
  111. prop="City"
  112. label="客户地址"
  113. min-width="6.14%"
  114. align="center">
  115. <template slot-scope="scope">
  116. <span v-if="scope.row.Province && scope.row.City" :style="scope.row.IsSuspend===1?'color:#bbb':''">{{scope.row.Province}}<br/>{{scope.row.City}}</span>
  117. <span v-else :style="scope.row.IsSuspend===1?'color:#bbb':''">{{scope.row.RegionType}}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column
  121. prop="SellerName"
  122. label="原销售"
  123. min-width="6.14%"
  124. align="center">
  125. <template slot-scope="scope">
  126. <p :style="scope.row.IsSuspend===1?'color:#bbb':''" v-for="item in scope.row.SellerName.split('/')" :key="item">{{item}}</p>
  127. </template>
  128. </el-table-column>
  129. <el-table-column
  130. prop="ShareSeller"
  131. label="分配销售"
  132. min-width="6.14%"
  133. align="center">
  134. </el-table-column>
  135. <el-table-column
  136. prop="Status"
  137. label="状态"
  138. min-width="7.14%"
  139. align="center">
  140. <template slot-scope="scope">
  141. <p :style="scope.row.IsSuspend===1?'color:#bbb;margin:3px 0':'margin:3px 0'" v-for="(item,index) in scope.row.Status.split('/')" :key="item">
  142. {{ item }}
  143. <template v-if="item === '试用' && scope.row.TryStageSlice">
  144. <el-select
  145. v-model="scope.row.TryStageSlice[index].TryStage"
  146. v-if="scope.row.Status === '试用/试用'"
  147. :disabled="!scope.row.TryStageSlice[index].HasPermission"
  148. size="mini"
  149. style="width: 50px"
  150. placeholder=""
  151. @change="changeTrialHandle(scope.row,scope.row.TryStageSlice[index])"
  152. >
  153. <el-option
  154. v-for="item in trialTags"
  155. :key="item.value"
  156. :label="item.label"
  157. :value="item.value">
  158. </el-option>
  159. </el-select>
  160. <el-select
  161. v-model="scope.row.TryStageSlice[0].TryStage"
  162. :disabled="!scope.row.TryStageSlice[0].HasPermission"
  163. v-else
  164. size="mini"
  165. style="width: 50px"
  166. placeholder=""
  167. @change="changeTrialHandle(scope.row,scope.row.TryStageSlice[0])"
  168. >
  169. <el-option
  170. v-for="item in trialTags"
  171. :key="item.value"
  172. :label="item.label"
  173. :value="item.value">
  174. </el-option>
  175. </el-select>
  176. </template>
  177. </p>
  178. </template>
  179. </el-table-column>
  180. <el-table-column
  181. label="累计试用天数"
  182. align="center"
  183. min-width="5.14%"
  184. prop="tryOutDay"
  185. sortable="custom">
  186. <template slot-scope="{row}">
  187. <el-tooltip :disabled="row.IsSuspend===1||(row.FiccTryOutDay+row.RaiTryOutDay===0)">
  188. <div slot="content">
  189. <p v-if="row.FiccTryOutDay">FICC累计试用天数:{{row.FiccTryOutDay}}</p>
  190. <p v-if="row.RaiTryOutDay">权益累计试用天数:{{row.RaiTryOutDay}}</p>
  191. </div>
  192. <span :style="row.IsSuspend===1?'color:#bbb':'color:#409EFF;cursor:pointer;'" @click="handleTotalDayClick(row)">
  193. {{row.FiccTryOutDay+row.RaiTryOutDay}}
  194. </span>
  195. </el-tooltip>
  196. </template>
  197. </el-table-column>
  198. <el-table-column
  199. label="阅读"
  200. align="center"
  201. min-width="5.14%"
  202. prop="viewTotal"
  203. sortable="custom">
  204. <template slot-scope="{row}">
  205. <el-tooltip :disabled="row.IsSuspend===1 || (row.FiccView+row.RaiView)===0">
  206. <div slot="content"><p v-if="row.FiccView">FICC报告阅读次数:{{row.FiccView}}</p><p v-if="row.RaiView">权益报告阅读次数:{{row.RaiView}}</p></div>
  207. <span :style="row.IsSuspend===1?'color:#bbb':'color:#409EFF;cursor:pointer;'">
  208. <!-- 阅读次数拆分 -->
  209. {{row.AllViewTotal}}
  210. </span>
  211. </el-tooltip>
  212. </template>
  213. </el-table-column>
  214. <el-table-column
  215. label="路演"
  216. align="center"
  217. min-width="5.14%"
  218. prop="roadShowTotal"
  219. sortable="custom">
  220. <template slot-scope="scope">
  221. <span :style="scope.row.IsSuspend===1?'color:#bbb':''" @click="accumulativeFrequencyClick(scope)" class="editsty" v-if="scope.row.RoadShowTotal > 0">{{scope.row.RoadShowTotal}}</span>
  222. <span :style="scope.row.IsSuspend===1?'color:#bbb':''" v-else>{{scope.row.RoadShowTotal}}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column
  226. label="最近阅读"
  227. min-width="8.14%"
  228. align="center"
  229. prop="viewTime"
  230. sortable="custom">
  231. <template slot-scope="scope">
  232. <p v-if="scope.row.FiccLastViewTime" :style="scope.row.IsSuspend===1?'color:#bbb':''">ficc: {{$moment(scope.row.FiccLastViewTime).format('YYYY.MM.DD')}}</p>
  233. <p v-else-if="scope.row.RaiLastViewTime" :style="scope.row.IsSuspend===1?'color:#bbb':''">权益: {{$moment(scope.row.RaiLastViewTime).format('YYYY.MM.DD')}}</p>
  234. <p v-else :style="scope.row.IsSuspend===1?'color:#bbb':''">--</p>
  235. </template>
  236. </el-table-column>
  237. <el-table-column
  238. prop="EndDate"
  239. :label="'服务期限'"
  240. align="center"
  241. min-width="6.14%">
  242. <template slot-scope="scope">
  243. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  244. <!-- 正常的时间显示 -->
  245. <template v-if="scope.row.StartDate.indexOf('/')==-1">
  246. {{scope.row.StartDate}}~{{scope.row.EndDate}}
  247. </template>
  248. <!-- 公用客户的时间显示 -->
  249. <template v-else>
  250. {{scope.row.StartDate.substr(0,10)}}~{{scope.row.EndDate.substr(0,10)}}/{{scope.row.StartDate.substr(11)}}~{{scope.row.EndDate.substr(11)}}
  251. </template>
  252. </span>
  253. </template>
  254. </el-table-column>
  255. <el-table-column
  256. prop="expireDay"
  257. :label="'到期'"
  258. align="center"
  259. min-width="5.14%"
  260. sortable="custom">
  261. <template slot-scope="scope">
  262. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  263. {{scope.row.ExpireDay||'--'}}
  264. </span>
  265. </template>
  266. </el-table-column>
  267. <el-table-column
  268. prop="createTime"
  269. :label="'创建时间'"
  270. sortable="custom"
  271. align="center" min-width="6.14%">
  272. <template slot-scope="scope">
  273. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  274. {{$moment(scope.row.CreatedTime).format('YYYY.MM.DD')}}
  275. </span>
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. prop="lastServiceTime"
  280. :label="'最新服务时间'"
  281. sortable="custom"
  282. align="center" min-width="6.14%">
  283. <template slot-scope="scope">
  284. <span :style="scope.row.IsSuspend===1?'color:#bbb':''">
  285. {{scope.row.LastServiceTime.substr(0,10).replaceAll('-','.')||'--'}}
  286. </span>
  287. </template>
  288. </el-table-column>
  289. <el-table-column
  290. prop="serviceTimes"
  291. :label="'服务次数'"
  292. sortable="custom"
  293. align="center" min-width="6.14%">
  294. <template slot-scope="scope">
  295. <span :style="scope.row.ServiceTimes>0?'color:#409eff;cursor: pointer;':''" @click="handleShowShareRecode(scope.row,'list')">
  296. {{scope.row.ServiceTimes}}
  297. </span>
  298. </template>
  299. </el-table-column>
  300. <el-table-column label="操作" align="center" min-width="7.14%">
  301. <template slot-scope="scope">
  302. <div class="tool" style="display: flex; align-items: center;justify-content: center;" v-if="scope.row.ApproveStatus!='待审批'">
  303. <!-- <span class="editsty" style="white-space: nowrap;" @click="itemclickHandle({type:'查看权限',data:scope.row})">
  304. 查看权限
  305. </span>
  306. <span @click="itemclickHandle({type:'分配销售',data:scope.row})" v-if="Role=='thisAdmin'" class="editsty"
  307. style="white-space: nowrap;">
  308. {{scope.row.ShareSellerId?'修改销售':'分配销售'}}
  309. </span>
  310. <span class="editsty" @click="itemclickHandle({type:'服务记录',data:scope.row})">
  311. 服务记录
  312. </span>
  313. <span class="editsty" @click="itemclickHandle({type:'备注',data:scope.row})">
  314. 备注
  315. </span> -->
  316. <div class="font-tool" style="display:flex;flex-direction:column;">
  317. <span class="editsty" v-for="item in getToolBtnList(scope.row).slice(0,3)" :key="item.type" @click="itemclickHandle({type:item.type,data:scope.row})">
  318. {{item.type==='分配销售'?scope.row.ShareSellerId?'修改销售':'分配销售':item.type}}
  319. </span>
  320. </div>
  321. <el-dropdown size="medium" placement="bottom-start" @command="itemclickHandle" style="height: 16px;margin-left: 5px;" v-if="getToolBtnList(scope.row).length>3">
  322. <span class="el-dropdown-link">
  323. <i class="el-icon-more el-icon--right"></i>
  324. <el-dropdown-menu slot="dropdown">
  325. <el-dropdown-item :command="{type:item.type,data:scope.row}"
  326. v-for="item in getToolBtnList(scope.row).slice(3)" :key="item.type">
  327. <span>{{item.type}}</span>
  328. </el-dropdown-item>
  329. </el-dropdown-menu>
  330. </span>
  331. </el-dropdown>
  332. </div>
  333. </template>
  334. </el-table-column>
  335. <div slot="empty" style="line-height:44px;margin:60px 0;color:#999;">
  336. <img src="~@/assets/img/cus_m/nodata.png" alt="" style="display:block;width:160px;height:128px;margin: auto;">
  337. <span>暂无信息</span>
  338. </div>
  339. </el-table>
  340. <div class="toolbar fixedbar">
  341. <el-pagination
  342. layout="prev,pager,next,total"
  343. background
  344. :current-page="page_no"
  345. @current-change="handleCurrentChange"
  346. :page-size="pageSize"
  347. :total="total"
  348. style="float:right;">
  349. </el-pagination>
  350. </div>
  351. </div>
  352. </div>
  353. <!-- 修改销售弹窗 -->
  354. <el-dialog
  355. v-dialogDrag
  356. :visible.sync="assignedSellerShow"
  357. :close-on-click-modal="false"
  358. :modal-append-to-body='false'
  359. :title="assignedSellerTitle"
  360. @close="cancelAssign"
  361. center
  362. width="444px">
  363. <el-form :model="assignform" :rules="rule" ref="assignform" label-width="110px">
  364. <el-form-item label="客户名称" prop="name">
  365. <span style="fontSize:16px;">{{assignform.CompanyName}}</span>
  366. </el-form-item>
  367. <el-form-item label="分配销售" prop="SellsId">
  368. <el-select
  369. v-model="assignform.SellsId"
  370. placeholder="请选择修改的销售"
  371. style="width: 240px"
  372. filterable>
  373. <el-option :label="item.RealName" :value="item.AdminId" v-for="item in salesArr" :key="item.AdminId"></el-option>
  374. </el-select>
  375. </el-form-item>
  376. </el-form>
  377. <div style="display:flex;justify-content:center;margin:60px 0 35px;">
  378. <el-button type="primary" style="width:80px;marginRight:24px;" @click="saveAssign">保存</el-button>
  379. <el-button style="width:80px;" @click="cancelAssign">取消</el-button>
  380. </div>
  381. </el-dialog>
  382. <!-- 查看权限弹窗 -->
  383. <permissionView :isLook.sync="isLook" :lookTitle="lookTitle" :lookAuthList="lookAuthList" :lookAuthListEquity="lookAuthListEquity"
  384. @closeDia="closeDia"></permissionView>
  385. <!-- 累计试用天数弹窗 -->
  386. <total-day-dialog
  387. :isTotalDayDialogShow.sync="isTotalDayDialogShow"
  388. :customInfo.sync="customInfo"
  389. />
  390. <!-- 路演业阅读的弹框 -->
  391. <accumulative-frequency-dlg :accumulativeFrequencyDlg.sync="accumulativeFrequencyDlg" :accumulativeFrequencyItem.sync="accumulativeFrequencyItem" />
  392. <!-- 服务记录弹窗 -->
  393. <share-list-dialog
  394. :isShareRecodeDialogShow.sync="isShareRecodeDialogShow"
  395. :customInfo="customInfo"
  396. :allowEdit="allowEdit"
  397. @close="()=>{isShareRecodeDialogShow&&getTableData();isShareRecodeDialogShow=false;}"/>
  398. <!-- 备注弹窗 -->
  399. <custom-remark-dialog
  400. :isRemarkLook="isRemarkLook"
  401. :lookRemarkItem="customInfo"
  402. @close="isRemarkLook=false"
  403. />
  404. <!-- 补全客户信息弹窗 -->
  405. <CompleteInfo
  406. :form="completeForm"
  407. @cancel="cancelCompleteInfo($event)"
  408. ></CompleteInfo>
  409. <!-- 合同 -->
  410. <el-dialog
  411. :visible.sync="contractModel.show"
  412. :modal-append-to-body='false'
  413. width="800px"
  414. class="self-dialog"
  415. v-dialogDrag
  416. >
  417. <div style="text-align:center;margin:30px 0 100px 0">
  418. <img width="191" src="../../../assets/img/cus_m/bzht.png" @click="handleContractModel('标准')" style="margin-right:80px;cursor: pointer;">
  419. <img width="191" src="../../../assets/img/cus_m/fbzht.png" @click="handleContractModel('非标准')" style="cursor: pointer;">
  420. <p style="font-size:15px;color:#333;text-align:left;padding-left:100px;margin-top:30px">
  421. 注:<br>
  422. 系统生成合同请选择标准合同入口<br>
  423. 非系统生成合同请选择非标准合同入口(包含已走完邮件流程的标准合同)</p>
  424. </div>
  425. </el-dialog>
  426. <!-- 合同信息 -->
  427. <ContractInfo
  428. :initData="contractDialog"
  429. @contractInfoDialogClose="contractInfoDialogClose"
  430. ></ContractInfo>
  431. <!-- 增开试用弹窗 -->
  432. <el-dialog
  433. :visible.sync="isAddTrial"
  434. :close-on-click-modal="false"
  435. :modal-append-to-body='false'
  436. @close="isAddTrial=false"
  437. width="800px"
  438. v-dialogDrag
  439. center>
  440. <div slot="title" style="display:flex;alignItems:center;">
  441. <span style="fontSize:16px;">增开试用(默认两个月)</span>
  442. </div>
  443. <Cauthlist
  444. :autharr="authList"
  445. :id="addTryId"
  446. @addOver="addTryOver"
  447. @close="isAddTrial=false"/>
  448. </el-dialog>
  449. </div>
  450. </template>
  451. <script>
  452. import { customInterence } from '@/api/api.js'
  453. import AccumulativeFrequencyDlg from '../compontents/accumulativeFrequencyDlg.vue'
  454. import permissionView from './components/permissionView.vue'
  455. import mixin from './mixins/customlistMixin';
  456. import TotalDayDialog from '../compontents/TotalDayDialog.vue'
  457. import ShareListDialog from './components/shareListDialog.vue';
  458. import CustomRemarkDialog from './components/customRemarkDialog.vue';
  459. import ContractInfo from '../compontents/ContractInfo.vue';
  460. import CompleteInfo from '../compontents/CompleteInfo.vue';
  461. import Cauthlist from '../compontents/CauthList.vue';
  462. export default {
  463. name:'',
  464. mixins: [ mixin ],
  465. components: {TotalDayDialog,AccumulativeFrequencyDlg,permissionView, ShareListDialog,CustomRemarkDialog,ContractInfo,CompleteInfo,Cauthlist},
  466. computed:{
  467. isPWang(){
  468. return this.adminId == 66
  469. },
  470. isYDLou(){
  471. // 不同环境下 楼颖丹账号的adminId 不一样
  472. if(process.env.NODE_ENV == 'development'||process.env.NODE_ENV == 'test'){
  473. return this.adminId == 476
  474. }else if(process.env.NODE_ENV == 'production'){
  475. return this.adminId == 15
  476. }
  477. },
  478. Role() {
  479. let role = localStorage.getItem('Role') || '';
  480. if(role=='admin' || this.isPWang || this.isYDLou){
  481. // 只有王沛、楼颖丹和所有admin账号才有分配销售的权利
  482. return 'thisAdmin';
  483. }else{
  484. return 'thisSeller';
  485. }
  486. }
  487. },
  488. data () {
  489. this.statusList = [{label:'未共享',value:3},{label:'已分配',value:1},{label:'待分配',value:2}]
  490. return {
  491. adminId:localStorage.getItem('AdminId'),
  492. sales:[],
  493. salesArr:[],//销售
  494. tableData:[],
  495. isShowloadding:false,
  496. status:'',
  497. search_txt:'',
  498. total:0,
  499. page_no:1,
  500. pageSize:10,
  501. isLook:false,//权限弹窗
  502. lookTitle:'',//权限弹窗标题
  503. lookAuthList:[],//查看的权限
  504. lookAuthListEquity:[],//权益
  505. assignedSellerShow:false,//分配销售弹窗
  506. assignedSellerTitle:'分配销售',
  507. assignform:{
  508. CompanyId:'',
  509. CompanyName:'',
  510. SellsId:''//选择的销售
  511. },
  512. rule:{
  513. SellsId:[
  514. { required: true, message: '销售不能为空', trigger: 'change' },
  515. ]
  516. },
  517. sort_type:'',//自定义排序方式
  518. sort_param:'',//自定义排序方式的哪一个
  519. btnCommandList:{
  520. BtnView: '查看权限',
  521. BtnModifySeller: '分配销售',
  522. BtnUpdate: '续约申请',
  523. BtnAddAgreement: '补充协议',
  524. BtnTryOut: '增开试用',
  525. BtnServiceRecord:'服务记录',
  526. BtnRemarkView:'备注'
  527. }, // 按钮命令列表
  528. accumulativeFrequencyDlg:false,//路演业阅读的弹框
  529. accumulativeFrequencyItem:{},
  530. isRemarkLook:false,//备注的弹框
  531. contractDialog:{
  532. show:false,
  533. type:'',//类型 续约申请、补充协议
  534. cusdata:null,//客户信息(列表用户数据)
  535. },//续约申请、补充协议 合同信息弹窗
  536. contractModel:{
  537. show:false,
  538. data:null,//客户信息(列表用户数据)
  539. type:'',//类型 续约申请、补充协议
  540. },//续约申请、补充协议 选择合同类型弹窗
  541. completeForm:{},
  542. isAddTrial:false,
  543. authList:[],
  544. originalSales:'',
  545. originalSalesArr:[],
  546. defaultSalesProps:{
  547. multiple: true,
  548. label:'RealName',
  549. children:'ChildrenList',
  550. value:'AdminId'
  551. },//销售级联配置
  552. IsShareGroup:false,//是否为咨询组销售
  553. };
  554. },
  555. methods: {
  556. /* 获取表格 */
  557. getTableData() {
  558. this.isShowloadding = true;
  559. // 处理销售筛选
  560. let salesArr=[]
  561. if(this.originalSales.length){
  562. salesArr=this.originalSales.map(item=>{
  563. return item[item.length-1]
  564. })
  565. }
  566. let params = {
  567. SortParam:this.sort_param,//自定义排序字段
  568. SortType:this.sort_type,//排序方式
  569. PageSize:this.pageSize,
  570. CurrentIndex:this.page_no,
  571. Keyword:this.search_txt,
  572. ListParam:this.status,
  573. SellerId:this.sales.join(','),
  574. OriginalSellerId:salesArr.join(','),
  575. }
  576. customInterence.getShareCustomList(params).then(res => {
  577. if(res.Ret === 200) {
  578. this.total = res.Data.Paging.Totals || 0;
  579. this.tableData = res.Data.List || [];
  580. this.isShowloadding = false;
  581. this.IsShareGroup=res.Data.IsShareGroup||false
  582. this.status=res.Data.Status||2
  583. }
  584. })
  585. },
  586. /* 获取销售 */
  587. getSale() {
  588. customInterence.salesShareList().then(res => {
  589. console.log(res);
  590. if(res.Ret === 200) {
  591. this.salesArr = res.Data|| []
  592. }
  593. })
  594. },
  595. /* 前往详情页 */
  596. goDetail(item) {
  597. const { href } = this.$router.resolve({
  598. path:'/customDetail',
  599. query:{
  600. id:item.CompanyId,
  601. }});
  602. window.open(href, '_blank');
  603. },
  604. getToolBtnList(data){
  605. let toolList = []
  606. const {BtnItem} = data
  607. for(const i in this.btnCommandList){
  608. if(BtnItem[i]){
  609. toolList.push({type:this.btnCommandList[i]})
  610. }
  611. }
  612. return toolList
  613. },
  614. /* 操作-按钮 */
  615. async itemclickHandle(query) {
  616. if(query.type == '分配销售'||query.type=='修改销售') {
  617. this.assignedSellerFun(query.data)
  618. }else if(query.type=='查看权限'){
  619. this.lookHandle(query.data)
  620. }else if(query.type=='服务记录'){
  621. this.handleShowShareRecode(query.data)
  622. }else if(query.type=='备注'){
  623. this.handleShowRemark(query.data)
  624. }else if(["续约申请","补充协议"].includes(query.type)){
  625. this.handleOpenContractChoose(query.type,query.data)
  626. }else if("增开试用"){
  627. this.addTrialHandle(query.data)
  628. }
  629. },
  630. /* 查看权限 */
  631. lookHandle(item) {
  632. this.lookTitle = item.CompanyName;
  633. customInterence.lookauth({
  634. CompanyId:item.CompanyId
  635. }).then(res => {
  636. if(res.Ret === 200) {
  637. this.isLook = true;
  638. let auth = [];
  639. res.Data.List ? res.Data.List.forEach(item=> {
  640. auth.push(item.Items)
  641. }):''
  642. this.lookAuthList = auth.flat(Infinity);
  643. let authEquity =[] //权益
  644. res.Data.ListRai ? res.Data.ListRai.forEach(item=> {//权益
  645. // 过滤没有权限的套餐
  646. authEquity.push(item.Items.filter(it => item.CheckList.includes(it.ChartPermissionId)))
  647. }):''
  648. this.lookAuthListEquity = authEquity.flat(Infinity) //权益
  649. }
  650. })
  651. },
  652. assignedSellerFun(row){
  653. this.assignform = {
  654. CompanyName:row.CompanyName,
  655. CompanyId:row.CompanyId,
  656. SellsId:row.ShareSellerId==0?'':row.ShareSellerId+'',
  657. }
  658. this.assignedSellerShow = true;
  659. },
  660. /* 页码改变 */
  661. handleCurrentChange(page) {
  662. this.page_no = page;
  663. this.getTableData();
  664. },
  665. /* 关闭查看权限弹窗 */
  666. closeDia() {
  667. this.lookTitle = '';
  668. this.lookAuthList = [];
  669. this.lookAuthListEquity = []
  670. this.isLook = false;
  671. },
  672. /* 分配销售 */
  673. saveAssign() {
  674. this.$refs.assignform.validate((valid) => {
  675. if (valid) {
  676. let param={
  677. CompanyId:this.assignform.CompanyId,
  678. SellsId:+this.assignform.SellsId
  679. }
  680. customInterence.assignShareSeller(param).then(res=>{
  681. if(res.Ret == 200){
  682. this.$message.success(this.assignedSellerTitle+'成功');
  683. this.getTableData();
  684. this.assignedSellerShow = false;
  685. }
  686. })
  687. }
  688. })
  689. },
  690. /* 取消移动客户 */
  691. cancelAssign() {
  692. this.assignform = {
  693. CompanyName:'',
  694. CompanyId:'',
  695. SellsId:'',
  696. }
  697. this.$refs.assignform.resetFields();
  698. this.assignedSellerShow = false;
  699. },
  700. /* 到期天数排序发生变化 全局排序 */
  701. sortChangeHandle(item) {
  702. this.sort_type = item.order === 'ascending' ? 'asc':item.order === 'descending' ? 'desc' : '';
  703. this.sort_param = item.prop;
  704. this.getTableData();
  705. },
  706. accumulativeFrequencyClick(item){
  707. this.accumulativeFrequencyDlg = true
  708. this.accumulativeFrequencyItem = item.row
  709. },
  710. handleShowRemark(item){
  711. this.customInfo = item
  712. this.isRemarkLook = true
  713. },
  714. //关闭合同信息弹窗
  715. contractInfoDialogClose(e){
  716. this.contractDialog={
  717. show:false,
  718. type:'',
  719. cusdata:null,
  720. }
  721. if(e==='updateList'){
  722. this.getTableData();
  723. }
  724. },
  725. //验证客户信息完整性
  726. async getCustomerDetail(id){
  727. let res=await customInterence.customDetail({
  728. CompanyId:id
  729. })
  730. if(res.Ret!=200) return
  731. let RoleType=localStorage.getItem('RoleType')
  732. let IndustryId='',Source=';'
  733. if(RoleType=='ficc'){
  734. IndustryId=res.Data.FiccItem.IndustryId
  735. Source=res.Data.FiccItem.Source
  736. }else if(RoleType=='权益'){
  737. IndustryId=res.Data.RaiItem.IndustryId
  738. Source=res.Data.RaiItem.Source
  739. }
  740. if((res.Data.Item.RegionType!='海外'&&!res.Data.Item.Province&&!res.Data.Item.City)||!res.Data.Item.CreditCode||!IndustryId||!Source){
  741. this.completeForm={
  742. nameDisable:res.Data.Item.CompanyName!='',
  743. CityDisable:res.Data.Item.City!='',
  744. CreditCodeDisable:res.Data.Item.CreditCode!='',
  745. IndustryIdDisable:IndustryId!=' ',
  746. SourceDisable:Source!='',
  747. CompanyId:id,
  748. name:res.Data.Item.CompanyName,
  749. Province:res.Data.Item.Province,
  750. RegionType:res.Data.Item.RegionType,
  751. City:res.Data.Item.City,
  752. CreditCode:res.Data.Item.CreditCode,
  753. IndustryId:IndustryId?IndustryId:'',
  754. Source:Source,
  755. flag:false,//是否为跨部门
  756. show:true
  757. }
  758. }else{
  759. this.completeForm.show=false
  760. }
  761. return new Promise((resolve,reject)=>{
  762. resolve(this.completeForm.show)
  763. })
  764. },
  765. //关闭补全信息弹窗
  766. cancelCompleteInfo(refresh){
  767. // 刷新列表
  768. if(refresh){
  769. this.getTableData()
  770. }
  771. this.completeForm={
  772. show:false
  773. }
  774. },
  775. //打开合同选择弹窗
  776. async handleOpenContractChoose(type,data){
  777. let flag=await this.getCustomerDetail(data.CompanyId)
  778. if(flag) return
  779. this.contractModel = {
  780. type,data,show:true
  781. }
  782. },
  783. //选择标准/非标合同
  784. handleContractModel(model){
  785. if(model==='标准'){
  786. this.contractDialog.type = this.contractModel.type
  787. this.contractDialog.cusdata = this.contractModel.data
  788. this.contractDialog.show = true
  789. }else{
  790. sessionStorage.setItem('companyInfo',JSON.stringify(this.contractModel.data))
  791. const routeMap = {
  792. '续约申请':'/updateCustom',
  793. '补充协议':'/addAgreement'
  794. }
  795. const { href } = this.$router.resolve({path:routeMap[this.contractModel.type],})||{href:''}
  796. href&&window.open(href, '_blank');
  797. }
  798. this.contractModel={
  799. type:'',data:null,show:false
  800. }
  801. },
  802. //增加试用完成
  803. addTryOver(){
  804. this.isAddTrial = false;
  805. this.getTableData();
  806. },
  807. //增开试用
  808. addTrialHandle(item) {
  809. this.authList = [];
  810. customInterence.lookauth({
  811. CompanyId:item.CompanyId,
  812. LookType:1
  813. }).then(res => {
  814. if(res.Ret === 200) {
  815. let auth = [];
  816. // res.Data.List 有值为 ficc
  817. // res.Data.ListRai 有值为 权益
  818. res.Data.List ? res.Data.List.forEach(item=> {
  819. let obj = {
  820. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  821. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  822. defaultAuth:item.CheckList,
  823. customType:'ficc',
  824. ...item,
  825. }
  826. auth.push(obj)
  827. }):
  828. // 权益 RaiMerge 0不管 1合并 2拆分 所传入的数据结构不一样
  829. res.Data.ListRai[0].RaiMerge==1?res.Data.ListRai.forEach(item=> { // 合并
  830. let obj = {
  831. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  832. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  833. defaultAuth:item.CheckList,
  834. ...item,
  835. }
  836. auth.push(obj)
  837. }): res.Data.ListRai.forEach(item=> { // 拆分
  838. let obj = {
  839. defaultAuth:item.CheckList,
  840. customType:'权益',
  841. ...item,
  842. }
  843. // 组合所需的数据格式
  844. obj.dataList=[
  845. {
  846. PermissionTypeName:'',
  847. medicine:{
  848. value:'医药',
  849. isIndeterminate:item.CheckList.filter(id => [obj.Items[0].ChartPermissionId,obj.Items[1].ChartPermissionId].includes(id)).length ==1,
  850. isCheckAll:item.CheckList.filter(id => [obj.Items[0].ChartPermissionId,obj.Items[1].ChartPermissionId].includes(id)).length == 2,
  851. isDisabled:item.CheckList.filter(id => [obj.Items[0].ChartPermissionId,obj.Items[1].ChartPermissionId].includes(id)).length ==2
  852. },
  853. consumption:{
  854. value:'消费',
  855. isIndeterminate:item.CheckList.filter(id => [obj.Items[2].ChartPermissionId,obj.Items[3].ChartPermissionId].includes(id)).length ==1,
  856. isCheckAll:item.CheckList.filter(id => [obj.Items[2].ChartPermissionId,obj.Items[3].ChartPermissionId].includes(id)).length == 2,
  857. isDisabled:item.CheckList.filter(id => [obj.Items[2].ChartPermissionId,obj.Items[3].ChartPermissionId].includes(id)).length ==2
  858. },
  859. technology:{
  860. value:'科技',
  861. isIndeterminate:item.CheckList.filter(id => [obj.Items[4].ChartPermissionId,obj.Items[5].ChartPermissionId].includes(id)).length ==1,
  862. isCheckAll:item.CheckList.filter(id => [obj.Items[4].ChartPermissionId,obj.Items[5].ChartPermissionId].includes(id)).length == 2,
  863. isDisabled:item.CheckList.filter(id => [obj.Items[4].ChartPermissionId,obj.Items[5].ChartPermissionId].includes(id)).length ==2
  864. },
  865. smart:{
  866. value:'智造',
  867. isIndeterminate:item.CheckList.filter(id => [obj.Items[6].ChartPermissionId,obj.Items[7].ChartPermissionId].includes(id)).length ==1,
  868. isCheckAll:item.CheckList.filter(id => [obj.Items[6].ChartPermissionId,obj.Items[7].ChartPermissionId].includes(id)).length == 2,
  869. isDisabled:item.CheckList.filter(id => [obj.Items[6].ChartPermissionId,obj.Items[7].ChartPermissionId].includes(id)).length ==2
  870. },
  871. strategy:{
  872. value:'策略'
  873. },
  874. experts:{
  875. value:'专家'
  876. },
  877. roadshow:{
  878. value:'路演服务'
  879. },
  880. choose:{
  881. value:'买方研选'
  882. }
  883. },
  884. {
  885. PermissionTypeName:{
  886. value:'主观',
  887. isIndeterminate:[1,2,3].includes(item.CheckList.filter(id => [obj.Items[0].ChartPermissionId,obj.Items[2].ChartPermissionId,
  888. obj.Items[4].ChartPermissionId,obj.Items[6].ChartPermissionId].includes(id)).length),
  889. isCheckAll:item.CheckList.filter(id => [obj.Items[0].ChartPermissionId,obj.Items[2].ChartPermissionId,
  890. obj.Items[4].ChartPermissionId,obj.Items[6].ChartPermissionId].includes(id)).length == 4,
  891. isDisabled:item.CheckList.filter(id => [obj.Items[0].ChartPermissionId,obj.Items[2].ChartPermissionId,
  892. obj.Items[4].ChartPermissionId,obj.Items[6].ChartPermissionId].includes(id)).length ==4
  893. },
  894. medicine:{
  895. value:obj.Items[0].ChartPermissionId,
  896. isDisabled:item.CheckList.includes(obj.Items[0].ChartPermissionId)
  897. },
  898. consumption:{
  899. value:obj.Items[2].ChartPermissionId,
  900. isDisabled:item.CheckList.includes(obj.Items[2].ChartPermissionId)
  901. },
  902. technology:{
  903. value:obj.Items[4].ChartPermissionId,
  904. isDisabled:item.CheckList.includes(obj.Items[4].ChartPermissionId)
  905. },
  906. smart:{
  907. value:obj.Items[6].ChartPermissionId,
  908. isDisabled:item.CheckList.includes(obj.Items[6].ChartPermissionId)
  909. },
  910. strategy:{
  911. value:obj.Items[8].ChartPermissionId,
  912. isDisabled:item.CheckList.includes(obj.Items[8].ChartPermissionId)
  913. },
  914. experts:{
  915. value:obj.Items[9].ChartPermissionId,
  916. isDisabled:item.CheckList.includes(obj.Items[9].ChartPermissionId)
  917. },
  918. roadshow:{
  919. value:obj.Items[10].ChartPermissionId,
  920. isDisabled:item.CheckList.includes(obj.Items[10].ChartPermissionId)
  921. },
  922. choose:{
  923. value:obj.Items[11].ChartPermissionId,
  924. isDisabled:item.CheckList.includes(obj.Items[11].ChartPermissionId)
  925. }
  926. },
  927. {
  928. PermissionTypeName:{
  929. value:'客观',
  930. isIndeterminate:[1,2,3].includes(item.CheckList.filter(id => [obj.Items[1].ChartPermissionId,obj.Items[3].ChartPermissionId,
  931. obj.Items[5].ChartPermissionId,obj.Items[7].ChartPermissionId].includes(id)).length),
  932. isCheckAll:item.CheckList.filter(id => [obj.Items[1].ChartPermissionId,obj.Items[3].ChartPermissionId,
  933. obj.Items[5].ChartPermissionId,obj.Items[7].ChartPermissionId].includes(id)).length == 4,
  934. isDisabled:item.CheckList.filter(id => [obj.Items[1].ChartPermissionId,obj.Items[3].ChartPermissionId,
  935. obj.Items[5].ChartPermissionId,obj.Items[7].ChartPermissionId].includes(id)).length ==4
  936. },
  937. medicine:{
  938. value:obj.Items[1].ChartPermissionId,
  939. isDisabled:item.CheckList.includes(obj.Items[1].ChartPermissionId)
  940. },
  941. consumption:{
  942. value:obj.Items[3].ChartPermissionId,
  943. isDisabled:item.CheckList.includes(obj.Items[3].ChartPermissionId)
  944. },
  945. technology:{
  946. value:obj.Items[5].ChartPermissionId,
  947. isDisabled:item.CheckList.includes(obj.Items[5].ChartPermissionId)
  948. },
  949. smart:{
  950. value:obj.Items[7].ChartPermissionId,
  951. isDisabled:item.CheckList.includes(obj.Items[7].ChartPermissionId)
  952. },
  953. strategy:{
  954. value:obj.Items[8].ChartPermissionId,
  955. isDisabled:item.CheckList.includes(obj.Items[8].ChartPermissionId)
  956. },
  957. experts:{
  958. value:obj.Items[9].ChartPermissionId,
  959. isDisabled:item.CheckList.includes(obj.Items[9].ChartPermissionId)
  960. },
  961. roadshow:{
  962. value:obj.Items[10].ChartPermissionId,
  963. isDisabled:item.CheckList.includes(obj.Items[10].ChartPermissionId)
  964. },
  965. choose:{
  966. value:obj.Items[11].ChartPermissionId,
  967. isDisabled:item.CheckList.includes(obj.Items[11].ChartPermissionId)
  968. }
  969. }
  970. ]
  971. auth.push(obj)
  972. })
  973. this.authList = auth;
  974. }
  975. })
  976. this.addTryId = item.CompanyId;
  977. this.isAddTrial = true;
  978. },
  979. /* 获取销售 */
  980. getoriginalSale() {
  981. let status=0;
  982. customInterence.getSale({"Status":status}).then(res => {
  983. if(res.Ret === 200) {
  984. this.originalSalesArr = res.Data.List||[];
  985. }
  986. })
  987. },
  988. },
  989. created() {
  990. this.getSale()
  991. this.getoriginalSale()
  992. this.getTableData()
  993. }
  994. }
  995. </script>
  996. <style lang='scss'>
  997. .self-dialog{
  998. .el-dialog__header{
  999. background-color: #fff !important;
  1000. .el-dialog__close.el-icon.el-icon-close{
  1001. color: #666;
  1002. }
  1003. }
  1004. }
  1005. </style>
  1006. <style lang='scss' scoped>
  1007. .ficc-package {
  1008. display: inline-block;
  1009. font-size: 12px;
  1010. padding:0 5px;
  1011. border-radius: 5px;
  1012. color: #3994fb;
  1013. background-color: #dcecfc;
  1014. }
  1015. .color-red{
  1016. color:red !important;
  1017. }
  1018. .isShared::after{
  1019. content: '共享';
  1020. font-size: 12px;
  1021. // padding: 0px 0px 0px 2px;
  1022. width: 30px;
  1023. color: #3994fb;
  1024. background-color: #dcecfc;
  1025. position: absolute;
  1026. left: 0;
  1027. bottom: 0;
  1028. border-top-right-radius: 5px;
  1029. }
  1030. .customList_container {
  1031. .customList_bot {
  1032. min-height: calc(100vh - 324px);
  1033. padding: 30px 30px 80px;
  1034. background: #fff;
  1035. position: relative;
  1036. border: 1px solid #ECECEC;
  1037. border-radius: 4px;
  1038. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  1039. .customList_bot_search{
  1040. display: flex;
  1041. align-items: center;
  1042. justify-content: space-between;
  1043. flex-wrap: wrap;
  1044. margin-bottom: 12px;
  1045. }
  1046. .bot_cont{
  1047. //padding-bottom: 20px;
  1048. .fixedbar{
  1049. position: fixed;
  1050. right: 45px;
  1051. bottom: 20px;
  1052. background-color: transparent;
  1053. z-index: 2;
  1054. }
  1055. }
  1056. }
  1057. .mouse-enter {
  1058. &:hover {
  1059. text-decoration:underline;
  1060. }
  1061. }
  1062. }
  1063. </style>
  1064. <style lang="scss">
  1065. #customList_container {
  1066. .el-input--mini {
  1067. .el-input__inner{
  1068. padding: 0 6px !important;
  1069. height: 24px;
  1070. line-height: 24px;
  1071. color: #409EFF;
  1072. background: #ECF5FF;
  1073. border-color: #409EFF;
  1074. text-align: center;
  1075. }
  1076. .el-input__suffix {
  1077. right: -22px;
  1078. }
  1079. &.is-disabled {
  1080. .el-input__inner {
  1081. border-color: #E4E7ED;
  1082. }
  1083. .el-input__suffix {
  1084. display: none;
  1085. }
  1086. }
  1087. }
  1088. }
  1089. </style>