Merge branch 'liushuai'

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

View File

@ -3,4 +3,7 @@
<component name="JavaScriptSettings"> <component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" /> <option name="languageLevel" value="ES6" />
</component> </component>
<component name="WebPackConfiguration">
<option name="mode" value="DISABLED" />
</component>
</project> </project>

View File

@ -57,3 +57,35 @@ export const URL =
// 固话 // 固话
export const TEL = /0\d{2,3}-\d{7,8}/ export const TEL = /0\d{2,3}-\d{7,8}/
// 正整数
export const INTEGER = {
pattern: /^[0-9]\d{0,10}|0$/,
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:'请填写参数'
}

View File

@ -24,11 +24,11 @@ export const cashStatusList = [
label:'待处理' label:'待处理'
}, },
{ {
value:'REFUSE', value:'FAIL_AUDITING',
label:'拒绝' label:'拒绝'
}, },
{ {
value:'PASS', value:'VIA_AUDITING',
label:'通过' label:'通过'
} }
] ]
@ -46,4 +46,4 @@ export const orderStatusList = [
value:'COMPLETE_CASH', value:'COMPLETE_CASH',
label:'提现完成' label:'提现完成'
} }
] ]

View File

@ -1,24 +1,27 @@
<template> <template>
<div> <div>
<Card> <Card>
<Row @keydown.enter.native="handleSearch" > <Form ref="searchForm" :model="searchForm" class="search-form">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form"> <Form-item label="会员名称" class="flex" prop="memberName">
<Form-item label="会员名称"> <Input
<Input class="search-input" v-model="searchForm.memberName"></Input> type="text" v-model="searchForm.memberName"
style="width: 200px"></Input>
</Form-item> </Form-item>
<Form-item label="编号"> <Form-item label="编号" class="flex">
<Input class="search-input" v-model="searchForm.sn"></Input> <Input
type="text" v-model="searchForm.sn"
style="width: 200px"></Input>
</Form-item> </Form-item>
<Form-item label="状态" style="margin-left: -20px"> <Form-item label="状态"
<Select v-model="searchForm.distributionCashStatus" style="width:150px;"> 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> <Option v-for="item in cashStatusList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item style="margin-left:-35px;" class="br"> <Form-item>
<Button @click="handleSearch" type="primary">搜索</Button> <Button @click="handleSearch" type="primary">搜索</Button>
</Form-item> </Form-item>
</Form> </Form>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table> <Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
<Row type="flex" justify="end" class="page padding-row"> <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> <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: "库存", title: "库存",
key: "quantity", key: "quantity",
minWidth: 80,
}, },
{ {
title: "添加时间", title: "添加时间",
key: "createTime", key: "createTime",
width: 170, minWidth: 100,
}, },
{ {
title: "店铺名称", title: "店铺名称",
key: "storeName", key: "storeName",
minWidth: 100,
tooltip: true, tooltip: true,
}, },
{ {
title: "佣金金额", title: "佣金金额",
key: "commission", key: "commission",
minWidth: 100,
sortable: false, sortable: false,
render: (h, params) => { render: (h, params) => {
return h( return h(
@ -134,7 +137,7 @@ export default {
key: "action", key: "action",
align: "center", align: "center",
fixed: "right", fixed: "right",
width: 150, minWidth: 100,
render: (h, params) => { render: (h, params) => {
return h("div", [ return h("div", [
h( h(

View File

@ -2,7 +2,7 @@
<div> <div>
<Card> <Card>
<Form ref="searchForm" @keydown.enter.native="handleSearch" :model="searchForm" inline :label-width="70" class="search-form"> <Form ref="searchForm" @keydown.enter.native="handleSearch" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="订单编号" prop="orderSn"> <Form-item label="订单编号" prop="orderSn">
<Input <Input
type="text" type="text"
v-model="searchForm.orderSn" v-model="searchForm.orderSn"
@ -21,7 +21,7 @@
/> />
</Form-item> </Form-item>
<Form-item label="店铺名称"> <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"> clearable style="width: 150px">
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option> <Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option>
</Select> </Select>
@ -86,22 +86,26 @@
searchForm: { // searchForm: { //
pageNumber: 1, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
sort:"create_time",
order:"desc"
}, },
columns: [ columns: [
{ {
title: "订单编号", title: "订单编号",
key: "orderSn", key: "orderSn",
minWidth: 100, minWidth: 180,
fixed: "left",
tooltip: true tooltip: true
}, },
{ {
title: '商品信息', title: '商品信息',
slot: 'goodsMsg', slot: 'goodsMsg',
minWidth: 120 minWidth: 150
}, },
{ {
title: "退款金额", title: "退款金额",
key: "returnMoney", key: "returnMoney",
minWidth:80,
sortable: false, sortable: false,
render: (h, params) => { render: (h, params) => {
if(params.row.sellBackRebate == null){ if(params.row.sellBackRebate == null){
@ -114,23 +118,24 @@
{ {
title: "分销商", title: "分销商",
key: "distributionName", key: "distributionName",
tooltip: true tooltip: true,
minWidth:80,
}, },
{ {
title: "店铺名称", title: "店铺名称",
key: "storeName", key: "storeName",
minWidth:80,
tooltip: true tooltip: true
}, },
{ {
title: "状态", title: "状态",
slot: "distributionOrderStatus", slot: "distributionOrderStatus",
width: 120, minWidth:80,
}, },
{ {
title: "佣金金额", title: "佣金金额",
key: "rebateGrade", key: "rebateGrade",
width: 120, minWidth:80,
sortable: false, sortable: false,
render: (h, params) => { render: (h, params) => {
if(params.row.rebate == null){ if(params.row.rebate == null){
@ -142,9 +147,10 @@
} }
}, },
{ {
fixed: "right",
title: "创建时间", title: "创建时间",
key: "createTime", key: "createTime",
width: 180, minWidth:100,
sortable: false, sortable: false,
} }
], ],

View File

@ -1,20 +1,20 @@
<template> <template>
<div style="background-color: #fff;"> <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> <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"> <i-switch size="large" v-model="form.isOpen" :true-value="true" :false-value="false">
<span slot="open">开启</span> <span slot="open">开启</span>
<span slot="close">关闭</span> <span slot="close">关闭</span>
</i-switch> </i-switch>
</FormItem> </FormItem>
<FormItem label="分销关系绑定天数" prop="distributionDay"> <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>
<FormItem label="分销结算天数" prop="cashDay"> <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>
<FormItem> <FormItem>
<Button type="primary" @click="submit"></Button> <Button type="primary" @click="submit"></Button>
@ -25,15 +25,27 @@
<script> <script>
import { setSetting, getSetting } from "@/api/index"; import { setSetting, getSetting } from "@/api/index";
import { regular } from "@/utils";
export default { export default {
name: "distributionSetting", name: "distributionSetting",
data() { data() {
return { return {
form: { form: {
// //
isOpen: "", isOpen: true,
distributionDay: 0, // distributionDay: 0, //
cashDay: 0, // cashDay: 0, //
},
formRule: {
isOpen: [
regular.REQUIRED
],
distributionDay: [
regular.REQUIRED
],
cashDay: [
regular.REQUIRED
],
} }
}; };
}, },

View File

@ -57,6 +57,9 @@ import {
updateGoodsUnit, updateGoodsUnit,
delGoodsUnit delGoodsUnit
} from "@/api/index"; } from "@/api/index";
import {regular} from "@/utils";
export default { export default {
name: "goods-unit", name: "goods-unit",
data() { data() {
@ -79,12 +82,9 @@ export default {
// //
formValidate: { formValidate: {
name: [ name: [
{ regular.REQUIRED,
required: true, regular.VARCHAR5
message: "请输入计量单位", ]
trigger: "blur",
},
],
}, },
submitLoading: false, // submitLoading: false, //
selectList: [], // selectList: [], //

View File

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

View File

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

View File

@ -1,9 +1,10 @@
<template> <template>
<div class="search"> <div class="search">
<Card> <Card>
<Form ref="searchForm" @keydown.enter.native="handleSearch" :model="searchForm" inline :label-width="70" class="search-form"> <Form ref="searchForm" @keydown.enter.native="handleSearch" :model="searchForm" inline :label-width="70"
class="search-form">
<Form-item label="品牌名称"> <Form-item label="品牌名称">
<Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px" /> <Input type="text" v-model="searchForm.name" placeholder="请输入品牌名称" clearable style="width: 200px"/>
</Form-item> </Form-item>
<Button @click="handleSearch" type="primary">搜索</Button> <Button @click="handleSearch" type="primary">搜索</Button>
</Form> </Form>
@ -12,14 +13,15 @@
</Row> </Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table"></Table> <Table :loading="loading" border :columns="columns" :data="data" ref="table"></Table>
<Row type="flex" justify="end" class="mt_10"> <Row type="flex" justify="end" class="mt_10">
<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" <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
show-total show-elevator show-sizer></Page> @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </Card>
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500"> <Modal :title="modalTitle" v-model="modalVisible" :mask-closable="false" :width="500">
<Form ref="form" :model="form" :label-width="100" :rules="formValidate"> <Form ref="form" :model="form" :label-width="100" :rules="formValidate">
<FormItem label="品牌名称" prop="name"> <FormItem label="品牌名称" prop="name">
<Input v-model="form.name" clearable style="width: 100%" /> <Input v-model="form.name" clearable style="width: 100%"/>
</FormItem> </FormItem>
<FormItem label="品牌图标" prop="logo"> <FormItem label="品牌图标" prop="logo">
<upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input> <upload-pic-input v-model="form.logo" style="width: 100%"></upload-pic-input>
@ -43,6 +45,8 @@ import {
} from "@/api/goods"; } from "@/api/goods";
import uploadPicInput from "@/views/my-components/lili/upload-pic-input"; import uploadPicInput from "@/views/my-components/lili/upload-pic-input";
import {regular} from "@/utils";
export default { export default {
name: "brand", name: "brand",
components: { components: {
@ -68,7 +72,16 @@ export default {
deleteFlag: "", deleteFlag: "",
}, },
// //
formValidate: {}, formValidate: {
name: [
regular.REQUIRED,
regular.VARCHAR20
],
logo: [
regular.REQUIRED,
regular.URL200
],
},
submitLoading: false, // submitLoading: false, //
columns: [ columns: [
{ {
@ -104,9 +117,9 @@ export default {
align: "left", align: "left",
render: (h, params) => { render: (h, params) => {
if (params.row.deleteFlag == 0) { if (params.row.deleteFlag == 0) {
return h("Tag", {props: {color: "green",},},"启用"); return h("Tag", {props: {color: "green",},}, "启用");
} else if (params.row.deleteFlag == 1) { } else if (params.row.deleteFlag == 1) {
return h("Tag", {props: {color: "volcano",},},"禁用"); return h("Tag", {props: {color: "volcano",},}, "禁用");
} }
}, },
filters: [ filters: [
@ -323,7 +336,7 @@ export default {
content: "您确认要启用品牌 " + v.name + " ?", content: "您确认要启用品牌 " + v.name + " ?",
loading: true, loading: true,
onOk: () => { onOk: () => {
disableBrand(v.id, { disable: false }).then((res) => { disableBrand(v.id, {disable: false}).then((res) => {
this.$Modal.remove(); this.$Modal.remove();
if (res.success) { if (res.success) {
this.$Message.success("操作成功"); this.$Message.success("操作成功");
@ -340,7 +353,7 @@ export default {
content: "您确认要禁用品牌 " + v.name + " ?", content: "您确认要禁用品牌 " + v.name + " ?",
loading: true, loading: true,
onOk: () => { onOk: () => {
disableBrand(v.id, { disable: true }).then((res) => { disableBrand(v.id, {disable: true}).then((res) => {
this.$Modal.remove(); this.$Modal.remove();
if (res.success) { if (res.success) {
this.$Message.success("操作成功"); this.$Message.success("操作成功");

View File

@ -171,9 +171,17 @@ export default {
// //
formValidate: { formValidate: {
commissionRate: [ commissionRate: [
{ required: true, message: "请填写佣金比例" }, regular.REQUIRED,
{ pattern: regular.Integer, message: "佣金比例不能为负" }, regular.INTEGER
], ],
name:[
regular.REQUIRED,
regular.VARCHAR20,
],
sortOrder:[
regular.REQUIRED,
regular.INTEGER
]
}, },
columns: [ columns: [
{ {
@ -475,4 +483,4 @@ export default {
min-height: 100vh; min-height: 100vh;
height: auto; height: auto;
} }
</style> </style>

View File

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

View File

@ -56,7 +56,8 @@
:mask-closable="false" :mask-closable="false"
:width="500" :width="500"
> >
<Form ref="form" :model="form" :label-width="100"> <Form ref="form" :model="form" :label-width="100"
:rules="formValidate">
<FormItem label="规格名称" prop="specName"> <FormItem label="规格名称" prop="specName">
<Input v-model="form.specName" maxlength="30" clearable style="width: 100%"/> <Input v-model="form.specName" maxlength="30" clearable style="width: 100%"/>
</FormItem> </FormItem>
@ -92,6 +93,7 @@ import {
delSpec delSpec
} from "@/api/goods"; } from "@/api/goods";
import {regular} from "@/utils";
export default { export default {
name: "spec", name: "spec",
components: {}, components: {},
@ -108,6 +110,17 @@ export default {
sort: "createTime", // sort: "createTime", //
order: "asc", // order: "asc", //
}, },
//
formValidate: {
specName: [
regular.REQUIRED,
// regular.VARCHAR20
],
specValue: [
regular.REQUIRED,
regular.VARCHAR255
],
},
form: { form: {
// //
specName: "", specName: "",
@ -280,6 +293,7 @@ export default {
this.modalType = 0; this.modalType = 0;
this.modalTitle = "添加"; this.modalTitle = "添加";
this.$refs.form.resetFields(); this.$refs.form.resetFields();
this.specValue = '';
delete this.form.id; delete this.form.id;
this.modalVisible = true; this.modalVisible = true;
}, },

View File

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

View File

@ -63,7 +63,7 @@ export default {
data() { data() {
return { return {
handleSubmit, // handleSubmit, //
picModelFlag: false, // picModelFlag: false, //
formValidate: { // formValidate: { //
buyerSideLogo: "", buyerSideLogo: "",

View File

@ -0,0 +1,87 @@
<template>
<div class="layout">
<Form ref="formValidate" :label-width="150" label-position="right" :model="formValidate" :rules="ruleValidate">
<FormItem label="云IM地址" prop="httpUrl">
<Input v-model="formValidate.httpUrl"/>
</FormItem>
<FormItem label="平台ID" class="label-item" prop="tenantId">
<Input v-model="formValidate.tenantId"/>
</FormItem>
<div class="label-btns">
<Button type="primary" @click="submit('formValidate')"></Button>
</div>
</Form>
</div>
</template>
<script>
import {setSetting} from "@/api/index";
import {handleSubmit} from "./validate";
export default {
data() {
return {
ruleValidate: {}, //
formValidate: { //
httpUrl: "",
tenantId: ""
},
};
},
props: ["res", "type"],
created() {
this.init();
},
methods: {
//
submit(name) {
let that = this;
if (handleSubmit(that, name)) {
this.setupSetting()
}
},
//
setupSetting() {
setSetting(this.type, this.formValidate).then((res) => {
if (res.success) {
this.$Message.success("保存成功!");
} else {
this.$Message.error("保存失败!");
}
});
},
//
init() {
this.res = JSON.parse(this.res);
this.$set(this, "formValidate", {...this.res});
Object.keys(this.formValidate).forEach((item) => {
this.ruleValidate[item] = [
{
required: true,
message: "请填写必填项",
trigger: "blur",
},
];
});
},
},
};
</script>
<style lang="scss" scoped>
@import "./style.scss";
.label-item {
display: flex;
}
/deep/ .ivu-input {
width: 300px !important;
margin: 0 10px;
}
.ivu-input-wrapper {
width: 300px;
margin-right: 10px;
}
</style>

View File

@ -6,7 +6,7 @@
<span slot="prepend">1积分=</span> <span slot="prepend">1积分=</span>
<span slot="append">人民币</span> <span slot="append">人民币</span>
</Input> </Input>
</FormItem> </FormItem>
<FormItem label="注册账号" prop="register"> <FormItem label="注册账号" prop="register">
@ -101,10 +101,7 @@ export default {
} }
this.formValidate.pointSettingItems.push({ this.formValidate.pointSettingItems.push({
point: "0", point: "0",
day: day: this.formValidate.pointSettingItems.length ,
this.formValidate.pointSettingItems[
this.formValidate.pointSettingItems.length - 1
].day + 1,
}); });
}, },
// //

View File

@ -57,6 +57,11 @@ export default {
type: "SMS_SETTING", type: "SMS_SETTING",
name: "阿里短信配置", name: "阿里短信配置",
}, },
//
{
type: "IM_SETTING",
name: "客服设置",
},
], ],
authLogin: [ authLogin: [
// //

View File

@ -5,6 +5,7 @@ import POINT_SETTING from "./setting/POINT_SETTING";
import KUAIDI_SETTING from "./setting/KUAIDI_SETTING"; import KUAIDI_SETTING from "./setting/KUAIDI_SETTING";
import OSS_SETTING from "./setting/OSS_SETTING"; import OSS_SETTING from "./setting/OSS_SETTING";
import SMS_SETTING from "./setting/SMS_SETTING"; import SMS_SETTING from "./setting/SMS_SETTING";
import IM_SETTING from "./setting/IM_SETTING";
import WITHDRAWAL_SETTING from "./setting/WITHDRAWAL_SETTING"; import WITHDRAWAL_SETTING from "./setting/WITHDRAWAL_SETTING";
import ALIPAY_PAYMENT from "./pay/ALIPAY_PAYMENT"; import ALIPAY_PAYMENT from "./pay/ALIPAY_PAYMENT";
import WECHAT_PAYMENT from "./pay/WECHAT_PAYMENT"; import WECHAT_PAYMENT from "./pay/WECHAT_PAYMENT";
@ -20,6 +21,7 @@ export default {
KUAIDI_SETTING, KUAIDI_SETTING,
OSS_SETTING, OSS_SETTING,
SMS_SETTING, SMS_SETTING,
IM_SETTING,
WITHDRAWAL_SETTING, WITHDRAWAL_SETTING,
PAYMENT_SUPPORT, PAYMENT_SUPPORT,
WECHAT_PAYMENT, WECHAT_PAYMENT,

View File

@ -57,3 +57,43 @@ export const URL =
// 固话 // 固话
export const TEL = /0\d{2,3}-\d{7,8}/ 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, // pageNumber: 1, //
pageSize: 10, // pageSize: 10, //
sort:"create_time",
order:"desc"
}, },
columns: [ 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 TreeTable from "@/views/my-components/tree-table/Table/Table";
import { regular } from "@/utils";
import {VARCHAR20} from "../../../utils/regular";
export default { export default {
name: "store-category", name: "store-category",
components: { components: {
@ -98,11 +101,12 @@ export default {
// //
formValidate: { formValidate: {
labelName: [ labelName: [
{ regular.REQUIRED,
required: true, regular.VARCHAR20
message: "请输入分类名称", ],
trigger: "blur", sortOrder: [
}, regular.REQUIRED,
regular.INTEGER
], ],
}, },
columns: [ columns: [
@ -128,7 +132,7 @@ export default {
}, },
methods: { methods: {
// //
init() { init() {
this.getAllList(); this.getAllList();
}, },
// //

View File

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

View File

@ -6,20 +6,20 @@
<Form-item label="商品名称" prop="goodsName"> <Form-item label="商品名称" prop="goodsName">
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" /> <Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" />
</Form-item> </Form-item>
<Form-item label="商品编号" prop="id">
<Form-item label="状态" prop="status"> <Input
<Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px"> type="text"
<Option value="DOWN">下架</Option> v-model="searchForm.id"
<Option value="UPPER">上架</Option> placeholder="商品编号"
</Select> clearable
style="width: 200px"
/>
</Form-item> </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"> <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-item>
</Form> </Form>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table> <Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
@ -51,7 +51,7 @@ export default {
columns: [ columns: [
// //
{ {
title: "ID", title: "编号",
key: "id", key: "id",
minWidth: 120, minWidth: 120,
}, },
@ -91,11 +91,6 @@ export default {
); );
}, },
}, },
{
title: "商品库存",
key: "quantity",
},
{ {
title: "创建时间", title: "创建时间",
key: "createTime", key: "createTime",
@ -206,7 +201,6 @@ export default {
// //
this.getDataList(); this.getDataList();
}, },
// //
getDataList() { getDataList() {
this.loading = true; this.loading = true;

View File

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