Commit 9a4067fc by crushh

update: dist

parent 686ba20f
<template>
<div id="app">
<router-view> </router-view>
<router-view />
</div>
</template>
......@@ -8,12 +8,16 @@
import request from './service/request.js';
export default {
name: 'App',
data() {
data () {
return {};
},
created () {
this.getUserId();
this.changeTab();
},
methods: {
// 保存用户id,串号标志
getUserId() {
getUserId () {
request.get('/api-auth/get-login-user-info').then(res => {
if (res.data.errorCode === 0) {
const useId = res.data.result.userId;
......@@ -24,7 +28,7 @@ export default {
});
},
// 浏览器tab切换检查uid是否变化
changeTab() {
changeTab () {
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
request.get('/api-auth/get-login-user-info').then(res => {
......@@ -36,7 +40,7 @@ export default {
this.$confirm('当前登录账号已经发生变化,如果您在其他页面已经登录另一个账号,请重新登录!', '登录账号变更提示', {
confirmButtonText: '重新登录',
cancelButtonText: '刷新页面',
type: 'error'
type: 'error',
})
.then(() => {
window.location.href = '/gic-web/#/login';
......@@ -53,7 +57,7 @@ export default {
});
},
// 退出登录
doLogout() {
doLogout () {
request.get('/api-auth/do-logout').then(res => {
if (res.data.errorCode === 0) {
this.$message.success('退出成功');
......@@ -63,12 +67,8 @@ export default {
this.$message.error(res.data.message);
}
});
}
},
},
created() {
this.getUserId();
this.changeTab();
}
};
</script>
......
<template>
<el-dialog title="新建分类" :visible.sync="addCateModal.dialogVisible" width="450px" @close="cancelSubmit('editInfoModal')">
<el-dialog
title="新建分类"
:visible.sync="addCateModal.dialogVisible"
width="450px"
@close="cancelSubmit('editInfoModal')"
>
<el-form :model="editInfoModal" ref="editInfoModal" :rules="modalRules">
<el-form-item label="分类名称" label-width="80px" prop="cateName" class="position-item">
<el-input type="text" v-model="editInfoModal.cateName" style="width:330px" @input="value => proNameLimit(value)"> </el-input>
<el-form-item
label="分类名称"
label-width="80px"
prop="cateName"
class="position-item"
>
<el-input
type="text"
v-model="editInfoModal.cateName"
style="width:330px"
@input="value => proNameLimit(value)"
/>
<span class="slot-num">{{ goodsInfo.cateNameLen }}/10</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('editInfoModal')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('editInfoModal')">确 定</el-button>
<el-button @click="cancelSubmit('editInfoModal')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('editInfoModal')">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -21,38 +40,38 @@ export default {
props: {
addCateModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
editInfoModal: {
cateName: ''
cateName: '',
},
goodsInfo: {
cateNameLen: 0
cateNameLen: 0,
},
modalRules: {
cateName: [{ required: true, message: '请输入分类名称', trigger: 'blur' }]
}
cateName: [{ required: true, message: '请输入分类名称', trigger: 'blur' }],
},
};
},
methods: {
//输入框字数统计
proNameLimit(value) {
// 输入框字数统计
proNameLimit (value) {
this.$nextTick(() => {
this.editInfoModal.cateName = getInputVal.getInputVal(value, 10);
this.goodsInfo.cateNameLen = getInputVal.getZhLen(this.editInfoModal.cateName);
});
},
//确认修改商品名称
submitProNanme(formName) {
// 确认修改商品名称
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
categoryName: this.editInfoModal.cateName
const params = {
categoryName: this.editInfoModal.cateName,
};
request.post('/api-integral-mall/create-gift-category', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -69,12 +88,12 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.addCateModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
......@@ -3,16 +3,24 @@
<div v-loading="loading">
<el-table :data="stockTableData">
<el-table-column label="规格名称" v-if="giftPropValues">
<template slot-scope="{ row }">{{ row.skuName }}</template>
<template slot-scope="{ row }">
{{ row.skuName }}
</template>
</el-table-column>
<el-table-column label="总库存">
<template slot-scope="{ row }">{{ row.allStock }}</template>
<template slot-scope="{ row }">
{{ row.allStock }}
</template>
</el-table-column>
<el-table-column label="常兑库存">
<template slot-scope="{ row }">{{ row.stock }}</template>
<template slot-scope="{ row }">
{{ row.stock }}
</template>
</el-table-column>
<el-table-column label="秒杀活动">
<template slot-scope="{ row }">{{ row.activityStock }}</template>
<template slot-scope="{ row }">
{{ row.activityStock }}
</template>
</el-table-column>
</el-table>
</div>
......@@ -27,26 +35,26 @@ export default {
props: {
integralMallProId: {
type: String,
default() {
default () {
return '';
}
}
},
},
},
data() {
data () {
return {
id: '',
stockTableData: [],
loading: false,
giftPropValues: ''
giftPropValues: '',
};
},
created() {
created () {
// console.log(this.ladderPriceData);
this.dialogVisible = true;
this.getInfo(this.integralMallProId);
},
methods: {
getInfo(integralMallProId) {
getInfo (integralMallProId) {
this.loading = true;
request.post(`/api-integral-mall/view-distribution?giftProId=${integralMallProId}`).then(res => {
if (res.data.errorCode === 0) {
......@@ -57,9 +65,9 @@ export default {
let totalActivityStock = 0;
this.stockTableData.forEach(item => {
item.skuName = '';
let skuName = [];
const skuName = [];
if (item.giftPropValues) {
let skuNameValues = JSON.parse(item.giftPropValues);
const skuNameValues = JSON.parse(item.giftPropValues);
skuNameValues.forEach(it => {
skuName.push(it.valueName);
});
......@@ -73,7 +81,7 @@ export default {
this.stockTableData.unshift({
allStock: totalAllStock,
stock: totalStock,
activityStock: totalActivityStock
activityStock: totalActivityStock,
});
}
if (this.stockTableData.length > 1) {
......@@ -87,13 +95,13 @@ export default {
}
});
},
cancel() {
cancel () {
this.dialogVisible = false;
setInterval(() => {
this.$emit('closeStockDistirbute');
}, 10);
}
}
},
},
};
</script>
<style scoped>
......
......@@ -6,17 +6,27 @@
</div>
<div v-loading="loading">
<el-tabs :value="selectTab" type="border-card" class="card-style">
<el-tab-pane :name="index" v-for="(item, index) in list3" :key="index" :label="item.gradeName" :value="item.gradeId">
<el-tab-pane
:name="index"
v-for="(item, index) in list3"
:key="index"
:label="item.gradeName"
:value="item.gradeId"
>
<el-form>
<el-form-item label="积分">
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuIntegral" style="width:180px"></el-input>
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuIntegral" style="width:180px" />
</el-form-item>
<el-form-item label="现金">
<el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuCash" style="width:180px" />&nbsp;&nbsp;
</el-form-item>
<el-form-item label="现金"> <el-input size="small" v-model.trim="list3[index].skuList[0].giftProSkuCash" style="width:180px"></el-input>&nbsp;&nbsp;</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs>
<div style="margin-top: 20px;text-align:right">
<el-button type="primary" @click="saveLadderDetail">保存</el-button>
<el-button type="primary" @click="saveLadderDetail">
保存
</el-button>
</div>
</div>
</el-dialog>
......@@ -29,12 +39,12 @@ export default {
props: {
ladderPriceData: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
selectTab: 0,
loading: false,
......@@ -44,19 +54,19 @@ export default {
integral: '',
cash: '',
cardCouponList: [],
ladder: []
ladder: [],
};
},
created() {
created () {
this.dialogVisible = true;
this.id = this.ladderPriceData.id;
this.getInfo();
},
methods: {
async getInfo() {
async getInfo () {
console.log(111);
let params = {
integralMallProId: this.id
const params = {
integralMallProId: this.id,
};
this.loading = true;
request
......@@ -81,7 +91,7 @@ export default {
})
.finally(() => (this.loading = false));
},
handleLadder(value) {
handleLadder (value) {
value.forEach(item => {
item.giftProSkuIntegral = this.integral ? this.integral : item.giftProSkuIntegral;
item.giftProSkuCash = this.cash ? this.cash : item.giftProSkuCash;
......@@ -89,10 +99,10 @@ export default {
this.integral = '';
this.cash = '';
},
saveLadderDetail() {
let params = {
saveLadderDetail () {
const params = {
integralMallProId: this.id,
differentialPricingJson: JSON.stringify(this.list3)
differentialPricingJson: JSON.stringify(this.list3),
};
request.post('/api-integral-mall/set-differential-pricing', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -104,13 +114,13 @@ export default {
}
});
},
cancelSubmit() {
cancelSubmit () {
this.dialogVisible = false;
setInterval(() => {
this.$emit('closeUpdateLadder');
}, 10);
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog :title="'编辑' + editInfoModal.type" :visible.sync="editInfoModal.dialogVisible" width="450px" @close="cancelSubmit('editInfoModal')">
<el-dialog
:title="'编辑' + editInfoModal.type"
:visible.sync="editInfoModal.dialogVisible"
width="450px"
@close="cancelSubmit('editInfoModal')"
>
<el-form :model="editInfoModal" ref="editInfoModal" :rules="modalRules">
<el-form-item label="积分费用" label-width="80px" prop="num" v-if="editInfoModal.type === '积分费用'">
<el-input-number v-model="editInfoModal.num" style="width:330px" :precision="0" :min="0"> </el-input-number>
<el-form-item
label="积分费用"
label-width="80px"
prop="num"
v-if="editInfoModal.type === '积分费用'"
>
<el-input-number
v-model="editInfoModal.num"
style="width:330px"
:precision="0"
:min="0"
/>
</el-form-item>
<el-form-item label="现金费用" label-width="80px" prop="num" v-if="editInfoModal.type === '现金费用'">
<el-input-number v-model="editInfoModal.num" style="width:330px" :precision="2" :min="0"> </el-input-number>
<el-form-item
label="现金费用"
label-width="80px"
prop="num"
v-if="editInfoModal.type === '现金费用'"
>
<el-input-number
v-model="editInfoModal.num"
style="width:330px"
:precision="2"
:min="0"
/>
</el-form-item>
<el-form-item label="库存" label-width="80px" prop="num" v-if="editInfoModal.type === '库存'">
<el-input-number v-model="editInfoModal.num" style="width:330px" :precision="0" :min="1"> </el-input-number>
<el-form-item
label="库存"
label-width="80px"
prop="num"
v-if="editInfoModal.type === '库存'"
>
<el-input-number
v-model="editInfoModal.num"
style="width:330px"
:precision="0"
:min="1"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('editInfoModal')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('editInfoModal')">确 定</el-button>
<el-button @click="cancelSubmit('editInfoModal')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('editInfoModal')">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -25,25 +64,25 @@ export default {
props: {
editInfoModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
modalRules: {
num: [{ required: true, message: '请输入分类名称', trigger: 'blur' }]
}
num: [{ required: true, message: '请输入分类名称', trigger: 'blur' }],
},
};
},
methods: {
//确认修改商品名称
submitProNanme(formName) {
// 确认修改商品名称
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
proId: this.editInfoModal.mallProId
const params = {
proId: this.editInfoModal.mallProId,
};
let url = '';
// proId
......@@ -82,12 +121,12 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.editInfoModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog title="修改礼品名称" :visible.sync="editInfoModal.dialogVisible" width="450px" @close="cancelSubmit('editInfoModal')">
<el-dialog
title="修改礼品名称"
:visible.sync="editInfoModal.dialogVisible"
width="450px"
@close="cancelSubmit('editInfoModal')"
>
<el-form :model="editInfoModal" ref="editInfoModal" :rules="modalRules">
<el-form-item label="商品名称" label-width="80px" prop="proName">
<el-input type="textarea" :row="2" v-model="editInfoModal.proName" style="width:330px" @input="value => proNameLimit(value)"> </el-input>
<el-input
type="textarea"
:row="2"
v-model="editInfoModal.proName"
style="width:330px"
@input="value => proNameLimit(value)"
/>
</el-form-item>
<span class="slot-num">{{ editInfoModal.proNameLen }}/30</span>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('editInfoModal')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('editInfoModal')">确 定</el-button>
<el-button @click="cancelSubmit('editInfoModal')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('editInfoModal')">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -21,36 +36,36 @@ export default {
props: {
editInfoModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
goodsInfo: {
proNameLen: 0
proNameLen: 0,
},
modalRules: {
proName: [{ required: true, message: '请输入礼品名称', trigger: 'blur' }]
}
proName: [{ required: true, message: '请输入礼品名称', trigger: 'blur' }],
},
};
},
methods: {
//输入框字数统计
proNameLimit(value) {
// 输入框字数统计
proNameLimit (value) {
this.$nextTick(() => {
this.editInfoModal.proName = getInputVal.getInputVal(value, 30);
this.editInfoModal.proNameLen = getInputVal.getZhLen(this.editInfoModal.proName);
});
},
//确认修改商品名称
submitProNanme(formName) {
// 确认修改商品名称
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
const params = {
integralMallProId: this.editInfoModal.mallProId,
name: this.editInfoModal.proName
name: this.editInfoModal.proName,
};
request.post('/api-integral-mall/update-integral-name', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -66,12 +81,12 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.editInfoModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
......@@ -2,21 +2,38 @@
<el-dialog title="商品链接" :visible.sync="modalData.show" width="450px">
<div class="dialog-body">
<div class="wechat-url" style="margin-bottom:30px;">
<p style="font-weight: 600;margin-bottom:15px">页面链接</p>
<p style="font-weight: 600;margin-bottom:15px">
页面链接
</p>
<div style="display:flex;align-items: center">
<el-input type="textarea" :rows="2" v-model="modalData.pageUrl" disabled></el-input>
<a href="javaScript:void(0)" style="width:40px;margin-left:20px" v-clipboard:copy="modalData.pageUrl" v-clipboard:success="onCopy" v-clipboard:error="onError">复制</a>
<el-input
type="textarea"
:rows="2"
v-model="modalData.pageUrl"
disabled
/>
<a
href="javaScript:void(0)"
style="width:40px;margin-left:20px"
v-clipboard:copy="modalData.pageUrl"
v-clipboard:success="onCopy"
v-clipboard:error="onError"
>复制</a>
</div>
</div>
<div class="wechat-img-box" v-loading="modalData.loading">
<p style="font-weight: 600;margin-bottom:15px">小程序二维码</p>
<img :src="modalData.imgUrl" class="wechat-img" style="width:140px;height:140px;" />
<p style="font-weight: 600;margin-bottom:15px">
小程序二维码
</p>
<img :src="modalData.imgUrl" class="wechat-img" style="width:140px;height:140px;">
</div>
<div class="wechat-force" style="margin-bottom:0">
<p>温馨提示:通过二维码兑换,仅校验会员适用等级</p>
</div>
<div class="wechat-force">
<el-button type="primary" @click="force">重新生成</el-button>
<el-button type="primary" @click="force">
重新生成
</el-button>
</div>
</div>
</el-dialog>
......@@ -28,48 +45,48 @@ import request from '../service/request';
export default {
props: {
modalData: {
type: Object
type: Object,
},
integralMallProId: {
type: String,
default() {
default () {
return '';
}
},
},
saleType: {
type: String,
default() {
default () {
return '';
}
}
},
},
},
data() {
data () {
return {
// loading:true,
forceIntegralMallProId: '',
forceType: ''
forceType: '',
};
},
watch: {
integralMallProId: function(value) {
integralMallProId: function (value) {
this.forceIntegralMallProId = value;
},
saleType: function(value) {
saleType: function (value) {
this.forceType = value;
}
},
},
methods: {
onCopy(e) {
onCopy (e) {
this.$message.success('复制成功');
},
onError(e) {
onError (e) {
this.$message.error('复制失败');
},
force() {
let params = {
force () {
const params = {
integralMallProId: this.forceIntegralMallProId,
type: this.forceType,
isForce: '1'
isForce: '1',
};
this.modalData.show = true;
request.get('/api-integral-mall/get-qRCode', { params }).then(res => {
......@@ -82,8 +99,8 @@ export default {
this.$message.error(res.data.message);
}
});
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-popover :placement="placement" width="440" height="180" trigger="hover" @show="getMemberInfo">
<el-popover
:placement="placement"
width="440"
height="180"
trigger="hover"
@show="getMemberInfo"
>
<div class="corsur-pointer">
<div class="singelinfo" @click="linkDetail">
<div class="singelinfo-img">
<img width="100" height="100" v-if="memberInfo.photoUrl" :src="memberInfo.photoUrl" alt="" />
<img width="100" height="100" v-else src="../../static/img/head_default.png" alt="" />
<img
width="100"
height="100"
v-if="memberInfo.photoUrl"
:src="memberInfo.photoUrl"
alt=""
>
<img
width="100"
height="100"
v-else
src="../../static/img/head_default.png"
alt=""
>
</div>
<div class="member-info-content">
<div class="info-top">
<span class="lheigt20 fl">{{ memberObj.memberName }}</span>
<div class="fr">
<img title="已取消关注公众号" v-if="memberInfo.status == 0" src="../../static/img/status@gzhcanclegray.png" style="margin-right:5px" />
<img title="已关注公众号" v-else-if="memberInfo.status == 1" src="../../static/img/status@gzh.png" style="margin-right:5px" />
<img title="未关注公众号" v-else-if="memberInfo.status == 2" src="../../static/img/status@gzhgray.png" style="margin-right:5px" />
<img title="使用过小程序" v-if="memberInfo.wxStatus === 1" src="../../static/img/status@xcx.png" style="margin-right:5px" />
<img title="未使用小程序" v-if="memberInfo.wxStatus === 0" src="../../static/img/status@xcxgray.png" style="margin-right:5px" />
<img title="已绑定手机号" v-if="memberInfo.phoneStatus === 1" src="../../static/img/phone_icon.png" style="margin-right:5px" />
<img title="未绑定手机号" v-if="memberInfo.phoneStatus === 0" src="../../static/img/phone_icon_gray.png" style="margin-right:5px" />
<img title="已认证" v-if="memberInfo.authStatus === 1" src="../../static/img/member_icon.png" style="margin-right:5px" />
<img title="未认证" v-if="memberInfo.authStatus === 0" src="../../static/img/member_icon_gray.png" style="margin-right:5px" />
<img
title="已取消关注公众号"
v-if="memberInfo.status == 0"
src="../../static/img/status@gzhcanclegray.png"
style="margin-right:5px"
>
<img
title="已关注公众号"
v-else-if="memberInfo.status == 1"
src="../../static/img/status@gzh.png"
style="margin-right:5px"
>
<img
title="未关注公众号"
v-else-if="memberInfo.status == 2"
src="../../static/img/status@gzhgray.png"
style="margin-right:5px"
>
<img
title="使用过小程序"
v-if="memberInfo.wxStatus === 1"
src="../../static/img/status@xcx.png"
style="margin-right:5px"
>
<img
title="未使用小程序"
v-if="memberInfo.wxStatus === 0"
src="../../static/img/status@xcxgray.png"
style="margin-right:5px"
>
<img
title="已绑定手机号"
v-if="memberInfo.phoneStatus === 1"
src="../../static/img/phone_icon.png"
style="margin-right:5px"
>
<img
title="未绑定手机号"
v-if="memberInfo.phoneStatus === 0"
src="../../static/img/phone_icon_gray.png"
style="margin-right:5px"
>
<img
title="已认证"
v-if="memberInfo.authStatus === 1"
src="../../static/img/member_icon.png"
style="margin-right:5px"
>
<img
title="未认证"
v-if="memberInfo.authStatus === 0"
src="../../static/img/member_icon_gray.png"
style="margin-right:5px"
>
</div>
</div>
<p class="member-detal-info">
......@@ -26,7 +89,9 @@
<span style="margin-right:5px;">{{ memberInfo.age }}</span>
<span>{{ memberInfo.cardNo }}</span>
</p>
<p class="member-detal-info">{{ memberInfo.mainStoreName }}</p>
<p class="member-detal-info">
{{ memberInfo.mainStoreName }}
</p>
<div class="singelinfo-cost">
<div class="singelinfo-costitem">
<p>{{ memberInfo.costFee || 0 }}</p>
......@@ -37,7 +102,9 @@
<p>消费次数</p>
</div>
<div class="singelinfo-costitem">
<p class="no-wrap">{{ memberInfo.lastCost || 0 }}</p>
<p class="no-wrap">
{{ memberInfo.lastCost || 0 }}
</p>
<p>最近消费</p>
</div>
</div>
......@@ -63,22 +130,22 @@
<script>
import request from '../service/request.js';
export default {
name: 'vue-member-info',
name: 'VueMemberInfo',
props: {
memberObj: {
type: Object,
default() {
default () {
return {};
}
},
},
requestProject: {
type: String
type: String,
},
placement: {
type: String
}
type: String,
},
},
data() {
data () {
return {
memberInfo: {},
/*eslint-disable*/
......
<template>
<el-popover placement="bottom-start" width="420" trigger="click" v-model="popoverShow">
<el-popover
placement="bottom-start"
width="420"
trigger="click"
v-model="popoverShow"
>
<div class="store-area-content">
<div class="store-area-left-content">
<div v-for="(item, index) in areaList" :key="index" class="list-item" @click="getRightList(item, index)">
<div
v-for="(item, index) in areaList"
:key="index"
class="list-item"
@click="getRightList(item, index)"
>
<div>
<el-checkbox :indeterminate="item.indeterminate" v-model="item.isCheck" @change="checkProvinceChange(item, index)"></el-checkbox>
<el-checkbox :indeterminate="item.indeterminate" v-model="item.isCheck" @change="checkProvinceChange(item, index)" />
<span class="list-name"> {{ item.provinceName }}</span>
</div>
<i class="el-icon-arrow-right"></i>
<i class="el-icon-arrow-right" />
</div>
</div>
<div class="store-area-right-content">
<div v-if="currentCityList.length > 0">
<div v-for="(v, i) in currentCityList" :key="i" class="list-item">
<div>
<el-checkbox :indeterminate="v.indeterminate" v-model="v.isCheck" @change="checkCityChange()"></el-checkbox>
<el-checkbox :indeterminate="v.indeterminate" v-model="v.isCheck" @change="checkCityChange()" />
<span class="list-name"> {{ v.label }}</span>
</div>
</div>
......@@ -25,10 +35,16 @@
</div>
</div>
<div class="store-button">
<el-button type="text" style="color:#303133" @click="cancel">取消</el-button>
<el-button type="text" @click="submit">确定</el-button>
<el-button type="text" style="color:#303133" @click="cancel">
取消
</el-button>
<el-button type="text" @click="submit">
确定
</el-button>
</div>
<div slot="reference" class="group-title">
已选择 {{ totalProvince }} 个省 {{ totalCity }} 个市区
</div>
<div slot="reference" class="group-title">已选择 {{ totalProvince }} 个省 {{ totalCity }} 个市区</div>
</el-popover>
</template>
<script>
......@@ -37,19 +53,19 @@ export default {
props: {
selectData: {
type: Array,
default() {
default () {
return [];
}
}
},
},
},
data() {
data () {
return {
areaList: [],
popoverShow: false,
currentCityList: [],
totalCity: 0,
totalProvince: 0,
currentIndex: 0
currentIndex: 0,
};
},
watch: {
......@@ -59,7 +75,7 @@ export default {
* false false 不选
* false true 全选
*/
handler(val) {
handler (val) {
// 全选计算省数量
this.totalProvince = this.areaList.filter(v => !v.indeterminate && v.isCheck).length;
this.totalCity = 0;
......@@ -74,16 +90,16 @@ export default {
}
});
},
deep: true
}
deep: true,
},
},
mounted() {
mounted () {
this.currentCityList = this.selectData;
this.getAreaList();
},
methods: {
//获取左侧区域列表
getAreaList() {
// 获取左侧区域列表
getAreaList () {
request.get('/api-plug/dict-tree-store-widget').then(res => {
if (res.data.errorCode === 0) {
this.areaList = res.data.result.map(v => ({
......@@ -96,11 +112,11 @@ export default {
isCheck: false,
label: w.cityName,
id: w.cityId,
...w
}))
...w,
})),
}));
if (this.selectData.length > 0) {
let selectId = this.selectData.map(u => u.id);
const selectId = this.selectData.map(u => u.id);
selectId.map(u => {
this.areaList.map(v => {
// 全选 市一起勾选
......@@ -128,7 +144,7 @@ export default {
});
},
// 左侧选中
checkProvinceChange(item, index) {
checkProvinceChange (item, index) {
this.currentIndex = index;
item.children.map(v => {
v.isCheck = item.isCheck;
......@@ -152,14 +168,14 @@ export default {
}
});
},
//获取右侧区域
getRightList(item, index) {
// 获取右侧区域
getRightList (item, index) {
this.currentIndex = index;
this.currentCityList = item.children;
},
// 左侧选中
checkCityChange() {
let item = this.areaList[this.currentIndex];
checkCityChange () {
const item = this.areaList[this.currentIndex];
const isAllCheck = item.children.every(v => v.isCheck);
const isSomeCheck = item.children.some(v => v.isCheck);
item.isCheck = isSomeCheck;
......@@ -177,30 +193,30 @@ export default {
}
});
},
//保存
submit() {
// 保存
submit () {
// 获取所有选中的省份
let selectProvince = this.areaList.filter(v => {
const selectProvince = this.areaList.filter(v => {
return v.isCheck && !v.indeterminate;
});
for (let item of selectProvince) {
for (const item of selectProvince) {
item.type = 0;
}
//获取市选中的
let cityList = this.areaList.filter(v => {
// 获取市选中的
const cityList = this.areaList.filter(v => {
return v.isCheck && v.indeterminate;
});
let selectCity = [];
for (let item of cityList) {
for (let v of item.children) {
const selectCity = [];
for (const item of cityList) {
for (const v of item.children) {
v.type = 1;
if (v.isCheck) {
selectCity.push(v);
}
}
}
let selectList = selectProvince.concat(selectCity);
let selectArr = [];
const selectList = selectProvince.concat(selectCity);
const selectArr = [];
selectList.forEach(element => {
selectArr.push({ id: element.id, label: element.label, type: element.type });
});
......@@ -208,11 +224,11 @@ export default {
this.$message.error('请至少选择一个区域');
return false;
}
//处理数据过滤掉无用字段
// 处理数据过滤掉无用字段
this.$emit('getSelectList', selectArr);
this.popoverShow = false;
},
cancel() {
cancel () {
this.areaList.forEach(i => {
(i.isCheck = false), (i.indeterminate = false);
i.children.forEach(v => {
......@@ -221,8 +237,8 @@ export default {
});
this.$emit('getSelectList', []);
this.popoverShow = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-popover placement="bottom-start" width="420" trigger="click" v-model="popoverShow">
<el-popover
placement="bottom-start"
width="420"
trigger="click"
v-model="popoverShow"
>
<div class="store-group-content">
<div class="store-group-left-content">
<div class="title">选择</div>
<div class="title">
选择
</div>
<div class="search-content">
<el-input placeholder="请输入门店名称" v-model="search" clearable class="w-180 border-radius20" @keyup.enter.native="getTreeContent" @clear="getTreeContent"></el-input>
<el-input
placeholder="请输入门店名称"
v-model="search"
clearable
class="w-180 border-radius20"
@keyup.enter.native="getTreeContent"
@clear="getTreeContent"
/>
</div>
<div class="tree-content">
<el-tree ref="tree" check-strictly @check-change="checkChange" :data="leftList" :default-expand-all="true" show-checkbox node-key="storeGroupId" :props="defaultProps"> </el-tree>
<el-tree
ref="tree"
check-strictly
@check-change="checkChange"
:data="leftList"
:default-expand-all="true"
show-checkbox
node-key="storeGroupId"
:props="defaultProps"
/>
</div>
</div>
<div class="store-group-right-content">
......@@ -15,16 +38,25 @@
<p>
已选<span class="group-num">{{ selectLeftList.length }}个分组)</span>
</p>
<el-button type="text" @click="clearAll">全部清除</el-button>
<el-button type="text" @click="clearAll">
全部清除
</el-button>
</div>
<div class="search-content">
<el-input placeholder="请输入门店名称" v-model="searchValue" clearable class="w-180 border-radius20" @keyup.enter.native="getRightList" @clear="getRightList"></el-input>
<el-input
placeholder="请输入门店名称"
v-model="searchValue"
clearable
class="w-180 border-radius20"
@keyup.enter.native="getRightList"
@clear="getRightList"
/>
</div>
<div class="list-content">
<div v-if="selectRightList.length > 0">
<div class="list-item" v-for="(item, index) in selectRightList" :key="index">
<span class="storeGroup-name">{{ item.storeGroupName }}</span>
<span class="el-icon-close" @click="removeSelect(item, index)"></span>
<span class="el-icon-close" @click="removeSelect(item, index)" />
</div>
</div>
<div v-else class="no-data-content">
......@@ -34,10 +66,16 @@
</div>
</div>
<div class="store-button">
<el-button type="text" style="color:#303133" @click="cancel">取消</el-button>
<el-button type="text" @click="submit">确定</el-button>
<el-button type="text" style="color:#303133" @click="cancel">
取消
</el-button>
<el-button type="text" @click="submit">
确定
</el-button>
</div>
<div slot="reference" class="group-title">
已选择 {{ selectLeftList.length }} 个分组
</div>
<div slot="reference" class="group-title">已选择 {{ selectLeftList.length }} 个分组</div>
</el-popover>
</template>
<script>
......@@ -47,12 +85,12 @@ export default {
props: {
selectData: {
type: Array,
default() {
default () {
return [];
}
}
},
},
},
data() {
data () {
return {
popoverShow: false,
selectLeftList: [],
......@@ -61,19 +99,19 @@ export default {
defaultProps: {
id: 'storeGroupId',
label: 'storeGroupName',
children: 'children'
children: 'children',
},
searchValue: '',
selectIdList: [],
selectRightList: [],
refash: false
refash: false,
};
},
mounted() {
mounted () {
this.getTreeContent();
this.selectLeftList = this.selectData;
this.selectRightList = this.selectData;
for (let item of this.selectData) {
for (const item of this.selectData) {
if (
!this.selectIdList.find(i => {
return i === item.storeGroupId;
......@@ -84,15 +122,15 @@ export default {
}
},
methods: {
getTreeContent() {
let params = {
search: this.search
getTreeContent () {
const params = {
search: this.search,
};
request.get('/api-plug/store-group-list', { params }).then(res => {
if (res.data.errorCode === 0) {
this.leftList = res.data.result || [];
this.handleDataStatus(this.leftList, this.selectLeftList);
for (let item of this.selectLeftList) {
for (const item of this.selectLeftList) {
if (
!this.selectIdList.find(i => {
return i === item.storeGroupId;
......@@ -107,9 +145,9 @@ export default {
}
});
},
//处理已选中数据不可取消
handleDataStatus(arr, list) {
for (let item of arr) {
// 处理已选中数据不可取消
handleDataStatus (arr, list) {
for (const item of arr) {
if (
list.find(i => {
return i.storeGroupId === item.storeGroupId;
......@@ -129,14 +167,14 @@ export default {
}
},
// 选中事件
checkChange(data, checked, ins) {
checkChange (data, checked, ins) {
data.disabled = true;
this.selectIdList = [];
for (let item of this.selectLeftList) {
for (const item of this.selectLeftList) {
this.selectIdList.push(item.storeGroupId);
}
let selectList = this.$refs.tree.getCheckedNodes();
for (let item of selectList) {
const selectList = this.$refs.tree.getCheckedNodes();
for (const item of selectList) {
if (
!this.selectLeftList.find(i => {
return i.storeGroupId === item.storeGroupId;
......@@ -187,13 +225,13 @@ export default {
// }
// },
// 右侧移除删除
removeSelect(item, index) {
removeSelect (item, index) {
// item.disabled = false;
// this.$set(this.leftList, 'item', false);
this.selectRightList.splice(copy(this.selectRightList).findIndex(i => i.storeGroupId === item.storeGroupId), 1);
this.selectLeftList.splice(this.selectLeftList.findIndex(i => i.storeGroupId === item.storeGroupId), 1);
this.selectIdList = [];
for (let item of this.selectLeftList) {
for (const item of this.selectLeftList) {
this.selectIdList.push(item.storeGroupId);
}
this.searchValue = '';
......@@ -201,15 +239,15 @@ export default {
this.handleDataStatus(this.leftList, this.selectLeftList);
},
// 全部清除
clearAll() {
clearAll () {
this.$refs.tree.setCheckedKeys([]);
this.selectRightList = [];
this.selectLeftList = [];
this.selectIdList = [];
this.handleDataStatus(this.leftList, this.selectLeftList);
},
//右侧搜索
getRightList() {
// 右侧搜索
getRightList () {
var newData = this.selectLeftList.filter(item => {
if (item.storeGroupName.indexOf(this.searchValue) > -1) {
return item;
......@@ -220,7 +258,7 @@ export default {
this.selectRightList = newData;
},
// 取消选中
cancel() {
cancel () {
this.selectRightList = [];
this.selectLeftList = [];
this.$refs.tree.setCheckedKeys([]);
......@@ -228,8 +266,8 @@ export default {
this.$emit('getSelectList', this.selectLeftList);
this.popoverShow = false;
},
//提交
submit() {
// 提交
submit () {
if (this.selectLeftList.length < 1) {
this.$message.error('请至少选择一个分组');
return false;
......@@ -245,8 +283,8 @@ export default {
});
this.$emit('getSelectList', this.selectLeftList);
this.popoverShow = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-popover placement="bottom-start" width="420" trigger="click" v-model="popoverShow">
<el-popover
placement="bottom-start"
width="420"
trigger="click"
v-model="popoverShow"
>
<div class="store-part-content">
<div class="store-part-left-content">
<div class="title">
......@@ -7,13 +12,42 @@
<span class="group-num">{{ total }}</span>
</div>
<div class="search-content">
<el-input placeholder="请输入自提点名称" v-model="search" clearable class="w-180 border-radius20" @keyup.enter.native="getSearchList" @clear="getSearchList"></el-input>
<el-input
placeholder="请输入自提点名称"
v-model="search"
clearable
class="w-180 border-radius20"
@keyup.enter.native="getSearchList"
@clear="getSearchList"
/>
</div>
<div class="store-table-content">
<el-table :data="tableData" :show-overflow-tooltip="true" :show-header="showHeader" ref="selectedTable" :row-key="getSelectList" @row-click="selectRow" @selection-change="handleSelectionChange" style="width: 100%" v-loadmore="loadmore" class="scroll-table" height="210">
<el-table
:data="tableData"
:show-overflow-tooltip="true"
:show-header="showHeader"
ref="selectedTable"
:row-key="getSelectList"
@row-click="selectRow"
@selection-change="handleSelectionChange"
style="width: 100%"
v-loadmore="loadmore"
class="scroll-table"
height="210"
>
<span style="display:none">{{ refash }}</span>
<el-table-column type="selection" width="30" :reserve-selection="true" :selectable="selectable"> </el-table-column>
<el-table-column prop="pickUpPointName" label="全部自提点" show-overflow-tooltip width="160"> </el-table-column>
<el-table-column
type="selection"
width="30"
:reserve-selection="true"
:selectable="selectable"
/>
<el-table-column
prop="pickUpPointName"
label="全部自提点"
show-overflow-tooltip
width="160"
/>
</el-table>
</div>
</div>
......@@ -24,13 +58,20 @@
</p>
</div>
<div class="search-content">
<el-input placeholder="请输入门店名称" v-model="searchValue" clearable class="w-180 border-radius20" @keyup.enter.native="getRightList" @clear="getRightList"></el-input>
<el-input
placeholder="请输入门店名称"
v-model="searchValue"
clearable
class="w-180 border-radius20"
@keyup.enter.native="getRightList"
@clear="getRightList"
/>
</div>
<div class="list-content">
<div v-if="selectRightList.length > 0">
<div class="list-item" v-for="(item, index) in selectRightList" :key="index">
<span class="storeGroup-name">{{ item.pickUpPointName }}</span>
<span class="el-icon-close" @click="removeItem(item, index)"></span>
<span class="el-icon-close" @click="removeItem(item, index)" />
</div>
</div>
<div v-else class="no-data-content">
......@@ -40,10 +81,16 @@
</div>
</div>
<div class="store-button">
<el-button type="text" style="color:#303133" @click="cancel">取消</el-button>
<el-button type="text" @click="submit">确定</el-button>
<el-button type="text" style="color:#303133" @click="cancel">
取消
</el-button>
<el-button type="text" @click="submit">
确定
</el-button>
</div>
<div slot="reference" class="group-title">
已选择 {{ selectLeftList.length }} 个自提点
</div>
<div slot="reference" class="group-title">已选择 {{ selectLeftList.length }} 个自提点</div>
</el-popover>
</template>
<script>
......@@ -51,35 +98,12 @@ import request from '../../service/request.js';
import qs from 'qs';
import copy from '../../utils/clone';
export default {
props: {
selectData: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
selectLeftList: [],
selectRightList: [],
search: '',
total: 0,
searchValue: '',
pageSize: 20,
totalPage: 1,
currentPage: 1,
tableData: [],
showHeader: false,
popoverShow: false
};
},
directives: {
loadmore: {
bind(el, binding) {
bind (el, binding) {
// 获取element-ui定义好的scroll盒子
const SELECTWRAP_DOM = el.querySelector('.el-table__body-wrapper');
SELECTWRAP_DOM.addEventListener('scroll', function() {
SELECTWRAP_DOM.addEventListener('scroll', function () {
/*
* scrollHeight 获取元素内容高度(只读)
* scrollTop 获取或者设置元素的偏移值,常用于, 计算滚动条的位置, 当一个元素的容器没有产生垂直方向的滚动条, 那它的scrollTop的值默认为0.
......@@ -101,10 +125,33 @@ export default {
binding.value();
}
});
}
}
},
},
},
mounted() {
props: {
selectData: {
type: Array,
default () {
return [];
},
},
},
data () {
return {
selectLeftList: [],
selectRightList: [],
search: '',
total: 0,
searchValue: '',
pageSize: 20,
totalPage: 1,
currentPage: 1,
tableData: [],
showHeader: false,
popoverShow: false,
};
},
mounted () {
this.selectLeftList = this.selectData;
this.getRightList();
this.getList();
......@@ -113,18 +160,18 @@ export default {
/**
* 拉到底部加载更多
*/
loadmore() {
loadmore () {
if (this.currentPage < this.totalPage) {
this.currentPage += 1;
this.getList();
}
},
getList() {
let params = {
getList () {
const params = {
pageSize: this.pageSize,
currentPage: this.currentPage,
search: this.search,
isValid: 1
isValid: 1,
};
request.post('/api-integral-mall/page-pick-up-points', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -137,7 +184,7 @@ export default {
this.total = res.data.result.totalCount;
this.totalPage = res.data.result.totalPage;
if (this.selectLeftList.length) {
for (let item of this.selectLeftList) {
for (const item of this.selectLeftList) {
let obj;
obj = this.tableData.find(i => {
return i.integralMallPickUpPointId === item.integralMallPickUpPointId;
......@@ -152,19 +199,19 @@ export default {
}
});
},
getSearchList() {
getSearchList () {
this.currentPage = 1;
this.getList();
},
getSelectList(row) {
getSelectList (row) {
return row.integralMallPickUpPointId;
},
// 点击正一行选中
selectRow(row, event, column) {
selectRow (row, event, column) {
this.$refs.selectedTable.toggleRowSelection(row);
},
handleSelectionChange(val) {
for (let item of val) {
handleSelectionChange (val) {
for (const item of val) {
if (
!this.selectLeftList.find(i => {
return i.integralMallPickUpPointId === item.integralMallPickUpPointId;
......@@ -175,9 +222,9 @@ export default {
}
this.selectRightList = copy(this.selectLeftList);
},
selectable(row, index) {
selectable (row, index) {
let flag = true;
for (let item of this.selectLeftList) {
for (const item of this.selectLeftList) {
if (row.integralMallPickUpPointId == item.integralMallPickUpPointId) {
flag = false;
}
......@@ -185,18 +232,18 @@ export default {
return flag;
},
// 移除
removeItem(item, index) {
removeItem (item, index) {
this.selectRightList.splice(index, 1);
this.selectLeftList.splice(this.selectLeftList.findIndex(i => i.integralMallPickUpPointId === item.integralMallPickUpPointId), 1);
//取消表格选中数据
let obj = this.tableData.find(i => {
// 取消表格选中数据
const obj = this.tableData.find(i => {
return i.integralMallPickUpPointId === item.integralMallPickUpPointId;
});
this.$refs.selectedTable.toggleRowSelection(obj, false);
this.searchValue = '';
},
// 右侧搜索
getRightList() {
getRightList () {
var newData = this.selectLeftList.filter(item => {
if (item.pickUpPointName.indexOf(this.searchValue) > -1) {
return item;
......@@ -206,8 +253,8 @@ export default {
this.selectRightList = newData;
},
//确定提交
submit() {
// 确定提交
submit () {
if (this.selectLeftList.length < 1) {
this.$message.error('请至少选择一个自提点');
return false;
......@@ -223,14 +270,14 @@ export default {
this.$emit('getSelectList', this.selectLeftList);
this.popoverShow = false;
},
cancel() {
cancel () {
this.selectLeftList = [];
this.selectRightList = [];
this.$refs.selectedTable.clearSelection();
this.$emit('getSelectList', []);
this.popoverShow = false;
}
}
},
},
};
</script>
<style scoped>
......
......@@ -2,21 +2,31 @@
<div class="store-content">
<div class="left-content">
<el-select v-model="storeType" placeholder="请选择" @change="handleChange">
<el-option label="所有自提点" :value="0"></el-option>
<el-option label="门店分组" :value="2"></el-option>
<el-option label="门店区域" :value="1"></el-option>
<el-option label="部分自提点" :value="3"></el-option>
<el-option label="批量导入" :value="4"></el-option>
<el-option label="所有自提点" :value="0" />
<el-option label="门店分组" :value="2" />
<el-option label="门店区域" :value="1" />
<el-option label="部分自提点" :value="3" />
<el-option label="批量导入" :value="4" />
</el-select>
</div>
<div class="right-content">
<store-group v-if="storeType === 2" :selectData="selectData" @getSelectList="getSelectList"></store-group>
<store-area v-if="storeType === 1" :selectData="selectData" @getSelectList="getSelectList"></store-area>
<store-part v-if="storeType === 3" :selectData="selectData" @getSelectList="getSelectList"></store-part>
<store-group v-if="storeType === 2" :selectData="selectData" @getSelectList="getSelectList" />
<store-area v-if="storeType === 1" :selectData="selectData" @getSelectList="getSelectList" />
<store-part v-if="storeType === 3" :selectData="selectData" @getSelectList="getSelectList" />
<div v-if="storeType === 4">
<div class="upload-box">
<el-upload :action="action" :data="uploadData" with-credentials :before-upload="uploadFileBefore" :on-success="uploadFile" :show-file-list="showList" class="upload-content">
<el-button size="small" plain class="upload-btn"><i class="iconfont icon-shangchuan"></i>点击上传</el-button>
<el-upload
:action="action"
:data="uploadData"
with-credentials
:before-upload="uploadFileBefore"
:on-success="uploadFile"
:show-file-list="showList"
class="upload-content"
>
<el-button size="small" plain class="upload-btn">
<i class="iconfont icon-shangchuan" />点击上传
</el-button>
</el-upload>
<el-button type="text" class="download-btn" @click="downLoad">
点击下载模板
......@@ -24,20 +34,28 @@
<p>1.自提点code请至配送设置中导出;</p>
<p>2.仅支持.xlsx .xls文件的导入,文件大小不超过2M;</p>
<p>3.每个sheet数据最多可导入2000条,超出则导入失败,门店过多建议使用多张sheet填充;</p>
<el-button slot="reference" type="text" icon="iconfont icon-xinxixianshi"></el-button>
<el-button slot="reference" type="text" icon="iconfont icon-xinxixianshi" />
</el-popover>
</el-button>
</div>
<div class="upload-text" v-if="uploadNum + errorNum > 0">
<div v-if="isAdd">
本次共上传 {{ uploadNum + errorNum }} 个自提点,其中成功 <span class="file-num">{{ uploadNum }}</span
>个,失败 <span class="error-num"> {{ errorNum }} </span>个。
<el-button type="text" class="error-list" @click="dialogVisible = true" v-if="errorNum > 0">查看失败原因</el-button>
本次共上传 {{ uploadNum + errorNum }} 个自提点,其中成功 <span class="file-num">{{ uploadNum }}</span>个,失败 <span class="error-num"> {{ errorNum }} </span>个。
<el-button
type="text"
class="error-list"
@click="dialogVisible = true"
v-if="errorNum > 0"
>
查看失败原因
</el-button>
</div>
<div v-else>
本次共成功上传 {{ uploadNum }} 个自提点
</div>
<div v-else>本次共成功上传 {{ uploadNum }} 个自提点</div>
<div class="file-name">
<span>{{ uploadFileName }}</span>
<el-button type="text" icon="iconfont icon-xiazai" @click="downLoadFile"></el-button>
<el-button type="text" icon="iconfont icon-xiazai" @click="downLoadFile" />
</div>
</div>
</div>
......@@ -59,32 +77,37 @@ import storePart from './store-part';
// import request from '../../service/request.js';
// import qs from 'qs';
export default {
components: {
storeGroup,
storeArea,
storePart,
},
props: {
pickUpPointType: {
type: Number,
default() {
default () {
return 0;
}
},
},
selectData: {
type: Array,
default() {
default () {
return [];
}
},
},
isAdd: {
type: Boolean,
default() {
default () {
return true;
}
}
},
},
},
data() {
data () {
return {
action: window.location.origin + '/api-integral-mall/upload-pick-up-points',
// action: 'http://gicdev.demogic.com/api-integral-mall/upload-pick-up-points',
uploadData: {
requestProject: 'integral-mall'
requestProject: 'integral-mall',
},
showList: false,
uploadNum: 0,
......@@ -94,10 +117,10 @@ export default {
pickUpPointStr: '',
storeType: 0,
dialogVisible: false,
errorList: []
errorList: [],
};
},
mounted() {
mounted () {
this.storeType = this.pickUpPointType || 0;
if (this.storeType === 4) {
this.uploadNum = this.selectData.correctNumber;
......@@ -106,18 +129,18 @@ export default {
}
},
methods: {
//获取数据
getSelectList(arr) {
// 获取数据
getSelectList (arr) {
this.$emit('getArr', arr, this.storeType);
},
//下载模板
downLoad() {
let url = 'static/礼品自提点导入模版.xlsx';
// 下载模板
downLoad () {
const url = 'static/礼品自提点导入模版.xlsx';
window.open(url);
},
// 上传之前
uploadFileBefore(file) {
let fileType = file.name.split('.')[file.name.split('.').length - 1];
uploadFileBefore (file) {
const fileType = file.name.split('.')[file.name.split('.').length - 1];
if (fileType !== 'xlsx' && fileType !== 'xls') {
this.$message.error('文件格式错误,请导入.xlsx或.xls格式的文件');
return false;
......@@ -127,7 +150,7 @@ export default {
return false;
}
},
uploadFile(file, fileList) {
uploadFile (file, fileList) {
if (file.errorCode === 0) {
this.uploadFileName = file.result.picUploadResDTO.fileId;
this.uploadNum = file.result.orderErrorDTO.correctNumber;
......@@ -140,7 +163,7 @@ export default {
downloadUrl: this.downloadUrl,
fileId: this.uploadFileName,
pickUpPointStr: this.pickUpPointStr,
correctNumber: this.uploadNum
correctNumber: this.uploadNum,
};
this.$emit('getArr', obj, this.storeType);
......@@ -149,7 +172,7 @@ export default {
}
},
// 下载上传的文件
downLoadFile() {
downLoadFile () {
window.location.href = this.downloadUrl;
// let params = {
// projectCode: 'integral-mall'
......@@ -163,19 +186,14 @@ export default {
// }
// });
},
//门店类型切换
handleChange() {
// 门店类型切换
handleChange () {
this.selectData = [];
// if (this.storeType === 0 || this.storeType === 3) {
this.$emit('getArr', this.selectData, this.storeType);
// }
}
},
},
components: {
storeGroup,
storeArea,
storePart
}
};
</script>
<style scoped>
......
......@@ -21,10 +21,8 @@ static
<tinymce-edit ref="tinymceWrap" :bodyHtml="ruleForm.gradeDescribe" :projectName="projectName"></tinymce-edit>
import tinymceEdit from 'components/memberShip/tinymce-edit'
公共上传图片请求方法
/*
* method: 'post'
......@@ -47,7 +45,7 @@ export const postForm = (url, params) => {
-->
<template>
<div class="tinymce-contain">
<editor id="tinymce" v-model="tinymceHtml" :init="init"></editor>
<editor id="tinymce" v-model="tinymceHtml" :init="init" />
</div>
</template>
<script>
......@@ -67,9 +65,12 @@ import 'tinymce/plugins/wordcount';
import 'tinymce/plugins/colorpicker';
import 'tinymce/plugins/textcolor';
export default {
name: 'tinymce-edit',
name: 'TinymceEdit',
components: {
Editor,
},
props: ['bodyHtml', 'projectName'],
data() {
data () {
return {
tinymceHtml: '请输入内容',
init: {
......@@ -81,7 +82,7 @@ export default {
// without images_upload_url set, Upload tab won't show up
// images_upload_url: '',
// images_upload_base_path: '/some/basepath',
images_upload_credentials: true, //是否应传递cookie等跨域的凭据
images_upload_credentials: true, // 是否应传递cookie等跨域的凭据
// images_upload_handler提供三个参数:blobInfo, success, failure
images_upload_handler: (blobInfo, success, failure) => {
this.handleImgUpload(blobInfo, success, failure);
......@@ -95,23 +96,40 @@ export default {
fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
branding: false,
menubar: false,
setup: function(editor) {
setup: function (editor) {
// 点击编辑框回调
editor.on('click', function(e) {});
}
}
editor.on('click', function (e) {});
},
},
};
},
watch: {
projectName: function (newData, oldData) {
const that = this;
that.repProjectName = newData || 'gic-web';
},
bodyHtml: function (newData, oldData) {
const that = this;
that.tinymceHtml = newData;
},
},
mounted () {
const that = this;
tinymce.init({
fontsize_formats: '8px 10px 12px 14px 18px 24px 36px',
});
that.tinymceHtml = that.bodyHtml;
},
methods: {
// 上传图片
handleImgUpload(blobInfo, success, failure) {
handleImgUpload (blobInfo, success, failure) {
if (blobInfo.blob().size > 5 * 1024 * 1024) {
failure('请上传小于 5 M 文件');
return false;
}
var that = this;
let formdata = new FormData();
const that = this;
const formdata = new FormData();
formdata.set('upload_file', blobInfo.blob());
formdata.set('requestProject', that.repProjectName);
request
......@@ -122,28 +140,8 @@ export default {
.catch(res => {
failure('error');
});
}
},
watch: {
projectName: function(newData, oldData) {
var that = this;
that.repProjectName = newData || 'gic-web';
},
bodyHtml: function(newData, oldData) {
var that = this;
that.tinymceHtml = newData;
}
},
components: {
Editor
},
mounted() {
var that = this;
tinymce.init({
fontsize_formats: '8px 10px 12px 14px 18px 24px 36px'
});
that.tinymceHtml = that.bodyHtml;
}
};
</script>
<style scoped>
......
<template>
<el-dialog :title="编辑积分费用或现金费用" :visible.sync="dialogVisible" width="650px" @close="close">
<el-dialog
:title="编辑积分费用或现金费用"
:visible.sync="dialogVisible"
width="650px"
@close="close"
>
<div class="dialog-body">
<el-table :data="cardCostList" style="width: 100%" v-if="cardCostList.length > 1">
<el-table-column prop="proRefName" label="卡券名称"> </el-table-column>
<el-table-column prop="proRefName" label="卡券名称" />
<el-table-column prop="integralCost" label="积分">
<template slot-scope="scope">
<el-input-number v-model="scope.row.integralCost" :precision="0" :min="0" controls-position="right" @blur="handleIntegralCostTotal" @change="handleIntegralCostTotal"></el-input-number>
<el-input-number
v-model="scope.row.integralCost"
:precision="0"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</template>
</el-table-column>
<el-table-column prop="cashCost" label="现金">
<template slot-scope="scope">
<el-input-number v-model="scope.row.cashCost" :precision="2" :min="0" controls-position="right" @blur="handleIntegralCostTotal" @change="handleIntegralCostTotal"></el-input-number>
<el-input-number
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
@blur="handleIntegralCostTotal"
@change="handleIntegralCostTotal"
/>
</template>
</el-table-column>
</el-table>
<el-table :data="tableData" style="width: 100%;margin-top:20PX">
<el-table-column prop="proName" label="券包名称"> </el-table-column>
<el-table-column prop="proName" label="券包名称" />
<el-table-column prop="integralCost" label="积分">
<template slot-scope="scope">
<el-input-number :disabled="cardCostList.length > 1" v-model="scope.row.integralCost" :precision="0" :min="0" controls-position="right"></el-input-number>
<el-input-number
:disabled="cardCostList.length > 1"
v-model="scope.row.integralCost"
:precision="0"
:min="0"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column prop="cashCost" label="现金">
<template slot-scope="scope">
<el-input-number :disabled="cardCostList.length > 1" v-model="scope.row.cashCost" :precision="2" :min="0" controls-position="right"></el-input-number>
<el-input-number
:disabled="cardCostList.length > 1"
v-model="scope.row.cashCost"
:precision="2"
:min="0"
controls-position="right"
/>
</template>
</el-table-column>
</el-table>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="close">取 消</el-button>
<el-button @click="submit">确 定</el-button>
<el-button @click="close">
取 消
</el-button>
<el-button @click="submit">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -42,25 +77,25 @@ export default {
props: {
packageData: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
dialogVisible: true,
cardCostList: [],
tableData: []
tableData: [],
};
},
created() {
created () {
this.getList();
},
methods: {
getList() {
let params = {
integralMallProId: this.packageData.integralMallProId
getList () {
const params = {
integralMallProId: this.packageData.integralMallProId,
};
this.loading = true;
request.post('/api-integral-mall/coupon-package-show', qs.stringify(params)).then(res => {
......@@ -71,7 +106,7 @@ export default {
proRefId: this.packageData.integralMallProId,
integralCost: res.data.result.integralCost,
cashCost: res.data.result.cashCost,
proName: res.data.result.proName
proName: res.data.result.proName,
});
} else {
this.$message.error(res.data.message);
......@@ -79,10 +114,10 @@ export default {
});
},
// 券包积分计算
handleIntegralCostTotal() {
handleIntegralCostTotal () {
let total = 0;
let totalCash = 0;
for (let item of this.cardCostList) {
for (const item of this.cardCostList) {
if (item.integralCost) {
total = total + Number(item.integralCost);
} else {
......@@ -97,9 +132,9 @@ export default {
this.tableData[0].integralCost = total;
this.tableData[0].cashCost = totalCash;
},
submit() {
submit () {
if (this.cardCostList.length > 1) {
for (let item of this.cardCostList) {
for (const item of this.cardCostList) {
if (item.cashCost === undefined || item.integralCost === undefined) {
this.$message.error('卡券积分或现金不能为空');
return false;
......@@ -110,12 +145,12 @@ export default {
this.$message.error('卡券积分或现金不能为空');
return false;
}
let params = {
const params = {
integralMallProId: this.packageData.integralMallProId,
cardCostList: this.cardCostList,
proName: this.tableData[0].proName,
integralCost: this.tableData[0].integralCost,
cashCost: this.tableData[0].cashCost
cashCost: this.tableData[0].cashCost,
};
request.post('/api-integral-mall/update-coupon-package-price', params).then(res => {
if (res.data.errorCode === 0) {
......@@ -126,10 +161,10 @@ export default {
}
});
},
close() {
close () {
this.$emit('closePackage');
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog title="商品链接" :visible.sync="dialogVisible" width="800px" @close="cancel()">
<el-dialog
title="商品链接"
:visible.sync="dialogVisible"
width="800px"
@close="cancel()"
>
<div class="dialog-body">
<el-table :data="goodsSkuList" :span-method="objectSpanMethod" border>
<el-table-column width="140px" v-for="(i, k) in skuCols" :label="i" :key="k" :class-name="k == skuCols.length - 1 ? 'pad-l-20' : 'right-border'">
<template slot-scope="scope">{{ scope.row.activitySkuList[k].valueName }}</template>
<el-table-column
width="140px"
v-for="(i, k) in skuCols"
:label="i"
:key="k"
:class-name="k == skuCols.length - 1 ? 'pad-l-20' : 'right-border'"
>
<template slot-scope="scope">
{{ scope.row.activitySkuList[k].valueName }}
</template>
</el-table-column>
<el-table-column label="当前商品库存" width="130px">
<template slot-scope="scope">
......@@ -13,16 +26,28 @@
<el-table-column label="活动库存">
<template slot-scope="scope">
<el-select v-model="scope.row.stockType" style="width:100px">
<el-option label="增加" :value="1"></el-option>
<el-option label="增加" :value="1" />
<!-- <el-option label="减少" :value="0"></el-option> -->
</el-select>
<el-input-number v-model="scope.row.stageStock" style="margin-left:-5px;width:140px" controls-position="right" @blur="changeSingleStock(scope.row.integralMallProId, scope.row.stageStock, scope.row.stockType)" precision="0" :min="0" :max="scope.row.commonStock"></el-input-number>
<el-input-number
v-model="scope.row.stageStock"
style="margin-left:-5px;width:140px"
controls-position="right"
@blur="changeSingleStock(scope.row.integralMallProId, scope.row.stageStock, scope.row.stockType)"
precision="0"
:min="0"
:max="scope.row.commonStock"
/>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 20px;text-align:right">
<el-button type="default" @click="cancel">取消</el-button>
<el-button type="primary" @click="submit">确认</el-button>
<el-button type="default" @click="cancel">
取消
</el-button>
<el-button type="primary" @click="submit">
确认
</el-button>
</div>
</div>
</el-dialog>
......@@ -36,34 +61,34 @@ import copy from '../utils/clone.js';
export default {
props: {
skuStockData: {
type: Object
}
type: Object,
},
},
data() {
data () {
return {
dialogVisible: false,
skuCols: [],
goodsSkuList: [],
activityProId: ''
activityProId: '',
};
},
created() {
created () {
this.dialogVisible = true;
this.handelSkuData(this.skuStockData);
this.goodsSkuList = copy(this.skuStockData.children);
this.handleGoodsSkuList(this.goodsSkuList);
},
methods: {
handelSkuData(value) {
handelSkuData (value) {
// let arr = [];
this.skuCols = [];
/** ****组合sku的数据*****/
for (let item of this.skuStockData.children[0].activitySkuList) {
for (const item of this.skuStockData.children[0].activitySkuList) {
this.skuCols.push(item.proName);
}
console.log(this.skuCols);
},
handleGoodsSkuList(value) {
handleGoodsSkuList (value) {
value.forEach(item => {
// item.stockType = 1;
// item.stageStock = '';
......@@ -71,20 +96,20 @@ export default {
this.$set(item, 'stageStock', 0);
});
},
changeSingleStock(id, stageStock, stockType) {
changeSingleStock (id, stageStock, stockType) {
console.log(id, stageStock, stockType);
},
submit() {
let list = [];
submit () {
const list = [];
this.goodsSkuList.forEach(item => {
list.push({
activityProId: item.activityProId,
stockChange: item.stageStock,
changeType: 1
changeType: 1,
});
});
let params = {
data: JSON.stringify(list)
const params = {
data: JSON.stringify(list),
};
request.post('/api-integral-mall/update-activity-stock', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -95,7 +120,7 @@ export default {
}, 10);
} else if (res.data.errorCode === 2500) {
// this.goodsSkuList
let errorMessage = res.data.result;
const errorMessage = res.data.result;
errorMessage.forEach(item => {
if (item.isSku) {
this.goodsSkuList.forEach(itt1 => {
......@@ -113,11 +138,11 @@ export default {
}
});
},
combine(arr) {
combine (arr) {
arr.reverse();
let r = [];
const r = [];
(function f(t, a, n) {
(function f (t, a, n) {
if (n == 0) return r.push(t);
for (let i = 0; i < a[n - 1].length; i++) {
f(t.concat(a[n - 1][i]), a, n - 1);
......@@ -126,13 +151,13 @@ export default {
// var t = r;
return r; // r是排列组合后的数据与
},
cancel() {
cancel () {
this.dialogVisible = false;
setInterval(() => {
this.$emit('closeSkuStock');
}, 10);
}
}
},
},
};
</script>
<style scoped>
......
......@@ -7,6 +7,6 @@ Vue.use(Vuex);
export default new Vuex.Store({
modules: {
product
}
product,
},
});
......@@ -4,7 +4,7 @@ const state = {
cartData: [],
total: 0,
canUseMenuUrl: [],
erpGoodsFlag: 0
erpGoodsFlag: 0,
};
// getters
......@@ -17,58 +17,58 @@ const getters = {
total: state => {
state.total = 0;
for (let item of state.cartData) {
for (const item of state.cartData) {
state.total += item.price;
}
return state.total;
}
},
};
// actions
const actions = {
setAll({ commit }, data) {
setAll ({ commit }, data) {
commit('mutations_setAll', data);
},
setCartData({ commit }, item) {
setCartData ({ commit }, item) {
commit('mutations_CartData', item);
},
removecartData({ commit }, item) {
removecartData ({ commit }, item) {
commit('mutations_removeCartData', item);
}
},
};
// mutations
const mutations = {
mutations_setAll(state, num) {
mutations_setAll (state, num) {
state.all = num;
},
mutations_CartData(state, item) {
mutations_CartData (state, item) {
state.cartData.push(item);
},
mutations_removeCartData(state, item) {
for (let i in state.cartData) {
mutations_removeCartData (state, item) {
for (const i in state.cartData) {
if (state.cartData[i].id === item.id) {
state.cartData.splice(i, 1);
}
}
},
// 更新可用菜单可用url
mutations_updateMenuUrl(state, url) {
mutations_updateMenuUrl (state, url) {
state.canUseMenuUrl = url;
},
// 更新erp商品兑换接口开关
mutations_erpGoodsFlag(state, val) {
mutations_erpGoodsFlag (state, val) {
state.erpGoodsFlag = val;
}
},
};
export default {
state,
getters,
actions,
mutations
mutations,
};
......@@ -4,7 +4,7 @@ export const alertInfo = () => {
Notification({
title: '温馨提示',
type: 'warning',
message: '在此页面进行修改、删除等操作将更改本商户下所有的配置 请谨慎进行'
message: '在此页面进行修改、删除等操作将更改本商户下所有的配置 请谨慎进行',
});
};
......@@ -12,7 +12,7 @@ export const confirmInfo = (fn, type) => {
MessageBox.confirm(' 在此页面进行修改、删除等操作将更改本商户下所有的配置 是否确认修改!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
type: 'warning',
})
.then(() => {
fn(type);
......
......@@ -333,13 +333,16 @@
<el-button type="text" v-if="scope.row.canEdit">删除</el-button>
</dm-delete> -->
<el-dropdown
v-if="(scope.row.isDifferentialPricing || scope.row.canEdit)&& ($getButtonLimit($buttonCode.couponTieredPricing)|| $getButtonLimit($buttonCode.couponDelete))"
v-if="(scope.row.isDifferentialPricing || scope.row.canEdit)&& ($getButtonLimit($buttonCode.couponTieredPricing)|| $getButtonLimit($buttonCode.couponDelete) || $getButtonLimit($buttonCode.couponDetail))"
style="margin-left:20px;"
@command="command => handleCommand(command, scope.row, scope.$index)"
placement="bottom-start"
>
<span class="el-dropdown-link" style="color:#1890ff;cursor: pointer;"> <i class="el-icon-more" /> </span>
<el-dropdown-menu slot="dropdown" style="width:110px;">
<el-dropdown-item command="0" v-if="$getButtonLimit($buttonCode.couponDetail)" :limit-code="$buttonCode.couponDetail">
查看详情
</el-dropdown-item>
<el-dropdown-item command="1" v-if="$getButtonLimit($buttonCode.couponConversion)" :limit-code="$buttonCode.couponConversion">
查看订单
</el-dropdown-item>
......@@ -588,7 +591,9 @@ export default {
});
},
handleCommand (command, item, index) {
if (command == 1) {
if (command == 0) {
this.goAdd(item, 'detail');
} else if (command == 1) {
this.goRecord(item);
} else if (command == 2) {
this.ladderList(item);
......@@ -820,7 +825,7 @@ export default {
this.$router.push({ name: 'couponAdd', query: { giftId: '-1', coupCardId: '-1', canEdit: true } });
},
// 编辑
goAdd (item) {
goAdd (item, type) {
this.couponListObj = {
currentPage: this.currentPage,
pageSize: this.pageSize,
......@@ -831,7 +836,7 @@ export default {
sortColumn: this.sortColumn,
};
window.localStorage.setItem('couponListObj', JSON.stringify(this.couponListObj));
this.$router.push({ name: 'couponInfo', query: { giftId: item.integralMallProId, coupCardId: item.proReferId, canEdit: item.canEdit } });
this.$router.push({ name: 'couponInfo', query: { giftId: item.integralMallProId, coupCardId: item.proReferId, canEdit: item.canEdit, isDetail: type === 'detail' ? 1 : 0 } });
},
// 编辑序号
editNumber (item) {
......
......@@ -577,7 +577,7 @@
type="primary"
size="small"
@click="submitForm('couponForm')"
:disabled="!canEdit"
:disabled="!canEdit||isDetail==1"
>
保存
</el-button>
......@@ -766,6 +766,7 @@ export default {
return time.getTime() < Date.now() - 24 * 3600 * 1000;
},
},
isDetail: null,
};
},
mounted () {
......@@ -782,6 +783,7 @@ export default {
this.getSelectGroupData(val);
this.mallProId = this.$route.query.giftId;
this.canEdit = Boolean(this.$route.query.canEdit);
this.isDetail = Number(this.$route.query.isDetail);
this.coupCardId = this.$route.query.coupCardId;
// if (this.mallProId !== '-1') {
......
<template>
<div class="mall-section-container">
<pickUp-store :pickUpPointType="pickUpPointType" :selectData="selectData" @getArr="getArr"></pickUp-store>
<pickUp-store :pickUpPointType="pickUpPointType" :selectData="selectData" @getArr="getArr" />
</div>
</template>
<script>
import pickUpStore from '../../../components/store/store';
export default {
data() {
components: {
pickUpStore,
},
data () {
return {
pickUpPointType: 0,
selectData: []
selectData: [],
// 门店区域数据测试
// selectData: [
// {
......@@ -48,12 +51,9 @@ export default {
},
methods: {
//调用获取数据
getArr(arr, type) {}
// 调用获取数据
getArr (arr, type) {},
},
components: {
pickUpStore
}
};
</script>
<style scoped>
......
<template>
<div>
<el-dialog title="券码" :visible.sync="couponListModal.dialogVisible" width="660px" @close="closeList">
<el-dialog
title="券码"
:visible.sync="couponListModal.dialogVisible"
width="660px"
@close="closeList"
>
<div>
<div class="coupon-search">
<el-input v-model="searchValue" placeholder="请输入卡号/卡密券码" prefix-icon="el-icon-search" clearable @keyup.enter.native="getSearchList" @clear="getSearchList"> </el-input>
<el-input
v-model="searchValue"
placeholder="请输入卡号/卡密券码"
prefix-icon="el-icon-search"
clearable
@keyup.enter.native="getSearchList"
@clear="getSearchList"
/>
</div>
<el-table :data="couponListModal.tableDate" style="width: 100%;" height="500">
<el-table-column prop="cardNumber" label="卡号" width="200px;">
<template slot-scope="scope">
<p style="line-height:16px">{{ scope.row.cardNumber ? scope.row.cardNumber : '--' }}</p>
<p style="line-height:16px">
{{ scope.row.cardNumber ? scope.row.cardNumber : '--' }}
</p>
</template>
</el-table-column>
<el-table-column prop="cardPassWord" label="卡密/券码" width="160px;">
<template slot-scope="scope">
<p style="line-height:16px">{{ scope.row.cardPassWord ? scope.row.cardPassWord : '--' }}</p>
<p style="line-height:16px">
{{ scope.row.cardPassWord ? scope.row.cardPassWord : '--' }}
</p>
</template>
</el-table-column>
<el-table-column prop="status" label="兑换状态" width="120px;">
<template slot-scope="scope">
<p class="intergral-edit">{{ scope.row.status === 1 ? '未兑换' : '已兑换' }}</p>
<p class="intergral-edit">
{{ scope.row.status === 1 ? '未兑换' : '已兑换' }}
</p>
</template>
</el-table-column>
<el-table-column label="操作" width="140px;">
<template slot-scope="scope">
<div :key="scope.row.giftCardId">
<el-popover placement="top" width="160" v-model="scope.row.visible2">
<p style="line-height:1.5;padding: 10px 10px 20px;">确定删除该券码吗?</p>
<p style="line-height:1.5;padding: 10px 10px 20px;">
确定删除该券码吗?
</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.visible2 = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, scope.$index)">确定</el-button>
<el-button size="mini" type="text" @click="scope.row.visible2 = false">
取消
</el-button>
<el-button type="primary" size="mini" @click="deleteList(scope.row, scope.$index)">
确定
</el-button>
</div>
<el-button slot="reference" type="text" v-if="scope.row.status === 1">删除</el-button>
<el-button slot="reference" type="text" v-if="scope.row.status === 1">
删除
</el-button>
</el-popover>
</div>
</template>
......@@ -38,14 +64,21 @@
<template slot="empty">
<div class="no-data-wrap">
<div class="no-data-icon">
<img src="../../../../static/img/no-data_icon.png" />
<img src="../../../../static/img/no-data_icon.png">
</div>
<p>暂无数据</p>
</div>
</template>
</el-table>
<div style="margin:15px 0;text-align:right" v-if="couponListModal.tableDate.length > 0">
<dm-pagination :page-size="10" :pager-count="5" @current-change="handleCurrentChange" layout="prev, pager, next" :current-page="couponCurrentPage" :total="couponListModal.total"> </dm-pagination>
<dm-pagination
:page-size="10"
:pager-count="5"
@current-change="handleCurrentChange"
layout="prev, pager, next"
:current-page="couponCurrentPage"
:total="couponListModal.total"
/>
</div>
</div>
</el-dialog>
......@@ -55,33 +88,34 @@
import qs from 'qs';
import request from '../../../service/request.js';
export default {
components: {},
props: {
couponListModal: {
type: Object
}
type: Object,
},
},
data() {
data () {
return {
dialogVisible: true,
searchValue: '',
couponCurrentPage: 1
couponCurrentPage: 1,
};
},
methods: {
//搜索
getSearchList() {
// 搜索
getSearchList () {
this.couponCurrentPage = 1;
this.$emit('getChildSearch', this.searchValue, this.couponListModal.integralMallProId, this.couponCurrentPage);
},
//设置页码
handleCurrentChange(val) {
// 设置页码
handleCurrentChange (val) {
this.couponCurrentPage = val;
this.$emit('getChildSearch', this.searchValue, this.couponListModal.integralMallProId, this.couponCurrentPage);
},
//删除
deleteList(item, index) {
let params = {
giftCardId: item.giftCardId
// 删除
deleteList (item, index) {
const params = {
giftCardId: item.giftCardId,
};
request.post('/api-integral-mall/delete-giftcard', qs.stringify(params)).then(res => {
if (res.data.errorCode === 0) {
......@@ -99,14 +133,13 @@ export default {
}
});
},
closeList() {
closeList () {
this.couponCurrentPage = 1;
this.searchValue = '';
this.$emit('getClose', this.couponCurrentPage, this.searchValue);
// this.$emit('getChildSearch', this.searchValue, this.couponListModal.integralMallProId, this.couponCurrentPage);
}
},
},
components: {}
};
</script>
<style scoped>
......
......@@ -361,6 +361,9 @@
>
<span class="el-dropdown-link" style="color:#1890ff;cursor: pointer;"> <i class="el-icon-more" /> </span>
<el-dropdown-menu slot="dropdown" style="width:110px;">
<el-dropdown-item command="0" v-if="$getButtonLimit($buttonCode.giftDetail)" :limit-code="$buttonCode.giftDetail">
查看详情
</el-dropdown-item>
<el-dropdown-item command="1" v-if="$getButtonLimit($buttonCode.giftConversion)" :limit-code="$buttonCode.giftConversion">
查看订单
</el-dropdown-item>
......@@ -605,7 +608,9 @@ export default {
this.stockDialog = false;
},
handleCommand (command, item, index) {
if (command == 1) {
if (command == 0) {
this.goAdd(item, 'detail');
} else if (command == 1) {
this.goRecord(item);
} else if (command == 2) {
this.getCouponList(item.integralMallProId);
......@@ -876,7 +881,7 @@ export default {
this.addModalData.dialogVisible = true;
},
// 编辑
goAdd (item) {
goAdd (item, type) {
this.giftListObj = {
currentPage: this.currentPage,
pageSize: this.pageSize,
......@@ -889,7 +894,7 @@ export default {
sortColumn: this.sortColumn,
};
window.localStorage.setItem('giftListObj', JSON.stringify(this.giftListObj));
this.$router.push({ name: 'giftInfo', query: { type: item.giftType, giftId: item.integralMallProId, proReferId: item.proReferId, canEdit: item.canEdit } });
this.$router.push({ name: 'giftInfo', query: { type: item.giftType, giftId: item.integralMallProId, proReferId: item.proReferId, isDetail: type === 'detail' ? 1 : 0 } });
},
// 编辑序号
editNumber (item) {
......
<template>
<div>
<el-dialog title="批量导入文本券码" :visible.sync="importCouponModal.dialogVisible" width="620px">
<el-form :model="dialogForm" label-position="right" label-width="80px" v-loading="loading">
<el-form
:model="dialogForm"
label-position="right"
label-width="80px"
v-loading="loading"
>
<el-form-item label="选择文件" required>
<div>
<div class="upload-btn">
<el-upload class="upload-ele" :action="action" :headers="headersUpload" :before-upload="uploadFileBefore" :on-success="uploadFile" with-credentials :show-file-list="showList" :data="uploadData">
<el-button size="small"><i class="el-icon-upload2" style="margin-right:5px"></i>点击上传</el-button>
<el-upload
class="upload-ele"
:action="action"
:headers="headersUpload"
:before-upload="uploadFileBefore"
:on-success="uploadFile"
with-credentials
:show-file-list="showList"
:data="uploadData"
>
<el-button size="small">
<i class="el-icon-upload2" style="margin-right:5px" />点击上传
</el-button>
</el-upload>
</div>
<el-button type="info" plain @click="downloadFile">下载EXCEL模板</el-button>
<el-button type="info" plain @click="downloadFile">
下载EXCEL模板
</el-button>
</div>
<p class="import-info" v-show="importMess">
本次共导入&nbsp;<span style="font-weight:600">{{ errornumber + correctNumber }}</span
>&nbsp;个券码,其中成功&nbsp;<span style="font-weight:600">{{ correctNumber }}</span
>&nbsp;个,失败&nbsp;<span style="color:#f5222d">{{ errornumber }}</span
>&nbsp;<a href="javaScript:void(0)" v-show="errornumber > 0" style="margin-left:10px" @click="showInfo">查看失败原因</a>
本次共导入&nbsp;<span style="font-weight:600">{{ errornumber + correctNumber }}</span>&nbsp;个券码,其中成功&nbsp;<span style="font-weight:600">{{ correctNumber }}</span>&nbsp;个,失败&nbsp;<span style="color:#f5222d">{{ errornumber }}</span>&nbsp;<a
href="javaScript:void(0)"
v-show="errornumber > 0"
style="margin-left:10px"
@click="showInfo"
>查看失败原因</a>
</p>
</el-form-item>
<el-form-item label="导入规则">
<div class="line"></div>
<div class="line" />
<div class="upload-rules">
<p>1. 每个sheet表最多1000条信息,文件大小不超过2M</p>
<p>2. 卡号可不填写,卡密/券码必填</p>
......@@ -28,7 +48,7 @@
</el-form-item>
</el-form>
</el-dialog>
<errorList :importInfo="importInfo"></errorList>
<errorList :importInfo="importInfo" />
</div>
</template>
......@@ -37,18 +57,18 @@ import errorList from '../../order/errorList';
export default {
props: {
importCouponModal: {
type: Object
}
type: Object,
},
},
data() {
data () {
return {
action: window.location.origin + '/api-integral-mall/upload-gift-card?requestProject=intergral-mall',
// action: 'http://gicdev.demogic.com/api-integral-mall/upload-gift-card?requestProject=intergral-mall',
headersUpload: {
sign: ''
sign: '',
},
uploadData: {
integralMallProId: ''
integralMallProId: '',
},
dialogForm: {},
errorList: [],
......@@ -56,21 +76,21 @@ export default {
correctNumber: 0,
errornumber: 0,
importInfo: {
//失败原因列表
// 失败原因列表
dialogVisible: false,
list: []
list: [],
},
importMess: false
importMess: false,
};
},
methods: {
//下载模板
downloadFile() {
let url = 'static/文本券码导入模板.xlsx';
// 下载模板
downloadFile () {
const url = 'static/文本券码导入模板.xlsx';
window.open(url);
},
//上传之前
uploadFileBefore(file) {
// 上传之前
uploadFileBefore (file) {
const isXlsx = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
/*eslint-disable*/
console.log(file);
......
<template>
<div class="content" ref="scroll" id="switchModule">
<div class="section">
<div class="box1 d_jump">1</div>
<div class="box2 d_jump">2</div>
<div class="box3 d_jump">3</div>
<div class="box4 d_jump">4</div>
<div class="box5 d_jump">5</div>
<div class="box6 d_jump">6</div>
<div class="box1 d_jump">
1
</div>
<div class="box2 d_jump">
2
</div>
<div class="box3 d_jump">
3
</div>
<div class="box4 d_jump">
4
</div>
<div class="box5 d_jump">
5
</div>
<div class="box6 d_jump">
6
</div>
</div>
<div class="fix">
<p @click="jump('1')">1</p>
<p @click="jump('2')">2</p>
<p @click="jump('3')">3</p>
<p @click="jump('4')">4</p>
<p @click="jump('5')">5</p>
<p @click="jump('6')">6</p>
<p @click="jump('1')">
1
</p>
<p @click="jump('2')">
2
</p>
<p @click="jump('3')">
3
</p>
<p @click="jump('4')">
4
</p>
<p @click="jump('5')">
5
</p>
<p @click="jump('6')">
6
</p>
</div>
</div>
</template>
......@@ -24,25 +48,26 @@
// import getInputVal from '../../../utils/common.js';
export default {
data() {
components: {},
data () {
return {};
},
mounted: function() {
this.$nextTick(function() {
mounted: function () {
this.$nextTick(function () {
window.addEventListener('scroll', this.onScroll, true);
});
},
methods: {
onScroll() {
let scroll = document.documentElement.scrollTop || document.body.scrollTop;
onScroll () {
const scroll = document.documentElement.scrollTop || document.body.scrollTop;
},
jump(num) {
let index = Number(num);
jump (num) {
const index = Number(num);
// 用 class="d_jump" 添加锚点
let jump = document.querySelectorAll('.d_jump');
const jump = document.querySelectorAll('.d_jump');
let total = jump[index - 1].offsetTop;
const total = jump[index - 1].offsetTop;
let distance = document.documentElement.scrollTop || document.body.scrollTop;
// let distance = 200;
......@@ -52,11 +77,11 @@ export default {
if (total > distance) {
smoothDown();
} else {
let newTotal = distance - total;
const newTotal = distance - total;
step = newTotal / 50;
smoothUp();
}
function smoothDown() {
function smoothDown () {
if (distance < total) {
distance += step;
document.body.scrollTop = distance;
......@@ -67,7 +92,7 @@ export default {
document.documentElement.scrollTop = total - 64;
}
}
function smoothUp() {
function smoothUp () {
if (distance > total) {
distance -= step;
document.body.scrollTop = distance;
......@@ -78,9 +103,8 @@ export default {
document.documentElement.scrollTop = total - 64;
}
}
}
},
},
components: {}
};
</script>
<style scoped>
......
......@@ -17,14 +17,24 @@
<div class="section">
<div style="margin-bottom:22px">
<div class="infoTips">
<div class="infoTipsTitle"><i class="el-icon-info" style="color:#1890FF" /> 温馨提示</div>
<div class="infoTipsTitle">
<i class="el-icon-info" style="color:#1890FF" /> 温馨提示
</div>
<div class="infoTipsContent">
<p>1.使用该功能请在常规设置中关闭“无库存自动下架”的设置项;</p>
<p>2.若礼品增加库存后将清空之前的统计数;</p>
</div>
</div>
<div>
<el-input v-model="query.search" placeholder="请输入礼品名称/编码进行搜索" prefix-icon="el-icon-search" clearable class="w-280" @change="getSearchList('1')" @clear="getSearchList('1')"></el-input>
<el-input
v-model="query.search"
placeholder="请输入礼品名称/编码进行搜索"
prefix-icon="el-icon-search"
clearable
class="w-280"
@change="getSearchList('1')"
@clear="getSearchList('1')"
/>
</div>
</div>
<div v-loading="loading">
......@@ -32,18 +42,29 @@
<el-table-column label="礼品">
<template slot-scope="{ row }">
<div class="gift-info">
<img :src="row.giftProImageUrl" style="margin-right:10px" alt />
<img :src="row.giftProImageUrl" style="margin-right:10px" alt>
<div class="info-name">
<p class="pro-ellipsis">{{ row.giftProName }}</p>
<p class="category-ellipsis">编码:{{ row.giftProCode }}</p>
<p class="pro-ellipsis">
{{ row.giftProName }}
</p>
<p class="category-ellipsis">
编码:{{ row.giftProCode }}
</p>
</div>
</div>
</template>
</el-table-column>
<el-table-column label="统计开始时间">
<template slot-scope="{ row }">{{ formatDate(row.createTime) }}</template>
<template slot-scope="{ row }">
{{ formatDate(row.createTime) }}
</template>
</el-table-column>
<el-table-column label="当前人数" prop="giftCount" sortable="custom" :render-header="renderHeader">
<el-table-column
label="当前人数"
prop="giftCount"
sortable="custom"
:render-header="renderHeader"
>
<template slot-scope="{ row }">
<!-- <span @click="removeMutil(row)">{{ row.count }}</span> -->
<span>{{ row.giftCount }}</span>
......@@ -51,14 +72,16 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="{ row }">
<el-button v-if="row.hasSku" type="text" @click="checkDistribution(row)">查看分布</el-button>
<el-button v-if="row.hasSku" type="text" @click="checkDistribution(row)">
查看分布
</el-button>
<span v-else>--</span>
</template>
</el-table-column>
<template slot="empty">
<div class="no-data-wrap">
<div class="no-data-icon">
<img src="../../../../static/img/no-data_icon.png" />
<img src="../../../../static/img/no-data_icon.png">
</div>
<p>暂无数据</p>
</div>
......@@ -66,7 +89,17 @@
</el-table>
<div class="pagination-conteiner" v-show="tableData.length > 0">
<div class="pagination">
<dm-pagination v-if="total != 0" background @size-change="getSearchList('1')" @current-change="getSearchList" :current-page="query.currentPage" :page-sizes="pageSizes" :page-size="query.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
<dm-pagination
v-if="total != 0"
background
@size-change="getSearchList('1')"
@current-change="getSearchList"
:current-page="query.currentPage"
:page-sizes="pageSizes"
:page-size="query.pageSize"
layout="total, sizes, prev, pager, next"
:total="total"
/>
</div>
</div>
</div>
......@@ -74,7 +107,12 @@
<el-dialog title="查看分布" :visible.sync="dialogVisible" width="40%">
<div v-loading="dialogLoading">
<el-table :data="DistributionData" style="width: 100%" @sort-change="sortChange2">
<el-table-column :label="item" v-for="(item, index) in columns" :key="index" :prop="columns[index]">
<el-table-column
:label="item"
v-for="(item, index) in columns"
:key="index"
:prop="columns[index]"
>
<!-- <template slot-scope="{ row }">{{ row }}</template> -->
</el-table-column>
<!-- <el-table-column label="尺码"></el-table-column>
......@@ -82,14 +120,16 @@
<template slot="empty">
<div class="no-data-wrap">
<div class="no-data-icon">
<img src="../../../../static/img/no-data_icon.png" />
<img src="../../../../static/img/no-data_icon.png">
</div>
<p>暂无数据</p>
</div>
</template>
</el-table>
<div slot="footer" style="text-align:right;margin-top:10px">
<el-button type="primary" @click="dialogVisible = false">关闭</el-button>
<el-button type="primary" @click="dialogVisible = false">
关闭
</el-button>
</div>
</div>
</el-dialog>
......@@ -102,7 +142,7 @@
import request from '../../../service/request.js';
import getInputVal from '../../../utils/common.js';
export default {
data() {
data () {
return {
formatDate: getInputVal.formatDate,
loading: false,
......@@ -111,34 +151,34 @@ export default {
search: '',
pageSize: 20,
currentPage: 1,
sort: ''
sort: '',
},
pageSizes: '',
total: '',
tableData: [],
dialogVisible: false,
DistributionData: [],
columns: []
columns: [],
};
},
created() {
created () {
this.getSearchList();
},
methods: {
renderHeader(h, { column, $index }, index) {
renderHeader (h, { column, $index }, index) {
return h('span', {}, [h('span', {}, '当前人数'), h('el-popover', { props: { placement: 'top-start', width: '200', trigger: 'hover', content: '订阅成功次数将会根据会员去重。' } }, [h('i', { slot: 'reference', class: 'iconfont icon-xinxixianshi', style: 'margin-left:6px' }, '')])]);
},
getSearchList(value) {
getSearchList (value) {
if (value) {
this.query.currentPage = 1;
}
let params = {
...this.query
const params = {
...this.query,
};
this.loading = true;
request.get('/api-integral-mall/get-subscribe-page', { params }).then(res => {
if (res.data.errorCode === 0) {
let resResult = res.data.result;
const resResult = res.data.result;
this.tableData = resResult.result;
this.total = resResult.totalCount;
this.pageSizes = resResult.totalPage;
......@@ -149,11 +189,11 @@ export default {
}
});
},
checkDistribution(value) {
checkDistribution (value) {
console.log(value);
this.dialogVisible = true;
let params = {
giftProId: value.giftProId
const params = {
giftProId: value.giftProId,
};
this.dialogLoading = true;
request
......@@ -179,7 +219,7 @@ export default {
// }
// });
// },
sortChange(value) {
sortChange (value) {
// this.sortColumn = value.prop;
if (value.order == 'ascending') {
this.query.sort = 'asc';
......@@ -187,8 +227,8 @@ export default {
this.query.sort = 'desc';
}
this.getSearchList();
}
}
},
},
// components: {}
};
</script>
......
<template>
<div class="container">
<vue-gic-header :projectName="projectName" :collapseFlag="collapseFlag" @collapseTag="collapseTag" @toRouterView="toRouterView"></vue-gic-header>
<vue-gic-header
:projectName="projectName"
:collapseFlag="collapseFlag"
@collapseTag="collapseTag"
@toRouterView="toRouterView"
/>
<div class="mall-content-container">
<div class="left-menu">
<vue-gic-aside-menu ref="leftmenu" :projectName="projectName" :leftModulesName="leftModulesName" :collapseFlag="collapseFlag" style="display:inline-block;height:100%"></vue-gic-aside-menu>
<vue-gic-aside-menu
ref="leftmenu"
:projectName="projectName"
:leftModulesName="leftModulesName"
:collapseFlag="collapseFlag"
style="display:inline-block;height:100%"
/>
</div>
<div class="goods-manege-content" :style="{ marginLeft: widthData }">
<div :style="{ minHeight: mallHeight + 'px' }">
<router-view></router-view>
<router-view />
</div>
<!-- 右侧页面部分 end-->
<!-- <vue-gic-footer></vue-gic-footer> -->
......@@ -18,7 +29,8 @@
<script>
import bus from '../assets/eventBus.js';
export default {
data() {
components: {},
data () {
return {
mallHeight: document.documentElement.clientHeight - 64,
widthData: '200px',
......@@ -26,12 +38,13 @@ export default {
menuRouter: [], // 路由菜单
leftMenuRouter: [],
leftModulesName: '积分商城',
projectName: 'integral-mall'
projectName: 'integral-mall',
};
},
mounted() {
var that = this;
bus.$on('widthData', function(widthData) {
computed: {},
mounted () {
const that = this;
bus.$on('widthData', function (widthData) {
that.widthData = widthData;
});
bus.$on('updateLeft', key => {
......@@ -39,27 +52,25 @@ export default {
that.$refs.leftmenu.handleSelect(key);
});
},
computed: {},
methods: {
// 处理路由跳转
toRouterView(val) {
var that = this;
toRouterView (val) {
const that = this;
that.$router.push({
path: val.path
path: val.path,
});
},
// 折叠事件
collapseTag(val) {
var that = this;
collapseTag (val) {
const that = this;
that.collapseFlag = val;
if (that.collapseFlag) {
that.widthData = '64px';
} else {
that.widthData = '200px';
}
}
},
},
components: {}
};
</script>
<style scoped>
......
<template>
<el-dialog title="同意退款" :visible.sync="agreeRefundModal.dialogVisible" width="450px" @close="cancelSubmit('agreeRefundModal')">
<el-dialog
title="同意退款"
:visible.sync="agreeRefundModal.dialogVisible"
width="450px"
@close="cancelSubmit('agreeRefundModal')"
>
<el-form :model="agreeRefundModal" ref="agreeRefundModal" :rules="modalRules">
<el-form-item label="退回积分" label-width="80px" prop="refundPoint">
<el-input type="text" v-model="agreeRefundModal.refundPoint" style="width:230px;"> </el-input>
<el-input type="text" v-model="agreeRefundModal.refundPoint" style="width:230px;" />
</el-form-item>
<el-form-item label="退回金额" label-width="80px" prop="refundMoney">
<el-input :disabled="agreeRefundModal.refundType === 1" type="text" v-model="agreeRefundModal.refundMoney" style="width:230px;" @blur="spliceMoney"> </el-input>
<el-input
:disabled="agreeRefundModal.refundType === 1"
type="text"
v-model="agreeRefundModal.refundMoney"
style="width:230px;"
@blur="spliceMoney"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('agreeRefundModal')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('agreeRefundModal')" :loading="submitLoading">确 定</el-button>
<el-button @click="cancelSubmit('agreeRefundModal')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('agreeRefundModal')" :loading="submitLoading">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -24,14 +39,14 @@ export default {
props: {
agreeRefundModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
let refundPointValidator = (rule, value, callback) => {
let reg = /^\d+$/;
data () {
const refundPointValidator = (rule, value, callback) => {
const reg = /^\d+$/;
if (Number(value) !== 0) {
if (!reg.test(Number(value))) {
callback(new Error('积分必须为正整数'));
......@@ -44,8 +59,8 @@ export default {
callback();
}
};
let refundMoneyValidator = (rule, value, callback) => {
let reg = /^\d+(\.\d+)?$/;
const refundMoneyValidator = (rule, value, callback) => {
const reg = /^\d+(\.\d+)?$/;
if (!reg.test(value)) {
callback(new Error('金额必须为大于0数字类型'));
} else if (Number(value) > this.refundMoney) {
......@@ -60,30 +75,30 @@ export default {
refundMoney: '',
modalRules: {
refundPoint: [{ required: true, message: '请输入积分', trigger: 'blur' }, { validator: refundPointValidator, trigger: 'blur' }],
refundMoney: [{ required: true, message: '请输入金额', trigger: 'blur' }, { validator: refundMoneyValidator, trigger: 'blur' }]
refundMoney: [{ required: true, message: '请输入金额', trigger: 'blur' }, { validator: refundMoneyValidator, trigger: 'blur' }],
},
submitLoading: false //按钮禁止重复提交
submitLoading: false, // 按钮禁止重复提交
};
},
created() {
created () {
this.refundMoney = copy(this.agreeRefundModal.refundMoney);
this.refundPoint = copy(this.agreeRefundModal.refundPoint);
},
methods: {
spliceMoney() {
spliceMoney () {
if (this.agreeRefundModal.refundMoney) {
this.agreeRefundModal.refundMoney = Number(this.agreeRefundModal.refundMoney).toFixed(2);
}
},
//确认提交
submitProNanme(formName) {
// 确认提交
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
const params = {
integralMallProRefundId: this.agreeRefundModal.integralMallProRefundId,
refundMoney: this.agreeRefundModal.refundMoney,
refundPoint: this.agreeRefundModal.refundPoint,
proId: this.agreeRefundModal.proId
proId: this.agreeRefundModal.proId,
};
this.submitLoading = true;
request.get('/api-integral-mall/agree-refund', { params }).then(res => {
......@@ -102,12 +117,12 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.agreeRefundModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog title="关闭订单" :visible.sync="refunOrderdModal.dialogVisible" width="450px" @close="cancelSubmit('refundForm')">
<el-dialog
title="关闭订单"
:visible.sync="refunOrderdModal.dialogVisible"
width="450px"
@close="cancelSubmit('refundForm')"
>
<el-form :model="refundForm" ref="refundForm" :rules="modalRules">
<el-form-item label="" label-width="0px" prop="closeReason">
<p>确认取消订单吗?</p>
<p>积分将会通过实时返回给会员。相应礼品的库存会归还</p>
<el-input type="textarea" :rows="5" v-model="refundForm.closeReason" style="width:410px;" @input="value => reasonLimit(value)"> </el-input>
<el-input
type="textarea"
:rows="5"
v-model="refundForm.closeReason"
style="width:410px;"
@input="value => reasonLimit(value)"
/>
</el-form-item>
<span class="slot-num">{{ reasonLen }}/50</span>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('refundForm')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('refundForm')" :loading="submitLoading">确 定</el-button>
<el-button @click="cancelSubmit('refundForm')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('refundForm')" :loading="submitLoading">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -23,39 +38,39 @@ export default {
props: {
refunOrderdModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
reasonLen: 0,
refundForm: {
closeReason: ''
closeReason: '',
},
submitLoading: false,
modalRules: {
closeReason: [{ required: true, message: '请输入关闭原因', trigger: 'blur' }]
}
closeReason: [{ required: true, message: '请输入关闭原因', trigger: 'blur' }],
},
};
},
methods: {
//输入框字数统计
reasonLimit(value) {
// 输入框字数统计
reasonLimit (value) {
this.$nextTick(() => {
this.refundForm.closeReason = getInputVal.getInputVal(value, 50);
this.reasonLen = getInputVal.getZhLen(this.refundForm.closeReason);
});
},
//确认
submitProNanme(formName) {
// 确认
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
const params = {
integralMallProExchangeId: this.refunOrderdModal.integralMallProExchangeId,
cancelReason: this.refundForm.closeReason,
optType: 2
optType: 2,
};
this.submitLoading = true;
request.get('/api-integral-mall/order-opt', { params }).then(res => {
......@@ -74,12 +89,12 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.refunOrderdModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog title="关闭退款" :visible.sync="refundModal.dialogVisible" width="450px" @close="cancelSubmit('refundForm')">
<el-dialog
title="关闭退款"
:visible.sync="refundModal.dialogVisible"
width="450px"
@close="cancelSubmit('refundForm')"
>
<el-form :model="refundForm" ref="refundForm" :rules="modalRules">
<el-form-item label="原因" label-width="80px" prop="reason">
<el-input type="textarea" :rows="5" v-model="refundForm.reason" style="width:330px;" @input="value => reasonLimit(value)"> </el-input>
<el-input
type="textarea"
:rows="5"
v-model="refundForm.reason"
style="width:330px;"
@input="value => reasonLimit(value)"
/>
</el-form-item>
<span class="slot-num">{{ reasonLen }}/200</span>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('refundForm')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('refundForm')" :loading="submitLoading">确 定</el-button>
<el-button @click="cancelSubmit('refundForm')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('refundForm')" :loading="submitLoading">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -21,39 +36,39 @@ export default {
props: {
refundModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
reasonLen: 0,
refundForm: {
reason: ''
reason: '',
},
submitLoading: false,
modalRules: {
reason: [{ required: true, message: '请输入关闭原因', trigger: 'blur' }]
}
reason: [{ required: true, message: '请输入关闭原因', trigger: 'blur' }],
},
};
},
methods: {
//输入框字数统计
reasonLimit(value) {
// 输入框字数统计
reasonLimit (value) {
this.$nextTick(() => {
this.refundForm.reason = getInputVal.getInputVal(value, 200);
this.reasonLen = getInputVal.getZhLen(this.refundForm.reason);
});
},
//确认修改商品名称
submitProNanme(formName) {
// 确认修改商品名称
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
const params = {
integralMallProRefundId: this.refundModal.integralMallProRefundId,
proId: this.refundModal.proId,
reason: this.refundForm.reason
reason: this.refundForm.reason,
};
this.submitLoading = true;
request.get('/api-integral-mall/refuse-refund', { params }).then(res => {
......@@ -72,12 +87,12 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.refundModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog title="发货" :visible.sync="deliverdModal.dialogVisible" width="600px" @close="cancelSubmit('deliverdModal')">
<el-dialog
title="发货"
:visible.sync="deliverdModal.dialogVisible"
width="600px"
@close="cancelSubmit('deliverdModal')"
>
<el-form :model="deliverdModal" ref="deliverdModal" :rules="modalRules">
<el-form-item v-if="deliverdModal.changeType === 2" label="收件人" label-width="80px">
<span>{{ deliverdModal.consignee }}</span>
......@@ -10,24 +15,72 @@
<el-form-item v-if="deliverdModal.changeType === 2" label="收货地址" label-width="80px">
<span>{{ deliverdModal.receivingAddress }}</span>
</el-form-item>
<el-form-item label="快递公司" v-if="deliverdModal.changeType === 2" label-width="80px" prop="logisticsCompanyId">
<el-select v-model="deliverdModal.logisticsCompanyId" placeholder="请选择快递" clearable class="w-450" @change="changeLogistics">
<el-option :label="item.logisticsCompanyName" :value="item.logisticsCompanyId" v-for="(item, index) in logistiesList" :key="index"></el-option>
<el-form-item
label="快递公司"
v-if="deliverdModal.changeType === 2"
label-width="80px"
prop="logisticsCompanyId"
>
<el-select
v-model="deliverdModal.logisticsCompanyId"
placeholder="请选择快递"
clearable
class="w-450"
@change="changeLogistics"
>
<el-option
:label="item.logisticsCompanyName"
:value="item.logisticsCompanyId"
v-for="(item, index) in logistiesList"
:key="index"
/>
</el-select>
</el-form-item>
<el-form-item v-if="deliverdModal.changeType === 2 && otherLogistics" label-width="80px" prop="otherLogisticsCompanyName">
<el-input type="text" v-model="deliverdModal.otherLogisticsCompanyName" class="w-450" placeholder="请输入快递公司" @input="value => logisticsNameLimit(value)"> </el-input>
<el-input
type="text"
v-model="deliverdModal.otherLogisticsCompanyName"
class="w-450"
placeholder="请输入快递公司"
@input="value => logisticsNameLimit(value)"
/>
</el-form-item>
<el-form-item v-if="deliverdModal.changeType === 2" label="运单编号" label-width="80px" prop="courierNumber">
<el-input type="text" v-model="deliverdModal.courierNumber" class="w-450" placeholder="请输入运单编号" @input="value => limitCode(value)"> </el-input>
<el-form-item
v-if="deliverdModal.changeType === 2"
label="运单编号"
label-width="80px"
prop="courierNumber"
>
<el-input
type="text"
v-model="deliverdModal.courierNumber"
class="w-450"
placeholder="请输入运单编号"
@input="value => limitCode(value)"
/>
</el-form-item>
<el-form-item v-if="deliverdModal.changeType === 3" label="发货内容" label-width="80px" prop="content">
<el-input type="textarea" :rows="4" v-model="deliverdModal.content" class="w-450" @input="value => contentLimit(value)"> </el-input>
<el-form-item
v-if="deliverdModal.changeType === 3"
label="发货内容"
label-width="80px"
prop="content"
>
<el-input
type="textarea"
:rows="4"
v-model="deliverdModal.content"
class="w-450"
@input="value => contentLimit(value)"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('deliverdModal')">取 消</el-button>
<el-button type="primary" @click="submitProNanme('deliverdModal')" :loading="submitLoading">确 定</el-button>
<el-button @click="cancelSubmit('deliverdModal')">
取 消
</el-button>
<el-button type="primary" @click="submitProNanme('deliverdModal')" :loading="submitLoading">
确 定
</el-button>
</div>
</el-dialog>
</template>
......@@ -41,37 +94,37 @@ export default {
props: {
deliverdModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
reasonLen: 0,
refundPoint: '',
refundMoney: '',
otherLogistics: false,
otherLogisticsCompanyName: '', //其他公司快递名称
logisticsCompanyCode: '', //物流公司code
otherLogisticsCompanyName: '', // 其他公司快递名称
logisticsCompanyCode: '', // 物流公司code
logisticsCompanyName: '',
modalRules: {
logisticsCompanyId: [{ required: true, message: '请选择快递公司', trigger: 'change' }],
courierNumber: [{ required: true, message: '请输入运单编号', trigger: 'blur' }],
otherLogisticsCompanyName: [{ required: true, message: '请输入快递公司名称', trigger: 'blur' }],
content: [{ required: true, message: '请输入在线发货的内容', trigger: 'blur' }]
content: [{ required: true, message: '请输入在线发货的内容', trigger: 'blur' }],
},
submitLoading: false,
logistiesList: [] //快递公司
logistiesList: [], // 快递公司
};
},
created() {
created () {
this.refundMoney = copy(this.deliverdModal.refundMoney);
this.refundPoint = copy(this.deliverdModal.refundPoint);
this.getLogistiesList();
},
methods: {
getLogistiesList() {
getLogistiesList () {
request.post('/api-integral-mall/load-logisties').then(res => {
if (res.data.errorCode === 0) {
if (res.data.result) {
......@@ -84,9 +137,9 @@ export default {
}
});
},
changeLogistics(value) {
changeLogistics (value) {
if (value) {
let code = this.logistiesList.find(item => {
const code = this.logistiesList.find(item => {
return item.logisticsCompanyId === value;
}).logisticsCompanyCode;
this.logisticsCompanyCode = code;
......@@ -95,7 +148,7 @@ export default {
} else {
this.otherLogistics = false;
this.deliverdModal.otherLogisticsCompanyName = '';
//获取下拉的快递名称
// 获取下拉的快递名称
this.logisticsCompanyName = this.logistiesList.find(item => {
return item.logisticsCompanyId === this.deliverdModal.logisticsCompanyId;
}).logisticsCompanyName;
......@@ -105,37 +158,37 @@ export default {
this.deliverdModal.otherLogisticsCompanyName = '';
}
},
logisticsNameLimit(value) {
logisticsNameLimit (value) {
this.$nextTick(() => {
this.deliverdModal.otherLogisticsCompanyName = getInputVal.getInputVal(value, 8);
});
},
limitCode(value) {
limitCode (value) {
this.$nextTick(() => {
this.deliverdModal.courierNumber = getInputVal.getInputVal(value, 16);
});
},
contentLimit(value) {
contentLimit (value) {
this.$nextTick(() => {
this.deliverdModal.content = getInputVal.getInputVal(value, 100);
});
},
//确认修改商品名称
submitProNanme(formName) {
// 确认修改商品名称
submitProNanme (formName) {
this.$refs[formName].validate(valid => {
if (valid) {
let params = {
optType: 1, //1 发货; 2 取消订单; 3 修改物流;
const params = {
optType: 1, // 1 发货; 2 取消订单; 3 修改物流;
integralMallProExchangeId: this.deliverdModal.integralMallProExchangeId,
logisticsCompanyId: this.deliverdModal.logisticsCompanyId, //物流公司id
logisticsCompanyCode: this.logisticsCompanyCode, //物流公司code号
logisticsCompanyName: this.otherLogistics ? this.deliverdModal.otherLogisticsCompanyName : this.logisticsCompanyName, //物流公司名称
courierNumber: this.deliverdModal.courierNumber, //物流单号
cancelReason: '', //取消发货原因
deliveryContent: this.deliverdModal.changeType === 3 ? this.deliverdModal.content : '' //在线发货内容
logisticsCompanyId: this.deliverdModal.logisticsCompanyId, // 物流公司id
logisticsCompanyCode: this.logisticsCompanyCode, // 物流公司code号
logisticsCompanyName: this.otherLogistics ? this.deliverdModal.otherLogisticsCompanyName : this.logisticsCompanyName, // 物流公司名称
courierNumber: this.deliverdModal.courierNumber, // 物流单号
cancelReason: '', // 取消发货原因
deliveryContent: this.deliverdModal.changeType === 3 ? this.deliverdModal.content : '', // 在线发货内容
};
if (this.deliverdModal.changeType === 3) {
//在线发货
// 在线发货
params.logisticsCompanyId = '';
params.logisticsCompanyCode = '';
params.logisticsCompanyName = '';
......@@ -158,13 +211,13 @@ export default {
}
});
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.otherLogistics = false;
this.deliverdModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
<template>
<el-dialog title="查看物流" :visible.sync="deliverInfodModal.dialogVisible" width="880px" @close="cancelSubmit('deliverInfodModal')">
<el-dialog
title="查看物流"
:visible.sync="deliverInfodModal.dialogVisible"
width="880px"
@close="cancelSubmit('deliverInfodModal')"
>
<el-form :model="temDeliverInfodModal" ref="deliverInfodModal" :rules="modalRules">
<el-form-item v-if="temDeliverInfodModal.deliverStatus" label="收件人" label-width="80px">
<span>{{ temDeliverInfodModal.consignee }}</span>
......@@ -19,7 +24,7 @@
<el-form-item v-if="!temDeliverInfodModal.deliverStatus" label="发货内容" label-width="80px">
<span style="word-break: break-all;">{{ temDeliverInfodModal.deliveryContent ? temDeliverInfodModal.deliveryContent : '--' }}</span>
</el-form-item>
<div class="line"></div>
<div class="line" />
<!-- {{ temDeliverInfodModal.traces }} -->
<div class="editInfo-content" v-show="temDeliverInfodModal.changeType !== 3">
<div v-if="!editStatus">
......@@ -33,39 +38,74 @@
<div v-else>
<div class="logistics-item">
<span>快递公司:</span>
<el-select v-model="temDeliverInfodModal.logisticsCompanyId" placeholder="请选择快递" clearable @change="changeLogistics" style="width:160px;">
<el-option :label="item.logisticsCompanyName" :value="item.logisticsCompanyId" v-for="(item, index) in logistiesList" :key="index"></el-option>
<el-select
v-model="temDeliverInfodModal.logisticsCompanyId"
placeholder="请选择快递"
clearable
@change="changeLogistics"
style="width:160px;"
>
<el-option
:label="item.logisticsCompanyName"
:value="item.logisticsCompanyId"
v-for="(item, index) in logistiesList"
:key="index"
/>
</el-select>
<p style="margin:0px 10px 0 10px;display:inline-block" v-show="otherLogistics">
<el-input type="text" v-model="temDeliverInfodModal.otherLogisticsCompanyName" style="width:160px" placeholder="请输入快递公司" @input="value => limitOtherName(value)"> </el-input>
<el-input
type="text"
v-model="temDeliverInfodModal.otherLogisticsCompanyName"
style="width:160px"
placeholder="请输入快递公司"
@input="value => limitOtherName(value)"
/>
</p>
</div>
<div class="logistics-item">
<span>运单号码:</span>
<el-input type="text" v-model="temDeliverInfodModal.courierNumber" style="width:160px" placeholder="请输入快递单号" @input="value => limitCode(value)"> </el-input>
<el-input
type="text"
v-model="temDeliverInfodModal.courierNumber"
style="width:160px"
placeholder="请输入快递单号"
@input="value => limitCode(value)"
/>
</div>
</div>
<div style="float:right;margin-top:-20px;">
<el-button type="text" v-show="!editStatus" @click="editLogisticsInfo">修改运单编号</el-button>
<el-button type="text" v-show="editStatus" @click="updateLogisticsInfo">确认1</el-button>
<el-button type="text" v-show="editStatus" @click="cancelLogisticsInfo">取消</el-button>
<el-button type="text" v-show="!editStatus" @click="editLogisticsInfo">
修改运单编号
</el-button>
<el-button type="text" v-show="editStatus" @click="updateLogisticsInfo">
确认1
</el-button>
<el-button type="text" v-show="editStatus" @click="cancelLogisticsInfo">
取消
</el-button>
</div>
</div>
<div class="logisticsList" v-show="temDeliverInfodModal.traces.length">
<ul class="el-timeline is-reverse">
<li class="el-timeline-item" v-for="(i, v) in temDeliverInfodModal.traces" :key="v">
<div class="el-timeline-item__tail"></div>
<div class="el-timeline-item__node el-timeline-item__node--normal el-timeline-item__node--"></div>
<div class="el-timeline-item__tail" />
<div class="el-timeline-item__node el-timeline-item__node--normal el-timeline-item__node--" />
<div class="el-timeline-item__wrapper">
<div class="el-timeline-item__content">{{ i.acceptStation }}</div>
<div class="el-timeline-item__timestamp is-bottom">{{ i.acceptTime }}</div>
<div class="el-timeline-item__content">
{{ i.acceptStation }}
</div>
<div class="el-timeline-item__timestamp is-bottom">
{{ i.acceptTime }}
</div>
</div>
</li>
</ul>
</div>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('deliverInfodModal')">关闭</el-button>
<el-button @click="cancelSubmit('deliverInfodModal')">
关闭
</el-button>
</div>
</el-dialog>
</template>
......@@ -79,37 +119,37 @@ export default {
props: {
deliverInfodModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
getTimeAll: getInputVal.formatDate,
reverse: true,
editStatus: false,
otherLogistics: false,
otherLogisticsCompanyName: '', //其他公司快递名称
logisticsCompanyCode: '', //物流公司code
otherLogisticsCompanyName: '', // 其他公司快递名称
logisticsCompanyCode: '', // 物流公司code
logisticsCompanyName: '',
logistiesList: [], //快递公司
temDeliverInfodModal: ''
logistiesList: [], // 快递公司
temDeliverInfodModal: '',
};
},
watch: {
deliverInfodModal() {
deliverInfodModal () {
this.temDeliverInfodModal = copy(this.deliverInfodModal);
}
},
},
created() {
created () {
this.getLogistiesList();
this.temDeliverInfodModal = copy(this.deliverInfodModal);
this.logisticsCompanyCode = this.deliverInfodModal.logisticsCompanyCode;
this.logisticsCompanyName = this.deliverInfodModal.logisticsCompanyName;
},
methods: {
getLogistiesList() {
getLogistiesList () {
request.post('/api-integral-mall/load-logisties').then(res => {
if (res.data.errorCode === 0) {
if (res.data.result) {
......@@ -122,9 +162,9 @@ export default {
}
});
},
changeLogistics(value) {
changeLogistics (value) {
if (value) {
let code = this.logistiesList.find(item => {
const code = this.logistiesList.find(item => {
return item.logisticsCompanyId === value;
}).logisticsCompanyCode;
this.logisticsCompanyCode = code;
......@@ -134,7 +174,7 @@ export default {
} else {
this.otherLogistics = false;
this.temDeliverInfodModal.otherLogisticsCompanyName = '';
//获取下拉的快递名称
// 获取下拉的快递名称
this.logisticsCompanyName = this.logistiesList.find(item => {
return item.logisticsCompanyId === this.temDeliverInfodModal.logisticsCompanyId;
}).logisticsCompanyName;
......@@ -144,29 +184,29 @@ export default {
this.temDeliverInfodModal.otherLogisticsCompanyName = '';
}
},
limitCode(value) {
limitCode (value) {
this.$nextTick(() => {
this.temDeliverInfodModal.courierNumber = getInputVal.getInputVal(value, 16);
});
},
limitOtherName(value) {
limitOtherName (value) {
this.$nextTick(() => {
this.temDeliverInfodModal.otherLogisticsCompanyName = getInputVal.getInputVal(value, 8);
});
},
editLogisticsInfo() {
editLogisticsInfo () {
this.editStatus = true;
},
updateLogisticsInfo() {
let params = {
updateLogisticsInfo () {
const params = {
optType: 3,
integralMallProExchangeId: this.temDeliverInfodModal.integralMallProExchangeId,
logisticsCompanyId: this.temDeliverInfodModal.logisticsCompanyId,
logisticsCompanyCode: this.logisticsCompanyCode,
courierNumber: this.temDeliverInfodModal.courierNumber,
logisticsCompanyName: this.otherLogistics ? this.temDeliverInfodModal.otherLogisticsCompanyName : this.logisticsCompanyName //物流公司名称
logisticsCompanyName: this.otherLogistics ? this.temDeliverInfodModal.otherLogisticsCompanyName : this.logisticsCompanyName, // 物流公司名称
};
return false
return false;
request.get('/api-integral-mall/order-opt', { params }).then(res => {
if (res.data.errorCode === 0) {
this.$message.success('发货成功');
......@@ -177,17 +217,17 @@ export default {
}
});
},
cancelLogisticsInfo() {
cancelLogisticsInfo () {
this.editStatus = false;
},
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.otherLogistics = false;
this.deliverInfodModal.dialogVisible = false;
this.temDeliverInfodModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
......@@ -11,16 +11,16 @@
<script>
export default {
components: {},
props: {
importInfo: {
type: Object
}
type: Object,
},
},
data() {
data () {
return {};
},
methods: {},
components: {}
};
</script>
<style scoped>
......
<template>
<el-dialog title="查看详情" :visible.sync="closeInfoModal.dialogVisible" width="600px" @close="cancelSubmit('closeInfoModal')">
<el-dialog
title="查看详情"
:visible.sync="closeInfoModal.dialogVisible"
width="600px"
@close="cancelSubmit('closeInfoModal')"
>
<el-form :model="closeInfoModal" ref="closeInfoModal" :rules="modalRules">
<el-form-item label="收件人" label-width="80px" v-show="closeInfoModal.changeType === 2">
<span>{{ closeInfoModal.consignee }}</span>
......@@ -21,7 +26,9 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelSubmit('closeInfoModal')">关闭</el-button>
<el-button @click="cancelSubmit('closeInfoModal')">
关闭
</el-button>
</div>
</el-dialog>
</template>
......@@ -35,14 +42,14 @@ export default {
props: {
closeInfoModal: {
type: Object,
default() {
default () {
return {};
}
}
},
},
},
data() {
data () {
return {
getTimeAll: getInputVal.formatDate
getTimeAll: getInputVal.formatDate,
// reverse: true,
// reasonLen: 0,
// refundPoint: '',
......@@ -62,13 +69,13 @@ export default {
},
methods: {
//取消修改
cancelSubmit(formName) {
// 取消修改
cancelSubmit (formName) {
this.$refs[formName].resetFields();
this.otherLogistics = false;
this.closeInfoModal.dialogVisible = false;
}
}
},
},
};
</script>
<style scoped>
......
......@@ -277,16 +277,16 @@
<!-- <el-button type="text" @click="goDetail(scope.row)">订单详情</el-button> -->
<el-button
type="text"
v-if="scope.row.status === 1 && scope.row.changeType === 2 && $getButtonLimit($buttonCode.giftExchangeLogisticsDelivery)"
:limit-code="$buttonCode.giftExchangeLogisticsDelivery"
v-if="scope.row.status === 1 && scope.row.changeType === 2 && $getButtonLimit($buttonCode.giftExchangeDelivery)"
:limit-code="$buttonCode.giftExchangeDelivery"
@click="handleDeliver(scope.row)"
>
物流发货
</el-button>
<el-button
type="text"
v-if="scope.row.status === 1 && scope.row.changeType === 3 && $getButtonLimit($buttonCode.giftExchangeOnlineDelivery)"
:limit-code="$buttonCode.giftExchangeOnlineDelivery"
v-if="scope.row.status === 1 && scope.row.changeType === 3 && $getButtonLimit($buttonCode.giftExchangeDelivery)"
:limit-code="$buttonCode.giftExchangeDelivery"
@click="handleDeliver(scope.row)"
>
在线发货
......
<template>
<div>
<el-dialog title="批量发货" :visible.sync="deliverModal.dialogVisible" width="620px">
<el-form :model="dialogForm" label-position="right" label-width="80px" v-loading="loading">
<el-form
:model="dialogForm"
label-position="right"
label-width="80px"
v-loading="loading"
>
<el-form-item label="选择文件" required>
<div>
<div class="upload-btn">
<el-upload class="upload-ele" :action="action" :headers="headersUpload" :before-upload="uploadFileBefore" :on-success="uploadFile" with-credentials :show-file-list="showList" :data="uploadData">
<el-button size="small"><i class="el-icon-upload2" style="margin-right:5px"></i>点击上传</el-button>
<el-upload
class="upload-ele"
:action="action"
:headers="headersUpload"
:before-upload="uploadFileBefore"
:on-success="uploadFile"
with-credentials
:show-file-list="showList"
:data="uploadData"
>
<el-button size="small">
<i class="el-icon-upload2" style="margin-right:5px" />点击上传
</el-button>
</el-upload>
</div>
<el-button type="info" plain @click="downloadFile">下载EXCEL模板</el-button>
<el-button type="info" plain @click="downloadFile">
下载EXCEL模板
</el-button>
</div>
<p class="import-info" v-show="importMess">
本次共导入&nbsp;<span style="font-weight:600">{{ errornumber + correctNumber }}</span
>&nbsp;个商品,其中成功&nbsp;<span style="font-weight:600">{{ correctNumber }}</span
>&nbsp;个,失败&nbsp;<span style="color:#f5222d">{{ errornumber }}</span
>&nbsp;<a href="javaScript:void(0)" v-show="errornumber > 0" style="margin-left:10px" @click="showInfo">查看失败原因</a>
本次共导入&nbsp;<span style="font-weight:600">{{ errornumber + correctNumber }}</span>&nbsp;个商品,其中成功&nbsp;<span style="font-weight:600">{{ correctNumber }}</span>&nbsp;个,失败&nbsp;<span style="color:#f5222d">{{ errornumber }}</span>&nbsp;<a
href="javaScript:void(0)"
v-show="errornumber > 0"
style="margin-left:10px"
@click="showInfo"
>查看失败原因</a>
</p>
</el-form-item>
<el-form-item label="导入规则">
<div class="line"></div>
<div class="line" />
<div class="upload-rules">
<p>1. 每个sheet表最多300个订单,文件大小不超过2M</p>
<p>2. 只需要填写订单编号,物流公司,物流单号(其中物流公司的填写请参考模板中的物流公司字典)</p>
......@@ -28,24 +48,27 @@
</el-form-item>
</el-form>
</el-dialog>
<errorList :importInfo="importInfo"></errorList>
<errorList :importInfo="importInfo" />
</div>
</template>
<script>
import errorList from './errorList';
export default {
components: {
errorList,
},
props: {
deliverModal: {
type: Object
}
type: Object,
},
},
data() {
data () {
return {
action: window.location.origin + '/api-integral-mall/upload-order-ship?requestProject=intergral-mall',
// action: 'http://gicdev.demogic.com/api-integral-mall/upload-order-ship?requestProject=intergral-mall',
headersUpload: {
sign: ''
sign: '',
},
dialogForm: {},
errorList: [],
......@@ -53,21 +76,21 @@ export default {
correctNumber: 0,
errornumber: 0,
importInfo: {
//失败原因列表
// 失败原因列表
dialogVisible: false,
list: []
list: [],
},
importMess: false
importMess: false,
};
},
methods: {
//下载模板
downloadFile() {
let url = 'static/批量发货模板.xlsx';
// 下载模板
downloadFile () {
const url = 'static/批量发货模板.xlsx';
window.open(url);
},
//上传之前
uploadFileBefore(file) {
// 上传之前
uploadFileBefore (file) {
const isXlsx = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
if (file.type) {
if (file.type !== isXlsx) {
......@@ -75,9 +98,9 @@ export default {
return false;
}
} else {
let fileName = file.name;
let arr = fileName.split('.');
let fileType = arr[arr.length - 1];
const fileName = file.name;
const arr = fileName.split('.');
const fileType = arr[arr.length - 1];
if (fileType !== 'xlsx') {
this.$message.error('文件格式错误,请导入.xlsx格式的文件');
return false;
......@@ -96,8 +119,8 @@ export default {
this.loading = true;
this.fileName = file.name;
},
//上传文件
uploadFile(file, fileList) {
// 上传文件
uploadFile (file, fileList) {
if (file.errorCode === 0) {
this.importMess = true;
if (file.result !== '') {
......@@ -115,13 +138,10 @@ export default {
this.fileName = '';
}
},
showInfo() {
showInfo () {
this.importInfo.dialogVisible = true;
}
},
},
components: {
errorList
}
};
</script>
<style scoped>
......
......@@ -3,7 +3,9 @@
<div class="mall-content-section">
<div class="mall-content-title">
<el-breadcrumb separator="/">
<el-breadcrumb-item :to="{ path: '' }"><a href="/report/#/memberSummary">首页</a></el-breadcrumb-item>
<el-breadcrumb-item :to="{ path: '' }">
<a href="/report/#/memberSummary">首页</a>
</el-breadcrumb-item>
<el-breadcrumb-item>积分商城</el-breadcrumb-item>
<el-breadcrumb-item>设置</el-breadcrumb-item>
<el-breadcrumb-item>库存日志</el-breadcrumb-item>
......@@ -17,16 +19,31 @@
<div class="operate-top">
<div class="fl">
<div class="search-item" style="margin-right:10px">
<el-input v-model="searchValue" placeholder="请输入卡券名称/礼品名称/编码" prefix-icon="el-icon-search" clearable class="w-280" @keyup.enter.native="getSearchList" @clear="getSearchList"> </el-input>
<el-input
v-model="searchValue"
placeholder="请输入卡券名称/礼品名称/编码"
prefix-icon="el-icon-search"
clearable
class="w-280"
@keyup.enter.native="getSearchList"
@clear="getSearchList"
/>
</div>
<div class="search-item">
<el-date-picker v-model="dateValue" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="changeTime"> </el-date-picker>
<el-date-picker
v-model="dateValue"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
@change="changeTime"
/>
</div>
</div>
</div>
<div v-loading="loading">
<el-table :data="tableDate" style="width: 100%">
<el-table-column prop="author" label="操作人"> </el-table-column>
<el-table-column prop="author" label="操作人" />
<el-table-column prop="integralMallProName" label="礼品/卡券名称">
<template slot-scope="scope">
<P>{{ scope.row.integralMallProName }}</P>
......@@ -47,7 +64,7 @@
<template slot="empty">
<div class="no-data-wrap">
<div class="no-data-icon">
<img src="../../../static/img/no-data_icon.png" />
<img src="../../../static/img/no-data_icon.png">
</div>
<p>暂无数据</p>
</div>
......@@ -55,7 +72,17 @@
</el-table>
<div class="pagination-conteiner" v-show="tableDate.length > 0">
<div class="pagination">
<dm-pagination v-if="total != 0" background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="pageSizes" :page-size="pageSize" layout="total, sizes, prev, pager, next" :total="total"> </dm-pagination>
<dm-pagination
v-if="total != 0"
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="pageSizes"
:page-size="pageSize"
layout="total, sizes, prev, pager, next"
:total="total"
/>
</div>
</div>
</div>
......@@ -70,7 +97,8 @@
import getInputVal from '../../utils/common.js';
import request from '../../service/request.js';
export default {
data() {
components: {},
data () {
return {
getTime: getInputVal.getTime,
getSeconds: getInputVal.getSeconds,
......@@ -84,18 +112,18 @@ export default {
loading: false,
startTime: '',
endTime: '',
tableDate: []
tableDate: [],
};
},
created() {
created () {
this.getList();
},
methods: {
getSearchList() {
getSearchList () {
this.currentPage = 1;
this.getList();
},
changeTime() {
changeTime () {
if (this.dateValue) {
this.startTime = this.dateValue[0] ? this.getTime(this.dateValue[0]) : '';
this.endTime = this.dateValue[1] ? this.getTime(this.dateValue[1]) : '';
......@@ -106,25 +134,25 @@ export default {
this.currentPage = 1;
this.getList();
},
//分页设置每页的数量
handleSizeChange(size) {
// 分页设置每页的数量
handleSizeChange (size) {
this.pageSize = size;
this.getList();
},
// 分页设置跳转到第几页
handleCurrentChange(page) {
handleCurrentChange (page) {
this.currentPage = page;
this.getList();
},
getList() {
getList () {
this.startTime = this.dateValue ? this.getTime(this.dateValue[0]) : '';
this.endTime = this.dateValue ? this.getTime(this.dateValue[1]) : '';
let params = {
const params = {
currentPage: this.currentPage,
pageSize: this.pageSize,
search: this.searchValue,
startTime: this.startTime,
endTime: this.endTime
endTime: this.endTime,
};
this.loading = true;
request.get('/api-integral-mall/page-pro-stock-record', { params }).then(res => {
......@@ -142,9 +170,8 @@ export default {
this.loading = false;
}
});
}
},
},
components: {}
};
</script>
<style scoped>
......
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