This commit is contained in:
那些花儿
2025-06-10 10:33:38 +08:00
parent ba4642dcce
commit be6fa5aee1
49 changed files with 6528 additions and 2206 deletions
@@ -1,224 +0,0 @@
let WELFARE_OPTION_TABLE = {
template: `
<div>
<el-card>
<el-form ref="form">
<el-card :key="s.id" class="item" shadow="never" v-for="(s,idx) in subject">
<!-- <el-form-item :label="(s.subjectType==='radio'?'(单选)':'(多选)')+ (idx+1)+'.'" prop="subjectName">-->
<el-form-item label="" prop="subjectName">
<div class="s-title-wrap">
<el-row align="middle" style="width: 100%" type="flex">
<el-col :xl="15"
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;">
<el-input class="text-input" data-type="subject"
v-model="s.subjectName"></el-input>
</el-col>
<el-col :xl="2" style="text-align: center"></el-col>
<!-- <el-col :xl="2" style="text-align: center">
<div class="option-delete">
<el-button circle
icon="el-icon-delete"
size="mini" type="danger"
@click="subject.splice(idx,1)"></el-button>
</div>
</el-col>-->
</el-row>
</div>
<div class="s-options-list" style="margin-top: 10px;">
<el-table :data="s.options" border>
<el-table-column
align="center"
header-align="center"
label="福利名称"
>
<template slot-scope="{row}">
<div
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
<i class="fa fa-circle-o" style="cursor: pointer"
v-if="s.subjectType==='radio'"></i>
<i class="fa fa-square-o"
style="cursor: pointer"
v-else-if="s.subjectType==='checkBox'"></i>
<el-input autosize class="text-input"
data-type="option"
v-model="row.optionName"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column align="center" header-align="center"
label="备注1">
<template slot-scope="{row}">
<el-input max="100" type="textarea"
v-model="row.supplier"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center"
label="备注2">
<template slot-scope="{row}">
<el-input max="100" type="textarea"
v-model="row.simpleDesc"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="排序"
width="120px">
<template slot-scope="{row}">
<div
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
<el-input autosize class="text-input"
data-type="option"
v-model="row.optionSort"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="图片"
width="120">
<template slot-scope="{row,$index}">
<file-upload :upload_number="1" :value.sync="row.imgUrl"
accept=".jpg,.jpeg,.png"
class="imgUrl"
upload_result_type="url"
complete_result upload_mode="image"
upload_result_category="interval"></file-upload>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="说明"
width="100px ">
<template slot-scope="scope">
<el-link @click="openDescRichText(scope.row.description,idx,scope.$index)"
type="primary">
编辑说明
</el-link>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
width="100px">
<template slot-scope="{row,$index}">
<div class="option-delete">
<el-button @click="deleteRow(s.options,row,$index)"
circle
icon="el-icon-delete" size="mini"
type="danger"></el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="s-operation">
<el-button @click="s.options.push({optionType:'套餐',optionNameId:'',optionName:'福利'+(s.options.length+1),optionSort:s.options.length+1,imgUrl:null,isDefaultOption:false,isSystemDefault:false})" size="small"
type="primary">
添加福利
</el-button>
</div>
</div>
</el-form-item>
</el-card>
</el-form>
</el-card>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="richTextDialog"
title="编辑说明"
width="60%">
<text-editor v-model="descRichTextContent"></text-editor>
<span class="dialog-footer" slot="footer">
<el-button @click="richTextDialog = false">取 消</el-button>
<el-button @click="saveRichText" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
`,
watch: {
subject(val) {
}
},
props: {
subject: {
type: Array,
default: []
}
},
data() {
return {
descRichTextContent: "",
files: [],
shoppingTypeOptions: null,
richTextDialog: false,
subjectIndex: 0,
optionIndex: 0,
imgPopover: false,
idx: null,
oidx: null,
}
},
methods: {
deleteRow(options, row, index) {
options.splice(index, 1)
const shoppingTypeOption = this.shoppingTypeOptions.find(v => v.id === row.optionNameId)
shoppingTypeOption.disabled = false
},
addSubject(type) {
let subject = {
subjectName: '题目' + (this.subject.length + 1),
subjectType: type,
options: [
{optionName: '选项一', imgUrl: null},
{optionName: '选项一', imgUrl: null}
]
}
this.subject.push(subject)
},
validate(fn) {
if (this._validate()) {
return false
}
return true
},
_validate() {
return this.subject.some(v => {
if (!v.subjectName) return true
return v.options.some(x => {
if (!x.optionName) return true
})
})
},
openDescRichText(description, sIdx, oIdx) {
this.descRichTextContent = description
this.richTextDialog = true
this.subjectIndex = sIdx
this.optionIndex = oIdx
},
saveRichText() {
this.subject[this.subjectIndex]['options'][this.optionIndex].description = this.descRichTextContent
this.richTextDialog = false
},
}
}
/*<style>
.imgUrl .el-upload--picture-card {
width: 100px;
height: 100px;
}
.imgUrl .el-upload--picture-card i {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
</style>*/
@@ -1,35 +1,30 @@
let ADDRESS_DIALOG = {
template: `
<el-dialog
:append-to-body="true"
:modal-append-to-body="false"
:close-on-click-modal="false"
:visible.sync="dialogVisible"
title="收货地址"
width="30%">
template: /*language=HTML*/ `
<el-dialog
:append-to-body="true"
:modal-append-to-body="false"
:close-on-click-modal="false"
:visible.sync="dialogVisible"
title="收货地址"
width="30%">
<el-form :model="formData" label-position="right"
label-suffix="" label-width="120px" ref="addForm">
<el-row :gutter="60">
<el-col :span="24" class="pb20">
<el-form :model="formData" label-position="right" label-suffix="" label-width="120px" ref="addForm">
<el-form-item :rules="{required:true,message: '请选择地址信息', trigger: 'blur'}"
label="地址信息"
prop="addressList">
<el-cascader
:options="dzOptions"
:props="{ expandTrigger: 'hover' }"
@change="handleChange"
clearable
placeholder="请选择地址信息"
style="width: 100%"
v-model="formData.addressList"></el-cascader>
:options="dzOptions"
:props="{ expandTrigger: 'hover' }"
@change="handleChange"
clearable
placeholder="请选择地址信息"
style="width: 100%"
v-model="formData.addressList"></el-cascader>
</el-form-item>
</el-col>
<el-col :span="24" class="pb20">
<el-form-item
:rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}"
label="详细地址"
prop="addressDetail">
:rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}"
label="详细地址"
prop="addressDetail">
<el-input maxlength="100"
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
rows="3"
@@ -37,41 +32,35 @@ let ADDRESS_DIALOG = {
type="textarea"
v-model="formData.addressDetail"></el-input>
</el-form-item>
</el-col>
<el-col :span="24" class="pb20">
<el-form-item
:rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}"
label="收货人姓名"
prop="userName">
:rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}"
label="收货人姓名"
prop="userName">
<el-input maxlength="11"
placeholder="请填写收货人姓名"
v-model="formData.userName"></el-input>
</el-form-item>
</el-col>
<el-col :span="24" class="pb20">
<el-form-item
:rules="{required:true,message: '请填写手机号码', trigger: 'blur'}"
label="手机号码"
prop="tel">
:rules="{required:true,message: '请填写手机号码', trigger: 'blur'}"
label="手机号码"
prop="tel">
<el-input maxlength="11" placeholder="请填写手机号码"
type="tel"
v-model="formData.tel"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
</span>
</el-dialog>
`,
<span class="dialog-footer" slot="footer">
<el-button @click="dialogVisible = false">取 消</el-button>
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
</span>
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
dzOptions: chengShiList,
dialogVisible: false,
dialogVisible: false
}
},
methods: {
@@ -101,16 +90,16 @@ let ADDRESS_DIALOG = {
doSaveUserAddress() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", {data: JSON.stringify(this.formData)})
const resp = await this.$axios.post("/platform/welfare/addressManage/doSaveUserAddress", { data: JSON.stringify(this.formData) })
if (resp.code === 0) {
this.$message({
message: resp.msg,
type: 'success'
});
type: "success"
})
this.$emit("select_user_address")
this.dialogVisible = false
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
}
})
@@ -121,7 +110,7 @@ let ADDRESS_DIALOG = {
row.addressList.push(province.value)
const city = province.children.find(p => p.label === row.city)
row.addressList.push(city.value)
if (row.county){
if (row.county) {
const county = city.children.find(p => p.label === row.county)
if (county) {
row.addressList.push(county.value)
@@ -130,7 +119,7 @@ let ADDRESS_DIALOG = {
this.formData = row
this.dialogVisible = true
},
}
}
}
<!--#include("/platform/zhgh/welfare/include/chengSh.js"){}#-->
@@ -1,73 +0,0 @@
let COURIER_NUMBER_INFO = {
template: `
<el-dialog title="快递物流信息" width="60%" :visible.sync="dialogVisible" :append-to-body="true"
top="50px">
<el-tabs v-model="activeName" v-loading="loading" v-if="activeName">
<el-tab-pane v-for="(v,k) in courierNumberInfoData"
:label="k"
:key="k"
:name="k" style="margin: 20px">
<div style="height: 600px;overflow-y: auto">
<div class="alert alert-info" v-if="v.length>1">
<strong>此套餐有多个快递单号</strong>
</div>
<div v-for="item in v" :key="item.courierNumber">
<div class="alert alert-info mb20">
<strong>快递单号</strong>
{{ item.courierNumber || '暂无' }}
</div>
<div>
<el-timeline :reverse="true"
v-if="item.logisticsTrace && item.logisticsTrace.logisticsTraceDetailList">
<el-timeline-item
:color="timeline.color"
:key="timelineIndex"
:timestamp="$moment(timeline.time).format('YYYY-MM-DD HH:mm:ss')"
v-for="(timeline, timelineIndex) in item.logisticsTrace.logisticsTraceDetailList">
{{ timeline.desc }}
</el-timeline-item>
</el-timeline>
<div v-else>
<el-empty description="暂无物流信息"></el-empty>
</div>
</div>
</div>
</div>
</el-tab-pane>
</el-tabs>
<div v-else>
<el-empty>暂无数据</el-empty>
</div>
</el-dialog>
`,
data() {
return {
dialogVisible: false,
courierNumberInfoData: [],
activeName: null,
loading: true
}
},
methods: {
async openView(welfareId, userId) {
this.dialogVisible = true
this.loading = true
const { code, data, msg } = await this.$axios.post("/platform/welfare/mine/courierNumberInfo", { welfareId, userId })
this.loading = false
if (code === 0) {
if (data == null || data.length === 0) {
this.dialogVisible = false
this.$message.warning("您还没有选择福利套餐")
return
}
this.courierNumberInfoData = data
const keys = Object.keys(this.courierNumberInfoData)
this.activeName = keys && keys[0]
} else {
this.$message.warning(msg)
}
}
}
}
@@ -66,7 +66,6 @@ layout("/layouts/platform.html"){
</template>
<template scope="{row}" v-else-if="column.prop=='gist_list'">
<template v-if="!projectInfo.flexible">{{projectInfo.gift}}</template>
<template v-if="row.gist_list">{{row.gist_list}}</template>
</template>
@@ -74,115 +73,29 @@ layout("/layouts/platform.html"){
<span v-if="row.receiveAddress">{{row.receiveAddress}}</span>
<span v-else>暂无</span>
</template>
<template scope="{row}" v-else-if="column.prop=='courierNumber'">
<span @click="viewCourierNumber(row)" class="text-primary" style="cursor: pointer">点击查看</span>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="200px">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button :disabled="!row.courierNumber" @click="openEvaluate(row)" size="mini" type="primary">评价</el-button>
<!-- <el-button :disabled="!row.courierNumber" @click="openEvaluate(row)" size="mini" type="primary">评价</el-button>-->
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<choose-welfare :is_view="true" ref="chooseWelfare" @go_back="go_back"></choose-welfare>
</template>
</guava>
<el-dialog :close-on-click-modal="false" :visible.sync="evaluateDialogVisible" title="福利评价" width="40%">
<el-form :model="formData" label-width="80px" ref="form">
<el-form-item :rules="[{ required: true, message: ''}]" label="评价套餐">
<el-radio-group @change="finOneWelfareEvaluate(formData.projectId,formData.optionId)" v-model="formData.optionId">
<el-row gutter="10">
<el-col :key="item.selectOptionId" class="mt10" span="24" v-for="item in userSelection">
<el-radio :label="item.selectOptionId" border style="width: 100%; position: relative">
{{item.optionName}}
<span style="color: red; position: absolute; right: 10px" v-if="!item.isPj">未评价</span>
</el-radio>
</el-col>
</el-row>
</el-radio-group>
</el-form-item>
<el-form-item :rules="[{ required: true, message: ''}]" label="评分">
<div style="position: absolute; top: 20%">
<el-rate :disabled="formData.id" show-score text-color="#ff9900" v-model="formData.evaluateScore"></el-rate>
</div>
</el-form-item>
<el-form-item label="评价">
<el-input
:disabled="formData.id"
maxlength="500"
placeholder="请输入评价"
rows="5"
show-word-limit
type="textarea"
v-model="formData.evaluateText"
></el-input>
</el-form-item>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="evaluateDialogVisible = false" type="primary">关 闭</el-button>
<el-button :loading="evaluateLoading" @click="doEvaluate" type="primary" v-if="!formData.id">提 交</el-button>
</span>
</el-dialog>
<el-drawer :visible.sync="descDialogVisible" direction="rtl" size="50%" title="福利详情">
<el-card style="margin: 20px">
<div v-html="descData"></div>
</el-card>
</el-drawer>
<el-drawer :visible.sync="expressDrawer" direction="rtl" size="50%">
<template #title>
<div style="font-size: 20px">
物流详情
<span style="color: red">&nbsp;&nbsp;温馨提示:物流信息一小时更新一次</span>
</div>
</template>
<el-card style="margin: 30px">
<el-timeline reverse="true">
<el-timeline-item
:color="item.color"
:key="index"
:timestamp="moment().format('YYYY-MM-DD HH:mm:ss')"
v-for="(item, index) in logisticsTrace.logisticsTraceDetailList"
>
{{item.desc}}
</el-timeline-item>
</el-timeline>
</el-card>
</el-drawer>
<!--快递物流信息-->
<courier-number-info ref="courierNumberInfo"></courier-number-info>
<select-view ref="selectViewRef"></select-view>
</div>
<script>
<!--#include("CourierNumberInfo.js"){}#-->
<!--#include("../userChoose/chooseWelfare.js"){}#-->
<!--#include('selectView.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
descData: "",
descDialogVisible: false,
projectInfo: {},
userSelection: [],
userId: "",
projectOptions: [],
units: [],
welfareUnits: [],
welfareProvideMode: [],
welfareSignMode: [],
welfareNoticePushMode: [],
pageForm: {
year: moment().format("YYYY"),
searchName: "username"
@@ -192,128 +105,25 @@ layout("/layouts/platform.html"){
{ prop: "name", label: "项目名称" },
{ prop: "choiceTime", label: "选择时间" },
{ prop: "isChoose", label: "是否选择" },
{ prop: "gist_list", label: "所选福利" },
{ prop: "receiveAddress", label: "收货地址" },
{ prop: "courierNumber", label: "快递单号", sortable: true }
],
formRules: {},
selPersonType: [],
welfare_id: null,
welfarePersonTypeList: [],
projectSelectOptions: [],
evaluateDialogVisible: false,
evaluateLoading: false,
expressDrawer: false,
logisticsTrace: {}
{ prop: "gist_list", label: "所选福利" }
// { prop: "receiveAddress", label: "收货地址" }
// { prop: "courierNumber", label: "快递单号", sortable: true }
]
}
},
components: {
"courier-number-info": COURIER_NUMBER_INFO,
"choose-welfare": CHOOSE_WELFARE
"select-view": selectView
},
methods: {
go_back() {
this.$refs.guava.index()
},
//查看快递单号
viewCourierNumber(row) {
this.$refs.courierNumberInfo.openView(row.projectId, row.userId)
},
async doEvaluate() {
if (!this.formData.evaluateScore || !this.formData.optionId) {
this.$message({
message: "请打分后再提交",
type: "warning"
})
return
}
const confirm = await this.$confirm("提交后将不能修改,确定要提交评价吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
this.evaluateLoading = true
const resp = await this.$axios.post(loc() + "/doEvaluate", this.formData)
if (resp.code === 0) {
this.$message({
message: resp.msg,
type: "success"
})
this.doSearch()
this.evaluateDialogVisible = false
} else {
this.$message.error(resp.msg)
}
this.evaluateLoading = false
}
},
async finOneWelfareEvaluate(projectId, optionId) {
const { data, code, msg } = await this.$axios.post(loc() + "/finOneWelfareEvaluate", {
projectId: projectId,
optionId: optionId
})
if (code === 0) {
if (data) {
this.formData = data
} else {
this.formData = {
projectId: projectId,
optionId: optionId
}
}
} else {
this.$message.warning(msg)
}
},
async openEvaluate(row) {
await this.getUserSelection(row.id)
if (this.userSelection && this.userSelection.length > 0) {
await this.finOneWelfareEvaluate(row.id, this.userSelection[0].selectOptionId)
}
this.evaluateDialogVisible = true
},
async openView(row) {
this.$refs.guava.edit(() => {
this.$refs.chooseWelfare.openChoose(row)
})
this.$refs.selectViewRef.onOpen(row.id)
}
},
async created() {
this.pageData()
this.welfareProvideMode = await this.$businessTool.getDictOptions("welfareProvideMode")
this.welfareProvideMode.map((v) => {
v.code = Number(v.code)
})
this.welfareSignMode = await this.$businessTool.getDictOptions("welfareSignMode")
this.welfareSignMode.map((v) => {
v.code = Number(v.code)
})
}
})
</script>
<style>
.desc_label {
width: 75px;
-webkit-flex-shrink: 0;
flex-shrink: 0;
padding-right: 4px;
display: inline-block;
font-size: 14px;
color: #7f7f7f;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.desc_value {
color: #333;
font-size: 14px;
}
</style>
<!--#
}
#-->
@@ -0,0 +1,517 @@
const selectView = {
template: /*language=HTML*/ `
<el-dialog title="我的福利选择" :visible.sync="visible" width="700px" append-to-body custom-class="welfare-select-view-dialog">
<div v-loading="loading">
<!-- 项目基本信息 -->
<div class="project-info-card">
<div class="project-info-header">
<i class="el-icon-s-flag"></i>
<span>项目基本信息</span>
</div>
<div class="project-info-content">
<div class="info-item">
<div class="info-label">项目名称</div>
<div class="info-value">{{ projectInfo.name }}</div>
</div>
<div class="info-item">
<div class="info-label">选择时间</div>
<div class="info-value">{{ projectInfo.choiceTimeStart }} 至 {{ projectInfo.choiceTimeEnd }}</div>
</div>
<div class="info-item">
<div class="info-label">发放时间</div>
<div class="info-value">{{ projectInfo.provideTimeStart }} 至 {{ projectInfo.provideTimeEnd }}</div>
</div>
<div class="info-item">
<div class="info-label">发放地点</div>
<div class="info-value">{{ projectInfo.provideAddress }}</div>
</div>
</div>
</div>
<!-- 联系信息 -->
<div class="project-info-card">
<div class="project-info-header">
<i class="el-icon-user"></i>
<span>联系信息</span>
</div>
<div class="project-info-content">
<div class="info-item">
<div class="info-label">联系电话</div>
<div class="info-value">{{ mergedSelections[0]?.mobile || '暂无' }}</div>
</div>
</div>
</div>
<!-- 我的选择 -->
<div class="my-selections-card">
<div class="selections-header">
<i class="el-icon-shopping-cart-full"></i>
<span>我的选择</span>
</div>
<div v-if="mergedSelections.length > 0" class="selections-content">
<div class="selection-item" v-for="item in mergedSelections" :key="item.id">
<div class="selection-item-image">
<el-image
:src="item.imgUrl || '/static/images/default-welfare.png'"
fit="cover"
:preview-src-list="item.imgUrl ? [item.imgUrl] : []">
<div slot="error" class="image-placeholder">
<i class="el-icon-picture-outline"></i>
</div>
</el-image>
</div>
<div class="selection-item-info">
<div class="selection-item-name">{{ item.optionName }}</div>
<div class="selection-item-meta">
<div class="selection-item-count">
<span>数量:</span>
<span class="count-value">{{ item.selectNum }}</span>
</div>
<div class="selection-item-time">
<span>选择时间:</span>
<span>{{ item.selectTime }}</span>
</div>
</div>
<div class="selection-item-actions">
<el-button
type="text"
size="small"
class="detail-btn"
@click="showOptionDetail(item)">
<i class="el-icon-view"></i> 查看详情
</el-button>
</div>
</div>
<div class="selection-item-status">
<el-tag size="small" type="success">已选择</el-tag>
</div>
</div>
</div>
<div v-else class="no-selections">
<i class="el-icon-warning-outline"></i>
<span>您还未选择任何福利项目</span>
</div>
</div>
</div>
<!-- 详情弹窗 -->
<el-dialog
title="福利详情"
:visible.sync="detailDialogVisible"
width="650px"
append-to-body
custom-class="welfare-detail-dialog">
<div class="welfare-detail-content" v-if="currentOption">
<!-- <div class="detail-header">-->
<!-- <div class="detail-image">-->
<!-- <el-image -->
<!-- :src="currentOption.imgUrl || '/static/images/default-welfare.png'" -->
<!-- fit="cover">-->
<!-- <div slot="error" class="image-placeholder">-->
<!-- <i class="el-icon-picture-outline"></i>-->
<!-- </div>-->
<!-- </el-image>-->
<!-- </div>-->
<!-- <div class="detail-title">-->
<!-- <h3>{{ currentOption.optionName }}</h3>-->
<!-- <div class="detail-meta">-->
<!-- <span class="detail-count">-->
<!-- <i class="el-icon-shopping-cart-2"></i> -->
<!-- 数量: <span class="count-value">{{ currentOption.selectNum }}</span>-->
<!-- </span>-->
<!-- <span class="detail-time">-->
<!-- <i class="el-icon-time"></i> -->
<!-- 选择时间: {{ currentOption.selectTime }}-->
<!-- </span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="detail-divider"></div>-->
<div class="detail-description rich-text-content" v-html="currentOption.description"></div>
</div>
</el-dialog>
</el-dialog>
`,
data() {
return {
projectId: null,
visible: false,
loading: false,
projectInfo: {
name: "",
choiceTimeStart: "",
choiceTimeEnd: "",
provideTimeStart: "",
provideTimeEnd: "",
provideAddress: "",
options: []
},
selectedOptions: [],
detailDialogVisible: false,
currentOption: null
}
},
computed: {
mergedSelections() {
return this.selectedOptions.map((item) => {
const option = this.projectInfo.options?.find((opt) => opt.id === item.selectOptionId) || {}
return {
...item,
optionName: option.optionName || "未知选项",
imgUrl: option.imgUrl,
description: option.description
}
})
}
},
methods: {
onOpen(id) {
this.projectId = id
this.visible = true
this.loadData()
},
async loadData() {
this.loading = true
await this.getProjectInfo()
await this.getUserSelections()
this.loading = false
},
async getProjectInfo() {
const { code, data, msg } = await this.$axios.post("/platform/welfare/common/projectInfo", {
id: this.projectId
})
if (code === 0) {
this.projectInfo = data
}
},
async getUserSelections() {
const { code, data, msg } = await this.$axios.post("/platform/welfare/userSelect/getUserSelection", { projectId: this.projectId })
if (code === 0) {
this.selectedOptions = data || []
}
},
showOptionDetail(option) {
this.currentOption = option
this.detailDialogVisible = true
}
},
style: /*language=CSS*/ `
.welfare-select-view-dialog .el-dialog__body {
padding: 20px;
}
/* 项目信息卡片 */
.project-info-card {
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
margin-bottom: 16px;
overflow: hidden;
}
.project-info-header {
padding: 14px 16px;
border-bottom: 1px solid #EBEEF5;
font-size: 16px;
font-weight: 600;
color: #303133;
display: flex;
align-items: center;
background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
}
.project-info-header i {
margin-right: 8px;
color: var(--color-primary);
font-size: 18px;
}
.project-info-content {
padding: 0;
}
.info-item {
display: flex;
align-items: center;
padding: 12px 16px;
border-bottom: 1px solid #EBEEF5;
}
.info-item:last-child {
border-bottom: none;
}
.info-label {
width: 100px;
color: #606266;
font-weight: 500;
flex-shrink: 0;
}
.info-value {
flex: 1;
color: #303133;
}
/* 选择卡片 */
.my-selections-card {
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
overflow: hidden;
}
.selections-header {
padding: 14px 16px;
border-bottom: 1px solid #EBEEF5;
font-size: 16px;
font-weight: 600;
color: #303133;
display: flex;
align-items: center;
background: linear-gradient(135deg, #f8f9fb 0%, #fff 100%);
}
.selections-header i {
margin-right: 8px;
color: var(--color-primary);
font-size: 18px;
}
.selections-content {
padding: 16px;
}
.selection-item {
display: flex;
align-items: center;
padding: 12px;
border-radius: 6px;
margin-bottom: 12px;
background: #f8f9fb;
transition: all 0.3s;
}
.selection-item:last-child {
margin-bottom: 0;
}
.selection-item:hover {
transform: translateX(4px);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.selection-item-image {
width: 80px;
height: 80px;
border-radius: 4px;
overflow: hidden;
flex-shrink: 0;
}
.selection-item-image .el-image {
width: 100%;
height: 100%;
}
.image-placeholder {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: #f5f7fa;
color: #909399;
font-size: 24px;
}
.selection-item-info {
flex: 1;
padding: 0 16px;
display: flex;
flex-direction: column;
}
.selection-item-name {
font-size: 15px;
font-weight: 600;
color: #303133;
margin-bottom: 6px;
}
.selection-item-meta {
margin-bottom: 8px;
}
.selection-item-count, .selection-item-time {
font-size: 13px;
color: #606266;
margin-bottom: 4px;
}
.selection-item-actions {
margin-top: 4px;
}
.detail-btn {
padding: 4px 8px;
font-size: 12px;
color: var(--color-primary);
background: #ecf5ff;
border-radius: 4px;
}
.detail-btn:hover {
background: #dbecff;
color: #3a8ee6;
}
.detail-btn i {
margin-right: 4px;
}
.count-value {
color: var(--color-primary);
font-weight: 600;
background: #ecf5ff;
padding: 2px 6px;
border-radius: 10px;
font-size: 12px;
}
.selection-item-status {
flex-shrink: 0;
width: 70px;
text-align: right;
}
.no-selections {
padding: 40px 0;
text-align: center;
color: #909399;
font-size: 14px;
display: flex;
flex-direction: column;
align-items: center;
}
.no-selections i {
font-size: 40px;
margin-bottom: 10px;
color: #C0C4CC;
}
/* 详情弹窗样式 */
.welfare-detail-dialog .el-dialog__body {
padding: 0;
}
.welfare-detail-content {
padding: 20px;
}
.detail-header {
display: flex;
margin-bottom: 20px;
}
.detail-image {
width: 120px;
height: 120px;
border-radius: 6px;
overflow: hidden;
flex-shrink: 0;
margin-right: 20px;
}
.detail-image .el-image {
width: 100%;
height: 100%;
}
.detail-title {
flex: 1;
}
.detail-title h3 {
margin: 0 0 12px 0;
font-size: 18px;
color: #303133;
}
.detail-meta {
display: flex;
flex-direction: column;
gap: 8px;
}
.detail-count, .detail-time {
display: flex;
align-items: center;
font-size: 14px;
color: #606266;
}
.detail-count i, .detail-time i {
margin-right: 6px;
color: #909399;
}
.detail-divider {
height: 1px;
background: #EBEEF5;
margin: 20px 0;
}
.detail-description {
color: #606266;
line-height: 1.6;
}
/* 富文本内容样式 */
.rich-text-content {
overflow-x: hidden;
word-break: break-word;
}
.rich-text-content img {
max-width: 100%;
height: auto;
border-radius: 4px;
margin: 10px 0;
}
.rich-text-content p {
margin: 8px 0;
line-height: 1.6;
}
.rich-text-content a {
color: var(--color-primary);
text-decoration: none;
}
.rich-text-content a:hover {
text-decoration: underline;
}
.rich-text-content ul, .rich-text-content ol {
padding-left: 20px;
margin: 10px 0;
}
.rich-text-content blockquote {
padding: 10px 15px;
border-left: 4px solid #EBEEF5;
background: #f8f9fb;
margin: 10px 0;
color: #606266;
}
`
}
@@ -0,0 +1,235 @@
const filterUser = {
template: /*language=HTML*/ `
<el-dialog title="选择用户生成福利名单" :visible.sync="visible" width="80%">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入姓名"
style="width: 100%" v-model="pageForm.userName">
</el-input>
</search-item>
<search-item label="工号">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入工号"
style="width: 100%" v-model="pageForm.loginName">
</el-input>
</search-item>
<search-item label="性别">
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
<el-option :key="sex" :label="sex" :value="sex"
v-for="sex in sexOptions"></el-option>
</el-select>
</search-item>
<search-item label="出生日期">
<el-date-picker
v-model="pageForm.birthday"
type="date"
placeholder="选择出生日期"
value-format="yyyy-MM-dd"
style="width: 100%">
</el-date-picker>
</search-item>
<search-item label="出生月份">
<el-select
v-model="pageForm.birthMonths"
multiple
collapse-tags
placeholder="请选择出生月份"
style="width: 100%">
<el-option
v-for="month in 12"
:key="month"
:label="month + '月'"
:value="month">
</el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select clearable filterable placeholder="请选择工会"
style="width: 100%"
v-model="pageForm.unionId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unionOptions">
</el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select clearable filterable
multiple
collapse-tags
placeholder="请选择单位" style="width: 100%"
v-model="pageForm.unitIds">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unitOptions">
</el-option>
</el-select>
</search-item>
<search-item label="人员类型:">
<dict-select clearable code="USER_PERSON_TYPE"
multiple
collapse-tags
placeholder="请选择人员类型"
v-model="pageForm.personTypes"></dict-select>
</search-item>
<search-item label="聘用方式:">
<dict-select clearable code="USER_PREPARED_BY_TYPE"
multiple
collapse-tags
placeholder="请选择聘用方式"
v-model="pageForm.preparedBys"></dict-select>
</search-item>
<search-item label="在职状态:">
<dict-select clearable code="USER_STATE"
multiple
collapse-tags
placeholder="请选择人员状态"
v-model="pageForm.userStates"></dict-select>
</search-item>
<search-item label="是否会员">
<el-select clearable placeholder="请选择是否会员" style="width: 100%"
v-model="pageForm.isMember">
<el-option label="全部" :value="null"></el-option>
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<el-table :data="tableData"
@sort-change="pageOrder"
ref="tableRef"
row-key="id"
style="width: 100%">
<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"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #footer>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="onSubmit">确认添加到福利名单</el-button>
</template>
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
visible: false,
projectId: null,
pageForm: {
birthMonths: [],
userStates: [],
personTypes: [],
preparedBys: [],
unitIds: []
},
sexOptions: ["男", "女"],
unionOptions: [],
unitOptions: [],
tableColumns: [
{ prop: "loginname", label: "工号" },
{ prop: "username", label: "姓名" },
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "preparedBy", label: "聘用方式", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }
]
}
},
methods: {
async onOpen(id) {
this.visible = true
this.resetPageForm()
this.pageForm.projectId = id
this.unionOptions = await this.$businessTool.listUnion()
this.unitOptions = await this.$businessTool.listUnit()
this.pageData()
},
resetPageForm() {
this.pageForm.userName = null
this.pageForm.loginName = null
this.pageForm.sex = null
this.pageForm.birthday = null
this.pageForm.birthMonths = []
this.pageForm.unionId = null
this.pageForm.unitId = null
this.pageForm.personTypes = []
this.pageForm.preparedBys = []
this.pageForm.userStates = []
this.pageForm.isMember = null
},
pageData() {
this.$axios
.post("/platform/welfare/project/mange/filterUserPageData", {
pageForm: JSON.stringify(this.pageForm)
})
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
} else {
this.$message.error(res.msg)
}
})
},
onSubmit() {
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const { code, data, msg } = await this.$axios.post("/platform/welfare/project/mange/addWelfareUser", {
pageForm: JSON.stringify(this.pageForm),
projectId: this.projectId
})
if (code === 0) {
this.$message.success(msg)
this.visible = false
this.$emit("refresh")
} else {
this.$message.error(msg)
}
})
}
}
}
@@ -88,28 +88,14 @@ layout("/layouts/platform.html"){
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{type:'status',data:row}">{{row.isDisabled?'发布':'关闭'}}</el-dropdown-item>
<el-dropdown-item :command="{type:'sendMsg',data:row}">通知未选择人员</el-dropdown-item>
<!-- <el-dropdown-item :command="{type:'createList2',data:row}" v-if="row.created">更新福利名单</el-dropdown-item>
<el-dropdown-item
:command="{type:'createList',data:row}"
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])"
>
{{row.created?'重置福利名单':'生成福利名单'}}
</el-dropdown-item>-->
<el-dropdown-item
:command="{type:'edit',data:row}"
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])"
>
编辑
<!-- <el-dropdown-item :command="{type:'createList2',data:row}" v-if="row.created">更新福利名单</el-dropdown-item>-->
<el-dropdown-item :command="{type:'createList',data:row}">
<!-- {{row.created?'重置福利名单':'生成福利名单'}}-->
生成福利名单
</el-dropdown-item>
<el-dropdown-item :command="{type:'edit',data:row}">编辑</el-dropdown-item>
<el-dropdown-item
:command="{type:'delete',data:row}"
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])"
>
删除
</el-dropdown-item>
<el-dropdown-item :command="{type:'delete',data:row}">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template>
@@ -183,18 +169,17 @@ layout("/layouts/platform.html"){
<el-switch @change="isCheckBoxChange" v-model="formData.flexible"></el-switch>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="是否全年生日蛋糕券" prop="isYearBirthday">
<el-switch v-model="formData.isYearBirthday"></el-switch>
</el-form-item>
</el-col>
<!-- <el-col :span="4">-->
<!-- <el-form-item label="是否全年生日蛋糕券" prop="isYearBirthday">-->
<!-- <el-switch v-model="formData.isYearBirthday"></el-switch>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- <el-col span="6">
<el-form-item label="是否常规" prop="isRoutine" v-if="formData.flexible">
<el-switch v-model="formData.isRoutine">
</el-switch>
</el-form-item>
</el-col>-->
<el-col :span="4" v-if="formData.isRoutine">
<el-form-item label="是否多选" prop="isCheckBox">
<el-switch
@@ -236,9 +221,16 @@ layout("/layouts/platform.html"){
<el-input maxlength="100" placeholder="福利礼品" suffix-icon="el-icon-present" v-model="formData.gift"></el-input>
</el-form-item>
<!-- {{formData.welfareProjectSubjects}}-->
<!-- <template v-if="formData.flexible">-->
<!-- <el-form-item label="福利选项" v-if="[2,3,4].includes(formData.provideMode)">-->
<!-- <welfare-option-table :subject="formData.welfareProjectSubjects" ref="welfareOptionTable"></welfare-option-table>-->
<!-- </el-form-item>-->
<!-- </template>-->
<template v-if="formData.flexible">
<el-form-item label="福利选项" v-if="[2,3,4].includes(formData.provideMode)">
<welfare-option-table :subject="formData.welfareProjectSubjects" ref="welfareOptionTable"></welfare-option-table>
<el-form-item label="福利选项">
<welfare-option v-model="formData.options"></welfare-option>
</el-form-item>
</template>
@@ -258,15 +250,24 @@ layout("/layouts/platform.html"){
</el-row>
</template>
</guava>
<filter-user ref="filterUserRef"></filter-user>
</div>
<script>
<!--#include("/platform/zhgh/welfare/include/common.js"){}#-->
<!--#include("welfareOptionTable.js"){}#-->
<!--#include("welfareOption.js"){}#-->
<!--#include("filterUser.js"){}#-->
new Vue({
el: "#app",
store,
mixins: [initTableMixins],
components: {
"welfare-option-table": WELFARE_OPTION_TABLE,
"welfare-option": welfareOption,
"filter-user": filterUser
},
data() {
return {
festival: [],
@@ -297,26 +298,24 @@ layout("/layouts/platform.html"){
welfarePersonTypeList: []
}
},
components: {
"welfare-option-table": WELFARE_OPTION_TABLE
},
methods: {
dropdownCommand(command) {
const { type, data } = command
this.welfare_id = data.id
if (type == "view") {
if (type === "view") {
this.openView(data.id)
} else if (type == "edit") {
} else if (type === "edit") {
this.openEdit(data)
} else if (type == "delete") {
} else if (type === "delete") {
this.doDelete(data.id)
} else if (type == "createList") {
this.createList(data, false)
} else if (type == "createList2") {
} else if (type === "createList") {
//this.createList(data, false)
this.$refs.filterUserRef.onOpen(data.id)
} else if (type === "createList2") {
this.createList(data, true)
} else if (type === "status") {
this.projectStatusChange(data)
} else if (type == "sendMsg") {
} else if (type === "sendMsg") {
this.sendMsg(data)
}
},
@@ -324,54 +323,24 @@ layout("/layouts/platform.html"){
const formValid = await this.$refs["form"].validate()
if (formValid) {
if (this.formData.flexible) {
const questionValid = this.$refs.welfareOptionTable.validate()
if (!questionValid) {
this.$message.warning("题目信息填写不完整!")
return
}
}
this.submitLoading = true
const loading = this.$loading({
lock: true,
text: "数据保存中请稍后",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)"
})
const formData = clone(this.formData)
formData.provideAddress = "工会"
if (formData.isCheckBox === "radio") {
formData.multiSelectNum = 1
}
/* if (formData.conditionStructure)
formData.conditionStructure = JSON.stringify(formData.conditionStructure)*/
if (this.formData.flexible && [2, 3, 4].includes(formData.provideMode)) {
formData.welfareProjectSubjects = this.$refs.welfareOptionTable.subject
}
if (!this.formData.id) {
const alert = await this.$alert("确定要提交吗?", "提醒", {
confirmButtonText: "确定"
})
}
try {
this.submitLoading = true
const resp = await this.$axios.post(loc() + "/save", { data: JSON.stringify(formData) })
loading.close()
this.submitLoading = false
if (resp.code === 0) {
this.$refs.guava.index()
this.doSearch()
this.$message.success(resp.msg)
} else {
this.notifyWarning(resp.msg)
this.$message.error(resp.msg)
}
} catch (e) {
loading.close()
this.submitLoading = false
this.notifyWarning(e.status)
} finally {
this.submitLoading = false
}
}
},
@@ -454,37 +423,34 @@ layout("/layouts/platform.html"){
this.submitLoading = false
if (resp.code === 0) {
const data = resp.data
/* data.flexibleGifts = data.flexibleGifts || [{}]
const idx = data.flexibleGifts.findIndex(v => v.isDefault)
data.defaultFlexibleGifts = idx < 0 ? 0 : idx*/
data.provideTime = [data.provideTimeStart, data.provideTimeEnd]
data.choiceTime = [data.choiceTimeStart, data.choiceTimeEnd]
if (data.welfareProjectSubjects.length === 0) {
data.welfareProjectSubjects = [
{
subjectName: "请输入福利信息",
subjectType: data.isCheckBox,
defaultOption: null,
options: [
{
optionType: "套餐",
optionName: "福利1",
optionNameId: "",
optionSort: "1",
imgUrl: ""
}
]
}
]
} else {
data.welfareProjectSubjects.forEach((v) => {
v.options.map((o) => {
if (!o.optionNameId) {
o.optionNameId = ""
}
})
})
}
// if (data.welfareProjectSubjects.length === 0) {
// data.welfareProjectSubjects = [
// {
// subjectName: "请输入福利信息",
// subjectType: data.isCheckBox,
// defaultOption: null,
// options: [
// {
// optionType: "套餐",
// optionName: "福利1",
// optionNameId: "",
// optionSort: "1",
// imgUrl: ""
// }
// ]
// }
// ]
// } else {
// data.welfareProjectSubjects.forEach((v) => {
// v.options.map((o) => {
// if (!o.optionNameId) {
// o.optionNameId = ""
// }
// })
// })
// }
this.formData = data
this.$refs.guava.edit()
} else {
@@ -495,21 +461,17 @@ layout("/layouts/platform.html"){
this.$confirm("确定要删除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: async (a, b) => {
if ("confirm" == a) {
//确认后再执行
this.submitLoading = true
const resp = await this.$axios.post(loc() + "/delete", { id })
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
this.submitLoading = false
}
type: "warning"
}).then(async () => {
this.submitLoading = true
const resp = await this.$axios.post(loc() + "/delete", { id })
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
this.submitLoading = false
})
},
async createList(row, flag) {
@@ -524,23 +486,20 @@ layout("/layouts/platform.html"){
this.$confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
callback: async (a, b) => {
if ("confirm" == a) {
//确认后再执行
this.submitLoading = true
const resp = await this.$axios.post(loc() + "/createList", {
id: row.id,
created: false
})
this.submitLoading = false
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
}
type: "warning"
}).then(async () => {
//确认后再执行
this.submitLoading = true
const resp = await this.$axios.post(loc() + "/createList", {
id: row.id,
created: false
})
this.submitLoading = false
if (resp.code === 0) {
this.doSearch()
this.$message.success(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
}
@@ -0,0 +1,192 @@
const welfareOption = {
template: /*language=HTML*/ `
<div class="welfare-option">
<el-card shadow="never">
<el-table :data="welfareList" border style="width: 100%; margin-top: 20px;">
<el-table-column align="center" header-align="center" label="福利名称">
<template slot-scope="{row}">
<el-input
v-model="row.optionName"
placeholder="请输入福利名称">
</el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="图片" width="120">
<template slot-scope="{row}">
<file-upload :upload_number="1" :value.sync="row.imgUrl"
accept=".jpg,.jpeg,.png"
class="imgUrl"
upload_result_type="url"
complete_result upload_mode="image"
upload_result_category="interval"></file-upload>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="说明" width="120">
<template slot-scope="{row, $index}">
<el-button
type="text"
@click="openDescription(row, $index)">
{{ row.description ? '编辑说明' : '添加说明' }}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="100">
<template slot-scope="{$index}">
<el-button
type="danger"
icon="el-icon-delete"
circle
size="mini"
@click="deleteOption($index)">
</el-button>
</template>
</el-table-column>
</el-table>
<el-button type="primary" size="small" @click="addOption">添加福利选项</el-button>
</el-card>
<!-- 说明编辑对话框 -->
<el-dialog
title="编辑福利说明"
:visible.sync="descriptionDialog.visible"
width="60%"
:append-to-body="true"
:close-on-click-modal="false">
<text-editor v-model="descriptionDialog.content"></text-editor>
<span slot="footer" class="dialog-footer">
<el-button @click="descriptionDialog.visible = false">取 消</el-button>
<el-button type="primary" @click="saveDescription">确 定</el-button>
</span>
</el-dialog>
</div>
`,
props: {
value: {
type: Array,
default: () => []
}
},
data() {
return {
welfareList: [],
descriptionDialog: {
visible: false,
content: '',
currentIndex: -1
}
}
},
created() {
this.welfareList = this.value ? JSON.parse(JSON.stringify(this.value)) : [];
},
watch: {
welfareList: {
handler(newVal) {
this.$emit('input', newVal);
},
deep: true
}
},
methods: {
addOption() {
const newSort = this.welfareList.length + 1;
this.welfareList.push({
optionName: '福利' + newSort,
optionSort: newSort,
imgUrl: '',
description: ''
});
},
deleteOption(index) {
this.$confirm('确认删除该福利选项?', '提示', {
type: 'warning'
}).then(() => {
this.welfareList.splice(index, 1);
this.updateSortNumbers();
});
},
openDescription(row, index) {
this.descriptionDialog.content = row.description || '';
this.descriptionDialog.currentIndex = index;
this.descriptionDialog.visible = true;
},
saveDescription() {
if (this.descriptionDialog.currentIndex > -1) {
this.welfareList[this.descriptionDialog.currentIndex].description = this.descriptionDialog.content;
}
this.descriptionDialog.visible = false;
},
handleSortChange(value, index) {
const item = this.welfareList[index];
const oldSort = item.optionSort;
if (value < 1) value = 1;
if (value > this.welfareList.length) value = this.welfareList.length;
this.welfareList.forEach(welfare => {
if (welfare !== item) {
if (value > oldSort && welfare.optionSort > oldSort && welfare.optionSort <= value) {
welfare.optionSort--;
} else if (value < oldSort && welfare.optionSort >= value && welfare.optionSort < oldSort) {
welfare.optionSort++;
}
}
});
item.optionSort = value;
this.welfareList.sort((a, b) => a.optionSort - b.optionSort);
},
updateSortNumbers() {
this.welfareList.forEach((item, index) => {
item.optionSort = index + 1;
});
}
},
style: /*language=CSS*/ `
.welfare-option {
}
.welfare-option .el-card__body{
padding: 0;
}
.welfare-option .el-upload-list__item{
width: 100px;
height: 100px;
}
.welfare-option .imgUrl .el-upload--picture-card {
width: 100px;
height: 100px;
}
.welfare-option .imgUrl .el-upload--picture-card i {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.preview-image {
width: 100%;
height: 100%;
display: block;
object-fit: cover;
}
`
};
@@ -0,0 +1,226 @@
const WELFARE_OPTION_TABLE = {
template: /*language=HTML*/ `
<div>
<el-card>
<el-form ref="form">
<el-card :key="s.id" class="item" shadow="never" v-for="(s,idx) in subject">
<!-- <el-form-item :label="(s.subjectType==='radio'?'(单选)':'(多选)')+ (idx+1)+'.'" prop="subjectName">-->
<el-form-item label="" prop="subjectName">
<div class="s-title-wrap">
<el-row align="middle" style="width: 100%" type="flex">
<el-col :xl="15"
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;">
<el-input class="text-input" data-type="subject"
v-model="s.subjectName"></el-input>
</el-col>
<el-col :xl="2" style="text-align: center"></el-col>
<!-- <el-col :xl="2" style="text-align: center">
<div class="option-delete">
<el-button circle
icon="el-icon-delete"
size="mini" type="danger"
@click="subject.splice(idx,1)"></el-button>
</div>
</el-col>-->
</el-row>
</div>
<div class="s-options-list" style="margin-top: 10px;">
<el-table :data="s.options" border>
<el-table-column
align="center"
header-align="center"
label="福利名称"
>
<template slot-scope="{row}">
<div
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
<i class="fa fa-circle-o" style="cursor: pointer"
v-if="s.subjectType==='radio'"></i>
<i class="fa fa-square-o"
style="cursor: pointer"
v-else-if="s.subjectType==='checkBox'"></i>
<el-input autosize class="text-input"
data-type="option"
v-model="row.optionName"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column align="center" header-align="center"
label="备注1">
<template slot-scope="{row}">
<el-input max="100" type="textarea"
v-model="row.supplier"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center"
label="备注2">
<template slot-scope="{row}">
<el-input max="100" type="textarea"
v-model="row.simpleDesc"></el-input>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="排序"
width="120px">
<template slot-scope="{row}">
<div
style="border: 1px dashed rgb(217, 217, 217);border-radius:6px;display: flex;align-items: center;padding-left: 10px;">
<el-input autosize class="text-input"
data-type="option"
v-model="row.optionSort"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="图片"
width="120">
<template slot-scope="{row,$index}">
<file-upload :upload_number="1" :value.sync="row.imgUrl"
accept=".jpg,.jpeg,.png"
class="imgUrl"
upload_result_type="url"
complete_result upload_mode="image"
upload_result_category="interval"></file-upload>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="说明"
width="100px ">
<template slot-scope="scope">
<el-link @click="openDescRichText(scope.row.description,idx,scope.$index)"
type="primary">
编辑说明
</el-link>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
width="100px">
<template slot-scope="{row,$index}">
<div class="option-delete">
<el-button @click="deleteRow(s.options,row,$index)"
circle
icon="el-icon-delete" size="mini"
type="danger"></el-button>
</div>
</template>
</el-table-column>
</el-table>
<div class="s-operation">
<el-button
@click="s.options.push({optionType:'套餐',optionNameId:'',optionName:'福利'+(s.options.length+1),optionSort:s.options.length+1,imgUrl:null,isDefaultOption:false,isSystemDefault:false})"
size="small"
type="primary">
添加福利
</el-button>
</div>
</div>
</el-form-item>
</el-card>
</el-form>
</el-card>
<el-dialog
:append-to-body="true"
:close-on-click-modal="false"
:visible.sync="richTextDialog"
title="编辑说明"
width="60%">
<text-editor v-model="descRichTextContent"></text-editor>
<span class="dialog-footer" slot="footer">
<el-button @click="richTextDialog = false">取 消</el-button>
<el-button @click="saveRichText" type="primary">确 定</el-button>
</span>
</el-dialog>
</div>
`,
watch: {
subject(val) {
}
},
props: {
subject: {
type: Array,
default: []
}
},
data() {
return {
descRichTextContent: "",
files: [],
shoppingTypeOptions: null,
richTextDialog: false,
subjectIndex: 0,
optionIndex: 0,
imgPopover: false,
idx: null,
oidx: null
}
},
methods: {
deleteRow(options, row, index) {
options.splice(index, 1)
const shoppingTypeOption = this.shoppingTypeOptions.find(v => v.id === row.optionNameId)
shoppingTypeOption.disabled = false
},
addSubject(type) {
let subject = {
subjectName: "题目" + (this.subject.length + 1),
subjectType: type,
options: [
{ optionName: "选项一", imgUrl: null },
{ optionName: "选项一", imgUrl: null }
]
}
this.subject.push(subject)
},
validate(fn) {
if (this._validate()) {
return false
}
return true
},
_validate() {
return this.subject.some(v => {
if (!v.subjectName) return true
return v.options.some(x => {
if (!x.optionName) return true
})
})
},
openDescRichText(description, sIdx, oIdx) {
this.descRichTextContent = description
this.richTextDialog = true
this.subjectIndex = sIdx
this.optionIndex = oIdx
},
saveRichText() {
this.subject[this.subjectIndex]["options"][this.optionIndex].description = this.descRichTextContent
this.richTextDialog = false
}
},
style: /*language=CSS*/ `
.imgUrl .el-upload--picture-card {
width: 100px;
height: 100px;
}
.imgUrl .el-upload--picture-card i {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
`
}
@@ -0,0 +1,196 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava :edit_scroll="false" ref="guava">
<template>
<el-card shadow="never">
<div class="search">
<div class="search-item">
<div class="search-item-label">&emsp;&emsp;度:</div>
<div class="search-item-option">
<el-date-picker
@change="doSearch"
placeholder="请选择"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
</div>
</div>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="福利项目">
<template #func></template>
</table-tool>
<el-table
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
ref="table"
row-key="id"
style="width: 100%"
v-loading="tableLoading"
>
<el-table-column
:index="indexMethod"
align="center"
header-align="center"
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"
align="center"
header-align="center"
min-width="100px"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='choiceTime'">
<i class="el-icon-time"></i>
&ensp; {{$moment(row.choiceTimeStart) .format('YYYY/MM/DD HH:mm')}}
<span>- {{$moment(row.choiceTimeEnd) .format('YYYY/MM/DD HH:mm')}}</span>
</template>
<template scope="{row}" v-else-if="column.prop=='isChoose'">
<span class="text-primary" v-if="row.isChoose">已选择</span>
<span class="text-danger" v-else>未选择</span>
</template>
<template scope="{row}" v-else-if="column.prop=='gist_list'">
<span v-if="row.gist_list">{{row.gist_list}}</span>
<span v-else>暂无</span>
</template>
<template scope="{row}" v-else-if="column.prop=='receiveAddress'">
<span v-if="row.receiveAddress">{{row.receiveAddress}}</span>
<span v-else>暂无</span>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="150px">
<template scope="{row}">
<el-button @click="openChoose(row)" size="mini" type="primary">{{confirmButtonInfo(row).text}}</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<option-select ref="optionSelectRef" @refresh="doSearch();$refs.guava.index();"></option-select>
</template>
</guava>
</div>
<script>
<!--#include("optionSelect.js"){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{ prop: "year", label: "年度" },
{ prop: "name", label: "项目名称" },
{ prop: "choiceTime", label: "选择时间" },
{ prop: "isChoose", label: "是否选择" },
{ prop: "gist_list", label: "所选福利" }
// { prop: "receiveAddress", label: "收货地址" }
]
}
},
components: {
"option-select": optionSelect
},
methods: {
go_back() {
this.doSearch()
this.$refs.guava.index()
},
confirmButtonInfo(row) {
const { choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime } = row
const now = this.$moment().valueOf()
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === "") {
if (now > this.$moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) {
return { text: isChoose ? "确定修改" : "确定选择", disabled: false }
} else if (now > this.$moment(choiceTimeEnd).valueOf()) {
return { text: "选择已结束", disabled: true }
} else if (now < this.$moment(choiceTimeStart).valueOf()) {
return { text: "选择未开始", disabled: true }
}
} else {
//已选择了不能再动了
if (isChoose) {
if (
this.$moment(selectTime).valueOf() > this.$moment(choiceTimeEnd).valueOf() &&
now < this.$moment(overdueChoiceTimeEnd).valueOf()
) {
return { text: "确定修改", disabled: false }
}
return { text: "选择已结束", disabled: true }
} else {
if (now > this.$moment(choiceTimeStart).valueOf() && now < this.$moment(overdueChoiceTimeEnd).valueOf()) {
return { text: isChoose ? "修改" : "确定选择", disabled: false }
} else if (now > this.$moment(overdueChoiceTimeEnd).valueOf()) {
return { text: "选择已结束", disabled: true }
} else if (now < this.$moment(choiceTimeStart).valueOf()) {
return { text: "选择未开始", disabled: true }
}
}
}
},
async openChoose(row) {
if (this.confirmButtonInfo(row).disabled) {
this.$message.warning("当前时间段无法选择")
return
}
this.$refs.guava.edit(() => {
this.$refs.optionSelectRef.onOpen(row.id)
})
}
},
async created() {
this.pageData()
}
})
</script>
<style>
.desc_label {
width: 75px;
-webkit-flex-shrink: 0;
flex-shrink: 0;
padding-right: 4px;
display: inline-block;
font-size: 14px;
color: #7f7f7f;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.desc_value {
color: #333;
font-size: 14px;
}
</style>
<!--#
}
#-->
File diff suppressed because it is too large Load Diff
@@ -33,41 +33,7 @@ layout("/layouts/platform.html"){
<el-card class="mt10" shadow="never" v-loading="tableLoading">
<table-tool label="工会列表">
<el-button
@click="allExportReceiveDetailByUnionIdWord"
icon="el-icon-printer"
size="small"
type="primary"
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN',
'SCHOOL_UNION_WELFARE_ADMIN'])"
>
导出各分工会福利签领表
</el-button>
<template
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN',
'SCHOOL_UNION_WELFARE_ADMIN','BRANCH_UNION_CHAIRMAN'])"
>
<el-button @click="exportSelectData" icon="el-icon-printer" size="small" type="primary">按品牌导出</el-button>
<el-button
:disabled="!pageForm.projectId"
@click="exportReceiveDetailByUnionId(true)"
icon="el-icon-printer"
size="small"
type="primary"
>
导出已选名单
</el-button>
<el-button
:disabled="!pageForm.projectId"
@click="exportReceiveDetailByUnionId(false)"
icon="el-icon-printer"
size="small"
type="primary"
>
导出未选名单
</el-button>
</template>
<el-button @click="exportByWelfareOptions" icon="el-icon-printer" size="small" type="primary">按福利选项导出</el-button>
<template
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN',
'SCHOOL_UNION_WELFARE_ADMIN'])"
@@ -102,125 +68,33 @@ layout("/layouts/platform.html"){
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='welfareUnitName'">{{row.welfareUnitName}}</template>
<template scope="{row}" v-else-if="column.prop=='unselectedTeacherSum'">
<el-link @click="openUnclaimed(row.id)" type="primary">{{row.unselectedTeacherSum}}</el-link>
<template scope="{row}" v-else-if="column.prop=='selectedNum'">
<el-link @click="openSelected(row)" type="primary">{{row.selectedNum}}</el-link>
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" v-if="tableColumns.length>0" width="400px">
<template scope="{ row }">
<el-button @click="exportReceiveDetailByUnionIdWord(row.id)" plain size="mini" type="primary">导出福利签领表</el-button>
<el-button @click="openView(row.id)" size="mini" type="primary">查看已选人员</el-button>
<template scope="{row}" v-else-if="column.prop=='unSelectedNum'">
<el-link @click="openUnSelected(row)" type="primary">{{row.unSelectedNum}}</el-link>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
<template #view>
<el-table
:data="receiveTableData"
:size="tableSize"
class="vi-table"
height="100%"
row-key="id"
style="width: 100%"
v-loading="tableLoading"
>
<el-table-column label="序号" type="index" width="50">
<template scope="scope">{{scope.$index + (receivePageForm.pageNumber - 1) * receivePageForm.pageSize + 1}}</template>
</el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in receive_tableColumns"
></el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
:current-page="receivePageForm.pageNumber"
:page-size="receivePageForm.pageSize"
:page-sizes="[5,10, 20, 30, 50]"
:total="receivePageForm.totalCount"
@current-change="receivePageNumberChange"
@size-change="receivePageSizeChange"
layout="total, sizes, prev, pager, next"
></el-pagination>
</el-row>
</template>
</guava>
<el-dialog :visible.sync="unclaimedDialog" title="未领取人员" width="65%">
<el-button @click="exportReceiveDetailByUnionId(false)" class="pull-right" icon="el-icon-printer" type="primary">导出未选名单</el-button>
<el-table
:data="unclaimedTableData"
:size="tableSize"
class="vi-table"
max-height="650"
row-key="id"
style="width: 100%"
v-loading="tableLoading"
>
<el-table-column type="index" width="50"></el-table-column>
<el-table-column
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in unclaimed_tableColumns"
></el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
:current-page="unclaimedPageForm.pageNumber"
:page-size="receivePageForm.pageSize"
:page-sizes="[5,10, 20, 30, 50]"
:total="unclaimedPageForm.totalCount"
@current-change="unclaimedPageNumberChange"
@size-change="unclaimedPageSizeChange"
layout="total, sizes, prev, pager, next"
></el-pagination>
</el-row>
</el-dialog>
<el-dialog :visible.sync="selectByAdminDialogVisible" title="管理员统一选择福利" width="35%">
<el-form label-position="right" label-width="120px">
<el-form-item label="福利选项">
<el-row :gutter="10" :key="item.id" style="margin: 10px" v-for="(item,oidx) in welfareOptions">
<el-col :span="4">
<el-tag style="height: 40px; line-height: 40px; width: 90%">
<span style="display: flex; justify-content: center">{{item.optionName}}</span>
</el-tag>
</el-col>
<el-col span="18">
<el-input-number
:max="item.maxNum"
:min="0"
@change="numChange(item.selectNum,item,oidx)"
style="width: 50%"
v-model="item.selectNum"
></el-input-number>
</el-col>
</el-row>
</el-form-item>
</el-form>
<el-alert class="text-primary mb10">给没有选择的福利人员统一代选择</el-alert>
<el-row justify="end" type="flex">
<el-button @click="selectByAdminDialogVisible=false">取消</el-button>
<el-button @click="doSelectByAdmin" type="primary">提交</el-button>
</el-row>
</el-dialog>
<selected-user ref="selectedUserRef"></selected-user>
<unselected-user ref="unSelectedUserRef"></unselected-user>
</div>
<script>
<!--#include('selectedUser.js'){}#-->
<!--#include('unSelectedUser.js'){}#-->
new Vue({
el: "#app",
mixins: [initTableMixins],
components: {
"selected-user": selectedUser,
"unselected-user": unSelectedUser
},
data() {
return {
unions: [],
@@ -263,163 +137,47 @@ layout("/layouts/platform.html"){
{ label: "工号", prop: "loginName" },
{ label: "单位", prop: "unitName" },
{ label: "工会", prop: "unionName" }
],
selectByAdminDialogVisible: false
]
}
},
methods: {
//数量更改
numChange(value, option, optionIndex) {
this.$nextTick(() => {
// 查找+1按钮
const plusButton = document.querySelector(".el-input-number__increase")
// 添加点击事件监听器
plusButton.addEventListener("click", this.handlePlusButtonClick(value, option, optionIndex))
})
},
handlePlusButtonClick(value, option, optionIndex) {
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
if (isCheckBox === "checkBox") {
//判断是否支持单个多选
if (!singleOptionSupportMultipleSelection && value > 1) {
this.$set(this.welfareOptions[optionIndex], "selectNum", 1)
this.$message("此套餐最多只能选择1份")
return
}
}
//获取用户当前选择的数量
const selectNums = this.welfareOptions.map((v) => v.selectNum)
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum > multiSelectNum) {
this.$set(this.welfareOptions[optionIndex], "selectNum", 0)
this.$message("此次福利最多只能选择" + multiSelectNum + "份")
}
},
doSelectByAdmin() {
//获取用户当前选择的数量
const selectNums = this.welfareOptions.map((v) => v.selectNum)
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum === 0) {
this.notifyWarning("请选择福利")
return
}
this.$confirm("请确定是否给未选择的教职工一键选择当前福利?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
this.doSelectByAdminLoading = true
const resp = await this.$axios.post("/platform/welfare/project/statistics/single/doSelectByAdmin", {
welfareOptions: JSON.stringify(this.welfareOptions),
projectId: this.pageForm.projectId
})
this.doSelectByAdminLoading = false
if (resp.code === 0) {
this.pageData()
this.selectByAdminDialogVisible = false
this.$message.success(resp.msg)
} else {
this.notifyWarning(resp.msg)
}
})
},
selectOptionByAdmin() {
this.selectByAdminDialogVisible = true
},
exportSummary() {
this.$downLoad("/platform/welfare/project/statistics/single/exportSummary", {
this.$downLoad("/platform/welfare/statistics/exportSummary", {
projectId: this.pageForm.projectId
})
},
exportSelectData() {
this.$downLoad("/platform/welfare/project/statistics/single/exportSelectData", {
this.$downLoad("/platform/welfare/statistics/exportSelectData", {
projectId: this.pageForm.projectId,
unionId: this.pageForm.unionId
})
},
allExportReceiveDetailByUnionIdWord() {
this.$downLoad("/platform/welfare/project/statistics/single/allExportReceiveDetailByUnionIdWord", {
projectId: this.pageForm.projectId
})
// 查看已选择的人员
openSelected(row) {
this.$refs.selectedUserRef.onOpen(this.pageForm.projectId, row)
},
exportReceiveDetailByUnionId(flag) {
this.$downLoad("/platform/welfare/project/statistics/single/exportReceiveDetailByUnionId", {
// 查看未选择的人员
async openUnSelected(row) {
this.$refs.unSelectedUserRef.onOpen(this.pageForm.projectId, row)
},
// 按福利选项导出
exportByWelfareOptions() {
this.$downLoad("/platform/welfare/statistics/exportByWelfareOptions", {
projectId: this.pageForm.projectId,
unionId: this.pageForm.unionId ? this.pageForm.unionId : this.unclaimedPageForm.unionId,
flag: flag
})
},
async openUnclaimed(id) {
this.unclaimedPageForm.pageNumber = 1
this.unclaimedPageForm.pageSize = 10
this.unclaimedPageForm.unionId = id
await this.unclaimedPageData()
this.unclaimedDialog = true
},
async unclaimedPageData() {
this.tableLoading = true
const resp = await $.post("/platform/welfare/project/statistics/single/unclaimedData", {
unionId: this.unclaimedPageForm.unionId,
projectId: this.pageForm.projectId,
pageNumber: this.unclaimedPageForm.pageNumber,
pageSize: this.unclaimedPageForm.pageSize
})
this.unclaimedTableData = resp.data.list
this.unclaimedPageForm.totalCount = resp.data.totalCount
this.tableLoading = false
},
unclaimedPageSizeChange(val) {
this.unclaimedPageForm.pageSize = val
this.unclaimedPageData()
},
unclaimedPageNumberChange(val) {
this.unclaimedPageForm.pageNumber = val
this.unclaimedPageData()
},
async openView(id) {
this.receivePageForm.pageNumber = 1
this.receivePageForm.pageSize = 10
this.receivePageForm.unionId = id
await this.receivePageData()
this.$refs.guava.view()
},
receivePageSizeChange(val) {
this.receivePageForm.pageSize = val
this.receivePageData()
},
receivePageNumberChange(val) {
this.receivePageForm.pageNumber = val
this.receivePageData()
},
async receivePageData() {
this.tableLoading = true
const resp = await this.$axios.post("/platform/welfare/project/statistics/single/receivePageData", {
unionId: this.receivePageForm.unionId,
projectId: this.pageForm.projectId,
pageNumber: this.receivePageForm.pageNumber,
pageSize: this.receivePageForm.pageSize
})
this.receiveTableData = resp.data.list
this.receivePageForm.totalCount = resp.data.totalCount
this.tableLoading = false
},
exportReceiveDetailByUnionIdWord(id) {
this.$downLoad("/platform/welfare/project/statistics/single/exportReceiveDetailByUnionIdWord", {
projectId: this.pageForm.projectId,
unionId: id
unionId: this.pageForm.unionId
})
},
async pageData() {
this.tableLoading = true
const resp = await this.$axios.post("/platform/welfare/project/statistics/single/pageData", this.pageForm)
const resp = await this.$axios.post("/platform/welfare/statistics/pageData", this.pageForm)
if (resp.code === 0) {
this.tableColumns = [
{
prop: "name",
label: "所属工会",
label: "工会",
width: "300"
}
].concat(resp.data.tableColumn)
@@ -432,7 +190,6 @@ layout("/layouts/platform.html"){
this.welfareProjectList = resp.data
if (this.welfareProjectList && this.welfareProjectList.length > 0) {
this.$set(this.pageForm, "projectId", this.welfareProjectList[0].id)
this.getWelfareOptions()
} else {
this.tableData = []
@@ -442,10 +199,7 @@ layout("/layouts/platform.html"){
getWelfareOptions() {
const data = this.welfareProjectList.find((p) => p.id === this.pageForm.projectId)
this.projectInfo = data
data.optionList.map((v) => {
v.selectNum = 0
})
this.welfareOptions = data.optionList
this.welfareOptions = data.options
},
async init() {
if (
@@ -0,0 +1,94 @@
const selectedUser = {
template: /*language=HTML*/ `
<el-dialog :title="unionName+'已选择用户'" :visible.sync="visible">
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<div>
<el-input
v-model="pageForm.searchKeyword"
placeholder="请输入姓名或工号"
style="width: 200px;"
size="small"
clearable
@keyup.enter.native="doSearch"
>
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
</el-input>
</div>
<div>
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
</div>
</div>
<el-table
:data="tableData"
height="100%"
row-key="id"
style="width: 100%"
>
<el-table-column label="序号" type="index" :index="indexMethod" width="50"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
visible: false,
projectId: null,
unionId: null,
unionName: null,
searchKeyword: "",
tableColumns: [
{ label: "工号", prop: "loginName" },
{ label: "姓名", prop: "userName" },
{ label: "单位", prop: "welfareUnitName" },
{ label: "分工会", prop: "welfareUnionName" },
{ label: "手机号", prop: "mobile" },
{ label: "所选福利", prop: "selectOptionName" }
]
}
},
methods: {
onOpen(projectId, { id, name }) {
this.visible = true
this.projectId = projectId
this.unionId = id
this.unionName = name
this.searchKeyword = ""
this.pageData()
},
pageData() {
this.$axios
.post("/platform/welfare/statistics/selectedUnionUserPageData", {
...this.pageForm,
projectId: this.projectId,
unionId: this.unionId,
keyword: this.searchKeyword
})
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
handleSearch() {
this.pageForm.pageNum = 1
this.pageData()
},
handleExport() {
this.$downLoad("/platform/welfare/statistics/exportSelectedUnionUser", {
projectId: this.projectId,
unionId: this.unionId
})
}
}
}
@@ -0,0 +1,84 @@
const unSelectedUser = {
template: /*language=HTML*/ `
<el-dialog :title="unionName+'未选择用户'" :visible.sync="visible">
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<div>
<el-input
v-model="pageForm.searchKeyword"
placeholder="请输入姓名或工号"
style="width: 200px;"
size="small"
clearable
@keyup.enter.native="doSearch"
>
<el-button slot="append" icon="el-icon-search" @click="doSearch"></el-button>
</el-input>
</div>
<div>
<el-button type="primary" size="small" @click="handleExport">导出</el-button>
</div>
</div>
<el-table
:data="tableData"
row-key="id"
style="width: 100%"
>
<el-table-column label="序号" type="index" :index="indexMethod" width="50"></el-table-column>
<el-table-column
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
align="center"
show-overflow-tooltip
v-for="column in tableColumns"
></el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
visible: false,
projectId: null,
unionId: null,
unionName: null,
tableColumns: [
{ label: "工号", prop: "loginName" },
{ label: "姓名", prop: "userName" },
{ label: "单位", prop: "welfareUnitName" },
{ label: "分工会", prop: "welfareUnionName" }
]
}
},
methods: {
onOpen(projectId, { id, name }) {
this.visible = true
this.projectId = projectId
this.unionId = id
this.unionName = name
this.pageData()
},
pageData() {
this.$axios
.post("/platform/welfare/statistics/unSelectedUnionUserPageData", {
...this.pageForm,
projectId: this.projectId,
unionId: this.unionId
})
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
}
})
},
handleExport() {
this.$downLoad("/platform/welfare/statistics/exportUnSelectedUnionUser", {
projectId: this.projectId,
unionId: this.unionId
})
}
}
}
@@ -1,196 +1,196 @@
<!--#include("/platform/zhgh/welfare/addressManage/addressDialog.js"){}#-->
let CHOOSE_WELFARE = {
template: `
<div>
<el-card shadow="never">
<el-form :model="formData" label-width="120px" ref="addForm">
<el-form-item label="福利名称">
<span style="font-weight: bold;font-size: 20px">{{projectInfo.name}}</span>
</el-form-item>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="福利节日">
{{projectInfo.festival}}
template: /*language=HTML*/ `
<div>
<el-card shadow="never">
<el-form :model="formData" label-width="120px" ref="addForm">
<el-form-item label="福利名称">
<span style="font-weight: bold;font-size: 20px">{{projectInfo.name}}</span>
</el-form-item>
</el-col>
<el-col :span="8" v-if="!projectInfo.flexible">
<el-form-item label="福利礼品">
{{projectInfo.gift}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="福利节日">
{{projectInfo.festival}}
</el-form-item>
</el-col>
<el-col :span="8" v-if="!projectInfo.flexible">
<el-form-item label="福利礼品">
{{projectInfo.gift}}
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="选择形式">
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
</el-form-item>
</el-col>
<el-col :span="8" v-if="projectInfo.isCheckBox==='checkBox'">
<el-form-item label="最多选几个">
{{projectInfo.multiSelectNum}}个
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发放形式">
<template>
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).name}}
</template>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签收形式">
<template>
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
welfareSignMode.find(v=>v.code==projectInfo.signMode).name}}
</template>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="选择时间">
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="选择形式">
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
</el-form-item>
</el-col>
<el-col :span="8" v-if="projectInfo.isCheckBox==='checkBox'">
<el-form-item label="最多选几个">
{{projectInfo.multiSelectNum}}个
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="发放形式">
<template>
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).name}}
</template>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="签收形式">
<template>
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
welfareSignMode.find(v=>v.code==projectInfo.signMode).name}}
</template>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="选择时间">
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
</el-form-item>
</el-col>
</el-row>
<el-form-item label="福利套餐">
<el-row :gutter="0">
<div :key="subject.id"
v-for="subject in projectInfo.welfareProjectSubjects">
<el-col :key="oidx" :span="8"
v-for="(option, oidx) in subject.options">
<el-card
style="margin: 5px;">
<el-form-item label="福利套餐">
<el-row :gutter="0">
<div :key="subject.id"
v-for="subject in projectInfo.welfareProjectSubjects">
<el-col :key="oidx" :span="8"
v-for="(option, oidx) in subject.options">
<el-card
style="margin: 5px;">
<div slot="header"
style="display: flex;justify-content: space-between">
<div style="color:#000;font-size: 18px">
{{option.optionName}}
</div>
<div>
<el-button @click.stop="viewDesc(option)"
type="text">套餐详情
</el-button>
</div>
</div>
<div slot="header"
style="display: flex;justify-content: space-between">
<div style="color:#000;font-size: 18px">
{{option.optionName}}
</div>
<div>
<el-button @click.stop="viewDesc(option)"
type="text">套餐详情
</el-button>
</div>
</div>
<div style="display: flex">
<el-image
style="width: 150px;height: 150px;"
:src="option.imgUrl"
fit="contain"
></el-image>
<div style="width:calc(100% - 150px);padding-left: 20px;position: relative">
<div style="white-space: nowrap;display: flex">
<span class="desc_label">服务专线</span>
<el-tooltip :content="option.supplier" placement="top">
<div style="display: flex">
<el-image
style="width: 150px;height: 150px;"
:src="option.imgUrl"
fit="contain"
></el-image>
<div style="width:calc(100% - 150px);padding-left: 20px;position: relative">
<div style="white-space: nowrap;display: flex">
<span class="desc_label">服务专线</span>
<el-tooltip :content="option.supplier" placement="top">
<span class="desc_value"
style="width: calc(100% - 80px);text-overflow: ellipsis;overflow: hidden">
{{option.supplier}}
</span>
</el-tooltip>
</div>
<div v-if="option.simpleDesc">
<span class="desc_label">备&emsp;&emsp;注</span>
<span class="desc_value">
</el-tooltip>
</div>
<div v-if="option.simpleDesc">
<span class="desc_label">备&emsp;&emsp;注</span>
<span class="desc_value">
{{option.simpleDesc}}
</span>
</div>
<div>
<el-input-number :disabled="is_view"
:max="option.maxNum"
:min="0"
@change="numChange(option.selectNum,option,oidx)"
style="width: 150px;position: absolute;right:0px;bottom: 0;"
v-model="option.selectNum"></el-input-number>
</div>
</div>
</div>
<div>
<el-input-number :disabled="is_view"
:max="option.maxNum"
:min="0"
@change="numChange(option.selectNum,option,oidx)"
style="width: 150px;position: absolute;right:0px;bottom: 0;"
v-model="option.selectNum"></el-input-number>
</div>
</div>
</div>
</el-card>
</el-col>
</div>
</el-row>
</el-form-item>
<template v-if="projectInfo.provideMode===3">
<el-row :gutter="20">
<el-col :span="24" v-if="!is_view">
<el-form-item label="收货地址" prop="receiveAddress">
<div style="display: flex; column-gap: 10px">
<div style="flex: 1">
<el-select @change="addressChange"
filterable placeholder="请选择收货地址"
style="width: 100%"
v-model="formData.addressId">
<el-option
:key="item.id"
:label="item.name+' '+item.defaultName"
:value="item.id"
v-for="item in addressOptions">
</el-option>
</el-select>
</div>
<div>
<el-button
@click="openAddress"
type="primary">添加收货地址
</el-button>
</div>
</el-card>
</el-col>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
:rules="{required:true,message: '请确认收货地址', trigger: 'blur'}"
label="请确认收货地址"
prop="receiveAddress">
<el-input :rows="4" disabled maxlength="100"
placeholder="选择收货地址联动" type="textarea"
v-model="formData.receiveAddress"></el-input>
</el-form-item>
</el-col>
</el-row>
</template>
</el-row>
</el-form-item>
<el-form-item :rules="{required:true,message: '请签字', trigger: 'blur'}"
label="签字" prop="userSign" v-if="projectInfo.signMode===2">
<template v-if="isChoice===0||!is_view">
<pc-signature v-model="formData.userSign"></pc-signature>
</template>
<template v-else>
<el-image :src="formData.userSign"
fit="contain"
style="height: 100px;width: 100%" v-if="formData.userSign">
</el-image>
<span v-else>暂无</span>
</template>
<template v-if="projectInfo.provideMode===3">
<el-row :gutter="20">
<el-col :span="24" v-if="!is_view">
<el-form-item label="收货地址" prop="receiveAddress">
<div style="display: flex; column-gap: 10px">
<div style="flex: 1">
<el-select @change="addressChange"
filterable placeholder="请选择收货地址"
style="width: 100%"
v-model="formData.addressId">
<el-option
:key="item.id"
:label="item.name+' '+item.defaultName"
:value="item.id"
v-for="item in addressOptions">
</el-option>
</el-select>
</div>
<div>
<el-button
@click="openAddress"
type="primary">添加收货地址
</el-button>
</div>
</div>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
:rules="{required:true,message: '请确认收货地址', trigger: 'blur'}"
label="请确认收货地址"
prop="receiveAddress">
<el-input :rows="4" disabled maxlength="100"
placeholder="选择收货地址联动" type="textarea"
v-model="formData.receiveAddress"></el-input>
</el-form-item>
</el-col>
</el-row>
</template>
<el-form-item :rules="{required:true,message: '请签字', trigger: 'blur'}"
label="签字" prop="userSign" v-if="projectInfo.signMode===2">
<template v-if="isChoice===0||!is_view">
<pc-signature v-model="formData.userSign"></pc-signature>
</template>
<template v-else>
<el-image :src="formData.userSign"
fit="contain"
style="height: 100px;width: 100%" v-if="formData.userSign">
</el-image>
<span v-else>暂无</span>
</template>
</el-form-item>
</el-form>
</el-card>
</el-form-item>
</el-form>
</el-card>
<el-row class="mt20" justify="end" type="flex">
<el-button @click="$emit('go_back')">关闭</el-button>
<el-button @click="doChoose" type="primary" v-if="!is_view">确定</el-button>
</el-row>
<el-drawer
:modal-append-to-body="false"
:append-to-body="true"
:visible.sync="descDialogVisible"
direction="rtl"
size="50%"
title="福利详情">
<el-card shadow="never" style="margin: 20px">
<div v-html="descData"></div>
</el-card>
</el-drawer>
<address-dialog ref="addressDialog" @select_user_address="selectUserAddress"></address-dialog>
</div>
`,
<el-row class="mt20" justify="end" type="flex">
<el-button @click="$emit('go_back')">关闭</el-button>
<el-button @click="doChoose" type="primary" v-if="!is_view">确定</el-button>
</el-row>
<el-drawer
:modal-append-to-body="false"
:append-to-body="true"
:visible.sync="descDialogVisible"
direction="rtl"
size="50%"
title="福利详情">
<el-card shadow="never" style="margin: 20px">
<div v-html="descData"></div>
</el-card>
</el-drawer>
<address-dialog ref="addressDialog" @select_user_address="selectUserAddress"></address-dialog>
</div>
`,
store,
props: {
is_view: {
@@ -428,4 +428,4 @@ let CHOOSE_WELFARE = {
}
}
};
@@ -147,7 +147,7 @@ layout("/layouts/platform.html"){
return { text: "选择已结束", disabled: true }
} else {
if (now > this.$moment(choiceTimeStart).valueOf() && now < this.$moment(overdueChoiceTimeEnd).valueOf()) {
return { text: isChoose ? "确定修改" : "确定选择", disabled: false }
return { text: isChoose ? "修改" : "确定选择", disabled: false }
} else if (now > this.$moment(overdueChoiceTimeEnd).valueOf()) {
return { text: "选择已结束", disabled: true }
} else if (now < this.$moment(choiceTimeStart).valueOf()) {
@@ -0,0 +1,250 @@
const addUser = {
template: /*language=HTML*/ `
<el-dialog title="添加用户" :visible.sync="visible" width="80%">
<el-card shadow="never">
<search @search="doSearch">
<search-item label="姓名">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入姓名"
style="width: 100%" v-model="pageForm.userName">
</el-input>
</search-item>
<search-item label="工号">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入工号"
style="width: 100%" v-model="pageForm.loginName">
</el-input>
</search-item>
<search-item label="性别">
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
<el-option :key="sex" :label="sex" :value="sex"
v-for="sex in sexOptions"></el-option>
</el-select>
</search-item>
<search-item label="出生日期">
<el-date-picker
v-model="pageForm.birthday"
type="date"
placeholder="选择出生日期"
value-format="yyyy-MM-dd"
style="width: 100%">
</el-date-picker>
</search-item>
<search-item label="出生月份">
<el-select
v-model="pageForm.birthMonths"
multiple
collapse-tags
placeholder="请选择出生月份"
style="width: 100%">
<el-option
v-for="month in 12"
:key="month"
:label="month + '月'"
:value="month">
</el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select clearable filterable placeholder="请选择工会"
style="width: 100%"
@change="unionIdChange"
v-model="pageForm.unionId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unionOptions">
</el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select clearable
filterable
multiple
collapse-tags
placeholder="请选择单位" style="width: 100%"
v-model="pageForm.unitIds">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unitOptions">
</el-option>
</el-select>
</search-item>
<search-item label="人员类型:">
<dict-select clearable code="USER_PERSON_TYPE"
multiple
collapse-tags
placeholder="请选择人员类型"
v-model="pageForm.personTypes"></dict-select>
</search-item>
<search-item label="聘用方式:">
<dict-select clearable code="USER_PREPARED_BY_TYPE"
multiple
collapse-tags
placeholder="请选择聘用方式"
v-model="pageForm.preparedBys"></dict-select>
</search-item>
<search-item label="在职状态:">
<dict-select clearable code="USER_STATE"
multiple
collapse-tags
placeholder="请选择人员状态"
v-model="pageForm.userStates"></dict-select>
</search-item>
<search-item label="是否会员">
<el-select clearable placeholder="请选择是否会员" style="width: 100%"
v-model="pageForm.isMember">
<el-option label="全部" :value="null"></el-option>
<el-option label="是" :value="true"></el-option>
<el-option label="否" :value="false"></el-option>
</el-select>
</search-item>
</search>
</el-card>
<el-card shadow="never">
<el-table :data="tableData"
:size="tableSize"
@sort-change="pageOrder"
ref="tableRef"
row-key="id"
style="width: 100%">
<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"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
<template #footer>
<el-button @click="visible = false">取消</el-button>
<el-button type="primary" @click="onSubmit">确定</el-button>
</template>
</el-dialog>
`,
mixins: [initTableMixins],
data() {
return {
visible: false,
projectId: null,
pageForm: {
userName: null,
loginName: null,
sex: null,
birthday: null,
birthMonths: [],
unionId: null,
unitIds: [],
personTypes: [],
preparedBys: [],
userStates: [],
isMember: null
},
sexOptions: ["男", "女"],
unionOptions: [],
unitOptions: [],
tableColumns: [
{ prop: "loginname", label: "工号" },
{ prop: "username", label: "姓名" },
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "preparedBy", label: "聘用方式", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "unionName", label: "所属工会", sortable: true },
{ prop: "unitName", label: "所属单位", sortable: true }
]
}
},
methods: {
async onOpen(id) {
this.visible = true
this.resetPageForm()
this.pageForm.projectId = id
this.unionOptions = await this.$businessTool.listUnion()
this.unitOptions = await this.$businessTool.listUnit()
this.pageData()
},
resetPageForm() {
this.pageForm.userName = null
this.pageForm.loginName = null
this.pageForm.sex = null
this.pageForm.birthday = null
this.pageForm.birthMonths = []
this.pageForm.unionId = null
this.pageForm.unitIds = []
this.pageForm.personTypes = []
this.pageForm.preparedBys = []
this.pageForm.userStates = []
this.pageForm.isMember = null
},
async unionIdChange(val) {
if (val) {
this.unitOptions = await this.$businessTool.listUnit(val)
} else {
this.pageForm.unitIds = []
}
},
pageData() {
this.$axios
.post("/platform/welfare/list/mange/notWelfareUserPageData", {
pageForm: JSON.stringify(this.pageForm)
})
.then((res) => {
if (res.code === 0) {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
} else {
this.$message.error(res.msg)
}
})
},
onSubmit() {
this.$confirm("当前筛选出" + this.pageForm.totalCount + "条数据,您确认添加到福利名单吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const { code, data, msg } = await this.$axios.post("/platform/welfare/list/mange/addWelfareUser", {
pageForm: JSON.stringify(this.pageForm),
projectId: this.projectId
})
if (code === 0) {
this.$message.success(msg)
this.visible = false
this.$emit("refresh")
} else {
this.$message.error(msg)
}
})
}
}
}
@@ -6,234 +6,208 @@ layout("/layouts/platform.html"){
<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"
:clearable="false"
placeholder="所属年份"
style="width: 100%"
type="year"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</search-item>
<search-item label="职工信息">
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
style="width: 100%" v-model="pageForm.searchKeyword">
<el-select slot="prepend" style="width: 80px;"
v-model="pageForm.searchName">
<el-option label="姓名" value="username"></el-option>
<el-option label="工号" value="loginname"></el-option>
</el-select>
</el-input>
<search-item label="福利项目">
<el-select :clearable="false" filterable placeholder="请选择福利项目" style="width: 100%" v-model="pageForm.projectId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in projectSelectOptions"></el-option>
</el-select>
</search-item>
<search-item label="福利项目">
<el-select :clearable="false" filterable
placeholder="请选择福利项目"
style="width: 100%"
v-model="pageForm.projectId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in projectSelectOptions">
</el-option>
<search-item label="姓名">
<el-input
@keyup.enter.native="doSearch"
clearable
placeholder="请输入姓名"
style="width: 100%"
v-model="pageForm.userName"
></el-input>
</search-item>
<search-item label="工号">
<el-input
@keyup.enter.native="doSearch"
clearable
placeholder="请输入工号"
style="width: 100%"
v-model="pageForm.loginName"
></el-input>
</search-item>
<search-item label="性别">
<el-select clearable placeholder="请选择性别" style="width: 100%" v-model="pageForm.sex">
<el-option :key="sex" :label="sex" :value="sex" v-for="sex in sexOptions"></el-option>
</el-select>
</search-item>
<search-item label="出生日期">
<el-date-picker
v-model="pageForm.birthday"
type="date"
placeholder="选择出生日期"
value-format="yyyy-MM-dd"
style="width: 100%"
></el-date-picker>
</search-item>
<search-item label="出生月份">
<el-select v-model="pageForm.birthMonths" multiple collapse-tags placeholder="请选择出生月份" style="width: 100%">
<el-option v-for="month in 12" :key="month" :label="month + '月'" :value="month"></el-option>
</el-select>
</search-item>
<search-item label="所属工会">
<el-select clearable filterable placeholder="请选择工会"
style="width: 100%"
v-model="pageForm.unionId">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unionList">
</el-option>
<el-select clearable filterable placeholder="请选择工会" style="width: 100%" v-model="pageForm.unionId">
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unionOptions"></el-option>
</el-select>
</search-item>
<search-item label="所属单位">
<el-select clearable filterable multiple
placeholder="请选择单位" style="width: 100%"
v-model="pageForm.unitIds">
<el-option
:key="item.id"
:label="item.name"
:value="item.id"
v-for="item in unitList">
</el-option>
</el-select>
</search-item>
<search-item label="性别">
<el-select clearable placeholder="请选择性别" style="width: 100%"
v-model="pageForm.sex">
<el-option :key="sex" :label="sex" :value="sex"
v-for="sex in sexOptions"></el-option>
<el-select
clearable
filterable
multiple
collapse-tags
placeholder="请选择单位"
style="width: 100%"
v-model="pageForm.unitIds"
>
<el-option :key="item.id" :label="item.name" :value="item.id" v-for="item in unitOptions"></el-option>
</el-select>
</search-item>
<search-item label="人员类型:">
<dict-select clearable code="PERSON_TYPE" multiple placeholder="请选择人员类型"
v-model="pageForm.personTypes"></dict-select>
<dict-select
clearable
code="USER_PERSON_TYPE"
multiple
collapse-tags
placeholder="请选择人员类型"
v-model="pageForm.personTypes"
></dict-select>
</search-item>
<search-item label="在职状态:">
<dict-select clearable code="USER_STATE" multiple placeholder="请选择人员状态"
v-model="pageForm.userStates"></dict-select>
</search-item>
<search-item label="所选福利:">
<el-select clearable placeholder="请选择所选福利" style="width: 100%"
v-model="pageForm.optionId">
<el-option :key="item.id" :label="item.optionName" :value="item.id"
v-for="item in pageFormProject"></el-option>
</el-select>
<dict-select
clearable
code="USER_STATE"
multiple
collapse-tags
placeholder="请选择人员状态"
v-model="pageForm.userStates"
></dict-select>
</search-item>
<!-- <search-item label="所选福利:">-->
<!-- <el-select clearable placeholder="请选择所选福利" style="width: 100%" v-model="pageForm.optionId">-->
<!-- <el-option :key="item.id" :label="item.optionName" :value="item.id" v-for="item in pageFormProject"></el-option>-->
<!-- </el-select>-->
<!-- </search-item>-->
</search>
</el-card>
<el-card class="mt10" shadow="never">
<table-tool :app="this" label="福利名单">
<!-- <el-button :disabled="pageFormProjectType!==3"-->
<!-- @click="doExcelByOptionId"-->
<!-- icon="el-icon-printer" size="small"-->
<!-- type="primary"-->
<!-- v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])">-->
<!-- 导出报销表-->
<!-- </el-button>-->
<!-- <el-button :disabled="pageFormProjectType!==3"-->
<!-- @click="openImportExpressExcel"-->
<!-- icon="el-icon-printer" size="small"-->
<!-- type="primary"-->
<!-- v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])">-->
<!-- 导入快递单号-->
<!-- </el-button>-->
<el-button :disabled="!pageForm.projectId" @click="openImport"
icon="el-icon-document-add"
size="small"
type="primary">导入名单
<el-button :disabled="!pageForm.projectId" @click="openImport" icon="el-icon-document-add" size="small" type="primary">
导入名单
</el-button>
<el-button :disabled="!pageForm.projectId" @click="openWelfareListUser"
icon="el-icon-document-add"
size="small"
type="primary">添加人员
<el-button
:disabled="!pageForm.projectId"
@click="$refs.addUserRef.onOpen(pageForm.projectId)"
icon="el-icon-document-add"
size="small"
type="primary"
>
添加人员
</el-button>
</table-tool>
<el-table :data="tableData" :size="tableSize"
@sort-change="pageOrder" class="vi-table"
ref="table" row-key="id" style="width: 100%"
v-loading="tableLoading">
<el-table-column :index="indexMethod" align="center" header-align="center"
label="序号" type="index"
width="80px"></el-table-column>
<el-table
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
ref="tableRef"
row-key="id"
style="width: 100%"
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"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns">
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
align="center"
header-align="center"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='isChoose'">
<span class="text-primary" v-if="row.isChoose">已选择</span>
<span class="text-danger" v-else>未选择</span>
</template>
<template scope="{row}" v-else-if="column.prop=='gist_list'">
{{row.gist_list?row.gist_list:'暂无'}}
</template>
<template scope="{row}" v-else-if="column.prop=='gist_list'">{{row.gist_list?row.gist_list:'暂无'}}</template>
<template scope="{row}" v-else-if="column.prop=='userSign'">
<el-image :src="row.userSign"
fit="cover"
style="height: 60px" v-if="row.userSign"></el-image>
<el-image :src="row.userSign" fit="cover" style="height: 60px" v-if="row.userSign"></el-image>
<el-tag type="warning" v-else>暂无</el-tag>
</template>
</el-table-column>
<el-table-column label="快递单号" prop="courierNumber" show-overflow-tooltip
v-if="pageFormProjectType===3">
<el-table-column label="快递单号" prop="courierNumber" show-overflow-tooltip v-if="pageFormProjectType===3">
<template scope="{row}">
<span @click="viewCourierNumber(row)" class="text-primary"
style="cursor: pointer">点击查看</span>
<span @click="viewCourierNumber(row)" class="text-primary" style="cursor: pointer">点击查看</span>
</template>
</el-table-column>
<el-table-column label="收货地址" prop="receiveAddress" show-overflow-tooltip
v-if="pageFormProjectType===3"></el-table-column>
<el-table-column align="center" fixed="right"
header-align="center" label="操作"
width="200px">
<el-table-column label="收货地址" prop="receiveAddress" show-overflow-tooltip v-if="pageFormProjectType===3"></el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="100px">
<template scope="{row}">
<el-button @click="openEditWelfare(row)" size="mini" type="primary"
v-if="pageFormSignMode!==1">
编辑
</el-button>
<el-button @click="doDelete(row)" size="mini" type="danger"
v-if="$auth.hasRoleOr(['SYSADMIN','SCHOOL_UNION_ADMIN','SCHOOL_UNION_WELFARE_ADMIN','SCHOOL_UNION_MEMBER_ADMIN'])">
删除
</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>
<edit-welfare-dialog :welfare_options="pageFormProject" ref="editWelfare"
:project_type="pageFormProjectType"
@do_search="doSearch"></edit-welfare-dialog>
<import-courier-number-dialog ref="importCourierNumber"></import-courier-number-dialog>
<!--快递物流信息-->
<courier-number-info ref="courierNumberInfo"></courier-number-info>
<el-dialog
:close-on-click-modal="false"
:visible.sync="importDialog"
title="福利名单导入"
width="50%"
>
<file-import ref="viewImport" temp_url="/platform/welfare/list/mange/downloadImport"
post_url="/platform/welfare/list/mange/doImport" is_show_radio
@flush="successImport" :business_id="pageForm.projectId"
<el-dialog :close-on-click-modal="false" :visible.sync="importDialog" title="福利名单导入" width="50%">
<file-import
ref="viewImport"
temp_url="/platform/welfare/list/mange/downloadImport"
post_url="/platform/welfare/list/mange/doImport"
is_show_radio
@flush="successImport"
:business_id="pageForm.projectId"
></file-import>
</el-dialog>
<add_welfare_list_by_select ref="addWelfareListUser" @search="doSearch"></add_welfare_list_by_select>
<add_welfare_list_by_select ref="addWelfareListUser" @search="doSearch"></add_welfare_list_by_select>
<add-user ref="addUserRef" @refresh="doSearch"></add-user>
</div>
<script>
<!--#include("editWelfareDialog.js"){}#-->
<!--#include("importCourierNumberDialog.js"){}#-->
<!--#include("addWelfareListBySelect.js"){}#-->
<!--#include("/platform/zhgh/welfare/mine/CourierNumberInfo.js"){}#-->
<!--#include("addUser.js"){}#-->
new Vue({
el: '#app',
el: "#app",
store,
mixins: [initTableMixins],
computed: {
pageFormProjectType() {
if (this.pageForm.projectId) {
const projectInfo = this.projectSelectOptions.find(v => v.id === this.pageForm.projectId)
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
if (projectInfo) {
return projectInfo.provideMode
}
@@ -243,7 +217,7 @@ layout("/layouts/platform.html"){
},
pageFormSignMode() {
if (this.pageForm.projectId) {
const projectInfo = this.projectSelectOptions.find(v => v.id === this.pageForm.projectId)
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
if (projectInfo) {
return projectInfo.signMode
}
@@ -253,57 +227,52 @@ layout("/layouts/platform.html"){
},
pageFormProject() {
if (this.pageForm.projectId) {
const projectInfo = this.projectSelectOptions.find(v => v.id === this.pageForm.projectId)
const projectInfo = this.projectSelectOptions.find((v) => v.id === this.pageForm.projectId)
if (projectInfo) {
return projectInfo.optionList
}
return null
}
return null
},
}
},
components: {
"edit-welfare-dialog": EDIT_WELFARE_DIALOG,
"import-courier-number-dialog": IMPORT_COURIER_NUMBER_DIALOG,
"courier-number-info": COURIER_NUMBER_INFO,
"add_welfare_list_by_select": ADD_WELFARE_LIST_BY_SELECT,
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
add_welfare_list_by_select: ADD_WELFARE_LIST_BY_SELECT,
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime()),
"add-user": addUser
},
data() {
return {
pageForm: {
searchName: "username",
year: moment().format('YYYY')
year: new Date().getFullYear().toString()
},
unionList: [],
unitList: [],
unionOptions: [],
unitOptions: [],
sexOptions: ["男", "女"],
projectSelectOptions: [],
tableColumns: [
{ prop: "loginname", label: "工号" },
{ prop: "username", label: "姓名" },
// {prop: 'sex', label: '性别', sortable: true, checked: 0},
{ prop: "sex", label: "性别", sortable: true, checked: 0 },
{ prop: "birthday", label: "出生日期", sortable: true, checked: 0 },
{ prop: "personType", label: "人员类型", sortable: true },
{ prop: "preparedBy", label: "聘用方式", sortable: true },
{ prop: "userState", label: "在职状态", sortable: true },
{ prop: "unionname", label: "所属工会", sortable: true },
{ prop: "unitname", label: "所属单位", sortable: true }
// {prop: 'isChoose', label: '是否选择', sortable: true},
// {prop: 'gist_list', label: '所选福利'},
// {prop: 'userSign', label: '签字', width: "100"},
{ prop: "welfareUnionName", label: "所属工会", sortable: true },
{ prop: "welfareUnitName", label: "所属单位", sortable: true }
],
importData: { fileList: [], isfg: 1 },
importLoading: false,
importDialog: false,
welfareListUserDrawer:false,
welfareListUserDrawer: false
}
},
methods: {
openWelfareListUser(){
console.log(this.$refs)
this.$refs.addWelfareListUser.welfareListUserDrawer=true
openWelfareListUser() {
this.$refs.addWelfareListUser.welfareListUserDrawer = true
this.$refs.addWelfareListUser.selectNotWelfareList(this.pageForm.projectId)
},
successImport() {
@@ -328,11 +297,11 @@ layout("/layouts/platform.html"){
},
doExcelByOptionId() {
if (!this.pageForm.optionId) {
this.$message.warning('请选择要导出的套餐')
this.$message.warning("请选择要导出的套餐")
return
}
if (!this.pageForm.projectId) {
this.$message.warning('请选择要导出的福利')
this.$message.warning("请选择要导出的福利")
return
}
this.$downLoad("/platform/welfare/list/mange/doExcelByOptionId", {
@@ -344,28 +313,22 @@ layout("/layouts/platform.html"){
this.$refs.editWelfare.openEditWelfare(row, this.projectSelectOptions)
},
doDelete(row) {
this.$confirm('确定要除吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: async (a, b) => {
if ("confirm" == a) {//确认后再执行
const resp = await this.$axios.post("/platform/welfare/list/mange/delete", {
id: row.listId,
userId: row.id,
projectId: this.pageForm.projectId,
});
if (resp.code === 0) {
this.doSearch()
} else {
this.notifyWarning(resp.msg)
}
}
this.$confirm("您确定要除吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const resp = await this.$axios.post("/platform/welfare/list/mange/delete", { id: row.id })
if (resp.code === 0) {
this.$message.success(resp.msg)
this.doSearch()
} else {
this.$message.error(resp.msg)
}
});
})
},
getWelfareList() {
this.$axios.post("/platform/welfare/project/mange/getWelfareList", {year: this.pageForm.year}).then(res => {
this.$axios.post("/platform/welfare/project/mange/getWelfareList", { year: this.pageForm.year }).then((res) => {
this.projectSelectOptions = res.data
if (res.data && res.data.length > 0) {
this.$set(this.pageForm, "projectId", res.data[0].id)
@@ -374,27 +337,28 @@ layout("/layouts/platform.html"){
},
pageData() {
this.tableLoading = true
const pageForm = clone(this.pageForm)
pageForm.unitIds = JSON.stringify(pageForm.unitIds)
pageForm.personTypes = JSON.stringify(pageForm.personTypes)
pageForm.userStates = JSON.stringify(pageForm.userStates)
this.$axios.post("/platform/welfare/list/mange/pageData", pageForm).then((res) => {
this.tableLoading = false
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
})
},
this.$axios
.post("/platform/welfare/list/mange/pageData", {
pageForm: JSON.stringify(this.pageForm)
})
.then((res) => {
this.tableData = res.data.list
this.pageForm.totalCount = res.data.totalCount
})
.finally(() => {
this.tableLoading = false
})
}
},
async created() {
this.getWelfareList()
this.unionList = await this.$businessTool.listUnion()
this.unitList = await this.$businessTool.listUnit()
this.unionOptions = await this.$businessTool.listUnion()
this.unitOptions = await this.$businessTool.listUnit()
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -2,230 +2,114 @@
layout("/layouts/platform_h5.html"){
#-->
<style>
.van-card {
background: transparent;
/* 列表卡片样式 */
.wf-welfare-list {
padding: 10px;
}
.address-cell .van-cell__title {
width: 0 !important;
}
.van-cell-group--inset {
margin: 10px 16px !important;
.wf-welfare-card {
position: relative;
background: #fff;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
.logistics_cell {
/* 左右布局容器 */
.wf-card-layout {
display: flex;
padding: 15px;
}
/* 左侧图片容器 */
.wf-card-img-container {
width: 120px;
height: 120px;
flex-shrink: 0;
margin-right: 15px;
}
/* 右侧信息容器 */
.wf-card-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.logistics_cell .van-step__title {
text-align: left;
}
.logistics_cell .van-step__title h3 {
margin: 0;
font-weight: normal;
font-size: inherit;
}
.evaluateForm .evaluateTextField .van-field__label {
margin-right: 0;
}
.evaluateForm .evaluateTextField .van-field__value textarea {
padding: 10px;
background-color: #f3f3f3;
}
.van-action-sheet__header {
/* 标题样式 */
.wf-card-heading {
font-size: 16px;
font-weight: bold;
margin-bottom: 8px;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
.courierNumberSheet .van-empty {
position: relative;
left: unset !important;
top: unset !important;
transform: unset !important;
/* 时间信息样式 */
.wf-time-row {
font-size: 14px;
color: #666;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
.wf-time-label {
color: #999;
display: inline-block;
width: 70px;
}
</style>
<div id="app" v-cloak>
<div>
<van-sticky>
<van-nav-bar
@click-left="()=>this.$pjaxReplace('/platform/h5/home')"
left-arrow
left-text="返回"
placeholder
title="我的福利"
></van-nav-bar>
<van-dropdown-menu>
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<van-sticky>
<van-nav-bar @click-left="()=>this.$pjaxReplace('/platform/h5/home')" left-arrow left-text="返回" placeholder title="我的福利"></van-nav-bar>
<van-dropdown-menu>
<year-van-dropdown-item :num="5" @change="doSearch" v-model="pageForm.year"></year-van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<div>
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
<div class="table-list">
<div :key="row.id" class="table-card" v-for="row in tableData">
<van-tag :type="row.isChoose?'success':''" mark style="position: absolute; left: 5px; top: 5px; z-index: 1">
{{row.isChoose?'已选择':'未选择'}}
</van-tag>
<div>
<van-image :src="row.cover" fit="cover" height="200" v-if="row.cover" width="100%"></van-image>
<van-image src="/assets/mobile/svg/welfare/welfareHome.svg" style="width: 88px; height: 88px" v-else></van-image>
<div>
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
<div class="wf-welfare-list">
<div class="wf-welfare-card" v-for="row in tableData" :key="row.id" @click="openView(row)">
<van-tag mark :type="row.isChoose?'success':''" style="position: absolute; left: 5px; top: 5px; z-index: 1">
{{row.isChoose?'已选择':'未选择'}}
</van-tag>
<div class="wf-card-layout">
<div class="wf-card-img-container">
<van-image :src="row.cover" fit="cover" width="100%" height="100%" radius="4"></van-image>
</div>
<div class="wf-card-content">
<div class="wf-card-heading">{{row.name}}</div>
<div class="wf-time-row">
<span class="wf-time-label">开始时间:</span>
{{row.choiceTimeStart}}
</div>
<div class="wf-time-row">
<span class="wf-time-label">结束时间:</span>
{{row.choiceTimeEnd}}
</div>
</div>
<van-cell>
<template slot="title">
<div class="flex-align">
<span class="font-size3 bold">{{row.name}}</span>
</div>
</template>
</van-cell>
<template v-if="row.gifts">
<van-cell :key="gift.name" :title="gift.name" v-for="gift in row.gifts">
<template #right-icon>x{{gift.num}}</template>
</van-cell>
</template>
<van-cell class="table-card-footer">
<van-button @click="openEvaluate(row)" plain round size="small" type="primary">评价商品</van-button>
<van-button @click="openView(row)" plain round size="small" type="primary">查看详情</van-button>
</van-cell>
</div>
</div>
</van-list>
<van-empty image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据" v-else></van-empty>
</div>
<van-action-sheet title="查看详情" v-model="descPopup">
<div class="van-cell-group--inset">
<van-cell>
<template #title>
<div style="font-weight: bold; font-size: 15px">已选福利</div>
</template>
</van-cell>
<van-cell style="padding: 0">
<van-card
:key="item.id"
:num="item.selectNum"
:thumb="item.imgUrl"
:title="item.optionName"
style="border-radius: 8px; background: #ffffff"
v-for="item in selectedOptions"
>
<template #desc>
<div>{{item.supplier}}</div>
<div>{{item.simpleDesc}}</div>
</template>
</van-card>
</van-cell>
</div>
<!--邮寄到家 填写收货地址-->
<div class="van-cell-group--inset" v-if="provideMode===3">
<van-cell>
<template #title>
<div style="font-weight: bold; font-size: 15px">收货地址</div>
</template>
</van-cell>
<van-field readonly rows="3" type="textarea" v-model="receiveAddress"></van-field>
</div>
<!--电子签字-->
<div class="van-cell-group--inset" v-if="signMode===2">
<van-cell>
<template #title>
<div style="font-weight: bold; font-size: 15px">电子签名</div>
</template>
</van-cell>
<van-cell title="">
<template #label>
<van-image :src="userSign" style="width: 100%; height: 150px; border: 1px dashed"></van-image>
</template>
</van-cell>
</div>
</van-action-sheet>
<!--评价-->
<van-action-sheet title="评价" v-model="evaluatePopup">
<div style="margin-top: 20px">
<van-radio-group v-model="evaluateFormData.optionId">
<van-cell-group>
<van-cell :key="item.selectOptionId" @click="optionIdClick(item.selectOptionId)" clickable v-for="item in selectedOptions">
<template #title>
{{item.optionName}}
<span style="color: red" v-if="!item.isPj">未评价</span>
</template>
<template #right-icon>
<van-radio :name="item.selectOptionId"></van-radio>
</template>
</van-cell>
</van-cell-group>
</van-radio-group>
</div>
<div class="evaluateForm">
<div style="text-align: center; margin: 20px 0; font-size: 20px; color: #f18d8d; font-weight: bold">您的评价让我们做的更好</div>
<div style="display: flex; justify-content: center; flex-direction: column; align-items: center">
<div style="text-align: center; font-size: 13px; color: rgb(139 134 134)">为本次福利打分</div>
<van-rate
:gutter="10"
:readonly="evaluateFormData.id?true:false"
:size="40"
color="#ffd21e"
v-model="evaluateFormData.evaluateScore"
void-color="#eee"
void-icon="star"
></van-rate>
</div>
<van-field
:readonly="evaluateFormData.id?true:false"
autosize
class="evaluateTextField"
label="评价"
label-width="0"
maxlength="100"
placeholder="请输入评价"
rows="5"
type="textarea"
v-model="evaluateFormData.evaluateText"
>
<div slot="label"></div>
</van-field>
</div>
<div style="padding: 10px 16px">
<van-button @click="doSubmitEvaluate" block type="primary" v-if="!evaluateFormData.id">提交</van-button>
<div style="display: flex; align-items: center; color: #52c41a; justify-content: center; font-size: 20px" v-else>
<svg
class="icon"
height="32"
p-id="2914"
t="1715150529722"
version="1.1"
viewBox="0 0 1024 1024"
width="32"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M596.48 113.024a142.848 142.848 0 0 0-169.024 0l-49.472 36.288a62.848 62.848 0 0 1-27.648 11.52l-60.8 9.28a142.848 142.848 0 0 0-119.424 119.488l-9.344 60.8a62.848 62.848 0 0 1-11.52 27.648l-36.224 49.472a142.848 142.848 0 0 0 0 169.088l36.288 49.472a62.336 62.336 0 0 1 11.456 27.648l9.344 60.672a142.848 142.848 0 0 0 119.488 119.488l60.672 9.344a62.656 62.656 0 0 1 27.648 11.52l49.472 36.224a142.848 142.848 0 0 0 169.088 0l49.472-36.288a62.4 62.4 0 0 1 27.648-11.52l60.672-9.28a142.912 142.912 0 0 0 119.552-119.552l9.344-60.672a62.656 62.656 0 0 1 11.52-27.648l36.224-49.472a142.848 142.848 0 0 0 0-169.088l-36.288-49.472a62.848 62.848 0 0 1-11.456-27.648l-9.28-60.8a142.848 142.848 0 0 0-119.488-119.424l-60.672-9.344a62.912 62.912 0 0 1-27.648-11.52l-49.536-36.224zM474.88 177.472a62.72 62.72 0 0 1 74.368 0l49.472 36.288c18.56 13.632 40.128 22.528 62.976 26.048l60.544 9.28a62.848 62.848 0 0 1 52.672 52.672l9.28 60.608c3.52 22.784 12.416 44.352 26.048 62.976l36.288 49.408a62.72 62.72 0 0 1 0 74.368l-36.288 49.472c-13.632 18.56-22.592 40.192-26.048 62.976l-9.28 60.608a62.848 62.848 0 0 1-52.672 52.608l-60.608 9.28a142.784 142.784 0 0 0-62.976 26.112l-49.408 36.224a62.72 62.72 0 0 1-74.368 0l-49.472-36.224a142.784 142.784 0 0 0-62.976-26.112l-60.544-9.28a62.784 62.784 0 0 1-52.672-52.608l-9.28-60.672a142.848 142.848 0 0 0-26.112-62.912l-36.224-49.472a62.848 62.848 0 0 1 0-74.368l36.224-49.472a142.72 142.72 0 0 0 26.112-62.912l9.28-60.608a62.848 62.848 0 0 1 52.672-52.672l60.608-9.28c22.784-3.456 44.352-12.416 62.912-26.048l49.472-36.288z m212.096 269.44A40 40 0 0 0 630.4 390.4L458.688 562.112 393.6 497.088a40 40 0 0 0-56.576 56.512l93.376 93.312a40 40 0 0 0 56.512 0l200-200z"
fill="#52C41A"
p-id="2915"
></path>
</svg>
评价完成
</div>
</div>
</van-action-sheet>
</van-list>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
</div>
<select-view ref="selectViewRef"></select-view>
</div>
<script>
<!--#include('selectView.js'){}#-->
new Vue({
el: "#app",
store,
components: {
"select-view": selectView
},
data() {
return {
tableData: [],
@@ -237,32 +121,7 @@ layout("/layouts/platform_h5.html"){
totalCount: 0,
year: new Date().getFullYear()
},
yearList: [],
selectedOptions: [],
provideMode: null,
signMode: null,
descPopup: false,
evaluatePopup: false,
evaluateFormData: {}
}
},
computed: {
receiveAddress() {
if (this.selectedOptions && this.selectedOptions.length > 0) {
return this.selectedOptions[0].receiveAddress
}
return null
},
userSign() {
if (this.selectedOptions && this.selectedOptions.length > 0) {
return this.selectedOptions[0].userSign
}
return null
yearList: []
}
},
methods: {
@@ -294,68 +153,7 @@ layout("/layouts/platform_h5.html"){
return resp
},
async openView(item) {
const { projectId, provideMode, signMode } = item
this.provideMode = provideMode
this.signMode = signMode
const { code, data, msg } = await this.getUserSelection(projectId)
if (code === 0) {
if (data.length === 0) {
this.$toast("您还没有选择福利,请先到职工福利->福利列表下选择")
return
}
this.descPopup = true
this.selectedOptions = data
}
},
//打开评价
async openEvaluate(item) {
/* if (!item.courierNumber) {
this.$toast("收货后才能评价")
return
}*/
const resp = await this.getUserSelection(item.projectId)
this.selectedOptions = resp.data
if (this.selectedOptions && this.selectedOptions.length > 0) {
await this.finOneWelfareEvaluate(item.id, this.selectedOptions[0].selectOptionId)
}
this.evaluatePopup = true
},
async finOneWelfareEvaluate(projectId, optionId) {
const { data, code, msg } = await this.$axios.post("/platform/welfare/mine/finOneWelfareEvaluate", {
projectId: projectId,
optionId: optionId
})
if (code === 0) {
if (data) {
this.evaluateFormData = data
} else {
this.evaluateFormData = {
projectId: projectId,
optionId: optionId
}
}
} else {
this.$toast(msg)
}
},
//评价
async doSubmitEvaluate() {
if (!this.evaluateFormData.evaluateScore) {
this.$modal.msg("请为本次福利评分")
return
}
const { code, data, msg } = await $.post("/platform/welfare/mine/doEvaluate", this.evaluateFormData)
if (code === 0) {
this.$toast.success("评价成功")
this.evaluatePopup = false
} else {
this.$toast.fail(msg)
}
},
optionIdClick(selectOptionId) {
this.$set(this.evaluateFormData, "optionId", selectOptionId)
this.finOneWelfareEvaluate(this.evaluateFormData.projectId, selectOptionId)
this.$refs.selectViewRef.onOpen(item.id)
}
},
created() {
@@ -0,0 +1,512 @@
const selectView = {
template: /*language=HTML*/ `
<van-action-sheet
v-model="visible"
:title="'我的福利选择'"
close-icon="close"
safe-area-inset-bottom
@close="handleClose"
:overlay-class="detailVisible ? 'no-overlay' : ''"
>
<div class="welfare-view">
<!-- 内容区域 -->
<div class="welfare-view__content">
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
<van-skeleton title :row="6" :loading="loading" animated>
<!-- 项目基本信息 -->
<div class="welfare-card">
<div class="welfare-card__header">
<i class="el-icon-s-flag"></i>
<span>项目基本信息</span>
</div>
<div class="welfare-card__content">
<div class="info-row">
<div class="info-row__label">项目名称</div>
<div class="info-row__value">{{ projectInfo.name }}</div>
</div>
<div class="info-row info-row--time">
<div class="info-row__label">选择时间</div>
<div class="info-row__value">
<div class="time-item time-item--start">{{ projectInfo.choiceTimeStart }}</div>
<div class="time-item time-item--end">{{ projectInfo.choiceTimeEnd }}</div>
</div>
</div>
<div class="info-row info-row--time">
<div class="info-row__label">发放时间</div>
<div class="info-row__value">
<div class="time-item time-item--start">{{ projectInfo.provideTimeStart }}</div>
<div class="time-item time-item--end">{{ projectInfo.provideTimeEnd }}</div>
</div>
</div>
<div class="info-row">
<div class="info-row__label">发放地点</div>
<div class="info-row__value">{{ projectInfo.provideAddress || '暂无' }}</div>
</div>
</div>
</div>
<!-- 联系信息 -->
<div class="welfare-card">
<div class="welfare-card__header">
<i class="el-icon-user"></i>
<span>联系信息</span>
</div>
<div class="welfare-card__content">
<div class="info-row">
<div class="info-row__label">联系电话</div>
<div class="info-row__value">{{ mergedSelections[0]?.mobile || '暂无' }}</div>
</div>
</div>
</div>
<!-- 我的选择 -->
<div class="selections-container">
<div class="welfare-card">
<div class="welfare-card__header">
<i class="el-icon-shopping-cart-full"></i>
<span>我的选择</span>
</div>
<div v-if="mergedSelections.length > 0" class="selection-list">
<div class="selection-item"
v-for="item in mergedSelections"
:key="item.id"
@click="showOptionDetail(item)">
<div class="selection-item__image">
<img :src="item.imgUrl || '/static/images/default-welfare.png'"
alt="福利图片"
@error="handleImageError">
</div>
<div class="selection-item__content">
<div class="selection-item__name">{{ item.optionName }}</div>
<div class="selection-item__meta">
<div class="selection-item__count">
<i class="el-icon-shopping-cart-2"></i> {{ item.selectNum }}
</div>
<div class="selection-item__time">
<i class="el-icon-time"></i> {{ formatDate(item.selectTime) }}
</div>
</div>
</div>
<div class="selection-item__arrow">
<i class="el-icon-arrow-right"></i>
</div>
</div>
</div>
<div v-else class="empty-state">
<i class="el-icon-warning-outline"></i>
<span>您还未选择任何福利项目</span>
</div>
</div>
</div>
</van-skeleton>
</van-pull-refresh>
</div>
<!-- 选项详情弹窗 -->
<van-action-sheet
v-model="detailVisible"
:title="currentOption?.optionName || '福利详情'"
close-icon="close"
safe-area-inset-bottom
@close="closeDetail"
:z-index="2001"
>
<div class="welfare-detail" v-if="currentOption">
<van-skeleton title :row="10" :loading="descLoading" animated>
<div class="welfare-detail__content rich-text" v-html="currentOption.description || '暂无详细说明'"></div>
</van-skeleton>
</div>
</van-action-sheet>
</div>
</van-action-sheet>
`,
data() {
return {
visible: false,
projectId: null,
loading: false,
refreshing: false,
descLoading: false,
projectInfo: {
name: "",
choiceTimeStart: "",
choiceTimeEnd: "",
provideTimeStart: "",
provideTimeEnd: "",
provideAddress: "",
options: []
},
selectedOptions: [],
detailVisible: false,
currentOption: null
}
},
computed: {
mergedSelections() {
return this.selectedOptions.map((item) => {
const option = this.projectInfo.options?.find((opt) => opt.id === item.selectOptionId) || {}
return {
...item,
optionName: option.optionName || "未知选项",
imgUrl: option.imgUrl,
description: option.description
}
})
}
},
methods: {
onOpen(id) {
this.projectId = id
this.visible = true
this.loadData()
},
handleClose() {
// 如果详情弹窗打开,先关闭详情弹窗
if (this.detailVisible) {
this.closeDetail()
return
}
// 否则关闭整个组件
this.$emit("close")
},
async onRefresh() {
try {
await this.loadData()
} finally {
this.refreshing = false
}
},
async loadData() {
try {
this.loading = true
await Promise.all([this.getProjectInfo(), this.getUserSelections()])
} catch (error) {
console.error("加载数据失败:", error)
this.$toast && this.$toast("加载数据失败,请稍后重试")
} finally {
this.loading = false
}
},
async getProjectInfo() {
try {
const { code, data, msg } = await this.$axios.post("/platform/welfare/common/projectInfo", {
id: this.projectId
})
if (code === 0) {
this.projectInfo = data || this.projectInfo
} else {
console.warn("获取项目信息失败:", msg)
}
} catch (error) {
console.error("获取项目信息异常:", error)
throw error
}
},
async getUserSelections() {
try {
const { code, data, msg } = await this.$axios.post("/platform/welfare/userSelect/getUserSelection", { projectId: this.projectId })
if (code === 0) {
this.selectedOptions = data || []
} else {
console.warn("获取用户选择失败:", msg)
}
} catch (error) {
console.error("获取用户选择异常:", error)
throw error
}
},
showOptionDetail(option) {
this.descLoading = true
this.currentOption = option
this.detailVisible = true
// 短暂延迟后关闭加载状态,给内容渲染留出时间
setTimeout(() => {
this.descLoading = false
}, 300)
},
closeDetail() {
this.detailVisible = false
},
handleImageError(e) {
e.target.src = "/static/images/default-welfare.png"
},
formatDate(dateStr) {
if (!dateStr) return ""
try {
// 简化日期显示,只保留月-日 时:分
const date = new Date(dateStr.replace(/-/g, "/"))
return date.getMonth() + 1 + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes().toString().padStart(2, "0")
} catch (e) {
console.error("日期格式化错误:", e)
return dateStr
}
}
},
style: /*language=CSS*/ `
.welfare-view {
background: #f7f8fa;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
/* 内容区域样式 */
.welfare-view__content {
padding: 16px;
height: 100%;
}
/* 卡片通用样式 */
.welfare-card {
background: #fff;
border-radius: 8px;
margin-bottom: 12px;
overflow: hidden;
}
.welfare-card__header {
display: flex;
align-items: center;
padding: 16px;
position: relative;
}
.welfare-card__header::after {
content: '';
position: absolute;
left: 16px;
right: 16px;
bottom: 0;
height: 1px;
background: #f5f5f5;
transform: scaleY(0.5);
}
.welfare-card__header i {
font-size: 16px;
margin-right: 6px;
color: var(--color-primary);
}
.welfare-card__header span {
font-size: 15px;
font-weight: 500;
color: #323233;
}
.welfare-card__content {
padding: 16px;
}
/* 信息行样式 */
.info-row {
display: flex;
margin-bottom: 12px;
align-items: center;
}
.info-row:last-child {
margin-bottom: 0;
}
.info-row__label {
width: 70px;
color: #969799;
font-size: 14px;
flex-shrink: 0;
}
.info-row__value {
flex: 1;
color: #323233;
font-size: 14px;
min-width: 0;
}
.info-row--time {
align-items: flex-start;
}
.info-row--time .info-row__value {
display: flex;
flex-direction: column;
gap: 4px;
}
.time-item {
position: relative;
padding-left: 42px;
line-height: 20px;
}
.time-item--start::before {
content: "开始:";
position: absolute;
left: 0;
color: #969799;
font-size: 12px;
}
.time-item--end::before {
content: "结束:";
position: absolute;
left: 0;
color: #969799;
font-size: 12px;
}
/* 选择列表样式 */
.selections-container {
margin-bottom: 12px;
}
.selection-list {
padding: 8px 16px;
}
.selection-item {
display: flex;
align-items: center;
padding: 12px;
background: #fff;
position: relative;
border-radius: 8px;
margin-bottom: 12px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.selection-item:active {
background: #f8f9fa;
}
.selection-item:last-child {
margin-bottom: 0;
}
.selection-item__image {
width: 72px;
height: 72px;
margin-right: 12px;
border-radius: 6px;
overflow: hidden;
background: #f5f6f7;
flex-shrink: 0;
}
.selection-item__image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.selection-item__content {
flex: 1;
min-width: 0;
padding: 4px 0;
}
.selection-item__name {
font-size: 15px;
font-weight: 500;
color: #323233;
margin-bottom: 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.selection-item__meta {
display: flex;
align-items: center;
font-size: 13px;
color: #969799;
line-height: 1.4;
}
.selection-item__count {
display: flex;
align-items: center;
margin-right: 16px;
background: #f7f8fa;
padding: 4px 8px;
border-radius: 4px;
}
.selection-item__time {
display: flex;
align-items: center;
background: #f7f8fa;
padding: 4px 8px;
border-radius: 4px;
}
.selection-item__meta i {
margin-right: 4px;
font-size: 14px;
}
.selection-item__arrow {
color: #c8c9cc;
font-size: 16px;
padding: 0 0 0 12px;
}
/* 空状态样式 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
padding: 32px 16px;
color: #969799;
}
.empty-state__icon {
font-size: 48px;
margin-bottom: 8px;
}
/* 详情弹窗样式 */
.welfare-detail {
padding: 20px 16px;
max-height: 60vh;
overflow-y: auto;
-webkit-overflow-scrolling: touch;
}
.welfare-detail__content {
font-size: 14px;
line-height: 1.6;
color: #323233;
}
.rich-text {
overflow-x: hidden;
}
.rich-text img {
max-width: 100%;
height: auto;
margin: 8px 0;
border-radius: 4px;
}
.rich-text p {
margin: 8px 0;
}
/* 阻止嵌套 action-sheet 时的背景重叠 */
.no-overlay {
background-color: transparent !important;
}
`
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,154 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
/* 列表卡片样式 */
.wf-welfare-list {
padding: 10px;
}
.wf-welfare-card {
position: relative;
background: #fff;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
/* 左右布局容器 */
.wf-card-layout {
display: flex;
padding: 15px;
}
/* 左侧图片容器 */
.wf-card-img-container {
width: 120px;
height: 120px;
flex-shrink: 0;
margin-right: 15px;
}
/* 右侧信息容器 */
.wf-card-content {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* 标题样式 */
.wf-card-heading {
font-size: 16px;
font-weight: bold;
margin-bottom: 8px;
color: #333;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
/* 时间信息样式 */
.wf-time-row {
font-size: 14px;
color: #666;
margin-bottom: 5px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
}
.wf-time-label {
color: #999;
display: inline-block;
width: 70px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="()=>this.$pjaxReplace('/platform/h5/home')" left-arrow left-text="返回" placeholder title="福利列表"></van-nav-bar>
<van-dropdown-menu>
<year-van-dropdown-item :num="10" v-model="pageForm.year" @change="doSearch"></year-van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<div>
<van-list :finished="finished" @load="pageData" finished-text="没有更多了" v-if="tableData.length>0" v-model="loading">
<div class="wf-welfare-list">
<div class="wf-welfare-card" v-for="row in tableData" :key="row.id" @click="openChoose(row)">
<van-tag mark :type="row.isChoose?'success':''" style="position: absolute; left: 5px; top: 5px; z-index: 1">
{{row.isChoose?'已选择':'未选择'}}
</van-tag>
<div class="wf-card-layout">
<div class="wf-card-img-container">
<van-image :src="row.cover" fit="cover" width="100%" height="100%" radius="4"></van-image>
</div>
<div class="wf-card-content">
<div class="wf-card-heading">{{row.name}}</div>
<div class="wf-time-row">
<span class="wf-time-label">开始时间:</span>
{{row.choiceTimeStart}}
</div>
<div class="wf-time-row">
<span class="wf-time-label">结束时间:</span>
{{row.choiceTimeEnd}}
</div>
</div>
</div>
</div>
</div>
</van-list>
<van-empty v-else image="/assets/platform/plugins/vant-green/images/nodata/nodata.png" description="暂无数据"></van-empty>
</div>
</div>
<script>
new Vue({
el: "#app",
data() {
return {
tableData: [],
finished: false,
loading: false,
pageForm: {
pageNumber: 1,
pageSize: 5,
totalCount: 0,
year: new Date().getFullYear()
}
}
},
methods: {
doSearch() {
this.tableKey = new Date().getTime()
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.tableData = []
this.pageData()
},
pageData() {
this.loading = true
this.$axios.post("/platform/welfare/userSelect/pageData", this.pageForm).then((res) => {
this.tableData = this.tableData.concat(res.data.list)
if (this.tableData.length === res.data.totalCount) {
this.finished = true
} else {
this.pageForm.pageNumber++
}
this.pageForm.totalCount = res.data.totalCount
this.loading = false
})
},
async openChoose(row) {
this.$pjaxReplace("/platform/h5/welfare/userSelect/index?id=" + row.id)
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,111 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.success-container {
min-height: 100vh;
background-color: #f7f8fa;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 20px;
box-sizing: border-box;
}
.success-icon {
margin-top: 80px;
width: 120px;
height: 120px;
border-radius: 60px;
background: #fff;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 16px rgba(25, 137, 250, 0.15);
}
.success-icon .van-icon {
font-size: 60px;
color: #07c160;
}
.success-title {
margin-top: 30px;
font-size: 22px;
font-weight: 600;
color: #333;
}
.success-desc {
margin-top: 16px;
font-size: 15px;
color: #666;
text-align: center;
line-height: 1.6;
}
.button-group {
margin-top: 50px;
width: 100%;
padding: 0 20px;
box-sizing: border-box;
}
.back-btn {
width: 100%;
height: 44px;
font-size: 16px;
border-radius: 22px;
}
.home-btn {
margin-top: 12px;
width: 100%;
height: 44px;
font-size: 16px;
border-radius: 22px;
}
</style>
<div id="app" v-cloak>
<div class="success-container">
<div class="success-icon">
<van-icon name="checked" />
</div>
<div class="success-title">选择成功</div>
<div class="success-desc">
您的福利选择已提交成功!
<br />
请在选择时间截止前,您仍可以重新选择并修改。
<br />
请留意系统通知,了解福利发放信息。
</div>
<div class="button-group">
<van-button type="primary" class="back-btn" @click="goToList">查看我的福利</van-button>
<van-button type="default" class="home-btn" @click="goToHome">返回首页</van-button>
</div>
</div>
</div>
<script>
new Vue({
el: "#app",
data() {
return {}
},
methods: {
goToList() {
this.$pjaxReplace("/platform/h5/welfare/mine/list")
},
goToHome() {
this.$pjaxReplace("/platform/h5/home")
}
}
})
</script>
<!--#
}
#-->
@@ -140,14 +140,14 @@ layout("/layouts/platform_h5.html"){
class="van-cell-group--inset"
style="margin: 10px auto"
v-if="projectInfo.flexible && [2,3].includes(projectInfo.provideMode)
&& projectInfo.welfareProjectSubjects
&& projectInfo.welfareProjectSubjects.length>0"
&& projectInfo.options
&& projectInfo.options.length>0"
>
<van-cell>
<div style="font-weight: bold; font-size: 15px; display: flex; align-items: center">选择套餐</div>
</van-cell>
<div :key="subject.id" v-for="(subject,subjectIndex) in projectInfo.welfareProjectSubjects" style="margin-bottom: 30px">
<div style="margin-bottom: 30px">
<div>
<van-text-box
:content="option.supplier"
@@ -156,7 +156,7 @@ layout("/layouts/platform_h5.html"){
:title="option.optionName"
sub-title=" "
type="5"
v-for="(option, optionIndex) in subject.options"
v-for="(option, optionIndex) in projectInfo.options"
>
<template #tip>
<span @click="openViewDesc(option.description)">查看详情</span>
@@ -358,49 +358,37 @@ layout("/layouts/platform_h5.html"){
}
return true
},
getWelfareInfo(id) {
const loading = this.$toast.loading({
message: "加载中...",
forbidClick: true,
overlay: true,
duration: 0
})
this.$axios.post("/platform/welfare/project/mange/findOne", { id: id }).then((res) => {
getWelfareInfo() {
this.$axios.post("/platform/welfare/project/mange/findOne", { id: this.projectId }).then((res) => {
if (res.code === 0) {
setTimeout(() => {
res.data.multiSelectNum = res.data.multiSelectNum ? res.data.multiSelectNum : 1
this.projectInfo = res.data
this.getUserSelection(this.$store.state.user.id)
loading.close()
}, 500)
this.projectInfo = res.data
} else {
loading.close()
this.$toast(res.msg)
this.$toast.fail(res.msg)
}
})
},
getUserSelection(id) {
this.$axios
.post("/platform/welfare/mine/getUserSelection", {
projectId: this.projectInfo.id,
userId: id
})
.then((resp) => {
// 获取用户选择的数据
getUserSelection() {
this.$axios.post("/platform/welfare/userChoose/getUserSelection", { projectId: this.projectInfo.id }).then((resp) => {
if (resp.code === 0) {
this.userSelection = resp.data
this.echoUserSelection()
})
} else {
this.$toast(resp.msg)
}
})
},
//回显用户选择的数据
echoUserSelection() {
//获取用户当前选择的数量
this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
const option = this.userSelection.find((x) => x.selectOptionId === v.id)
if (option) {
v.selectNum = option.selectNum
} else {
v.selectNum = 0
}
})
// this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
// const option = this.userSelection.find((x) => x.selectOptionId === v.id)
// if (option) {
// v.selectNum = option.selectNum
// } else {
// v.selectNum = 0
// }
// })
},
//查看详情
openViewDesc(desc) {
@@ -551,9 +539,11 @@ layout("/layouts/platform_h5.html"){
}
},
async created() {
const id = GetQueryString("id")
if (id) {
this.getWelfareInfo(id)
this.projectId = GetQueryString("id")
if (this.projectId) {
this.getWelfareInfo()
this.getUserSelection()
this.welfareProvideMode = await this.$businessTool.getDictOptions("welfareProvideMode")
this.welfareProvideMode.map((v) => {
v.code = Number(v.code)
@@ -2,7 +2,52 @@
layout("/layouts/platform_h5.html"){
#-->
<style></style>
<style>
.table-card {
position: relative;
background: #fff;
border-radius: 8px;
margin-bottom: 15px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
}
/* 左右布局容器 */
.card-content {
display: flex;
padding: 15px;
}
/* 左侧图片容器 */
.card-image {
width: 120px;
height: 120px;
flex-shrink: 0;
margin-right: 15px;
}
/* 右侧信息容器 */
.card-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
/* 标题样式 */
.card-title {
font-size: 16px;
font-weight: bold;
margin-bottom: 8px;
color: #333;
}
/* 时间信息样式 */
.time-info {
font-size: 14px;
color: #666;
margin-bottom: 5px;
}
.time-label {
color: #999;
margin-right: 5px;
}
</style>
<div id="app" v-cloak>
<van-sticky>
@@ -19,19 +64,22 @@ layout("/layouts/platform_h5.html"){
<van-tag mark :type="row.isChoose?'success':''" style="position: absolute; left: 5px; top: 5px; z-index: 1">
{{row.isChoose?'已选择':'未选择'}}
</van-tag>
<van-image :src="row.cover" fit="cover" height="200" width="100%"></van-image>
<van-cell>
<template slot="title">
<div class="flex-align">
<span class="font-size3 bold">{{row.name}}</span>
<div class="card-content">
<div class="card-image">
<van-image :src="row.cover" fit="cover" width="100%" height="100%" radius="4"></van-image>
</div>
<div class="card-info">
<div class="card-title">{{row.name}}</div>
<div class="time-info">
<span class="time-label">开始时间:</span>
{{row.choiceTimeStart}}
</div>
</template>
</van-cell>
<van-cell title="开始时间" :value="row.choiceTimeStart"></van-cell>
<van-cell title="结束时间" :value="row.choiceTimeEnd"></van-cell>
<van-cell class="table-card-footer">
<!-- <van-button @click="openChoose(o)" size="middle" type="primary" round>查看</van-button>-->
</van-cell>
<div class="time-info">
<span class="time-label">结束时间:</span>
{{row.choiceTimeEnd}}
</div>
</div>
</div>
</div>
</div>
</van-list>