AI销管
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

429 行
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. };
  120. },
  121. onShow() {
  122. let newmenulist= uni.getStorageSync('weapp_session_Menu_data');
  123. this.isShow = newmenulist.jd_zp
  124. this.parames.projectId = uni.getStorageSync('buildingID').id;
  125. this.getFreeList();
  126. },
  127. methods: {
  128. //取消
  129. confirmA() {
  130. if (this.daitiReceptionobj.assign != null) {
  131. this.parames.agentId = this.daitiReceptionobj.assign.accountId;
  132. this.baochunfun()
  133. } else {
  134. uni.showToast({
  135. icon: "none",
  136. title: "【" + this.daitiReceptionobj.owner.name + "】正在接待中"
  137. })
  138. return;
  139. }
  140. },
  141. // 确认
  142. confirmB() {
  143. console.log(this.daitiReceptionobj.replacement.accountId)
  144. this.parames.agentId = this.daitiReceptionobj.replacement.accountId;
  145. this.parames.replaceReception = 1;
  146. this.baochunfun()
  147. },
  148. save() {
  149. if (this.parames.name.length == 0) {
  150. uni.showToast({
  151. icon: "none",
  152. title: "客户姓名不能为空"
  153. })
  154. return;
  155. }
  156. if (this.parames.phone && this.parames.phone.length < 11) {
  157. uni.showToast({
  158. icon: "none",
  159. title: "手机号码不能小于11位"
  160. })
  161. return;
  162. }
  163. if (this.parames.phone && this.parames.phone.length > 11) {
  164. uni.showToast({
  165. icon: "none",
  166. title: "手机号码不能大于11位"
  167. })
  168. return;
  169. }
  170. const that = this;
  171. this.$u.post("customer/daitiReception", {
  172. phone: that.parames.phone,
  173. projectId: that.parames.projectId,
  174. agentId: that.parames.agentId
  175. }).then(res => {
  176. if (res.unchecked == 0) {
  177. that.baochunfun()
  178. } else {
  179. if (res.zs == 0) {
  180. console.log(res, 'ajdlksajdklsajkdljsakldjsakl')
  181. console.log(res, 'ajdlksajdklsajkdljsakldjsakl')
  182. that.parames.agentId = res.assign.accountId;
  183. that.baochunfun()
  184. } else {
  185. console.log("zo")
  186. if (res.assign == null && res.replacement == null) {
  187. that.baochunfun()
  188. } else {
  189. if (res.assign == null) {
  190. that.daitiReceptionobj = res;
  191. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  192. "】代接待吗?"
  193. that.confirmtext = res.replacement.name + "代接代", //确认文字
  194. that.canceltext = res.owner.name + '接待', //取消文字
  195. that.show = true;
  196. } else {
  197. that.daitiReceptionobj = res;
  198. console.log(that.daitiReceptionobj)
  199. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  200. "】代接待吗?"
  201. that.confirmtext = res.replacement.name + "代接代", //确认文字
  202. that.canceltext = res.assign.name + '接待', //取消文字
  203. that.show = true;
  204. }
  205. }
  206. }
  207. }
  208. })
  209. },
  210. baochunfun() {
  211. const {
  212. dataCode
  213. } = uni.getStorageSync("weapp_session_userInfo_data");
  214. if (this.parames.phone.length == 0) {
  215. this.parames.phone = null
  216. }
  217. uni.showLoading({
  218. title: "保存中",
  219. mask: true
  220. })
  221. if (dataCode == 6) {
  222. this.$u.post("/customer/gwAdd", this.parames).then(res => {
  223. uni.hideLoading();
  224. uni.showToast({
  225. icon: "none",
  226. title: "保存成功"
  227. })
  228. uni.navigateBack()
  229. })
  230. } else {
  231. this.$u.post("/customer/add", this.parames).then(res => {
  232. uni.hideLoading();
  233. uni.showToast({
  234. icon: "none",
  235. title: "保存成功"
  236. })
  237. uni.navigateBack()
  238. })
  239. }
  240. },
  241. changeSex(sex) {
  242. this.parames.sex = sex;
  243. },
  244. changeHowMany(num) {
  245. this.parames.howMany = num;
  246. },
  247. clickShowhid() {
  248. if (this.freeList.length == 0) {
  249. uni.showToast({
  250. icon: 'none',
  251. title: '当前无可用排班顾问',
  252. duration: 2000
  253. });
  254. } else {
  255. this.Showhid = true;
  256. }
  257. },
  258. cancel1() {
  259. this.Showhid = false;
  260. },
  261. confirm1(e) {
  262. this.text = e[0].label;
  263. this.parames.agentId = e[0].value;
  264. this.Showhid = false;
  265. },
  266. Buildingselection() {
  267. this.Showhiddenunits = true;
  268. },
  269. cancel() {
  270. this.Showhiddenunits = false;
  271. },
  272. confirm(e) {
  273. this.parames.sourceName = e[0].value;
  274. this.Showhiddenunits = false;
  275. },
  276. //获取顾问列表
  277. getFreeList() {
  278. this.$u.get("/zkAgentPool/freeList?itemId=" + this.parames.projectId).then(res => {
  279. this.freeList = res;
  280. this.freeList.forEach(item => {
  281. if (item.onLine == 0) {
  282. item.label = item.name + "(离线)";
  283. } else if (item.onLine == 1) {
  284. item.label = item.name + "(在线)";
  285. } else {
  286. item.label = item.name + "(无设备)";
  287. }
  288. item.value = item.agentId
  289. })
  290. })
  291. },
  292. }
  293. };
  294. </script>
  295. <style lang="scss" scoped>
  296. .sexRadio {
  297. color: #BFBFBF;
  298. border: 1rpx solid #BFBFBF;
  299. font-size: 24upx;
  300. width: 120rpx;
  301. height: 60rpx;
  302. text-align: center;
  303. display: flex;
  304. align-items: center;
  305. justify-content: center;
  306. &:last-child {
  307. margin-left: 20rpx;
  308. }
  309. &.active {
  310. background: #2B6FFF;
  311. color: #fff;
  312. border-color: #2B6FFF;
  313. }
  314. }
  315. .num {
  316. width: 50rpx;
  317. height: 50rpx;
  318. background: rgba(43, 110, 253, 0.1);
  319. color: #2B6EFD;
  320. font-size: 30rpx;
  321. display: flex;
  322. align-items: center;
  323. justify-content: center;
  324. &.active {
  325. background: #2B6EFD;
  326. color: #FFFFFF;
  327. }
  328. }
  329. .cented-box {
  330. background: #F8F8F8;
  331. width: 100%;
  332. height: 100vh;
  333. }
  334. .Pinspeak {
  335. width: 100%;
  336. height: 92rpx;
  337. border-bottom: 1rpx solid #E0E0E0;
  338. font-size: 32rpx;
  339. font-weight: bold;
  340. color: #333333;
  341. text-indent: 30rpx;
  342. line-height: 92rpx;
  343. background: #FFFFFF;
  344. margin-top: 20rpx;
  345. padding-left: 10rpx;
  346. }
  347. .chented {
  348. width: 100%;
  349. padding-left: 30rpx;
  350. padding-right: 30rpx;
  351. background-color: #FFFFFF;
  352. .title {
  353. width: 100%;
  354. height: 110rpx;
  355. border-bottom: 1rpx solid #E0E0E0;
  356. display: flex;
  357. align-items: center;
  358. .titletext {
  359. width: 21%;
  360. height: 110rpx;
  361. font-size: 30rpx;
  362. font-weight: 400;
  363. color: #333333;
  364. line-height: 110rpx;
  365. text-indent: 10rpx;
  366. }
  367. .titletext2 {
  368. width: 71%;
  369. height: 110rpx;
  370. }
  371. .titletext-input {
  372. width: 100%;
  373. height: 110rpx;
  374. font-size: 30rpx;
  375. font-weight: 400;
  376. color: #B2B2B2;
  377. line-height: 110rpx;
  378. padding-left: 10rpx;
  379. }
  380. .titleimg {
  381. width: 8%;
  382. text-align: right;
  383. .titleimg1 {
  384. width: 16rpx;
  385. height: 36rpx;
  386. }
  387. }
  388. }
  389. }
  390. .clive {
  391. position: absolute;
  392. bottom: 32rpx;
  393. left: 30rpx;
  394. right: 30rpx;
  395. width: 690rpx;
  396. height: 88rpx;
  397. background: #2671E2;
  398. text-align: center;
  399. line-height: 88rpx;
  400. color: #FFFFFF;
  401. border-radius: 8rpx;
  402. font-size: 32rpx;
  403. }
  404. </style>