From be84838fd3e7e58ed1db0412cbd51a9f6ba332f8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 12 二月 2026 16:36:48 +0800
Subject: [PATCH] 进销存升级app: 1.确认消息后,页面展示乱码 2.消息通知页面样式修改与优化 3.新增客户拜访后,点击签到页面无响应
---
src/pages/sales/salesAccount/index.vue | 104 +++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 95 insertions(+), 9 deletions(-)
diff --git a/src/pages/sales/salesAccount/index.vue b/src/pages/sales/salesAccount/index.vue
index 8e3fdf6..b5b378a 100644
--- a/src/pages/sales/salesAccount/index.vue
+++ b/src/pages/sales/salesAccount/index.vue
@@ -26,8 +26,7 @@
v-if="ledgerList.length > 0">
<view v-for="(item, index) in ledgerList"
:key="index">
- <view class="ledger-item"
- @click="handleInfo('edit', item)">
+ <view class="ledger-item">
<view class="item-header">
<view class="item-left">
<view class="document-icon">
@@ -79,12 +78,28 @@
</view>
</view>
<up-divider></up-divider>
- <u-button class="detail-button"
- size="small"
- type="primary"
- @click="openOut(item)">
- 鍙戣揣鐘舵��
- </u-button>
+ <view class="detail-buttons">
+ <u-button class="detail-button"
+ size="small"
+ type="primary"
+ @click.stop="handleInfo('edit', item)">
+ 缂栬緫
+ </u-button>
+ <u-button class="detail-button"
+ size="small"
+ type="primary"
+ plain
+ @click.stop="openOut(item)">
+ 鍙戣揣鐘舵��
+ </u-button>
+ <u-button class="detail-button"
+ size="small"
+ type="error"
+ plain
+ @click.stop="handleDelete(item)">
+ 鍒犻櫎
+ </u-button>
+ </view>
</view>
</view>
</view>
@@ -106,7 +121,11 @@
<script setup>
import { ref } from "vue";
import { onShow } from "@dcloudio/uni-app";
- import { ledgerListPage } from "@/api/salesManagement/salesLedger";
+ import {
+ ledgerListPage,
+ delLedger,
+ productList,
+ } from "@/api/salesManagement/salesLedger";
import useUserStore from "@/store/modules/user";
import PageHeader from "@/components/PageHeader.vue";
const userStore = useUserStore();
@@ -125,6 +144,18 @@
// 閿�鍞彴璐︽暟鎹�
const ledgerList = ref([]);
+
+ // 鍒ゆ柇鏄惁瀛樺湪宸插彂璐�/鍙戣揣瀹屾垚鐨勪骇鍝�
+ const hasShippedProducts = products => {
+ if (!products || products.length === 0) return false;
+ return products.some(p => {
+ const statusStr = (p.shippingStatus ?? "").toString();
+ // 鍖呭惈鈥滃彂璐р�濇垨鏈夊彂璐ф棩鏈�/杞︾墝鍙疯涓哄凡鍙戣揣
+ return (
+ statusStr.includes("鍙戣揣") || !!p.shippingDate || !!p.shippingCarNumber
+ );
+ });
+ };
// 杩斿洖涓婁竴椤�
const goBack = () => {
@@ -153,11 +184,61 @@
url: "/pages/sales/salesAccount/out",
});
};
+
+ // 鍒犻櫎鍗曟潯閿�鍞彴璐�
+ const handleDelete = async row => {
+ if (!row || !row.id) return;
+
+ // 鑾峰彇浜у搧鍒楄〃锛岀敤浜庡垽鏂槸鍚﹀凡鍙戣揣
+ let products = row.children && row.children.length > 0 ? row.children : null;
+ if (!products) {
+ try {
+ const res = await productList({ salesLedgerId: row.id, type: 1 });
+ products = res.data || res.records || [];
+ } catch (e) {
+ products = [];
+ }
+ }
+
+ if (hasShippedProducts(products)) {
+ uni.showToast({
+ title: "宸插彂璐�/鍙戣揣瀹屾垚鐨勯攢鍞鍗曚笉鑳藉垹闄�",
+ icon: "none",
+ });
+ return;
+ }
+
+ uni.showModal({
+ title: "鍒犻櫎纭",
+ content: "閫変腑鐨勫唴瀹瑰皢琚垹闄わ紝鏄惁纭鍒犻櫎锛�",
+ success: async res => {
+ if (res.confirm) {
+ try {
+ showLoadingToast("澶勭悊涓�...");
+ await delLedger([row.id]);
+ closeToast();
+ uni.showToast({
+ title: "鍒犻櫎鎴愬姛",
+ icon: "success",
+ });
+ getList();
+ } catch (e) {
+ closeToast();
+ uni.showToast({
+ title: "鍒犻櫎澶辫触锛岃閲嶈瘯",
+ icon: "none",
+ });
+ }
+ }
+ },
+ });
+ };
// 澶勭悊鍙拌处淇℃伅鎿嶄綔锛堟煡鐪�/缂栬緫/鏂板锛�
const handleInfo = (type, row) => {
try {
// 璁剧疆鎿嶄綔绫诲瀷
uni.setStorageSync("operationType", type);
+ uni.removeStorageSync("editData");
// 濡傛灉鏄煡鐪嬫垨缂栬緫鎿嶄綔
if (type !== "add") {
@@ -209,4 +290,9 @@
<style scoped lang="scss">
@import "@/styles/sales-common.scss";
+ .detail-buttons {
+ display: flex;
+ gap: 10px;
+ justify-content: space-between;
+ }
</style>
--
Gitblit v1.9.3