Commit 9a4067fc by crushh

update: dist

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