优惠券管理
parent
37ab37774a
commit
699fd06fd9
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<el-dialog :close-on-click-modal="false" v-dialogDrag title="适用项目" :visible.sync="dialogVisible" width="600px">
|
||||
<el-table ref="list" :data="list" max-height="600" v-loading="listLoading" :element-loading-text="elementLoadingText" @selection-change="handleSelect" @row-click="handleRowClick" @row-dblclick="confirm">
|
||||
<el-table-column align="center" width="60" type="selection"></el-table-column>
|
||||
<el-table-column align="center" min-width="120" prop="storeName" label="门店名称"></el-table-column>
|
||||
<el-table-column align="center" width="100" prop="projectNum" label="项目编码"></el-table-column>
|
||||
<el-table-column align="center" min-width="120" prop="projectName" label="项目名称"></el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button size="mini" type="primary" plain @click="close">取 消</el-button>
|
||||
<el-button size="mini" type="primary" @click="confirm">确 定
|
||||
</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { propage, organizations } from "@/api/storeManage.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 表格
|
||||
list: [],
|
||||
listLoading: false,
|
||||
elementLoadingText: '正在加载...',
|
||||
// 其它
|
||||
mulSelect: [],
|
||||
queryForm: {
|
||||
pageNum: 1,
|
||||
pageSize: 1000000,
|
||||
state: 1
|
||||
},
|
||||
dialogVisible: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// ======================== 弹窗 ======================== //
|
||||
// 打开
|
||||
show(list) {
|
||||
this.dialogVisible = true
|
||||
this.fetchHeadStoreId()
|
||||
},
|
||||
close() {
|
||||
this.list = Array.from([]);
|
||||
this.mulSelect = Array.from([]);
|
||||
this.dialogVisible = false
|
||||
},
|
||||
// ======================== 查询 ======================== //
|
||||
// 查询当前账户所在组织的总店的ID
|
||||
async fetchHeadStoreId() {
|
||||
let { code, rows, message } = await organizations({ storeRequest: null })
|
||||
if (code == '000000') {
|
||||
rows.forEach((item) => {
|
||||
if (!item.parentId) {
|
||||
this.queryForm.storeId = item.id
|
||||
this.fetchData()
|
||||
}
|
||||
});
|
||||
}
|
||||
if (code == '010000') {
|
||||
this.$message({
|
||||
message: message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 根据总店ID查询总店的所有项目
|
||||
async fetchData() {
|
||||
let { code, pageInfo, message } = await propage(this.queryForm)
|
||||
if (code == '000000') {
|
||||
this.list = Array.from(pageInfo.list);
|
||||
}
|
||||
if (code == '010000') {
|
||||
this.$message({
|
||||
message: message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
// ======================== 其它 ======================== //
|
||||
handleSelect(data) {
|
||||
this.mulSelect = Array.from(data);
|
||||
},
|
||||
handleRowClick(row) {
|
||||
this.$refs.list.toggleRowSelection(row)
|
||||
},
|
||||
// 确定
|
||||
confirm(row) {
|
||||
if (row.id) {
|
||||
this.$emit('call-back-project', [{ storeId: row.id, storeName: row.storeName, projectId: row.id, projectNum: row.projectNum, projectName: row.projectName }]);
|
||||
} else {
|
||||
let list = this.mulSelect.map((item) => {
|
||||
return { storeId: item.id, storeName: item.storeName, projectId: item.id, projectNum: item.projectNum, projectName: item.projectName }
|
||||
})
|
||||
this.$emit('call-back-project', list);
|
||||
}
|
||||
this.close()
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@ -0,0 +1 @@
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<el-dialog title="增加优惠券" :visible.sync="dialogFormVisible" ref="dialog" width="450px" @close="close">
|
||||
<el-dialog title="编辑" :visible.sync="dialogFormVisible" ref="dialog" width="450px" @close="close">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="auto">
|
||||
<el-form-item label="增量" prop="num">
|
||||
<el-input v-model.trim="form.num" clearable autocomplete="off" onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"></el-input>
|
||||
@ -1,72 +1,73 @@
|
||||
export const phoneNum = /^((1)|(\\+861)|(861))[0-9]{10}$/;
|
||||
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
||||
|
||||
// export const http = "https://www.decaisoft.com:443/";
|
||||
// export const https = "https://www.decaisoft.com:443/img";
|
||||
|
||||
export const http = "http://14.18.154.50:5757/img";
|
||||
export const https = "http://14.18.154.50:5757/img";
|
||||
|
||||
var month = "";
|
||||
if (new Date().getMonth() + 1 < 10) {
|
||||
month = "0" + (new Date().getMonth() + 1);
|
||||
} else {
|
||||
month = new Date().getMonth() + 1;
|
||||
}
|
||||
|
||||
var day = "";
|
||||
if (new Date().getDate() < 10) {
|
||||
day = "0" + new Date().getDate();
|
||||
} else {
|
||||
day = new Date().getDate();
|
||||
}
|
||||
|
||||
var hours = "";
|
||||
if (new Date().getHours() < 10) {
|
||||
hours = "0" + new Date().getHours();
|
||||
} else {
|
||||
hours = new Date().getHours();
|
||||
}
|
||||
|
||||
var Min = null;
|
||||
if (new Date().getMinutes() < 10) {
|
||||
Min = "0" + new Date().getMinutes();
|
||||
} else {
|
||||
Min = new Date().getMinutes();
|
||||
}
|
||||
var seconds = null;
|
||||
if (new Date().getSeconds() < 10) {
|
||||
seconds = "0" + new Date().getSeconds();
|
||||
} else {
|
||||
seconds = new Date().getSeconds();
|
||||
}
|
||||
|
||||
export const date =
|
||||
new Date().getFullYear() +
|
||||
"" +
|
||||
month +
|
||||
"" +
|
||||
day +
|
||||
"" +
|
||||
hours +
|
||||
"" +
|
||||
Min +
|
||||
"" +
|
||||
seconds;
|
||||
export const dates =
|
||||
new Date().getFullYear() +
|
||||
"/" +
|
||||
month +
|
||||
"/" +
|
||||
day +
|
||||
" " +
|
||||
hours +
|
||||
":" +
|
||||
Min +
|
||||
":" +
|
||||
seconds;
|
||||
|
||||
export const dayStatisticDate =
|
||||
new Date().getFullYear() + "-" + month + "-" + new Date().getDate();
|
||||
export const months = new Date().getFullYear() + "-" + month + "";
|
||||
export const phoneNum = /^((1)|(\\+861)|(861))[0-9]{10}$/;
|
||||
|
||||
export const email = /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;
|
||||
|
||||
// export const http = "https://www.decaisoft.com:443/";
|
||||
// export const https = "https://www.decaisoft.com:443/img";
|
||||
|
||||
export const http = "http://14.18.154.50:5757/img";
|
||||
export const https = "http://14.18.154.50:5757/img";
|
||||
export const imagePath = "https://139.9.185.131:8093/img"
|
||||
|
||||
var month = "";
|
||||
if (new Date().getMonth() + 1 < 10) {
|
||||
month = "0" + (new Date().getMonth() + 1);
|
||||
} else {
|
||||
month = new Date().getMonth() + 1;
|
||||
}
|
||||
|
||||
var day = "";
|
||||
if (new Date().getDate() < 10) {
|
||||
day = "0" + new Date().getDate();
|
||||
} else {
|
||||
day = new Date().getDate();
|
||||
}
|
||||
|
||||
var hours = "";
|
||||
if (new Date().getHours() < 10) {
|
||||
hours = "0" + new Date().getHours();
|
||||
} else {
|
||||
hours = new Date().getHours();
|
||||
}
|
||||
|
||||
var Min = null;
|
||||
if (new Date().getMinutes() < 10) {
|
||||
Min = "0" + new Date().getMinutes();
|
||||
} else {
|
||||
Min = new Date().getMinutes();
|
||||
}
|
||||
var seconds = null;
|
||||
if (new Date().getSeconds() < 10) {
|
||||
seconds = "0" + new Date().getSeconds();
|
||||
} else {
|
||||
seconds = new Date().getSeconds();
|
||||
}
|
||||
|
||||
export const date =
|
||||
new Date().getFullYear() +
|
||||
"" +
|
||||
month +
|
||||
"" +
|
||||
day +
|
||||
"" +
|
||||
hours +
|
||||
"" +
|
||||
Min +
|
||||
"" +
|
||||
seconds;
|
||||
export const dates =
|
||||
new Date().getFullYear() +
|
||||
"/" +
|
||||
month +
|
||||
"/" +
|
||||
day +
|
||||
" " +
|
||||
hours +
|
||||
":" +
|
||||
Min +
|
||||
":" +
|
||||
seconds;
|
||||
|
||||
export const dayStatisticDate =
|
||||
new Date().getFullYear() + "-" + month + "-" + new Date().getDate();
|
||||
export const months = new Date().getFullYear() + "-" + month + "";
|
||||
|
||||
Loading…
Reference in New Issue