AI销管
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

434 lines
11 KiB

  1. <template>
  2. <view class="cented-box">
  3. <view class="Pinspeak">客户信息</view>
  4. <view class="chented">
  5. <view class="title">
  6. <view class="titletext">客户姓名</view>
  7. <view class="titletext2">
  8. <input maxlength="10" class="titletext-input" style="color: #333333;" v-model="parames.name"
  9. placeholder-class="titletext-input" placeholder-style="color:#B2B2B2;" type="text"
  10. placeholder="请输入客户姓名(必填)" />
  11. </view>
  12. <view class="titleimg">
  13. </view>
  14. </view>
  15. <view class="title">
  16. <view class="titletext">客户性别</view>
  17. <view class="titletext2 displayclick" style="display: flex;align-items: center;padding-left: 10rpx;">
  18. <view class="sexRadio" @click="changeSex(1)" :class="{active:parames.sex == 1}">男士</view>
  19. <view class="sexRadio" @click="changeSex(2)" :class="{active:parames.sex == 2}">女士</view>
  20. </view>
  21. </view>
  22. <view class="title">
  23. <view class="titletext">联系电话</view>
  24. <view class="titletext2">
  25. <input class="titletext-input" style="color: #333333;" v-model="parames.phone" maxlength="11"
  26. placeholder-class="titletext-input" placeholder-style="color:#B2B2B2;" type="number"
  27. placeholder="请输入联系电话" />
  28. </view>
  29. </view>
  30. <view class="title">
  31. <view class="titletext">接待人数</view>
  32. <view class="titletext2" style="display: flex;align-items: center;justify-content: space-around;">
  33. <view class="num" v-for="i in 6" :key="i" :class="{active:parames.howMany == i+1}"
  34. @click="changeHowMany(i+1)">
  35. {{i + 1}}
  36. </view>
  37. </view>
  38. </view>
  39. <view class="title" style="border: none;" @click="Buildingselection()">
  40. <view class="titletext">客户来源</view>
  41. <view class="titletext2"
  42. style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 110rpx;padding-left: 10rpx;">
  43. <!-- {{parames.sourceName||'请选择客户来源'}} -->
  44. <text v-if="parames.sourceName" style="color: #333333;">{{parames.sourceName}}</text>
  45. <text v-else>请选择客户来源</text>
  46. </view>
  47. <view class="titleimg">
  48. <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="Pinspeak" v-if="isShow">顾问</view>
  53. <view class="chented" v-if="isShow" @click="clickShowhid()">
  54. <view class="title" style="border: none;">
  55. <view class="titletext">接待顾问</view>
  56. <view class="titletext2"
  57. style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 110rpx;padding-left: 10rpx;">
  58. <!-- {{text || '请选择接待顾问'}} -->
  59. <text v-if="text" style="color: #333333;">{{text}}</text>
  60. <text v-else>请选择接待顾问</text>
  61. </view>
  62. <view class="titleimg">
  63. <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="clive" @click="$noMultipleClicks(save)">确定</view>
  68. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="list"
  69. @cancel="cancel" @confirm="confirm"></u-select>
  70. <u-select :mask-close-able="false" v-model="Showhid" mode="single-column" :list="freeList" @cancel="cancel1"
  71. @confirm="confirm1"></u-select>
  72. <u-modal v-model="show" :mask-close-able="true" :title="'代接待提醒'" :confirm-text="confirmtext"
  73. :cancel-text='canceltext' @cancel="confirmA" @confirm="confirmB" :show-cancel-button='true'
  74. :content="content"></u-modal>
  75. </view>
  76. </template>
  77. <script>
  78. var app = getApp();
  79. var config = require("../../../config");
  80. export default {
  81. data() {
  82. return {
  83. noClick: true,
  84. Showhiddenunits: false,
  85. list: [{
  86. label: '自然到访',
  87. value: '自然到访'
  88. },
  89. {
  90. label: '渠道推荐',
  91. value: '渠道推荐'
  92. },
  93. ],
  94. parames: {
  95. name: '',
  96. // 性别1男 2女
  97. sex: 1,
  98. phone: '',
  99. source: null,
  100. sourceName: null,
  101. howMany: 1,
  102. agentId: null,
  103. projectId: '',
  104. replaceReception: 0
  105. },
  106. freeList: [],
  107. Showhid: false,
  108. text: null,
  109. show: false,
  110. content: '东临碣石,以观沧海',
  111. confirmtext: '1', //确认文字
  112. canceltext: '2', //取消文字
  113. daitiReceptionobj: {},
  114. isShow: false, // 默认隐藏该权限
  115. userInfo: {}, // 用户信息
  116. };
  117. },
  118. onLoad() {
  119. this.userInfo = uni.getStorageSync('weapp_session_userInfo_data');
  120. console.log(this.userInfo, 'adkljsakldjaskljdklasjdklsajdklasjdklasjdlk')
  121. },
  122. onShow() {
  123. let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
  124. this.isShow = newmenulist.jd_zp
  125. this.parames.projectId = uni.getStorageSync('buildingID').id;
  126. this.getFreeList();
  127. },
  128. methods: {
  129. //取消
  130. confirmA() {
  131. if (this.daitiReceptionobj.assign != null) {
  132. this.parames.agentId = this.daitiReceptionobj.assign.accountId;
  133. this.baochunfun()
  134. } else {
  135. uni.showToast({
  136. icon: "none",
  137. title: "【" + this.daitiReceptionobj.owner.name + "】正在接待中"
  138. })
  139. return;
  140. }
  141. },
  142. // 确认
  143. confirmB() {
  144. console.log(this.daitiReceptionobj.replacement.accountId)
  145. this.parames.agentId = this.daitiReceptionobj.replacement.accountId;
  146. this.parames.replaceReception = 1;
  147. this.baochunfun()
  148. },
  149. save() {
  150. if (this.parames.name.length == 0) {
  151. uni.showToast({
  152. icon: "none",
  153. title: "客户姓名不能为空"
  154. })
  155. return;
  156. }
  157. if (this.parames.phone && this.parames.phone.length < 11) {
  158. uni.showToast({
  159. icon: "none",
  160. title: "手机号码不能小于11位"
  161. })
  162. return;
  163. }
  164. if (this.parames.phone && this.parames.phone.length > 11) {
  165. uni.showToast({
  166. icon: "none",
  167. title: "手机号码不能大于11位"
  168. })
  169. return;
  170. }
  171. const that = this;
  172. this.$u.post("customer/daitiReception", {
  173. phone: that.parames.phone,
  174. projectId: that.parames.projectId,
  175. agentId: that.parames.agentId
  176. }).then(res => {
  177. if (res.unchecked == 0) {
  178. that.baochunfun()
  179. } else {
  180. if (res.zs == 0) {
  181. that.parames.agentId = res.assign.accountId;
  182. that.baochunfun()
  183. } else {
  184. if (res.assign == null && res.replacement == null) {
  185. that.baochunfun()
  186. } else {
  187. if (res.assign == null) {
  188. that.daitiReceptionobj = res;
  189. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  190. "】代接待吗?"
  191. that.confirmtext = res.replacement.name + "代接待", //确认文字
  192. that.canceltext = res.owner.name + '接待', //取消文字
  193. that.show = true;
  194. } else {
  195. that.daitiReceptionobj = res;
  196. console.log(that.daitiReceptionobj)
  197. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  198. "】代接待吗?"
  199. that.confirmtext = res.replacement.name + "代接待", //确认文字
  200. that.canceltext = res.assign.name + '接待', //取消文字
  201. that.show = true;
  202. }
  203. }
  204. }
  205. }
  206. })
  207. },
  208. baochunfun() {
  209. const {
  210. dataCode
  211. } = uni.getStorageSync("weapp_session_userInfo_data");
  212. if (this.parames.phone.length == 0) {
  213. this.parames.phone = null
  214. }
  215. uni.showLoading({
  216. title: "保存中",
  217. mask: true
  218. })
  219. if (dataCode == 6) {
  220. this.$u.post("/customer/gwAdd", this.parames).then(res => {
  221. uni.hideLoading();
  222. uni.showToast({
  223. icon: "none",
  224. title: "保存成功"
  225. })
  226. uni.navigateBack()
  227. })
  228. } else {
  229. this.$u.post("/customer/add", this.parames).then(res => {
  230. uni.hideLoading();
  231. uni.showToast({
  232. icon: "none",
  233. title: "保存成功"
  234. })
  235. uni.navigateBack()
  236. })
  237. }
  238. },
  239. changeSex(sex) {
  240. this.parames.sex = sex;
  241. },
  242. changeHowMany(num) {
  243. this.parames.howMany = num;
  244. },
  245. clickShowhid() {
  246. if (this.userInfo.userRoleType == 6) {
  247. return
  248. }
  249. if (this.freeList.length == 0) {
  250. uni.showToast({
  251. icon: 'none',
  252. title: '当前无可用排班顾问',
  253. duration: 2000
  254. });
  255. } else {
  256. this.Showhid = true;
  257. }
  258. },
  259. cancel1() {
  260. this.Showhid = false;
  261. },
  262. confirm1(e) {
  263. this.text = e[0].label;
  264. this.parames.agentId = e[0].value;
  265. this.Showhid = false;
  266. },
  267. Buildingselection() {
  268. this.Showhiddenunits = true;
  269. },
  270. cancel() {
  271. this.Showhiddenunits = false;
  272. },
  273. confirm(e) {
  274. this.parames.sourceName = e[0].value;
  275. this.Showhiddenunits = false;
  276. },
  277. //获取顾问列表
  278. getFreeList() {
  279. this.$u.get("/zkAgentPool/freeList?itemId=" + this.parames.projectId).then(res => {
  280. this.freeList = res;
  281. this.freeList.forEach(item => {
  282. // console.log(item, '顾问')
  283. if (item.onLine == 0) {
  284. item.label = item.name + "(离线)";
  285. } else if (item.onLine == 1) {
  286. item.label = item.name + "(在线)";
  287. } else {
  288. item.label = item.name + "(无设备)";
  289. }
  290. item.value = item.agentId
  291. if (this.userInfo.accountId == item.agentId) {
  292. this.text = item.label
  293. this.parames.agentId = item.agentId;
  294. }
  295. })
  296. })
  297. },
  298. }
  299. };
  300. </script>
  301. <style lang="scss" scoped>
  302. .sexRadio {
  303. color: #BFBFBF;
  304. border: 1rpx solid #BFBFBF;
  305. font-size: 24rpx;
  306. width: 120rpx;
  307. height: 60rpx;
  308. text-align: center;
  309. display: flex;
  310. align-items: center;
  311. justify-content: center;
  312. &:last-child {
  313. margin-left: 20rpx;
  314. }
  315. &.active {
  316. background: #2B6FFF;
  317. color: #fff;
  318. border-color: #2B6FFF;
  319. }
  320. }
  321. .num {
  322. width: 50rpx;
  323. height: 50rpx;
  324. background: rgba(43, 110, 253, 0.1);
  325. color: #2B6EFD;
  326. font-size: 30rpx;
  327. display: flex;
  328. align-items: center;
  329. justify-content: center;
  330. &.active {
  331. background: #2B6EFD;
  332. color: #FFFFFF;
  333. }
  334. }
  335. .cented-box {
  336. background: #F8F8F8;
  337. width: 100%;
  338. height: 100vh;
  339. }
  340. .Pinspeak {
  341. width: 100%;
  342. height: 92rpx;
  343. border-bottom: 1rpx solid #E0E0E0;
  344. font-size: 32rpx;
  345. font-weight: bold;
  346. color: #333333;
  347. text-indent: 30rpx;
  348. line-height: 92rpx;
  349. background: #FFFFFF;
  350. margin-top: 20rpx;
  351. padding-left: 10rpx;
  352. }
  353. .chented {
  354. width: 100%;
  355. padding-left: 30rpx;
  356. padding-right: 30rpx;
  357. background-color: #FFFFFF;
  358. .title {
  359. width: 100%;
  360. height: 110rpx;
  361. border-bottom: 1rpx solid #E0E0E0;
  362. display: flex;
  363. align-items: center;
  364. .titletext {
  365. width: 21%;
  366. height: 110rpx;
  367. font-size: 30rpx;
  368. font-weight: 400;
  369. color: #333333;
  370. line-height: 110rpx;
  371. text-indent: 10rpx;
  372. }
  373. .titletext2 {
  374. width: 71%;
  375. height: 110rpx;
  376. }
  377. .titletext-input {
  378. width: 100%;
  379. height: 110rpx;
  380. font-size: 30rpx;
  381. font-weight: 400;
  382. color: #B2B2B2;
  383. line-height: 110rpx;
  384. padding-left: 10rpx;
  385. }
  386. .titleimg {
  387. width: 8%;
  388. text-align: right;
  389. .titleimg1 {
  390. width: 16rpx;
  391. height: 36rpx;
  392. }
  393. }
  394. }
  395. }
  396. .clive {
  397. position: absolute;
  398. bottom: 32rpx;
  399. left: 30rpx;
  400. right: 30rpx;
  401. width: 690rpx;
  402. height: 88rpx;
  403. background: #2671E2;
  404. text-align: center;
  405. line-height: 88rpx;
  406. color: #FFFFFF;
  407. border-radius: 8rpx;
  408. font-size: 32rpx;
  409. }
  410. </style>