Commit ee8648e6 authored by dragondean@qq.com's avatar dragondean@qq.com

Merge remote-tracking branch 'origin/dev' into dev

parents 60fc51b2 f79cee34
import request from "@/utils/request"; import request from '@/utils/request'
//操作积分 // 操作积分
export function operateMemberScore(data) { export function operateMemberScore(data) {
return request({ return request({
url: "/member/user-score/operate", url: '/member/user-score/operate',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//积分记录分页 // 积分记录分页
export function queryMemberScoreRecord(data) { export function queryMemberScoreRecord(data) {
return request({ return request({
url: "/member/user-score-log/page", url: '/member/user-score-log/page',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//兑换记录分页 // 兑换记录分页
export function queryMemberExchangeRecord(data) { export function queryMemberExchangeRecord(data) {
return request({ return request({
url: "/reward/redeem/record/page", url: '/reward/redeem/record/page',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//批量核销按钮 // 批量核销按钮
export function batchVerifyAPI(data) { export function batchVerifyAPI(data) {
return request({ return request({
url: "/reward/redeem/record/batch/verify", url: '/reward/redeem/record/batch/verify',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//兑换记录导出 // 兑换记录导出
export function batchRecordExport(data) { export function batchRecordExport(data) {
return request({ return request({
url: "/reward/redeem/record/export", url: '/reward/redeem/record/export',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//兑换记录导入 // 兑换记录导入
export function batchRecordImport(data) { export function batchRecordImport(data) {
return request({ return request({
url: "/reward/redeem/record/import", url: '/reward/redeem/record/import',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//兑换记录导入模板下载 // 兑换记录导入模板下载
export function batchRecordImportTemplate() { export function batchRecordImportTemplate() {
return request({ return request({
url: "/reward/redeem/record/import/template", url: '/reward/redeem/record/import/template',
method: "post", method: 'post',
responseType: "blob", responseType: 'blob'
}); })
} }
//撤销 操作 // 撤销 操作
export function rewardCancelQuery(data) { export function rewardCancelQuery(data) {
return request({ return request({
url: "/reward/redeem/record/cancel", url: '/reward/redeem/record/cancel',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//获取记录详情 // 获取记录详情
export function getRewardDetailQuery(data) { export function getRewardDetailQuery(data) {
return request({ return request({
url: "/reward/redeem/record/detail", url: '/reward/redeem/record/detail',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//更新兑换记录 // 更新兑换记录
export function updatedRewardsDetails(data) { export function updatedRewardsDetails(data) {
return request({ return request({
url: "/reward/redeem/record/update", url: '/reward/redeem/record/update',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//核销回退 // 核销回退
export function verifyRollback(data) { export function verifyRollback(data) {
return request({ return request({
url: "/reward/redeem/record/verify-back", url: '/reward/redeem/record/verify-back',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//核销 操作 // 核销 操作
export function verifyRedeem(data) { export function verifyRedeem(data) {
return request({ return request({
url: "/reward/redeem/record/verify", url: '/reward/redeem/record/verify',
method: "post", method: 'post',
data: data, data: data
}); })
} }
//获取积分规则记录 // 获取积分规则记录
export function getScoreRecordList(data) { export function getScoreRecordList(data) {
return request({ return request({
url: "/member/score-rule/page", url: '/member/score-rule/page',
method: "post", method: 'post',
params: { params: {
page: data.page, page: data.page,
rows: data.rows, rows: data.rows
}, },
data, data
}); })
} }
//会员积分等级列表 // 会员积分等级列表
export function getMemberLevelList(data) { export function getMemberLevelList(data) {
return request({ return request({
url: "/member/user-level/page", url: '/member/user-level/page',
method: "post", method: 'post',
data, data
}); })
} }
//新增会员等级设置 // 新增会员等级设置
export function addNewMemberLevel(data) { export function addNewMemberLevel(data) {
return request({ return request({
url: "/member/user-level/add", url: '/member/user-level/add',
method: "post", method: 'post',
data, data
}); })
} }
//删除会员等级 // 删除会员等级
export function delMemberLevel(data) { export function delMemberLevel(data) {
return request({ return request({
url: "/member/user-level/delete", url: '/member/user-level/delete',
method: "post", method: 'post',
data, data
}); })
} }
//edit member level // edit member level
export function editMemberLevel(data) { export function editMemberLevel(data) {
return request({ return request({
url: "/member/user-level/update", url: '/member/user-level/update',
method: "post", method: 'post',
data, data
}); })
} }
//获得目的国、目的城市、目的仓列表 // 获得目的国、目的城市、目的仓列表
export function getRegionTreeList() { export function getRegionTreeList() {
return request({ return request({
url: "/member/score-rule/warehouse-tree-region-list", url: '/member/score-rule/warehouse-tree-region-list',
method: "get", method: 'get'
}); })
} }
//获取渠道列表 // 获取渠道列表
export function getChannelList() { export function getChannelList() {
return request({ return request({
url: "/ecw/channel/list-all-simple", url: '/ecw/channel/list-all-simple',
method: "get", method: 'get'
}); })
} }
//积分规则创建 // 积分规则创建
export function createIntegralRule(data) { export function createIntegralRule(data) {
return request({ return request({
url: "/member/score-rule/create", url: '/member/score-rule/create',
method: "post", method: 'post',
data, data
}); })
} }
//启用关闭 积分规则 // 启用关闭 积分规则
export function integralRuleStatus(data) { export function integralRuleStatus(data) {
return request({ return request({
url: "/member/score-rule/status", url: '/member/score-rule/status',
method: "post", method: 'post',
data, data
}); })
} }
//复制积分规则 // 复制积分规则
export function integralRuleCopy(data) { export function integralRuleCopy(data) {
return request({ return request({
url: "/member/score-rule/copy", url: '/member/score-rule/copy',
method: "post", method: 'post',
data, data
}); })
} }
//延期积分规则 // 延期积分规则
export function integralRuleDelay(data) { export function integralRuleDelay(data) {
return request({ return request({
url: "/member/score-rule/delay", url: '/member/score-rule/delay',
method: "post", method: 'post',
data, data
}); })
} }
//删除积分规则 // 删除积分规则
export function integralRuleDelete(data) { export function integralRuleDelete(data) {
return request({ return request({
url: "/member/score-rule/delete", url: '/member/score-rule/delete',
method: "post", method: 'post',
data, data
}); })
} }
//获取积分规则详情 // 获取积分规则详情
export function integralRuleDetails(data) { export function integralRuleDetails(data) {
return request({ return request({
url: "/member/score-rule/get", url: '/member/score-rule/get',
method: "post", method: 'post',
data, data
}); })
} }
//编辑积分规则 // 编辑积分规则
export function integralRuleUpdated(data) { export function integralRuleUpdated(data) {
return request({ return request({
url: "/member/score-rule/update", url: '/member/score-rule/update',
method: "post", method: 'post',
data, data
}); })
}
// 获取会员功能开关
export function switchRuleGet() {
return request({
url: '/member/score-rule/switch/get',
method: 'get'
})
}
// 设置会员工能开关
export function switchRuleSet(data) {
return request({
url: '/member/score-rule/switch/set',
method: 'post',
data
})
} }
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<el-select v-model="queryParams.attrId" :placeholder="$t('选择属性')" style="width:120px" clearable @change="getList" :disabled="loading"> <el-select v-model="queryParams.attrId" :placeholder="$t('选择属性')" style="width:120px" clearable @change="getList" :disabled="loading">
<el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" /> <el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" />
</el-select> </el-select>
<el-input v-model="queryParams.titleZh" :placeholder="$t('产品关键字')" style="width:120px" clearable :disabled="loading"/> <el-input v-model="queryParams.titleZh" :placeholder="$t('产品关键字')" style="width:120px" clearable onkeyup="this.value=this.value.replace(/\s+/g, '')" :disabled="loading"/>
<el-button type="primary" @click="reLoad" :loading="loading">{{$t('搜索')}}</el-button> <el-button type="primary" @click="reLoad" :loading="loading">{{$t('搜索')}}</el-button>
<div style="height: 36px; display: flex; align-items: center"> <div style="height: 36px; display: flex; align-items: center">
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<el-select v-model="selectedFilterParams.attrId" :placeholder="$t('选择属性')" style="width:120px" clearable :disabled="loading"> <el-select v-model="selectedFilterParams.attrId" :placeholder="$t('选择属性')" style="width:120px" clearable :disabled="loading">
<el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" /> <el-option v-for="item in attrList" :key="item.id" :label="item.attrName" :value="item.id" />
</el-select> </el-select>
<el-input v-model="selectedFilterParams.titleZh" :placeholder="$t('产品关键字')" style="width:120px" clearable :disabled="loading"/> <el-input v-model="selectedFilterParams.titleZh" :placeholder="$t('产品关键字')" style="width:120px" clearable onkeyup="this.value=this.value.replace(/\s+/g, '')" :disabled="loading"/>
<!--<el-button type="primary" @click="reLoad" :loading="loading">{{$t('搜索')}}</el-button>--> <!--<el-button type="primary" @click="reLoad" :loading="loading">{{$t('搜索')}}</el-button>-->
<div class="flex"> <div class="flex">
......
...@@ -10,14 +10,28 @@ ...@@ -10,14 +10,28 @@
<el-option v-for="item in exportCityList" :key="item.id" :label="item.titleZh" :value="item.id" /> <el-option v-for="item in exportCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select> </el-select>
{{$t('目的地')}}: {{$t('目的国')}}:
<el-select :placeholder="$t('请选择目的国')" v-model="destCountryId" clearable>
<el-option v-for="item in countryList" :key="item.id" :label="$l(item, 'title')" :value="item.id" />
</el-select>
{{$t('目的城市')}}:
<!--
<el-select :placeholder="$t('请选择目的地')" v-model="importCity" clearable> <el-select :placeholder="$t('请选择目的地')" v-model="importCity" clearable>
<el-option v-for="item in importCityList" :key="item.id" :label="item.titleZh" :value="item.id" /> <el-option v-for="item in importCityList" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select> </el-select>
-->
<el-select :placeholder="$t('请选择目的城市')" v-model="destCityId" clearable>
<el-option v-for="item in AddressCity" :key="item.shi" :label="item.shiName" :value="item.shi" />
</el-select>
{{$t('目的仓')}}:
<el-select :placeholder="$t('请选择目的仓')" v-model="destWarehouseId" clearable>
<el-option v-for="item in AddressTown" :key="item.id" :label="item.titleZh" :value="item.id" />
</el-select>
<template v-if="type != 'sea'"> <template v-if="type != 'sea'">
{{$t('出货渠道')}}: {{$t('出货渠道')}}:
<el-select :placeholder="$t('请选择渠道')" v-model="channelId" clearable> <el-select :placeholder="$t('请选择出货渠道')" v-model="channelId" clearable>
<el-option v-for="item in channelList" :key="item.channelId" :label="item.nameZh" :value="item.channelId" /> <el-option v-for="item in channelList" :key="item.channelId" :label="item.nameZh" :value="item.channelId" />
</el-select> </el-select>
</template> </template>
...@@ -82,7 +96,8 @@ ...@@ -82,7 +96,8 @@
</template> </template>
<script> <script>
import {getChannelList} from '@/api/ecw/channel' import {getChannelList} from '@/api/ecw/channel'
import {getTradeCityList} from '@/api/ecw/region' import {getListTree, getTradeCityList} from '@/api/ecw/region'
import {getRegionList} from "@/api/ecw/order";
import {openedRouterList} from '@/api/ecw/warehouse' import {openedRouterList} from '@/api/ecw/warehouse'
import {getProductAttrList} from "@/api/ecw/productAttr"; import {getProductAttrList} from "@/api/ecw/productAttr";
import Template from "@/views/cms/template"; import Template from "@/views/cms/template";
...@@ -115,7 +130,13 @@ export default { ...@@ -115,7 +130,13 @@ export default {
checkAll: null, checkAll: null,
groupChecker: {}, // 分组全选状态 groupChecker: {}, // 分组全选状态
attrList:[], // 商品特性 attrList:[], // 商品特性
inited: false inited: false,
countryList: [], //目的国
AddressCity: [], //目的地
AddressTown: [], //目的仓
destCountryId: null,
destCityId: null,
destWarehouseId: null,
} }
}, },
...@@ -124,6 +145,7 @@ export default { ...@@ -124,6 +145,7 @@ export default {
return this.tradeCityList.filter(item => item.type == 1 || item.type == 3) return this.tradeCityList.filter(item => item.type == 1 || item.type == 3)
}, },
exportCityList(){ exportCityList(){
//字典:贸易类型字典region_trade_type,0非进出口,1进口,2出口,3进出口
return this.tradeCityList.filter(item => item.type == 2 || item.type == 3) return this.tradeCityList.filter(item => item.type == 2 || item.type == 3)
}, },
exportCityIds(){ exportCityIds(){
...@@ -185,6 +207,7 @@ export default { ...@@ -185,6 +207,7 @@ export default {
transportTypeList.push(child) transportTypeList.push(child)
} }
}) })
console.log(transportTypeList)
return transportTypeList return transportTypeList
}, },
// 是否显示商品特性(渠道) // 是否显示商品特性(渠道)
...@@ -211,10 +234,10 @@ export default { ...@@ -211,10 +234,10 @@ export default {
exportCity(){ exportCity(){
this.getOpenedRouterList() this.getOpenedRouterList()
}, },
importCity(){ /*importCity(){
this.getChannelList() this.getChannelList()
this.getOpenedRouterList() this.getOpenedRouterList()
}, },*/
selectedRoutes(val){ selectedRoutes(val){
this.$emit('input', val) this.$emit('input', val)
// 如果选择发生变化 // 如果选择发生变化
...@@ -252,18 +275,108 @@ export default { ...@@ -252,18 +275,108 @@ export default {
this.groupChecker[key] = false this.groupChecker[key] = false
}) })
} }
},
destCountryId: {
//监听当前地区值的变化,于与上方地区值进行了双向绑定
deep: true, //深度监听
handler() {
//每当值省份值改变时其下地区值进行清空
this.AddressCity = [];
this.AddressTown = [];
this.destWarehouseId = "";
this.destCityId = "";
this.findByprovinceCode();
if (this.destCountryId == "") {
//1 是所有区域,2 国家,3是市,
this.getAddressCity()
this.getAddressTown()
} else if (
this.destCountryId != "" &&
this.destCityId == "" &&
this.destWarehouseId == ""
) {
this.getAddressTown()
} }
this.getOpenedRouterList()
}, },
async created(){ },
destCityId: {
deep: true, //深度监听 目的仓
handler() {
this.AddressTown = [];
this.destWarehouseId = "";
this.findBycityCode();
if (
this.destCityId != "" &&
this.destCountryId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
} else if (
this.destCountryId == "" &&
this.destCityId == "" &&
this.destWarehouseId == ""
) {
this.getAddressTown()
} else if (
this.destCountryId != "" &&
this.destCityId == "" &&
this.destWarehouseId == ""
) {
this.findByprovinceCode()
this.getAddressTown()
} else if (
this.destCountryId == "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
}
this.getOpenedRouterList()
this.getChannelList() this.getChannelList()
},
},
destWarehouseId: {
deep: true, //深度监听
handler() {
if (
this.destCountryId != "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
//获取当前城市值id,获取该城市下区域
this.findBycityCode()
} else if (
this.destCountryId != "" &&
this.destCityId == "" &&
this.destWarehouseId == ""
) {
this.getAddressTown()
} else if (
this.destCountryId == "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
this.findBycityCode()
}
this.getOpenedRouterList()
},
},
},
async created(){
this.tradeCityList = (await getTradeCityList()).data this.tradeCityList = (await getTradeCityList()).data
// 路线需要过滤失效的进出口城市,所以在程序加载后再加载路线 // 路线需要过滤失效的进出口城市,所以在程序加载后再加载路线
await this.getOpenedRouterList() await this.getOpenedRouterList()
if(this.option){ if(this.option){
this.changeOption() this.changeOption()
} }
await this.$nextTick() await this.$nextTick()
this.getCountryList()
this.getAddressCity()
this.getAddressTown()
this.getChannelList()
if(this.value && this.value.length){ if(this.value && this.value.length){
this.selectedRoutes = this.value this.selectedRoutes = this.value
} }
...@@ -277,11 +390,15 @@ export default { ...@@ -277,11 +390,15 @@ export default {
this.inited = true this.inited = true
}, },
methods:{ methods:{
async getChannelList(){ getChannelList(){
if (this.type == 'sea') return
let query = { let query = {
cityId: this.importCity // cityId: this.importCity
cityId: this.destCityId
} }
this.channelList = (await getChannelList(query)).data getChannelList(query).then(res => {
this.channelList = res.data
})
}, },
getAttrList(){ getAttrList(){
getProductAttrList().then(res => { getProductAttrList().then(res => {
...@@ -290,7 +407,10 @@ export default { ...@@ -290,7 +407,10 @@ export default {
}, },
changeOption(){ changeOption(){
if(!this.option) return if(!this.option) return
this.importCity = +this.option.importCity || null this.destCountryId = +this.option.destCountryId || null
this.destCityId = +this.option.destCityId || null
this.destWarehouseId = +this.option.destWarehouseId || null
// this.importCity = +this.option.importCity || null
this.exportCity = +this.option.exportCity || null this.exportCity = +this.option.exportCity || null
this.transportType = this.option.transportId || null this.transportType = this.option.transportId || null
this.channelId = +this.option.channelId || null this.channelId = +this.option.channelId || null
...@@ -308,8 +428,14 @@ export default { ...@@ -308,8 +428,14 @@ export default {
if(this.exportCity){ if(this.exportCity){
params.startCityId = this.exportCity params.startCityId = this.exportCity
} }
if(this.importCity){ if(this.destCountryId){
params.destCityId = this.importCity params.destCountryId = this.destCountryId
}
if(this.destCityId){
params.destCityId = this.destCityId
}
if(this.destWarehouseId){
params.destWarehouseId = this.destWarehouseId
} }
const res = await openedRouterList(params) const res = await openedRouterList(params)
this.openedRouterList = res.data.filter(item => { this.openedRouterList = res.data.filter(item => {
...@@ -368,6 +494,39 @@ export default { ...@@ -368,6 +494,39 @@ export default {
if(!this.type) return true if(!this.type) return true
return (this.type == 'sea' ? ['1','2'] : ['3', '4']).indexOf(item.value) > -1 return (this.type == 'sea' ? ['1','2'] : ['3', '4']).indexOf(item.value) > -1
}, },
/* 国家 */
getCountryList() {
getListTree({ treeType: 1 }).then((response) => {
this.countryList = response.data;
})
},
getAddressCity() {
getRegionList(4, 4).then(({ data }) => {
this.AddressCity = data;
})
},
getAddressTown() {
getRegionList(5, 5).then(({ data }) => {
this.AddressTown = data;
})
},
findByprovinceCode() {
if (this.destCountryId != null && this.destCountryId != '') {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId).then(({ data }) => {
this.AddressCity = data;
})
}
},
findBycityCode() {
if (this.destCityId != null && this.destCityId != '') {
//获取当前城市值id,获取该城市下区域
getRegionList(3, this.destCityId).then(({ data }) => {
this.AddressTown = data;
})
}
},
} }
} }
</script> </script>
......
...@@ -4689,6 +4689,7 @@ ...@@ -4689,6 +4689,7 @@
"发货评估": "Delivery evaluation", "发货评估": "Delivery evaluation",
"财务资料": "Finance Information", "财务资料": "Finance Information",
"特殊设置": "Special setting", "特殊设置": "Special setting",
"已卸柜/已到仓时间": "Unloaded/arrived Time" "已卸柜/已到仓时间": "Unloaded/arrived Time",
"开启会员积分系统":"Enable member points system",
"是否确认{val}会员积分系统":"Confirm whether to {val} the member points system"
} }
...@@ -19,7 +19,7 @@ const service = axios.create({ ...@@ -19,7 +19,7 @@ const service = axios.create({
(localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) + (localStorage.VUE_APP_BASE_API || process.env.VUE_APP_BASE_API) +
"/admin-api/", // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/ "/admin-api/", // 此处的 /admin-api/ 地址,原因是后端的基础路径为 /admin-api/
// 超时 // 超时
timeout: 1000 * 30, timeout: 1000 * 60,
}); });
// 如果是生产环境则打印提示 // 如果是生产环境则打印提示
......
...@@ -88,24 +88,31 @@ ...@@ -88,24 +88,31 @@
range-separator="-" range-separator="-"
:start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" /> :start-placeholder="$t('开始日期')" :end-placeholder="$t('结束日期')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的国')"> <el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select <el-select
v-model="destCountryId" v-model="destCountryId"
:label="destCountryId" multiple
:placeholder="$t('请选择目的国')"
clearable clearable
@change="handleQuery" @change="handleQuery"
> >
<el-option <el-option
v-for="item in countryList" v-for="item in AddressProvince"
:key="item.id" :key="item.guojia"
:label="$l(item, 'title')" :label="item.guojiaName"
:value="item.id" :value="item.guojia"
> ></el-option>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的地')"> <el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="destCityId" clearable @change="handleQuery"> <el-select
v-model="objectiveId"
multiple
:placeholder="$t('请根据目的国选择目的城市')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option <el-option
v-for="item in AddressCity" v-for="item in AddressCity"
:key="item.shi" :key="item.shi"
...@@ -114,8 +121,15 @@ ...@@ -114,8 +121,15 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')"> <el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="destWarehouseId" clearable @change="handleQuery"> <el-select
v-model="destWarehouseId"
multiple
:placeholder="$t('请根据目的城市选择目的仓')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option <el-option
v-for="item in AddressTown" v-for="item in AddressTown"
:key="item.id" :key="item.id"
...@@ -132,6 +146,15 @@ ...@@ -132,6 +146,15 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<el-descriptions :column="2">
<el-descriptions-item :label="$t('海空联运/海运拼柜/海运整柜/专线空运')">{{orderStatisticsObj.hklyTotal || 0}}/{{orderStatisticsObj.hypgTotal || 0 }}/{{orderStatisticsObj.hyzgTotal || 0}}/{{orderStatisticsObj.zxkyTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易日期')">{{orderStatisticsObj.lastBusinessDate}}</el-descriptions-item>
<el-descriptions-item :label="$t('全部订单/控货订单')">{{orderStatisticsObj.allOrderTotal || 0}}/{{orderStatisticsObj.controlOrderTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('最后交易单号')">{{orderStatisticsObj.lastBusinessOrderNo}}</el-descriptions-item>
<el-descriptions-item :label="$t('报价/下单/入仓')">{{orderStatisticsObj.offerOrderTotal || 0}}/{{orderStatisticsObj.pickOrderTotal || 0}}/{{orderStatisticsObj.wareHousingTotal || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('储存量')">{{orderStatisticsObj.stock || 0}}</el-descriptions-item>
<el-descriptions-item :label="$t('已出货订单')">{{orderStatisticsObj.shipmentTotal || 0}}</el-descriptions-item>
</el-descriptions>
<el-table :data="orderList"> <el-table :data="orderList">
<el-table-column :label="$t('订单编号')" width="120px" align="center" prop="orderNo" > <el-table-column :label="$t('订单编号')" width="120px" align="center" prop="orderNo" >
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -210,24 +233,31 @@ ...@@ -210,24 +233,31 @@
<el-card class="box-card"> <el-card class="box-card">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<el-form :inline="true" size="small"> <el-form :inline="true" size="small">
<el-form-item :label="$t('目的国')"> <el-form-item :label="$t('目的国')" prop="destCountryId">
<el-select <el-select
v-model="destCountryId" v-model="destCountryId"
:label="destCountryId" multiple
:placeholder="$t('请选择目的国')"
clearable clearable
@change="handleQuery" @change="handleQuery"
> >
<el-option <el-option
v-for="item in countryList" v-for="item in AddressProvince"
:key="item.id" :key="item.guojia"
:label="$l(item, 'title')" :label="item.guojiaName"
:value="item.id" :value="item.guojia"
> ></el-option>
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的地')"> <el-form-item :label="$t('目的城市')" prop="objectiveId">
<el-select v-model="destCityId" clearable @change="handleQuery"> <el-select
v-model="objectiveId"
multiple
:placeholder="$t('请根据目的国选择目的城市')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option <el-option
v-for="item in AddressCity" v-for="item in AddressCity"
:key="item.shi" :key="item.shi"
...@@ -236,8 +266,15 @@ ...@@ -236,8 +266,15 @@
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('目的仓')"> <el-form-item :label="$t('目的仓')" prop="destWarehouseId">
<el-select v-model="destWarehouseId" clearable @change="handleQuery"> <el-select
v-model="destWarehouseId"
multiple
:placeholder="$t('请根据目的城市选择目的仓')"
style="width: 200px"
clearable
@change="handleQuery"
>
<el-option <el-option
v-for="item in AddressTown" v-for="item in AddressTown"
:key="item.id" :key="item.id"
...@@ -249,7 +286,7 @@ ...@@ -249,7 +286,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" @click="getInfoListOfferPage">{{$t('搜索')}}</el-button> <el-button type="primary" @click="getInfoListOfferPage">{{$t('搜索')}}</el-button>
<el-button type="primary" @click="()=>{ <el-button type="primary" @click="()=>{
queryParams = { rows:10,page:1}; getInfoListOfferPage();rucangtime = []; infoListOfferFrom = { pageNo:1,pageSize:10}; getInfoListOfferPage();rucangtime = [];
}">{{$t('重置')}}</el-button> }">{{$t('重置')}}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
...@@ -349,6 +386,33 @@ ...@@ -349,6 +386,33 @@
:label="$t('创建时间')" :label="$t('创建时间')"
> >
</el-table-column> </el-table-column>
<el-table-column :label="$t('操作')" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<!--
0 取消 恢复
1 特价审批 编辑、跟进、 取消 删除
2 草稿 编辑、 删除
3 需求确认 编辑、跟进、结果、特价、取消 删除
4 赢单 删除
5 输单 删除
6 完成 删除
7 跟进中 编辑、跟进、结果、特价、取消、 删除
-->
<el-dropdown>
<el-button icon="el-icon-plus" circle type="primary"></el-button>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="$router.push('/offer/detail?offerId=' + scope.row.offerId)" v-hasPermi="['ecw:offer:show']">{{$t('详情')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/edit?id=' + scope.row.offerId)" v-if="[1,2,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:update']">{{$t('编辑')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/logList?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:loglist']">{{$t('跟进')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push(`/offer/result?offerId=${scope.row.offerId}&number=${scope.row.number}`)" v-if="[3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:result']">{{$t('结果')}}</el-dropdown-item>
<el-dropdown-item @click.native="$router.push('/offer/special?offerId=' + scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:discount','ecw:offer:commission']">{{$t('特价')}}</el-dropdown-item>
<el-dropdown-item @click.native="cancel(scope.row.offerId)" v-if="[1,3,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:cancel']">{{$t('取消')}}</el-dropdown-item>
<el-dropdown-item @click.native="recovery(scope.row.offerId)" v-if="[0].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:recovery']">{{$t('恢复')}}</el-dropdown-item>
<el-dropdown-item @click.native="deleteOffer(scope.row.offerId)" v-if="[0,1,2,3,4,5,6,7].indexOf(scope.row.status) > -1" v-hasPermi="['ecw:offer:delete']">{{$t('删除')}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
</el-table-column>
</el-table> </el-table>
<pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination> <pagination @pagination="getInfoListOfferPage" :page.sync="infoListOfferFrom.pageNo" :limit.sync="infoListOfferFrom.pageSize" :total="infoListOfferTotal" ></pagination>
</el-card> </el-card>
...@@ -713,6 +777,7 @@ import {checkPermi} from "@/utils/permission"; ...@@ -713,6 +777,7 @@ import {checkPermi} from "@/utils/permission";
import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue"; import ImageDisplay from "@/views/ecw/order/components/imageDisplay.vue";
import { getListTree } from "@/api/ecw/region"; import { getListTree } from "@/api/ecw/region";
import { getWarehouseList } from "@/api/ecw/warehouse"; import { getWarehouseList } from "@/api/ecw/warehouse";
import { deleteOffer, cancel, recovery } from "@/api/ecw/offer";
export default { export default {
name: 'query', name: 'query',
components: { components: {
...@@ -759,13 +824,10 @@ export default { ...@@ -759,13 +824,10 @@ export default {
// this.creditLogPage()//等级日志 // this.creditLogPage()//等级日志
this.getorderList()//订单 this.getorderList()//订单
// this.getInfoListOfferPage()//报价 // this.getInfoListOfferPage()//报价
// this.getOrderStatistics()//数据 this.getOrderStatistics()//数据
// this.creditScoreStatisticFn() //信用日志 // this.creditScoreStatisticFn() //信用日志
// this.infoListReceiptFn()//账单 // this.infoListReceiptFn()//账单
this.getData(); this.getData();
//获取城市列表
this.getCountryList();
this.getWarehouseList() this.getWarehouseList()
}, },
watch:{ watch:{
...@@ -773,16 +835,16 @@ export default { ...@@ -773,16 +835,16 @@ export default {
switch (val) { switch (val) {
case 'order': case 'order':
this.destCountryId = '' this.destCountryId = ''
this.destCityId = ''
this.destWarehouseId = '' this.destWarehouseId = ''
this.queryParams = { rows:10, page:1} this.objectiveId = ''
this.queryParams.page = 1
this.getorderList()//订单 this.getorderList()//订单
break break
case 'quote': case 'quote':
this.destCountryId = '' this.destCountryId = ''
this.destCityId = ''
this.destWarehouseId = '' this.destWarehouseId = ''
this.queryParams = { rows:10, page:1} this.objectiveId = ''
this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage()//报价 this.getInfoListOfferPage()//报价
break break
case 'bill': case 'bill':
...@@ -805,7 +867,6 @@ export default { ...@@ -805,7 +867,6 @@ export default {
} }
}, },
destCountryId: { destCountryId: {
//监听当前地区值的变化,于与上方地区值进行了双向绑定 //监听当前地区值的变化,于与上方地区值进行了双向绑定
deep: true, //深度监听 deep: true, //深度监听
...@@ -813,111 +874,48 @@ export default { ...@@ -813,111 +874,48 @@ export default {
//每当值省份值改变时其下地区值进行清空 //每当值省份值改变时其下地区值进行清空
this.AddressCity = []; this.AddressCity = [];
this.AddressTown = []; this.AddressTown = [];
this.objectiveId = "";
this.destWarehouseId = ""; this.destWarehouseId = "";
this.destCityId = "";
this.findByprovinceCode();
if (this.destCountryId == "") {
//1 是所有区域,2 国家,3是市,
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});
getRegionList(5, 5) if (this.destCountryId == "") {
.then(({ data }) => { this.getAddressCity()
this.AddressTown = data; this.getAddressTown()
})
.catch((error) => {
console.log(error);
});
} else if ( } else if (
this.destCountryId != "" && this.destCountryId != "" &&
this.destCityId == "" && this.objectiveId == "" &&
this.destWarehouseId == "" this.destWarehouseId == ""
) { ) {
/*getRegionList(2, this.destCountryId) this.findByprovinceCode()
.then(({ data }) => { this.getAddressTown()
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});*/
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} }
}, },
}, },
destCityId: { objectiveId: {
deep: true, //深度监听 目的仓 deep: true, //深度监听
handler() { handler() {
this.AddressTown = []; this.AddressTown = [];
this.destWarehouseId = ""; this.destWarehouseId = "";
this.findBycityCode();
if ( if (
this.destCityId != "" && this.objectiveId != "" &&
this.destCountryId != "" && this.destCountryId != "" &&
this.destWarehouseId == "" this.destWarehouseId == ""
) { ) {
//获取当前城市值id,获取该城市下区域 //获取当前城市值id,获取该城市下区域
/*getRegionList(3, this.destCityId) this.findBycityCode()
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});*/
} else if ( } else if (
this.destCountryId == "" && this.destCountryId == "" &&
this.destCityId == "" && this.objectiveId == "" &&
this.destWarehouseId == "" this.destWarehouseId == ""
) { ) {
getRegionList(5, 5) this.getAddressCity()
.then(({ data }) => { this.getAddressTown()
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} else if ( } else if (
this.destCountryId != "" && this.destCountryId != "" &&
this.destCityId == "" && this.objectiveId == "" &&
this.destWarehouseId == ""
) {
getRegionList(2, this.destCountryId)
.then(({ data }) => {
this.AddressCity = data;
})
.catch((error) => {
console.log(error);
});
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId == "" &&
this.destCityId != "" &&
this.destWarehouseId == "" this.destWarehouseId == ""
) { ) {
//获取当前城市值id,获取该城市下区域 this.findByprovinceCode()
getRegionList(3, this.destCityId) this.getAddressTown()
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} }
}, },
}, },
...@@ -925,42 +923,18 @@ export default { ...@@ -925,42 +923,18 @@ export default {
deep: true, //深度监听 deep: true, //深度监听
handler() { handler() {
if ( if (
this.objectiveId != "" &&
this.destCountryId != "" && this.destCountryId != "" &&
this.destCityId != "" &&
this.destWarehouseId == "" this.destWarehouseId == ""
) { ) {
//获取当前城市值id,获取该城市下区域 //获取当前城市值id,获取该城市下区域
getRegionList(3, this.destCityId) this.findBycityCode()
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} else if ( } else if (
this.destCountryId != "" && this.destCountryId != "" &&
this.destCityId == "" && this.objectiveId == "" &&
this.destWarehouseId == "" this.destWarehouseId == ""
) { ) {
getRegionList(5, 5) this.getAddressTown()
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} else if (
this.destCountryId == "" &&
this.destCityId != "" &&
this.destWarehouseId == ""
) {
getRegionList(3, this.destCityId)
.then(({ data }) => {
this.AddressTown = data;
})
.catch((error) => {
console.log(error);
});
} }
}, },
}, },
...@@ -1070,14 +1044,12 @@ export default { ...@@ -1070,14 +1044,12 @@ export default {
infoListReceiptTotal:0, infoListReceiptTotal:0,
country: '', country: '',
showMore: true, showMore: true,
countryList: [], //目的国 AddressCity: [],
AddressCity: [], //目的城市 AddressProvince: [],
AddressTown: [], //目的仓 AddressTown: [],
destCountryId: null, destCountryId: null,
// objectiveId: null, objectiveId: null,
destCityId: null,
destWarehouseId: null, destWarehouseId: null,
warehouseList: [],
} }
}, },
computed: { computed: {
...@@ -1175,7 +1147,20 @@ export default { ...@@ -1175,7 +1147,20 @@ export default {
}, },
//订单 //订单
getorderList(){ getorderList(){
infoListOrderPage({customerDetailId:this.id,...this.queryParams}).then(r => { let queryParams = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryId = this.destCountryId;
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveId = this.objectiveId;
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseId = this.destWarehouseId;
}
infoListOrderPage({customerDetailId:this.id,...this.queryParams,...queryParams}).then(r => {
if(r.code === 0){ if(r.code === 0){
this.orderList = r.data.list this.orderList = r.data.list
this.orderTotal = r.data.total this.orderTotal = r.data.total
...@@ -1184,10 +1169,22 @@ export default { ...@@ -1184,10 +1169,22 @@ export default {
}, },
// 客户报价 // 客户报价
getInfoListOfferPage(){ getInfoListOfferPage(){
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id}).then(r => { let queryParams = {}
//目的国
if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryId = this.destCountryId;
}
//目的城市
if (this.objectiveId != null && this.objectiveId != "") {
queryParams.objectiveId = this.objectiveId;
}
//目的仓
if (this.destWarehouseId != null && this.destWarehouseId != "") {
queryParams.destWarehouseId = this.destWarehouseId;
}
infoListOfferPage({...this.infoListOfferFrom,customerId:this.id,...queryParams}).then(r => {
this.infoListOfferList = r.data.list; this.infoListOfferList = r.data.list;
this.infoListOfferTotal = r.data.total; this.infoListOfferTotal = r.data.total;
}).catch(r => {
}) })
}, },
// 数据 // 数据
...@@ -1238,68 +1235,47 @@ export default { ...@@ -1238,68 +1235,47 @@ export default {
}, },
findByprovinceCode() { findByprovinceCode() {
//获取当前省份值id,获取该省份下城市 destCountryId provinceCode //获取当前省份值id,获取该省份下城市 destCountryId provinceCode
getRegionList(2, this.destCountryId) if (this.destCountryId != null && this.destCountryId != "") {
.then(({ data }) => { getRegionList(2, this.destCountryId).then(({ data }) => {
this.AddressCity = data; this.AddressCity = data;
}) })
.catch((error) => { }
console.log(error);
});
}, },
findBycityCode() { findBycityCode() {
//获取当前城市值id,获取该城市下区域 //获取当前城市值id,获取该城市下区域
getRegionList(3, this.destCityId) if (this.objectiveId != null && this.objectiveId != "") {
.then(({ data }) => { getRegionList(3, this.objectiveId).then(({ data }) => {
this.AddressTown = data; this.AddressTown = data;
}) })
.catch((error) => { }
console.log(error);
});
}, },
getData() { getData() {
//加载时发起请求获取所有省份值 this.getAddressProvince()
/*getRegionList(1, 1) this.getAddressCity()
.then(({ data }) => { this.getAddressTown()
},
getAddressProvince() {
getRegionList(1, 1).then(({ data }) => {
this.AddressProvince = data; this.AddressProvince = data;
}) })
.catch((error) => { },
console.log(error); getAddressCity() {
});*/ getRegionList(4, 4).then(({ data }) => {
//目的城市
getRegionList(4, 4)
.then(({ data }) => {
this.AddressCity = data; this.AddressCity = data;
}) })
.catch((error) => { },
console.log(error); getAddressTown() {
}); getRegionList(5, 5).then(({ data }) => {
//目的仓
getRegionList(5, 5)
.then(({ data }) => {
this.AddressTown = data; this.AddressTown = data;
}) })
.catch((error) => {
console.log(error);
});
},
/* 国家 */
getCountryList() {
getListTree({ treeType: 1 }).then((response) => {
this.countryList = response.data;
});
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1;
//目的国
this.queryParams.destCountryId = this.destCountryId;
//目的城市
this.queryParams.objectiveId = this.destCityId;
//目的仓
this.queryParams.destWarehouseId = this.destWarehouseId;
if (this.activeName == 'order') { if (this.activeName == 'order') {
this.queryParams.page = 1
this.getorderList() this.getorderList()
} else if (this.activeName == 'quote') { } else if (this.activeName == 'quote') {
this.infoListOfferFrom.pageNo = 1
this.getInfoListOfferPage() this.getInfoListOfferPage()
} }
}, },
...@@ -1319,6 +1295,23 @@ export default { ...@@ -1319,6 +1295,23 @@ export default {
return warehouseName return warehouseName
}, },
}, },
cancel(id){
this.doAction(this.$t('确定要取消此报价单么?'), cancel, id);
},
recovery(id){
this.doAction(this.$t('确定要恢复此报价单么?'), recovery, id);
},
deleteOffer(id){
this.doAction(this.$t('确定要删除此报价单么?'), deleteOffer, id);
},
doAction(tips, action, id){
this.$confirm(tips).then(res => {
return action(id)
})
.then(() => {
this.$message.success('操作成功')
this.handleQuery()
})
}
} }
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form
:model="queryParams" v-show="showSearch"
ref="queryForm" ref="queryForm"
:model="queryParams"
size="small" size="small"
:inline="true" :inline="true"
v-show="showSearch"
label-width="68px" label-width="68px"
> >
<el-form-item :label="$t('礼品名称')"> <el-form-item :label="$t('礼品名称')">
...@@ -13,40 +13,38 @@ ...@@ -13,40 +13,38 @@
v-model.trim="queryParams.title" v-model.trim="queryParams.title"
:placeholder="$t('请输入礼品名称')" :placeholder="$t('请输入礼品名称')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换积分')"> <el-form-item :label="$t('兑换积分')">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="8">
<dict-selector <dict-selector
v-model="queryParams.pointsRequireSymbol"
clearable clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.pointsRequireSymbol"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<el-input <el-input
v-model.trim="queryParams.pointsRequire" v-model.trim="queryParams.pointsRequire"
:placeholder="$t('请输入数字')" :placeholder="$t('请输入数字')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item :label="$t('领取方式')" prop="level"> <el-form-item :label="$t('领取方式')" prop="level">
<dict-selector <dict-selector
v-model="queryParams.pickMethod"
clearable clearable
:type="DICT_TYPE.WAY_OF_RECEIVING" :type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.pickMethod"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换网点')" prop="level"> <el-form-item :label="$t('兑换网点')" prop="level">
...@@ -68,50 +66,48 @@ ...@@ -68,50 +66,48 @@
<el-form-item :label="$t('状态')" prop="level"> <el-form-item :label="$t('状态')" prop="level">
<dict-selector <dict-selector
v-model="queryParams.status"
clearable clearable
:type="DICT_TYPE.GIFT_STATUS" :type="DICT_TYPE.GIFT_STATUS"
v-model="queryParams.status"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('备注')" prop="level"> <el-form-item :label="$t('备注')" prop="level">
<el-input <el-input
v-model.trim="queryParams.remark" v-model.trim="queryParams.remark"
:placeholder="$t('请输入备注')" :placeholder="$t('请输入备注')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('剩余数量')"> <el-form-item :label="$t('剩余数量')">
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="8"> <el-col :span="8">
<dict-selector <dict-selector
v-model="queryParams.quantityRemainSymbol"
clearable clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.quantityRemainSymbol"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-col> </el-col>
<el-col :span="16"> <el-col :span="16">
<el-input <el-input
v-model.trim="queryParams.quantityRemain" v-model.trim="queryParams.quantityRemain"
:placeholder="$t('请输入数字')" :placeholder="$t('请输入数字')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<el-date-picker <el-date-picker
v-model="dateRangeCreateTime"
type="datetimerange" type="datetimerange"
clearable clearable
placement="bottom-start" placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-" range-separator="-"
...@@ -130,17 +126,13 @@ ...@@ -130,17 +126,13 @@
</el-form> </el-form>
<el-row class="mb8"> <el-row class="mb8">
<el-button <el-button
v-hasPermi="['ecw:giftManagement:add']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleAddReward" @click="handleAddReward"
v-hasPermi="['ecw:giftManagement:add']" >{{ $t("添加礼品") }}</el-button>
>{{ $t("添加礼品") }}</el-button <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row> </el-row>
<!-- 礼品列表 --> <!-- 礼品列表 -->
<el-table ref="multipleTable" v-loading="loading" :data="list"> <el-table ref="multipleTable" v-loading="loading" :data="list">
...@@ -149,7 +141,7 @@ ...@@ -149,7 +141,7 @@
:label="$t('礼品ID')" :label="$t('礼品ID')"
align="center" align="center"
prop="code" prop="code"
></el-table-column> />
<el-table-column :label="$t('礼品名称')" align="center"> <el-table-column :label="$t('礼品名称')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleView(scope.row)">{{ <el-button type="text" @click="handleView(scope.row)">{{
...@@ -162,31 +154,27 @@ ...@@ -162,31 +154,27 @@
<el-image <el-image
:src="firstImg(isChinese ? scope.row.imgZh : scope.row.imgEn)" :src="firstImg(isChinese ? scope.row.imgZh : scope.row.imgEn)"
style="width: 50px; height: 50px" style="width: 50px; height: 50px"
>{{ $t("") }}</el-image >{{ $t("") }}</el-image>
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" :label="$t('开始日期')"> <el-table-column width="100" :label="$t('开始日期')">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.startTime, "{y}-{m}-{d}") || "/" }} {{ parseTime(row.startTime, "{y}-{m}-{d}") || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="100" :label="$t('结束日期')"> <el-table-column width="100" :label="$t('结束日期')">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.endTime, "{y}-{m}-{d}") || "/" }} {{ parseTime(row.endTime, "{y}-{m}-{d}") || "/" }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column :label="$t('兑换积分')" prop="pointsRequire" />
:label="$t('兑换积分')"
prop="pointsRequire"
></el-table-column>
<el-table-column :label="$t('领取方式')" align="center" prop="pickMethod"> <el-table-column :label="$t('领取方式')" align="center" prop="pickMethod">
<template v-slot="{ row }"> <template #default="{ row }">
{{ handlePickMethod(row.pickMethod) }} {{ handlePickMethod(row.pickMethod) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('兑换网点')" align="center"> <el-table-column :label="$t('兑换网点')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeNodeId(row.nodeId).titleZh ? handleExchangeNodeId(row.nodeId).titleZh
...@@ -198,7 +186,7 @@ ...@@ -198,7 +186,7 @@
:label="$t('允许兑换次数')" :label="$t('允许兑换次数')"
align="center" align="center"
prop="allowCount" prop="allowCount"
></el-table-column> />
<el-table-column :label="$t('状态')"> <el-table-column :label="$t('状态')">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
{{ {{
...@@ -232,15 +220,14 @@ ...@@ -232,15 +220,14 @@
<el-button <el-button
type="text" type="text"
@click="$router.push('/memberManagement/exchangeRecord')" @click="$router.push('/memberManagement/exchangeRecord')"
>{{ scope.row.exchangeCount }}</el-button >{{ scope.row.exchangeCount }}</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="$t('剩余次数')" :label="$t('剩余次数')"
align="center" align="center"
prop="quantityRemain" prop="quantityRemain"
></el-table-column> />
<el-table-column <el-table-column
width="220px" width="220px"
align="center" align="center"
...@@ -249,74 +236,66 @@ ...@@ -249,74 +236,66 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-hasPermi="['ecw:giftManagement:check']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="handleView(scope.row)" @click="handleView(scope.row)"
v-hasPermi="['ecw:giftManagement:check']" >{{ $t("查看") }}</el-button>
>{{ $t("查看") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:giftManagement:close']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
:disabled="scope.row.status == '2' || scope.row.status == '3'"
@click="handleCloseStatus(scope.row)" @click="handleCloseStatus(scope.row)"
:disabled="scope.row.status == '2'" >{{ $t("关闭") }}</el-button>
v-hasPermi="['ecw:giftManagement:close']"
>{{ $t("关闭") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:giftManagement:copy']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="copyRewards(scope.row)" @click="copyRewards(scope.row)"
v-hasPermi="['ecw:giftManagement:copy']" >{{ $t("复制") }}</el-button>
>{{ $t("复制") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:giftManagement:postpone']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handlePostpone(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:giftManagement:postpone']" @click="handlePostpone(scope.row)"
>{{ $t("延期") }}</el-button >{{ $t("延期") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:giftManagement:delete']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleDelete(scope.row)"
:disabled="scope.row.status != '2'" :disabled="scope.row.status != '2'"
v-hasPermi="['ecw:giftManagement:delete']" @click="handleDelete(scope.row)"
>{{ $t("删除") }}</el-button >{{ $t("删除") }}</el-button>
>
<el-button <el-button
size="mini"
v-has-permi="['ecw:giftManagement:edit']" v-has-permi="['ecw:giftManagement:edit']"
size="mini"
type="text" type="text"
:disabled="scope.row.status != '2' && scope.row.status != '1'" :disabled="scope.row.status != '2' && scope.row.status != '1'"
icon="el-icon-collection" icon="el-icon-collection"
@click="editRewards(scope.row)" @click="editRewards(scope.row)"
>{{ $t("编辑") }}</el-button >{{ $t("编辑") }}</el-button>
>
<el-button <el-button
size="mini"
v-has-permi="['ecw:giftManagement:enable']" v-has-permi="['ecw:giftManagement:enable']"
size="mini"
type="text" type="text"
icon="el-icon-user" icon="el-icon-user"
@click="handleLaunchRewards(scope.row)" @click="handleLaunchRewards(scope.row)"
>{{ $t("启用") }}</el-button >{{ $t("启用") }}</el-button>
>
<el-button <el-button
:disabled="scope.row.isInOpenSea"
v-has-permi="['ecw:giftManagement:exchange']" v-has-permi="['ecw:giftManagement:exchange']"
:disabled="scope.row.isInOpenSea"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-user" icon="el-icon-user"
@click="handleExchange(scope.row)" @click="handleExchange(scope.row)"
>{{ $t("兑换") }}</el-button >{{ $t("兑换") }}</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -333,11 +312,10 @@ ...@@ -333,11 +312,10 @@
<operating-gift <operating-gift
ref="operatingGift" ref="operatingGift"
:title="operatingPagetitle" :title="operatingPagetitle"
:rewardsDetails="rewardsItem" :rewards-details="rewardsItem"
:show.sync="dialogVisible" :show.sync="dialogVisible"
:nodeList="nodeList" :node-list="nodeList"
> />
</operating-gift>
<el-dialog <el-dialog
:title="$t('提示')" :title="$t('提示')"
:visible.sync="dialogPostponeVisible" :visible.sync="dialogPostponeVisible"
...@@ -345,14 +323,14 @@ ...@@ -345,14 +323,14 @@
> >
<el-row class="mb8">{{ $t("请选择延期时间") }}</el-row> <el-row class="mb8">{{ $t("请选择延期时间") }}</el-row>
<el-date-picker <el-date-picker
v-model="postponeDatetime"
type="datetime" type="datetime"
clearable clearable
v-model="postponeDatetime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions" :picker-options="pickerOptions"
:placeholder="$t('请选择时间')" :placeholder="$t('请选择时间')"
></el-date-picker> />
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogPostponeVisible = false">{{ <el-button @click="dialogPostponeVisible = false">{{
$t("取 消") $t("取 消")
...@@ -371,20 +349,21 @@ import { ...@@ -371,20 +349,21 @@ import {
deleteRewards, deleteRewards,
copyRewardsAPI, copyRewardsAPI,
changeRewardsStatus, changeRewardsStatus,
delayRewards, delayRewards
} from "@/api/ecw/giftManagement"; } from '@/api/ecw/giftManagement'
import { getDictDatas, DICT_TYPE } from "@/utils/dict"; import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { parseTime } from "../../../utils/ruoyi"; import { parseTime } from '../../../utils/ruoyi'
import OperatingGift from "@/views/ecw/giftManagement/components/operatingGift.vue"; import OperatingGift from '@/views/ecw/giftManagement/components/operatingGift.vue'
import { uploadFile } from "@/api/infra/file"; import { uploadFile } from '@/api/infra/file'
import ImageUpload from "@/components/ImageUpload"; import ImageUpload from '@/components/ImageUpload'
export default { export default {
name: "giftManagementList", name: 'GiftManagementList',
components: { components: {
OperatingGift, OperatingGift
}, },
data() { data() {
return { return {
getDictDatas,
env: process.env.NODE_ENV, env: process.env.NODE_ENV,
// 遮罩层 // 遮罩层
loading: true, loading: true,
...@@ -397,13 +376,13 @@ export default { ...@@ -397,13 +376,13 @@ export default {
// 礼品列表 // 礼品列表
list: [], list: [],
// 弹出层标题 // 弹出层标题
operatingPagetitle: "", operatingPagetitle: '',
// 是否显示弹出层 // 是否显示弹出层
dialogVisible: false, dialogVisible: false,
rewardsItem: {}, rewardsItem: {},
dateRangeCreateTime: [], dateRangeCreateTime: [],
postponeDatetime: "", postponeDatetime: '',
postponeRewardsID: "", postponeRewardsID: '',
dialogPostponeVisible: false, dialogPostponeVisible: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
...@@ -419,197 +398,195 @@ export default { ...@@ -419,197 +398,195 @@ export default {
quantityRemainSymbol: null, quantityRemainSymbol: null,
quantityRemain: null, quantityRemain: null,
beginCreateTime: null, beginCreateTime: null,
endCreateTime: null, endCreateTime: null
}, },
// 网点 // 网点
nodeList: [], nodeList: [],
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7
}, }
}, }
}; }
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === 'zh_CN'
}, }
}, },
created() { created() {
this.getList(); this.getList()
this.getNodeList(); this.getNodeList()
}, },
activated() { activated() {
this.getList(); this.getList()
}, },
methods: { methods: {
arraysEqual(arr1, arr2) { arraysEqual(arr1, arr2) {
return arr1.filter((current) => { return arr1.filter((current) => {
return arr2.find((item) => item == current.value.toString()) return !!arr2.find((item) => item == current.value.toString())
? true })
: false;
});
}, },
handleRewardsStatus(status) { handleRewardsStatus(status) {
return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter( return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter(
(dicItem) => dicItem.value.toString() == status (dicItem) => dicItem.value.toString() == status
)[0]; )[0]
}, },
firstImg(imgString) { firstImg(imgString) {
if (!imgString || imgString == "") return imgString; if (!imgString || imgString == '') return imgString
let imgs = imgString.split(","); const imgs = imgString.split(',')
return imgs.length ? imgs[0] : null; return imgs.length ? imgs[0] : null
}, },
handlePickMethod(pickMethod) { handlePickMethod(pickMethod) {
let pickMethodLabel = []; const pickMethodLabel = []
if (this.isChinese) { if (this.isChinese) {
this.arraysEqual( this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING), this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(",") pickMethod.split(',')
).forEach((element) => { ).forEach((element) => {
pickMethodLabel.push(element.label); pickMethodLabel.push(element.label)
}); })
} else { } else {
this.arraysEqual( this.arraysEqual(
this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING), this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING),
pickMethod.split(",") pickMethod.split(',')
).forEach((element) => { ).forEach((element) => {
pickMethodLabel.push(element.labelEn); pickMethodLabel.push(element.labelEn)
}); })
} }
return pickMethodLabel.join(); return pickMethodLabel.join()
}, },
handleExchangeNodeId(nodeId) { handleExchangeNodeId(nodeId) {
return this.nodeList.filter((nodeItem) => nodeItem.id == nodeId)[0]; return this.nodeList.filter((nodeItem) => nodeItem.id == nodeId)[0]
}, },
handleAddReward() { handleAddReward() {
this.rewardsItem = {}; this.rewardsItem = {}
this.dialogVisible = true; this.dialogVisible = true
this.operatingPagetitle = "3"; this.operatingPagetitle = '3'
}, },
handleExchange(row) { handleExchange(row) {
this.$router.push({ this.$router.push({
path: "/giftManagement/bulkExchange", path: '/giftManagement/bulkExchange',
query: { rewardsID: row.id }, query: { rewardsID: row.id }
}); })
}, },
/** 延期按钮操作 */ /** 延期按钮操作 */
handlePostpone(row) { handlePostpone(row) {
this.postponeRewardsID = row.id; this.postponeRewardsID = row.id
this.dialogPostponeVisible = true; this.dialogPostponeVisible = true
}, },
confirmPostponeRewards() { confirmPostponeRewards() {
this.dialogPostponeVisible = false; this.dialogPostponeVisible = false
delayRewards({ delayRewards({
id: this.postponeRewardsID, id: this.postponeRewardsID,
endTime: this.postponeDatetime, endTime: this.postponeDatetime
}).then((res) => { }).then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("延期成功")); this.$message.success(this.$t('延期成功'))
}); })
}, },
/** 关闭按钮操作 */ /** 关闭按钮操作 */
handleCloseStatus(row) { handleCloseStatus(row) {
this.$confirm(this.$t("是否关闭当前礼品?"), this.$t("提示"), { this.$confirm(this.$t('是否关闭当前礼品?'), this.$t('提示'), {
confirmButtonText: this.$t("确定"), confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t("取消"), cancelButtonText: this.$t('取消'),
type: "warning", type: 'warning'
}) })
.then((_) => { .then((_) => {
return changeRewardsStatus({ id: row.id, status: "3" }); return changeRewardsStatus({ id: row.id, status: '3' })
}) })
.then((res) => { .then((res) => {
this.getList(); this.getList()
this.$message.success(this.$t("关闭成功")); this.$message.success(this.$t('关闭成功'))
}) })
.catch((_) => { .catch((_) => {
// this.queryAllData(); // this.queryAllData();
}); })
}, },
//启用礼品状态 // 启用礼品状态
handleLaunchRewards(row) { handleLaunchRewards(row) {
this.$confirm(this.$t("是否启用当前礼品?"), this.$t("提示"), { this.$confirm(this.$t('是否启用当前礼品?'), this.$t('提示'), {
confirmButtonText: this.$t("确定"), confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t("取消"), cancelButtonText: this.$t('取消'),
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
changeRewardsStatus({ id: row.id, status: "1" }).then((r) => { changeRewardsStatus({ id: row.id, status: '1' }).then((r) => {
this.$message.success(this.$t("启用成功")); this.$message.success(this.$t('启用成功'))
this.getList(); this.getList()
}); })
}) })
.catch(() => {}); .catch(() => {})
}, },
getNodeList() { getNodeList() {
getNodeList().then((res) => { getNodeList().then((res) => {
this.nodeList = res.data; this.nodeList = res.data
}); })
}, },
getList() { getList() {
this.loading = true; this.loading = true
// 处理查询参数 // 处理查询参数
let params = { ...this.queryParams }; const params = { ...this.queryParams }
this.addBeginAndEndTime( this.addBeginAndEndTime(
params, params,
this.dateRangeCreateTime, this.dateRangeCreateTime,
"createTime", 'createTime',
false false
); )
getGiftList(params).then((res) => { getGiftList(params).then((res) => {
this.loading = false; this.loading = false
this.list = res.data.list; this.list = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
// 新增潜在客户 // 新增潜在客户
handleAddPotential() { handleAddPotential() {
this.$refs.potentialCustom.dialogTableVisible = true; this.$refs.potentialCustom.dialogTableVisible = true
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
this.$modal this.$modal
.confirm(this.$t("是否确认删除此礼品")) .confirm(this.$t('是否确认删除此礼品'))
.then(function () { .then(function() {
return deleteRewards({ id: row.id }); return deleteRewards({ id: row.id })
}) })
.then(() => { .then(() => {
this.getList(); this.getList()
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t('删除成功'))
}) })
.catch(() => {}); .catch(() => {})
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.$nextTick(() => { this.$nextTick(() => {
this.queryParams.page = 1; this.queryParams.page = 1
this.getList(); this.getList()
}); })
}, },
/** 查看按钮操作 */ /** 查看按钮操作 */
handleView(row) { handleView(row) {
this.dialogVisible = true; this.dialogVisible = true
this.operatingPagetitle = "1"; this.operatingPagetitle = '1'
this.rewardsItem = row; this.rewardsItem = row
}, },
/** 编辑按钮操作 */ /** 编辑按钮操作 */
editRewards(row) { editRewards(row) {
this.dialogVisible = true; this.dialogVisible = true
this.operatingPagetitle = "2"; this.operatingPagetitle = '2'
this.rewardsItem = row; this.rewardsItem = row
}, },
/** 复制按钮操作 */ /** 复制按钮操作 */
copyRewards(row) { copyRewards(row) {
copyRewardsAPI(row.id).then((res) => { copyRewardsAPI(row.id).then((res) => {
this.$modal.msgSuccess(this.$t("复制成功")); this.$modal.msgSuccess(this.$t('复制成功'))
this.handleQuery(); this.handleQuery()
}); })
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.queryParams = { this.queryParams = {
page: 1, page: 1,
rows: 10, rows: 10,
...@@ -625,12 +602,12 @@ export default { ...@@ -625,12 +602,12 @@ export default {
memberCode: null, memberCode: null,
memberName: null, memberName: null,
memberMobile: null, memberMobile: null,
memberAreaCode: null, memberAreaCode: null
}; }
this.handleQuery(); this.handleQuery()
}, }
}, }
}; }
</script> </script>
<style> <style>
.rewardstToolTip { .rewardstToolTip {
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form
:model="queryParams" v-show="showSearch"
ref="queryForm" ref="queryForm"
:model="queryParams"
size="small" size="small"
v-show="showSearch"
:inline="true" :inline="true"
label-width="120px" label-width="120px"
> >
<el-form-item :label="$t('礼品名称')"> <el-form-item :label="$t('礼品名称')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.rewardTitle" v-model.trim="queryParams.rewardTitle"
style="width: 300px"
:placeholder="$t('请输入礼品名称')" :placeholder="$t('请输入礼品名称')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('会员昵称')"> <el-form-item :label="$t('会员昵称')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.memberName" v-model.trim="queryParams.memberName"
style="width: 300px"
:placeholder="$t('请输入会员昵称')" :placeholder="$t('请输入会员昵称')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换方式')"> <el-form-item :label="$t('兑换方式')">
<dict-selector <dict-selector
v-model="queryParams.redeemType"
clearable clearable
:type="DICT_TYPE.WAY_OF_RECEIVING" :type="DICT_TYPE.WAY_OF_RECEIVING"
v-model="queryParams.redeemType" />
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('状态')"> <el-form-item :label="$t('状态')">
<dict-selector <dict-selector
v-model="queryParams.status"
clearable clearable
:type="DICT_TYPE.REWARD_REDEEM_STATUS" :type="DICT_TYPE.REWARD_REDEEM_STATUS"
v-model="queryParams.status" />
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('数量')"> <el-form-item :label="$t('数量')">
<el-row :gutter="10" style="width: 300px"> <el-row :gutter="10" style="width: 300px">
<el-col :span="10"> <el-col :span="10">
<dict-selector <dict-selector
v-model="queryParams.rewardCountOperate"
clearable clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.rewardCountOperate"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-input <el-input
v-model.trim="queryParams.rewardCount" v-model.trim="queryParams.rewardCount"
:placeholder="$t('请输入数字')" :placeholder="$t('请输入数字')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换时间')"> <el-form-item :label="$t('兑换时间')">
<el-date-picker <el-date-picker
v-model="dateRangeCreateTime"
type="datetimerange" type="datetimerange"
clearable clearable
placement="bottom-start" placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-" range-separator="-"
...@@ -81,22 +78,21 @@ ...@@ -81,22 +78,21 @@
</el-form-item> </el-form-item>
<el-form-item :label="$t('礼品ID')"> <el-form-item :label="$t('礼品ID')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.rewardCode" v-model.trim="queryParams.rewardCode"
style="width: 300px"
:placeholder="$t('请输入礼品ID')" :placeholder="$t('请输入礼品ID')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换入口')"> <el-form-item :label="$t('兑换入口')">
<dict-selector <dict-selector
v-model="queryParams.entrance"
clearable clearable
:type="DICT_TYPE.PLATFORM_TYPE" :type="DICT_TYPE.PLATFORM_TYPE"
v-model="queryParams.entrance"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('兑换网点')"> <el-form-item :label="$t('兑换网点')">
...@@ -126,89 +122,83 @@ ...@@ -126,89 +122,83 @@
</el-form> </el-form>
<el-row class="mb8"> <el-row class="mb8">
<el-button <el-button
v-hasPermi="['ecw:memberManagement:newExchange']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
v-hasPermi="['ecw:memberManagement:newExchange']"
@click="handleNewExchange" @click="handleNewExchange"
>{{ $t("新增兑换") }}</el-button >{{ $t("新增兑换") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:batchWriteOff']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
v-hasPermi="['ecw:memberManagement:batchWriteOff']"
@click="handleBatchVerify" @click="handleBatchVerify"
>{{ $t("批量核销") }}</el-button >{{ $t("批量核销") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:export']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleBatchExport" @click="handleBatchExport"
v-hasPermi="['ecw:memberManagement:export']" >{{ $t("导出") }}</el-button>
>{{ $t("导出") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:exchangeoInfoImport']"
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleShowFileUploadDialog" @click="handleShowFileUploadDialog"
v-hasPermi="['ecw:memberManagement:exchangeoInfoImport']" >{{ $t("兑换信息导入") }}</el-button>
>{{ $t("兑换信息导入") }}</el-button
>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :show-search.sync="showSearch"
@queryTable="handleQueryPagination" @queryTable="handleQueryPagination"
></right-toolbar> />
</el-row> </el-row>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
v-loading="loading" v-loading="loading"
@selection-change="handleSelectionChange"
:data="memberList" :data="memberList"
@selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"> </el-table-column> <el-table-column type="selection" width="55" />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('兑换记录ID')" :label="$t('兑换记录ID')"
align="center" align="center"
prop="id" prop="id"
></el-table-column> />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('礼品ID')" :label="$t('礼品ID')"
align="center" align="center"
prop="rewardCode" prop="rewardCode"
></el-table-column> />
<el-table-column <el-table-column
:label="$t('礼品名称')" :label="$t('礼品名称')"
align="center" align="center"
:prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'" :prop="isChinese ? 'rewardTitleZh' : 'rewardTitleEn'"
></el-table-column> />
<el-table-column :label="$t('会员名称')" align="center"> <el-table-column :label="$t('会员名称')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
<el-button <el-button
type="text" type="text"
@click=" @click="
$router.push('/member/member/member-details/' + row.memberId) $router.push('/member/member/member-details/' + row.memberId)
" "
>{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button >{{ isChinese ? row.memberNameZh : row.memberNameEn }}</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('兑换时间')" align="center"> <el-table-column :label="$t('兑换时间')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.redemptionTime) || "/" }}</template {{ parseTime(row.redemptionTime) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="$t('兑换积分')" :label="$t('兑换积分')"
align="center" align="center"
prop="totalCount" prop="totalCount"
></el-table-column> />
<el-table-column width="140" :label="$t('兑换入口')" align="center"> <el-table-column width="140" :label="$t('兑换入口')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeEntrance(row.entrance).label ? handleExchangeEntrance(row.entrance).label
...@@ -221,10 +211,9 @@ ...@@ -221,10 +211,9 @@
:label="$t('兑换网点')" :label="$t('兑换网点')"
align="center" align="center"
:prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'" :prop="isChinese ? 'nodeTitleZh' : 'nodeTitleEn'"
> />
</el-table-column>
<el-table-column width="140" :label="$t('领取方式')" align="center"> <el-table-column width="140" :label="$t('领取方式')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeRedeemType(row.redeemType).label ? handleExchangeRedeemType(row.redeemType).label
...@@ -233,7 +222,7 @@ ...@@ -233,7 +222,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column width="140" :label="$t('状态')" align="center"> <el-table-column width="140" :label="$t('状态')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ {{
isChinese isChinese
? handleExchangeStatus(row.status).label ? handleExchangeStatus(row.status).label
...@@ -246,26 +235,25 @@ ...@@ -246,26 +235,25 @@
:label="$t('备注')" :label="$t('备注')"
align="center" align="center"
prop="remark" prop="remark"
></el-table-column />
>
<el-table-column <el-table-column
width="140" width="140"
:label="$t('数量')" :label="$t('数量')"
align="center" align="center"
prop="rewardCount" prop="rewardCount"
></el-table-column> />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('创建人')" :label="$t('创建人')"
align="center" align="center"
prop="creatorName" prop="creatorName"
></el-table-column> />
<el-table-column <el-table-column
width="140" width="140"
:label="$t('更新人')" :label="$t('更新人')"
align="center" align="center"
prop="updaterName" prop="updaterName"
></el-table-column> />
<el-table-column <el-table-column
width="220px" width="220px"
align="center" align="center"
...@@ -274,49 +262,44 @@ ...@@ -274,49 +262,44 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-hasPermi="['ecw:memberManagement:cancel']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-view" icon="el-icon-view"
@click="handleRewardCancel(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:cancel']" @click="handleRewardCancel(scope.row)"
>{{ $t("撤销") }}</el-button >{{ $t("撤销") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:edit']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleRewardEdit(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:edit']" @click="handleRewardEdit(scope.row)"
>{{ $t("编辑") }}</el-button >{{ $t("编辑") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:view']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleViewRecord(scope.row)" @click="handleViewRecord(scope.row)"
v-hasPermi="['ecw:memberManagement:view']" >{{ $t("查看") }}</el-button>
>{{ $t("查看") }}</el-button
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:verification']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleVerify(scope.row)"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
v-hasPermi="['ecw:memberManagement:verification']" @click="handleVerify(scope.row)"
>{{ $t("核销") }}</el-button >{{ $t("核销") }}</el-button>
>
<el-button <el-button
v-hasPermi="['ecw:memberManagement:verificationRollback']"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete" icon="el-icon-delete"
@click="handleVerificationRollback(scope.row)"
:disabled="scope.row.status != '2'" :disabled="scope.row.status != '2'"
v-hasPermi="['ecw:memberManagement:verificationRollback']" @click="handleVerificationRollback(scope.row)"
>{{ $t("核销回退") }}</el-button >{{ $t("核销回退") }}</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -349,11 +332,11 @@ ...@@ -349,11 +332,11 @@
:auto-upload="false" :auto-upload="false"
drag drag
> >
<i class="el-icon-upload"></i> <i class="el-icon-upload" />
<div class="el-upload__text"> <div class="el-upload__text">
{{ $t("将文件拖到此处,或") }}<em>{{ $t("点击上传") }}</em> {{ $t("将文件拖到此处,或") }}<em>{{ $t("点击上传") }}</em>
</div> </div>
<div class="el-upload__tip text-center" slot="tip"> <div slot="tip" class="el-upload__tip text-center">
<span>仅允许导入xls、xlsx格式文件。</span> <span>仅允许导入xls、xlsx格式文件。</span>
<el-link <el-link
type="primary" type="primary"
...@@ -380,8 +363,8 @@ ...@@ -380,8 +363,8 @@
:before-close="handleClose" :before-close="handleClose"
> >
<el-form <el-form
:model="batchVerifyForm"
ref="numberValidateForm" ref="numberValidateForm"
:model="batchVerifyForm"
label-width="100px" label-width="100px"
class="demo-ruleForm" class="demo-ruleForm"
> >
...@@ -393,19 +376,19 @@ ...@@ -393,19 +376,19 @@
<el-input <el-input
v-model.number="batchVerifyForm.verifyUser" v-model.number="batchVerifyForm.verifyUser"
autocomplete="off" autocomplete="off"
></el-input> />
</el-form-item> </el-form-item>
<el-form-item <el-form-item
:label="$t('核销时间')" :label="$t('核销时间')"
:rules="[{ required: true, message: $t('核销时间不能为空') }]" :rules="[{ required: true, message: $t('核销时间不能为空') }]"
> >
<el-date-picker <el-date-picker
v-model="batchVerifyForm.verifyTime"
type="date" type="date"
placement="bottom-start" placement="bottom-start"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:placeholder="$t('选择核销时间')" :placeholder="$t('选择核销时间')"
v-model="batchVerifyForm.verifyTime" />
></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -434,8 +417,7 @@ ...@@ -434,8 +417,7 @@
:key="item.id" :key="item.id"
:label="isChinese ? item.memberNameZh : item.memberNameEn" :label="isChinese ? item.memberNameZh : item.memberNameEn"
:value="item.id" :value="item.id"
> />
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item :label="$t('操作')"> <el-form-item :label="$t('操作')">
...@@ -444,8 +426,7 @@ ...@@ -444,8 +426,7 @@
v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)" v-for="dict in getDictDatas(DICT_TYPE.MEMBER_SCORE_OPERATE_TYPE)"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
>{{ $l(dict, "label") }}</el-radio >{{ $l(dict, "label") }}</el-radio>
>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item :label="$t('积分')"> <el-form-item :label="$t('积分')">
...@@ -456,7 +437,7 @@ ...@@ -456,7 +437,7 @@
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('备注')"> <el-form-item :label="$t('备注')">
<el-input type="textarea" v-model="formQuery.comment"></el-input> <el-input v-model="formQuery.comment" type="textarea" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
...@@ -469,8 +450,8 @@ ...@@ -469,8 +450,8 @@
</div> </div>
</template> </template>
<script> <script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict"; import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { getNodeList } from "@/api/ecw/giftManagement"; import { getNodeList } from '@/api/ecw/giftManagement'
import { import {
queryMemberExchangeRecord, queryMemberExchangeRecord,
batchVerifyAPI, batchVerifyAPI,
...@@ -478,19 +459,19 @@ import { ...@@ -478,19 +459,19 @@ import {
batchRecordImport, batchRecordImport,
batchRecordImportTemplate, batchRecordImportTemplate,
rewardCancelQuery, rewardCancelQuery,
verifyRollback, verifyRollback
} from "@/api/ecw/memberManagement"; } from '@/api/ecw/memberManagement'
import { getNowDateTime, parseTime } from "@/utils/ruoyi"; import { getNowDateTime, parseTime } from '@/utils/ruoyi'
import { getBaseHeader } from "@/utils/request"; import { getBaseHeader } from '@/utils/request'
export default { export default {
name: "exchangeRecord", name: 'ExchangeRecord',
data() { data() {
return { return {
upload: { upload: {
// 是否显示弹出层(用户导入) // 是否显示弹出层(用户导入)
open: false, open: false,
// 弹出层标题(用户导入) // 弹出层标题(用户导入)
title: this.$t("兑换信息导入"), title: this.$t('兑换信息导入'),
// 是否禁用上传 // 是否禁用上传
isUploading: false, isUploading: false,
// 设置上传的请求头部 // 设置上传的请求头部
...@@ -498,14 +479,14 @@ export default { ...@@ -498,14 +479,14 @@ export default {
// 上传的地址 // 上传的地址
url: url:
process.env.VUE_APP_BASE_API + process.env.VUE_APP_BASE_API +
"/admin-api/reward/redeem/record/import", '/admin-api/reward/redeem/record/import'
}, },
//批量核销 // 批量核销
dialogBatchVerify: false, dialogBatchVerify: false,
batchVerifyForm: { batchVerifyForm: {
ids: [], ids: [],
verifyTime: "", verifyTime: '',
verifyUser: "", verifyUser: ''
}, },
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
...@@ -517,278 +498,278 @@ export default { ...@@ -517,278 +498,278 @@ export default {
dialogVisible: false, dialogVisible: false,
memberList: [], memberList: [],
formQuery: { formQuery: {
comment: "", comment: '',
memberIds: [], memberIds: [],
operateType: null, operateType: null,
scoreCount: null, scoreCount: null
}, },
queryParams: { queryParams: {
rewardTitle: "", rewardTitle: '',
memberName: "", //会员昵称 memberName: '', // 会员昵称
redeemType: "", //兑换方式 redeemType: '', // 兑换方式
status: "", status: '',
rewardCount: "", rewardCount: '',
rewardCountOperate: "", rewardCountOperate: '',
rewardCode: "", rewardCode: '',
entrance: "", //兑换入口 entrance: '', // 兑换入口
startTime: "", startTime: '',
endTime: "", endTime: '',
nodeId: "", nodeId: '',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10
}, },
// 网点 // 网点
nodeList: [], nodeList: []
}; }
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === 'zh_CN'
}, }
}, },
created() { created() {
this.getNodeListAPI(); this.getNodeListAPI()
this.handleQuery(); this.handleQuery()
}, },
activated() { activated() {
this.handleQuery(); this.handleQuery()
}, },
methods: { methods: {
//核销回退 // 核销回退
handleVerificationRollback(row) { handleVerificationRollback(row) {
this.$confirm(this.$t("是否继续核销回退?"), this.$t("提示"), { this.$confirm(this.$t('是否继续核销回退?'), this.$t('提示'), {
confirmButtonText: this.$t("确定"), confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t("取消"), cancelButtonText: this.$t('取消'),
type: "warning", type: 'warning'
}) })
.then(() => { .then(() => {
let params = { const params = {
redeemIds: [row.id], redeemIds: [row.id]
}; }
verifyRollback(params).then((res) => { verifyRollback(params).then((res) => {
this.$message({ this.$message({
type: "success", type: 'success',
message: this.$t("回退成功!"), message: this.$t('回退成功!')
}); })
this.handleQuery(); this.handleQuery()
}); })
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: 'info',
message: this.$t("已取消回退"), message: this.$t('已取消回退')
}); })
}); })
}, },
//核销 // 核销
handleVerify(row) { handleVerify(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: "verify" }, query: { exchangeRewardID: row.id, pageStatus: 'verify' }
}); })
}, },
//查看按钮操作 // 查看按钮操作
handleViewRecord(row) { handleViewRecord(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: "view" }, query: { exchangeRewardID: row.id, pageStatus: 'view' }
}); })
}, },
//兑换记录编辑操作 // 兑换记录编辑操作
handleRewardEdit(row) { handleRewardEdit(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation',
query: { exchangeRewardID: row.id, pageStatus: "edit" }, query: { exchangeRewardID: row.id, pageStatus: 'edit' }
}); })
}, },
//撤销按钮操作 // 撤销按钮操作
handleRewardCancel(row) { handleRewardCancel(row) {
this.$confirm( this.$confirm(
this.$t("此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?"), this.$t('此操作积分可能存在到期积分, 撤销后积分将进行扣除,是否继续?'),
this.$t("提示"), this.$t('提示'),
{ {
confirmButtonText: this.$t("确定"), confirmButtonText: this.$t('确定'),
cancelButtonText: this.$t("取消"), cancelButtonText: this.$t('取消'),
type: "warning", type: 'warning'
} }
) )
.then(() => { .then(() => {
let params = { const params = {
id: row.id, id: row.id
}; }
rewardCancelQuery(params).then((res) => { rewardCancelQuery(params).then((res) => {
this.$message({ this.$message({
type: "success", type: 'success',
message: this.$t("撤销成功!"), message: this.$t('撤销成功!')
}); })
this.handleQuery(); this.handleQuery()
}); })
}) })
.catch(() => { .catch(() => {
this.$message({ this.$message({
type: "info", type: 'info',
message: this.$t("已取消撤销"), message: this.$t('已取消撤销')
}); })
}); })
}, },
//下载导入模板 // 下载导入模板
importTemplate() { importTemplate() {
batchRecordImportTemplate().then((res) => { batchRecordImportTemplate().then((res) => {
this.$download.excel(res, "用户导入模板.xls"); this.$download.excel(res, '用户导入模板.xls')
this.$message({ this.$message({
message: this.$t("下载模板成功"), message: this.$t('下载模板成功'),
type: "success", type: 'success'
}); })
}); })
}, },
//导入 // 导入
handleShowFileUploadDialog() { handleShowFileUploadDialog() {
this.upload.open = true; this.upload.open = true
}, },
handleFileUploadProgress(event, file, fileList) { handleFileUploadProgress(event, file, fileList) {
this.upload.isUploading = true; this.upload.isUploading = true
}, },
// 文件上传成功处理 // 文件上传成功处理
handleFileSuccess(response, file, fileList) { handleFileSuccess(response, file, fileList) {
if (response.code == "1001011027") { if (response.code == '1001011027') {
this.$message.error(response.msg); this.$message.error(response.msg)
} }
if ( if (
!response.data.redeemIdFailedMap || !response.data.redeemIdFailedMap ||
JSON.stringify(response.data.redeemIdFailedMap) == "{}" JSON.stringify(response.data.redeemIdFailedMap) == '{}'
) { ) {
this.upload.open = false; this.upload.open = false
this.$modal.msgSuccess(this.$t("导入成功")); this.$modal.msgSuccess(this.$t('导入成功'))
this.handleQuery(); this.$refs.upload.clearFiles()
return; this.upload.isUploading = false
this.handleQuery()
return
} }
this.upload.open = false; this.upload.open = false
this.upload.isUploading = false; this.upload.isUploading = false
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles()
// 拼接提示语 // 拼接提示语
let data = response.data; const data = response.data
let text = `${this.$t("导入失败:")}`; let text = `${this.$t('导入失败:')}`
for (const username in data.redeemIdFailedMap) { for (const username in data.redeemIdFailedMap) {
text += text +=
"<br />&nbsp;&nbsp;&nbsp;&nbsp;" + '<br />&nbsp;&nbsp;&nbsp;&nbsp;' +
username + username +
this.$t("") + this.$t('') +
data.redeemIdFailedMap[username]; data.redeemIdFailedMap[username]
} }
text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t("以上数据格式有问题")}`; text += `<br />&nbsp;&nbsp;&nbsp;&nbsp;${this.$t('以上数据格式有问题')}`
this.$alert(text, this.$t("导入结果"), { this.$alert(text, this.$t('导入结果'), {
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true
}); })
}, },
// 提交上传文件 // 提交上传文件
submitFileForm() { submitFileForm() {
this.$refs.upload.submit(); this.$refs.upload.submit()
}, },
//导出 // 导出
handleBatchExport() { handleBatchExport() {
let params = { ...this.queryParams }; const params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
params.pageNo = null;
params.pageSize = null;
} }
batchRecordExport(params).then((res) => { batchRecordExport(params).then((res) => {
this.$message({ this.$message({
message: this.$t("已加入导出队列,请稍后在下载日志中下载"), message: this.$t('已加入导出队列,请稍后在下载日志中下载'),
type: "success", type: 'success'
}); })
}); })
}, },
//批量核销确认按钮 // 批量核销确认按钮
handleBatchVerifySubmit() { handleBatchVerifySubmit() {
this.$confirm(this.$t("确认提交?")) this.$confirm(this.$t('确认提交?'))
.then((_) => { .then((_) => {
let params = { ...this.batchVerifyForm }; const params = { ...this.batchVerifyForm }
batchVerifyAPI(params).then((res) => { batchVerifyAPI(params).then((res) => {
this.dialogBatchVerify = false; this.dialogBatchVerify = false
this.$message({ this.$message({
message: this.$t("核销成功"), message: this.$t('核销成功'),
type: "success", type: 'success'
});
});
}) })
.catch((_) => {}); })
})
.catch((_) => {})
}, },
// 批量核销 // 批量核销
handleBatchVerify() { handleBatchVerify() {
if (this.batchVerifyForm.ids.length > 0) { if (this.batchVerifyForm.ids.length > 0) {
this.dialogBatchVerify = true; this.dialogBatchVerify = true
this.batchVerifyForm.verifyUser = this.$store.getters.name; this.batchVerifyForm.verifyUser = this.$store.getters.name
this.batchVerifyForm.verifyTime = getNowDateTime(); this.batchVerifyForm.verifyTime = getNowDateTime()
} else { } else {
this.$message({ this.$message({
message: this.$t("请先选择兑换记录"), message: this.$t('请先选择兑换记录'),
type: "warning", type: 'warning'
}); })
} }
}, },
// 新增兑换 // 新增兑换
handleNewExchange() { handleNewExchange() {
this.$router.push({ this.$router.push({
path: "/memberManagement/exchangeRecordOperation", path: '/memberManagement/exchangeRecordOperation'
}); })
}, },
getNodeListAPI() { getNodeListAPI() {
getNodeList().then((res) => { getNodeList().then((res) => {
this.nodeList = res.data; this.nodeList = res.data
}); })
}, },
handleExchangeRedeemType(id) { handleExchangeRedeemType(id) {
return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter( return this.getDictDatas(DICT_TYPE.WAY_OF_RECEIVING).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
//兑换入口 // 兑换入口
handleExchangeEntrance(id) { handleExchangeEntrance(id) {
return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter( return this.getDictDatas(DICT_TYPE.PLATFORM_TYPE).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
//兑换状态 // 兑换状态
handleExchangeStatus(id) { handleExchangeStatus(id) {
return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter( return this.getDictDatas(DICT_TYPE.REWARD_REDEEM_STATUS).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
handleScoreSubmit() { handleScoreSubmit() {
this.$confirm(this.$t("确认提交?")) this.$confirm(this.$t('确认提交?'))
.then((_) => { .then((_) => {
let params = { ...this.formQuery }; const params = { ...this.formQuery }
operateMemberScore(params).then((res) => { operateMemberScore(params).then((res) => {
this.dialogVisible = true; this.dialogVisible = true
this.formQuery = { this.formQuery = {
comment: "", comment: '',
memberIds: [], memberIds: [],
operateType: null, operateType: null,
scoreCount: null, scoreCount: null
}; }
this.selectedMember = []; this.selectedMember = []
this.$message.success(this.$t("操作成功")); this.$message.success(this.$t('操作成功'))
});
}) })
.catch((_) => {}); })
.catch((_) => {})
}, },
handleClose(done) { handleClose(done) {
this.$confirm(this.$t("确认关闭?")) this.$confirm(this.$t('确认关闭?'))
.then((_) => { .then((_) => {
done(); done()
}) })
.catch((_) => {}); .catch((_) => {})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.selectedMember = val; this.selectedMember = val
this.batchVerifyForm.ids = val.map((item) => { this.batchVerifyForm.ids = val.map((item) => {
return item.id; return item.id
}); })
}, },
dialogBeforeClose() { dialogBeforeClose() {
this.loading = true; this.loading = true
this.queryParams = { this.queryParams = {
country: null, country: null,
city: null, city: null,
...@@ -800,37 +781,37 @@ export default { ...@@ -800,37 +781,37 @@ export default {
pageSize: 10, pageSize: 10,
startTime: null, startTime: null,
usedScore: null, usedScore: null,
usedScoreOperate: null, usedScoreOperate: null
}; }
}, },
handleQuery() { handleQuery() {
this.queryParams.pageNo = 1; this.queryParams.pageNo = 1
let params = { ...this.queryParams }; const params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
} }
queryMemberExchangeRecord(params).then((res) => { queryMemberExchangeRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberList = res.data.list; this.memberList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
handleQueryPagination() { handleQueryPagination() {
let params = { ...this.queryParams }; const params = { ...this.queryParams }
if (this.dateRangeCreateTime) { if (this.dateRangeCreateTime) {
params.startTime = this.dateRangeCreateTime[0]; params.startTime = this.dateRangeCreateTime[0]
params.endTime = this.dateRangeCreateTime[1]; params.endTime = this.dateRangeCreateTime[1]
} }
queryMemberExchangeRecord(params).then((res) => { queryMemberExchangeRecord(params).then((res) => {
this.loading = false; this.loading = false
this.memberList = res.data.list; this.memberList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
resetQuery() { resetQuery() {
this.loading = true; this.loading = true
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.queryParams = { this.queryParams = {
country: null, country: null,
city: null, city: null,
...@@ -842,10 +823,10 @@ export default { ...@@ -842,10 +823,10 @@ export default {
pageSize: 10, pageSize: 10,
startTime: null, startTime: null,
usedScore: null, usedScore: null,
usedScoreOperate: null, usedScoreOperate: null
}; }
this.handleQuery(); this.handleQuery()
}, }
}, }
}; }
</script> </script>
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form
:model="queryParams" v-show="showSearch"
ref="queryForm" ref="queryForm"
:model="queryParams"
size="small" size="small"
:inline="true" :inline="true"
v-show="showSearch"
label-width="68px" label-width="68px"
> >
<el-form-item :label="$t('指标类型')"> <el-form-item :label="$t('指标类型')">
<dict-selector <dict-selector
v-model="queryParams.type"
clearable clearable
:type="DICT_TYPE.SCORE_RULE_TYPE" :type="DICT_TYPE.SCORE_RULE_TYPE"
v-model="queryParams.type"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('标题:')"> <el-form-item :label="$t('标题:')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.title" v-model.trim="queryParams.title"
style="width: 300px"
:placeholder="$t('请输入查找')" :placeholder="$t('请输入查找')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('规则说明')"> <el-form-item :label="$t('规则说明')">
<el-input <el-input
style="width: 300px"
v-model.trim="queryParams.desc" v-model.trim="queryParams.desc"
style="width: 300px"
:placeholder="$t('请输入关键词查找')" :placeholder="$t('请输入关键词查找')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('状态')"> <el-form-item :label="$t('状态')">
<dict-selector <dict-selector
v-model="queryParams.status"
clearable clearable
:type="DICT_TYPE.GIFT_STATUS" :type="DICT_TYPE.GIFT_STATUS"
v-model="queryParams.status" />
>
</dict-selector>
</el-form-item> </el-form-item>
<el-form-item :label="$t('单次积分')"> <el-form-item :label="$t('单次积分')">
<el-row :gutter="10" style="width: 300px"> <el-row :gutter="10" style="width: 300px">
<el-col :span="10"> <el-col :span="10">
<dict-selector <dict-selector
v-model="queryParams.getScoreOnceSymbol"
clearable clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.getScoreOnceSymbol"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-input <el-input
v-model.trim="queryParams.getScoreOnce" v-model.trim="queryParams.getScoreOnce"
:placeholder="$t('请输入数字')" :placeholder="$t('请输入数字')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-col> </el-col>
</el-row> </el-row>
...@@ -71,30 +68,29 @@ ...@@ -71,30 +68,29 @@
<el-row :gutter="10" style="width: 300px"> <el-row :gutter="10" style="width: 300px">
<el-col :span="10"> <el-col :span="10">
<dict-selector <dict-selector
v-model="queryParams.maxScoreTotalSymbol"
clearable clearable
:type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL" :type="DICT_TYPE.QUANTITATIVE_RELATION_SYMBOL"
v-model="queryParams.maxScoreTotalSymbol"
@change="handleQuery" @change="handleQuery"
> />
</dict-selector>
</el-col> </el-col>
<el-col :span="14"> <el-col :span="14">
<el-input <el-input
v-model.trim="queryParams.maxScoreTotal" v-model.trim="queryParams.maxScoreTotal"
:placeholder="$t('请输入数字')" :placeholder="$t('请输入数字')"
clearable clearable
@keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')"
@keyup.enter.native="handleQuery"
/> />
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
<el-form-item :label="$t('创建时间')"> <el-form-item :label="$t('创建时间')">
<el-date-picker <el-date-picker
v-model="dateRangeCreateTime"
type="datetimerange" type="datetimerange"
clearable clearable
placement="bottom-start" placement="bottom-start"
v-model="dateRangeCreateTime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
range-separator="-" range-separator="-"
...@@ -112,17 +108,27 @@ ...@@ -112,17 +108,27 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row class="mb8"> <el-row class="mb8">
<el-button <el-button
type="success" type="success"
size="mini" size="mini"
icon="el-icon-plus" icon="el-icon-plus"
@click="handleNewScoreRule" @click="handleNewScoreRule"
>{{ $t("添加规则") }}</el-button >{{ $t("添加规则") }}</el-button>
>
<right-toolbar <right-toolbar
:showSearch.sync="showSearch" :show-search.sync="showSearch"
@queryTable="handleQueryPagination" @queryTable="handleQueryPagination"
></right-toolbar> />
<el-tooltip v-hasPermi="['ecw:memberManagement:enableMemberPointsSystem']" :content="`${$t('开启会员积分系统')} : ${switchState} `" placement="top" class="switchBtn">
<el-switch
v-model="switchState"
:active-value="true"
:inactive-text="$t('开启会员积分系统')"
:inactive-value="false"
@change="openSwitch($event)"
/>
</el-tooltip>
</el-row> </el-row>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
...@@ -142,64 +148,53 @@ ...@@ -142,64 +148,53 @@
:label="$t('标题')" :label="$t('标题')"
align="center" align="center"
:prop="isChinese ? 'titleZh' : 'titleEn'" :prop="isChinese ? 'titleZh' : 'titleEn'"
></el-table-column> />
<el-table-column :label="$t('开始时间')" align="center"> <el-table-column :label="$t('开始时间')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.startTime) || "/" }}</template {{ parseTime(row.startTime) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column :label="$t('结束时间')" align="center"> <el-table-column :label="$t('结束时间')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.endTime) || "/" }}</template {{ parseTime(row.endTime) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:label="$t('单次积分')" :label="$t('单次积分')"
align="center" align="center"
prop="getScoreOnce" prop="getScoreOnce"
> />
</el-table-column>
<el-table-column <el-table-column
:label="$t('累计最高积分')" :label="$t('累计最高积分')"
align="center" align="center"
prop="maxScoreTotal" prop="maxScoreTotal"
> />
</el-table-column>
<el-table-column <el-table-column
:label="$t('规则说明')" :label="$t('规则说明')"
align="center" align="center"
:prop="isChinese ? 'descZh' : 'descEn'" :prop="isChinese ? 'descZh' : 'descEn'"
> />
</el-table-column>
<el-table-column :label="$t('展示平台')" align="center"> <el-table-column :label="$t('展示平台')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ handlePlatform(row.showPlatform) || "/" }}</template {{ handlePlatform(row.showPlatform) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column :label="$t('状态')" align="center"> <el-table-column :label="$t('状态')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ $l(handleStatus(row.status), "label") || "/" }}</template {{ $l(handleStatus(row.status), "label") || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column :label="$t('创建人')" align="center" prop="creator"> <el-table-column :label="$t('创建人')" align="center" prop="creator" />
</el-table-column>
<el-table-column :label="$t('创建时间')" align="center"> <el-table-column :label="$t('创建时间')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.createTime) || "/" }}</template {{ parseTime(row.createTime) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column :label="$t('最后更新人')" align="center" prop="updater"> <el-table-column :label="$t('最后更新人')" align="center" prop="updater" />
</el-table-column>
<el-table-column :label="$t('最后更新时间')" align="center"> <el-table-column :label="$t('最后更新时间')" align="center">
<template v-slot="{ row }"> <template #default="{ row }">
{{ parseTime(row.updateTime) || "/" }}</template {{ parseTime(row.updateTime) || "/" }}</template>
>
</el-table-column> </el-table-column>
<el-table-column width="220px" :label="$t('操作')" align="center"> <el-table-column width="220px" :label="$t('操作')" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -207,49 +202,42 @@ ...@@ -207,49 +202,42 @@
size="mini" size="mini"
type="text" type="text"
@click="handleViewDetails(scope.row)" @click="handleViewDetails(scope.row)"
>{{ $t("查看") }}</el-button >{{ $t("查看") }}</el-button>
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
@click="handleCloseButton(scope.row)" @click="handleCloseButton(scope.row)"
>{{ $t("关闭") }}</el-button >{{ $t("关闭") }}</el-button>
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@click="handleCopyButton(scope.row)" @click="handleCopyButton(scope.row)"
>{{ $t("复制") }}</el-button >{{ $t("复制") }}</el-button>
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
:disabled="scope.row.status != '1'" :disabled="scope.row.status != '1'"
@click="handleDelayButton(scope.row)" @click="handleDelayButton(scope.row)"
>{{ $t("延期") }}</el-button >{{ $t("延期") }}</el-button>
>
<el-button <el-button
size="mini" size="mini"
:disabled="scope.row.status != '2'" :disabled="scope.row.status != '2'"
type="text" type="text"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>{{ $t("删除") }}</el-button >{{ $t("删除") }}</el-button>
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
:disabled="scope.row.status != '2'" :disabled="scope.row.status != '2'"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>{{ $t("编辑") }}</el-button >{{ $t("编辑") }}</el-button>
>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
:disabled="scope.row.status != '2'" :disabled="scope.row.status != '2'"
@click="handleEnabledStatus(scope.row)" @click="handleEnabledStatus(scope.row)"
>{{ $t("启用") }}</el-button >{{ $t("启用") }}</el-button>
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -268,14 +256,14 @@ ...@@ -268,14 +256,14 @@
> >
<el-row class="mb8">{{ $t("请选择延期时间") }}</el-row> <el-row class="mb8">{{ $t("请选择延期时间") }}</el-row>
<el-date-picker <el-date-picker
v-model="postponeDatetime"
type="datetime" type="datetime"
clearable clearable
v-model="postponeDatetime"
style="width: 240px" style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
:picker-options="pickerOptions" :picker-options="pickerOptions"
:placeholder="$t('请选择时间')" :placeholder="$t('请选择时间')"
></el-date-picker> />
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogPostponeVisible = false">{{ <el-button @click="dialogPostponeVisible = false">{{
$t("取 消") $t("取 消")
...@@ -288,230 +276,258 @@ ...@@ -288,230 +276,258 @@
</div> </div>
</template> </template>
<script> <script>
import { getDictDatas, DICT_TYPE } from "@/utils/dict"; import { getDictDatas, DICT_TYPE } from '@/utils/dict'
import { import {
getScoreRecordList, getScoreRecordList,
integralRuleStatus, integralRuleStatus,
integralRuleCopy, integralRuleCopy,
integralRuleDelay, integralRuleDelay,
integralRuleDelete, integralRuleDelete,
} from "@/api/ecw/memberManagement"; switchRuleSet,
switchRuleGet
} from '@/api/ecw/memberManagement'
export default { export default {
name: "integralRecord", name: 'IntegralRecord',
data() { data() {
return { return {
switchState: true,
dateRangeCreateTime: [], dateRangeCreateTime: [],
total: 0, total: 0,
showSearch: true, showSearch: true,
loading: true, loading: true,
dialogPostponeVisible: false, dialogPostponeVisible: false,
integrationRuleList: [], integrationRuleList: [],
postponeIntegralID: "", postponeIntegralID: '',
postponeDatetime: "", postponeDatetime: '',
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getTime() < Date.now() - 8.64e7; return time.getTime() < Date.now() - 8.64e7
}, }
}, },
queryParams: { queryParams: {
type: "", type: '',
title: "", title: '',
desc: "", desc: '',
status: "", status: '',
getScoreOnceSymbol: "", getScoreOnceSymbol: '',
getScoreOnce: "", getScoreOnce: '',
maxScoreTotalSymbol: "", maxScoreTotalSymbol: '',
maxScoreTotal: "", maxScoreTotal: '',
page: 1, page: 1,
rows: 10, rows: 10
}, }
}; }
}, },
computed: { computed: {
isChinese() { isChinese() {
return this.$i18n.locale === "zh_CN"; return this.$i18n.locale === 'zh_CN'
}, }
}, },
created() { created() {
this.handleQuery(); this.handleQuery()
this.getSwitchRuleStatus()
}, },
activated() { activated() {
this.handleQuery(); this.handleQuery()
}, },
methods: { methods: {
//编辑操作按钮 openSwitch(status) {
this.$modal
.confirm(this.$t('是否确认{val}会员积分系统', { val: status ? this.$t('开启') : this.$t('关闭') }))
.then(async() => {
// return integralRuleDelete({ id: row.id })
const { code } = await switchRuleSet({ switchState: status })
if (code === 0) {
this.$modal.msgSuccess(this.$t('成功'))
}
})
.catch(() => {
this.switchState = !status
})
},
getSwitchRuleStatus() {
switchRuleGet().then(res => {
this.switchState = res.data
})
},
// 编辑操作按钮
handleUpdate(row) { handleUpdate(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/addIntegrationRuleOperation", path: '/memberManagement/addIntegrationRuleOperation',
query: { id: row.id, pageStatus: "edit" }, query: { id: row.id, pageStatus: 'edit' }
}); })
}, },
//查看按钮操作 // 查看按钮操作
handleViewDetails(row) { handleViewDetails(row) {
this.$router.push({ this.$router.push({
path: "/memberManagement/addIntegrationRuleOperation", path: '/memberManagement/addIntegrationRuleOperation',
query: { id: row.id, pageStatus: "view" }, query: { id: row.id, pageStatus: 'view' }
}); })
}, },
//延期按钮操作 // 延期按钮操作
handleDelayButton(row) { handleDelayButton(row) {
this.postponeIntegralID = row.id; this.postponeIntegralID = row.id
this.dialogPostponeVisible = true; this.dialogPostponeVisible = true
}, },
confirmPostponeIntegral() { confirmPostponeIntegral() {
integralRuleDelay({ integralRuleDelay({
id: this.postponeIntegralID, id: this.postponeIntegralID,
endTime: this.postponeDatetime, endTime: this.postponeDatetime
}).then((res) => { }).then((res) => {
this.postponeDatetime = ""; this.postponeDatetime = ''
this.$modal.msgSuccess(this.$t("延期成功")); this.$modal.msgSuccess(this.$t('延期成功'))
}); })
}, },
//删除按钮操作 // 删除按钮操作
handleDelete(row) { handleDelete(row) {
this.$modal this.$modal
.confirm(this.$t("是否确认删除此礼品规则")) .confirm(this.$t('是否确认删除此礼品规则'))
.then(function () { .then(function() {
return integralRuleDelete({ id: row.id }); return integralRuleDelete({ id: row.id })
}) })
.then(() => { .then(() => {
this.handleQuery(); this.handleQuery()
this.$modal.msgSuccess(this.$t("删除成功")); this.$modal.msgSuccess(this.$t('删除成功'))
}) })
.catch(() => {}); .catch(() => {})
}, },
//启用按钮操作 // 启用按钮操作
handleEnabledStatus(row) { handleEnabledStatus(row) {
this.$modal this.$modal
.confirm(this.$t("是否确认启用此礼品规则")) .confirm(this.$t('是否确认启用此礼品规则'))
.then(function () { .then(function() {
return integralRuleStatus({ id: row.id, status: "1" }); return integralRuleStatus({ id: row.id, status: '1' })
}) })
.then(() => { .then(() => {
this.handleQuery(); this.handleQuery()
this.$modal.msgSuccess(this.$t("启用成功")); this.$modal.msgSuccess(this.$t('启用成功'))
}) })
.catch(() => {}); .catch(() => {})
}, },
//复制按钮操作 // 复制按钮操作
handleCopyButton(row) { handleCopyButton(row) {
this.$modal this.$modal
.confirm(this.$t("是否确认复制礼品规则")) .confirm(this.$t('是否确认复制礼品规则'))
.then(function () { .then(function() {
return integralRuleCopy({ id: row.id }); return integralRuleCopy({ id: row.id })
}) })
.then(() => { .then(() => {
this.handleQuery(); this.handleQuery()
this.$modal.msgSuccess(this.$t("复制成功")); this.$modal.msgSuccess(this.$t('复制成功'))
}) })
.catch(() => {}); .catch(() => {})
}, },
//关闭按钮操作 // 关闭按钮操作
handleCloseButton(row) { handleCloseButton(row) {
this.$modal this.$modal
.confirm(this.$t("是否确认关闭此礼品规则")) .confirm(this.$t('是否确认关闭此礼品规则'))
.then(function () { .then(function() {
return integralRuleStatus({ id: row.id, status: "3" }); return integralRuleStatus({ id: row.id, status: '3' })
}) })
.then(() => { .then(() => {
this.handleQuery(); this.handleQuery()
this.$modal.msgSuccess(this.$t("关闭成功")); this.$modal.msgSuccess(this.$t('关闭成功'))
}) })
.catch(() => {}); .catch(() => {})
}, },
// new score rule func // new score rule func
handleNewScoreRule() { handleNewScoreRule() {
this.$router.push({ this.$router.push({
path: "/memberManagement/addIntegrationRuleOperation", path: '/memberManagement/addIntegrationRuleOperation',
query: { pageStatus: "new" }, query: { pageStatus: 'new' }
}); })
}, },
//积分来源 // 积分来源
handleSourceType(id) { handleSourceType(id) {
return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter( return this.getDictDatas(DICT_TYPE.SCORE_RULE_TYPE).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
// 活动状态 // 活动状态
handleStatus(id) { handleStatus(id) {
return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter( return this.getDictDatas(DICT_TYPE.GIFT_STATUS).filter(
(item) => item.value == id (item) => item.value == id
)[0]; )[0]
}, },
arraysEqual(arr1, arr2) { arraysEqual(arr1, arr2) {
return arr1.filter((current) => { return arr1.filter((current) => {
return arr2.find((item) => item == current.value.toString()) return !!arr2.find((item) => item == current.value.toString())
? true })
: false;
});
}, },
//展示平台 // 展示平台
handlePlatform(platformId) { handlePlatform(platformId) {
let platformIdLabel = []; const platformIdLabel = []
if (this.isChinese) { if (this.isChinese) {
this.arraysEqual( this.arraysEqual(
this.getDictDatas(DICT_TYPE.PLATFORM_TYPE), this.getDictDatas(DICT_TYPE.PLATFORM_TYPE),
platformId.split(",") platformId.split(',')
).forEach((element) => { ).forEach((element) => {
platformIdLabel.push(element.label); platformIdLabel.push(element.label)
}); })
} else { } else {
this.arraysEqual( this.arraysEqual(
this.getDictDatas(DICT_TYPE.PLATFORM_TYPE), this.getDictDatas(DICT_TYPE.PLATFORM_TYPE),
platformId.split(",") platformId.split(',')
).forEach((element) => { ).forEach((element) => {
platformIdLabel.push(element.labelEn); platformIdLabel.push(element.labelEn)
}); })
} }
return platformIdLabel.join(); return platformIdLabel.join()
}, },
handleQuery() { handleQuery() {
this.queryParams.page = 1; this.queryParams.page = 1
let params = { ...this.queryParams }; const params = { ...this.queryParams }
this.addBeginAndEndTime( this.addBeginAndEndTime(
params, params,
this.dateRangeCreateTime, this.dateRangeCreateTime,
"createTime", 'createTime',
false false
); )
getScoreRecordList(params).then((res) => { getScoreRecordList(params).then((res) => {
this.loading = false; this.loading = false
this.integrationRuleList = res.data.list; this.integrationRuleList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
handleQueryPagination() { handleQueryPagination() {
let params = { ...this.queryParams }; const params = { ...this.queryParams }
this.addBeginAndEndTime( this.addBeginAndEndTime(
params, params,
this.dateRangeCreateTime, this.dateRangeCreateTime,
"createTime", 'createTime',
false false
); )
getScoreRecordList(params).then((res) => { getScoreRecordList(params).then((res) => {
this.loading = false; this.loading = false
this.integrationRuleList = res.data.list; this.integrationRuleList = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
}, },
resetQuery() { resetQuery() {
this.loading = true; this.loading = true
this.dateRangeCreateTime = []; this.dateRangeCreateTime = []
this.queryParams = { this.queryParams = {
ruleTitle: "", ruleTitle: '',
ruleDesc: "", ruleDesc: '',
key: "", key: '',
sourceType: "", sourceType: '',
scoreCount: "", scoreCount: '',
scoreCountOperate: "", scoreCountOperate: '',
endTime: "", endTime: '',
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
startTime: "", startTime: ''
}; }
this.handleQuery(); this.handleQuery()
}, }
}, }
}; }
</script> </script>
<style scoped>
.switchBtn{
float: right;
padding-right: 70px;
padding-top: 6px;
}
</style>
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
:placeholder="$t('请输入订单号、唛头、提单号')" :placeholder="$t('请输入订单号、唛头、提单号')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/\s+/g, '')"
> >
<template slot="prepend"> <template slot="prepend">
<dict-selector <dict-selector
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
:placeholder="$t('发货人')" :placeholder="$t('发货人')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/\s+/g, '')"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('收货人')" prop="consigneeKey"> <el-form-item :label="$t('收货人')" prop="consigneeKey">
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
:placeholder="$t('收货人')" :placeholder="$t('收货人')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/\s+/g, '')"
/> />
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
...@@ -213,7 +214,8 @@ ...@@ -213,7 +214,8 @@
<el-form-item :label="$t('订单状态')" prop="status"> <el-form-item :label="$t('订单状态')" prop="status">
<dict-selector <dict-selector
:type="DICT_TYPE.ORDER_STATUS" :type="DICT_TYPE.ORDER_STATUS"
v-model="queryParams.status" multiple
v-model="queryParams.statusList"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
:filter="statusDictFilter" :filter="statusDictFilter"
clearable clearable
...@@ -261,7 +263,7 @@ ...@@ -261,7 +263,7 @@
:placeholder="$t('快递单号')" :placeholder="$t('快递单号')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/(^\s*)|(\s*$)/g,'')" onkeyup="this.value=this.value.replace(/\s+/g, '')"
/> />
</el-form-item> </el-form-item>
<el-form-item :label="$t('外部仓')" prop="number"> <el-form-item :label="$t('外部仓')" prop="number">
...@@ -281,7 +283,7 @@ ...@@ -281,7 +283,7 @@
<dict-selector <dict-selector
:type="DICT_TYPE.ORDER_ABNORMAL_STATE" :type="DICT_TYPE.ORDER_ABNORMAL_STATE"
multiple multiple
v-model="queryParams.abnormalState" v-model="queryParams.abnormalStateList"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
clearable clearable
@change="handleQuery" @change="handleQuery"
...@@ -291,7 +293,7 @@ ...@@ -291,7 +293,7 @@
<dict-selector <dict-selector
:type="DICT_TYPE.ECW_ORDER_APPROVAL_TYPE" :type="DICT_TYPE.ECW_ORDER_APPROVAL_TYPE"
multiple multiple
v-model="queryParams.auditType" v-model="queryParams.auditTypeList"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
clearable clearable
@change="handleQuery" @change="handleQuery"
...@@ -1675,16 +1677,16 @@ export default { ...@@ -1675,16 +1677,16 @@ export default {
} }
//目的国 //目的国
if (this.destCountryId != null && this.destCountryId != "") { if (this.destCountryId != null && this.destCountryId != "") {
queryParams.destCountryId = this.destCountryId; queryParams.destCountryIds = this.destCountryId;
} }
if (this.objectiveId != null && this.objectiveId != "") { if (this.objectiveId != null && this.objectiveId != "") {
//目的城市 //目的城市
queryParams.objectiveId = this.objectiveId; queryParams.objectiveIds = this.objectiveId;
} }
if (this.destWarehouseId != null && this.destWarehouseId != "") { if (this.destWarehouseId != null && this.destWarehouseId != "") {
//目的仓 //目的仓
queryParams.destWarehouseId = this.destWarehouseId; queryParams.destWarehouseIds = this.destWarehouseId;
} }
return queryParams; return queryParams;
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item :label="$t('商品编码')" prop="productCode"> <el-form-item :label="$t('商品编码')" prop="productCode">
<el-input v-model="queryParams.productCode" :placeholder="$t('请输入商品编码')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.productCode" :placeholder="$t('请输入商品编码')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('海关编码')" prop="customsCode"> <el-form-item :label="$t('海关编码')" prop="customsCode">
<el-input v-model="queryParams.customsCode" :placeholder="$t('请输入海关编码')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.customsCode" :placeholder="$t('请输入海关编码')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品名称')" prop="titleZh"> <el-form-item :label="$t('商品名称')" prop="titleZh">
<el-input v-model="queryParams.titleZh" :placeholder="$t('请输入商品名称')" clearable @keyup.enter.native="handleQuery"/> <el-input v-model="queryParams.titleZh" :placeholder="$t('请输入商品名称')" clearable @keyup.enter.native="handleQuery" onkeyup="this.value=this.value.replace(/\s+/g, '')" />
</el-form-item> </el-form-item>
<el-form-item :label="$t('商品类型')" prop="typeId"> <el-form-item :label="$t('商品类型')" prop="typeId">
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
:placeholder="$t('请输入中英文名称、商品编码、海关编码')" :placeholder="$t('请输入中英文名称、商品编码、海关编码')"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
onkeyup="this.value=this.value.replace(/\s+/g, '')"
> >
<template #prepend> <template #prepend>
<el-select v-model="queryParams.searchType" style="width: 100px"> <el-select v-model="queryParams.searchType" style="width: 100px">
......
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