微信支付、福利

This commit is contained in:
Paidax
2025-03-10 09:40:09 +08:00
parent d5a8dd7534
commit 0d3bafb328
46 changed files with 2489 additions and 1435 deletions
+12 -2
View File
@@ -47,7 +47,7 @@ jdbc.defaultAutoCommit=true
xsssql.ignore.urls=/platform/cms/content/article/addDo,/platform/sys/app/conf/addDo,/platform/sys/app/conf/editDo,\
/platform/member/change/mange/userPageData,/platform/welfare/member/mange/userPageData,/platform/sys/task/cronExp,\
/platform/sys/task/editDo,/platform/sys/task/addDo,/platform/fellowship/manage/activity/doHandle,/platform/sys/menu/editMenuDo,\
/platform/trainSingUp/manage/activity/doHandle
/platform/trainSingUp/manage/activity/doHandle,/platform/activity/school/info/mange/doAdd,/platform/activity/school/info/mange/doEdit
#环境 dev/prod
v.environment=dev
v.loginUrl=/sso/login
@@ -78,7 +78,7 @@ shiro.url.login=/platform
shiro.url.logout_redirect=/platform
shiro.url.unauth=/platform
#开发时设置本地路径,便于调试
beetl.RESOURCE.rootLocal=G:/zhgh/zhgh_hrbnu/src/main/resources/views/
beetl.RESOURCE.rootLocal=G:/zhgh/ /src/main/resources/views/
beetl.RESOURCE.root=views/
beetl.DELIMITER_STATEMENT_START=<!--#
beetl.DELIMITER_STATEMENT_END=#-->
@@ -143,5 +143,15 @@ logback.exts.loglevel.enabled=true
#心跳间隔(单位:秒)
logback.exts.loglevel.heartbeat=15
wxpay.appId=\u5E94\u7528\u7F16\u53F7
wxpay.keyPath=key.pem
wxpay.certPath=cert.pem
wxpay.certP12Path=cert.p12
wxpay.platformCertPath=wx_cert.pem
wxpay.mchId=\u5FAE\u4FE1\u5546\u6237\u53F7
wxpay.apiKey3=Api-v3 \u5BC6\u94A5
wxpay.apiKey=Api \u5BC6\u94A5
wxpay.domain=https://ijpay.javen.com
+2 -2
View File
@@ -32,9 +32,9 @@
<logger name="org.quartz" level="INFO"/>
<logger name="org.nutz" level="DEBUG"/>
<root level="DEBUG">
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="ASYNC" />
</root>
</configuration>
</configuration>
@@ -84,8 +84,17 @@ module.exports = {
clearInterval(signatureInterval)
const ts = new Date().getTime() + (Math.floor(Math.random() * (1000 - 1 + 1)) + 1).toString()
console.log(ts)
// this.postAddress = location.protocol + '//' + location.host + '/signature?prefix=' + this.prefix + '&id=' + ts + "&is_value_base64=" + this.is_value_base64
this.postAddress = "https://zhgh.hrbnu.edu.cn/signature?prefix=" + this.prefix + "&id=" + ts + "&is_value_base64=" + this.is_value_base64
this.postAddress =
location.protocol +
"//" +
location.host +
"/signature?prefix=" +
this.prefix +
"&id=" +
ts +
"&is_value_base64=" +
this.is_value_base64
// this.postAddress = "https://zhgh.hrbnu.edu.cn/signature?prefix=" + this.prefix + "&id=" + ts + "&is_value_base64=" + this.is_value_base64
this.showQrCode = true
@@ -101,7 +101,6 @@
<script src="${base!}/assets/platform/js/offscreen.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/vue-echarts@4.0.2"></script>-->
<script src="${base!}/assets/platform/plugins/vue-charts/echartTheme.js"></script>
<script src="${base!}/assets/platform/js/chengSh.js"></script>
<!--拖拽js-->
<script src="${base!}/assets/platform/js/directive/v-sticky.js"></script>
@@ -109,6 +108,7 @@
<script src="${base!}/assets/platform/js/jr-qrcode.js"></script>
<!--字典混入-->
<script src="${base!}/assets/platform/js/chengSh.js"></script>
<script src="${base!}/components/plugins/sysDict/DictData.js"></script>
<script src="${base!}/assets/platform/js/util/commonUtil.js"></script>
@@ -0,0 +1,16 @@
<!--#
layout("/mobile/platform.html"){
#-->
<div id="app" v-cloak></div>
<script>
new Vue({
el: "#app",
mixins: [mobileMixins],
data() {
return {}
}
})
</script>
<!--#
}
#-->
@@ -16,11 +16,13 @@ layout("/mobile/platform.html"){
border-bottom: 1px dashed lightgrey;
}
.selection .van-checkbox-group .van-cell, .selection .van-radio-group .van-cell {
.selection .van-checkbox-group .van-cell,
.selection .van-radio-group .van-cell {
flex-direction: row-reverse;
}
.selection .van-checkbox-group .van-cell .van-cell__title, .selection .van-radio-group .van-cell .van-cell__title {
.selection .van-checkbox-group .van-cell .van-cell__title,
.selection .van-radio-group .van-cell .van-cell__title {
padding-left: 20px;
}
@@ -41,7 +43,6 @@ layout("/mobile/platform.html"){
}
.van-collapse-item .van-collapse-item__title {
}
.selection .van-radio {
@@ -59,7 +60,9 @@ layout("/mobile/platform.html"){
height: 80px;
}
.welfare_img .van-image__error, .welfare_img .van-image__img, .welfare_img .van-image__loading {
.welfare_img .van-image__error,
.welfare_img .van-image__img,
.welfare_img .van-image__loading {
border-radius: 10px;
margin-left: -35px;
}
@@ -115,7 +118,7 @@ layout("/mobile/platform.html"){
padding-left: 20px;
padding-right: 10px;
position: relative;
height: 100px
height: 100px;
}
.optionDesc {
@@ -132,142 +135,143 @@ layout("/mobile/platform.html"){
border: 1pt solid #000000 !important;
}
.van-submit-bar__button {
width: 150px;
}
.custom-cell {
font-size: 18px;
font-weight: bold;
}
</style>
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar @click-left="history.go(-1)" left-arrow
title="福利详情"></van-nav-bar>
<van-nav-bar @click-left="history.go(-1)" left-arrow title="福利详情"></van-nav-bar>
</van-sticky>
<template v-show="vLoading && !vLoading.value">
<div>
<van-image :src="CREATE_PREVIEW_URL(projectInfo.cover)"
fit="cover"
style="width: 100%;height: 150px"></van-image>
<van-image :src="CREATE_PREVIEW_URL(projectInfo.cover)" fit="cover" style="width: 100%; height: 150px"></van-image>
</div>
<!--基本信息-->
<van-cell-group class="van-cell-group--inset">
<van-cell>
<div style="font-weight: bold;font-size: 15px;display: flex;align-items: center">
福利信息
<div style="font-weight: bold; font-size: 15px; display: flex; align-items: center; justify-content: space-between">
<div>
<span>福利信息</span>
</div>
<div @click="clickUpOrDown=!clickUpOrDown">
<span>{{clickUpOrDown ? '点击收起' : '点击展开'}}</span>
<van-icon :name="clickUpOrDown?'arrow-up':'arrow-down'"></van-icon>
</div>
</div>
</van-cell>
<van-cell :border="false" :value="projectInfo.name" title="福利名称"></van-cell>
<van-cell :border="false" :value="projectInfo.festival" title="发放节日"></van-cell>
<van-cell :border="false" :value="projectInfo.gift" title="福利礼品"
v-if="!projectInfo.flexible"></van-cell>
<!--<van-cell :border="false" :value="projectInfo.provideAddress"
title="发放地点"></van-cell>-->
<van-cell :border="false" title="选择形式">
{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}
</van-cell>
<van-cell :border="false" :value="projectInfo.multiSelectNum" title="最多选几个"
v-if="projectInfo.isCheckBox==='checkBox'"></van-cell>
<van-cell :border="false" title="发放形式">
<template>
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="签收形式">
<template>
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) &&
welfareSignMode.find(v=>v.code==projectInfo.signMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="选择时间">
<template #label>
{{projectInfo.choiceTimeStart + ' 至 ' + projectInfo.choiceTimeEnd}}
</template>
</van-cell>
<template v-if="clickUpOrDown">
<van-cell :border="false" :value="projectInfo.name" title="福利名称"></van-cell>
<van-cell :border="false" :value="projectInfo.festival" title="发放节日"></van-cell>
<van-cell :border="false" :value="projectInfo.gift" title="福利礼品" v-if="!projectInfo.flexible"></van-cell>
<!--<van-cell :border="false" :value="projectInfo.provideAddress"
title="发放地点"></van-cell>-->
<van-cell :border="false" title="选择形式">{{projectInfo.isCheckBox==='checkBox'?'多选':'单选'}}</van-cell>
<van-cell
:border="false"
:value="projectInfo.multiSelectNum"
title="最多选几个"
v-if="projectInfo.isCheckBox==='checkBox'"
></van-cell>
<van-cell :border="false" title="发放形式">
<template>
{{welfareProvideMode.find(v=>v.code==projectInfo.provideMode) &&
welfareProvideMode.find(v=>v.code==projectInfo.provideMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="签收形式">
<template>
{{welfareSignMode.find(v=>v.code==projectInfo.signMode) && welfareSignMode.find(v=>v.code==projectInfo.signMode).description}}
</template>
</van-cell>
<van-cell :border="false" title="选择时间">
<template #label>{{projectInfo.choiceTimeStart + ' 至 ' + projectInfo.choiceTimeEnd}}</template>
</van-cell>
</template>
</van-cell-group>
<!--礼品套餐-->
<div class="van-cell-group--inset"
style="margin:10px auto"
v-if="projectInfo.flexible && [2,3].includes(projectInfo.provideMode)
<div
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.welfareProjectSubjects.length>0"
>
<van-cell>
<div style="font-weight: bold;font-size: 15px;display: flex;align-items: center">
选择套餐
</div>
<div style="font-weight: bold; font-size: 15px; display: flex; align-items: center">选择套餐</div>
</van-cell>
<div class="selection" style="background: #FFF"
v-for="(subject,sidx) in projectInfo.welfareProjectSubjects">
<div style="display: flex;width: 100%;padding: 10px 0"
v-for="(option, oidx) in subject.options">
<div style="width: 120px;height: 100px;display: flex;justify-content: center;align-items: center">
<van-image :src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+option.imgUrl"
fit="contain"
style="width: 100px;height: 100px;border-radius: 10px"></van-image>
<div class="selection" style="background: #fff" v-for="(subject,sidx) in projectInfo.welfareProjectSubjects">
<div style="display: flex; width: 100%; padding: 10px 0" v-for="(option, oidx) in subject.options">
<div style="width: 120px; height: 100px; display: flex; justify-content: center; align-items: center">
<van-image
:src="FILE_STREAM_PREVIEW_ADDRESS+'?id='+option.imgUrl"
fit="contain"
style="width: 100px; height: 100px; border-radius: 10px"
></van-image>
<!-- @click="vant.ImagePreview([CREATE_PREVIEW_URL(option.imgUrl)])"-->
</div>
<div class="right_content">
<div style="display: flex;justify-content: space-between;align-items: center;font-size: 14px">
<div style="display: flex; justify-content: space-between; align-items: center; font-size: 14px">
<div style="width: 100%">{{option.optionName}}</div>
</div>
<div class="optionDesc">
<template v-if="option.supplier">
服务专线:{{option.supplier}}
</template>
<template v-if="option.supplier">服务专线:{{option.supplier}}</template>
</div>
<div class="optionDesc" v-if="option.simpleDesc">
备注:{{option.simpleDesc}}
</div>
<div style="position: absolute;right: 10px;bottom: 0;left: 0;display: flex;justify-content: space-between">
<div @click="openViewDesc(option.description)"
style="width: 70px;font-size: 13px;color: #918a8a;text-align: right">
<div class="optionDesc" v-if="option.simpleDesc">备注:{{option.simpleDesc}}</div>
<div style="position: absolute; right: 10px; bottom: 0; left: 0; display: flex; justify-content: space-between">
<div @click="openViewDesc(option.description)" style="width: 70px; font-size: 13px; color: #918a8a; text-align: right">
套餐详情
</div>
<van-stepper :default-value="0"
:disabled="confirmButtonInfo.disabled"
:min="0"
@change="(value)=>{numChange(value,option,oidx)}"
async-change
button-size="20"
disable-input
integer
theme="round"
v-model="option.selectNum"></van-stepper>
<van-stepper
:default-value="0"
:disabled="confirmButtonInfo.disabled"
:min="0"
@change="(value)=>{numChange(value,option,oidx)}"
async-change
button-size="20"
disable-input
integer
theme="round"
v-model="option.selectNum"
></van-stepper>
</div>
</div>
</div>
</div>
</div>
<van-submit-bar :button-text="confirmButtonInfo.text"
@submit="confirmSelect"
tip="您可以在福利选择截至时间之前修改福利套餐"
tip-icon="info-o">
<div style="width: calc(100% - 110px);">
<div style="width: 25px;height: 25px;position: relative">
<van-submit-bar
:button-text="confirmButtonInfo.text"
@submit="confirmSelect"
tip="您可以在福利选择截至时间之前修改福利套餐"
tip-icon="info-o"
>
<div style="width: calc(100% - 110px)">
<div style="width: 25px; height: 25px; position: relative">
<van-icon name="shopping-cart-o" size="25"></van-icon>
<div class="van-info">
{{sumSelectNum}}
</div>
<div class="van-info">{{sumSelectNum}}</div>
</div>
</div>
</van-submit-bar>
</template>
<van-popup :style="{ height: '70%' }" closeable position="bottom" safe-area-inset-bottom
v-model="selectAddressPopup">
<van-popup :style="{ height: '70%' }" closeable position="bottom" safe-area-inset-bottom v-model="selectAddressPopup">
<div style="height: 100%">
<div style="font-size: 15px;font-weight: bold;text-align: center;padding-top: 16px;">
配送至
</div>
<div style="font-size: 15px; font-weight: bold; text-align: center; padding-top: 16px">配送至</div>
<template v-if="addressList && addressList.length>0">
<van-cell @click="addressClick(item);selectAddressPopup=false" clickable
icon="location-o"
v-for="item in addressList">
<template #title>
{{item.address}}
</template>
<van-cell @click="addressClick(item);selectAddressPopup=false" clickable icon="location-o" v-for="item in addressList">
<template #title>{{item.address}}</template>
<template #label>
<div>{{"地区:" + item.province + item.city + item.county}}</div>
<div>{{"收件人:" + item.name}}</div>
@@ -278,59 +282,48 @@ layout("/mobile/platform.html"){
<van-empty description="暂无地址" v-else></van-empty>
<div style="position: absolute;bottom: 0;left: 0;box-sizing: border-box;width: 100%;padding: 0 16px;background: #fff">
<van-button @click="openAddressManage" block round
style="height: 40px;margin: 5px 0"
type="danger">
地址管理
</van-button>
<div style="position: absolute; bottom: 0; left: 0; box-sizing: border-box; width: 100%; padding: 0 16px; background: #fff">
<van-button @click="openAddressManage" block round style="height: 40px; margin: 5px 0" type="danger">地址管理</van-button>
</div>
</div>
</van-popup>
<van-popup :style="{ height: '100%',width: '100%'}" position="right" safe-area-inset-bottom
v-model="descPopup">
<van-popup :style="{ height: '100%',width: '100%'}" position="right" safe-area-inset-bottom v-model="descPopup">
<van-sticky>
<van-nav-bar @click-left="descPopup=false" left-arrow
title="详情"></van-nav-bar>
<van-nav-bar @click-left="descPopup=false" left-arrow title="详情"></van-nav-bar>
</van-sticky>
<div @click="descImgClick" class="desc" style="padding: 20px;" v-html="desc"></div>
<div @click="descImgClick" class="desc" style="padding: 20px" v-html="desc"></div>
</van-popup>
<van-popup :close-on-click-overlay="false"
:style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="confirmPopup">
<van-popup
:close-on-click-overlay="false"
:style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="confirmPopup"
>
<div>
<!--选择的信息-->
<div class="van-cell-group--inset">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">已选福利</div>
<van-icon class="van-cell__left-icon" color="red" name="location" slot="icon"></van-icon>
<div slot="title" style="font-weight: bold; font-size: 15px">已选福利</div>
</van-cell>
<van-cell style="padding: 0" v-for="(item,index) in selectedOptions">
<van-card
:key="item.id"
:num="item.selectNum"
:thumb="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
:title="item.optionName"
desc=""
style="border-radius: 8px;background: #FFFFFF"
:key="item.id"
:num="item.selectNum"
:thumb="FILE_STREAM_PREVIEW_ADDRESS+'?id='+item.imgUrl"
:title="item.optionName"
desc=""
style="border-radius: 8px; background: #ffffff"
></van-card>
<div class="van-hairline--top"></div>
<van-cell @click="openShoppingPopup(item,index)" is-link title="收货门店"
v-if="item.shoppingId">
<template #label>
{{item.receiveAddress?item.receiveAddress:'暂未选择'}}
</template>
<van-cell @click="openShoppingPopup(item,index)" is-link title="收货门店" v-if="item.shoppingId">
<template #label>{{item.receiveAddress?item.receiveAddress:'暂未选择'}}</template>
</van-cell>
</van-cell>
</div>
@@ -338,17 +331,13 @@ layout("/mobile/platform.html"){
<!--邮寄到家 填写收货地址-->
<div class="van-cell-group--inset" v-if="projectInfo.provideMode===3">
<van-cell>
<van-icon class="van-cell__left-icon" color="red" name="location"
slot="icon"></van-icon>
<div slot="title" style="font-weight: bold;font-size: 15px">收货地址</div>
<van-icon class="van-cell__left-icon" color="red" name="location" slot="icon"></van-icon>
<div slot="title" style="font-weight: bold; font-size: 15px">收货地址</div>
</van-cell>
<van-cell @click="clickSelectAddressPopup" class="address-cell" is-link
title="">
<van-cell @click="clickSelectAddressPopup" class="address-cell" is-link title="">
<template>
<span v-if="$.isEmptyObject(selectAddress)">请选择地址</span>
<span v-else>
{{selectAddress}}
</span>
<span v-else>{{selectAddress}}</span>
</template>
</van-cell>
</div>
@@ -357,69 +346,58 @@ layout("/mobile/platform.html"){
<div class="van-cell-group--inset" v-if="projectInfo.signMode===2">
<van-cell>
<template #title>
<div style="font-weight: bold;font-size: 15px">电子签名</div>
<div style="font-weight: bold; font-size: 15px">电子签名</div>
</template>
</van-cell>
<van-cell title="">
<template #label>
<mobile-sign :is_value_base64="false" prefix="welfare" ref="signature"
v-model="signData"></mobile-sign>
<mobile-sign :is_value_base64="false" prefix="welfare" ref="signature" v-model="signData"></mobile-sign>
</template>
</van-cell>
</div>
<div style="padding: 10px 16px;left: 0;right: 0;bottom: 0;background: #FFFFFF">
<van-button @click="submitSelect" round style="width: 100%" type="danger">提交
</van-button>
<div style="padding: 10px 16px; left: 0; right: 0; bottom: 0; background: #ffffff">
<van-button @click="submitSelect" round style="width: 100%" type="danger">提交</van-button>
</div>
</div>
</van-popup>
<van-popup :style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="shoppingPopup">
<van-popup
:style="{ height: '90vh', 'overflow-y':'auto', background:'#f9f9f9'}"
closeable
position="bottom"
round
safe-area-inset-bottom
v-model="shoppingPopup"
>
<div>
<div style="margin-top: 45px">
<van-search
@search="onSearchShoppingAddress"
placeholder="请输入门店关键词"
show-action
v-model="shoppingAddress">
<van-search @search="onSearchShoppingAddress" placeholder="请输入门店关键词" show-action v-model="shoppingAddress">
<template #action>
<div @click="onSearchShoppingAddress">搜索</div>
</template>
</van-search>
<div class="van-cell-group--inset"
v-if="offlineStoresOption&&offlineStoresOption.length>0">
<van-cell @click="addShopping(item.address)" is-link
v-for="item in offlineStoresOption"
>
<div class="van-cell-group--inset" v-if="offlineStoresOption && offlineStoresOption.length>0">
<van-cell icon="location-o" class="custom-cell" @click="addShopping(item.address)" v-for="item in offlineStoresOption">
{{item.address}}
</van-cell>
</div>
<div v-else>
<van-empty description="描述文字" style="height: calc(100% - 180px);"></van-empty>
<van-empty description="描述文字" style="height: calc(100% - 180px)"></van-empty>
</div>
</div>
</div>
</van-popup>
</div>
<script>
<!--#include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [mobileMixins, welfareMixins],
components: {
'mobile-sign': httpVueLoader('/components/sign/mobileSign.vue'),
"mobile-sign": httpVueLoader("/components/sign/mobileSign.vue")
},
data() {
return {
@@ -441,13 +419,16 @@ layout("/mobile/platform.html"){
shoppingAddress: "",
optionIndex: null,
optionData: {},
clickUpOrDown: false
}
},
computed: {
sumSelectNum() {
if (this.projectInfo && this.projectInfo.welfareProjectSubjects) {
return this.projectInfo.welfareProjectSubjects[0].options.map(v => v.selectNum).reduce((accumulator, currentValue) => accumulator + currentValue, 0)
return this.projectInfo.welfareProjectSubjects[0].options
.map((v) => v.selectNum)
.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
}
return 0
},
@@ -465,92 +446,129 @@ layout("/mobile/platform.html"){
},
confirmButtonInfo() {
if (this.projectInfo) {
const {choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd} = this.projectInfo
const { choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd } = this.projectInfo
const now = moment().valueOf()
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === '') {
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === "") {
if (now > moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) {
return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false}
return { text: this.isSelect ? "选好了,下一步" : "选好了,下一步", disabled: false }
} else if (now > moment(choiceTimeEnd).valueOf()) {
return {text: '选择已结束', disabled: true}
return { text: "选择已结束", disabled: true }
} else if (now < moment(choiceTimeStart).valueOf()) {
return {text: '选择未开始', disabled: true}
return { text: "选择未开始", disabled: true }
}
} else {
//已选择了不能再动了
if (this.isSelect) {
if (moment(this.selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return {text: '确定修改', disabled: false}
return { text: "下一步", disabled: false }
}
return {text: '选择已结束', disabled: true}
return { text: "选择已结束", disabled: true }
} else {
if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return {text: this.isSelect ? '确定修改' : '确定选择', disabled: false}
return { text: this.isSelect ? "选好了,下一步" : "选好了,下一步", disabled: false }
} else if (now > moment(overdueChoiceTimeEnd).valueOf()) {
return {text: '选择已结束', disabled: true}
return { text: "选择已结束", disabled: true }
} else if (now < moment(choiceTimeStart).valueOf()) {
return {text: '选择未开始', disabled: true}
return { text: "选择未开始", disabled: true }
}
}
}
}
return {text: '', disabled: true}
return { text: "", disabled: true }
},
selectedOptions() {
if (this.projectInfo && this.projectInfo.welfareProjectSubjects) {
return this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1)
return this.projectInfo.welfareProjectSubjects[0].options.filter((v) => v.selectNum >= 1)
}
return []
}
},
methods: {
addShopping(address) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], 'receiveAddress', address)
this.$set(this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex], "receiveAddress", address)
this.projectInfo.welfareProjectSubjects[0].options[this.optionIndex].receiveAddress = address
this.shoppingPopup = false
},
async onSearchShoppingAddress() {
const data = await this.getShoppingType()
const shopping = data.find(d => d.id === this.optionData.shoppingId)
const shopping = data.find((d) => d.id === this.optionData.shoppingId)
if (this.shoppingAddress) {
this.offlineStoresOption = shopping.offlineStores.filter(s => s.address.includes(this.shoppingAddress))
this.offlineStoresOption = shopping.offlineStores.filter((s) => s.address.includes(this.shoppingAddress))
} else {
this.offlineStoresOption = shopping.offlineStores
}
},
openShoppingPopup(item, optionIndex) {
this.optionData = item
const shopping = this.shoppingTypeOptions.find(v => v.id === item.shoppingId)
const shopping = this.shoppingTypeOptions.find((v) => v.id === item.shoppingId)
this.offlineStoresOption = shopping.offlineStores
this.optionIndex = optionIndex
this.shoppingAddress = ""
this.shoppingPopup = true
},
editAddress(item) {
location.replace("/mobile/welfare/mine/addressEdit?projectId=" + this.projectId + "&id=" + item.id)
window.sessionStorage.setItem("welfareProjectId", this.projectId)
const formData = {
projectInfo: this.projectInfo,
signData: this.signData || null
}
window.sessionStorage.setItem("welfareProjectSelectInfo" + "${@shiro.getPrincipalProperty('loginname')}", JSON.stringify(formData))
},
deleteAddress(item) {
this.selectAddressPopup = true
// 确认要删除该地址吗
this.$dialog
.confirm({
title: "提示",
message: "确认要删除该地址吗"
})
.then(async () => {
const loading = this.$toast.loading({
message: "删除中...",
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post("/mobile/welfare/mine/deleteAddress", { id: item.id })
loading.close()
if (resp.code === 0) {
this.$toast.success(resp.msg)
}
await this.selectAddressList()
if (this.addressList && this.addressList.length > 0) {
const resp = this.addressList.find((v) => v.isDefault)
this.addressClick(resp)
} else {
this.selectAddress = ""
}
this.selectAddressPopup = true
})
.catch(() => {
this.selectAddressPopup = true
})
},
//数量更改
numChange(value, option, optionIndex) {
const {
isCheckBox,
multiSelectNum,
singleOptionSupportMultipleSelection
} = this.projectInfo
if (isCheckBox === 'checkBox') {
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
if (isCheckBox === "checkBox") {
//判断是否支持单个多选
if (!singleOptionSupportMultipleSelection && value > 1) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', 1)
this.$toast('此套餐最多只能选择1份')
return;
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], "selectNum", 1)
this.$toast("此套餐最多只能选择1份")
return
}
}
//获取用户当前选择的数量
const selectNums = this.projectInfo.welfareProjectSubjects[0].options.map(v => v.selectNum)
const selectNums = this.projectInfo.welfareProjectSubjects[0].options.map((v) => v.selectNum)
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum > multiSelectNum) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', value - 1)
this.$toast('此次福利最多只能选择' + multiSelectNum + '份')
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], "selectNum", value - 1)
this.$toast("此次福利最多只能选择" + multiSelectNum + "份")
}
},
//确定选择
@@ -560,15 +578,11 @@ layout("/mobile/platform.html"){
return
}
const {
isCheckBox,
multiSelectNum,
singleOptionSupportMultipleSelection
} = this.projectInfo
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
if (isCheckBox === "checkBox") {
if (this.sumSelectNum < multiSelectNum) {
//用户没有选择完
this.$toast('一共可以选择' + multiSelectNum + '份,您目前只选择了' + this.sumSelectNum + '份,快去选择吧!')
this.$toast("一共可以选择" + multiSelectNum + "份,您目前只选择了" + this.sumSelectNum + "份,快去选择吧!")
return
}
}
@@ -583,46 +597,43 @@ layout("/mobile/platform.html"){
if (this.projectInfo.signMode === 2 && this.isSelect && this.userSelection) {
this.signData = this.userSelection[0].userSign
}
},
//提交选择
async submitSelect() {
if (this.projectInfo.provideMode === 3) {
if (this.selectAddress == null || this.selectAddress === '') {
if (this.selectAddress == null || this.selectAddress === "") {
this.$modal.msg("请填写您的收货地址")
return
}
}
if (this.projectInfo.signMode === 2) {
if (this.signData == null || this.signData === '') {
if (this.signData == null || this.signData === "") {
this.$modal.msg("请签名")
return
}
}
const notReceiveAddress = []
const formData = this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1).map(v => {
if (v.shoppingId && !v.receiveAddress) {
notReceiveAddress.push(v.optionName)
}
return {
welfareId: this.projectId,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.projectInfo.provideMode === 3 ? this.selectAddress : v.receiveAddress,
userSign: this.signData,
selectNum: v.selectNum
}
})
const formData = this.projectInfo.welfareProjectSubjects[0].options
.filter((v) => v.selectNum >= 1)
.map((v) => {
if (v.shoppingId && !v.receiveAddress) {
notReceiveAddress.push(v.optionName)
}
return {
welfareId: this.projectId,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.projectInfo.provideMode === 3 ? this.selectAddress : v.receiveAddress,
userSign: this.signData,
selectNum: v.selectNum
}
})
if (notReceiveAddress.length > 0) {
this.$modal.msg("请填写收货门店:" + notReceiveAddress.join(","))
return
}
const {
code,
msg,
data
} = await $.post('/platform/welfare/userChoose/confirmSelect', {
const { code, msg, data } = await $.post("/platform/welfare/userChoose/confirmSelect", {
welfareUserSelections: JSON.stringify(formData),
projectId: this.projectId
})
@@ -638,24 +649,29 @@ layout("/mobile/platform.html"){
//查看详情
openViewDesc(desc) {
if (desc == null || desc.length === 0) {
this.$toast('没有更多了')
this.$toast("没有更多了")
return
}
this.desc = desc
this.descPopup = true
},
descImgClick(e) {
if (e.target.tagName === 'IMG') {
if (e.target.tagName === "IMG") {
vant.ImagePreview([e.target.src])
}
},
//地址管理
openAddressManage() {
location.replace('/mobile/welfare/mine/address')
window.sessionStorage.setItem('welfareProjectId', this.projectId)
location.replace("/mobile/welfare/mine/addressEdit?projectId=" + this.projectId)
window.sessionStorage.setItem("welfareProjectId", this.projectId)
const formData = {
projectInfo: this.projectInfo,
signData: this.signData || null
}
window.sessionStorage.setItem("welfareProjectSelectInfo" + "${@shiro.getPrincipalProperty('loginname')}", JSON.stringify(formData))
},
clickSelectAddressPopup() {
@@ -665,12 +681,12 @@ layout("/mobile/platform.html"){
//地址列表点击
addressClick(item) {
const {province, city, county, address, name, tel} = item
const { province, city, county, address, name, tel } = item
this.selectAddress = "收货地址:" + province + city + county + address + "," + "收件人:" + name + "," + "联系方式:" + tel
},
async getProjectInfo() {
const resp = await $.get('/platform/welfare/common/findOne', {projectId: this.projectId})
const resp = await $.get("/platform/welfare/common/findOne", { projectId: this.projectId })
if (resp.code === 0) {
resp.data.multiSelectNum = resp.data.multiSelectNum ? resp.data.multiSelectNum : 1
this.projectInfo = resp.data
@@ -680,15 +696,15 @@ layout("/mobile/platform.html"){
//获取用户选择的数据
async getUserSelection(projectId) {
const resp = await $.get('/platform/welfare/mine/getUserSelection', {projectId: projectId})
const resp = await $.get("/platform/welfare/mine/getUserSelection", { projectId: projectId })
this.userSelection = resp.data
this.echoUserSelection()
},
//回显用户选择的数据
echoUserSelection() {
this.projectInfo.welfareProjectSubjects[0].options.forEach(v => {
const option = this.userSelection.find(x => x.selectOptionId === v.id)
this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
const option = this.userSelection.find((x) => x.selectOptionId === v.id)
if (option) {
v.selectNum = option.selectNum
v.receiveAddress = option.receiveAddress
@@ -698,25 +714,36 @@ layout("/mobile/platform.html"){
async getShoppingType() {
const resp = await $.get("/platform/shoppingType/apply/getShoppingType")
return resp.data
},
}
},
async created() {
const id = GetQueryString("projectId")
if (!id) return
this.projectId = id
this.getProjectInfo()
this.shoppingTypeOptions = await this.getShoppingType()
// this.getChoice()
getEnumOptions("WelfareProvideMode").then(res => {
getEnumOptions("WelfareProvideMode").then((res) => {
this.welfareProvideMode = res
})
getEnumOptions("WelfareSignMode").then(res => {
getEnumOptions("WelfareSignMode").then((res) => {
this.welfareSignMode = res
})
},
const loginname = "${@shiro.getPrincipalProperty('loginname')}"
const formData = window.sessionStorage.getItem("welfareProjectSelectInfo" + loginname)
if (formData) {
const resp = JSON.parse(formData)
this.projectInfo = resp.projectInfo
this.signData = resp.signData
this.confirmSelect()
window.sessionStorage.removeItem("welfareProjectSelectInfo" + loginname)
// this.selectAddressPopup = true
} else {
this.getProjectInfo()
}
}
})
window.addEventListener('pageshow', e => {
window.addEventListener("pageshow", (e) => {
if (e.persisted || (window.performance && window.performance.navigation.type === 2)) {
vue.init()
}
@@ -12,98 +12,97 @@ layout("/mobile/platform.html"){
<div id="app" v-cloak>
<van-sticky>
<van-nav-bar title="地址管理" left-arrow placeholder fixed
@click-left="location.replace('/mobile/welfare/mine/address')"></van-nav-bar>
<van-nav-bar title="地址管理" left-arrow placeholder fixed @click-left="back()"></van-nav-bar>
</van-sticky>
<div v-if="vLoading && !vLoading.value">
<van-address-edit
ref="address"
:area-list="areaList"
:show-delete="addressId"
:address-info="addressInfo"
show-set-default
show-search-result
tel-maxlength="11"
:area-columns-placeholder="['请选择', '请选择', '请选择']"
@save="onSave"
@delete="onDelete"
ref="address"
:area-list="areaList"
:show-delete="addressId"
:address-info="addressInfo"
show-set-default
show-search-result
tel-maxlength="11"
:area-columns-placeholder="['请选择', '请选择', '请选择']"
@save="onSave"
@delete="onDelete"
></van-address-edit>
</div>
</div>
<script>
<!--#include("/mobile/welfare/include/areaList.js"){};include("/mobile/welfare/include/mixins.js"){}#-->
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [mobileMixins, welfareMixins],
data() {
return {
projectId: GetQueryString("projectId"),
areaList: areaList,
addressInfo: {},
addressId: null
};
}
},
methods: {
back() {
if (this.projectId) {
// pjaxReplace("/mobile/welfare/mine/address?projectId=" + this.projectId)
pjaxReplace("/mobile/welfare/list/receive?projectId=" + this.projectId)
} else {
pjaxReplace("/mobile/welfare/mine/address")
}
},
async onSave(content) {
const loading = this.$toast.loading({
message: '保存中...',
message: "保存中...",
forbidClick: true,
overlay: true,
duration: 0
})
content.userName = content.name
const resp = await $.post('/mobile/welfare/mine/doSaveUserAddress', content)
const resp = await $.post("/mobile/welfare/mine/doSaveUserAddress", content)
loading.close()
if (resp.code === 0) {
this.$toast.success(resp.msg)
setTimeout(() => {
let welfareProjectId = window.sessionStorage.getItem("welfareProjectId");
if (welfareProjectId) {
location.replace('/mobile/welfare/list/receive?projectId=' + welfareProjectId)
window.sessionStorage.removeItem("welfareProjectId");
} else {
location.replace('/mobile/welfare/mine/address')
}
}, 1000)
this.$nextTick(() => {
this.back()
})
}
},
async onDelete(content) {
const loading = this.$toast.loading({
message: '删除中...',
message: "删除中...",
forbidClick: true,
overlay: true,
duration: 0
})
const resp = await $.post('/mobile/welfare/mine/deleteAddress', {id: content.id})
const resp = await $.post("/mobile/welfare/mine/deleteAddress", { id: content.id })
loading.close()
if (resp.code === 0) {
this.$toast.success(resp.msg)
setTimeout(() => {
location.replace('/mobile/welfare/mine/address')
}, 1000)
this.$nextTick(() => {
this.back()
})
}
}
},
async created() {
this.startLoading()
this.addressId = GetQueryString("id") === '' ? null : GetQueryString("id")
this.addressId = GetQueryString("id") === "" ? null : GetQueryString("id")
if (this.addressId) {
const resp = await $.get('/mobile/welfare/mine/findOneUserAddress', {id: this.addressId})
const resp = await $.get("/mobile/welfare/mine/findOneUserAddress", { id: this.addressId })
if (resp.code === 0) {
this.addressInfo = resp.data
}
this.closeLoading()
} else {
this.addressInfo.name = "${@shiro.getPrincipalProperty('username')}";
this.addressInfo.name = "${@shiro.getPrincipalProperty('username')}"
this.closeLoading()
}
/*this.areaList.province_list = {320000: "江苏省"}
this.areaList.city_list = {320200: "无锡市"}*/
}
})
</script>
@@ -84,10 +84,10 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item label="申报基层工会" prop="fundsUnitName" v-if="formData.activity_type!=40003">
<el-input placeholder="请输入基层工会名称" type="text" v-model="formData.fundsUnitName"></el-input>
<el-input placeholder="请输入基层工会名称" readonly type="text" v-model="formData.fundsUnitName"></el-input>
</el-form-item>
<el-form-item label="申请协会" prop="clubId" v-else-if="formData.activity_type==40003">
<el-select @change="fundsUnitChange" placeholder="请选择申请协会" style="width: 100%" v-model="formData.clubId">
<el-form-item label="申报文体协会" prop="clubId" v-else-if="formData.activity_type==40003">
<el-select @change="fundsUnitChange" placeholder="请选择申报文体协会" style="width: 100%" v-model="formData.clubId">
<el-option
:key="item.id"
:label="item.name+' ('+item.code+')'"
@@ -106,29 +106,6 @@ layout("/layouts/platform.html"){
v-model="formData.joinActivityNum"
></el-input-number>
</el-form-item>
<!-- <el-form-item prop="projectTypeCode" label="活动项目类型">
<el-select v-model="formData.projectTypeCode" placeholder="请选择活动类型"
style="width: 100%;">
<el-option
v-for="item in projectType"
:key="item.id"
:label="item.name+' ('+item.code+')'"
:value="item.code">
</el-option>
</el-select>
</el-form-item>-->
<!--<el-form-item label="活动经费类型" prop="projectJfCode">
<el-select placeholder="选择活动主体类型自动选择" style="width: 100%" v-model="formData.projectJfCode">
<el-option
:key="item.id"
:label="item.name+' ('+item.code+')'"
:value="item.code"
disabled
v-for="item in projectJfType"
></el-option>
</el-select>
</el-form-item>-->
</el-col>
<el-col :span="12">
@@ -155,7 +132,7 @@ layout("/layouts/platform.html"){
<el-form-item label="预算总费用" prop="funds_money">
<el-input-number
disabled
placeholder="输入物品单价自动计算"
placeholder="输入预算费用自动计算"
:precision="2"
style="width: 100%"
v-model="formData.funds_money"
@@ -366,19 +343,10 @@ layout("/layouts/platform.html"){
}
},
async getProjectCodeChange(val) {
this.$set(this.formData, "fundsUnitName", null)
await this.generateProjectCode(this.formData.activity_type)
if (this.formData.activity_type == "40001") {
const jfType = this.projectJfType.find((p) => p.code == "70001")
this.$set(this.formData, "projectJfCode", jfType ? jfType.code : null)
this.$set(this.formData, "fundsUnitName", "校工会")
} else if (this.formData.activity_type == "40002") {
const jfType = this.projectJfType.find((p) => p.code == "70002")
this.$set(this.formData, "projectJfCode", jfType ? jfType.code : null)
if (this.formData.activity_type == "40002") {
this.$set(this.formData, "fundsUnitName", '${@shiro.getPrincipalProperty("union").getUnionname()}')
} else if (this.formData.activity_type == "40003") {
const jfType = this.projectJfType.find((p) => p.code == "70003")
this.$set(this.formData, "projectJfCode", jfType ? jfType.code : null)
const { data } = await $.get("/platform/jf/Funds/apply/getUserClub")
const clubList = await getClubs()
const aa = clubList.filter((v) => {
@@ -0,0 +1,17 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak></div>
<script>
new Vue({
el: "#app",
data() {
return {}
},
methods: {},
created() {}
})
</script>
<!--#
}
#-->
@@ -11,180 +11,181 @@ layout("/layouts/platform.html"){
</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
:data="tableData"
:size="tableSize"
@sort-change="pageOrder"
ref="table"
row-key="id"
style="width: 100%"
v-loading="tableLoading"
>
<el-table-column label="序号" type="index" width="80px"></el-table-column>
<el-table-column
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" show-overflow-tooltip
v-for="column in tableColumns">
<template scope="{row}" v-if="column.prop=='address'">
{{row.province}} {{row.city}} {{row.county}}
</template>
:key="column.prop"
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
:width="column.width"
show-overflow-tooltip
v-for="column in tableColumns"
>
<template scope="{row}" v-if="column.prop=='address'">{{row.province}} {{row.city}} {{row.county}}</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center"
label="操作" prop="userOnline"
width="170px">
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="170px">
<template scope="{row}">
<el-button @click="openEdit(row)" size="mini" type="primary">
修改
</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">
删除
</el-button>
<el-button @click="openEdit(row)" size="mini" type="primary">修改</el-button>
<el-button @click="doDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" header-align="center" label=""
prop="userOnline"
width="170px">
<el-table-column align="center" fixed="right" header-align="center" label="" prop="userOnline" width="170px">
<template scope="{row}">
<span v-if="row.isDefault">
<el-tag type="danger">默认地址</el-tag></span>
<el-tag type="danger">默认地址</el-tag>
</span>
<span v-else>
<el-button @click="doDefault(row)" size="mini"
type="primary">设为默认</el-button>
</span>
<el-button @click="doDefault(row)" size="mini" type="primary">设为默认</el-button>
</span>
</template>
</el-table-column>
</el-table>
</el-card>
</template>
</guava>
<el-dialog
title="收货地址"
:close-on-click-modal="false"
:visible.sync="dialogVisible"
width="30%">
<el-form :model="formData" label-position="right"
label-suffix=":" label-width="120px" ref="addForm">
<el-dialog title="收货地址" :close-on-click-modal="false" :visible.sync="dialogVisible" width="40%">
<el-form :model="formData" label-position="right" :rules="formRules" label-suffix=":" label-width="120px" ref="addForm">
<el-row :gutter="60">
<el-col :span="24">
<el-form-item :rules="{required:true,message: '请选择地址信息', trigger: 'blur'}"
label="地址信息"
prop="addressList">
<el-form-item 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">
<el-form-item
:rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}"
label="详细地址"
prop="addressDetail">
<el-input maxlength="100"
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
rows="3"
show-word-limit
type="textarea"
v-model="formData.addressDetail"></el-input>
<el-form-item label="详细地址" prop="addressDetail">
<el-input
maxlength="100"
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
rows="3"
show-word-limit
type="textarea"
v-model="formData.addressDetail"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
:rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}"
label="收货人姓名"
prop="userName">
<el-input maxlength="11"
placeholder="请填写收货人姓名"
v-model="formData.userName"></el-input>
<el-form-item label="收货人姓名" prop="userName">
<el-input maxlength="11" placeholder="请填写收货人姓名" v-model="formData.userName"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
: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 label="手机号码" prop="tel">
<el-input maxlength="11" placeholder="请填写手机号码" clearable v-model="formData.tel"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="是否默认" prop="isDefault">
<el-switch
v-model="formData.isDefault"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
</el-form-item>
</el-col>
</el-row>
</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-button @click="dialogVisible = false">取 消</el-button>
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
</span>
</el-dialog>
</div>
<script src="${base!}/assets/platform/js/chengSh.js"></script>
<script>
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
dzOptions: chengShiList,
dialogVisible: false,
tableColumns: [
{prop: 'userName', label: '收货人'},
{prop: 'address', label: '所在地区'},
{prop: 'addressDetail', label: '详细地址'},
{prop: 'tel', label: '电话'},
]
{ prop: "userName", label: "收货人" },
{ prop: "address", label: "所在地区" },
{ prop: "addressDetail", label: "详细地址" },
{ prop: "tel", label: "电话" }
],
formRules: {
addressList: [{ required: true, message: "请选择地址信息", trigger: ["blur", "change"] }],
addressDetail: [{ required: true, message: "请填写您的详细地址", trigger: ["blur", "change"] }],
userName: [{ required: true, message: "请填写收货人姓名", trigger: ["blur", "change"] }],
tel: [
{ required: true, message: "必填", trigger: ["blur", "change"] },
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号" }
]
}
}
},
methods: {
pageData() {
sublime.showLoadingbar();
sublime.showLoadingbar()
this.tableLoading = true
$.post(loc() + "/selectUserAddress", this.pageForm, (data) => {
sublime.closeLoadingbar();
this.tableLoading = false
if (data.code === 0) {
this.tableData = data.data;
} else {
this.$message.error(data.msg);
}
}, "json");
$.post(
loc() + "/selectUserAddress",
this.pageForm,
(data) => {
sublime.closeLoadingbar()
this.tableLoading = false
if (data.code === 0) {
this.tableData = data.data
} else {
this.$message.error(data.msg)
}
},
"json"
)
},
handleChange(val) {
if (val) {
let provinceName = ""
let cityName = ""
let countyName = ""
const province = this.dzOptions.find(c => c.value === val[0])
const province = this.dzOptions.find((c) => c.value === val[0])
provinceName = province.label
const city = province.children.find(p => p.value === val[1])
const city = province.children.find((p) => p.value === val[1])
cityName = city.label
if (val.length === 3) {
const county = city.children.find(p => p.value === val[2])
const county = city.children.find((p) => p.value === val[2])
countyName = county.label
this.$set(this.formData, "areaCode", county.value)
}else{
} else {
this.$set(this.formData, "areaCode", city.value)
}
this.$set(this.formData, "province", provinceName)
this.$set(this.formData, "city", cityName)
this.$set(this.formData, "county", countyName)
}
},
openAddress() {
this.formData = {}
this.formData = {
userName: "${@shiro.getPrincipalProperty('username')}",
tel: "${@shiro.getPrincipalProperty('mobile')}"
}
this.dialogVisible = true
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
if (this.$refs["addForm"]) this.$refs["addForm"].resetFields()
},
doSaveUserAddress() {
this.$refs["addForm"].validate(async (valid) => {
@@ -194,72 +195,69 @@ layout("/layouts/platform.html"){
this.doSearch()
this.$message({
message: resp.msg,
type: 'success'
});
type: "success"
})
this.dialogVisible = false
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
}
})
},
doDelete(id) {
this.$confirm('此操作将永久删除该地址, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
this.$confirm("此操作将永久删除该地址, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(async () => {
const resp = await $.post("/mobile/welfare/mine/deleteAddress", {id: id})
const resp = await $.post("/mobile/welfare/mine/deleteAddress", { id: id })
if (resp.code === 0) {
this.doSearch()
this.$message({
type: 'success',
type: "success",
message: resp.msg
});
})
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
})
},
openEdit(row) {
row.addressList = []
const province = chengShiList.find(c => c.label === row.province)
const province = chengShiList.find((c) => c.label === row.province)
row.addressList.push(province.value)
const city = province.children.find(p => p.label === row.city)
const city = province.children.find((p) => p.label === row.city)
row.addressList.push(city.value)
const county = city.children.find(p => p.label === row.county)
if (county) {
row.addressList.push(county.value)
if (row.county) {
const county = city.children.find((p) => p.label === row.county)
if (county) {
row.addressList.push(county.value)
}
}
this.formData = row
this.formData = { ...row }
this.formData.isDefault = this.formData.isDefault ? "1" : "0"
this.dialogVisible = true
},
async doDefault(row) {
const resp = await $.post(loc()+"/doDefault", {id: row.id})
const resp = await $.post(loc() + "/doDefault", { id: row.id })
if (resp.code === 0) {
this.doSearch()
this.$message({
type: 'success',
type: "success",
message: resp.msg
});
})
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
},
}
},
async created() {
this.pageData()
/* if ("${@shiro.hasRole('sysadmin')}" === 'false') {
this.dzOptions = this.dzOptions.filter(d => d.label === "江苏省")
this.dzOptions[0].children = this.dzOptions[0].children.filter(d => d.label === "无锡市")
}*/
}
})
</script>
<!--#
}
#-->
@@ -25,26 +25,24 @@ layout("/layouts/platform.html"){
font-size: 13px;
color: #868282;
}
</style>
<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">年度:</div>
<div class="search-item-option">
<el-date-picker
:clearable="true"
placeholder="选择年"
type="year"
v-model="pageForm.year"
value-format="yyyy">
</el-date-picker>
:clearable="true"
placeholder="选择年"
type="year"
style="width: 100%"
v-model="pageForm.year"
value-format="yyyy"
></el-date-picker>
</div>
</div>
@@ -59,38 +57,48 @@ layout("/layouts/platform.html"){
</div>-->
<div class="search-query">
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
</el-button>
<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>
<template #func></template>
</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"
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-column
: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">
: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')}}
<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>
@@ -101,9 +109,7 @@ layout("/layouts/platform.html"){
<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.gifts.map(v=>v.name + '('+v.num+'份)').join(',')}}
</template>
<template v-if="row.gist_list">{{row.gifts.map(v=>v.name + '('+v.num+'份)').join(',')}}</template>
</template>
<template scope="{row}" v-else-if="column.prop=='receiveAddress'">
@@ -112,33 +118,21 @@ layout("/layouts/platform.html"){
</template>
<template scope="{row}" v-else-if="column.prop=='courierNumber'">
<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 align="center" fixed="right" header-align="center"
label="操作" prop="userOnline"
width="200px">
<el-table-column align="center" fixed="right" header-align="center" label="操作" prop="userOnline" width="200px">
<template scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">
查看
</el-button>
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<!-- <el-button :disabled="!row.courierNumber" @click="openExpress(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>
@@ -148,29 +142,20 @@ layout("/layouts/platform.html"){
<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>
<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}}
</el-form-item>
<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-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-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-form-item label="最多选几个">{{projectInfo.multiSelectNum}}个</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="发放形式">
@@ -189,75 +174,52 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="选择时间">
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
</el-form-item>
<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="6"
v-for="(option, oidx) in subject.options">
<el-card shadow="never"
style="margin: 5px;">
<div slot="header"
style="display: flex;justify-content: space-between">
<div :key="subject.id" v-for="subject in projectInfo.welfareProjectSubjects">
<el-col :key="oidx" :span="6" v-for="(option, oidx) in subject.options">
<el-card shadow="never" style="margin: 5px">
<div slot="header" style="display: flex; justify-content: space-between">
<div>{{option.optionName}}</div>
<div>
{{option.optionName}}
</div>
<div>
<el-button @click.stop="viewDesc(option)"
type="text">套餐详情
</el-button>
<el-button @click.stop="viewDesc(option)" type="text">套餐详情</el-button>
</div>
</div>
<el-row :gutter="10">
<el-col :span="24">
<div class="optionImg">
<el-image
:src="CREATE_PREVIEW_URL(option.imgUrl)"
fit="contain"
></el-image>
<el-image :src="CREATE_PREVIEW_URL(option.imgUrl)" fit="contain"></el-image>
</div>
</el-col>
</el-row>
<el-row :gutter="10" v-if="option.supplier">
<el-col :span="24">
<div class="descriptionClass">
{{removeHTMLTag(option.supplier)}}
</div>
<div class="descriptionClass">{{removeHTMLTag(option.supplier)}}</div>
</el-col>
</el-row>
<el-row style="">
<el-input-number disabled
style="width: 100%"
v-model="option.selectNum"></el-input-number>
<el-input-number disabled style="width: 100%" v-model="option.selectNum"></el-input-number>
</el-row>
</el-card>
</el-col>
</div>
</el-row>
</el-form-item>
<el-form-item
label="收货地址"
prop="receiveAddress" v-if="projectInfo.provideMode===3">
{{formData.receiveAddress}}
</el-form-item>
<el-form-item label="收货地址" prop="receiveAddress" v-if="projectInfo.provideMode===3">{{formData.receiveAddress}}</el-form-item>
<el-form-item label="签字" prop="sign" v-if="projectInfo.signMode===2">
<el-image :src="'/signature/getSignData?path=' +formData.imageUrl"
fit="contain"
style="height: 100px;width: 100%" v-if="formData.imageUrl">
</el-image>
<el-image
:src="'/signature/getSignData?path=' +formData.imageUrl"
fit="contain"
style="height: 100px; width: 100%"
v-if="formData.imageUrl"
></el-image>
<span v-else>暂无</span>
</el-form-item>
</el-form>
@@ -265,86 +227,67 @@ layout("/layouts/platform.html"){
</template>
</guava>
<el-dialog
:close-on-click-modal="false"
:visible.sync="evaluateDialogVisible"
title="福利评价"
width="40%">
<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-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">
<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>
<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 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-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-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-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%">
<el-drawer :visible.sync="expressDrawer" direction="rtl" size="50%">
<template #title>
<div style="font-size: 20px">物流详情
<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">
: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>
@@ -353,7 +296,7 @@ layout("/layouts/platform.html"){
</div>
<script>
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
@@ -361,7 +304,7 @@ layout("/layouts/platform.html"){
descDialogVisible: false,
projectInfo: {},
userSelection: [],
userId: '',
userId: "",
projectOptions: [],
units: [],
welfareUnits: [],
@@ -370,18 +313,17 @@ layout("/layouts/platform.html"){
welfareSignMode: [],
welfareNoticePushMode: [],
pageForm: {
year: moment().format('YYYY'),
searchName: 'username'
year: moment().format("YYYY"),
searchName: "username"
},
tableColumns: [
{prop: 'year', label: '年度'},
{prop: 'name', label: '项目名称'},
{prop: 'choiceTime', label: '选择时间'},
{prop: 'isChoose', label: '是否选择'},
{prop: 'gist_list', label: '所选福利'},
{prop: 'receiveAddress', label: '收货地址'},
{prop: 'courierNumber', label: '快递单号', sortable: true},
{ prop: "year", label: "年度" },
{ prop: "name", label: "项目名称" },
{ prop: "choiceTime", label: "选择时间" },
{ prop: "isChoose", label: "是否选择" },
{ prop: "gist_list", label: "所选福利" },
{ prop: "receiveAddress", label: "收货地址" },
{ prop: "courierNumber", label: "快递单号", sortable: true }
],
formRules: {},
selPersonType: [],
@@ -392,12 +334,11 @@ layout("/layouts/platform.html"){
evaluateLoading: false,
expressDrawer: false,
logisticsTrace: {},
logisticsTrace: {}
}
},
components: {
'courier-number-info': httpVueLoader('/components/welfare/CourierNumberInfo.vue?v=' + new Date().getTime())
"courier-number-info": httpVueLoader("/components/welfare/CourierNumberInfo.vue?v=" + new Date().getTime())
},
methods: {
//查看快递单号
@@ -411,15 +352,15 @@ layout("/layouts/platform.html"){
async doEvaluate() {
if (!this.formData.evaluateScore || !this.formData.optionId) {
this.$message({
message: '请打分后再提交',
type: 'warning'
});
message: "请打分后再提交",
type: "warning"
})
return
}
const confirm = await this.$confirm('提交后将不能修改,确定要提交评价吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
const confirm = await this.$confirm("提交后将不能修改,确定要提交评价吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
if (confirm === "confirm") {
this.evaluateLoading = true
@@ -427,24 +368,18 @@ layout("/layouts/platform.html"){
if (resp.code === 0) {
this.$message({
message: resp.msg,
type: 'success'
});
type: "success"
})
this.doSearch()
this.evaluateDialogVisible = false
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
this.evaluateLoading = false
}
},
async finOneWelfareEvaluate(projectId, optionId) {
const {
data,
code,
msg
} = await $.post(loc() + "/finOneWelfareEvaluate", {
const { data, code, msg } = await $.post(loc() + "/finOneWelfareEvaluate", {
projectId: projectId,
optionId: optionId
})
@@ -470,7 +405,7 @@ layout("/layouts/platform.html"){
this.evaluateDialogVisible = true
},
async getProjectInfo(id) {
const resp = await $.get('/platform/welfare/common/findOne', {projectId: id})
const resp = await $.get("/platform/welfare/common/findOne", { projectId: id })
if (resp.code === 0) {
this.projectInfo = resp.data
await this.getUserSelection(id)
@@ -479,14 +414,14 @@ layout("/layouts/platform.html"){
},
//获取用户选择的数据
async getUserSelection(projectId) {
const resp = await $.get('/platform/welfare/mine/getUserSelection', {projectId: projectId})
const resp = await $.get("/platform/welfare/mine/getUserSelection", { projectId: projectId })
this.userSelection = resp.data
},
//回显用户选择的数据
echoUserSelection() {
//获取用户当前选择的数量
this.projectInfo.welfareProjectSubjects[0].options.forEach(v => {
const option = this.userSelection.find(x => x.selectOptionId === v.id)
this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
const option = this.userSelection.find((x) => x.selectOptionId === v.id)
if (option) {
v.selectNum = option.selectNum
} else {
@@ -508,7 +443,7 @@ layout("/layouts/platform.html"){
this.$refs.guava.edit()
},
async getExpressInfo(row) {
const resp = await $.get(loc() + '/getExpressInfo', {courierNumber: row.courierNumber})
const resp = await $.get(loc() + "/getExpressInfo", { courierNumber: row.courierNumber })
if (resp.code === 0) {
for (let i = 0; i < resp.data.logisticsTraceDetailList.length; i++) {
if (i === resp.data.logisticsTraceDetailList.length - 1) {
@@ -518,17 +453,16 @@ layout("/layouts/platform.html"){
}
this.logisticsTrace = resp.data
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
},
}
},
async created() {
this.pageData()
getEnumOptions("WelfareProvideMode").then(res => {
getEnumOptions("WelfareProvideMode").then((res) => {
this.welfareProvideMode = res
})
getEnumOptions("WelfareSignMode").then(res => {
getEnumOptions("WelfareSignMode").then((res) => {
this.welfareSignMode = res
})
}
File diff suppressed because it is too large Load Diff
@@ -65,6 +65,20 @@ layout("/layouts/platform.html"){
</div>
</div>
<div class="search-item">
<div class="search-item-label">人员类型:</div>
<div class="search-item-option">
<dict-select
@change="doSearch"
clearable
code="PERSON_TYPE"
placeholder="人员类型"
style="width: 100%"
v-model="pageForm.personType"
></dict-select>
</div>
</div>
<div class="search-query">
<el-button @click="doSearch();unionGroupChange()" icon="el-icon-search" type="primary">搜索</el-button>
</div>
@@ -86,7 +100,7 @@ layout("/layouts/platform.html"){
type="primary"
v-if="judgmentAuthority"
>
导出各基层工会福利签领表
导出各分工会福利签领表
</el-button>
<el-button
@@ -105,7 +119,7 @@ layout("/layouts/platform.html"){
type="primary">按品牌导出全部(蛋糕券)
</el-button>-->
<template v-if="judgmentAuthority || ${@shiro.hasRole('H04') || @shiro.hasRole('gh12')}">
<template v-if="judgmentAuthority || ${@shiro.hasRole('H04') || @shiro.hasRole('gh01') || @shiro.hasRole('gh12')}">
<el-button
:disabled="!pageForm.projectId"
@click="exportReceiveDetail(true)"
@@ -138,12 +152,19 @@ layout("/layouts/platform.html"){
<!-- @click="exportByUnionGroup">按工会小组导出汇总表-->
<!-- </el-button>-->
</template>
<template v-if="judgmentAuthority">
<el-button :disabled="!pageForm.projectId" @click="exportByUnion" icon="el-icon-printer" size="small" type="primary">
导出基层工会/福利套餐汇总表
<!--<template
v-if="judgmentAuthority">
<el-button :disabled="!pageForm.projectId" @click="reimbursementDialog = true"
icon="el-icon-printer"
size="small"
type="primary">导出发放清单
</el-button>
<el-button @click="selectOptionByAdmin" icon="el-icon-printer" size="small" type="primary">管理员代选择</el-button>
</template>
<el-button @click="selectOptionByAdmin"
icon="el-icon-printer"
size="small"
type="primary">管理员代选择
</el-button>
</template>-->
</template>
</table-tool>
<el-table
@@ -309,6 +330,19 @@ layout("/layouts/platform.html"){
<el-button @click="doSelectByAdmin" type="primary">提交</el-button>
</el-row>
</el-dialog>
<el-dialog :visible.sync="reimbursementDialog" title="导出发放清单" width="40%">
<el-radio-group v-model="reimbursementPersonType" size="small">
<el-radio label="在职人员" border>在职人员</el-radio>
<el-radio label="劳务派遣人员" border>劳务派遣人员</el-radio>
<el-radio label="空状态" border>空状态</el-radio>
<el-radio label="全部" border>全部</el-radio>
</el-radio-group>
<span class="dialog-footer" slot="footer">
<el-button @click="reimbursementDialog = false">取消</el-button>
<el-button @click="exportByUnion" type="primary">导出</el-button>
</span>
</el-dialog>
</div>
<script>
@@ -328,7 +362,8 @@ layout("/layouts/platform.html"){
month: "",
unionGroupId: "",
year: "",
welfareUnitCode: ""
welfareUnitCode: "",
personType: ""
},
unions: [],
tableColumns: [],
@@ -383,7 +418,10 @@ layout("/layouts/platform.html"){
projectInfo: {},
viewTableWrapHeight: 500,
judgmentAuthority
judgmentAuthority,
reimbursementDialog: false,
reimbursementPersonType: null
}
},
computed: {
@@ -614,6 +652,10 @@ layout("/layouts/platform.html"){
this.unclaimedPageData()
},
exportByUnion() {
if (!this.reimbursementPersonType) {
this.$message.warning("请先选择需要导出的人员类型")
return
}
const { projectId, welfareUnitCode } = this.pageForm
window.open(
loc() +
@@ -622,8 +664,11 @@ layout("/layouts/platform.html"){
"&welfareUnitCode=" +
(welfareUnitCode ? welfareUnitCode : "") +
"&month=" +
this.pageForm.month
this.pageForm.month +
"&personType=" +
this.reimbursementPersonType
)
this.reimbursementDialog = false
},
exportByUnit() {
const { projectId, welfareUnitCode } = this.pageForm
@@ -3,8 +3,6 @@ layout("/layouts/platform.html"){
#-->
<style>
.optionImg {
display: grid;
place-items: center;
@@ -49,7 +47,6 @@ layout("/layouts/platform.html"){
}
</style>
<div id="app" v-cloak>
<guava :edit_scroll="false" ref="guava">
<template>
@@ -59,50 +56,59 @@ layout("/layouts/platform.html"){
<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>
@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>
<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>
<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
: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">
: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')}}
<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>
@@ -122,12 +128,9 @@ layout("/layouts/platform.html"){
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作"
prop="userOnline" width="150px">
<el-table-column align="center" header-align="center" label="操作" prop="userOnline" width="150px">
<template scope="{row}">
<el-button type="primary" size="mini" @click="openChoose(row)">
{{confirmButtonInfo(row).text}}
</el-button>
<el-button type="primary" size="mini" @click="openChoose(row)">{{confirmButtonInfo(row).text}}</el-button>
<!-- <el-button @click="openChoose(row)" size="mini" type="primary"-->
<!-- v-if="new Date().getTime()>moment(row.choiceTimeStart).valueOf()-->
@@ -143,7 +146,6 @@ layout("/layouts/platform.html"){
<!-- </template>-->
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
@@ -153,29 +155,20 @@ layout("/layouts/platform.html"){
<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>
<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}}
</el-form-item>
<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-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-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-form-item label="最多选几个">{{projectInfo.multiSelectNum}}个</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="发放形式">
@@ -194,91 +187,76 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-col>
<el-col span="8">
<el-form-item label="选择时间">
{{projectInfo.choiceTimeStart}}至{{projectInfo.choiceTimeEnd}}
</el-form-item>
<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 shadow="never"
style="margin: 5px;">
<div slot="header" style="display: flex;justify-content: space-between">
<div style="color:#000;font-size: 18px">
{{option.optionName}}
</div>
<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 shadow="never" 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>
<el-button @click.stop="viewDesc(option)" type="text">套餐详情</el-button>
</div>
</div>
<div style="display: flex">
<el-image
style="width: 150px;height: 150px;"
<div style="display: grid; grid-template-rows: auto 1fr auto; height: 200px">
<div style="display: flex">
<el-image
style="width: 150px; height: 150px"
:src="CREATE_PREVIEW_URL(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 placement="top" :content="option.supplier">
<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">
{{option.simpleDesc}}
</span>
</div>
<div>
<el-input-number :disabled="isView"
:max="option.maxNum"
:min="0"
@change="numChange(option.selectNum,option,oidx)"
style="width: 150px;position: absolute;right: 0;bottom: 0;"
v-model="option.selectNum"></el-input-number>
></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 placement="top" :content="option.supplier">
<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"></span>
<span class="desc_value">{{ option.simpleDesc }}</span>
</div>
<div>
<el-input-number
:disabled="isView"
:max="option.maxNum"
:min="0"
@keydown.native="onKeydown"
@change="numChange(option.selectNum, option, oidx)"
style="width: 150px; position: absolute; right: 0; bottom: 0"
v-model="option.selectNum"
></el-input-number>
</div>
</div>
</div>
<div style="margin-top: 17px">
<el-select
style="width: 100%"
clearable
:disabled="option.selectNum == 0"
placeholder="请选择取货门店"
v-model="option.receiveAddress"
>
<el-option
v-for="item in option.receiveAddressList"
:key="item.address"
:label="item.address"
:value="item.address"
></el-option>
</el-select>
</div>
</div>
<!-- <el-row :gutter="10">-->
<!-- <el-col :span="24">-->
<!-- <div class="optionImg">-->
<!-- <el-image-->
<!-- :src="CREATE_PREVIEW_URL(option.imgUrl)"-->
<!-- fit="contain"-->
<!-- ></el-image>-->
<!-- </div>-->
<!-- </el-col>-->
<!-- </el-row>-->
<!-- <div class="descriptionClass" style="white-space: pre-line">-->
<!-- {{option.supplier}}-->
<!-- </div>-->
<!-- <el-row style="text-align: right">-->
<!-- <el-input-number :disabled="isView"-->
<!-- :max="option.maxNum"-->
<!-- :min="0"-->
<!-- @change="numChange(option.selectNum,option,oidx)"-->
<!-- style="width: 50%"-->
<!-- v-model="option.selectNum"></el-input-number>-->
<!-- </el-row>-->
</el-card>
</el-col>
</div>
@@ -291,58 +269,68 @@ layout("/layouts/platform.html"){
<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-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>
: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>
<el-button @click="openAddress" type="primary">添加收货地址</el-button>
</div>
</div>
<span style="color: #ac3111">
温馨提示:填写默认收货地址后,系统会自动选择默认地址;如未设置默认,请您在添加收货地址后在此下拉框进行选择
</span>
</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>
: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="sign" v-if="projectInfo.signMode===2">
<el-form-item
:rules="{required:true,message: '请签字', trigger: 'blur'}"
label="签字"
prop="sign"
v-if="projectInfo.signMode===2"
>
<template v-if="isChoice===0||!isView">
<sign :is_value_base64="false" :qz.sync="formData.sign"
prefix="welfare"
ref="sign"></sign>
<sign :is_value_base64="false" :qz.sync="formData.sign" prefix="welfare" ref="sign"></sign>
</template>
<template v-else>
<el-image :src="'/signature/getSignData?path=' +formData.imageUrl"
fit="contain"
style="height: 100px;width: 100%" v-if="formData.imageUrl">
</el-image>
<el-image
:src="'/signature/getSignData?path=' +formData.imageUrl"
fit="contain"
style="height: 100px; width: 100%"
v-if="formData.imageUrl"
></el-image>
<span v-else>暂无</span>
</template>
</el-form-item>
</el-form>
</el-card>
@@ -354,85 +342,76 @@ layout("/layouts/platform.html"){
</template>
</guava>
<el-drawer
:visible.sync="descDialogVisible"
direction="rtl"
size="50%"
title="福利详情">
<el-drawer :visible.sync="descDialogVisible" direction="rtl" size="50%" title="福利详情">
<el-card style="margin: 20px" shadow="never">
<div v-html="descData"></div>
</el-card>
</el-drawer>
<el-dialog
:close-on-click-modal="false"
:visible.sync="addressDialogVisible"
title="收货地址"
width="30%">
<el-form :model="formData" label-position="right"
label-suffix=":" label-width="120px" ref="addForm">
<el-dialog :close-on-click-modal="false" :visible.sync="addressDialogVisible" title="收货地址" width="40%">
<el-form :model="formData" label-position="right" :rules="formRules" label-suffix=":" label-width="120px" ref="addForm">
<el-row :gutter="60">
<el-col :span="24">
<el-form-item :rules="{required:true,message: '请选择地址信息', trigger: 'blur'}"
label="地址信息"
prop="addressList">
<el-form-item 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">
<el-form-item
:rules="{required:true,message: '请填写您的详细地址', trigger: 'blur'}"
label="详细地址"
prop="addressDetail">
<el-input maxlength="100"
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
rows="3"
show-word-limit
type="textarea"
v-model="formData.addressDetail"></el-input>
<el-form-item label="详细地址" prop="addressDetail">
<el-input
maxlength="100"
placeholder="请输入详细地址信息,如道路、门牌号、小区、楼栋号、单元等信息"
rows="3"
show-word-limit
type="textarea"
v-model="formData.addressDetail"
></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
:rules="{required:true,message: '请填写收货人姓名', trigger: 'blur'}"
label="收货人姓名"
prop="userName">
<el-input maxlength="11"
placeholder="请填写收货人姓名"
v-model="formData.userName"></el-input>
<el-form-item label="收货人姓名" prop="userName">
<el-input maxlength="11" placeholder="请填写收货人姓名" v-model="formData.userName"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
: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 label="手机号码" prop="tel">
<el-input maxlength="11" placeholder="请填写手机号码" clearable v-model="formData.tel"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="是否默认" prop="isDefault">
<el-switch
v-model="formData.isDefault"
active-color="#13ce66"
inactive-color="#ff4949"
active-value="1"
inactive-value="0"
active-text="是"
inactive-text="否"
></el-switch>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span class="dialog-footer" slot="footer">
<el-button @click="addressDialogVisible = false">取 消</el-button>
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
</span>
<el-button @click="addressDialogVisible = false">取 消</el-button>
<el-button @click="doSaveUserAddress" type="primary">保存</el-button>
</span>
</el-dialog>
</div>
<script>
const vue = new Vue({
el: '#app',
el: "#app",
mixins: [initTableMixins],
data() {
return {
@@ -450,56 +429,78 @@ layout("/layouts/platform.html"){
welfareSubject: {},
pageForm: {
isChoose: false,
year: moment().format('YYYY')
year: moment().format("YYYY")
},
tableColumns: [
{prop: 'year', label: '年度'},
{prop: 'name', label: '项目名称'},
{prop: 'choiceTime', label: '选择时间'},
{prop: 'isChoose', label: '是否选择'},
{prop: 'gist_list', label: '所选福利'},
{prop: 'receiveAddress', label: '收货地址'},
{ prop: "year", label: "年度" },
{ prop: "name", label: "项目名称" },
{ prop: "choiceTime", label: "选择时间" },
{ prop: "isChoose", label: "是否选择" },
{ prop: "gist_list", label: "所选福利" },
{ prop: "receiveAddress", label: "收货地址" }
],
isView: false,
isChoice: false,
addressDialogVisible: false,
formRules: {
addressList: [{ required: true, message: "请选择地址信息", trigger: ["blur", "change"] }],
addressDetail: [{ required: true, message: "请填写您的详细地址", trigger: ["blur", "change"] }],
userName: [{ required: true, message: "请填写收货人姓名", trigger: ["blur", "change"] }],
tel: [
{ required: true, message: "必填", trigger: ["blur", "change"] },
{ pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号" }
]
},
// 供应商
shoppingType: [],
// 门店地址
offlineStoresOption: []
}
},
computed: {
sumSelectNum() {
if (this.projectInfo && this.projectInfo.welfareProjectSubjects) {
return this.projectInfo.welfareProjectSubjects[0].options.map(v => v.selectNum).reduce((accumulator, currentValue) => accumulator + currentValue, 0)
return this.projectInfo.welfareProjectSubjects[0].options
.map((v) => v.selectNum)
.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
}
return 0
},
}
},
methods: {
onKeydown(event) {
if (event.key !== "ArrowUp" && event.key !== "ArrowDown") {
event.preventDefault()
}
},
confirmButtonInfo(row) {
const {choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime} = row
const { choiceTimeEnd, choiceTimeStart, overdueChoiceTimeEnd, isChoose, selectTime } = row
const now = moment().valueOf()
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === '') {
if (overdueChoiceTimeEnd == null || overdueChoiceTimeEnd === "") {
if (now > moment(choiceTimeStart).valueOf() && now < moment(choiceTimeEnd).valueOf()) {
return {text: isChoose ? '确定修改' : '确定选择', disabled: false}
return { text: isChoose ? "修改" : "选择", disabled: false }
} else if (now > moment(choiceTimeEnd).valueOf()) {
return {text: '选择已结束', disabled: true}
return { text: "选择已结束", disabled: true }
} else if (now < moment(choiceTimeStart).valueOf()) {
return {text: '选择未开始', disabled: true}
return { text: "选择未开始", disabled: true }
}
} else {
//已选择了不能再动了
if (isChoose) {
if(moment(selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()){
return {text: '确定修改', disabled: false}
if (moment(selectTime).valueOf() > moment(choiceTimeEnd).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return { text: "修改", disabled: false }
}
return {text: '选择已结束', disabled: true}
return { text: "选择已结束", disabled: true }
} else {
if (now > moment(choiceTimeStart).valueOf() && now < moment(overdueChoiceTimeEnd).valueOf()) {
return {text: isChoose ? '确定修改' : '确定选择', disabled: false}
return { text: isChoose ? "修改" : "选择", disabled: false }
} else if (now > moment(overdueChoiceTimeEnd).valueOf()) {
return {text: '选择已结束', disabled: true}
return { text: "选择已结束", disabled: true }
} else if (now < moment(choiceTimeStart).valueOf()) {
return {text: '选择未开始', disabled: true}
return { text: "选择未开始", disabled: true }
}
}
}
@@ -509,12 +510,12 @@ layout("/layouts/platform.html"){
let provinceName = ""
let cityName = ""
let countyName = ""
const province = this.dzOptions.find(c => c.value === val[0])
const province = this.dzOptions.find((c) => c.value === val[0])
provinceName = province.label
const city = province.children.find(p => p.value === val[1])
const city = province.children.find((p) => p.value === val[1])
cityName = city.label
if (val.length === 3) {
const county = city.children.find(p => p.value === val[2])
const county = city.children.find((p) => p.value === val[2])
countyName = county.label
this.$set(this.formData, "areaCode", county.value)
} else {
@@ -523,7 +524,6 @@ layout("/layouts/platform.html"){
this.$set(this.formData, "province", provinceName)
this.$set(this.formData, "city", cityName)
this.$set(this.formData, "county", countyName)
}
},
openAddress() {
@@ -540,64 +540,56 @@ layout("/layouts/platform.html"){
this.doSearch()
this.$message({
message: resp.msg,
type: 'success'
});
type: "success"
})
await this.selectUserAddress()
this.addressDialogVisible = false
} else {
this.$message.error(resp.msg);
this.$message.error(resp.msg)
}
}
})
},
//数量更改
numChange(value, option, optionIndex) {
this.$nextTick(() => {
// 查找+1按钮
const plusButton = document.querySelector('.el-input-number__increase');
const plusButton = document.querySelector(".el-input-number__increase")
// 添加点击事件监听器
plusButton.addEventListener('click', this.handlePlusButtonClick(value, option, optionIndex));
plusButton.addEventListener("click", this.handlePlusButtonClick(value, option, optionIndex))
})
},
handlePlusButtonClick(value, option, optionIndex) {
const {
isCheckBox,
multiSelectNum,
singleOptionSupportMultipleSelection
} = this.projectInfo
if (isCheckBox === 'checkBox') {
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
if (isCheckBox === "checkBox") {
//判断是否支持单个多选
if (!singleOptionSupportMultipleSelection && value > 1) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', 1)
this.$message.warning('此套餐最多只能选择1份');
return;
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], "selectNum", 1)
this.$message.warning("此套餐最多只能选择1份")
return
}
}
//获取用户当前选择的数量
const selectNums = this.projectInfo.welfareProjectSubjects[0].options.map(v => v.selectNum)
const selectNums = this.projectInfo.welfareProjectSubjects[0].options.map((v) => v.selectNum)
const sum = selectNums.reduce((accumulator, currentValue) => accumulator + currentValue, 0)
if (sum > multiSelectNum) {
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], 'selectNum', value - 1)
this.$message.warning('此次福利最多只能选择' + multiSelectNum + '份');
this.$set(this.projectInfo.welfareProjectSubjects[0].options[optionIndex], "selectNum", value - 1)
this.$message.warning("此次福利最多只能选择" + multiSelectNum + "份")
}
},
async getProjectInfo(id) {
const resp = await $.get('/platform/welfare/common/findOne', {projectId: id})
const resp = await $.get("/platform/welfare/common/findOne", { projectId: id })
if (resp.code === 0) {
resp.data.multiSelectNum = resp.data.multiSelectNum ? resp.data.multiSelectNum : 1
this.projectInfo = resp.data
await this.getUserSelection(id)
await this.getChoice()
await this.getShoppingType()
}
},
async openView(row) {
this.isView = true
await this.getProjectInfo(row.id)
@@ -611,7 +603,7 @@ layout("/layouts/platform.html"){
this.$refs.guava.edit()
},
addressChange(val) {
const address = this.addressOptions.find(a => a.id === val)
const address = this.addressOptions.find((a) => a.id === val)
if (address) {
this.$set(this.formData, "receiveAddress", address.name)
}
@@ -619,54 +611,76 @@ layout("/layouts/platform.html"){
doChoose() {
this.$refs["addForm"].validate(async (valid) => {
if (valid) {
const {
isCheckBox,
multiSelectNum,
singleOptionSupportMultipleSelection
} = this.projectInfo
const { isCheckBox, multiSelectNum, singleOptionSupportMultipleSelection } = this.projectInfo
if (isCheckBox === "checkBox") {
if (this.sumSelectNum < multiSelectNum) {
//用户没有选择完
this.$message('一共可以选择' + multiSelectNum + '份,您目前只选择了' + this.sumSelectNum + '份,快去选择吧!')
this.$message.warning("一共可以选择" + multiSelectNum + "份,您目前只选择了" + this.sumSelectNum + "份,快去选择吧!")
return
}
} else {
if (this.sumSelectNum === 0) {
//用户选择了多份
this.$message.warning("您还没有选择福利套餐,快去选择吧!")
return
}
}
if (this.formData.receiveAddress == null || this.formData.receiveAddress === '') {
this.$message.warning('请填写收货地址')
return
}
if (this.formData.sign == null || this.formData.sign === '') {
this.$message.warning('请签字')
return
}
const formData = this.projectInfo.welfareProjectSubjects[0].options.filter(v => v.selectNum >= 1).map(v => {
return {
welfareId: this.projectInfo.id,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.formData.receiveAddress,
userSign: this.formData.sign,
selectNum: v.selectNum
// 判断门店是否选择
const chooseOptions = this.projectInfo.welfareProjectSubjects[0].options
.filter((v) => v.selectNum > 0)
.map((item) => {
return { optionName: item.optionName, selectNum: item.selectNum, receiveAddress: item.receiveAddress }
})
let isReceiveAddress = true
for (const item of chooseOptions) {
if (!item.receiveAddress) {
this.$message.warning(item.optionName + "还没有选择收货门店哦")
isReceiveAddress = false
break
}
})
const {
code,
msg,
data
} = await $.post('/platform/welfare/userChoose/confirmSelect', {
}
if (!isReceiveAddress) {
return
}
if (this.projectInfo.provideMode == 3) {
if (this.formData.receiveAddress == null || this.formData.receiveAddress === "") {
this.$message.warning("请填写收货地址")
return
}
}
if (![1, 4].includes(this.projectInfo.signMode)) {
if (this.formData.sign == null || this.formData.sign === "") {
this.$message.warning("请签字")
return
}
}
const formData = this.projectInfo.welfareProjectSubjects[0].options
.filter((v) => v.selectNum >= 1)
.map((v) => {
return {
welfareId: this.projectInfo.id,
subjectId: v.subjectId,
selectOptionId: v.id,
receiveAddress: this.projectInfo.provideMode === 3 ? this.formData.receiveAddress : v.receiveAddress,
userSign: this.formData.sign,
selectNum: v.selectNum
}
})
console.log(formData)
const { code, msg, data } = await $.post("/platform/welfare/userChoose/confirmSelect", {
welfareUserSelections: JSON.stringify(formData),
projectId: this.projectInfo.id
})
if (code === 0) {
this.$message({
message: msg,
type: 'success'
});
this.$message.success("您已完成本次福利选择。")
} else {
this.$message({
message: msg,
type: 'warning'
});
type: "warning"
})
}
this.doSearch()
this.$refs.guava.index()
@@ -695,7 +709,7 @@ layout("/layouts/platform.html"){
this.$set(this.formData, "addressId", null)
this.$set(this.formData, "sign", this.userSelection[0].userSign)
} else {
const address = this.addressOptions.find(a => a.isDefault)
const address = this.addressOptions.find((a) => a.isDefault)
if (address) {
this.$set(this.formData, "receiveAddress", address.name)
this.$set(this.formData, "addressId", address.id)
@@ -705,58 +719,67 @@ layout("/layouts/platform.html"){
},
//获取用户选择的数据
async getUserSelection(projectId) {
const resp = await $.get('/platform/welfare/mine/getUserSelection', {projectId: projectId})
const resp = await $.get("/platform/welfare/mine/getUserSelection", { projectId: projectId })
this.userSelection = resp.data
this.echoUserSelection()
},
//回显用户选择的数据
echoUserSelection() {
//获取用户当前选择的数量
this.projectInfo.welfareProjectSubjects[0].options.forEach(v => {
const option = this.userSelection.find(x => x.selectOptionId === v.id)
this.projectInfo.welfareProjectSubjects[0].options.forEach((v) => {
const option = this.userSelection.find((x) => x.selectOptionId === v.id)
if (option) {
v.selectNum = option.selectNum
this.$set(v, "receiveAddress", option.receiveAddress)
} else {
v.selectNum = 0
this.$set(v, "receiveAddress", "")
}
})
},
async getChoice() {
const resp = await $.get('/mobile/welfare/mine/isChoice', {projectId: this.projectInfo.id})
const resp = await $.get("/mobile/welfare/mine/isChoice", { projectId: this.projectInfo.id })
this.isChoice = resp.data
},
async selectUserAddress() {
const resp = await $.get('/platform/welfare/addressManage/selectUserAddress')
resp.data.map(r => {
const resp = await $.get("/platform/welfare/addressManage/selectUserAddress")
resp.data.map((r) => {
let defaultName = r.isDefault ? "默认地址" : ""
r.defaultName = defaultName
r.name = "收货地址:" + r.province + r.city + r.county + r.addressDetail + ",收件人:" + r.userName + ",联系方式:" + r.tel
})
this.addressOptions = resp.data
this.$nextTick(() => {
const address = this.addressOptions.find((v) => v.isDefault)
if (address) {
this.$set(this.formData, "addressId", address.id)
this.$set(this.formData, "receiveAddress", address.name)
}
})
},
// 获取供应商
async getShoppingType() {
const { data } = await $.get("/platform/shoppingType/apply/getShoppingType")
this.projectInfo.welfareProjectSubjects[0].options.forEach((item) => {
item.receiveAddressList = data.find((v) => v.id === item.shoppingId).offlineStores
})
console.log(this.projectInfo.welfareProjectSubjects[0])
}
},
async created() {
this.pageData()
this.selectUserAddress()
getEnumOptions("WelfareProvideMode").then(res => {
getEnumOptions("WelfareProvideMode").then((res) => {
this.welfareProvideMode = res
})
getEnumOptions("WelfareSignMode").then(res => {
getEnumOptions("WelfareSignMode").then((res) => {
this.welfareSignMode = res
})
/* if ("${@shiro.hasRole('sysadmin')}" === 'false') {
this.dzOptions = this.dzOptions.filter(d => d.label === "江苏省")
this.dzOptions[0].children = this.dzOptions[0].children.filter(d => d.label === "无锡市")
}*/
}
})
</script>
<!--#
}
#-->