Merge pull request 'master-客户管理' (#39) from master-客户管理 into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/39
This commit is contained in:
commit
f7dc37ce2c
41
src/api/emis/emisSalesCommissionRatio.js
Normal file
41
src/api/emis/emisSalesCommissionRatio.js
Normal file
@ -0,0 +1,41 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询
|
||||
export function listSalesCommissionRatio(query) {
|
||||
return request({
|
||||
url: '/emis/salesCommissionRatio/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 新增
|
||||
export function addSalesCommissionRatio(data) {
|
||||
return request({
|
||||
url: '/emis/salesCommissionRatio',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 删除
|
||||
export function delSalesCommissionRatio(ids) {
|
||||
return request({
|
||||
url: '/emis/salesCommissionRatio/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
//修改
|
||||
export function updateSalesCommissionRatio(data) {
|
||||
return request({
|
||||
url: '/emis/salesCommissionRatio',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
//根据id查询
|
||||
export function getSalesCommissionRatio(id) {
|
||||
return request({
|
||||
url: '/emis/salesCommissionRatio/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
@ -62,8 +62,9 @@
|
||||
<el-form-item label="支付状态" prop="payStatus">
|
||||
<el-select v-model="queryParams.payStatus" placeholder="" clearable filterable style="width:100%">
|
||||
<el-option label="未支付" :value="0"></el-option>
|
||||
<el-option label="支付成功" :value="1"></el-option>
|
||||
<el-option label="支付失败" :value="2"></el-option>
|
||||
<el-option label="支付中" :value="1"></el-option>
|
||||
<el-option label="支付成功" :value="2"></el-option>
|
||||
<el-option label="支付失败" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
@ -781,14 +782,16 @@ export default {
|
||||
return this.selectDictLabel(this.dict.type.emis_payment_status,paymentStatus);
|
||||
}
|
||||
|
||||
if(j == 'payStatus'){
|
||||
let payStatus = v['payStatus']
|
||||
if (payStatus == 0) {
|
||||
return '待支付';
|
||||
if (j == 'payStatus') {
|
||||
let payStatus = v['payStatus']
|
||||
if (payStatus == 0 || payStatus == null) {
|
||||
return '未支付';
|
||||
}
|
||||
else if (payStatus == 1) {
|
||||
return '支付成功';
|
||||
return '支付中';
|
||||
} else if (payStatus == 2) {
|
||||
return '支付成功';
|
||||
} else if (payStatus == 3) {
|
||||
return '支付失败';
|
||||
}
|
||||
}
|
||||
|
||||
169
src/views/emis/salesCommissionRatio/editForm.vue
Normal file
169
src/views/emis/salesCommissionRatio/editForm.vue
Normal file
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="form" size="mini" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="0" style="display: flex;flex-wrap: wrap;">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售主管" prop="salesExecutive">
|
||||
<EmpNamePicker1 :placeholder="$t('销售主管')" v-model="form.salesExecutive"></EmpNamePicker1>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售主管占比" prop="salesExecutiveRatio">
|
||||
<el-input type="number" v-model="form.salesExecutiveRatio" placeholder="" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售联系人" prop="salesmen">
|
||||
<EmpNamePicker2 :placeholder="$t('销售联系人')" v-model="form.salesmen"></EmpNamePicker2>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售联系人占比" prop="salesmenRatio">
|
||||
<el-input type="number" v-model="form.salesmenRatio" placeholder="" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售支持" prop="salesSupport">
|
||||
<EmpNamePicker3 :placeholder="$t('销售支持')" v-model="form.salesSupport"></EmpNamePicker3>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="销售支持占比" prop="salesSupportRatio">
|
||||
<el-input type="number" v-model="form.salesSupportRatio" placeholder="" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="启用状态" prop="status">
|
||||
<!-- 选项水平显示 -->
|
||||
<el-radio v-model="form.status" label="1">启用</el-radio>
|
||||
<el-radio v-model="form.status" label="2">停用</el-radio>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="" maxlength="30" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="text-align: center;margin-bottom: 10px;">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { addSalesCommissionRatio, getSalesCommissionRatio, updateSalesCommissionRatio } from "@/api/emis/emisSalesCommissionRatio";
|
||||
import EmpNamePicker1 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
import EmpNamePicker2 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
import EmpNamePicker3 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
|
||||
export default {
|
||||
name: "SalesCommissionRatioForm",
|
||||
props: {
|
||||
id: {
|
||||
type: Number
|
||||
}
|
||||
},
|
||||
components: { EmpNamePicker1, EmpNamePicker2, EmpNamePicker3 },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 默认密码
|
||||
initPassword: undefined,
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
salesExecutive: [
|
||||
{ required: true, message: "销售主管不能为空", trigger: ["change", "blur"] }
|
||||
],
|
||||
salesExecutiveRatio: [
|
||||
{ required: true, message: "销售主管占比不能为空", trigger: ["change", "blur"] }
|
||||
],
|
||||
salesmen: [
|
||||
{ required: true, message: "销售联系人不能为空", trigger: ["change", "blur"] }
|
||||
],
|
||||
salesmenRatio: [
|
||||
{ required: true, message: "销售联系人占比不能为空", trigger: ["change", "blur"] }
|
||||
],
|
||||
salesSupport: [
|
||||
{ required: true, message: "销售支持不能为空", trigger: ["change", "blur"] }
|
||||
],
|
||||
salesSupportRatio: [
|
||||
{ required: true, message: "销售支持占比不能为空", trigger: ["change", "blur"] }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"id": {
|
||||
handler(newValue, oldValue) {
|
||||
this.id = newValue;
|
||||
this.initData();
|
||||
},
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initData();
|
||||
},
|
||||
|
||||
methods: {
|
||||
initData() {
|
||||
this.reset();
|
||||
if (this.id !== null) {
|
||||
getSalesCommissionRatio(this.id).then(response => {
|
||||
this.form = response.data;
|
||||
});
|
||||
}
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.reset();
|
||||
this.$emit("on-cancel");
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
salesExecutive: null,
|
||||
salesExecutiveRatio: null,
|
||||
salesmen: null,
|
||||
salesmenRatio: null,
|
||||
salesSupport: null,
|
||||
salesSupportRatio: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: null,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.form.userName = this.form.empCode;
|
||||
this.form.nickName = this.form.empName;
|
||||
if (this.form.id != null) {
|
||||
updateSalesCommissionRatio(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.$emit("on-changed");
|
||||
});
|
||||
} else {
|
||||
addSalesCommissionRatio(this.form).then(response => {
|
||||
this.$modal.msgSuccess("添加成功");
|
||||
this.$emit("on-changed");
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped></style>
|
||||
264
src/views/emis/salesCommissionRatio/index.vue
Normal file
264
src/views/emis/salesCommissionRatio/index.vue
Normal file
@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<XdPageContainer class="app-container">
|
||||
<SearchForm slot="pageHeader" :model="queryParams" ref="queryForm" size="mini" :maxShow="20" label-width="100px"
|
||||
v-show="showSearch" @search="handleQuery" @reset="resetQuery">
|
||||
<el-form-item label="销售主管" prop="salesExecutive">
|
||||
<EmpNamePicker1 :placeholder="$t('销售主管')" v-model="queryParams.salesExecutive"></EmpNamePicker1>
|
||||
</el-form-item>
|
||||
<el-form-item label="销售联系人" prop="salesmen">
|
||||
<EmpNamePicker2 :placeholder="$t('销售联系人')" v-model="queryParams.salesmen"></EmpNamePicker2>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="销售支持" prop="salesSupport">
|
||||
<EmpNamePicker3 :placeholder="$t('销售支持')" v-model="queryParams.salesSupport"></EmpNamePicker3>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="启用状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择" clearable>
|
||||
<el-option label="启用" value="1"></el-option>
|
||||
<el-option label="停用" value="0"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</SearchForm>
|
||||
|
||||
<XdTable slot="pageContent" slot-scope="slotProps" :height="(slotProps.contentHeight) + 'px'" ref="refTable"
|
||||
v-loading="loading" border size="mini" :data="list" storageName="emisUser_main" :showSearch.sync="showSearch"
|
||||
:total="total" highlight-current-row @queryTable="getList" :queryParams="queryParams"
|
||||
@selection-change="handleSelectionChange" @sort-change="handleSortChange">
|
||||
|
||||
<div slot="toolbar">
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- 单行操作 -->
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleDelete">删除</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column label="销售主管" align="center" prop="salesExecutive" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column label="销售主管占比" align="left" prop="salesExecutiveRatio" :show-overflow-tooltip="true"
|
||||
min-width="80">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.salesExecutiveRatio}}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售联系人" align="left" prop="salesmen" :show-overflow-tooltip="true" min-width="80">
|
||||
</el-table-column>
|
||||
<el-table-column label="销售联系人占比" align="center" key="deptName" prop="salesmenRatio" :show-overflow-tooltip="true"
|
||||
min-width="100" >
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.salesmenRatio}}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="销售支持" align="center" prop="salesSupport" min-width="100">
|
||||
</el-table-column>
|
||||
<el-table-column label="销售支持占比" align="center" prop="salesSupportRatio" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.salesSupportRatio}}%
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="启用状态" align="center" prop="status" min-width="100">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.status == '1'">启用</span>
|
||||
<span v-else>停用</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" min-width="100" tooltip>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" align="center" prop="createByName" width="80" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="170" />
|
||||
<el-table-column label="创建网点" align="center" prop="createSiteName" width="80" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="修改人" align="center" prop="updateByName" width="80" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="修改网点" align="center" prop="updateSiteName" width="80" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="修改时间" align="center" prop="updateTime" width="170" />
|
||||
</XdTable>
|
||||
|
||||
<el-dialog :title="titleForm" :visible.sync="openForm" width="40%" :destroy-on-close="true" v-dialogDrag
|
||||
append-to-body>
|
||||
<SalesCommissionRatioForm :id="currentId" @on-changed="handleFormChanged" @on-cancel="cancelForm">
|
||||
</SalesCommissionRatioForm>
|
||||
</el-dialog>
|
||||
</XdPageContainer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listSalesCommissionRatio, delSalesCommissionRatio } from "@/api/emis/emisSalesCommissionRatio";
|
||||
import SalesCommissionRatioForm from '@/views/emis/salesCommissionRatio/editForm';
|
||||
import EmpNamePicker1 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
import EmpNamePicker2 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
import EmpNamePicker3 from '@/views/emis/EmisBaseTools/EmpNamePicker.vue';
|
||||
|
||||
export default {
|
||||
name: "SalesCommissionRatio",
|
||||
components: { EmpNamePicker3, EmpNamePicker1, EmpNamePicker2, SalesCommissionRatioForm },
|
||||
data() {
|
||||
return {
|
||||
tableHeight: 200,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 用户表格数据
|
||||
list: null,
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
currentId: null,
|
||||
openForm: false,
|
||||
titleForm: "",
|
||||
selectionList: null,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
salesExecutive: null,
|
||||
salesSupport: null,
|
||||
salesmen: null,
|
||||
status: null
|
||||
},
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询用户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSalesCommissionRatio(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
this.list = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
handleSortChange(column) {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
this.getList();
|
||||
},
|
||||
handleFormChanged() {
|
||||
this.openForm = false;
|
||||
this.getList();
|
||||
},
|
||||
cancelForm() {
|
||||
this.openForm = false;
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
this.selectionList = selection;
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.currentId = null;
|
||||
this.openForm = true;
|
||||
this.titleForm = "添加销售计提比例";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
console.log('ids', this.ids)
|
||||
this.currentId = row.id || this.ids[0];
|
||||
this.openForm = true;
|
||||
this.titleForm = "修改销售计提比例";
|
||||
},
|
||||
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const userIds = row.userId || this.ids;
|
||||
this.$modal.confirm('注意:确认是否删除?').then(function () {
|
||||
delSalesCommissionRatio(userIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const loadingInstance = this.$loading({
|
||||
text: '正在导出...'
|
||||
})
|
||||
|
||||
if (this.selectionList && this.selectionList.length > 0) {
|
||||
this.exportData(this.selectionList, loadingInstance);
|
||||
}
|
||||
else {
|
||||
let qExportParam = { ...this.queryParams };
|
||||
qExportParam.pageNum = 1;
|
||||
qExportParam.pageSize = 20000;
|
||||
qExportParam = this.addDateRange(qExportParam, this.dateRange);
|
||||
|
||||
listSalesCommissionRatio(qExportParam).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.exportData(response.rows, loadingInstance);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
exportData(selData, loadingInstance) {
|
||||
const curList = selData
|
||||
import('@/vendor/Export2Excel').then(excel => {
|
||||
const exportParam = this.$refs.refTable.getExportParam();
|
||||
const tHeader = exportParam.header;
|
||||
const filterVal = exportParam.filter;
|
||||
const data = this.formatJson(filterVal, curList, selData)
|
||||
excel.export_json_to_excel({
|
||||
header: tHeader,
|
||||
data,
|
||||
filename: '销售计提比例列表',
|
||||
autoWidth: true
|
||||
})
|
||||
loadingInstance.close()
|
||||
})
|
||||
},
|
||||
formatJson(filterVal, jsonData, resData) {
|
||||
return jsonData.map(v => filterVal.map(j => {
|
||||
|
||||
if (j === 'status') {
|
||||
if (v[j] == 1) {
|
||||
return '启用';
|
||||
} else {
|
||||
return '停用';
|
||||
}
|
||||
}
|
||||
return v[j]
|
||||
}))
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
Loading…
Reference in New Issue
Block a user