合并shuai分支 优化正则校验以及商品发布中样式 ,后续会优化商品发布中规格问题

master
lemon橪 2021-09-26 16:37:53 +08:00
commit 1aab8aa8c8
19 changed files with 212 additions and 146 deletions

View File

@ -61,7 +61,8 @@ export const TEL = /0\d{2,3}-\d{7,8}/
// 正整数
export const INTEGER = {
pattern: /^[0-9]\d*$/,
pattern: /^[0-9]\d{0,10}|0$/,
message:'请输入正整数'
}

View File

@ -24,11 +24,11 @@ export const cashStatusList = [
label:'待处理'
},
{
value:'REFUSE',
value:'FAIL_AUDITING',
label:'拒绝'
},
{
value:'PASS',
value:'VIA_AUDITING',
label:'通过'
}
]

View File

@ -1,24 +1,27 @@
<template>
<div>
<Card>
<Row @keydown.enter.native="handleSearch" >
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="会员名称">
<Input class="search-input" v-model="searchForm.memberName"></Input>
<Form ref="searchForm" :model="searchForm" class="search-form">
<Form-item label="会员名称" class="flex" prop="memberName">
<Input
type="text" v-model="searchForm.memberName"
style="width: 200px"></Input>
</Form-item>
<Form-item label="编号">
<Input class="search-input" v-model="searchForm.sn"></Input>
<Form-item label="编号" class="flex">
<Input
type="text" v-model="searchForm.sn"
style="width: 200px"></Input>
</Form-item>
<Form-item label="状态" style="margin-left: -20px">
<Select v-model="searchForm.distributionCashStatus" style="width:150px;">
<Form-item label="状态"
style="width: 200px">
<Select v-model="searchForm.distributionCashStatus" clearable style="width: 150px">
<Option v-for="item in cashStatusList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</Form-item>
<Form-item style="margin-left:-35px;" class="br">
<Form-item>
<Button @click="handleSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
<Row type="flex" justify="end" class="page padding-row">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer></Page>

View File

@ -107,20 +107,23 @@ export default {
{
title: "库存",
key: "quantity",
minWidth: 80,
},
{
title: "添加时间",
key: "createTime",
width: 170,
minWidth: 100,
},
{
title: "店铺名称",
key: "storeName",
minWidth: 100,
tooltip: true,
},
{
title: "佣金金额",
key: "commission",
minWidth: 100,
sortable: false,
render: (h, params) => {
return h(
@ -134,7 +137,7 @@ export default {
key: "action",
align: "center",
fixed: "right",
width: 150,
minWidth: 100,
render: (h, params) => {
return h("div", [
h(

View File

@ -21,7 +21,7 @@
/>
</Form-item>
<Form-item label="店铺名称">
<Select v-model="searchForm.shopId" placeholder="请选择" @on-query-change="searchChange" filterable
<Select v-model="searchForm.storeId" placeholder="请选择" @on-query-change="searchChange" filterable
clearable style="width: 150px">
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option>
</Select>
@ -86,22 +86,26 @@
searchForm: { //
pageNumber: 1, //
pageSize: 10, //
sort:"create_time",
order:"desc"
},
columns: [
{
title: "订单编号",
key: "orderSn",
minWidth: 100,
minWidth: 180,
fixed: "left",
tooltip: true
},
{
title: '商品信息',
slot: 'goodsMsg',
minWidth: 120
minWidth: 150
},
{
title: "退款金额",
key: "returnMoney",
minWidth:80,
sortable: false,
render: (h, params) => {
if(params.row.sellBackRebate == null){
@ -114,23 +118,24 @@
{
title: "分销商",
key: "distributionName",
tooltip: true
tooltip: true,
minWidth:80,
},
{
title: "店铺名称",
key: "storeName",
minWidth:80,
tooltip: true
},
{
title: "状态",
slot: "distributionOrderStatus",
width: 120,
minWidth:80,
},
{
title: "佣金金额",
key: "rebateGrade",
width: 120,
minWidth:80,
sortable: false,
render: (h, params) => {
if(params.row.rebate == null){
@ -142,9 +147,10 @@
}
},
{
fixed: "right",
title: "创建时间",
key: "createTime",
width: 180,
minWidth:100,
sortable: false,
}
],

View File

@ -1,20 +1,20 @@
<template>
<div style="background-color: #fff;">
<Form ref="form" :model="form" :label-width="120" style="padding: 10px;">
<Form ref="form" :model="form" :rules="formRule" :label-width="120" style="padding: 10px;">
<Divider orientation="left">分销设置</Divider>
<FormItem label="是否开启分销" prop="distribution">
<FormItem label="是否开启分销" prop="isOpen">
<i-switch size="large" v-model="form.isOpen" :true-value="true" :false-value="false">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
</FormItem>
<FormItem label="分销关系绑定天数" prop="distributionDay">
<InputNumber :min="1" style="width:100px;" v-model="form.distributionDay"></InputNumber>
<InputNumber :min="1" :max="365" style="width:100px;" v-model="form.distributionDay"></InputNumber>
</FormItem>
<FormItem label="分销结算天数" prop="cashDay">
<InputNumber :min="1" style="width:100px;" v-model="form.cashDay"></InputNumber>
<InputNumber :min="1" :max="365" style="width:100px;" v-model="form.cashDay"></InputNumber>
</FormItem>
<FormItem>
<Button type="primary" @click="submit"></Button>
@ -25,15 +25,27 @@
<script>
import { setSetting, getSetting } from "@/api/index";
import { regular } from "@/utils";
export default {
name: "distributionSetting",
data() {
return {
form: {
//
isOpen: "",
isOpen: true,
distributionDay: 0, //
cashDay: 0, //
},
formRule: {
isOpen: [
regular.REQUIRED
],
distributionDay: [
regular.REQUIRED
],
cashDay: [
regular.REQUIRED
],
}
};
},

View File

@ -18,10 +18,10 @@
style="width: 200px"
/>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Form-item label="商品编号" prop="id">
<Input
type="text"
v-model="searchForm.sn"
v-model="searchForm.id"
placeholder="请输入商品编号"
clearable
style="width: 200px"
@ -149,21 +149,10 @@ export default {
},
{
title: "商品编号",
key: "sn",
key: "id",
minWidth: 150,
tooltip: true
},
{
title: "成本价",
key: "price",
width: 130,
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.cost, "¥")
);
},
},
{
title: "价格",
key: "price",

View File

@ -18,10 +18,10 @@
style="width: 200px"
/>
</Form-item>
<Form-item label="商品编号" prop="sn">
<Form-item label="商品编号" prop="id">
<Input
type="text"
v-model="searchForm.sn"
v-model="searchForm.id"
placeholder="请输入商品编号"
clearable
style="width: 200px"
@ -101,21 +101,10 @@
},
{
title: "商品编号",
key: "sn",
key: "id",
minWidth: 100,
tooltip: true
},
{
title: "成本价",
key: "price",
minWidth: 130,
render: (h, params) => {
return h(
"div",
this.$options.filters.unitPrice(params.row.cost, "¥")
);
},
},
{
title: "价格",
key: "price",

View File

@ -25,9 +25,8 @@
</div>
<h4>商品规格及图片</h4>
<div class="form-item-view">
<FormItem label="商品编号"> {{ goods.sn }}</FormItem>
<FormItem label="商品编号"> {{ goods.id }}</FormItem>
<FormItem label="商品价格"> ¥{{ goods.price | unitPrice }} </FormItem>
<FormItem label="市场价格"> ¥{{ goods.cost | unitPrice }} </FormItem>
<FormItem label="商品图片">
<div class="demo-upload-list" v-for="(item, __index) in goods.goodsGalleryList" :key="__index">
<img :src="item"/>
@ -69,14 +68,6 @@
<div v-html="goods.mobileIntro"></div>
</FormItem>
</div>
<h4>商品物流信息</h4>
<div class="form-item-view">
<FormItem label="商品重量">
<Input v-model="goods.weight">
<span slot="append">kg</span>
</Input>
</FormItem>
</div>
</div>
</Card>
</Form>

View File

@ -35,7 +35,8 @@
<span>
<i-button type="text" @click="handleEditParams(group, param)">编辑</i-button>
<i-button type="text" size="small" style="color: #f56c6c" @click="handleDeleteParam(group, param)">删除</i-button>
<i-button type="text" size="small" style="color: #f56c6c"
@click="handleDeleteParam(group, param)">删除</i-button>
</span>
</div>
</template>
@ -52,7 +53,7 @@
<Modal :title="modalTitle" v-model="dialogParamsVisible" :mask-closable="false" :width="500">
<Form ref="paramForm" :model="paramForm" :label-width="100" :rules="formValidate">
<FormItem label="参数名称" prop="paramName">
<Input v-model="paramForm.paramName" style="width: 100%" />
<Input v-model="paramForm.paramName" style="width: 100%"/>
</FormItem>
<FormItem label="可选值" prop="options">
<Select
@ -71,7 +72,7 @@
:key="item"
:label="item"
>
{{item}}
{{ item }}
</Option>
</Select>
</FormItem>
@ -79,8 +80,8 @@
<Checkbox label=1 v-model="paramForm.required"></Checkbox>
<Checkbox label=1 v-model="paramForm.isIndex"></Checkbox>
</FormItem>
<FormItem label="排序" prop="specName3">
<Input type="number" v-model="paramForm.sort" style="width: 100%" />
<FormItem label="排序" prop="sort">
<Input type="number" v-model="paramForm.sort" style="width: 100%"/>
</FormItem>
</Form>
@ -95,7 +96,7 @@
<Modal :title="modalTitle" v-model="dialogParamsGroupVisible" :mask-closable="false" :width="500">
<Form ref="paramGroupForm" :model="paramGroupForm" :label-width="100" :rules="paramGroupValidate">
<FormItem label="参数名称" prop="groupName">
<Input v-model="paramGroupForm.groupName" style="width: 100%" />
<Input v-model="paramGroupForm.groupName" style="width: 100%"/>
</FormItem>
</Form>
@ -117,6 +118,9 @@ import {
updateParamsGroup,
deleteParamsGroup,
} from "@/api/goods";
import {regular} from "@/utils";
export default {
name: "categoryParams",
data() {
@ -136,7 +140,7 @@ export default {
//
paramForm: {},
/** 参数值 **/
ops:{
ops: {
options: []
},
//
@ -144,13 +148,23 @@ export default {
/** 添加、编辑参数 规格 */
formValidate: {
paramName: [
{ required: true, message: "参数名称不能为空", trigger: "blur" },
regular.REQUIRED,
regular.VARCHAR5
],
options: [
regular.REQUIRED,
regular.VARCHAR255
],
sort: [
regular.REQUIRED,
regular.INTEGER
],
},
/** 参数组*/
paramGroupValidate: {
groupName: [
{ required: true, message: "参数组名称不能为空", trigger: "blur" },
regular.REQUIRED,
regular.VARCHAR5
],
},
};
@ -186,8 +200,8 @@ export default {
this.paramForm = {
paramName: param.paramName,
options: param.options.split(","),
required: param.required==1?true:false,
isIndex: param.isIndex==1?true:false,
required: param.required == 1 ? true : false,
isIndex: param.isIndex == 1 ? true : false,
groupId: group.groupId,
categoryId: this.categoryId,
sort: param.sort,
@ -211,12 +225,8 @@ export default {
},
//
handleAddParamsGroup() {
this.paramGroupForm = {
};
this.ops = {
};
this.paramGroupForm = {};
this.ops = {};
(this.paramGroupForm.categoryId = this.categoryId), (this.modalType = 0);
this.modalTitle = "添加参数组";
@ -334,11 +344,12 @@ export default {
},
};
</script>
<style lang="scss" >
<style lang="scss">
.row {
overflow: hidden;
margin: 20px 0;
}
.params {
align-items: center;
display: flex;
@ -347,6 +358,7 @@ export default {
font-size: 14px;
justify-content: space-between;
}
.ivu-card-head {
background-color: #f5f7fa;
}
@ -354,6 +366,7 @@ export default {
.ivu-btn {
font-size: 13px;
}
.paramsGroup {
flex-wrap: wrap;
display: flex;

View File

@ -114,7 +114,7 @@ export default {
formValidate: {
specName: [
regular.REQUIRED,
regular.VARCHAR20
// regular.VARCHAR20
],
specValue: [
regular.REQUIRED,

View File

@ -33,7 +33,7 @@
>删除
</Button>
<Button
v-show="scope.row.level != 2"
v-show="scope.row.level != 1"
type="success"
@click="addChildren(scope.row)"
size="small"
@ -65,14 +65,14 @@
/>
</FormItem>
</div>
<FormItem label="分类名称" prop="name">
<FormItem label="分类名称" prop="articleCategoryName">
<Input
v-model="formAdd.articleCategoryName"
clearable
style="width: 100%"
/>
</FormItem>
<FormItem label="排序值" prop="sort" style="width: 345px">
<FormItem label="排序值" prop="sort">
<InputNumber v-model="formAdd.sort"></InputNumber>
</FormItem>
</Form>
@ -94,7 +94,7 @@ import {
} from "@/api/pages";
import TreeTable from "@/views/my-components/tree-table/Table/Table";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import { regular } from "@/utils";
export default {
name: "lili-components",
components: {
@ -114,12 +114,21 @@ export default {
formAdd: {
//
parentId: "",
name: "",
sort: 1,
level: 0,
articleCategoryName:""
},
//
formValidate: {},
formValidate: {
articleCategoryName:[
regular.REQUIRED,
regular.VARCHAR20,
],
sort:[
regular.REQUIRED,
regular.INTEGER
]
},
columns: [
{
title: "分类名称",

View File

@ -101,10 +101,7 @@ export default {
}
this.formValidate.pointSettingItems.push({
point: "0",
day:
this.formValidate.pointSettingItems[
this.formValidate.pointSettingItems.length - 1
].day + 1,
day: this.formValidate.pointSettingItems.length ,
});
},
//

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: [

View File

@ -98,9 +98,11 @@ div.base-info-item {
line-height: 40px;
text-align: left;
}
>div{
> div {
padding-left: 5%;
}
.form-item-view {
display: flex;
flex-direction: column;
@ -110,6 +112,8 @@ div.base-info-item {
.layout {
margin-bottom: 20px;
width: 100%;
justify-content: center;
.sku-item-content {
margin: 20px 0;
@ -125,6 +129,12 @@ div.base-info-item {
width: 100%;
}
.ivu-card-body{
width: 100%;
justify-content: center;
align-items: flex-start;
}
.sku-item-content-name {
display: flex;
align-items: flex-start;
@ -132,6 +142,7 @@ div.base-info-item {
width: 100%;
}
}
}
.shop-category-text {
@ -237,15 +248,18 @@ div.base-info-item {
> h1 {
font-size: 28px;
}
> * {
margin: 10px;
}
}
.operation {
> * {
margin: 10px 0;
}
}
/*商品描述*/
.goods-intro {
line-height: 40;
@ -261,6 +275,7 @@ div.base-info-item {
bottom: 0px;
text-align: center;
z-index: 999;
> .ivu-btn {
margin: 0 10px;
}
@ -368,9 +383,7 @@ div.base-info-item {
cursor: pointer;
margin: 0 2px;
}
.ivu-form-item-content {
display: flex;
}
.required {
/deep/ .ivu-form-item-label::before {
content: "*";
@ -382,6 +395,7 @@ div.base-info-item {
color: #ed4014;
}
}
.demo-upload-list {
width: 150px;
height: 150px;
@ -394,10 +408,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;
@ -412,9 +428,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%;
@ -427,9 +445,11 @@ div.base-info-item {
cursor: pointer;
}
}
.active-goods-type {
background: #e8e8e8;
}
.goods-type-list {
max-height: 500px;
overflow-y: auto;
@ -442,31 +462,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>
@ -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",