Commit 107c56ae by 董有沛

Merge remote-tracking branch 'origin/master'

parents 281e47bd 5560da4a
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 + "/lzKpi/initSubstName" , params);
let getSchoolNames = (params) => postAction(prefix + "/lzKpi/getSchoolNames" , params);
let uploadExcel = (params) => downFilePost(prefix + "/lzKpi/excelOut" , params);
let downloadMoBan = (params) => downFilePost(prefix + "/lzKpi/downloadMoBan" , params);
let lzKpiList = (params) => postAction(prefix + "/lzKpi/list" , params);
let lzKpiDelete = (params) => postAction(prefix + "/lzKpi/delete", params);
let lzKpiInsert = (params) => postAction(prefix + "/lzKpi/insert" , params);
let lzKpiUpdate = (params) => postAction(prefix + "/lzKpi/update",params);
export {
initSubstName,
getSchoolNames,
uploadExcel,
downloadMoBan,
lzKpiList,
lzKpiDelete,
lzKpiInsert,
lzKpiUpdate,
}
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/manager/ciop';
// 楼长KPI管理
let initSubstName = (params) => postAction(prefix + "/lzWage/initSubstName" , params);
let getSchoolNames = (params) => postAction(prefix + "/lzWage/getSchoolNames" , params);
let uploadExcel = (params) => downFilePost(prefix + "/lzWage/excelOut" , params);
let downloadMoBan = (params) => downFilePost(prefix + "/lzWage/downloadMoBan" , params);
let lzSalaryList = (params) => postAction(prefix + "/lzWage/list" , params);
let lzSalaryDelete = (params) => postAction(prefix + "/lzWage/delete", params);
let lzSalaryInsert = (params) => postAction(prefix + "/lzWage/insert" , params);
let lzSalaryUpdate = (params) => postAction(prefix + "/lzWage/update",params);
//生成楼长上月薪酬
let createSalary = (params) => postAction(prefix + "/lzWage/createSalary",params);
export {
initSubstName,
getSchoolNames,
uploadExcel,
downloadMoBan,
lzSalaryList,
lzSalaryDelete,
lzSalaryInsert,
lzSalaryUpdate,
createSalary
}
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/manager/ciop';
// 楼长KPI管理
let uploadExcel = (params) => downFilePost(prefix + "/managerKpi/excelOut" , params);
let downloadMoBan = (params) => downFilePost(prefix + "/managerKpi/downloadMoBan" , params);
let zjlKpiList = (params) => postAction(prefix + "/managerKpi/list" , params);
export {
uploadExcel,
downloadMoBan,
zjlKpiList
}
import {postAction} from '@/api/manage'
const prefix = '/manager/ciop';
// 宽带产品
let regularList = (params) => postAction(prefix + "/regular/list" , params);
let regularDelete = (params) => postAction(prefix + "/regular/delete", params);
let regularInsert = (params) => postAction(prefix + "/regular/insert" , params);
let regularUpdate = (params) => postAction(prefix + "/regular/update",params);
export {
regularList,
regularDelete,
regularInsert,
regularUpdate,
}
import {postAction,downFilePost} from '@/api/manage'
const prefix = '/manager/ciop';
// 楼长KPI管理
let initSubstName = (params) => postAction(prefix + "/yxtOrder/initSubstName" , params);
let getSchoolNames = (params) => postAction(prefix + "/yxtOrder/getSchoolNames" , params);
let uploadExcel = (params) => downFilePost(prefix + "/yxtOrder/excelOut" , params);
let downloadMoBan = (params) => downFilePost(prefix + "/yxtOrder/downloadMoBan" , params);
let yxtOrderList = (params) => postAction(prefix + "/yxtOrder/list" , params);
let yxtOrderDelete = (params) => postAction(prefix + "/yxtOrder/delete", params);
let yxtOrderInsert = (params) => postAction(prefix + "/yxtOrder/insert" , params);
let yxtOrderUpdate = (params) => postAction(prefix + "/yxtOrder/update",params);
let getYxtCard = (params) => postAction(prefix + "/yxtOrder/getYxtCard",params);
export {
initSubstName,
getSchoolNames,
uploadExcel,
downloadMoBan,
yxtOrderList,
yxtOrderDelete,
yxtOrderInsert,
yxtOrderUpdate,
getYxtCard
}
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
}
......@@ -19,7 +19,7 @@ let roleTreeList = (params) => postAction(prefix+"/role/roleTreeListByUserId", p
let roleTreeList2 = (params) => postAction(prefix+"/role/roleTreeListByUserId/"+params["id"], {});
let userFreeze= (params) => postAction(prefix+"/mgr/freeze", params);
let userUnFreeze= (params) => postAction(prefix+"/mgr/unfreeze", params);
let changeOtherPwd= (params) => postAction(prefix+"/forgerpw/changeOtherPwd", params);//修改密码
let changeOtherPwd= (params) => postAction(prefix+"/mgr/changeOtherPwd", params);//修改密码
//部门管理
const departmentList = (params) => getAction(prefix+"/dept/departmentList", params);
let deptAdd = (params) => postAction(prefix+"/dept/add", params);
......
......@@ -60,6 +60,12 @@
visible: false
}
},
mounted() {
let timestamp = (new Date()).valueOf();
if((timestamp - this.$store.state.user.info.updateTime) > (24*60*60*1000*90)){
this.updatePassword()
}
},
methods: {
...mapActions(["Logout"]),
...mapGetters(["nickname", "avatar", "userInfo"]),
......
......@@ -11,6 +11,13 @@
<a-spin :spinning="confirmLoading">
<a-form :form="form" class="addModel clearfix">
<a-form-item
v-show="tishi"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="提示:">
<p style="color:red;">您的密码已90天未修改,请修改密码后重新登录</p>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="旧密码">
......@@ -20,6 +27,23 @@
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="验证码">
<a-input
v-decorator="['inputCode',validatorRules.inputCode]"
type="text"
placeholder="请输入验证码">
</a-input>
<a-button
type="primary"
htmlType="submit"
@click.stop.prevent="getCode"
>{{codeMsg}}
</a-button>
</a-form-item>
<a-form-item
:labelCol="labelCol"
:wrapperCol="wrapperCol"
label="新密码">
<a-input type="password" placeholder="请输入新密码" v-decorator="[ 'newPwd', validatorRules.newPwd]"/>
</a-form-item>
......@@ -36,17 +60,19 @@
</template>
<script>
import {registercode} from '@/api/system'
import { postAction } from '@/api/manage'
import {mapActions} from 'vuex'
export default {
name: "UserPassword",
data () {
return {
tishi:false,
countdown: 60,// 倒计时秒数
codeMsg: '获取验证码', // 按钮上的文字
timer: null,// 定时器
title:"修改密码",
modalWidth:500,
modalWidth:600,
visible: false,
confirmLoading: false,
verifiedCode: "",
......@@ -90,6 +116,36 @@
}
},
methods: {
...mapActions(["Logout"]),
getCode() {
// 验证码60秒倒计时
if (!this.timer) {
postAction(this.codeurl).then((res)=>{
if (res.code==200){
this.$notification.success({
message: res.data,
});
return null;
}
this.$notification.error({
message: res.data,
});
})
this.timer = setInterval(() => {
if (this.countdown > 0 && this.countdown <= 60) {
this.countdown--;
if (this.countdown !== 0) {
this.codeMsg = "重新发送(" + this.countdown + ")";
} else {
clearInterval(this.timer);
this.codeMsg = "获取验证码";
this.countdown = 60;
this.timer = null;
}
}
}, 1000)
}
},
//密码加密
getPass(text){
/*let keyss = setMaxDigits(130);
......@@ -103,6 +159,10 @@
//return text;
},
show(uname){
let timestamp = (new Date()).valueOf();
if((timestamp - this.$store.state.user.info.updateTime) > (24*60*60*1000*90)){
this.tishi=true
}
if(!uname){
this.$message.warning("当前系统无登陆用户!");
return
......@@ -113,7 +173,20 @@
}
},
handleCancel () {
if(this.tishi){
this.$message.warning("您的密码已90天未修改,请修改密码后重新登录!");
return this.Logout({}).then(() => {
window.location.href = "/";
//window.location.reload()
}).catch(err => {
this.$message.error({
title: '错误',
description: err.message
})
})
}else {
this.close()
}
},
close () {
this.$emit('close');
......@@ -134,15 +207,29 @@
that.confirmLoading = true;
values.oldPwd=encodeURIComponent(this.getPass(values.oldPwd))
values.newPwd=encodeURIComponent(this.getPass(values.newPwd))
values.inputCode=encodeURIComponent(this.getPass(values.inputCode))
values.rePwd=values.newPwd
let params = Object.assign(values)
postAction(this.url,params).then((res)=>{
if(res.code!=200){
that.$message.error(res.message);
that.close();
that.$message.error(res.data);
}else{
that.$message.success(res.message);
this.visible=false
that.close();
if(this.tishi){
return this.Logout({}).then(() => {
that.$message.success("修改成功,请重新登录!");
window.location.href = "/";
//window.location.reload()
}).catch(err => {
that.$message.error({
title: '错误',
description: err.message
})
})
}
that.$message.success(res.message);
}
}).finally(() => {
that.confirmLoading = false;
......
<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.userName" 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.substName" @change="getSchoolNames" style="width: 8rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option v-for="d in subNames" :key="d.value" :value="d.value">{{d.text}}
</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.schoolName" style="width: 15rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option v-for="d in schoolNames" :key="d.value" :value="d.value">{{d.text}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="KPI月份">
<a-month-picker @change="onChange" v-model="queryParam.month" placeholder="选择KPI月份" style="width: 8rem;"/>
</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">KPI数据导入</a-button>
<a-divider type="vertical"/>
<a-button @click="excelOut()" type="primary">KPI数据导出</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">楼长KPI管理信息模板</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="operation" slot-scope="text,record">
<span>
<a @click="modifyfunction(record)">KPI打分</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="remove(record.id,'')">
<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="[ 'sysuName', {rules: [{ required: true, message: '姓名不能为空!' }]} ]" :disabled="isdisabled"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="账号:">
<a-input placeholder="账号" v-decorator="[ 'account', {rules: [{ required: true, message: '账号不能为空!' }]} ]" :disabled="isdisabled"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="汇总任务量(满分:30):">
<a-input-number
placeholder="汇总任务量"
style="width: 20rem;"
:min="0"
:max="30"
v-decorator="[ 'reportDaily', {rules: [{ required: true, message: '汇总任务量不能为空!' }]} ]"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="参与集中营销(满分:30):">
<a-input-number
placeholder="参与集中营销"
:min="0"
:max="30"
v-decorator="[ 'collectiveSales', {rules: [{required: true, message: '参与集中营销不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织周例会(满分:10):">
<a-input-number
placeholder="组织周例会"
:min="0"
:max="10"
v-decorator="[ 'weeklyMeeting', {rules: [{ required: true, message: '组织周例会不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="定制扫楼营销方案(满分:10):">
<a-input-number
placeholder="定制扫楼营销方案"
:min="0"
:max="10"
v-decorator="[ 'organTraining', {rules: [{ required: true, message: '定制扫楼营销方案不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织培训(满分:20):">
<a-input-number
placeholder="组织培训"
:min="0"
:max="20"
v-decorator="[ 'designPlan', {rules: [{required: true, message: '组织培训不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI总值:">
<a-input-number
placeholder="KPI总值"
:min="0"
:max="100"
v-decorator="[ 'kpi' ]"
style="width: 20rem;"
disabled/>
</a-form-item>
<a-form-item v-show="add" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI月份:">
<a-month-picker @change="onChange" placeholder="选择KPI月份" v-decorator="[ 'month' ]" style="width: 20rem;"/>
</a-form-item>
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="是否删除:">
<a-select v-decorator="['isDel']" style="width: 330px">
<a-select-option key="1"></a-select-option>
<a-select-option key="0"></a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import STable from '@/components/table';
import ImportBtn from "../../../components/sysmanage/ImportBtn";
import {
lzKpiList, lzKpiDelete, lzKpiInsert, lzKpiUpdate,
getSchoolNames, initSubstName, uploadExcel, downloadMoBan
} from "@/api/school-center/louZhangManagerAPI"
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: "louZhangKPI",
components: {
STable, ImportBtn
},
data() {
return {
emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this),
modifyvisible: false,
kpiModifyvisible: false,
title: ConstantActivity.title,
add: true,
isdisabled: true,
queryParam: {
userName: '',
substName: '',
schoolName: '',
month: '',
},
subNames: [],
schoolNames: [],
modelData: {
id: '',
userId: '',
sysuName: '',
account: '',
substName: '',
schoolName: '',
reportDaily: '',
collectiveSales: '',
weeklyMeeting: '',
organTraining: '',
designPlan: '',
kpi: '',
month: '',
isDel: '0'
},
columns: [
{dataIndex: 'sysuName', width: 25, title: '姓名'},
{dataIndex: 'account', width: 40, title: '账号'},
{dataIndex: 'substName', width: 20, title: '县分'},
{dataIndex: 'schoolName', width: 70, title: '学校'},
{dataIndex: 'reportDaily', width: 25, title: '汇总任务量'},
{dataIndex: 'collectiveSales', width: 30, title: '参与集中营销'},
{dataIndex: 'weeklyMeeting', width: 25, title: '组织周例会'},
{dataIndex: 'organTraining', width: 30, title: '定制扫楼营销方案 '},
{dataIndex: 'designPlan', width: 20, title: '组织培训 '},
{dataIndex: 'kpi', width: 20, title: 'KPI总值'},
{dataIndex: 'month', width: 20, title: 'KPI月份 '},
{
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 lzKpiList(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.month = 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)),
"楼长KPI管理信息" + nowdate + ".xlsx",
);
},
excelInto() {
this.importTile = "批量导入楼长KPI管理信息";
this.YRYMmoBan = true;
this.importUrl = "manager/ciop/lzKpi/importDate";
this.kpiModifyvisible = true
},
downloadMoBan: function () {
exportFile(downloadMoBan(), "楼长KPI管理信息.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(id, isdel) {
lzKpiDelete({'id': id, 'isdel': "isdel"}).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
this.modelData.userId = data.userId
this.modelData.month = data.month
setTimeout(() => {
this.Formtable.setFieldsValue({
"sysuName": data.sysuName,
"account": data.account,
"substName": data.substName,
"schoolName": data.schoolName,
"reportDaily": data.reportDaily,
"collectiveSales": data.collectiveSales,
"weeklyMeeting": data.weeklyMeeting,
"organTraining": data.organTraining,
"designPlan": data.designPlan,
"month": data.month,
"kpi": data.kpi,
"isDel": data.isDel
})
}, 0)
}else{
this.isdisabled = false;
}
this.modifyvisible = true;
},
createfunctionOk() {
let that = this;
that.Formtable.validateFields(['sysuName', 'account', 'substName', 'schoolName', 'reportDaily', 'collectiveSales', 'weeklyMeeting', 'organTraining', 'designPlan', "month", 'kpi', 'isDel'], {force: true}, (err, values) => {
if (err) {
return;
}
that.modelData.sysuName = values.sysuName
that.modelData.account = values.account
that.modelData.reportDaily = values.reportDaily
that.modelData.collectiveSales = values.collectiveSales
that.modelData.weeklyMeeting = values.weeklyMeeting
that.modelData.organTraining = values.organTraining
that.modelData.designPlan = values.designPlan
that.modelData.kpi = values.reportDaily + values.collectiveSales + values.weeklyMeeting + values.organTraining + values.designPlan
that.modelData.isDel = 0
if (this.add) {
let obj = that.modelData;
delete obj.id
let lzKpi = JSON.stringify(obj);
lzKpiInsert({lzKpi}).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 lzKpi = JSON.stringify(obj);
lzKpiUpdate({lzKpi}).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({
"sysuName": '',
"account": '',
"substName": '',
"schoolName": '',
"reportDaily": '',
"collectiveSales": '',
"weeklyMeeting": '',
"organTraining": '',
"designPlan": '',
"kpi": '',
"month": '',
"isDel": 1
})
},
getSchoolNames() {
this.schoolNames = []
this.queryParam.schoolName = ''
getSchoolNames({"substName": this.queryParam.substName}).then((res) => {
if (res.state == "success") {
const result = res.data
result.forEach((r) => {
if (r.schoolName === 'null')
return;
this.schoolNames.push({
value: r.schoolName,
text: r.schoolName
})
})
}
})
},
initSubstName() {
initSubstName().then((res) => {
if (res.state == "success") {
const result = res.data
result.forEach((r) => {
if (r.subName === 'null')
return;
this.subNames.push({
value: r.subName,
text: r.subName
})
})
}
})
}
},
mounted() {
this.initSubstName();
this.getSchoolNames();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<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.userName" style="width: 8rem;"></a-input>
</a-form-item>
</a-col>
<a-col :md="3" :sm="6">
<a-form-item label="县分">
<a-select v-model="queryParam.substName" @change="getSchoolNames" style="width: 8rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option v-for="d in subNames" :key="d.value" :value="d.value">{{d.text}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="5" :sm="10">
<a-form-item label="学校">
<a-select v-model="queryParam.schoolName" style="width: 15rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option v-for="d in schoolNames" :key="d.value" :value="d.value">{{d.text}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="8">
<a-form-item label="KPI月份">
<a-month-picker @change="onChange" v-model="queryParam.month" placeholder="选择KPI月份" style="width: 8rem;"/>
</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="createSalay()" type="primary">生成楼长上月薪酬</a-button>
<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">薪酬数据导入</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="createSalaryvisible"
@ok="createfunctionOk1"
@cancel="createfunctionCancel1"
width="400px"
>
<a-row :gutter="24">
<a-col :md="24" :sm="12">
<p style="text-align:center;font-weight: bold;">确定生成楼长上月薪酬吗?</p>
</a-col>
</a-row>
</a-modal>
<a-modal
title="批量导入"
:visible="salaryModifyvisible"
@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="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>
<!----弹框-->
<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="[ 'sysuName', {rules: [{ required: true, message: '姓名不能为空!' }]} ]" :disabled="isdisabled"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="放号充值数:">
<a-input
placeholder="放号充值数"
style="width: 20rem;"
v-decorator="[ 'rechargeNum', {rules: [{ required: true, message: '放号充值数不能为空!' }]} ]"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="放号薪酬:">
<a-input
placeholder="放号薪酬"
v-decorator="[ 'rechargeWage', {rules: [{required: true, message: '放号薪酬不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI总值:">
<a-input
placeholder="KPI总值"
v-decorator="[ 'kpi' ]"
style="width: 20rem;"
disabled/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="kpi薪酬:">
<a-input
placeholder="kpi薪酬"
v-decorator="[ 'kpiWage', {rules: [{ required: true, message: 'kpi薪酬不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="总薪酬:">
<a-input
placeholder="总薪酬"
v-decorator="[ 'wage', {rules: [{ required: true, message: '总薪酬不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item>
<a-form-item v-show="add" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI月份:">
<a-month-picker @change="onChange" placeholder="选择KPI月份" v-decorator="[ 'month' ]" 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 {
lzSalaryList, lzSalaryDelete, lzSalaryInsert, lzSalaryUpdate,
getSchoolNames, initSubstName, uploadExcel, downloadMoBan
} from "@/api/school-center/lzSalaryManagerAPI"
import {cloneObject, exportFile} from '@/utils/util';
import Vue from 'vue';
import {DatetimePicker} from 'vant';
import moment from "moment";
import ConstantActivity from "@/constant/ConstantActivity";
import {createSalary} from "../../../api/school-center/lzSalaryManagerAPI";
Vue.use(DatetimePicker);
export default {
name: "lzSalary",
components: {
STable, ImportBtn
},
data() {
return {
emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this),
modifyvisible: false,
salaryModifyvisible: false,
createSalaryvisible: false,
title: ConstantActivity.title,
add: true,
isdisabled: true,
queryParam: {
userName: '',
substName: '',
schoolName: '',
month: '',
},
subNames: [],
schoolNames: [],
modelData: {
id: '',
userId: '',
month: '',
sysuName: '',
substName: '',
schoolName: '',
rechargeNum: '',
rechargeWage: '',
kpi: '',
kpiWage: '',
wage: '',
},
columns: [
{dataIndex: 'month', width: 20, title: 'KPI月份 '},
{dataIndex: 'sysuName', width: 25, title: '姓名'},
{dataIndex: 'substName', width: 20, title: '县分'},
{dataIndex: 'schoolName', width: 70, title: '学校'},
{dataIndex: 'rechargeNum', width: 25, title: '放号充值数'},
{dataIndex: 'rechargeWage', width: 25, title: '放号薪酬'},
{dataIndex: 'kpi', width: 20, title: 'KPI总值'},
{dataIndex: 'kpiWage', width: 30, title: 'kpi薪酬'},
{dataIndex: 'wage', width: 25, title: '总薪酬'},
{
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 lzSalaryList(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.month = 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/lzWage/importDate";
this.createSalaryvisible = 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) {
lzSalaryDelete({'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})
})
},
modifyfunction(data) {
if (data != undefined) {
this.add = false;
this.isdisabled = true;
this.modelData.id = data.id
this.modelData.userId = data.userId
this.modelData.month = data.month
setTimeout(() => {
this.Formtable.setFieldsValue({
"sysuName": data.sysuName,
"account": data.account,
"substName": data.substName,
"schoolName": data.schoolName,
"reportDaily": data.reportDaily,
"collectiveSales": data.collectiveSales,
"weeklyMeeting": data.weeklyMeeting,
"organTraining": data.organTraining,
"designPlan": data.designPlan,
"month": data.month,
"kpi": data.kpi,
"isDel": data.isDel
})
}, 0)
}else{
this.isdisabled = false;
}
this.modifyvisible = true;
},
createfunctionOk() {
let that = this;
that.Formtable.validateFields(['sysuName', 'account', 'substName', 'schoolName', 'reportDaily', 'collectiveSales', 'weeklyMeeting', 'organTraining', 'designPlan', "month", 'kpi', 'isDel'], {force: true}, (err, values) => {
if (err) {
return;
}
that.modelData.sysuName = values.sysuName
that.modelData.account = values.account
that.modelData.reportDaily = values.reportDaily
that.modelData.collectiveSales = values.collectiveSales
that.modelData.weeklyMeeting = values.weeklyMeeting
that.modelData.organTraining = values.organTraining
that.modelData.designPlan = values.designPlan
that.modelData.kpi = values.reportDaily + values.collectiveSales + values.weeklyMeeting + values.organTraining + values.designPlan
that.modelData.isDel = 0
if (this.add) {
let obj = that.modelData;
delete obj.id
let lzKpi = JSON.stringify(obj);
lzSalaryInsert({lzKpi}).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 lzKpi = JSON.stringify(obj);
lzSalaryUpdate({lzKpi}).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({
"sysuName": '',
"account": '',
"substName": '',
"schoolName": '',
"reportDaily": '',
"collectiveSales": '',
"weeklyMeeting": '',
"organTraining": '',
"designPlan": '',
"kpi": '',
"month": '',
"isDel": 1
})
},
getSchoolNames() {
this.schoolNames = []
this.queryParam.schoolName = ''
getSchoolNames({"substName": this.queryParam.substName}).then((res) => {
if (res.state == "success") {
const result = res.data
result.forEach((r) => {
if (r.schoolName === 'null')
return;
this.schoolNames.push({
value: r.schoolName,
text: r.schoolName
})
})
}
})
},
initSubstName() {
initSubstName().then((res) => {
if (res.state == "success") {
const result = res.data
result.forEach((r) => {
if (r.subName === 'null')
return;
this.subNames.push({
value: r.subName,
text: r.subName
})
})
}
})
}
},
mounted() {
this.initSubstName();
this.getSchoolNames();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<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 type="vertical"/>
<a-button @click="excelInto()" type="primary">导入总经理KPI数据</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="zjlkpivisible"
@ok="createfunctionOk"
@cancel="createfunctionCancel"
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="zjlmoBan">
模板下载:
<a-button type="primary" @click="downloadMoBan">总经理KPI信息模板</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 { zjlKpiList, uploadExcel, downloadMoBan } from "@/api/school-center/managerKpiAPI"
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: "managerKpiAPI",
components: {
STable, ImportBtn
},
data() {
return {
emptyText: {emptyText: '暂无数据'},
title: ConstantActivity.title,
queryParam: {
name: '',
month: ['', ''],
},
modelData: {
month: '',
county: '',
name: '',
totalPerformance: '',
performanceBase: '',
yfPerformance: '',
kpi: '',
rwKpi: '',
wxKpi: '',
yyKpi: '',
workKpi: '',
totalBonus: '',
totalFund: '',
autumnBonus: '',
yfBonus: '',
},
columns: [
{dataIndex: 'month', width: 20, title: '月份 '},
{dataIndex: 'county', width: 20, title: '县分'},
{dataIndex: 'name', width: 25, title: '督导'},
{dataIndex: 'totalPerformance', width: 30, title: '绩效奖金合计'},
{dataIndex: 'performanceBase', width: 25, title: '绩效基数'},
{dataIndex: 'yfPerformance', width: 25, title: '应发绩效'},
{dataIndex: 'kpi', width: 20, title: 'kpi总分'},
{dataIndex: 'rwKpi', width: 25, title: '移动入网'},
{dataIndex: 'wxKpi', width: 30, title: '存量维系'},
{dataIndex: 'yyKpi', width: 25, title: '团队运营'},
{dataIndex: 'workKpi', width: 25, title: '每月工作'},
{dataIndex: 'totalBonus', width: 25, title: '累计佣金'},
{dataIndex: 'totalFund', width: 25, title: '累计分成'},
{dataIndex: 'autumnBonus', width: 25, title: '秋营达标奖'},
{dataIndex: 'yfBonus', width: 25, title: '应发提成'}
],
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
let obj = cloneObject(this.queryParam)
return zjlKpiList(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: "",
zjlmoBan: true,
KDmoBan: true,
zjlkpivisible: false,
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)),
"总经理KPI信息" + nowdate + ".xlsx",
);
},
excelInto() {
this.importTile = "批量导入总经理KPI信息";
this.importUrl = "manager/ciop/managerKpi/importDate";
this.zjlmoBan = true;
this.zjlkpivisible = true
},
downloadMoBan: function () {
exportFile(downloadMoBan(), "总经理KPI信息.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);
},
createfunctionOk() {
this.zjlkpivisible = false;
this.clearmodel();
},
createfunctionCancel() {
this.zjlkpivisible = false;
this.clearmodel0();
},
clearmodel() {
this.importTile = "";
this.zjlmoBan = false;
this.importUrl = "";
},
search() {
console.log("queryParam.month=================="+this.queryParam);
this.$refs.table.refresh({search: true})
},
},
mounted() {
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<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
......@@ -12,7 +12,7 @@
</a-col>
<a-col :md="6" :sm="12">
<a-form-item label="学校名称">
<a-input placeholder="学校名称" v-model="queryParam.productUniversity" ></a-input>
<a-input placeholder="学校名称" v-model="queryParam.productUniversity"></a-input>
</a-form-item>
</a-col>
<a-col :md="12" :sm="12">
......@@ -25,7 +25,8 @@
</div>
<!--列表-->
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling" :locale="emptyText">
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling"
:locale="emptyText">
<!--拦截器-->
<template slot="productLastUpdateTime" slot-scope="text">
{{ text | dayjs}}
......@@ -73,33 +74,63 @@
<p><span>计费属性:{{chouti.universityChargingAttribute}}</span></p>
<p><span>学校联系号码:{{chouti.universityContactPhone}}</span></p>
</a-drawer>
<a-drawer
title="正则校检详情"
placement="right"
:closable="false"
@close="visibleT2 = false"
:visible="visibleT2"
width=" 40%"
>
<p><span>正则名称:{{regular.name}}</span></p>
<p><span>正则表达示:{{regular.regular}}</span></p>
<p><span>错误提示:{{regular.tips}}</span></p>
<p><span>输入框默认提示:{{regular.placeholder}}</span></p>
</a-drawer>
<a-form :form="Formtable">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="宽带标题:">
<a-input placeholder="宽带标题" v-decorator="[ 'productTitle', {rules: [{ required: true, message: '宽带标题不能为空!' ,validator: 'click'}]} ]"></a-input>
<a-input placeholder="宽带标题"
v-decorator="[ 'productTitle', {rules: [{ required: true, message: '宽带标题不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="区域:">
<a-input placeholder="区域" v-decorator="[ 'productRegion', {rules: [{ required: true, message: '区域不能为空!' ,validator: 'click'}]} ]"></a-input>
<a-input placeholder="区域"
v-decorator="[ 'productRegion', {rules: [{ required: true, message: '区域不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="资费:">
<a-input placeholder="资费" v-decorator="[ 'productPrice', {rules: [{required: true, message: '资费不能为空!' ,validator: 'click'}]} ]"></a-input>
<a-input placeholder="资费"
v-decorator="[ 'productPrice', {rules: [{required: true, message: '资费不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="宽带速率:">
<a-input placeholder="宽带速率" v-decorator="[ 'productMeal', {rules: [{ required: true, message: '宽带速率不能为空!' ,validator: 'click'}]} ]"></a-input>
<a-input placeholder="宽带速率"
v-decorator="[ 'productMeal', {rules: [{ required: true, message: '宽带速率不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="包年包月情况:">
<a-input placeholder="包年包月情况" v-decorator="[ 'productRate', {rules: [{ required: true, message: '包年包月情况不能为空!' ,validator: 'click'}]} ]"></a-input>
<a-input placeholder="包年包月情况"
v-decorator="[ 'productRate', {rules: [{ required: true, message: '包年包月情况不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="适用学校:">
<a-select v-model="universityName" style="width: 330px">
<a-select-option @click="universitySchoolName('请选择')" value="请选择">请选择</a-select-option>
<a-select-option @click="universitySchoolName(item)" v-for="item in universitySchool" :value="item.universityId">{{item.universityName}}</a-select-option>
<a-select-option @click="universitySchoolName(item)" v-for="item in universitySchool"
:value="item.universityId">
{{item.universityName}}
</a-select-option>
</a-select>
<a @click="visibleT = true">详情</a>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="套餐情况:">
<a-input :rows="10" v-model="modelData.productMealPrice"/>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则验证名:">
<a-select v-model="regularName" style="width: 330px">
<a-select-option @click="regularsName('请选择')" value="请选择">请选择</a-select-option>
<a-select-option @click="regularsName(item)" v-for="item in regulars" :value="item.regularId">
{{item.regularName}}
</a-select-option>
</a-select>
<a @click="visibleT2 = true">详情</a>
</a-form-item>
<div v-show="!add">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="状态">
<a-select placeholder="状态" v-decorator="[ 'productState']">
......@@ -108,12 +139,13 @@
</a-select>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="产品情况:">
<div v-html="productIntroduction">
</div>
<mavon-editor @save="saveProductIntroduction" ref="editor_a" v-model="productIntroduction"></mavon-editor>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="资费介绍:">
<div v-html="productSetMealIntroduction">
</div>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="单宽资费介绍:">
<mavon-editor @save="saveProductSetMealIntroduction" ref="editor_b" v-model="productSetMealIntroduction"></mavon-editor>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}" label="融合资费介绍:">
<mavon-editor @save="saveProductRf2" ref="editor_c" v-model="productRf2"></mavon-editor>
</a-form-item>
</div>
</a-form>
......@@ -123,42 +155,60 @@
<script>
import STable from '@/components/table';
import {productList,productDelete,productInsert,productUpdate,universitySchool} from "@/api/school-center/productAPI"
import {mavonEditor} from "mavon-editor";
import "mavon-editor/dist/css/index.css";
import {
productList,
productDelete,
productInsert,
productUpdate,
universitySchool
} from "@/api/school-center/productAPI"
import {cloneObject} from '@/utils/util';
export default {
name: "product",
components: {
STable,
STable, mavonEditor,
},
data(){
data() {
return {
universityIdtrue:true,
universityName:'',
visibleT:false,
chouti:{},
universitySchool:[],
universityIdtrue: true,
universityName: '',
regularName: '请选择',
visibleT: false,
visibleT2: false,
chouti: {},
regular: {},
universitySchool: [],
regulars: [],
emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this),
modifyvisible: false,
add: true,
productIntroduction:"",
productSetMealIntroduction:'',
productIntroduction: "",
productSetMealIntroduction: '',
productRf2:'',
queryParam: {
productUniversity :'', //适用学校
productRegion :'', // 区域
productTitle :'', //宽带标题
productState :'' // 宽带狀態
productUniversity: '', //适用学校
productRegion: '', // 区域
productTitle: '', //宽带标题
productState: '' // 宽带狀態
},
modelData:{
universityId:'',
productMealPrice:'',
productMeal:'',
productTitle:'',
productUniversity:'',
productPrice:'',
productRegion:'',
productRate:'',
productId:''
modelData: {
universityId: '',
productMealPrice: '',
productMeal: '',
productTitle: '',
productUniversity: '',
productPrice: '',
productRegion: '',
productRate: '',
productId: '',
productIntroduction:'',
productSetMealIntroduction:'',
productRf2:'',
productIntroductionPic2: ''
},
columns: [
{dataIndex: 'productTitle', width: 200, title: '宽带标题 '},
......@@ -166,8 +216,18 @@
{dataIndex: 'productPrice', width: 80, title: '资费 '},
{dataIndex: 'productRegion', width: 80, title: '县分'},
{dataIndex: 'productCreater', width: 80, title: '创建人 '},
{dataIndex: 'productLastUpdateTime', width: 200, title: '更新时间 ' ,scopedSlots: {customRender: 'productLastUpdateTime'}},
{dataIndex: 'productCreateTime', width: 200, title: '创建时间 ', scopedSlots: {customRender: 'productCreateTime'}},
{
dataIndex: 'productLastUpdateTime',
width: 200,
title: '更新时间 ',
scopedSlots: {customRender: 'productLastUpdateTime'}
},
{
dataIndex: 'productCreateTime',
width: 200,
title: '创建时间 ',
scopedSlots: {customRender: 'productCreateTime'}
},
{dataIndex: 'productState', width: 80, title: '状态 ', scopedSlots: {customRender: 'productState'}},
{dataIndex: 'productMealPrice', width: 200, title: '套餐情况 ', scopedSlots: {customRender: 'text'}},
{dataIndex: 'productRate', width: 120, title: '包年包月情况 '},
......@@ -189,7 +249,7 @@
}
let obj = cloneObject(this.queryParam)
//表示
return productList(Object.assign(params,obj)).then(res => {
return productList(Object.assign(params, obj)).then(res => {
let data = {}
if (res.state !== 'success') {
this.$message.error("查询失败!", 5);
......@@ -201,11 +261,12 @@
totalCount: 0
}
} else {
this.regulars = res.data.regulars;
data = {
data: res.data.records,
data: res.data.page.records,
pageSize: parameter.pageSize,
pageNo: parameter.pageNo,
totalCount: res.data.total
totalCount: res.data.page.total
}
}
return data
......@@ -213,14 +274,41 @@
}
}
},
methods:{
universitySchoolName(item){
if(item == '请选择'){
this.modelData.productUniversity=item
}else {
this.modelData.productUniversity=item.universityName
this.modelData.universityId=item.universityId
this.chouti=item
methods: {
saveProductIntroduction(markdown, html) {
// 此时会自动将 markdown 和 html 传递到这个方法中
console.log("markdown内容:" + markdown);
//alert("html内容:" + html);
this.productIntroduction = html;
},
saveProductSetMealIntroduction(markdown, html) {
// 此时会自动将 markdown 和 html 传递到这个方法中
console.log("markdown内容:" + markdown);
this.productSetMealIntroduction = html
//alert("html内容:" + html);
},
saveProductRf2(markdown, html) {
// 此时会自动将 markdown 和 html 传递到这个方法中
console.log("markdown内容:" + markdown);
this.productRf2 = html
//alert("html内容:" + html);
},
universitySchoolName(item) {
if (item == '请选择') {
this.modelData.universityId = ''
} else {
this.modelData.productUniversity = item.universityName
this.modelData.universityId = item.universityId
this.chouti = item
}
},
regularsName(item) {
if (item == '请选择') {
this.modelData.productIntroductionPic2 = ''
} else {
this.modelData.productIntroductionPic2 = item.id
this.name = item.name
this.regular = item
}
},
search() {
......@@ -228,76 +316,97 @@
},
remove(id) {
productDelete(id).then((res) => {
if(res.state=="success"){
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.$refs.table.refresh({search: true})
})
},
modifyfunction(data){
modifyfunction(data) {
universitySchool().then(res => {
this.universitySchool=res.data
this.universitySchool = res.data
res.data.forEach(value => {
if (data.universityId == value.universityId) {
this.chouti = value
}
})
if(data != undefined ){
this.productIntroduction=data.productIntroduction,
this.productSetMealIntroduction=data.productSetMealIntroduction,
this.modelData.productMealPrice=data.productMealPrice
this.modelData.productUniversity=data.productUniversity
this.universityName=data.productUniversity
this.modelData.universityId=data.universityId
this.modelData.productId=data.productId
setTimeout(()=>{
console.log(this.universitySchool)
})
if (data != undefined) {
this.productIntroduction = data.productIntroduction
this.productSetMealIntroduction = data.productSetMealIntroduction
this.productRf2 = data.productRf2
this.modelData.productMealPrice = data.productMealPrice
this.modelData.productUniversity = data.productUniversity
this.universityName = data.productUniversity
for (var i = 0; i < this.regulars.length; i++) {
if (data.productIntroductionPic2 == this.regulars[i].regularId + '') {
this.regularName = this.regulars[i].regularName
this.modelData.productIntroductionPic2 = this.regulars[i].regularId
}
}
this.modelData.universityId = data.universityId
this.modelData.productId = data.productId
setTimeout(() => {
this.Formtable.setFieldsValue({
"productMeal":data.productMeal,
"productTitle":data.productTitle,
"productPrice":data.productPrice,
"productRegion":data.productRegion,
"productRate":data.productRate,
productState:data.productState
"productMeal": data.productMeal,
"productTitle": data.productTitle,
"productPrice": data.productPrice,
"productRegion": data.productRegion,
"productRate": data.productRate,
"productState": data.productState
})
},0)
this.add=false;
}else {
this.universityName='请选择'
}, 0)
this.add = false;
} else {
this.universityName = '请选择'
this.regularName = "请选择";
}
this.modifyvisible=true;
this.modifyvisible = true;
},
createfunctionOk(){
if(this.modelData.universityId == '' || this.modelData.universityId == undefined || this.modelData.productUniversity=='请选择'){
createfunctionOk() {
if (this.modelData.universityId == '' || this.modelData.universityId == undefined || this.modelData.productUniversity == '请选择') {
this.$notification.error({message: '请选择适用学校', duration: 4})
return
}
let that = this;
that.Formtable.validateFields(['productMeal','productTitle','productPrice','productRegion','productRate','productState'], {force: true}, (err, values) => {
if (err ) {
that.Formtable.validateFields(
[
'productMeal', 'productTitle', 'productPrice', 'productRegion', 'productRate',
'productState', "productIntroduction", "productSetMealIntroduction", "productRf2"
], {force: true}, (err, values) => {
if (err) {
return;
}
that.modelData.productMeal=values.productMeal
that.modelData.productTitle=values.productTitle
that.modelData.productPrice=values.productPrice
that.modelData.productRegion=values.productRegion
that.modelData.productRate=values.productRate
that.modelData.productState=values.productState
if(this.add){
let obj= that.modelData;
that.modelData.productMeal = values.productMeal
that.modelData.productTitle = values.productTitle
that.modelData.productPrice = values.productPrice
that.modelData.productRegion = values.productRegion
that.modelData.productRate = values.productRate
that.modelData.productState = values.productState
that.modelData.productIntroduction = this.$refs.editor_a.d_render;
that.modelData.productSetMealIntroduction = this.$refs.editor_b.d_render;
that.modelData.productRf2 = this.$refs.editor_c.d_render;
if (this.add) {
let obj = that.modelData;
delete obj.productId
let product= JSON.stringify(obj);
let product = JSON.stringify(obj);
productInsert({product}).then((res) => {
this.modifyvisible=false;
this.modifyvisible = false;
this.clearmodel()
if(res.state=="success"){
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search()
})
}else {
let obj= that.modelData;
let product= JSON.stringify(obj);
} else {
let obj = that.modelData;
let product = JSON.stringify(obj);
productUpdate({product}).then((res) => {
this.modifyvisible=false;
this.modifyvisible = false;
this.clearmodel()
if(res.state=="success"){
if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search()
......@@ -305,28 +414,29 @@
}
})
},
createfunctionCancel(){
this.modifyvisible=false;
createfunctionCancel() {
this.modifyvisible = false;
this.clearmodel()
this.add=true;
this.add = true;
},
//清除弹窗信息
clearmodel() {
this.add=true
this.add = true
let that = this;
that.modelData.productMealPrice=''
that.modelData.productId=''
that.modelData.productIntroduction=''
that.modelData.productSetMealIntroduction=''
that.modelData.productUniversity='',
that.modelData.universityId='',
that.modelData.productMealPrice = ''
that.modelData.productId = ''
that.modelData.productIntroduction = ''
that.modelData.productSetMealIntroduction = ''
that.modelData.productUniversity = ''
that.modelData.universityId = ''
that.modelData.productIntroductionPic2 = ''
this.Formtable.setFieldsValue({
productMeal:'',
productTitle:'',
productPrice:'',
productRegion:'',
productRate:'',
productState:'0'
productMeal: '',
productTitle: '',
productPrice: '',
productRegion: '',
productRate: '',
productState: '0'
})
}
}
......
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item label="正则名称">
<a-input placeholder="正则名称" v-model="queryParam.regularName" ></a-input>
</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-col>
</span>
</a-row>
</a-form>
</div>
<!--列表-->
<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 @click="modifyfunction(record)">编辑</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定不显示吗" v-if="record.isShow == 1" @confirm="remove(record.regularId,0)">
<a>隐藏</a>
</a-popconfirm>
<a-popconfirm title="确定显示吗" v-if="record.isShow == 0" @confirm="remove(record.regularId,1)">
<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 v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="">
<a-input placeholder="regularId" v-decorator="[ 'regularId', {rules: [{ required: true, message: 'regularId' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则名称:">
<a-input placeholder="正则名称" v-decorator="[ 'regularName', {rules: [{ required: true, message: '学校名称不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则表达示:">
<a-input placeholder="正则表达示" v-decorator="[ 'regular', {rules: [{ required: true, message: '表达示不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="错误提示:">
<a-input placeholder="错误提示" v-decorator="[ 'tips', {rules: [{required: true, message: '装机地址不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="输入框默认值:">
<a-input placeholder="输入框默认值" v-decorator="[ 'placeholder', {rules: [{ required: true, message: '外线方式不能为空!' ,validator: 'click'}]} ]"></a-input>
</a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="是否显示:">
<a-select v-decorator="[ 'isShow' ]" style="width: 330px">
<a-select-option key="1"></a-select-option>
<a-select-option key="0"></a-select-option>
</a-select>
</a-form-item>
</a-form>
</a-modal>
</div>
</template>
<script>
import STable from '@/components/table';
import {regularList,regularDelete,regularInsert,regularUpdate} from "@/api/school-center/verCodesAPI"
import {cloneObject} from '@/utils/util';
export default {
name: "codeManage",
components: {
STable,
},
data(){
return {
emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this),
modifyvisible: false,
add: true,
queryParam: {
regularName :'',
},
modelData:{
regularId: '',
regularName:'',
regular:'',
tips:'',
placeholder:'',
isShow: '1'
},
columns: [
{dataIndex: 'regularId', width: 20, title: 'regularId',istrue: true},
{dataIndex: 'regularName', width: 70, title: '正则名称'},
{dataIndex: 'regular', width: 100, title: '正则表达示 '},
{dataIndex: 'tips', width: 70, title: '错误提示'},
{dataIndex: 'placeholder', width: 70, title: '输入框默认提示 '},
{
dataIndex: 'operation',
width: 26,
title: '操作',
scopedSlots: {customRender: 'operation'},
fixed: "right"
}]
,
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
let obj = cloneObject(this.queryParam)
//表示
return regularList(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
})
}
}
},
methods:{
search() {
this.$refs.table.refresh({search: true})
},
remove(regularId,isShow) {
regularDelete({'regularId':regularId,'isShow':isShow}).then((res) => {
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.$refs.table.refresh({search: true})
})
},
modifyfunction(data){
if(data != undefined ){
this.modelData.regularId=data.regularId
setTimeout(()=>{
this.Formtable.setFieldsValue({
"regularId":data.regularId,
"regularName":data.regularName,
"regular":data.regular,
"tips":data.tips,
"placeholder":data.placeholder,
"isShow":data.isShow
})
},0)
this.add=false;
}
this.modifyvisible=true;
},
createfunctionOk(){
let that = this;
that.Formtable.validateFields(['regularName','regular','tips','placeholder','isShow'], {force: true}, (err, values) => {
if (err ) {
return;
}
that.modelData.regularName=values.regularName
that.modelData.regular=values.regular
that.modelData.tips=values.tips
that.modelData.placeholder=values.placeholder
that.modelData.isShow=values.isShow
if(this.add){
let obj= that.modelData;
delete obj.id
let regular= JSON.stringify(obj);
regularInsert({regular}).then((res) => {
this.modifyvisible=false;
this.clearmodel()
if(res.state=="success"){
this.$notification.success({message: res.data, description: '', duration: 4})
}
this.search()
})
}else {
let obj= that.modelData;
let regular= JSON.stringify(obj);
regularUpdate({regular}).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.regularId=''
this.Formtable.setFieldsValue({
"regularName":'',
"regular":'',
"tips":'',
"placeholder":'',
"isShow":'',
})
}
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
<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" v-show="false">
<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-if="text==3">售出中</p>
<p v-else=""></p>
</template>
<template slot="operation" slot-scope="text,record">
<span>
<a-popconfirm title="确定删除吗" v-if="record.state == 1" @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
<template>
<div class="flex-container">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<!-- 搜索区域 -->
<a-form layout="inline">
<a-row :gutter="24">
<a-col :md="5" :sm="8">
<a-form-item label="订单编号:">
<a-input placeholder="订单编号" v-model="queryParam.orderNum" style="width: 12rem;"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :sm="6">
<a-form-item label="买家账号:">
<a-input placeholder="买家账号" v-model="queryParam.account" style="width:10rem;"></a-input>
</a-form-item>
</a-col>
<a-col :md="4" :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="4" :sm="6">
<a-form-item label="付款状态:">
<a-select v-model="queryParam.state" 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-option key="4">已取消订单</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="4" :sm="4">
<a-form-item label="县分">
<a-select v-model="queryParam.substName" @change="getSchoolNames" style="width: 6rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option v-for="d in subNames" :key="d.value" :value="d.value">{{d.text}}
</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.schoolName" style="width: 18rem;">
<a-select-option key="">--全部--</a-select-option>
<a-select-option v-for="d in schoolNames" :key="d.value" :value="d.value">{{d.text}}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="6" :sm="6">
<a-form-item label="创建时间">
<a-range-picker @change="onChange" />
<!--<a-range-picker
:placeholder="['开始时间', '结束时间']"
format="YYYY-MM"
:value="queryParam.month"
:mode="tempMode"
@panelChange="handlePanelChange"
style="width: 12rem;"
/>-->
</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="state" slot-scope="text">
<p v-if="text==1">未付款</p>
<p v-if="text==2">付款成功</p>
<p v-if="text==3">付款失败</p>
<p v-if="text==4">已取消订单</p>
<p v-else=""></p>
</template>
<template slot="operation" slot-scope="text,record">
<span>
<a @click="modifyfunction(record)">查看订单详情</a>
<a-divider v-if="record.state==1" type="vertical"/>
<a-popconfirm title="确定要取消订单吗?" @confirm="remove(record)">
<a v-if="record.state==1">取消订单</a>
</a-popconfirm>
</span>
</template>
</s-table>
<!----弹框-->
<a-modal title="订单详情" :visible="modifyvisible" @ok="createfunctionCancel" @cancel="createfunctionCancel" height="600px" width="1100px">
<a-table :columns="columns2" :data-source="datas" bordered :row-style="{height:'25px'}">
<!--拦截器-->
<template slot="updateDate2" slot-scope="text">
{{ text | dayjs}}
</template>
<!--拦截器-->
<template slot="validityPeriod2" slot-scope="text">
{{ text | dayjs}}
</template>
<template slot="shelfState2" slot-scope="text">
<p v-if="text==1">已上架</p>
<p v-if="text==2">已下架</p>
<p v-else=""></p>
</template>
<template slot="state2" slot-scope="text">
<p v-if="text==1">未售出</p>
<p v-if="text==2">已售出</p>
<p v-if="text==3">售出中</p>
<p v-else=""></p>
</template>
<template v-for="col in ['cardNumber', 'state', 'shelfState','validityPeriod','updateDate']" :slot="col" slot-scope="text, record, index">
<div :key="col">
<a-input v-if="record.editable" style="margin: -5px 0" :value="text" @change="e => handleChange(e.target.value, record.key, col)"/>
<template v-else>
{{ text }}
</template>
</div>
</template>
</a-table>
</a-modal>
</div>
</template>
<script>
import STable from '@/components/table';
import ImportBtn from "../../../components/sysmanage/ImportBtn";
import {
yxtOrderList, yxtOrderDelete, getSchoolNames, initSubstName, uploadExcel, downloadMoBan
} from "@/api/school-center/yxtOrderAPI"
import {cloneObject, exportFile} from '@/utils/util';
import Vue from 'vue';
import {DatetimePicker} from 'vant';
import moment from "moment";
import ConstantActivity from "@/constant/ConstantActivity";
import {getYxtCard} from "../../../api/school-center/yxtOrderAPI";
Vue.use(DatetimePicker);
export default {
name: "louZhangKPI",
components: {
STable, ImportBtn
},
data() {
return {
emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this),
modifyvisible: false,
kpiModifyvisible: false,
title: ConstantActivity.title,
add: true,
queryParam: {
orderNum:'',
account:'',
name: '',
state:'',
substName: '',
schoolName: '',
month: '',
},
subNames: [],
schoolNames: [],
modelData: {
id: '',
userId: '',
sysuName: '',
account: '',
substName: '',
schoolName: '',
reportDaily: '',
collectiveSales: '',
weeklyMeeting: '',
organTraining: '',
designPlan: '',
kpi: '',
month: '',
isDel: '0'
},
columns: [
{dataIndex: 'orderNum', width: 40, title: '订单号'},
{dataIndex: 'totalPrice', width: 15, title: '金额'},
{dataIndex: 'state', width: 15, title: '订单状态', scopedSlots: {customRender: 'state'}},
{dataIndex: 'orderType', width: 15, title: '订单类型'},
{dataIndex: 'account', width: 20, title: '账号'},
{dataIndex: 'sysuName', width: 15, title: '姓名'},
{dataIndex: 'schoolName', width: 40, title: '学校'},
{dataIndex: 'substName', width: 10, title: '县分'},
{dataIndex: 'updateDate', width: 25, title: '创建时间', scopedSlots: {customRender: 'updateDate'}},
{
dataIndex: 'operation',
width: 30,
title: '操作',
scopedSlots: {customRender: 'operation'},
fixed: "right"
}
],
columns2: [
{title: '兑换券账号',dataIndex: 'cardNumber',width: 25,scopedSlots: { customRender: 'cardNumber' },},
{title: '售出状态',dataIndex: 'state',width: 15,scopedSlots: { customRender: 'state2' },},
{title: '上架状态',dataIndex: 'shelfState',width: 15,scopedSlots: { customRender: 'shelfState2' },},
{title: '有效截止日期',dataIndex: 'validityPeriod',width: 25,scopedSlots: { customRender: 'validityPeriod2' },},
{title: '上传时间',dataIndex: 'updateDate',width: 25,scopedSlots: { customRender: 'updateDate2' },}
],
rowdata: parameter => {
let params = {
pageNo: parameter.pageNo,
pageSize: parameter.pageSize
}
let obj = cloneObject(this.queryParam)
//表示
return yxtOrderList(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'],
datas : [],
}
},
methods: {
moment,
onChange(date, dateString) {
this.queryParam.month = dateString;
console.log(date, 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/yxtOrder/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(data) {
yxtOrderDelete({'id': data.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})
})
},
modifyfunction(data) {
if (data != undefined) {
getYxtCard({'orderId': data.id,'pageNo': 1,'pageSize': 10}).then((res) => {
if (res.state == "success") {
this.datas = res.data.records
} else{
this.$message.error(res.msg);
return;
}
})
}
this.modifyvisible = true;
},
createfunctionCancel() {
this.modifyvisible = false;
},
getSchoolNames() {
this.schoolNames = []
this.queryParam.schoolName = ''
getSchoolNames({"substName": this.queryParam.substName}).then((res) => {
if (res.state == "success") {
const result = res.data
result.forEach((r) => {
if (r.schoolName === 'null')
return;
this.schoolNames.push({
value: r.schoolName,
text: r.schoolName
})
})
}
})
},
initSubstName() {
initSubstName().then((res) => {
if (res.state == "success") {
const result = res.data
result.forEach((r) => {
if (r.subName === 'null')
return;
this.subNames.push({
value: r.subName,
text: r.subName
})
})
}
})
}
},
mounted() {
this.initSubstName();
this.getSchoolNames();
}
}
</script>
<style scoped>
</style>
\ No newline at end of file
......@@ -31,8 +31,8 @@
<a-col :md="6" :sm="24">
<a-form-item label="使用状态">
<a-select v-model="queryParams.status" placeholder="请选择" default-value="1">
<!-- <a-select-option value="1,2,3">全部</a-select-option>-->
<a-select v-model="queryParams.status" placeholder="请选择" default-value="0">
<a-select-option value="">全部</a-select-option>
<a-select-option value="1">正常</a-select-option>
<a-select-option value="2">冻结</a-select-option>
<a-select-option value="3">已失效</a-select-option>
......@@ -89,18 +89,31 @@
</s-table>
<!-- 修改密码 -->
<a-modal title="密码修改" v-model="editpaswordmodel" @ok="editPassword" @cancel="editPasswordcancel">
<a-form :form="EditPassFrom" >
<a-form-item label="原密码" v-if="hasOperationPermission(['超级管理员'])">
<a-input placeholder="原密码" type="password" v-model="editpasswordfrom.oldPwd"></a-input>
<a-form :form="EditPassFrom">
<a-form-item label="用户密码" >
<a-input placeholder="用户密码" v-decorator="['glyPwd',{rules: [{ required: true, message: '用户密码不能为空!' }]}]" type="password"></a-input>
</a-form-item>
<a-form-item label="新密码" >
<a-input placeholder="新密码" v-decorator="['editpassword',{rules: [{ required: true, message: '新密码不能为空!' }]}]" type="password"></a-input>
</a-form-item>
<a-form-item label="确认密码" >
<a-input placeholder="确认密码" v-decorator="['editrepassword',{rules: [{ required: true, message: '确认密码不能为空' }, { validator: this.compareToFirstPassword,}]}]" type="password"></a-input>
</a-form-item>
<a-form-item label="验证码">
<a-input style="width:350px;margin-right: 10px"
v-decorator="['inputCode',{rules: [{ required: true, message: '验证码不能为空!' }]}]"
type="text"
placeholder="请输入验证码">
</a-input>
<a-button
type="primary"
htmlType="submit"
@click.stop.prevent="getCode"
>{{codeMsg}}
</a-button>
</a-form-item>
</a-form>
</a-modal>
<!-- 添加用户 -->
......@@ -224,6 +237,7 @@ import treeList from '@/components/sysmanage/treeList'
import treecheck from '@/components/sysmanage/treeCheck'
import JDate from '@/components/jeecg/JDate'
import {notification} from 'ant-design-vue'
import { postAction } from '@/api/manage'
import { unique } from '@/utils/util'
import {
getList,
......@@ -251,15 +265,20 @@ export default {
},
data() {
return {
countdown: 60,// 倒计时秒数
codeMsg: '获取验证码', // 按钮上的文字
timer: null,// 定时器
title:"修改密码",
EditPassFrom: this.$form.createForm(this, { name: 'modify'},),
EditPassMess:"不能为空!",
//修改密码窗口
editpaswordmodel:false,
editpasswordfrom:{
oldPwd:'',
newPwd:"",
rePwd:"",
changeId:"",
glyPwd:'',
inputCode:''
},
settings:{ y: 500,x:2000 },
advanced:false,//控制菜单展开
......@@ -292,7 +311,7 @@ export default {
//查询条件
queryParams: {
account: '',
status:"1",
status:"",
deptid:"",
name:"",
phone:""
......@@ -343,10 +362,41 @@ export default {
resetPassw: false,
add_user: false,
Department: false,
reol: false
reol: false,
url: "auth/ciop/mgr/changeOtherPwd",
codeurl:"auth/ciop/mgr/codemessage",
}
},
methods: {
getCode() {
// 验证码60秒倒计时
if (!this.timer) {
postAction(this.codeurl).then((res)=>{
if (res.code==200){
this.$notification.success({
message: res.data,
});
return null;
}
this.$notification.error({
message: res.data,
});
})
this.timer = setInterval(() => {
if (this.countdown > 0 && this.countdown <= 60) {
this.countdown--;
if (this.countdown !== 0) {
this.codeMsg = "重新发送(" + this.countdown + ")";
} else {
clearInterval(this.timer);
this.codeMsg = "获取验证码";
this.countdown = 60;
this.timer = null;
}
}
}, 1000)
}
},
//密码加密
getPass(text){
/*let keyss = setMaxDigits(130);
......@@ -361,31 +411,37 @@ export default {
},
//提交密码修改
editPassword() {
if(this.hasOperationPermission(['超级管理员'])){
if(this.editpasswordfrom.oldPwd == '' || this.editpasswordfrom.oldPwd==undefined){
this.$message.error("请输入原密码!", 5);
}
let mima = (/^(?![A-Za-z]+$)(?![A-Z\d]+$)(?![A-Z\W]+$)(?![a-z\d]+$)(?![a-z\W]+$)(?![\d\W]+$)\S{8,}$/);
if(mima.test(this.EditPassFrom.getFieldValue('editpassword'))==false){
this.$message.error("密码强制等级低,必须要数字、小写英文字母、大写英文字母或特殊字符混合组成,长度至少8位!", 5);
return
}
this.EditPassFrom.validateFields(err => {
if (!err) {
this.editpasswordfrom.newPwd= encodeURIComponent(this.getPass(this.EditPassFrom.getFieldValue('editpassword')))
this.editpasswordfrom.oldPwd= encodeURIComponent(this.getPass(this.editpasswordfrom.oldPwd))
this.editpasswordfrom.rePwd=this.editpasswordfrom.newPwd
this.editpasswordfrom.glyPwd=encodeURIComponent(this.getPass(this.EditPassFrom.getFieldValue('glyPwd')))
this.editpasswordfrom.inputCode=encodeURIComponent(this.getPass(this.EditPassFrom.getFieldValue('inputCode')))
changeOtherPwd(this.editpasswordfrom).then(res => {
if (res.state == 'success') {
this.editpasswordfrom.oldPwd = ''
this.editpasswordfrom.editrepassword = ''
this.editpasswordfrom.editpassword = ''
if (res.code == 200) {
this.EditPassFrom.setFieldsValue({editpassword:""});
this.EditPassFrom.setFieldsValue({editrepassword:""});
this.EditPassFrom.setFieldsValue({glyPwd:""});
this.EditPassFrom.setFieldsValue({inputCode:""});
if(res.message==undefined){
this.$message.success(res.data != "" ? res.data : "修改成功", 5);
}else{
this.editpasswordfrom.oldPwd = ''
this.editpasswordfrom.editrepassword = ''
this.editpasswordfrom.editpassword = ''
this.$message.error(res.msg != "" ? res.msg : "修改失败", 5);
}else {
this.$message.success(res.message != "" ? res.message : "修改成功", 5);
}
this.editpaswordmodel = false
}else{
if(res.message==undefined){
this.$message.error(res.data != "" ? res.data : "失败修改", 5);
}else {
this.$message.error(res.message != "" ? res.message : "失败修改", 5);
}
}
})
}
})
......@@ -394,7 +450,9 @@ export default {
this.editpaswordmodel=false
this.EditPassFrom.setFieldsValue({
editpassword:'',
editrepassword:''
editrepassword:'',
glyPwd:'',
inputCode:''
})
},
compareToFirstPassword (rule, value, callback) {
......@@ -585,14 +643,6 @@ export default {
that.$refs.table.refresh({ search: true })
})
},
hasOperationPermission(marks = []) {
for (const index in marks) {
if (this.$store.state.user.info.role.indexOf(marks[index]) > -1) {
return false;
}
}
return true;
},
updatePassword(userid){
this.editpaswordmodel=true
this.editpasswordfrom.changeId=userid;
......
......@@ -125,6 +125,7 @@ export default {
requiredTwoStepCaptcha: false,
stepCaptchaVisible: false,
form: this.$form.createForm(this),
updateTime:'',
formLogin: {
username: "",
password: "",
......@@ -216,7 +217,9 @@ export default {
loginParams.remember = that.formLogin.remember;
loginParams.phonecode=encodeURIComponent(this.getPass(values.phonecode));
//console.log(loginParams);
that.Login(loginParams).then(() => {
that.Login(loginParams).then((res) => {
this.updateTime = res.updateTime
console.log(res.updateTime)
this.departConfirm({});
}).catch((err) => {
that.requestFailed(err);
......
......@@ -99,7 +99,6 @@ import {timeFix} from "@/utils/util"
import Vue from 'vue'
import {ACCESS_TOKEN} from "@/store/mutation-types"
import JGraphicCode from '@/components/jeecg/JGraphicCode'
import {setMaxDigits , RSAKeyPair , encryptedString} from '@/utils/RSA'
import {
register,registercode
} from '@/api/system'
......@@ -165,17 +164,17 @@ export default {
// 验证码60秒倒计时
if (!this.timer) {
let data={
account:this.form.getFieldValue("username")
username:this.form.getFieldValue("username")
}
registercode(data).then(res=>{
if (res.code==200){
this.$notification.success({
message: res.data,
message: res.message,
});
return null;
}
this.$notification.error({
message: res.data,
message: res.message,
});
})
this.timer = setInterval(() => {
......
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