Compare commits

...

2 Commits

Author SHA1 Message Date
zxx cf0fd156b1 Merge branch 'main' of https://git.positivepole.cn/Mes/middle-admin-ant
# Conflicts:
#	src/pages/Middle/Mes/MesStaff/MesStaff/Edit.vue
2024-03-26 16:56:46 +08:00
zxx ee075ea7f8 更新 2024-03-26 16:55:37 +08:00
14 changed files with 350 additions and 16 deletions

View File

@ -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>

View File

@ -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() //
}
})
}
},
//

View File

@ -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); //

View File

@ -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); //

View File

@ -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); //

View File

@ -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); //

View File

@ -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); //

View File

@ -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); //

View File

@ -317,6 +317,7 @@ export default {
this.$mk.success("保存成功");
if (!this.isEdit) { //
this.back();
this.$forceUpdate()
}
}).catch((a) => { //
this.$mk.error(a.data.msg); //

View File

@ -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); //

View File

@ -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); //

View File

@ -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); //

View File

@ -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); //

View File

@ -215,6 +215,7 @@ export default {
});
} else {
this.back();
this.$forceUpdate()
}
}