diff --git a/src/views/inventory/goods.vue b/src/views/inventory/goods.vue index aacfb1f..b6dc23d 100644 --- a/src/views/inventory/goods.vue +++ b/src/views/inventory/goods.vue @@ -7,8 +7,9 @@ - + - + @@ -119,28 +120,36 @@ - + - + - - - - - + + + + + + + + + + + @@ -149,26 +158,24 @@ - - - - - - - - + - - - + +
+
+
总成本:{{statisticsData.totalCost}}
+
总售价:{{statisticsData.totalPrice}}
+
医保药品:{{statisticsData.totalSocialCount}}个
+
+ {{item.name}}:{{item.ratio}}({{item.count}}) +
+
({}) const inventoryNumber = ref(false) const status = ref(false) const profitCategory = [ @@ -243,7 +250,7 @@ const getTypeName = (type: number) => { return typeList[typeStr as keyof typeof typeList] || "未知类型"; } const searchModel = ref({ - name: "", + keyword: "", cateId: [], minInterestRate: "", maxInterestRate: "", @@ -255,7 +262,7 @@ const searchGoods = () => { pageSize: 20, pageNum: 1, cateId: cateArray == null ? null : cateArray[1], - name: searchModel.value.name, + keyword: searchModel.value.keyword, minInterestRate: parseFloat(searchModel.value.minInterestRate) || null, // 转换为数字并处理空值 maxInterestRate: parseFloat(searchModel.value.maxInterestRate) || null, // 转换为数字并处理空值 interestRateIntervalList: [] as { min: number; max: number }[], // 显式声明类型 @@ -304,6 +311,7 @@ let init = () => { total.value = res.total_count }) getAllCate() + getStatisticsData() } let open_edit = (type: number, id: number) => { @@ -397,7 +405,7 @@ const changeTab = (name: string) => { const activeName = ref('first') const resetSearch = () => { searchModel.value = { - name: "", + keyword: "", cateId: [], minInterestRate: "", maxInterestRate: "", @@ -405,6 +413,14 @@ const resetSearch = () => { } init() } +/** + * 获取商品统计数据 总成本 总售价 甲乙丙类 + */ +const getStatisticsData = () => { + post("statistics/goodsStatistics").then((res: any) => { + statisticsData.value = res + }) +}