index.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <div>
  3. <basicDetails
  4. v-if="mainData"
  5. ref="details"
  6. :titleText="mainData.name"
  7. :oldFormPath="{
  8. edit:'SManagement/orderclue/components',
  9. }"
  10. :editData="mainData"
  11. :mainAreaData="mainAreaData"
  12. turnPageId="20221101094502"
  13. idname="sat_orderclueid"
  14. tags=""
  15. :tabs="['跟进记录','详细信息']"
  16. @pageChange="pageChange"
  17. @onEditSuccess="queryMainData($route.query.id)"
  18. @detailCreate="detailCreate">
  19. <div slot="customOperation">
  20. <follow :detailInfo="mainData"
  21. v-if="tool.checkAuth($route.name,'follow')"
  22. @updataList="queryMainData();$refs.followDetail.getFollowDetail()" @onSuccess="$refs.followDetail.getFollowDetail()" :disabled="!isHandle"></follow>
  23. <!-- <move :data="mainData"
  24. @updataList="queryMainData"
  25. :teamList="teamList()"
  26. v-if="userInfo.isAuth == 1 ? mainData.status == '待跟进' || mainData.status == '跟进中' : ''"></move> -->
  27. <changeData v-if="tool.checkAuth($route.name,'change')" :data="mainData" :disabled="!isHandle" class="inline-16"/>
  28. <noNull v-if="tool.checkAuth($route.name,'change')" class="inline-16" :disabled="!isHandle" @onSuccess="$store.dispatch('changeDetailDrawer',false);$router.replace('/orderclue')" :id="mainData.sat_orderclueid"/>
  29. <el-button v-if="tool.checkAuth($route.name,'goBack')" :disabled="!isHandle" class="inline-16" size="mini" @click="goBack">退 回</el-button>
  30. <Del v-if="tool.checkAuth($route.name,'delete')" class="inline-16" :disabled="!isHandle" :idName="20221123193702" @onSuccess="$store.dispatch('changeDetailDrawer',false);$router.replace('/orderclue')" :id="mainData.sat_orderclueid" idKey="sat_orderclueids"/>
  31. </div>
  32. <div slot="slot1" class="container normal-panel">
  33. <BaseInfo :detailInfo="detailInfo"/>
  34. </div>
  35. <div slot="slot0">
  36. <followDetail ref="followDetail"/>
  37. </div>
  38. </basicDetails>
  39. </div>
  40. </template>
  41. <script>
  42. import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo'
  43. import followDetail from '@/SManagement/orderclue_detail/components/followDetail'
  44. import follow from '@/SManagement/orderclue/components/follow'
  45. import move from '@/SManagement/orderclue/components/move'
  46. import Del from './components/delete'
  47. import noNull from './components/noNull'
  48. import changeData from './components/changeData'
  49. import { log } from '@antv/g2plot/lib/utils'
  50. export default {
  51. name: "detail",
  52. inject:['teamList'],
  53. data() {
  54. return {
  55. mainData:{},
  56. mainAreaData:{},
  57. detailInfo:{},
  58. userInfo:JSON.parse(window.sessionStorage.getItem('userInfo')),
  59. isHandle:''
  60. }
  61. },
  62. components:{
  63. BaseInfo,
  64. followDetail,
  65. follow,
  66. move,
  67. Del,
  68. noNull,
  69. changeData
  70. },
  71. watch: {
  72. mainData(val) {
  73. let is
  74. if(JSON.parse(window.sessionStorage.getItem('userInfo')).userid == this.mainData.leader[0].userid) {
  75. is = true
  76. if(this.mainData.status == '待跟进' || this.mainData.status == '跟进中') {
  77. is = true
  78. } else {
  79. is = false
  80. }
  81. } else {
  82. is = false
  83. }
  84. this.isHandle = is
  85. console.log(this.isHandle,'权限');
  86. }
  87. },
  88. methods:{
  89. detailCreate (param) {
  90. param.content.isAll = 0
  91. },
  92. async queryMainData(id) {
  93. const res = await this.$api.requested({
  94. "classname": "saletool.orderclue.web.orderclue",
  95. "method": "selectDetail",
  96. "content": {
  97. "sat_orderclueid": this.$route.query.id
  98. }
  99. })
  100. this.mainData = res.data
  101. console.log(this.mainData);
  102. this.changeDataStructure()
  103. },
  104. changeDataStructure() {
  105. this.mainAreaData = [
  106. {
  107. label:'客户名称',
  108. value:this.mainData.enterprisename_customer
  109. },
  110. {
  111. label:'联系人',
  112. value:this.mainData.name
  113. },
  114. {
  115. label:'手机号',
  116. value:this.mainData.phonenumber
  117. },
  118. {
  119. label:'来源',
  120. value:this.mainData.cluesource
  121. },
  122. {
  123. label:'负责人',
  124. value:this.mainData.leader[0].name
  125. },
  126. {
  127. label:'分配状态',
  128. value:this.mainData.allocationstatus
  129. },
  130. {
  131. label:'跟进状态',
  132. value:this.mainData.status
  133. },
  134. {
  135. label:'跟进次数',
  136. value:this.mainData.followcount
  137. },
  138. {
  139. label:'转化次数',
  140. value:this.mainData.changecount
  141. },
  142. ]
  143. this.detailInfo = {
  144. baseInfo: [
  145. {
  146. label:'客户名称',
  147. value:this.mainData.name
  148. },
  149. {
  150. label:'手机号',
  151. value:this.mainData.phonenumber
  152. },
  153. {
  154. label:'省市县',
  155. value:`${this.mainData.province}-${this.mainData.city}-${this.mainData.county}`
  156. },
  157. {
  158. label:'地址',
  159. value:this.mainData.address
  160. },
  161. {
  162. label:'来源',
  163. value:this.mainData.cluesource
  164. },
  165. // {
  166. // label:'负责人',
  167. // value:this.mainData.leader[0].name
  168. // },
  169. {
  170. label:'跟进状态',
  171. value:this.mainData.status
  172. },
  173. {
  174. label:'分配状态',
  175. value:this.mainData.allocationstatus
  176. },
  177. {
  178. label:'备注',
  179. value:this.mainData.notes
  180. },
  181. ],
  182. systemInfo: [
  183. {label:'创建人',value:this.mainData.createBy},
  184. {label:'分配人',value:this.mainData.assignedBy},
  185. {label:'最近跟进人',value:this.mainData.followBy},
  186. {label:'转移人',value:this.mainData.changeBy},
  187. {label:'最近编辑人',value:this.mainData.editBy},
  188. {label:'创建时间',value:this.mainData.createDate},
  189. {label:'分配时间',value:this.mainData.assignedDate},
  190. {label:'最近跟进时间',value:this.mainData.followDate},
  191. {label:'最近转移时间',value:this.mainData.changeDate},
  192. {label:'最近编辑时间',value:this.mainData.editDate},
  193. {label:'最近编辑时间',value:this.mainData.editDate},
  194. {label:'最近编辑时间',value:this.mainData.editDate},
  195. ]
  196. }
  197. },
  198. goBack () {
  199. this.$confirm('退回该线索后无法撤销,是否继续','提示',{
  200. "confirmButtonText":'确定',
  201. "cancelButtonText":'取消'
  202. }).then(async confirm => {
  203. let res = await this.$api.requested({
  204. "id":20221207160802,
  205. "content": {
  206. sat_orderclueid: this.mainData.sat_orderclueid
  207. }
  208. })
  209. this.tool.showMessage(res , () => {
  210. this.$store.dispatch('changeDetailDrawer',false)
  211. this.$router.push('/orderclue')
  212. })
  213. })
  214. },
  215. // 监听切换数据,上一页,下一页
  216. pageChange (id,rowindex) {
  217. this.flag = false
  218. this.$router.replace({path:'/orderclue_detail',query:{id:id,rowindex:rowindex}})
  219. this.queryMainData(id)
  220. }
  221. },
  222. mounted () {
  223. this.queryMainData(this.$route.query.id)
  224. },
  225. created() {
  226. }
  227. }
  228. </script>
  229. <style scoped>
  230. </style>