customDetail.vue 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768
  1. <template>
  2. <div class="customDetail_box" v-if="showData">
  3. <div class="customDetail_container" style="display:flex">
  4. <div class="left_form_cont" style="flex:1;margin-right:100px">
  5. <p class="page-title">基础信息</p>
  6. <ul class="detail_item" v-if="basicform">
  7. <li style="width:40%">
  8. <label class="label">客户名称</label>
  9. <span class="con">
  10. <span style="margin-right: 10px;">{{basicform.CompanyName}} </span>
  11. <el-tooltip content="此客户存在长期且反复申请试用,但从未签约的情况,请谨慎领取" placement="top" :open-delay="500"
  12. v-if="RaiSellerRole && basicform.IsScrounge==1" >
  13. <img width="16" style="cursor: pointer;vertical-align: text-top;" src="../../../assets/img/icons/warning_triangle_yellow.png" />
  14. </el-tooltip>
  15. </span>
  16. </li>
  17. <li style="width:26%">
  18. <label class="label">所属区域</label>
  19. <span class="con">{{basicform.RegionType}}</span>
  20. </li>
  21. <li >
  22. <label class="label">客户地址</label>
  23. <span class="con">{{basicform.Province}}<span v-if="basicform.Province">/</span>{{basicform.City}}</span>
  24. </li>
  25. <li style="width:40%">
  26. <label class="label">社会信用码</label>
  27. <span class="con">{{basicform.CreditCode}}</span>
  28. </li>
  29. <li style="width:26%">
  30. <label class="label">客户类型</label>
  31. <span class="con">{{raiform&&ficcform?'FICC/权益':basicform.CreateAuth==1?'FICC':"权益"}}</span>
  32. </li>
  33. </ul>
  34. <!-- 权益类型信息 -->
  35. <template v-if="raiform">
  36. <p class="page-title">权益类型信息</p>
  37. <ul class="detail_item" style="margin-bottom:0">
  38. <li style="width:40%">
  39. <label class="label">客户状态</label>
  40. <span class="con">{{raiform.Status}}</span>
  41. </li>
  42. <li style="width:26%">
  43. <label class="label">所属销售</label>
  44. <span class="con">{{raiform.SellerName}}</span>
  45. </li>
  46. <li>
  47. <label class="label">所属行业</label>
  48. <span class="con">{{raiform.IndustryName}}</span>
  49. </li>
  50. <li style="width:40%">
  51. <label class="label">客户来源</label>
  52. <span class="con">{{raiform.Source}}</span>
  53. </li>
  54. <!-- <li style="width:50%">
  55. <label class="label">备注</label>
  56. <span class="con">{{raiform.Reasons}}</span>
  57. </li> -->
  58. <li style="width:23%">
  59. <label class="label">管理规模</label>
  60. <span class="con">{{raiform.Scale ==1?'50亿以下':raiform.Scale ==2?'50~100亿':raiform.Scale ==3?'100亿以上':''}}</span>
  61. </li>
  62. <li v-if="raiform.SpecialSurplus">
  63. <label class="label-num" >专项调研剩余次数</label>
  64. <span class="con">{{raiform.SpecialSurplus}} <span class="editsty" @click="clickDlgNumberHandler('专项调研')">明细>></span></span>
  65. </li>
  66. <li v-if="RoleType==='admin'" style="width:100%">
  67. <label class="label"
  68. >客户编码</label>
  69. <span class="con" style="word-break: break-word;">{{raiform.OpenCode}}</span>
  70. </li>
  71. <li style="width:100%" v-if="raiform.Points">
  72. <label class="label-num">研选服务点数</label>
  73. <span class="con" style="word-break: break-word;">{{raiform.Points}}</span>
  74. <span v-if="raiform.Points" @click="clickDlgNumberHandler('研选服务')" class="con" style="word-break: break-word;color:#409EFF;padding-left:10px;cursor: pointer;">明细>></span>
  75. </li>
  76. </ul>
  77. <el-collapse v-model="raiCollapseOpen" accordion>
  78. <el-collapse-item name="1">
  79. <template slot="title">
  80. <p style="display:inline-block;font-size:15px;padding-left:23px">
  81. <span style="font-weight:bold">权限设置</span>
  82. <span style="color:#1989FA;display:inline-block;margin-left:10px">{{raiCollapseOpen=='1'?'收起':'展开'}}</span>
  83. </p>
  84. </template>
  85. <!-- <CpessionTable fromType="detail" :authList="raiform.authList"/> -->
  86. <CpessionTableEquity fromType="detail" :authList="raiform.authList"/>
  87. </el-collapse-item>
  88. </el-collapse>
  89. </template>
  90. <!-- FICC类型信息 -->
  91. <template v-if="ficcform">
  92. <p class="page-title">FICC类型信息</p>
  93. <ul class="detail_item" style="margin-bottom:0">
  94. <li style="width:40%">
  95. <label class="label">客户状态</label>
  96. <span class="con">{{ficcform.Status}}</span>
  97. </li>
  98. <li style="width:26%">
  99. <label class="label">所属销售</label>
  100. <span class="con">{{ficcform.SellerName}}</span>
  101. </li>
  102. <li>
  103. <label class="label">所属行业</label>
  104. <span class="con">{{ficcform.IndustryName}}</span>
  105. </li>
  106. <li style="width:40%">
  107. <label class="label">客户来源</label>
  108. <span class="con">{{ficcform.Source}}</span>
  109. </li>
  110. <!-- <li style="width:50%">
  111. <label class="label">备注</label>
  112. <span class="con">{{ficcform.Reasons}}</span>
  113. </li> -->
  114. <li v-if="RoleType==='admin'">
  115. <label class="label">客户编码</label>
  116. <span class="con" style="word-break: break-word;">{{ficcform.OpenCode}}</span>
  117. </li>
  118. </ul>
  119. <el-collapse v-model="ficcCollapseOpen" accordion>
  120. <el-collapse-item name="1">
  121. <template slot="title">
  122. <p style="display:inline-block;font-size:15px;padding-left:23px">
  123. <span style="font-weight:bold">权限设置</span>
  124. <span style="color:#1989FA;display:inline-block;margin-left:10px">{{ficcCollapseOpen=='1'?'收起':'展开'}}</span>
  125. </p>
  126. </template>
  127. <CpessionTable fromType="detail" :authList="ficcform.authList"/>
  128. </el-collapse-item>
  129. </el-collapse>
  130. </template>
  131. </div>
  132. <div style="flex-shrink: 0;">
  133. <div style="display:flex;justify-content:flex-end;align-items: center;gap:0 20px;margin:0 0 30px;">
  134. <span style="color:#409EFF;cursor:pointer;font-size: 14px;margin-right: 20px;" v-if="isBtnShow.BtnHistoryList&&dealList.length" @click="previewHistory">历史签约</span>
  135. <el-button type="primary" style="width:100px;" @click="editHandle" v-if="isBtnShow.BtnEdit">编辑</el-button>
  136. <el-button type="danger" plain style="width:100px;" @click="delHandle" v-if="isBtnShow.BtnDelete">删除</el-button>
  137. </div>
  138. <Ctimeline :id="companyId"></Ctimeline>
  139. </div>
  140. </div>
  141. <!-- 联系人 -->
  142. <div class="customDetail_container" style="marginTop:20px;padding:30px 40px 80px 60px;">
  143. <div class="customList_bot_top">
  144. <div >
  145. <div v-if="isContractButtonShow">
  146. <input type="file" size="small" name="file" @change="fileSelected()" id="fileImport" class="true-file" style="display:none;">
  147. <el-button type="primary" @click="addConcat">添加联系人</el-button>
  148. <el-button type="primary" @click.native="importHandle">批量导入</el-button>
  149. <!-- <span style="fontSize:16px;color:#AAB4CC;">(请至少添加一位联系人)</span> -->
  150. <!-- <el-button v-if="RoleType=='admin' || RoleType=='权益'" style="margin-left:20px" type="primary" @click="exportDataIsShow=true">导出数据</el-button> -->
  151. <a :href="downTemplate" download style="fontSize:14px;color:#409eff;margin-left:30px">下载导入模板</a>
  152. </div>
  153. </div>
  154. <div style="display: flex">
  155. <el-select
  156. v-model="IsSubscribe"
  157. placeholder="是否关注公众号"
  158. multiple
  159. clearable
  160. style="margin-right: 10px;width: 300px;"
  161. @change="changeSubscribe"
  162. >
  163. <el-option
  164. label="已关注弘则研究"
  165. value="1"
  166. :disabled="IsSubscribe.includes('2')"
  167. />
  168. <el-option
  169. label="已关注查研观向小助手"
  170. value="3"
  171. :disabled="IsSubscribe.includes('4')"
  172. />
  173. <el-option
  174. label="未关注弘则研究"
  175. value="2"
  176. :disabled="IsSubscribe.includes('1')"
  177. />
  178. <el-option
  179. label="未关注查研观向小助手"
  180. value="4"
  181. :disabled="IsSubscribe.includes('3')"
  182. />
  183. </el-select>
  184. <el-select v-model="platform_type" style="margin-right: 10px;width: 250px;" @change="changeSubProductHandle">
  185. <el-option
  186. v-for="item in platformOption"
  187. :key="item.key"
  188. :label="item.ProductName"
  189. :value="item.key"
  190. >
  191. {{ item.ProductName }}
  192. </el-option>
  193. </el-select>
  194. <el-input
  195. placeholder="姓名/手机号码/邮箱"
  196. v-model="search_txt"
  197. style="maxWidth:400px"
  198. @input="searchUser"
  199. clearable>
  200. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  201. </el-input>
  202. </div>
  203. </div>
  204. <div class="bot_cont">
  205. <el-table
  206. ref="userTable"
  207. :data="userTable"
  208. v-loading="isShowloadding"
  209. :row-class-name="setRowClass"
  210. element-loading-text="数据加载中..."
  211. border>
  212. <el-table-column
  213. prop="RealName"
  214. label="姓名"
  215. align="center"
  216. min-width="80px"
  217. >
  218. <template slot-scope="scope"
  219. :class="{'isShared':scope.row.IsShared}"
  220. >
  221. <img :src="$icons.card" alt="" style="width:17px;cursor:pointer;marginRight:5px;"
  222. v-if="scope.row.BusinessCardUrl"
  223. @click="reviewCard(scope.row.BusinessCardUrl)">
  224. <img src="~@/assets/img/icons/like-heart.png" class="name-follow-heart" v-if="scope.row.IsFollow==1">
  225. <span :class="{'isShared':scope.row.IsShared}">{{scope.row.RealName}}</span>
  226. </template>
  227. </el-table-column>
  228. <el-table-column
  229. prop="Mobile"
  230. label="手机号"
  231. align="center"
  232. min-width="100">
  233. <template slot-scope="scope"><span v-if="scope.row.Mobile&&scope.row.CountryCode">{{scope.row.CountryCode}}-</span><span>{{scope.row.Mobile+(scope.row.MobileTwo?'/'+scope.row.MobileTwo:'')}}</span> </template>
  234. </el-table-column>
  235. <el-table-column
  236. prop="Email"
  237. label="邮箱"
  238. min-width="120"
  239. align="center">
  240. <template slot-scope="scope"> <span>{{scope.row.Email}}</span> </template>
  241. </el-table-column>
  242. <el-table-column
  243. prop="IsMaker"
  244. label="是否KP"
  245. align="center">
  246. <template slot-scope="scope"> <span>{{scope.row.IsMaker==1?'是':'否'}}</span> </template>
  247. </el-table-column>
  248. <el-table-column
  249. prop="IsRegister"
  250. label="是否注册"
  251. align="center">
  252. <template slot-scope="scope"> <span>{{scope.row.IsRegister?'已注册':'未注册'}}</span> </template>
  253. </el-table-column>
  254. <el-table-column
  255. prop="CreatedTime"
  256. label="注册时间"
  257. min-width="150"
  258. align="center">
  259. <template slot-scope="scope"> <span>{{scope.row.RegisterTime|formatTime}}</span> </template>
  260. </el-table-column>
  261. <el-table-column
  262. prop="IsSubscribeHzyj"
  263. label="是否关注公众号"
  264. min-width="90"
  265. align="center">
  266. <template slot-scope="scope">
  267. <div style="text-align:left">
  268. <img v-if="scope.row.IsSubscribeHzyj==1" style="width:16px;height:16px" src="~@/assets/img/icons/icon_1.png" alt="">
  269. <img v-else style="width:16px;height:16px" src="~@/assets/img/icons/icon_2.png" alt="">
  270. <span>弘则研究</span>
  271. </div>
  272. <div style="text-align:left">
  273. <img v-if="scope.row.IsSubscribeCygx==1" style="width:16px;height:16px" src="~@/assets/img/icons/icon_1.png" alt="">
  274. <img v-else style="width:16px;height:16px" src="~@/assets/img/icons/icon_2.png" alt="">
  275. <span>查研观向小助手</span>
  276. </div>
  277. </template>
  278. </el-table-column>
  279. <el-table-column
  280. prop="ViewTotal"
  281. label="累计阅读次数"
  282. align="center">
  283. <template slot-scope="scope"> <span>{{scope.row.ViewTotal||'暂无'}}</span> </template>
  284. </el-table-column>
  285. <el-table-column
  286. prop="LastViewTimeStr"
  287. label="最近一次阅读时间"
  288. min-width="150"
  289. align="center">
  290. <template slot-scope="scope"> <span>{{scope.row.ViewTotal?scope.row.LastViewTimeStr:''|formatTime}}</span> </template>
  291. </el-table-column>
  292. <el-table-column
  293. label="研报统计"
  294. align="center">
  295. <template slot-scope="scope"> <span v-if="scope.row.ViewTotal!=0" class="editsty" @click="lookReport(scope.row)" :disabled="!isContractButtonShow" >点击查看</span></template>
  296. </el-table-column>
  297. <el-table-column
  298. v-if="ficcform"
  299. prop="YbProductViewTotal"
  300. label="其他统计"
  301. min-width="110"
  302. align="center">
  303. <template slot-scope="scope"> <span :class="scope.row.YbProductViewTotal?'editsty':''" @click="lookReadInfo(scope.row)">{{scope.row.YbProductViewTotal||'0'}}</span> </template>
  304. </el-table-column>
  305. <el-table-column label="操作" align="center" min-width="150">
  306. <template slot-scope="scope" v-if="isContractButtonShow">
  307. <div class="contact-opt-box" style="color:#4099ef; font-size:14px;">
  308. <span class="editsty" @click="editContact(scope.row)">编辑</span>
  309. <span class="editsty move" style="margin:0 5px;" @click="handleShowMove(scope.row)">移动</span>
  310. <span style="margin-right:5px;" :class="scope.row.IsFollow==1?'deletesty':'editsty'"
  311. @click="followContact(scope.row)"
  312. >{{ scope.row.IsFollow==1?'取消关注':'关注' }}</span>
  313. <span class="deletesty" @click.stop="delConcat(scope.row)">删除</span>
  314. <!-- <block v-if="RoleType!='权益'&&ficcform&&['正式','试用','永续'].includes(ficcform.Status)">
  315. <span
  316. class="chart"
  317. @click.stop="handleShowChartAuth(scope.row)"
  318. v-if="scope.row.IsChartPermissionSetting==0"
  319. style="color:#4099ef"
  320. >图表权限</span>
  321. <span
  322. class="chart"
  323. @click.stop="handleShowChartAuth(scope.row)"
  324. v-if="scope.row.IsChartPermissionSetting==1"
  325. style="color:#13ce66"
  326. >图表权限</span>
  327. <span
  328. class="chart"
  329. v-if="scope.row.IsChartPermissionSetting==2"
  330. style="color:#bbb"
  331. >图表权限</span>
  332. </block> -->
  333. </div>
  334. </template>
  335. </el-table-column>
  336. <div slot="empty" style="lineHeight:40px;margin:30px 0;color:#999;">
  337. <img src="~@/assets/img/cus_m/nodata.png" alt="" style="display:block;width:160px;height:128px;margin: auto;">
  338. <span>暂无联系人</span>
  339. </div>
  340. </el-table>
  341. <el-col :span="24" class="toolbar">
  342. <el-pagination
  343. layout="total,prev,pager,next,jumper"
  344. background
  345. :current-page="page_no"
  346. @current-change="handleCurrentChange"
  347. page-size="10"
  348. :total="total"
  349. style="float:right;">
  350. </el-pagination>
  351. </el-col>
  352. </div>
  353. </div>
  354. <!-- 添加联系人弹窗 -->
  355. <Contactdia
  356. :userId="userId"
  357. :name="defaultName"
  358. :id="companyId"
  359. :title="diatit"
  360. :userForm="diaform"
  361. :custom_name="diaform.companyName"
  362. :isAddContact="isAddContact"
  363. :regionType="regionType"
  364. :isEditUser="true"
  365. @cancel="canceldialog"
  366. >
  367. </Contactdia>
  368. <!-- 阅读报告弹窗 -->
  369. <Readia
  370. :readId="readId"
  371. :lookRead="isRead"
  372. :title="readTit"
  373. @cancelRead="cancelRead">
  374. </Readia>
  375. <!-- 图片预览 -->
  376. <el-image-viewer
  377. v-if="showViewer"
  378. :on-close="closeViewer"
  379. :url-list="[imgView]" />
  380. <!-- 历史签约弹窗 旧版-->
  381. <!-- <el-dialog
  382. :visible.sync="isPreview"
  383. :modal-append-to-body='false'
  384. :show-close="false"
  385. custom-class="customDetail_contract_dialog"
  386. center
  387. top="7vh"
  388. v-dialogDrag
  389. width="60%">
  390. <div slot="title" style="display:flex;alignItems:center;">
  391. <span style="fontSize:16px;color:#333;fontWeight:bold;">历史签约</span>
  392. </div>
  393. <template v-if="dealList.length">
  394. <div v-for="(item,index) in dealList" :key="index" class="history_item">
  395. <el-tag style="margin-bottom:30px;margin-right:10px" size="small">合同编号:{{item.ContractCode}}</el-tag>
  396. <div style="display:inline-block">
  397. <span style="margin-right:5px;border:1px solid #409eff;padding:4px 8px;font-size:12px;color:#409eff;background:#ecf5ff;border-radius:4px">
  398. {{item.ContractType}}
  399. </span>
  400. <el-tooltip
  401. class="item"
  402. effect="dark"
  403. v-if="item.ContractType!='补充协议'"
  404. placement="top-start">
  405. <div slot="content" v-if="item.ContractType=='新签合同'">没有正式转试用记录的客户,在申请转正时提交的合同</div>
  406. <div slot="content" v-if="item.ContractType=='续约合同'">
  407. 1、有正式转试用记录的客户,在申请转正时提交的合同<br>
  408. 2、所有客户在续约申请时提交的合同
  409. </div>
  410. <i class="el-icon-info"></i>
  411. </el-tooltip>
  412. </div>
  413. <ul class="detail_item">
  414. <li>
  415. <span style="min-width:300px;marginRight:200px;display:inline-block;">合同期限:{{item.StartDate+'~'+item.EndDate}}</span>
  416. <span>合同金额:{{item.Money}}元</span>
  417. </li>
  418. <li>
  419. <span style="min-width:300px;marginRight:200px;display:inline-block;">付款方式:{{item.PayMethod}}</span>
  420. <span>付款渠道:{{item.PayChannel}}</span>
  421. </li>
  422. <li>
  423. <span style="min-width:300px;marginRight:200px;display:inline-block;">审批时间:{{item.ModifyTimeStr|formatTime}}</span>
  424. </li>
  425. <li class="textarea_item" style="width:97%;">
  426. <label style="display:block;marginBottom:20px;fontSize:16px;position:relative;">
  427. 权限设置
  428. </label>
  429. <ul class="menu_lists">
  430. <li v-for="auth in item.PermissionList" :key="auth.ClassifyName" class="menu_item">
  431. <el-checkbox :indeterminate="auth.CheckList.length>0&&auth.CheckList.length<auth.Items.length" v-model="auth.CheckAll" disabled @change="handleCheckAll(item)" style="marginRight:30px;fontWeight:bold;">{{auth.ClassifyName+':'}}</el-checkbox>
  432. <el-checkbox-group v-model="auth.CheckList" @change="handleChecked(item)" disabled>
  433. <el-checkbox v-for="list in auth.Items" :label="list.ChartPermissionId" :key="list.ChartPermissionId" class="list_item">{{list.PermissionName}}</el-checkbox>
  434. </el-checkbox-group>
  435. </li>
  436. </ul>
  437. </li>
  438. <li class="textarea_item" style="width:97%;display:flex" v-if="item.ImgUrl!=''">
  439. <label style="marginRight:17px;fontSize:16px;position:relative;width:112px;">
  440. 查看合同附件
  441. </label>
  442. <ul class="img_cont">
  443. <li v-for="img in item.constractFiles" :key="img" class="img_item" style="display:inline-block;margin-right:10px">
  444. <el-image :src="require('@/assets/img/constract/word-icon.png')" style="width:240px;height:180px;" v-if="img.type=='word'" @click.native="preViewConstractFile(img)"></el-image>
  445. <pdf ref="pdf" :src="img.url" style="width:240px;height:180px;overflow:hidden" v-else-if="img.type=='pdf'" @click.native="preViewConstractFile(img)"></pdf>
  446. <el-image :src="img.url" :preview-src-list="constractFileImgList" alt="" style="background:#aaa;width:240px;height:180px;" v-else @click.native="preViewConstractFile(item.constractFiles)"/>
  447. <i class="el-icon-zoom-in" style="position:absolute;right:12px;top:12px;color:#fff;" @click="preViewConstractFile(img)"></i>
  448. </li>
  449. </ul>
  450. </li>
  451. </ul>
  452. </div>
  453. </template>
  454. <span v-else>暂无历史合同</span>
  455. </el-dialog> -->
  456. <!-- 导入的联系人表格 -->
  457. <el-dialog
  458. title="批量导入"
  459. :visible.sync="isShowImportDia"
  460. :close-on-click-modal="false"
  461. :modal-append-to-body='false'
  462. @close="cancelImport"
  463. center
  464. width="1000px">
  465. <template v-if="!isImportRepeat">
  466. <div style="fontSize:15px;color:#606266;marginBottom:20px;">请确认导入信息(已过滤信息不全的联系人):</div>
  467. <el-table :data="importData" border max-height="350">
  468. <el-table-column align="center" label="姓名">
  469. <template slot-scope="scope">{{scope.row.RealName}}</template>
  470. </el-table-column>
  471. <el-table-column align="center" label="性别">
  472. <template slot-scope="scope">{{scope.row.Sex==1?'男':scope.row.Sex==2?'女':''}}</template>
  473. </el-table-column>
  474. <el-table-column align="center" label="手机号">
  475. <template slot-scope="scope">{{scope.row.CountryCode+'-'+scope.row.Mobile||''}}</template>
  476. </el-table-column>
  477. <!-- <el-table-column align="center" label="手机号2">
  478. <template slot-scope="scope">{{scope.row.MobileTwo||''}}</template>
  479. </el-table-column> -->
  480. <el-table-column align="center" label="邮箱">
  481. <template slot-scope="scope">{{scope.row.Email||''}}</template>
  482. </el-table-column>
  483. <el-table-column align="center" label="是否KP">
  484. <template slot-scope="scope">{{scope.row.IsMaker==1?'是':'否'}}</template>
  485. </el-table-column>
  486. <el-table-column align="center" label="职位">
  487. <template slot-scope="scope">{{scope.row.Position||''}}</template>
  488. </el-table-column>
  489. <el-table-column align="center" label="部门">
  490. <template slot-scope="scope">{{scope.row.DepartmentName||''}}</template>
  491. </el-table-column>
  492. </el-table>
  493. </template>
  494. <!-- 重复联系人 -->
  495. <template v-else>
  496. <div style="font-size:16px;color:#606266;margin-bottom:10px">导入完成。</div>
  497. <div style="fontSize:16px;color:#606266;marginBottom:20px;">请单独处理以下系统中已存在的联系人:</div>
  498. <el-table :data="repeatData" border max-height="300">
  499. <el-table-column align="center" label="联系人">
  500. <template slot-scope="scope">{{scope.row.RealName}}</template>
  501. </el-table-column>
  502. <el-table-column align="center" label="手机号/邮箱" width="300">
  503. <template slot-scope="scope">
  504. {{scope.row.Mobile}}
  505. {{(scope.row.Mobile&&scope.row.Email)?'/':''}}
  506. {{scope.row.Email}}
  507. </template>
  508. </el-table-column>
  509. <el-table-column align="center" label="销售">
  510. <template slot-scope="scope">{{scope.row.SellerRealName}}</template>
  511. </el-table-column>
  512. <el-table-column align="center" label="关联客户" min-width="150">
  513. <template slot-scope="scope">{{scope.row.CompanyName}}</template>
  514. </el-table-column>
  515. <el-table-column align="center" label="操作">
  516. <template slot-scope="scope">
  517. <el-button type="text" size="small" @click="handleMoveToCurrentCustom(scope.row,scope.$index)" v-if="scope.row.HasMove">移至当前客户</el-button>
  518. </template>
  519. </el-table-column>
  520. </el-table>
  521. <p style="padding:20px 0;font-size:16px;">无法移至当前客户的联系人,请联系对应销售处理。</p>
  522. </template>
  523. <div style="display:flex;justify-content:center;margin:30px 0">
  524. <template v-if="!isImportRepeat">
  525. <el-button type="primary" style="marginRight:24px;" @click="ensureImport">确定</el-button>
  526. <el-button type="primary" plain style="width:80px;" @click="cancelImport">取消</el-button>
  527. </template>
  528. <el-button type="primary" style="width:100px;" v-else @click="cancelImport(1)">知道了</el-button>
  529. </div>
  530. </el-dialog>
  531. <!-- 移动联系人弹窗 -->
  532. <el-dialog
  533. title="提示"
  534. :visible.sync="isMove"
  535. :close-on-click-modal="false"
  536. :modal-append-to-body="false"
  537. @close="cancelMove"
  538. center
  539. top="25vh"
  540. width="500px">
  541. <div slot="title" style="display: flex; align-items: center; position: relative">
  542. <img
  543. src="../../../assets/img/icons/move.png"
  544. style="color: #fff; width: 16px; height: 16px; margin-right: 5px"/>
  545. <span style="font-size: 16px">移动联系人</span>
  546. <i
  547. class="el-icon-close"
  548. style="
  549. font-size: 24px;
  550. cursor: pointer;
  551. position: absolute;
  552. right: 20px;
  553. top: 50%;
  554. transform: translateY(-50%);
  555. "
  556. @click="cancelMove"
  557. ></i>
  558. </div>
  559. <el-form
  560. @submit.native.prevent
  561. :model="moveForm"
  562. ref="moveFormvalidate"
  563. inline
  564. :rules="moveRule"
  565. label-width="80px"
  566. class="demo-ruleForm"
  567. style="margin-top: 15px">
  568. <el-form-item
  569. label="移动到"
  570. prop="companyId"
  571. style="width: 100%">
  572. <el-select
  573. v-model="moveForm.companyId"
  574. filterable
  575. remote
  576. :remote-method="getCompany"
  577. @focus="focusGetCompany"
  578. @change="getCompanySeller"
  579. placeholder="请选择公司"
  580. style="width: 280px">
  581. <el-option
  582. v-for="item in typeArr"
  583. :key="item.CompanyId"
  584. :label="item.CompanyName"
  585. :value="item.CompanyId">
  586. </el-option>
  587. </el-select>
  588. </el-form-item>
  589. <el-form-item
  590. label="所属销售"
  591. prop="belongUser"
  592. style="width: 100%"
  593. v-if="!hideBelongUser">
  594. <el-select
  595. v-model="moveForm.belongUser"
  596. placeholder="请选择对应销售"
  597. style="width: 280px">
  598. <el-option
  599. v-for="item in belongList"
  600. :key="item.AdminId"
  601. :label="item.RealName"
  602. :value="item.AdminId">
  603. </el-option>
  604. </el-select>
  605. </el-form-item>
  606. <div v-if="isMoveShowTips&&ficcform&&['正式','试用','永续'].includes(ficcform.Status)" style="text-align:center;color:#999">提示:移动联系人会关闭该联系人的图表权限</div>
  607. <div style="display: flex; justify-content: center; margin: 30px 0 55px">
  608. <el-button type="primary" @click="submitMove">保存</el-button>
  609. <el-button @click="cancelMove">取消</el-button>
  610. </div>
  611. </el-form>
  612. </el-dialog>
  613. <!-- 设置图库权限弹窗 -->
  614. <chartAuthDialog
  615. :chartAuthClassifyList="chartAuthClassifyList"
  616. :chartAuthUserInfo="chartAuthUserInfo"
  617. :showChartAuthPop="showChartAuthPop"
  618. @chartAuthClose="showChartAuthPop=false"
  619. @chartAuthSave="chartAuthSave"
  620. ></chartAuthDialog>
  621. <export-data :exportDataIsShow.sync="exportDataIsShow" :companyId="companyId"/>
  622. <!-- 分产品阅读统计弹窗 -->
  623. <product-read-info
  624. :productReadInfoShow="productReadInfoShow"
  625. :productReadId="productReadId"
  626. :subProductId="platform_type"
  627. :subProductName="subProductName"
  628. :clickToal="clickToal"
  629. :productReadTitle="productReadTitle"
  630. @close="productReadInfoShow=false"
  631. ></product-read-info>
  632. <!-- 研选服务点数明细 弹框 -->
  633. <DeductDetailDlg :isShowResearchNumber.sync="isShowResearchNumber" :isShowDlgType.sync="isShowDlgType" :dataForm="raiform"/>
  634. <!-- 历史签约弹窗 新版 -->
  635. <HistoryContract
  636. :isPreview="isPreview"
  637. :dealList="dealList"
  638. @close="isPreview=false"
  639. />
  640. </div>
  641. </template>
  642. <script>
  643. import Ctimeline from '../compontents/Ctimeline.vue'
  644. import Contactdia from '../compontents/Contactdialog.vue'
  645. import Readia from '../compontents/ReadDialog.vue'
  646. import ElImageViewer from 'element-ui/packages/image/src/image-viewer'
  647. import CpessionTable from '../compontents/CpessionTable.vue'
  648. import { customInterence,mychartInterface } from '@/api/api.js'
  649. import{ customAllInterence } from '@/api/modules/crmApi.js'
  650. import pdf from 'vue-pdf'
  651. import chartAuthDialog from '../compontents/chartAuthDialog.vue'
  652. import CpessionTableEquity from '../compontents/CpessionTableEquity.vue'
  653. import ExportData from '../compontents/exportData.vue'
  654. import ProductReadInfo from '../compontents/ProductReadInfo.vue'
  655. import DeductDetailDlg from './components/deductDetailDlg.vue'
  656. import HistoryContract from '../compontents/historyContract.vue'
  657. export default {
  658. name:'',
  659. components: { Ctimeline, Contactdia, Readia, ElImageViewer, CpessionTable, pdf, chartAuthDialog, ExportData, CpessionTableEquity, ProductReadInfo, DeductDetailDlg, HistoryContract },
  660. computed:{
  661. Role() {
  662. let role = localStorage.getItem('Role') || '';
  663. return role;
  664. },
  665. RoleType() {
  666. let type = localStorage.getItem('RoleType') || '';
  667. return type;
  668. },
  669. RaiSellerRole(){
  670. return ['rai_seller','rai_admin','admin'].includes(this.Role)
  671. },
  672. },
  673. beforeRouteLeave(to, from, next) {
  674. from.matched[0].name='客户管理'
  675. next()
  676. },
  677. data () {
  678. return {
  679. exportDataIsShow:false,
  680. raiCollapseOpen:'0',//1展开 0 收起
  681. ficcCollapseOpen:'0',// 1展开 0 收起
  682. basicform:'',
  683. ficcform:"",
  684. raiform:"",
  685. constractFileImgList:[],//预览合同图片列表
  686. hideBelongUser:false,
  687. isMove:false,//移动联系人弹窗
  688. isMoveShowTips:false,//移动联系人弹窗中是否提示移动联系人将重置图表权限
  689. moveForm:{
  690. companyId:'',
  691. belongUser:''
  692. },
  693. moveRule:{
  694. companyId:[{ required: true, message: "公司不能为空", trigger: "change" }],
  695. belongUser:[{ required: true, message: "所属销售不能为空", trigger: "change" }]
  696. },
  697. belongList:[],//所属销售列表
  698. typeArr: [], //公司列表
  699. showData:false,//
  700. downTemplate:process.env.API_ROOT+'/custom/template?'+localStorage.getItem('auth')||'',//下载模板
  701. activeNames:'1',//默认展开
  702. companyId:this.$route.query.id,
  703. IsFullCompany:Number(this.$route.query.IsFullCompany)||0,
  704. isBtnShow:{
  705. BtnEdit:'',
  706. BtnDelete:'',
  707. },
  708. dataForm2:null,
  709. dataForm:null,
  710. fromArr:[
  711. '无',
  712. '七禾',
  713. '万德',
  714. '潮汛课堂',
  715. '进门',
  716. '全时',
  717. '鑫乐',
  718. '沃理',
  719. ],//客户来源
  720. authList:[],//权限列表1
  721. authList2:[],
  722. search_txt:'',
  723. userTable:[],//联系人表格
  724. total:1,
  725. page_no:1,
  726. isAddContact:false,//联系人弹窗
  727. userId:'',//联系人id
  728. diaform:{
  729. companyName:'',
  730. name:'',
  731. sex:1,
  732. telCode:'86',
  733. tel1:'',
  734. tel2:'',
  735. mail:'',
  736. post:'',
  737. desiger:'',
  738. depart:'',
  739. carte:'',
  740. mailQY:'',
  741. telQY:'',
  742. Source:'add_user',
  743. },//联系人表单
  744. defaultName:'',//默认公司名称
  745. diatit:'新增联系人',
  746. isRead:false,//阅读弹窗
  747. readTit:'研报统计',
  748. readId:'',
  749. showViewer:false,//名片预览
  750. imgView:'',
  751. dealList:[],//合同列表
  752. isPreview:false,//合同弹窗
  753. isShowImportDia:false,//导入联系人弹窗
  754. importData:[],//要导入的信息
  755. isImportRepeat:false,//导入数据出现重复
  756. repeatData:[],//重复的联系人
  757. importParams:null,
  758. productName:'',
  759. regionType:'',
  760. isContractButtonShow:true, //不是同一销售不允许操作 //true 默认可以操作
  761. companyStatus:"",// 删除联系人时根据此状态判断是否为 试用、正式、永续
  762. showChartAuthPop:false,//图表权限弹窗
  763. chartAuthClassifyList:[],
  764. chartAuthUserInfo:{},
  765. productReadInfoShow:false,//分产品阅读统计弹窗
  766. productReadId:0,//联系人ID
  767. productReadTitle:'',//分产品阅读统计弹窗的标题
  768. platform_type: 1,
  769. subProductName: '',//分产品名称
  770. clickToal:'',//点击量
  771. platformOption: [],
  772. IsSubscribe:[],//是否关注公众号
  773. isShowResearchNumber:false,// 研选服务点数明细 弹框
  774. isShowDlgType:'',
  775. };
  776. },
  777. methods: {
  778. // 显示配置联系人图库权限弹窗
  779. async handleShowChartAuth(item){
  780. const res=await mychartInterface.commonClassify()
  781. if(res.Ret==200){
  782. this.chartAuthClassifyList=res.Data&&res.Data.List||[]
  783. }
  784. const res2=await customInterence.chartPermissionInfo({UserId:item.UserId})
  785. if(res2.Ret==200){
  786. this.chartAuthUserInfo={...res2.Data,auth:res2.Data.Enabled==0?false:true}
  787. // if(item.IsChartPermissionSetting==0){
  788. // this.chartAuthUserInfo.auth=true
  789. // }
  790. }
  791. if(res.Ret==200&&res2.Ret==200){
  792. this.showChartAuthPop=true
  793. }
  794. },
  795. // 联系人图库权限配置
  796. async chartAuthSave(){
  797. let res
  798. let params={
  799. UserId: this.chartAuthUserInfo.UserId,
  800. StartTime: this.chartAuthUserInfo.StartTime,
  801. EndTime: this.chartAuthUserInfo.EndTime,
  802. Enabled: this.chartAuthUserInfo.auth?1:0
  803. }
  804. if(this.chartAuthUserInfo.ChartPermissionId==0){
  805. res=await customInterence.chartPermissionSet(params)
  806. }else{
  807. res=await customInterence.chartPermissionEdit(params)
  808. }
  809. if(res.Ret==200){
  810. this.$message.success('保存成功')
  811. this.showChartAuthPop=false
  812. this.getuserTable()
  813. }
  814. },
  815. // 导入联系人弹窗中的移动至当前客户
  816. handleMoveToCurrentCustom(e,index){
  817. let SellerId=localStorage.getItem('AdminId')
  818. let params={
  819. CompanyId: Number(this.companyId),
  820. BusinessCardUrl:e.BusinessCardUrl,
  821. DepartmentName:e.DepartmentName,
  822. Email:e.Email,
  823. IsMaker:Number(e.IsMaker),
  824. Mobile:e.Mobile,
  825. Position:e.Position,
  826. RegionType:"",
  827. RealName:e.RealName,
  828. Remark:"",
  829. SellerId:Number(SellerId),
  830. Sex:Number(e.Sex),
  831. UserId:Number(e.UserId),
  832. }
  833. console.log(params);
  834. customInterence.moveUser(params).then(res=>{
  835. if(res.Ret==200){
  836. this.$message.success("移动成功!");
  837. this.repeatData[index].HasMove=false
  838. }
  839. })
  840. },
  841. //点击预览历史签约中的合同附件
  842. preViewConstractFile(e) {
  843. console.log(e);
  844. this.constractFileImgList=[]
  845. if(e instanceof Array){
  846. e.forEach(item=>{
  847. if(item.type==='img'){
  848. this.constractFileImgList.push(item.url)
  849. }
  850. })
  851. }else{
  852. if(e.type==='pdf'){
  853. window.open(e.url);
  854. }else if(e.type==='word'){
  855. window.open('https://view.officeapps.live.com/op/view.aspx?src='+e.url,'_blank');
  856. }
  857. }
  858. },
  859. //获取公司对应的销售列表
  860. getCompanySeller(){
  861. this.moveForm.belongUser=null
  862. customInterence.companySellerList({CompanyId:Number(this.moveForm.companyId)}).then(res=>{
  863. if(res.Ret===200){
  864. if(!res.Data.List){
  865. this.hideBelongUser=true
  866. this.moveRule.belongUser[0].required=false
  867. return
  868. }
  869. if(res.Data.List.length===1){
  870. this.moveForm.belongUser=res.Data.List[0].AdminId
  871. }
  872. this.belongList=res.Data.List
  873. this.moveRule.belongUser[0].required=true
  874. this.hideBelongUser=false
  875. }
  876. })
  877. },
  878. //显示移动联系人弹窗
  879. handleShowMove(e){
  880. this.userId = e.UserId;
  881. this.isMoveShowTips=e.IsChartPermissionSetting==0?false:true
  882. this.isMove=true
  883. },
  884. //关闭移动联系人弹窗
  885. cancelMove(){
  886. this.isMove=false
  887. this.isMoveShowTips=false
  888. this.hideBelongUser=false
  889. this.moveForm.companyId=''
  890. this.moveForm.belongUser=''
  891. this.moveRule.belongUser[0].required=true
  892. this.$refs.moveFormvalidate.resetFields();
  893. },
  894. //提交移动联系人
  895. submitMove(){
  896. this.$refs.moveFormvalidate.validate((valid,key)=>{
  897. if(!valid) return
  898. console.log(this.moveForm.companyId,this.moveForm.belongUser,this.userId);
  899. customInterence
  900. .moveCustom({
  901. CompanyId:Number(this.moveForm.companyId),
  902. SellerId:Number(this.moveForm.belongUser)||0,
  903. UserId:Number(this.userId)
  904. }).then(res=>{
  905. if(res.Ret===200){
  906. this.$message.success('移动成功');
  907. this.$router.go(0)
  908. }
  909. })
  910. })
  911. },
  912. focusGetCompany() {
  913. customInterence
  914. .companySearch({
  915. KeyWord: "##",
  916. })
  917. .then((res) => {
  918. if (res.Ret === 200) {
  919. this.typeArr = res.Data.List || [];
  920. }
  921. });
  922. },
  923. /* 过滤公司 */
  924. getCompany(query) {
  925. if (query) {
  926. customInterence
  927. .companySearch({
  928. KeyWord: query,
  929. })
  930. .then((res) => {
  931. if (res.Ret === 200) {
  932. this.typeArr = res.Data.List || [];
  933. }
  934. });
  935. } else {
  936. this.typeArr = [];
  937. }
  938. },
  939. /* 获取客户详情 */
  940. async getDetail() {
  941. const res = this.IsFullCompany
  942. ? await customAllInterence.customDetail({
  943. CompanyId:this.companyId
  944. })
  945. : await customInterence.customDetail({
  946. CompanyId:this.companyId
  947. })
  948. if(res.Ret!==200) return
  949. this.isContractButtonShow=res.Data.IsContractButtonShow
  950. this.formatCustomDetail(res)
  951. },
  952. formatCustomDetail(res){
  953. this.showData = true;
  954. this.isBtnShow = res.Data.BtnItem;
  955. this.regionType=res.Data.Item.RegionType
  956. let ficcform = res.Data.FiccItem;//ficc添加的信息
  957. let basicform = res.Data.Item;//客户基本信息
  958. let raiform = res.Data.RaiItem;//权益添加的信息
  959. this.basicform = {...res.Data.Item,CreateAuth:res.Data.CreateAuth};//客户基本信息
  960. this.ficcform = res.Data.FiccItem;//ficc添加的信息
  961. this.raiform = res.Data.RaiItem;//权益添加的信息
  962. // 处理ficc权限列表格式
  963. if(res.Data.FiccItem){
  964. let auth = [];
  965. res.Data.FiccItem.PermissionList.forEach(item=> {
  966. let obj = {
  967. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  968. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  969. ...item,
  970. }
  971. auth.push(obj)
  972. })
  973. this.ficcform={...this.ficcform,authList:auth}
  974. }
  975. // 处理权益权限列表格式
  976. if(res.Data.RaiItem){
  977. let auth = [];
  978. res.Data.RaiItem.PermissionList.forEach(item=> {
  979. let obj = {
  980. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  981. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  982. ...item,
  983. }
  984. auth.push(obj)
  985. })
  986. this.raiform={...this.raiform,authList:auth}
  987. }
  988. this.companyStatus=res.Data.CreateAuth == 1?this.ficcform.Status:this.raiform.Status
  989. /* 基础表单 */
  990. this.dataForm = {
  991. area:basicform.RegionType,
  992. custom_name:basicform.CompanyName,
  993. code:basicform.CreditCode,
  994. province:basicform.Province,
  995. city:basicform.City,
  996. cuStatus:res.Data.CreateAuth == 1?ficcform.Status:raiform.Status,
  997. custype:res.Data.CreateAuth == 1?'ficc':'权益',
  998. trade:res.Data.CreateAuth == 1?ficcform.IndustryName:raiform.IndustryName,
  999. from:res.Data.CreateAuth == 1?ficcform.Source:raiform.Source,
  1000. sales:res.Data.CreateAuth == 1?ficcform.SellerName:raiform.SellerName,
  1001. addreason:res.Data.CreateAuth == 1?ficcform.Reasons:raiform.Reasons
  1002. }
  1003. if(res.Data.CreateAuth == 1) { //ficc创建客户
  1004. /* 处理权限列表格式 */
  1005. let auth = [];
  1006. ficcform.PermissionList.forEach(item=> {
  1007. let obj = {
  1008. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  1009. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  1010. ...item,
  1011. }
  1012. auth.push(obj)
  1013. })
  1014. this.authList = auth;
  1015. //
  1016. if(raiform) {
  1017. this.dataForm2 = {
  1018. cuStatus:raiform.Status,
  1019. custype:'权益',
  1020. trade:raiform.IndustryName,
  1021. from:raiform.Source,
  1022. sales:raiform.SellerName,
  1023. addreason:raiform.Reasons,
  1024. }
  1025. /* 处理权限列表格式 */
  1026. let auth2 = [];
  1027. raiform.PermissionList.forEach(item=> {
  1028. let obj = {
  1029. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  1030. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  1031. ...item,
  1032. }
  1033. auth2.push(obj)
  1034. })
  1035. this.authList2 = auth2;
  1036. }
  1037. }else if (res.Data.CreateAuth == 2){ //权益创建客户
  1038. // /* 基础表单 */
  1039. // this.dataForm = {
  1040. // custom_name:basicform.CompanyName,
  1041. // code:basicform.CreditCode,
  1042. // province:basicform.Province,
  1043. // city:basicform.City,
  1044. // cuStatus:raiform.Status,
  1045. // custype:'权益',
  1046. // trade:raiform.IndustryName,
  1047. // from:raiform.Source,
  1048. // sales:raiform.SellerName,
  1049. // addreason:raiform.Reasons
  1050. // }
  1051. /* 处理权限列表格式 */
  1052. let auth = [];
  1053. raiform.PermissionList.forEach(item=> {
  1054. let obj = {
  1055. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  1056. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  1057. ...item,
  1058. }
  1059. auth.push(obj)
  1060. })
  1061. this.authList = auth;
  1062. //
  1063. if(ficcform) {
  1064. this.dataForm2 = {
  1065. cuStatus:ficcform.Status,
  1066. custype:'ficc',
  1067. trade:ficcform.IndustryName,
  1068. from:ficcform.Source,
  1069. sales:ficcform.SellerName,
  1070. addreason:ficcform.Reasons
  1071. };
  1072. /* 处理权限列表格式 */
  1073. let auth2 = [];
  1074. ficcform.PermissionList.forEach(item=> {
  1075. let obj = {
  1076. checkAll:item.CheckList&&item.CheckList.length===item.Items.length?true:false,
  1077. isIndeterminate:item.CheckList&&item.CheckList.length>0 && item.CheckList.length<item.Items.length,
  1078. ...item,
  1079. }
  1080. auth2.push(obj)
  1081. })
  1082. this.authList2 = auth2;
  1083. }
  1084. }
  1085. },
  1086. /* 获取联系人列表 */
  1087. getuserTable() {
  1088. const subProductArr = this.platform_type.split('-');
  1089. customInterence.concactList({
  1090. PageSize:10,
  1091. CurrentIndex:this.page_no,
  1092. CompanyId:this.companyId,
  1093. KeyWord:this.search_txt,
  1094. ProductType: Number(subProductArr[0]),
  1095. ProductId: Number(subProductArr[1]),
  1096. IsSubscribeHzyj:this.IsSubscribe.includes('1')?1:this.IsSubscribe.includes('2')?0:'',
  1097. IsSubscribeCygx:this.IsSubscribe.includes('3')?1:this.IsSubscribe.includes('4')?0:'',
  1098. }).then(res => {
  1099. if(res.Ret === 200) {
  1100. this.userTable = res.Data.List || [];
  1101. this.total = res.Data.Paging.Totals
  1102. }else {
  1103. this.userTable = []
  1104. }
  1105. })
  1106. },
  1107. /* 获取历史签约 */
  1108. getDealList() {
  1109. customInterence.historydeal({
  1110. CompanyId:this.companyId,
  1111. CompanyType:this.RoleType
  1112. }).then(res => {
  1113. if(res.Ret === 200) {
  1114. let auth = [];
  1115. res.Data.List&&res.Data.List.forEach(item=> {
  1116. item.StartDate = item.StartDate.replace(/-/g,'.')
  1117. item.EndDate = item.EndDate.replace(/-/g,'.')
  1118. item.PermissionList.forEach(auth => {
  1119. auth.CheckAll = auth.CheckList&&auth.CheckList.length===auth.Items.length?true:false
  1120. })
  1121. // 处理合同附件
  1122. let arr=item.ImgUrl.split('#').map(e=>{
  1123. const reg = /\.(pdf)$/;
  1124. const reg2= /\.doc|\.docx$/
  1125. if(reg.test(e)){
  1126. return {
  1127. type:'pdf',
  1128. url:e
  1129. }
  1130. }else if(reg2.test(e)){
  1131. return {
  1132. type:'word',
  1133. url:e
  1134. }
  1135. }else{
  1136. return {
  1137. type:'img',
  1138. url:e
  1139. }
  1140. }
  1141. })
  1142. item.constractFiles=arr
  1143. })
  1144. this.dealList = res.Data.List || []
  1145. }
  1146. })
  1147. },
  1148. /* 查看历史签约 */
  1149. previewHistory() {
  1150. this.isPreview = true
  1151. },
  1152. /* 编辑客户 */
  1153. editHandle() {
  1154. this.$router.push({
  1155. path:'/editCustom',
  1156. query: {
  1157. id:this.companyId
  1158. }
  1159. })
  1160. },
  1161. /* 删除客户 */
  1162. delHandle() {
  1163. this.$confirm('是否确认删除该客户吗?','提示',{
  1164. type:'warning'
  1165. }).then(() => {
  1166. customInterence.customDel({
  1167. CompanyId:Number(this.companyId)
  1168. }).then(res => {
  1169. if(res.Ret === 200) {
  1170. this.$message.success(res.Msg)
  1171. //this.$router.go(-1);
  1172. this.$router.push({path:'/customList'})
  1173. }
  1174. })
  1175. }).catch(() => {});
  1176. },
  1177. /* 搜索联系人 */
  1178. searchUser() {
  1179. this.page_no = 1;
  1180. this.getuserTable();
  1181. },
  1182. /* 新增联系人 */
  1183. addConcat() {
  1184. this.diaform.companyName = this.dataForm.custom_name;
  1185. this.defaultName = this.dataForm.custom_name;
  1186. this.isAddContact = true;
  1187. this.diatit = '新增联系人'
  1188. // 客户ID
  1189. customInterence.customDetail({
  1190. CompanyId: window.location.search.split("=")[1]
  1191. }).then((res) =>{
  1192. // 得知用户是FICC或是权益
  1193. this.ProductName =res.Data.ProductName;
  1194. }).catch((err)=>{
  1195. console.log(err)
  1196. })
  1197. },
  1198. /* 编辑联系人 */
  1199. editContact(item) {
  1200. this.defaultName = item.CompanyName;
  1201. this.diaform = {
  1202. companyName:item.CompanyName,
  1203. name:item.RealName,
  1204. sex:item.Sex,
  1205. telCode:item.CountryCode,
  1206. tel1:item.Mobile,
  1207. tel2:item.MobileTwo||'',
  1208. mail:item.Email||'',
  1209. post:item.Position||'',
  1210. desiger:item.IsMaker,
  1211. depart:item.DepartmentName,
  1212. carte:item.BusinessCardUrl,
  1213. mailQY:item.Email,
  1214. telQY:item.Mobile
  1215. }
  1216. this.userId = item.UserId;
  1217. this.isAddContact = true;
  1218. this.diatit = '编辑联系人';
  1219. },
  1220. // 关注与取消关注
  1221. followContact(row){
  1222. // console.log(row);
  1223. let isFollow = row.IsFollow==1
  1224. let confirmText = isFollow?'是否取消':'是否设为'
  1225. this.$confirm(`${confirmText}特别关注?`, "提示", {
  1226. type: "warning",
  1227. }).then(() => {
  1228. let params={
  1229. UserId:row.UserId,
  1230. CompanyId:row.CompanyId,
  1231. Type:isFollow?0:1
  1232. }
  1233. customInterence.concactFollow(params).then(res=>{
  1234. if(res.Ret == 200){
  1235. this.$message.success(isFollow?"取消成功":"关注成功")
  1236. this.getuserTable()
  1237. }
  1238. })
  1239. })
  1240. .catch(() => {});
  1241. },
  1242. // 删除联系人判断 试用、正式、永续、冻结状态下的客户 如只剩一个联系人不允许删除
  1243. /**
  1244. * 1.如果是非管理员用户则直接根据数量判断
  1245. * 2.如果是管理员 根据该联系人数据中的ProductIds 判断
  1246. *
  1247. */
  1248. async beforeDelConcat(e){
  1249. let tag=true
  1250. if(this.companyStatus=='试用'||this.companyStatus=='正式'||this.companyStatus=='永续'||this.companyStatus=='冻结'){
  1251. const roleType=localStorage.getItem('RoleType')
  1252. if(roleType!='admin'){
  1253. let res=await customInterence.companyUserTotal({CompanyId:this.companyId})
  1254. if(res.Ret==200&&res.Data.Total<=1){
  1255. tag=false
  1256. }
  1257. }else{
  1258. let arr=e.ProductIds.split(',')
  1259. console.log(arr);
  1260. if(arr.length==1){
  1261. let res=await customInterence.companyUserTotal({CompanyId:this.companyId,ProductId:arr[0]})
  1262. if(res.Ret==200&&res.Data.Total<=1){
  1263. tag=false
  1264. }
  1265. }
  1266. if(arr.length>1){
  1267. let res1=await customInterence.companyUserTotal({CompanyId:this.companyId,ProductId:arr[0]})
  1268. let res2=await customInterence.companyUserTotal({CompanyId:this.companyId,ProductId:arr[1]})
  1269. if((res1.Ret==200&&res1.Data.Total<=1)||(res2.Ret==200&&res2.Data.Total<=1)){
  1270. tag=false
  1271. }
  1272. }
  1273. }
  1274. }
  1275. return new Promise((resolve,reject)=>{
  1276. resolve(tag)
  1277. })
  1278. },
  1279. /* 删除联系人 */
  1280. async delConcat(item) {
  1281. let flag=await this.beforeDelConcat(item)
  1282. if(!flag){
  1283. this.$confirm('当前只有一个联系人,无法删除','提示',{
  1284. confirmButtonText: '知道了',
  1285. showCancelButton:false,
  1286. type: 'warning',
  1287. })
  1288. return
  1289. }
  1290. // let totalRes=await customInterence.companyUserTotal({CompanyId:this.companyId})
  1291. // if(totalRes.Ret===200){
  1292. // console.log(this.companyStatus);
  1293. // if(totalRes.Data.Total<=1&&(this.companyStatus=='试用'||this.companyStatus=='正式'||this.companyStatus=='永续'||this.companyStatus=='冻结')){
  1294. // this.$confirm('当前只有一个联系人,无法删除','提示',{
  1295. // confirmButtonText: '知道了',
  1296. // showCancelButton:false,
  1297. // type: 'warning',
  1298. // })
  1299. // return
  1300. // }
  1301. // }else{
  1302. // return
  1303. // }
  1304. this.$confirm('是否确认删除该联系人吗?','提示',{
  1305. type:'warning'
  1306. }).then(() => {
  1307. customInterence.concactDel({
  1308. UserId:item.UserId
  1309. }).then(res => {
  1310. if(res.Ret === 200) {
  1311. this.$message.success(res.Msg)
  1312. this.page_no = 1
  1313. this.getuserTable()
  1314. // let index = this.userTable.indexOf(item);
  1315. // this.userTable.splice(index,1);
  1316. // this.total = this.total-1;
  1317. }
  1318. })
  1319. }).catch(() => {});
  1320. },
  1321. /* 取消弹窗 */
  1322. canceldialog(type) {
  1323. this.isAddContact = false;
  1324. this.userId = '';
  1325. this.defaultName = this.dataForm.custom_name;
  1326. this.diaform = {
  1327. companyName:this.dataForm.custom_name,
  1328. name:'',
  1329. telCode:'86',
  1330. sex:1,
  1331. tel1:'',
  1332. tel2:'',
  1333. mail:'',
  1334. post:'',
  1335. desiger:'',
  1336. depart:'',
  1337. carte:''
  1338. }
  1339. if(type==1) {
  1340. this.getuserTable();
  1341. }
  1342. },
  1343. /* 页码改变 */
  1344. handleCurrentChange(page) {
  1345. this.page_no = page;
  1346. this.getuserTable();
  1347. },
  1348. /* 查看阅读报告列表 */
  1349. lookReport(item) {
  1350. this.readId = item.UserId;
  1351. this.readTit = item.RealName+'研报统计';
  1352. this.isRead = true;
  1353. },
  1354. /* 关闭阅读报告弹窗 */
  1355. cancelRead() {
  1356. this.readTit = '研报统计';
  1357. this.isRead = false;
  1358. },
  1359. /* 预览名片 */
  1360. reviewCard(card) {
  1361. this.showViewer = true;
  1362. this.imgView = card;
  1363. },
  1364. /* 关闭预览 */
  1365. closeViewer() {
  1366. this.imgView = '';
  1367. this.showViewer = false;
  1368. },
  1369. /* 导入联系人打开弹窗 */
  1370. async importHandle() {
  1371. let totalRes=await customInterence.companyUserTotal({CompanyId:this.companyId})
  1372. if(totalRes.Ret===200){
  1373. if(totalRes.Data.Total>=1) {
  1374. setTimeout(() => {
  1375. $('#fileImport').click();
  1376. })
  1377. }else {
  1378. this.$message.error('请先至少添加一位名片联系人')
  1379. }
  1380. }else{
  1381. this.$message.error(totalRes.ErrMsg)
  1382. }
  1383. },
  1384. /* 关闭导入弹窗 */
  1385. cancelImport(type) {
  1386. this.isShowImportDia = false;
  1387. this.isImportRepeat = false;
  1388. this.importData = [];
  1389. this.repeatData = [];
  1390. this.importParams = null;
  1391. if(type == 1) {
  1392. this.getuserTable();
  1393. }
  1394. },
  1395. // 获取文件上传的数据
  1396. fileSelected(type){
  1397. console.log(document.getElementById('fileImport').files)
  1398. const that = this;
  1399. if( document.getElementById('fileImport').files[0] ){
  1400. let hostfile = document.getElementById('fileImport').files[0];
  1401. let size = Math.floor(hostfile.size / 1024 / 1024);
  1402. if( size>200 ){
  1403. that.$message.error('上传文件大小不能大于200M!');
  1404. hostfile = {};
  1405. return false
  1406. }
  1407. if( hostfile.name.toLowerCase().includes('.xlsx')){
  1408. let form = new FormData();
  1409. form.append('File',hostfile); //hostfile.name
  1410. form.append('CompanyId',that.companyId);
  1411. customInterence.getimportList(form).then((res) => {
  1412. if( res.Ret === 200 ){
  1413. if(res.Data.RepeatUser.length>0){
  1414. this.$confirm('excel表中存在重复手机号,请去重后,重新导入','提示',{
  1415. confirmButtonText: '知道了',
  1416. showCancelButton:false,
  1417. type: 'warning'
  1418. })
  1419. }else{
  1420. that.isShowImportDia = true;
  1421. that.importParams = form;
  1422. that.importData = res.Data.ValidUser || [];
  1423. }
  1424. }
  1425. $("#fileImport").val('');
  1426. hostfile = {};
  1427. });
  1428. }else{
  1429. that.$message.error('请上传.xlsx的文件格式!');
  1430. }
  1431. }
  1432. },
  1433. /* 确认导入联系人 */
  1434. ensureImport() {
  1435. customInterence.importUser(this.importParams).then(res => {
  1436. if(res.Ret === 200) {
  1437. this.$message.success('导入成功');
  1438. this.cancelImport(1);
  1439. }else if(res.Ret === 600) {
  1440. this.cancelImport();
  1441. // this.$nextTick(()=> {
  1442. this.isShowImportDia = true;
  1443. this.isImportRepeat = true;
  1444. this.repeatData = res.Data;
  1445. // })
  1446. }
  1447. })
  1448. },
  1449. /* 选择全选或取消全选 */
  1450. handleCheckAll(item) {
  1451. // 取到所有的子菜单id
  1452. let ids = item.Items.map(item =>{
  1453. return item.ChartPermissionId
  1454. })
  1455. item.CheckList = item.checkAll ? ids : [];
  1456. item.isIndeterminate = false;
  1457. },
  1458. /* 复选框組选中时 */
  1459. handleChecked(item) {
  1460. let len = item.CheckList.length;
  1461. item.checkAll = len === item.Items.length;
  1462. item.isIndeterminate = len > 0 && len < item.Items.length;
  1463. },
  1464. lookReadInfo(item){
  1465. if(!item.YbProductViewTotal) return
  1466. this.productReadId = item.UserId
  1467. this.productReadTitle = item.RealName + '其他统计'
  1468. this.clickToal = item.YbProductViewTotal
  1469. this.productReadInfoShow = true
  1470. },
  1471. /* 获取分产品的几种类型 */
  1472. getSubProductList() {
  1473. customInterence.getSubProduct({StatisticFlag:true}).then(res => {
  1474. if(res.Ret !== 200) return
  1475. res.Data.forEach(item => {
  1476. item.key = `${item.ProductType}-${item.ProductId}`
  1477. })
  1478. this.platformOption = res.Data;
  1479. this.platform_type = `${res.Data[0].ProductType}-${res.Data[0].ProductId}`;
  1480. this.subProductName = res.Data[0].ProductName;
  1481. this.getuserTable();
  1482. })
  1483. },
  1484. changeSubProductHandle(val) {
  1485. this.search_txt = '';
  1486. let obj = this.platformOption.find(_ =>_.key === val);
  1487. this.subProductName = obj.ProductName;
  1488. this.getuserTable();
  1489. },
  1490. changeSubscribe(){
  1491. this.search_txt = '';
  1492. this.getuserTable();
  1493. },
  1494. // 研选服务、专项调研明细
  1495. clickDlgNumberHandler(type){
  1496. this.isShowDlgType = type
  1497. this.isShowResearchNumber =true
  1498. },
  1499. // 设置表格行的样式
  1500. setRowClass({row}){
  1501. if(row.NotRead && row.IsFollow==1){
  1502. return "not-read-seven-days"
  1503. }
  1504. }
  1505. },
  1506. mounted() {
  1507. this.getDetail();
  1508. this.getSubProductList();
  1509. this.getDealList();
  1510. },
  1511. }
  1512. </script>
  1513. <style lang='scss'>
  1514. .contact-opt-box{
  1515. .chart{
  1516. display: inline-block;
  1517. cursor: pointer;
  1518. margin-left: 5px;
  1519. }
  1520. }
  1521. .el-icon-arrow-right:before{
  1522. color: #1989FA;
  1523. }
  1524. .el-message-box__header .el-message-box__title{
  1525. color: #333 !important;
  1526. }
  1527. .page-title{
  1528. font-size: 16px;
  1529. font-weight: bold;
  1530. color: #333;
  1531. height: 40px;
  1532. line-height: 40px;
  1533. padding-left: 10px;
  1534. background: #F0F2F5;
  1535. margin-bottom: 40px;
  1536. }
  1537. .customDetail_container {
  1538. .isShared::after{
  1539. content: '共享';
  1540. font-size: 12px;
  1541. // padding: 0px 0px 0px 2px;
  1542. width: 30px;
  1543. color: #3994fb;
  1544. background-color: #dcecfc;
  1545. position: absolute;
  1546. left: 0;
  1547. bottom: 0;
  1548. border-top-right-radius: 5px;
  1549. }
  1550. padding:30px 40px 60px 60px;
  1551. background: #fff;
  1552. position: relative;
  1553. border: 1px solid #ECECEC;
  1554. border-radius: 4px;
  1555. box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  1556. font-size: 16px;
  1557. color: #666;
  1558. /* reset */
  1559. .el-form-item {
  1560. margin-bottom: 30px;
  1561. &:last-child {
  1562. margin-bottom: 0;
  1563. }
  1564. }
  1565. .el-collapse {
  1566. border: none;
  1567. }
  1568. .el-collapse-item__header {
  1569. display: block;
  1570. border: none;
  1571. font-size: 16px;
  1572. color: #333;
  1573. }
  1574. .el-collapse-item__wrap {
  1575. border: none;
  1576. }
  1577. .textarea_item .el-form-item__content {
  1578. width: 100%;
  1579. }
  1580. .el-form-item .el-checkbox-group {
  1581. height: 40px;
  1582. line-height: 40px;
  1583. }
  1584. .distpicker-address-wrapper select {
  1585. width: 198px;
  1586. }
  1587. /* */
  1588. .detail_item {
  1589. display: flex;
  1590. align-items: center;
  1591. flex-wrap: wrap;
  1592. margin-bottom: 40px;
  1593. li {
  1594. width: 33%;
  1595. color: #666;
  1596. margin-bottom: 30px;
  1597. font-size: 15px;
  1598. display: flex;
  1599. .label{
  1600. display: inline-block;
  1601. width: 80px;
  1602. text-align: right;
  1603. margin-right: 30px;
  1604. flex-shrink: 0;
  1605. }
  1606. .label-num {
  1607. flex-shrink: 0;
  1608. margin-right: 30px;
  1609. }
  1610. .con{
  1611. display: inline-block;
  1612. color: #333;
  1613. // font-weight: bold;
  1614. }
  1615. }
  1616. }
  1617. .menu_lists {
  1618. padding: 40px 18px;
  1619. border: 1px dashed #AAB4CC;
  1620. border-radius: 4px;
  1621. .menu_item {
  1622. display: flex;
  1623. // align-items: center;
  1624. margin-bottom: 30px;
  1625. &:last-child {
  1626. margin-bottom: 0;
  1627. }
  1628. .list_item {
  1629. margin-right: 30px;
  1630. margin-bottom: 10px;
  1631. &:last-child {
  1632. margin-right: 0;
  1633. }
  1634. }
  1635. }
  1636. }
  1637. .customList_bot_top {
  1638. display: flex;
  1639. justify-content: space-between;
  1640. align-items: center;
  1641. margin-bottom: 28px;
  1642. }
  1643. .name-follow-heart{
  1644. width:25px;
  1645. height: 15px;
  1646. position: absolute;
  1647. left: 0;
  1648. top: 0;
  1649. }
  1650. .not-read-seven-days{
  1651. background-color: #FFF8F8;
  1652. }
  1653. }
  1654. .customDetail_contract_dialog {
  1655. max-height: 810px;
  1656. min-height: 200px;
  1657. overflow-y: auto;
  1658. .el-dialog__header {
  1659. background: #fff;
  1660. }
  1661. .el-dialog__body {
  1662. padding: 30px 50px !important;
  1663. }
  1664. .history_item {
  1665. margin-bottom: 60px;
  1666. .detail_item {
  1667. font-size: 16px;
  1668. color: #666;
  1669. li {
  1670. margin-bottom: 30px;
  1671. &:last-child {
  1672. margin-bottom: 0;
  1673. }
  1674. }
  1675. }
  1676. }
  1677. .menu_lists {
  1678. padding: 20px 18px;
  1679. border: 1px dashed #AAB4CC;
  1680. border-radius: 4px;
  1681. .menu_item {
  1682. display: flex;
  1683. // align-items: center;
  1684. margin-bottom: 20px;
  1685. &:last-child {
  1686. margin-bottom: 0;
  1687. }
  1688. .list_item {
  1689. margin-right: 30px;
  1690. margin-bottom: 5px;
  1691. &:last-child {
  1692. margin-right: 0;
  1693. }
  1694. }
  1695. }
  1696. }
  1697. }
  1698. </style>