Commit 33dde46b by 彭祥礼

增加楼长薪水管理

parent 77acb4c2
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);
export {
initSubstName,
getSchoolNames,
uploadExcel,
downloadMoBan,
lzSalaryList,
lzSalaryDelete,
lzSalaryInsert,
lzSalaryUpdate,
}
...@@ -88,8 +88,7 @@ ...@@ -88,8 +88,7 @@
</a-row> </a-row>
</a-modal> </a-modal>
<!--列表--> <!--列表-->
<s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling" <s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling" :locale="emptyText">
:locale="emptyText">
<!--拦截器--> <!--拦截器-->
<template slot="productLastUpdateTime" slot-scope="text"> <template slot="productLastUpdateTime" slot-scope="text">
{{ text | dayjs}} {{ text | dayjs}}
...@@ -105,59 +104,73 @@ ...@@ -105,59 +104,73 @@
<template slot="operation" slot-scope="text,record"> <template slot="operation" slot-scope="text,record">
<span> <span>
<a @click="modifyfunction(record)">KPI打分</a> <a @click="modifyfunction(record)">KPI打分</a>
<a-divider v-show="false" type="vertical"/> <a-divider type="vertical"/>
<a-popconfirm title="确定不显示吗" v-show="false" v-if="record.isDel == 0" @confirm="remove(record.id,1)"> <a-popconfirm title="确定删除吗?" @confirm="remove(record.id,'')">
<a>隐藏</a> <a>删除</a>
</a-popconfirm>
<a-popconfirm v-show="false" title="确定显示吗" v-if="record.isDel == 1" @confirm="remove(record.id,0)">
<a>显示</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
</template> </template>
</s-table> </s-table>
<!----弹框--> <!----弹框-->
<a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" <a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px">
@cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-form :form="Formtable"> <a-form :form="Formtable">
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="姓名:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="姓名:">
<a-input placeholder="姓名" v-decorator="[ 'sysuName']" disabled/> <a-input placeholder="姓名" v-decorator="[ 'sysuName', {rules: [{ required: true, message: '姓名不能为空!' }]} ]" :disabled="isdisabled"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="学校:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="账号:">
<a-input placeholder="学校" v-decorator="[ 'schoolName', ]" disabled/> <a-input placeholder="账号" v-decorator="[ 'account', {rules: [{ required: true, message: '账号不能为空!' }]} ]" :disabled="isdisabled"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="汇总任务量(满分:30):"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="汇总任务量(满分:30):">
<a-input-number placeholder="汇总任务量" :min="0" <a-input-number
v-decorator="[ 'reportDaily', {rules: [{ required: true, message: '汇总任务量不能为空!' }]} ]" placeholder="汇总任务量"
style="width: 20rem;"/> style="width: 20rem;"
:min="0"
:max="30"
v-decorator="[ 'reportDaily', {rules: [{ required: true, message: '汇总任务量不能为空!' }]} ]"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="参与集中营销(满分:30):"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="参与集中营销(满分:30):">
<a-input-number placeholder="参与集中营销" :min="0" <a-input-number
placeholder="参与集中营销"
:min="0"
:max="30"
v-decorator="[ 'collectiveSales', {rules: [{required: true, message: '参与集中营销不能为空!' }]} ]" v-decorator="[ 'collectiveSales', {rules: [{required: true, message: '参与集中营销不能为空!' }]} ]"
style="width: 20rem;"/> style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织周例会(满分:10):"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织周例会(满分:10):">
<a-input-number placeholder="组织周例会" :min="0" <a-input-number
placeholder="组织周例会"
:min="0"
:max="10"
v-decorator="[ 'weeklyMeeting', {rules: [{ required: true, message: '组织周例会不能为空!' }]} ]" v-decorator="[ 'weeklyMeeting', {rules: [{ required: true, message: '组织周例会不能为空!' }]} ]"
style="width: 20rem;"/> style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="定制扫楼营销方案(满分:10):"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="定制扫楼营销方案(满分:10):">
<a-input-number placeholder="定制扫楼营销方案" :min="0" <a-input-number
placeholder="定制扫楼营销方案"
:min="0"
:max="10"
v-decorator="[ 'organTraining', {rules: [{ required: true, message: '定制扫楼营销方案不能为空!' }]} ]" v-decorator="[ 'organTraining', {rules: [{ required: true, message: '定制扫楼营销方案不能为空!' }]} ]"
style="width: 20rem;"/> style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织培训(满分:20):"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织培训(满分:20):">
<a-input-number placeholder="组织培训" :min="0" <a-input-number
placeholder="组织培训"
:min="0"
:max="20"
v-decorator="[ 'designPlan', {rules: [{required: true, message: '组织培训不能为空!' }]} ]" v-decorator="[ 'designPlan', {rules: [{required: true, message: '组织培训不能为空!' }]} ]"
style="width: 20rem;"/> style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI总值:"> <a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI总值:">
<a-input-number placeholder="KPI总值" :min="0" <a-input-number
v-decorator="[ 'kpi', {rules: [{ required: true, message: 'KPI总值不能为空!'}]} ]" placeholder="KPI总值"
style="width: 20rem;"/> :min="0"
:max="100"
v-decorator="[ 'kpi' ]"
style="width: 20rem;"
disabled/>
</a-form-item> </a-form-item>
<a-form-item v-show="add" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="KPI月份:"> <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' ]" <a-month-picker @change="onChange" placeholder="选择KPI月份" v-decorator="[ 'month' ]" style="width: 20rem;"/>
style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="是否删除:"> <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 v-decorator="['isDel']" style="width: 330px">
...@@ -198,6 +211,7 @@ ...@@ -198,6 +211,7 @@
kpiModifyvisible: false, kpiModifyvisible: false,
title: ConstantActivity.title, title: ConstantActivity.title,
add: true, add: true,
isdisabled: true,
queryParam: { queryParam: {
userName: '', userName: '',
substName: '', substName: '',
...@@ -223,17 +237,17 @@ ...@@ -223,17 +237,17 @@
isDel: '0' isDel: '0'
}, },
columns: [ columns: [
{dataIndex: 'sysuName', width: 40, title: '姓名'}, {dataIndex: 'sysuName', width: 25, title: '姓名'},
{dataIndex: 'account', width: 50, title: '账号'}, {dataIndex: 'account', width: 40, title: '账号'},
{dataIndex: 'substName', width: 30, title: '县分'}, {dataIndex: 'substName', width: 20, title: '县分'},
{dataIndex: 'schoolName', width: 70, title: '学校'}, {dataIndex: 'schoolName', width: 70, title: '学校'},
{dataIndex: 'reportDaily', width: 30, title: '汇总任务量'}, {dataIndex: 'reportDaily', width: 25, title: '汇总任务量'},
{dataIndex: 'collectiveSales', width: 30, title: '参与集中营销'}, {dataIndex: 'collectiveSales', width: 30, title: '参与集中营销'},
{dataIndex: 'weeklyMeeting', width: 30, title: '组织周例会'}, {dataIndex: 'weeklyMeeting', width: 25, title: '组织周例会'},
{dataIndex: 'organTraining', width: 30, title: '定制扫楼营销方案 '}, {dataIndex: 'organTraining', width: 30, title: '定制扫楼营销方案 '},
{dataIndex: 'designPlan', width: 30, title: '组织培训 '}, {dataIndex: 'designPlan', width: 20, title: '组织培训 '},
{dataIndex: 'kpi', width: 30, title: 'KPI总值'}, {dataIndex: 'kpi', width: 20, title: 'KPI总值'},
{dataIndex: 'month', width: 30, title: 'KPI月份 '}, {dataIndex: 'month', width: 20, title: 'KPI月份 '},
{ {
dataIndex: 'operation', dataIndex: 'operation',
width: 30, width: 30,
...@@ -292,7 +306,7 @@ ...@@ -292,7 +306,7 @@
//导出 //导出
exportFile( exportFile(
uploadExcel(Object.assign(params, obj)), uploadExcel(Object.assign(params, obj)),
"楼长KPI管理信息" + nowdate + ".xls", "楼长KPI管理信息" + nowdate + ".xlsx",
); );
}, },
...@@ -335,15 +349,22 @@ ...@@ -335,15 +349,22 @@
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}, },
remove(id, isdel) { remove(id, isdel) {
lzKpiDelete({'id': id, 'isdel': isdel}).then((res) => { lzKpiDelete({'id': id, 'isdel': "isdel"}).then((res) => {
if (res.state == "success") { if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
else{
this.$message.error(res.msg);
return;
}
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}) })
}, },
modifyfunction(data) { modifyfunction(data) {
if (data != undefined) { if (data != undefined) {
this.add = false;
this.isdisabled = true;
this.modelData.id = data.id this.modelData.id = data.id
this.modelData.userId = data.userId this.modelData.userId = data.userId
this.modelData.month = data.month this.modelData.month = data.month
...@@ -363,7 +384,8 @@ ...@@ -363,7 +384,8 @@
"isDel": data.isDel "isDel": data.isDel
}) })
}, 0) }, 0)
this.add = false; }else{
this.isdisabled = false;
} }
this.modifyvisible = true; this.modifyvisible = true;
}, },
...@@ -373,6 +395,8 @@ ...@@ -373,6 +395,8 @@
if (err) { if (err) {
return; return;
} }
that.modelData.sysuName = values.sysuName
that.modelData.account = values.account
that.modelData.reportDaily = values.reportDaily that.modelData.reportDaily = values.reportDaily
that.modelData.collectiveSales = values.collectiveSales that.modelData.collectiveSales = values.collectiveSales
that.modelData.weeklyMeeting = values.weeklyMeeting that.modelData.weeklyMeeting = values.weeklyMeeting
...@@ -389,6 +413,9 @@ ...@@ -389,6 +413,9 @@
this.clearmodel() this.clearmodel()
if (res.state == "success") { if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
}else{
this.$message.error(res.msg);
return;
} }
this.search() this.search()
}) })
......
...@@ -5,22 +5,88 @@ ...@@ -5,22 +5,88 @@
<!-- 搜索区域 --> <!-- 搜索区域 -->
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="24"> <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-col :md="6" :sm="12">
<a-form-item label="正则名称"> <a-form-item label="学校">
<a-input placeholder="正则名称" v-model="queryParam.regularName" ></a-input> <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-form-item>
</a-col> </a-col>
<span class="table-page-search-submitButtons" style="float: left; overflow: hidden;"> <span class="table-page-search-submitButtons" style="float: left; overflow: hidden;">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-button @click="search()" type="primary">查询</a-button> <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 v-show="false" type="vertical"/>
<a-button v-show="false" @click="excelInto()" type="primary">KPI数据导入</a-button>
<a-divider type="vertical"/> <a-divider type="vertical"/>
<a-button @click="modifyfunction()" type="primary">添加</a-button> <a-button @click="excelOut()" type="primary">KPI数据导出</a-button>
</a-col> </a-col>
</span> </span>
</a-row> </a-row>
</a-form> </a-form>
</div> </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"> <s-table :columns="columns" :data="rowdata" bordered ref="table" size="small" class="flex-filling" :locale="emptyText">
<!--拦截器--> <!--拦截器-->
...@@ -37,13 +103,10 @@ ...@@ -37,13 +103,10 @@
</template> </template>
<template slot="operation" slot-scope="text,record"> <template slot="operation" slot-scope="text,record">
<span> <span>
<a @click="modifyfunction(record)">编辑</a> <a v-show="false" @click="modifyfunction(record)">编辑</a>
<a-divider type="vertical"/> <a-divider v-show="false" type="vertical"/>
<a-popconfirm title="确定不显示吗" v-if="record.isShow == 1" @confirm="remove(record.regularId,0)"> <a-popconfirm title="确定删除吗?" @confirm="remove(record.id)">
<a>隐藏</a> <a>删除</a>
</a-popconfirm>
<a-popconfirm title="确定显示吗" v-if="record.isShow == 0" @confirm="remove(record.regularId,1)">
<a>显示</a>
</a-popconfirm> </a-popconfirm>
</span> </span>
</template> </template>
...@@ -51,26 +114,60 @@ ...@@ -51,26 +114,60 @@
<!----弹框--> <!----弹框-->
<a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px"> <a-modal :title="add ?'添加正则配置': '编辑正则配置'" :visible="modifyvisible" @ok="createfunctionOk" @cancel="createfunctionCancel" html-type="submit" width="1024px">
<a-form :form="Formtable"> <a-form :form="Formtable">
<a-form-item v-show="false" :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label=""> <a-form-item :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-input placeholder="姓名" v-decorator="[ 'sysuName', {rules: [{ required: true, message: '姓名不能为空!' }]} ]" :disabled="isdisabled"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则名称:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="汇总任务量(满分:30):">
<a-input placeholder="正则名称" v-decorator="[ 'regularName', {rules: [{ required: true, message: '学校名称不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input-number
placeholder="汇总任务量"
style="width: 20rem;"
:min="0"
:max="30"
v-decorator="[ 'reportDaily', {rules: [{ required: true, message: '汇总任务量不能为空!' }]} ]"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="正则表达示:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="参与集中营销(满分:30):">
<a-input placeholder="正则表达示" v-decorator="[ 'regular', {rules: [{ required: true, message: '表达示不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input-number
placeholder="参与集中营销"
:min="0"
:max="30"
v-decorator="[ 'collectiveSales', {rules: [{required: true, message: '参与集中营销不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="错误提示:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织周例会(满分:10):">
<a-input placeholder="错误提示" v-decorator="[ 'tips', {rules: [{required: true, message: '装机地址不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input-number
placeholder="组织周例会"
:min="0"
:max="10"
v-decorator="[ 'weeklyMeeting', {rules: [{ required: true, message: '组织周例会不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="输入框默认值:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="定制扫楼营销方案(满分:10):">
<a-input placeholder="输入框默认值" v-decorator="[ 'placeholder', {rules: [{ required: true, message: '外线方式不能为空!' ,validator: 'click'}]} ]"></a-input> <a-input-number
placeholder="定制扫楼营销方案"
:min="0"
:max="10"
v-decorator="[ 'organTraining', {rules: [{ required: true, message: '定制扫楼营销方案不能为空!' }]} ]"
style="width: 20rem;"/>
</a-form-item> </a-form-item>
<a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="是否显示:"> <a-form-item :labelCol="{span: 5}" :wrapperCol="{span: 9, offset: 1}" label="组织培训(满分:20):">
<a-select v-decorator="[ 'isShow' ]" style="width: 330px"> <a-input-number
<a-select-option key="1"></a-select-option> placeholder="组织培训"
<a-select-option key="0"></a-select-option> :min="0"
</a-select> :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>
</a-form> </a-form>
</a-modal> </a-modal>
...@@ -79,44 +176,72 @@ ...@@ -79,44 +176,72 @@
<script> <script>
import STable from '@/components/table'; import STable from '@/components/table';
import {regularList,regularDelete,regularInsert,regularUpdate} from "@/api/school-center/louZhangManagerAPI" import ImportBtn from "../../../components/sysmanage/ImportBtn";
import {cloneObject} from '@/utils/util'; 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";
Vue.use(DatetimePicker);
export default { export default {
name: "lzSalary", name: "lzSalary",
components: { components: {
STable, STable, ImportBtn
}, },
data(){ data() {
return { return {
emptyText: {emptyText: '暂无数据'}, emptyText: {emptyText: '暂无数据'},
Formtable: this.$form.createForm(this), Formtable: this.$form.createForm(this),
modifyvisible: false, modifyvisible: false,
kpiModifyvisible: false,
title: ConstantActivity.title,
add: true, add: true,
isdisabled: true,
queryParam: { queryParam: {
regularName :'', userName: '',
substName: '',
schoolName: '',
month: '',
}, },
modelData:{ subNames: [],
regularId: '', schoolNames: [],
regularName:'', modelData: {
regular:'', id: '',
tips:'', userId: '',
placeholder:'', month: '',
isShow: '1' sysuName: '',
substName: '',
schoolName: '',
rechargeNum: '',
rechargeWage: '',
kpi: '',
kpiWage: '',
wage: '',
}, },
columns: [ columns: [
{dataIndex: 'regularId', width: 20, title: 'regularId',istrue: true}, {dataIndex: 'month', width: 20, title: 'KPI月份 '},
{dataIndex: 'regularName', width: 70, title: '正则名称'}, {dataIndex: 'sysuName', width: 25, title: '姓名'},
{dataIndex: 'regular', width: 100, title: '正则表达示 '}, {dataIndex: 'substName', width: 20, title: '县分'},
{dataIndex: 'tips', width: 70, title: '错误提示'}, {dataIndex: 'schoolName', width: 70, title: '学校'},
{dataIndex: 'placeholder', 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', dataIndex: 'operation',
width: 26, width: 30,
title: '操作', title: '操作',
scopedSlots: {customRender: 'operation'}, scopedSlots: {customRender: 'operation'},
fixed: "right" fixed: "right"
}] }
, ],
rowdata: parameter => { rowdata: parameter => {
let params = { let params = {
pageNo: parameter.pageNo, pageNo: parameter.pageNo,
...@@ -124,7 +249,7 @@ ...@@ -124,7 +249,7 @@
} }
let obj = cloneObject(this.queryParam) let obj = cloneObject(this.queryParam)
//表示 //表示
return regularList(Object.assign(params,obj)).then(res => { return lzSalaryList(Object.assign(params, obj)).then(res => {
let data = {} let data = {}
if (res.state !== 'success') { if (res.state !== 'success') {
this.$message.error("查询失败!", 5); this.$message.error("查询失败!", 5);
...@@ -145,68 +270,148 @@ ...@@ -145,68 +270,148 @@
} }
return data 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.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 = "";
}, },
methods:{
search() { search() {
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}, },
remove(regularId,isShow) { remove(id) {
regularDelete({'regularId':regularId,'isShow':isShow}).then((res) => { lzSalaryDelete({'id': id}).then((res) => {
if(res.state=="success"){ if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
else{
this.$message.error(res.msg);
return;
}
this.$refs.table.refresh({search: true}) this.$refs.table.refresh({search: true})
}) })
}, },
modifyfunction(data){ modifyfunction(data) {
if(data != undefined ){ if (data != undefined) {
this.modelData.regularId=data.regularId this.add = false;
setTimeout(()=>{ this.isdisabled = true;
this.modelData.id = data.id
this.modelData.userId = data.userId
this.modelData.month = data.month
setTimeout(() => {
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
"regularId":data.regularId, "sysuName": data.sysuName,
"regularName":data.regularName, "account": data.account,
"regular":data.regular, "substName": data.substName,
"tips":data.tips, "schoolName": data.schoolName,
"placeholder":data.placeholder, "reportDaily": data.reportDaily,
"isShow":data.isShow "collectiveSales": data.collectiveSales,
"weeklyMeeting": data.weeklyMeeting,
"organTraining": data.organTraining,
"designPlan": data.designPlan,
"month": data.month,
"kpi": data.kpi,
"isDel": data.isDel
}) })
},0) }, 0)
this.add=false; }else{
this.isdisabled = false;
} }
this.modifyvisible=true; this.modifyvisible = true;
}, },
createfunctionOk(){ createfunctionOk() {
let that = this; let that = this;
that.Formtable.validateFields(['regularName','regular','tips','placeholder','isShow'], {force: true}, (err, values) => { that.Formtable.validateFields(['sysuName', 'account', 'substName', 'schoolName', 'reportDaily', 'collectiveSales', 'weeklyMeeting', 'organTraining', 'designPlan', "month", 'kpi', 'isDel'], {force: true}, (err, values) => {
if (err ) { if (err) {
return; return;
} }
that.modelData.regularName=values.regularName that.modelData.sysuName = values.sysuName
that.modelData.regular=values.regular that.modelData.account = values.account
that.modelData.tips=values.tips that.modelData.reportDaily = values.reportDaily
that.modelData.placeholder=values.placeholder that.modelData.collectiveSales = values.collectiveSales
that.modelData.isShow=values.isShow that.modelData.weeklyMeeting = values.weeklyMeeting
if(this.add){ that.modelData.organTraining = values.organTraining
let obj= that.modelData; 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 delete obj.id
let regular= JSON.stringify(obj); let lzKpi = JSON.stringify(obj);
regularInsert({regular}).then((res) => { lzSalaryInsert({lzKpi}).then((res) => {
this.modifyvisible=false; this.modifyvisible = false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){ if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
}else{
this.$message.error(res.msg);
return;
} }
this.search() this.search()
}) })
}else { } else {
let obj= that.modelData; let obj = that.modelData;
let regular= JSON.stringify(obj); let lzKpi = JSON.stringify(obj);
regularUpdate({regular}).then((res) => { lzSalaryUpdate({lzKpi}).then((res) => {
this.modifyvisible=false; this.modifyvisible = false;
this.clearmodel() this.clearmodel()
if(res.state=="success"){ if (res.state == "success") {
this.$notification.success({message: res.data, description: '', duration: 4}) this.$notification.success({message: res.data, description: '', duration: 4})
} }
this.search() this.search()
...@@ -214,23 +419,66 @@ ...@@ -214,23 +419,66 @@
} }
}) })
}, },
createfunctionCancel(){ createfunctionCancel() {
this.modifyvisible=false; this.modifyvisible = false;
this.clearmodel() this.clearmodel()
this.add=true; this.add = true;
}, },
//清除弹窗信息 //清除弹窗信息
clearmodel() { clearmodel() {
this.add=true this.add = true
this.modelData.regularId='' this.modelData.id = ''
this.modelData.month = ''
this.Formtable.setFieldsValue({ this.Formtable.setFieldsValue({
"regularName":'', "sysuName": '',
"regular":'', "account": '',
"tips":'', "substName": '',
"placeholder":'', "schoolName": '',
"isShow":'', "reportDaily": '',
"collectiveSales": '',
"weeklyMeeting": '',
"organTraining": '',
"designPlan": '',
"kpi": '',
"month": '',
"isDel": 1
})
},
getSchoolNames() {
this.schoolNames = []
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> </script>
......
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