followUp.vue 7.4 KB

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