Commit 7dfa10a7 by liangjianmin

fix(approve): update API endpoints and field mappings for approval workflow

- Change approval status parameter from `approve_status` to `approval_status`
- Update API endpoint from `updateFeeApproveStatus` to `approve`
- Replace request parameters `id` and `status` with `bill_id` and `approval_status`
- Fix detail page timestamp field from `create_time_cn` to `create_time`
- Update list item key binding from `item.id` to `item.approve_id`
- Update navigation parameter from `item.id` to `item.approve_id`
- Add error handling with user feedback for failed approval requests
- Improve error messaging to display API response message on failure
parent c25faab0
......@@ -6,7 +6,7 @@
<u-cell title="申请类型" value="费用减免申请"></u-cell>
<u-cell title="客户名称" :value="detail.customer_name"></u-cell>
<u-cell title="减免明细" :value="detail.relief_detail"></u-cell>
<u-cell title="申请时间" :value="detail.create_time_cn"></u-cell>
<u-cell title="申请时间" :value="detail.create_time"></u-cell>
<u-cell title="订单号" :value="detail.order_sn" :value-style="{ flex: 1 }" :border="false">
<template #value>
<view class="row verCenter bothSide" style="flex: 1;">
......@@ -195,13 +195,13 @@
}
this.submitting = true;
var params = {
id: this.id,
status: this.modalStatus
bill_id: this.id,
approval_status: this.modalStatus
};
if (this.remark.trim()) {
params.remark = this.remark.trim();
}
this.request(API.updateFeeApproveStatus, 'POST', params).then(res => {
this.request(API.approve, 'POST', params).then(res => {
this.submitting = false;
if (res.code === 0) {
uni.showToast({ title: '操作成功', icon: 'success' });
......@@ -209,9 +209,12 @@
setTimeout(() => {
uni.navigateBack();
}, 1500);
}else{
uni.showToast({
title: res.msg || '操作失败',
icon: 'none'
});
}
}).catch(() => {
this.submitting = false;
});
}
}
......
......@@ -18,7 +18,7 @@
<!-- 列表内容 -->
<template v-else>
<view class="approve-card" v-for="item in currentList" :key="item.id">
<view class="approve-card" v-for="item in currentList" :key="item.approve_id">
<view class="card-title">费用减免申请</view>
<view class="card-body">
<view class="card-row row">
......@@ -127,7 +127,7 @@
var page = this.currentTab === 0 ? this.pendingPage : this.donePage;
var statusVal = this.currentTab === 0 ? '0,1' : '2';
var params = {
approve_status: statusVal,
approval_status: statusVal,
page,
limit: this.limit
};
......@@ -202,9 +202,9 @@
* @param {Object} item - 审批项
* @return {void}
*/
handleApprove(item) {
handleApprove(item) {
uni.navigateTo({
url: `/pages/approve/detail?id=${item.id}`
url: `/pages/approve/detail?id=${item.approve_id}`
});
}
}
......
......@@ -66,7 +66,7 @@ const API = {
/**
* 费用审批状态修改
*/
updateFeeApproveStatus: API_BASE + '/api/approve/updateFeeApproveStatus'
approve: API_BASE + '/api/approve/approve'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment