Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

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