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.
 
 
 

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