Identity_switching.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="center">
  3. <view v-for="(item , index) in lists" :Key="index">
  4. <view>
  5. <view class="company">{{item.customerType}}</view>
  6. <view class="guess-item" @click="navToDetailPage(item)">
  7. <view class="infos">
  8. <view class="info">{{item.customerName}}
  9. <view class='cu-tag radius line-pink but'>{{item.authenticationStatus}}</view>
  10. </view>
  11. <view class="info">{{item.customerPhone}}</view>
  12. <label>
  13. <checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
  14. <text>设置默认</text>
  15. </label>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. import {
  26. mapState
  27. } from 'vuex';
  28. export default {
  29. name: "buy",
  30. data() {
  31. return {
  32. lists:[],
  33. PageCur: "buy",
  34. buyInfo: [],
  35. pages: 1, //页数
  36. limit: 10, //每次取条目数
  37. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  38. isLoadMore: false, //是否加载中
  39. showTran: true,
  40. scrollTop: 0,
  41. TabCur: 0,
  42. current: 1,
  43. checked:false,
  44. goodsName:'',
  45. receivePrivate:'',
  46. receiveCity:'',
  47. receiveArea:'',
  48. minimumVolume:'',
  49. basis:'',
  50. buyer:'',
  51. unitPrice:'',
  52. receiveWarehouse:'',
  53. procurementPlanType:'',
  54. procurementPlan:'',
  55. identityAuthenticationInfo: {
  56. pageSize: 10,
  57. currentPage: 1,
  58. commonId: "",
  59. },
  60. };
  61. },
  62. onShow(){
  63. this.getList()
  64. },
  65. onLoad(options) {
  66. this.goodsName = options.goodsName
  67. this.receivePrivate = options.receivePrivate
  68. this.receiveCity = options.receiveCity
  69. this.receiveArea = options.receiveArea
  70. this.minimumVolume = options.minimumVolume
  71. this.buyer = options.buyer
  72. this.basis = options.basisPrice
  73. this.unitPrice = options.unitPrice
  74. this.receiveWarehouse = options.receiveWarehouse
  75. this.procurementPlanType = options.procurementPlanType
  76. this.procurementPlan=options.procurementPlanNo
  77. },
  78. computed: {
  79. ...mapState(['hasLogin', 'userInfo'])
  80. },
  81. methods: {
  82. getList() {
  83. this.identityAuthenticationInfo.commonId = this.userInfo.id
  84. this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  85. pageSize: 10,
  86. currentPage: 1,
  87. commonId: this.userInfo.id
  88. }, 'application/json;charset=UTF-8').then(res => {
  89. if(res.data.code==200){
  90. for(var i=0;i<res.data.data.records.length;i++){
  91. if(res.data.data.records[i].defaultFlag!=1){
  92. res.data.data.records[i].checked=false
  93. }else{
  94. res.data.data.records[i].checked=true
  95. }
  96. }
  97. this.lists = res.data.data.records
  98. }
  99. })
  100. .catch(res => {
  101. uni.showToast({
  102. title: res.errmsg,
  103. icon: 'none',
  104. duration: 2000
  105. })
  106. });
  107. },
  108. checkBox(e,item){
  109. for(var i=0;i<this.lists.length;i++){
  110. this.lists[i].checked=true
  111. }
  112. item.checked=true
  113. this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
  114. id:item.id,
  115. commonId: this.userInfo.id
  116. }).then(res => {
  117. if(res.data.code==200){
  118. // this.lists = res.data.data.records
  119. }
  120. })
  121. .catch(res => {
  122. uni.showToast({
  123. title: res.errmsg,
  124. icon: 'none',
  125. duration: 2000
  126. })
  127. });
  128. },
  129. // adddriver(index) {
  130. // if (index == 1) {
  131. // uni.navigateTo({
  132. // url: `/pageD/identity/companyIdentity`
  133. // })
  134. // } else {
  135. // uni.navigateTo({
  136. // url: `/pageD/identity/driverIdentity`
  137. // })
  138. // }
  139. // },
  140. navToDetailPage(item) {
  141. // if (index == 1) {
  142. if(item.customerTypeFlag==1){
  143. uni.navigateTo({
  144. url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.customerName}`
  145. })
  146. }else{
  147. uni.navigateTo({
  148. url: `/pageD/myRelease/buyGrain?id=${item.id}&customerName=${item.compName}`
  149. })
  150. }
  151. },
  152. // } else {
  153. // uni.navigateTo({
  154. // url: `/pageD/identity/driverIdentityLook`
  155. // })
  156. // }
  157. }
  158. }
  159. </script>
  160. <style>
  161. .center {
  162. padding: 10px 20px;
  163. }
  164. .title {
  165. font-size: 18px;
  166. font-weight: 900;
  167. margin-right: 20px;
  168. display: initial;
  169. }
  170. .company {
  171. font-size: 16px;
  172. margin-top: 10px;
  173. }
  174. .infos {
  175. /* margin: 10px 20px; */
  176. width: 100%;
  177. display: inline-table;
  178. }
  179. .info {
  180. line-height: 20px;
  181. }
  182. .but {
  183. right: 3px;
  184. float: right;
  185. }
  186. </style>