Commit 097ea963 authored by 赵茹林's avatar 赵茹林

Merge branch 'dev' of git.singsingenglish.com:new-sing/admin into dev

parents b95e6545 7edf6ee5
<template>
<el-dialog
:title="dialogObj.title"
:visible.sync="dialogObj.show"
center
width="800px">
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label="合同协议名称" prop="contract_name" label-width="120px">
<el-input v-model="form.contract_name" clearable></el-input>
</el-form-item>
<el-form-item label="类型" prop="contract_type" label-width="120px">
<el-select v-model="form.contract_type" placeholder="请选择" clearable>
<el-option label="用户协议" value="0"></el-option>
<el-option label="正式课合同" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item label="关联商品" label-width="120px">
<el-select multiple v-model="form.goods_ids" placeholder="请选择" clearable
:popper-class="'refresh-select-multi width-480'" style="width: 480px">
<el-option
v-for="data in goodslist"
:key="data.id"
:label="`【${data.id}】${data.name}`"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="合同/协议文本" prop="" label-width="120px" required>
<!-- <el-input type="textarea" :rows="10" v-model="form.contract_text"></el-input>-->
<editor-detail :lookData="form.contract_text"/>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogObj.show = false">取 消</el-button>
<el-button type="primary" @click="sub">保 存</el-button>
</span>
</el-dialog>
</template>
<script>
import {contractGoodslistApi, contractAddApi, contractEditApi} from "../../service/api";
import editorDetail from "./editorDetail";
export default {
name: "dialogObj",
props: [
'dialogObj'
],
components: {
editorDetail
},
data() {
return {
form: {
contract_name: '',
contract_type: '',
goods_ids: [],
contract_text: {
detail: ""
}
},
goodslist: [],
rules: {
contract_name: [
{required: true, message: '请输入赠品名称'},
{max: 20, message: '合同协议名称不能超过20汉字'}
],
contract_type: [
{required: true, message: '请选择类型', trigger: 'change'}
]
}
}
},
methods: {
sub() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (!this.form.contract_text.detail) {
this.$message({
message: '合同/协议文本不能为空',
type: 'error'
});
return;
}
let json = {
contract_name: this.form.contract_name,
contract_type: this.form.contract_type,
goods_ids: this.form.goods_ids.join(','),
contract_text: this.form.contract_text.detail
};
switch (this.dialogObj.type) {
case 0:
contractAddApi(json).then(res => {
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
break;
case 1:
contractEditApi(this.dialogObj.id, json).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
break;
}
} else {
return false;
}
});
}
},
created() {
contractGoodslistApi().then(res => {
this.goodslist = res.goods_list;
});
},
watch: {
'dialogObj.show'() {
this.$nextTick(() => {
this.form.goods_ids = [];
this.form.contract_text.detail = '';
this.$refs['form'].resetFields();
if (this.dialogObj.type == 1) {
let goods_ids_arr = [];
if (this.dialogObj.goods_ids) {
this.dialogObj.goods_ids.split(',').map(i => {
goods_ids_arr.push(Number(i));
});
}
this.form.name = this.dialogObj.name;
this.form.contract_name = this.dialogObj.contract_name;
this.form.contract_type = this.dialogObj.contract_type.toString();
this.form.goods_ids = goods_ids_arr;
this.form.contract_text.detail = this.dialogObj.contract_text;
}
});
}
}
}
</script>
<style scoped>
</style>
<template>
<div class='tinymce'>
<editor id='tinymce' v-model='lookData.detail' :init='init'></editor>
<div>
<div class="imgInter" @click="showDialog()">插入图片</div>
</div>
<el-dialog
title="插入图片"
:visible.sync="dialogVisible"
:modal-append-to-body="false"
:close-on-click-modal="false"
center
:append-to-body="true"
width="550px">
<el-form label-width="80px">
<el-form-item label="图片">
<el-upload
action="/api/public/upload"
:http-request="uploadFile"
:on-remove="removeFile"
:before-upload="beforeAvatarUploadImg"
drag
:on-exceed="handleExceed"
multiple
:limit="1"
:file-list="form.imgList">
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
<div class="el-upload__tip" slot="tip">只能上传png或jpg文件</div>
</el-upload>
</el-form-item>
<el-form-item label="铺满">
<el-switch
v-model="form.big">
</el-switch>
</el-form-item>
<el-form-item label="居中">
<el-switch
v-model="form.center">
</el-switch>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button type="primary" @click="imgInter">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import tinymce from 'tinymce/tinymce'
import 'tinymce/themes/modern/theme'
import Editor from '@tinymce/tinymce-vue'
import 'tinymce/plugins/link'
import 'tinymce/plugins/code'
import 'tinymce/plugins/table'
import 'tinymce/plugins/lists'
import 'tinymce/plugins/contextmenu'
import 'tinymce/plugins/wordcount'
import 'tinymce/plugins/textcolor'
import 'tinymce/plugins/colorpicker'
import 'tinymce/plugins/preview'
import 'tinymce/plugins/fullpage'
import 'tinymce/plugins/textpattern'
import 'tinymce/plugins/colorpicker'
import 'tinymce/plugins/media'
import {uploadFileApi} from "../../service/api";
export default {
name: 'tinymce',
props:[
'lookData'
],
data () {
return {
radio:[],
imageType:false,
form:{
imgList:[],
big:false,
weight:'',
center:true
},
show:'',
dialogVisible:false,
init: {
toolbar:'bold italic underline strikethrough | fontselect | fontsizeselect | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | outdent indent blockquote | undo redo | link unlink image code | ',
language_url: '/static/tinymce/zh_CN.js',
language: 'zh_CN',
skin_url: '/static/tinymce/skins/lightgray',
height: 500,
plugins: 'preview textpattern colorpicker lists code colorpicker fullpage textcolor wordcount contextmenu media',
branding: false,
}
}
},
activated(){
this.show = true
},
deactivated(){
},
mounted () {
},
methods:{
beforeAvatarUploadImg(file){
const isJPG = (file.type === 'image/jpeg' || file.type === 'image/png' );
if (!isJPG) {
this.$message.error('上传头像图片只能是 JPG 或 PNG 格式!');
}
return isJPG;
},
imgInter(){
if(this.form.imgList.length < 1){
this.$message({
type: 'error',
message: '请选择图片'
});
return false
}
let ImageStyle = '';
if(this.form.big){
ImageStyle += 'width:100%;'
}else{
ImageStyle += 'width:70%'
}
if(this.form.center){
ImageStyle = 'display:block;margin:auto'
}
let str= `<img src="${this.form.imgList[0].url}" style="${ImageStyle}"/>`;
tinymce.activeEditor.insertContent(str);
this.dialogVisible = false
},
uploadFile(a){
uploadFileApi({file:a.file,type:'local'}).then(res=>{
this.$message({
type: 'success',
message: '上传成功!'
});
this.form.imgList = [{name:res.name,url:process.env.IMAGE_URL_HEAD + res.url}];
})
},
showDialog(){
this.dialogVisible = true;
this.form={
imgList:[],
big:false,
weight:'',
center:true
}
},
insertContent(content) {
if (!content) {//如果插入的内容为空则返回
return;
}
let sel = null;
if (document.selection) {//IE9以下
sel = document.selection;
sel.createRange().pasteHTML(content);
} else {
sel = document.getElementById('tinymce_ifr').contentWindow.getSelection();
if (sel.rangeCount > 0) {
let range = sel.getRangeAt(0); //获取选择范围
range.deleteContents(); //删除选中的内容
let el = document.createElement("div"); //创建一个空的div外壳
el.innerHTML = content; //设置div内容为我们想要插入的内容。
let frag = document.createDocumentFragment();//创建一个空白的文档片段,便于之后插入dom树
let node = el.firstChild;
let lastNode = frag.appendChild(node);
range.insertNode(frag); //设置选择范围的内容为插入的内容
let contentRange = range.cloneRange(); //克隆选区
contentRange.setStartAfter(lastNode); //设置光标位置为插入内容的末尾
contentRange.collapse(true); //移动光标位置到末尾
sel.removeAllRanges(); //移出所有选区
sel.addRange(contentRange); //添加修改后的选区
}
}
},
removeFile(){},
handleExceed(){}
},
created:function(){
tinymce.init({})
},
components: {Editor}
}
</script>
<style scoped lang="less">
@import "../../util/public";
.tinymce{
position: relative;
.clear-both;
.imgInter{
position: absolute;
display: inline-block;
text-shadow: 0 1px 1px rgba(255,255,255,0.75);
top: 3px;
left: 330px;
box-shadow: none;
filter: none;
padding: 4px 6px;
border: 1px solid transparent;
line-height: 1.4;
margin: 0 5px;
&:hover{
border-color: #e2e4e7;
cursor: pointer;
}
}
}
</style>
<template>
<div class="container">
<div class="search-form">
<el-button type="success" size="small" plain icon="el-icon-plus" @click="add">新增</el-button>
</div>
<div class="table-form">
<el-table :data="dataList" size="mini" style="width: 100%">
<el-table-column prop="contract_number" label="合同协议编号"></el-table-column>
<el-table-column prop="contract_name" label="合同协议名称"></el-table-column>
<el-table-column prop="contract_type" label="类型">
<template slot-scope="scope">
<div v-if="scope.row.contract_type == 0">用户协议</div>
<div v-if="scope.row.contract_type == 1">正式课合同</div>
</template>
</el-table-column>
<el-table-column prop="goods_name" label="关联商品"></el-table-column>
<el-table-column prop="created_at" label="创建时间"></el-table-column>
<el-table-column prop="updated_at" label="最后编辑时间"></el-table-column>
<el-table-column prop="operator" label="最后编辑人"></el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<div v-if="scope.row.status == 0">启用</div>
<div v-if="scope.row.status == 1">停用</div>
</template>
</el-table-column>
<el-table-column width="150" label="操作">
<template slot-scope="scope">
<el-button type="primary" size="mini" plain @click="edit(scope.row)">编辑</el-button>
<el-button v-if="scope.row.status == 0" type="warning" size="mini" plain @click="switchStatus(scope.row)">
停用
</el-button>
<el-button v-if="scope.row.status == 1" type="success" size="mini" plain @click="switchStatus(scope.row)">
启用
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<dialog-com :dialogObj="dialogObj" @reflash="getDataList"/>
</div>
</template>
<script>
import {contractListApi, contractSwitchstatusApi} from "../../service/api";
import dialogCom from './dialog';
export default {
name: "index",
data() {
return {
dataList: [],
dialogObj: {
type: 0,
show: false,
id: '',
title: ''
}
}
},
components: {
dialogCom
},
methods: {
getDataList() {
contractListApi().then(res => {
this.dataList = res;
});
},
add() {
this.dialogObj = {
type: 0,
show: true,
id: '',
title: '新增合同协议'
}
},
edit(data) {
this.dialogObj = {
type: 1,
show: true,
id: data.id,
title: '编辑合同协议',
contract_name: data.contract_name,
contract_type: data.contract_type,
goods_ids: data.goods_ids,
contract_text: data.contract_text
}
},
switchStatus(data) {
let json = {
status: data.status
};
if (data.status == 0) {
json.status = 1;
}
if (data.status == 1) {
json.status = 0;
}
contractSwitchstatusApi(data.id, json).then(res => {
if (json.status == 0) {
this.$confirm('此操作将启用合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '启用成功'
});
this.getDataList();
}).catch(() => {});
}
if (json.status == 1) {
this.$confirm('此操作将停用合同?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$message({
type: 'success',
message: '停用成功'
});
this.getDataList();
}).catch(() => {});
}
});
},
},
created() {
this.getDataList();
}
}
</script>
<style scoped>
.container {
padding: 20px;
}
.search-form {
margin-bottom: 20px;
}
</style>
<template>
<el-dialog
:title="dialogObj.title"
:visible.sync="dialogObj.show"
center
width="500px">
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label="赠品名称" prop="name">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="成本价格" prop="cost_price">
<el-input v-model.number="form.cost_price"></el-input>
</el-form-item>
<el-form-item label="赠品总数" prop="gift_num">
<el-input v-model.number="form.gift_num" @change="giftNumChange"></el-input>
</el-form-item>
<el-form-item label="库存数量" prop="stock_num">
<div>{{form.stock_num}}</div>
</el-form-item>
<el-form-item label="赠品类型" prop="type">
<el-select v-model="form.type" placeholder="请选择" clearable>
<el-option label="渠道赠品(市场渠道或投放需求关联的赠品)" value="1"></el-option>
<el-option label="活动赠品(全勤打卡或其他运营活动关联的赠品)" value="2"></el-option>
<el-option label="关联赠品(销售为了关单而赠送的赠品)" value="3"></el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogObj.show = false">取 消</el-button>
<el-button type="primary" @click="sub">保 存</el-button>
</span>
</el-dialog>
</template>
<script>
import {giftConfigAddApi, giftConfigEditApi} from "../../service/api";
export default {
name: "dialogObj",
props: [
'dialogObj'
],
data() {
const validGiftNum = (rule, value, callback) => {
if (!/^[\d\/]+$/.test(value)) {
callback(new Error('只能填阿拉伯数字'));
} else {
callback();
}
};
return {
form: {
name: '',
cost_price: '',
gift_num: '/',
stock_num: 0,
type: ''
},
rules: {
name: [
{required: true, message: '请输入赠品名称'},
{max: 20, message: '赠品名称不能超过20汉字'}
],
cost_price: [
{required: true, message: '请输入成本价格'},
{type: 'number', message: '只能填阿拉伯数字'}
],
gift_num: [
{required: true, message: '请输入赠品总数'},
{validator: validGiftNum}
],
type: [
{required: true, message: '请选择赠品类型', trigger: 'change'}
]
}
}
},
methods: {
giftNumChange() {
if (!this.form.gift_num) {
this.form.gift_num = '/';
}
},
sub() {
this.$refs['form'].validate((valid) => {
if (valid) {
let json = {
name: this.form.name,
cost_price: this.form.cost_price,
type: this.form.type
};
if (this.form.gift_num != '/') {
json.gift_num = this.form.gift_num;
}
switch (this.dialogObj.type) {
case 0:
giftConfigAddApi(json).then(res => {
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
break;
case 1:
giftConfigEditApi(this.dialogObj.id, json).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
break;
}
} else {
return false;
}
});
}
},
watch: {
'dialogObj.show'() {
this.$nextTick(() => {
this.$refs['form'].resetFields();
if (this.dialogObj.type == 1) {
this.form.name = this.dialogObj.name;
this.form.cost_price = this.dialogObj.cost_price;
this.form.gift_num = this.dialogObj.gift_num;
this.form.stock_num = this.dialogObj.stock_num;
this.form.type = this.dialogObj.gift_type.toString();
}
});
}
}
}
</script>
<style scoped>
</style>
<template>
<div class="container">
<div class="search-form">
<el-form :inline="true" :model="searchFrom" size="small">
<el-form-item label="赠品名称" label-width="100px">
<el-input v-model="searchFrom.name" clearable></el-input>
</el-form-item>
<el-form-item label="类型" label-width="100px">
<el-select v-model="searchFrom.type" placeholder="请选择" clearable>
<el-option label="渠道赠品" value="1"></el-option>
<el-option label="活动赠品" value="2"></el-option>
<el-option label="关联赠品" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getDataList">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="success" plain icon="el-icon-plus" @click="add">新增</el-button>
</el-form-item>
</el-form>
</div>
<div class="table-form">
<el-table :data="dataList" size="mini" style="width: 100%">
<el-table-column prop="id" label="ID"></el-table-column>
<el-table-column prop="name" label="赠品名称"></el-table-column>
<el-table-column prop="gift_type" label="赠品类型">
<template slot-scope="scope">
<div v-if="scope.row.gift_type == 1">渠道赠品</div>
<div v-if="scope.row.gift_type == 2">活动赠品</div>
<div v-if="scope.row.gift_type == 3">关联赠品</div>
</template>
</el-table-column>
<el-table-column prop="cost_price" label="成本价"></el-table-column>
<el-table-column prop="gift_num" label="赠品总数"></el-table-column>
<el-table-column prop="stock_num" label="库存数量"></el-table-column>
<el-table-column prop="get_num" label="领取数量"></el-table-column>
<el-table-column prop="status" label="状态">
<template slot-scope="scope">
<div v-if="scope.row.status == 1">上架</div>
<div v-if="scope.row.status == 2">下架</div>
</template>
</el-table-column>
<el-table-column width="150" label="操作">
<template slot-scope="scope">
<el-button type="primary" size="mini" plain @click="edit(scope.row)">编辑</el-button>
<el-button type="warning" size="mini" plain @click="onDown(scope.row)">下架</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination">
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
<dialog-com :dialogObj="dialogObj" @reflash="getDataList"/>
</div>
</template>
<script>
import page from "../framework/page";
import {relationGiftApi, giftSoldoutApi} from "../../service/api";
import dialogCom from './dialog';
export default {
name: "index",
components: {
page,
dialogCom
},
data() {
return {
searchFrom: {
name: '',
type: ''
},
dataList: [],
nowPage: 1,
total: 0,
limit: 10,
dialogObj: {
type: 0,
show: false,
id: '',
title: ''
}
}
},
methods: {
getDataList() {
let json = {
name: this.searchFrom.name,
type: this.searchFrom.type,
limit: this.limit,
page: this.nowPage
};
relationGiftApi(json).then(res => {
this.dataList = res.list;
this.total = res.total;
});
},
add() {
this.dialogObj = {
type: 0,
show: true,
id: '',
title: '新增赠品'
}
},
edit(data) {
this.dialogObj = {
type: 1,
show: true,
id: data.id,
title: '编辑赠品',
name: data.name,
cost_price: data.cost_price,
gift_num: data.gift_num,
stock_num: data.stock_num,
gift_type: data.gift_type
};
},
onDown(data) {
this.$confirm('此操作将下架该商品?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
giftSoldoutApi(data.id).then(res => {
this.$message({
type: 'success',
message: '操作成功!'
});
this.getDataList();
});
}).catch(() => {
});
},
changeShow(data) {
this.dialogObj.show = data;
},
onPageChange(val) {
this.nowPage = val;
this.getDataList();
},
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getDataList();
}
},
created() {
this.getDataList();
}
}
</script>
<style scoped>
.container {
padding: 20px;
}
</style>
<template>
<div class="container">
<div class="search-form">
<el-form :inline="true" :model="searchFrom" size="small">
<el-form-item label="赠品名称" label-width="100px">
<el-input v-model="searchFrom.gift_name" clearable></el-input>
</el-form-item>
<el-form-item label="类型" label-width="100px">
<el-select v-model="searchFrom.gift_type" placeholder="请选择" clearable>
<el-option label="渠道赠品" value="1"></el-option>
<el-option label="活动赠品" value="2"></el-option>
<el-option label="关联赠品" value="3"></el-option>
</el-select>
</el-form-item>
<el-form-item label="期数名称" label-width="100px">
<el-input v-model="searchFrom.periods_title" clearable></el-input>
</el-form-item>
<el-form-item label="班级名称" label-width="100px">
<el-input v-model="searchFrom.class_name" clearable></el-input>
</el-form-item>
<el-form-item label="学员电话" label-width="100px">
<el-input v-model="searchFrom.mobile" clearable></el-input>
</el-form-item>
<el-form-item label="领取时间" label-width="100px">
<el-date-picker
v-model="searchFrom.receiveTime"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getRecordList">搜索</el-button>
</el-form-item>
<el-form-item>
<el-button type="success" plain @click="exportTable">导出</el-button>
</el-form-item>
</el-form>
</div>
<div class="table-form">
<el-table :data="recordList" size="mini" style="width: 100%">
<el-table-column prop="gift_name" label="赠品名称"></el-table-column>
<el-table-column prop="gift_type" label="赠品类型">
<template slot-scope="scope">
<div v-if="scope.row.gift_type == 1">渠道赠品</div>
<div v-if="scope.row.gift_type == 2">活动赠品</div>
<div v-if="scope.row.gift_type == 3">关联赠品</div>
</template>
</el-table-column>
<el-table-column prop="quantity" label="数量"></el-table-column>
<el-table-column prop="cost" label="成本"></el-table-column>
<el-table-column prop="periods_title" label="期数名称"></el-table-column>
<el-table-column prop="class_name" label="班级名称"></el-table-column>
<el-table-column prop="money" label="实付金额"></el-table-column>
<el-table-column prop="teacher_name" label="带班老师"></el-table-column>
<el-table-column prop="nickname" label="学员名称"></el-table-column>
<el-table-column prop="mobile" label="学员电话"></el-table-column>
<el-table-column prop="address" label="学员地址"></el-table-column>
<el-table-column prop="created_at" label="领取时间"></el-table-column>
<el-table-column prop="deliver_at" label="物流导入时间"></el-table-column>
<el-table-column prop="express_no" label="快递单号"></el-table-column>
</el-table>
</div>
<div class="pagination">
<page :nowPage="nowPage" :total="total" :limit="limit" @pageChange="onPageChange" @sizeChange="onSizeChange"/>
</div>
</div>
</template>
<script>
import page from "../framework/page";
import { receiveRecordApi, exportExcelApi } from "../../service/api";
export default {
name: "index",
components: {
page
},
data() {
return {
searchFrom: {
gift_name: '',
gift_type: '',
periods_title: '',
class_name: '',
mobile: '',
receiveTime: []
},
recordList: [],
nowPage: 1,
total: 0,
limit: 10
}
},
methods: {
getRecordList() {
let json = {
gift_name: this.searchFrom.gift_name,
gift_type: this.searchFrom.gift_type,
periods_title: this.searchFrom.periods_title,
class_name: this.searchFrom.class_name,
mobile: this.searchFrom.mobile,
start_at: this.searchFrom.receiveTime[0],
over_at: this.searchFrom.receiveTime[1],
limit: this.limit,
page: this.nowPage
};
receiveRecordApi(json).then(res => {
this.recordList = res.list;
this.total = res.total;
});
},
onPageChange(val) {
this.nowPage = val;
this.getRecordList();
},
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getRecordList();
},
exportTable() {
let json = {
gift_name: this.searchFrom.gift_name,
gift_type: this.searchFrom.gift_type,
periods_title: this.searchFrom.periods_title,
class_name: this.searchFrom.class_name,
mobile: this.searchFrom.mobile,
start_at: this.searchFrom.receiveTime[0],
over_at: this.searchFrom.receiveTime[1]
};
exportExcelApi("/api/admin/gift/receive/record/export", json);
},
},
created() {
this.getRecordList();
}
}
</script>
<style scoped>
.container {
padding: 20px;
}
</style>
This diff is collapsed.
<template>
<el-dialog
:title="dialogObj.title"
center
append-to-body
:visible.sync="dialogObj.show">
<div v-if="dialogObj.gift_deliver" class="dialog-content">
<div class="dialog-text">物流已发货,不能修改赠品信息!</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogObj.show = false">知道了</el-button>
</span>
</div>
<div v-else class="dialog-content">
<div>当前商品:{{dialogObj.goods_name}}</div>
<div>
<el-form ref="form" :model="form" :rules="rules">
<el-form-item label="选择赠品" required prop="selectedGiftList">
<el-select multiple v-model="form.selectedGiftList" placeholder="全部">
<el-option v-for="data in selectedGiftList"
:key="data.id"
:label="`【${data.id}】${data.name}`"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogObj.show = false">取 消</el-button>
<el-button type="primary" @click="sub" :disabled="selectedGiftList.length == 0">确 定</el-button>
</span>
</div>
</el-dialog>
</template>
<script>
import {relationGiftApi, orderSetApi} from "../../service/api";
export default {
name: "giftDeliverDialog",
props: [
'dialogObj'
],
data() {
return {
form: {
selectedGiftList: []
},
selectedGiftList: [],
rules: {
selectedGiftList: [
{required: true, message: '请选择赠品', trigger: 'change'}
]
}
}
},
methods: {
initDialog() {
relationGiftApi({goods_id: this.dialogObj.goods_id}).then(res => {
this.selectedGiftList = res.list;
});
},
sub() {
this.$refs['form'].validate((valid) => {
if (valid) {
let json = {
gift_ids: this.form.selectedGiftList.join(','),
goods_id: this.dialogObj.goods_id,
user_id: this.dialogObj.user_id,
user_address_id: this.dialogObj.user_address_id,
out_trade_no: this.dialogObj.out_trade_no
};
orderSetApi(json).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
} else {
return false;
}
});
},
},
watch: {
'dialogObj.show'(val) {
if (val) {
this.initDialog();
}
}
},
}
</script>
<style scoped>
.dialog-content {
text-align: center;
}
.dialog-content div {
margin-bottom: 20px;
text-align: left;
}
.dialog-content .dialog-text {
text-align: center;
}
</style>
This diff is collapsed.
...@@ -99,7 +99,6 @@ export const getTeacherListApi = function (json) { ...@@ -99,7 +99,6 @@ export const getTeacherListApi = function (json) {
//获取教师详情 //获取教师详情
const getTeacherDetailUrl = `${_baseUrl}api/admin/teacher/info`; const getTeacherDetailUrl = `${_baseUrl}api/admin/teacher/info`;
export const getTeacherDetailApi = function (id, json) { export const getTeacherDetailApi = function (id, json) {
console.log(id)
return Vue.prototype.$fetch(`${getTeacherDetailUrl}/${id}`, json) return Vue.prototype.$fetch(`${getTeacherDetailUrl}/${id}`, json)
}; };
//添加教师 //添加教师
...@@ -237,7 +236,6 @@ const deleteGoodsUrl = `${_baseUrl}api/admin/goods`; ...@@ -237,7 +236,6 @@ const deleteGoodsUrl = `${_baseUrl}api/admin/goods`;
export const deleteGoodsApi = function (id) { export const deleteGoodsApi = function (id) {
return Vue.prototype.$del(`${deleteGoodsUrl}/${id}`) return Vue.prototype.$del(`${deleteGoodsUrl}/${id}`)
}; };
// 商品上架 // 商品上架
const upGoodsUrl = `${_baseUrl}api/admin/goods/putaway/`; const upGoodsUrl = `${_baseUrl}api/admin/goods/putaway/`;
export const upGoodsApi = function (id) { export const upGoodsApi = function (id) {
...@@ -1220,7 +1218,6 @@ export const deleteQuestionModularDetailApi = function (question_id) { ...@@ -1220,7 +1218,6 @@ export const deleteQuestionModularDetailApi = function (question_id) {
export const sortQuestionModularDetailApi = function (json) { export const sortQuestionModularDetailApi = function (json) {
return Vue.prototype.$put(`/api/admin/question/sort/`, json) return Vue.prototype.$put(`/api/admin/question/sort/`, json)
}; };
//用户收货地址 //用户收货地址
export const fetchAddressListApi = function (uid) { export const fetchAddressListApi = function (uid) {
return Vue.prototype.$fetch(`/api/admin/student/address/${uid}`) return Vue.prototype.$fetch(`/api/admin/student/address/${uid}`)
...@@ -1502,4 +1499,58 @@ export const getHourTimeApi = function (json) { ...@@ -1502,4 +1499,58 @@ export const getHourTimeApi = function (json) {
export const getGrowthRecordApi = function (json) { export const getGrowthRecordApi = function (json) {
return Vue.prototype.$fetch(`${_baseUrl}api/admin/user/growth/list`,json) return Vue.prototype.$fetch(`${_baseUrl}api/admin/user/growth/list`,json)
}; };
//赠品配置列表
const relationGiftUrl = `${_baseUrl}api/admin/gift/config/list`;
export const relationGiftApi = function (json) {
return Vue.prototype.$fetch(`${relationGiftUrl}`, json)
};
// 订单配置赠品
const orderSetUrl = `${_baseUrl}api/admin/order/set/gift`;
export const orderSetApi = function (json) {
return Vue.prototype.$post(`${orderSetUrl}`, json)
};
// 赠品领取记录
const receiveRecordUrl = `${_baseUrl}api/admin/gift/receive/record`;
export const receiveRecordApi = function (json) {
return Vue.prototype.$fetch(`${receiveRecordUrl}`, json)
};
// 添加赠品配置
const giftConfigAddUrl = `${_baseUrl}api/admin/gift/config/add`;
export const giftConfigAddApi = function (json) {
return Vue.prototype.$post(`${giftConfigAddUrl}`, json)
};
// 编辑赠品配置
const giftConfigEditUrl = `${_baseUrl}api/admin/gift/config`;
export const giftConfigEditApi = function (id, json) {
return Vue.prototype.$put(`${giftConfigEditUrl}/${id}`, json)
};
// 赠品下架
const giftSoldoutUrl = `${_baseUrl}api/admin/gift/soldout`;
export const giftSoldoutApi = function (id) {
return Vue.prototype.$patch(`${giftSoldoutUrl}/${id}`)
};
// 合同协议列表
const contractListUrl = `${_baseUrl}api/admin/contract/list`;
export const contractListApi = function () {
return Vue.prototype.$fetch(`${contractListUrl}`)
};
// 合同状态切换
const contractSwitchstatusUrl = `${_baseUrl}api/admin/contract/switchstatus`;
export const contractSwitchstatusApi = function (id, json) {
return Vue.prototype.$put(`${contractSwitchstatusUrl}/${id}`, json)
};
// 合同协议绑定商品
const contractGoodslistUrl = `${_baseUrl}api/admin/contract/goodslist`;
export const contractGoodslistApi = function () {
return Vue.prototype.$fetch(`${contractGoodslistUrl}`)
};
// 合同协议创建
const contractAddUrl = `${_baseUrl}api/admin/contract/add`;
export const contractAddApi = function (json) {
return Vue.prototype.$post(`${contractAddUrl}`, json)
};
// 合同协议编辑
const contractEditUrl = `${_baseUrl}api/admin/contract/edit`;
export const contractEditApi = function (id, json) {
return Vue.prototype.$patch(`${contractEditUrl}/${id}`, json)
};
...@@ -536,6 +536,26 @@ export default [ ...@@ -536,6 +536,26 @@ export default [
name: 'disposable', name: 'disposable',
component: e => require(['@/components/disposable'], e), component: e => require(['@/components/disposable'], e),
} }
}, {
value: '赠品配置',
routerName: 'gitConfig',
path: '/gitConfig',
cover: '6-5',
router: {
path: '/gitConfig',
name: 'gitConfig',
component: e => require(['@/components/gitConfig'], e),
}
}, {
value: '赠品领取记录',
routerName: 'gitDeliverRecord',
path: '/gitDeliverRecord',
cover: '6-6',
router: {
path: '/gitDeliverRecord',
name: 'gitDeliverRecord',
component: e => require(['@/components/gitDeliverRecord'], e),
}
} }
] ]
}, { }, {
...@@ -720,7 +740,17 @@ export default [ ...@@ -720,7 +740,17 @@ export default [
name: 'config', name: 'config',
component: e => require(['@/components/config'], e), component: e => require(['@/components/config'], e),
} }
}, }, {
value: '合同协议管理',
routerName: 'contract',
path: '/contract',
cover: '10-6',
router: {
path: '/contract',
name: 'contract',
component: e => require(['@/components/contract'], e),
}
}
] ]
}, { }, {
name: '', name: '',
......
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