|
@@ -7,8 +7,8 @@
|
|
|
v-model="listQuery.name"></el-input>
|
|
|
<el-input clearable class="filter-item" style="width: 200px;" placeholder="礼品编号"
|
|
|
v-model="listQuery.seq"></el-input>
|
|
|
- <el-date-picker class="filter-item" v-model="listQuery.shelfTime" type="datetime" placeholder="礼品上架时间">
|
|
|
- </el-date-picker>
|
|
|
+ <!-- <el-date-picker class="filter-item" v-model="listQuery.shelfTime" type="datetime" placeholder="礼品上架时间">
|
|
|
+ </el-date-picker> -->
|
|
|
<el-select v-model="listQuery.status" clearable placeholder="状态" style="top: -4px;width: 200px;">
|
|
|
<el-option :key="item.type" v-for="item in goodsStatusList" :label="item.name" :value="item.type">
|
|
|
</el-option>
|
|
@@ -27,7 +27,7 @@
|
|
|
<el-table-column align="center" min-width="100px" label="礼品名称" prop="name">
|
|
|
</el-table-column>
|
|
|
|
|
|
- <el-table-column align="center" min-width="100px" label="礼品编号" prop="seq">
|
|
|
+ <el-table-column align="center" min-width="120px" label="礼品编号" prop="seq">
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column align="center" min-width="80px" label="礼品属性">
|
|
@@ -49,8 +49,8 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column align="center" min-width="100px" label="礼品所在地" prop="location">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="150px" label="上架时间" prop="shelfTime">
|
|
|
- </el-table-column>
|
|
|
+ <!-- <el-table-column align="center" min-width="150px" label="上架时间" prop="shelfTime">
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column align="center" min-width="80px" label="礼品状态">
|
|
|
<template slot-scope="props">
|
|
|
<span v-if="props.row.status == 1">上架</span>
|
|
@@ -88,8 +88,8 @@
|
|
|
<!-- 员工积分记录列表 -->
|
|
|
<el-dialog title="兑换记录" :visible.sync="dialogListVisible" width="70%">
|
|
|
<div class="filter-container">
|
|
|
- <el-select v-model="itemListQuery.deptId" clearable placeholder="部门" style="top: -4px;width: 200px;">
|
|
|
- <el-option :key="item.type" v-for="item in depTypeList" :label="item.name" :value="item.type">
|
|
|
+ <el-select filterable v-model="itemListQuery.deptId" clearable placeholder="部门" style="top: -4px;width: 200px;">
|
|
|
+ <el-option :key="item.deptId" v-for="item in depTypeList" :label="item.deptName" :value="item.deptId">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
<el-input clearable class="filter-item" style="width: 200px;" placeholder="员工名称"
|
|
@@ -104,19 +104,21 @@
|
|
|
highlight-current-row>
|
|
|
<el-table-column type="index" label="序号" header-align="center" align="center">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="100px" label="部门" prop="deptName">
|
|
|
+ <el-table-column align="center" width="200px" label="部门" prop="deptName">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="员工姓名" prop="purchaser">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="100px" label="员工姓名" prop="purchaserName">
|
|
|
+ <el-table-column align="center" label="兑换方式" prop="deliveryTypeName">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="100px" label="兑换方式" prop="deliveryName">
|
|
|
+ <el-table-column align="center" label="联系人" prop="contact">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="80px" label="联系人" prop="contact">
|
|
|
+ <el-table-column align="center" width="120px" label="联系方式" prop="contactPhone">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="80px" label="联系方式" prop="contactPhone">
|
|
|
+ <el-table-column align="center" width="200px" label="地址" prop="contactAddr">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="80px" label="地址/邮箱" prop="contactAddr">
|
|
|
+ <el-table-column align="center" width="200px" label="邮箱" prop="contactEmail">
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" min-width="80px" label="兑换时间" prop="createTime">
|
|
|
+ <el-table-column align="center" width="150px" label="兑换时间" prop="createTime">
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
@@ -160,7 +162,7 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item style="width: 800px" label="礼品图片">
|
|
|
+ <el-form-item style="width: 800px" label="礼品图片" prop="imgUrl">
|
|
|
<el-tooltip content="建议图片宽高比260*200" placement="top-start">
|
|
|
<el-upload :action="fileImgUrl" list-type="picture-card" :file-list="dataForm.images"
|
|
|
:on-success="handleGallerySucess" :on-exceed="handleExceed" :before-upload="uploadBannerImg"
|
|
@@ -169,10 +171,6 @@
|
|
|
</el-upload>
|
|
|
</el-tooltip>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
- <!-- <el-form-item label="积分" prop="integral">
|
|
|
- <el-input v-model="dataForm.integral"></el-input>
|
|
|
- </el-form-item> -->
|
|
|
<el-form-item label="库存量" prop="actualStock">
|
|
|
<el-input-number :precision="0" :step="1" v-model="dataForm.actualStock"></el-input-number>
|
|
|
</el-form-item>
|
|
@@ -185,10 +183,10 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 关联福利操作 -->
|
|
|
- <el-dialog title="管理福利" :visible.sync="dialogRelatedVisible" width="40%">
|
|
|
+ <el-dialog title="关联福利" :visible.sync="dialogRelatedVisible" width="40%">
|
|
|
<div class="filter-container">
|
|
|
- <el-select v-model="relatedId" multiple style="width: 100%;" placeholder="请选择">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
|
|
+ <el-select clearable v-model="welfareId" style="width: 100%;" placeholder="请选择">
|
|
|
+ <el-option v-for="item in options" :key="item.id" :label="item.title" :value="item.id">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
@@ -218,7 +216,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { createItem, updateItem, giftList, giftState, exchangeHistory, relatedWelfare, welfareList } from "@/api/giftManage";
|
|
|
-import { companyTypeList, depTypeList } from "@/api/public";
|
|
|
+import { depTypeList } from "@/api/public";
|
|
|
import waves from "@/directive/waves"; // 水波纹指令
|
|
|
import Tinymce from '@/components/Tinymce'
|
|
|
|
|
@@ -228,21 +226,9 @@ export default {
|
|
|
directives: { waves },
|
|
|
data() {
|
|
|
return {
|
|
|
- relatedId:[],
|
|
|
+ welfareId:'',
|
|
|
skuId:'',
|
|
|
- options: [{
|
|
|
- value: 1,
|
|
|
- label: '中秋福利'
|
|
|
- }, {
|
|
|
- value: 2,
|
|
|
- label: '端午福利'
|
|
|
- }, {
|
|
|
- value: 3,
|
|
|
- label: '国庆福利'
|
|
|
- }, {
|
|
|
- value: 4,
|
|
|
- label: '元旦福利'
|
|
|
- }],
|
|
|
+ options: [],
|
|
|
locationList:['洛阳','北京','上海'],
|
|
|
productAttributeList: [
|
|
|
{
|
|
@@ -299,7 +285,7 @@ export default {
|
|
|
seq: 'sp123456',
|
|
|
productAttribute: 0,
|
|
|
title: '中秋福利,国庆福利',
|
|
|
- relatedId:[1,3],
|
|
|
+ welfareId:1,
|
|
|
actualStock: '12',
|
|
|
deliveryType: 0,
|
|
|
location: '北京',
|
|
@@ -313,7 +299,7 @@ export default {
|
|
|
seq: 'sp123456',
|
|
|
productAttribute: 1,
|
|
|
title: '端午福利',
|
|
|
- relatedId:[2],
|
|
|
+ welfareId:1,
|
|
|
actualStock: '12',
|
|
|
deliveryType: 1,
|
|
|
location: '上海',
|
|
@@ -327,7 +313,7 @@ export default {
|
|
|
seq: 'sp123456',
|
|
|
productAttribute: 1,
|
|
|
title: '',
|
|
|
- relatedId:[],
|
|
|
+ welfareId:1,
|
|
|
actualStock: '12',
|
|
|
deliveryType: 1,
|
|
|
location: '洛阳',
|
|
@@ -419,16 +405,20 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
// this.getCompanyTypeList();
|
|
|
- // this.getDepTypeList();
|
|
|
- // this.getList();
|
|
|
+ this.getDepTypeList();
|
|
|
+ this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
getWelfareList(){
|
|
|
- welfareList({status:0}).then(response => {
|
|
|
+ welfareList({status:1}).then(response => {
|
|
|
this.options = response.data.data;
|
|
|
- }).catch(() => {
|
|
|
- this.options = []
|
|
|
- });
|
|
|
+ // this.options.push(
|
|
|
+ // {
|
|
|
+ // id:'',
|
|
|
+ // title:'请选择'
|
|
|
+ // }
|
|
|
+ // )
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
|
changeProductAttribute(val) {
|
|
|
this.dataForm.deliveryType = '';
|
|
@@ -460,7 +450,7 @@ export default {
|
|
|
let response = fileList[i].response;
|
|
|
let url = response.data.url;
|
|
|
images.push(url);
|
|
|
- this.dataForm.image = images.join(",");
|
|
|
+ this.dataForm.imgUrl = images.join(",");
|
|
|
}
|
|
|
},
|
|
|
uploadBannerImg(file) {
|
|
@@ -474,7 +464,7 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
handleGallerySucess(res, file, fileList) {
|
|
|
- this.dataForm.image = ""; // 清空画廊图片数组
|
|
|
+ this.dataForm.imgUrl = ""; // 清空画廊图片数组
|
|
|
|
|
|
let images = [];
|
|
|
for (let i in fileList) {
|
|
@@ -489,7 +479,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- this.dataForm.image = images.join(",");
|
|
|
+ this.dataForm.imgUrl = images.join(",");
|
|
|
},
|
|
|
resetForm() {
|
|
|
this.dataForm = {
|
|
@@ -518,13 +508,7 @@ export default {
|
|
|
|
|
|
this.$refs["dataForm"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- console.log(this.dataForm);
|
|
|
- if (!this.dataForm.imgUrl) {
|
|
|
- this.$alert("请上传礼品图片", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- });
|
|
|
- } else {
|
|
|
- createItem(this.dataForm)
|
|
|
+ createItem(this.dataForm)
|
|
|
.then((response) => {
|
|
|
this.getList();
|
|
|
this.dialogFormVisible = false;
|
|
@@ -537,7 +521,6 @@ export default {
|
|
|
this.reload();
|
|
|
})
|
|
|
.catch(() => { });
|
|
|
- }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -585,12 +568,7 @@ export default {
|
|
|
updateData() {
|
|
|
this.$refs['dataForm'].validate((valid) => {
|
|
|
if (valid) {
|
|
|
- if (!this.dataForm.imgUrl) {
|
|
|
- this.$alert("请上传礼品图片", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- });
|
|
|
- } else {
|
|
|
- updateItem(this.dataForm).then(() => {
|
|
|
+ updateItem(this.dataForm).then(() => {
|
|
|
this.dialogFormVisible = false
|
|
|
this.$notify({
|
|
|
title: '成功',
|
|
@@ -600,22 +578,19 @@ export default {
|
|
|
})
|
|
|
this.getList()
|
|
|
})
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
},
|
|
|
handleRelated(row) {
|
|
|
- this.relatedId = row.relatedId.split(",");
|
|
|
+ this.welfareId = row.welfareId;
|
|
|
this.skuId = row.skuId;
|
|
|
- // this.getWelfareList();
|
|
|
+ this.getWelfareList();
|
|
|
this.dialogRelatedVisible = true
|
|
|
},
|
|
|
handleRelatedWelfare(){
|
|
|
- const welfareId = this.relatedId.join(",");
|
|
|
- console.log(this.relatedId);
|
|
|
- // relatedWelfare({ skuId: this.skuId, welfareId: welfareId }).then(response => {
|
|
|
+ relatedWelfare({ skuId: this.skuId, welfareId: this.welfareId }).then(response => {
|
|
|
this.dialogRelatedVisible = false;
|
|
|
this.$notify({
|
|
|
title: '成功',
|
|
@@ -623,8 +598,8 @@ export default {
|
|
|
type: 'success',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- // this.getList()
|
|
|
- // })
|
|
|
+ this.getList()
|
|
|
+ })
|
|
|
},
|
|
|
changeGoodsState(id, index) {
|
|
|
giftState({ skuId: id, status: index }).then(response => {
|
|
@@ -650,8 +625,7 @@ export default {
|
|
|
type: 'success',
|
|
|
duration: 2000
|
|
|
})
|
|
|
- const index = this.list.indexOf(row)
|
|
|
- this.list.splice(index, 1)
|
|
|
+ this.getList()
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
|
|
@@ -661,9 +635,7 @@ export default {
|
|
|
getDepTypeList() {
|
|
|
depTypeList().then(response => {
|
|
|
this.depTypeList = response.data.data;
|
|
|
- }).catch(() => {
|
|
|
- this.depTypeList = []
|
|
|
- });
|
|
|
+ }).catch(() => {});
|
|
|
},
|
|
|
getList() {
|
|
|
this.listLoading = true
|
|
@@ -718,7 +690,7 @@ export default {
|
|
|
|
|
|
handleView(row) {
|
|
|
this.itemListQuery.id = row.id;
|
|
|
- // this.getItemList()
|
|
|
+ this.getItemList()
|
|
|
this.dialogListVisible = true
|
|
|
},
|
|
|
}
|