Commit 7edf6ee5 authored by chenjundi's avatar chenjundi

新增赠品配置、赠品领取记录、合同协议管理,修改商品列表、系统订单列表

parent e2e8dbdd
<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>
......@@ -143,6 +143,7 @@
<el-form-item v-if="form.goods_type==4" label="领取到期时间(小时)" label-width="160px">
<el-input-number v-model="form.goods_desc.time_limit"></el-input-number>
</el-form-item>
<el-form-item v-if="form.goods_type==1||form.goods_type==2" label="是否赠送优惠券" label-width="160px">
<el-select v-model="form.goods_desc.coupon_goods_id" placeholder="请选择">
<el-option v-for="data in coupongoods"
......@@ -152,7 +153,18 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="课程封面(670*472)" v-if="form.goods_type !== 3 && form.goods_type !== 4 && form.goods_type !== 5" required>
<el-form-item label="关联赠品" v-if="dialogObj.type == 0 || dialogObj.type == 1">
<el-select v-model="form.relation_gift" multiple placeholder="请选择" clearable>
<el-option
v-for="data in relation_gift"
:key="data.id"
:label="`【${data.id}】${data.name}`"
:value="data.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="课程封面(670*472)"
v-if="form.goods_type !== 3 && form.goods_type !== 4 && form.goods_type !== 5" required>
<el-upload
list-type="picture-card"
class="upload-demo"
......@@ -224,12 +236,16 @@
<el-row>
<el-col :span="12">
<el-form-item :label="form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '原价(元)' :form.goods_type === 4 ? '抵扣价格(元)' : '单买价格(元)'" required>
<el-form-item
:label="form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '原价(元)' :form.goods_type === 4 ? '抵扣价格(元)' : '单买价格(元)'"
required>
<el-input-number v-model="form.original_price" label="原价"></el-input-number>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item :label="form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '现价(元)' :form.goods_type === 4 ? '购买价格(元)' : '拼团价格(元)'" required>
<el-form-item
:label="form.goods_type === 1 || form.goods_type === 3 || form.goods_type === 5 ? '现价(元)' :form.goods_type === 4 ? '购买价格(元)' : '拼团价格(元)'"
required>
<el-input-number v-model="form.current_price" label="现价"></el-input-number>
</el-form-item>
</el-col>
......@@ -305,525 +321,535 @@
</template>
<script>
import {
getLessonApi,
addGoodsApi,
editGoodsApi,
getGoodsDetailApi,
uploadFileApi,
getGoodsListApi
} from "../../service/api";
import {TEACHERTYPE, GOODSTYPE} from "../../util/wordbook";
import editorDetail from "./editorDetail"
import editorKnow from "./editorKnow"
import {
getLessonApi,
addGoodsApi,
editGoodsApi,
getGoodsDetailApi,
uploadFileApi,
getGoodsListApi,
relationGiftApi
} from "../../service/api";
import {TEACHERTYPE, GOODSTYPE} from "../../util/wordbook";
import editorDetail from "./editorDetail"
import editorKnow from "./editorKnow"
export default {
name: "dialogObj",
props: [
'dialogObj',
],
components: { // 引入组件
editorDetail,
editorKnow
},
filters: {
filterGoods(val) {
return '[' + GOODSTYPE[val.goods_type] + ']' + '[' + val.current_price / 100 + '元]' + val.name
}
},
data() {
return {
tiny: {
height: 300
},
sendObj: {
content: 'nihao'
},
loading: true,
goodsYou: [],
goodsList: [],
form: {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
imgLesson: [],
img: [],
course_title: '',
time_limit: 0
},
course_id: '',
course_type: 0,
watch_num: '',
invite_earnings: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
img: [],
refImg: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
after_goods_id: '',
before_goods_id: ''
},
is_into_periods: '0'
export default {
name: "dialogObj",
props: [
'dialogObj',
],
components: { // 引入组件
editorDetail,
editorKnow
},
lessonList: [],
goOn_goods_Id: {
after_goods_id: '',
before_goods_id: ''
},
coupongoods: [],
false: false
}
},
methods: {
goodsChange() {
if (this.form.goods_type == 4 || this.form.goods_type == 3) {
let json = {
limit: '999',
page: '1',
goods_type: '1,2',
status: "1"
};
getGoodsListApi(json).then(res => {
console.log(json)
// debugger
this.goodsList = res.list
});
} else if (this.form.goods_type == 1 || this.form.goods_type == 2) {
// debugger
let json = {
limit: '999',
page: '1',
goods_type: '4',
};
getGoodsListApi(json).then(res => {
console.log(res)
// debugger
let item = {
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
},
sub() {
console.log(this.form)
if (!this.form.share_desc.img && this.form.goods_type == 2) {
this.$message({
type: 'success',
message: '请上传主图!'
});
return
}
let _json = JSON.parse(JSON.stringify(this.form) + '');
console.log(this.form)
// debugger
if (_json.goods_type === 3 || _json.goods_type === 4 || _json.goods_type === 5) {
_json.course_id = 0;
_json.watch_num = 0;
}
if (_json.goods_type === 5) {
_json.is_real = 1;
}
_json.desc.before_goods_id = this.goOn_goods_Id.before_goods_id;
if (this.goodsYou.length < 1) {
_json.desc.use_goods_ids = ''
} else {
_json.desc.use_goods_ids = this.goodsYou.toString()
}
_json.desc.after_goods_id = this.goOn_goods_Id.after_goods_id;
_json.original_price = (_json.original_price * 100).toFixed(0);
_json.current_price = (_json.current_price * 100).toFixed(0);
_json.invite_earnings = (_json.invite_earnings * 100).toFixed(0);
_json.goods_desc = JSON.stringify(_json.goods_desc);
_json.desc = JSON.stringify(_json.desc);
_json.share_desc = JSON.stringify(_json.share_desc);
switch (this.dialogObj.type) {
case 1:
editGoodsApi(this.dialogObj.id, _json).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
break;
case 0:
console.log(_json)
addGoodsApi(_json).then(res => {
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
})
break
}
},
removeFileMain(a) {
let x = this.form.goods_desc.img.findIndex(i => {
return i.name === a.name
});
this.form.goods_desc.img.splice(x, 1);
},
uploadFileLesson(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.form.goods_desc.imgLesson = [{
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}];
this.$message({
message: '上传成功',
type: 'success'
});
})
},
removeFileLesson() {
this.form.goods_desc.imgLesson = []
},
uploadFileMain(a) {
console.log(a)
// debugger
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.form.goods_desc.img.push({
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
});
this.$message({
message: '上传成功',
type: 'success'
});
})
},
removeFileShareRef() {
this.form.share_desc.refImg = []
},
uploadFileMainShareRef(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.share_desc.refImg) {
this.form.share_desc.refImg[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.refImg = [];
this.form.share_desc.refImg[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
uploadFileMainShare(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.share_desc.img) {
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.img = [];
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
filters: {
filterGoods(val) {
return '[' + GOODSTYPE[val.goods_type] + ']' + '[' + val.current_price / 100 + '元]' + val.name
}
}
})
},
removeFileService() {
this.form.desc.customer_service = [];
},
uploadFileMainService(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.desc.customer_service) {
this.form.desc.customer_service[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.desc.customer_service = [];
this.form.desc.customer_service[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
uploadFileShare(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.share_desc.img) {
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.img = [];
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
},
data() {
return {
tiny: {
height: 300
},
sendObj: {
content: 'nihao'
},
loading: true,
goodsYou: [],
goodsList: [],
form: {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
imgLesson: [],
img: [],
course_title: '',
time_limit: 0
},
course_id: '',
course_type: 0,
watch_num: '',
invite_earnings: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
img: [],
refImg: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
after_goods_id: '',
before_goods_id: ''
},
is_into_periods: '0',
relation_gift: []
},
lessonList: [],
goOn_goods_Id: {
after_goods_id: '',
before_goods_id: ''
},
coupongoods: [],
false: false,
relation_gift: []
}
}
})
},
initDialog() {
switch (this.dialogObj.type) {
case 0: // 添加商品
this.loading = false;
this.goOn_goods_Id.after_goods_id = '';
this.goodsYou = [];
this.goOn_goods_Id.before_goods_id = '';
this.form = {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
img: [],
course_title: ""
},
course_id: '',
course_type: 0,
watch_num: '',
duration_num: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
refImg: [],
img: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
before_goods_id: 0,
after_goods_id: 0
},
is_into_periods: '0'
};
this.getLessonList();
console.log(this.form.course_type)
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res => {
// debugger
let item = {
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
},
methods: {
goodsChange() {
if (this.form.goods_type == 4 || this.form.goods_type == 3) {
let json = {
limit: '999',
page: '1',
goods_type: '1,2',
status: "1"
};
getGoodsListApi(json).then(res => {
console.log(json)
// debugger
this.goodsList = res.list
});
} else if (this.form.goods_type == 1 || this.form.goods_type == 2) {
// debugger
let json = {
limit: '999',
page: '1',
goods_type: '4',
};
getGoodsListApi(json).then(res => {
console.log(res)
// debugger
let item = {
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
break;
case 1: // 编辑商品
case 2: // 查看商品
this.goOn_goods_Id.after_goods_id = '';
this.goOn_goods_Id.before_goods_id = '';
this.goodsYou = [];
this.form = {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
img: [],
course_title: ''
},
course_id: '',
course_type: 0,
watch_num: '',
duration_num: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
refImg: [],
img: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
before_goods_id: 0,
after_goods_id: 0
},
is_into_periods: '0'
};
getGoodsDetailApi(this.dialogObj.id).then(res => {
this.loading = false;
let share_desc = JSON.parse(res.share_desc);
if (!share_desc.refImg) {
share_desc.refImg = []
}
this.form = {
name: res.name,
goods_type: res.goods_type,
goods_desc: JSON.parse(res.goods_desc),
course_id: res.course_id,
course_type: res.course_type,
watch_num: res.watch_num,
duration_num: res.duration_num,
original_price: res.original_price / 100,
current_price: res.current_price / 100,
is_real: res.is_real,
is_auth_user: res.is_auth_user,
share_desc: JSON.parse(res.share_desc),
desc: JSON.parse(res.desc),
invite_earnings: res.invite_earnings / 100,
is_auth_teacher: res.is_auth_teacher,
is_into_periods: res.is_into_periods
};
if (this.form.desc.before_goods_id) {
this.goOn_goods_Id.before_goods_id = this.form.desc.before_goods_id;
}
if (this.form.desc.after_goods_id) {
this.goOn_goods_Id.after_goods_id = this.form.desc.after_goods_id;
}
if (this.form.desc.use_goods_ids) {
this.goodsYou = this.form.desc.use_goods_ids.split(',');
this.goodsYou = this.goodsYou.map(function (item) {
return +item;
});
}
console.log(this.form)
if (this.form.course_type != 1 && this.form.course_type != 2) {
// debugger
getGoodsListApi({limit: 200}).then(res => {
this.goodsList = res.list
});
}
// debugger
console.log(this.form.course_type)
if (this.form.goods_type == 4) {
},
sub() {
if (this.form.relation_gift) {
this.form.relation_gift = this.form.relation_gift.join(',');
}
if (!this.form.share_desc.img && this.form.goods_type == 2) {
this.$message({
type: 'success',
message: '请上传主图!'
});
return
}
let _json = JSON.parse(JSON.stringify(this.form) + '');
// debugger
this.getLessonList()
let json = {
limit: 200,
nowPage: 1,
goods_type: '1,2'
if (_json.goods_type === 3 || _json.goods_type === 4 || _json.goods_type === 5) {
_json.course_id = 0;
_json.watch_num = 0;
}
getGoodsListApi(json).then(res => {
this.goodsList = res.list
});
}
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
if (_json.goods_type === 5) {
_json.is_real = 1;
}
getGoodsListApi(json).then(res => {
// debugger
let item = {
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
_json.desc.before_goods_id = this.goOn_goods_Id.before_goods_id;
if (this.goodsYou.length < 1) {
_json.desc.use_goods_ids = ''
} else {
_json.desc.use_goods_ids = this.goodsYou.toString()
}
_json.desc.after_goods_id = this.goOn_goods_Id.after_goods_id;
_json.original_price = (_json.original_price * 100).toFixed(0);
_json.current_price = (_json.current_price * 100).toFixed(0);
_json.invite_earnings = (_json.invite_earnings * 100).toFixed(0);
_json.goods_desc = JSON.stringify(_json.goods_desc);
_json.desc = JSON.stringify(_json.desc);
_json.share_desc = JSON.stringify(_json.share_desc);
switch (this.dialogObj.type) {
case 1:
editGoodsApi(this.dialogObj.id, _json).then(res => {
this.$message({
type: 'success',
message: '修改成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
});
break;
case 0:
console.log(_json)
addGoodsApi(_json).then(res => {
this.$message({
type: 'success',
message: '新增成功!'
});
this.$emit("reflash");
this.dialogObj.show = false;
})
break
}
},
removeFileMain(a) {
let x = this.form.goods_desc.img.findIndex(i => {
return i.name === a.name
});
}
this.getLessonList()
});
break;
case 3:
this.title = '编辑';
this.show = this.dialogObj.show;
this.id = this.dialogObj.id;
this.type = 2;
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
this.getLessonList()
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res => {
this.coupongoods = res.list
});
}
this.form.goods_desc.img.splice(x, 1);
},
uploadFileLesson(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.form.goods_desc.imgLesson = [{
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}];
this.$message({
message: '上传成功',
type: 'success'
});
})
},
removeFileLesson() {
this.form.goods_desc.imgLesson = []
},
uploadFileMain(a) {
console.log(a)
// debugger
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.form.goods_desc.img.push({
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
});
this.$message({
message: '上传成功',
type: 'success'
});
})
},
removeFileShareRef() {
this.form.share_desc.refImg = []
},
uploadFileMainShareRef(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.share_desc.refImg) {
this.form.share_desc.refImg[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.refImg = [];
this.form.share_desc.refImg[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
uploadFileMainShare(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.share_desc.img) {
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.img = [];
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
removeFileService() {
this.form.desc.customer_service = [];
},
uploadFileMainService(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.desc.customer_service) {
this.form.desc.customer_service[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.desc.customer_service = [];
this.form.desc.customer_service[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
uploadFileShare(a) {
this.$store.dispatch('setProgress', {type: 'new', id: a.file.uid});
this.fileUid = a.file.uid;
uploadFileApi({file: a.file, type: 'local'}).then(res => {
this.$message({
message: '上传成功',
type: 'success'
});
if (this.form.share_desc.img) {
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
} else {
this.form.share_desc.img = [];
this.form.share_desc.img[0] = {
name: res.url,
url: process.env.IMAGE_URL_HEAD + res.url,
title: '',
lable: ''
}
}
})
},
initDialog() {
switch (this.dialogObj.type) {
case 0: // 添加商品
this.loading = false;
this.goOn_goods_Id.after_goods_id = '';
this.goodsYou = [];
this.goOn_goods_Id.before_goods_id = '';
this.form = {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
img: [],
course_title: ""
},
course_id: '',
course_type: 0,
watch_num: '',
duration_num: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
refImg: [],
img: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
before_goods_id: 0,
after_goods_id: 0
},
is_into_periods: '0',
relation_gift: []
};
this.getLessonList();
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res => {
// debugger
let item = {
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
break;
case 1: // 编辑商品
case 2: // 查看商品
this.goOn_goods_Id.after_goods_id = '';
this.goOn_goods_Id.before_goods_id = '';
this.goodsYou = [];
this.form = {
name: '',
goods_type: 1,
goods_desc: {
desc: "",
img: [],
course_title: ''
},
course_id: '',
course_type: 0,
watch_num: '',
duration_num: 0,
original_price: '',
current_price: '',
is_real: 0,
is_auth_user: 0,
is_auth_teacher: 0,
share_desc: {
title: '',
content: '',
refImg: [],
img: []
},
desc: {
detail: "",
qa: "",
customer_service: [],
before_goods_id: 0,
after_goods_id: 0
},
is_into_periods: '0'
};
getGoodsDetailApi(this.dialogObj.id).then(res => {
this.loading = false;
let share_desc = JSON.parse(res.share_desc);
if (!share_desc.refImg) {
share_desc.refImg = []
}
let gift_ids_arr = [];
if (res.gift_ids) {
res.gift_ids.split(',').map(i => {
gift_ids_arr.push(Number(i));
});
}
this.form = {
name: res.name,
goods_type: res.goods_type,
goods_desc: JSON.parse(res.goods_desc),
course_id: res.course_id,
course_type: res.course_type,
watch_num: res.watch_num,
duration_num: res.duration_num,
original_price: res.original_price / 100,
current_price: res.current_price / 100,
is_real: res.is_real,
is_auth_user: res.is_auth_user,
share_desc: JSON.parse(res.share_desc),
desc: JSON.parse(res.desc),
invite_earnings: res.invite_earnings / 100,
is_auth_teacher: res.is_auth_teacher,
is_into_periods: res.is_into_periods,
relation_gift: gift_ids_arr
};
if (this.form.desc.before_goods_id) {
this.goOn_goods_Id.before_goods_id = this.form.desc.before_goods_id;
}
if (this.form.desc.after_goods_id) {
this.goOn_goods_Id.after_goods_id = this.form.desc.after_goods_id;
}
if (this.form.desc.use_goods_ids) {
this.goodsYou = this.form.desc.use_goods_ids.split(',');
this.goodsYou = this.goodsYou.map(function (item) {
return +item;
});
}
if (this.form.course_type != 1 && this.form.course_type != 2) {
// debugger
getGoodsListApi({limit: 200}).then(res => {
this.goodsList = res.list
});
}
// debugger
console.log(this.form.course_type)
if (this.form.goods_type == 4) {
// debugger
this.getLessonList()
let json = {
limit: 200,
nowPage: 1,
goods_type: '1,2'
}
getGoodsListApi(json).then(res => {
this.goodsList = res.list
});
}
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res => {
// debugger
let item = {
name: '不赠送',
id: '0',
goods_type: 4,
course_type: 0,
current_price: 0
}
this.coupongoods = res.list
this.coupongoods.unshift(item)
});
}
this.getLessonList()
});
break;
case 3:
this.title = '编辑';
this.show = this.dialogObj.show;
this.id = this.dialogObj.id;
this.type = 2;
if (this.form.goods_type == 1 || this.form.goods_type == 2) {
this.getLessonList()
let json = {
limit: 200,
nowPage: 1,
goods_type: '4'
}
getGoodsListApi(json).then(res => {
this.coupongoods = res.list
});
}
// getTeacherDetailApi(this.id).then(res=>{
// this.form.name = res.name;
// this.form.alias = res.alias;
......@@ -832,36 +858,41 @@
// this.form.status = res.status;
// this.loading = false
// });
break
}
},
changeLessonType() {
this.getLessonList()
},
getLessonList() {
getLessonApi({type: this.form.course_type}).then(res => {
this.lessonList = res.list
})
}
},
watch: {
dialogObj: {
handler: function () {
if (this.dialogObj.show) {
console.log(this.dialogObj)
this.loading = true;
this.initDialog()
}
break
}
},
changeLessonType() {
this.getLessonList()
},
getLessonList() {
getLessonApi({type: this.form.course_type}).then(res => {
this.lessonList = res.list
})
},
getRelationGift() {
relationGiftApi().then(res => {
this.relation_gift = res.list;
});
}
},
deep: true
},
"dialogObj.show": function (a) {
},
show(value) {
this.$emit("changeShow", value);
}
watch: {
dialogObj: {
handler: function () {
if (this.dialogObj.show) {
this.loading = true;
this.initDialog()
}
},
deep: true
},
"dialogObj.show": function (a) {
this.getRelationGift();
},
show(value) {
this.$emit("changeShow", value);
}
}
}
}
</script>
<style scoped lang="less">
......
<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>
......@@ -4,7 +4,9 @@
<el-card style="width: 450px;display: inline-block;margin-right: 10px">
<div slot="header">
<span><label>{{detail.type | teacherType}}</label> {{detail.name}}(T{{detail.squad}}</span>
<el-button style="float: right;margin-top: -6px;" size="small" type="success" v-if="!$store.state.readonly" plain @click="onAddUser(true)">老师绑定用户</el-button>
<el-button style="float: right;margin-top: -6px;" size="small" type="success" v-if="!$store.state.readonly"
plain @click="onAddUser(true)">老师绑定用户
</el-button>
</div>
<div class="card-content">
<div class="text item">
......@@ -34,7 +36,9 @@
<el-card style="width: 450px;display: inline-block;margin-right: 10px" v-if="detail.user_info">
<div slot="header">
<span>绑定用户</span>
<el-button @click="createInviteLink(detail.user_info)" style="float: right;" size="mini" plain type="primary">复制专属链接</el-button>
<el-button @click="createInviteLink(detail.user_info)" style="float: right;" size="mini" plain type="primary">
复制专属链接
</el-button>
</div>
<div class="card-content">
<div class="text item">
......@@ -55,7 +59,8 @@
<span>当月销售转化率【{{nowDate}}</span>
</div>
<div class="text item">
<el-progress type="circle" style="float: left;margin-right: 10px" :percentage="Number(task4Data.trans_rate.split('%')[0])"></el-progress>
<el-progress type="circle" style="float: left;margin-right: 10px"
:percentage="Number(task4Data.trans_rate.split('%')[0])"></el-progress>
</div>
<div class="card-content">
<div class="text item">
......@@ -187,6 +192,15 @@
<el-form-item label="交易订单号">
<el-input v-model="form.out_trade_no"></el-input>
</el-form-item>
<el-form-item label="关联赠品">
<el-input v-model="form.gift_name"></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="form.deliver_status" placeholder="请选择" clearable>
<el-option label="未发货" value="0"></el-option>
<el-option label="已发货" value="1"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" plain @click="getOrderList">搜索</el-button>
</el-form-item>
......@@ -208,7 +222,8 @@
<el-table-column prop="goods_name" label="商品名称"></el-table-column>
<el-table-column width="250" prop="invite_id" className="f-c" label="推广人">
<template slot-scope="scope">
<div @click="showSource(scope.row)" v-if="scope.row.invite_earnings > 0 && scope.row.invite_id !== 0" style="width:100%;display: flex;color: #409eff;cursor: pointer">
<div @click="showSource(scope.row)" v-if="scope.row.invite_earnings > 0 && scope.row.invite_id !== 0"
style="width:100%;display: flex;color: #409eff;cursor: pointer">
<img :src="scope.row.invite_avatar" class="avatar"/>
类型:{{scope.row.invite_type}} ({{scope.row.invite_name}})
<br>
......@@ -235,6 +250,20 @@
<div v-if="scope.row.invite_id === 0"></div>
</template>
</el-table-column>
<el-table-column prop="relation_gift" label="关联赠品">
<template slot-scope="scope">
<span v-for="(data, index) in scope.row.relation_gift">{{data}} </span>
</template>
</el-table-column>
<el-table-column prop="gift_deliver" label="关联赠品物流">
<template slot-scope="scope">
<div v-if="scope.row.gift_deliver">
<a class="gift_deliver" v-for="(data, index) in scope.row.gift_deliver"
:href="`https://m.baidu.com/from=1013755s/s?word=${data.express_no}&sa=tb&ts=2790568&t_kt=0&ie=utf-8&rsv_t=cbe2F%252FT5T3MIzkRl%252Fg8ZUw%252FEPHZmn2wHIrB8cLvgNlEKyyDqUNPrTyDEEDjkAb8&rsv_pq=11793168499026332712&ss=110000000001&tj=1&rqlang=zh&rsv_sug4=4111&inputT=3178&oq=快递单号查询`"
target="_blank">{{data.goods_title}} </a>
</div>
</template>
</el-table-column>
<el-table-column label="优惠活动">
<template slot-scope="scope">
<span v-if="scope.row.order_coupon_id === 0"></span>
......@@ -245,7 +274,9 @@
</el-table-column>
<el-table-column label="付款状态" width="80">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.status === 5 || scope.row.status === 3" @click="showRef(scope.row)">{{scope.row.status|status}}</el-button>
<el-button type="text" v-if="scope.row.status === 5 || scope.row.status === 3"
@click="showRef(scope.row)">{{scope.row.status|status}}
</el-button>
<div v-if="scope.row.status !== 5 && scope.row.status !== 3">{{scope.row.status|status}}</div>
</template>
</el-table-column>
......@@ -266,18 +297,19 @@
<el-table-column prop="pay_at" label="购买时间" sortable></el-table-column>
<el-table-column prop="created_at" label="下单时间" sortable></el-table-column>
<el-table-column prop="desc" label="备注"></el-table-column>
<el-table-column width="50" label="操作" v-if="!$store.state.readonly" fixed="right">
<el-table-column align="center" width="100" label="操作" v-if="!$store.state.readonly" fixed="right">
<template slot-scope="scope">
<el-popover placement="top" width="200">
<div style="text-align: center">
<el-button @click="editComment(scope.row.id, scope.row.desc)" type="info" plain size="mini">编辑备注</el-button>
</div>
<el-button slot="reference" size="mini" type="text">操作</el-button>
</el-popover>
<el-button slot="reference" size="mini" type="text"
@click="editComment(scope.row.id, scope.row.desc)">编辑备注
</el-button>
<el-button slot="reference" size="mini" type="text" @click="editGiftDeliver(scope.row)"
style="margin: 0;">关联赠品
</el-button>
</template>
</el-table-column>
</el-table>
<page :total="orderListObj.total" :limit="orderListObj.limit" @pageChange="onPageChange2" @sizeChange="onSizeChange2"/>
<page :total="orderListObj.total" :limit="orderListObj.limit" @pageChange="onPageChange2"
@sizeChange="onSizeChange2"/>
</el-tab-pane>
<el-tab-pane label="外部订单列表" name="yunji">
<el-form ref="form" :model="form" label-width="100px" inline>
......@@ -346,7 +378,9 @@
</el-table-column>
<el-table-column label="付款状态" width="80">
<template slot-scope="scope">
<el-button type="text" v-if="scope.row.status === 5 || scope.row.status === 3" @click="showRef(scope.row)">{{scope.row.status|status}}</el-button>
<el-button type="text" v-if="scope.row.status === 5 || scope.row.status === 3"
@click="showRef(scope.row)">{{scope.row.status|status}}
</el-button>
<div v-if="scope.row.status !== 5 && scope.row.status !== 3">{{scope.row.status|status}}</div>
</template>
</el-table-column>
......@@ -361,7 +395,8 @@
<br>
tel:{{scope.row.receiver_phone}}
<br>
{{scope.row.receiver_province}} {{scope.row.receiver_city}} {{scope.row.receiver_area}} {{scope.row.receiver_address}}
{{scope.row.receiver_province}} {{scope.row.receiver_city}} {{scope.row.receiver_area}}
{{scope.row.receiver_address}}
</template>
</el-table-column>
<el-table-column prop="active_at" label="激活时间" width="90">
......@@ -371,10 +406,12 @@
</el-table-column>
<el-table-column prop="create_time" label="下单时间" width="90"></el-table-column>
<el-table-column prop="pay_time" label="付款时间" width="90"></el-table-column>
<el-table-column prop="user_status" :formatter="userStatusFormatter" label="沟通状态" width="90"></el-table-column>
<el-table-column prop="user_status" :formatter="userStatusFormatter" label="沟通状态"
width="90"></el-table-column>
<el-table-column prop="desc" label="备注"></el-table-column>
</el-table>
<page :total="yunjiListObj.total" :limit="yunjiListObj.limit" @pageChange="onPageChange3" @sizeChange="onSizeChange3"/>
<page :total="yunjiListObj.total" :limit="yunjiListObj.limit" @pageChange="onPageChange3"
@sizeChange="onSizeChange3"/>
</el-tab-pane>
<el-tab-pane label="话术列表" name="huashu">
<div class="cssbox">
......@@ -402,10 +439,12 @@
</template>
</el-table-column>
</el-table>
<page :total="contentTotal" :limit="contentLimit" @pageChange="onPageChangeC" @sizeChange="onSizeChangeC"/>
<page :total="contentTotal" :limit="contentLimit" @pageChange="onPageChangeC"
@sizeChange="onSizeChangeC"/>
</el-collapse-item>
</el-collapse>
<page :total="modularTotal" :limit="modularLimit" @pageChange="onPageChangeModular" @sizeChange="onSizeChangeModular"/>
<page :total="modularTotal" :limit="modularLimit" @pageChange="onPageChangeModular"
@sizeChange="onSizeChangeModular"/>
<!-- 查看内容 -->
<el-dialog
title=""
......@@ -443,6 +482,7 @@
<user-list :userObj="userObj" @reflash="getTeacherDetail"/>
<choose-good-dialog :dialogObj="chooseGoodDialogObj" @changeShow="changeShow"/>
<gift-deliver-dialog :dialogObj="giftDeliverDialogObj" @reflash="getOrderList"></gift-deliver-dialog>
<el-dialog append-to-body :visible.sync="addShow" top="5vh">
<el-form label-width="90px" inline>
......@@ -471,7 +511,8 @@
</el-table-column>
<el-table-column prop="mobile" label="手机号"></el-table-column>
</el-table>
<page :total="userObj.total" :limit="userObj.limit" :small="true" @pageChange="onPageChange4" @sizeChange="onSizeChange4"/>
<page :total="userObj.total" :limit="userObj.limit" :small="true" @pageChange="onPageChange4"
@sizeChange="onSizeChange4"/>
<span slot="footer" class="dialog-footer">
<el-button @click="addShow = false">取 消</el-button>
<el-button type="primary" @click="onAdd">确 定</el-button>
......@@ -481,619 +522,648 @@
</template>
<script>
import {
getTeacherDetailApi,
getClassStatisticsApi,
task4Api,
getUserListApi,
getQuestionModularListApi,
getQuestionModularDetailApi,
teacherBindUserApi,
getOrderListApi,
getGoodsListApi,
editOrderDescApi,
updateOrderTeacherApi,
getyunjiApi,
getClassListApi,
getSourceStudentApi
} from "../../service/api";
import {
TEACHERTYPE,
ORDERSTATUSOPTION,
GOODSTYPE,
ORDERSTATUS,
CLASSSOURCE,
USERSTATUSFORMATER
} from "../../util/wordbook";
import AddressArray from '../framework/address-picker/addr'
import task from './task'
import page from '../framework/page'
// import customerDetail from './customer'
import sourceDialog from './sourceDialog'
import couponDialog from './couponDialog'
import refundDetail from './refundDetail'
import UserList from '../class/userList'
import chooseGoodDialog from './chooseGoodDialog'
import {
getTeacherDetailApi,
getClassStatisticsApi,
task4Api,
getUserListApi,
getQuestionModularListApi,
getQuestionModularDetailApi,
teacherBindUserApi,
getOrderListApi,
getGoodsListApi,
editOrderDescApi,
updateOrderTeacherApi,
getyunjiApi,
getClassListApi,
getSourceStudentApi
} from "../../service/api";
import {
TEACHERTYPE,
ORDERSTATUSOPTION,
GOODSTYPE,
ORDERSTATUS,
CLASSSOURCE,
USERSTATUSFORMATER
} from "../../util/wordbook";
import AddressArray from '../framework/address-picker/addr'
import task from './task'
import page from '../framework/page'
// import customerDetail from './customer'
import sourceDialog from './sourceDialog'
import couponDialog from './couponDialog'
import refundDetail from './refundDetail'
import UserList from '../class/userList'
import chooseGoodDialog from './chooseGoodDialog'
import giftDeliverDialog from './giftDeliverDialog'
let studentSource = {}
export default {
name: "index",
props: [
'parentDetail'
],
components: {
page,
task,
UserList,
chooseGoodDialog,
couponDialog,
refundDetail,
sourceDialog,
// customerDetail
},
data() {
let nowDate = new Date();
let month = (nowDate.getMonth() + 1);
if (month < 10) month = '0' + month.toString();
nowDate = nowDate.getFullYear() + '-' + month;
return {
modularContentTitle: "",
modularTotal: 0,
modularNowPage: 1,
modularLimit: 10,
contentTotal: 0,
contentNowPage: 1,
contentLimit: 10,
postModularContentDialog: false,
modularId: "",
questionListParams: {
type: "1",
pid: "",
keywords: ''
},
postModularParams: {},
modularList: [],
modularContent: [],
tabs: 'task',
nowDate: nowDate,
yunjiList: [],
searchFrom: {
user_id: '',
is_add_teacher: '',
is_view_course: '',
start_at: '',
end_at: ''
},
form: {
nickname: '',
user_id: '',
status: [1, 3, 4, 5],
goods_id: '',
out_trade_no: '',
receive_mobile: "",
mobile: "",
},
task4Data: null,
goodList: [],
orderStatusOption: ORDERSTATUSOPTION,
tableData: [],
userList: [],
list: [],
id: this.parentDetail ? this.parentDetail.id : this.$route.params.id,
isBindUser: true,
addShow: false,
detail: {},
total: 0,
limit: 10,
nowPage: 1,
customerObj: {
alias: '',
name: '',
adviser: ''
},
userObj: {
classId: '',
title: '',
show: false,
total: 0,
limit: 10,
nowPage: 1,
},
addId: '',
multipleSelection: [],
chooseGoodDialogObj: {
show: false,
code: ''
let studentSource = {}
export default {
name: "index",
props: [
'parentDetail'
],
components: {
page,
task,
UserList,
chooseGoodDialog,
couponDialog,
refundDetail,
sourceDialog,
giftDeliverDialog
},
orderListObj: {
total: 0,
limit: 10,
nowPage: 1,
data() {
let nowDate = new Date();
let month = (nowDate.getMonth() + 1);
if (month < 10) month = '0' + month.toString();
nowDate = nowDate.getFullYear() + '-' + month;
return {
modularContentTitle: "",
modularTotal: 0,
modularNowPage: 1,
modularLimit: 10,
contentTotal: 0,
contentNowPage: 1,
contentLimit: 10,
postModularContentDialog: false,
modularId: "",
questionListParams: {
type: "1",
pid: "",
keywords: ''
},
postModularParams: {},
modularList: [],
modularContent: [],
tabs: 'task',
nowDate: nowDate,
yunjiList: [],
searchFrom: {
user_id: '',
is_add_teacher: '',
is_view_course: '',
start_at: '',
end_at: ''
},
form: {
nickname: '',
user_id: '',
status: [1, 3, 4, 5],
goods_id: '',
out_trade_no: '',
receive_mobile: "",
mobile: "",
gift_name: "",
deliver_status: ""
},
task4Data: null,
goodList: [],
orderStatusOption: ORDERSTATUSOPTION,
tableData: [],
userList: [],
list: [],
id: this.parentDetail ? this.parentDetail.id : this.$route.params.id,
isBindUser: true,
addShow: false,
detail: {},
total: 0,
limit: 10,
nowPage: 1,
customerObj: {
alias: '',
name: '',
adviser: ''
},
userObj: {
classId: '',
title: '',
show: false,
total: 0,
limit: 10,
nowPage: 1,
},
addId: '',
multipleSelection: [],
chooseGoodDialogObj: {
show: false,
code: ''
},
orderListObj: {
total: 0,
limit: 10,
nowPage: 1,
},
yunjiListObj: {
total: 0,
limit: 10,
nowPage: 1,
},
sourceDialog: {
show: false,
out_trade_no: ''
},
couponDetail: {
show: false,
order_coupon_id: ''
},
refundDetail: {
show: false,
out_trade_no: ''
},
giftDeliverDialogObj: {
show: false,
title: '配置赠品',
gift_deliver: null,
goods_id: '',
user_id: '',
user_address_id: '',
out_trade_no: '',
gift_ids: '',
goods_name: ''
}
}
},
yunjiListObj: {
total: 0,
limit: 10,
nowPage: 1,
},
sourceDialog: {
show: false,
out_trade_no: ''
},
couponDetail: {
show: false,
order_coupon_id: ''
},
refundDetail: {
show: false,
out_trade_no: ''
},
}
},
methods: {
periodName(val) {
let str = '';
if (!val.periods_title) {
str = '-'
} else {
if (val.goods_id) {
str += `【${val.goods_id}】`
}
if (val.periods_title) {
str += `${val.periods_title}<br>`
}
if (val.watch_num) {
str += `${val.watch_num}课时`
}
if (val.start_at) {
str += `(${val.start_at.slice(5).replace('-', '')})`
}
if (val.has_watch_num || val.has_watch_num == 0) {
str += `-d${val.has_watch_num}`
}
}
return str
},
onPageChangeModular(val) {
this.modularNowPage = val;
this.getList();
},
onSizeChangeModular(val) {
this.modularNowPage = 1;
this.modularLimit = val;
this.getList();
},
onPageChangeC(val) {
this.contentNowPage = val;
this.handleChange();
},
onSizeChangeC(val) {
this.contentNowPage = 1;
this.contentLimit = val;
this.handleChange();
},
showContent(data) {
this.modularContentTitle = data.title
getQuestionModularDetailApi(data.id).then(res => {
this.postModularParams = Object.assign({}, res);
// console.log(this.postModularParams);
this.postModularContentDialog = true;
});
},
handleChange() {
this.modularContent = [];
// console.log(val);
let json = {
type: this.questionListParams.type,
page: this.contentNowPage,
limit: this.contentLimit
};
if (this.modularId) {
json.pid = this.modularId;
}
if (this.questionListParams.keywords) {
json.keywords = this.questionListParams.keywords;
}
// this.postModularParams.pid = this.modularId;
getQuestionModularListApi(json.type, json).then(res => {
this.modularContent = res.list;
console.log(res);
// debugger
this.contentTotal = res.total;
});
},
handleClick(tab) {
// console.log(tab.name,413)
this.questionListParams.type = tab.name;
// this.postModularParams.type = tab.name;
this.getList();
},
getList() {
let json = {
type: this.questionListParams.type,
modularPage: this.modularNowPage,
modularLimit: this.modularLimit
};
if (this.questionListParams.pid) {
json.pid = this.questionListParams.pid;
}
getQuestionModularListApi(json.type, json).then(res => {
this.modularList = res.list;
console.log(this.modularList);
// debugger
this.modularTotal = res.total;
});
},
userStatusFormatter(val) {
return (USERSTATUSFORMATER[val.user_status])
},
getTask4() {
task4Api(this.id).then(res => {
this.task4Data = res
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
onAdd() {
let json = {
is_buy: 0
}
if (this.multipleSelection.length === 0) {
this.$message({
type: 'error',
message: '请选择用户!'
});
return
} else if (this.multipleSelection.length !== 1) {
this.$message({
type: 'error',
message: '只能选择一个用户!'
});
return
}
this.addId = this.multipleSelection[0].user_id;
if (!this.addId) {
return
}
if (!this.isBindUser) {
methods: {
periodName(val) {
let str = '';
if (!val.periods_title) {
str = '-'
} else {
if (val.goods_id) {
str += `【${val.goods_id}】`
}
if (val.periods_title) {
str += `${val.periods_title}<br>`
}
if (val.watch_num) {
str += `${val.watch_num}课时`
}
if (val.start_at) {
str += `(${val.start_at.slice(5).replace('-', '')})`
}
if (val.has_watch_num || val.has_watch_num == 0) {
str += `-d${val.has_watch_num}`
}
}
return str
},
onPageChangeModular(val) {
this.modularNowPage = val;
this.getList();
},
onSizeChangeModular(val) {
this.modularNowPage = 1;
this.modularLimit = val;
this.getList();
},
onPageChangeC(val) {
this.contentNowPage = val;
this.handleChange();
},
onSizeChangeC(val) {
this.contentNowPage = 1;
this.contentLimit = val;
this.handleChange();
},
showContent(data) {
this.modularContentTitle = data.title
getQuestionModularDetailApi(data.id).then(res => {
this.postModularParams = Object.assign({}, res);
// console.log(this.postModularParams);
this.postModularContentDialog = true;
});
},
handleChange() {
this.modularContent = [];
// console.log(val);
let json = {
type: this.questionListParams.type,
page: this.contentNowPage,
limit: this.contentLimit
};
if (this.modularId) {
json.pid = this.modularId;
}
if (this.questionListParams.keywords) {
json.keywords = this.questionListParams.keywords;
}
// this.postModularParams.pid = this.modularId;
getQuestionModularListApi(json.type, json).then(res => {
this.modularContent = res.list;
console.log(res);
// debugger
this.contentTotal = res.total;
});
},
handleClick(tab) {
// console.log(tab.name,413)
this.questionListParams.type = tab.name;
// this.postModularParams.type = tab.name;
this.getList();
},
getList() {
let json = {
type: this.questionListParams.type,
modularPage: this.modularNowPage,
modularLimit: this.modularLimit
};
if (this.questionListParams.pid) {
json.pid = this.questionListParams.pid;
}
getQuestionModularListApi(json.type, json).then(res => {
this.modularList = res.list;
console.log(this.modularList);
// debugger
this.modularTotal = res.total;
});
},
userStatusFormatter(val) {
return (USERSTATUSFORMATER[val.user_status])
},
getTask4() {
task4Api(this.id).then(res => {
this.task4Data = res
})
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
onAdd() {
let json = {
is_buy: 0
}
if (this.multipleSelection.length === 0) {
this.$message({
type: 'error',
message: '请选择用户!'
});
return
} else if (this.multipleSelection.length !== 1) {
this.$message({
type: 'error',
message: '只能选择一个用户!'
});
return
}
this.addId = this.multipleSelection[0].user_id;
if (!this.addId) {
return
}
if (!this.isBindUser) {
} else {
teacherBindUserApi(this.id, {user_id: this.addId}).then(res => {
this.$message({
type: 'success',
message: '绑定成功!'
});
this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id;
this.getTeacherDetail();
this.getGoodsOption();
this.addShow = false;
})
}
},
onAddUser(flag) {
this.isBindUser = flag;
this.addShow = true;
this.getUser();
},
getUser() {
let json = {
page: this.userObj.nowPage,
limit: this.userObj.limit,
};
if (this.searchFrom.userId) {
json.user_id = this.searchFrom.userId
}
if (this.searchFrom.nickName) {
json.nickname = this.searchFrom.nickName
}
if (this.searchFrom.mobile) {
json.mobile = this.searchFrom.mobile
}
getUserListApi(json).then(res => {
this.userList = res.list;
this.userObj.total = res.total;
})
},
changeRow(data, b) {
if (b.indexOf(data) > -1) {
getClassStatisticsApi(data.periods_id, data.id).then(res => {
data.arrive_course_rate = res.arrive_course_rate;
data.watch_course_rate = res.watch_course_rate;
data.over_course_rate = res.over_course_rate;
data.work_rate = res.work_rate;
data.over_work_rate = res.over_work_rate;
data.clock_rate = res.clock_rate;
data.over_clock_rate = res.over_clock_rate;
data.transform_rate = res.transform_rate;
})
}
},
showUser(data) {
console.log(data)
let classType = data.type == 1 ? '(带班班级)' : '(观摩班级)'
this.userObj = {
classId: data.id,
show: true,
title: `${this.detail.name}班级用户列表${classType}`,
teacherId: data.teacher_id,
periods_id: data.periods_id,
goods_id: data.goods_id,
type: data.type
}
},
onPageChange4(val) {
this.userObj.nowPage = val;
this.getUser()
},
onSizeChange4(val) {
this.userObj.limit = val;
this.userObj.nowPage = 1;
this.getUser();
},
onPageChange(val) {
this.nowPage = val;
this.getTeacherDetail();
} else {
teacherBindUserApi(this.id, {user_id: this.addId}).then(res => {
this.$message({
type: 'success',
message: '绑定成功!'
});
this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id;
this.getTeacherDetail();
this.getGoodsOption();
this.addShow = false;
})
}
},
onAddUser(flag) {
this.isBindUser = flag;
this.addShow = true;
this.getUser();
},
getUser() {
let json = {
page: this.userObj.nowPage,
limit: this.userObj.limit,
};
if (this.searchFrom.userId) {
json.user_id = this.searchFrom.userId
}
if (this.searchFrom.nickName) {
json.nickname = this.searchFrom.nickName
}
if (this.searchFrom.mobile) {
json.mobile = this.searchFrom.mobile
}
getUserListApi(json).then(res => {
this.userList = res.list;
this.userObj.total = res.total;
})
},
changeRow(data, b) {
if (b.indexOf(data) > -1) {
getClassStatisticsApi(data.periods_id, data.id).then(res => {
data.arrive_course_rate = res.arrive_course_rate;
data.watch_course_rate = res.watch_course_rate;
data.over_course_rate = res.over_course_rate;
data.work_rate = res.work_rate;
data.over_work_rate = res.over_work_rate;
data.clock_rate = res.clock_rate;
data.over_clock_rate = res.over_clock_rate;
data.transform_rate = res.transform_rate;
})
}
},
showUser(data) {
console.log(data)
let classType = data.type == 1 ? '(带班班级)' : '(观摩班级)'
this.userObj = {
classId: data.id,
show: true,
title: `${this.detail.name}班级用户列表${classType}`,
teacherId: data.teacher_id,
periods_id: data.periods_id,
goods_id: data.goods_id,
type: data.type
}
},
onPageChange4(val) {
this.userObj.nowPage = val;
this.getUser()
},
onSizeChange4(val) {
this.userObj.limit = val;
this.userObj.nowPage = 1;
this.getUser();
},
onPageChange(val) {
this.nowPage = val;
this.getTeacherDetail();
},
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getTeacherDetail();
},
onPageChange2(val) {
this.orderListObj.nowPage = val;
this.getOrderList()
},
onSizeChange2(val) {
this.orderListObj.limit = val;
this.orderListObj.nowPage = 1;
this.getOrderList()
},
onPageChange3(val) {
this.yunjiListObj.nowPage = val;
this.getyunjiList()
},
onSizeChange3(val) {
this.yunjiListObj.limit = val;
this.yunjiListObj.nowPage = 1;
this.getyunjiList()
},
getTeacherDetail() {
this.searchFrom = {
user_id: '',
is_add_teacher: '',
is_view_course: '',
start_at: '',
end_at: ''
};
let id = this.id;
let json = {
limit: this.limit,
page: this.nowPage
}
// getClassListApi(this.id,json).then(res =>{
// console.log(res)
// debugger
// })
console.log(9999999)
console.log(this.id)
// debugger
getTeacherDetailApi(id, json).then((res) => {
console.log(res)
this.detail = res;
if (this.detail.class_list) {
this.detail.class_list.list.forEach(data => {
data.arrive_course_rate = 0;
data.watch_course_rate = 0;
data.over_course_rate = 0;
data.work_rate = 0;
data.over_work_rate = 0;
data.clock_rate = 0;
data.over_clock_rate = 0;
data.transform_rate = 0;
});
},
onSizeChange(val) {
this.limit = val;
this.nowPage = 1;
this.getTeacherDetail();
},
onPageChange2(val) {
this.orderListObj.nowPage = val;
this.getOrderList()
},
onSizeChange2(val) {
this.orderListObj.limit = val;
this.orderListObj.nowPage = 1;
this.getOrderList()
},
onPageChange3(val) {
this.yunjiListObj.nowPage = val;
this.getyunjiList()
},
onSizeChange3(val) {
this.yunjiListObj.limit = val;
this.yunjiListObj.nowPage = 1;
this.getyunjiList()
},
getTeacherDetail() {
this.searchFrom = {
user_id: '',
is_add_teacher: '',
is_view_course: '',
start_at: '',
end_at: ''
};
let id = this.id;
let json = {
limit: this.limit,
page: this.nowPage
}
// getClassListApi(this.id,json).then(res =>{
// console.log(res)
// debugger
// })
console.log(9999999)
console.log(this.id)
// debugger
getTeacherDetailApi(id, json).then((res) => {
console.log(res)
this.detail = res;
if (this.detail.class_list) {
this.detail.class_list.list.forEach(data => {
data.arrive_course_rate = 0;
data.watch_course_rate = 0;
data.over_course_rate = 0;
data.work_rate = 0;
data.over_work_rate = 0;
data.clock_rate = 0;
data.over_clock_rate = 0;
data.transform_rate = 0;
});
this.list = this.detail.class_list.list || [];
this.total = this.detail.class_list.total;
}
// this.getOrderList();
})
},
createInviteLink(val) {
this.chooseGoodDialogObj.show = true;
//类型选择项
if (this.detail.type == 0) {
this.chooseGoodDialogObj.code = `CC-TEACHER-${val.user_id}`;
this.list = this.detail.class_list.list || [];
this.total = this.detail.class_list.total;
}
// this.getOrderList();
})
},
createInviteLink(val) {
this.chooseGoodDialogObj.show = true;
//类型选择项
if (this.detail.type == 0) {
this.chooseGoodDialogObj.code = `CC-TEACHER-${val.user_id}`;
} else if (this.detail.type == 1) {
this.chooseGoodDialogObj.code = `CC-XXMM-${val.user_id}`;
} else {
this.chooseGoodDialogObj.code = `CC-TEACHER-${val.user_id}`;
}
} else if (this.detail.type == 1) {
this.chooseGoodDialogObj.code = `CC-XXMM-${val.user_id}`;
} else {
this.chooseGoodDialogObj.code = `CC-TEACHER-${val.user_id}`;
}
},
changeShow() {
this.chooseGoodDialogObj.show = false;
this.chooseGoodDialogObj.code = '';
},
getOrderList() {
let json = {
limit: this.orderListObj.limit,
page: this.orderListObj.nowPage
};
if (this.form.nickname) {
json.nickname = this.form.nickname
}
if (this.form.user_id) {
json.user_id = this.form.user_id
}
if (this.form.status) {
json.status = this.form.status.toString()
}
if (this.form.goods_id) {
json.goods_id = this.form.goods_id
}
if (this.form.receive_mobile) {
json.receive_mobile = this.form.receive_mobile
}
if (this.form.out_trade_no) {
json.out_trade_no = this.form.out_trade_no
}
if (this.form.mobile) {
json.mobile = this.form.mobile
}
// if(this.id){
// json.invite_id=this.id;
// debugger
// }
// json.teacher_id=this.id;
// json.invite_id=this.id;
if (this.detail.user_id !== 0) {
json.invite_id = this.detail.user_id;
getOrderListApi(json).then((res) => {
res.list.forEach(i => {
i.refundList = []
});
this.tableData = res.list;
this.orderListObj.total = res.total
})
}
},
changeShow() {
this.chooseGoodDialogObj.show = false;
this.chooseGoodDialogObj.code = '';
},
getOrderList() {
let json = {
limit: this.orderListObj.limit,
page: this.orderListObj.nowPage
};
if (this.form.nickname) {
json.nickname = this.form.nickname
}
if (this.form.user_id) {
json.user_id = this.form.user_id
}
if (this.form.status) {
json.status = this.form.status.toString()
}
if (this.form.goods_id) {
json.goods_id = this.form.goods_id
}
if (this.form.receive_mobile) {
json.receive_mobile = this.form.receive_mobile
}
if (this.form.out_trade_no) {
json.out_trade_no = this.form.out_trade_no
}
if (this.form.mobile) {
json.mobile = this.form.mobile
}
if (this.form.gift_name) {
json.gift_name = this.form.gift_name
}
if (this.form.deliver_status) {
json.deliver_status = this.form.deliver_status
}
// if(this.id){
// json.invite_id=this.id;
// debugger
// }
// json.teacher_id=this.id;
// json.invite_id=this.id;
if (this.detail.user_id !== 0) {
json.invite_id = this.detail.user_id;
getOrderListApi(json).then((res) => {
res.list.forEach(i => {
i.refundList = []
});
this.tableData = res.list;
this.orderListObj.total = res.total
})
}
},
getGoodsOption() {
let json = {
page: 1,
limit: 100,
course_type: 0,
};
getGoodsListApi(json).then(res => {
this.goodList = res.list;
})
},
editComment(id, desc) {
this.$prompt('', '编辑备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputValue: desc || ''
}).then(({value}) => {
this.$confirm('确定保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editOrderDescApi(id, 'order', {desc: value}).then(res => {
this.$message({
type: 'success',
message: '编辑备注成功'
});
this.getOrderList();
});
});
})
},
showRef(data) {
this.refundDetail.show = true;
this.refundDetail.out_trade_no = data.out_trade_no;
},
showCoupon(data) {
this.couponDetail.show = true;
this.couponDetail.order_coupon_id = data.order_coupon_id;
},
showSource(data) {
this.sourceDialog.show = true;
this.sourceDialog.out_trade_no = data.out_trade_no;
},
getyunjiList() {
let json = {
limit: this.yunjiListObj.limit,
page: this.yunjiListObj.nowPage
};
if (this.form.nickname) {
json.nickname = this.form.nickname
}
if (this.form.user_id) {
json.user_id = this.form.user_id
}
if (this.form.status) {
json.status = this.form.status.toString()
}
if (this.form.goods_id) {
json.goods_id = this.form.goods_id
}
if (this.form.receive_mobile) {
json.receive_mobile = this.form.receive_mobile
}
if (this.form.out_trade_no) {
json.out_trade_no = this.form.out_trade_no
}
if (this.form.mobile) {
json.mobile = this.form.mobile
}
if (this.id) {
json.teacher_id = this.id;
}
getyunjiApi(json).then(res => {
this.yunjiListObj.total = res.total;
this.yunjiList = res.list ? res.list : [];
});
}
},
filters: {
teacherType(value) {
return TEACHERTYPE[value]
},
percent(val) {
return (val * 100).toFixed(2) + '%'
},
status(value) {
return ORDERSTATUS[value]
},
moneytFilter(val) {
return val = val / 100 + '元'
},
filterGoods(val) {
return '[' + val.id + ']' + '[' + GOODSTYPE[val.goods_type] + ']' + '[' + val.current_price / 100 + '元]' + val.name
},
classSource(val) {
// return CLASSSOURCE[val]
return studentSource[val]
}
},
created() {
this.customerObj.alias = this.parentDetail ? this.parentDetail.alias : this.$route.params.alias;
this.customerObj.name = this.parentDetail ? this.parentDetail.name : this.$route.params.name;
this.customerObj.adviser = this.parentDetail ? this.parentDetail.adviser : this.$route.params.adviser;
},
mounted() {
this.getTeacherDetail();
console.log(this.parentDetail)
},
getGoodsOption() {
let json = {
page: 1,
limit: 100,
course_type: 0,
};
getGoodsListApi(json).then(res => {
this.goodList = res.list;
})
},
editComment(id, desc) {
this.$prompt('', '编辑备注', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputType: 'textarea',
inputValue: desc || ''
}).then(({value}) => {
this.$confirm('确定保存?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
editOrderDescApi(id, 'order', {desc: value}).then(res => {
this.$message({
type: 'success',
message: '编辑备注成功'
});
this.getOrderList();
});
});
})
},
editGiftDeliver(data) {
this.giftDeliverDialogObj.show = true;
this.giftDeliverDialogObj.gift_deliver = data.gift_deliver;
this.giftDeliverDialogObj.goods_id = data.goods_id;
this.giftDeliverDialogObj.user_id = data.user_id;
this.giftDeliverDialogObj.user_address_id = data.user_address_id;
this.giftDeliverDialogObj.out_trade_no = data.out_trade_no;
this.giftDeliverDialogObj.goods_name = data.goods_name;
},
showRef(data) {
this.refundDetail.show = true;
this.refundDetail.out_trade_no = data.out_trade_no;
},
showCoupon(data) {
this.couponDetail.show = true;
this.couponDetail.order_coupon_id = data.order_coupon_id;
},
showSource(data) {
this.sourceDialog.show = true;
this.sourceDialog.out_trade_no = data.out_trade_no;
},
getyunjiList() {
let json = {
limit: this.yunjiListObj.limit,
page: this.yunjiListObj.nowPage
};
if (this.form.nickname) {
json.nickname = this.form.nickname
}
if (this.form.user_id) {
json.user_id = this.form.user_id
}
if (this.form.status) {
json.status = this.form.status.toString()
}
if (this.form.goods_id) {
json.goods_id = this.form.goods_id
}
if (this.form.receive_mobile) {
json.receive_mobile = this.form.receive_mobile
}
if (this.form.out_trade_no) {
json.out_trade_no = this.form.out_trade_no
}
if (this.form.mobile) {
json.mobile = this.form.mobile
}
if (this.id) {
json.teacher_id = this.id;
}
getyunjiApi(json).then(res => {
this.yunjiListObj.total = res.total;
this.yunjiList = res.list ? res.list : [];
});
}
},
filters: {
teacherType(value) {
return TEACHERTYPE[value]
},
percent(val) {
return (val * 100).toFixed(2) + '%'
},
status(value) {
return ORDERSTATUS[value]
},
moneytFilter(val) {
return val = val / 100 + '元'
},
filterGoods(val) {
return '[' + val.id + ']' + '[' + GOODSTYPE[val.goods_type] + ']' + '[' + val.current_price / 100 + '元]' + val.name
},
classSource(val) {
// return CLASSSOURCE[val]
return studentSource[val]
}
},
created() {
this.customerObj.alias = this.parentDetail ? this.parentDetail.alias : this.$route.params.alias;
this.customerObj.name = this.parentDetail ? this.parentDetail.name : this.$route.params.name;
this.customerObj.adviser = this.parentDetail ? this.parentDetail.adviser : this.$route.params.adviser;
},
mounted() {
this.getTeacherDetail();
console.log(this.parentDetail)
// this.id = this.parentDetail ? this.parentDetail.id : this.$route.params.id;
this.getTask4();
getSourceStudentApi().then(res => {
let obj = {}
res.forEach((item, index) => {
obj[item.type] = item.name
})
studentSource = obj
// console.log(obj)
});
this.getGoodsOption();
},
watch: {
'tabs'(value) {
if (value === 'order') {
this.getOrderList();
}
if (value === 'yunji') {
this.getyunjiList();
}
if (value === 'huashu') {
this.getList();
this.getTask4();
getSourceStudentApi().then(res => {
let obj = {}
res.forEach((item, index) => {
obj[item.type] = item.name
})
studentSource = obj
// console.log(obj)
});
this.getGoodsOption();
},
watch: {
'tabs'(value) {
if (value === 'order') {
this.getOrderList();
}
if (value === 'yunji') {
this.getyunjiList();
}
if (value === 'huashu') {
this.getList();
}
}
}
}
}
}
</script>
<style scoped lang="less">
......@@ -1210,6 +1280,11 @@
justify-content: flex-start;
align-items: center;
}
.gift_deliver {
color: rgb(64, 158, 255) !important;
text-decoration: none !important;
}
</style>
......@@ -99,7 +99,6 @@ export const getTeacherListApi = function (json) {
//获取教师详情
const getTeacherDetailUrl = `${_baseUrl}api/admin/teacher/info`;
export const getTeacherDetailApi = function (id, json) {
console.log(id)
return Vue.prototype.$fetch(`${getTeacherDetailUrl}/${id}`, json)
};
//添加教师
......@@ -237,7 +236,6 @@ const deleteGoodsUrl = `${_baseUrl}api/admin/goods`;
export const deleteGoodsApi = function (id) {
return Vue.prototype.$del(`${deleteGoodsUrl}/${id}`)
};
// 商品上架
const upGoodsUrl = `${_baseUrl}api/admin/goods/putaway/`;
export const upGoodsApi = function (id) {
......@@ -1220,7 +1218,6 @@ export const deleteQuestionModularDetailApi = function (question_id) {
export const sortQuestionModularDetailApi = function (json) {
return Vue.prototype.$put(`/api/admin/question/sort/`, json)
};
//用户收货地址
export const fetchAddressListApi = function (uid) {
return Vue.prototype.$fetch(`/api/admin/student/address/${uid}`)
......@@ -1502,4 +1499,58 @@ export const getHourTimeApi = function (json) {
export const getGrowthRecordApi = function (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 [
name: 'disposable',
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 [
name: 'config',
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: '',
......
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