Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

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