Commit 56a76fbd by 彭祥礼

新增兑换券管理模块

parent 14e91fe4
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/manager/ciop';
// 楼长KPI管理
let initSubstName = (params) => postAction(prefix + "/yxtCoupon/initSubstName" , params);
let getSchoolNames = (params) => postAction(prefix + "/yxtCoupon/getSchoolNames" , params);
let uploadExcel = (params) => downFilePost(prefix + "/yxtCoupon/excelOut" , params);
let downloadMoBan = (params) => downFilePost(prefix + "/yxtCoupon/downloadMoBan" , params);
let yxtCouponList = (params) => postAction(prefix + "/yxtCoupon/list" , params);
let yxtCouponDelete = (params) => postAction(prefix + "/yxtCoupon/delete", params);
let yxtCouponInsert = (params) => postAction(prefix + "/yxtCoupon/insert" , params);
let yxtCouponUpdate = (params) => postAction(prefix + "/yxtCoupon/update",params);
export {
initSubstName,
getSchoolNames,
uploadExcel,
downloadMoBan,
yxtCouponList,
yxtCouponDelete,
yxtCouponInsert,
yxtCouponUpdate,
}
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/manager/ciop';
// 楼长KPI管理
let initSubstName = (params) => postAction(prefix + "/zjlWage/initSubstName" , params);
let getSchoolNames = (params) => postAction(prefix + "/zjlWage/getSchoolNames" , params);
let uploadExcel = (params) => downFilePost(prefix + "/zjlWage/excelOut" , params);
let downloadMoBan = (params) => downFilePost(prefix + "/zjlWage/downloadMoBan" , params);
let zjlSalaryList = (params) => postAction(prefix + "/zjlWage/list" , params);
let zjlSalaryDelete = (params) => postAction(prefix + "/zjlWage/delete", params);
let zjlSalaryInsert = (params) => postAction(prefix + "/zjlWage/insert" , params);
let zjlSalaryUpdate = (params) => postAction(prefix + "/zjlWage/update",params);
//生成楼长上月薪酬
let createSalary = (params) => postAction(prefix + "/zjlWage/createSalary",params);
export {
initSubstName,
getSchoolNames,
uploadExcel,
downloadMoBan,
zjlSalaryList,
zjlSalaryDelete,
zjlSalaryInsert,
zjlSalaryUpdate,
createSalary
}
......@@ -97,10 +97,6 @@
<template slot="productCreateTime" slot-scope="text">
{{ text | dayjs}}
</template>
<template slot="productState" slot-scope="text">
<p v-if="text=='0'">正常</p>
<p v-else=""></p>
</template>
<template slot="operation" slot-scope="text,record">
<span>
<a @click="modifyfunction(record)">KPI打分</a>
......
......@@ -41,9 +41,9 @@
<a-divider v-show="false" type="vertical"/>
<a-button v-show="false" @click="modifyfunction()" type="primary">添加</a-button>
<a-divider v-show="false" type="vertical"/>
<a-button v-show="false" @click="excelInto()" type="primary">KPI数据导入</a-button>
<a-button v-show="false" @click="excelInto()" type="primary">薪酬数据导入</a-button>
<a-divider type="vertical"/>
<a-button @click="excelOut()" type="primary">KPI数据导出</a-button>
<a-button @click="excelOut()" type="primary">薪酬数据导出</a-button>
</a-col>
</span>
</a-row>
......@@ -91,7 +91,7 @@
<a-col :md="24" :sm="12">
<p v-show="YRYMmoBan">
模板下载:
<a-button type="primary" @click="downloadMoBan">楼长薪管理信息模板</a-button>
<a-button type="primary" @click="downloadMoBan">楼长薪管理信息模板</a-button>
</p>
</a-col>
</a-row>
......@@ -291,18 +291,18 @@
//导出
exportFile(
uploadExcel(Object.assign(params, obj)),
"楼长薪管理信息" + nowdate + ".xlsx",
"楼长薪管理信息" + nowdate + ".xlsx",
);
},
excelInto() {
this.importTile = "批量导入楼长薪管理信息";
this.importTile = "批量导入楼长薪管理信息";
this.YRYMmoBan = true;
this.importUrl = "manager/ciop/lzWage/importDate";
this.createSalaryvisible = true
},
downloadMoBan: function () {
exportFile(downloadMoBan(), "楼长薪管理信息.xlsx");
exportFile(downloadMoBan(), "楼长薪管理信息.xlsx");
},
doPush(res) {
console.log(res);
......
......@@ -20,7 +20,6 @@
@panelChange="handlePanelChange"
style="width: 16rem;"
/>
<!--<a-month-picker type="" @change="onChange" v-model="queryParam.month" placeholder="选择月份" style="width: 8rem;"/>-->
</a-form-item>
</a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
......
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="3" :sm="6">
<a-form-item label="姓名">
<a-input placeholder="姓名" v-model="queryParam.name" style="width: 8rem;"></a-input>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="月份">
<a-range-picker
:placeholder="['开始月份', '结束月份']"
format="YYYYMM"
:value="queryParam.month"
:mode="tempMode"
@panelChange="handlePanelChange"
style="width: 16rem;"
/>
</a-form-item>
</a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="6" :sm="24">
<a-button @click="search()" type="primary">查询</a-button>
<!-- <a-divider v-show="false" type="vertical"/>-->
<!-- <a-button v-show="false" @click="modifyfunction()" type="primary">添加</a-button>-->
<a-divider type="vertical"/>
<a-button @click="excelInto()" type="primary">薪酬数据导入</a-button>
<a-divider type="vertical"/>
<a-button @click="excelOut()" type="primary">薪酬数据导出</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<a-modal
title="批量导入"
:visible="salaryModifyvisible"
@ok="createfunctionOk0"
@cancel="createfunctionCancel0"
html-type="submit"
width="800px"
>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p style="text-align:center">{{ importTile }}</p>
</a-col>
</a-row>
<import-btn :url="importUrl" :responseFun="doPush">
<a-tooltip placement="topLeft" title="导入文件" arrowPointAtCenter>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p>
选择文件:
<a-button type="primary">选择文件</a-button>
</p>
</a-col>
</a-row>
</a-tooltip>
</import-btn>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p v-show="YRYMmoBan">
模板下载:
<a-button type="primary" @click="downloadMoBan">总经理薪酬管理信息模板</a-button>
</p>
</a-col>
</a-row>
<a-row :gutter="24" :v-show="KDmoBan">
<a-col :md="24" :sm="12">
<p>说明:</p>
<p>1.批量导入请严格按照模版进行导入;</p>
</a-col>
</a-row>
</a-modal>
<!--列表-->
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling" :locale="emptyText">
<!--拦截器-->
<template slot="productLastUpdateTime" slot-scope="text">
{{ text | dayjs}}
</template>
<!--拦截器-->
<template slot="productCreateTime" slot-scope="text">
{{ text | dayjs}}
</template>
<template slot="productState" slot-scope="text">
<p v-if="text=='0'">正常</p>
<p v-else=""></p>
</template>
<template slot="operation" slot-scope="text,record">
<span>
<!--<a v-show="false" @click="modifyfunction(record)">编辑</a>
<a-divider v-show="false" type="vertical"/>-->
<a-popconfirm title="确定删除吗?" @confirm="remove(record.id)">
<a>删除</a>
</a-popconfirm>
</span>
</template>
</s-table>
</div>
</template>
<script>
import STable from '@/components/table';
import ImportBtn from "../../../components/sysmanage/ImportBtn";
import {
zjlSalaryList, zjlSalaryDelete, uploadExcel, downloadMoBan,createSalary
} from "@/api/school-center/zjlSalaryManagerAPI"
import {cloneObject, exportFile} from '@/utils/util';
import Vue from 'vue';
import {DatetimePicker} from 'vant';
import moment from "moment";
import ConstantActivity from "@/constant/ConstantActivity";
Vue.use(DatetimePicker);
export default {
name: "zjlSalary",
components: {
STable, ImportBtn
},
data() {
return {
emptyText: {emptyText: '暂无数据'},
modifyvisible: false,
salaryModifyvisible: false,
title: ConstantActivity.title,
queryParam: {
name: '',
month: '',
},
columns: [
{dataIndex: 'month', width: 80, title: '月份 '},
{dataIndex: 'department', width: 80, title: '归属'},
{dataIndex: 'name', width: 80, title: '姓名'},
{dataIndex: 'idCard', width: 120, title: '身份证'},
{dataIndex: 'company', width: 80, title: '分公司'},
{dataIndex: 'attribute', width: 80, title: '属性'},
{dataIndex: 'positionWage', width: 80, title: '岗位工资'},
{dataIndex: 'performanceBonus', width: 80, title: '绩效奖金(绩效工资+提成)'},
{dataIndex: 'specialBonus', width: 80, title: '专项奖'},
{dataIndex: 'yearEndBonus', width: 80, title: '年终奖'},
{dataIndex: 'festivalFee', width: 80, title: '高温补贴(6-10月)'},
{dataIndex: 'correspondenceSubsidy', width: 80, title: '通讯补贴'},
{dataIndex: 'tableMoneySubsidy', width: 80, title: '餐费补贴'},
{dataIndex: 'trafficSubsidy', width: 80, title: '交通补贴'},
{dataIndex: 'specialBonusAutumn', width: 87, title: '专项奖(秋营奖励)'},
{dataIndex: 'otherSubsidy', width: 80, title: '其他补扣补退'},
{dataIndex: 'totalYf', width: 80, title: '应发合计'},
{dataIndex: 'endowmentInsurancePersonal', width: 80, title: '个人养老保险'},
{dataIndex: 'unenploymentInsurancePersonal', width: 80, title: '个人缴纳失业保险'},
{dataIndex: 'medicarePersonal', width: 80, title: '个人缴纳医疗保险'},
{dataIndex: 'totalInsurance', width: 80, title: '个人保险小计'},
{dataIndex: 'reservedFund', width: 80, title: '个人缴纳住房公积金'},
{dataIndex: 'reservedFundTax', width: 80, title: '个税'},
{dataIndex: 'yearEndBonusTax', width: 80, title: '年终奖个税'},
{dataIndex: 'otherFeePersonal', width: 80, title: '个人其他补交补退'},
{dataIndex: 'duesPersonal', width: 80, title: '个人工会费'},
{dataIndex: 'totalFeePersonal', width: 80, title: '个人缴交小计'},
{dataIndex: 'totalSf', width: 80, title: '实发合计'},
{dataIndex: 'endowmentInsuranceUnit', width: 80, title: '单位养老保险'},
{dataIndex: 'unenploymentInsuranceUnit', width: 80, title: '单位失业保险'},
{dataIndex: 'medicareUnit', width: 80, title: '单位医疗保险'},
{dataIndex: 'employmentInjuryInsuranceUnit', width: 80, title: '单位工伤保险'},
{dataIndex: 'birthInsuranceUnit', width: 80, title: '单位生育保险'},
{dataIndex: 'illnessInsuranceUnit', width: 80, title: '重大疾病保险'},
{dataIndex: 'reservedFundUnit', width: 80, title: '单位公积金'},
{dataIndex: 'laborUnionFeeUnit', width: 80, title: '工会计提'},
{dataIndex: 'accidentInsuranceUnit', width: 80, title: '商业意外险'},
{dataIndex: 'disabilityInsuranceUnit', width: 80, title: '残保金'},
{dataIndex: 'otherFeeUnit', width: 80, title: '单位其他补交补退'},
{dataIndex: 'totalFeeUnit', width: 80, title: '单位缴交小计'},
{dataIndex: 'totalCastPersonal', width: 80, title: '总个人人工成本合计'},
{dataIndex: 'additionMsg', width: 80, title: '总薪酬'},
{dataIndex: 'manageFee', width: 80, title: '邮电人才服务管理费(200/人)'},
{dataIndex: 'totalCastUnit', width: 80, title: '单位总成本(含支出税点)'},
{dataIndex: 'endowmentInsurancePersonal2', width: 80, title: '个人缴纳养老保险2'},
{dataIndex: 'unenploymentInsurancePersonal2', width: 80, title: '个人缴纳失业保险2'},
{dataIndex: 'medicarePersonal2', width: 80, title: '个人缴纳医疗保险2'},
{dataIndex: 'resveredFundPersonal2', width: 80, title: '个人缴纳住房公积金2'},
{dataIndex: 'endowmentInsuranceUnit2', width: 80, title: '单位养老保险2'},
{dataIndex: 'unenploymentInsuranceUnit2', width: 80, title: '单位失业保险2'},
{dataIndex: 'medicareUnit2', width: 80, title: '单位医疗保险2'},
{dataIndex: 'employmentInjuryInsuranceUnit2', width: 80, title: '单位工伤保险2'},
{dataIndex: 'birthInsuranceUnit2', width: 80, title: '单位生育保险2'},
{dataIndex: 'illnessInsuranceUnit2', width: 80, title: '重大疾病保险企业缴纳2'},
{dataIndex: 'reservedInsuranceUnit2', width: 80, title: '单位住房公积金2'},
{dataIndex: 'totalInsuranceUnit2', width: 80, title: '合并计税'},
{dataIndex: 'wage', width: 80, title: '本月计税工资'},
{dataIndex: 'wageTax', width: 80, title: '本月抵税扣除'},
{dataIndex: 'wageTaxAfter', width: 80, title: '本月工资抵税'},
{dataIndex: 'lastYearEndBonus', width: 80, title: '年终奖应税'},
{dataIndex: 'lastYearEndBonusTax', width: 80, title: '年终奖个税计算'},
{dataIndex: 'bankAccount', width: 80, title: '银行账号'},
{dataIndex: 'managerCast', width: 80, title: '督导成本'},
{dataIndex: 'xzCompanyCast', width: 80, title: '学子公司成本'},
{
dataIndex: 'operation',
width: 60,
title: '操作',
scopedSlots: {customRender: 'operation'},
fixed: "right"
}
],
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
let obj = cloneObject(this.queryParam)
//表示
return zjlSalaryList(Object.assign(params, obj)).then(res => {
let data = {}
if (res.state !== 'success') {
this.$message.error("查询失败!", 5);
this.emptyText.emptyText = '查询失败!'
data = {
data: [],
pageSize: parameter.pageSize,
pageNo: 1,
totalCount: 0
}
} else {
data = {
data: res.data.records,
pageSize: parameter.pageSize,
pageNo: parameter.pageNo,
totalCount: res.data.total
}
}
return data
})
},
importTile: "",
importUrl: "",
YRYMmoBan: true,
tempMode:['month', 'month'],
}
},
methods: {
moment,
handlePanelChange(value, mode) {
this.queryParam.month = value;
this.tempMode = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]];
//console.log("this.tempMode=================="+this.tempMode);
},
excelOut() {
let params = {
pageNo: 1,
pageSize: 10
}
let obj = cloneObject(this.queryParam)
let nowdate = moment().format("YYYY-MM-DD");
//导出
exportFile(
uploadExcel(Object.assign(params, obj)),
"总经理薪酬管理信息" + nowdate + ".xlsx",
);
},
excelInto() {
this.importTile = "批量导入总经理薪酬管理信息";
this.YRYMmoBan = true;
this.importUrl = "manager/ciop/zjlWage/importDate";
this.salaryModifyvisible = true
},
downloadMoBan: function () {
exportFile(downloadMoBan(), "总经理薪酬管理信息.xlsx");
},
doPush(res) {
console.log(res);
if (!res || !res.response) {
this.$message.error("上传文件出错!", 10);
return false;
}
const response = res.response;
if (response.state !== "success") {
this.$message.error(response.msg ? response.msg : "上传文件出错!", 10);
return false;
}
this.$message.success("上传成功!" + response.data, 5);
},
createSalay(){
//生成总经理上月薪酬
this.createSalaryvisible = true
},
createfunctionOk1() { //确定按扭
this.createSalaryvisible = false;
createSalary({}).then((res) => {
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
}else{
this.$message.error(res.msg);
return;
}
this.search()
})
},
createfunctionCancel1() { //取消按扭
this.createSalaryvisible = false;
},
createfunctionOk0() {
this.salaryModifyvisible = false;
this.clearmodel0();
},
createfunctionCancel0() {
this.salaryModifyvisible = false;
this.clearmodel0();
},
clearmodel0() {
this.importTile = "";
this.YRYMmoBan = false;
this.importUrl = "";
},
search() {
this.$refs.table.refresh({search: true})
},
remove(id) {
zjlSalaryDelete({'id': id}).then((res) => {
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
}
else{
this.$message.error(res.msg);
return;
}
this.$refs.table.refresh({search: true})
})
},
},
mounted() {
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -53,8 +53,7 @@
</template>
</s-table>
<!----弹框-->
<a-modal :title="add ?'添加宽带': '编辑宽带'" :visible="modifyvisible" @ok="createfunctionOk"
@cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-modal :title="add ?'添加宽带': '编辑宽带'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-drawer
title="适用学校详情"
placement="right"
......
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="4" :sm="8">
<a-form-item label="兑换券账号">
<a-input placeholder="兑换券账号" v-model="queryParam.card" style="width: 8rem;"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="销售状态">
<a-select v-model="queryParam.state" @change="getSchoolNames" style="width: 8rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option key="1">未出售</a-select-option>
<a-select-option key="2">已出售</a-select-option>
<a-select-option key="3">出售中</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="上架状态">
<a-select v-model="queryParam.shelfState" style="width: 15rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option key="1">已上架</a-select-option>
<a-select-option key="2">已下架</a-select-option>
</a-select>
</a-form-item>
</a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="6" :sm="24">
<a-button @click="search()" type="primary">查询</a-button>
<a-divider type="vertical"/>
<a-button @click="modifyfunction()" type="primary">添加</a-button>
<a-divider type="vertical"/>
<a-button @click="excelInto()" type="primary">兑换券数据导入</a-button>
<a-divider type="vertical"/>
<a-button @click="excelOut()" type="primary">兑换券数据导出</a-button>
</a-col>
</span>
</a-row>
</a-form>
</div>
<a-modal
title="批量导入"
:visible="kpiModifyvisible"
@ok="createfunctionOk0"
@cancel="createfunctionCancel0"
html-type="submit"
width="400px"
>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p style="text-align:center">{{ importTile }}</p>
</a-col>
</a-row>
<import-btn :url="importUrl" :responseFun="doPush">
<a-tooltip placement="topLeft" title="导入文件" arrowPointAtCenter>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p>
选择文件:
<a-button type="primary">选择文件</a-button>
</p>
</a-col>
</a-row>
</a-tooltip>
</import-btn>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p v-show="YRYMmoBan">
模板下载:
<a-button type="primary" @click="downloadMoBan">兑换券信息模板</a-button>
</p>
</a-col>
</a-row>
<a-row :gutter="24" :v-show="KDmoBan">
<a-col :md="24" :sm="12">
<p>说明:</p>
<p>1.批量导入请严格按照模版进行导入;</p>
</a-col>
</a-row>
</a-modal>
<!--列表-->
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling"
:locale="emptyText">
<!--拦截器-->
<template slot="updateDate" slot-scope="text">
{{ text | dayjs}}
</template>
<!--拦截器-->
<template slot="validityPeriod" slot-scope="text">
{{ text | dayjs}}
</template>
<template slot="shelfState" slot-scope="text">
<p v-if="text==1">已上架</p>
<p v-if="text==2">已下架</p>
<p v-else=""></p>
</template>
<template slot="state" slot-scope="text">
<p v-if="text==1">未售出</p>
<p v-if="text==2">已售出</p>
<p v-else="">售出中</p>
</template>
<template slot="operation" slot-scope="text,record">
<span>
<a-popconfirm title="确定删除吗" v-if="record.delFlag == 0" @confirm="remove(record,1)">
<a>删除</a>
</a-popconfirm>
<a-popconfirm title="确定恢复删除吗" v-if="record.delFlag == 1" @confirm="remove(record,0)">
<a>恢复删除</a>
</a-popconfirm>
</span>
</template>
</s-table>
<!----弹框-->
<a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk"
@cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-form :form="Formtable">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="兑换券账号:">
<a-input placeholder="兑换券账号"
v-decorator="[ 'cardNumber', {rules: [{ required: true, message: '兑换券账号不能为空!' }]} ]"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="密码:">
<a-input placeholder="密码"
v-decorator="[ 'password', {rules: [{ required: true, message: '密码不能为空!' }]} ]"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="有效截止日期:">
<a-date-picker @change="onChange" placeholder="有效截止日期"
v-decorator="[ 'validityPeriod', {rules: [{ required: true, message: '有效截止日期不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import STable from '@/components/table';
import ImportBtn from "../../../components/sysmanage/ImportBtn";
import {
yxtCouponList, yxtCouponDelete, yxtCouponInsert, yxtCouponUpdate,
getSchoolNames, initSubstName, uploadExcel, downloadMoBan
} from "@/api/school-center/exchangeCouponAPI"
import {cloneObject, exportFile} from '@/utils/util';
import Vue from 'vue';
import {DatetimePicker} from 'vant';
import moment from "moment";
import ConstantActivity from "@/constant/ConstantActivity";
Vue.use(DatetimePicker);
export default {
name: "exchangeCoupon",
components: {
STable, ImportBtn
},
data() {
return {
emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this),
modifyvisible: false,
kpiModifyvisible: false,
title: ConstantActivity.title,
add: true,
isdisabled: true,
queryParam: {
card: '',
state: '',
shelfState: '',
},
subNames: [],
schoolNames: [],
modelData: {
id: '',
cardNumber: '',
password: '',
validityPeriod: '',
updateDate: '',
state: '',
shelfState: '',
},
columns: [
{dataIndex: 'cardNumber', width: 40, title: '兑换券账号'},
{dataIndex: 'password', width: 20, title: '密码'},
{dataIndex: 'state', width: 20, title: '出售状态 ', scopedSlots: {customRender: 'state'}},
{dataIndex: 'shelfState', width: 20, title: '上架状态 ', scopedSlots: {customRender: 'shelfState'}},
{
dataIndex: 'validityPeriod',
width: 40,
title: '有效截止日期',
scopedSlots: {customRender: 'validityPeriod'}
},
{dataIndex: 'updateDate', width: 40, title: '上传时间', scopedSlots: {customRender: 'updateDate'}},
{
dataIndex: 'operation',
width: 30,
title: '操作',
scopedSlots: {customRender: 'operation'},
fixed: "right"
}
],
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
let obj = cloneObject(this.queryParam)
//表示
return yxtCouponList(Object.assign(params, obj)).then(res => {
let data = {}
if (res.state !== 'success') {
this.$message.error("查询失败!", 5);
this.emptyText.emptyText = '查询失败!'
data = {
data: [],
pageSize: parameter.pageSize,
pageNo: 1,
totalCount: 0
}
} else {
data = {
data: res.data.records,
pageSize: parameter.pageSize,
pageNo: parameter.pageNo,
totalCount: res.data.total
}
}
return data
})
},
importTile: "",
importUrl: "",
YRYMmoBan: true,
}
},
methods: {
moment,
onChange(date, dateString) {
console.log(dateString);
this.modelData.validityPeriod = dateString;
},
excelOut() {
let params = {
pageNo: 1,
pageSize: 10
}
let obj = cloneObject(this.queryParam)
let nowdate = moment().format("YYYY-MM-DD");
//导出
exportFile(
uploadExcel(Object.assign(params, obj)),
"兑换券信息" + nowdate + ".xlsx",
);
},
excelInto() {
this.importTile = "批量导入兑换券信息";
this.YRYMmoBan = true;
this.importUrl = "manager/ciop/yxtCoupon/importDate";
this.kpiModifyvisible = true
},
downloadMoBan: function () {
exportFile(downloadMoBan(), "兑换券信息模板模板.xlsx");
},
doPush(res) {
console.log(res);
if (!res || !res.response) {
this.$message.error("上传文件出错!", 10);
return false;
}
const response = res.response;
if (response.state !== "success") {
this.$message.error(response.msg ? response.msg : "上传文件出错!", 10);
return false;
}
this.$message.success("上传成功!" + response.data, 5);
},
createfunctionOk0() {
this.kpiModifyvisible = false;
this.clearmodel0();
},
createfunctionCancel0() {
this.kpiModifyvisible = false;
this.clearmodel0();
},
clearmodel0() {
this.importTile = "";
this.YRYMmoBan = false;
this.importUrl = "";
},
search() {
this.$refs.table.refresh({search: true})
},
remove(date, delFlag) {
if(delFlag == 1){
if(date.state == 2){//
this.$message.error("已售出的兑换券不能删除!");
return;
}else if(date.state == 2){//售出中
this.$message.error("售出中的兑换券不能删除!");
return;
}
}
yxtCouponDelete({'id': date.id, 'isdel': delFlag}).then((res) => {
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
} else {
this.$message.error(res.msg);
return;
}
this.$refs.table.refresh({search: true})
})
},
modifyfunction(data) {
if (data != undefined) {
this.add = false;
this.isdisabled = true;
this.modelData.id = data.id
setTimeout(() => {
this.Formtable.setFieldsValue({
"cardNumber": data.cardNumber,
"password": data.password,
"validityPeriod": data.validityPeriod,
"updateDate": data.updateDate,
"state": data.state,
"shelfState": data.shelfState,
"delFlag": data.delFlag,
})
}, 0)
} else {
this.isdisabled = false;
}
this.modifyvisible = true;
},
createfunctionOk() {
let that = this;
that.Formtable.validateFields(['cardNumber', 'password', 'validityPeriod'], {force: true}, (err, values) => {
if (err) {
return;
}
that.modelData.cardNumber = values.cardNumber
that.modelData.password = values.password
that.modelData.validityPeriod = values.validityPeriod
if (this.add) {
let obj = that.modelData;
delete obj.id
let yxtCoupon = JSON.stringify(obj);
yxtCouponInsert({yxtCoupon}).then((res) => {
this.modifyvisible = false;
this.clearmodel()
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
} else {
this.$message.error(res.msg);
return;
}
this.search()
})
} else {
let obj = that.modelData;
let yxtCoupon = JSON.stringify(obj);
yxtCouponUpdate({yxtCoupon}).then((res) => {
this.modifyvisible = false;
this.clearmodel()
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search()
})
}
})
},
createfunctionCancel() {
this.modifyvisible = false;
this.clearmodel()
this.add = true;
},
//清除弹窗信息
clearmodel() {
this.add = true
this.modelData.id = ''
this.modelData.month = ''
this.Formtable.setFieldsValue({
"cardNumber": '',
"password": '',
"validityPeriod": '',
})
}
},
mounted() {
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment