Identity_switching.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="center">
  3. <view v-for="(item , index) in lists" :Key="index">
  4. <view class="forList">
  5. <view class="flex">
  6. <view class="company" v-if="item.customerType == '企业'">{{item.customerType}}</view>
  7. <view class="company1" v-if="item.customerType == '个人'">{{item.customerType}}</view>
  8. <view class="guess-item" @click="navToDetailPage(item)">
  9. </view>
  10. <view class="infos">
  11. <view class="info1">{{item.customerName}}
  12. <view class='but but1' v-if="item.authenticationStatus == '已认证'">{{item.authenticationStatus}}</view>
  13. <view class='but but2' v-if="item.authenticationStatus == '审核中'">{{item.authenticationStatus}}</view>
  14. <view class='but but3' v-if="item.authenticationStatus == '未通过'">{{item.authenticationStatus}}</view>
  15. <view class='but but4' v-if="item.authenticationStatus == '已覆盖'">{{item.authenticationStatus}}</view>
  16. </view>
  17. <view class="info2">{{item.customerPhone}}</view>
  18. </view>
  19. </view>
  20. <hr style="margin: 10px 0px;">
  21. <label>
  22. <checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
  23. <text>设置默认</text>
  24. </label>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import {
  33. mapState
  34. } from 'vuex';
  35. export default {
  36. name: "buy",
  37. data() {
  38. return {
  39. lists:[],
  40. PageCur: "buy",
  41. buyInfo: [],
  42. pages: 1, //页数
  43. limit: 10, //每次取条目数
  44. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  45. isLoadMore: false, //是否加载中
  46. showTran: true,
  47. scrollTop: 0,
  48. TabCur: 0,
  49. current: 1,
  50. checked:false,
  51. goodsName:'',
  52. receivePrivate:'',
  53. receiveCity:'',
  54. receiveArea:'',
  55. minimumVolume:'',
  56. basis:'',
  57. buyer:'',
  58. unitPrice:'',
  59. receiveWarehouse:'',
  60. procurementPlanType:'',
  61. procurementPlan:'',
  62. identityAuthenticationInfo: {
  63. pageSize: 10,
  64. currentPage: 1,
  65. commonId: "",
  66. },
  67. };
  68. },
  69. onShow(){
  70. this.getList()
  71. },
  72. onLoad(options) {
  73. this.goodsName = options.goodsName
  74. this.receivePrivate = options.receivePrivate
  75. this.receiveCity = options.receiveCity
  76. this.receiveArea = options.receiveArea
  77. this.minimumVolume = options.minimumVolume
  78. this.buyer = options.buyer
  79. this.basis = options.basisPrice
  80. this.unitPrice = options.unitPrice
  81. this.receiveWarehouse = options.receiveWarehouse
  82. this.procurementPlanType = options.procurementPlanType
  83. this.procurementPlan=options.procurementPlanNo
  84. },
  85. computed: {
  86. ...mapState(['hasLogin', 'userInfo'])
  87. },
  88. methods: {
  89. getList() {
  90. this.identityAuthenticationInfo.commonId = this.userInfo.id
  91. this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
  92. pageSize: 10,
  93. currentPage: 1,
  94. commonId: this.userInfo.id,
  95. flag:1
  96. }, 'application/json;charset=UTF-8').then(res => {
  97. if(res.data.code==200){
  98. for(var i=0;i<res.data.data.records.length;i++){
  99. if(res.data.data.records[i].defaultFlag!=1){
  100. res.data.data.records[i].checked=false
  101. }else{
  102. res.data.data.records[i].checked=true
  103. }
  104. }
  105. this.lists = res.data.data.records
  106. }
  107. })
  108. .catch(res => {
  109. if(res.errmsg){
  110. uni.showToast({
  111. title: res.errmsg,
  112. icon: 'none',
  113. duration: 2000
  114. })
  115. }
  116. else{
  117. uni.showToast({
  118. title: "系统异常,请联系管理员",
  119. icon: 'none',
  120. duration: 2000
  121. })
  122. }
  123. });
  124. },
  125. checkBox(e,item){
  126. for(var i=0;i<this.lists.length;i++){
  127. this.lists[i].checked=true
  128. }
  129. item.checked=true
  130. this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
  131. id:item.id,
  132. defaultFlag:1,
  133. commonId: this.userInfo.id
  134. }).then(res => {
  135. if(res.data.code==200){
  136. // this.lists = res.data.data.records
  137. wx.navigateBack({
  138. delta: 1
  139. })
  140. }
  141. })
  142. .catch(res => {
  143. if(res.errmsg){
  144. uni.showToast({
  145. title: res.errmsg,
  146. icon: 'none',
  147. duration: 2000
  148. })
  149. }
  150. else{
  151. uni.showToast({
  152. title: "系统异常,请联系管理员",
  153. icon: 'none',
  154. duration: 2000
  155. })
  156. }
  157. });
  158. },
  159. // adddriver(index) {
  160. // if (index == 1) {
  161. // uni.navigateTo({
  162. // url: `/pageD/identity/companyIdentity`
  163. // })
  164. // } else {
  165. // uni.navigateTo({
  166. // url: `/pageD/identity/driverIdentity`
  167. // })
  168. // }
  169. // },
  170. navToDetailPage(item) {
  171. // if (index == 1) {
  172. uni.navigateTo({
  173. url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}&goodsName=${this.goodsName}
  174. &receivePrivate=${this.receivePrivate}&receiveCity=${this.receiveCity}&receiveArea=${this.receiveArea}&minimumVolume=${this.minimumVolume}&buyer=${this.buyer}&basisPrice=${this.basis}&unitPrice=${this.unitPrice}
  175. &receiveWarehouse=${this.receiveWarehouse}&procurementPlanType=${this.procurementPlanType}&procurementPlanNo=${this.procurementPlan}`
  176. })
  177. },
  178. // } else {
  179. // uni.navigateTo({
  180. // url: `/pageD/identity/driverIdentityLook`
  181. // })
  182. // }
  183. }
  184. }
  185. </script>
  186. <style>
  187. .center {
  188. padding: 10px 20px;
  189. }
  190. .title {
  191. font-size: 18px;
  192. font-weight: 900;
  193. margin-right: 20px;
  194. display: initial;
  195. }
  196. .company {
  197. width: 35px;
  198. height: 35px;
  199. background-color: #E9F8F0;
  200. font-size: 16px;
  201. margin-top: 10px;
  202. border-radius: 5px;
  203. text-align: center;
  204. line-height: 35px;
  205. color: #22C572;
  206. font-size: 12px;
  207. }
  208. .company1{
  209. width: 35px;
  210. height: 35px;
  211. background-color: #FEECE6;
  212. font-size: 16px;
  213. margin-top: 10px;
  214. border-radius: 5px;
  215. text-align: center;
  216. line-height: 35px;
  217. color:#FE6430;
  218. font-size: 12px;
  219. }
  220. .infos {
  221. /* margin: 10px 20px; */
  222. width: 100%;
  223. display: inline-table;
  224. }
  225. .info {
  226. line-height: 20px;
  227. }
  228. .but {
  229. margin-right: 30px;
  230. float: right;
  231. font-size: 14px;
  232. background-color: #FFFFFF;
  233. }
  234. .but1{
  235. color: #22C572 ;
  236. }
  237. .but2{
  238. color:#FE6430;
  239. }
  240. .but3{
  241. color:#FB1E1E;
  242. }
  243. .but4{
  244. color:#AFB3BF;
  245. }
  246. .forList{
  247. background-color: #FFFFFF;
  248. padding: 10px 10px;
  249. border-radius: 10px;
  250. margin-top: 10px;
  251. }
  252. /* .guess-item{
  253. font-size: 18px;
  254. margin-left: 20px;
  255. font-weight: 700;
  256. } */
  257. .info1{
  258. font-size: 18px;
  259. margin-left: 20px;
  260. font-weight: 700;
  261. }
  262. .info2{
  263. margin-left: 20px;
  264. color: #AFB3BF;
  265. }
  266. </style>