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.
 
 
 

418 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 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. <!-- {{parames.sourceName||'请选择客户来源'}} -->
  40. <text v-if="parames.sourceName" style="color: #333333;">{{parames.sourceName}}</text>
  41. <text v-else>请选择客户来源</text>
  42. </view>
  43. <view class="titleimg">
  44. <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="Pinspeak" v-if="shifoinfo==0">顾问</view>
  49. <view class="chented" v-if="shifoinfo==0" @click="clickShowhid()">
  50. <view class="title" style="border: none;">
  51. <view class="titletext">接待顾问</view>
  52. <view class="titletext2" style="font-size: 30rpx;font-weight: 400;color: #B2B2B2;line-height: 90rpx;padding-left: 10rpx;">
  53. <!-- {{text || '请选择接待顾问'}} -->
  54. <text v-if="text" style="color: #333333;">{{text}}</text>
  55. <text v-else>请选择接待顾问</text>
  56. </view>
  57. <view class="titleimg">
  58. <image class="titleimg1" src="../../../static/images/arrow.png" mode=""></image>
  59. </view>
  60. </view>
  61. </view>
  62. <view class="clive" @click="save">确定</view>
  63. <view v-if="Showhiddenunits">
  64. <u-select :mask-close-able="false" v-model="Showhiddenunits" mode="single-column" :list="list" @cancel="cancel" @confirm="confirm"></u-select>
  65. </view>
  66. <view v-if="Showhid">
  67. <u-select :mask-close-able="false" v-model="Showhid" mode="single-column" :list="freeList" @cancel="cancel1" @confirm="confirm1"></u-select>
  68. </view>
  69. <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>
  70. </view>
  71. </template>
  72. <script>
  73. var app = getApp();
  74. var config = require("../../../config");
  75. export default {
  76. data() {
  77. return {
  78. Showhiddenunits:false,
  79. list: [
  80. {label: '自然到访',value:'自然到访'},
  81. {label: '渠道推荐',value:'渠道推荐'},
  82. ],
  83. parames: {
  84. name: '',
  85. // 性别1男 2女
  86. sex: 1,
  87. phone: '',
  88. source: null,
  89. sourceName: null,
  90. howMany: 1,
  91. agentId:null,
  92. projectId:'',
  93. replaceReception:0
  94. },
  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. };
  105. },
  106. onShow: function() {
  107. this.parames.projectId=uni.getStorageSync('buildingID').id;
  108. this.init()
  109. this.getFreeList();
  110. },
  111. methods: {
  112. //取消
  113. confirmA(){
  114. if(this.daitiReceptionobj.assign!=null){
  115. this.parames.agentId=this.daitiReceptionobj.assign.accountId;
  116. this.baochunfun()
  117. }else{
  118. uni.showToast({
  119. icon: "none",
  120. title: "【"+this.daitiReceptionobj.owner.name+"】正在接待中"
  121. })
  122. return;
  123. }
  124. },
  125. // 确认
  126. confirmB(){
  127. this.parames.agentId=this.daitiReceptionobj.replacement.accountId;
  128. this.parames.replaceReception=1;
  129. this.baochunfun()
  130. },
  131. save() {
  132. if (this.parames.name.length==0) {
  133. uni.showToast({
  134. icon: "none",
  135. title: "客户姓名不能为空"
  136. })
  137. return;
  138. }
  139. // (this.parames.phone && !this.$u.test.mobile(this.parames.phone))
  140. // if (this.parames.phone) {
  141. // uni.showToast({
  142. // icon: "none",
  143. // title: "手机号码不能为空"
  144. // })
  145. // return;
  146. // }
  147. console.log(this.parames.phone.length)
  148. if (this.parames.phone && this.parames.phone.length<5) {
  149. uni.showToast({
  150. icon: "none",
  151. title: "手机号码不能小于5位"
  152. })
  153. return;
  154. }
  155. if (this.parames.phone && this.parames.phone.length>11) {
  156. uni.showToast({
  157. icon: "none",
  158. title: "手机号码不能大于11位"
  159. })
  160. return;
  161. }
  162. const that = this;
  163. this.$u.post("customer/daitiReception", {
  164. phone: that.parames.phone,
  165. projectId: that.parames.projectId,
  166. agentId:that.parames.agentId
  167. }).then(res => {
  168. if(res.unchecked==0){
  169. that.baochunfun()
  170. }else{
  171. if(res.zs==0){
  172. that.parames.agentId=res.assign.accountId;
  173. that.baochunfun()
  174. }else{
  175. console.log("zo")
  176. if(res.assign==null&&res.replacement==null){
  177. that.baochunfun()
  178. }else{
  179. if(res.assign==null){
  180. that.daitiReceptionobj=res;
  181. that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?"
  182. that.confirmtext=res.replacement.name +"代接代",//确认文字
  183. that.canceltext=res.owner.name +'接待',//取消文字
  184. that.show=true;
  185. }else{
  186. that.daitiReceptionobj=res;
  187. console.log(that.daitiReceptionobj)
  188. that.content="此客户的顾问为【"+ res.owner.name +"】,确认让【"+ res.replacement.name +"】代接待吗?"
  189. that.confirmtext=res.replacement.name +"代接代",//确认文字
  190. that.canceltext=res.assign.name +'接待',//取消文字
  191. that.show=true;
  192. }
  193. }
  194. }
  195. }
  196. })
  197. },
  198. baochunfun(){
  199. const {
  200. dataCode
  201. } = uni.getStorageSync("weapp_session_userInfo_data");
  202. if(this.parames.phone.length==0){
  203. this.parames.phone=null
  204. }
  205. uni.showLoading({
  206. title: "保存中",
  207. mask: true
  208. })
  209. if (dataCode == 6) {
  210. this.$u.post("/customer/gwAdd", this.parames).then(res => {
  211. uni.hideLoading();
  212. uni.showToast({
  213. icon: "none",
  214. title: "保存成功"
  215. })
  216. uni.navigateBack()
  217. })
  218. } else {
  219. this.$u.post("/customer/add", this.parames).then(res => {
  220. uni.hideLoading();
  221. uni.showToast({
  222. icon: "none",
  223. title: "保存成功"
  224. })
  225. uni.navigateBack()
  226. })
  227. }
  228. },
  229. changeSex(sex) {
  230. this.parames.sex = sex;
  231. },
  232. changeHowMany(num) {
  233. this.parames.howMany = num;
  234. },
  235. clickShowhid(){
  236. if(this.freeList.length==0){
  237. uni.showToast({
  238. icon:'none',
  239. title: '当前无可用排班顾问',
  240. duration: 2000
  241. });
  242. }else{
  243. this.Showhid=true;
  244. }
  245. },
  246. cancel1(){
  247. this.Showhid=false;
  248. },
  249. confirm1(e) {
  250. this.text=e[0].label;
  251. this.parames.agentId=e[0].value;
  252. this.Showhid=false;
  253. },
  254. Buildingselection(){
  255. this.Showhiddenunits=true;
  256. },
  257. cancel(){
  258. this.Showhiddenunits=false;
  259. },
  260. confirm(e) {
  261. this.parames.sourceName=e[0].value;
  262. this.Showhiddenunits=false;
  263. },
  264. init(){
  265. uni.request({
  266. url: config.service.getSelfAssignedByHouseId+"?houseId="+this.parames.projectId,
  267. method: "GET",
  268. header: {
  269. 'content-type': 'application/json',
  270. 'Access-Token': uni.getStorageSync('weapp_session_login_data').token
  271. },
  272. success: (data) => {
  273. if(data.data.code==10000){
  274. this.shifoinfo=data.data.data.selfAssigned
  275. }
  276. }
  277. })
  278. },
  279. //获取顾问列表
  280. getFreeList() {
  281. this.$u.get("/zkAgentPool/freeList?itemId="+this.parames.projectId).then(res => {
  282. this.freeList = res;
  283. this.freeList.forEach(item=>{
  284. if(item.onLine==0){
  285. item.label=item.name+"(离线)";
  286. }else if(item.onLine==1){
  287. item.label=item.name+"(在线)";
  288. }else{
  289. item.label=item.name+"(无设备)";
  290. }
  291. item.value=item.agentId
  292. })
  293. })
  294. },
  295. }
  296. };
  297. </script>
  298. <style lang="scss" scoped>
  299. .sexRadio{
  300. color: #BFBFBF;
  301. border: 1rpx solid #BFBFBF;
  302. font-size: 24upx;
  303. width: 100rpx;
  304. height: 43rpx;
  305. text-align: center;
  306. line-height: 40rpx;
  307. &:last-child {
  308. margin-left: 20rpx;
  309. }
  310. &.active {
  311. color: #2B6FFF;
  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: 90rpx;
  355. border-bottom: 1rpx solid #E0E0E0;
  356. display: flex;
  357. align-items: center;
  358. .titletext{
  359. width: 21%;
  360. height: 90rpx;
  361. font-size: 30rpx;
  362. font-weight: 400;
  363. color: #333333;
  364. line-height: 90rpx;
  365. text-indent: 10rpx;
  366. }
  367. .titletext2{
  368. width: 71%;
  369. height: 90rpx;
  370. }
  371. .titletext-input{
  372. width: 100%;
  373. height: 90rpx;
  374. font-size: 30rpx;
  375. font-weight: 400;
  376. color: #B2B2B2;
  377. line-height: 90rpx;
  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. width: 690rpx;
  392. height: 88rpx;
  393. background: #2671E2;
  394. text-align: center;
  395. line-height: 88rpx;
  396. color: #FFFFFF;
  397. border-radius: 8rpx;
  398. margin: 0 auto;
  399. margin-top: 300rpx;
  400. font-size: 32rpx;
  401. }
  402. </style>