followUpCopy.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. <template>
  2. <div class="normal-panel follow__panel" id="containerFull">
  3. <div class="container flex-align-center flex-between">
  4. <div>
  5. <slot name="collapse"></slot>
  6. <p class="inline-16">{{$t(`跟进动态`)}}</p>
  7. </div>
  8. <div style="display: flex;justify-content: space-between">
  9. <fullScreen class="inline-16" domId="containerFull" @onFull="onFull" @backFull="backFull"></fullScreen>
  10. <addLog :ownertable="ownertable" @onSuccess="queryLogs" :status="status"></addLog>
  11. </div>
  12. </div>
  13. <div class="container" >
  14. <div v-if="logList.length === 0">
  15. <el-empty description="暂无记录" :image-size="40"></el-empty>
  16. </div>
  17. <div :style="{overflow: isFull?'auto':'none',height:isFull?(windowHeight - 100) + 'px':''}">
  18. <el-timeline>
  19. <el-timeline-item
  20. v-for="i in logList" :key="i.index"
  21. :timestamp="i.createdate">
  22. <div slot="dot" class="dot"></div>
  23. <div class="step__panel normal-margin">
  24. <div class="flex-align-center " style="margin-bottom:10px" v-if="i.userextend.length > 0">
  25. <!-- <p><small>跟进人:</small>{{i.changeby}}</p> -->
  26. <!-- <img height="30" width="30" :src="i.headpic" alt="">-->
  27. <div class="avatar" >
  28. <img class="avatar__image" v-if="i.headpic" :src="i.headpic" alt="">
  29. <p v-else>{{i.userextend[0].name.substr(0, 1)}}</p>
  30. </div>
  31. <div style="margin-left: 10px">
  32. <p>{{ i.userextend[0].name }}&nbsp;</p>
  33. <small style="color:#999999ad;margin-top:10px">{{$t(`部门`)}}:{{ i.userextend[0].depname?i.userextend[0].depname:"--" }}&emsp;{{$t(`职位`)}}:{{ i.userextend[0].position?i.userextend[0].position:"--" }}</small>
  34. </div>
  35. <!-- <div style="margin-left: 20px">
  36. <small style="color:#999">{{i.createdate}}</small>
  37. </div>-->
  38. </div>
  39. <div class="flex-align-center " style="margin-bottom:10px" v-else>
  40. <!-- <p><small>跟进人:</small>{{i.changeby}}</p> -->
  41. <!-- <img height="30" width="30" :src="i.headpic" alt="">-->
  42. <div class="avatar" >
  43. <img class="avatar__image" v-if="i.headpic" :src="i.headpic" alt="">
  44. <p v-else>{{i.createby.substr(0, 1)}}</p>
  45. </div>
  46. <div style="margin-left: 10px">
  47. <p>{{ i.createby }}&nbsp;</p>
  48. <small style="color:#999999ad;margin-top:10px">{{$t(`部门`)}}:{{"--" }}&emsp;{{$t(`职位`)}}:{{ "--" }}</small>
  49. </div>
  50. <!-- <div style="margin-left: 20px">
  51. <small style="color:#999">{{i.createdate}}</small>
  52. </div>-->
  53. </div>
  54. <!-- <div >
  55. <span>{{i.userextend[0].name}}</span>
  56. <span>
  57. <small>{{$t('部门')}}:{{i.userextend[0].depname}}</small>
  58. <small>职位:{{i.userextend[0].position}}</small>
  59. </span>
  60. </div>-->
  61. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  62. <span>{{$t(`跟进类型`)}}:{{i.type}}</span>
  63. </div>
  64. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  65. <span>{{$t(`跟进对象`)}}:</span>
  66. <span v-for="item in i.contacts" :key="item.index">
  67. <span v-if="item.rowindex === i.contacts.length">
  68. {{item.name}}
  69. </span>
  70. <span v-else>
  71. {{item.name + ','}}
  72. </span>
  73. </span>
  74. </div>
  75. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  76. <span>{{$t(`目的`)}}:{{i.target}}</span>
  77. </div>
  78. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  79. <span>{{$t(`过程`)}}:{{i.content}}</span>
  80. </div>
  81. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  82. <span>{{$t(`结果`)}}:{{i.results}}</span>
  83. </div>
  84. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  85. <span>{{$t(`下次跟进计划`)}}:{{i.nextplan}}</span>
  86. </div>
  87. <div v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'">
  88. <span>{{$t(`营销费用`)}}:</span>
  89. <span v-if="i.salesfeesamount || i.salesfeesamount == 0">
  90. <span style="color: red">¥ </span>
  91. <span style="font-size: 12px;color: red">{{tool.formatAmount(i.salesfeesamount,2)}}</span>
  92. </span>
  93. <span v-else>--</span>
  94. </div>
  95. <div v-if="$route.path === '/projectChangeDetail'">
  96. <marketingExpenses class="inline-16" ownertable="sa_project" :ownerid="i.sys_datafollowupid" :dataTime="i.createdate" :userid="i.createuserid" @onSuccess="onSuccess"></marketingExpenses>
  97. </div>
  98. <div v-if="$route.path === '/customerDetail'">
  99. <marketingExpenses class="inline-16" ownertable="sa_customers" :ownerid="i.sys_datafollowupid" :dataTime="i.createdate" :userid="i.createuserid" @onSuccess="onSuccess"></marketingExpenses>
  100. </div>
  101. <div v-if="$route.path === '/PublicCustomerDetail'">
  102. <marketingExpenses class="inline-16" ownertable="sa_customers" :ownerid="i.sys_datafollowupid" :dataTime="i.createdate" :userid="i.createuserid" @onSuccess="onSuccess"></marketingExpenses>
  103. </div>
  104. <div class="follow-progress">
  105. <p v-if="$route.path !== '/projectChangeDetail' && $route.path !== '/customerDetail' && $route.path !== '/PublicCustomerDetail'">{{i.content}}</p>
  106. <div>
  107. <!-- <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> -->
  108. <div class="flex-align-center flex-between pionter" v-for="img in i.attinfos" :key="img.index" style="padding:10px;margin-bottom:5px">
  109. <div class="flex-align-center" style="flex:1;width:100%">
  110. <img width="30" :src="checkFileType(img.postfix) === 'file'?require('@/assets/file_icons/file.svg'):img.url" class="inline-16" alt="">
  111. <div class="file__link">
  112. <a :href="img.url">{{img.document}}</a>
  113. <p>{{(img.contentlength / 1024).toFixed(2)}}kb</p>
  114. </div>
  115. </div>
  116. <i style="color:red;" class="el-icon-delete" v-if="nowUserid === i.createuserid" @click="deleteFile(img)"></i>
  117. </div>
  118. </div>
  119. <!-- <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">
  120. <a class="file__link" :href="file.url">{{file.document}}</a>
  121. <i style="color:red;" class="el-icon-delete" @click="deleteFile(file)"></i>
  122. </div> -->
  123. <div style="text-align:right" v-if="nowUserid === i.createuserid">
  124. <upload class="inline-16" slot="upload"
  125. :folderid="folderid"
  126. :status="status"
  127. btntype="icon"
  128. :bindData="{ ownertable: 'sys_datafollowup', ownerid: i.sys_datafollowupid,usetype: 'default' }"
  129. @onSuccess="queryLogs">
  130. </upload>
  131. <editLog :status="status" ref="edits" :data="i" :ownertable="ownertable" @onSuccess="queryLogs"></editLog>
  132. <el-popconfirm
  133. :confirm-button-text="$t('确定')" :cancel-button-text="$t('取消')"
  134. :title="$t('确定删除该跟进动态吗')+'?'"
  135. @confirm="deleteLogs(i)"
  136. >
  137. <el-button slot="reference" icon="el-icon-delete" size="mini" type="text" :disabled="status === '已结案' || status === '已失败'">{{$t(`删 除`)}}</el-button>
  138. </el-popconfirm>
  139. </div>
  140. </div>
  141. </div>
  142. </el-timeline-item>
  143. </el-timeline>
  144. </div>
  145. </div>
  146. </div>
  147. </template>
  148. <script>
  149. import upload from '@/components/upload/hw_obs_upload.vue'
  150. import previewImage from '@/components/previewImage/index.vue'
  151. import fullScreen from "@/views/salesData/components/fullScreen";
  152. import addLog from './addLog.vue'
  153. import editLog from './editLog.vue'
  154. import marketingExpenses from '@/components/marketingExpenses/index'
  155. export default {
  156. props:['ownertable','status'],
  157. components:{
  158. addLog,
  159. editLog,
  160. upload,
  161. previewImage,
  162. fullScreen,
  163. marketingExpenses
  164. },
  165. data () {
  166. return {
  167. folderid:JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
  168. logList:[],
  169. nowUserid:'',
  170. ownertableNew:'',
  171. owneridNew:'',
  172. isFull:false,
  173. windowHeight: window.innerHeight, //实时屏幕高度
  174. }
  175. },
  176. methods:{
  177. async queryLogs() {
  178. const res = await this.$api.requested({
  179. "id": 20220930121501,
  180. "content": {
  181. "ownertable":this.ownertable,
  182. "ownerid":this.$route.query.id
  183. }
  184. })
  185. this.logList = res.data
  186. console.log(this.logList,'跟进数据')
  187. console.log(this.logList.length,'数据')
  188. },
  189. async queryLogsNew(ownertable,ownerid) {
  190. this.owneridNew = ownerid
  191. this.ownertableNew = ownertable
  192. const res = await this.$api.requested({
  193. "id": 20220930121501,
  194. "content": {
  195. "ownertable":this.ownertableNew,
  196. "ownerid":this.owneridNew
  197. }
  198. })
  199. this.logList = res.data
  200. console.log(this.logList,'跟进数据')
  201. console.log(this.logList.length,'数据')
  202. },
  203. async deleteLogs (val) {
  204. const res = await this.$api.requested({
  205. "id": 20220930121701,
  206. "content": {
  207. "sys_datafollowupid":val.sys_datafollowupid
  208. }
  209. })
  210. this.tool.showMessage(res,()=>{
  211. this.queryLogs()
  212. })
  213. },
  214. checkFileType (type) {
  215. let arr = ['JPG','JPEG','PNG']
  216. if (arr.includes(type.toUpperCase())) {
  217. return 'img'
  218. } else {
  219. return 'file'
  220. }
  221. },
  222. async deleteFile (row) {
  223. const res = await this.$api.requested({
  224. "classname": "system.attachment.Attachment",
  225. "method": "deleteFileLink",
  226. "content": {
  227. "linksids":[row.linksid]
  228. }
  229. })
  230. this.tool.showMessage(res,()=>{
  231. this.queryLogs()
  232. })
  233. },
  234. /*全屏*/
  235. onFull(){
  236. this.heightChart = this.windowWidth > 1128 ? 'calc(100vh - 85px)':'calc(100vh - 115px)'
  237. this.isFull = true
  238. },
  239. /*退出全屏*/
  240. backFull(val){
  241. this.heightChart = '100%'
  242. this.isFull = false
  243. this.$emit('backFull',val)
  244. },
  245. onSuccess(){
  246. this.queryLogs()
  247. this.$emit('logSuccess')
  248. }
  249. },
  250. mounted () {
  251. this.queryLogs()
  252. console.log(this.windowHeight,'windowHeight高度')
  253. this.nowUserid = JSON.parse(sessionStorage.getItem('active_account')).userid
  254. var that = this;
  255. // <!--把window.onresize事件挂在到mounted函数上-->
  256. window.onresize = () => {
  257. return (() => {
  258. window.fullHeight = document.documentElement.clientHeight;
  259. that.windowHeight = window.fullHeight; // 高
  260. })()
  261. };
  262. },
  263. watch: {
  264. $route () {
  265. this.queryLogs()
  266. },
  267. windowHeight (val) {
  268. console.log("实时屏幕高度:",val );
  269. console.log(this.windowHeight)
  270. }
  271. }
  272. }
  273. </script>
  274. <style>
  275. .el-step__description{
  276. padding-right:0px !important;
  277. }
  278. </style>
  279. <style scoped>
  280. .step__panel{
  281. background-color: #eff4ff;
  282. padding: 10px;
  283. border-radius: 5px;
  284. color:#666
  285. }
  286. .follow-progress p{
  287. width:100%;
  288. margin-bottom:5px;
  289. font-size:14px;
  290. word-wrap: break-word;
  291. }
  292. .file__link{
  293. color:#999;
  294. font-size: 12px;
  295. padding: 0 5px;
  296. display:block;
  297. width: 100%;
  298. white-space: nowrap;
  299. overflow: hidden;
  300. text-overflow: ellipsis;
  301. }
  302. .pionter{
  303. margin:6px 0;
  304. padding: 10px;
  305. transition: .2s linear;
  306. cursor: pointer;
  307. border-radius: 5px;
  308. background: #ffff;
  309. }
  310. .pionter:hover{
  311. box-shadow: 0 5px 10px rgb(0 0 0 / 10%);
  312. }
  313. .sticky{
  314. position: sticky;
  315. top:0px;
  316. /* background: #fff; */
  317. z-index: 9999;
  318. }
  319. .dot{
  320. background:#fff;height:10px;width:10px;border-radius:100%;border:2px solid #3874F6;
  321. }
  322. .normal-panel{
  323. border-radius: 5px;
  324. }
  325. .avatar__image{
  326. height: 100%;
  327. width: 100%;
  328. }
  329. .avatar:hover .avatar__model{
  330. display: block;
  331. }
  332. .avatar{
  333. position: relative;
  334. height:40px;
  335. width: 40px;
  336. margin-bottom: 5px;
  337. border-radius: 100%;
  338. text-align: center;
  339. line-height: 40px;
  340. color:#fff;
  341. font-weight: 500;
  342. background: #3874F6;
  343. cursor: pointer;
  344. overflow: hidden;
  345. }
  346. .scroll{
  347. height: 410px;
  348. overflow: auto;
  349. }
  350. .scroll::-webkit-scrollbar-thumb { /*滚动条滑块*/
  351. border-radius: 10px;
  352. background-color: #CACACA;
  353. }
  354. .flex-wrap{
  355. flex-wrap: wrap
  356. };
  357. </style>