index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <div>
  3. <el-input style="width:200px;" :placeholder="$t('搜索')" :suffix-icon="param.content.where.condition?param.content.where.condition.length > 0?'':'':'el-icon-search'" v-model="param.content.where.condition" @keyup.native.enter="listData(param.content.pageNumber = 1)" @clear="clearSearchValue" size="small" class="input-with-select inline-16 layout_search__panel mt-10" clearable>
  4. </el-input>
  5. <el-table
  6. ref="table"
  7. :row-class-name="tableClassName"
  8. :data="tableData"
  9. highlight-current-row
  10. size="mini"
  11. :header-cell-style="{height:'40px',color:'#606266',fontWeight:'400',fontSize:'14px'}"
  12. :cell-style="{height:'40px',color:'#666666',fontWeight:'400'}"
  13. border
  14. >
  15. <el-table-column
  16. prop="createby"
  17. label="跟进人"
  18. min-width="69">
  19. </el-table-column>
  20. <el-table-column
  21. prop="createdate"
  22. label="跟进时间"
  23. min-width="139">
  24. </el-table-column>
  25. <el-table-column
  26. v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'"
  27. prop="type"
  28. label="跟进类型"
  29. min-width="80">
  30. </el-table-column>
  31. <el-table-column
  32. prop="contacts"
  33. v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'"
  34. label="跟进对象"
  35. min-width="117">
  36. <template slot-scope="scope">
  37. <div v-for="item in scope.row.contacts" :key="item.index">
  38. <span v-if="item.rowindex === scope.row.contacts.length" class="span-style">
  39. {{item.name}}
  40. </span>
  41. <span v-else class="span-style">
  42. {{item.name + ','}}
  43. </span>
  44. </div>
  45. </template>
  46. </el-table-column>
  47. <el-table-column
  48. prop="content"
  49. label="跟进内容"
  50. min-width="500"
  51. >
  52. <template slot-scope="scope">
  53. <div v-if="($route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail')">
  54. <div>{{$t(`目的:`)}}{{scope.row.target}}</div>
  55. <div>{{$t(`过程:`)}}{{scope.row.content}}</div>
  56. <div>{{$t(`结果:`)}}{{scope.row.results}}</div>
  57. <div>{{$t(`下次跟进计划:`)}}{{scope.row.nextplan}}</div>
  58. </div>
  59. <div v-else>{{scope.row.content}}</div>
  60. </template>
  61. </el-table-column>
  62. <el-table-column
  63. prop="attcount"
  64. label="附件数"
  65. min-width="69">
  66. <template slot-scope="scope">
  67. <el-button type="text" size="small" @click="showFiles(scope.row)">{{scope.row.attcount}}</el-button>
  68. </template>
  69. </el-table-column>
  70. <el-table-column
  71. v-if="$route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail'"
  72. prop="salesfeesamount"
  73. label="营销费用"
  74. min-width="80">
  75. <template slot-scope="scope">
  76. {{scope.row.salesfeesamount?tool.formatAmount(scope.row.salesfeesamount,2,'¥'):'¥0.00'}}
  77. </template>
  78. </el-table-column>
  79. <el-table-column
  80. label="操作"
  81. min-width="220">
  82. <template slot-scope="scope">
  83. <el-button type="text" size="small" @click="showReview(scope.row)" class="inline-16">{{$t(`评论`)}}({{scope.row.commentqty}})</el-button>
  84. <editLog v-if="userid === scope.row.createuserid && !disabled" ref="edits" :data="scope.row" :ownertable="ownertable" @onSuccess="onSuccess" :isOperation="true"></editLog>
  85. <el-button type="text" size="small" class="inline-16" @click="onDelFollow(scope.row)" v-if="userid === scope.row.createuserid && !disabled">{{$t(`删除`)}}</el-button>
  86. <marketingExpenses v-if="($route.path === '/projectChangeDetail' || $route.path === '/customerDetail' || $route.path === '/PublicCustomerDetail') && !disabled"
  87. class="inline-16" ownertable="sa_customers" :ownerid="scope.row.sys_datafollowupid" :dataTime="scope.row.createdate" :userid="scope.row.createuserid" :isOperation="true"
  88. @onSuccess="listData"></marketingExpenses>
  89. </template>
  90. </el-table-column>
  91. </el-table>
  92. <div class="container normal-panel" style="text-align:right">
  93. <el-pagination
  94. background
  95. @size-change="handleSizeChange"
  96. @current-change="handleCurrentChange"
  97. :current-page="currentPage"
  98. :page-sizes="[20, 50, 100, 200]"
  99. :page-size="100"
  100. layout="total,sizes, prev, pager, next, jumper"
  101. :total="total">
  102. </el-pagination>
  103. </div>
  104. <normalDialog ref="normalDialogFile" title="附件" >
  105. <template slot="content">
  106. <attachmentList style="margin-top: -10px;margin-bottom: 10px" :attinfos="attinfo_attachment" :onlyread="true" minWidth="80">
  107. </attachmentList>
  108. </template>
  109. </normalDialog>
  110. <normalDialog ref="normalDialogReview" title="评论" @closeDialog="closeDialog">
  111. <template slot="content">
  112. <div style="padding: 10px">
  113. <div style="border: 1px solid #9ca3af;padding: 10px;border-radius: 5px">
  114. <el-input type="textarea" style="border: none;margin-bottom: 10px" :rows="1" v-model="content" :placeholder="$t(`我评论`)+':'"></el-input>
  115. <el-divider></el-divider>
  116. <div style="display: flex;justify-content: right">
  117. <el-button type="primary" size="small" :disabled="content.length == 0" @click="onComment">{{$t(`发布`)}}</el-button>
  118. </div>
  119. </div>
  120. </div>
  121. <div style="padding: 0 10px 10px 10px">
  122. <div style="max-height: 360px;min-height:200px;background: #F5F5F5;border-radius: 2px;padding: 10px;overflow:auto">
  123. <div style="color: #333;font-size: 16px;font-weight: bold">{{$t(`评论`)}}({{commentqty}})</div>
  124. <div v-for="item in comment" :key="item.index" style="margin-top: 10px">
  125. <div style="color: #333;font-size: 14px;font-weight: bold;margin-top: 5px">{{item.createby}}</div>
  126. <div style="color:#666;font-size: 14px;margin-top: 5px">{{item.content}}</div>
  127. <div style="display: flex;justify-content: space-between;align-items: center;margin-top: -5px;margin-bottom: -5px">
  128. <div style="display: flex;justify-content: space-between;align-items: center">
  129. <div style="font-size: 12px;color: #999">{{item.createdate}}</div>
  130. <el-button type="text" size="small" class="margin-5" v-if="userid == item.createuserid"><svg style="vertical-align: middle" t="1727053625238" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11334" width="14" height="14"><path d="M343.113143 156.379429h333.897143v-73.142858H343.113143v73.142858zM677.010286 0a83.456 83.456 0 0 1 83.456 83.456v64.146286h215.917714a46.299429 46.299429 0 1 1 0 92.672h-48.64v700.196571a83.456 83.456 0 0 1-83.456 83.456H176.128a83.456 83.456 0 0 1-83.456-83.456V240.054857H47.542857a46.299429 46.299429 0 0 1 0-92.452571h212.114286v-64.146286A83.456 83.456 0 0 1 343.113143 0h333.897143z m156.525714 241.371429H186.587429v688.859428h647.021714v-689.005714zM384.877714 345.6a41.764571 41.764571 0 0 1 41.764572 41.764571v333.897143a41.764571 41.764571 0 0 1-83.456 0V387.364571a41.764571 41.764571 0 0 1 41.691428-41.764571z m250.441143 0a41.764571 41.764571 0 0 1 41.764572 41.764571v333.897143a41.764571 41.764571 0 0 1-83.456 0V387.364571a41.764571 41.764571 0 0 1 41.545142-41.764571z" fill="#999999" p-id="11335"></path></svg>
  131. <span style="color: #666666;font-size: 14px;margin-left: 5px;vertical-align: middle" @click="onDel(item)">{{$t(`删除`)}}</span></el-button>
  132. </div>
  133. <div>
  134. <el-button type="text" v-if="!isContentShow" size="small" @click="isContentShow = true;sys_datacommentid = item.sys_datacommentid">
  135. <svg t="1727055468269" class="icon" style="vertical-align: middle" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11646" width="14" height="14"><path d="M643.657143 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286 36.571429 0 58.514286-29.257143 58.514285-58.514286 0-36.571429-29.257143-58.514286-58.514285-58.514286-29.257143-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11647"></path><path d="M1024 142.774857c0-43.885714-43.885714-87.771429-87.771429-87.771428H87.771429c-43.885714 0-87.771429 36.571429-87.771429 87.771428v621.714286c0 51.2 43.885714 87.771429 87.771429 87.771428h307.2l117.028571 117.028572 117.028571-117.028572h307.2c51.2 0 87.771429-43.885714 87.771429-87.771428v-621.714286z m-65.828571 592.457143c0 29.257143-21.942857 51.2-51.2 51.2H592.457143l-80.457143 80.457143-80.457143-80.457143H117.028571c-29.257143 0-51.2-21.942857-51.2-51.2v-563.2c0-29.257143 21.942857-51.2 51.2-51.2h789.942858c29.257143 0 51.2 21.942857 51.2 51.2v563.2z" fill="#3874F6" p-id="11648"></path><path d="M453.485714 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514286-58.514286c0-36.571429-21.942857-65.828571-58.514286-65.828572s-58.514286 29.257143-58.514286 65.828572M256 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514285-58.514286c0-36.571429-29.257143-58.514286-58.514285-58.514286-36.571429-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11649"></path></svg>
  136. <span style="color: #3874F6;font-size: 14px;margin-left: 5px;vertical-align: middle">{{$t(`回复`)}}</span></el-button>
  137. <el-button type="text" v-if="isContentShow " size="small" @click="isContentShow = false;sys_datacommentid = ''">
  138. <svg t="1727055468269" class="icon" viewBox="0 0 1024 1024" style="vertical-align: middle" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11646" width="14" height="14"><path d="M643.657143 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286 36.571429 0 58.514286-29.257143 58.514285-58.514286 0-36.571429-29.257143-58.514286-58.514285-58.514286-29.257143-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11647"></path><path d="M1024 142.774857c0-43.885714-43.885714-87.771429-87.771429-87.771428H87.771429c-43.885714 0-87.771429 36.571429-87.771429 87.771428v621.714286c0 51.2 43.885714 87.771429 87.771429 87.771428h307.2l117.028571 117.028572 117.028571-117.028572h307.2c51.2 0 87.771429-43.885714 87.771429-87.771428v-621.714286z m-65.828571 592.457143c0 29.257143-21.942857 51.2-51.2 51.2H592.457143l-80.457143 80.457143-80.457143-80.457143H117.028571c-29.257143 0-51.2-21.942857-51.2-51.2v-563.2c0-29.257143 21.942857-51.2 51.2-51.2h789.942858c29.257143 0 51.2 21.942857 51.2 51.2v563.2z" fill="#3874F6" p-id="11648"></path><path d="M453.485714 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514286-58.514286c0-36.571429-21.942857-65.828571-58.514286-65.828572s-58.514286 29.257143-58.514286 65.828572M256 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514285-58.514286c0-36.571429-29.257143-58.514286-58.514285-58.514286-36.571429-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11649"></path></svg>
  139. <span style="color: #3874F6;font-size: 14px;margin-left: 5px;vertical-align: middle">{{$t(`取消回复`)}}</span></el-button>
  140. </div>
  141. </div>
  142. <div style="border: 1px solid #9ca3af;padding: 10px;border-radius: 5px" v-if="isContentShow && sys_datacommentid == item.sys_datacommentid">
  143. <el-input type="textarea" style="border: none;margin-bottom: 10px" :rows="1" v-model="replyContent" :placeholder="$t('我回复')+item.createby+':'"></el-input>
  144. <el-divider></el-divider>
  145. <div style="display: flex;justify-content: right">
  146. <el-button type="primary" size="small" :disabled="replyContent.length == 0" @click="onReply(sys_datafollowupid,item)">{{$t(`发布`)}}</el-button>
  147. </div>
  148. </div>
  149. <div v-if="item.subcomment.length > 0" style="margin-left: 10px;margin-top: 10px">
  150. <div v-for="k in item.subcomment" :key="k.index" style="margin-top: 10px">
  151. <div style="display: flex;justify-content: left;align-items: center">
  152. <div style="font-size: 14px;font-weight: bold;color:#333;">{{k.createby}}</div><i style="margin: 0 10px 0 10px" class="el-icon-caret-right"></i><div style="font-size: 14px;font-weight: bold;color:#333;">{{k.replyusername}}</div>
  153. </div>
  154. <div style="color:#666;font-size: 14px;margin-top: 5px">{{k.content}}</div>
  155. <div style="display: flex;justify-content: space-between;align-items: center;margin-top: -5px;margin-bottom: -5px">
  156. <div style="display: flex;justify-content: space-between;align-items: center">
  157. <div style="font-size: 12px;color:#999;margin-right: 10px">{{k.createdate}}</div>
  158. <el-button type="text" size="small" v-if="userid == k.createuserid"><svg style="vertical-align: middle" t="1727053625238" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11334" width="14" height="14"><path d="M343.113143 156.379429h333.897143v-73.142858H343.113143v73.142858zM677.010286 0a83.456 83.456 0 0 1 83.456 83.456v64.146286h215.917714a46.299429 46.299429 0 1 1 0 92.672h-48.64v700.196571a83.456 83.456 0 0 1-83.456 83.456H176.128a83.456 83.456 0 0 1-83.456-83.456V240.054857H47.542857a46.299429 46.299429 0 0 1 0-92.452571h212.114286v-64.146286A83.456 83.456 0 0 1 343.113143 0h333.897143z m156.525714 241.371429H186.587429v688.859428h647.021714v-689.005714zM384.877714 345.6a41.764571 41.764571 0 0 1 41.764572 41.764571v333.897143a41.764571 41.764571 0 0 1-83.456 0V387.364571a41.764571 41.764571 0 0 1 41.691428-41.764571z m250.441143 0a41.764571 41.764571 0 0 1 41.764572 41.764571v333.897143a41.764571 41.764571 0 0 1-83.456 0V387.364571a41.764571 41.764571 0 0 1 41.545142-41.764571z" fill="#999999" p-id="11335"></path></svg>
  159. <span style="color: #666666;font-size: 14px;margin-left: 5px;vertical-align: middle" @click="onDel(k)">{{$t(`删除`)}}</span></el-button>
  160. </div>
  161. <div>
  162. <el-button type="text" v-if="!isContentShow " size="small" @click="isContentShow = true;sys_datacommentid = k.sys_datacommentid">
  163. <svg t="1727055468269" class="icon" style="vertical-align: middle" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11646" width="14" height="14"><path d="M643.657143 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286 36.571429 0 58.514286-29.257143 58.514285-58.514286 0-36.571429-29.257143-58.514286-58.514285-58.514286-29.257143-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11647"></path><path d="M1024 142.774857c0-43.885714-43.885714-87.771429-87.771429-87.771428H87.771429c-43.885714 0-87.771429 36.571429-87.771429 87.771428v621.714286c0 51.2 43.885714 87.771429 87.771429 87.771428h307.2l117.028571 117.028572 117.028571-117.028572h307.2c51.2 0 87.771429-43.885714 87.771429-87.771428v-621.714286z m-65.828571 592.457143c0 29.257143-21.942857 51.2-51.2 51.2H592.457143l-80.457143 80.457143-80.457143-80.457143H117.028571c-29.257143 0-51.2-21.942857-51.2-51.2v-563.2c0-29.257143 21.942857-51.2 51.2-51.2h789.942858c29.257143 0 51.2 21.942857 51.2 51.2v563.2z" fill="#3874F6" p-id="11648"></path><path d="M453.485714 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514286-58.514286c0-36.571429-21.942857-65.828571-58.514286-65.828572s-58.514286 29.257143-58.514286 65.828572M256 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514285-58.514286c0-36.571429-29.257143-58.514286-58.514285-58.514286-36.571429-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11649"></path></svg>
  164. <span style="color: #3874F6;font-size: 14px;margin-left: 5px;vertical-align: middle">{{$t(`回复`)}}</span></el-button>
  165. <el-button type="text" v-if="isContentShow " size="small" @click="isContentShow = false;sys_datacommentid = ''">
  166. <svg t="1727055468269" style="vertical-align: middle" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11646" width="14" height="14"><path d="M643.657143 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286 36.571429 0 58.514286-29.257143 58.514285-58.514286 0-36.571429-29.257143-58.514286-58.514285-58.514286-29.257143-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11647"></path><path d="M1024 142.774857c0-43.885714-43.885714-87.771429-87.771429-87.771428H87.771429c-43.885714 0-87.771429 36.571429-87.771429 87.771428v621.714286c0 51.2 43.885714 87.771429 87.771429 87.771428h307.2l117.028571 117.028572 117.028571-117.028572h307.2c51.2 0 87.771429-43.885714 87.771429-87.771428v-621.714286z m-65.828571 592.457143c0 29.257143-21.942857 51.2-51.2 51.2H592.457143l-80.457143 80.457143-80.457143-80.457143H117.028571c-29.257143 0-51.2-21.942857-51.2-51.2v-563.2c0-29.257143 21.942857-51.2 51.2-51.2h789.942858c29.257143 0 51.2 21.942857 51.2 51.2v563.2z" fill="#3874F6" p-id="11648"></path><path d="M453.485714 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514286-58.514286c0-36.571429-21.942857-65.828571-58.514286-65.828572s-58.514286 29.257143-58.514286 65.828572M256 457.289143c0 36.571429 29.257143 58.514286 58.514286 58.514286s58.514286-29.257143 58.514285-58.514286c0-36.571429-29.257143-58.514286-58.514285-58.514286-36.571429-7.314286-58.514286 21.942857-58.514286 58.514286" fill="#3874F6" p-id="11649"></path></svg>
  167. <span style="color: #3874F6;font-size: 14px;margin-left: 5px;vertical-align: middle">{{$t(`取消回复`)}}</span></el-button>
  168. </div>
  169. </div>
  170. <div style="border: 1px solid #9ca3af;padding: 10px;border-radius: 5px" v-if="isContentShow && sys_datacommentid == k.sys_datacommentid">
  171. <el-input type="textarea" style="border: none;margin-bottom: 10px" :rows="1" v-model="replyContent" :placeholder="$t('我回复')+k.createby+':'"></el-input>
  172. <el-divider></el-divider>
  173. <div style="display: flex;justify-content: right">
  174. <el-button type="primary" size="small" :disabled="replyContent.length == 0" @click="onReply(sys_datafollowupid,k)">{{$t(`发布`)}}</el-button>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. </div>
  182. </template>
  183. </normalDialog>
  184. </div>
  185. </template>
  186. <script>
  187. import marketingExpenses from '@/components/marketingExpenses/index'
  188. import normalDialog from '@/template/dialogTemplate/normal'
  189. import attachmentList from '@/components/attachment_list/index.vue'
  190. import editLog from '../followUp/editLog'
  191. export default {
  192. name: "index",
  193. props:['ownertable','disabled'],
  194. components:{marketingExpenses,normalDialog,attachmentList,editLog},
  195. data() {
  196. return {
  197. tableData:[],
  198. currentPage:0,
  199. total:0,
  200. attinfo_attachment:[],
  201. content:'',
  202. comment:[],
  203. commentqty:0,
  204. userid:JSON.parse(sessionStorage.getItem('active_account')).userid,
  205. isContentShow:false,
  206. sys_datacommentid:'',
  207. replyContent:'',
  208. sys_datafollowupid:'',
  209. param:{
  210. "id": 20220930121501,
  211. "content": {
  212. "ownertable":'',
  213. "ownerid":'',
  214. "pageNumber": 1,
  215. "pageSize": 50,
  216. "where":{
  217. "condition":''
  218. }
  219. }
  220. }
  221. }
  222. },
  223. methods:{
  224. async listData(type,id){
  225. this.param.content.ownerid = this.$route.query.id
  226. this.param.content.ownertable = this.ownertable
  227. const res = await this.$api.requested(this.param)
  228. this.tableData = res.data
  229. this.total = res.total
  230. this.currentPage = res.pageNumber
  231. if (type){
  232. this.tableData.forEach(item=>{
  233. if (item.sys_datafollowupid == id){
  234. this.comment = item.comment
  235. this.commentqty = item.commentqty
  236. }
  237. })
  238. }
  239. },
  240. handleSizeChange(val) {
  241. // console.log(`每页 ${val} 条`);
  242. this.param.content.pageSize = val
  243. this.listData()
  244. },
  245. handleCurrentChange(val) {
  246. // console.log(`当前页: ${val}`);
  247. this.param.content.pageNumber = val
  248. this.listData()
  249. },
  250. tableClassName({ row, rowIndex }) {
  251. row.index = rowIndex;
  252. },
  253. clearSearchValue () {
  254. this.$store.dispatch('clearSearchValue')
  255. this.listData(this.param.content.pageNumber = 1)
  256. },
  257. showFiles(data){
  258. this.$refs.normalDialogFile.dialogVisible = true
  259. this.attinfo_attachment = data.attinfos
  260. },
  261. showReview(data){
  262. this.$refs.normalDialogReview.dialogVisible = true
  263. this.comment = data.comment
  264. this.commentqty = data.commentqty
  265. this.sys_datafollowupid = data.sys_datafollowupid
  266. },
  267. onDel(data){
  268. console.log(data,'删除')
  269. this.$confirm(this.$t('确定删除该评论吗')+'?', this.$t('提示'), {
  270. confirmButtonText: this.$t('确定'),
  271. cancelButtonText: this.$t('取消'),
  272. type: 'warning'
  273. }).then(async() => {
  274. const res = await this.$api.requested({
  275. "id": 20240429161701,
  276. "content": {
  277. "sys_datacommentid":data.sys_datacommentid
  278. }
  279. })
  280. this.tool.showMessage(res,()=>{
  281. this.listData('删除',this.sys_datafollowupid)
  282. this.$emit('newFollow')
  283. })
  284. }).catch(() => {
  285. this.$message({
  286. type: 'info',
  287. message: this.$t('已取消删除'),
  288. });
  289. });
  290. },
  291. async onReply(id,data){
  292. const res = await this.$api.requested({
  293. "id": 20240429161601,
  294. "content": {
  295. "ownertable":'sys_datafollowup',//数据表
  296. "ownerid":id,//数据id
  297. "content":this.replyContent,//内容
  298. "replyid":data.sys_datacommentid//被回复评论id
  299. }
  300. })
  301. this.tool.showMessage(res,()=>{
  302. this.replyContent = ''
  303. this.isContentShow = false
  304. this.sys_datacommentid = ''
  305. this.listData('回复',this.sys_datafollowupid)
  306. this.$emit('newFollow')
  307. })
  308. },
  309. async onComment(){
  310. const res = await this.$api.requested({
  311. "id": 20240429161601,
  312. "content": {
  313. "ownertable":'sys_datafollowup',//数据表
  314. "ownerid":this.sys_datafollowupid,//数据id
  315. "content":this.content,//内容
  316. "replyid":"0"//被回复评论id
  317. }
  318. })
  319. this.tool.showMessage(res,()=>{
  320. this.content = ''
  321. this.sys_datacommentid = ''
  322. this.listData('回复',this.sys_datafollowupid)
  323. this.$emit('newFollow')
  324. })
  325. },
  326. closeDialog(){
  327. this.content = ''
  328. this.replyContent = ''
  329. this.isContentShow = false
  330. },
  331. onSuccess(){
  332. this.listData()
  333. this.$emit('newFollow')
  334. },
  335. onDelFollow(val){
  336. this.$confirm(this.$t('确定删除该跟进动态吗?'), this.$t('提示'), {
  337. confirmButtonText: this.$t('确定'),
  338. cancelButtonText: this.$t('取消'),
  339. type: 'warning'
  340. }).then(async() => {
  341. const res = await this.$api.requested({
  342. "id": 20220930121701,
  343. "content": {
  344. "sys_datafollowupid":val.sys_datafollowupid
  345. }
  346. })
  347. this.tool.showMessage(res,()=>{
  348. this.listData()
  349. this.$emit('newFollow')
  350. })
  351. }).catch(() => {
  352. this.$message({
  353. type: 'info',
  354. message: '已取消删除'
  355. });
  356. });
  357. }
  358. },
  359. mounted() {
  360. this.listData()
  361. }
  362. }
  363. </script>
  364. <style scoped>
  365. .table-style{
  366. width: 100%;
  367. height: calc(100vh - 390px);
  368. }
  369. </style>