diff --git a/.idea/misc.xml b/.idea/misc.xml index 28a804d8..1c24890b 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,4 +3,7 @@ + + + \ No newline at end of file diff --git a/manager/src/utils/regular.js b/manager/src/utils/regular.js index 05e78f2c..f55b197e 100644 --- a/manager/src/utils/regular.js +++ b/manager/src/utils/regular.js @@ -57,3 +57,34 @@ export const URL = // 固话 export const TEL = /0\d{2,3}-\d{7,8}/ + + +// 正整数 +export const INTEGER = { + pattern: /^[0-9]\d*$/, + message:'请输入正整数' +} + +export const VARCHAR5 = { + pattern:/^.{1,5}$/, + message:'长度应该限制在1-5个字符' +} + +export const VARCHAR20 = { + pattern:/^.{1,20}$/, + message:'长度应该限制在1-20个字符' +} + +export const VARCHAR255 = { + pattern:/^.{1,255}$/, + message:'超出最大长度限制' +} + +export const URL200 = { + pattern:/[a-zA-z]+\:\/\/[^\s]{1,190}/, + message:'请输入长度不超过200的URL地址' +} +export const REQUIRED = { + required: true, + message:'请填写参数' +} diff --git a/manager/src/views/goods-unit/index.vue b/manager/src/views/goods-unit/index.vue index e3e5e561..57f1131d 100644 --- a/manager/src/views/goods-unit/index.vue +++ b/manager/src/views/goods-unit/index.vue @@ -57,6 +57,9 @@ import { updateGoodsUnit, delGoodsUnit } from "@/api/index"; + +import {regular} from "@/utils"; + export default { name: "goods-unit", data() { @@ -79,12 +82,9 @@ export default { // 表单验证规则 formValidate: { name: [ - { - required: true, - message: "请输入计量单位", - trigger: "blur", - }, - ], + regular.REQUIRED, + regular.VARCHAR5 + ] }, submitLoading: false, // 添加或编辑提交状态 selectList: [], // 多选数据 diff --git a/manager/src/views/goods/goods-manage/brand.vue b/manager/src/views/goods/goods-manage/brand.vue index 8c91f298..42683b4a 100644 --- a/manager/src/views/goods/goods-manage/brand.vue +++ b/manager/src/views/goods/goods-manage/brand.vue @@ -1,9 +1,10 @@ - + - + 搜索 @@ -12,14 +13,15 @@ - + - + @@ -43,6 +45,8 @@ import { } from "@/api/goods"; import uploadPicInput from "@/views/my-components/lili/upload-pic-input"; +import {regular} from "@/utils"; + export default { name: "brand", components: { @@ -68,7 +72,16 @@ export default { deleteFlag: "", }, // 表单验证规则 - formValidate: {}, + formValidate: { + name: [ + regular.REQUIRED, + regular.VARCHAR20 + ], + logo: [ + regular.REQUIRED, + regular.URL200 + ], + }, submitLoading: false, // 添加或编辑提交状态 columns: [ { @@ -104,9 +117,9 @@ export default { align: "left", render: (h, params) => { if (params.row.deleteFlag == 0) { - return h("Tag", {props: {color: "green",},},"启用"); + return h("Tag", {props: {color: "green",},}, "启用"); } else if (params.row.deleteFlag == 1) { - return h("Tag", {props: {color: "volcano",},},"禁用"); + return h("Tag", {props: {color: "volcano",},}, "禁用"); } }, filters: [ @@ -323,7 +336,7 @@ export default { content: "您确认要启用品牌 " + v.name + " ?", loading: true, onOk: () => { - disableBrand(v.id, { disable: false }).then((res) => { + disableBrand(v.id, {disable: false}).then((res) => { this.$Modal.remove(); if (res.success) { this.$Message.success("操作成功"); @@ -340,7 +353,7 @@ export default { content: "您确认要禁用品牌 " + v.name + " ?", loading: true, onOk: () => { - disableBrand(v.id, { disable: true }).then((res) => { + disableBrand(v.id, {disable: true}).then((res) => { this.$Modal.remove(); if (res.success) { this.$Message.success("操作成功"); diff --git a/manager/src/views/goods/goods-manage/category.vue b/manager/src/views/goods/goods-manage/category.vue index 1144878d..a2302f04 100644 --- a/manager/src/views/goods/goods-manage/category.vue +++ b/manager/src/views/goods/goods-manage/category.vue @@ -171,9 +171,17 @@ export default { // 表单验证规则 formValidate: { commissionRate: [ - { required: true, message: "请填写佣金比例" }, - { pattern: regular.Integer, message: "佣金比例不能为负" }, + regular.REQUIRED, + regular.INTEGER ], + name:[ + regular.REQUIRED, + regular.VARCHAR20, + ], + sortOrder:[ + regular.REQUIRED, + regular.INTEGER + ] }, columns: [ { @@ -475,4 +483,4 @@ export default { min-height: 100vh; height: auto; } - \ No newline at end of file + diff --git a/manager/src/views/goods/goods-manage/spec.vue b/manager/src/views/goods/goods-manage/spec.vue index 913e5632..d6a5d76b 100644 --- a/manager/src/views/goods/goods-manage/spec.vue +++ b/manager/src/views/goods/goods-manage/spec.vue @@ -56,7 +56,8 @@ :mask-closable="false" :width="500" > - + @@ -92,6 +93,7 @@ import { delSpec } from "@/api/goods"; +import {regular} from "@/utils"; export default { name: "spec", components: {}, @@ -108,6 +110,17 @@ export default { sort: "createTime", // 默认排序字段 order: "asc", // 默认排序方式 }, + // 表单验证规则 + formValidate: { + specName: [ + regular.REQUIRED, + regular.VARCHAR20 + ], + specValue: [ + regular.REQUIRED, + regular.VARCHAR255 + ], + }, form: { // 添加或编辑表单对象初始化数据 specName: "", @@ -280,6 +293,7 @@ export default { this.modalType = 0; this.modalTitle = "添加"; this.$refs.form.resetFields(); + this.specValue = ''; delete this.form.id; this.modalVisible = true; }, diff --git a/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue b/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue index 6caeeabe..0e7c3c26 100644 --- a/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue +++ b/manager/src/views/sys/setting-manage/setting/BASE_SETTING.vue @@ -63,7 +63,7 @@ export default { data() { return { handleSubmit, // 验证规则 - + picModelFlag: false, // 预览图片显隐 formValidate: { // 表单数据 buyerSideLogo: "", diff --git a/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue b/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue new file mode 100644 index 00000000..82372a7b --- /dev/null +++ b/manager/src/views/sys/setting-manage/setting/IM_SETTING.vue @@ -0,0 +1,87 @@ + + + + + + + + + + + 保存 + + + + + + + diff --git a/manager/src/views/sys/setting-manage/settingManage.vue b/manager/src/views/sys/setting-manage/settingManage.vue index 316c8f97..45d3f793 100644 --- a/manager/src/views/sys/setting-manage/settingManage.vue +++ b/manager/src/views/sys/setting-manage/settingManage.vue @@ -57,6 +57,11 @@ export default { type: "SMS_SETTING", name: "阿里短信配置", }, + //阿里短信配置 + { + type: "IM_SETTING", + name: "客服设置", + }, ], authLogin: [ // 微信设置 diff --git a/manager/src/views/sys/setting-manage/template.js b/manager/src/views/sys/setting-manage/template.js index b53d674f..3cfc0aad 100644 --- a/manager/src/views/sys/setting-manage/template.js +++ b/manager/src/views/sys/setting-manage/template.js @@ -5,6 +5,7 @@ import POINT_SETTING from "./setting/POINT_SETTING"; import KUAIDI_SETTING from "./setting/KUAIDI_SETTING"; import OSS_SETTING from "./setting/OSS_SETTING"; import SMS_SETTING from "./setting/SMS_SETTING"; +import IM_SETTING from "./setting/IM_SETTING"; import WITHDRAWAL_SETTING from "./setting/WITHDRAWAL_SETTING"; import ALIPAY_PAYMENT from "./pay/ALIPAY_PAYMENT"; import WECHAT_PAYMENT from "./pay/WECHAT_PAYMENT"; @@ -20,6 +21,7 @@ export default { KUAIDI_SETTING, OSS_SETTING, SMS_SETTING, + IM_SETTING, WITHDRAWAL_SETTING, PAYMENT_SUPPORT, WECHAT_PAYMENT, diff --git a/seller/src/views/goods/goods-seller/addGoods.scss b/seller/src/views/goods/goods-seller/addGoods.scss index 44de5fac..8241de40 100644 --- a/seller/src/views/goods/goods-seller/addGoods.scss +++ b/seller/src/views/goods/goods-seller/addGoods.scss @@ -76,7 +76,15 @@ text-align: left; } } - +.sku-val{ + justify-content: flex-start; + flex-wrap: wrap; + >.sku-item-content-val{ + + + margin-right: 20px; + } +} div.base-info-item { h4 { @@ -104,15 +112,23 @@ div.base-info-item { margin-bottom: 20px; .sku-item-content { + margin: 20px 0; display: flex; + width: 100% !important; + flex: 1; + flex-direction: column; align-items: flex-start; - justify-content: center; + justify-content: flex-start; width: 100%; + >.ivu-card-body{ + width: 100%; + } .sku-item-content-name { display: flex; align-items: flex-start; + justify-content: flex-start; width: 100%; } } diff --git a/seller/src/views/goods/goods-seller/goodsOperationSec.vue b/seller/src/views/goods/goods-seller/goodsOperationSec.vue index 9b54a085..64f4802c 100644 --- a/seller/src/views/goods/goods-seller/goodsOperationSec.vue +++ b/seller/src/views/goods/goods-seller/goodsOperationSec.vue @@ -15,6 +15,9 @@ + + + @@ -47,15 +50,6 @@ 商品规格及图片 - - - - - - - - - @@ -89,43 +83,46 @@ - 规格名称 - + 自定义规格项 + - - - + + + + 删除规格 + + - 删除 - + - + - - - - - - 删除 - - - - - 添加规格值 - - + + + + + 删除 + + + + + + 添加规格值 + - 添加规格项目 + 添加规格项 @@ -166,7 +163,7 @@ - + @@ -213,12 +210,6 @@ 商品物流信息 - - - kg - - - {{ item.name }} @@ -305,6 +296,7 @@ export default { }, }, data() { + // 表单验证项,商品价格 const checkPrice = (rule, value, callback) => { if (!value && value !== 0) { @@ -326,6 +318,8 @@ export default { callback(new Error("商品编号不能为空")); } else if (!/^[a-zA-Z0-9_\\-]+$/g.test(value)) { callback(new Error("请输入数字、字母、下划线或者中划线")); + } else if (value.length > 30) { + callback(new Error("商品编号长度不能大于30")); } else { callback(); } @@ -343,6 +337,7 @@ export default { } }; return { + regular, accessToken: "", //令牌token goodsParams: "", categoryId: "", // 商品分类第三级id @@ -365,8 +360,6 @@ export default { /** 发布商品基本参数 */ baseInfoForm: { salesModel: "RETAIL", - /** 商品重量 */ - weight: "", /** 商品相册列表 */ goodsGalleryFiles: [], /** 是否立即发布 true 立即发布 false 放入仓库 */ @@ -421,37 +414,13 @@ export default { /** 存储未通过校验的单元格位置 */ validateError: [], baseInfoFormRule: { - goodsName: [ - { required: true, message: "请输入商品名称" }, - { - whitespace: true, - message: "商品名称不可为纯空格", - }, - { - min: 3, - max: 60, - message: "长度在 3 到 60 个字符", - }, - ], - sn: [ - { required: true, message: "请输入商品编号" }, - { validator: checkSn }, - ], - price: [ - { required: true, message: "请输入商品价格" }, - { validator: checkPrice }, - ], - cost: [ - { required: true, message: "请输入市场价格" }, - { validator: checkPrice }, - ], - weight: [ - { required: true, message: "请输入商品重量" }, - { validator: checkWeight }, - ], - templateId: [{ required: true, message: "请选择物流模板" }], - sellingPoint: [{ required: true, message: "请输入商品卖点" }], + goodsName: [regular.REQUIRED, regular.WHITE_SPACE, regular.VARCHAR60], + price: [regular.REQUIRED, { validator: checkPrice }], + sellingPoint: [regular.REQUIRED, regular.VARCHAR60], goodsUnit: [{ required: true, message: "请选择计量单位" }], + name: [regular.REQUIRED, regular.VARCHAR5], + value: [regular.REQUIRED, regular.VARCHAR60], + templateId: [regular.REQUIRED], }, /** 品牌列表 */ brandList: [], @@ -507,9 +476,9 @@ export default { paramName: "", paramValue: "", isIndex: "", - required: "", + // required: "", paramId: "", - sort: "" + sort: "", }; } this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[ @@ -518,9 +487,9 @@ export default { paramName: params.paramName, paramValue: value, isIndex: params.isIndex, - required: params.required, + // required: params.required, paramId: params.id, - sort: params.sort + sort: params.sort, }; }, // 编辑sku图片 @@ -900,11 +869,11 @@ export default { }); }); - this.baseInfoForm.goodsType != "VIRTUAL_GOODS" + this.baseInfoForm.goodsType != "VIRTUAL_GOODS" ? pushData.push({ - title: "重量", - slot: "weight", - }) + title: "重量", + slot: "weight", + }) : ""; pushData.push( { @@ -949,7 +918,7 @@ export default { cloneTemp.splice(0, 1); result = this.specIterator(result, cloneTemp); this.skuTableData = result; - console.log(this.skuTableData) + console.log(this.skuTableData); } }, /** @@ -999,7 +968,6 @@ export default { }, /** 数据改变之后 抛出数据 */ updateSkuTable(row, item, type = "deafult") { - let index = row._index; this.baseInfoForm.regeneratorSkuFlag = true; /** 进行自定义校验 判断是否是数字(小数也能通过)重量 */ @@ -1065,6 +1033,10 @@ export default { ids += e.id + ","; }); ids = ids.substring(0, ids.length - 1); + + if (ids.length > 100) { + this.$Message.error("选择了过多的店铺分类,请谨慎选择"); + } this.baseInfoForm.storeCategoryPath = ids; }, /** 添加商品 **/ @@ -1134,6 +1106,8 @@ export default { } } else { this.submitLoading = false; + + this.$Message.error("还有必填项未做处理,请检查表单"); } }); }, @@ -1232,4 +1206,4 @@ export default { \ No newline at end of file +