This commit is contained in:
2025-09-20 18:03:22 +08:00
parent d857eca39f
commit d343a1389a
35 changed files with 330 additions and 141 deletions

View File

@@ -1 +1 @@
{"version":3,"file":"constants.js","sources":["common/constants.js"],"sourcesContent":["// 统一常量配置:其他收入/支出分类,禁止在业务中硬编码\r\nexport const INCOME_CATEGORIES = [\r\n\t{ key: 'sale_income', label: '销售收入' },\r\n\t{ key: 'operation_income', label: '经营所得' },\r\n\t{ key: 'interest_income', label: '利息收入' },\r\n\t{ key: 'investment_income', label: '投资收入' },\r\n\t{ key: 'other_income', label: '其它收入' }\r\n]\r\n\r\nexport const EXPENSE_CATEGORIES = [\r\n\t{ key: 'operation_expense', label: '经营支出' },\r\n\t{ key: 'office_supplies', label: '办公用品' },\r\n\t{ key: 'rent', label: '房租' },\r\n\t{ key: 'interest_expense', label: '利息支出' },\r\n\t{ key: 'other_expense', label: '其它支出' }\r\n]\r\n\r\n\r\n\r\n"],"names":[],"mappings":";AACY,MAAC,oBAAoB;AAAA,EAChC,EAAE,KAAK,eAAe,OAAO,OAAQ;AAAA,EACrC,EAAE,KAAK,oBAAoB,OAAO,OAAQ;AAAA,EAC1C,EAAE,KAAK,mBAAmB,OAAO,OAAQ;AAAA,EACzC,EAAE,KAAK,qBAAqB,OAAO,OAAQ;AAAA,EAC3C,EAAE,KAAK,gBAAgB,OAAO,OAAQ;AACvC;AAEY,MAAC,qBAAqB;AAAA,EACjC,EAAE,KAAK,qBAAqB,OAAO,OAAQ;AAAA,EAC3C,EAAE,KAAK,mBAAmB,OAAO,OAAQ;AAAA,EACzC,EAAE,KAAK,QAAQ,OAAO,KAAM;AAAA,EAC5B,EAAE,KAAK,oBAAoB,OAAO,OAAQ;AAAA,EAC1C,EAAE,KAAK,iBAAiB,OAAO,OAAQ;AACxC;;;"}
{"version":3,"file":"constants.js","sources":["common/constants.js"],"sourcesContent":["// 统一常量配置:其他收入/支出分类,禁止在业务中硬编码\r\nexport const INCOME_CATEGORIES = [\r\n\t{ key: 'sale_income', label: '销售收入' },\r\n\t{ key: 'operation_income', label: '经营所得' },\r\n\t{ key: 'interest_income', label: '利息收入' },\r\n\t{ key: 'investment_income', label: '投资收入' },\r\n\t{ key: 'other_income', label: '其它收入' }\r\n]\r\n\r\nexport const EXPENSE_CATEGORIES = [\r\n\t{ key: 'operation_expense', label: '经营支出' },\r\n\t{ key: 'office_supplies', label: '办公用品' },\r\n\t{ key: 'rent', label: '房租' },\r\n\t{ key: 'interest_expense', label: '利息支出' },\r\n\t{ key: 'other_expense', label: '其它支出' }\r\n]\r\n\r\n// 路由常量(集中管理页面路径,避免在业务中硬编码)\r\nexport const ROUTES = {\r\n\thome: '/pages/index/index',\r\n\tproductList: '/pages/product/list',\r\n\tproductForm: '/pages/product/form',\r\n\tproductSelect: '/pages/product/select',\r\n\tproductSettings: '/pages/product/settings',\r\n\torderCreate: '/pages/order/create',\r\n\tdetail: '/pages/detail/index',\r\n\tmy: '/pages/my/index',\r\n\tmyAbout: '/pages/my/about',\r\n\treport: '/pages/report/index',\r\n\tcustomerSelect: '/pages/customer/select',\r\n\tsupplierSelect: '/pages/supplier/select',\r\n\taccountSelect: '/pages/account/select'\r\n}\r\n\r\n\r\n"],"names":[],"mappings":";AACY,MAAC,oBAAoB;AAAA,EAChC,EAAE,KAAK,eAAe,OAAO,OAAQ;AAAA,EACrC,EAAE,KAAK,oBAAoB,OAAO,OAAQ;AAAA,EAC1C,EAAE,KAAK,mBAAmB,OAAO,OAAQ;AAAA,EACzC,EAAE,KAAK,qBAAqB,OAAO,OAAQ;AAAA,EAC3C,EAAE,KAAK,gBAAgB,OAAO,OAAQ;AACvC;AAEY,MAAC,qBAAqB;AAAA,EACjC,EAAE,KAAK,qBAAqB,OAAO,OAAQ;AAAA,EAC3C,EAAE,KAAK,mBAAmB,OAAO,OAAQ;AAAA,EACzC,EAAE,KAAK,QAAQ,OAAO,KAAM;AAAA,EAC5B,EAAE,KAAK,oBAAoB,OAAO,OAAQ;AAAA,EAC1C,EAAE,KAAK,iBAAiB,OAAO,OAAQ;AACxC;AAGY,MAAC,SAAS;AAAA,EACrB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,gBAAgB;AAAA,EAChB,gBAAgB;AAAA,EAChB,eAAe;AAChB;;;;"}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -27,5 +27,43 @@
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
"tabBar": {
"color": "#8a7535",
"selectedColor": "#B4880F",
"backgroundColor": "#ffffff",
"borderStyle": "black",
"list": [
{
"pagePath": "pages/index/index",
"text": "首页",
"iconPath": "static/logo.png",
"selectedIconPath": "static/logo.png"
},
{
"pagePath": "pages/product/list",
"text": "货品",
"iconPath": "static/logo.png",
"selectedIconPath": "static/logo.png"
},
{
"pagePath": "pages/order/create",
"text": "开单",
"iconPath": "static/logo.png",
"selectedIconPath": "static/logo.png"
},
{
"pagePath": "pages/detail/index",
"text": "明细",
"iconPath": "static/logo.png",
"selectedIconPath": "static/logo.png"
},
{
"pagePath": "pages/my/index",
"text": "我的",
"iconPath": "static/logo.png",
"selectedIconPath": "static/logo.png"
}
]
},
"usingComponents": {}
}

View File

@@ -13,6 +13,22 @@ const EXPENSE_CATEGORIES = [
{ key: "interest_expense", label: "利息支出" },
{ key: "other_expense", label: "其它支出" }
];
const ROUTES = {
home: "/pages/index/index",
productList: "/pages/product/list",
productForm: "/pages/product/form",
productSelect: "/pages/product/select",
productSettings: "/pages/product/settings",
orderCreate: "/pages/order/create",
detail: "/pages/detail/index",
my: "/pages/my/index",
myAbout: "/pages/my/about",
report: "/pages/report/index",
customerSelect: "/pages/customer/select",
supplierSelect: "/pages/supplier/select",
accountSelect: "/pages/account/select"
};
exports.EXPENSE_CATEGORIES = EXPENSE_CATEGORIES;
exports.INCOME_CATEGORIES = INCOME_CATEGORIES;
exports.ROUTES = ROUTES;
//# sourceMappingURL=../../.sourcemap/mp-weixin/common/constants.js.map

View File

@@ -125,7 +125,7 @@ const _sfc_main = {
},
onCreate() {
if (this.biz === "sale") {
common_vendor.index.navigateTo({ url: "/pages/order/create" });
common_vendor.index.switchTab({ url: "/pages/order/create" });
return;
}
common_vendor.index.showToast({ title: "该类型创建页待实现", icon: "none" });

View File

@@ -1,6 +1,7 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_http = require("../../common/http.js");
const common_constants = require("../../common/constants.js");
const common_assets = require("../../common/assets.js");
const _sfc_main = {
data() {
@@ -60,11 +61,15 @@ const _sfc_main = {
},
onFeatureTap(item) {
if (item.key === "product") {
common_vendor.index.navigateTo({ url: "/pages/product/list" });
common_vendor.index.switchTab({ url: "/pages/product/list" });
return;
}
if (item.key === "sale") {
common_vendor.index.navigateTo({ url: "/pages/order/create?biz=sale&type=out" });
try {
common_vendor.index.setStorageSync("ORDER_DEFAULT_PARAMS", { biz: "sale", type: "out" });
} catch (e) {
}
common_vendor.index.switchTab({ url: "/pages/order/create" });
return;
}
if (item.key === "customer") {
@@ -80,41 +85,42 @@ const _sfc_main = {
return;
}
if (item.key === "purchase") {
common_vendor.index.navigateTo({ url: "/pages/order/create?biz=purchase&type=in" });
try {
common_vendor.index.setStorageSync("ORDER_DEFAULT_PARAMS", { biz: "purchase", type: "in" });
} catch (e) {
}
common_vendor.index.switchTab({ url: "/pages/order/create" });
return;
}
if (item.key === "report") {
common_vendor.index.navigateTo({ url: "/pages/report/index" });
common_vendor.index.navigateTo({ url: common_constants.ROUTES.report });
return;
}
if (item.key === "otherPay") {
common_vendor.index.navigateTo({ url: "/pages/order/create?biz=expense" });
try {
common_vendor.index.setStorageSync("ORDER_DEFAULT_PARAMS", { biz: "expense" });
} catch (e) {
}
common_vendor.index.switchTab({ url: "/pages/order/create" });
return;
}
common_vendor.index.showToast({ title: item.title + "(开发中)", icon: "none" });
},
goProduct() {
this.activeTab = "product";
common_vendor.index.navigateTo({ url: "/pages/product/list" });
common_vendor.index.switchTab({ url: "/pages/product/list" });
},
onCreateOrder() {
common_vendor.index.navigateTo({ url: "/pages/order/create" });
common_vendor.index.switchTab({ url: "/pages/order/create" });
},
goDetail() {
this.activeTab = "detail";
try {
common_vendor.index.__f__("log", "at pages/index/index.vue:199", "[index] goDetail → /pages/detail/index");
common_vendor.index.__f__("log", "at pages/index/index.vue:177", "[index] goDetail → /pages/detail/index");
} catch (e) {
}
common_vendor.index.navigateTo({ url: "/pages/detail/index" });
},
goReport() {
this.activeTab = "report";
common_vendor.index.navigateTo({ url: "/pages/report/index" });
common_vendor.index.switchTab({ url: "/pages/detail/index" });
},
goMe() {
this.activeTab = "me";
common_vendor.index.navigateTo({ url: "/pages/my/index" });
common_vendor.index.switchTab({ url: "/pages/my/index" });
},
onNoticeTap(n) {
common_vendor.index.showModal({
@@ -167,18 +173,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
g: item.key,
h: common_vendor.o(($event) => $options.onFeatureTap(item), item.key)
});
}),
l: $data.activeTab === "home" ? 1 : "",
m: common_vendor.o(($event) => $data.activeTab = "home"),
n: $data.activeTab === "product" ? 1 : "",
o: common_vendor.o((...args) => $options.goProduct && $options.goProduct(...args)),
p: common_vendor.o((...args) => $options.onCreateOrder && $options.onCreateOrder(...args)),
q: $data.activeTab === "detail" ? 1 : "",
r: common_vendor.o((...args) => $options.goDetail && $options.goDetail(...args)),
s: $data.activeTab === "report" ? 1 : "",
t: common_vendor.o((...args) => $options.goReport && $options.goReport(...args)),
v: $data.activeTab === "me" ? 1 : "",
w: common_vendor.o((...args) => $options.goMe && $options.goMe(...args))
})
});
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);

View File

@@ -1 +1 @@
<view class="home"><image class="home-bg" src="{{a}}" mode="aspectFill"></image><view class="hero"><view class="hero-top"><text class="brand">五金配件管家</text><view class="cta"><text class="cta-text">咨询</text></view></view><view class="kpi"><view class="kpi-item"><text class="kpi-label">今日销售额</text><text class="kpi-value">{{b}}</text></view><view class="kpi-item"><text class="kpi-label">本月销售额</text><text class="kpi-value">{{c}}</text></view><view class="kpi-item"><text class="kpi-label">本月利润</text><text class="kpi-value">{{d}}</text></view><view class="kpi-item"><text class="kpi-label">库存商品数量</text><text class="kpi-value">{{e}}</text></view></view></view><view class="notice"><view class="notice-left">广告</view><view wx:if="{{f}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">加载中...</view><view wx:elif="{{g}}" class="notice-swiper" style="display:flex;align-items:center;color:#dd524d">{{h}}</view><view wx:elif="{{i}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">暂无公告</view><swiper wx:else class="notice-swiper" circular autoplay interval="4000" duration="400" vertical><swiper-item wx:for="{{j}}" wx:for-item="n" wx:key="e"><view class="notice-item" bindtap="{{n.d}}"><text class="notice-text">{{n.a}}</text><text wx:if="{{n.b}}" class="notice-tag">{{n.c}}</text></view></swiper-item></swiper></view><view class="section-title"><text class="section-text">常用功能</text></view><view class="grid-wrap"><view class="grid"><view wx:for="{{k}}" wx:for-item="item" wx:key="g" class="grid-item" bindtap="{{item.h}}"><view class="icon icon-squircle"><image wx:if="{{item.a}}" src="{{item.b}}" class="icon-img" mode="aspectFit" binderror="{{item.c}}"></image><text wx:elif="{{item.d}}" class="icon-emoji">{{item.e}}</text><view wx:else class="icon-placeholder"></view></view><text class="grid-chip">{{item.f}}</text></view></view></view><view class="bottom-bar"><view class="{{['tab', l && 'active']}}" bindtap="{{m}}"><text>首页</text></view><view class="{{['tab', n && 'active']}}" bindtap="{{o}}"><text>货品</text></view><view class="tab primary" bindtap="{{p}}"><text>开单</text></view><view class="{{['tab', q && 'active']}}" bindtap="{{r}}"><text>明细</text></view><view class="{{['tab', s && 'active']}}" bindtap="{{t}}"><text>报表</text></view><view class="{{['tab', v && 'active']}}" bindtap="{{w}}"><text>我的</text></view></view></view>
<view class="home"><image class="home-bg" src="{{a}}" mode="aspectFill"></image><view class="hero"><view class="hero-top"><text class="brand">五金配件管家</text><view class="cta"><text class="cta-text">咨询</text></view></view><view class="kpi"><view class="kpi-item"><text class="kpi-label">今日销售额</text><text class="kpi-value">{{b}}</text></view><view class="kpi-item"><text class="kpi-label">本月销售额</text><text class="kpi-value">{{c}}</text></view><view class="kpi-item"><text class="kpi-label">本月利润</text><text class="kpi-value">{{d}}</text></view><view class="kpi-item"><text class="kpi-label">库存商品数量</text><text class="kpi-value">{{e}}</text></view></view></view><view class="notice"><view class="notice-left">广告</view><view wx:if="{{f}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">加载中...</view><view wx:elif="{{g}}" class="notice-swiper" style="display:flex;align-items:center;color:#dd524d">{{h}}</view><view wx:elif="{{i}}" class="notice-swiper" style="display:flex;align-items:center;color:#6b5a2a">暂无公告</view><swiper wx:else class="notice-swiper" circular autoplay interval="4000" duration="400" vertical><swiper-item wx:for="{{j}}" wx:for-item="n" wx:key="e"><view class="notice-item" bindtap="{{n.d}}"><text class="notice-text">{{n.a}}</text><text wx:if="{{n.b}}" class="notice-tag">{{n.c}}</text></view></swiper-item></swiper></view><view class="section-title"><text class="section-text">常用功能</text></view><view class="grid-wrap"><view class="grid"><view wx:for="{{k}}" wx:for-item="item" wx:key="g" class="grid-item" bindtap="{{item.h}}"><view class="icon icon-squircle"><image wx:if="{{item.a}}" src="{{item.b}}" class="icon-img" mode="aspectFit" binderror="{{item.c}}"></image><text wx:elif="{{item.d}}" class="icon-emoji">{{item.e}}</text><view wx:else class="icon-placeholder"></view></view><text class="grid-chip">{{item.f}}</text></view></view></view></view>

View File

@@ -43,7 +43,7 @@ const _sfc_main = {
common_vendor.index.showToast({ title: "VIP会员开发中", icon: "none" });
},
goMyOrders() {
common_vendor.index.navigateTo({ url: "/pages/detail/index" });
common_vendor.index.switchTab({ url: "/pages/detail/index" });
},
goSupplier() {
common_vendor.index.navigateTo({ url: "/pages/supplier/select" });

View File

@@ -70,8 +70,9 @@ const _sfc_main = {
},
onLoad(query) {
try {
const biz = query && query.biz;
const type = query && query.type;
const preset = common_vendor.index.getStorageSync("ORDER_DEFAULT_PARAMS") || {};
const biz = query && query.biz || preset.biz;
const type = query && query.type || preset.type;
if (biz === "sale" || biz === "purchase" || biz === "income" || biz === "expense") {
this.biz = biz;
}
@@ -81,6 +82,10 @@ const _sfc_main = {
if (this.biz === "purchase" && (type === "in" || type === "return" || type === "pay")) {
this.purchaseType = type;
}
try {
common_vendor.index.removeStorageSync("ORDER_DEFAULT_PARAMS");
} catch (_) {
}
} catch (e) {
}
this.fetchCategories();

View File

@@ -1,25 +0,0 @@
"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = {
methods: {
go(mode, dim) {
const q = `mode=${encodeURIComponent(mode)}&dim=${encodeURIComponent(dim || "")}`;
common_vendor.index.navigateTo({ url: `/pages/report/index?${q}` });
}
}
};
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
return {
a: common_vendor.o(($event) => $options.go("sale", "customer")),
b: common_vendor.o(($event) => $options.go("sale", "product")),
c: common_vendor.o(($event) => $options.go("sale", "customer")),
d: common_vendor.o(($event) => $options.go("sale", "customer")),
e: common_vendor.o(($event) => $options.go("purchase", "supplier")),
f: common_vendor.o(($event) => $options.go("inventory", "qty")),
g: common_vendor.o(($event) => $options.go("arap", "ar")),
h: common_vendor.o(($event) => $options.go("arap", "ap"))
};
}
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createPage(MiniProgramPage);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/report/entry.js.map

View File

@@ -1,4 +0,0 @@
{
"navigationBarTitleText": "报表",
"usingComponents": {}
}

View File

@@ -1 +0,0 @@
<view class="entry"><view class="section"><view class="section-title">资金报表</view><view class="grid"><view class="btn" bindtap="{{a}}">利润统计</view><view class="btn" bindtap="{{b}}">营业员统计</view><view class="btn" bindtap="{{c}}">经营业绩</view></view></view><view class="section"><view class="section-title">进销存报表</view><view class="grid"><view class="btn" bindtap="{{d}}">销售统计</view><view class="btn" bindtap="{{e}}">进货统计</view><view class="btn" bindtap="{{f}}">库存统计</view><view class="btn" bindtap="{{g}}">应收对账单</view><view class="btn" bindtap="{{h}}">应付对账单</view></view></view></view>

View File

@@ -1,13 +0,0 @@
.entry { padding: 20rpx;
}
.section { margin-bottom: 24rpx;
}
.section-title { background:#f1f4f8; color:#6a7a8a; padding: 14rpx 16rpx; border-radius: 12rpx; font-weight: 700;
}
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18rpx; padding: 18rpx 6rpx 0;
}
.btn { text-align: center; padding: 18rpx 8rpx; border: 1rpx solid #e5e9ef; border-radius: 12rpx; color:#333; background: #fff;
}
.btn:active { background: #f6f8fa;
}

View File

@@ -0,0 +1,4 @@
{
"navigationBarTitleText": "五金配件管家",
"usingComponents": {}
}

View File

@@ -0,0 +1 @@
<view class="shell"><keep-alive><component is="{{a}}" switch-tab="{{b}}"/></keep-alive><bottom-nav wx:if="{{d}}" bindchange="{{c}}" u-i="26537006-0" bind:__l="__l" u-p="{{d}}"/></view>

View File

@@ -0,0 +1,5 @@
{
"setting": {
"urlCheck": false
}
}