You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

addreception.vue 11 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
2 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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" placeholder-class="titletext-input" placeholder-style="color:#B2B2B2;" type="text" placeholder="请输入客户姓名(必填)" />
  9. </view>
  10. <view class="titleimg">
  11. <!-- <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image> -->
  12. </view>
  13. </view>
  14. <view class="title">
  15. <view class="titletext">客户性别</view>
  16. <view class="titletext2 displayclick" style="display: flex;align-items: center;padding-left: 10rpx;">
  17. <view class="sexRadio" @click="changeSex(1)" :class="{active:parames.sex == 1}">男士</view>
  18. <view class="sexRadio" @click="changeSex(2)" :class="{active:parames.sex == 2}">女士</view>
  19. </view>
  20. </view>
  21. <view class="title">
  22. <view class="titletext">联系电话</view>
  23. <view class="titletext2">
  24. <input class="titletext-input" style="color: #333333;" v-model="parames.phone" placeholder-class="titletext-input" placeholder-style="color:#B2B2B2;" type="number" placeholder="请输入联系电话" />
  25. </view>
  26. </view>
  27. <view class="title">
  28. <view class="titletext">接待人数</view>
  29. <view class="titletext2" style="display: flex;align-items: center;justify-content: space-around;">
  30. <view class="num" v-for="i in 6" :key="i" :class="{active:parames.howMany == i+1}"
  31. @click="changeHowMany(i+1)">
  32. {{i + 1}}
  33. </view>
  34. </view>
  35. </view>
  36. <view class="title" style="border: none;" @click="Buildingselection()">
  37. <view class="titletext">客户来源</view>
  38. <view class="titletext2" style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 90rpx;padding-left: 10rpx;">
  39. <text v-if="parames.sourceId" style="color: #333333;">{{showSourceName}}</text>
  40. <text v-else>请选择客户来源</text>
  41. </view>
  42. <view class="titleimg">
  43. <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image>
  44. </view>
  45. </view>
  46. </view>
  47. <view class="Pinspeak" v-if="shifoinfo==0">顾问</view>
  48. <view class="chented" v-if="shifoinfo==0" @click="clickShowhid()">
  49. <view class="title" style="border: none;">
  50. <view class="titletext">接待顾问</view>
  51. <view class="titletext2" style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 90rpx;padding-left: 10rpx;">
  52. <!-- {{text || '请选择接待顾问'}} -->
  53. <text v-if="text" style="color: #333333;">{{text}}</text>
  54. <text v-else>请选择接待顾问</text>
  55. </view>
  56. <view class="titleimg">
  57. <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="clive" v-if="saveisshow" @click.stop="save">确定</view>
  62. <view class="clive2" v-else >确定</view>
  63. <!-- <view v-if="Showhiddenunits"> -->
  64. <!-- <u-select v-model="show" :list="list"></u-select> -->
  65. <u-select :mask-close-able="false" label-name="sourceName" value-name="id" v-model="Showhiddenunits" mode="single-column" :list="list" @cancel="cancel" @confirm="confirm"></u-select>
  66. <!-- </view> -->
  67. <u-select :mask-close-able="false" v-model="Showhid" mode="single-column" :list="freeList" @cancel="cancel1" @confirm="confirm1"></u-select>
  68. <u-modal v-model="show" :mask-close-able="true" :title="'代接待提醒'" :confirm-text="confirmtext" :cancel-text='canceltext' @cancel="confirmA" @confirm="confirmB" :show-cancel-button='true' :content="content"></u-modal>
  69. </view>
  70. </template>
  71. <script>
  72. var app = getApp();
  73. var config = require("../../../config");
  74. export default {
  75. data() {
  76. return {
  77. Showhiddenunits:false,
  78. list: [
  79. // {label: '自然到访',value:'自然到访'},
  80. // {label: '渠道推荐',value:'渠道推荐'},
  81. ],
  82. parames: {
  83. name: '',
  84. // 性别1男 2女
  85. sex: 1,
  86. phone: '',
  87. source: null,
  88. sourceId: null,
  89. howMany: 1,
  90. agentId:null,
  91. projectId:'',
  92. replaceReception:0
  93. },
  94. showSourceName: '', // 展示文字
  95. shifoinfo:0,
  96. freeList:[],
  97. Showhid:false,
  98. text:null,
  99. show:false,
  100. content: '东临碣石,以观沧海',
  101. confirmtext:'1',//确认文字
  102. canceltext:'2',//取消文字
  103. daitiReceptionobj:{},
  104. saveisshow:true,
  105. };
  106. },
  107. onShow() {
  108. this.parames.projectId=uni.getStorageSync('buildingID').id;
  109. this.init()
  110. this.getFreeList();
  111. this.getFromSource();
  112. },
  113. methods: {
  114. // 获取客户来源
  115. getFromSource() {
  116. uni.request({
  117. url: config.service.sourceList+"?houseId="+this.parames.projectId,
  118. method: "GET",
  119. header: {
  120. 'content-type': 'application/json',
  121. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  122. },
  123. success: (data) => {
  124. console.log(data)
  125. if(data.data.code==10000){
  126. // this.shifoinfo=data.data.data.selfAssigned
  127. this.list = data.data.data
  128. }
  129. }
  130. })
  131. },
  132. //取消
  133. confirmA(){
  134. if(this.daitiReceptionobj.assign!=null){
  135. this.parames.agentId=this.daitiReceptionobj.assign.accountId;
  136. this.baochunfun()
  137. }else{
  138. uni.showToast({
  139. icon: "none",
  140. title: "【"+this.daitiReceptionobj.owner.name+"】正在接待中"
  141. })
  142. return;
  143. }
  144. },
  145. // 确认
  146. confirmB(){
  147. this.parames.agentId=this.daitiReceptionobj.replacement.accountId;
  148. this.parames.replaceReception=1;
  149. this.baochunfun()
  150. },
  151. save() {
  152. this.saveisshow=false;
  153. if (this.parames.name.length==0) {
  154. uni.showToast({
  155. icon: "none",
  156. title: "客户姓名不能为空"
  157. })
  158. this.saveisshow=true;
  159. return;
  160. }
  161. if (this.parames.phone && !this.$u.test.mobile(this.parames.phone)) {
  162. uni.showToast({
  163. icon: "none",
  164. title: "手机号码格式不正确"
  165. })
  166. this.saveisshow=true;
  167. return;
  168. }
  169. const that = this;
  170. this.$u.post("customer/daitiReception", {
  171. phone: that.parames.phone,
  172. projectId: that.parames.projectId,
  173. agentId:that.parames.agentId
  174. }).then(res => {
  175. if(res.unchecked==0){
  176. that.baochunfun()
  177. }else{
  178. if(res.zs==0){
  179. that.parames.agentId=res.assign.accountId;
  180. that.baochunfun()
  181. }else{
  182. console.log("zo")
  183. if(res.assign==null&&res.replacement==null){
  184. that.baochunfun()
  185. }else{
  186. if(res.assign==null){
  187. that.daitiReceptionobj=res;
  188. that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?"
  189. that.confirmtext=res.replacement.name +"代接代",//确认文字
  190. that.canceltext=res.owner.name +'接待',//取消文字
  191. that.show=true;
  192. }else{
  193. that.daitiReceptionobj=res;
  194. console.log(that.daitiReceptionobj)
  195. that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?"
  196. that.confirmtext=res.replacement.name +"代接代",//确认文字
  197. that.canceltext=res.assign.name +'接待',//取消文字
  198. that.show=true;
  199. }
  200. }
  201. }
  202. }
  203. })
  204. },
  205. baochunfun(){
  206. const {
  207. dataCode
  208. } = uni.getStorageSync("weapp_session_userInfo_data");
  209. if(this.parames.phone.length==0){
  210. this.parames.phone=null
  211. }
  212. uni.showLoading({
  213. title: "保存中",
  214. mask: true
  215. })
  216. if (dataCode == 6) {
  217. this.$u.post("/customer/gwAdd", this.parames).then(res => {
  218. this.saveisshow=true;
  219. uni.hideLoading();
  220. uni.showToast({
  221. icon: "none",
  222. title: "保存成功"
  223. })
  224. uni.navigateBack()
  225. })
  226. } else {
  227. this.$u.post("/customer/add", this.parames).then(res => {
  228. this.saveisshow=true;
  229. uni.hideLoading();
  230. uni.showToast({
  231. icon: "none",
  232. title: "保存成功"
  233. })
  234. uni.navigateBack()
  235. })
  236. }
  237. },
  238. changeSex(sex) {
  239. this.parames.sex = sex;
  240. },
  241. changeHowMany(num) {
  242. this.parames.howMany = num;
  243. },
  244. clickShowhid(){
  245. if(this.freeList.length==0){
  246. uni.showToast({
  247. icon:'none',
  248. title: '当前无可用排班顾问',
  249. duration: 2000
  250. });
  251. }else{
  252. this.Showhid=true;
  253. }
  254. },
  255. cancel1(){
  256. this.Showhid=false;
  257. },
  258. confirm1(e) {
  259. this.text=e[0].label;
  260. this.parames.agentId=e[0].value;
  261. this.Showhid=false;
  262. },
  263. Buildingselection(){
  264. this.Showhiddenunits=true;
  265. },
  266. cancel(){
  267. this.Showhiddenunits=false;
  268. },
  269. confirm(e) {
  270. this.showSourceName = e[0].label;
  271. this.parames.sourceId=e[0].value;
  272. this.Showhiddenunits=false;
  273. },
  274. init(){
  275. uni.request({
  276. url: config.service.getSelfAssignedByHouseId+"?houseId="+this.parames.projectId,
  277. method: "GET",
  278. header: {
  279. 'content-type': 'application/json',
  280. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  281. },
  282. success: (data) => {
  283. if(data.data.code==10000){
  284. this.shifoinfo=data.data.data.selfAssigned
  285. }
  286. }
  287. })
  288. },
  289. //获取顾问列表
  290. getFreeList() {
  291. this.$u.get("/zkAgentPool/freeList?itemId="+this.parames.projectId).then(res => {
  292. this.freeList = res;
  293. this.freeList.forEach(item=>{
  294. if(item.onLine==0){
  295. item.label=item.name+"(离线)";
  296. }else if(item.onLine==1){
  297. item.label=item.name+"(在线)";
  298. }else{
  299. item.label=item.name+"(无设备)";
  300. }
  301. item.value=item.agentId
  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: 100rpx;
  314. height: 43rpx;
  315. text-align: center;
  316. line-height: 40rpx;
  317. &:last-child {
  318. margin-left: 20rpx;
  319. }
  320. &.active {
  321. color: #2B6FFF;
  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: 90rpx;
  365. border-bottom: 1rpx solid #E0E0E0;
  366. display: flex;
  367. align-items: center;
  368. .titletext{
  369. width: 21%;
  370. height: 90rpx;
  371. font-size: 30rpx;
  372. font-weight: 400;
  373. color: #333333;
  374. line-height: 90rpx;
  375. text-indent: 10rpx;
  376. }
  377. .titletext2{
  378. width: 71%;
  379. height: 90rpx;
  380. }
  381. .titletext-input{
  382. width: 100%;
  383. height: 90rpx;
  384. font-size: 30rpx;
  385. font-weight: 400;
  386. color: #B2B2B2;
  387. line-height: 90rpx;
  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. width: 690rpx;
  402. height: 88rpx;
  403. background: #2671E2;
  404. text-align: center;
  405. line-height: 88rpx;
  406. color: #FFFFFF;
  407. border-radius: 8rpx;
  408. margin: 0 auto;
  409. margin-top: 300rpx;
  410. font-size: 32rpx;
  411. }
  412. .clive2{
  413. width: 690rpx;
  414. height: 88rpx;
  415. background: #9999;
  416. text-align: center;
  417. line-height: 88rpx;
  418. color: #666;
  419. border-radius: 8rpx;
  420. margin: 0 auto;
  421. margin-top: 300rpx;
  422. font-size: 32rpx;
  423. }
  424. </style>