发布商品代码拆分完成,管理端订单设置修改
parent
0504592f7d
commit
f5faad982c
|
@ -17,14 +17,14 @@ export default {
|
||||||
* @description api请求基础路径
|
* @description api请求基础路径
|
||||||
*/
|
*/
|
||||||
api_dev: {
|
api_dev: {
|
||||||
common: "https://common-api.pickmall.cn",
|
// common: "https://common-api.pickmall.cn",
|
||||||
buyer: "https://buyer-api.pickmall.cn",
|
// buyer: "https://buyer-api.pickmall.cn",
|
||||||
seller: "https://store-api.pickmall.cn",
|
// seller: "https://store-api.pickmall.cn",
|
||||||
manager: "https://admin-api.pickmall.cn"
|
// manager: "https://admin-api.pickmall.cn"
|
||||||
// common: 'http://192.168.0.106:8890',
|
common: 'http://192.168.0.103:8890',
|
||||||
// buyer: 'http://192.168.0.106:8888',
|
buyer: 'http://192.168.0.103:8888',
|
||||||
// seller: 'http://192.168.0.106:8889',
|
seller: 'http://192.168.0.103:8889',
|
||||||
// manager: 'http://192.168.0.106:8887'
|
manager: 'http://192.168.0.103:8887'
|
||||||
},
|
},
|
||||||
api_prod: {
|
api_prod: {
|
||||||
common: "https://common-api.pickmall.cn",
|
common: "https://common-api.pickmall.cn",
|
||||||
|
|
|
@ -1,43 +1,38 @@
|
||||||
<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-item label="订单号" prop="orderSn">
|
||||||
|
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 160px" />
|
||||||
|
</Form-item>
|
||||||
|
<Form-item label="会员名称" prop="buyerName">
|
||||||
|
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
|
||||||
|
</Form-item>
|
||||||
|
|
||||||
<Row @keydown.enter.native="handleSearch">
|
<Form-item label="订单类型" prop="orderType">
|
||||||
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
|
<Select v-model="searchForm.orderType" placeholder="请选择" clearable style="width: 160px">
|
||||||
<Form-item label="订单号" prop="orderSn">
|
<Option value="NORMAL">普通订单</Option>
|
||||||
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 160px" />
|
<Option value="PINTUAN">拼团订单</Option>
|
||||||
</Form-item>
|
<Option value="GIFT">赠品订单</Option>
|
||||||
<Form-item label="会员名称" prop="buyerName">
|
<Option value="VIRTUAL">核验订单</Option>
|
||||||
<Input type="text" v-model="searchForm.buyerName" placeholder="请输入会员名称" clearable style="width: 160px" />
|
</Select>
|
||||||
</Form-item>
|
</Form-item>
|
||||||
|
<Form-item label="订单状态" prop="orderStatus">
|
||||||
<Form-item label="订单类型" prop="orderType">
|
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
||||||
<Select v-model="searchForm.orderType" placeholder="请选择" clearable style="width: 160px">
|
<Option value="UNPAID">未付款</Option>
|
||||||
<Option value="NORMAL">普通订单</Option>
|
<Option value="PAID">已付款</Option>
|
||||||
<Option value="PINTUAN">拼团订单</Option>
|
<Option value="UNDELIVERED">待发货</Option>
|
||||||
<Option value="GIFT">赠品订单</Option>
|
<Option value="DELIVERED">已发货</Option>
|
||||||
<Option value="VIRTUAL">核验订单</Option>
|
<Option value="COMPLETED">已完成</Option>
|
||||||
</Select>
|
<Option value="TAKE">待核验</Option>
|
||||||
</Form-item>
|
<Option value="CANCELLED">已取消</Option>
|
||||||
<Form-item label="订单状态" prop="orderStatus">
|
</Select>
|
||||||
<Select v-model="searchForm.orderStatus" placeholder="请选择" clearable style="width: 160px">
|
</Form-item>
|
||||||
<Option value="UNPAID">未付款</Option>
|
<Form-item label="下单时间">
|
||||||
<Option value="PAID">已付款</Option>
|
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
|
||||||
<Option value="UNDELIVERED">待发货</Option>
|
</Form-item>
|
||||||
<Option value="DELIVERED">已发货</Option>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
<Option value="COMPLETED">已完成</Option>
|
</Form>
|
||||||
<Option value="TAKE">待核验</Option>
|
|
||||||
<Option value="CANCELLED">已取消</Option>
|
|
||||||
</Select>
|
|
||||||
</Form-item>
|
|
||||||
|
|
||||||
<Form-item label="下单时间">
|
|
||||||
<DatePicker v-model="selectDate" type="datetimerange" format="yyyy-MM-dd" clearable @on-change="selectDateRange" placeholder="选择起始时间" style="width: 160px"></DatePicker>
|
|
||||||
</Form-item>
|
|
||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
|
||||||
</Form>
|
|
||||||
</Row>
|
|
||||||
<div>
|
<div>
|
||||||
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
|
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
|
||||||
<Button type="info" class="export">
|
<Button type="info" class="export">
|
||||||
|
|
|
@ -12,13 +12,7 @@
|
||||||
<Input type='number' v-model="formValidate.autoReceive">
|
<Input type='number' v-model="formValidate.autoReceive">
|
||||||
<span slot="append">天</span>
|
<span slot="append">天</span>
|
||||||
</Input>
|
</Input>
|
||||||
|
<span class="desc">收货后,订单完成</span>
|
||||||
</FormItem>
|
|
||||||
<FormItem label="订单自动完成" prop="autoComplete">
|
|
||||||
<Input type='number' v-model="formValidate.autoComplete">
|
|
||||||
<span slot="append">天</span>
|
|
||||||
</Input>
|
|
||||||
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem label="自动评价" prop="autoEvaluation">
|
<FormItem label="自动评价" prop="autoEvaluation">
|
||||||
|
@ -27,11 +21,17 @@
|
||||||
</Input>
|
</Input>
|
||||||
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="售后自动取消" prop="autoCancelAfterSale">
|
<FormItem label="已完成订单允许退单" prop="closeAfterSale">
|
||||||
<Input type='number' v-model="formValidate.autoCancelAfterSale">
|
<Input type='number' v-model="formValidate.closeAfterSale">
|
||||||
<span slot="append">天</span>
|
<span slot="append">天</span>
|
||||||
</Input>
|
</Input>
|
||||||
|
<span class="desc">如果天数为0,则不允许退单</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="已完成订单允许投诉" prop="closeComplaint">
|
||||||
|
<Input type='number' v-model="formValidate.closeComplaint">
|
||||||
|
<span slot="append">天</span>
|
||||||
|
</Input>
|
||||||
|
<span class="desc">如果天数为0,则不允许投诉</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<div class="label-btns">
|
<div class="label-btns">
|
||||||
|
@ -50,10 +50,10 @@ export default {
|
||||||
ruleValidate: {}, // 验证规则
|
ruleValidate: {}, // 验证规则
|
||||||
formValidate: { // 表单数据
|
formValidate: { // 表单数据
|
||||||
autoCancel: "",
|
autoCancel: "",
|
||||||
autoComplete: "",
|
|
||||||
autoEvaluation: "",
|
autoEvaluation: "",
|
||||||
autoReceive: "",
|
autoReceive: "",
|
||||||
autoCancelAfterSale: "",
|
closeAfterSale: "",
|
||||||
|
closeComplaint:""
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -121,4 +121,8 @@ export default {
|
||||||
/deep/ .ivu-input {
|
/deep/ .ivu-input {
|
||||||
width: 100px !important;
|
width: 100px !important;
|
||||||
}
|
}
|
||||||
|
.desc {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
</steps>
|
</steps>
|
||||||
</div>
|
</div>
|
||||||
<!-- 第一步 选择分类 -->
|
<!-- 第一步 选择分类 -->
|
||||||
<first-step ref='first' v-show="activestep === 0"></first-step>
|
<first-step ref='first' v-show="activestep === 0" @change="getFirstData"></first-step>
|
||||||
<!-- 第二步 商品详细信息 -->
|
<!-- 第二步 商品详细信息 -->
|
||||||
<second-step ref='second' v-if="activestep === 1"></second-step>
|
<second-step ref='second' :firstData="firstData" v-if="activestep === 1"></second-step>
|
||||||
<!-- 第三步 发布完成 -->
|
<!-- 第三步 发布完成 -->
|
||||||
<third-step ref='third' v-if="activestep === 2"></third-step>
|
<third-step ref='third' v-if="activestep === 2"></third-step>
|
||||||
|
|
||||||
|
@ -33,20 +33,24 @@ export default {
|
||||||
return {
|
return {
|
||||||
/** 当前激活步骤*/
|
/** 当前激活步骤*/
|
||||||
activestep: 0,
|
activestep: 0,
|
||||||
|
firstData: {}, // 第一步传递的数据
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
getFirstData (item) {
|
||||||
|
this.firstData = item;
|
||||||
|
this.activestep = 1;
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 编辑商品、模板
|
// 编辑商品、模板
|
||||||
if (this.$route.query.id || this.$route.query.draftId) {
|
if (this.$route.query.id || this.$route.query.draftId) {
|
||||||
this.activestep = 1;
|
this.activestep = 1;
|
||||||
} else {
|
} else {
|
||||||
this.activestep = 0
|
this.activestep = 0
|
||||||
|
this.$refs.first.selectGoodsType = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
<div v-else class="goods-type-list">
|
<div v-else class="goods-type-list">
|
||||||
<h2 @click="showGoodsTemplates = !showGoodsTemplates">返回</h2>
|
<h2 @click="showGoodsTemplates = !showGoodsTemplates">返回</h2>
|
||||||
<div class="goods-type-item template-item" @click="handleClickGoodsTemplate(item)"
|
<div class="goods-type-item template-item" @click="handleClickGoodsTemplate(item)"
|
||||||
v-for="(item,index) in goodsTemplates" :key="index">
|
v-for="(item,tempIndex) in goodsTemplates" :key="tempIndex">
|
||||||
<img :src="item.thumbnail"/>
|
<img :src="item.thumbnail" />
|
||||||
<div>
|
<div>
|
||||||
<h2>{{ item.goodsName }}</h2>
|
<h2>{{ item.goodsName }}</h2>
|
||||||
<p>{{ item.sellingPoint || '' }}</p>
|
<p>{{ item.sellingPoint || '' }}</p>
|
||||||
|
@ -54,8 +54,8 @@
|
||||||
<span v-show="category[1].name">> {{ category[1].name }}</span>
|
<span v-show="category[1].name">> {{ category[1].name }}</span>
|
||||||
<span v-show="category[2].name">> {{ category[2].name }}</span>
|
<span v-show="category[2].name">> {{ category[2].name }}</span>
|
||||||
</p>
|
</p>
|
||||||
<template>
|
<template v-if="selectedTemplate.goodsName">
|
||||||
<Divider>已选商品模版:{{checkedTemplate()}}</Divider>
|
<Divider>已选商品模版:{{selectedTemplate.goodsName}}</Divider>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
|
@ -69,11 +69,10 @@
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import * as API_GOODS from "@/api/goods";
|
import * as API_GOODS from "@/api/goods";
|
||||||
import bus from '@/libs/eventBus'
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
draftId: '',
|
selectedTemplate: {}, // 已选模板
|
||||||
selectGoodsType: false, // 展示选择商品分类modal
|
selectGoodsType: false, // 展示选择商品分类modal
|
||||||
goodsTemplates: [], // 商品模板列表
|
goodsTemplates: [], // 商品模板列表
|
||||||
showGoodsTemplates: false, //是否显示选择商品模板
|
showGoodsTemplates: false, //是否显示选择商品模板
|
||||||
|
@ -118,14 +117,6 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 获取已选模板
|
|
||||||
checkedTemplate () {
|
|
||||||
if(this.goodsTemplates.length) {
|
|
||||||
return this.goodsTemplates.find(item=>{return item.id == this.draftId}).goodsName
|
|
||||||
} else {
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 点击商品类型
|
// 点击商品类型
|
||||||
handleClickGoodsType(val) {
|
handleClickGoodsType(val) {
|
||||||
this.goodsTypeWay.map((item) => {
|
this.goodsTypeWay.map((item) => {
|
||||||
|
@ -134,18 +125,26 @@ export default {
|
||||||
|
|
||||||
val.check = !val.check;
|
val.check = !val.check;
|
||||||
if (!val.type) {
|
if (!val.type) {
|
||||||
this.showGoodsTemplates = true;
|
|
||||||
this.GET_GoodsTemplate()
|
this.GET_GoodsTemplate()
|
||||||
|
this.showGoodsTemplates = true;
|
||||||
} else {
|
} else {
|
||||||
this.goodsType = val.type;
|
this.goodsType = val.type;
|
||||||
|
this.selectedTemplate = {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 点击商品模板
|
||||||
|
handleClickGoodsTemplate(val) {
|
||||||
|
console.log(val);
|
||||||
|
this.selectedTemplate = val;
|
||||||
|
this.selectGoodsType = false;
|
||||||
|
this.$emit('change', {tempId: val.id})
|
||||||
|
},
|
||||||
// 获取商品模板
|
// 获取商品模板
|
||||||
GET_GoodsTemplate() {
|
GET_GoodsTemplate() {
|
||||||
let searchParams = {
|
let searchParams = {
|
||||||
saveType: "TEMPLATE",
|
saveType: "TEMPLATE",
|
||||||
sort: "create_time",
|
sort: "create_time",
|
||||||
order: "desc",
|
order: "desc"
|
||||||
};
|
};
|
||||||
API_GOODS.getDraftGoodsListData(searchParams).then((res) => {
|
API_GOODS.getDraftGoodsListData(searchParams).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
@ -153,10 +152,6 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 选择商品模板
|
|
||||||
handleClickGoodsTemplate(val) {
|
|
||||||
this.selectGoodsType = false;
|
|
||||||
},
|
|
||||||
/** 选择商城商品分类 */
|
/** 选择商城商品分类 */
|
||||||
handleSelectCategory(row, index, level) {
|
handleSelectCategory(row, index, level) {
|
||||||
if (level === 1) {
|
if (level === 1) {
|
||||||
|
@ -178,10 +173,6 @@ export default {
|
||||||
this.category[2].name = row.name
|
this.category[2].name = row.name
|
||||||
this.category[2].id = row.id
|
this.category[2].id = row.id
|
||||||
}
|
}
|
||||||
// 设置当前商品分类ID
|
|
||||||
// this.baseInfoForm.categoryId = row.id;
|
|
||||||
// this.categoryId = row.id;
|
|
||||||
// this.baseInfoForm.categoryName = row.name;
|
|
||||||
},
|
},
|
||||||
/** 查询下一级 商城商品分类*/
|
/** 查询下一级 商城商品分类*/
|
||||||
GET_NextLevelCategory(row) {
|
GET_NextLevelCategory(row) {
|
||||||
|
@ -195,11 +186,8 @@ export default {
|
||||||
// 下一步
|
// 下一步
|
||||||
next() {
|
next() {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
/** 1级校验 */
|
if (!this.goodsType && !this.selectedTemplate.goodsName) {
|
||||||
this.loading = true;
|
|
||||||
if (!this.goodsType) {
|
|
||||||
this.$Message.error('请选择商品类型')
|
this.$Message.error('请选择商品类型')
|
||||||
this.loading = false;
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (!this.category[0].name) {
|
if (!this.category[0].name) {
|
||||||
|
@ -209,13 +197,17 @@ export default {
|
||||||
this.$Message.error("必须选择到三级分类");
|
this.$Message.error("必须选择到三级分类");
|
||||||
return;
|
return;
|
||||||
} else if (this.category[2].name) {
|
} else if (this.category[2].name) {
|
||||||
this.$parent.activestep = 1;
|
if (this.selectedTemplate.id) {
|
||||||
|
this.$emit('change',{tempId: this.selectedTemplate.id})
|
||||||
|
} else {
|
||||||
|
this.$emit('change',{category: this.category,goodsType:this.goodsType})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.GET_NextLevelCategory()
|
this.GET_NextLevelCategory()
|
||||||
this.selectGoodsType = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
<h4>基本信息</h4>
|
<h4>基本信息</h4>
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem label="商品分类">
|
<FormItem label="商品分类">
|
||||||
<span class="goods-category-name">{{ activeCategoryName1 }}</span>
|
<span class="goods-category-name">{{ this.baseInfoForm.categoryName[0] }}</span>
|
||||||
<span v-show="activeCategoryName2">> {{ activeCategoryName2 }}</span>
|
<span> > {{ this.baseInfoForm.categoryName[1] }}</span>
|
||||||
<span v-show="activeCategoryName3">> {{ activeCategoryName3 }}</span>
|
<span> > {{ this.baseInfoForm.categoryName[2] }}</span>
|
||||||
<span v-if="!activeCategoryName1" v-html="baseInfoForm.category_name"></span>
|
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="商品名称" prop="goodsName">
|
<FormItem label="商品名称" prop="goodsName">
|
||||||
<Input type="text" v-model="baseInfoForm.goodsName" placeholder="商品名称" clearable style="width: 260px"/>
|
<Input type="text" v-model="baseInfoForm.goodsName" placeholder="商品名称" clearable style="width: 260px"/>
|
||||||
|
@ -169,18 +169,24 @@
|
||||||
<img v-if="previewPicture !== ''" :src="previewPicture"/>
|
<img v-if="previewPicture !== ''" :src="previewPicture"/>
|
||||||
</div>
|
</div>
|
||||||
<Divider/>
|
<Divider/>
|
||||||
<div class="sku-upload-list" v-for="(img, __index) in selectedSku.images" :key="__index">
|
<vuedraggable
|
||||||
<template v-if="img.status === 'finished'">
|
:list="baseInfoForm.goodsGalleryFiles"
|
||||||
<img :src="img.url"/>
|
:animation="200"
|
||||||
<div class="sku-upload-list-cover">
|
style="display:inline-block;"
|
||||||
<Icon type="ios-eye-outline" @click="handleView(img.url)"></Icon>
|
>
|
||||||
<Icon type="ios-trash-outline" @click="handleRemove(img, __index)"></Icon>
|
<div class="sku-upload-list" v-for="(img, __index) in selectedSku.images" :key="__index">
|
||||||
</div>
|
<template v-if="img.status === 'finished'">
|
||||||
</template>
|
<img :src="img.url"/>
|
||||||
<template v-else>
|
<div class="sku-upload-list-cover">
|
||||||
<Progress v-if="img.showProgress" :percent="img.percentage" hide-info></Progress>
|
<Icon type="ios-eye-outline" @click="handleView(img.url)"></Icon>
|
||||||
</template>
|
<Icon type="ios-trash-outline" @click="handleRemove(img, __index)"></Icon>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<Progress v-if="img.showProgress" :percent="img.percentage" hide-info></Progress>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</vuedraggable>
|
||||||
<Upload ref="uploadSku" :show-upload-list="false" :default-file-list="row.images"
|
<Upload ref="uploadSku" :show-upload-list="false" :default-file-list="row.images"
|
||||||
:on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
|
:on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
|
||||||
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
|
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
|
||||||
|
@ -193,7 +199,6 @@
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
@ -254,20 +259,20 @@
|
||||||
<div class="form-item-view">
|
<div class="form-item-view">
|
||||||
<FormItem class="form-item-view-el" label="商品发布" prop="release">
|
<FormItem class="form-item-view-el" label="商品发布" prop="release">
|
||||||
<RadioGroup type="button" button-style="solid" v-model="baseInfoForm.release">
|
<RadioGroup type="button" button-style="solid" v-model="baseInfoForm.release">
|
||||||
<Radio title="立即发布" label="true">
|
<Radio title="立即发布" :label="true">
|
||||||
<span>立即发布</span>
|
<span>立即发布</span>
|
||||||
</Radio>
|
</Radio>
|
||||||
<Radio title="放入仓库" label="false">
|
<Radio title="放入仓库" :label="false">
|
||||||
<span>放入仓库</span>
|
<span>放入仓库</span>
|
||||||
</Radio>
|
</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem class="form-item-view-el" label="商品推荐" prop="skuList">
|
<FormItem class="form-item-view-el" label="商品推荐" prop="skuList">
|
||||||
<RadioGroup type="button" button-style="solid" v-model="baseInfoForm.recommend">
|
<RadioGroup type="button" button-style="solid" v-model="baseInfoForm.recommend">
|
||||||
<Radio title="推荐" label="true">
|
<Radio title="推荐" :label="true">
|
||||||
<span>推荐</span>
|
<span>推荐</span>
|
||||||
</Radio>
|
</Radio>
|
||||||
<Radio title="不推荐" label="false">
|
<Radio title="不推荐" :label="false">
|
||||||
<span>不推荐</span>
|
<span>不推荐</span>
|
||||||
</Radio>
|
</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
|
@ -275,9 +280,9 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-item-view-bottom">
|
<div class="form-item-view-bottom">
|
||||||
<Collapse v-model="params_panel" v-for="(paramsGroup,groupIndex) in goodsParams"
|
<Collapse v-model="params_panel" v-for="(paramsGroup,groupIndex) in goodsParams"
|
||||||
:title="paramsGroup.groupName"
|
:title="paramsGroup.groupName"
|
||||||
class="mb_10"
|
class="mb_10"
|
||||||
style="text-align: left" :key="paramsGroup.groupName">
|
style="text-align: left" :key="paramsGroup.groupName">
|
||||||
<Panel :name="paramsGroup.groupName">
|
<Panel :name="paramsGroup.groupName">
|
||||||
{{paramsGroup.groupName}}
|
{{paramsGroup.groupName}}
|
||||||
<p slot="content">
|
<p slot="content">
|
||||||
|
@ -314,7 +319,6 @@
|
||||||
import * as API_GOODS from "@/api/goods";
|
import * as API_GOODS from "@/api/goods";
|
||||||
import * as API_Shop from "@/api/shops";
|
import * as API_Shop from "@/api/shops";
|
||||||
import cloneObj from "@/utils/index";
|
import cloneObj from "@/utils/index";
|
||||||
import bus from '@/libs/eventBus'
|
|
||||||
import vuedraggable from "vuedraggable";
|
import vuedraggable from "vuedraggable";
|
||||||
import editor from "@/views/my-components/lili/editor";
|
import editor from "@/views/my-components/lili/editor";
|
||||||
import {regular} from "@/utils";
|
import {regular} from "@/utils";
|
||||||
|
@ -322,7 +326,13 @@ import {regular} from "@/utils";
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components:{
|
||||||
editor,
|
editor,
|
||||||
vuedraggable,
|
vuedraggable
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
firstData: {
|
||||||
|
default: {},
|
||||||
|
type: Object
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
// 表单验证项,商品价格
|
// 表单验证项,商品价格
|
||||||
|
@ -363,6 +373,7 @@ export default {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
categoryId: '', // 商品分类第三级id
|
||||||
//提交状态
|
//提交状态
|
||||||
submitLoading: false,
|
submitLoading: false,
|
||||||
//上传图片路径
|
//上传图片路径
|
||||||
|
@ -387,9 +398,9 @@ export default {
|
||||||
/** 商品相册列表 */
|
/** 商品相册列表 */
|
||||||
goodsGalleryFiles: [],
|
goodsGalleryFiles: [],
|
||||||
/** 是否立即发布 true 立即发布 false 放入仓库 */
|
/** 是否立即发布 true 立即发布 false 放入仓库 */
|
||||||
release: "true",
|
release: true,
|
||||||
/** 是否为推荐商品 */
|
/** 是否为推荐商品 */
|
||||||
recommend: "true",
|
recommend: true,
|
||||||
/** 店铺分类 */
|
/** 店铺分类 */
|
||||||
storeCategoryPath: "",
|
storeCategoryPath: "",
|
||||||
brandId: 0,
|
brandId: 0,
|
||||||
|
@ -411,6 +422,8 @@ export default {
|
||||||
templateId: '',
|
templateId: '',
|
||||||
/** 参数组*/
|
/** 参数组*/
|
||||||
goodsParamsDTOList: [],
|
goodsParamsDTOList: [],
|
||||||
|
/** 商品分类中文名 */
|
||||||
|
categoryName: []
|
||||||
},
|
},
|
||||||
/** 表单数据*/
|
/** 表单数据*/
|
||||||
skuForm: {},
|
skuForm: {},
|
||||||
|
@ -482,7 +495,7 @@ export default {
|
||||||
/** 店铺分类列表 */
|
/** 店铺分类列表 */
|
||||||
shopCategory: [],
|
shopCategory: [],
|
||||||
/** 商品单位列表 */
|
/** 商品单位列表 */
|
||||||
goodsUnitList: {},
|
goodsUnitList: [],
|
||||||
ignoreColumn: [
|
ignoreColumn: [
|
||||||
"_index",
|
"_index",
|
||||||
"_rowKey",
|
"_rowKey",
|
||||||
|
@ -507,6 +520,7 @@ export default {
|
||||||
* @value 参数选项值
|
* @value 参数选项值
|
||||||
*/
|
*/
|
||||||
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
|
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
|
||||||
|
debugger
|
||||||
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
|
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
|
||||||
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
|
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
|
||||||
groupId:'',
|
groupId:'',
|
||||||
|
@ -515,10 +529,9 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//赋予分组id、分组名称
|
//赋予分组id、分组名称
|
||||||
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
|
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId = paramsGroup.groupId
|
||||||
groupId : paramsGroup.groupId,
|
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName = paramsGroup.groupName
|
||||||
groupName : paramsGroup.groupName
|
|
||||||
}
|
|
||||||
//参数详细为空,则赋予
|
//参数详细为空,则赋予
|
||||||
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]) {
|
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]) {
|
||||||
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]={
|
this.baseInfoForm.goodsParamsDTOList[groupIndex].goodsParamsItemDTOList[paramsIndex]={
|
||||||
|
@ -573,6 +586,7 @@ export default {
|
||||||
this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url);
|
this.baseInfoForm.goodsGalleryFiles.filter((i) => i.url !== file.url);
|
||||||
},
|
},
|
||||||
updateSkuPicture() {
|
updateSkuPicture() {
|
||||||
|
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||||
let _index = this.selectedSku._index;
|
let _index = this.selectedSku._index;
|
||||||
this.skuTableData[_index] = this.selectedSku;
|
this.skuTableData[_index] = this.selectedSku;
|
||||||
},
|
},
|
||||||
|
@ -596,16 +610,13 @@ export default {
|
||||||
handleFormatError(file) {
|
handleFormatError(file) {
|
||||||
this.$Notice.warning({
|
this.$Notice.warning({
|
||||||
title: "文件格式不正确",
|
title: "文件格式不正确",
|
||||||
desc:
|
desc: "文件 " + file.name + " 的格式不正确"
|
||||||
"File format of " +
|
|
||||||
file.name +
|
|
||||||
" is incorrect, please select jpg or png.",
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleMaxSize(file) {
|
handleMaxSize(file) {
|
||||||
this.$Notice.warning({
|
this.$Notice.warning({
|
||||||
title: "超过文件大小限制",
|
title: "超过文件大小限制",
|
||||||
desc: "图片 " + file.name + " 不能超过2mb",
|
desc: "图片 " + file.name + " 不能超过2mb"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleBeforeUploadGoodsPicture() {
|
handleBeforeUploadGoodsPicture() {
|
||||||
|
@ -669,27 +680,19 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 编辑时获取商品信息
|
// 编辑时获取商品信息
|
||||||
async GET_GoodData() {
|
async GET_GoodData(id,draftId) {
|
||||||
let response = {};
|
let response = {};
|
||||||
if (this.$route.query.draftId) {
|
if (draftId) {
|
||||||
response = await API_GOODS.getDraftGoodsDetail(this.$route.query.draftId);
|
response = await API_GOODS.getDraftGoodsDetail(draftId);
|
||||||
} else {
|
} else {
|
||||||
response = await API_GOODS.getGoods(this.$route.query.id);
|
response = await API_GOODS.getGoods(id);
|
||||||
this.goodsId = response.result.id;
|
this.goodsId = response.result.id;
|
||||||
}
|
}
|
||||||
this.baseInfoForm = {...this.baseInfoForm,...response.result};
|
this.baseInfoForm = {...this.baseInfoForm,...response.result};
|
||||||
|
|
||||||
this.baseInfoForm.release = "true";
|
this.baseInfoForm.release = true;
|
||||||
this.baseInfoForm.recommend = this.baseInfoForm.recommend
|
|
||||||
? "true"
|
|
||||||
: "false";
|
|
||||||
|
|
||||||
//分类名称展示
|
this.categoryId = response.result.categoryPath.split(",")[2];
|
||||||
this.activeCategoryName1 = response.result.categoryName[0];
|
|
||||||
this.activeCategoryName2 = response.result.categoryName[1];
|
|
||||||
this.activeCategoryName3 = response.result.categoryName[2];
|
|
||||||
|
|
||||||
this.baseInfoForm.categoryId = response.result.categoryPath.split(",");
|
|
||||||
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -703,8 +706,6 @@ export default {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.categoryId = this.baseInfoForm.categoryId[2];
|
|
||||||
|
|
||||||
this.Get_SkuInfoByCategory(this.categoryId)
|
this.Get_SkuInfoByCategory(this.categoryId)
|
||||||
|
|
||||||
this.renderGoodsDetailSku(response.result.skuList);
|
this.renderGoodsDetailSku(response.result.skuList);
|
||||||
|
@ -1024,7 +1025,7 @@ export default {
|
||||||
/** 数据改变之后 抛出数据 */
|
/** 数据改变之后 抛出数据 */
|
||||||
updateSkuTable(row, item) {
|
updateSkuTable(row, item) {
|
||||||
let index = row._index;
|
let index = row._index;
|
||||||
// this.skuTableData[index][item] = row[item];
|
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||||
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
|
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
|
||||||
if (item === "weight") {
|
if (item === "weight") {
|
||||||
if (
|
if (
|
||||||
|
@ -1136,11 +1137,10 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// this.baseInfoForm.goodsType = "NORMAL";
|
|
||||||
API_GOODS.createGoods(this.baseInfoForm).then((res) => {
|
API_GOODS.createGoods(this.baseInfoForm).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
this.activestep = 2;
|
this.$parent.activestep = 2;
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
} else {
|
} else {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
|
@ -1197,7 +1197,7 @@ export default {
|
||||||
API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => {
|
API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.info("保存成功!");
|
this.$Message.info("保存成功!");
|
||||||
this.$router.back();
|
this.$router.push({name: 'template-goods'});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -1212,16 +1212,34 @@ export default {
|
||||||
this.logisticsTemplate = res.result;
|
this.logisticsTemplate = res.result;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
/** 获取该商城分类下 商品参数信息 */
|
if (this.$route.query.id || this.$route.query.draftId) { // 编辑商品、模板
|
||||||
this.GET_GoodsParams();
|
this.GET_GoodData(this.$route.query.id, this.$route.query.draftId)
|
||||||
/** 查询品牌列表 */
|
} else { // 新增商品、模板
|
||||||
this.getGoodsBrandList();
|
if (this.firstData.tempId) { // 选择模板
|
||||||
/** 查询分类绑定的规格信息 */
|
this.GET_GoodData('', this.firstData.tempId)
|
||||||
this.Get_SkuInfoByCategory(this.baseInfoForm.categoryId);
|
} else {
|
||||||
// 获取商品单位
|
const cateId = []
|
||||||
this.GET_GoodsUnit();
|
this.firstData.category.forEach(cate => {
|
||||||
// 获取当前店铺分类
|
this.baseInfoForm.categoryName.push(cate.name)
|
||||||
this.GET_ShopGoodsLabel();
|
cateId.push(cate.id)
|
||||||
|
})
|
||||||
|
this.categoryId = cateId[2]
|
||||||
|
this.baseInfoForm.categoryPath = cateId.toString()
|
||||||
|
this.baseInfoForm.goodsType = this.firstData.goodsType;
|
||||||
|
/** 获取该商城分类下 商品参数信息 */
|
||||||
|
this.GET_GoodsParams();
|
||||||
|
/** 查询品牌列表 */
|
||||||
|
this.getGoodsBrandList();
|
||||||
|
/** 查询分类绑定的规格信息 */
|
||||||
|
this.Get_SkuInfoByCategory(this.categoryId);
|
||||||
|
// 获取商品单位
|
||||||
|
this.GET_GoodsUnit();
|
||||||
|
// 获取当前店铺分类
|
||||||
|
this.GET_ShopGoodsLabel();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue