AI销管
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

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