Commit 966ae19d by 前端

Merge branch 'SAAS+V4.28.0' into 'DJ_master'

Saas+v4.28.0

See merge request !33
2 parents 515662be 1fcf7f8d
......@@ -53,5 +53,19 @@ const pictureUpload = params => {
noSignAttr: ['file']
})
}
const uploadFileApi = (params, callback) => {
params.method = 'scrm.api.equity.common.upload.common.multiple'
return http({
url: 'rop-scrm-equity/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file'],
returnAll: true,
onUploadProgress: res => {
callback(res)
}
})
}
export { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload }
export { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload,uploadFileApi }
import { http } from '@/main'
const path = 'dj.api.smarcarlife.'
const path2 = 'dj.api.goodsInfo.'
const path3 = 'dj.api.smartcarlife.'
// 获取当前登录园区店商户收货地址
const addressGet = (params = {}) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.get`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smarcarlife.yqMerchantDeliveryAddress.getByNoLogin`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -16,7 +14,7 @@ const addressGet = (params = {}) => {
}
// 获取省市区信息
const getAreaInfoApi = function (params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.yseMerchantOffline.getAreaInfo`
return http({
url: 'rop-scrm-boutiquecoupon/router',
......@@ -28,8 +26,8 @@ const getAreaInfoApi = function (params) {
// 分页查询采购订单
const getPurchaseOrderList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseApply.page`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smarcarlife.purchaseApply.page.noLogin`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -39,7 +37,7 @@ const getPurchaseOrderList = (params) => {
}
// 采购订单取消/审核
const purchaseOrderCancelOrCheck = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smarcarlife.purchaseApply.cancel`
return http({
url: 'rop-scrm-boutiquecoupon/router',
......@@ -52,7 +50,7 @@ const purchaseOrderCancelOrCheck = (params) => {
// 分页查询采购上架记录
const listWithPagePurchaseInfo = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smartcarlife.purchaseMall.page`
return http({
url: 'rop-scrm-boutiquecoupon/router',
......@@ -67,8 +65,8 @@ const listWithPagePurchaseInfo = (params) => {
// 保存园区店商户收货地址
const addressSave = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}yqMerchantDeliveryAddress.save`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smarcarlife.yqMerchantDeliveryAddress.saveByNoLogin`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -79,7 +77,7 @@ const addressSave = (params) => {
// 按商品类目分组获取购物车列表
const listGroupByGoodsType = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `${path}purchaseShoppingCar.listGroupByGoodsType`
return http({
url: 'rop-scrm-boutiquecoupon/router',
......@@ -90,41 +88,9 @@ const listGroupByGoodsType = (params) => {
}
// 更新购物车商品选中标识
const updateSelectedFlag = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.updateSelectedFlag`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 添加到购物车
const shoppingCarAdd = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseShoppingCar.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 添加采购订单
export function purchaseOrderAdd(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smarcarlife.purchaseApply.add`
return http({
url: 'rop-scrm-boutiquecoupon/router',
......@@ -137,8 +103,8 @@ export function purchaseOrderAdd(params) {
export function exportExcel(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseApply.export`
params.method = `scrm.api.boutiquecoupon.rop.router`
params.routerMethod = `dj.api.smarcarlife.purchaseApply.export.noLogin`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
......@@ -147,68 +113,10 @@ export function exportExcel(params) {
})
}
// 采购订单入库
export function purchaseOrderPutIn(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path}purchaseOrder.putIn`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 获取下单/入库门店
export function getMerchantList(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `${path3}permission.yqMerchant.list`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//查询园区店关联的4s店列表 -入库门店
const get4SRefByYqShopList = (params) => {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.scenemerchantref.query4SRefByYqShop`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
//编辑
export function selectByOrderCode(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.selectByOrderCode`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true
})
}
// 是否有发货主体
export function checkShipper(params) {
params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
params.routerMethod = `dj.api.smarcarlife.purchaseOrder.checkShipper`
return http({
url: 'rop-scrm-boutiquecoupon/router',
method: 'POST',
data: params,
sign: true,
returnAll:true
})
}
// 确认发货
// export function purchaseOrderConfirmDelivery(data) {
// params.method = `scrm.api.boutiquecoupon.rop.router.twoCityTale`
// data.routerMethod = `${path}purchaseOrder.confirmDelivery`
// return http(data)
// }
export default {getAreaInfoApi,checkShipper,get4SRefByYqShopList, selectByOrderCode, getMerchantList, purchaseOrderPutIn, exportExcel, purchaseOrderAdd, shoppingCarAdd, updateSelectedFlag, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file
export default {getAreaInfoApi, exportExcel, purchaseOrderAdd, listGroupByGoodsType, getPurchaseOrderList, purchaseOrderCancelOrCheck, listWithPagePurchaseInfo, addressGet, addressSave }
\ No newline at end of file
<template>
<el-input :value="value" v-bind="$attrs" v-on="{...$listeners}" @blur="blurFn"></el-input>
</template>
<script>
export default {
name: 'FormatInput',
props: ['value','precise','intDigit','maxVal','minVal'],
data() {
return {
}
},
watch:{
value:{
handler(nVal, oVal){
this.inputFn(nVal)
},
deep: true
}
},
mounted(){
},
methods:{
inputFn(e){
e = e ? String(e) : ''
this.intDigit = this.intDigit || 6
this.precise = this.precise || 2
let value = e
if(this.maxVal){
if(+this.maxVal<= +e) value = this.maxVal //加等号是因为 '500' == '500.' 导致多了点
}else{
const intDigitReg = this.intDigit == -1 ? `(^\\d+)(\\.\\d+)?` : `(^\\d{${this.intDigit}})\\d+(\\.\\d+)?`
value = e.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(new RegExp(intDigitReg,'g'), '$1').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(new RegExp(`^(-)*(\\d+)\\.(\\d{${this.precise}}).*$`), this.intDigit == -1 ? '$1$2' : '$1$2.$3')
}
this.$emit('input', value)
},
blurFn(e){
let value = e.target.value
if(this.minVal && +this.minVal>=value) value = this.minVal+''
if(value && value.charAt(value.length-1)=='.') value = value.substr(0 ,value.length-1)
this.$emit('input', value)
}
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
......@@ -30,13 +30,13 @@ Vue.use(GLEditor)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, request_brand, request_common, request_merchant, sign_common, sign, secret } = await fetchConfig()
// 本地切换域名,不需要Mock上面改动 const => let
// request.baseURL = 'http://scrm.test.glsx.com.cn'
// request_brand.baseURL = 'http://scrm.test.glsx.com.cn'
// request.baseURL = 'http://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'http://scrm.dev.glsx.com.cn'
// request_common.baseURL = 'http://didicb.glsx.com.cn'
// request_merchant.baseURL = 'http://rop-merchant.test.glsx.com.cn'
// request.baseURL = 'http://192.168.1.78:8064'
// request_brand.baseURL = 'http://192.168.1.78:8064'
// globalState.session.token = 'scrm-base-bb848580-e5e2-48d2-8fcc-2cf3d8bbc3bd-rop'
// globalState.session.token = 'scrm-base-07730836-7f92-4d6d-9925-a0f33f551ddc-rop'
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState
......
<template>
<div class="element">
<label class="element_label">
<span v-if="isRequire" class="require">*</span>
{{ title }}:
</label>
<div class="wrapper">
<div class="upload_wrap">
<!-- 0 是默认上传类型 -->
<template v-if="uploadType == 0">
<template v-if="imagesList.length">
<div v-for="(imgItem, i) in imagesList" :key="i" class="imagBox">
<img class="imgItem" :src="imgItem" alt="" />
<div class="img_mask">
<i @click="handlePictureCardPreview(imgItem)" class="el-icon-zoom-in"></i>
<i v-if="!disabled" @click="toDeleteImg(index, i)" class="el-icon-delete"></i>
</div>
</div>
</template>
<div v-if="!(imagesList.length == limitNum)" class="upload-value">
<el-upload :disabled="disabled" list-type="picture" class="upload_item" action="#" :before-upload="e => beforeAvatarUpload(e)" :on-remove="e => handleRemove(e, index)" :http-request="e => httpRequest(e, index)">
<img class="img" slot="default" :src="upload_img" alt="" />
</el-upload>
</div>
</template>
<!-- 1 代表的是身份证、驾驶证等类型 -->
<template v-if="uploadType == 1">
<template v-for="count in 2">
<div v-if="(count == 1 && cardImg.font) || (count == 2 && cardImg.reverse)" :key="count" class="imagBox wid180">
<img class="imgItem wid180" :src="count == 2 ? cardImg.reverse : cardImg.font" alt="" />
<div class="img_mask wid180">
<i @click="handlePictureCardPreview(count == 2 ? cardImg.reverse : cardImg.font)" class="el-icon-zoom-in"></i>
<i v-if="!disabled" @click="removeCard(count)" class="el-icon-delete"></i>
</div>
</div>
</template>
<template v-for="count in 2">
<div v-if="(count == 1 && !cardImg.font&&!disabled) || (count == 2 && !cardImg.reverse&&!disabled)" :key="count" class="upload-value upload-value-max marRight-13">
<el-upload :disabled="disabled" list-type="picture" class="upload_item" action="#" :before-upload="e => beforeAvatarUpload(e)" :on-remove="e => handleRemove(e, index)" :http-request="e => httpRequest(e, count)">
<img class="img" slot="default" :src="count == 2 ? idCardBack_img : idCard_img" alt="" />
</el-upload>
</div>
</template>
</template>
</div>
<div class="tip">
图片格式为jpg,jpeg,png,大小10M以内
<span v-if="limitNum > 8 && uploadType == 0">,最多可上传{{ limitNum }}张</span>
</div>
</div>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="" />
</el-dialog>
</div>
</template>
<script type="text/ecmascript-6">
import upload_img from '@/assets/beforeSale/upload.png'
import idCard_img from '@/assets/beforeSale/idCard.png'
import idCardBack_img from '@/assets/beforeSale/idCardBack.png'
import { uploadFileApi } from '@/api/modules/common'
export default {
name: 'uploadHandler',
props: {
title: {
type: String,
default: '其他'
},
imagesList: Array,
uploadType: {
type: Number,
default: 0
},
limitNum: {
type: Number,
default: 100
},
cardImg: Object,
disabled:Boolean,
isRequire:Boolean
},
data() {
return {
upload_img,
idCard_img,
idCardBack_img,
dialogVisible: false,
hideUpload: false
}
},
mounted() {},
methods: {
toDeleteImg(index, i) {
this.imagesList.splice(i, 1)
this.$emit('getImages', this.imagesList)
},
removeCard(count) {
if (count == 1) {
this.cardImg.font = ''
} else {
this.cardImg.reverse = ''
}
this.$emit('getCardImg', {detail:this.cardImg,type:count})
},
handlePictureCardPreview(url) {
this.dialogImageUrl = url
this.dialogVisible = true
},
beforeAvatarUpload(e) {
return new Promise((resolve, reject) => {
let AllImgExt = '.png|.jpg|.jpeg'
let extName = e.name.substring(e.name.lastIndexOf('.')).toLowerCase()
if (AllImgExt.indexOf(extName) === -1) {
this.$message.error('上传格式不正确')
return reject(false)
}
const size = e.size / 1024 / 1024
let maxSize = 10
let filetype = this.getFileType(e.type)
if (filetype == 'image') {
maxSize = 10
} else {
maxSize = 30
}
if (size > maxSize) {
this.$message.error(`上传文件不可超过${maxSize}M`)
return reject(false)
}
return resolve(true)
})
},
httpRequest({ file: e }, count) {
let size = e.size / 1024 / 1024
let loading = null
// 大于2给loading
if (size > 2) {
loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
}
// // 转码base64
const reader = new FileReader()
reader.readAsDataURL(e)
reader.onload = event => {
const imgFile = event.target.result
const arrBase64 = imgFile.split(',')
const targetNameList = e.name.split('.')
const fileInfo = targetNameList[targetNameList.length - 1] + '@' + arrBase64[1]
const fileType = this.getFileType(e.type)
const paramObj = { file: fileInfo, fileType: fileType }
let param = {}
param.fileList = [paramObj]
uploadFileApi(param, res => {
if (loading != null) {
loading.close()
loading = null
}
// let progress = ((res.loaded / res.total) * 100).toFixed(2)
// if (progress > 90) {
// progress = 90
// }
}).then(res => {
if (res.code == 0) {
const url = res.data[0]
if (this.uploadType == 0) {
this.imagesList.push(url)
this.$emit('getImages', this.imagesList)
} else if (this.uploadType == 1) {
if (count == 1) {
this.cardImg.font = url
} else {
this.cardImg.reverse = url
}
this.$emit('getCardImg', {detail:this.cardImg,type:count})
}
}
})
}
},
handleRemove(e, fieldName) {
if (e.status == 'ready') return
},
getFileType(type) {
if (!type) return 'doc'
if (type.indexOf('image') > -1) {
return 'image'
} else {
return 'doc'
}
}
}
}
</script>
<style lang="scss" scoped>
.element {
display: flex;
margin-bottom: 20px;
.element_label {
width: 154px;
font-weight: 400;
font-size: 14px;
color: #333333;
text-align: right;
.require {
color: red;
}
}
.wrapper {
width: 650px;
.upload_wrap {
display: flex;
flex-wrap: wrap;
.imagBox {
position: relative;
.imgItem {
width: 104px;
height: 104px;
border-radius: 4px;
margin-right: 10px;
margin-bottom: 10px;
border: 1px dashed #00000026;
}
.img_mask {
display: none;
}
}
.imagBox:hover {
.img_mask {
display: block;
width: 104px;
height: 104px;
border-radius: 4px;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.4);
transition: opacity 0.3s;
display: flex;
align-items: center;
justify-content: center;
i {
color: white;
cursor: pointer;
font-weight: 400;
font-size: 21px;
}
i:first-child {
margin-right: 12px;
}
i:last-child {
margin-right: 0;
}
}
}
}
.upload-value {
width: 104px;
height: 104px;
border: 1px dashed #00000026;
border-radius: 4px;
.upload_item {
width: 104px;
height: 104px;
.img {
width: 104px;
height: 104px;
border-radius: 4px;
}
/deep/.el-upload-list--picture {
display: none;
}
}
}
.upload-value-max {
width: 180px;
.upload_item {
width: 180px;
.img {
width: 180px;
}
}
}
.wid180 {
width: 180px !important;
margin-right: 13px;
}
.marRight-13 {
margin-right: 13px;
}
.tip {
font-weight: 400;
font-size: 14px;
color: #999999;
margin-top: 8px;
}
}
}
</style>
......@@ -185,7 +185,7 @@ export default {
searchForm: {
queryText: '',
orderStatus: '',
packageCode: '',
packageCodeList: [],
merchantId: '',
dqtId: '',
pqId: '',
......@@ -256,12 +256,13 @@ export default {
},
{
label: '产品名称',
name: 'packageCode',
name: 'packageCodeList',
type: 'select',
optionList: [],
optionId: 'packageCode',
optionLabel: 'packageName',
optionsName: 'goodsStatusList'
optionsName: 'goodsStatusList',
multiple:true
},
{
label: '提单成功时间',
......@@ -650,8 +651,10 @@ export default {
this.$refs.equityRef.page.pageSize = 5
this.$apis.beforeSale.getProListApi({}).then(res => {
this.baseData.goodsStatusList = res
this.getOptionsList('searchFormData')
this.getOptionsList('searchFormData', false, 'packageCodeList')
})
//服务状态
this.getOptionsList('searchFormData', true, 'orderStatus')
this.getCountNoData()
this.$apis.beforeSale.getUserInfoApi({}).then(res => {
this.userInfo = res
......
<template>
<div class="upload-contianer">
<div class="title">上传资料</div>
<div class="widget">
<uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0001')" title="购车发票" limitNum="1" :imagesList="uploadMessage.buyCar"></uploadHandler>
<uploadHandler :isRequire="true" :disabled="disabled" @getImages="getImages($event, 'YB0002')" title="合同购买时里程数" limitNum="1" :imagesList="uploadMessage.mileage"></uploadHandler>
<uploadHandler :isRequire="true" :disabled="disabled" @getCardImg="getCardImg" uploadType="1" title="行驶证" :cardImg="cardImg"></uploadHandler>
<uploadHandler :disabled="disabled" @getImages="getImages($event, 'YB0005')" title="其他" limitNum="9" :imagesList="uploadMessage.others"></uploadHandler>
</div>
</div>
</template>
<script type="text/ecmascript-6">
import upload_img from '@/assets/beforeSale/upload.png'
import uploadHandler from './components/UploadHandler.vue'
export default {
name: 'uploadInfo',
components: {
uploadHandler
},
data() {
return {
upload_img,
dialogVisible: false,
attachmentList: [],
license: [{}, {}]
}
},
props: {
uploadMessage: Object,
cardImg: Object,
disabled: Boolean,
imgsQuery: Array
},
mounted() {},
methods: {
getImages(e, code) {
this.handlerData()
if (code === 'YB0005') {
this.others = []
} else if (code === 'YB0001' && !e.length) {
this.buyCar = []
} else if (code === 'YB0002' && !e.length) {
this.mileage = []
}
e.forEach(url => {
let obj = {
attachmentCode: code,
attachmentFile: url,
attachmentType: 'IMG'
}
if (code === 'YB0001') {
this.buyCar = [obj]
} else if (code === 'YB0002') {
this.mileage = [obj]
} else if (code === 'YB0005') {
this.others.push(obj)
}
})
this.getAllImages()
},
getCardImg(e) {
this.handlerData()
const _value = e.detail,
type = e.type
const _attachmentCode = type == 1 ? 'YB0003' : 'YB0004'
const _attachmentFile = type == 1 ? _value.font : _value.reverse
const _obj = {
attachmentCode: _attachmentCode,
attachmentFile: _attachmentFile,
attachmentType: 'IMG'
}
if (!_attachmentFile && type == 1) {
this.license[0] = {}
} else if (!_attachmentFile && type == 2) {
this.license[1] = {}
} else {
this.license[type - 1] = _obj
}
this.getAllImages()
},
getAllImages() {
let attachmentList = [],
_tempArr1 = [],
_tempArr2 = [],
_tempArr3 = [],
_tempArr4 = []
if (this.buyCar) {
this.buyCar.forEach(e => {
_tempArr1.push(e)
})
}
if (this.mileage) {
this.mileage.forEach(e => {
_tempArr2.push(e)
})
}
if (this.others) {
this.others.forEach(e => {
_tempArr3.push(e)
})
}
if (this.license) {
this.license.forEach(e => {
if (e.attachmentFile) {
_tempArr4.push(e)
}
})
}
attachmentList = [..._tempArr1, ..._tempArr2, ..._tempArr3, ..._tempArr4]
this.$emit('getAttachmentList', attachmentList)
},
handlerData() {
if (this.imgsQuery.length && !this.active) {
this.buyCar = []
this.mileage = []
this.license = [{}, {}]
this.others = []
this.imgsQuery.forEach(el => {
if (el.attachmentCode === 'YB0001') {
this.buyCar = [el]
} else if (el.attachmentCode === 'YB0002') {
this.mileage = [el]
} else if (el.attachmentCode === 'YB0003') {
this.license[0] = el
} else if (el.attachmentCode === 'YB0004') {
this.license[1] = el
} else if (el.attachmentCode === 'YB0005') {
this.others.push(el)
}
})
this.active = true
}
}
}
}
</script>
<style lang="scss" scoped>
.upload-contianer {
background: white;
margin: 10px 0 0;
.title {
font-size: 16px;
font-weight: 600;
padding: 15px 20px;
border-bottom: 1px solid #e7eaec;
margin: 0 0;
}
.widget {
padding: 32px 0px;
}
}
</style>
<template>
<el-drawer ref="drawerRef" class="shoppingCartDrawerCon" v-bind="$attrs" title="收货地址管理" size="774px"
:direction="direction" :before-close="cancel">
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="154px" defaultWidth="432px"
:formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<el-drawer ref="drawerRef" class="shoppingCartDrawerCon" v-bind="$attrs" title="收货地址管理" size="774px" :direction="direction" :before-close="cancel">
<glsx-combi-form class="edit-form-container" ref="editFormRef" labelWidth="154px" defaultWidth="432px" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule">
<span slot="provincesAndCities">
<el-cascader v-model="editForm.provincesAndCities" size="mini" ref="cascader" placeholder="请选择 省/市/区"
style="width:432px" :options="provincesAndCities_options"
:props="{ label: 'name', value: 'code', children: 'childrenList' }" />
<el-cascader v-model="editForm.provincesAndCities" size="mini" ref="cascader" placeholder="请选择 省/市/区" style="width: 432px" :options="provincesAndCities_options" :props="{ label: 'name', value: 'code', children: 'childrenList' }" />
</span>
</glsx-combi-form>
<div class="footer-btn">
<span class="btn">
<el-button size="small" @click="cancel">取消</el-button>
<el-button size="small" @click="submit" type="primary">保存</el-button>
<el-button size="small" @click="cancel">取消</el-button>
<el-button size="small" @click="submit" type="primary">保存</el-button>
</span>
</div>
</el-drawer>
</template>
......@@ -106,8 +101,6 @@ export default {
this.editForm = {}
}
}
}
},
created() {
......@@ -118,7 +111,6 @@ export default {
getAreaInfo() {
this.$apis.purchase.getAreaInfoApi({ areaType: '2' }).then(res => {
this.provincesAndCities_options = res.areaList
})
},
getProvincesAndCities() {
......@@ -137,7 +129,11 @@ export default {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
this.getProvincesAndCities()
let { merchantId, accountName, merchantName } = this.$globalState.session
const params = this.$common.utils.deepClone(this.editForm)
params.merchantId = merchantId
params.merchantName = merchantName
params.updatedBy = accountName
delete params.provincesAndCities
this.$apis.purchase
.addressSave(params)
......@@ -149,7 +145,7 @@ export default {
this.$parent.addressComVisible = false
this.$emit('handleConfirmAddress')
})
.catch(err => { })
.catch(err => {})
}
})
},
......@@ -157,8 +153,7 @@ export default {
this.$parent.addressComVisible = false
},
validPhone(mobile) {
const myreg =
/^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile)
}
}
......@@ -167,7 +162,6 @@ export default {
<style lang="scss" scoped>
.shoppingCartDrawerCon {
// position: relative;
/deep/ .el-drawer__header {
border-bottom: 1px solid #e7eaec;
......@@ -178,26 +172,26 @@ export default {
}
/deep/ .el-textarea {
width: 580px!important;
width: 580px !important;
.el-textarea__inner {
height: auto !important;
}
}
.footer-btn {
width: 774px;
height: 64px;
border-radius: 4px;
border-top: 1px solid #E5E5E5;
position: fixed;
bottom: 0;
text-align: right;
line-height: 64px;
width: 774px;
height: 64px;
border-radius: 4px;
border-top: 1px solid #e5e5e5;
position: fixed;
bottom: 0;
text-align: right;
line-height: 64px;
.btn {
text-align: right;
margin-right: 20px;
}
.btn {
text-align: right;
margin-right: 20px;
}
}
}
</style>
......@@ -196,6 +196,7 @@ export default {
params.orderTimeStr[0] = new Date(this.searchForm.placeOrderTimeStr[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.orderTimeStr[1] = new Date(this.searchForm.placeOrderTimeStr[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
params.merchantId = this.$globalState.session.merchantId
delete params.placeOrderTimeStr
return params
},
......@@ -229,7 +230,7 @@ export default {
},
//取消
handleCancel(row) {
this.secondConfirm('取消', '订单取消后即自动作废该订单,且无法撤回。是否确定取消?', 'purchase', 'purchaseOrderCancelOrCheck', { id: row.id })
this.secondConfirm('取消', '订单取消后即自动作废该订单,且无法撤回。是否确定取消?', 'purchase', 'purchaseOrderCancelOrCheck', { id: row.id,updatedBy:this.$globalState.session.accountName })
},
getOptionsList(formName, hasAll = true, refreshSigle) {
......
......@@ -191,8 +191,11 @@ export default {
},
methods: {
getAddressInfo() {
const { merchantId } = this.$globalState.session
this.$apis.purchase
.addressGet()
.addressGet({
merchantId
})
.then(result => {
if (result) {
this.addressInfo = result
......@@ -258,6 +261,7 @@ export default {
handleSubmit() {
this.throttleSubmit = true
const { contactAddress, contactName, contactPhone, provinceId, provinceName, cityId, cityName, areaId, areaName } = this.addressInfo
let { merchantId, accountName, merchantName } = this.$globalState.session
const params = {
purchaseMallId: this.goodsInfo.id,
goodsNumber: this.goodsNumber,
......@@ -269,7 +273,10 @@ export default {
cityId,
cityName,
areaId,
areaName
areaName,
merchantId,
merchantName,
updatedBy:accountName
}
if (provinceName == null) {
this.$message.error('请先完善收货地址')
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!