4.27
This commit is contained in:
parent
349cb5b8dc
commit
a680cd72d0
|
|
@ -80,7 +80,31 @@
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- 销售记录 -->
|
||||||
|
<div class="sale-list" style="margin-top: 20px">
|
||||||
|
<h2>销售记录</h2>
|
||||||
|
<!-- 搜索区 -->
|
||||||
|
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||||
|
<template #date="{}">
|
||||||
|
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||||
|
<a-range-picker @change="onDateChange"/>
|
||||||
|
</a-form-item>
|
||||||
|
</template>
|
||||||
|
</vxe-form>
|
||||||
|
<!-- 表格区 -->
|
||||||
|
<div class="gridPanel">
|
||||||
|
<vxe-grid ref='xGrid' v-bind="gridOptions">
|
||||||
|
|
||||||
|
<!-- =============================== 表格列 自动生成 Start =============================== -->
|
||||||
|
<template #status="{ row }"><!-- 这里是自定义列 -->
|
||||||
|
{{ row.status == 1 ? '正常' : '禁用'}}
|
||||||
|
</template>
|
||||||
|
</vxe-grid>
|
||||||
|
</div>
|
||||||
|
<!-- 表格 -->
|
||||||
|
</div>
|
||||||
<!-- 结余日志列表 -->
|
<!-- 结余日志列表 -->
|
||||||
<div class="balance-log">
|
<div class="balance-log">
|
||||||
<h2>
|
<h2>
|
||||||
|
|
@ -125,14 +149,15 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
const listFieldName = 'train_number';
|
||||||
|
var pageData = {
|
||||||
BalanceAdd: `${BASE_URL.BASE_URL}/Custom/v1/balance/add`, // 增加客户结余
|
BalanceAdd: `${BASE_URL.BASE_URL}/Custom/v1/balance/add`, // 增加客户结余
|
||||||
BalanceReduce: `${BASE_URL.BASE_URL}/Custom/v1/balance/reduce`, // 减少客户结余 BalanceLogList: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/list`, // 客户结余日志列表
|
BalanceReduce: `${BASE_URL.BASE_URL}/Custom/v1/balance/reduce`, // 减少客户结余 BalanceLogList: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/list`, // 客户结余日志列表
|
||||||
BalanceLogSearch: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/search`, // 客户结余日志搜索
|
BalanceLogSearch: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/search`, // 客户结余日志搜索
|
||||||
BalanceLogDetail: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/detail`, // 客户结余日志详情
|
BalanceLogDetail: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/detail`, // 客户结余日志详情
|
||||||
BalanceLogDelete: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/detele`, // 删除客户结余日志
|
BalanceLogDelete: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/detele`, // 删除客户结余日志
|
||||||
BalanceLogBatchDelete: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/batchDelete`, // 批量删除客户结余日志
|
BalanceLogBatchDelete: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/batchDelete`, // 批量删除客户结余日志
|
||||||
|
getTradeLIst:`${BASE_URL.BASE_URL}/Custom/v1/custom/trade/list`,
|
||||||
zkSelectData: {
|
zkSelectData: {
|
||||||
page: 1,
|
page: 1,
|
||||||
end_time: 0,
|
end_time: 0,
|
||||||
|
|
@ -175,7 +200,118 @@ export default {
|
||||||
data: {
|
data: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
start_time: 0, // 开始时间
|
||||||
|
end_time: 0, // 结束时间
|
||||||
|
//搜索区
|
||||||
|
searchFormData: {},
|
||||||
|
searchFormItems: [ // 子项
|
||||||
|
{span: 8, slots: {default: 'date'}}, // 自定义列
|
||||||
|
{
|
||||||
|
align: 'right', span: 8, itemRender: { // 按钮列
|
||||||
|
name: '$buttons', children: [{props: {type: 'submit', content: '搜索', status: 'primary'}}, // 搜索按钮
|
||||||
|
{props: {type: 'reset', content: '重置'}},
|
||||||
|
{props: {type: 'reset', content: '打印'}}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
//数据区
|
||||||
|
gridOptions: { // 表格配置
|
||||||
|
height: '100%', // 表格高度 100% 会自动撑满父容器
|
||||||
|
stripe: true, // 启用斑马纹
|
||||||
|
id: 'datagrid_1', // 表格唯一标识
|
||||||
|
|
||||||
|
// 接口获取数据
|
||||||
|
proxyConfig: { // 配置代理
|
||||||
|
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
||||||
|
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
||||||
|
props: {
|
||||||
|
result: listFieldName, // 配置响应结果列表字段
|
||||||
|
total: 'total' // 配置响应结果总页数字段
|
||||||
|
},
|
||||||
|
|
||||||
|
// 接收Promise
|
||||||
|
ajax: {
|
||||||
|
// 当点击工具栏查询按钮或者手动提交指令 query或reload 时会被触发
|
||||||
|
query: (options) => { // options 为当前表格的配置项
|
||||||
|
const {page,sorts} = options; // 获取当前页码、每页条数、排序信息
|
||||||
|
var params = {}; // 定义请求参数
|
||||||
|
params.page = page.currentPage; // 当前页码
|
||||||
|
params.limit = page.pageSize; // 每页条数
|
||||||
|
params.order_bys = []; // 排序信息
|
||||||
|
params.search_rules = this.getSearchParms(); // 搜索信息
|
||||||
|
if (sorts) { // 如果有排序信息
|
||||||
|
sorts.forEach((v) => { // 遍历排序信息
|
||||||
|
params.order_bys.push({ // 添加排序信息
|
||||||
|
column: v.property, // 字段名
|
||||||
|
order: v.order // 排序方式
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return this.loadData({params}); // 返回请求结果
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{ type: 'checkbox', width: 50 }, // 多选框
|
||||||
|
{ type: 'seq', width: 40 }, // 序号
|
||||||
|
|
||||||
|
|
||||||
|
// =============================== 表格列 自动生成 Start ===============================
|
||||||
|
|
||||||
|
|
||||||
|
{ field: 'code', align: 'center', sortable: true, title: '车次单号', width: 120 }, // 车次单号
|
||||||
|
{
|
||||||
|
field: 'truck_id', align: 'center', sortable: true, title: '车辆', width: 150,
|
||||||
|
slots: { default: 'truck_id' }
|
||||||
|
}, // 车辆id
|
||||||
|
{
|
||||||
|
field: 'driver_id', align: 'center', sortable: true, title: '司机', width: 150,
|
||||||
|
slots: { default: 'driver_id' }
|
||||||
|
}, // 司机id
|
||||||
|
// {field: 'custom_id', sortable: true, title: '客户id', width: 250}, // 客户id
|
||||||
|
{ field: 'custom_name', align: 'center', sortable: true, title: '客户名称', width: 200 }, // 客户名称
|
||||||
|
// {field: 'supplier_id', sortable: true, title: '供应商id', width: 250}, // 供应商id
|
||||||
|
{ field: 'supplier_name', align: 'center', sortable: true, title: '供应商名称', width: 200 }, // 客户名称
|
||||||
|
{ field: 'outbound_date', align: 'center', sortable: true, formatter: 'formatDate', title: '出车日期', width: 100 }, // 出车日期
|
||||||
|
{ field: 'return_date', align: 'center', sortable: true, formatter: 'formatDate', title: '回车日期', width: 100 }, // 回车日期
|
||||||
|
{
|
||||||
|
field: 'is_oil', align: 'center', sortable: true, title: '加油', width: 70,
|
||||||
|
slots: { default: 'is_oil' }
|
||||||
|
}, // 是否加油
|
||||||
|
|
||||||
|
// {
|
||||||
|
// field: 'create_time',
|
||||||
|
// formatter: 'formatDate',
|
||||||
|
// width: 100,
|
||||||
|
// sortable: true,
|
||||||
|
// title: '创建时间',
|
||||||
|
// showHeaderOverflow: true
|
||||||
|
// }, // 创建时间
|
||||||
|
|
||||||
|
{ field: 'outbound_mileage', align: 'center', sortable: true, title: '出车公里数', width: 120 }, // 出车公里数
|
||||||
|
{ field: 'outbound_remark', align: 'center', sortable: true, title: '出车备注', width: 250 }, // 出车备注
|
||||||
|
{
|
||||||
|
field: 'income', sortable: true, title: '收入', width: 80, fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
}, // 收入
|
||||||
|
{
|
||||||
|
field: 'cost', sortable: true, title: '成本', width: 80, fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
}, // 成本
|
||||||
|
{
|
||||||
|
field: 'profit', sortable: true, title: '利润', width: 80, fixed: 'right',
|
||||||
|
align: 'center',
|
||||||
|
}, // 利润
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并表格数据
|
||||||
|
return pageData;
|
||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.initDetailData();
|
this.initDetailData();
|
||||||
|
|
@ -240,7 +376,54 @@ export default {
|
||||||
reduceBalance() {
|
reduceBalance() {
|
||||||
this.reduceBalanceApi();
|
this.reduceBalanceApi();
|
||||||
},
|
},
|
||||||
|
// 修改日期
|
||||||
|
onDateChange(date) { // 日期选择器事件
|
||||||
|
if (date && date.length) { // 如果有值
|
||||||
|
this.start_time = parseInt(date[0]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
|
this.end_time = parseInt(date[1]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
|
} else { // 如果没有值
|
||||||
|
this.start_time = 0; // 将日期转换为时间戳
|
||||||
|
this.end_time = 0; // 将日期转换为时间戳
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 搜索
|
||||||
|
onSearch() {
|
||||||
|
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||||
|
},
|
||||||
|
// 获取搜索参数
|
||||||
|
getSearchParms() { // 获取搜索参数
|
||||||
|
var rules = []; // 定义搜索参数
|
||||||
|
let findMode = k => { // 查找搜索模式
|
||||||
|
for (let i in this.searchRules) { // 遍历搜索规则
|
||||||
|
if (this.searchRules[i].key == k) return this.searchRules[i].mode; // 如果找到了就返回搜索模式
|
||||||
|
}
|
||||||
|
return "="; // 如果没有找到就返回等于
|
||||||
|
};
|
||||||
|
|
||||||
|
for (let key in this.searchFormData) { // 遍历搜索表单数据
|
||||||
|
let value = this.searchFormData[key]; // 获取值
|
||||||
|
if (value) { // 如果有值
|
||||||
|
let mode = findMode(key); // 获取搜索模式
|
||||||
|
if (mode == "like") { // 如果是模糊搜索
|
||||||
|
value = "%" + value + "%"; // 如果是模糊搜索就在两边加上%
|
||||||
|
}
|
||||||
|
rules.push({ // 添加搜索参数
|
||||||
|
column: key, // 字段名
|
||||||
|
mode: mode, // 搜索模式
|
||||||
|
value: value // 值
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rules; // 返回搜索参数
|
||||||
|
},
|
||||||
|
// 加载数据
|
||||||
|
loadData({params}) {
|
||||||
|
params.id = Number(this.dataId); // 转换为数字
|
||||||
|
params.last_time = Number(params.last_time)
|
||||||
|
params.start_time = this.start_time; // 开始时间
|
||||||
|
params.end_time = this.end_time; // 结束时间
|
||||||
|
return this.$mk.getPagedData({url: this.getTradeLIst, data: params}); // 获取分页数据
|
||||||
|
},
|
||||||
addBalanceApi() {
|
addBalanceApi() {
|
||||||
// 转换 this.amount 为数字
|
// 转换 this.amount 为数字
|
||||||
this.amount = Number(this.amount);
|
this.amount = Number(this.amount);
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@
|
||||||
<a-button @click="grant(row)" v-if="row.wages_status === 0" type="primary">发放工资</a-button>
|
<a-button @click="grant(row)" v-if="row.wages_status === 0" type="primary">发放工资</a-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
<template #bottom>
|
||||||
|
<div class="bottom-box">总计工资:{{ total_wages }}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
</vxe-grid>
|
</vxe-grid>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -125,7 +128,7 @@ export default {
|
||||||
|
|
||||||
keyName: 'id', // 主键字段名
|
keyName: 'id', // 主键字段名
|
||||||
|
|
||||||
|
total_wages:0, // 总工资
|
||||||
// 接口动作
|
// 接口动作
|
||||||
actions: { // Api 接口地址
|
actions: { // Api 接口地址
|
||||||
// =============================== 接口地址 自动生成 Start ===============================
|
// =============================== 接口地址 自动生成 Start ===============================
|
||||||
|
|
@ -206,7 +209,8 @@ export default {
|
||||||
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
||||||
props: {
|
props: {
|
||||||
result: listFieldName, // 配置响应结果列表字段
|
result: listFieldName, // 配置响应结果列表字段
|
||||||
total: 'total' // 配置响应结果总页数字段
|
total: 'total', // 配置响应结果总页数字段
|
||||||
|
total_wages:'total_wages', // 配置响应结果总工资字段
|
||||||
},
|
},
|
||||||
// 接收Promise
|
// 接收Promise
|
||||||
ajax: {
|
ajax: {
|
||||||
|
|
@ -360,6 +364,9 @@ export default {
|
||||||
loadData({ params }) {
|
loadData({ params }) {
|
||||||
params.start_time = this.start_time; // 开始时间
|
params.start_time = this.start_time; // 开始时间
|
||||||
params.end_time = this.end_time; // 结束时间
|
params.end_time = this.end_time; // 结束时间
|
||||||
|
this.$mk.post({ url: this.actions.getList, data: params }).then(res=>{
|
||||||
|
this.total_wages = res.data.total_wages;
|
||||||
|
})
|
||||||
return this.$mk.getPagedData({ url: this.actions.getList, data: params }); // 获取分页数据
|
return this.$mk.getPagedData({ url: this.actions.getList, data: params }); // 获取分页数据
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -469,8 +476,8 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 选择器改变
|
// 选择器改变
|
||||||
StaffhandleChange(value) {
|
StaffhandleChange(value) {
|
||||||
|
|
||||||
this.$data.searchFormData.staff_uid = value.id;
|
this.$data.searchFormData.staff_uid = value.id;
|
||||||
console.log("this.$data.searchFormData.driver_id:",this.$data.searchFormData.staff_uid);
|
console.log("this.$data.searchFormData.driver_id:",this.$data.searchFormData.staff_uid);
|
||||||
|
|
@ -498,10 +505,15 @@ export default {
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style>
|
<style scoped>
|
||||||
.oplinks svg {
|
.oplinks svg {
|
||||||
width: 22px;
|
width: 22px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
margin: 0 5px 0 0;
|
margin: 0 5px 0 0;
|
||||||
}
|
}
|
||||||
|
.bottom-box{
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: bold;
|
||||||
|
/* text-align: center; */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -0,0 +1,449 @@
|
||||||
|
<template>
|
||||||
|
<div class="page-body">
|
||||||
|
|
||||||
|
<a-row type="flex">
|
||||||
|
<a-col :flex="$mk.config.ui.searchFlex">
|
||||||
|
<!-- 搜索区 -->
|
||||||
|
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||||
|
|
||||||
|
<template #driver_id="{ }">
|
||||||
|
<ZkSelectSearch :ListTitle="'请选择司机'" :IsListShowCode="true" :ListUrl="zkSelectSearch2.Search"
|
||||||
|
:ListUrlData="zkSelectSearch2.zkSelectData"
|
||||||
|
:ListFieldName="zkSelectSearch2.zkSelectDataFieldName"
|
||||||
|
:BackFieldNames="zkSelectSearch2.zkBackFieldNames" @zkSelectSearch="StaffhandleChange">
|
||||||
|
</ZkSelectSearch>
|
||||||
|
</template>
|
||||||
|
<template #date="{ }">
|
||||||
|
<a-form-item label="创建时间" :style="{ display: 'inline-block', width: 120 }">
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item :style="{ display: 'inline-block', width: 'calc(100% - 120px )' }">
|
||||||
|
<a-range-picker @change="onDateChange" />
|
||||||
|
</a-form-item>
|
||||||
|
</template>
|
||||||
|
</vxe-form>
|
||||||
|
</a-col>
|
||||||
|
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||||
|
<!-- 工具条 -->
|
||||||
|
<mk-toolbar :isShowLog="false" :isShowSetting="false" :isShowAdd="false" @toolbarClick="toolbarClick"></mk-toolbar>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<!-- 表格区 -->
|
||||||
|
<div class="gridPanel">
|
||||||
|
<vxe-grid ref='xGrid' :export-config="{}" v-bind="gridOptions">
|
||||||
|
|
||||||
|
<!-- =============================== 表格列 自动生成 Start =============================== -->
|
||||||
|
|
||||||
|
<!-- =============================== 表格列 自动生成 End =============================== -->
|
||||||
|
<template #wages_status="{ row }">
|
||||||
|
|
||||||
|
|
||||||
|
<a-tag color="orange" v-if="row.wages_status === 0">
|
||||||
|
未发放
|
||||||
|
</a-tag>
|
||||||
|
<a-tag color="green" v-if="row.wages_status === 1">
|
||||||
|
已发放
|
||||||
|
</a-tag>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template #op="{ row }">
|
||||||
|
<div class="oplinks">
|
||||||
|
<a-button @click="grant(row)" v-if="row.wages_status === 0" type="primary">发放工资</a-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #bottom>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
</vxe-grid>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import BASE_URL from '@/services/Middle/transport/DriverWages/api.js';
|
||||||
|
import ZkSelectSearch from '@/components/zk/zkSelectSearch.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'DriverWagesList',
|
||||||
|
i18n: require('./i18n'), // 国际化
|
||||||
|
components: { ZkSelectSearch },
|
||||||
|
props: {
|
||||||
|
pageMode: {
|
||||||
|
type: String,
|
||||||
|
default: "edit"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
|
||||||
|
const listFieldName = 'mes_staff_wages_total';
|
||||||
|
|
||||||
|
|
||||||
|
const year=[
|
||||||
|
{label: '2024', value: 2024},
|
||||||
|
{label: '2025', value: 2025},
|
||||||
|
{label: '2026', value: 2026},
|
||||||
|
{label: '2027', value: 2027},
|
||||||
|
]
|
||||||
|
const month=[
|
||||||
|
{label: '1月', value: 1},
|
||||||
|
{label: '2月', value: 2},
|
||||||
|
{label: '3月', value: 3},
|
||||||
|
{label: '4月', value: 4},
|
||||||
|
{label: '5月', value: 5},
|
||||||
|
{label: '6月', value: 6},
|
||||||
|
{label: '7月', value: 7},
|
||||||
|
{label: '8月', value: 8},
|
||||||
|
{label: '9月', value: 9},
|
||||||
|
{label: '10月', value: 10},
|
||||||
|
{label: '11月', value: 11},
|
||||||
|
{label: '12月', value: 12},
|
||||||
|
]
|
||||||
|
// 页面数据
|
||||||
|
var pageData = { // 页面数据变量
|
||||||
|
zkSelectSearch2: {
|
||||||
|
Search: `${BASE_URL.BASE_URL}/MesStaff/v1/mes/staff/list`,
|
||||||
|
zkSelectData: {
|
||||||
|
page: 1,
|
||||||
|
limit: 50,
|
||||||
|
order_bys: [
|
||||||
|
{
|
||||||
|
column: "create_time",
|
||||||
|
order: "desc"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
zkSelectDataFieldName: 'MesStaff',
|
||||||
|
zkBackFieldNames: ['id', 'name', 'code', 'create_time'],
|
||||||
|
},
|
||||||
|
|
||||||
|
keyName: 'id', // 主键字段名
|
||||||
|
|
||||||
|
|
||||||
|
// 接口动作
|
||||||
|
actions: { // Api 接口地址
|
||||||
|
// =============================== 接口地址 自动生成 Start ===============================
|
||||||
|
DriverWagesTotal: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/total`, // 司机工资列表
|
||||||
|
DriverWagesPay: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/pay`
|
||||||
|
// =============================== 接口地址 自动生成 End ===============================
|
||||||
|
},
|
||||||
|
|
||||||
|
start_time: 0, // 开始时间
|
||||||
|
end_time: 0, // 结束时间
|
||||||
|
|
||||||
|
//搜索区
|
||||||
|
searchFormData: {
|
||||||
|
wages_year:'',
|
||||||
|
wages_month: '',
|
||||||
|
staff_uid: '',
|
||||||
|
},
|
||||||
|
// 搜索区配置
|
||||||
|
searchRules: [
|
||||||
|
{ key: "wages_year", mode: "=" },
|
||||||
|
{ key: "wages_month", mode: "=" },
|
||||||
|
{ key: "staff_uid", mode: "=" }
|
||||||
|
],
|
||||||
|
//搜索区
|
||||||
|
searchFormItems: [ // 子项
|
||||||
|
{field: 'wages_year', title: '年份', span: 3, itemRender: {name: '$select',props: { options: year,placeholder: '请选择年份' }}},
|
||||||
|
{field: 'wages_month', title: '月份', span: 3, itemRender: {name: '$select',props: { options: month,placeholder: '请选择月份' }}},
|
||||||
|
{
|
||||||
|
field: 'staff_uid',
|
||||||
|
title: '司机',
|
||||||
|
span: 4,
|
||||||
|
slots: { default: 'driver_id' }
|
||||||
|
},
|
||||||
|
{ span: 8, slots: { default: 'date' } }, // 自定义列
|
||||||
|
{
|
||||||
|
align: 'right', span: 6, itemRender: { // 按钮列
|
||||||
|
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } }, // 搜索按钮
|
||||||
|
{ props: { type: 'reset', content: '重置' } },
|
||||||
|
{ props: { type: 'reset', content: '打印' } }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
|
||||||
|
//数据区
|
||||||
|
gridOptions: { // 表格配置
|
||||||
|
export: true,
|
||||||
|
exportConfig: { // 导出配置
|
||||||
|
|
||||||
|
},
|
||||||
|
height: '100%', // 表格高度 100% 会自动撑满父容器
|
||||||
|
stripe: true, // 启用斑马纹
|
||||||
|
id: 'datagrid_1', // 表格唯一标识
|
||||||
|
|
||||||
|
// 接口获取数据
|
||||||
|
proxyConfig: { // 配置代理
|
||||||
|
sort: true, // 启用排序代理,当点击排序时会自动触发 query 行为
|
||||||
|
filter: true, // 启用筛选代理,当点击筛选时会自动触发 query 行为
|
||||||
|
props: {
|
||||||
|
result: listFieldName, // 配置响应结果列表字段
|
||||||
|
total: 'total', // 配置响应结果总页数字段
|
||||||
|
},
|
||||||
|
// 接收Promise
|
||||||
|
ajax: {
|
||||||
|
// 当点击工具栏查询按钮或者手动提交指令 query或reload 时会被触发
|
||||||
|
query: (options) => { // options 为当前表格的配置项
|
||||||
|
const { page, sorts } = options; // 获取当前页码、每页条数、排序信息
|
||||||
|
var params = {}; // 定义请求参数
|
||||||
|
params.page = page.currentPage; // 当前页码
|
||||||
|
params.limit = page.pageSize; // 每页条数
|
||||||
|
params.order_bys = []; // 排序信息
|
||||||
|
params.search_rules = this.getSearchParms(); // 搜索信息
|
||||||
|
if (sorts) { // 如果有排序信息
|
||||||
|
sorts.forEach((v) => { // 遍历排序信息
|
||||||
|
params.order_bys.push({ // 添加排序信息
|
||||||
|
column: v.property, // 字段名
|
||||||
|
order: v.order // 排序方式
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return this.loadData({ params }); // 返回请求结果
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 表格列配置
|
||||||
|
columns: [
|
||||||
|
{ type: 'checkbox', width: 50 }, // 多选框
|
||||||
|
{ type: 'seq', width: 30 }, // 序号
|
||||||
|
|
||||||
|
|
||||||
|
// =============================== 表格列 自动生成 Start ===============================
|
||||||
|
|
||||||
|
|
||||||
|
// { field: "mes_staff['wages_year']", sortable: true, title: '年份', width: 80 }, // 工资年份
|
||||||
|
// { field: 'wages_month', sortable: true, title: '月份', width: 70 }, // 工资月份
|
||||||
|
{ field: 'staff_name', sortable: true, title: '司机姓名', width: 120 }, // 员工姓名
|
||||||
|
{ field: 'staff_code', sortable: true, title: '司机编号', width: 120 }, // 员工编号
|
||||||
|
{ field: 'staff_phone', sortable: true, title: '司机手机', width: 120 }, // 员工手机号
|
||||||
|
{ field: 'total', sortable: true, title: '总工资', width: 100 }, // 工资金额
|
||||||
|
{
|
||||||
|
field: 'wages_status', sortable: true, title: '状态', width: 120,
|
||||||
|
slots: { default: 'wages_status' }
|
||||||
|
}, // 工资状态
|
||||||
|
{ field: 'wages_date', sortable: true, title: '日期', formatter: 'formatDate', width: 120 }, // 工资日期
|
||||||
|
// { field: 'wages_balance', sortable: true, title: '帐户结余', width: 120 }, // 工资结余
|
||||||
|
{ field: 'wages_remark', sortable: true, title: '备注', width: 250 }, // 工资备注
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
pageData.actions.getList = pageData.actions.DriverWagesTotal;
|
||||||
|
pageData.gridOptions = Object.assign({}, this.$mk.config.defaults.gridOptions, pageData.gridOptions); // 合并表格数据
|
||||||
|
|
||||||
|
return pageData; // 返回页面数据
|
||||||
|
},
|
||||||
|
|
||||||
|
// 计算属性
|
||||||
|
computed: {
|
||||||
|
// 页面描述
|
||||||
|
// desc() {
|
||||||
|
// return this.$t('pageDesc')
|
||||||
|
// }
|
||||||
|
},
|
||||||
|
|
||||||
|
// 创建完成
|
||||||
|
created() {
|
||||||
|
this.$nextTick(() => { // 在下次 DOM 更新循环结束之后执行延迟回调
|
||||||
|
// 将表格和工具栏进行关联
|
||||||
|
this.$refs.xGrid.connect(this.$refs.xToolbar) // 将表格和工具栏进行关联
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//页面动态刷新
|
||||||
|
activated() {
|
||||||
|
this.onSearch();
|
||||||
|
// 这里可以执行一些需要在组件被激活时执行的操作
|
||||||
|
},
|
||||||
|
// 挂载完成
|
||||||
|
onLoad() {
|
||||||
|
|
||||||
|
},
|
||||||
|
// 动作
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
// =============================== 基于status进行开关 自动生成 Start ===============================
|
||||||
|
|
||||||
|
// =============================== 基于status进行开关 自动生成 End ===============================
|
||||||
|
|
||||||
|
// 修改日期
|
||||||
|
onDateChange(date) { // 日期选择器事件
|
||||||
|
if (date && date.length) { // 如果有值
|
||||||
|
this.start_time = parseInt(date[0]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
|
this.end_time = parseInt(date[1]._d.getTime() / 1000); // 将日期转换为时间戳
|
||||||
|
} else { // 如果没有值
|
||||||
|
this.start_time = 0; // 将日期转换为时间戳
|
||||||
|
this.end_time = 0; // 将日期转换为时间戳
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取搜索参数
|
||||||
|
getSearchParms() { // 获取搜索参数
|
||||||
|
var rules = []; // 定义搜索参数
|
||||||
|
let findMode = k => { // 查找搜索模式
|
||||||
|
for (let i in this.searchRules) { // 遍历搜索规则
|
||||||
|
if (this.searchRules[i].key == k) return this.searchRules[i].mode; // 如果找到了就返回搜索模式
|
||||||
|
}
|
||||||
|
return "equal"; // 如果没有找到就返回等于
|
||||||
|
};
|
||||||
|
|
||||||
|
for (let key in this.searchFormData) { // 遍历搜索表单数据
|
||||||
|
let value = this.searchFormData[key]; // 获取值
|
||||||
|
if (value) { // 如果有值
|
||||||
|
let mode = findMode(key); // 获取搜索模式
|
||||||
|
if (mode == "like") { // 如果是模糊搜索
|
||||||
|
value = "%" + value + "%"; // 如果是模糊搜索就在两边加上%
|
||||||
|
}
|
||||||
|
// 如果value是数字,转换为字符串
|
||||||
|
if (typeof value == "number") {
|
||||||
|
value = value.toString();
|
||||||
|
}
|
||||||
|
rules.push({ // 添加搜索参数
|
||||||
|
column: key, // 字段名
|
||||||
|
mode: mode, // 搜索模式
|
||||||
|
value: value // 值
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rules; // 返回搜索参数
|
||||||
|
},
|
||||||
|
// 获取选中行
|
||||||
|
getSelectdRow() { // 获取选中行
|
||||||
|
let row = this.$refs.xGrid.getCurrentRecord(); // 获取当前行
|
||||||
|
if (!row) { // 如果没有选中行
|
||||||
|
let rows = this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
||||||
|
if (rows && rows.length) {
|
||||||
|
row = rows[0];
|
||||||
|
} // 如果有选中行就取第一行
|
||||||
|
}
|
||||||
|
return row; // 返回选中行
|
||||||
|
},
|
||||||
|
// 加载数据
|
||||||
|
loadData({ params }) {
|
||||||
|
params.start_time = this.start_time; // 开始时间
|
||||||
|
params.end_time = this.end_time; // 结束时间
|
||||||
|
return this.$mk.getPagedData({ url: this.actions.getList, data: params }); // 获取分页数据
|
||||||
|
},
|
||||||
|
|
||||||
|
// 工具栏点击事件 add / log / setting
|
||||||
|
toolbarClick(e) {
|
||||||
|
if (e.name == "add") { // 如果是添加
|
||||||
|
this.$openPage("/DriverWages/DriverWagesCreate"); // 打开页面
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
// 编辑
|
||||||
|
pageEdit(row) {
|
||||||
|
if (!row) { // 如果没有选中行
|
||||||
|
this.$mk.msg("请选择行"); // 提示
|
||||||
|
return; // 返回
|
||||||
|
}
|
||||||
|
this.$openPage("/DriverWages/DriverWagesUpdate/" + row[this.keyName]); // 打开页面
|
||||||
|
},
|
||||||
|
|
||||||
|
// 删除
|
||||||
|
pageDelete(row) {
|
||||||
|
let rows = row ? [row] : this.$refs.xGrid.getCheckboxRecords(); // 获取选中行
|
||||||
|
let ids = []; // 定义id数组
|
||||||
|
rows.forEach((row) => { // 遍历选中行
|
||||||
|
ids.push(row[this.keyName]); // 将选择行的id添加到id数组
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!ids.length) { // 如果没有选中行
|
||||||
|
this.$mk.error("请选择行"); // 提示
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$mk.confirm('您确定要删除吗?').then(type => { // 确认删除
|
||||||
|
if (type == 'confirm') { // 如果确认删除
|
||||||
|
this.$mk.post({
|
||||||
|
url: this.actions.delete, // 请求删除数据地址
|
||||||
|
loading: "删除中...", // 加载提示
|
||||||
|
data: {
|
||||||
|
ids: ids // 传递id数组
|
||||||
|
},
|
||||||
|
useBigInt: true
|
||||||
|
}).then(() => { // 成功
|
||||||
|
this.$mk.success("删除成功"); // 提示成功
|
||||||
|
this.onSearch(); // 重新加载数据
|
||||||
|
}).catch((a) => { // 失败
|
||||||
|
this.$mk.error(a.data.msg); // 提示错误信息
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 搜索
|
||||||
|
onSearch() {
|
||||||
|
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||||
|
},
|
||||||
|
|
||||||
|
// 发放工资
|
||||||
|
grant(row){
|
||||||
|
console.log("row",row);
|
||||||
|
let ids = [row.id]; // 定义id数组
|
||||||
|
this.$mk.confirm('您确定要发放吗?').then(type => { // 确认删除
|
||||||
|
if (type == 'confirm') { // 如果确认删除
|
||||||
|
this.$mk.post({
|
||||||
|
url: this.actions.DriverWagesPay, // 请求发放工资数据地址
|
||||||
|
loading: "发放中...", // 加载提示
|
||||||
|
data: {
|
||||||
|
ids: ids // 传递id数组
|
||||||
|
},
|
||||||
|
useBigInt: true
|
||||||
|
}).then(() => { // 成功
|
||||||
|
this.$mk.success("发放成功"); // 提示成功
|
||||||
|
this.onSearch(); // 重新加载数据
|
||||||
|
}).catch((a) => { // 失败
|
||||||
|
this.$mk.error(a.data.msg); // 提示错误信息
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 选择器改变
|
||||||
|
StaffhandleChange(value) {
|
||||||
|
|
||||||
|
this.$data.searchFormData.staff_uid = value.id;
|
||||||
|
console.log("this.$data.searchFormData.driver_id:",this.$data.searchFormData.staff_uid);
|
||||||
|
|
||||||
|
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
// 监听属性
|
||||||
|
watch: {}
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style scoped lang="less">
|
||||||
|
.page-body {
|
||||||
|
padding: 30px;
|
||||||
|
background: @base-bg-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.gridPanel {
|
||||||
|
height: calc(100vh - 400px);
|
||||||
|
}
|
||||||
|
.btns{
|
||||||
|
margin-left:10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.oplinks svg {
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
margin: 0 5px 0 0;
|
||||||
|
}
|
||||||
|
.bottom-box{
|
||||||
|
font-size: 25px;
|
||||||
|
font-weight: bold;
|
||||||
|
/* text-align: center; */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -296,7 +296,7 @@ export default {
|
||||||
// {field: 'unit_price', sortable: true, title: '单价', width: 120}, // 单价
|
// {field: 'unit_price', sortable: true, title: '单价', width: 120}, // 单价
|
||||||
// {field: 'total_price', sortable: true, title: '总价', width: 120}, // 总价
|
// {field: 'total_price', sortable: true, title: '总价', width: 120}, // 总价
|
||||||
{
|
{
|
||||||
field: 'is_outsourcing', align: 'center', sortable: true, title: '类型', width: 80,
|
field: 'is_outsourcing', align: 'center', sortable: true, title: '是否委外', width: 80,
|
||||||
slots: { default: 'is_outsourcing' }
|
slots: { default: 'is_outsourcing' }
|
||||||
}, // 是否委外
|
}, // 是否委外
|
||||||
// {field: 'is_need_outbound', sortable: true, title: '出车', width: 70}, // 是否需要出车
|
// {field: 'is_need_outbound', sortable: true, title: '出车', width: 70}, // 是否需要出车
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ const DriverWagesRouterMap = {
|
||||||
icon: 'idcard',
|
icon: 'idcard',
|
||||||
path: '/DriverWages/DriverWagesTotal',
|
path: '/DriverWages/DriverWagesTotal',
|
||||||
meta: {
|
meta: {
|
||||||
invisible: true, // 不在菜单中显示
|
invisible: false, // 不在菜单中显示
|
||||||
},
|
},
|
||||||
component: () => import('@/pages/Middle/transport/DriverWages/DriverWages/Total'),
|
component: () => import('@/pages/Middle/transport/DriverWages/DriverWages/Total'),
|
||||||
authority: {
|
authority: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue