Commit 84b09b47 authored by dragondean@qq.com's avatar dragondean@qq.com

优化优惠券,布局创建报价单

parent 70af7de0
...@@ -5,7 +5,7 @@ ENV = 'development' ...@@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 捷道管理系统 VUE_APP_TITLE = 捷道管理系统
# 捷道管理系统/开发环境 # 捷道管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:48080' VUE_APP_BASE_API = 'http://jd.admtest.jdshangmen.com'
# VUE_APP_BASE_API = '/api' # VUE_APP_BASE_API = '/api'
# 路由懒加载 # 路由懒加载
......
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": [
"node_modules"
]
}
\ No newline at end of file
...@@ -12,8 +12,8 @@ export function createCoupon(data) { ...@@ -12,8 +12,8 @@ export function createCoupon(data) {
// 更新优惠券信息 // 更新优惠券信息
export function updateCoupon(data) { export function updateCoupon(data) {
return request({ return request({
url: '/ecw/coupon/createOrUpdate', url: '/ecw/coupon/update',
method: 'post', method: 'put',
data: data data: data
}) })
} }
...@@ -29,7 +29,7 @@ export function deleteCoupon(id) { ...@@ -29,7 +29,7 @@ export function deleteCoupon(id) {
// 获得优惠券信息 // 获得优惠券信息
export function getCoupon(id) { export function getCoupon(id) {
return request({ return request({
url: '/ecw/coupon/get?id=' + id, url: '/ecw/coupon/get?couponId=' + id,
method: 'get' method: 'get'
}) })
} }
...@@ -43,6 +43,15 @@ export function getCouponPage(query) { ...@@ -43,6 +43,15 @@ export function getCouponPage(query) {
}) })
} }
// 获得优惠券下拉
export function getCouponSelect(query) {
return request({
url: '/ecw/coupon/select',
method: 'get',
params: query
})
}
// 导出优惠券信息 Excel // 导出优惠券信息 Excel
export function exportCouponExcel(query) { export function exportCouponExcel(query) {
return request({ return request({
......
import request from '@/utils/request'
// 创建报价单管理
export function createOffer(data) {
return request({
url: '/ecw/offer/create',
method: 'post',
data: data
})
}
// 更新报价单管理
export function updateOffer(data) {
return request({
url: '/ecw/offer/update',
method: 'put',
data: data
})
}
// 删除报价单管理
export function deleteOffer(id) {
return request({
url: '/ecw/offer/delete?id=' + id,
method: 'delete'
})
}
// 获得报价单管理
export function getOffer(id) {
return request({
url: '/ecw/offer/get?id=' + id,
method: 'get'
})
}
// 获得报价单管理分页
export function getOfferPage(query) {
return request({
url: '/ecw/offer/page',
method: 'get',
params: query
})
}
// 导出报价单管理 Excel
export function exportOfferExcel(query) {
return request({
url: '/ecw/offer/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}
<template> <template>
<div class="dict-selector"> <div class="dict-selector">
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple"> <el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple" :disabled="disabled">
<el-option v-for="dict in dictList" <el-option v-for="dict in formattedList"
:key="dict.value" :label="dict.label" :value="dict.value"/> :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select> </el-select>
<el-radio-group v-if="formType == 'radio'" v-model="valueSync"> <el-radio-group v-if="formType == 'radio'" v-model="valueSync" :disabled="disabled">
<el-radio v-for="dict in dictList" :label="dict.value" :key="dict.value">{{dict.label}}</el-radio> <el-radio v-for="dict in formattedList" :label="dict.value" :checked="valueSync === dict.value" :key="dict.value">{{dict.label}}</el-radio>
</el-radio-group> </el-radio-group>
<el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync"> <el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync" :disabled="disabled">
<el-checkbox v-for="dict in dictList" :label="dict.value" :key="dict.value">{{dict.label}}</el-checkbox> <el-checkbox v-for="dict in formattedList" :label="dict.value" :key="dict.value">{{dict.label}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</div> </div>
</template> </template>
<script> <script>
const FORMATTERS = {
"string": String,
"bool": function(val){
return [false, 'false', 0, "0"].indexOf(val) < 0
},
'number': Number,
'array': function(val){
return typeof val == 'string' ? val.split(',').filter(item => item && item !== '') : val
}
}
export default { export default {
props:{ props:{
placeholder: { placeholder: {
...@@ -20,17 +30,22 @@ export default { ...@@ -20,17 +30,22 @@ export default {
default: '请选择' default: '请选择'
}, },
type: String, type: String,
value: [String, Number, Array], value: [String, Number, Array, Boolean],
multiple: Boolean, multiple: Boolean,
formType:{ formType:{
type: String, type: String,
default: 'select' default: 'select'
}, },
forceString: { formatter: {
type: [Function, String],
default: String
},
/* forceString: {
type: Boolean, type: Boolean,
default: true default: true
}, }, */
defaultable: Boolean, // 是否默认选择第一个 defaultable: Boolean, // 是否默认选择第一个
disabled: Boolean
}, },
data(){ data(){
return { return {
...@@ -40,11 +55,24 @@ export default { ...@@ -40,11 +55,24 @@ export default {
computed:{ computed:{
dictList(){ dictList(){
return this.getList(this.type) return this.getList(this.type)
},
formattedList(){
let arr = []
this.dictList.forEach(item => {
arr.push({
label: item.label,
value: this.format(item.value),
cssClass: item.cssClass,
colorType: item.colorType
})
})
return arr
} }
}, },
watch:{ watch:{
valueSync(){ valueSync(val){
this.$emit('input', this.forceString ? String(this.valueSync) : this.valueSync) //this.$emit('input', this.forceString ? String(this.valueSync) : this.valueSync)
this.$emit('input', this.format(val))
}, },
value(val){ value(val){
this.setValueSync() this.setValueSync()
...@@ -58,11 +86,30 @@ export default { ...@@ -58,11 +86,30 @@ export default {
this.setDefault() this.setDefault()
}, },
methods:{ methods:{
format(val){
if(val === null || val == undefined) return val
let formatter = typeof this.formatter == 'function' ? this.formatter : FORMATTERS[this.formatter]
if(!formatter){
console.warn('格式器无效', this.formatter)
return val
}
return formatter(val)
},
setValueSync(){ setValueSync(){
if(!this.value || this.value == '') return if(this.value === null || this.value === undefined || this.value === '') return
if(this.forceString && this.multiple){ if(this.multiple){
let value = []
if(typeof this.value == 'string'){
value = this.value.split(',').filter(item => item && item != '')
}
this.valueSync = value.map(item => this.format(item))
}else{
this.valueSync = this.format(this.value)
}
/* if(this.forceString && this.multiple){
this.valueSync = this.value.split(',') this.valueSync = this.value.split(',')
}else this.valueSync = this.forceString ? String(this.value) : this.value }else this.valueSync = this.forceString ? String(this.value) : this.value */
}, },
getList(){ getList(){
return this.getDictDatas(this.type) return this.getDictDatas(this.type)
...@@ -70,7 +117,7 @@ export default { ...@@ -70,7 +117,7 @@ export default {
setDefault(){ setDefault(){
if(!this.defaultable) return if(!this.defaultable) return
if(this.dictList.length && (this.valueSync === null || this.valueSync == '')){ if(this.dictList.length && (this.valueSync === null || this.valueSync == '')){
this.valueSync = this.dictList[0].value this.valueSync = this.multiple ? [] : this.formattedList[0].value
} }
} }
} }
......
...@@ -59,6 +59,11 @@ import {getChannelList} from '@/api/ecw/channel' ...@@ -59,6 +59,11 @@ import {getChannelList} from '@/api/ecw/channel'
import {getTradeCityList} from '@/api/ecw/region' import {getTradeCityList} from '@/api/ecw/region'
import {openedRouterList} from '@/api/ecw/warehouse' import {openedRouterList} from '@/api/ecw/warehouse'
export default { export default {
props:{
value: {
type: Array
}
},
data(){ data(){
return { return {
transportTypeDicts: this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE), transportTypeDicts: this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE),
...@@ -72,6 +77,7 @@ export default { ...@@ -72,6 +77,7 @@ export default {
selectedRoutes: [], // 勾选的路线渠道 selectedRoutes: [], // 勾选的路线渠道
hideMap: {}, // 折叠状态 hideMap: {}, // 折叠状态
checkAll: null, checkAll: null,
} }
}, },
computed:{ computed:{
...@@ -96,7 +102,7 @@ export default { ...@@ -96,7 +102,7 @@ export default {
if(router.transportType == item.value){ if(router.transportType == item.value){
routerList.push(Object.assign({ routerList.push(Object.assign({
_merge: item.cssClass == 'channel' ? this.availChannelList.length || 1 : 1, _merge: item.cssClass == 'channel' ? this.availChannelList.length || 1 : 1,
channel: item.cssClass == 'channel' ? this.availChannelList[0] || {} : {}, channel: item.cssClass == 'channel' ? this.availChannelList[0] || { channelId: 0} : {channelId: 0},
}, router) }, router)
) )
// 字典的cssClass =channel则表示渠道相关(空运,海空联运) // 字典的cssClass =channel则表示渠道相关(空运,海空联运)
...@@ -161,6 +167,10 @@ export default { ...@@ -161,6 +167,10 @@ export default {
}) })
this.getOpenedRouterList() this.getOpenedRouterList()
if(this.value && this.value.length){
this.selectedRoutes = this.value
}
}, },
methods:{ methods:{
getOpenedRouterList(){ getOpenedRouterList(){
...@@ -187,7 +197,7 @@ export default { ...@@ -187,7 +197,7 @@ export default {
if(selected){ if(selected){
this.selectedRoutes.push({ this.selectedRoutes.push({
lineId: router.id, lineId: router.id,
shippingChannelId: router.channel.channelId channelId: router.channel.channelId
}) })
}else{ }else{
let index = this.getSelectedIndex(router) let index = this.getSelectedIndex(router)
...@@ -199,7 +209,7 @@ export default { ...@@ -199,7 +209,7 @@ export default {
}, },
getSelectedIndex(router){ getSelectedIndex(router){
return this.selectedRoutes.findIndex(item => { return this.selectedRoutes.findIndex(item => {
return item.lineId == router.id && item.shippingChannelId == router.channel.channelId return item.lineId == router.id && item.channelId == router.channel.channelId
}) })
/* let index = null /* let index = null
......
This diff is collapsed.
...@@ -128,44 +128,27 @@ ...@@ -128,44 +128,27 @@
<el-table-column label="优惠券ID" align="center" prop="couponId" /> <el-table-column label="优惠券ID" align="center" prop="couponId" />
<el-table-column label="类型" align="center" prop="type"> <el-table-column label="类型" align="center" prop="type">
<template slot-scope="{row}"> <template slot-scope="{row}">
<dict-tag :type="DICT_TYPE.COUPON_TYPE" :value="row.type" /> <dict-tag :type="DICT_TYPE.ECW_COUPON_TYPE" :value="row.type" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="标题" align="center" prop="titleZh" /> <el-table-column label="标题" align="center" prop="titleZh" />
<!-- <el-table-column label="标题-英文" align="center" prop="titleEn" /> --> <el-table-column label="发布人/发布时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<el-table-column label="使用条件(优惠卷专用)" align="center" prop="cashCondition" /> <div>{{ scope.row.creatorName }}</div>
<el-table-column label="减免金额(优惠卷专用)" align="center" prop="reduceAmount" /> <div>{{ parseTime(scope.row.createTime) }}</div>
<el-table-column label="条件货币ID" align="center" prop="conditionCurrencyId" /> </template>
</el-table-column>
<el-table-column label="开始时间" align="center" prop="startTime" width="180"> <el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime) }}</span> <span>{{ parseTime(scope.row.startTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="减免货币ID" align="center" prop="reduceCurrencyId" />
<el-table-column label="结束时间" align="center" prop="endTime" width="180"> <el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime) }}</span> <span>{{ parseTime(scope.row.endTime) }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="领券后X天起生效" align="center" prop="afterReceiveDays" />
<el-table-column label="有效天数" align="center" prop="validDays" />
<el-table-column label="费用类型:1 运输费 2 清关费 3 总费用(优惠卷专用)" align="center" prop="costType" />
<el-table-column label="优惠清单" align="center" prop="discountDetailed" />
<el-table-column label="同类优惠劵是否可以叠加 0否 1是" align="center" prop="isSimilarSuperposition" />
<el-table-column label="可叠加优惠劵列表" align="center" prop="couponIds" />
<el-table-column label="适用用户类型 0全部用户 1部分用户 2指定用户不参与" align="center" prop="suitableUserType" />
<el-table-column label="适用线路类型 0全部线路参与 1指定线路参与 2指定线路不参与" align="center" prop="suitableLineType" />
<el-table-column label="适用产品类型 0全部产品参与 1指定产品参与 2指定产品不参与" align="center" prop="suitableProdType" />
<el-table-column label="每个用户领券上限,如不填则默认为1" align="center" prop="limitNum" />
<el-table-column label="优惠券过期状态 0:过期 1:未过期" align="center" prop="overdueStatus" />
<el-table-column label="优惠券投放状态(-1:取消投放 0:等待投放 1:投放 2:违规下架 3:等待审核)" align="center" prop="putonStatus" />
<el-table-column label="获取方式 0=客户领取 1=平台发放" align="center" prop="getWay" />
<el-table-column label="订单属性(可多选) 1 普货 2重货 3泡货" align="center" prop="orderAttr" />
<el-table-column label="是否发送站内信 0否 1是" align="center" prop="isSiteContent" />
<el-table-column label="是否控货(可多选) 0否 1是" align="center" prop="isCargoControl" />
<el-table-column label="单证报关(可多选) 1 我司全代 2自单代报 3混合报关" align="center" prop="documentDeclaration" />
<el-table-column label="优惠券状态(0:草稿 1:发布)" align="center" prop="status" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span> <span>{{ parseTime(scope.row.createTime) }}</span>
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment