feat(admin): full repair of order module including list, statistics, aftersales, cashier, and write-off records with real RPC integration

This commit is contained in:
comlibmb
2026-02-10 23:01:23 +08:00
parent 1d9915cd77
commit cd7b92d496
12 changed files with 397 additions and 138 deletions

View File

@@ -249,23 +249,24 @@
</template>
<script setup lang="uts">
import { ref, reactive } from 'vue'
import { ref, reactive, onMounted } from 'vue'
import { getOrderSettings, saveOrderSettings } from '@/services/orderService.uts'
const tabs = ['包邮设置', '发票功能配置', '售后退款配置', '订单取消配置', '自动收货配置', '自动评价配置', '到店自提配置', '警戒库存配置']
const currentTab = ref(0)
const config = reactive({
// 1. 包邮设置
freeShippingPrice: 1000000,
freeShippingPrice: 0,
offlineFreeShipping: false,
// 2. 发票功能配置
invoiceEnabled: true,
specialInvoiceEnabled: true,
invoiceEnabled: false,
specialInvoiceEnabled: false,
// 3. 售后退款配置
refundContactName: '',
refundContactPhone: '',
refundAddress: '',
refundReasons: '收货地址填错了\n与描述不符\n信息填错了重新拍\n收到商品损坏了\n未按预定时间发货\n其它原因',
refundReasons: '',
refundCoupon: true,
afterSalesDays: 0,
// 4. 订单取消配置
@@ -278,19 +279,48 @@ const config = reactive({
autoReceiveDays: 7,
// 6. 自动评价配置
autoCommentDays: 0,
autoCommentText: '此用户未做评价',
autoCommentText: '',
// 7. 到店自提配置
storeSelfPickup: true,
storeSelfPickup: false,
// 8. 警戒库存配置
stockWarningCount: 10
})
const handleSave = () => {
const loadSettings = async () => {
try {
const data = await getOrderSettings()
if (data != null) {
const remoteConfig = data as UTSJSONObject
// 逐项对齐,避免结构丢失
Object.keys(config).forEach(key => {
if (remoteConfig[key] !== undefined) {
(config as any)[key] = remoteConfig[key]
}
})
}
} catch (e) {
uni.showToast({ title: '加载配置失败', icon: 'none' })
}
}
onMounted(() => {
loadSettings()
})
const handleSave = async () => {
uni.showLoading({ title: '保存中...' })
setTimeout(() => {
try {
const ok = await saveOrderSettings(config as UTSJSONObject)
uni.hideLoading()
uni.showToast({ title: '保存成功', icon: 'success' })
}, 500)
if (ok) {
uni.showToast({ title: '保存成功', icon: 'success' })
} else {
uni.showToast({ title: '保存失败', icon: 'none' })
}
} catch (e) {
uni.hideLoading()
uni.showToast({ title: '保存出错', icon: 'none' })
}
}
</script>