customer-visit.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view>
  3. <ul style="list-style: none;padding-left: 0px;margin-top: 20rpx;">
  4. <li v-for="data in msgdata" :key="data.customerId" style="margin:0 auto 40rpx;padding: 20rpx;width: 90%;background-color: #f5f5f5;">
  5. <view class="slot-text-filename" @click="clickDetail(data)">
  6. <text>{{data.customerName}}</text>
  7. </view>
  8. <view class="slot-text-msg" @click="clickDetail(data)" style="display: flex;flex-direction: column;">
  9. <text class="slot-text-msg-data" style="font-size: 30rpx;">拜访时间:{{data.visitTime}}</text>
  10. <text class="slot-text-msg-data" style="font-size: 30rpx;">拜访方式:{{data.visitMethod | filterMethod}}</text>
  11. <text class="slot-text-msg-data" style="font-size: 30rpx;">回访记录:{{data.record}}</text>
  12. <text class="slot-text-msg-data" style="font-size: 30rpx;">是否内部客户:{{data.isIn | filterIn}} </text>
  13. </view>
  14. <view class="slot-text-btn">
  15. <button class="btn-modify" @click="modifyF(data.visitId)">修改</button>
  16. <button class="btn-delete" @click="deleteF(data.visitId)">删除</button>
  17. </view>
  18. </li>
  19. </ul>
  20. <view class="tips-box" v-show="isShow">
  21. <text style="line-height: 150rpx;">确认删除?</text>
  22. <view class="tips-btn">
  23. <button @click="close">取消</button>
  24. <button @click="handleDelete()">确认</button>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script>
  30. import { listVisit,delVisit } from "../../api/marketmini/index"
  31. export default {
  32. data() {
  33. return {
  34. visit:'visit',
  35. msgdata:[
  36. {
  37. customerId: 7,
  38. customerName: "周杰伦",
  39. isIn: 2,
  40. record: "新歌不错",
  41. visitId: "1",
  42. visitMethod: 1,
  43. visitTime: "2022-07-12"
  44. }
  45. ],
  46. queryParams: {
  47. pageNum: 1,
  48. pageSize: 10,
  49. // visitMethod: null,
  50. // isIn: null,
  51. },
  52. isShow:false,
  53. deleteid:''
  54. };
  55. },
  56. methods:{
  57. createF(){
  58. uni.navigateTo({
  59. url:"/pages/newAdd/newAdd"
  60. })
  61. },
  62. deleteF(data){
  63. // delCustomerInfo()
  64. this.isShow= true
  65. // this.$refs.popup.open('top')
  66. this.deleteid = data
  67. // console.log(this.deleteid)
  68. },
  69. close() {
  70. // this.$refs.popup.close()
  71. this.isShow = false
  72. },
  73. handleDelete(){
  74. delVisit(this.deleteid).then(data=>{
  75. this.getlist()
  76. this.close()
  77. })
  78. },
  79. modifyF(id){
  80. uni.navigateTo({
  81. url:'/pages/addVisit/addVisit?id='+id
  82. })
  83. },
  84. exportF(){
  85. console.log("导出")
  86. },
  87. getlist(){
  88. listVisit(this.queryParams).then(data=>{
  89. this.msgdata = data.rows
  90. })
  91. }
  92. },
  93. onShow() {
  94. this.getlist()
  95. },
  96. filters:{
  97. filterIn(data){
  98. switch(data){
  99. case '1': return "是";
  100. break;
  101. case '2': return "否";
  102. break;
  103. default: return "否";
  104. }
  105. },
  106. filterMethod(val){
  107. if(val==1){
  108. return "自驾"
  109. }else if(val==2){
  110. return "交通工具"
  111. }else if(val==3){
  112. return "步行"
  113. }else{
  114. return "其他"
  115. }
  116. }
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. @import url("@/common/scss/core.scss");
  122. .commonlist-text{
  123. margin: 50rpx 20rpx 20rpx;
  124. }
  125. /deep/ checkbox.round .wx-checkbox-input,
  126. /deep/ checkbox.round .uni-checkbox-input {
  127. border-radius: 50%;
  128. width: 14px;
  129. height: 14px;
  130. }
  131. .slot-box {
  132. display: flex;
  133. flex-direction: row;
  134. align-items: center;
  135. }
  136. .slot-image {
  137. display: block;
  138. margin-right: 10px;
  139. width: 30px;
  140. }
  141. .slot-text {
  142. flex: 1;
  143. font-size: 13px;
  144. color: #000000;
  145. margin-right: 10px;
  146. .slot-text-msg{
  147. color: #8F8F94;
  148. font-size: 35rpx;
  149. .slot-text-msg-data{
  150. margin-right: 10px;
  151. font-size:20px ;
  152. }
  153. }
  154. }
  155. // .slot-box-checkbox{
  156. // }
  157. .slot-text-filename{
  158. font-size: 40rpx;
  159. border-bottom: 2px solid #c9c9cd;
  160. }
  161. .slot-text-btn{
  162. margin-top: 30rpx;
  163. display: flex;
  164. justify-content: space-around;
  165. button{
  166. width: 25%;
  167. font-size: 20rpx;
  168. color: white;
  169. background-color: blue;
  170. }
  171. }
  172. .tips-box{
  173. padding: 40rpx;
  174. position: fixed;
  175. top: 50%;
  176. left: 50%;
  177. transform: translate(-50%,-50%);
  178. // height: 100px;
  179. width: 70%;
  180. background-color: #fff;font-size: 40rpx;
  181. border-radius: 20px;
  182. text-align: center;
  183. .tips-btn{
  184. display: flex;
  185. justify-content: space-around;
  186. }
  187. // span{
  188. // margin-bottom: 50rpx;
  189. // line-height: 100rpx;
  190. // }
  191. button{
  192. background-color: blue;
  193. color: #fff;
  194. font-size: 35rpx;
  195. width: 30%;
  196. }
  197. }
  198. </style>