customor-message.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view>
  3. <ul style="list-style: none;padding-left: 0px;margin-top: 20rpx;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.company}}</text>
  10. <text class="slot-text-msg-data" style="font-size: 30rpx;">职位:{{data.position}}</text>
  11. <text class="slot-text-msg-data" style="font-size: 30rpx;">电话:{{data.phone}}</text>
  12. <text class="slot-text-msg-data" style="font-size: 30rpx;">年龄:{{data.age}}&nbsp;&nbsp;&nbsp;性别:{{data.sex|filterSex}}</text>
  13. <text class="slot-text-msg-data" style="font-size: 30rpx;">是否内部客户:{{data.isIn | filterIn}} </text>
  14. </view>
  15. <view class="slot-text-btn">
  16. <button class="btn-modify" @click="modifyF(data.customerId)">修改</button>
  17. <button class="btn-delete" @click="deleteF(data.customerId)">删除</button>
  18. </view>
  19. </li>
  20. </ul>
  21. <view class="tips-box" v-show="isShow">
  22. <text style="line-height: 150rpx;">确认删除?</text>
  23. <view class="tips-btn">
  24. <button @click="close">取消</button>
  25. <button @click="handleDelete()">确认</button>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import { listCustomerInfo,delCustomerInfo } from "../../api/marketmini/index"
  32. export default {
  33. data() {
  34. return {
  35. isShow:false,
  36. visit:'visit',
  37. msgdata:[
  38. {
  39. address: "深圳南山",
  40. age: 23,
  41. company: "腾讯",
  42. createBy: null,
  43. createTime: "2022-07-12 11:47:31",
  44. createUserId: null,
  45. customerId: "1",
  46. customerName: "李嘉欣",
  47. isIn: 1,
  48. params: {},
  49. phone: 18313121312,
  50. position: "开发员",
  51. remark: "地中海发型123",
  52. searchValue: null,
  53. sex: 0,
  54. updateBy: null,
  55. updateTime: "2022-07-12 11:53:14",
  56. updateUserId: null,
  57. year: "2022"
  58. }
  59. ],
  60. queryParams: {
  61. pageNum: 1,
  62. pageSize: 10,
  63. // customerName: null,
  64. // company: null,
  65. // address: null,
  66. // isIn: null,
  67. // sex: null,
  68. // year: null,
  69. // phone: null,
  70. },
  71. deleteid:''
  72. };
  73. },
  74. filters:{
  75. filterSex(data){
  76. switch(data){
  77. case 0 :return "男";
  78. break;
  79. case 1 :return "女";
  80. break;
  81. case 2: return "未知";
  82. default: return "未知"
  83. }
  84. },
  85. filterIn(data){
  86. switch(data){
  87. case '1': return "是";
  88. break;
  89. case '2': return "否";
  90. break;
  91. default: return "否";
  92. }
  93. }
  94. },
  95. methods:{
  96. createF(){
  97. uni.navigateTo({
  98. url:"/pages/newAdd/newAdd"
  99. })
  100. },
  101. deleteF(data){
  102. // delCustomerInfo()
  103. this.isShow= true
  104. // this.$refs.popup.open('top')
  105. this.deleteid = data
  106. console.log(this.deleteid)
  107. },
  108. close() {
  109. // this.$refs.popup.close()
  110. this.isShow = false
  111. },
  112. handleDelete(){
  113. delCustomerInfo(this.deleteid).then(data=>{
  114. this.getlist()
  115. this.close()
  116. })
  117. },
  118. modifyF(data){
  119. // console.log("修改")
  120. uni.navigateTo({
  121. url:'/pages/addCustomer/addCustomer?id='+data
  122. })
  123. },
  124. exportF(){
  125. console.log("导出")
  126. },
  127. getlist(){
  128. listCustomerInfo(this.queryParams).then((data)=>{
  129. this.msgdata = data.rows
  130. })
  131. }
  132. },
  133. onShow(){
  134. this.getlist()
  135. }
  136. }
  137. </script>
  138. <style lang="scss">
  139. @import url("@/common/scss/core.scss");
  140. .commonlist-text{
  141. margin: 50rpx 20rpx 20rpx;
  142. }
  143. /deep/ checkbox.round .wx-checkbox-input,
  144. /deep/ checkbox.round .uni-checkbox-input {
  145. border-radius: 50%;
  146. width: 14px;
  147. height: 14px;
  148. }
  149. .slot-box {
  150. display: flex;
  151. flex-direction: row;
  152. align-items: center;
  153. }
  154. .slot-image {
  155. display: block;
  156. margin-right: 10px;
  157. width: 30px;
  158. }
  159. .slot-text {
  160. flex: 1;
  161. font-size: 13px;
  162. color: #000000;
  163. margin-right: 10px;
  164. .slot-text-msg{
  165. color: #8F8F94;
  166. font-size: 35rpx;
  167. .slot-text-msg-data{
  168. margin-right: 10px;
  169. font-size:20px ;
  170. }
  171. }
  172. }
  173. // .slot-box-checkbox{
  174. // }
  175. .slot-text-filename{
  176. font-size: 40rpx;
  177. border-bottom: 2px solid #c9c9cd;
  178. }
  179. .slot-text-btn{
  180. margin-top: 30rpx;
  181. display: flex;
  182. justify-content: space-around;
  183. button{
  184. width: 25%;
  185. font-size: 20rpx;
  186. color: white;
  187. background-color: blue;
  188. }
  189. }
  190. .tips-box{
  191. padding: 40rpx;
  192. position: fixed;
  193. top: 50%;
  194. left: 50%;
  195. transform: translate(-50%,-50%);
  196. // height: 100px;
  197. width: 70%;
  198. background-color: #fff;font-size: 40rpx;
  199. border-radius: 20px;
  200. text-align: center;
  201. .tips-btn{
  202. display: flex;
  203. justify-content: space-around;
  204. }
  205. // span{
  206. // margin-bottom: 50rpx;
  207. // line-height: 100rpx;
  208. // }
  209. button{
  210. background-color: blue;
  211. color: #fff;
  212. font-size: 35rpx;
  213. width: 30%;
  214. }
  215. }
  216. </style>