@@ -154,9 +153,21 @@ export default {
{ required: true, message: "请输入最高可砍金额" },
{ validator: checkHighestPrice },
],
- rangeTime: [{ required: true, message: "请选择活动时间" }],
+ rangeTime: [
+ {
+ type: "array",
+ required: true,
+ message: "请选择活动时间",
+ trigger: "change",
+ },
+ ],
stock: [{ required: true, message: "请输入活动库存" }],
},
+ options: {
+ disabledDate(date) {
+ return date && date.valueOf() < Date.now() - 86400000;
+ },
+ },
};
},
async mounted() {
@@ -166,9 +177,6 @@ export default {
}
},
methods: {
- disabledDate(date) {
- return date && date.getTime() < Date.now() - 86400000;
- },
getKanJiaActivityGoods() {
getKanJiaActivityGoodsById(this.id).then((res) => {
this.form = res.result;
@@ -177,58 +185,62 @@ export default {
},
handleSubmit() {
this.$refs.form.validate((valid) => {
- if (valid) {
- const params = JSON.parse(JSON.stringify(this.form));
- if (!this.form.rangeTime || this.form.rangeTime.length !== 2) {
- this.$Message.error("请选择活动时间");
- return;
- }
- params.startTime = this.form.rangeTime[0];
- params.endTime = this.form.rangeTime[1];
- delete params.rangeTime;
-
- if (params.stock <= 0 || params.stock > params.goodsSku.quantity) {
- this.$Message.error("活动库存不能为0且不能超过商品库存");
- return;
- }
- if (!regular.money.test(params.settlementPrice)) {
- this.$Message.error("结算价格金额格式不正确");
- return;
- }
- if (params.settlementPrice < 0 || params.settlementPrice > params.price) {
- this.$Message.error("结算价格金额不能为0且不能超过商品价格");
- return;
- }
- if (!regular.money.test(params.highestPrice)) {
- this.$Message.error("最高可砍金额格式错误");
- return;
- }
- if (params.highestPrice <= 0 || params.highestPrice > params.price) {
- this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
- return;
- }
- if (!regular.money.test(params.lowestPrice)) {
- this.$Message.error("最低可砍金额格式错误");
- return;
- }
- if (params.lowestPrice <= 0 || params.lowestPrice > params.price) {
- this.$Message.error("最低可砍金额不能为0");
- return;
- }
- if (params.lowestPrice > params.highestPrice) {
- this.$Message.error("最低砍价金额不能大于最高砍价金额");
- return;
- }
-
- this.submitLoading = true;
- editKanJiaActivityGoods(params).then((res) => {
- this.submitLoading = false;
- if (res.success) {
- this.$Message.success("砍价活动修改成功");
- this.closeCurrentPage();
- }
- });
+ if (!valid) {
+ return;
}
+ const params = JSON.parse(JSON.stringify(this.form));
+ const [start, end] = this.form.rangeTime || [];
+ if (!start || !end) {
+ this.$Message.error("请选择活动时间");
+ return;
+ }
+ const startDate = start instanceof Date ? start : new Date(start);
+ const endDate = end instanceof Date ? end : new Date(end);
+ params.startTime = this.$filters.unixToDate(startDate.getTime() / 1000);
+ params.endTime = this.$filters.unixToDate(endDate.getTime() / 1000);
+ delete params.rangeTime;
+
+ if (params.stock <= 0 || params.stock > params.goodsSku.quantity) {
+ this.$Message.error("活动库存不能为0且不能超过商品库存");
+ return;
+ }
+ if (!regular.money.test(params.settlementPrice)) {
+ this.$Message.error("结算价格金额格式不正确");
+ return;
+ }
+ if (params.settlementPrice < 0 || params.settlementPrice > params.price) {
+ this.$Message.error("结算价格金额不能为0且不能超过商品价格");
+ return;
+ }
+ if (!regular.money.test(params.highestPrice)) {
+ this.$Message.error("最高可砍金额格式错误");
+ return;
+ }
+ if (params.highestPrice <= 0 || params.highestPrice > params.price) {
+ this.$Message.error("最高可砍金额不能为0且不能超过商品价格");
+ return;
+ }
+ if (!regular.money.test(params.lowestPrice)) {
+ this.$Message.error("最低可砍金额格式错误");
+ return;
+ }
+ if (params.lowestPrice <= 0 || params.lowestPrice > params.price) {
+ this.$Message.error("最低可砍金额不能为0");
+ return;
+ }
+ if (params.lowestPrice > params.highestPrice) {
+ this.$Message.error("最低砍价金额不能大于最高砍价金额");
+ return;
+ }
+
+ this.submitLoading = true;
+ editKanJiaActivityGoods(params).then((res) => {
+ this.submitLoading = false;
+ if (res.success) {
+ this.$Message.success("砍价活动修改成功");
+ this.closeCurrentPage();
+ }
+ });
});
},
closeCurrentPage() {
@@ -252,4 +264,12 @@ h4 {
line-height: 40px;
text-align: left;
}
+
+.kanjia-activity-time-form-item {
+ :deep(.el-date-editor) {
+ width: 360px !important;
+ max-width: 360px;
+ flex-grow: 0;
+ }
+}
diff --git a/manager/src/views/seller/shop/shopOperation.vue b/manager/src/views/seller/shop/shopOperation.vue
index 17b697f9..3b3737a1 100644
--- a/manager/src/views/seller/shop/shopOperation.vue
+++ b/manager/src/views/seller/shop/shopOperation.vue
@@ -370,8 +370,9 @@
:show-close="true"
>
@@ -566,7 +567,6 @@ export default {
//选择会员
selectMember() {
- this.$refs["memberLayout"].selectedMember = true;
this.memberModalFlag = true;
},
diff --git a/manager/src/views/sys/slider/slider.vue b/manager/src/views/sys/slider/slider.vue
index 3d1b5a62..85c80eec 100644
--- a/manager/src/views/sys/slider/slider.vue
+++ b/manager/src/views/sys/slider/slider.vue
@@ -44,7 +44,7 @@
编辑
- |||
+ |
删除
diff --git a/manager/src/views/sys/user-manage/userManage.vue b/manager/src/views/sys/user-manage/userManage.vue
index 0333c148..5910648e 100644
--- a/manager/src/views/sys/user-manage/userManage.vue
+++ b/manager/src/views/sys/user-manage/userManage.vue
@@ -104,7 +104,7 @@
-
+
@@ -178,9 +178,12 @@ export default {
modalTitle: "",
form: {
username: "",
+ nickName: "",
+ password: "",
mobile: "",
email: "",
- sex: "",
+ avatar: "",
+ description: "",
roles: [],
departmentId: 0,
departmentTitle: "",
@@ -285,18 +288,30 @@ export default {
this.$refs.form.validate((valid) => {
if (valid) {
if (this.modalType == 0) {
- const params = JSON.parse(JSON.stringify(this.form));
- delete params.id;
- delete params.status;
- if (params.password == "" || params.password == undefined) {
+ if (this.form.password == "" || this.form.password == undefined) {
this.errorPass = "密码不能为空";
return;
}
- if (params.password.length < 6) {
+ if (this.form.password.length < 6) {
this.errorPass = "密码长度不得少于6位";
return;
}
- params.password = this.md5(params.password);
+ if (Array.isArray(this.form.roles) && this.form.roles.length > 9) {
+ ElMessage.warning("角色最多选择9个");
+ return;
+ }
+ const params = {
+ username: this.form.username,
+ password: this.form.password,
+ nickName: this.form.nickName,
+ mobile: this.form.mobile,
+ email: this.form.email,
+ avatar: this.form.avatar,
+ description: this.form.description,
+ departmentId: this.form.departmentId,
+ roles: this.form.roles,
+ };
+ this.errorPass = "";
this.submitLoading = true;
addUser(params).then((res) => {
this.submitLoading = false;
@@ -325,9 +340,12 @@ export default {
this.modalTitle = "添加用户";
this.form = {
username: "",
+ nickName: "",
+ password: "",
mobile: "",
email: "",
- sex: "",
+ avatar: "",
+ description: "",
roles: [],
departmentId: 0,
departmentTitle: "",
diff --git a/seller/src/api/goods.js b/seller/src/api/goods.js
index 8ce3d321..77e3de27 100644
--- a/seller/src/api/goods.js
+++ b/seller/src/api/goods.js
@@ -67,11 +67,6 @@ export const getCategoryBrandListData = (category_id, params) => {
export const saveCategoryBrand = (category_id, params) => {
return postRequest(`/category/brand/${category_id}`, params);
};
-//保存获取关联规格
-export const saveCategorySpec = (category_id, params) => {
- return postRequest(`/goods/categorySpec/${category_id}`, params);
-};
-
//获取所有可用品牌
export const getBrandListData = params => {
return getRequest("/goods/brand/all", params);
@@ -115,10 +110,6 @@ export const getSpecListData = params => {
export const insertOrUpdateSpec = params => {
return postRequest("/goods/spec/edit", params);
};
-//根据分类id获取关联规格
-export const getCategorySpecListData = (category_id, params) => {
- return getRequest(`/goods/categorySpec/${category_id}`, params);
-};
//删除gUI个
export const delSpec = (id, params) => {
return deleteRequest(`/goods/spec/del/${id}`, params);
@@ -335,11 +326,6 @@ export const getCategoryParamsListDataSeller = (id, params) => {
return getRequest(`/goods/categoryParameters/${id}`, params);
};
-//保存获取关联规格
-export const getGoodsSpecInfoSeller = (category_id) => {
- return getRequest(`/goods/spec/${category_id}`);
-};
-
//批量设置运费模板
export const batchShipTemplate = params => {
return putRequest(`/goods/goods/freight`, params);
diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
index 31eb823d..46527058 100644
--- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue
+++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue
@@ -1211,8 +1211,6 @@ export default {
this.baseInfoForm.weight = response.result.skuList[0].weight;
}
- this.Get_SkuInfoByCategory(this.categoryId);
-
this.renderGoodsDetailSku(response.result.skuList);
/** 查询品牌列表 */
@@ -2000,20 +1998,6 @@ export default {
return generateCombinations(0, []);
},
- /** 根据分类id获取系统设置规格信息*/
- Get_SkuInfoByCategory(categoryId) {
- if (categoryId) {
- API_GOODS.getGoodsSpecInfoSeller(categoryId).then((res) => {
- if (res.length) {
- res.forEach((e) => {
- this.skuData.push(e.specName);
- const vals = e.specValue ? e.specValue.split(",") : [];
- this.skuVals.push(Array.from(new Set(vals)));
- });
- }
- });
- }
- },
// 判断相同数组的值
scalarArrayEquals(array1, array2) {
return (
@@ -2307,8 +2291,6 @@ export default {
this.GET_GoodsParams();
/** 查询品牌列表 */
this.getGoodsBrandList();
- /** 查询分类绑定的规格信息 */
- this.Get_SkuInfoByCategory(this.categoryId);
// 获取商品单位
this.GET_GoodsUnit();
// 获取当前店铺分类