AI销管
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

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