diff --git a/.env.development b/.env.development
index 0b88f07..17c96dd 100644
--- a/.env.development
+++ b/.env.development
@@ -8,9 +8,9 @@ VITE_OPEN = true
ENV = 'development'
# ADMIN 服务地址
-#VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上
+VITE_ADMIN_PROXY_PATH = http://123.156.230.15:8089/api/ # 线上
# VITE_ADMIN_PROXY_PATH = http://pjcloud.center.takin.cc/
-VITE_ADMIN_PROXY_PATH = http://localhost:9999/
+# VITE_ADMIN_PROXY_PATH = http://localhost:9999/
# VITE_ADMIN_PROXY_PATH = http://192.168.101.29:9999/ # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://192.168.101.37:9999/ # 邓-本地
# VITE_ADMIN_PROXY_PATH = http://59.202.170.152:81/api # 正式环境
@@ -18,7 +18,7 @@ VITE_ADMIN_PROXY_PATH = http://localhost:9999/
# 图片访问基础地址
VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc
-VITE_IMAGE_BASE_PATH = http://localhost:9999
+# VITE_IMAGE_BASE_PATH = http://localhost:9999
# VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://192.168.101.37:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api/ # 正式环境
diff --git a/src/views/supermarketerp/supermarketSpu/components/supermarketAuxiliaryCode/index.vue b/src/views/supermarketerp/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
index 86e134a..2e79906 100644
--- a/src/views/supermarketerp/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
+++ b/src/views/supermarketerp/supermarketSpu/components/supermarketAuxiliaryCode/index.vue
@@ -46,11 +46,15 @@
-
+
-
编辑
-
+
删除
@@ -78,12 +88,12 @@
diff --git a/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/form.vue b/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/form.vue
index 2d4a879..ed25a08 100644
--- a/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/form.vue
+++ b/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/form.vue
@@ -104,9 +104,10 @@ const dataRules = ref({
unit: [{ required: true, message: "单位不能为空", trigger: "blur" }],
status: [{ required: true, message: "状态不能为空", trigger: "blur" }],
packageNum: [{ required: true, message: "内装数不能为空", trigger: "blur" }],
- // purchasePrice: [{ required: true, message: '进价不能为空', trigger: 'blur' }],
retailPrice: [{ required: true, message: "零售价不能为空", trigger: "blur" }],
- // promotionPrice: [{ required: true, message: '促销价不能为空', trigger: 'blur' }],
+ purchasePrice: [{ required: true, message: "进价不能为空", trigger: "blur" }],
+ promotionPrice: [{ required: true, message: "促销价不能为空", trigger: "blur" }],
+ costPrice: [{ required: true, message: "成本价不能为空", trigger: "blur" }],
})
// 打开弹窗
diff --git a/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/index.vue b/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/index.vue
index cb68f3c..d77b38c 100644
--- a/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/index.vue
+++ b/src/views/supermarketerp/supermarketSpu/components/supermarketUnit/index.vue
@@ -80,7 +80,6 @@
-
@@ -102,8 +101,9 @@
type="primary"
v-auth="'supermarket_supermarketUnit_del'"
@click="handleDelete(scope.row)"
- >删除
+ 删除
+
@@ -149,18 +149,31 @@ const tableStyle = {
},
}
+// 根据基础信息的部分填写项自动生成一条默认包装单位
watch(
() => props.defaultSpuUnit,
(newValue, oldValue) => {
+ console.log(newValue, oldValue)
+
const defaultSpuUnitIndex = supermarketUnitEntityList.value.findIndex((item: any) => {
- return (item.flag = "default")
+ return (
+ item.barCode == oldValue.barCode &&
+ item.unit == oldValue.unit &&
+ item.packageNum == oldValue.packageNum &&
+ item.retailPrice == oldValue.retailPrice &&
+ item.purchasePrice == oldValue.purchasePrice &&
+ item.promotionPrice == oldValue.promotionPrice &&
+ item.costPrice == oldValue.costPrice
+ )
})
+ console.log(defaultSpuUnitIndex)
+
if (defaultSpuUnitIndex !== -1) {
- console.log(supermarketUnitEntityList.value[defaultSpuUnitIndex])
supermarketUnitEntityList.value[defaultSpuUnitIndex] = newValue
} else {
supermarketUnitEntityList.value.push(newValue)
}
+ console.log(supermarketUnitEntityList.value)
},
{
deep: true,
diff --git a/src/views/supermarketerp/supermarketSpu/form.vue b/src/views/supermarketerp/supermarketSpu/form.vue
index 467c5ae..0c73b3b 100644
--- a/src/views/supermarketerp/supermarketSpu/form.vue
+++ b/src/views/supermarketerp/supermarketSpu/form.vue
@@ -15,8 +15,8 @@
-
-
+
+
@@ -126,7 +126,7 @@
-
+
@@ -211,7 +211,7 @@ const form = reactive({
id: "",
merchantId: "",
productCode: "",
- barCode: "",
+ barcode: "",
productName: "",
unit: "",
categoryId: "",
@@ -223,7 +223,7 @@ const form = reactive({
costPrice: 0,
stock: 0,
giveIntegral: 0,
- specification: "",
+ spec: "",
origin: "",
packageNum: 0,
retailPrice: 0,
@@ -250,7 +250,7 @@ const dataRules = {
productNature: [{ required: true, message: "请选择商品性质", trigger: "blur" }],
merchantId: [{ required: true, message: "商户不能为空", trigger: "blur" }],
productCode: [{ required: true, message: "货号不能为空", trigger: "blur" }],
- barCode: [{ required: true, message: "自编码/条码不能为空", trigger: "blur" }],
+ barcode: [{ required: true, message: "自编码/条码不能为空", trigger: "blur" }],
productName: [{ required: true, message: "商品名称不能为空", trigger: "blur" }],
unit: [{ required: true, message: "单位不能为空", trigger: "blur" }],
stock: [{ required: true, message: "总库存不能为空", trigger: "blur" }],
@@ -261,8 +261,10 @@ const dataRules = {
supplierId: [{ required: true, message: "请选择货商", trigger: "blur" }],
smErpUnitEntityList: [{ required: true, message: "请添加包装单位", trigger: "change" }],
smErpAuxiliaryCodeEntityList: [{ required: true, message: "请添加辅助条码", trigger: "change" }],
- // costPrice: [{ required: true, message: "成本价不能为空", trigger: "blur" }],
retailPrice: [{ required: true, message: "零售价不能为空", trigger: "blur" }],
+ purchasePrice: [{ required: true, message: "进价不能为空", trigger: "blur" }],
+ promotionPrice: [{ required: true, message: "促销价不能为空", trigger: "blur" }],
+ costPrice: [{ required: true, message: "成本价不能为空", trigger: "blur" }],
packageNum: [{ required: true, message: "内装数不能为空", trigger: "blur" }],
}
const { supermarket_nature, status } = useDict("supermarket_nature", "status")
@@ -272,12 +274,14 @@ const supplierOptions = ref([]) // 货商的下拉选项
// 默认包装单位
const defaultSpuUnit = computed(() => ({
flag: "default",
- barCode: form.barCode,
+ barCode: form.barcode,
unit: form.unit,
packageNum: form.packageNum,
retailPrice: form.retailPrice,
purchasePrice: form.purchasePrice,
promotionPrice: form.promotionPrice,
+ costPrice: form.costPrice,
+ spec: form.spec,
status: "0",
}))
@@ -305,8 +309,6 @@ const openDialog = async (id: string) => {
getSupplierTypeOptions(),
]).then((results) => results.map((result) => (result.status === "fulfilled" ? result.value : null)))
- console.log(categoryDict, brandDict, supplierDict)
-
categoryOptions && categoryDict.code === 0 && (categoryOptions.value = categoryDict.data)
brandOptions && brandDict.code === 0 && (brandOptions.value = brandDict.data)
supplierOptions && supplierDict.code === 0 && (supplierOptions.value = supplierDict.data)
@@ -325,6 +327,7 @@ const getsupermarketSpuData = async (id: string) => {
item.purchasePrice = displayPrice(item.purchasePrice, "")
item.costPrice = displayPrice(item.costPrice, "")
})
+
Object.assign(form, res.data)
console.log(res.data)
}