Files
UNION_HUTB/target/classes/views/platform/fw/zgfl/hysrfl.html
T
2026-09-09 09:14:28 +08:00

1114 lines
49 KiB
HTML

<!--#
layout("/layouts/platform.html"){
#-->
<!--
会员生日福利页面
李耀威
2019 6 18
-->
<style>
.dia .el-dialog__body {
padding: 5px 20px;
}
.note {
width: 100%;
height: 200px;
}
.el-radio.is-bordered.is-disabled.is-checked {
/* cursor: not-allowed; */
border-color: #409EFF;
}
.el-radio__input.is-disabled .is-checked .el-radio__inner, .el-radio__input.is-disabled.is-checked .el-radio__inner {
background-color: #409EFF;
/*border-color: #E4E7ED; */
}
.tpa {
padding: 10px;
text-align: center;
width: 12%;
color: #777;
background-color: rgb(250, 250, 250);
border: 1px solid rgb(220, 220, 220);
}
.tpb {
padding: 10px;
text-align: center;
color: #333;
width: 15%;
border: 1px solid rgb(220, 220, 220);
}
.tpc {
padding: 10px;
color: #a0a9b4;
width: 15%;
border: 1px solid rgb(220, 220, 220);
}
.el-card__body {
padding: 0;
}
.myT .has-gutter tr th {
background-color: #F5F7FA;
}
</style>
<div id="app" v-cloak>
<el-row class="header navbar bg-white shadow">
<div class="btn-group tool-button mt5">
<el-input placeholder="请输入内容" v-model="pageForm.searchKeyword">
<el-select v-model="pageForm.searchName" slot="prepend" placeholder="查询" style="width: 100px;">
<el-option label="职工号" value="loginname"></el-option>
<el-option label="姓名" value="username"></el-option>
</el-select>
</el-input>
</div>
<div class="btn-group tool-button mt5">
<div class="block">
<el-date-picker
format="MM-dd"
v-model="pageForm.time"
type="daterange"
range-separator="——"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</div>
<!-- <div class="btn-group tool-button mt5">-->
<!-- <el-select clearable v-model="pageForm.hysrfl_fllx" placeholder="请选择福利类型">-->
<!-- <el-option-->
<!-- v-for="item in [{x:1,y:'礼品'},{x:2,y:'现金'}]"-->
<!-- :key="item.x"-->
<!-- :label="item.y"-->
<!-- :value="item.x">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </div>-->
<div class="btn-group tool-button mt5" v-if="identity==1||identity==3">
<el-select placeholder="请选择基层工会" v-model="pageForm.fghid" clearable="true" filterable="true"
style="width:200px;">
<el-option v-for="item in ghOptions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-button icon="el-icon-search" @click="doSearch"
style="background-color:#409eff;color: white;"></el-button>
</div>
<div class="pull-right offscreen-right mt5">
<el-button size="medium" type="warning" @click="openAdd"><i class="el-icon-s-promotion"></i> 生日福利发放
</el-button>
<!-- <el-button size="medium" type="warning" @click="firstDialogVisible=true"><i class="ti-plus"></i> 申请慰问</el-button>-->
</div>
</el-row>
<el-row class="el-table-container">
<el-table
@sort-change='pageOrder'
:data="tableData"
size="small"
header-align="center"
style="width: 100%"
>
<el-table-column label="序号" type="index" header-align="center" align="center">
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
</template>
</el-table-column>
<el-table-column
prop="loginname"
label="工号"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="username"
label="姓名"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable
prop="sex"
label="性别"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
prop="mobile"
label="电话"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable="true"
prop="birthday"
label="生日"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable="true"
prop="fghname"
label="所属基层工会"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<!-- <el-table-column-->
<!-- sortable-->
<!-- prop="hysrfl_fllx"-->
<!-- label="福利类型"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag v-if="scope.row.hysrfl_fllx==1">礼品</el-tag>-->
<!-- <el-tag type="success" v-if="scope.row.hysrfl_fllx==2">现金</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column-->
<!-- sortable-->
<!-- prop="hysrfl_sfqs"-->
<!-- label="是否签收"-->
<!-- header-align="center"-->
<!-- align="center"-->
<!-- :show-overflow-tooltip="true">-->
<!-- <template slot-scope="scope">-->
<!-- <i v-if="scope.row.hysrfl_sfqs == 0" class="fa fa-circle text-danger ml5"> &nbsp;未领取</i>-->
<!-- <i v-if="scope.row.hysrfl_sfqs == 1" class="fa fa-circle text-success ml5"> &nbsp;已领取</i>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column
prop="userOnline"
label="操作"
header-align="center"
align="center">
<template slot-scope="scope">
<el-button type="success" size="mini" @click="openDetail(scope.row.id)">查看</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
<el-row class="el-pagination-container">
<el-pagination
@size-change="pageSizeChange"
@current-change="pageNumberChange"
:current-page="pageForm.pageNumber"
:page-sizes="[10, 20, 30, 50]"
:page-size="pageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="pageForm.totalCount">
</el-pagination>
</el-row>
<el-dialog
width="30%"
class="ViewDialogClass"
title="填写礼品详情"
:close-on-click-modal="false"
:visible.sync="lpxqDialogVisible"
@close="nowNIndex=-1;lpxq=''"
>
<el-input type="textarea" :autosize="{ minRows: 4, maxRows: 8}" maxlength="1000"
placeholder="请填写礼品详情" size="mini" v-model="lpxq"></el-input>
<span slot="footer" class="dialog-footer">
<el-button type="primary"
@click="lpxqDialogVisible=false;nData[nowNIndex].hysrfl_lpxq=lpxq">保 存</el-button>
</span>
</el-dialog>
<el-dialog
class="ViewDialogClass"
title="生日福利发放"
:close-on-click-modal="false"
:visible.sync="addDialogVisible"
@close="kxryClose()"
:width="nWidth">
<div v-show="firstDialogVisible==true">
<el-divider content-position="left" class="dia"><span style="color: #3ea1ec;">此后三个月生日的会员</span></el-divider>
<el-row style="margin-bottom: 15px;">
<div class="btn-group tool-button mt5">
<el-input size="mini" v-model="kxryPageForm.name" placeholder="请输入工号或姓名查找"
style="width: 200px"></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button size="mini" type="primary" icon="el-icon-search" @click="kxrySearch"></el-button>
</div>
</el-row>
<el-row>
<el-table
ref="kxryTableData"
:row-key="getRowKeys"
reserve-selection="true"
:data="kxryTableData"
size="small"
header-align="center"
style="width: 100%"
@select="kxrySelect"
@select-all="kxrySelectAll"
>
<el-table-column
type="selection"
width="30">
</el-table-column>
</el-table-column>
<el-table-column
prop="loginname"
label="教工号"
header-align="center"
align="center"
>
</el-table-column>
<el-table-column
prop="username"
label="姓名"
header-align="center"
align="center"
:show-overflow-tooltip="true"
>
</el-table-column>
<el-table-column
sortable
prop="sex"
label="性别"
header-align="center"
align="center"
>
</el-table-column>
<el-table-column
prop="mobile"
label="电话"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable
prop="birthday"
label="生日"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable
prop="fghname"
label="所属基层工会"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
</el-row>
<el-row style="margin-top: 15px">
<el-pagination
@size-change="kxryPageSizeChange"
@current-change="kxryPageNumberChange"
:current-page="kxryPageForm.pageNumber"
:page-sizes="[5, 10]"
:page-size="kxryPageForm.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="kxryPageForm.totalCount">
</el-pagination>
</el-row>
</div>
<div v-show="secondDialogVisible==true">
<el-row style="margin-bottom: 15px; text-align: right">
<div class="btn-group tool-button mt5">
<el-select clearable size="mini"
v-model="tyfllx"
@change="tyfllxSz"
placeholder="统一设置福利类型">
<el-option
v-for="item in [{x:1,y:'礼品'},{x:2,y:'现金'}]"
:key="item.x"
:label="item.y"
:value="item.x">
</el-option>
</el-select>
</div>
<div class="btn-group tool-button mt5">
<el-input size="mini" v-model.number="tylpje" @keyup.enter.native="tylpjeSz" style="width: 200px"
@blur="tylpjeSz" @keydown.native="inputNumLimit" placeholder="统一设置礼品金额">
<template slot="prepend"></template>
</el-input>
</div>
</el-row>
<el-row>
<el-table
class="myT"
:data="nData"
border
show-summary
style="width: 100%">
<el-table-column
prop="loginname"
label="工号"
align-="center"
header-align="center"
width="100px"
align="center">
</el-table-column>
<el-table-column
prop="username"
header-align="center"
align="center"
label="姓名">
</el-table-column>
<el-table-column
sortable
prop="sex"
header-align="center"
align="center"
label="性别">
</el-table-column>
<el-table-column
sortable
prop="birthday"
label="生日"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
header-align="center"
align-="center"
label="福利类型"
width="170px"
>
<template slot-scope="scope">
<el-select clearable v-model="scope.row.hysrfl_fllx" size="mini"
placeholder="请选择福利类型">
<el-option
v-for="item in [{x:1,y:'礼品'},{x:2,y:'现金'}]"
:key="item.x"
:label="item.y"
:value="item.x">
</el-option>
</el-select>
<el-input v-if="scope.row.hysrfl_fllx==1" type="text" :autosize="{ minRows: 4, maxRows: 8}" maxlength="1000"
placeholder="请填写礼品详情" size="mini" v-model="scope.row.hysrfl_lpxq"></el-input>
</template>
</el-table-column>
<el-table-column
prop="hysrfl_lpje"
header-align="center"
align-="center"
label="礼品金额"
width="180px"
>
<template slot-scope="scope">
<!--<el-input size="mini" @keydown.native="inputNumLimit" v-model.number="scope.row.hysrfl_lpje"
placeholder="礼品金额">
<template slot="prepend">¥</template>
</el-input>-->
<el-input-number style="width: 100%" size="mini" v-model="scope.row.hysrfl_lpje" :min="0" controls-position="right" :step="100">
</el-input-number>
</template>
</el-table-column>
</el-table>
</el-row>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="kxryClose()">取 消</el-button>
<el-button type="primary" v-if="firstDialogVisible==true&&isNext==true"
@click="next">下一步</el-button>
<el-button type="primary" v-if="firstDialogVisible==true&&isNext==false" disabled>下一步</el-button>
<el-button type="primary" v-if="secondDialogVisible==true"
@click="function(){firstDialogVisible=true;secondDialogVisible=false;nWidth='50%'}">上一步</el-button>
<el-button type="success" v-if="secondDialogVisible==true" @click="doSubmit">提 交</el-button>
</span>
</el-dialog>
<el-dialog
class="ViewDialogClass"
title="生日福利编辑"
:close-on-click-modal="false"
:visible.sync="editDialogVisible"
width="30%">
<el-form :model="formData" ref="editForm" :label-position="'top'" :rules="formRules" size="small"
label-width="100px">
<el-form-item prop="hysrfl_fllx" label="福利类型">
<el-select v-model="formData.hysrfl_fllx"
placeholder="选择福利类型" style="width: 100%">
<el-option
v-for="item in [{x:1,y:'礼品'},{x:2,y:'现金'}]"
:key="item.x"
:label="item.y"
:value="item.x">
</el-option>
</el-select>
</el-form-item>
<el-form-item class="is-required" prop="hysrfl_xjje" v-show="formData.hysrfl_fllx==2" label="现金金额">
<el-input placeholder="请填写现金金额" v-model="formData.hysrfl_xjje"></el-input>
</el-form-item>
<el-form-item prop="hysrfl_lpxq" class="is-required" v-show="formData.hysrfl_fllx==1"
style="white-space:normal"
label="礼品详情">
<el-input
type="textarea"
:autosize="{ minRows: 5, maxRows: 10}"
placeholder="请填写礼品详情"
v-model="formData.hysrfl_lpxq">
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="editDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="doEdit">确 认</el-button>
</span>
</el-dialog>
<el-dialog
custom-class="ViewDialogClass"
title="生日福利详情"
:visible.sync="roleDialogVisible"
width="45%"
>
<el-collapse v-model="activeName">
<el-collapse-item title="用户信息" name="1">
<el-card>
<div>
<table style="width: 100%">
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">&emsp;&emsp;</td>
<td class="tpb">{{roleData.user.username}}</td>
<td class="tpa">&emsp;&emsp;</td>
<td class="tpb">{{roleData.user.sex}}</td>
<td class="tpa">出生日期</td>
<td class="tpb">{{roleData.user.birthday}}</td>
<!-- <td rowspan="3">-->
<!-- <img v-if="roleData.user.imgurl!=''&&roleData.user.imgurl!=null" :src="showPic"-->
<!-- style="height: 140px;width: 100%;border:none">-->
<!-- <div v-if="(roleData.user.imgurl==''||roleData.user.imgurl==null)"-->
<!-- style="text-align: center">-->
<!-- <el-label>暂无图片</el-label>-->
<!-- </div>-->
<!-- </td>-->
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">出生地点</td>
<td class="tpb">{{roleData.user.csdd}}</td>
<td class="tpa">&emsp;&emsp;</td>
<td class="tpb">{{roleData.user.mz}}</td>
<td class="tpa">政治面貌</td>
<td class="tpb">{{roleData.user.zzmc}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa">&emsp;&emsp;</td>
<td class="tpb">{{roleData.user.gz}}</td>
<td class="tpa">&emsp;&emsp;</td>
<td class="tpb">{{roleData.user.zc}}</td>
<td class="tpa">联系电话</td>
<td class="tpb">{{roleData.user.mobile}}</td>
</tr>
<tr style="border: 1px solid rgb(220,220,220);">
<td class="tpa" colspan="1">所在部门</td>
<td class="tpb" colspan="1">{{roleData.user.unitname}}</td>
<td class="tpa" colspan="1">所属基层工会</td>
<td class="tpb" colspan="1">{{roleData.user.fghname}}</td>
<td class="tpa" colspan="1">现任职务</td>
<td class="tpb" colspan="2">{{roleData.user.zw}}</td>
</tr>
<!-- <tr style="border: 1px solid rgb(220,220,220);">-->
<!-- <td class="tpa" colspan="7">个 人 简 历</td>-->
<!-- </tr>-->
<!-- <tr style="border: 1px solid rgb(220,220,220);">-->
<!-- <td class="tpb" colspan="7" v-if="(typeof(roleData.user.grjl)==='undefined')">暂无个人简历信息-->
<!-- </td>-->
<!-- <td class="tpc" colspan="7" v-if="!(typeof(roleData.user.grjl)==='undefined')">-->
<!-- <div v-html="roleData.user.grjl"></div>-->
<!-- </td>-->
<!-- </tr>-->
<!-- <tr style="border: 1px solid rgb(220,220,220);">-->
<!-- <td class="tpa" colspan="7">家 庭 成 员</td>-->
<!-- </tr>-->
<!-- <tr style="border: 1px solid rgb(220,220,220);">-->
<!-- <td class="tpb" colspan="7" v-if="(typeof(roleData.user.jtcy)==='undefined')">暂无家庭成员信息-->
<!-- </td>-->
<!-- <td class="tpc" colspan="7" v-if="!(typeof(roleData.user.jtcy)==='undefined')">-->
<!-- <div v-html="roleData.user.jtcy"></div>-->
<!-- </td>-->
<!-- </tr>-->
</table>
</div>
</el-card>
</el-collapse-item>
<el-collapse-item title="发放福利记录" name="2">
<el-card>
<el-table
:data="roleData.fl"
size="small"
header-align="center"
style="width: 100%"
>
<el-table-column
sortable="true"
prop="hysrfl_ffflsj"
label="发放时间"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable
prop="hysrfl_fllx"
label="福利类型"
header-align="center"
align="center"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<el-tag v-if="scope.row.hysrfl_fllx==1">礼品</el-tag>
<el-tag type="success" v-if="scope.row.hysrfl_fllx==2">现金</el-tag>
</template>
</el-table-column>
<el-table-column
prop="hysrfl_lpxq"
label="礼品详情"
header-align="center"
align="center"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span v-if="typeof(scope.row.hysrfl_lpxq)==='undefined'"></span>
<span v-if="!(typeof(scope.row.hysrfl_lpxq)==='undefined')">{{scope.row.hysrfl_lpxq}}</span>
</template>
</el-table-column>
<el-table-column
sortable="true"
prop="hysrfl_lpje"
label="礼品金额"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
sortable
prop="hysrfl_sfqs"
label="是否签收"
header-align="center"
align="center"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<i v-if="scope.row.hysrfl_sfqs == 0" class="fa fa-circle text-danger ml5"> &nbsp;未领取</i>
<i v-if="scope.row.hysrfl_sfqs == 1" class="fa fa-circle text-success ml5">
&nbsp;已领取</i>
</template>
</el-table-column>
<el-table-column
sortable="true"
prop="ffr"
label="发放人"
header-align="center"
align="center"
:show-overflow-tooltip="true">
</el-table-column>
</el-table>
</el-card>
</el-collapse-item>
</el-collapse>
</el-collaps>
<span slot="footer" class="dialog-footer">
<el-button type="danger" @click="roleDialogVisible = false">关 闭</el-button>
</span>
</el-dialog>
</div>
<script>
var vue = new Vue({
el: "#app",
data: function () {
var self = this
var validateLpxq = function (rule, value, callback) {
if ((self.formData.hysrfl_fllx == 1) && typeof (value) === "undefined") {
callback(new Error(''));
} else if ((self.formData.hysrfl_fllx == 1) && value == '') {
callback(new Error(''));
} else {
callback()
}
};
var validateXjje = function (rule, value, callback) {
console.log(self.formData.hysrfl_fllx + "-----" + value)
if (self.formData.hysrfl_fllx == 2 && typeof (value) === "undefined") {
callback(new Error(''));
} else if (self.formData.hysrfl_fllx == 2 && value == '') {
callback(new Error(''));
} else {
callback()
}
};
return {
tylpje: '',
tyfllx: '',
lpxq: '',
nowNIndex: -1,
lpxqDialogVisible: false,
showPic: '',
activeName: ["1", '2'],
kxryPageForm: {
pageNumber: 1,
pageSize: 5,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
kxryTableData: [],
sy: '',
nowNIndex: -1,
nWidth: '50%',
isNext: false,
nData: [],
rys: [],
roleData: {user: {}, fl: []},
roleDialogVisible: false,
addDialogVisible: false,
editDialogVisible: false,
firstDialogVisible: false,
secondDialogVisible: false,
wwsq_id: '',
identity: 0,
ghOptions: [],
tableData: [],
pageForm: {
time: [],
searchName: "",
searchKeyword: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
},
formData: {},
formRules: {
// wwsq_bwwrs: [{validator: validateUser, trigger: ['blur', 'change']}],
hysrfl_fllx: [{required: true, message: '', trigger: ['blur', 'change']}],
hysrfl_lpxq: [{validator: validateLpxq, message: '', trigger: ['blur', 'change']}],
hysrfl_xjje: [{validator: validateXjje, message: '', trigger: ['blur', 'change']}],
},
}
},
methods: {
tyfllxSz: function () {
var self = this
self.nData.forEach(function (value) {
value.hysrfl_fllx = self.tyfllx
})
var table = self.nData;
self.nData = []
setTimeout(function () {
self.nData = table
}, 1)
},
tylpjeSz: function () {
var self = this
self.nData.forEach(function (value) {
value.hysrfl_lpje = self.tylpje
})
var table = self.nData;
self.nData = []
setTimeout(function () {
self.nData = table
}, 1)
},
inputNumLimit: function (e) {
let num = e.target.value || ''
let code = e.which || e.keyCode
let str = (e.key && e.key != 'Unidentified') ? e.key : num.substr(num.length - 1)
console.log('|type:' + e.type + '|code:' + code + '|str:' + str + '|value:' + num)
//无论任何情况,皆可执行
if (code == '8') {
return true
}
//没有满足任何一种情况,中断执行
if (!(/[\d.]/.test(str) || code == '190')) {
e.returnValue = false
return false
}
if (num.length > 12 ||
(num.indexOf('.') >= 0 && code == '190') ||
((num.indexOf('.') == num.length - 3) && num.length > 3) ||
(num.length == 0 && code == '190')) {
e.returnValue = false
return false
}
return true
},
openWriteLpxq: function (scope) {
var self = this;
self.nowNIndex = scope.$index
self.lpxqDialogVisible = true;
self.lpxq = self.nData[self.nowNIndex].hysrfl_lpxq
},
kxrySearch: function () {
var self = this
self.kxryPageForm.pageNumber = 1;
self.kxryPageData();
},
doDelete: function (id) {
this.findMedicalByTime = function (ONDate, OFFDate) {
alert(159456)
var parms = {'ONDate': ONDate, 'OFFDate': OFFDate}
return $http.post("finance/findMedicalByTime", {ONDate: ONDate, OFFDate: OFFDate});
}
var self = this;
this.$confirm('确定要删除吗', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: function (a, b) {
if ("confirm" == a) {//确认后再执行
$.post(base + "/platform/zgfw/hysrfl/delete", {hysrfl_id: id}, function (data) {
if (data.code == 0) {
self.$message({
message: data.msg,
type: 'success'
});
self.pageData();
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
}
});
},
doEdit: function () {
var self = this;
self.$refs["editForm"].validate(function (valid) {
if (valid) {
$.post(base + "/platform/zgfw/hysrfl/editDo", self.formData, function (data) {
if (data.code == 0) {
self.$message({
message: data.msg,
type: 'success'
});
self.pageData();//查询是带条件的,加载新建用户选择的单位用户数据
self.editDialogVisible = false;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
});
},
openEdit: function (id) {
var self = this;
this.formData = {};
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
$.get("/platform/zgfw/hysrfl/edit", {hysrfl_id: id}, function (data) {
if (data.code == 0) {
self.formData = data.data
self.editDialogVisible = true
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, 'json')
},
kxryClose: function () {
var self = this
self.pushRys();
self.nData = [];
for (var i = 0; i < self.kxryTableData.length; i++) {
self.$refs.kxryTableData.toggleRowSelection(self.kxryTableData[i], false);
}
self.addDialogVisible = false;
self.isNextFun()
},
openAdd: function () {
var self = this;
this.tyfllx=''
this.tylpje=''
this.addDialogVisible = true;
this.firstDialogVisible = true;
this.secondDialogVisible = false;
this.kxryPageForm = {
pageNumber: 1,
pageSize: 5,
totalCount: 0,
pageOrderName: "",
pageOrderBy: ""
}
this.kxryPageData()
this.formData = {};//打开新增窗口,表单先清空
if (this.$refs["addForm"])
this.$refs["addForm"].resetFields();
},
doSubmit: function () {
var self = this
var flag = true
self.nData.forEach(function (v1) {
if (typeof (v1.hysrfl_fllx) === "undefined" || v1.hysrfl_fllx == '') {
flag = false
self.$message({
message: '请填写' + v1.username + '的福利类型!',
type: 'error'
});
throw new Error("")
} else {
if (v1.hysrfl_fllx == 1) {
if (typeof (v1.hysrfl_lpxq) === "undefined" || v1.hysrfl_lpxq == '') {
flag = false
self.$message({
message: '请填写' + v1.username + '的礼品详情!',
type: 'error'
});
throw new Error("")
}
}else{
if (typeof (v1.hysrfl_lpje) === "undefined" || v1.hysrfl_lpje == '') {
flag = false
self.$message({
message: '请填写' + v1.username + '的礼品金额!',
type: 'error'
});
throw new Error("")
}
}
}
})
if (flag) {
var T = []
self.nData.forEach(function (v) {
T.push({
hysrfl_fllx: v.hysrfl_fllx,
wwsq_wwfs: v.wwsq_wwfs,
hysrfl_hyid: v.id,
hysrfl_lpxq: typeof (v.hysrfl_lpxq) === "undefined" ? null : v.hysrfl_lpxq,
hysrfl_lpje: v.hysrfl_lpje,
})
})
$.post(base + "/platform/zgfw/hysrfl/addDo", {data: JSON.stringify(T)}, function (data) {
if (data.code == 0) {
self.$message({
message: data.msg,
type: 'success'
});
self.pageData();//查询是带条件的,加载新建用户选择的单位用户数据
self.addDialogVisible = false;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, 'json')
}
},
next: function () {
var self = this
self.nWidth = '60%'
self.firstDialogVisible = false;
self.secondDialogVisible = true
self.nData = []
self.rys.forEach(function (value) {
value.forEach(function (v) {
self.nData.push(v)
})
})
},
isNextFun: function () {
var self = this
var count = 0
$(self.rys).each(function () {
count += this.length
})
self.isNext = count > 0 ? true : false
},
getRowKeys: function (row) {
return row.id;
},
kxryPageOrder: function (column) {//按字段排序
this.kxryPageForm.pageOrderName = column.prop;
this.kxryPageForm.pageOrderBy = column.order;
this.kxryPageData();
},
kxryPageNumberChange: function (val) {//页码更新操作
this.kxryPageForm.pageNumber = val;
this.kxryPageData();
var self = this
},
kxryPageSizeChange: function (val) {//分页大小更新操作
this.kxryPageForm.pageSize = val;
this.kxryPageData();
},
kxryPageData: function () {//加载分页数据
var self = this;
sublime.showLoadingbar();//显示loading
$.post(base + "/platform/zgfw/hysrfl/nearThreeMonthBirthdayUser", self.kxryPageForm, function (data) {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
self.kxryTableData = data.data.list;
self.kxryPageForm.totalCount = data.data.totalCount;
self.$nextTick(function () {
self.rys[self.kxryPageForm.pageNumber - 1].forEach(function (value, index) {
for (var i = 0; i < self.kxryTableData.length; i++) {
if (self.kxryTableData[i].id == value.id) {
self.$refs.kxryTableData.toggleRowSelection(self.kxryTableData[i]);
}
}
})
})
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
kxrySelectAll: function (val) {
var self = this
self.rys[self.kxryPageForm.pageNumber - 1] = val
self.isNextFun()
},
kxrySelect: function (val, row) {
var self = this
self.rys[self.kxryPageForm.pageNumber - 1] = val
self.isNextFun()
},
openDetail: function (id) {
var self = this;
$.get(base + "/platform/zgfw/hysrfl/queryDetail", {"userid": id}, function (data) {
if (data.code == 0) {
self.roleData = data.data;//加载后台表单数据
self.roleDialogVisible = true
self.showPic = base + "/platform/hy/hyda/showPic?filePath=" + data.data.user.imgurl;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json")
},
doSearch: function () {
if (this.pageForm.time != null) {
this.pageForm.beforeTime = this.pageForm.time[0]
this.pageForm.endTime = this.pageForm.time[1]
} else {
this.pageForm.beforeTime = null
this.pageForm.endTime = null
}
this.pageForm.pageNumber = 1;
this.pageData();
},
pageOrder: function (column) {//按字段排序
switch (column.order) {
case 'descending':
column.order = 'desc'
break
case "ascending":
column.order = 'asc'
break
}
this.pageForm.pageOrderName = column.prop;
this.pageForm.pageOrderBy = column.order;
this.pageData();
},
pageNumberChange: function (val) {//页码更新操作
this.pageForm.pageNumber = val;
this.pageData();
},
pageSizeChange: function (val) {//分页大小更新操作
this.pageForm.pageSize = val;
this.pageData();
},
pageData: function () {//加载分页数据
var self = this;
sublime.showLoadingbar();//显示loading
$.post(base + "/platform/zgfw/hysrfl/data", self.pageForm, function (data) {
sublime.closeLoadingbar();//关闭loading
if (data.code == 0) {
self.tableData = data.data.list;
self.pageForm.totalCount = data.data.totalCount;
} else {
self.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
},
getIdentity: function () {
var self = this
$.get(base + "/platform/zgfw/zgwwsh/getIdentity", function (data) {
self.identity = data
if (data == 1 || data == 3) {
self.queryAllFgh()
}
}, 'json')
},
queryAllFgh: function () {
var self = this
$.get(base + "/platform/zgfw/zgwwsh/queryAllFgh", function (data) {
self.ghOptions = data.data;
}, 'json')
},
pushRys: function () {
this.rys = []
for (var i = 0; i < 1000; i++) {
this.rys.push([])
}
}
},
created:
function () {
this.pushRys();
this.pageData();
this.getIdentity()
}
,
})
</script>
<!--#
}
#-->