123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- <template>
- <view class="center">
- <view v-if='lists.length>0'>
- <view v-for="(item , index) in lists" :Key="index">
- <view @click="navToDetailPage(item)" class="forList">
- <view class="flex">
- <view class="company" v-if="item.customerType == '企业'">{{item.customerType}}</view>
- <view class="company1" v-if="item.customerType == '个人'">{{item.customerType}}</view>
- <view class="infos">
- <view class="info1">
- <text v-if='item.customerTypeFlag==1'>{{item.customerName}}</text>
- <text v-if='item.customerTypeFlag==2'>{{item.compName}}</text>
- <view class='but but1' v-if="item.authenticationStatus == '已认证'">{{item.authenticationStatus}}</view>
- <view class='but but2' v-if="item.authenticationStatus == '审核中'">{{item.authenticationStatus}}</view>
- <view class='but but3' v-if="item.authenticationStatus == '未通过'">{{item.authenticationStatus}}</view>
- <view class='but but4' v-if="item.authenticationStatus == '已覆盖'">{{item.authenticationStatus}}</view>
- </view>
- <view class="info2">{{item.customerPhone}}</view>
-
-
- </view>
- </view>
- <hr style="margin: 10px 0px;">
- <label>
- <checkbox style='transform: scale(0.8);' :value='item.id' :checked="item.checked" @click.stop="checkBox($event,item)" ></checkbox>
- <text>设置默认</text>
- </label>
- </view>
- </view>
- </view>
-
- <view style='text-align:center;' v-else>
- 当前暂无已认证的粮商身份
- </view>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- name: "buy",
- data() {
- return {
- lists:[],
- PageCur: "buy",
- buyInfo: [],
- pages: 1, //页数
- limit: 10, //每次取条目数
- loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
- isLoadMore: false, //是否加载中
- showTran: true,
- scrollTop: 0,
- TabCur: 0,
- current: 1,
- id:0,
- checked:false,
- status:0,
- goodsName:'',
- receivePrivate:'',
- receiveCity:'',
- receiveArea:'',
- minimumVolume:'',
- basis:'',
- buyer:'',
- unitPrice:'',
- receiveWarehouse:'',
- procurementPlanType:'',
- procurementPlan:'',
- identityAuthenticationInfo: {
- pageSize: 10,
- currentPage: 1,
- commonId: "",
-
-
- },
- };
- },
- onLoad(options) {
- this.status=options.status
- },
- onShow(){
- this.getList()
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {
- getList() {
- console.log(this.userInfo)
- this.identityAuthenticationInfo.commonId = this.userInfo.id
- this.$api.doRequest('get', '/identityAuthenticationInfo/selectIdentityAuthenticationInfo', {
- pageSize: 10,
- currentPage: 1,
- commonId: this.userInfo.id,
- flag:1
- }, 'application/json;charset=UTF-8').then(res => {
- if(res.data.code==200){
- for(var i=0;i<res.data.data.records.length;i++){
- if(res.data.data.records[i].defaultFlag!=1){
- res.data.data.records[i].checked=false
- }else{
- res.data.data.records[i].checked=true
- }
- }
- this.lists = res.data.data.records
- }
- })
- .catch(res => {
- if(res.errmsg){
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- else{
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- checkBox(e,item){
- for(var i=0;i<this.lists.length;i++){
- this.lists[i].checked=true
- }
- item.checked=true
- this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
- id:item.id,
- commonId: this.userInfo.id
- }).then(res => {
- if(res.data.code==200){
- // this.lists = res.data.data.records
- }
- })
- .catch(res => {
- if(res.errmsg){
- uni.showToast({
- title: res.errmsg,
- icon: 'none',
- duration: 2000
- })
- }
- else{
- uni.showToast({
- title: "系统异常,请联系管理员",
- icon: 'none',
- duration: 2000
- })
- }
- });
- },
- // adddriver(index) {
- // if (index == 1) {
- // uni.navigateTo({
- // url: `/pageD/identity/companyIdentity`
- // })
- // } else {
- // uni.navigateTo({
- // url: `/pageD/identity/driverIdentity`
- // })
- // }
- // },
- navToDetailPage(item) {
- console.log(11111)
- var url=''
- if(this.status==1){
- url='/pageD/myRelease/buyGrain'
- }else{
- url='/pageD/myRelease/sellGrain'
- }
- // if (index == 1) {
- if(item.customerTypeFlag==1){
- uni.navigateTo({
- url: url+`?id=${item.id}&customerName=${item.customerName}`
- })
- }else{
- uni.navigateTo({
- url: url+`?id=${item.id}&customerName=${item.compName}`
- })
- }
-
- },
- // } else {
- // uni.navigateTo({
- // url: `/pageD/identity/driverIdentityLook`
- // })
-
- // }
- }
- }
- </script>
- <style>
- .center {
- padding: 10px 20px;
- background-color: #F5F6FA;
- }
- .title {
- font-size: 18px;
- font-weight: 900;
- margin-right: 20px;
- display: initial;
- }
- .company {
- width: 35px;
- height: 35px;
- background-color: #E9F8F0;
- font-size: 16px;
- margin-top: 10px;
- border-radius: 5px;
- text-align: center;
- line-height: 35px;
- color: #22C572;
- font-size: 12px;
-
- }
- .company1{
- width: 35px;
- height: 35px;
- background-color: #FEECE6;
- font-size: 16px;
- margin-top: 10px;
- border-radius: 5px;
- text-align: center;
- line-height: 35px;
- color:#FE6430;
- font-size: 12px;
- }
- .infos {
- /* margin: 10px 20px; */
- width: 100%;
- display: inline-table;
- }
- .info {
- line-height: 20px;
- }
- .but {
- margin-right: 30px;
- float: right;
- font-size: 14px;
-
- background-color: #FFFFFF;
- }
- .but1{
- color: #22C572 ;
- }
- .but2{
- color:#FE6430;
- }
- .but3{
- color:#FB1E1E;
- }
- .but4{
- color:#AFB3BF;
- }
- .forList{
- background-color: #FFFFFF;
- padding: 10px 10px;
- border-radius: 10px;
- margin-top: 10px;
- }
- /* .guess-item{
- font-size: 18px;
- margin-left: 20px;
- font-weight: 700;
- } */
- .info1{
- font-size: 18px;
- margin-left: 20px;
- font-weight: 700;
- }
- .info2{
- margin-left: 20px;
- color: #AFB3BF;
- }
- </style>
|