followUp.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="normal-panel follow__panel normal-margin">
  3. <div class="container flex-align-center flex-between">
  4. <p>跟进动态</p>
  5. <addLog :ownertable="ownertable" @onSuccess="queryLogs"></addLog>
  6. </div>
  7. <div class="container">
  8. <div v-if="logList.length === 0">
  9. <el-empty description="暂无记录"></el-empty>
  10. </div>
  11. <div>
  12. <el-timeline>
  13. <el-timeline-item
  14. v-for="i in logList" :key="i.index"
  15. :timestamp="i.createdate">
  16. <div slot="dot" class="dot"></div>
  17. <div class="step__panel normal-margin">
  18. <div class="flex-align-stretch flex-between normal-margin">
  19. <p><small>跟进人:</small>{{i.changeby}}</p>
  20. <small style="color:#999">{{i.createdate}}</small>
  21. </div>
  22. <div class="follow-progress">
  23. <p style="margin-bottom:5px;font-size:14px">{{i.content}}</p>
  24. <div class="flex-align-center" style="margin-bottom:5px">
  25. <previewImage v-show="checkFileType(img.postfix) === 'img'" style="width:80px;height:80px;margin-left:5px" v-for="img in i.attinfos" :key="img.index" :image="img" :deletebtn="true" @onSuccess="queryLogs"></previewImage>
  26. </div>
  27. <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">
  28. <a class="file__link" :href="file.url">{{file.document}}</a>
  29. <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
  30. </div>
  31. <div style="text-align:right">
  32. <upload class="inline-16" slot="upload"
  33. :folderid="folderid"
  34. btntype="icon"
  35. :bindData="{ ownertable: 'sys_datafollowup', ownerid: i.sys_datafollowupid,usetype: 'default' }"
  36. @onSuccess="queryLogs">
  37. </upload>
  38. <el-button size="small" type="text" @click="deleteLogs(i)">删 除</el-button>
  39. </div>
  40. </div>
  41. </div>
  42. </el-timeline-item>
  43. </el-timeline>
  44. </div>
  45. </div>
  46. </div>
  47. </template>
  48. <script>
  49. import upload from '@/components/upload/hw_obs_upload.vue'
  50. import previewImage from '@/components/previewImage/index.vue'
  51. import addLog from './addLog.vue'
  52. export default {
  53. props:['ownertable'],
  54. components:{
  55. addLog,
  56. upload,
  57. previewImage
  58. },
  59. data () {
  60. return {
  61. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  62. logList:[]
  63. }
  64. },
  65. methods:{
  66. async queryLogs() {
  67. const res = await this.$api.requested({
  68. "id": 20220930121501,
  69. "content": {
  70. "ownertable":this.ownertable,
  71. "ownerid":this.$route.query.id
  72. }
  73. })
  74. this.logList = res.data
  75. },
  76. async deleteLogs (val) {
  77. const res = await this.$api.requested({
  78. "id": 20220930121701,
  79. "content": {
  80. "sys_datafollowupid":val.sys_datafollowupid
  81. }
  82. })
  83. this.tool.showMessage(res,()=>{
  84. this.queryLogs()
  85. })
  86. },
  87. checkFileType (type) {
  88. let arr = ['JPG','JPEG','PNG']
  89. if (arr.includes(type.toUpperCase())) {
  90. return 'img'
  91. } else {
  92. return 'file'
  93. }
  94. },
  95. async deleteFile (row) {
  96. const res = await this.$api.requested({
  97. "classname": "system.attachment.Attachment",
  98. "method": "deleteFileLink",
  99. "content": {
  100. "linksids":[row.linksid]
  101. }
  102. })
  103. this.tool.showMessage(res,()=>{
  104. this.queryLogs()
  105. })
  106. }
  107. },
  108. mounted () {
  109. this.queryLogs()
  110. },
  111. watch: {
  112. $route () {
  113. this.queryLogs()
  114. }
  115. }
  116. }
  117. </script>
  118. <style>
  119. .el-step__description{
  120. padding-right:0px !important;
  121. }
  122. </style>
  123. <style scoped>
  124. .step__panel{
  125. background-color: #eff4ff;
  126. padding: 16px;
  127. border-radius: 5px;
  128. color:#666
  129. }
  130. .follow-progress{
  131. }
  132. .file__link{
  133. color:#999;
  134. font-size: 12px;
  135. padding: 0 5px;
  136. display:block;
  137. width: 100%;
  138. white-space: nowrap;
  139. overflow: hidden;
  140. text-overflow: ellipsis;
  141. }
  142. .pionter{
  143. cursor: pointer;
  144. }
  145. .sticky{
  146. position: sticky;
  147. top:0px;
  148. /* background: #fff; */
  149. z-index: 9999;
  150. }
  151. .dot{
  152. background:#fff;height:10px;width:10px;border-radius:100%;border:2px solid #3874F6;
  153. }
  154. </style>