CustomerDetail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <div style="padding-bottom:20px;">
  3. <el-row :gutter="5">
  4. <el-col :span="8">
  5. <el-card class="box-card">
  6. <div slot="header" class="clearfix">
  7. <el-row :gutter="10" style="font-size:20px;font-weight:bold">
  8. <el-col :span="8">
  9. <span style="float:right">客户名称:</span>
  10. </el-col>
  11. <el-col :span="16">
  12. <span>{{customerCard.customerName}}</span>
  13. </el-col>
  14. </el-row>
  15. </div>
  16. <div>
  17. <el-row :gutter="10" class="cust-card-row">
  18. <el-col :span="8">
  19. <span class="cust-card-tt">所属集团:</span>
  20. </el-col>
  21. <el-col :span="16">
  22. <span class="cust-card-ct">{{customerCard.groupName}}</span>
  23. </el-col>
  24. </el-row>
  25. <el-row :gutter="10" class="cust-card-row">
  26. <el-col :span="8">
  27. <span class="cust-card-tt">客户状态:</span>
  28. </el-col>
  29. <el-col :span="16">
  30. <span class="cust-card-ct">{{customerCard.customeStatusName}}</span>
  31. </el-col>
  32. </el-row>
  33. <el-row :gutter="10" class="cust-card-row">
  34. <el-col :span="8">
  35. <span class="cust-card-tt">客户等级:</span>
  36. </el-col>
  37. <el-col :span="16">
  38. <span class="cust-card-ct">{{customerCard.customeLevelName}}</span>
  39. </el-col>
  40. </el-row>
  41. <el-row :gutter="10" class="cust-card-row">
  42. <el-col :span="8">
  43. <span class="cust-card-tt">社会信用代码:</span>
  44. </el-col>
  45. <el-col :span="16">
  46. <span class="cust-card-ct">{{customerCard.scode}}</span>
  47. </el-col>
  48. </el-row>
  49. <el-row :gutter="10" class="cust-card-row">
  50. <el-col :span="8">
  51. <span class="cust-card-tt">客户区域:</span>
  52. </el-col>
  53. <el-col :span="16">
  54. <span class="cust-card-ct">{{customerCard.rangeName }}</span>
  55. </el-col>
  56. </el-row>
  57. <el-row :gutter="10" class="cust-card-row">
  58. <el-col :span="8">
  59. <span class="cust-card-tt">客户省份:</span>
  60. </el-col>
  61. <el-col :span="16">
  62. <span class="cust-card-ct">{{customerCard.province }}</span>
  63. </el-col>
  64. </el-row>
  65. <el-row :gutter="10" class="cust-card-row">
  66. <el-col :span="8">
  67. <span class="cust-card-tt">客户地址:</span>
  68. </el-col>
  69. <el-col :span="16">
  70. <span class="cust-card-ct">{{customerCard.address }}</span>
  71. </el-col>
  72. </el-row>
  73. <el-row :gutter="10" class="cust-card-row">
  74. <el-col :span="8">
  75. <span class="cust-card-tt">负责人:</span>
  76. </el-col>
  77. <el-col :span="16">
  78. <span class="cust-card-ct">{{customerCard.directorName }}</span>
  79. </el-col>
  80. </el-row>
  81. <el-row :gutter="10" class="cust-card-row">
  82. <el-col :span="8">
  83. <span class="cust-card-tt">创建人:</span>
  84. </el-col>
  85. <el-col :span="16">
  86. <span class="cust-card-ct">{{customerCard.createrName }}</span>
  87. </el-col>
  88. </el-row>
  89. <el-row :gutter="10" class="cust-card-row">
  90. <el-col :span="8">
  91. <span class="cust-card-tt">创建日期:</span>
  92. </el-col>
  93. <el-col :span="16">
  94. <span class="cust-card-ct">{{customerCard.createtime }}</span>
  95. </el-col>
  96. </el-row>
  97. <el-row :gutter="10" class="cust-card-row">
  98. <el-col :span="8">
  99. <span class="cust-card-tt">备注:</span>
  100. </el-col>
  101. <el-col :span="16">
  102. <span class="cust-card-ct">{{customerCard.remark }}</span>
  103. </el-col>
  104. </el-row>
  105. </div>
  106. <!-- <div v-for="o in 4" :key="o" class="text item">
  107. {{'列表内容 ' + o }}
  108. </div> -->
  109. </el-card>
  110. </el-col>
  111. <el-col :span="16">
  112. <div class="search">
  113. <el-select v-model="tableObj.getdataListParm.parammaps.businessName" placeholder="业务" class="filter-item" style="width: 120px;" clearable filterable>
  114. <el-option v-for="(item,index) in businessNameList" :key="index" :label="item.name" :value="item.id" />
  115. </el-select>
  116. <el-date-picker v-model="tableObj.getdataListParm.parammaps.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
  117. <el-input v-model="tableObj.getdataListParm.parammaps.directorName" placeholder="负责人" style="width: 180px;" class="filter-item" clearable />
  118. <el-select v-model="tableObj.getdataListParm.parammaps.customeStatus" placeholder="客户状态" class="filter-item" style="width: 120px;" clearable>
  119. <el-option v-for="(item,index) in customeStatusList" :key="index" :label="item.name" :value="item.id" />
  120. </el-select>
  121. <el-input v-model="tableObj.getdataListParm.parammaps.beginMoney" placeholder="金额" style="width:80px"></el-input>
  122. -
  123. <el-input v-model="tableObj.getdataListParm.parammaps.endMoney" placeholder="金额" style="width:80px"></el-input>
  124. <el-button class="successBorder" @click="form_search">查询</el-button>
  125. <el-button class="successBorder" @click="form_clear">重置</el-button>
  126. </div>
  127. <div>
  128. <el-divider></el-divider>
  129. <div class="block" style="height:320px;overflow:auto">
  130. <el-timeline>
  131. <el-timeline-item type="success" color="#409EFF" size="large" :timestamp="item.date" placement="top" v-for="item in customerResumeList" class = "cust-line-bx">
  132. <div style="position: absolute;top:0px;right:0px;">
  133. <span>负责人:</span>
  134. <span>{{item.directorName}}</span>
  135. </div>
  136. <el-card>
  137. <div class = "cust-ex-item">
  138. <span class = "cust-ex-tt">业务:</span>
  139. <span class = "cust-ex-ct">{{item.businessName}}</span>
  140. </div>
  141. <div class = "cust-ex-item">
  142. <span class = "cust-ex-tt">状态:</span>
  143. <span class = "cust-ex-ct">{{item.customeStatus}}</span>
  144. </div>
  145. <!-- <div class = "cust-ex-item">
  146. <span class = "cust-ex-tt">详情:</span>
  147. <span class = "cust-ex-ct">{{item.businessName}}</span>
  148. </div> -->
  149. <div class = "cust-ex-item">
  150. <span class = "cust-ex-tt">待付金额(元):</span>
  151. <span class = "cust-ex-ct">{{item.paidPrice}}</span>
  152. </div>
  153. <div class = "cust-ex-item">
  154. <span class = "cust-ex-tt">支付状态:</span>
  155. <span class = "cust-ex-ct">{{item.payStatus}}</span>
  156. </div>
  157. </el-card>
  158. </el-timeline-item>
  159. </el-timeline>
  160. </div>
  161. <el-divider></el-divider>
  162. <div>
  163. <div class = "cust-rest">
  164. <span>待付总金额(元):</span>
  165. <span>{{sunPrice.planPaySumMoney}}</span>
  166. </div>
  167. <div class = "cust-rest">
  168. <span>已付金额(元):</span>
  169. <span>{{sunPrice.payMoney}}</span>
  170. </div>
  171. <div class = "cust-rest">
  172. <span>未付金额(元):</span>
  173. <span>{{sunPrice.planPayMoney}}</span>
  174. </div>
  175. </div>
  176. </div>
  177. </el-col>
  178. </el-row>
  179. </div>
  180. </template>
  181. <script>
  182. import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, GetDataByNames, checkButtons, calculativeWidth } from '@/api/common'
  183. import Cookies from 'js-cookie'
  184. import { parseTime } from '@/utils/index.js'
  185. import Pagination from '@/components/Pagination'
  186. import { MessageBox } from 'element-ui'
  187. import { getToken } from '@/utils/auth'
  188. export default {
  189. name: 'CustomerDetail',
  190. props: {
  191. customerData: {
  192. type: Object,
  193. required: true
  194. }
  195. },
  196. data() {
  197. return {
  198. customerCard: {
  199. // "address":"1","createrId":"3072707379235128328","createrName":"管理员","createtime":"2022-05-11","customeLevelName":"2级","customeStatusName":"欠款客户","customerName":"测试12","directorId":24,"directorName":"康亮","enable":1,"groupId":207,"groupName":"星连星牧业","id":1425,"province":"1","rangeName":"西北区域","remark":"","scode":"123456789012345678"
  200. },
  201. //列表请求
  202. tableObj: {
  203. getdataListParm: {
  204. name: 'getResumeByCustomerId',
  205. page: 1,
  206. offset: 1,
  207. pagecount: 10,
  208. returntype: 'Map',
  209. parammaps: {
  210. id:"",
  211. customerId: '',
  212. businessName: '',
  213. inputDatetime: '',
  214. beginDate: '',
  215. endDate: '',
  216. directorName: '',
  217. customeStatus: '已完成',
  218. beginMoney: '',
  219. endMoney: '',
  220. }
  221. },
  222. tableKey: 0,
  223. total: 0
  224. },
  225. businessNameList: [
  226. {id:"客户拜访", name:"客户拜访"},
  227. {id:"电话回访", name:"电话回访"},
  228. {id:"快递接送", name:"快递接送"},
  229. {id:"备货", name:"备货"},
  230. {id:"发货", name:"发货"},
  231. {id:"现场服务", name:"现场服务"},
  232. {id:"远程服务", name:"远程服务"},
  233. {id:"投诉", name:"投诉"},
  234. ],
  235. customeStatusList: [
  236. {id:"已完成", name:"已完成"},
  237. {id:"未完成", name:"未完成"},
  238. ],
  239. customerResumeList:[
  240. // {id:1, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-01"},
  241. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  242. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  243. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  244. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  245. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  246. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  247. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  248. // {id:2, businessName: '合同款项', customeStatus: '已完成', paidPrice: '100.00', payStatus: '无需支付', director:'epans', date:"2022-12-02"},
  249. ],
  250. sunPrice:{
  251. // payMoney: '200',
  252. // planPayMoney: '50',
  253. // planPaySumMoney: '300'
  254. }
  255. }
  256. },
  257. watch: {
  258. customerData: {
  259. deep: true,
  260. handler: function (item) {
  261. console.log("父组件:", item)
  262. this.form_clear()
  263. this.get_card_list()
  264. this.get_resume_list()
  265. this.get_sum_money()
  266. }
  267. },
  268. },
  269. mounted() {
  270. },
  271. created() {
  272. this.get_card_list()
  273. this.get_resume_list()
  274. this.get_sum_money()
  275. },
  276. beforeDestroy() {
  277. },
  278. methods: {
  279. //AJAX事件 - 获取卡片
  280. get_card_list() {
  281. var send_data = {
  282. name: 'getCustomerById',
  283. parammaps: {
  284. id:this.customerData.id,
  285. }
  286. }
  287. GetDataByName(send_data).then(response => {
  288. console.log('卡片数据', response )
  289. if (response.data.list !== null) {
  290. this.customerCard = response.data.list[0]
  291. } else {
  292. this.customerCard = {}
  293. }
  294. })
  295. },
  296. //监听 - 表单查询
  297. form_search() {
  298. console.log('点击了查询 - 客户详情列表',this.tableObj.getdataListParm.parammaps)
  299. if (this.tableObj.getdataListParm.parammaps.inputDatetime !== '' && this.tableObj.getdataListParm.parammaps.inputDatetime !== null) {
  300. this.tableObj.getdataListParm.parammaps.beginDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime[0], '{y}-{m}-{d}')
  301. this.tableObj.getdataListParm.parammaps.endDate = parseTime(this.tableObj.getdataListParm.parammaps.inputDatetime[1], '{y}-{m}-{d}')
  302. } else {
  303. this.tableObj.getdataListParm.parammaps.inputDatetime = ''
  304. this.tableObj.getdataListParm.parammaps.beginDate = ''
  305. this.tableObj.getdataListParm.parammaps.endDate = ''
  306. }
  307. this.tableObj.getdataListParm.parammaps.id = this.customerData.id
  308. this.tableObj.getdataListParm.offset = 1
  309. this.get_resume_list()
  310. this.get_sum_money()
  311. },
  312. //事件 - 清空所有表单信息
  313. form_clear() {
  314. console.log('点击了重置')
  315. this.tableObj.getdataListParm.parammaps.id = ''
  316. this.tableObj.getdataListParm.parammaps.customerId = ''
  317. this.tableObj.getdataListParm.parammaps.businessName = ''
  318. this.tableObj.getdataListParm.parammaps.inputDatetime = ''
  319. this.tableObj.getdataListParm.parammaps.beginDate = ''
  320. this.tableObj.getdataListParm.parammaps.endDate = ''
  321. this.tableObj.getdataListParm.parammaps.directorName = ''
  322. this.tableObj.getdataListParm.parammaps.customeStatus = ''
  323. this.tableObj.getdataListParm.parammaps.beginMoney = ''
  324. this.tableObj.getdataListParm.parammaps.endMoney = ''
  325. this.tableObj.getdataListParm.offset = 1
  326. this.get_resume_list()
  327. this.get_sum_money()
  328. },
  329. //AJAX事件 - 获取卡片列表
  330. get_resume_list() {
  331. this.tableObj.getdataListParm.parammaps.customerId = this.customerData.id
  332. var send_data2 = {
  333. name: 'getResumeByCustomerId',
  334. parammaps: this.tableObj.getdataListParm.parammaps
  335. }
  336. GetDataByName(send_data2).then(response => {
  337. console.log('卡片列表数据', response )
  338. if (response.data.list !== null) {
  339. this.customerResumeList = response.data.list
  340. } else {
  341. this.customerResumeList = []
  342. }
  343. })
  344. },
  345. //AJAX事件 - 获取金额总价
  346. get_sum_money() {
  347. var send_data3 = {
  348. name: 'getResumeMoney',
  349. parammaps: this.tableObj.getdataListParm.parammaps
  350. }
  351. GetDataByName(send_data3).then(response => {
  352. console.log('卡片总金额', response )
  353. this.sunPrice = response.data.list[0]
  354. })
  355. },
  356. }
  357. }
  358. </script>