first commit
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="所属年份">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
placeholder="所属年份"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy"
|
||||
></el-date-picker>
|
||||
</search-item>
|
||||
</search>
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool label="我的福利"></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-if="column.prop==='provideMode'" v-slot="{row}">
|
||||
<dict-tag :options="dict.type.BENEFIT_PROVIDE_MODE" :value="row.provideMode"></dict-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop==='signMode'" v-slot="{row}">
|
||||
<dict-tag :options="dict.type.BENEFIT_SIGN_MODE" :value="row.signMode"></dict-tag>
|
||||
</template>
|
||||
<template v-else-if="column.prop==='isChoice'" v-slot="{row}">
|
||||
<span v-if="row.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">{{row.isChoice?'已选择':'未选择'}}</span>
|
||||
<span v-else-if="row.provideMode==='BENEFIT_PROVIDE_MODE_ONE'&&row.signMode==='BENEFIT_SIGN_MODE_ONE'">
|
||||
{{row.isChoice?'已签字':'未签字'}}
|
||||
</span>
|
||||
</template>
|
||||
<template v-else-if="column.prop==='giftName'" v-slot="{row}">
|
||||
<span v-if="row.isChoice">{{row.giftList?row.giftList:row.giftName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">查看福利</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<selection-benefit-info ref="selectionBenefitInfoRef"></selection-benefit-info>
|
||||
</div>
|
||||
<script nonce="${cspNonce!}">
|
||||
<!--#include("info.js"){}#-->
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
dicts: ["BENEFIT_FESTIVAL", "BENEFIT_SIGN_MODE", "BENEFIT_PROVIDE_MODE", "BENEFIT_GOODS_PROVIDE_MODE"],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {
|
||||
year: moment().format("YYYY")
|
||||
},
|
||||
tableColumns: [
|
||||
{ prop: "year", label: "年度" },
|
||||
{ prop: "benefitName", label: "福利名称" },
|
||||
{ prop: "startChoiceTime", label: "选择开始时间" },
|
||||
{ prop: "endChoiceTime", label: "选择结束时间" },
|
||||
{ prop: "signMode", label: "是否电子签字" },
|
||||
{ prop: "provideMode", label: "发放形式" },
|
||||
{ prop: "giftName", label: "所选礼品" },
|
||||
{ prop: "isChoice", label: "是否选择/签字" }
|
||||
]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"selection-benefit-info": SELECTION_BENEFIT_INFO
|
||||
},
|
||||
methods: {
|
||||
openView(row) {
|
||||
if (!row.isChoice) {
|
||||
this.$message.warning("当前福利暂未选择,请前往福利选择进行选择!")
|
||||
return
|
||||
}
|
||||
if (row.provideMode === "BENEFIT_PROVIDE_MODE_ONE") {
|
||||
this.$message.warning("当前福利为统一发放【" + row.giftName + "】")
|
||||
return
|
||||
}
|
||||
this.$refs.selectionBenefitInfoRef.open(row.benefitId)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,154 @@
|
||||
<!--#include("../goods/goodsInfo.js"){}#-->
|
||||
let SELECTION_BENEFIT_INFO = {
|
||||
/*language=HTML*/
|
||||
template: `
|
||||
<div>
|
||||
<el-dialog title="选择福利"
|
||||
:visible.sync="visibleDialog" :close-on-click-modal="false" width="70%">
|
||||
<el-form label-suffix=":">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<span
|
||||
style="font-weight: bold;font-size: 20px;display: flex;justify-content: center">{{viewData.name}}</span>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="福利节日">
|
||||
<dict-tag :options="dict.type.BENEFIT_FESTIVAL"
|
||||
:value="viewData.festival"></dict-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_ONE'">
|
||||
<el-form-item label="福利礼品">
|
||||
{{viewData.giftName}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="是否电子签字">
|
||||
<dict-tag :options="dict.type.BENEFIT_SIGN_MODE"
|
||||
:value="viewData.signMode"></dict-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="发放形式">
|
||||
<dict-tag :options="dict.type.BENEFIT_PROVIDE_MODE"
|
||||
:value="viewData.provideMode"></dict-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
<el-form-item label="选择时间">
|
||||
{{$moment(viewData.startChoiceTime).format("YYYY-MM-DD HH:mm")}}
|
||||
至
|
||||
{{$moment(viewData.endChoiceTime).format("YYYY-MM-DD HH:mm")}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
<el-form-item label="逾期选择时间">
|
||||
<span v-if="viewData.endOverdueChoiceTime">
|
||||
{{
|
||||
$moment(viewData.endOverdueChoiceTime).format("YYYY-MM-DD HH:mm")
|
||||
}}
|
||||
</span>
|
||||
<span v-else>暂无</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="viewData.provideMode==='BENEFIT_PROVIDE_MODE_TWO'">
|
||||
<el-form-item label="福利总积分">
|
||||
{{viewData.totalMoney}}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-card v-for="item in userSelection" :key="item.id">
|
||||
<el-row :gutter="20">
|
||||
<div @click="openGoods(item.goods.id)">
|
||||
<el-col :span="2">
|
||||
<el-image
|
||||
style="width: 100px;height: 100px"
|
||||
:src="item.goods.imgUrl[0].url"
|
||||
fit="contain"
|
||||
v-if="item.goods"></el-image>
|
||||
</el-col>
|
||||
<el-col :span="6" v-if="item.goods">
|
||||
<el-tooltip :content="item.goods.name" placement="top">
|
||||
<div style="cursor: pointer;color: #0a84ff"
|
||||
>
|
||||
{{item.goods.name}}
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</div>
|
||||
<el-col :span="1">
|
||||
x{{item.selectNum}}
|
||||
</el-col>
|
||||
<el-col :span="11">
|
||||
<span
|
||||
v-if="item.shopAddress">收货门店: {{item.shopAddress}}</span>
|
||||
<span>{{item.receiveAddress}}</span>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
{{item.specificationsName}}
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-col :span="24">
|
||||
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visibleDialog = false" type="primary">关 闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<benefit-goods-info ref="benefitGoodsInfo"></benefit-goods-info>
|
||||
</div>
|
||||
`,
|
||||
dicts: ["BENEFIT_FESTIVAL", "BENEFIT_SIGN_MODE", "BENEFIT_PROVIDE_MODE", "BENEFIT_GOODS_PROVIDE_MODE"],
|
||||
data() {
|
||||
return {
|
||||
userSelection: [],
|
||||
viewData: {},
|
||||
visibleDialog: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"benefit-goods-info": BENEFIT_GOODS_INFO
|
||||
},
|
||||
methods: {
|
||||
openGoods(id) {
|
||||
this.$refs.benefitGoodsInfo.open(id)
|
||||
},
|
||||
async findOneBenefit(id) {
|
||||
const res = await this.$axios.post("/platform/benefit/userSelection/findOneBenefit", { id })
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
},
|
||||
async selectSelectionBenefit(benefitId) {
|
||||
const res = await this.$axios.post("/platform/benefit/userSelection/selectSelectionBenefit", { benefitId })
|
||||
if (res.code === 0) {
|
||||
this.userSelection = res.data
|
||||
}
|
||||
},
|
||||
async open(id) {
|
||||
await this.selectSelectionBenefit(id)
|
||||
await this.findOneBenefit(id)
|
||||
this.userSelection.map(v => {
|
||||
const data = this.viewData.benefitGoodsList.find(b => b.id === v.goodsId)
|
||||
v.goods = data
|
||||
if (v.specificationsId) {
|
||||
const specifications = data.benefitGoodsSpecificationsList.find(x => x.id === v.specificationsId)
|
||||
v.specificationsName = specifications.name
|
||||
}
|
||||
})
|
||||
this.visibleDialog = true
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user