index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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. <el-button type="primary" v-if="tool.checkAuth($route.name,'goBack')" :disabled="!isHandle" class="inline-16" size="mini" @click="goBack">退 回</el-button>
  29. <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"/>
  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(this.mainData.leader.length <= 0 ) return
  75. if(JSON.parse(window.sessionStorage.getItem('userInfo')).userid == this.mainData.leader[0].userid) {
  76. is = true
  77. if(this.mainData.status == '待跟进' || this.mainData.status == '跟进中') {
  78. is = true
  79. } else {
  80. is = false
  81. }
  82. } else {
  83. is = false
  84. }
  85. this.isHandle = is
  86. console.log(this.isHandle,'权限');
  87. }
  88. },
  89. methods:{
  90. detailCreate (param) {
  91. param.content.isAll = 0
  92. },
  93. async queryMainData(id) {
  94. const res = await this.$api.requested({
  95. "classname": "saletool.orderclue.web.orderclue",
  96. "method": "selectDetail",
  97. "content": {
  98. "sat_orderclueid": this.$route.query.id
  99. }
  100. })
  101. this.mainData = res.data
  102. console.log(this.mainData);
  103. this.changeDataStructure()
  104. },
  105. changeDataStructure() {
  106. var that = this
  107. this.mainAreaData = [
  108. {
  109. label:'客户名称',
  110. value:this.mainData.enterprisename_customer
  111. },
  112. {
  113. label:'联系人',
  114. value:this.mainData.name
  115. },
  116. {
  117. label:'手机号',
  118. value:this.mainData.phonenumber
  119. },
  120. {
  121. label:'来源',
  122. value:this.mainData.cluesource
  123. },
  124. {
  125. label:'市场活动',
  126. value:this.mainData.campaign_name
  127. },
  128. {
  129. label:'负责人',
  130. value:this.mainData.leader.length > 0 && this.mainData.leader[0].name
  131. },
  132. {
  133. label:'分配状态',
  134. value:this.mainData.allocationstatus
  135. },
  136. {
  137. label:'跟进状态',
  138. value:this.mainData.status,
  139. style:function () {
  140. let style = {}
  141. switch (that.mainData.status) {
  142. case '已过期':
  143. style = {color:'#333'}
  144. break;
  145. case '跟进中':
  146. style = {color:'#52C41A'}
  147. break;
  148. case '待跟进':
  149. style = {color:'#FA8C16'}
  150. break;
  151. case '已成交':
  152. style = {color:'#F60909'}
  153. break;
  154. case '无效':
  155. style = {color:'#BBBBBB'}
  156. break;
  157. default:
  158. break;
  159. }
  160. return style
  161. }
  162. },
  163. {
  164. label:'跟进次数',
  165. value:this.mainData.followcount
  166. },
  167. ]
  168. this.detailInfo = {
  169. baseInfo: [
  170. {
  171. label:'客户名称',
  172. value:this.mainData.name
  173. },
  174. {
  175. label:'手机号',
  176. value:this.mainData.phonenumber
  177. },
  178. {
  179. label:'省市县',
  180. value:`${this.mainData.province}-${this.mainData.city}-${this.mainData.county}`
  181. },
  182. {
  183. label:'地址',
  184. value:this.mainData.address
  185. },
  186. {
  187. label:'来源',
  188. value:this.mainData.cluesource
  189. },
  190. // {
  191. // label:'负责人',
  192. // value:this.mainData.leader[0].name
  193. // },
  194. {
  195. label:'跟进状态',
  196. value:this.mainData.status,
  197. style:function () {
  198. let style = {}
  199. switch (that.mainData.status) {
  200. case '已过期':
  201. style = {color:'#333'}
  202. break;
  203. case '跟进中':
  204. style = {color:'#52C41A'}
  205. break;
  206. case '待跟进':
  207. style = {color:'#FA8C16'}
  208. break;
  209. case '已成交':
  210. style = {color:'#F60909'}
  211. break;
  212. case '无效':
  213. style = {color:'#BBBBBB'}
  214. break;
  215. default:
  216. break;
  217. }
  218. return style
  219. }
  220. },
  221. {
  222. label:'分配状态',
  223. value:this.mainData.allocationstatus,
  224. style:function () {
  225. let style = {}
  226. switch (that.mainData.status) {
  227. case '已分配':
  228. style = {color:'#333333'}
  229. break;
  230. default:
  231. break;
  232. }
  233. return style
  234. }
  235. },
  236. {
  237. label:'备注',
  238. value:this.mainData.notes
  239. },
  240. ],
  241. systemInfo: [
  242. {label:'创建人',value:this.mainData.createBy},
  243. {label:'分配人',value:this.mainData.assignedBy},
  244. {label:'最近跟进人',value:this.mainData.followBy},
  245. {label:'最近编辑人',value:this.mainData.editBy},
  246. {label:'创建时间',value:this.mainData.createDate},
  247. {label:'分配时间',value:this.mainData.assignedDate},
  248. {label:'最近跟进时间',value:this.mainData.followDate},
  249. {label:'最近编辑时间',value:this.mainData.editDate},
  250. {label:'最近编辑时间',value:this.mainData.editDate},
  251. {label:'最近编辑时间',value:this.mainData.editDate},
  252. {label:'转化次数',value:this.mainData.changecount},
  253. ]
  254. }
  255. },
  256. goBack () {
  257. this.$confirm('退回该线索后无法撤销,是否继续','提示',{
  258. "confirmButtonText":'确定',
  259. "cancelButtonText":'取消'
  260. }).then(async confirm => {
  261. let res = await this.$api.requested({
  262. "id":20221207160802,
  263. "content": {
  264. sat_orderclueid: this.mainData.sat_orderclueid
  265. }
  266. })
  267. this.tool.showMessage(res , () => {
  268. this.$store.dispatch('changeDetailDrawer',false)
  269. this.$router.push('/orderclue')
  270. })
  271. })
  272. },
  273. // 监听切换数据,上一页,下一页
  274. pageChange (id,rowindex) {
  275. this.flag = false
  276. this.$router.replace({path:'/orderclue_detail',query:{id:id,rowindex:rowindex}})
  277. this.queryMainData(id)
  278. }
  279. },
  280. mounted () {
  281. this.queryMainData(this.$route.query.id)
  282. },
  283. created() {
  284. }
  285. }
  286. </script>
  287. <style scoped>
  288. </style>