123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305 |
- <template>
- <view class="center">
- <view v-for="(item , index) in lists" :Key="index">
- <view class="forList" @click="definition(item)">
- <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="guess-item" @click="navToDetailPage(item)">
- </view>
- <view class="infos">
- <view class="info1">
- <view v-if="item.customerType == '企业'">{{item.compName}}</view>
- <view v-if="item.customerType == '个人'">{{item.customerName}}</view>
- <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>
- </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,
- checked: false,
- goodsName: '',
- receivePrivate: '',
- receiveCity: '',
- receiveArea: '',
- minimumVolume: '',
- basis: '',
- buyer: '',
- unitPrice: '',
- receiveWarehouse: '',
- procurementPlanType: '',
- procurementPlan: '',
- identityAuthenticationInfo: {
- pageSize: 10,
- currentPage: 1,
- commonId: "",
- },
- };
- },
- onShow() {
- this.getList()
- },
- onLoad(options) {
- this.goodsName = options.goodsName
- this.receivePrivate = options.receivePrivate
- this.receiveCity = options.receiveCity
- this.receiveArea = options.receiveArea
- this.minimumVolume = options.minimumVolume
- this.buyer = options.buyer
- this.basis = options.basisPrice
- this.unitPrice = options.unitPrice
- this.receiveWarehouse = options.receiveWarehouse
- this.procurementPlanType = options.procurementPlanType
- this.procurementPlan = options.procurementPlanNo
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo'])
- },
- methods: {
- definition(item){
- if (item.customerType == "企业") {
- this.$store.commit('configfreightChoice', item.compName)
- } else if (item.customerType == "个人") {
- this.$store.commit('configfreightChoice', item.customerName)
- }
- uni.navigateBack(1)
- },
- getList() {
- 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 = false
- }
- item.checked = true
- this.$api.doRequest('post', '/identityAuthenticationInfo/api/setDefault', {
- id: item.id,
- defaultFlag: 1,
- commonId: this.userInfo.id
- }).then(res => {
- if (res.data.code == 200) {
- }
- })
- .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) {
- // if (index == 1) {
- uni.navigateTo({
- url: `/pageA/product/business_buy?id=${item.id}&customerName=${item.customerName}&goodsName=${this.goodsName}
- &receivePrivate=${this.receivePrivate}&receiveCity=${this.receiveCity}&receiveArea=${this.receiveArea}&minimumVolume=${this.minimumVolume}&buyer=${this.buyer}&basisPrice=${this.basis}&unitPrice=${this.unitPrice}
- &receiveWarehouse=${this.receiveWarehouse}&procurementPlanType=${this.procurementPlanType}&procurementPlanNo=${this.procurementPlan}`
- })
- },
- // } else {
- // uni.navigateTo({
- // url: `/pageD/identity/driverIdentityLook`
- // })
- // }
- }
- }
- </script>
- <style>
- .center {
- padding: 10px 20px;
- }
- .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>
|