Merge branch 'liushuai'

大部分为参数校验问题,以及部分商品字段优化
# Conflicts:
#	buyer/src/config/index.js
#	manager/src/config/index.js
#	seller/src/views/goods/goods-seller/draftGoods.vue
This commit is contained in:
Chopper
2021-09-26 16:12:24 +08:00
26 changed files with 401 additions and 157 deletions

View File

@@ -57,3 +57,43 @@ 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 VARCHAR60 = {
pattern: /^.{1,60}$/,
message: '长度应该限制在1-60个字符'
}
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: '请填写参数'
}
export const WHITE_SPACE = {
whitespace: true,
message: "不可为纯空格",
}

View File

@@ -38,6 +38,8 @@ export default {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort:"create_time",
order:"desc"
},
columns: [
{

View File

@@ -75,6 +75,9 @@ import * as API_Goods from "@/api/goods";
import TreeTable from "@/views/my-components/tree-table/Table/Table";
import { regular } from "@/utils";
import {VARCHAR20} from "../../../utils/regular";
export default {
name: "store-category",
components: {
@@ -98,11 +101,12 @@ export default {
// 表单验证规则
formValidate: {
labelName: [
{
required: true,
message: "请输入分类名称",
trigger: "blur",
},
regular.REQUIRED,
regular.VARCHAR20
],
sortOrder: [
regular.REQUIRED,
regular.INTEGER
],
},
columns: [
@@ -128,7 +132,7 @@ export default {
},
methods: {
// 初始化数据
init() {
init() {
this.getAllList();
},
// 刷新列表

View File

@@ -90,9 +90,11 @@ div.base-info-item {
line-height: 40px;
text-align: left;
}
>div{
> div {
padding-left: 5%;
}
.form-item-view {
display: flex;
flex-direction: column;
@@ -102,20 +104,35 @@ div.base-info-item {
.layout {
margin-bottom: 20px;
width: 100%;
justify-content: center;
.sku-item-content {
display: flex;
flex-direction: column;
flex-direction: row;
align-items: flex-start;
flex-wrap: wrap;
justify-content: center;
width: 100%;
.ivu-card-body{
width: 100%;
justify-content: center;
align-items: flex-start;
}
.sku-item-content-name {
display: flex;
align-items: flex-start;
width: 100%;
width: 130px;
}
.sku-item-content-val{
display: flex;
width: 300px;
align-items: flex-start;
}
}
}
.shop-category-text {
@@ -221,15 +238,18 @@ div.base-info-item {
> h1 {
font-size: 28px;
}
> * {
margin: 10px;
}
}
.operation {
> * {
margin: 10px 0;
}
}
/*商品描述*/
.goods-intro {
line-height: 40;
@@ -245,6 +265,7 @@ div.base-info-item {
bottom: 0px;
text-align: center;
z-index: 999;
> .ivu-btn {
margin: 0 10px;
}
@@ -352,9 +373,7 @@ div.base-info-item {
cursor: pointer;
margin: 0 2px;
}
.ivu-form-item-content {
display: flex;
}
.required {
/deep/ .ivu-form-item-label::before {
content: "*";
@@ -366,6 +385,7 @@ div.base-info-item {
color: #ed4014;
}
}
.demo-upload-list {
width: 150px;
height: 150px;
@@ -378,10 +398,12 @@ div.base-info-item {
margin-right: 4px;
vertical-align: bottom;
}
.demo-upload-list img {
width: 100%;
height: 100%;
}
.demo-upload-list-cover {
display: none;
position: absolute;
@@ -396,9 +418,11 @@ div.base-info-item {
align-items: center;
flex-direction: column;
}
.demo-upload-list:hover .demo-upload-list-cover {
display:flex;
display: flex;
}
.demo-upload-list-cover div {
margin-top: 50px;
width: 100%;
@@ -411,9 +435,11 @@ div.base-info-item {
cursor: pointer;
}
}
.active-goods-type {
background: #e8e8e8;
}
.goods-type-list {
max-height: 500px;
overflow-y: auto;
@@ -426,31 +452,36 @@ div.base-info-item {
display: flex;
justify-content: center;
align-items: center;
/deep/ img {
margin-right: 20px;
width: 100px;
}
/deep/ h2 {
cursor: pointer;
font-size: 21px;
padding: 10px 0;
color: #333;
}
/deep/ p {
color: #999;
font-size: 14px;
margin-top: 10px;
}
}
> .goods-type-item:hover {
transform: translateY(-10px);
}
}
.template-item {
justify-content: flex-start !important;
}
.tree-bar{
.tree-bar {
height: auto !important;
max-height: auto !important;
min-height: 240px !important;

View File

@@ -6,20 +6,20 @@
<Form-item label="商品名称" prop="goodsName">
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
</Form-item>
<Form-item label="状态" prop="status">
<Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px">
<Option value="DOWN">下架</Option>
<Option value="UPPER">上架</Option>
</Select>
<Form-item label="商品编号" prop="id">
<Input
type="text"
v-model="searchForm.id"
placeholder="商品编号"
clearable
style="width: 200px"
/>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px" />
</Form-item>
<Form-item style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleSearch" type="primary" icon="ios-search"
>搜索</Button
>
<Button @click="handleReset">重置</Button>
</Form-item>
</Form>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
@@ -51,7 +51,7 @@ export default {
columns: [
// 表头
{
title: "ID",
title: "编号",
key: "id",
minWidth: 120,
},
@@ -91,11 +91,6 @@ export default {
);
},
},
{
title: "商品库存",
key: "quantity",
},
{
title: "创建时间",
key: "createTime",
@@ -206,7 +201,6 @@ export default {
// 重新加载数据
this.getDataList();
},
// 获取列表数据
getDataList() {
this.loading = true;

View File

@@ -19,7 +19,7 @@
</Select>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px" />
<Input type="text" v-model="searchForm.id" placeholder="商品编号" clearable style="width: 200px" />
</Form-item>
<Button @click="handleSearch" type="primary" class="search-btn">搜索</Button>
<Button @click="handleReset" class="search-btn">重置</Button>
@@ -118,7 +118,7 @@ import {
import * as API_Shop from "@/api/shops";
export default {
name: "goods",
data() {
return {
@@ -201,8 +201,8 @@ export default {
},
{
title: "商品编号",
key: "sn",
width: 100,
key: "id",
width: 180,
tooltip: true,
},
{
@@ -211,18 +211,6 @@ export default {
minWidth: 200,
slot: "goodsSlot",
},
{
title: "市场价格",
key: "cost",
width: 130,
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.cost, "¥")
);
},
},
{
title: "商品类型",
key: "goodsType",