企微助手 ,仓库名 短剧

customerProfile.vue 7.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <!-- v-loading="loading"-->
  3. <div >
  4. <div class="bigTitle">
  5. <i class="el-icon-user-solid"></i>
  6. <span>添加客服信息</span>
  7. </div>
  8. <div class="tableBox_detial">
  9. <el-skeleton :loading="loading" animated>
  10. <template slot="template">
  11. <el-skeleton-item animated style="height: 100px"/>
  12. </template>
  13. <template>
  14. <el-table
  15. :data="tableData"
  16. :header-cell-class-name="headerClassName"
  17. border
  18. style="width: 100%">
  19. <el-table-column
  20. label="所属员工"
  21. class-name="self-column">
  22. <template slot-scope="scope">
  23. <div class="flex-align-center">
  24. <img :src="scope.row.avatar" alt="" width="40px">
  25. <span class="lMar8">{{scope.row.user_name}}</span>
  26. </div>
  27. </template>
  28. </el-table-column>
  29. <el-table-column
  30. class-name="self-column"
  31. label="其他客户来源">
  32. <template slot-scope="scope">
  33. {{scope.row.add_way}}
  34. </template>
  35. </el-table-column>
  36. <el-table-column
  37. class-name="self-column"
  38. label="添加时间">
  39. <template slot-scope="scope">
  40. {{scope.row.createtime}}
  41. </template>
  42. </el-table-column>
  43. <el-table-column
  44. class-name="self-column"
  45. label="最近沟通">
  46. <template slot-scope="scope">
  47. {{scope.row.remark}}
  48. </template>
  49. </el-table-column>
  50. </el-table>
  51. </template>
  52. </el-skeleton>
  53. </div>
  54. <div class="bigTitle tMar30">
  55. <i class="el-icon-user-solid"></i>
  56. <span>基本信息</span>
  57. <!-- <span style="color: #898D92;font-weight: 400;margin-left: 6px">所属员工可在「侧边栏-客户画像」中进行编辑</span>-->
  58. </div>
  59. <el-skeleton :loading="loading" animated>
  60. <template slot="template">
  61. <el-skeleton-item animated style="height: 140px"/>
  62. </template>
  63. <template>
  64. <div class="tableBox_detial flexWrap" style="border: 1px solid #D2D2D2">
  65. <div v-for="(b,bidx) in basicInfo" :key="bidx" class="basic_item"
  66. :style="[{borderBottom:(b.name == '企业' || b.name == '微博') ? 'none' : '' },{borderRight:bidx%2!==0 ? 'none' : ''}]">
  67. <div class="name">{{b.name}}</div>
  68. <div class="value">
  69. <template v-if="b.key == 'e_birthday'">
  70. <el-date-picker class="ipt"
  71. v-focus
  72. v-if="b.itpShow"
  73. @blur="iptBlur(bidx)"
  74. v-model="b.value"
  75. type="date"
  76. value-format="yyyy-MM-dd"
  77. :placeholder="'请输入'+b.name">
  78. </el-date-picker>
  79. <span @click="b.itpShow = true" class="text" v-else>{{b.value?b.value:'-'}}</span>
  80. </template>
  81. <template v-else-if="b.key == 'sex'">
  82. <span>{{b.value == 1 ? '男' : (b.value == 2 ? '女' : '未知')}}</span>
  83. </template>
  84. <template v-else>
  85. <el-input class="ipt" v-focus v-model="b.value" :placeholder="'请输入'+b.name" v-if="b.itpShow" @blur="iptBlur(bidx)"></el-input>
  86. <span @click="b.itpShow = true" class="text" v-else>{{b.value?b.value:'-'}}</span>
  87. </template>
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. </el-skeleton>
  93. </div>
  94. </template>
  95. <script>
  96. export default {
  97. name: "customerProfile",
  98. props:['rowProp'],
  99. data(){
  100. return{
  101. loading:false,
  102. basicInfo:[
  103. { //性别的位置不要换,换的话在initProfile里调整获取的索引
  104. name:'性别',
  105. key:'sex',
  106. value:'',
  107. itpShow:false
  108. },
  109. {
  110. name:'地址',
  111. key:'e_address',
  112. value:'',
  113. itpShow:false
  114. },
  115. {
  116. name:'年龄',
  117. key:'e_age',
  118. value:'',
  119. itpShow:false
  120. },
  121. {
  122. name:'生日',
  123. key:'e_birthday',
  124. value:'',
  125. itpShow:false
  126. },
  127. {
  128. name:'描述',
  129. key:'e_desc',
  130. value:'',
  131. itpShow:false
  132. },
  133. {
  134. name:'邮箱',
  135. key:'e_email',
  136. value:'',
  137. itpShow:false
  138. },
  139. {
  140. name:'电话',
  141. key:'e_phone',
  142. value:'',
  143. itpShow:false
  144. },
  145. {
  146. name:'职位',
  147. key:'e_position',
  148. value:'',
  149. itpShow:false
  150. },
  151. {
  152. name:'QQ',
  153. key:'e_qq',
  154. value:'',
  155. itpShow:false
  156. },
  157. {
  158. name:'来源',
  159. key:'e_source',
  160. value:'',
  161. itpShow:false
  162. },
  163. {
  164. name:'企业',
  165. key:'e_company',
  166. value:'',
  167. itpShow:false
  168. },
  169. {
  170. name:'微博',
  171. key:'e_weibo',
  172. value:'',
  173. itpShow:false
  174. }
  175. ],
  176. resInfo:{},
  177. tableData: [],
  178. }
  179. },
  180. directives:{
  181. focus:{
  182. inserted : function (el){
  183. el.querySelector('input').focus()
  184. }
  185. }
  186. },
  187. created() {
  188. this.init()
  189. },
  190. methods:{
  191. init(){
  192. this.loading = true
  193. this.$axios.get(this.URL.BASEURL + this.URL.customerDetail,{
  194. params:{
  195. customer_id:this.rowProp.customer_id,
  196. user_id:this.rowProp.user_id
  197. }
  198. }).then((res)=>{
  199. this.loading = false
  200. res=res.data
  201. this.resInfo = res.rst
  202. this.tableData = []
  203. this.tableData.push({
  204. add_way:res.rst.follow_list.add_way,
  205. createtime:res.rst.follow_list.createtime,
  206. remark:res.rst.follow_list.remark,
  207. avatar:res.rst.follow_list.avatar,
  208. user_name:res.rst.follow_list.user_name
  209. })
  210. this.basicInfo[0].value = res.rst.gender
  211. this.basicInfo.forEach(item=>{
  212. item.value = res.rst[item.key]
  213. })
  214. }).catch(err=>{
  215. this.loading = false
  216. })
  217. },
  218. editProfile(){
  219. let data={
  220. customer_id:this.rowProp.customer_id,
  221. }
  222. this.basicInfo.forEach(item=>{
  223. data[item.key] = item.value
  224. })
  225. this.$axios.post(this.URL.BASEURL + this.URL.customerInfoUpdate,data).then((res)=>{
  226. res=res.data
  227. this.$message({
  228. message: res.err,
  229. type: "info"
  230. })
  231. })
  232. },
  233. headerClassName(){
  234. return 'headerClass'
  235. },
  236. iptBlur(index){
  237. this.basicInfo[index].itpShow = false
  238. this.editProfile()
  239. }
  240. }
  241. }
  242. </script>
  243. <style lang="scss">
  244. .tableBox_detial{
  245. .headerClass{
  246. background: #FBFBFB !important;
  247. font-weight: 400;
  248. color: #666;
  249. }
  250. .basic_item{
  251. width: 50%;
  252. font-size: 14px;
  253. display: flex;
  254. align-items: center;
  255. line-height: 44px;
  256. border-bottom: 1px solid #D2D2D2;
  257. border-right: 1px solid #D2D2D2;
  258. .value{
  259. padding: 0 20px;
  260. width: 100%;
  261. .ipt{
  262. width: 80%;
  263. .el-input__inner{
  264. height: 30px;
  265. line-height: 30px;
  266. }
  267. }
  268. .text{
  269. width: 80%;
  270. height: 30px;
  271. line-height: 30px;
  272. display:inline-block;
  273. }
  274. .text:hover{
  275. border-bottom: 1px solid #333;
  276. cursor: text;
  277. }
  278. }
  279. .name{
  280. color: #666;
  281. background: #FBFBFB;
  282. width: 30%;
  283. padding-left: 20px;
  284. border-right: 1px solid #D2D2D2;
  285. }
  286. }
  287. }
  288. </style>
  289. <style lang="scss" scoped>
  290. .bigTitle{
  291. color: #333;
  292. font-size: 14px;
  293. margin-left: 5px;
  294. font-weight: 600;
  295. margin-bottom: 10px;
  296. }
  297. .tableBox_detial{
  298. font-size: 14px;
  299. margin-top: 10px;
  300. .self-column{
  301. text-align: center;
  302. }
  303. }
  304. </style>