followUp.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. <template>
  2. <div class="normal-panel follow__panel" >
  3. <div class="container flex-align-center flex-between">
  4. <div>
  5. <slot name="collapse"></slot>
  6. <p class="inline-16">跟进动态</p>
  7. </div>
  8. <addLog :ownertable="ownertable" @onSuccess="queryLogs" :status="status"></addLog>
  9. </div>
  10. <div class="container scroll" >
  11. <div v-if="logList.length === 0">
  12. <el-empty description="暂无记录" :image-size="40"></el-empty>
  13. </div>
  14. <div>
  15. <el-timeline>
  16. <el-timeline-item
  17. v-for="i in logList" :key="i.index"
  18. :timestamp="i.createdate">
  19. <div slot="dot" class="dot"></div>
  20. <div class="step__panel normal-margin">
  21. <div class="flex-align-center " style="margin-bottom:10px" v-if="i.userextend.length > 0">
  22. <!-- <p><small>跟进人:</small>{{i.changeby}}</p> -->
  23. <!-- <img height="30" width="30" :src="i.headpic" alt="">-->
  24. <div class="avatar" >
  25. <img class="avatar__image" v-if="i.headpic" :src="i.headpic" alt="">
  26. <p v-else>{{i.userextend[0].name.substr(0, 1)}}</p>
  27. </div>
  28. <div style="margin-left: 10px">
  29. <p>{{ i.userextend[0].name }}&nbsp;</p>
  30. <small style="color:#999999ad;margin-top:10px">部门:{{ i.userextend[0].depname?i.userextend[0].depname:"--" }}&emsp;职位:{{ i.userextend[0].position?i.userextend[0].position:"--" }}</small>
  31. </div>
  32. <!-- <div style="margin-left: 20px">
  33. <small style="color:#999">{{i.createdate}}</small>
  34. </div>-->
  35. </div>
  36. <div class="flex-align-center " style="margin-bottom:10px" v-else>
  37. <!-- <p><small>跟进人:</small>{{i.changeby}}</p> -->
  38. <!-- <img height="30" width="30" :src="i.headpic" alt="">-->
  39. <div class="avatar" >
  40. <img class="avatar__image" v-if="i.headpic" :src="i.headpic" alt="">
  41. <p v-else>{{i.createby.substr(0, 1)}}</p>
  42. </div>
  43. <div style="margin-left: 10px">
  44. <p>{{ i.createby }}&nbsp;</p>
  45. <small style="color:#999999ad;margin-top:10px">部门:{{"--" }}&emsp;职位:{{ "--" }}</small>
  46. </div>
  47. <!-- <div style="margin-left: 20px">
  48. <small style="color:#999">{{i.createdate}}</small>
  49. </div>-->
  50. </div>
  51. <!-- <div >
  52. <span>{{i.userextend[0].name}}</span>
  53. <span>
  54. <small>部门:{{i.userextend[0].depname}}</small>
  55. <small>职位:{{i.userextend[0].position}}</small>
  56. </span>
  57. </div>-->
  58. <div class="follow-progress">
  59. <p>{{i.content}}</p>
  60. <div>
  61. <!-- <previewImage v-show="checkFileType(img.postfix) === 'img'" style="width:60px;height:60px;margin-left:5px" v-for="img in i.attinfos" :key="img.index" :image="img" :deletebtn="true" @onSuccess="queryLogs"></previewImage> -->
  62. <div class="flex-align-center flex-between pionter" v-for="img in i.attinfos" :key="img.index" style="padding:10px;margin-bottom:5px">
  63. <div class="flex-align-center" style="flex:1;width:100%">
  64. <img width="30" :src="checkFileType(img.postfix) === 'file'?require('@/assets/file_icons/file.svg'):img.url" class="inline-16" alt="">
  65. <div class="file__link">
  66. <a :href="img.url">{{img.document}}</a>
  67. <p>{{(img.contentlength / 1024).toFixed(2)}}kb</p>
  68. </div>
  69. </div>
  70. <i style="color:red;" class="el-icon-delete" v-if="nowUserid === i.createuserid" @click="deleteFile(img)"></i>
  71. </div>
  72. </div>
  73. <!-- <div v-show="checkFileType(file.postfix) === 'file'" class="flex-align-center pionter" style="margin-bottom:10px;" v-for="file in i.attinfos" :key="file.index">
  74. <a class="file__link" :href="file.url">{{file.document}}</a>
  75. <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
  76. </div> -->
  77. <div style="text-align:right" v-if="nowUserid === i.createuserid">
  78. <upload class="inline-16" slot="upload"
  79. :folderid="folderid"
  80. :status="status"
  81. btntype="icon"
  82. :bindData="{ ownertable: 'sys_datafollowup', ownerid: i.sys_datafollowupid,usetype: 'default' }"
  83. @onSuccess="queryLogs">
  84. </upload>
  85. <editLog :status="status" :data="i" :ownertable="ownertable" @onSuccess="queryLogs"></editLog>
  86. <el-button icon="el-icon-delete" size="mini" type="text" @click="deleteLogs(i)" :disabled="status === '已结案' || status === '已失败'">删 除</el-button>
  87. </div>
  88. </div>
  89. </div>
  90. </el-timeline-item>
  91. </el-timeline>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script>
  97. import upload from '@/components/upload/hw_obs_upload.vue'
  98. import previewImage from '@/components/previewImage/index.vue'
  99. import addLog from './addLog.vue'
  100. import editLog from './editLog.vue'
  101. export default {
  102. props:['ownertable','status'],
  103. components:{
  104. addLog,
  105. editLog,
  106. upload,
  107. previewImage
  108. },
  109. data () {
  110. return {
  111. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  112. logList:[],
  113. nowUserid:''
  114. }
  115. },
  116. methods:{
  117. async queryLogs() {
  118. const res = await this.$api.requested({
  119. "id": 20220930121501,
  120. "content": {
  121. "ownertable":this.ownertable,
  122. "ownerid":this.$route.query.id
  123. }
  124. })
  125. this.logList = res.data
  126. console.log(this.logList,'跟进数据')
  127. console.log(this.logList.length,'数据')
  128. },
  129. async deleteLogs (val) {
  130. const res = await this.$api.requested({
  131. "id": 20220930121701,
  132. "content": {
  133. "sys_datafollowupid":val.sys_datafollowupid
  134. }
  135. })
  136. this.tool.showMessage(res,()=>{
  137. this.queryLogs()
  138. })
  139. },
  140. checkFileType (type) {
  141. let arr = ['JPG','JPEG','PNG']
  142. if (arr.includes(type.toUpperCase())) {
  143. return 'img'
  144. } else {
  145. return 'file'
  146. }
  147. },
  148. async deleteFile (row) {
  149. const res = await this.$api.requested({
  150. "classname": "system.attachment.Attachment",
  151. "method": "deleteFileLink",
  152. "content": {
  153. "linksids":[row.linksid]
  154. }
  155. })
  156. this.tool.showMessage(res,()=>{
  157. this.queryLogs()
  158. })
  159. }
  160. },
  161. mounted () {
  162. this.queryLogs()
  163. this.nowUserid = JSON.parse(sessionStorage.getItem('active_account')).userid
  164. },
  165. watch: {
  166. $route () {
  167. this.queryLogs()
  168. }
  169. }
  170. }
  171. </script>
  172. <style>
  173. .el-step__description{
  174. padding-right:0px !important;
  175. }
  176. </style>
  177. <style scoped>
  178. .step__panel{
  179. background-color: #eff4ff;
  180. padding: 10px;
  181. border-radius: 5px;
  182. color:#666
  183. }
  184. .follow-progress p{
  185. width:100%;
  186. margin-bottom:5px;
  187. font-size:14px;
  188. word-wrap: break-word;
  189. }
  190. .file__link{
  191. color:#999;
  192. font-size: 12px;
  193. padding: 0 5px;
  194. display:block;
  195. width: 100%;
  196. white-space: nowrap;
  197. overflow: hidden;
  198. text-overflow: ellipsis;
  199. }
  200. .pionter{
  201. margin:6px 0;
  202. padding: 10px;
  203. transition: .2s linear;
  204. cursor: pointer;
  205. border-radius: 5px;
  206. background: #ffff;
  207. }
  208. .pionter:hover{
  209. box-shadow: 0 5px 10px rgb(0 0 0 / 10%);
  210. }
  211. .sticky{
  212. position: sticky;
  213. top:0px;
  214. /* background: #fff; */
  215. z-index: 9999;
  216. }
  217. .dot{
  218. background:#fff;height:10px;width:10px;border-radius:100%;border:2px solid #3874F6;
  219. }
  220. .normal-panel{
  221. border-radius: 5px;
  222. }
  223. .avatar__image{
  224. height: 100%;
  225. width: 100%;
  226. }
  227. .avatar:hover .avatar__model{
  228. display: block;
  229. }
  230. .avatar{
  231. position: relative;
  232. height:40px;
  233. width: 40px;
  234. margin-bottom: 5px;
  235. border-radius: 100%;
  236. text-align: center;
  237. line-height: 40px;
  238. color:#fff;
  239. font-weight: 500;
  240. background: #3874F6;
  241. cursor: pointer;
  242. overflow: hidden;
  243. }
  244. .scroll{
  245. height: 410px;
  246. overflow: auto;
  247. }
  248. .scroll::-webkit-scrollbar-thumb { /*滚动条滑块*/
  249. border-radius: 10px;
  250. background-color: #CACACA;
  251. }
  252. .flex-wrap{
  253. flex-wrap: wrap
  254. };
  255. </style>