Commit bf4fce74 by cmosquito

整理页面

parent d47341b9
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/brand/list',
method:'get',
params:params
})
}
export function createBrand(data) {
return request({
url:'/brand/create',
method:'post',
data:data
})
}
export function updateShowStatus(data) {
return request({
url:'/brand/update/showStatus',
method:'post',
data:data
})
}
export function updateFactoryStatus(data) {
return request({
url:'/brand/update/factoryStatus',
method:'post',
data:data
})
}
export function deleteBrand(id) {
return request({
url:'/brand/delete/'+id,
method:'get',
})
}
export function getBrand(id) {
return request({
url:'/brand/'+id,
method:'get',
})
}
export function updateBrand(id,data) {
return request({
url:'/brand/update/'+id,
method:'post',
data:data
})
}
import request from '@/utils/request'
export function fetchList() {
return request({
url:'/companyAddress/list',
method:'get'
})
}
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/coupon/list',
method:'get',
params:params
})
}
export function createCoupon(data) {
return request({
url:'/coupon/create',
method:'post',
data:data
})
}
export function getCoupon(id) {
return request({
url:'/coupon/'+id,
method:'get',
})
}
export function updateCoupon(id,data) {
return request({
url:'/coupon/update/'+id,
method:'post',
data:data
})
}
export function deleteCoupon(id) {
return request({
url:'/coupon/delete/'+id,
method:'post',
})
}
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/couponHistory/list',
method:'get',
params:params
})
}
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/flash/list',
method:'get',
params:params
})
}
export function updateStatus(id,params) {
return request({
url:'/flash/update/status/'+id,
method:'post',
params:params
})
}
export function deleteFlash(id) {
return request({
url:'/flash/delete/'+id,
method:'post'
})
}
export function createFlash(data) {
return request({
url:'/flash/create',
method:'post',
data:data
})
}
export function updateFlash(id,data) {
return request({
url:'/flash/update/'+id,
method:'post',
data:data
})
}
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/home/newProduct/list',
method:'get',
params:params
})
}
export function updateRecommendStatus(data) {
return request({
url:'/home/newProduct/update/recommendStatus',
method:'post',
data:data
})
}
export function deleteNewProduct(data) {
return request({
url:'/home/newProduct/delete',
method:'post',
data:data
})
}
export function createNewProduct(data) {
return request({
url:'/home/newProduct/create',
method:'post',
data:data
})
}
export function updateNewProductSort(params) {
return request({
url:'/home/newProduct/update/sort/'+params.id,
method:'post',
params:params
})
}
import request from '@/utils/request'
export function fetchList(params) {
return request({
url:'/returnApply/list',
method:'get',
params:params
})
}
export function deleteApply(params) {
return request({
url:'/returnApply/delete',
method:'post',
params:params
})
}
export function updateApplyStatus(id,data) {
return request({
url:'/returnApply/update/status/'+id,
method:'post',
data:data
})
}
export function getApplyDetail(id) {
return request({
url:'/returnApply/'+id,
method:'get'
})
}
<template>
<div class="container">
<!-- <h1>achievementDetail</h1> -->
<el-form
:model="list"
:rules="rules"
ref="wordDetailForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="中文名" prop="nameCn">
<el-col :span="11">
<!-- <el-slider
v-model="list.probability"
show-input
:max="1"
:step="0.01"
></el-slider> -->
<el-input v-model="list.nameCn"></el-input>
</el-col>
</el-form-item>
<el-form-item label="获得条件" prop="requirement">
<el-col :span="11">
<el-input v-model="list.requirement"></el-input>
</el-col>
</el-form-item>
<el-form-item label="条件次数" prop="num">
<el-col :span="11">
<!-- <el-input v-model="list.num"></el-input> -->
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.num"
></el-input>
</el-col>
</el-form-item>
<!-- <el-form-item label="抽奖类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="稀有度名称" prop="rarityName">
<el-col :span="11">
<el-select v-model="list.rarityName" placeholder="请选择">
<el-option
v-for="item in rarityNameList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="稀有度名称" prop="rarityName">
<el-col :span="11">
<el-input v-model="list.rarityName"></el-input>
</el-col>
</el-form-item> -->
<el-form-item label="第一种奖励资源编号" prop="firstAwardCode">
<el-col :span="11">
<el-input v-model="list.firstAwardCode"></el-input>
</el-col>
</el-form-item>
<el-form-item label="第一种奖励资源数量" prop="firstAwardNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.firstAwardNum"
></el-input>
</el-col>
</el-form-item>
<el-form-item label="第二种奖励资源编号" prop="secondAwardCode">
<el-col :span="11">
<el-input v-model="list.secondAwardCode"></el-input>
</el-col>
</el-form-item>
<el-form-item label="第二种奖励资源数量" prop="secondAwardNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.secondAwardNum"
></el-input>
</el-col>
</el-form-item>
<el-form-item label="家具图片">
<el-upload
:action="`${$BASE_URL}/admin/storage/upload/${4}`"
:headers="headers"
list-type="picture-card"
name="file"
:file-list="fileList"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success="handleSuccess"
>
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogUrl" alt="" />
</el-dialog>
</el-form-item>
<!-- <el-form-item label="词性" prop="wordClass">
<el-col :span="11">
<el-input v-model="list.wordClass"></el-input>
</el-col>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getAchievementInfoById,
updateByPrimaryKeySelectiveAchievement
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
import { getToken } from "@/utils/auth";
export default {
name: "achievementDetail",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "普通抽奖"
},
{
value: 2,
label: "高级抽奖"
}
],
rarityNameList: [
{
value: 1,
label: "常见级"
},
{
value: 2,
label: "稀有级"
},
{
value: 3,
label: "史诗级"
},
{
value: 4,
label: "传说级"
},
{
value: 5,
label: "特殊怪物"
}
],
allLotteryList: "",
rules: {
nameCn: [{ required: true, message: "必填", trigger: "blur" }],
requirement: [{ required: true, message: "必填", trigger: "blur" }],
num: [{ required: true, message: "必填", trigger: "blur" }],
firstAwardCode: [{ required: true, message: "必填", trigger: "blur" }],
firstAwardNum: [{ required: true, message: "必填", trigger: "blur" }],
secondAwardCode: [{ required: true, message: "必填", trigger: "blur" }],
secondAwardNum: [{ required: true, message: "必填", trigger: "blur" }],
type: [{ required: true, message: "必填", trigger: "change" }]
},
token: "",
dialogVisible: false,
dialogUrl: "",
fileList: []
};
},
computed: {
headers() {
return {
Authorization: this.token
};
}
},
methods: {
getData() {
getAchievementInfoById(this.id).then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
this.fileList.push({ url: this.list.medalUrl });
// this.list.probability = this.list.probability * 100;
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
// submitForm(formName) {
// this.$refs[formName].validate(valid => {
// if (valid &&
// this.fileList.length > 0 ) {
// for (const key in this.list) {
// if (this.list[key].length == 0) {
// this.list[key] = undefined;
// }
// }
// this.$confirm("是否确认提交?", "提示", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
// type: "warning"
// }).then(() => {
// updateByPrimaryKeySelectiveAchievement(this.list).then(res => {
// this.$message({
// type: "success",
// message: "提交成功!"
// });
// });
// });
// } else {
// console.log("error submit!!");
// return false;
// }
// });
// },
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid && this.fileList.length) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateByPrimaryKeySelectiveFurniture(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
} else {
this.$message({
type: "warning",
message: "全部必填!"
});
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
handleRemove(file, fileList) {
let arr = this.fileList.filter(item => {
return item.url !== file.url;
});
this.fileList = arr;
console.log(this.fileList, "this.fileList");
},
handlePreview(file) {
this.dialogUrl = file.url;
this.dialogVisible = true;
},
handleSuccess(res, file, fileList) {
let arr = {};
arr.url = res.data.url;
this.fileList.shift();
this.fileList.push(arr);
// console.log(this.fileList, "this.fileList");
this.list.Url = res.data.url;
console.log(res);
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<!-- <h1>achievement</h1> -->
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
>
<el-form-item label="关键字:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<!-- <el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button class="btn-add" @click="handleAddProduct" size="mini">
添加
</el-button>
</el-card> -->
<div class="table-container">
<el-table
ref="productTable"
:data="list"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="中文名" align="center">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id)"
>
{{ scope.row.nameCn }}
</div>
</template>
</el-table-column>
<el-table-column label="获得条件" align="center">
<template slot-scope="scope">{{ scope.row.requirement }}</template>
</el-table-column>
<el-table-column label="条件次数" align="center">
<template slot-scope="scope">{{ scope.row.num }}</template>
</el-table-column>
<!-- <el-table-column label="勋章类型" align="center">
<template slot-scope="scope">{{
scope.row.type == 1
? "引导"
: scope.row.type == 2
? "打卡"
: scope.row.type == 3
? "训练"
: scope.row.type == 4
? "收藏"
: ""
}}</template>
</el-table-column> -->
<el-table-column label="勋章图片" align="center">
<template slot-scope="scope">
<img class="medalUrl" :src="scope.row.medalUrl" alt="" />
</template>
</el-table-column>
<el-table-column label="第一种奖励资源编号" align="center">
<template slot-scope="scope">{{ scope.row.firstAwardCode }}</template>
</el-table-column>
<el-table-column label="第一种奖励资源数量" align="center">
<template slot-scope="scope">{{ scope.row.firstAwardNum }}</template>
</el-table-column>
<el-table-column label="第二种奖励资源编号" align="center">
<template slot-scope="scope">{{
scope.row.secondAwardCode
}}</template>
</el-table-column>
<el-table-column label="第二种奖励资源数量" align="center">
<template slot-scope="scope">{{ scope.row.secondAwardNum }}</template>
</el-table-column>
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="词根" align="center">
<template slot-scope="scope">{{ scope.row.etyma }}</template>
</el-table-column> -->
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button
>
<!-- <el-button
@click="handleWordDelete(scope.row.id)"
size="mini"
type="danger"
>删除</el-button
> -->
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import {
getPageFurnitureInfoAchievement
// deleteByPrimaryKeyRootAffix
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null
};
},
methods: {
getData() {
getPageFurnitureInfoAchievement(this.listQuery).then(res => {
// console.log(res);
this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = res.data.pageNum;
this.pageSize = res.data.pageSize;
this.total = res.data.total;
});
},
edit(id) {
console.log(id, "edit");
},
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.getData();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getData();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
handleWordDetail(id) {
this.$router.push({
path: "/achievement/achievementDetail",
query: {
id: id
}
});
// console.log(123);
},
handleWordDelete(id) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
deleteByPrimaryKeyRootAffix(id).then(res => {
this.$message({
type: "success",
message: "删除成功!"
});
this.getData();
});
});
},
handleAddProduct() {
// 添加
this.$router.push({ path: "/affixRoot/affixRootAdd" });
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
.medalUrl {
width: 100rem;
object-fit: contain;
}
</style>
<template>
<div class="container">
<!-- <h1>advertiseNum</h1> -->
<el-form
:model="list"
ref="wordDetailForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="广告次数限制" prop="resourceCode">
<el-col :span="15">
<!-- <el-input v-model="list.advertiseNum"></el-input> -->
<el-slider v-model="list.advertiseNum" show-input> </el-slider>
</el-col>
</el-form-item>
<!-- <el-form-item label="任务名称(英文名)" prop="nameEn">
<el-col :span="11">
<el-input v-model="list.nameEn"></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="任务内容说明" prop="intro">
<el-col :span="11">
<el-input v-model="list.intro"></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="排序" prop="sort">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.sort"
></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="奖励资源数量" prop="resourceNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.resourceNum"
></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="资源编号" prop="resourceCode">
<el-col :span="11">
<el-input v-model="list.resourceCode"></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="奖励资源数量" prop="rewardNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.rewardNum"
></el-input>
</el-col>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getAdvertiseNumById,
updateByPrimaryKeySelectiveAdvertiseNum
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
export default {
name: "advertiseNumDetail",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "新手引导任务"
},
{
value: 2,
label: "每日任务"
}
]
};
},
methods: {
getData() {
getAdvertiseNumById().then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
submitForm(formName) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
// console.log(key, "---", this.list[key]);
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateByPrimaryKeySelectiveAdvertiseNum(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<h1>advertiseNum</h1>
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
>
<el-form-item label="关键字:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<div class="table-container">
<el-table
ref="productTable"
:data="list"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="任务名称" align="center">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id)"
>
{{ scope.row.name }}
</div>
</template>
</el-table-column>
<el-table-column label="任务名称(英文名)" align="center">
<template slot-scope="scope">{{ scope.row.nameEn }}</template>
</el-table-column>
<el-table-column label="任务内容说明" align="center">
<template slot-scope="scope">{{ scope.row.intro }}</template>
</el-table-column>
<!-- <el-table-column label="任务类型" align="center">
<template slot-scope="scope">{{
scope.row.type == 1
? "新手引导任务"
: scope.row.type == 2
? "每日任务"
: ""
}}</template>
</el-table-column> -->
<!-- <el-table-column label="排序" align="center">
<template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column> -->
<el-table-column label="目标数" align="center">
<template slot-scope="scope">{{ scope.row.num }}</template>
</el-table-column>
<el-table-column label="资源编号" align="center">
<template slot-scope="scope">{{ scope.row.resourceCode }}</template>
</el-table-column>
<el-table-column label="奖励资源数量" align="center">
<template slot-scope="scope">{{ scope.row.rewardNum }}</template>
</el-table-column>
<!-- <el-table-column label="美式发音" align="center">
<template slot-scope="scope">{{ scope.row.usPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="词根" align="center">
<template slot-scope="scope">{{ scope.row.etyma }}</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { getPageBaseWordMission } from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null
};
},
methods: {
getData() {
getPageBaseWordMission(this.listQuery).then(res => {
// console.log(res);
this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = res.data.pageNum;
this.pageSize = res.data.pageSize;
this.total = res.data.total;
});
},
edit(id) {
console.log(id, "edit");
},
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.getData();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getData();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
handleWordDetail(id) {
this.$router.push({
path: "/missionInfo/missionInfoDetail",
query: {
id: id
}
});
// console.log(123);
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<el-form
:model="list"
:rules="rules"
ref="wordDetailForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="词根词缀" prop="affix">
<el-col :span="11">
<el-input v-model="list.affix"></el-input>
</el-col>
</el-form-item>
<el-form-item label="释义" prop="intro">
<el-col :span="11">
<el-input v-model="list.intro"></el-input>
</el-col>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.sort"
></el-input>
</el-col>
</el-form-item>
<el-form-item label="词性" prop="wordClass">
<el-col :span="11">
<el-input v-model="list.wordClass"></el-input>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import { getRootAffixById, insertSelectiveRootAffix } from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
export default {
name: "affixRootAdd",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "前缀"
},
{
value: 2,
label: "词根"
}
],
rules: {
affix: [{ required: true, message: "必填", trigger: "blur" }],
intro: [{ required: true, message: "必填", trigger: "blur" }],
sort: [{ required: true, message: "必填", trigger: "blur" }],
type: [{ required: true, message: "必填", trigger: "change" }]
}
};
},
methods: {
getData() {
getRootAffixById(this.id).then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
insertSelectiveRootAffix(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
// this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<el-form
:model="list"
:rules="rules"
ref="wordDetailForm"
label-width="100px"
class="demo-ruleForm"
>
<el-form-item label="词根词缀" prop="affix">
<el-col :span="11">
<el-input disabled v-model="list.affix"></el-input>
</el-col>
</el-form-item>
<el-form-item label="释义" prop="intro">
<el-col :span="11">
<el-input v-model="list.intro"></el-input>
</el-col>
</el-form-item>
<el-form-item label="类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.sort"
></el-input>
</el-col>
</el-form-item>
<el-form-item label="词性" prop="wordClass">
<el-col :span="11">
<el-input v-model="list.wordClass"></el-input>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getRootAffixById,
updateByPrimaryKeySelectiveRootAffix
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
export default {
name: "wordGradeDetail",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "前缀"
},
{
value: 2,
label: "词根"
}
],
rules: {
affix: [{ required: true, message: "必填", trigger: "blur" }],
intro: [{ required: true, message: "必填", trigger: "blur" }],
sort: [{ required: true, message: "必填", trigger: "blur" }],
type: [{ required: true, message: "必填", trigger: "change" }]
}
};
},
methods: {
getData() {
getRootAffixById(this.id).then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateByPrimaryKeySelectiveRootAffix(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
@submit.native.prevent
>
<el-form-item label="词根词缀:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
@keyup.enter.native="handleSearchList()"
></el-input>
</el-form-item>
<el-radio-group v-model="searchValue">
<el-radio-button label="1">精准搜索</el-radio-button>
<el-radio-button label="0">模糊匹配</el-radio-button>
</el-radio-group>
</el-form>
</div>
</el-card>
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button class="btn-add" @click="handleAddProduct" size="mini">
添加
</el-button>
<!-- <el-button class="btn-add" @click="handleStuDetail()" size="mini">
stuDetail
</el-button> -->
</el-card>
<div class="table-container">
<el-table
ref="productTable"
:data="list"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="词根词缀" align="center">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id)"
>
{{ scope.row.affix }}
</div>
</template>
</el-table-column>
<el-table-column label="释义" align="center">
<template slot-scope="scope">{{ scope.row.intro }}</template>
</el-table-column>
<el-table-column label="类型" align="center">
<template slot-scope="scope">{{
scope.row.type == 1 ? "前缀" : scope.row.type == 2 ? "词根" : ""
}}</template>
</el-table-column>
<el-table-column label="排序" align="center">
<template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column>
<el-table-column label="词性" align="center">
<template slot-scope="scope">{{ scope.row.wordClass }}</template>
</el-table-column>
<!-- <el-table-column label="美式发音" align="center">
<template slot-scope="scope">{{ scope.row.usPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="词根" align="center">
<template slot-scope="scope">{{ scope.row.etyma }}</template>
</el-table-column> -->
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button
>
<el-button
@click="handleWordDelete(scope.row.id)"
size="mini"
type="danger"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import {
getPageRootAffix,
deleteByPrimaryKeyRootAffix
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null,
searchValue: 1,
};
},
methods: {
getData() {
getPageRootAffix(this.listQuery).then(res => {
// console.log(res);
this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = res.data.pageNum;
this.pageSize = res.data.pageSize;
this.total = res.data.total;
});
},
// edit(id) {
// console.log(id, "edit");
// },
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.listQuery.match = this.searchValue
this.getData();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getData();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
handleWordDetail(id) {
this.$router.push({
path: "/affixRoot/affixRootDetail",
query: {
id: id
}
});
// console.log(123);
},
handleWordDelete(id) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
deleteByPrimaryKeyRootAffix(id).then(res => {
this.$message({
type: "success",
message: "删除成功!"
});
this.getData();
});
});
},
handleAddProduct() {
// 添加
this.$router.push({ path: "/affixRoot/affixRootAdd" });
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<el-form
:model="friendOne"
:rules="rules"
ref="friendDetailForm"
label-width="160px"
class="demo-ruleForm"
>
<!-- <el-form-item label="id" prop="id">
<el-col :span="11">
<el-input v-model="friendOne.id" ></el-input>
</el-col>
</el-form-item> -->
<el-form-item label="code" prop="code">
<el-col :span="11">
<el-input v-model="friendOne.code" ></el-input>
</el-col>
</el-form-item>
<el-form-item label="职业" prop="profession">
<el-col :span="11">
<el-input v-model="friendOne.profession" type="textarea" autosize></el-input>
</el-col>
</el-form-item>
<el-form-item label="性格" prop="character">
<el-col :span="11">
<el-input v-model="friendOne.character" type="textarea" autosize></el-input>
</el-col>
</el-form-item>
<el-form-item label="人设" prop="definition">
<el-col :span="16">
<el-input v-model="friendOne.definition" type="textarea" autosize></el-input>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('friendDetailForm')"
>提交</el-button
>
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getFurnitureInfoById,
updateByPrimaryKeySelectiveFurniture,
updateFriends
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
import { getToken } from "@/utils/auth";
export default {
name: "furnitureInfoDetail",
data() {
return {
id: "",
list: {},
rules: {
nameCn: [{ required: true, message: "必填", trigger: "blur" }],
nameEn: [{ required: true, message: "必填", trigger: "blur" }],
engName: [{ required: true, message: "必填", trigger: "blur" }],
code: [{ required: true, message: "必填", trigger: "blur" }],
des: [{ required: true, message: "必填", trigger: "blur" }],
},
friendOne:{
// id: "",
profession:"",
character:"",
definition:"",
code:""
},
token: "",
dialogVisible: false,
dialogUrl: "",
fileList: [],
dialogVisibleFrame: false,
dialogUrlFrame: "",
fileListFrame: [],
dialogVisiblePut: false,
dialogUrlPut: "",
fileListPut: []
};
},
computed: {
headers() {
return {
Authorization: this.token
};
}
},
methods: {
submitForm(formName) {
this.$refs[formName].validate(
valid => {
if (
// valid &&
// this.fileList.length > 0 &&
// this.fileListFrame &&
// this.fileListPut
1
) {
// for (const key in this.list) {
// if (this.list[key].length == 0) {
// this.list[key] = undefined;
// }
// }
// this.list.picUrlList = [];
// this.fileList.forEach(item => {
// this.list.picUrlList.push(item.url);
// });
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateFriends(this.friendOne).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
} else {
this.$message({
type: "warning",
message: "全部必填!"
});
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
},
handleRemove(file, fileList) {
let arr = this.fileList.filter(item => {
return item.url !== file.url;
});
this.fileList = arr;
console.log(this.fileList, "this.fileList");
},
handlePreview(file) {
this.dialogUrl = file.url;
this.dialogVisible = true;
},
handleSuccess(res, file, fileList) {
let arr = {};
arr.url = res.data.url;
this.fileList.push(arr);
// this.fileList.push(res.data.url);
// console.log(this.fileList, "this.fileList");
// this.list.picUrlList = this.fileList;
console.log(res);
},
// ---------------------------
handleRemoveFrame(file, fileListFrame) {
let arr = this.fileListFrame.filter(item => {
return item.url !== file.url;
});
this.fileListFrame = arr;
console.log(this.fileListFrame, "this.fileListFrame");
},
handlePreviewFrame(file) {
this.dialogUrl = file.url;
this.dialogVisible = true;
},
handleSuccessFrame(res, file, fileListFrame) {
let arr = {};
arr.url = res.data.url;
this.fileListFrame.shift();
this.fileListFrame.push(arr);
// console.log(this.fileListFrame, "this.fileListFrame");
this.list.frameUrl = res.data.url;
console.log(res);
},
// ---------------------------
handleRemovePut(file, fileListPut) {
let arr = this.fileListPut.filter(item => {
return item.url !== file.url;
});
this.fileListPut = arr;
console.log(this.fileListPut, "this.fileListPut");
},
handlePreviewPut(file) {
this.dialogUrl = file.url;
this.dialogVisible = true;
},
handleSuccessPut(res, file, fileListPut) {
let arr = {};
arr.url = res.data.url;
this.fileListPut.shift();
this.fileListPut.push(arr);
// this.fileListPut[0] = arr;
// console.log(this.fileListPut, "this.fileListPut");
this.list.putUrl = res.data.url;
console.log(res);
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.friendOne.id = this.$route.query.id;
this.friendOne.profession = this.$route.query.profession;
this.friendOne.character = this.$route.query.character;
this.friendOne.definition = this.$route.query.definition;
this.friendOne.code = this.$route.query.code;
console.log(this.$route.query,'friendonlist');
// this.token = getToken();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<!-- <h1>furnitureInfoDetail</h1> -->
<!-- <el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
@submit.native.prevent
>
<el-form-item label="关键字:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
@keyup.enter.native="handleSearchList()"
></el-input>
</el-form-item>
</el-form>
</div>
</el-card> -->
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button class="btn-add" @click="handleAddProduct" size="mini">
添加
</el-button>
<!-- <el-button class="btn-add" @click="handleStuDetail()" size="mini">
stuDetail
</el-button> -->
</el-card>
<div class="table-container">
<el-table
ref="productTable"
:data="friendList"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="60">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="id" align="center" width="120">
<template slot-scope="scope">{{ scope.row.id }}</template>
</el-table-column>
<el-table-column label="code" align="center" width="120">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id,scope.row.profession,scope.row.character,scope.row.definition,scope.row.code)"
>
{{ scope.row.code }}
</div>
</template>
</el-table-column>
<el-table-column label="职业" align="center" width="240">
<template slot-scope="scope">{{ scope.row.profession }}</template>
</el-table-column>
<el-table-column label="性格" align="center" width="240">
<template slot-scope="scope">{{ scope.row.character }}</template>
</el-table-column>
<el-table-column label="人设" align="center" >
<template slot-scope="scope">{{ scope.row.definition }}</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id,scope.row.profession,scope.row.character,scope.row.definition,scope.row.code )" type="mini"
>修改</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { getPageFurnitureInfo ,getFriendsList} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
friendList:[],
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null
};
},
methods: {
getList() {
getFriendsList(this.listQuery).then(res => {
this.friendList = res.data.list
console.log(this.friendList,'friendList');
// this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = Number(res.data.pageNum);
this.pageSize = Number(res.data.pageSize);
this.total = Number(res.data.total);
});
},
edit(id) {
console.log(id, "edit");
},
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.getList();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getList();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getList();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getList();
},
handleWordDetail(id,profession,character,definition,code) {
this.$router.push({
name: "friendsDetail",
query: {
code:code,
definition:definition,
character:character,
profession:profession,
id: id,
}
});
// console.log(123);
},
handleAddProduct() {
// 添加
this.$router.push({ path: "/friends/friendsDetail" });
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
// this.getData();
this.getList()
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
.picBox {
display: flex;
justify-content: center;
align-items: center;
.pic {
width: 100rem;
object-fit: contain;
}
}
</style>
<template>
<div>
<el-form
:model="oneMailList"
ref="oneMailForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="" prop="">
<el-button @click="handleAdd" size="mini">添加句子</el-button>
</el-form-item>
<el-form-item
v-for="(item, index) in mailAwards "
:key="index"
:label="'奖励' + (index + 1)"
class="item"
>
<el-col :span="11">
<el-input v-model="item.oneTalkCn" placeholder="中文"></el-input>
</el-col>
<el-col class="line" :span="1">-</el-col>
<el-col :span="8">
<el-input v-model="item.oneTalkEn" placeholder="英文"></el-input>
</el-col>
<el-button
@click="handleDel(index)"
type="danger"
size="mini"
icon="el-icon-delete"
circle
></el-button>
</el-form-item>
<el-form-item label="" prop="">
<el-col :span="16">
<el-input v-model="oneMailList.mailContentAwards" type="textarea" autosize=""></el-input>
</el-col>
</el-form-item>
</el-form>
</div>
</template>
<script>
export default {
name: 'oneTalk',
data(){
return{
mailAwards:[],
oneMailList:{},
}
},
methods: {
handleAdd() {
this.mailAwards.push({
oneTalkCn: "",
oneTalkEn: ""
});
console.log(this.mailAwards,'----');
this.oneMailList.mailContentAwards = JSON.stringify(this.mailAwards)
},
handleDel(index) {
this.mailAwards.splice(index, 1);
// this.oneMailList.mailContentAwards.splice(index, 1);
},
},
}
</script>
<style>
</style>
\ No newline at end of file
<template> <template>
<div class="container"> <div class="container">
<h1>欢迎来到熊猫单词宝后台管理系统</h1> <h1>xxx,您好</h1>
<img src="@/assets/images/pandaxia.png" alt=""> <!-- <img src="@/assets/images/pandaxia.png" alt=""> -->
</div> </div>
</template> </template>
......
<template>
<div class="container">
<!-- <h1>missionInfoDetail</h1> -->
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
>
<el-form-item label="关键字:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<div class="table-container">
<el-table
ref="productTable"
:data="list"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="任务名称" align="center">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id)"
>
{{ scope.row.name }}
</div>
</template>
</el-table-column>
<el-table-column label="任务名称(英文名)" align="center">
<template slot-scope="scope">{{ scope.row.nameEn }}</template>
</el-table-column>
<el-table-column label="任务内容说明" align="center">
<template slot-scope="scope">{{ scope.row.intro }}</template>
</el-table-column>
<!-- <el-table-column label="任务类型" align="center">
<template slot-scope="scope">{{
scope.row.type == 1
? "新手引导任务"
: scope.row.type == 2
? "每日任务"
: ""
}}</template>
</el-table-column> -->
<!-- <el-table-column label="排序" align="center">
<template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column> -->
<el-table-column label="目标数" align="center">
<template slot-scope="scope">{{ scope.row.num }}</template>
</el-table-column>
<el-table-column label="资源编号" align="center">
<template slot-scope="scope">{{ scope.row.resourceCode }}</template>
</el-table-column>
<el-table-column label="奖励资源数量" align="center">
<template slot-scope="scope">{{ scope.row.rewardNum }}</template>
</el-table-column>
<!-- <el-table-column label="美式发音" align="center">
<template slot-scope="scope">{{ scope.row.usPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="词根" align="center">
<template slot-scope="scope">{{ scope.row.etyma }}</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { getPageBaseWordMission } from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null
};
},
methods: {
getData() {
getPageBaseWordMission(this.listQuery).then(res => {
// console.log(res);
this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = res.data.pageNum;
this.pageSize = res.data.pageSize;
this.total = res.data.total;
});
},
edit(id) {
console.log(id, "edit");
},
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.getData();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getData();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
handleWordDetail(id) {
this.$router.push({
path: "/missionInfo/missionInfoDetail",
query: {
id: id
}
});
// console.log(123);
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<!-- <h1>inviteAward</h1> -->
<el-form
:model="list"
ref="wordDetailForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="奖励资源编号" prop="resourceCode">
<el-col :span="11">
<el-input v-model="list.resourceCode"></el-input>
</el-col>
</el-form-item>
<!-- <el-form-item label="任务名称(英文名)" prop="nameEn">
<el-col :span="11">
<el-input v-model="list.nameEn"></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="任务内容说明" prop="intro">
<el-col :span="11">
<el-input v-model="list.intro"></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="排序" prop="sort">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.sort"
></el-input>
</el-col>
</el-form-item> -->
<el-form-item label="奖励资源数量" prop="resourceNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.resourceNum"
></el-input>
</el-col>
</el-form-item>
<!-- <el-form-item label="资源编号" prop="resourceCode">
<el-col :span="11">
<el-input v-model="list.resourceCode"></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="奖励资源数量" prop="rewardNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.rewardNum"
></el-input>
</el-col>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getInviteAwardById,
updateByPrimaryKeySelectiveInviteAward
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
export default {
name: "inviteAwardDetail",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "新手引导任务"
},
{
value: 2,
label: "每日任务"
}
]
};
},
methods: {
getData() {
getInviteAwardById().then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
submitForm(formName) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
// console.log(key, "---", this.list[key]);
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateByPrimaryKeySelectiveInviteAward(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<!-- <h1>lottery</h1> -->
<!-- <el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
>
<el-form-item label="关键字:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
></el-input>
</el-form-item>
</el-form>
</div>
</el-card> -->
<!-- <el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button class="btn-add" @click="handleAddProduct" size="mini">
添加
</el-button>
</el-card> -->
<div class="table-container">
<el-table
ref="productTable"
:data="list"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="中奖概率" align="center">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id)"
>
{{ scope.row.probability }}
</div>
</template>
</el-table-column>
<el-table-column label="宠物的稀有度分类id" align="center">
<template slot-scope="scope">{{ scope.row.dragonRarityId }}</template>
</el-table-column>
<el-table-column label="抽奖类型" align="center">
<template slot-scope="scope">{{
scope.row.type == 1
? "普通抽奖"
: scope.row.type == 2
? "高级抽奖"
: ""
}}</template>
</el-table-column>
<el-table-column label="稀有度名称" align="center">
<template slot-scope="scope">{{ scope.row.rarityName }}</template>
</el-table-column>
<el-table-column label="所需资源编号" align="center">
<template slot-scope="scope">{{ scope.row.resourceCode }}</template>
</el-table-column>
<el-table-column label="所需资源数量" align="center">
<template slot-scope="scope">{{ scope.row.resourceNum }}</template>
</el-table-column>
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="词根" align="center">
<template slot-scope="scope">{{ scope.row.etyma }}</template>
</el-table-column> -->
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button
>
<!-- <el-button
@click="handleWordDelete(scope.row.id)"
size="mini"
type="danger"
>删除</el-button
> -->
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import {
getPageFurnitureInfoLottery,
deleteByPrimaryKeyRootAffix
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null
};
},
methods: {
getData() {
getPageFurnitureInfoLottery(this.listQuery).then(res => {
// console.log(res);
this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = res.data.pageNum;
this.pageSize = res.data.pageSize;
this.total = res.data.total;
});
},
edit(id) {
console.log(id, "edit");
},
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.getData();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getData();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
handleWordDetail(id) {
this.$router.push({
path: "/lottery/lotteryDetail",
query: {
id: id
}
});
// console.log(123);
},
handleWordDelete(id) {
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
deleteByPrimaryKeyRootAffix(id).then(res => {
this.$message({
type: "success",
message: "删除成功!"
});
this.getData();
});
});
},
handleAddProduct() {
// 添加
this.$router.push({ path: "/affixRoot/affixRootAdd" });
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<!-- <h1>lotteryDetail</h1> -->
<el-form
:model="list"
:rules="rules"
ref="wordDetailForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="中奖概率" prop="probability">
<el-col :span="11">
<el-slider
v-model="list.probability"
show-input
:max="1"
:step="0.01"
></el-slider>
</el-col>
</el-form-item>
<el-form-item label="宠物的稀有度分类id" prop="dragonRarityId">
<el-col :span="11">
<!-- <el-input v-model="list.dragonRarityId"></el-input> -->
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.dragonRarityId"
></el-input>
</el-col>
</el-form-item>
<el-form-item label="抽奖类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item label="稀有度名称" prop="rarityName">
<el-col :span="11">
<el-select v-model="list.rarityName" placeholder="请选择">
<el-option
v-for="item in rarityNameList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item>
<!-- <el-form-item label="稀有度名称" prop="rarityName">
<el-col :span="11">
<el-input v-model="list.rarityName"></el-input>
</el-col>
</el-form-item> -->
<el-form-item label="所需资源编号" prop="resourceCode">
<el-col :span="11">
<el-input v-model="list.resourceCode"></el-input>
</el-col>
</el-form-item>
<el-form-item label="所需资源数量" prop="resourceNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.resourceNum"
></el-input>
</el-col>
</el-form-item>
<!-- <el-form-item label="词性" prop="wordClass">
<el-col :span="11">
<el-input v-model="list.wordClass"></el-input>
</el-col>
</el-form-item> -->
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getLotteryById,
updateByPrimaryKeySelectiveLottery,
allLottery
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
export default {
name: "lotteryDetail",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "普通抽奖"
},
{
value: 2,
label: "高级抽奖"
}
],
rarityNameList: [
{
value: 1,
label: "常见级"
},
{
value: 2,
label: "稀有级"
},
{
value: 3,
label: "史诗级"
},
{
value: 4,
label: "传说级"
},
{
value: 5,
label: "特殊怪物"
}
],
allLotteryList: "",
rules: {
probability: [{ required: true, message: "必填", trigger: "blur" }],
dragonRarityId: [{ required: true, message: "必填", trigger: "blur" }],
rarityName: [{ required: true, message: "必填", trigger: "blur" }],
resourceCode: [{ required: true, message: "必填", trigger: "blur" }],
resourceNum: [{ required: true, message: "必填", trigger: "blur" }],
type: [{ required: true, message: "必填", trigger: "change" }]
}
};
},
methods: {
getData() {
getLotteryById(this.id).then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
// this.list.probability = this.list.probability * 100;
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
allLottery().then(res => {
console.log(res);
// this.list = JSON.parse(JSON.stringify(res.data));
// this.list.probability = this.list.probability * 100;
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateByPrimaryKeySelectiveLottery(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template>
<div>
<el-card>
<el-button type="primary" style="float:right;margin-bottom:10px" @click="newmail()">新建邮件</el-button>
</el-card>
<div class="tableMain">
<el-table
ref="productTable"
:data="tableData"
style="width: 100%"
border
>
<el-table-column label="序号" align="center" width="60">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="id" align="center" width="100">
<template slot-scope="scope">{{ scope.row.id}}</template>
</el-table-column>
<el-table-column label="邮件类型" align="center" width="100">
<template slot-scope="scope">
<span v-if="scope.row.mailType == 1">通知</span>
<span v-else>奖励</span>
</template>
</el-table-column>
<el-table-column label="邮件标题" align="center">
<template slot-scope="scope">{{ scope.row.mailTitle}}</template>
</el-table-column>
<!-- <el-table-column label="邮件接收类型" align="center">
<template slot-scope="scope">{{ scope.row.receiverType}}</template>
</el-table-column> -->
<el-table-column label="邮件封面图" align="center" >
<template slot-scope="scope">
<img :src="scope.row.mailCover" alt="" style="width: 100rem; height: 100rem">
</template>
</el-table-column>
<el-table-column label="触发时间" align="center" >
<template slot-scope="scope">{{ scope.row.triggerTime }}</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<!-- <el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button> -->
<el-button @click="mailDelete(scope.row.id)" type="mini"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import {
getMailList,deleteMail
} from "@/api/pandaWords";
const defaultListQuery = {
pageNum: 1,
pageSize: 5
};
export default {
name: "maillist",
data() {
return {
tableData: [],
listQuery: Object.assign({}, defaultListQuery),
listLoading: true,
pageSize: null,
pageNum: null,
total: null,
}
},
methods:{
getData(){
getMailList(this.listQuery).then(res => {
// console.log(res,'List');
this.tableData = res.data.list
// this.listLoading = false;
});
},
mailDelete(id){
this.$confirm("是否确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
deleteMail({id:id}).then(res => {
this.$message({
type: "success",
message: "删除成功!"
});
this.getData();
});
});
},
//页面跳转
newmail() {
this.$router.push({
path: "/mail/newMail",
});
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
},
mounted(){
this.getData()
}
}
</script>
<style lang="scss" scoped>
.tableMain{
width: 95%;
padding: 10px;
}
</style>
\ No newline at end of file
<template>
<div class="container">
<!-- <h1>missionInfoDetail</h1> -->
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="handleSearchList()"
type="primary"
size="small"
>
查询结果
</el-button>
<el-button
style="float: right; margin-right: 15px"
@click="handleResetSearch('listQuery')"
size="small"
>
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form
:inline="true"
:model="listQuery"
ref="listQuery"
size="small"
label-width="140px"
@submit.native.prevent
>
<el-form-item label="关键字:" prop="customerName">
<el-input
style="width: 203px"
v-model="listQuery.key"
placeholder=""
@keyup.enter.native="handleSearchList()"
></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<div class="table-container">
<el-table
ref="productTable"
:data="list"
style="width: 100%"
v-loading="listLoading"
border
>
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">{{ scope.$index + 1 }}</template>
</el-table-column>
<el-table-column label="任务名称" align="center">
<template slot-scope="scope">
<div
class="handleWordDetail"
@click="handleWordDetail(scope.row.id)"
>
{{ scope.row.name }}
</div>
</template>
</el-table-column>
<el-table-column label="任务名称(英文名)" align="center">
<template slot-scope="scope">{{ scope.row.nameEn }}</template>
</el-table-column>
<el-table-column label="任务内容说明" align="center">
<template slot-scope="scope">{{ scope.row.intro }}</template>
</el-table-column>
<!-- <el-table-column label="任务类型" align="center">
<template slot-scope="scope">{{
scope.row.type == 1
? "新手引导任务"
: scope.row.type == 2
? "每日任务"
: ""
}}</template>
</el-table-column> -->
<!-- <el-table-column label="排序" align="center">
<template slot-scope="scope">{{ scope.row.sort }}</template>
</el-table-column> -->
<!-- <el-table-column label="目标数" align="center">
<template slot-scope="scope">{{ scope.row.num }}</template>
</el-table-column> -->
<el-table-column label="资源编号" align="center">
<template slot-scope="scope">{{ scope.row.resourceCode }}</template>
</el-table-column>
<el-table-column label="奖励资源数量" align="center">
<template slot-scope="scope">{{ scope.row.rewardNum }}</template>
</el-table-column>
<!-- <el-table-column label="美式发音" align="center">
<template slot-scope="scope">{{ scope.row.usPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column>
<el-table-column label="英式发音" align="center">
<template slot-scope="scope">{{ scope.row.ukPronounce }}</template>
</el-table-column> -->
<!-- <el-table-column label="词根" align="center">
<template slot-scope="scope">{{ scope.row.etyma }}</template>
</el-table-column> -->
<el-table-column label="操作" align="center" width="100">
<template slot-scope="scope">
<el-button @click="handleWordDetail(scope.row.id)" type="mini"
>修改</el-button
>
</template>
</el-table-column>
</el-table>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total,sizes,prev, pager, next,jumper"
:page-size="pageSize"
:page-sizes="[5, 10, 15]"
:current-page.sync="pageNum"
:total="total"
>
</el-pagination>
</div>
</div>
</template>
<script>
import { getPageBaseWordMission } from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
const defaultListQuery = {
pageNum: 1,
pageSize: 10
};
export default {
data() {
return {
listQuery: Object.assign({}, defaultListQuery),
test: "errorWords",
list: [],
listLoading: true,
pageSize: null,
pageNum: null,
total: null
};
},
methods: {
getData() {
getPageBaseWordMission(this.listQuery).then(res => {
// console.log(res);
this.list = JSON.parse(JSON.stringify(res.data.list));
this.listLoading = false;
this.pageNum = res.data.pageNum;
this.pageSize = res.data.pageSize;
this.total = res.data.total;
});
},
edit(id) {
console.log(id, "edit");
},
handleSearchList() {
//搜索
this.listQuery.pageNum = 1;
this.getData();
},
handleResetSearch(formName) {
this.$refs[formName].resetFields();
// 重置
// this.selectProductCateValue = [];
// this.chatTime = undefined;
// this.paymentTime = undefined;
this.listQuery = Object.assign({}, defaultListQuery);
this.getData();
},
handleCurrentChange(val) {
// 翻页
this.listQuery.pageNum = val;
this.listLoading = true;
this.getData();
},
handleSizeChange(val) {
//切换展示条数
this.listQuery.pageSize = val;
this.getData();
},
handleWordDetail(id) {
this.$router.push({
path: "/missionInfo/missionInfoDetail",
query: {
id: id
}
});
// console.log(123);
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.getData();
}
};
</script>
<style lang="scss" scoped>
.handleWordDetail {
cursor: pointer;
}
.container {
padding: 30rem;
}
</style>
<template>
<div class="container">
<el-form
:model="list"
:rules="rules"
ref="wordDetailForm"
label-width="150px"
class="demo-ruleForm"
>
<el-form-item label="任务名称" prop="name">
<el-col :span="11">
<el-input v-model="list.name"></el-input>
</el-col>
</el-form-item>
<el-form-item label="任务名称(英文名)" prop="nameEn">
<el-col :span="11">
<el-input v-model="list.nameEn"></el-input>
</el-col>
</el-form-item>
<el-form-item label="任务内容说明" prop="intro">
<el-col :span="11">
<el-input v-model="list.intro"></el-input>
</el-col>
</el-form-item>
<!-- <el-form-item label="类型" prop="type">
<el-col :span="11">
<el-select v-model="list.type" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="排序" prop="sort">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.sort"
></el-input>
</el-col>
</el-form-item> -->
<!-- <el-form-item label="目标数" prop="num">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.num"
></el-input>
</el-col>
</el-form-item> -->
<el-form-item label="资源编号" prop="resourceCode">
<el-col :span="11">
<el-input v-model="list.resourceCode"></el-input>
</el-col>
</el-form-item>
<el-form-item label="奖励资源数量" prop="rewardNum">
<el-col :span="11">
<el-input
oninput="value=value.replace(/[^\d]|^[0]/g, '')"
v-model.number="list.rewardNum"
></el-input>
</el-col>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="submitForm('wordDetailForm')"
>提交</el-button
>
<!-- <el-button @click="resetForm('wordDetailForm')">清空</el-button> -->
</el-form-item>
</el-form>
</div>
</template>
<script>
import {
getBaseWordByIdMission,
updateByPrimaryKeySelectiveMission
} from "@/api/pandaWords";
import { formatDate } from "@/utils/date";
export default {
name: "missionInfoDetail",
data() {
return {
id: "",
list: {},
typeList: [
{
value: 1,
label: "新手引导任务"
},
{
value: 2,
label: "每日任务"
}
],
rules: {
name: [{ required: true, message: "必填", trigger: "blur" }],
// nameEn: [{ required: true, message: "必填", trigger: "blur" }],
resourceCode: [{ required: true, message: "必填", trigger: "blur" }],
rewardNum: [{ required: true, message: "必填", trigger: "blur" }]
// type: [{ required: true, message: "必填", trigger: "change" }]
}
};
},
methods: {
getData() {
getBaseWordByIdMission(this.id).then(res => {
console.log(res);
this.list = JSON.parse(JSON.stringify(res.data));
// this.listLoading = false;
// this.pageNum = res.data.pageNum;
// this.pageSize = res.data.pageSize;
// this.total = res.data.total;
});
},
submitForm(formName) {
this.$refs[formName].validate(valid => {
if (valid) {
for (const key in this.list) {
if (this.list[key].length == 0) {
this.list[key] = undefined;
}
}
this.$confirm("是否确认提交?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
updateByPrimaryKeySelectiveMission(this.list).then(res => {
this.$message({
type: "success",
message: "提交成功!"
});
});
});
} else {
console.log("error submit!!");
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
}
},
filters: {
formatDateTime(time) {
if (time == null || time === "") {
return "";
}
let date = new Date(time);
return formatDate(date, "yyyy-MM-dd hh:mm:ss");
// return formatDate(date, "yyyy-MM-dd");
}
},
mounted() {
this.id = this.$route.query.id;
this.getData();
}
};
</script>
<style lang="scss" scoped>
// .item {
// display: flex;
// flex-direction: column;
// }
.container {
padding: 30rem;
}
</style>
<template> 
<div class="app-container">
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float:right"
type="primary"
@click="handleSearchList()"
size="small">
查询搜索
</el-button>
<el-button
style="float:right;margin-right: 15px"
@click="handleResetSearch()"
size="small">
重置
</el-button>
</div>
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:">
<el-input v-model="listQuery.id" class="input-width" placeholder="服务单号"></el-input>
</el-form-item>
<el-form-item label="处理状态:">
<el-select v-model="listQuery.status" placeholder="全部" clearable class="input-width">
<el-option v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="申请时间:">
<el-date-picker
class="input-width"
v-model="listQuery.createTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择时间">
</el-date-picker>
</el-form-item>
<el-form-item label="操作人员:">
<el-input v-model="listQuery.handleMan" class="input-width" placeholder="全部"></el-input>
</el-form-item>
<el-form-item label="处理时间:">
<el-date-picker
class="input-width"
v-model="listQuery.handleTime"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择时间">
</el-date-picker>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
</el-card>
<div class="table-container">
<el-table ref="returnApplyTable"
:data="list"
style="width: 100%;"
@selection-change="handleSelectionChange"
v-loading="listLoading" border>
<el-table-column type="selection" width="60" align="center"></el-table-column>
<el-table-column label="服务单号" width="180" align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="申请时间" width="180" align="center">
<template slot-scope="scope">{{scope.row.createTime | formatTime}}</template>
</el-table-column>
<el-table-column label="用户账号" align="center">
<template slot-scope="scope">{{scope.row.memberUsername}}</template>
</el-table-column>
<el-table-column label="退款金额" width="180" align="center">
<template slot-scope="scope">{{scope.row | formatReturnAmount}}</template>
</el-table-column>
<el-table-column label="申请状态" width="180" align="center">
<template slot-scope="scope">{{scope.row.status | formatStatus}}</template>
</el-table-column>
<el-table-column label="处理时间" width="180" align="center">
<template slot-scope="scope">{{scope.row.handleTime | formatTime}}</template>
</el-table-column>
<el-table-column label="操作" width="180" align="center">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleViewDetail(scope.$index, scope.row)">查看详情</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="batch-operate-container">
<el-select
size="small"
v-model="operateType" placeholder="批量操作">
<el-option
v-for="item in operateOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button
style="margin-left: 20px"
class="search-button"
@click="handleBatchOperate()"
type="primary"
size="small">
确定
</el-button>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {formatDate} from '@/utils/date';
import {fetchList,deleteApply} from '@/api/returnApply';
const defaultListQuery = {
pageNum: 1,
pageSize: 10,
id: null,
receiverKeyword: null,
status: null,
createTime: null,
handleMan: null,
handleTime: null
};
const defaultStatusOptions=[
{
label: '待处理',
value: 0
},
{
label: '退货中',
value: 1
},
{
label: '已完成',
value: 2
},
{
label: '已拒绝',
value: 3
}
];
export default {
name:'returnApplyList',
data() {
return {
listQuery:Object.assign({},defaultListQuery),
statusOptions: Object.assign({},defaultStatusOptions),
list:null,
total:null,
listLoading:false,
multipleSelection:[],
operateType:1,
operateOptions: [
{
label: "批量删除",
value: 1
}
],
}
},
created(){
this.getList();
},
filters:{
formatTime(time) {
if(time==null||time===''){
return 'N/A';
}
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
},
formatStatus(status){
for(let i=0;i<defaultStatusOptions.length;i++){
if(status===defaultStatusOptions[i].value){
return defaultStatusOptions[i].label;
}
}
},
formatReturnAmount(row){
return row.productRealPrice*row.productCount;
}
},
methods:{
handleSelectionChange(val){
this.multipleSelection = val;
},
handleResetSearch() {
this.listQuery = Object.assign({}, defaultListQuery);
},
handleSearchList() {
this.listQuery.pageNum = 1;
this.getList();
},
handleViewDetail(index,row){
this.$router.push({path:'/oms/returnApplyDetail',query:{id:row.id}})
},
handleBatchOperate(){
if(this.multipleSelection==null||this.multipleSelection.length<1){
this.$message({
message: '请选择要操作的申请',
type: 'warning',
duration: 1000
});
return;
}
if(this.operateType===1){
//批量删除
this.$confirm('是否要进行删除操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = new URLSearchParams();
let ids=[];
for(let i=0;i<this.multipleSelection.length;i++){
ids.push(this.multipleSelection[i].id);
}
params.append("ids",ids);
deleteApply(params).then(response=>{
this.getList();
this.$message({
type: 'success',
message: '删除成功!'
});
});
})
}
},
handleSizeChange(val){
this.listQuery.pageNum = 1;
this.listQuery.pageSize = val;
this.getList();
},
handleCurrentChange(val){
this.listQuery.pageNum = val;
this.getList();
},
getList(){
this.listLoading=true;
fetchList(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data.list;
this.total = response.data.total;
});
}
}
}
</script>
<style scoped>
.input-width {
width: 203px;
}
</style>
<template> 
<div class="app-container">
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button
size="mini"
@click="handleAdd"
class="btn-add">添加
</el-button>
</el-card>
<div class="table-container">
<el-table ref="returnReasonTable"
:data="list"
style="width: 100%;"
@selection-change="handleSelectionChange"
v-loading="listLoading" border>
<el-table-column type="selection" width="60" align="center"></el-table-column>
<el-table-column label="编号" width="80" align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="原因类型" align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="排序" width="100" align="center">
<template slot-scope="scope">{{scope.row.sort }}</template>
</el-table-column>
<el-table-column label="是否可用" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.status"
@change="handleStatusChange(scope.$index,scope.row)"
:active-value="1"
:inactive-value="0">
</el-switch>
</template>
</el-table-column>
<el-table-column label="添加时间" width="180" align="center">
<template slot-scope="scope">{{scope.row.createTime | formatCreateTime}}</template>
</el-table-column>
<el-table-column label="操作" width="160" align="center">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleUpdate(scope.$index, scope.row)">编辑</el-button>
<el-button
size="mini"
@click="handleDelete(scope.$index, scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="batch-operate-container">
<el-select
size="small"
v-model="operateType" placeholder="批量操作">
<el-option
v-for="item in operateOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button
style="margin-left: 20px"
class="search-button"
@click="handleBatchOperate"
type="primary"
size="small">
确定
</el-button>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:current-page.sync="listQuery.pageNum"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:total="total">
</el-pagination>
</div>
<el-dialog
title="添加退货原因"
:visible.sync="dialogVisible" width="30%">
<el-form :model="returnReason"
ref="reasonForm" label-width="150px">
<el-form-item label="原因类型:">
<el-input v-model="returnReason.name" class="input-width"></el-input>
</el-form-item>
<el-form-item label="排序:">
<el-input v-model="returnReason.sort" class="input-width"></el-input>
</el-form-item>
<el-form-item label="是否启用:">
<el-switch v-model="returnReason.status" :active-value="1" :inactive-value="0"></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="handleConfirm">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {formatDate} from '@/utils/date';
import {fetchList,deleteReason,updateStatus,addReason,getReasonDetail,updateReason} from '@/api/returnReason';
const defaultListQuery = {
pageNum: 1,
pageSize: 5
};
const defaultReturnReason = {
name:null,
sort:0,
status:1,
createTime:null
};
export default {
name: 'returnReasonList',
data() {
return {
list: null,
total: null,
multipleSelection: [],
listLoading:true,
listQuery:Object.assign({}, defaultListQuery),
operateType:null,
operateOptions: [
{
label: "删除",
value: 1
}
],
dialogVisible:false,
returnReason:Object.assign({},defaultReturnReason),
operateReasonId:null
}
},
created(){
this.getList();
},
filters:{
formatCreateTime(time) {
let date = new Date(time);
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
}
},
methods: {
handleAdd() {
this.dialogVisible=true;
this.operateReasonId=null;
this.returnReason=Object.assign({},defaultReturnReason);
},
handleConfirm(){
if(this.operateReasonId==null){
//添加操作
addReason(this.returnReason).then(response=>{
this.dialogVisible=false;
this.operateReasonId=null;
this.$message({
message: '添加成功!',
type: 'success',
duration:1000
});
this.getList();
});
}else{
//编辑操作
updateReason(this.operateReasonId,this.returnReason).then(response=>{
this.dialogVisible=false;
this.operateReasonId=null;
this.$message({
message: '修改成功!',
type: 'success',
duration:1000
});
this.getList();
});
}
},
handleUpdate(index, row){
this.dialogVisible=true;
this.operateReasonId=row.id;
getReasonDetail(row.id).then(response=>{
this.returnReason=response.data;
});
},
handleDelete(index, row){
let ids=[];
ids.push(row.id);
this.deleteReason(ids);
},
handleSelectionChange(val){
this.multipleSelection = val;
},
handleStatusChange(index,row){
let ids=[];
ids.push(row.id);
let param = new URLSearchParams();
param.append("status",row.status);
param.append("ids",ids);
updateStatus(param).then(response=>{
this.$message({
message: '状态修改成功',
type: 'success'
});
});
},
handleBatchOperate(){
if(this.multipleSelection==null||this.multipleSelection.length<1){
this.$message({
message: '请选择要操作的条目',
type: 'warning',
duration: 1000
});
return;
}
if(this.operateType===1){
let ids=[];
for(let i=0;i<this.multipleSelection.length;i++){
ids.push(this.multipleSelection[i].id);
}
this.deleteReason(ids);
}
},
handleSizeChange(val){
this.listQuery.pageNum = 1;
this.listQuery.pageSize = val;
this.getList();
},
handleCurrentChange(val){
this.listQuery.pageNum = val;
this.getList();
},
getList(){
this.listLoading = true;
fetchList(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data.list;
this.total = response.data.total;
});
},
deleteReason(ids){
this.$confirm('是否要进行该删除操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = new URLSearchParams();
params.append("ids",ids);
deleteReason(params).then(response=>{
this.$message({
message: '删除成功!',
type: 'success',
duration: 1000
});
this.listQuery.pageNum=1;
this.getList();
});
})
},
}
}
</script>
<style scoped>
.input-width {
width: 80%;
}
</style>
<template> 
<el-dialog title="订单跟踪"
:visible.sync="visible"
:before-close="handleClose"
width="40%">
<el-steps direction="vertical"
:active="6"
finish-status="success"
space="50px">
<el-step v-for="item in logisticsList"
:key="item.name"
:title="item.name"
:description="item.time"></el-step>
</el-steps>
</el-dialog>
</template>
<script>
const defaultLogisticsList=[
{name: '订单已提交,等待付款',time:'2017-04-01 12:00:00 '},
{name: '订单付款成功',time:'2017-04-01 12:00:00 '},
{name: '在北京市进行下级地点扫描,等待付款',time:'2017-04-01 12:00:00 '},
{name: '在分拨中心广东深圳公司进行卸车扫描,等待付款',time:'2017-04-01 12:00:00 '},
{name: '在广东深圳公司进行发出扫描',time:'2017-04-01 12:00:00 '},
{name: '到达目的地网点广东深圳公司,快件将很快进行派送',time:'2017-04-01 12:00:00 '},
{name: '订单已签收,期待再次为您服务',time:'2017-04-01 12:00:00 '}
];
export default {
name:'logisticsDialog',
props: {
value: Boolean
},
computed:{
visible: {
get() {
return this.value;
},
set(visible){
this.value=visible;
}
}
},
data() {
return {
logisticsList:Object.assign({},defaultLogisticsList)
}
},
methods:{
emitInput(val) {
this.$emit('input', val)
},
handleClose(){
this.emitInput(false);
}
}
}
</script>
<style></style>
<template> 
<div class="app-container">
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>发货列表</span>
</el-card>
<div class="table-container">
<el-table ref="deliverOrderTable"
style="width: 100%;"
:data="list" border>
<el-table-column label="订单编号" width="180" align="center">
<template slot-scope="scope">{{scope.row.orderSn}}</template>
</el-table-column>
<el-table-column label="收货人" width="180" align="center">
<template slot-scope="scope">{{scope.row.receiverName}}</template>
</el-table-column>
<el-table-column label="手机号码" width="160" align="center">
<template slot-scope="scope">{{scope.row.receiverPhone}}</template>
</el-table-column>
<el-table-column label="邮政编码" width="160" align="center">
<template slot-scope="scope">{{scope.row.receiverPostCode}}</template>
</el-table-column>
<el-table-column label="收货地址" align="center">
<template slot-scope="scope">{{scope.row.address}}</template>
</el-table-column>
<el-table-column label="配送方式" width="160" align="center">
<template slot-scope="scope">
<el-select placeholder="请选择物流公司"
v-model="scope.row.deliveryCompany"
size="small">
<el-option v-for="item in companyOptions"
:key="item"
:label="item"
:value="item">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="物流单号" width="180" align="center">
<template slot-scope="scope">
<el-input size="small" v-model="scope.row.deliverySn"></el-input>
</template>
</el-table-column>
</el-table>
<div style="margin-top: 15px;text-align: center">
<el-button @click="cancel">取消</el-button>
<el-button @click="confirm" type="primary">确定</el-button>
</div>
</div>
</div>
</template>
<script>
import {deliveryOrder} from '@/api/order'
const defaultLogisticsCompanies=["顺丰快递","圆通快递","中通快递","韵达快递"];
export default {
name: 'deliverOrderList',
data() {
return {
list:[],
companyOptions:defaultLogisticsCompanies
}
},
created(){
this.list= this.$route.query.list;
//当list不为数组时转换为数组
if(this.list instanceof Array===false){
this.list=[];
}
},
methods:{
cancel(){
this.$router.back();
},
confirm(){
this.$confirm('是否要进行发货操作?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deliveryOrder(this.list).then(response=>{
this.$router.back();
this.$message({
type: 'success',
message: '发货成功!'
});
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消发货'
});
});
}
}
}
</script>
<style></style>
<template> 
<el-card class="form-container" shadow="never">
<el-form :model="orderSetting"
ref="orderSettingForm"
:rules="rules"
label-width="150px">
<el-form-item label="秒杀订单超过:" prop="flashOrderOvertime">
<el-input v-model="orderSetting.flashOrderOvertime" class="input-width">
<template slot="append"></template>
</el-input>
<span class="note-margin">未付款,订单自动关闭</span>
</el-form-item>
<el-form-item label="正常订单超过:" prop="normalOrderOvertime">
<el-input v-model="orderSetting.normalOrderOvertime" class="input-width">
<template slot="append"></template>
</el-input>
<span class="note-margin">未付款,订单自动关闭</span>
</el-form-item>
<el-form-item label="发货超过:" prop="confirmOvertime">
<el-input v-model="orderSetting.confirmOvertime" class="input-width">
<template slot="append"></template>
</el-input>
<span class="note-margin">未收货,订单自动完成</span>
</el-form-item>
<el-form-item label="订单完成超过:" prop="finishOvertime">
<el-input v-model="orderSetting.finishOvertime" class="input-width">
<template slot="append"></template>
</el-input>
<span class="note-margin">自动结束交易,不能申请售后</span>
</el-form-item>
<el-form-item label="订单完成超过:" prop="commentOvertime">
<el-input v-model="orderSetting.commentOvertime" class="input-width">
<template slot="append"></template>
</el-input>
<span class="note-margin">自动五星好评</span>
</el-form-item>
<el-form-item>
<el-button
@click="confirm('orderSettingForm')"
type="primary">提交</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import {getOrderSetting,updateOrderSetting} from '@/api/orderSetting';
const defaultOrderSetting = {
id: null,
flashOrderOvertime: 0,
normalOrderOvertime: 0,
confirmOvertime: 0,
finishOvertime: 0,
commentOvertime: 0
};
const checkTime = (rule, value, callback) => {
if (!value) {
return callback(new Error('时间不能为空'));
}
console.log("checkTime",value);
let intValue = parseInt(value);
if (!Number.isInteger(intValue)) {
return callback(new Error('请输入数字值'));
}
callback();
};
export default {
name: 'orderSetting',
data() {
return {
orderSetting: Object.assign({}, defaultOrderSetting),
rules: {
flashOrderOvertime:{validator: checkTime, trigger: 'blur' },
normalOrderOvertime:{validator: checkTime, trigger: 'blur' },
confirmOvertime: {validator: checkTime, trigger: 'blur' },
finishOvertime: {validator: checkTime, trigger: 'blur' },
commentOvertime:{validator: checkTime, trigger: 'blur' }
}
}
},
created(){
this.getDetail();
},
methods:{
confirm(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
this.$confirm('是否要提交修改?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
updateOrderSetting(1,this.orderSetting).then(response=>{
this.$message({
type: 'success',
message: '提交成功!',
duration:1000
});
})
});
} else {
this.$message({
message: '提交参数不合法',
type: 'warning'
});
return false;
}
});
},
getDetail(){
getOrderSetting(1).then(response=>{
this.orderSetting=response.data;
})
}
}
}
</script>
<style scoped>
.input-width {
width: 50%;
}
.note-margin {
margin-left: 15px;
}
</style>
<template> 
<brand-detail :is-edit='false'></brand-detail>
</template>
<script>
import BrandDetail from './components/BrandDetail'
export default {
name: 'addBrand',
components: { BrandDetail }
}
</script>
<style>
</style>
<template> 
<el-card class="form-container" shadow="never">
<el-form :model="brand" :rules="rules" ref="brandFrom" label-width="150px">
<el-form-item label="品牌名称:" prop="name">
<el-input v-model="brand.name"></el-input>
</el-form-item>
<el-form-item label="品牌首字母:">
<el-input v-model="brand.firstLetter"></el-input>
</el-form-item>
<el-form-item label="品牌LOGO:" prop="logo">
<single-upload v-model="brand.logo"></single-upload>
</el-form-item>
<el-form-item label="品牌专区大图:">
<single-upload v-model="brand.bigPic"></single-upload>
</el-form-item>
<el-form-item label="品牌故事:">
<el-input
placeholder="请输入内容"
type="textarea"
v-model="brand.brandStory"
:autosize="true"></el-input>
</el-form-item>
<el-form-item label="排序:" prop="sort">
<el-input v-model.number="brand.sort"></el-input>
</el-form-item>
<el-form-item label="是否显示:">
<el-radio-group v-model="brand.showStatus">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="品牌制造商:">
<el-radio-group v-model="brand.factoryStatus">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('brandFrom')">提交</el-button>
<el-button v-if="!isEdit" @click="resetForm('brandFrom')">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</template>
<script>
import {createBrand, getBrand, updateBrand} from '@/api/brand'
import SingleUpload from '@/components/Upload/singleUpload'
const defaultBrand={
bigPic: '',
brandStory: '',
factoryStatus: 0,
firstLetter: '',
logo: '',
name: '',
showStatus: 0,
sort: 0
};
export default {
name: 'BrandDetail',
components:{SingleUpload},
props: {
isEdit: {
type: Boolean,
default: false
}
},
data() {
return {
brand:Object.assign({}, defaultBrand),
rules: {
name: [
{required: true, message: '请输入品牌名称', trigger: 'blur'},
{min: 2, max: 140, message: '长度在 2 到 140 个字符', trigger: 'blur'}
],
logo: [
{required: true, message: '请输入品牌logo', trigger: 'blur'}
],
sort: [
{type: 'number', message: '排序必须为数字'}
],
}
}
},
created() {
if (this.isEdit) {
getBrand(this.$route.query.id).then(response => {
this.brand = response.data;
});
}else{
this.brand = Object.assign({},defaultBrand);
}
},
methods: {
onSubmit(formName) {
this.$refs[formName].validate((valid) => {
if (valid) {
this.$confirm('是否提交数据', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
if (this.isEdit) {
updateBrand(this.$route.query.id, this.brand).then(response => {
this.$refs[formName].resetFields();
this.$message({
message: '修改成功',
type: 'success',
duration:1000
});
this.$router.back();
});
} else {
createBrand(this.brand).then(response => {
this.$refs[formName].resetFields();
this.brand = Object.assign({},defaultBrand);
this.$message({
message: '提交成功',
type: 'success',
duration:1000
});
});
}
});
} else {
this.$message({
message: '验证失败',
type: 'error',
duration:1000
});
return false;
}
});
},
resetForm(formName) {
this.$refs[formName].resetFields();
this.brand = Object.assign({},defaultBrand);
}
}
}
</script>
<style>
</style>
<template> 
<div class="app-container">
<el-card class="filter-container" shadow="never">
<div>
<i class="el-icon-search"></i>
<span>筛选搜索</span>
<el-button
style="float: right"
@click="searchBrandList()"
type="primary"
size="small">
查询结果
</el-button>
</div>
<div style="margin-top: 15px">
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
<el-form-item label="输入搜索:">
<el-input style="width: 203px" v-model="listQuery.keyword" placeholder="品牌名称/关键字"></el-input>
</el-form-item>
</el-form>
</div>
</el-card>
<el-card class="operate-container" shadow="never">
<i class="el-icon-tickets"></i>
<span>数据列表</span>
<el-button
class="btn-add"
@click="addBrand()"
size="mini">
添加
</el-button>
</el-card>
<div class="table-container">
<el-table ref="brandTable"
:data="list"
style="width: 100%"
@selection-change="handleSelectionChange"
v-loading="listLoading"
border>
<el-table-column type="selection" width="60" align="center"></el-table-column>
<el-table-column label="编号" width="100" align="center">
<template slot-scope="scope">{{scope.row.id}}</template>
</el-table-column>
<el-table-column label="品牌名称" align="center">
<template slot-scope="scope">{{scope.row.name}}</template>
</el-table-column>
<el-table-column label="品牌首字母" width="100" align="center">
<template slot-scope="scope">{{scope.row.firstLetter}}</template>
</el-table-column>
<el-table-column label="排序" width="100" align="center">
<template slot-scope="scope">{{scope.row.sort}}</template>
</el-table-column>
<el-table-column label="品牌制造商" width="100" align="center">
<template slot-scope="scope">
<el-switch
@change="handleFactoryStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.factoryStatus">
</el-switch>
</template>
</el-table-column>
<el-table-column label="是否显示" width="100" align="center">
<template slot-scope="scope">
<el-switch
@change="handleShowStatusChange(scope.$index, scope.row)"
:active-value="1"
:inactive-value="0"
v-model="scope.row.showStatus">
</el-switch>
</template>
</el-table-column>
<el-table-column label="相关" width="220" align="center">
<template slot-scope="scope">
<span>商品:</span>
<el-button
size="mini"
type="text"
@click="getProductList(scope.$index, scope.row)">100
</el-button>
<span>评价:</span>
<el-button
size="mini"
type="text"
@click="getProductCommentList(scope.$index, scope.row)">1000
</el-button>
</template>
</el-table-column>
<el-table-column label="操作" width="200" align="center">
<template slot-scope="scope">
<el-button
size="mini"
@click="handleUpdate(scope.$index, scope.row)">编辑
</el-button>
<el-button
size="mini"
type="danger"
@click="handleDelete(scope.$index, scope.row)">删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="batch-operate-container">
<el-select
size="small"
v-model="operateType" placeholder="批量操作">
<el-option
v-for="item in operates"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-button
style="margin-left: 20px"
class="search-button"
@click="handleBatchOperate()"
type="primary"
size="small">
确定
</el-button>
</div>
<div class="pagination-container">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
layout="total, sizes,prev, pager, next,jumper"
:page-size="listQuery.pageSize"
:page-sizes="[5,10,15]"
:current-page.sync="listQuery.pageNum"
:total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import {fetchList, updateShowStatus, updateFactoryStatus, deleteBrand} from '@/api/brand'
export default {
name: 'brandList',
data() {
return {
operates: [
{
label: "显示品牌",
value: "showBrand"
},
{
label: "隐藏品牌",
value: "hideBrand"
}
],
operateType: null,
listQuery: {
keyword: null,
pageNum: 1,
pageSize: 10
},
list: null,
total: null,
listLoading: true,
multipleSelection: []
}
},
created() {
this.getList();
},
methods: {
getList() {
this.listLoading = true;
fetchList(this.listQuery).then(response => {
this.listLoading = false;
this.list = response.data.list;
this.total = response.data.total;
this.totalPage = response.data.totalPage;
this.pageSize = response.data.pageSize;
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleUpdate(index, row) {
this.$router.push({path: '/pms/updateBrand', query: {id: row.id}})
},
handleDelete(index, row) {
this.$confirm('是否要删除该品牌', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteBrand(row.id).then(response => {
this.$message({
message: '删除成功',
type: 'success',
duration: 1000
});
this.getList();
});
});
},
getProductList(index, row) {
console.log(index, row);
},
getProductCommentList(index, row) {
console.log(index, row);
},
handleFactoryStatusChange(index, row) {
var data = new URLSearchParams();
data.append("ids", row.id);
data.append("factoryStatus", row.factoryStatus);
updateFactoryStatus(data).then(response => {
this.$message({
message: '修改成功',
type: 'success',
duration: 1000
});
}).catch(error => {
if (row.factoryStatus === 0) {
row.factoryStatus = 1;
} else {
row.factoryStatus = 0;
}
});
},
handleShowStatusChange(index, row) {
let data = new URLSearchParams();
;
data.append("ids", row.id);
data.append("showStatus", row.showStatus);
updateShowStatus(data).then(response => {
this.$message({
message: '修改成功',
type: 'success',
duration: 1000
});
}).catch(error => {
if (row.showStatus === 0) {
row.showStatus = 1;
} else {
row.showStatus = 0;
}
});
},
handleSizeChange(val) {
this.listQuery.pageNum = 1;
this.listQuery.pageSize = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.pageNum = val;
this.getList();
},
searchBrandList() {
this.listQuery.pageNum = 1;
this.getList();
},
handleBatchOperate() {
console.log(this.multipleSelection);
if (this.multipleSelection < 1) {
this.$message({
message: '请选择一条记录',
type: 'warning',
duration: 1000
});
return;
}
let showStatus = 0;
if (this.operateType === 'showBrand') {
showStatus = 1;
} else if (this.operateType === 'hideBrand') {
showStatus = 0;
} else {
this.$message({
message: '请选择批量操作类型',
type: 'warning',
duration: 1000
});
return;
}
let ids = [];
for (let i = 0; i < this.multipleSelection.length; i++) {
ids.push(this.multipleSelection[i].id);
}
let data = new URLSearchParams();
data.append("ids", ids);
data.append("showStatus", showStatus);
updateShowStatus(data).then(response => {
this.getList();
this.$message({
message: '修改成功',
type: 'success',
duration: 1000
});
});
},
addBrand() {
this.$router.push({path: '/pms/addBrand'})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>
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