Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

addreception.vue 12 KiB

pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
pirms 2 gadiem
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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 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"
  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: 90rpx;padding-left: 10rpx;">
  44. <text v-if="showSourceName" style="color: #333333;">{{showSourceName}}</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. <template v-if="shifoinfo==0">
  53. <view class="Pinspeak">顾问</view>
  54. <view class="chented" @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: 90rpx;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. </template>
  69. <view class="clive" @click.stop="$noMultipleClicks(save)" :style="{background:(isBand==false?'#2671E2':'#949494')}">确定</view>
  70. <!-- <view v-if="Showhiddenunits"> -->
  71. <!-- <u-select v-model="show" :list="list"></u-select> -->
  72. <u-select :mask-close-able="false" label-name="sourceName" value-name="id" v-model="Showhiddenunits"
  73. mode="single-column" :list="list" @cancel="cancel" @confirm="confirm"></u-select>
  74. <!-- </view> -->
  75. <u-select :mask-close-able="false" v-model="Showhid" mode="single-column" :list="freeList" @cancel="cancel1"
  76. @confirm="confirm1"></u-select>
  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. noClick: true,
  89. Showhiddenunits: false,
  90. list: [
  91. // {label: '自然到访',value:'自然到访'},
  92. // {label: '渠道推荐',value:'渠道推荐'},
  93. ],
  94. parames: {
  95. name: '',
  96. // 性别1男 2女
  97. sex: 1,
  98. phone: '',
  99. source: null,
  100. sourceId: null,
  101. howMany: 1,
  102. agentId: null,
  103. projectId: '',
  104. replaceReception: 0
  105. },
  106. showSourceName: '', // 展示文字
  107. shifoinfo: 0,
  108. freeList: [],
  109. Showhid: false,
  110. text: null,
  111. show: false,
  112. content: '',
  113. confirmtext: '', //确认文字
  114. canceltext: '', //取消文字
  115. daitiReceptionobj: {},
  116. saveisshow: true,
  117. isBand: false, // 阻止二次提交
  118. tap: true,
  119. fdFlag:null
  120. };
  121. },
  122. computed: {
  123. },
  124. onShow() {
  125. this.parames.projectId = uni.getStorageSync('buildingID').id;
  126. console.log(this.$u)
  127. this.init()
  128. this.getFreeList();
  129. this.getFromSource();
  130. },
  131. methods: {
  132. // 获取客户来源
  133. getFromSource() {
  134. uni.request({
  135. url: config.service.sourceList + "?houseId=" + this.parames.projectId,
  136. method: "GET",
  137. header: {
  138. 'content-type': 'application/json',
  139. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  140. },
  141. success: (data) => {
  142. console.log(data)
  143. if (data.data.code == 10000) {
  144. // this.shifoinfo=data.data.data.selfAssigned
  145. this.list = data.data.data
  146. }
  147. }
  148. })
  149. },
  150. //取消
  151. confirmA() {
  152. if (this.daitiReceptionobj.assign != null) {
  153. this.parames.agentId = this.daitiReceptionobj.assign.accountId;
  154. this.baochunfun()
  155. } else {
  156. uni.showToast({
  157. icon: "none",
  158. title: "【" + this.daitiReceptionobj.owner.name + "】正在接待中"
  159. })
  160. return;
  161. }
  162. },
  163. // 确认
  164. confirmB() {
  165. this.parames.agentId = this.daitiReceptionobj.replacement.accountId;
  166. this.parames.replaceReception = 1;
  167. this.baochunfun()
  168. },
  169. btnSave() {
  170. if (this.isBand) return
  171. this.save()
  172. },
  173. save() {
  174. if (this.parames.name.length == 0) {
  175. uni.showToast({
  176. icon: "none",
  177. title: "客户姓名不能为空"
  178. })
  179. return;
  180. }
  181. if (this.parames.phone && !this.$u.test.mobile(this.parames.phone)) {
  182. uni.showToast({
  183. icon: "none",
  184. title: "手机号码格式不正确"
  185. })
  186. return;
  187. }
  188. const that = this;
  189. this.isBand = true
  190. this.$u.post("customer/daitiReception", {
  191. phone: that.parames.phone,
  192. projectId: that.parames.projectId,
  193. agentId: that.parames.agentId
  194. }).then(res => {
  195. if (res.unchecked == 0) {
  196. that.baochunfun()
  197. this.tap = false;
  198. } else {
  199. if (res.zs == 0) {
  200. that.parames.agentId = res.assign.accountId;
  201. that.baochunfun()
  202. this.tap = false;
  203. } else {
  204. console.log("zo")
  205. if (res.assign == null && res.replacement == null) {
  206. that.baochunfun()
  207. this.tap = false;
  208. } else {
  209. if (res.assign == null) {
  210. that.daitiReceptionobj = res;
  211. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  212. "】代接待吗?"
  213. that.confirmtext = res.replacement.name + "代接待", //确认文字
  214. that.canceltext = res.owner.name + '接待', //取消文字
  215. that.show = true;
  216. this.isBand = false
  217. } else {
  218. that.daitiReceptionobj = res;
  219. console.log(that.daitiReceptionobj)
  220. that.content = "此客户的顾问为【" + res.owner.name + "】,确认让【" + res.replacement.name +
  221. "】代接待吗?"
  222. that.confirmtext = res.replacement.name + "代接待", //确认文字
  223. that.canceltext = res.assign.name + '接待', //取消文字
  224. that.show = true;
  225. this.isBand = false
  226. }
  227. }
  228. }
  229. }
  230. }).catch(e => {
  231. that.show = true;
  232. this.isBand = false
  233. })
  234. },
  235. baochunfun() {
  236. const {
  237. dataCode
  238. } = uni.getStorageSync("weapp_session_userInfo_data");
  239. if (this.parames.phone.length == 0) {
  240. this.parames.phone = null
  241. }
  242. uni.showLoading({
  243. title: "保存中",
  244. mask: true
  245. })
  246. if (dataCode == 6) {
  247. this.$u.post("/customer/gwAdd", this.parames).then(res => {
  248. this.saveisshow = true;
  249. uni.hideLoading();
  250. uni.showToast({
  251. icon: "none",
  252. title: "保存成功"
  253. })
  254. uni.navigateBack()
  255. }).catch(e => {
  256. this.isBand = false
  257. })
  258. } else {
  259. this.$u.post("/customer/add", this.parames).then(res => {
  260. this.saveisshow = true;
  261. uni.hideLoading();
  262. uni.showToast({
  263. icon: "none",
  264. title: "保存成功"
  265. })
  266. uni.navigateBack()
  267. }).catch(e => {
  268. this.isBand = false
  269. })
  270. }
  271. },
  272. changeSex(sex) {
  273. this.parames.sex = sex;
  274. },
  275. changeHowMany(num) {
  276. this.parames.howMany = num;
  277. },
  278. clickShowhid() {
  279. if (this.freeList.length == 0) {
  280. uni.showToast({
  281. icon: 'none',
  282. title: '当前无可用排班顾问',
  283. duration: 2000
  284. });
  285. } else {
  286. this.Showhid = true;
  287. }
  288. },
  289. cancel1() {
  290. this.Showhid = false;
  291. },
  292. confirm1(e) {
  293. this.text = e[0].label;
  294. this.parames.agentId = e[0].value;
  295. this.Showhid = false;
  296. },
  297. Buildingselection() {
  298. this.Showhiddenunits = true;
  299. },
  300. cancel() {
  301. this.Showhiddenunits = false;
  302. },
  303. confirm(e) {
  304. console.log(e)
  305. this.showSourceName = e[0].label;
  306. this.parames.sourceId = e[0].value;
  307. this.Showhiddenunits = false;
  308. },
  309. init() {
  310. uni.request({
  311. url: config.service.getSelfAssignedByHouseId + "?houseId=" + this.parames.projectId,
  312. method: "GET",
  313. header: {
  314. 'content-type': 'application/json',
  315. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  316. },
  317. success: (data) => {
  318. if (data.data.code == 10000) {
  319. this.shifoinfo = data.data.data.selfAssigned
  320. }
  321. }
  322. })
  323. },
  324. //获取顾问列表
  325. getFreeList() {
  326. this.$u.get("/zkAgentPool/freeList?itemId=" + this.parames.projectId).then(res => {
  327. this.freeList = res;
  328. this.freeList.forEach(item => {
  329. if (item.onLine == 0) {
  330. item.label = item.name + "(离线)";
  331. } else if (item.onLine == 1) {
  332. item.label = item.name + "(在线)";
  333. } else {
  334. item.label = item.name + "(无设备)";
  335. }
  336. item.value = item.agentId
  337. })
  338. })
  339. },
  340. }
  341. };
  342. </script>
  343. <style lang="scss" scoped>
  344. .sexRadio {
  345. color: #BFBFBF;
  346. border: 1rpx solid #BFBFBF;
  347. font-size: 24upx;
  348. width: 100rpx;
  349. height: 43rpx;
  350. text-align: center;
  351. line-height: 40rpx;
  352. &:last-child {
  353. margin-left: 20rpx;
  354. }
  355. &.active {
  356. color: #2B6FFF;
  357. border-color: #2B6FFF;
  358. }
  359. }
  360. .num {
  361. width: 50rpx;
  362. height: 50rpx;
  363. background: rgba(43, 110, 253, 0.1);
  364. color: #2B6EFD;
  365. font-size: 30rpx;
  366. display: flex;
  367. align-items: center;
  368. justify-content: center;
  369. &.active {
  370. background: #2B6EFD;
  371. color: #FFFFFF;
  372. }
  373. }
  374. .cented-box {
  375. background: #F8F8F8;
  376. width: 100%;
  377. height: 100vh;
  378. }
  379. .Pinspeak {
  380. width: 100%;
  381. height: 92rpx;
  382. border-bottom: 1rpx solid #E0E0E0;
  383. font-size: 32rpx;
  384. font-weight: bold;
  385. color: #333333;
  386. text-indent: 30rpx;
  387. line-height: 92rpx;
  388. background: #FFFFFF;
  389. margin-top: 20rpx;
  390. padding-left: 10rpx;
  391. }
  392. .chented {
  393. width: 100%;
  394. padding-left: 30rpx;
  395. padding-right: 30rpx;
  396. background-color: #FFFFFF;
  397. .title {
  398. width: 100%;
  399. height: 90rpx;
  400. border-bottom: 1rpx solid #E0E0E0;
  401. display: flex;
  402. align-items: center;
  403. .titletext {
  404. width: 21%;
  405. height: 90rpx;
  406. font-size: 30rpx;
  407. font-weight: 400;
  408. color: #333333;
  409. line-height: 90rpx;
  410. text-indent: 10rpx;
  411. }
  412. .titletext2 {
  413. width: 71%;
  414. height: 90rpx;
  415. }
  416. .titletext-input {
  417. width: 100%;
  418. height: 90rpx;
  419. font-size: 30rpx;
  420. font-weight: 400;
  421. color: #B2B2B2;
  422. line-height: 90rpx;
  423. padding-left: 10rpx;
  424. }
  425. .titleimg {
  426. width: 8%;
  427. text-align: right;
  428. .titleimg1 {
  429. width: 16rpx;
  430. height: 36rpx;
  431. }
  432. }
  433. }
  434. }
  435. .clive {
  436. width: 690rpx;
  437. height: 88rpx;
  438. background: #2671E2;
  439. text-align: center;
  440. line-height: 88rpx;
  441. color: #FFFFFF;
  442. border-radius: 8rpx;
  443. margin: 0 auto;
  444. margin-top: 300rpx;
  445. font-size: 32rpx;
  446. }
  447. .clive2 {
  448. width: 690rpx;
  449. height: 88rpx;
  450. background: #999;
  451. text-align: center;
  452. line-height: 88rpx;
  453. color: #666;
  454. border-radius: 8rpx;
  455. margin: 0 auto;
  456. margin-top: 300rpx;
  457. font-size: 32rpx;
  458. }
  459. </style>