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

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

parent 70af7de0
......@@ -5,7 +5,7 @@ ENV = 'development'
VUE_APP_TITLE = 捷道管理系统
# 捷道管理系统/开发环境
VUE_APP_BASE_API = 'http://localhost:48080'
VUE_APP_BASE_API = 'http://jd.admtest.jdshangmen.com'
# 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) {
// 更新优惠券信息
export function updateCoupon(data) {
return request({
url: '/ecw/coupon/createOrUpdate',
method: 'post',
url: '/ecw/coupon/update',
method: 'put',
data: data
})
}
......@@ -29,7 +29,7 @@ export function deleteCoupon(id) {
// 获得优惠券信息
export function getCoupon(id) {
return request({
url: '/ecw/coupon/get?id=' + id,
url: '/ecw/coupon/get?couponId=' + id,
method: 'get'
})
}
......@@ -43,6 +43,15 @@ export function getCouponPage(query) {
})
}
// 获得优惠券下拉
export function getCouponSelect(query) {
return request({
url: '/ecw/coupon/select',
method: 'get',
params: query
})
}
// 导出优惠券信息 Excel
export function exportCouponExcel(query) {
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>
<div class="dict-selector">
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple">
<el-option v-for="dict in dictList"
<el-select v-if="formType == 'select'" v-model="valueSync" :placeholder="placeholder" clearable :multiple="multiple" :disabled="disabled">
<el-option v-for="dict in formattedList"
:key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
<el-radio-group v-if="formType == 'radio'" v-model="valueSync">
<el-radio v-for="dict in dictList" :label="dict.value" :key="dict.value">{{dict.label}}</el-radio>
<el-radio-group v-if="formType == 'radio'" v-model="valueSync" :disabled="disabled">
<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-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync">
<el-checkbox v-for="dict in dictList" :label="dict.value" :key="dict.value">{{dict.label}}</el-checkbox>
<el-checkbox-group v-if="formType == 'checkbox'" v-model="valueSync" :disabled="disabled">
<el-checkbox v-for="dict in formattedList" :label="dict.value" :key="dict.value">{{dict.label}}</el-checkbox>
</el-checkbox-group>
</div>
</template>
<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 {
props:{
placeholder: {
......@@ -20,17 +30,22 @@ export default {
default: '请选择'
},
type: String,
value: [String, Number, Array],
value: [String, Number, Array, Boolean],
multiple: Boolean,
formType:{
type: String,
default: 'select'
},
forceString: {
formatter: {
type: [Function, String],
default: String
},
/* forceString: {
type: Boolean,
default: true
},
}, */
defaultable: Boolean, // 是否默认选择第一个
disabled: Boolean
},
data(){
return {
......@@ -40,11 +55,24 @@ export default {
computed:{
dictList(){
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:{
valueSync(){
this.$emit('input', this.forceString ? String(this.valueSync) : this.valueSync)
valueSync(val){
//this.$emit('input', this.forceString ? String(this.valueSync) : this.valueSync)
this.$emit('input', this.format(val))
},
value(val){
this.setValueSync()
......@@ -58,11 +86,30 @@ export default {
this.setDefault()
},
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(){
if(!this.value || this.value == '') return
if(this.forceString && this.multiple){
if(this.value === null || this.value === undefined || this.value === '') return
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(',')
}else this.valueSync = this.forceString ? String(this.value) : this.value
}else this.valueSync = this.forceString ? String(this.value) : this.value */
},
getList(){
return this.getDictDatas(this.type)
......@@ -70,7 +117,7 @@ export default {
setDefault(){
if(!this.defaultable) return
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'
import {getTradeCityList} from '@/api/ecw/region'
import {openedRouterList} from '@/api/ecw/warehouse'
export default {
props:{
value: {
type: Array
}
},
data(){
return {
transportTypeDicts: this.getDictDatas(this.DICT_TYPE.ECW_TRANSPORT_TYPE),
......@@ -72,6 +77,7 @@ export default {
selectedRoutes: [], // 勾选的路线渠道
hideMap: {}, // 折叠状态
checkAll: null,
}
},
computed:{
......@@ -96,7 +102,7 @@ export default {
if(router.transportType == item.value){
routerList.push(Object.assign({
_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)
)
// 字典的cssClass =channel则表示渠道相关(空运,海空联运)
......@@ -160,6 +166,10 @@ export default {
this.tradeCityList = res.data
})
this.getOpenedRouterList()
if(this.value && this.value.length){
this.selectedRoutes = this.value
}
},
methods:{
......@@ -187,7 +197,7 @@ export default {
if(selected){
this.selectedRoutes.push({
lineId: router.id,
shippingChannelId: router.channel.channelId
channelId: router.channel.channelId
})
}else{
let index = this.getSelectedIndex(router)
......@@ -199,7 +209,7 @@ export default {
},
getSelectedIndex(router){
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
......
......@@ -102,7 +102,7 @@ export const DICT_TYPE = {
IS_DEFAULT: 'is_default', // 默认联系人
CUSTOMER_FOLLOW_TYPE: 'customer_follow_type', // 跟进类型
CUSTOMER_FOLLOW_METHOD: 'customer_follow_method', // 跟进方式
COMMISSION_PRODUCT_APPROVAL:'commission_product_approval', //佣金备案
COMMISSION_PRODUCT_APPROVAL:'commission_product_approval', //佣金备案
SHIPPING_DECLARATION_TYPE:'shipping_declaration_type',//出货报关方式(与订单报关方式相同)
COMMISSION_TYPE:'commission_type',//佣金类型
COMMISSION_DARK_TYPE :'commission_dark_type',//暗涌类型
......
This diff is collapsed.
......@@ -128,44 +128,27 @@
<el-table-column label="优惠券ID" align="center" prop="couponId" />
<el-table-column label="类型" align="center" prop="type">
<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>
</el-table-column>
<el-table-column label="标题" align="center" prop="titleZh" />
<!-- <el-table-column label="标题-英文" align="center" prop="titleEn" /> -->
<el-table-column label="使用条件(优惠卷专用)" align="center" prop="cashCondition" />
<el-table-column label="减免金额(优惠卷专用)" align="center" prop="reduceAmount" />
<el-table-column label="条件货币ID" align="center" prop="conditionCurrencyId" />
<el-table-column label="发布人/发布时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<div>{{ scope.row.creatorName }}</div>
<div>{{ parseTime(scope.row.createTime) }}</div>
</template>
</el-table-column>
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime) }}</span>
</template>
</el-table-column>
<el-table-column label="减免货币ID" align="center" prop="reduceCurrencyId" />
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime) }}</span>
</template>
</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">
<template slot-scope="scope">
<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