Identity_switching.vue 6.9 KB

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