Compare commits
2 Commits
008a267cb1
...
cf0fd156b1
| Author | SHA1 | Date |
|---|---|---|
|
|
cf0fd156b1 | |
|
|
ee075ea7f8 |
|
|
@ -0,0 +1,293 @@
|
|||
<template>
|
||||
<div class="detail">
|
||||
|
||||
<!-- <div class="header">-->
|
||||
<!-- <h1>详情</h1>-->
|
||||
<!-- </div>-->
|
||||
<a-descriptions size="small" :title="pageOptions.title" bordered>
|
||||
<a-descriptions-item label="编码">
|
||||
{{ data.code }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="名称">
|
||||
{{ data.name }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="类型">
|
||||
{{ data.type }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="行业">
|
||||
{{ data.industry }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="联系人">
|
||||
{{ data.contact }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="联系人电话">
|
||||
{{ data.contact_phone }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="总计交易吨数">
|
||||
{{ data.total_ton }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="总计交易次数">
|
||||
{{ data.total_count }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="最后交易时间">
|
||||
{{ data.last_time }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="总结余">
|
||||
{{ data.total_balance }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="总交易金额">
|
||||
{{ data.total_amount }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="状态">
|
||||
{{ data.status | formatStatus }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="创建时间">
|
||||
{{ data.create_time | formatDate }}
|
||||
</a-descriptions-item>
|
||||
<a-descriptions-item label="备注">
|
||||
{{ data.remark }}
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
<div class="amount">
|
||||
<h3>
|
||||
修改结余
|
||||
</h3>
|
||||
<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="primary"> 减少结余</a-button>
|
||||
</a-popconfirm>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import BASE_URL from '@/services/Middle/transport/Custom/api.js';
|
||||
// import ZkTable from "@/components/zk/zkTable.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
// ZkTable
|
||||
},
|
||||
props: {
|
||||
dataId: {
|
||||
},
|
||||
pageOptions: {
|
||||
type: Object
|
||||
},
|
||||
ApiUrl: {
|
||||
type: String
|
||||
},
|
||||
ApiData: {
|
||||
type: Object
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
BalanceAdd: `${BASE_URL.BASE_URL}/Custom/v1/balance/add`, // 增加客户结余
|
||||
BalanceReduce: `${BASE_URL.BASE_URL}/Custom/v1/balance/reduce`, // 减少客户结余
|
||||
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 <= 0) {
|
||||
this.$mk.error("请输入正确的金额");
|
||||
return
|
||||
}
|
||||
// 调用增加结余接口
|
||||
this.$zk.post({
|
||||
url: this.BalanceAdd,
|
||||
data: {
|
||||
id: this.pageOptions.ApiData.id,
|
||||
amount: 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() // 刷新
|
||||
}).catch((a) => {
|
||||
this.$mk.error(a.msg, "aaa");
|
||||
});
|
||||
},
|
||||
reduceBalanceApi() {
|
||||
// 转换 this.amount 为数字
|
||||
this.amount = Number(this.amount);
|
||||
if (this.amount <= 0) {
|
||||
this.$mk.error("请输入正确的金额");
|
||||
return
|
||||
}
|
||||
// 调用减少结余接口
|
||||
this.$zk.post({
|
||||
url: this.BalanceReduce,
|
||||
data: {
|
||||
|
||||
id: this.pageOptions.ApiData.id,
|
||||
amount: 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() // 刷新
|
||||
|
||||
}).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: 10px;
|
||||
|
||||
li {
|
||||
margin-top: 10px;
|
||||
list-style: none;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
|
@ -39,6 +39,9 @@
|
|||
|
||||
<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>
|
||||
|
|
@ -76,6 +79,7 @@ export default {
|
|||
keyName: 'id', // 主键字段名
|
||||
|
||||
|
||||
|
||||
// 接口动作
|
||||
actions: { // Api 接口地址
|
||||
// =============================== 接口地址 自动生成 Start ===============================
|
||||
|
|
@ -91,8 +95,6 @@ export default {
|
|||
CustomBatchHandle: `${BASE_URL.BASE_URL}/Custom/v1/custom/batchHandle`, // 批量处理客户
|
||||
CustomOpen: `${BASE_URL.BASE_URL}/Custom/v1/custom/open`, // 打开客户
|
||||
CustomClose: `${BASE_URL.BASE_URL}/Custom/v1/custom/close`, // 关闭客户
|
||||
BalanceAdd: `${BASE_URL.BASE_URL}/Custom/v1/balance/add`, // 增加客户结余
|
||||
BalanceReduce: `${BASE_URL.BASE_URL}/Custom/v1/balance/reduce`, // 减少客户结余
|
||||
|
||||
// =============================== 接口地址 自动生成 End ===============================
|
||||
},
|
||||
|
|
@ -179,6 +181,7 @@ export default {
|
|||
{field: 'type', sortable: true, title: '类型',formatter: this.formatType, width: 150}, // 客户类型
|
||||
{field: 'industry', sortable: true, title: '行业', width: 150}, // 客户行业
|
||||
{field: 'contact', title: '联系人', width: 150}, // 客户联系人
|
||||
{field: 'total_balance', sortable: true, title: '总结余', width: 150}, // 总结余
|
||||
{field: 'contact_phone', sortable: true, title: '联系人电话', width: 150}, // 客户联系人电话
|
||||
{field: 'total_ton', sortable: true, title: '总计交易吨数', width: 150}, // 总计交易吨数
|
||||
{field: 'total_count', sortable: true, title: '总计交易次数', width: 150}, // 总计交易次数
|
||||
|
|
@ -191,7 +194,6 @@ export default {
|
|||
title: '创建时间',
|
||||
showHeaderOverflow: true
|
||||
}, // 创建时间
|
||||
{field: 'total_balance', sortable: true, title: '总结余', width: 150}, // 总结余
|
||||
{field: 'total_amount', sortable: true, title: '总交易金额', width: 150}, // 总交易金额
|
||||
{field: 'remark', sortable: true, title: '备注', width: 250}, // 备注
|
||||
{
|
||||
|
|
@ -207,7 +209,7 @@ export default {
|
|||
// =============================== 表格列 自动生成 Start ===============================
|
||||
|
||||
|
||||
{title: '操作', slots: {default: 'op'}, width: 120,fixed: 'right'}
|
||||
{title: '操作', slots: {default: 'op'}, width: 160,fixed: 'right'}
|
||||
]
|
||||
}
|
||||
|
||||
|
|
@ -373,7 +375,34 @@ export default {
|
|||
onSearch() {
|
||||
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.CustomDetail,
|
||||
ApiData: {
|
||||
id: row.id
|
||||
},
|
||||
FieldName: "custom",
|
||||
title: "详情",
|
||||
},
|
||||
callback: ({success}) => {
|
||||
console.log("success",success);
|
||||
|
||||
this.$forceUpdate() // 刷新
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
// 监听属性
|
||||
|
|
|
|||
|
|
@ -274,7 +274,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/DriverWages/DriverWagesAdd"
|
||||
closeRoute: "/DriverWages/DriverWagesCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -314,6 +314,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -226,7 +226,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/DriverWages/DriverWagesGiornaleLogAdd"
|
||||
closeRoute: "/DriverWages/DriverWagesGiornaleLogCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -266,6 +266,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/DriverWages/DriverWagesSurplusAdd"
|
||||
closeRoute: "/DriverWages/DriverWagesSurplusCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -271,6 +271,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/Maintenance/MaintenanceAdd"
|
||||
closeRoute: "/Maintenance/MaintenanceCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -249,6 +249,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/Maintenance/MaintenanceGiornaleLogAdd"
|
||||
closeRoute: "/Maintenance/MaintenanceGiornaleLogCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -347,6 +347,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -270,7 +270,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/Maintenance/OtherExpensesLogAdd"
|
||||
closeRoute: "/Maintenance/OtherExpensesLogCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -314,6 +314,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/SoilQualityMaterial/SoilQualityMaterialAliasAdd"
|
||||
closeRoute: "/SoilQualityMaterial/SoilQualityMaterialAliasCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -264,6 +264,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -284,7 +284,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/Tire/TireAdd"
|
||||
closeRoute: "/Tire/TireCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -330,6 +330,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -640,7 +640,7 @@ export default {
|
|||
// 如果是新增模式,关闭当前页面
|
||||
if (!this.isEdit) {
|
||||
this.$closePage({
|
||||
closeRoute: "/TrainNumber/TrainNumberAdd"
|
||||
closeRoute: "/TrainNumber/TrainNumberCreate"
|
||||
});
|
||||
} else {
|
||||
// 如果是编辑模式,关闭当前页面
|
||||
|
|
@ -735,6 +735,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div class="page-body">
|
||||
|
||||
<div class="page-header">
|
||||
<!-- <div class="page-header">
|
||||
<a-descriptions title="User Info">
|
||||
<a-descriptions-item label="UserName">
|
||||
Zhou Maomao
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
No. 18, Wantang Road, Xihu District, Hangzhou, Zhejiang, China
|
||||
</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<vxe-form :data="formOptions.data" ref="xForm" :title-width="formOptions.titleWidth"
|
||||
:title-align="formOptions.titleAlign" :rules="formOptions.rules" :items="formOptions.items" titleColon>
|
||||
|
|
@ -324,6 +324,7 @@ export default {
|
|||
this.$mk.success("保存成功");
|
||||
if (!this.isEdit) { // 如果是新增模式,关闭当前页面
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}).catch((a) => { // 失败回调
|
||||
this.$mk.error(a.data.msg); // 显示错误信息
|
||||
|
|
|
|||
|
|
@ -215,6 +215,7 @@ export default {
|
|||
});
|
||||
} else {
|
||||
this.back();
|
||||
this.$forceUpdate()
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue