first commit
This commit is contained in:
@@ -0,0 +1,225 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<div id="app" v-cloak>
|
||||
<guava :edit_scroll="false" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="所属年份">
|
||||
<el-date-picker
|
||||
:clearable="true"
|
||||
placeholder="所属年份"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
@change="getWelfareList"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="福利项目">
|
||||
<el-select filterable :clearable="true" placeholder="请选择福利项目" style="width: 100%" v-model="pageForm.benefitId">
|
||||
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in projectSelectOptions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool label="福利项目">
|
||||
<el-button @click="openAdd()" icon="el-icon-plus" size="mini" type="primary">新增项目</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" ref="table" row-key="id" v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" label="序号" type="index" width="80px"></el-table-column>
|
||||
|
||||
<el-table-column
|
||||
:key="column.prop"
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
:width="column.width"
|
||||
min-width="100px"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns"
|
||||
>
|
||||
<template v-slot="{row}" v-if="column.prop==='startChoiceTime'">
|
||||
{{$moment(row.startChoiceTime).format("YYYY-MM-DD HH:mm")}}
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop==='endChoiceTime'">
|
||||
{{$moment(row.startChoiceTime).format("YYYY-MM-DD HH:mm")}}
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop==='provideMode'">
|
||||
<dict-tag :options="dict.type.BENEFIT_PROVIDE_MODE" :value="row.provideMode"></dict-tag>
|
||||
</template>
|
||||
<template v-slot="{row}" v-else-if="column.prop==='signMode'">
|
||||
<dict-tag :options="dict.type.BENEFIT_SIGN_MODE" :value="row.signMode"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="550px">
|
||||
<template slot-scope="{row}">
|
||||
<template v-if="row.isUnseal">
|
||||
<el-button
|
||||
@click="createBenefitUser(row)"
|
||||
:loading="submitLoading"
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="row.benefitUserNum===0"
|
||||
>
|
||||
生成福利名单
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="renewBenefitUser(row,true)"
|
||||
:loading="submitLoading"
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="row.benefitUserNum>0"
|
||||
>
|
||||
更新福利名单
|
||||
</el-button>
|
||||
<el-button
|
||||
@click="renewBenefitUser(row,false)"
|
||||
:loading="submitLoading"
|
||||
size="mini"
|
||||
type="primary"
|
||||
v-if="row.benefitUserNum>0"
|
||||
>
|
||||
重置福利名单
|
||||
</el-button>
|
||||
<el-button @click="doEdit(row.id,false)" size="mini" type="danger">关闭</el-button>
|
||||
</template>
|
||||
<template v-if="!row.isUnseal">
|
||||
<el-button @click="doEdit(row.id,true)" size="mini" type="primary">开启</el-button>
|
||||
</template>
|
||||
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">编辑</el-button>
|
||||
<el-button @click="doDelete(row)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<benefit-project-form ref="benefitProjectForm" @query="pageData"></benefit-project-form>
|
||||
<benefit-project-info ref="benefitInfo"></benefit-project-info>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("projectForm.js"){}#-->
|
||||
<!--#include("projectInfo.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
dicts: ["BENEFIT_PROVIDE_MODE", "BENEFIT_SIGN_MODE"],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format("YYYY")
|
||||
},
|
||||
projectSelectOptions: [],
|
||||
tableColumns: [
|
||||
{ prop: "name", label: "项目名称" },
|
||||
{ prop: "festival", label: "发放节日" },
|
||||
{ prop: "startChoiceTime", label: "选择开始时间" },
|
||||
{ prop: "endChoiceTime", label: "选择结束时间" },
|
||||
{ prop: "provideMode", label: "发放形式" },
|
||||
{ prop: "signMode", label: "是否电子签字" }
|
||||
]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"benefit-project-form": BENEFIT_PROJECT_FORM,
|
||||
"benefit-project-info": BENEFIT_PROJECT_INFO
|
||||
},
|
||||
methods: {
|
||||
doEdit(id, isUnseal) {
|
||||
this.submitLoading = true
|
||||
this.$axios.post("/platform/benefit/project/doEdit", { id, isUnseal }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("更新成功")
|
||||
this.pageData()
|
||||
}
|
||||
this.submitLoading = false
|
||||
})
|
||||
},
|
||||
renewBenefitUser(row, isRenew) {
|
||||
this.$confirm("确定要" + (isRenew ? "更新" : "重置") + "福利名单吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.submitLoading = true
|
||||
this.$axios.post("/platform/benefit/project/renewBenefitUser", { benefitId: row.id, isRenew: isRenew }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("更新成功")
|
||||
this.pageData()
|
||||
}
|
||||
this.submitLoading = false
|
||||
})
|
||||
})
|
||||
},
|
||||
createBenefitUser(row) {
|
||||
this.$confirm("确定要生成福利名单吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.submitLoading = true
|
||||
this.$axios.post("/platform/benefit/project/createBenefitUser", { benefitId: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("生成成功")
|
||||
this.pageData()
|
||||
this.submitLoading = false
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.benefitInfo.open(row.id)
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.benefitProjectForm.openEdit(row.id)
|
||||
},
|
||||
doDelete(row) {
|
||||
this.$confirm("确定要删除【" + row.name + "】?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
})
|
||||
.then(() => {
|
||||
this.$axios.post("/platform/benefit/project/delete", { id: row.id }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("删除成功")
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.benefitProjectForm.open()
|
||||
},
|
||||
getWelfareList() {
|
||||
this.$set(this.pageForm, "benefitId", "")
|
||||
this.$axios.post("/platform/benefit/project/getBenefitList", { year: this.pageForm.year }).then((res) => {
|
||||
this.projectSelectOptions = res.data
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getWelfareList()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.benefitProjectForm .el-form-item {
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,298 @@
|
||||
<!--#include("../goods/goodsInfo.js"){}#-->
|
||||
let BENEFIT_PROJECT_FORM = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<el-dialog :title="formData.id ? '编辑项目' : '新增项目'"
|
||||
:visible.sync="visibleDialog" :close-on-click-modal="false" width="60%">
|
||||
<el-form :model="formData" ref="formRef" :rules="formRules"
|
||||
label-width="0" class="benefitProjectForm">
|
||||
<el-descriptions border class="descriptions-form" :column="3">
|
||||
<el-descriptions-item label="项目名称" span="3">
|
||||
<el-form-item prop="name" label="">
|
||||
<el-input maxlength="40" placeholder="项目名称" show-word-limit
|
||||
v-model="formData.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发放节日">
|
||||
<el-form-item label="" prop="festival">
|
||||
<dict-select clearable code="BENEFIT_FESTIVAL"
|
||||
placeholder="请选择发放节日"
|
||||
v-model="formData.festival"></dict-select>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="选择时间" span="2">
|
||||
<el-form-item label="" prop="choiceTime">
|
||||
<el-date-picker
|
||||
@change="choiceTimeChange"
|
||||
end-placeholder="结束时间"
|
||||
range-separator="-"
|
||||
start-placeholder="开始时间"
|
||||
style="width: 100%"
|
||||
type="datetimerange"
|
||||
v-model="formData.choiceTime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="是否电子签字" span="1.5">
|
||||
<el-form-item label="" prop="signMode">
|
||||
<el-radio-group size="medium" v-model="formData.signMode">
|
||||
<el-radio-button :key="item.code" :label="item.code"
|
||||
v-for="item in dict.type.BENEFIT_SIGN_MODE">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发放形式" span="1.5">
|
||||
<el-form-item label="" prop="provideMode">
|
||||
<el-radio-group size="medium" v-model="formData.provideMode"
|
||||
@change="provideModeChange">
|
||||
<el-radio-button :key="item.code" :label="item.code"
|
||||
v-for="item in dict.type.BENEFIT_PROVIDE_MODE">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<template v-if="formData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
<el-descriptions-item label="逾期选择时间" span="1.5">
|
||||
<el-form-item label="" prop="endOverdueChoiceTime">
|
||||
<el-date-picker
|
||||
placeholder="逾期未选择最后选择截至时间"
|
||||
style="width: 100%"
|
||||
type="datetime"
|
||||
v-model="formData.endOverdueChoiceTime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="福利总积分" span="1.5">
|
||||
<el-form-item label="" prop="totalMoney">
|
||||
<el-input-number v-model="formData.totalMoney" :precision="2"
|
||||
:max="99999" :min="1"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</template>
|
||||
|
||||
|
||||
<el-descriptions-item label="福利礼品" span="3"
|
||||
v-if="formData.provideMode==='BENEFIT_PROVIDE_MODE_ONE'">
|
||||
<el-form-item label="" prop="giftName">
|
||||
<el-input maxlength="100" placeholder="福利礼品"
|
||||
suffix-icon="el-icon-present"
|
||||
v-model="formData.giftName"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="福利套餐" span="3"
|
||||
v-if="formData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
<el-cascader
|
||||
@change="goodsCategoryChange"
|
||||
:options="goodsCategoryOptions"
|
||||
:props="goodsCategoryProps"
|
||||
v-model="pageForm.goodsCategoryIds"
|
||||
placeholder="选择类型查询"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
></el-cascader>
|
||||
|
||||
<el-table
|
||||
:data="goodsTableData"
|
||||
ref="goodsTable"
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column
|
||||
type="selection"
|
||||
:reserve-selection="true"
|
||||
width="55">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column label="商品名称" prop="name"></el-table-column>
|
||||
<el-table-column label="所属一级分类"
|
||||
prop="goodsCategoryOneLevelName"></el-table-column>
|
||||
<el-table-column label="所属二级分类"
|
||||
prop="goodsCategoryTwoLevelName"></el-table-column>
|
||||
<el-table-column label="所需积分" prop="money"></el-table-column>
|
||||
<el-table-column label="发放形式" prop="goodsProvideMode">
|
||||
<template v-slot="{row}">
|
||||
<dict-tag :options="dict.type.BENEFIT_GOODS_PROVIDE_MODE"
|
||||
:value="row.goodsProvideMode"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openViewGoods(row.id)" size="mini"
|
||||
type="primary">查看
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="封面图片" span="3">
|
||||
<el-form-item label="" prop="cover">
|
||||
<file-upload
|
||||
:value.sync="formData.cover"
|
||||
:upload_number="1"
|
||||
upload_mode="image"
|
||||
upload_result_category="interval"
|
||||
upload_result_type="url"
|
||||
></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visibleDialog = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submit">提 交</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<benefit-goods-info ref="benefitGoodsInfo"></benefit-goods-info>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["BENEFIT_PROVIDE_MODE", "BENEFIT_SIGN_MODE", "BENEFIT_GOODS_PROVIDE_MODE"],
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visibleDialog: false,
|
||||
goodsTableData: [],
|
||||
goodsCategoryOptions: [],
|
||||
goodsCategoryProps: {
|
||||
checkStrictly: true,
|
||||
multiple: false,
|
||||
label: "name",
|
||||
value: "id"
|
||||
},
|
||||
formRules: {
|
||||
name: [{ required: true, message: "必填", trigger: "blur" }],
|
||||
totalMoney: [{ required: true, message: "必填", trigger: "blur" }],
|
||||
giftName: [{ required: true, message: "必填", trigger: "blur" }],
|
||||
festival: [{ required: true, message: "必填", trigger: "blur" }]
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"benefit-goods-info": BENEFIT_GOODS_INFO
|
||||
},
|
||||
methods: {
|
||||
choiceTimeChange(val) {
|
||||
if (val) {
|
||||
this.$set(this.formData, "startChoiceTime", val[0])
|
||||
this.$set(this.formData, "endChoiceTime", val[1])
|
||||
}
|
||||
},
|
||||
submit() {
|
||||
this.$refs.formRef.validate(valid => {
|
||||
console.log(this.formData.benefitGoodsIds)
|
||||
if (valid) {
|
||||
if (this.formData.provideMode === "BENEFIT_PROVIDE_MODE_TWO" && this.formData.benefitGoodsIds && this.formData.benefitGoodsIds.length === 0) {
|
||||
this.$message.error("请选择福利商品")
|
||||
return
|
||||
}
|
||||
this.$axios.post("/platform/benefit/project/submit", {
|
||||
data: JSON.stringify(this.formData),
|
||||
benefitGoodsIds: this.formData.benefitGoodsIds
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("保存成功")
|
||||
this.visibleDialog = false
|
||||
this.$emit("query")
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
provideModeChange() {
|
||||
if (this.formData.provideMode === "BENEFIT_PROVIDE_MODE_TWO") {
|
||||
this.pageData()
|
||||
this.getCategoryTree()
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
// 使用 Map 来存储唯一的 id 和对应的对象
|
||||
const data = new Map(val.map(item => [item.id, item]))
|
||||
// 将 Map 的值转换回数组
|
||||
const newData = Array.from(data.values())
|
||||
this.formData.benefitGoodsIds = newData.map(v => v.id)
|
||||
},
|
||||
getCategoryTree() {
|
||||
this.$axios.post("/platform/benefit/project/getCategoryTree").then((res) => {
|
||||
this.goodsCategoryOptions = res.data
|
||||
})
|
||||
},
|
||||
goodsCategoryChange(val) {
|
||||
this.pageForm.goodsCategoryIds = val
|
||||
this.pageData()
|
||||
},
|
||||
pageData() {
|
||||
this.pageForm.benefitId = this.formData.id
|
||||
this.$axios.post("/platform/benefit/project/getGoodsTableData", { pageForm: JSON.stringify(this.pageForm) }).then((res) => {
|
||||
this.tableLoading = false
|
||||
this.goodsTableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
this.toggleRowSelection()
|
||||
})
|
||||
},
|
||||
openViewGoods(id) {
|
||||
this.$refs.benefitGoodsInfo.open(id)
|
||||
},
|
||||
async findOne(id) {
|
||||
const res = await this.$axios.post("/platform/benefit/project/findOne", { id })
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
},
|
||||
toggleRowSelection() {
|
||||
this.formData.benefitGoodsList.forEach((v) => {
|
||||
if (v.benefitId) {
|
||||
const index = this.goodsTableData.findIndex((item) => item.id === v.id)
|
||||
if (index !== -1) {
|
||||
this.$refs.goodsTable.toggleRowSelection(this.goodsTableData[index])
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
async openEdit(id) {
|
||||
this.visibleDialog = true
|
||||
const data = await this.findOne(id)
|
||||
this.formData = data
|
||||
this.pageForm.isEdit = true
|
||||
this.$set(this.formData, "choiceTime", [data.startChoiceTime, data.endChoiceTime])
|
||||
this.pageData()
|
||||
this.getCategoryTree()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.goodsTable.clearSelection();
|
||||
})
|
||||
},
|
||||
async open() {
|
||||
this.formData = {
|
||||
signMode: "BENEFIT_SIGN_MODE_ONE",
|
||||
provideMode: "BENEFIT_PROVIDE_MODE_ONE",
|
||||
benefitGoodsIds: []
|
||||
}
|
||||
this.$set(this.pageForm, "isEdit", true)
|
||||
this.$set(this.pageForm, "benefitGoodsIds", [])
|
||||
this.visibleDialog = true
|
||||
this.$refs.goodsTable.clearSelection();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
let BENEFIT_PROJECT_INFO = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<el-dialog title="查看项目详情"
|
||||
:visible.sync="visibleDialog" :close-on-click-modal="false" width="60%">
|
||||
<el-descriptions border class="descriptions-form" :column="3">
|
||||
<el-descriptions-item label="项目名称" span="3">
|
||||
{{viewData.name}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发放节日">
|
||||
<dict-tag :options="dict.type.BENEFIT_FESTIVAL"
|
||||
:value="viewData.festival"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="选择时间" span="2">
|
||||
{{viewData.startChoiceTime}}至{{viewData.endChoiceTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="是否电子签字" span="1.5">
|
||||
<dict-tag :options="dict.type.BENEFIT_SIGN_MODE"
|
||||
:value="viewData.signMode"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="发放形式" span="1.5">
|
||||
<dict-tag :options="dict.type.BENEFIT_PROVIDE_MODE"
|
||||
:value="viewData.provideMode"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="逾期选择时间" span="1.5">
|
||||
{{viewData.endOverdueChoiceTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="福利总积分" span="1.5"
|
||||
v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
{{viewData.totalMoney}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="" span="1.5"
|
||||
v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_ONE'">
|
||||
</el-descriptions-item>
|
||||
|
||||
|
||||
<el-descriptions-item label="福利礼品" span="3"
|
||||
v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_ONE'">
|
||||
{{viewData.giftName}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="福利套餐" span="3"
|
||||
v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
<el-table
|
||||
:data="goodsTableData"
|
||||
ref="goodsTable"
|
||||
row-key="id"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column
|
||||
:index="indexMethod"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"
|
||||
></el-table-column>
|
||||
<el-table-column label="商品名称" prop="name"></el-table-column>
|
||||
<el-table-column label="所属一级分类"
|
||||
prop="goodsCategoryOneLevelName"></el-table-column>
|
||||
<el-table-column label="所属二级分类"
|
||||
prop="goodsCategoryTwoLevelName"></el-table-column>
|
||||
<el-table-column label="所需积分" prop="money"></el-table-column>
|
||||
<el-table-column label="发放形式" prop="goodsProvideMode">
|
||||
<template v-slot="{row}">
|
||||
<dict-tag :options="dict.type.BENEFIT_GOODS_PROVIDE_MODE"
|
||||
:value="row.goodsProvideMode"></dict-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="封面图片" span="3">
|
||||
<file-preview :files="viewData.cover"></file-preview>
|
||||
</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visibleDialog = false">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["BENEFIT_FESTIVAL", "BENEFIT_SIGN_MODE", "BENEFIT_PROVIDE_MODE", "BENEFIT_GOODS_PROVIDE_MODE"],
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
visibleDialog: false,
|
||||
goodsTableData: []
|
||||
}
|
||||
},
|
||||
components: {},
|
||||
methods: {
|
||||
async findOne(id) {
|
||||
const res = await this.$axios.post("/platform/benefit/project/findOne", { id })
|
||||
if (res.code === 0) {
|
||||
return res.data
|
||||
}
|
||||
},
|
||||
|
||||
pageData() {
|
||||
this.pageForm.benefitId = this.viewData.id
|
||||
this.pageForm.isEdit = false
|
||||
this.$axios.post("/platform/benefit/project/getGoodsTableData", { pageForm: JSON.stringify(this.pageForm) }).then((res) => {
|
||||
this.tableLoading = false
|
||||
this.goodsTableData = res.data.list
|
||||
this.pageForm.totalCount = res.data.totalCount
|
||||
})
|
||||
},
|
||||
async open(id) {
|
||||
const data = await this.findOne(id)
|
||||
this.viewData = data
|
||||
this.pageData()
|
||||
this.visibleDialog = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user