setfollow.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. <template>
  2. <view>
  3. <scroll-view scroll-x class="bg-white radius nav echo-fixed-top">
  4. <view class="flex text-center solid-bottom">
  5. <view class="cu-item flex-sub" :class="1==TabCur?'text-blue cur':''" @tap="tabSelect" :data-id="1">
  6. 上报跟进信息
  7. </view>
  8. <view class="cu-item flex-sub" :class="2==TabCur?'text-blue cur':''" @tap="tabSelect" :data-id="2">
  9. 往期跟进记录
  10. </view>
  11. </view>
  12. </scroll-view>
  13. <view class="echo-fixed-top-empty"></view>
  14. <view class="cu-list menu margin-bottom-sm">
  15. <view class="cu-item">
  16. <view class="content">
  17. <text>昵称/姓名</text>
  18. </view>
  19. <view class="action">
  20. <text>{{user.nickname}} / {{user.realname}}</text>
  21. </view>
  22. </view>
  23. <view class="cu-item">
  24. <view class="content">
  25. <text>当前状态</text>
  26. </view>
  27. <view class="action">
  28. <text>{{forminfo.followstatusarr[parseInt(user.followstatus)-1]}}</text>
  29. </view>
  30. </view>
  31. <view class="cu-item arrow" @tap="makePhone()">
  32. <view class="content">
  33. <text>手机号</text>
  34. </view>
  35. <view class="action">
  36. <text>{{user.mobile}}</text>
  37. </view>
  38. </view>
  39. </view>
  40. <form v-if="1==TabCur">
  41. <view class="cu-form-group">
  42. <view class="title">跟进状态</view>
  43. <picker @change="followstatusChange" :value="forminfo.followstatus" :range="forminfo.followstatusarr">
  44. <view class="picker">
  45. {{forminfo.followstatusarr[forminfo.followstatus]}}
  46. </view>
  47. </picker>
  48. </view>
  49. <view class="cu-form-group">
  50. <view class="title">跟进方式</view>
  51. <picker @change="ftypeChange" :value="forminfo.ftype" :range="forminfo.ftypearr">
  52. <view class="picker">
  53. {{forminfo.ftypearr[forminfo.ftype]}}
  54. </view>
  55. </picker>
  56. </view>
  57. <view class="cu-form-group align-start">
  58. <view class="title">备注信息</view>
  59. <textarea maxlength="-1" placeholder="请输入跟进的具体内容..." @input="bindInput" data-val="remark" :value="forminfo.remark"></textarea>
  60. </view>
  61. <view class="padding flex flex-direction">
  62. <button class="cu-btn bg-blue margin-tb-sm lg" @tap="sendFollow">确认提交</button>
  63. </view>
  64. </form>
  65. <block v-if="2==TabCur">
  66. <view class="padding text-center text-grey" v-if="user.userFollow.length==0">
  67. 还没有有跟进记录...
  68. </view>
  69. <view v-else>
  70. <view class="cu-timeline" v-for="(item,index) in user.userFollow" :key="index">
  71. <view class="cu-time">{{item.createtime}}</view>
  72. <view class="cu-item text-blue">
  73. <view class="content">
  74. <text>【{{item.ftype}}】</text> {{item.remark}}
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </block>
  80. </view>
  81. </template>
  82. <script>
  83. var _this;
  84. export default {
  85. data() {
  86. return {
  87. TabCur: 1,
  88. isRotate: false,
  89. brokerinfo: {},
  90. user: {},
  91. forminfo: {
  92. followstatusarr: ['未跟进', '未面试', '面试通过', '面试未通过', '用户放弃', '已入职', '已离职'],
  93. followstatus: 0,
  94. ftypearr: ['电话', '微信/QQ', '其他'],
  95. ftype: 0,
  96. remark: ""
  97. }
  98. }
  99. },
  100. onLoad: function(option) {
  101. _this = this;
  102. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  103. var userid = option.userid || 0;
  104. _this.$req.ajax({
  105. path: "broker/getmyuser",
  106. data: {
  107. userid: userid,
  108. brokerid: _this.brokerinfo.id
  109. }
  110. }).then((data) => {
  111. _this.user = data.user;
  112. _this.forminfo.followstatus = parseInt(data.user.followstatus) - 1;
  113. }).catch((err) => {
  114. uni.showModal({
  115. title: '信息提示',
  116. content: err,
  117. showCancel: false
  118. });
  119. });
  120. },
  121. methods: {
  122. sendFollow: function() {
  123. if(_this.isRotate){
  124. return false;
  125. }
  126. _this.isRotate = true;
  127. _this.$req.ajax({
  128. path: "broker/sendfollow",
  129. data: {
  130. userid: _this.user.id,
  131. followstatus: parseInt(_this.forminfo.followstatus) + 1,
  132. ftype: _this.forminfo.ftypearr[_this.forminfo.ftype],
  133. remark: _this.forminfo.remark
  134. }
  135. }).then((data) => {
  136. _this.user = data.user;
  137. _this.forminfo.followstatus = parseInt(data.user.followstatus) - 1;
  138. uni.showModal({
  139. title: '信息提示',
  140. content: "跟进信息提交成功。",
  141. showCancel: false,
  142. success: function(res) {
  143. if (res.confirm) {
  144. _this.TabCur = 2;
  145. }
  146. }
  147. });
  148. _this.isRotate = false;
  149. }).catch((err) => {
  150. uni.showModal({
  151. title: '信息提示',
  152. content: err,
  153. showCancel: false
  154. });
  155. _this.isRotate = false;
  156. });
  157. },
  158. followstatusChange: function(e) {
  159. _this.forminfo.followstatus = e.detail.value
  160. },
  161. ftypeChange: function(e) {
  162. _this.forminfo.ftype = e.detail.value
  163. },
  164. bindInput: function(e) {
  165. var dataval = e.currentTarget.dataset.val;
  166. _this.forminfo[dataval] = e.detail.value;
  167. },
  168. makePhone: function() {
  169. uni.makePhoneCall({
  170. phoneNumber: _this.user.mobile
  171. });
  172. },
  173. goLPage: function(pageurl) {
  174. _this.userinfo = _this.checkLogin("/pages/my/my");
  175. if (_this.userinfo===false){
  176. return false;
  177. }
  178. uni.navigateTo({
  179. url: pageurl,
  180. fail: function(){
  181. uni.switchTab({
  182. url: pageurl
  183. });
  184. }
  185. });
  186. },
  187. tabSelect: function(e) {
  188. _this.TabCur = e.currentTarget.dataset.id;
  189. }
  190. }
  191. }
  192. </script>
  193. <style>
  194. .cu-time{ width: 300rpx !important; padding-left: 30rpx !important; text-align: left !important; }
  195. </style>