This commit is contained in:
parent
168015c00e
commit
21c1ea22b4
|
|
@ -16,7 +16,7 @@
|
|||
</a-col>
|
||||
<a-col :flex="$mk.config.ui.toolbarFlex">
|
||||
<!-- 工具条 -->
|
||||
<mk-toolbar :isShowAdd="true" @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
<mk-toolbar :isShowAdd="false" @toolbarClick="toolbarClick"></mk-toolbar>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
|
|
|
|||
|
|
@ -78,17 +78,31 @@
|
|||
</li>
|
||||
</div>
|
||||
|
||||
<!-- 结余日志列表 -->
|
||||
<div class="balance-log">
|
||||
<h2>
|
||||
结余日志
|
||||
</h2>
|
||||
|
||||
<ZkTableList
|
||||
ref="ZkTableList"
|
||||
:ListUrl="this.BalanceLogSearch" :ListUrlData="this.zkSelectData"
|
||||
:Columns="this.columns"
|
||||
:ListFieldName="this.zkSelectDataFieldName">
|
||||
</ZkTableList>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import BASE_URL from '@/services/Middle/transport/Custom/api.js';
|
||||
import ZkTableList from './zkTableList.vue'
|
||||
// import ZkTable from "@/components/zk/zkTable.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
// ZkTable
|
||||
ZkTableList
|
||||
},
|
||||
props: {
|
||||
dataId: {
|
||||
|
|
@ -108,7 +122,48 @@ export default {
|
|||
return {
|
||||
|
||||
BalanceAdd: `${BASE_URL.BASE_URL}/Custom/v1/balance/add`, // 增加客户结余
|
||||
BalanceReduce: `${BASE_URL.BASE_URL}/Custom/v1/balance/reduce`, // 减少客户结余
|
||||
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`, // 客户结余日志搜索
|
||||
BalanceLogDetail: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/detail`, // 客户结余日志详情
|
||||
BalanceLogDelete: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/detele`, // 删除客户结余日志
|
||||
BalanceLogBatchDelete: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/batchDelete`, // 批量删除客户结余日志
|
||||
zkSelectData: {
|
||||
page: 1,
|
||||
end_time: 0,
|
||||
start_time: 0,
|
||||
search_rules: [
|
||||
],
|
||||
order_bys: [
|
||||
],
|
||||
limit: 50
|
||||
},
|
||||
zkSelectDataFieldName: "BalanceLog",
|
||||
// 表格列配置
|
||||
columns: [
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
||||
{field: 'custom_id', sortable: true, title: '客户id', width: 150}, // 客户id
|
||||
{field: 'balance_type', sortable: true, title: '结余类型', width: 120}, // 结余类型:1增加,2减少
|
||||
|
||||
{
|
||||
field: 'create_time',
|
||||
formatter: 'formatDate',
|
||||
width: 100,
|
||||
sortable: true,
|
||||
title: '创建时间',
|
||||
showHeaderOverflow: true
|
||||
}, // 创建时间
|
||||
|
||||
{field: 'total_balance', sortable: true, title: '结余金额', width: 100}, // 结余金额
|
||||
{field: 'total_amount', sortable: true, title: '总结余金额', width: 120}, // 总结余金额
|
||||
{field: 'remark', sortable: true, title: '备注', width: 250}, // 备注
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
],
|
||||
amount: 0,
|
||||
remark: "",
|
||||
data: {
|
||||
|
|
@ -212,6 +267,8 @@ export default {
|
|||
this.$mk.success("增加结余成功");
|
||||
// 刷新页面
|
||||
this.initDetailData() // 刷新
|
||||
// 刷新列表
|
||||
this.$refs.ZkTableList.refresh()
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg, "aaa");
|
||||
});
|
||||
|
|
@ -251,6 +308,8 @@ export default {
|
|||
this.$mk.success("减少结余成功");
|
||||
// 刷新页面
|
||||
this.initDetailData() // 刷新
|
||||
// 刷新列表
|
||||
this.$refs.ZkTableList.refresh()
|
||||
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg, "aaa");
|
||||
|
|
@ -300,4 +359,9 @@ export default {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
.balance-log {
|
||||
margin-top: 20px;
|
||||
height:600px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,8 +2,8 @@
|
|||
<vxe-grid ref='xGrid' v-bind="gridOptions" @form-submit="initListData" @page-change="handlePageChange">
|
||||
<!-- 工具栏 -->
|
||||
<template #toolbar_buttons>
|
||||
<a-button @click="pageDelete()">批量删除</a-button>
|
||||
<a-button type="primary" @click="Add()">新增</a-button>
|
||||
<!-- <a-button @click="pageDelete()">批量删除</a-button> -->
|
||||
<!-- <a-button type="primary" @click="Add()">新增</a-button> -->
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
|
|
@ -33,22 +33,22 @@ export default {
|
|||
create_time: 0
|
||||
},
|
||||
items: [
|
||||
{
|
||||
field: 'name',
|
||||
title: '名称',
|
||||
slots: {default: 'name_item'} // 自定义插槽
|
||||
},
|
||||
{
|
||||
field: 'code',
|
||||
title: '编码',
|
||||
slots: {default: 'code_item'} // 自定义插槽
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
title: '时间',
|
||||
slots: {default: 'create_time_item'} // 自定义插槽
|
||||
},
|
||||
{slots: {default: 'operate_item'}}
|
||||
// {
|
||||
// field: 'name',
|
||||
// title: '名称',
|
||||
// slots: {default: 'name_item'} // 自定义插槽
|
||||
// },
|
||||
// {
|
||||
// field: 'code',
|
||||
// title: '编码',
|
||||
// slots: {default: 'code_item'} // 自定义插槽
|
||||
// },
|
||||
// {
|
||||
// field: 'create_time',
|
||||
// title: '时间',
|
||||
// slots: {default: 'create_time_item'} // 自定义插槽
|
||||
// },
|
||||
// {slots: {default: 'operate_item'}}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -238,7 +238,11 @@ export default {
|
|||
success && this.initListData(); // 如果成功,初始化列表数据
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
// 刷新数据,父组件调用
|
||||
refresh() {
|
||||
this.initListData();
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
<a-col :flex="$mk.config.ui.searchFlex">
|
||||
<!-- 搜索区 -->
|
||||
<vxe-form :data="searchFormData" :items="searchFormItems" titleColon @submit="onSearch">
|
||||
<template #date="{}">
|
||||
<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-range-picker @change="onDateChange" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</vxe-form>
|
||||
|
|
@ -33,14 +33,17 @@
|
|||
<!-- =============================== 表格列 自动生成 Start =============================== -->
|
||||
|
||||
<!-- =============================== 表格列 自动生成 End =============================== -->
|
||||
<template #wages_status="{ row }">
|
||||
{{ row.wages_status === 0 ? '未发放' : '已发放' }}
|
||||
</template>
|
||||
|
||||
<template #op="{ row }">
|
||||
<div class="oplinks">
|
||||
<a @click.stop="pageEdit(row)" title="编辑">
|
||||
<a-icon type="edit"/>
|
||||
<a-icon type="edit" />
|
||||
</a>
|
||||
<a @click.stop="pageDelete(row)" title="删除">
|
||||
<a-icon type="delete"/>
|
||||
<a-icon type="delete" />
|
||||
</a>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -113,18 +116,18 @@ export default {
|
|||
},
|
||||
// 搜索区配置
|
||||
searchRules: [
|
||||
{key: "title", mode: "like"},
|
||||
{key: "desc", mode: "like"}
|
||||
{ key: "title", mode: "like" },
|
||||
{ key: "desc", mode: "like" }
|
||||
],
|
||||
//搜索区
|
||||
searchFormItems: [ // 子项
|
||||
// {field: 'title', title: '标题', span: 5, itemRender: {name: '$input', props: {placeholder: '请输入标题'}}},
|
||||
// {field: 'desc', title: '描述', span: 5, itemRender: {name: '$input', props: {placeholder: '请输入描述'}}},
|
||||
{span: 8, slots: {default: 'date'}}, // 自定义列
|
||||
{ span: 8, slots: { default: 'date' } }, // 自定义列
|
||||
{
|
||||
align: 'right', span: 4, itemRender: { // 按钮列
|
||||
name: '$buttons', children: [{props: {type: 'submit', content: '搜索', status: 'primary'}}, // 搜索按钮
|
||||
{props: {type: 'reset', content: '重置'}}]
|
||||
name: '$buttons', children: [{ props: { type: 'submit', content: '搜索', status: 'primary' } }, // 搜索按钮
|
||||
{ props: { type: 'reset', content: '重置' } }]
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
@ -148,7 +151,7 @@ export default {
|
|||
ajax: {
|
||||
// 当点击工具栏查询按钮或者手动提交指令 query或reload 时会被触发
|
||||
query: (options) => { // options 为当前表格的配置项
|
||||
const {page, sorts} = options; // 获取当前页码、每页条数、排序信息
|
||||
const { page, sorts } = options; // 获取当前页码、每页条数、排序信息
|
||||
var params = {}; // 定义请求参数
|
||||
params.page = page.currentPage; // 当前页码
|
||||
params.limit = page.pageSize; // 每页条数
|
||||
|
|
@ -162,7 +165,7 @@ export default {
|
|||
})
|
||||
});
|
||||
}
|
||||
return this.loadData({params}); // 返回请求结果
|
||||
return this.loadData({ params }); // 返回请求结果
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -170,40 +173,34 @@ export default {
|
|||
|
||||
// 表格列配置
|
||||
columns: [
|
||||
{type: 'checkbox', width: 50}, // 多选框
|
||||
{type: 'seq', width: 30}, // 序号
|
||||
{ type: 'checkbox', width: 50 }, // 多选框
|
||||
{ type: 'seq', width: 30 }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
||||
{field: 'code', sortable: true, title: '编码', width: 120}, // 编码
|
||||
{field: 'staff_name', sortable: true, title: '员工姓名', width: 250}, // 员工姓名
|
||||
{field: 'staff_code', sortable: true, title: '员工编号', width: 250}, // 员工编号
|
||||
{field: 'staff_phone', sortable: true, title: '员工手机号', width: 250}, // 员工手机号
|
||||
{field: 'wages_date', sortable: true, title: '工资日期', width: 120}, // 工资日期
|
||||
{field: 'wages_year', sortable: true, title: '工资年份', width: 250}, // 工资年份
|
||||
{field: 'wages_month', sortable: true, title: '工资月份', width: 250}, // 工资月份
|
||||
{field: 'wages_type', sortable: true, title: '工资类型', width: 250}, // 工资类型
|
||||
{field: 'wages_amount', sortable: true, title: '工资金额', width: 250}, // 工资金额
|
||||
{field: 'wages_balance', sortable: true, title: '工资结余', width: 250}, // 工资结余
|
||||
{field: 'wages_remark', sortable: true, title: '工资备注', width: 250}, // 工资备注
|
||||
{field: 'wages_status', sortable: true, title: '工资状态', width: 250}, // 工资状态
|
||||
|
||||
{ field: 'wages_year', sortable: true, title: '年份', width: 80 }, // 工资年份
|
||||
{ field: 'wages_month', sortable: true, title: '月份', width: 80 }, // 工资月份
|
||||
{ field: 'code', sortable: true, title: '工资单号', width: 120 }, // 编码
|
||||
{ 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: 'wages_date', sortable: true, title: '工资日期', formatter: 'formatDate', width: 120 }, // 工资日期
|
||||
{ field: 'wages_type', sortable: true, title: '类型', width: 100 }, // 工资类型
|
||||
{ field: 'wages_amount', sortable: true, title: '金额', width: 100 }, // 工资金额
|
||||
{ field: 'wages_balance', sortable: true, title: '帐户结余', width: 120 }, // 工资结余
|
||||
{
|
||||
field: 'create_time',
|
||||
formatter: 'formatDate',
|
||||
width: 100,
|
||||
sortable: true,
|
||||
title: '创建时间',
|
||||
showHeaderOverflow: true
|
||||
}, // 创建时间
|
||||
field: 'wages_status', sortable: true, title: '状态', width: 120,
|
||||
slots: { default: 'wages_status' }
|
||||
}, // 工资状态
|
||||
{ field: 'wages_remark', sortable: true, title: '备注', width: 250 }, // 工资备注
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
||||
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120, fixed: 'right' }
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -290,10 +287,10 @@ export default {
|
|||
return row; // 返回选中行
|
||||
},
|
||||
// 加载数据
|
||||
loadData({params}) {
|
||||
loadData({ params }) {
|
||||
params.start_time = this.start_time; // 开始时间
|
||||
params.end_time = this.end_time; // 结束时间
|
||||
return this.$mk.getPagedData({url: this.actions.getList, data: params}); // 获取分页数据
|
||||
return this.$mk.getPagedData({ url: this.actions.getList, data: params }); // 获取分页数据
|
||||
},
|
||||
|
||||
// 工具栏点击事件 add / log / setting
|
||||
|
|
|
|||
|
|
@ -0,0 +1,355 @@
|
|||
<template>
|
||||
<div class="detail">
|
||||
|
||||
<!-- <div class="header">-->
|
||||
<!-- <h1>详情</h1>-->
|
||||
<!-- </div>-->
|
||||
<a-descriptions size="small" :title="pageOptions.title" bordered>
|
||||
<a-descriptions-item label="员工姓名">
|
||||
{{ data.staff_detail.name }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="员工工号">
|
||||
{{ data.staff_detail.code }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="员工电话">
|
||||
{{ data.staff_detail.phone }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="运输总公里数">
|
||||
{{ data.transport_mileage }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="本月份总公里数">
|
||||
{{ data.month_mileage }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="工资结余">
|
||||
{{ data.wages_balance }} 元
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<div class="amount">
|
||||
<h2>
|
||||
修改结余
|
||||
</h2>
|
||||
<li>
|
||||
<span>操作金额:</span>
|
||||
<a-input id="inputNumber" style="width: 200px;margin-right: 10px;" prefix="¥" suffix="RMB" v-model="amount"
|
||||
:min="1" :max="1000000000" placeholder="请输入要操作的金额" />
|
||||
</li>
|
||||
<li>
|
||||
<span>操作备注:</span>
|
||||
<a-textarea v-model="remark" placeholder="请输入要操作的备注" :auto-size="{ minRows: 3, maxRows: 5 }"
|
||||
style="width: 200px;margin-right: 10px;" />
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<div class="btns">
|
||||
<!-- 增加结余按钮 -->
|
||||
<a-popconfirm title="是否增加结余?" ok-text="确认" cancel-text="取消" @confirm="addBalance" @cancel="cancel">
|
||||
<a-button class="btn-add-balance" type="primary">增加结余</a-button>
|
||||
</a-popconfirm>
|
||||
<!-- 减少结余按钮 -->
|
||||
<a-popconfirm title="是否减少结余?" ok-text="确认" cancel-text="取消" @confirm="reduceBalance" @cancel="cancel">
|
||||
<a-button class="btn-reduce-balance" type="danger"> 减少结余</a-button>
|
||||
</a-popconfirm>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
<!-- 结余日志列表 -->
|
||||
<div class="balance-log">
|
||||
<h2>
|
||||
结余日志
|
||||
</h2>
|
||||
|
||||
<ZkTableList ref="ZkTableList" :ListUrl="this.DriverWagesGiornaleLogSearch" :ListUrlData="this.zkSelectData"
|
||||
:Columns="this.columns" :ListFieldName="this.zkSelectDataFieldName">
|
||||
</ZkTableList>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import BASE_URL from '@/services/Middle/transport/Custom/api.js';
|
||||
import ZkTableList from './zkTableList.vue'
|
||||
// import ZkTable from "@/components/zk/zkTable.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ZkTableList
|
||||
},
|
||||
props: {
|
||||
dataId: {
|
||||
},
|
||||
pageOptions: {
|
||||
type: Object
|
||||
},
|
||||
ApiUrl: {
|
||||
type: String
|
||||
},
|
||||
ApiData: {
|
||||
type: Object
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
DriverWagesSurplusAdd: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/surplus/add`, // 增加司机结余
|
||||
DriverWagesSurplusReduce: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/surplus/reduce`, // 减少司机结余 DriverWagesSurplusLogList: `${BASE_URL.BASE_URL}/Custom/v1/balance/log/list`, // 客户结余日志列表
|
||||
DriverWagesGiornaleLogList: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/list`, // 司机工资结余日志列表
|
||||
DriverWagesGiornaleLogSearch: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/search`, // 司机工资结余日志搜索
|
||||
DriverWagesGiornaleLogDetail: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/detail`, // 司机工资结余日志详情
|
||||
DriverWagesGiornaleLogCreate: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/create`, // 创建司机工资结余日志
|
||||
DriverWagesGiornaleLogUpdate: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/update`, // 更新司机工资结余日志
|
||||
DriverWagesGiornaleLogDelete: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/detele`, // 删除司机工资结余日志
|
||||
DriverWagesGiornaleLogBatchDelete: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/batchDelete`, // 批量删除司机工资结余日志
|
||||
DriverWagesGiornaleLogBatchUpdate: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/batchUpdate`, // 批量更新司机工资结余日志
|
||||
DriverWagesGiornaleLogBatchCreate: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/batchCreate`, // 批量创建司机工资结余日志
|
||||
DriverWagesGiornaleLogBatchHandle: `${BASE_URL.BASE_URL}/DriverWages/v1/driver/wages/giornale/log/batchHandle`, // 批量处理司机工资结余日志
|
||||
zkSelectData: {
|
||||
page: 1,
|
||||
end_time: 0,
|
||||
start_time: 0,
|
||||
search_rules: [
|
||||
],
|
||||
order_bys: [
|
||||
],
|
||||
limit: 50
|
||||
},
|
||||
zkSelectDataFieldName: "DriverWagesGiornaleLog",
|
||||
// 表格列配置
|
||||
columns: [
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
{ type: 'checkbox', width: 50 }, // 多选框
|
||||
{ type: 'seq', width: 30 }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
||||
{ field: 'code', sortable: true, title: '编码', width: 120 }, // 编码
|
||||
{ field: 'staff_uid', sortable: true, title: '员工uid', width: 250 }, // 员工uid
|
||||
{ field: 'balance_type', sortable: true, title: '结余类型', width: 250 }, // 结余类型:1增加,2减少
|
||||
{ field: 'balance_amount', sortable: true, title: '修改金额', width: 250 }, // 修改金额
|
||||
{ field: 'total_balance', sortable: true, title: '总结余金额', width: 250 }, // 总结余金额
|
||||
{ field: 'remark', sortable: true, title: '备注', width: 250 }, // 备注
|
||||
|
||||
{
|
||||
field: 'create_time',
|
||||
formatter: 'formatDate',
|
||||
width: 100,
|
||||
sortable: true,
|
||||
title: '创建时间',
|
||||
showHeaderOverflow: true
|
||||
}, // 创建时间
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
],
|
||||
amount: 0,
|
||||
remark: "",
|
||||
data: {
|
||||
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initDetailData();
|
||||
},
|
||||
filters: {
|
||||
formatDate: function (value) {
|
||||
if (value) {
|
||||
// 时间戳转日期格式格式化日期时间
|
||||
return new Date(value).toLocaleString().replace(/:\d{1,2}$/, ' ');
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
// 格式化状态
|
||||
formatStatus: function (value) {
|
||||
if (value === 1) {
|
||||
return "正常";
|
||||
|
||||
// return "success";
|
||||
} else if (value === 0) {
|
||||
return "停用";
|
||||
// return "error";
|
||||
} else {
|
||||
return "未知";
|
||||
// return "warning";
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
initDetailData() {
|
||||
console.log("this.pageOptions.FieldName:", this.pageOptions.FieldName)
|
||||
console.log("this.pageOptions.ApiUrl:", this.pageOptions.ApiUrl);
|
||||
console.log("this.pageOptions.ApiData:", this.pageOptions.ApiData);
|
||||
|
||||
// this.dataId 转换为bigint
|
||||
// 如果this.dataId是对象,则需要转换为数字
|
||||
|
||||
this.$zk.post({
|
||||
url: this.pageOptions.ApiUrl,
|
||||
data: this.pageOptions.ApiData,
|
||||
|
||||
|
||||
loading: "加载中...",
|
||||
useBigInt: true,
|
||||
config: {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
}).then(a => {
|
||||
console.log("a", a)
|
||||
console.log("this.pageOptions.ApiUrl", this.pageOptions.ApiUrl)
|
||||
this.data = a.data[this.pageOptions.FieldName];
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg, "aaa");
|
||||
});
|
||||
},
|
||||
addBalance() {
|
||||
this.addBalanceApi();
|
||||
},
|
||||
reduceBalance() {
|
||||
this.reduceBalanceApi();
|
||||
},
|
||||
|
||||
addBalanceApi() {
|
||||
// 转换 this.amount 为数字
|
||||
this.amount = Number(this.amount);
|
||||
// 如果不为数字
|
||||
if (this.amount === undefined || isNaN(this.amount)) {
|
||||
this.$mk.error("请输入正确的金额");
|
||||
return
|
||||
}
|
||||
if (this.amount <= 0) {
|
||||
this.$mk.error("请输入正确的金额");
|
||||
return
|
||||
}
|
||||
// 调用增加结余接口
|
||||
this.$zk.post({
|
||||
url: this.DriverWagesSurplusAdd,
|
||||
data: {
|
||||
staff_uid: this.pageOptions.ApiData.id,
|
||||
add_balance: this.amount,
|
||||
remark: this.remark
|
||||
},
|
||||
loading: "加载中...",
|
||||
useBigInt: true,
|
||||
config: {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
}).then(a => {
|
||||
console.log("a", a);
|
||||
// 成功提示 刷新页面
|
||||
this.$mk.success("增加结余成功");
|
||||
// 刷新页面
|
||||
this.initDetailData() // 刷新
|
||||
// 刷新列表
|
||||
this.$refs.ZkTableList.refresh()
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg, "aaa");
|
||||
});
|
||||
},
|
||||
reduceBalanceApi() {
|
||||
// 转换 this.amount 为数字
|
||||
this.amount = Number(this.amount);
|
||||
// 如果不为数字
|
||||
if (this.amount === undefined || isNaN(this.amount)) {
|
||||
this.$mk.error("请输入正确的金额");
|
||||
return
|
||||
}
|
||||
if (this.amount <= 0) {
|
||||
this.$mk.error("请输入正确的金额");
|
||||
return
|
||||
}
|
||||
// 调用减少结余接口
|
||||
this.$zk.post({
|
||||
url: this.DriverWagesSurplusReduce,
|
||||
data: {
|
||||
|
||||
staff_uid: this.pageOptions.ApiData.id,
|
||||
reduce_balance: this.amount,
|
||||
remark: this.remark
|
||||
|
||||
},
|
||||
loading: "加载中...",
|
||||
useBigInt: true,
|
||||
config: {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
}).then(a => {
|
||||
console.log("a", a);
|
||||
// 成功提示 刷新页面
|
||||
this.$mk.success("减少结余成功");
|
||||
// 刷新页面
|
||||
this.initDetailData() // 刷新
|
||||
// 刷新列表
|
||||
this.$refs.ZkTableList.refresh()
|
||||
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg, "aaa");
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
cancel() {
|
||||
console.log('cancel');
|
||||
},
|
||||
confirm() {
|
||||
console.log('confirm');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.detail {
|
||||
margin: 10px;
|
||||
|
||||
}
|
||||
|
||||
.btns {
|
||||
|
||||
margin-top: 10px;
|
||||
|
||||
.btn-add-balance {}
|
||||
|
||||
.btn-reduce-balance {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.amount {
|
||||
margin-top: 20px;
|
||||
|
||||
li {
|
||||
margin-top: 10px;
|
||||
list-style: none;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.balance-log {
|
||||
margin-top: 20px;
|
||||
height: 600px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -39,12 +39,15 @@
|
|||
</template>
|
||||
<template #status="{ row }"><!-- 这里是自定义列 -->
|
||||
<!-- 转换 row.status 的值 如果是true显示开,否则显示关-->
|
||||
<a-switch :checked="row.status ? true : false" @change="onSwitch(row, 'status')" />
|
||||
{{ row.status === 0 ? '正常' :'异常'}}
|
||||
</template>
|
||||
<!-- =============================== 表格列 自动生成 End =============================== -->
|
||||
|
||||
<template #op="{ row }">
|
||||
<div class="oplinks">
|
||||
<a @click.stop="pageDetail(row)" title="详情">
|
||||
<a-icon type="file"/>
|
||||
</a>
|
||||
<a @click.stop="pageEdit(row)" title="编辑">
|
||||
<a-icon type="edit" />
|
||||
</a>
|
||||
|
|
@ -219,7 +222,7 @@ export default {
|
|||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
||||
{ title: '操作', slots: { default: 'op' }, width: 120, fixed: 'right' }
|
||||
{ title: '操作', slots: { default: 'op' }, width: 150, fixed: 'right' }
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -379,6 +382,42 @@ export default {
|
|||
this.$refs.xGrid.commitProxy('query') // 提交搜索
|
||||
},
|
||||
|
||||
pageDetail(row){
|
||||
console.log("list row",row)
|
||||
if (!row) { // 如果没有选中行
|
||||
this.$mk.msg("请选择行"); // 提示
|
||||
return; // 返回
|
||||
}
|
||||
|
||||
this.$mk.dialog.open({
|
||||
height: 800,
|
||||
width: 1200,
|
||||
page: () => import('./Detail.vue'),
|
||||
title: "详情",
|
||||
dataId: row.id,
|
||||
pageOptions: {
|
||||
ApiUrl: this.actions.DriverWagesSurplusDetail,
|
||||
ApiData: {
|
||||
id: row.id
|
||||
},
|
||||
FieldName: "driver_wages_surplus",
|
||||
title: "详情",
|
||||
},
|
||||
callback: ({success}) => {
|
||||
console.log("success",success);
|
||||
|
||||
this.$forceUpdate() // 刷新
|
||||
},
|
||||
// 关闭弹窗时触发
|
||||
close: () => {
|
||||
console.log("close");
|
||||
|
||||
// 表格重新加载数据
|
||||
this.onSearch();
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
<template>
|
||||
<vxe-grid ref='xGrid' v-bind="gridOptions" @form-submit="initListData" @page-change="handlePageChange">
|
||||
<!-- 工具栏 -->
|
||||
<template #toolbar_buttons>
|
||||
<!-- <a-button @click="pageDelete()">批量删除</a-button> -->
|
||||
<!-- <a-button type="primary" @click="Add()">新增</a-button> -->
|
||||
</template>
|
||||
|
||||
<template #empty>
|
||||
<a-empty/>
|
||||
</template>
|
||||
</vxe-grid>
|
||||
</template>
|
||||
<script>
|
||||
import ListMixin from "@/application/zk/mixins/ListComponents.js";
|
||||
import DeleteMixin from "@/application/zk/mixins/DeleteComponents.js";
|
||||
import DetailMixin from "@/application/zk/mixins/DetailComponents.js";
|
||||
import UpdateMixin from "@/application/zk/mixins/UpdateComponents.js";
|
||||
|
||||
export default {
|
||||
mixins: [ListMixin, DeleteMixin, DetailMixin, UpdateMixin],
|
||||
props: {
|
||||
Columns: {
|
||||
type: Array
|
||||
},
|
||||
FormConfig: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
data: {
|
||||
name: '',
|
||||
code: '',
|
||||
create_time: 0
|
||||
},
|
||||
items: [
|
||||
// {
|
||||
// field: 'name',
|
||||
// title: '名称',
|
||||
// slots: {default: 'name_item'} // 自定义插槽
|
||||
// },
|
||||
// {
|
||||
// field: 'code',
|
||||
// title: '编码',
|
||||
// slots: {default: 'code_item'} // 自定义插槽
|
||||
// },
|
||||
// {
|
||||
// field: 'create_time',
|
||||
// title: '时间',
|
||||
// slots: {default: 'create_time_item'} // 自定义插槽
|
||||
// },
|
||||
// {slots: {default: 'operate_item'}}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
DeleteIds: [], // 删除的id
|
||||
gridOptions: { // 表格配置
|
||||
resizable: true, // 是否允许拖动列宽调整大小
|
||||
border: true, // 是否带有纵向边框
|
||||
showOverflow: true, // 当内容过长时显示为省略号
|
||||
loading: false, // 是否显示加载中
|
||||
minHeight: '600', // 最小高度
|
||||
maxHeight: '1200', // 最大高度
|
||||
// 间隔条纹
|
||||
stripe: true,
|
||||
exportConfig: { // 导出配置
|
||||
|
||||
},
|
||||
|
||||
pagerConfig: {// 分页配置
|
||||
total: 0, // 总条数
|
||||
currentPage: this.ListUrlData.page, // 当前页
|
||||
pageSize: this.ListUrlData.limit, // 默认每页显示条数
|
||||
pageSizes: [10, 20, 30, 50, 100, 500, 1000, 2000] // 每页显示条数选项
|
||||
},
|
||||
checkboxConfig: { // 复选框配置
|
||||
// 设置复选框支持分页勾选,需要设置 rowId 行数据主键
|
||||
reserve: true,
|
||||
// 点击行选中复选框
|
||||
trigger: 'row',
|
||||
highlight: true
|
||||
},
|
||||
formConfig: this.FormConfig, // 表单配置
|
||||
toolbarConfig: { // 工具栏配置
|
||||
export: true, // 是否显示导出按钮
|
||||
custom: true, // 是否显示自定义列按钮
|
||||
slots: {
|
||||
buttons: 'toolbar_buttons' // 自定义插槽
|
||||
}
|
||||
},
|
||||
columns: this.Columns, // 表格列配置
|
||||
data: []
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化列表数据
|
||||
this.initListData()
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 初始化列表数据
|
||||
initListData() {
|
||||
this.ListUrlData.order_bys = []
|
||||
this.ListUrlData.order_bys.push({
|
||||
column: "create_time",
|
||||
order: "desc"
|
||||
})
|
||||
this.ListUrlData.search_rules = [];
|
||||
if (this.gridOptions.formConfig.data.name !== '') {
|
||||
this.ListUrlData.search_rules.push(
|
||||
{
|
||||
column: "name",
|
||||
mode: "like",
|
||||
value: this.gridOptions.formConfig.data.name
|
||||
}
|
||||
)
|
||||
}
|
||||
if (this.gridOptions.formConfig.data.code !== '') {
|
||||
this.ListUrlData.search_rules.push(
|
||||
{
|
||||
column: "code",
|
||||
mode: "like",
|
||||
value: this.gridOptions.formConfig.data.code
|
||||
}
|
||||
)
|
||||
}
|
||||
this.$zk.getPagedData({
|
||||
url: this.ListUrl,
|
||||
listFieldName: this.ListFieldName,
|
||||
data: this.ListUrlData,
|
||||
loading: "加载中...",
|
||||
config: {
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
}).then(a => {
|
||||
if (a.total === 0) {
|
||||
this.gridOptions.pagerConfig.currentPage = this.ListUrlData.page;
|
||||
this.gridOptions.pagerConfig.pageSize = this.ListUrlData.limit;
|
||||
this.gridOptions.pagerConfig.total = a.total;
|
||||
this.gridOptions.data = a[this.ListFieldName];
|
||||
return
|
||||
}
|
||||
this.gridOptions.data = a[this.ListFieldName];
|
||||
// this.list中的id字段转换为字符串
|
||||
this.gridOptions.data.forEach(item => {
|
||||
item.id = item.id.toString();
|
||||
});
|
||||
this.gridOptions.pagerConfig.currentPage = this.ListUrlData.page;
|
||||
this.gridOptions.pagerConfig.pageSize = this.ListUrlData.limit;
|
||||
this.gridOptions.pagerConfig.total = a.total;
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg);
|
||||
});
|
||||
},
|
||||
|
||||
// 删除
|
||||
pageDelete: function (row) {
|
||||
let ids = [];
|
||||
if (row) {
|
||||
ids.push(row.id);
|
||||
}
|
||||
this.$refs.xGrid.getCheckboxRecords().forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
console.log(ids);
|
||||
if (!ids.length) { // 如果没有选中行
|
||||
this.$mk.error("请选择行"); // 提示
|
||||
return;
|
||||
}
|
||||
this.$mk.confirm('您确定要删除吗?').then(type => { // 确认删除
|
||||
if (type === 'confirm') { // 如果确认删除
|
||||
this.DeleteUrlData.ids = ids;
|
||||
this.Delete()
|
||||
this.$message.success("删除成功")
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
// 分页
|
||||
handlePageChange({currentPage, pageSize}) {
|
||||
this.ListUrlData.page = currentPage
|
||||
this.ListUrlData.limit = pageSize
|
||||
this.initListData()
|
||||
},
|
||||
// 时间选择
|
||||
onChangeCreatTime(date, dateString) {
|
||||
console.log("dateString:", dateString)
|
||||
if (dateString[0] === '' && dateString[1] === '') {
|
||||
this.ListUrlData.start_time = 0;
|
||||
this.ListUrlData.end_time = 0;
|
||||
this.initListData()
|
||||
} else {
|
||||
this.ListUrlData.start_time = dateString[0];
|
||||
this.ListUrlData.end_time = dateString[1];
|
||||
this.initListData()
|
||||
}
|
||||
},
|
||||
// 新增
|
||||
Add() {
|
||||
this.$openPage(this.CreateRouter);
|
||||
},
|
||||
// 编辑
|
||||
pageEdit(row) {
|
||||
console.log(row)
|
||||
if (!row) { // 如果没有选中行
|
||||
this.$mk.msg("请选择行"); // 提示
|
||||
return; // 返回
|
||||
}
|
||||
this.$openPage(this.UpdateRouter + "/" + row.id); // 打开页面
|
||||
},
|
||||
// 详情
|
||||
pageDetail(row) {
|
||||
console.log(row)
|
||||
if (!row) { // 如果没有选中行
|
||||
this.$mk.msg("请选择行"); // 提示
|
||||
return; // 返回
|
||||
}
|
||||
this.$mk.dialog.open({
|
||||
height: 800,
|
||||
width: 1200,
|
||||
page: () => import('./Detail.vue'),
|
||||
title: "详情",
|
||||
dataId: row.id,
|
||||
pageOptions: {
|
||||
ApiUrl: this.DetailUrl,
|
||||
ApiData: this.DetailUrlData,
|
||||
FieldName: "truck",
|
||||
title: "详情",
|
||||
},
|
||||
callback: ({success}) => {
|
||||
success && this.initListData(); // 如果成功,初始化列表数据
|
||||
}
|
||||
})
|
||||
},
|
||||
// 刷新数据,父组件调用
|
||||
refresh() {
|
||||
this.initListData();
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.ant-btn {
|
||||
margin-right: 10px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -172,7 +172,7 @@ export default {
|
|||
// 表格列配置
|
||||
columns: [
|
||||
{ type: 'checkbox', width: 50 }, // 多选框
|
||||
{ type: 'seq', width: 30 }, // 序号
|
||||
{ type: 'seq', width: 50 }, // 序号
|
||||
|
||||
|
||||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ export default {
|
|||
outsourcing_truck_number: "",
|
||||
outsourcing_driver_name: "",
|
||||
outsourcing_driver_phone: "",
|
||||
is_need_outbound: 0,
|
||||
is_need_outbound: 1,
|
||||
truck_name: "",
|
||||
truck_id: 0,
|
||||
driver_name:'',
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ const CustomRouterMap = {
|
|||
icon: 'idcard',
|
||||
path: '/Custom/BalanceLogList',
|
||||
meta: {
|
||||
invisible: false, // 不在菜单中显示
|
||||
invisible: true, // 不在菜单中显示
|
||||
},
|
||||
component: () => import('@/pages/Middle/transport/Custom/BalanceLog/List'),
|
||||
authority: {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ const DriverWagesRouterMap = {
|
|||
meta: {
|
||||
invisible: false, // 不在菜单中显示
|
||||
},
|
||||
component: () => import('@/pages/Middle/transport/DriverWages/DriverWagesSurplus/List'),
|
||||
component: () => import('@/pages/Middle/transport/DriverWages/DriverWages/List'),
|
||||
authority: {
|
||||
permission: ["DriverWages", "DriverWages-All", "Driver-Wages-List"],
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue