diff --git a/src/main.js b/src/main.js
index 62650a5..3dfbba7 100644
--- a/src/main.js
+++ b/src/main.js
@@ -16,5 +16,5 @@ createApp(App)
.use(ElementPlus, { locale: zhCn, zIndex: 3000, size: 'default' })
.mount('#app')
-document.title = 'ERP-管理系统';
+document.title = '妙选ERP';
document.execCommand("BackgroundImageCache", false, true);
diff --git a/src/views/commodity/combination.vue b/src/views/commodity/combination.vue
index 2e1df25..86e525a 100644
--- a/src/views/commodity/combination.vue
+++ b/src/views/commodity/combination.vue
@@ -105,12 +105,12 @@
-
+
-
+
删除
@@ -252,6 +252,7 @@ export default {
function handleSkuDelete(index) {
data.goodsSkus.splice(index, 1)
+ computeCost()
}
function toAddSku() {
@@ -265,6 +266,10 @@ export default {
function getSkusList() {
get(`/api/all/goods-skus`).then((res) => {
data.skusList = res.data
+ data.skuObj = {}
+ res.data.forEach(item => {
+ data.skuObj[item.id] = item
+ })
})
}
@@ -280,6 +285,20 @@ export default {
})
}
+ function computeCost() {
+ let val = 0
+ data.goodsSkus.forEach(item => {
+ if(item.sku_id) {
+ let goods_cost = data.skuObj[item.sku_id].goods_cost || 0
+ let other_cost = data.skuObj[item.sku_id].other_cost || 0
+ let cost_factor = data.skuObj[item.sku_id].cost_factor || 0
+ let cost = (goods_cost * 100 + other_cost * 100) * cost_factor
+ val += cost * item.num
+ }
+ })
+ data.itemInfo.goods_cost = (val / 100).toFixed(2)
+ }
+
onMounted(() => {
fetchData()
getSkusList()
@@ -297,8 +316,8 @@ export default {
handleSkuDelete,
toAddSku,
getSkusList,
- handleUpload
-
+ handleUpload,
+ computeCost
}
}
}
diff --git a/src/views/commodity/list.vue b/src/views/commodity/list.vue
index 66548eb..ff7a1a8 100644
--- a/src/views/commodity/list.vue
+++ b/src/views/commodity/list.vue
@@ -159,14 +159,24 @@
-
+
有运费
无运费
后补
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -317,7 +327,7 @@ export default {
let item = data.skusList[index]
item.freight_cost = item.freight_cost || 0
if(!item.goods_cost || item.goods_cost * 1 == 0) {
- return ElMessage({ type: 'info', message: '商品成本必填' })
+ // return ElMessage({ type: 'info', message: '商品成本必填' })
}
}
data.opa_loading = true
@@ -395,8 +405,10 @@ export default {
sort: 0,
gift: 0,
goods_cost: '',
+ other_cost: '',
freight_cost: '',
- freight_type: 1
+ freight_type: 1,
+ cost_factor: ''
}
data.skusList.push(sku)
}
diff --git a/src/views/commodity/sku.vue b/src/views/commodity/sku.vue
index 4a9f2e5..8e8ffc1 100644
--- a/src/views/commodity/sku.vue
+++ b/src/views/commodity/sku.vue
@@ -95,7 +95,7 @@
-
+
@@ -195,9 +195,19 @@
后补
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -363,7 +373,8 @@ export default {
status: 1,
sort: 0,
gift: 0,
- freight_type: 1
+ freight_type: 1,
+ cost_factor: ''
}
data.showDialog = true
}
diff --git a/src/views/statistics/index.vue b/src/views/statistics/index.vue
index c864b11..8a44aea 100644
--- a/src/views/statistics/index.vue
+++ b/src/views/statistics/index.vue
@@ -148,6 +148,9 @@
+
+
+