<template>
|
<view class="container-page">
|
<view>
|
<view class="form-item">
|
<view class="label required">店铺类型</view>
|
<view class="m-l-a m-r-0 flex " :class="[!dto.applicationType?'desc-gray':'']" @click="()=>{
|
if(!id){
|
show_select_type=true
|
}
|
}">
|
<view>{{dto.applicationTypeStr||dto.applicationType || '请选择'}}</view>
|
<u-icon class="m-l-a" name="arrow-right"></u-icon>
|
</view>
|
|
</view>
|
<view class="form-item before-line">
|
<view class="label required">店铺名称</view>
|
<view class="m-l-a m-r-0 flex">
|
<input v-model="dto.applicationTitle" placeholder="请输入店铺名称"
|
style="margin-top: 16px;text-align: right;"></input>
|
|
</view>
|
</view>
|
<view class="form-item bottom-border-no">
|
<view class="label required" style="width: 360rpx;">店铺头像(750*750px)</view>
|
<view class="m-l-a m-r-0 flex m-t-20 m-b-20">
|
<view class="component-button-upload" @click="uploadIcon('cover')" >
|
|
</view>
|
</view>
|
</view>
|
<view v-if="dto.cover">
|
<view class="flex p20 form-item bottom-border-no" style="padding-top: 0rpx;padding-bottom: 10rpx" >
|
<view class="m-r-10 ">
|
<image class="banner-img" :src="dto.cover" @click.stop="previewImg(dto.cover)">
|
|
</image>
|
<view class="t-red text-center" @click.stop="deleteImg('cover','')">删除</view>
|
</view>
|
</view>
|
</view>
|
<u-divider></u-divider>
|
|
<view class="form-item before-line">
|
<view class="label required">姓名</view>
|
<view class="m-l-a m-r-0 flex">
|
<input v-model="dto.applicationTitle" placeholder="请输入姓名"
|
style="margin-top: 16px;text-align: right;"></input>
|
|
</view>
|
</view>
|
<view class="form-item before-line">
|
<view class="label required">联系方式</view>
|
<view class="m-l-a m-r-0 flex">
|
<input v-model="dto.applicationTitle" placeholder="请输入联系方式"
|
style="margin-top: 16px;text-align: right;"></input>
|
|
</view>
|
</view>
|
<view class="form-item before-line">
|
<view class="label required">集货站</view>
|
<view class="m-l-a m-r-0 flex " :class="[!dto.applicationType?'desc-gray':'']" @click="()=>{
|
if(!id){
|
show_select_type=true
|
}
|
}">
|
<view>{{dto.applicationTypeStr||dto.applicationType || '请选择'}}</view>
|
<u-icon class="m-l-a" name="arrow-right"></u-icon>
|
</view>
|
|
</view>
|
<view class="form-item before-line">
|
<view class="label required">地区</view>
|
<view class="m-l-a m-r-0 flex " :class="[!dto.applicationType?'desc-gray':'']" @click="()=>{
|
if(!id){
|
show_select_type=true
|
}
|
}">
|
<view>{{dto.applicationTypeStr||dto.applicationType || '请选择'}}</view>
|
<u-icon class="m-l-a" name="arrow-right"></u-icon>
|
</view>
|
|
</view>
|
<view class="form-item before-line">
|
<view class="label required">地址</view>
|
<view class="m-l-a m-r-0 flex">
|
<input v-model="dto.applicationTitle" placeholder="请输入地址"
|
style="margin-top: 16px;text-align: right;"></input>
|
|
</view>
|
</view>
|
<view class="form-item before-line">
|
<view class="label required">店铺简介</view>
|
</view>
|
<view class="flex">
|
<u--textarea v-model="dto.ps" placeholder="请输入店铺简介"></u--textarea>
|
</view>
|
<view class="form-item before-line m-t-20">
|
<view class="label required">选择审核方式</view>
|
<view class="m-l-a m-r-0 flex">
|
|
<u-radio-group v-model="dto.idcardType" placement="row">
|
<u-radio :customStyle="{'margin-bottom': '8px','margin-right': '8px','font-size':'28rpx'}"
|
v-for="(item, index) in shTypeList" :key="index" :label="item.name" :name="item.name">
|
</u-radio>
|
</u-radio-group>
|
</view>
|
</view>
|
<view class="form-item bottom-border-no before-line m-t-20 p-b-20" v-if="dto.idcardType=='身份证'">
|
<view class="label required">身份证正反面</view>
|
<view class="m-l-a m-r-0 flex">
|
<!-- <view class="component-button-upload m-r-15" @click="uploadIcon('idCards')">
|
|
</view> -->
|
<view class="component-button-upload" @click="uploadIcon('idCards')">
|
|
</view>
|
</view>
|
</view>
|
<view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx"
|
v-if="dto.idcardType=='身份证'&&dto.idCards&&dto.idCards.length>0">
|
<view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.idCards" :key="index">
|
<image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)">
|
|
</image>
|
<view class="t-red text-center" @click.stop="deleteImg('idCards',index)">删除</view>
|
</view>
|
</view>
|
<view class="form-item bottom-border-no before-line m-t-20 p-b-20" v-if="dto.idcardType=='营业执照'">
|
<view class="label required">营业执照</view>
|
<view class="m-l-a m-r-0 flex">
|
<view class="component-button-upload m-r-15" @click="uploadIcon('pictures')">
|
|
</view>
|
|
</view>
|
</view>
|
<view class="flex p20" style="padding-top: 0rpx;padding-bottom: 10rpx"
|
v-if="dto.idcardType=='营业执照'&&dto.pictures&&dto.pictures.length>0">
|
<view class="m-t-12 m-r-10 " v-for="(tBanner,index) of dto.pictures" :key="index">
|
<image class="banner-img" :src="tBanner.url" @click.stop="previewImg(tBanner.url)">
|
|
</image>
|
<view class="t-red text-center" @click.stop="deleteImg('pictures',index)">删除</view>
|
</view>
|
</view>
|
|
|
|
<view class="button-green-1 m-t-20 button-fixed-bottom before-line " @click="submit">
|
提交审核
|
</view>
|
|
</view>
|
|
<view style="min-height: 200rpx;">
|
|
</view>
|
<u-picker @confirm="select_type" keyName="label" @cancel="show_select_type=false" :show="show_select_type"
|
:columns="columns_types"></u-picker>
|
|
<u-picker @confirm="select_user" keyName="label" @cancel="show_select_user=false" :show="show_select_user"
|
:columns="userListCols"></u-picker>
|
|
|
</view>
|
</template>
|
|
<script>
|
import environments from '@/environments'
|
|
import {
|
mapState
|
} from 'vuex'
|
|
export default {
|
|
data() {
|
return {
|
id: '',
|
orderId: '',
|
show_addlog: false,
|
log_remarks: '',
|
refresh: false,
|
api: '',
|
dto: {
|
id: '',
|
pictures: [],
|
idCards: [],
|
cover:''
|
},
|
show_select_type: false,
|
show_select_user: false,
|
columns_types: [],
|
audit_remarks: '',
|
audit_result: false,
|
show_audit: false,
|
|
|
//审核方式
|
shTypeList: [{
|
name: '身份证',
|
disabled: false
|
},
|
{
|
name: '营业执照',
|
disabled: false
|
}
|
],
|
radiovalue1: '身份证',
|
|
}
|
},
|
onLoad(options) {
|
if (options.id) {
|
this.id = options.id
|
this.getDetail()
|
} else {
|
|
this.$http.request('get', '/api/code/value', {
|
params: {
|
type: 'APPLICATION_TYPE'
|
}
|
}).then(res => {
|
var data = res.data
|
this.columns_types = [data || []]
|
this.columns_types[0].unshift({
|
label: '全部',
|
value: ''
|
})
|
|
})
|
}
|
|
},
|
|
methods: {
|
|
|
select_type(e) {
|
this.show_select_type = false
|
this.dto.applicationTypeStr = e.value[0].label
|
this.dto.applicationType = e.value[0].value
|
},
|
select_user(e) {
|
this.show_select_user = false
|
this.dto.auditPersonStr = e.value[0].label
|
this.dto.auditPersonId = e.value[0].value
|
},
|
|
async getDetail() {
|
this.$message.showLoading()
|
const {
|
code,
|
data
|
} = await this.$http.request('get', "/api/supplier/addOrUpdate/detail/" + this.id, {})
|
if (code == 0) {
|
this.dto = {
|
...data,
|
|
}
|
if (!this.dto.pictures) {
|
this.dto.pictures = []
|
}
|
if (!this.dto.idCards) {
|
this.dto.idCards = []
|
}
|
|
}
|
|
this.$message.hideLoading()
|
|
},
|
async submit() {
|
|
await this.$message.confirm(`是否确定提交/修改店铺信息`)
|
|
|
var dto = {
|
...this.dto,
|
}
|
this.$message.showLoading()
|
const re = await this.$http.request('post', '/api/supplier/addOrUpdate', {
|
data: dto
|
})
|
this.$message.hideLoading()
|
if (re.code == 2000 || re.code == 0) {
|
this.$message.showToast('操作成功')
|
//需要标记加一下
|
this.$store.dispatch('sign_add', 'application');
|
|
this.backpage()
|
}
|
},
|
|
async deleteImg(key, index) {
|
await this.$message.confirm('是否确认删除此图片')
|
if(Array.isArray(this.dto[key])){
|
this.dto[key].splice(index, 1)
|
|
}else{
|
this.dto[key] = ''
|
}
|
},
|
uploadIcon(key) {
|
const that = this
|
uni.chooseImage({
|
count: 1, // 最多可以选择的图片张数,默认9
|
sizeType: ['original', 'compressed'], //original 原图,compressed 压缩图,默认二者都有
|
sourceType: ['camera', 'album'], //album 从相册选图,camera 使用相机,默认二者都有。如需直接开相机或直接选相册,请只使用一个选项
|
success: function({
|
errMsg,
|
tempFiles
|
}) {
|
if (errMsg === 'chooseImage:ok') {
|
// console.log(tempFiles[0])
|
that.$message.showLoading()
|
that.$http.upload(tempFiles[0].path).then(async res => {
|
var pic = res.data && res.data.length > 0 && res.data[
|
0] || {}
|
that.$message.hideLoading()
|
if(Array.isArray(that.dto[key])){
|
that.dto[key].push(pic || '')
|
|
}else{
|
that.dto[key] = (pic || {}).url || ''
|
|
}
|
that.$forceUpdate()
|
}).catch(res => {
|
that.$message.hideLoading()
|
|
})
|
}
|
}
|
})
|
},
|
|
},
|
computed: {
|
...mapState(['currentInfo'])
|
},
|
components: {}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.banner-img {
|
width: 96rpx;
|
height: 96rpx;
|
border-radius: 4rpx;
|
border: 2rpx dashed #CECECE;
|
}
|
|
.form-item {
|
// padding: 40rpx;
|
border-bottom: 2rpx solid #F3F3F3;
|
display: flex;
|
// height: 100px;
|
|
.label {
|
width: 300rpx;
|
line-height: 60px;
|
|
}
|
|
.flex {
|
line-height: 60px;
|
|
.flex1 {
|
flex: 1;
|
text-align: center;
|
color: var(--selfblue)
|
}
|
|
|
}
|
}
|
|
.form-item.bottom-border-no {
|
border-bottom: none;
|
}
|
|
.container-page {
|
padding: 40rpx;
|
background-color: #FFFFFF;
|
// min-height: calc(100vh - 80rpx);
|
min-height: 100vh;
|
}
|
|
.style {
|
width: fit-content;
|
margin: 0 auto;
|
line-height: 64rpx;
|
border-radius: 8rpx;
|
padding-left: 20rpx;
|
padding-right: 20rpx;
|
// padding-top: 5rpx;
|
// padding-bottom: 5rpx;
|
border: 2rpx solid var(--selfblue);
|
background-color: var(--selfbluebg);
|
min-width: 100rpx;
|
}
|
|
|
.style-1 {
|
border: 1px solid rgb(122, 187, 255);
|
border: 1px solid #409EFF;
|
color: #409EFF;
|
background-color: rgb(240, 247, 255);
|
}
|
|
.style-2 {
|
border: 1px solid rgb(255, 184, 78);
|
border: 1px solid #FE9044;
|
color: #FE9044;
|
background-color: rgb(255, 247, 235);
|
}
|
|
.style-3 {
|
border: 1px solid #19be6b;
|
color: #19be6b;
|
background-color: rgb(231, 244, 238);
|
}
|
|
.style-4 {
|
border: 1px solid #F56c6c;
|
color: #F56c6c;
|
background-color: rgb(254, 243, 243);
|
}
|
</style>
|