Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

393 wiersze
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. item.label=item.name;
  267. item.value=item.agentId
  268. })
  269. })
  270. },
  271. }
  272. };
  273. </script>
  274. <style lang="scss" scoped>
  275. .sexRadio{
  276. color: #BFBFBF;
  277. border: 1rpx solid #BFBFBF;
  278. font-size: 24upx;
  279. width: 100rpx;
  280. height: 43rpx;
  281. text-align: center;
  282. line-height: 40rpx;
  283. &:last-child {
  284. margin-left: 20rpx;
  285. }
  286. &.active {
  287. color: #2B6FFF;
  288. border-color: #2B6FFF;
  289. }
  290. }
  291. .num {
  292. width: 50rpx;
  293. height: 50rpx;
  294. background: rgba(43, 110, 253, 0.1);
  295. color: #2B6EFD;
  296. font-size: 30rpx;
  297. display: flex;
  298. align-items: center;
  299. justify-content: center;
  300. &.active {
  301. background: #2B6EFD;
  302. color: #FFFFFF;
  303. }
  304. }
  305. .cented-box{
  306. background: #F8F8F8;
  307. width: 100%;
  308. height: 100vh;
  309. }
  310. .Pinspeak{
  311. width: 100%;
  312. height: 92rpx;
  313. border-bottom: 1rpx solid #E0E0E0;
  314. font-size: 32rpx;
  315. font-weight: bold;
  316. color: #333333;
  317. text-indent: 30rpx;
  318. line-height: 92rpx;
  319. background: #FFFFFF;
  320. margin-top: 20rpx;
  321. padding-left: 10rpx;
  322. }
  323. .chented{
  324. width: 100%;
  325. padding-left: 30rpx;
  326. padding-right: 30rpx;
  327. background-color: #FFFFFF;
  328. .title{
  329. width: 100%;
  330. height: 90rpx;
  331. border-bottom: 1rpx solid #E0E0E0;
  332. display: flex;
  333. align-items: center;
  334. .titletext{
  335. width: 21%;
  336. height: 90rpx;
  337. font-size: 30rpx;
  338. font-weight: 400;
  339. color: #333333;
  340. line-height: 90rpx;
  341. text-indent: 10rpx;
  342. }
  343. .titletext2{
  344. width: 71%;
  345. height: 90rpx;
  346. }
  347. .titletext-input{
  348. width: 100%;
  349. height: 90rpx;
  350. font-size: 30rpx;
  351. font-weight: 400;
  352. color: #B2B2B2;
  353. line-height: 90rpx;
  354. padding-left: 10rpx;
  355. }
  356. .titleimg{
  357. width: 8%;
  358. text-align: right;
  359. .titleimg1{
  360. width: 16rpx;
  361. height: 36rpx;
  362. }
  363. }
  364. }
  365. }
  366. .clive{
  367. width: 690rpx;
  368. height: 88rpx;
  369. background: #2671E2;
  370. text-align: center;
  371. line-height: 88rpx;
  372. color: #FFFFFF;
  373. border-radius: 8rpx;
  374. margin: 0 auto;
  375. margin-top: 300rpx;
  376. font-size: 32rpx;
  377. }
  378. </style>