AI销管
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

addreception.vue 11 KiB

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