index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div>
  3. <basicDetails
  4. v-if="mainData"
  5. ref="details"
  6. :titleText="mainData.enterprisename_customer"
  7. :editData="mainData"
  8. :mainAreaData="mainAreaData"
  9. turnPageId="20221101094502"
  10. idname="sat_orderclueid"
  11. tags=""
  12. :tabs="['跟进记录','详细信息']"
  13. @pageChange="pageChange"
  14. @onEditSuccess="queryMainData($route.query.id)"
  15. @detailCreate="detailCreate">
  16. <div slot="customOperation">
  17. <edit class="inline-16" v-if="Object.keys(mainData).length > 0 && tool.checkAuth($route.name,'update')" :disabled="!isHandle" :data="mainData" @onSuccess="queryMainData"/>
  18. <follow :detailInfo="mainData"
  19. v-if="tool.checkAuth($route.name,'follow')"
  20. @updataList="queryMainData();$refs.followDetail.getFollowDetail()" @onSuccess="onFollow" :disabled="!isHandle"></follow>
  21. <!-- <move :data="mainData"
  22. @updataList="queryMainData"
  23. :teamList="teamList()"
  24. v-if="userInfo.isAuth == 1 ? mainData.status == '待跟进' || mainData.status == '跟进中' : ''"></move> -->
  25. <changeProject v-if="mainData.isproject == 0 && tool.checkAuth($route.name,'changeProject')" :data="mainData" :disabled="!isHandle" class="inline-16"/>
  26. <changeCustomer v-if="mainData.iscustomer == 0 && tool.checkAuth($route.name,'changeCutomer')" :data="mainData" :disabled="!isHandle" class="inline-16" @onChangeCustomer="onChangeCustomer"></changeCustomer>
  27. <el-button :type="!isHandle?'':'primary'" v-if="tool.checkAuth($route.name,'goBack') && mainData.status != '已转化' && mainData.isprivate !== 1" :disabled="!isHandle" class="inline-16" size="mini" @click="goBack">退 回</el-button>
  28. <noNull v-if="tool.checkAuth($route.name,'change') && mainData.status != '已转化'" class="inline-16" :disabled="!isHandle" @onSuccess="$store.dispatch('changeDetailDrawer',false);$router.replace('/orderclue')" :id="mainData.sat_orderclueid"/>
  29. <Del v-if="tool.checkAuth($route.name,'delete') && mainData.status != '已转化'" class="inline-16" :disabled="!isHandle" :idName="20221123193702" @onSuccess="$store.dispatch('changeDetailDrawer',false);$router.replace('/orderclue')" :id="mainData.sat_orderclueid" idKey="sat_orderclueids"/>
  30. </div>
  31. <div slot="slot1" class="container normal-panel">
  32. <BaseInfo :detailInfo="detailInfo"/>
  33. </div>
  34. <div slot="slot0">
  35. <followDetail ref="followDetail"/>
  36. </div>
  37. </basicDetails>
  38. </div>
  39. </template>
  40. <script>
  41. import BaseInfo from '@/HDrpManagement/projectChange/modules/modules/baseInfo/baseInfo'
  42. import followDetail from '@/SManagement/orderclue_detail/components/followDetail'
  43. import follow from '@/SManagement/orderclue/components/follow'
  44. import move from '@/SManagement/orderclue/components/move'
  45. import edit from '@/SManagement/orderclue/components/edit'
  46. import Del from './components/delete'
  47. import noNull from './components/noNull'
  48. import changeProject from './components/changeData'
  49. import changeCustomer from './components/changeCustomer'
  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. changeProject,
  70. changeCustomer,
  71. edit
  72. },
  73. watch: {
  74. mainData(val) {
  75. let is
  76. if (Object.keys(JSON.parse(window.sessionStorage.getItem('userInfo'))).length > 0) {
  77. console.log('负责人逻辑');
  78. if(this.mainData.leader.length <= 0 ) return
  79. if(JSON.parse(window.sessionStorage.getItem('userInfo')).userid == this.mainData.leader[0].userid) {
  80. is = true
  81. } else {
  82. is = false
  83. }
  84. } else {
  85. console.log('不是负责人逻辑');
  86. is = true
  87. }
  88. this.isHandle = is
  89. console.log(this.isHandle,'权限');
  90. }
  91. },
  92. methods:{
  93. detailCreate (param) {
  94. param.content.isAll = 0
  95. },
  96. async queryMainData(id) {
  97. const res = await this.$api.requested({
  98. "classname": "saletool.orderclue.web.orderclue",
  99. "method": "selectDetail",
  100. "content": {
  101. "sat_orderclueid": this.$route.query.id
  102. }
  103. })
  104. this.mainData = res.data
  105. this.$refs.details.param.content.type = this.$route.query.tabIndex
  106. console.log(this.mainData,"销售线索手机号数据");
  107. this.changeDataStructure()
  108. },
  109. changeDataStructure() {
  110. var that = this
  111. this.mainAreaData = [
  112. {
  113. label:'客户名称',
  114. value:this.mainData.enterprisename_customer
  115. },
  116. {
  117. label:'联系人',
  118. value:this.mainData.name
  119. },
  120. {
  121. label:'手机号',
  122. value:this.mainData.phonenumber
  123. },
  124. {
  125. label:'来源',
  126. value:this.mainData.cluesource
  127. },
  128. {
  129. label:'市场活动',
  130. value:this.mainData.campaign_name
  131. },
  132. {
  133. label:'负责人',
  134. value:this.mainData.leader.length > 0 && this.mainData.leader[0].name
  135. },
  136. {
  137. label:'分配状态',
  138. value:this.mainData.allocationstatus
  139. },
  140. {
  141. label:'跟进状态',
  142. value:this.mainData.status,
  143. style:function () {
  144. let style = {}
  145. switch (that.mainData.status) {
  146. case '已过期':
  147. style = {color:'#333'}
  148. break;
  149. case '跟进中':
  150. style = {color:'#52C41A'}
  151. break;
  152. case '待跟进':
  153. style = {color:'#3874f6'}
  154. break;
  155. case '已无效':
  156. style = {color:'#333333'}
  157. break;
  158. case '已转化':
  159. style = {color:'#fa8c16'}
  160. break;
  161. default:
  162. break;
  163. }
  164. return style
  165. }
  166. },
  167. {
  168. label:'跟进次数',
  169. value:this.mainData.followcount
  170. },
  171. ]
  172. this.detailInfo = {
  173. baseInfo: [
  174. {
  175. label:'客户名称',
  176. value:this.mainData.name
  177. },
  178. {
  179. label:'手机号',
  180. value:this.mainData.phonenumber
  181. },
  182. {
  183. label:'省市县',
  184. value:`${this.mainData.province}-${this.mainData.city}-${this.mainData.county}`
  185. },
  186. {
  187. label:'联系人',
  188. value:this.mainData.name
  189. },
  190. {
  191. label:'地址',
  192. value:this.mainData.address
  193. },
  194. {
  195. label:'市场活动',
  196. value:this.mainData.campaign_name
  197. },
  198. {
  199. label:'来源',
  200. value:this.mainData.cluesource
  201. },
  202. {
  203. label:'负责人',
  204. value:this.mainData.leader.length > 0 && this.mainData.leader[0].name
  205. },
  206. // {
  207. // label:'负责人',
  208. // value:this.mainData.leader[0].name
  209. // },
  210. {
  211. label:'跟进状态',
  212. value:this.mainData.status,
  213. style:function () {
  214. let style = {}
  215. switch (that.mainData.status) {
  216. case '已过期':
  217. style = {color:'#333'}
  218. break;
  219. case '跟进中':
  220. style = {color:'#52C41A'}
  221. break;
  222. case '待跟进':
  223. style = {color:'#3874f6'}
  224. break;
  225. case '已无效':
  226. style = {color:'#333333'}
  227. break;
  228. case '已转化':
  229. style = {color:'#fa8c16'}
  230. break;
  231. default:
  232. break;
  233. }
  234. return style
  235. }
  236. },
  237. {
  238. label:'分配状态',
  239. value:this.mainData.allocationstatus,
  240. style:function () {
  241. let style = {}
  242. switch (that.mainData.status) {
  243. case '已分配':
  244. style = {color:'#333333'}
  245. break;
  246. case '待分配':
  247. style = {color:'#3874f6'}
  248. break;
  249. default:
  250. break;
  251. }
  252. return style
  253. }
  254. },
  255. {
  256. label:'备注',
  257. value:this.mainData.notes
  258. },
  259. {
  260. label:'跟进次数',
  261. value:this.mainData.followcount
  262. },
  263. ],
  264. systemInfo: [
  265. {label:'创建人',value:this.mainData.createBy},
  266. {label:'创建时间',value:this.mainData.createDate},
  267. {label:'分配人',value:this.mainData.assignedBy},
  268. {label:'分配时间',value:this.mainData.assignedDate},
  269. {label:'最近跟进人',value:this.mainData.followBy},
  270. {label:'最近跟进时间',value:this.mainData.followDate},
  271. {label:'最近编辑人',value:this.mainData.editBy},
  272. {label:'最近编辑时间',value:this.mainData.editDate},
  273. {label:'转化次数',value:this.mainData.isproject === 0 && this.mainData.iscustomer === 0?'0':this.mainData.isproject + this.mainData.iscustomer },
  274. {label:'转手次数', value:this.mainData.leader[0].leadernum === 0?'0':this.mainData.leader[0].leadernum},
  275. ]
  276. }
  277. },
  278. goBack () {
  279. this.$confirm('退回该线索后无法撤销,是否继续','提示',{
  280. "confirmButtonText":'确定',
  281. "cancelButtonText":'取消'
  282. }).then(async confirm => {
  283. let res = await this.$api.requested({
  284. "id":20221207160802,
  285. "content": {
  286. sat_orderclueid: this.mainData.sat_orderclueid
  287. }
  288. })
  289. this.tool.showMessage(res , () => {
  290. this.$store.dispatch('changeDetailDrawer',false)
  291. this.$router.push('/orderclue')
  292. })
  293. })
  294. },
  295. // 监听切换数据,上一页,下一页
  296. pageChange (id,rowindex,tabIndex) {
  297. this.flag = false
  298. tabIndex = this.$route.query.tabIndex
  299. this.$router.replace({path:'/orderclue_detail',query:{id:id,rowindex:rowindex,tabIndex:tabIndex}})
  300. this.queryMainData(id)
  301. },
  302. onChangeCustomer(){
  303. this.queryMainData(this.$route.query.id)
  304. },
  305. onFollow(){
  306. this.$refs.followDetail.getFollowDetail()
  307. this.queryMainData()
  308. }
  309. },
  310. mounted () {
  311. this.queryMainData(this.$route.query.id)
  312. },
  313. created() {
  314. }
  315. }
  316. </script>
  317. <style scoped>
  318. </style>