1,修改用户管理展示岗位信息

2,修复提成比例数据格式为浮点型
3,修复修改提成比例时业务员展示
4,金额数字逢三位加逗号
This commit is contained in:
huangdeliang
2020-10-06 20:16:58 +08:00
parent 0e3b59b12f
commit 92fc73e923
11 changed files with 839 additions and 783 deletions

View File

@ -1,75 +1,76 @@
import Vue from 'vue'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
//自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
}
Vue.prototype.msgError = function (msg) {
this.$message({ showClose: true, message: msg, type: "error" });
}
Vue.prototype.msgInfo = function (msg) {
this.$message.info(msg);
}
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.use(permission)
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
})
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})
import Vue from 'vue'
import Cookies from 'js-cookie'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css
import '@/assets/styles/ruoyi.scss' // ruoyi css
import App from './App'
import store from './store'
import router from './router'
import permission from './directive/permission'
import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, toThousands } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
//自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime
Vue.prototype.resetForm = resetForm
Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.download = download
Vue.prototype.handleTree = handleTree
Vue.prototype.toThousands = toThousands
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });
}
Vue.prototype.msgError = function (msg) {
this.$message({ showClose: true, message: msg, type: "error" });
}
Vue.prototype.msgInfo = function (msg) {
this.$message.info(msg);
}
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
Vue.use(permission)
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
Vue.use(Element, {
size: Cookies.get('size') || 'medium' // set element-ui default size
})
Vue.config.productionTip = false
new Vue({
el: '#app',
router,
store,
render: h => h(App)
})

View File

@ -153,3 +153,14 @@ export function handleTree(data, id, parentId, children, rootId) {
});
return treeData != '' ? treeData : data;
}
/** 数字逢三位加逗号 */
export function toThousands(num) {
var num = (num || 0).toString(), result = '';
while (num.length > 3) {
result = ',' + num.slice(-3) + result;
num = num.slice(0, num.length - 3);
}
if (num) { result = num + result; }
return result;
}

View File

@ -1,8 +1,8 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="位" prop="postId">
<el-select v-model="queryParams.postId" placeholder="请选择位" clearable size="small" @change="searchPostChange">
<el-form-item label="位" prop="postId">
<el-select v-model="queryParams.postId" placeholder="请选择位" clearable size="small" @change="searchPostChange">
<el-option
v-for="dict in postIdOptions"
:key="dict.dictValue"
@ -76,8 +76,12 @@
<el-table v-loading="loading" :data="commisionList" :span-method="objectSpanMethod"
@selection-change="handleSelectionChange">
<el-table-column label="业务员" align="center" prop="userName"/>
<el-table-column label="位" align="center" prop="postName"/>
<el-table-column label="金额" align="center" prop="amount"/>
<el-table-column label="位" align="center" prop="postName"/>
<el-table-column label="金额" align="center" prop="amount">
<template scope="scope">
{{toThousands(scope.row.amount)}}
</template>
</el-table-column>
<el-table-column label="比例" align="center" prop="rate">
<template scope="scope">
{{scope.row.rate + '%'}}
@ -119,8 +123,8 @@
<el-row :gutter="15">
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-col :span="12">
<el-form-item label="位" prop="postId">
<el-select v-model="form.postId" placeholder="请选择位" @change="postChange">
<el-form-item label="位" prop="postId">
<el-select v-model="form.postId" placeholder="请选择位" @change="postChange">
<el-option
v-for="dict in postIdOptions"
:key="dict.dictValue"
@ -228,7 +232,7 @@
{required: true, message: "业务员不能为空", trigger: "change"}
],
postId: [
{required: true, message: "位不能为空", trigger: "change"}
{required: true, message: "位不能为空", trigger: "change"}
],
amount: [
{required: true, message: "金额不能为空", trigger: "blur"}
@ -368,6 +372,7 @@
const ruleId = row.ruleId || this.ids
getCommision(ruleId).then(response => {
this.form = response.data;
this.userIdOptions = this.options[this.form.postId];
this.open = true;
this.title = "修改业务提成比例";
});
@ -436,7 +441,7 @@
this.userIdOptions = this.options[postId];
},
searchPostChange(postId) {
if(!postId) {
if (!postId) {
this.searchUserIdOptions = this.totalUserIdOptions.slice();
return;
}

View File

@ -1,8 +1,8 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="位" prop="postId">
<el-select v-model="queryParams.postId" placeholder="请选择位" clearable size="small" @change="searchPostChange">
<el-form-item label="位" prop="postId">
<el-select v-model="queryParams.postId" placeholder="请选择位" clearable size="small" @change="searchPostChange">
<el-option
v-for="dict in postIdOptions"
:key="dict.dictValue"
@ -52,14 +52,23 @@
<el-table v-loading="loading" :data="commisionList"
@selection-change="handleSelectionChange">
<el-table-column label="业务员" align="center" prop="userName"/>
<el-table-column label="位" align="center" prop="postName"/>
<el-table-column label="总金额" align="center" prop="amount"/>
<el-table-column label="位" align="center" prop="postName"/>
<el-table-column label="总金额" align="center" prop="amount">
<template scope="scope">
{{toThousands(scope.row.amount)}}
</template>
</el-table-column>
<el-table-column label="比例" align="center" prop="rate">
<template scope="scope">
{{scope.row.rate + '%'}}
</template>
</el-table-column>
<el-table-column label="提成" align="center" prop="commision"/>
<el-table-column label="提成" align="center" prop="commision">
<template scope="scope">
{{toThousands(scope.row.commision)}}
</template>
</el-table-column>
</el-table>
<pagination
@ -206,7 +215,7 @@
this.userIdOptions = this.options[postId];
},
searchPostChange(postId) {
if(!postId) {
if (!postId) {
this.searchUserIdOptions = this.totalUserIdOptions.slice();
return;
}

View File

@ -190,7 +190,11 @@
</template>
</el-table-column>
<el-table-column label="客户姓名" align="center" prop="customer" width="120" fixed="left"/>
<el-table-column label="金额" align="center" prop="amount" width="120" fixed="left"/>
<el-table-column label="金额" align="center" prop="amount" width="120" fixed="left">
<template scope="scope">
{{toThousands(scope.row.amount)}}
</template>
</el-table-column>
<el-table-column label="电话" align="center" prop="phone" width="120"/>
<el-table-column label="服务月数" align="center" prop="serveMonth" width="80"/>
<el-table-column label="收款方式" align="center" prop="payType" width="120"/>
@ -408,6 +412,7 @@
<script>
import {listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder, getOptions} from "@/api/custom/order";
import dayjs from 'dayjs';
const beginTime = dayjs().startOf('month').format('YYYY-MM-DD');
const endTime = dayjs().format('YYYY-MM-DD');

File diff suppressed because it is too large Load Diff