Commit c496fa69 by huaying

fix: 核销记录

parent 500bc022
......@@ -216,6 +216,8 @@ export const importCostStore = params => requests('/api-marketing/import-cost-st
export const getCardLogPage = params => requests(PREFIX + 'card-write-off-log-page', params);
//核销记录导出
export const exportCardLog = params => requests(PREFIX + 'export-card-write-off-log', params);
//核销记录导出(门店)
export const exportStoreLog = params => requests(PREFIX + 'export-card-write-off-store', params);
//核销数据 (门店)列表
export const getCardStorePage = params => requests(PREFIX + 'card-write-off-store-page', params);
//核销数据 (门店)--明细列表
......
......@@ -35,6 +35,7 @@ export default {
this.uuid = '';
this.$nextTick(_ => {
this.$emit('update:show', false);
this.$emit('refresh');
});
},
async saving() {
......@@ -55,10 +56,15 @@ export default {
};
return para;
});
await addStore({ storeList: res }).then(res => {
this.loadings = false;
this.handleClose();
});
await addStore({ storeList: res })
.then(res => {
this.loadings = false;
this.handleClose();
})
.catch(err => {
this.$tips({ type: 'error', message: err.message || '操作失败' });
this.loadings = false;
});
} else {
this.loadings = false;
this.$tips({ type: 'waring', message: '请完善表单' });
......
......@@ -11,7 +11,7 @@
<div class="links__qr">
<div style="text-align:center; background: #FFFFFF;border-radius: 2px;">
<vue-qr v-if="sourceType" id="qrImg" :text="src" :size="130" :margin="5"></vue-qr>
<img v-else :src="src" class="imgs" />
<img :src="src" id="qrImg" class="imgs" />
</div>
<el-button type="text" v-show="src" @click="download"><i class="iconfont icon-xiazai font-14"></i> 小程序二维码下载</el-button>
</div>
......@@ -30,6 +30,10 @@ export default {
type: Boolean,
default: false
},
link: {
type: String,
default: ''
},
src: {
type: String,
default: ''
......@@ -40,7 +44,7 @@ export default {
},
sourceType: {
type: Boolean,
default: true
default: false
}
},
data() {
......
......@@ -34,13 +34,13 @@ export default {
//验证手机号的正则表达式
let reg = /^(((13[0-9]{1})|(15[0-9]{1})|(16[0-9]{1})|(17[3-8]{1})|(18[0-9]{1})|(19[0-9]{1})|(14[5-7]{1}))+\d{8})$/;
//验证方法
let validatorPhone = (writeOffPhone, value, callback) => {
let validatorPhone = async (writeOffPhone, value, callback) => {
if (value === '') {
callback(new Error('手机号不能为空'));
} else if (!reg.test(value)) {
callback(new Error('手机号格式错误'));
} else if (value) {
searchRePhone({ writeOffPhone: this.form.writeOffPhone }).then(res => {
await searchRePhone({ writeOffPhone: value }).then(res => {
if (res.errorCode == 0) {
if (!res.result) {
callback(new Error('手机号码已存在'));
......@@ -50,6 +50,7 @@ export default {
}
});
}
callback();
};
return {
loadings: false,
......@@ -82,7 +83,10 @@ export default {
if (!this.form.writeOffStoreStaffId) {
delete this.form.writeOffStoreStaffId;
}
setStraff(this.form)
let param = {
...this.form
};
setStraff(param)
.then(res => {
this.$tips({ type: 'success', message: '操作成功' });
this.loading = false;
......@@ -94,6 +98,7 @@ export default {
this.loading = false;
});
} else {
this.loadings = false;
return false;
}
this.loadings = false;
......
......@@ -45,7 +45,7 @@
</div>
<dm-pagination v-show="tableData.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="listParams.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="listParams.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
</div>
<links :src="linkUrl" :show.sync="linkShow" :imageName="核销工具二维码" />
<links :link="link" :src="linkUrl" :show.sync="linkShow" :imageName="核销工具二维码" />
<add-store-dialog :show.sync="addStoreShow" @refresh="getList"></add-store-dialog>
<set-staff-dialog :show.sync="setStraffShow" :row="straffDetail" @refresh="getList"></set-staff-dialog>
</div>
......@@ -73,7 +73,8 @@ export default {
},
total: 0,
linkShow: false,
linkUrl: 'api-marketing/card-write-off-qrcode',
linkUrl: '',
link: '',
addStoreShow: false,
setStraffShow: false,
straffDetail: {}
......@@ -143,7 +144,12 @@ export default {
},
// 核销工具二维码
async qrEvent() {
await getwriteOffQr({}).then(() => {
await getwriteOffQr({}).then(res => {
if (res.errorCode == 0) {
this.link = res.result.link;
this.linkUrl = res.result.url;
}
console.log(res.result, 'link');
this.linkShow = true;
});
}
......
import { exportCardLog } from '@/service/api/cardApi.js';
import { exportStoreLog } from '@/service/api/cardApi.js';
import { formatDateTimeByType } from '@/utils/index.js';
export default {
data() {
......@@ -106,14 +106,15 @@ export default {
this.params.writeOffEndTime = '';
}
},
exportResult() {
exportStoreResult() {
const paras = {
search: this.params.search,
writeOffBeginTime: this.params.writeOffBeginTime,
writeOffEndTime: this.params.writeOffEndTime,
sortBy: this.params.sortBy
sortBy: this.params.sortBy,
dataType: 0
};
exportCardLog(paras).then(res => {
exportStoreLog(paras).then(res => {
if (res.result.errorCode == '0') {
let blob = new Blob([res.data], {
type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'
......
......@@ -29,7 +29,9 @@
</template>
</el-table-column>
<el-table-column label="核销金额" prop="writeOffPrice" min-width="100px"></el-table-column>
<el-table-column label="成本比例" prop="costValueProportion" min-width="92px"></el-table-column>
<el-table-column label="成本比例" prop="costValueProportion" min-width="92px">
<template slot-scope="{ row }"> {{ row.costValueProportion }}% </template>
</el-table-column>
<el-table-column label="成本金额" prop="costValue" min-width="100px"></el-table-column>
<el-table-column label="核销门店" prop="storeName" min-width="100px" show-overflow-tooltip></el-table-column>
<el-table-column label="核销操作人" prop="writeOffName" min-width="118px" show-overflow-tooltip></el-table-column>
......@@ -48,12 +50,13 @@
<el-table-column label="卡券代码" prop="cardCode" min-width="117px" show-overflow-tooltip></el-table-column>
</el-table>
<dm-pagination v-show="tableData.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="params.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="params.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
<vue-gic-export-excel :dialogVisible.sync="dialogVisible" :dataArr="tableData" :type="2" :excelUrl="excelUrl" :params="paramsex" :projectName="projectName"></vue-gic-export-excel>
</div>
</div>
</template>
<script>
import { getCardLogPage } from '@/service/api/cardApi.js';
import { getCardLogPage, exportCardLog } from '@/service/api/cardApi.js';
import writeOff from './writeOff';
export default {
name: 'writeOffCard',
......@@ -67,7 +70,11 @@ export default {
search: '',
currentPage: 1,
pageSize: 20
}
},
dialogVisible: false,
paramsex: {},
excelUrl: '',
projectName: 'marketing' // 当前项目名
};
},
mounted() {
......@@ -90,6 +97,17 @@ export default {
.catch(() => {
this.loading = false;
});
},
exportResult() {
this.dialogVisible = true;
this.excelUrl = exportCardLog;
this.params = {
search: this.params.search,
writeOffBeginTime: this.params.writeOffBeginTime,
writeOffEndTime: this.params.writeOffEndTime,
sortBy: this.params.sortBy,
dataType: 1
};
}
}
};
......
......@@ -23,12 +23,13 @@
</el-table-column>
</el-table>
<dm-pagination v-show="tableData.length" background class="dm-pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="params.currentPage" :page-sizes="[20, 40, 60, 80]" :page-size="params.pageSize" layout="total, sizes, prev, pager, next" :total="total"></dm-pagination>
<vue-gic-export-excel :dialogVisible.sync="dialogVisible" :dataArr="tableData" :type="2" :excelUrl="excelUrl" :params="paramsex" :projectName="projectName"></vue-gic-export-excel>
</div>
</div>
</template>
<script>
import { getCardStorePage } from '@/service/api/cardApi.js';
import { getCardStorePage, exportStoreLog } from '@/service/api/cardApi.js';
import writeOff from './writeOff';
export default {
name: 'writeOffCard',
......@@ -42,7 +43,11 @@ export default {
search: '',
currentPage: 1,
pageSize: 20
}
},
dialogVisible: false,
paramsex: {},
excelUrl: '',
projectName: 'marketing' // 当前项目名
};
},
mounted() {
......@@ -57,29 +62,6 @@ export default {
if (res.errorCode == 0) {
this.tableData = res.result.result || [];
this.total = res.result.totalCount;
// this.tableData = [
// {
// storeId: 1,
// storeName: 'cehsai',
// writeOffPrice: '23',
// writeOffCount: '66',
// costValue: '66'
// },
// {
// storeId: 2,
// storeName: 'daf',
// writeOffPrice: '25',
// writeOffCount: '55',
// costValue: '33'
// },
// {
// storeId: 3,
// storeName: 'cehsdfasai',
// writeOffPrice: '21',
// writeOffCount: '88',
// costValue: '44'
// }
// ];
} else {
this.$tips({ type: 'error', message: '加载列表失败' });
}
......@@ -92,6 +74,17 @@ export default {
// 明细
details(row) {
this.$router.push(`/card/storeDetails?id=${row.storeId}`);
},
exportResult() {
this.dialogVisible = true;
this.excelUrl = exportStoreLog;
this.params = {
search: this.params.search,
writeOffBeginTime: this.params.writeOffBeginTime,
writeOffEndTime: this.params.writeOffEndTime,
sortBy: this.params.sortBy,
dataType: 1
};
}
}
};
......
......@@ -54,29 +54,6 @@ export default {
if (res.errorCode == 0) {
this.tableData = res.result.result || [];
this.total = res.result.totalCount;
this.tableData = [
{
storeId: 1,
storeName: 'cehsai',
writeOffPrice: '23',
writeOffCount: '66',
costValue: '66'
},
{
storeId: 2,
storeName: 'daf',
writeOffPrice: '25',
writeOffCount: '55',
costValue: '33'
},
{
storeId: 3,
storeName: 'cehsdfasai',
writeOffPrice: '21',
writeOffCount: '88',
costValue: '44'
}
];
} else {
this.$tips({ type: 'error', message: '加载列表失败' });
}
......
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