customDetail.vue 53 KB

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