发布商品代码拆分完成,管理端订单设置修改

master
mabo 2021-07-09 15:04:02 +08:00
parent 0504592f7d
commit f5faad982c
6 changed files with 173 additions and 160 deletions

View File

@ -17,14 +17,14 @@ export default {
* @description api请求基础路径
*/
api_dev: {
common: "https://common-api.pickmall.cn",
buyer: "https://buyer-api.pickmall.cn",
seller: "https://store-api.pickmall.cn",
manager: "https://admin-api.pickmall.cn"
// common: 'http://192.168.0.106:8890',
// buyer: 'http://192.168.0.106:8888',
// seller: 'http://192.168.0.106:8889',
// manager: 'http://192.168.0.106:8887'
// common: "https://common-api.pickmall.cn",
// buyer: "https://buyer-api.pickmall.cn",
// seller: "https://store-api.pickmall.cn",
// manager: "https://admin-api.pickmall.cn"
common: 'http://192.168.0.103:8890',
buyer: 'http://192.168.0.103:8888',
seller: 'http://192.168.0.103:8889',
manager: 'http://192.168.0.103:8887'
},
api_prod: {
common: "https://common-api.pickmall.cn",

View File

@ -1,10 +1,7 @@
<template>
<div class="search">
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :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">
<Input type="text" v-model="searchForm.orderSn" placeholder="请输入订单号" clearable style="width: 160px" />
</Form-item>
@ -31,13 +28,11 @@
<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>
<download-excel class="export-excel-wrapper" :data="data" :fields="fields" name="商品订单.xls">
<Button type="info" class="export">

View File

@ -12,13 +12,7 @@
<Input type='number' v-model="formValidate.autoReceive">
<span slot="append"></span>
</Input>
</FormItem>
<FormItem label="订单自动完成" prop="autoComplete">
<Input type='number' v-model="formValidate.autoComplete">
<span slot="append"></span>
</Input>
<span class="desc">收货后订单完成</span>
</FormItem>
<FormItem label="自动评价" prop="autoEvaluation">
@ -27,11 +21,17 @@
</Input>
</FormItem>
<FormItem label="售后自动取消" prop="autoCancelAfterSale">
<Input type='number' v-model="formValidate.autoCancelAfterSale">
<FormItem label="已完成订单允许退单" prop="closeAfterSale">
<Input type='number' v-model="formValidate.closeAfterSale">
<span slot="append"></span>
</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>
<div class="label-btns">
@ -50,10 +50,10 @@ export default {
ruleValidate: {}, //
formValidate: { //
autoCancel: "",
autoComplete: "",
autoEvaluation: "",
autoReceive: "",
autoCancelAfterSale: "",
closeAfterSale: "",
closeComplaint:""
},
};
},
@ -121,4 +121,8 @@ export default {
/deep/ .ivu-input {
width: 100px !important;
}
.desc {
font-size: 12px;
color: #999;
}
</style>

View File

@ -8,9 +8,9 @@
</steps>
</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>
@ -33,20 +33,24 @@ export default {
return {
/** 当前激活步骤*/
activestep: 0,
firstData: {}, //
};
},
methods: {
getFirstData (item) {
this.firstData = item;
this.activestep = 1;
}
},
mounted() {
//
if (this.$route.query.id || this.$route.query.draftId) {
this.activestep = 1;
} else {
this.activestep = 0
this.$refs.first.selectGoodsType = true;
}
},
methods: {
}
};
</script>

View File

@ -15,7 +15,7 @@
<div v-else class="goods-type-list">
<h2 @click="showGoodsTemplates = !showGoodsTemplates">返回</h2>
<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" />
<div>
<h2>{{ item.goodsName }}</h2>
@ -54,8 +54,8 @@
<span v-show="category[1].name">> {{ category[1].name }}</span>
<span v-show="category[2].name">> {{ category[2].name }}</span>
</p>
<template>
<Divider>已选商品模版:{{checkedTemplate()}}</Divider>
<template v-if="selectedTemplate.goodsName">
<Divider>已选商品模版:{{selectedTemplate.goodsName}}</Divider>
</template>
</div>
<!-- 底部按钮 -->
@ -69,11 +69,10 @@
</template>
<script>
import * as API_GOODS from "@/api/goods";
import bus from '@/libs/eventBus'
export default {
data() {
return {
draftId: '',
selectedTemplate: {}, //
selectGoodsType: false, // modal
goodsTemplates: [], //
showGoodsTemplates: false, //
@ -118,14 +117,6 @@ export default {
}
},
methods: {
//
checkedTemplate () {
if(this.goodsTemplates.length) {
return this.goodsTemplates.find(item=>{return item.id == this.draftId}).goodsName
} else {
return ""
}
},
//
handleClickGoodsType(val) {
this.goodsTypeWay.map((item) => {
@ -134,18 +125,26 @@ export default {
val.check = !val.check;
if (!val.type) {
this.showGoodsTemplates = true;
this.GET_GoodsTemplate()
this.showGoodsTemplates = true;
} else {
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() {
let searchParams = {
saveType: "TEMPLATE",
sort: "create_time",
order: "desc",
order: "desc"
};
API_GOODS.getDraftGoodsListData(searchParams).then((res) => {
if (res.success) {
@ -153,10 +152,6 @@ export default {
}
});
},
//
handleClickGoodsTemplate(val) {
this.selectGoodsType = false;
},
/** 选择商城商品分类 */
handleSelectCategory(row, index, level) {
if (level === 1) {
@ -178,10 +173,6 @@ export default {
this.category[2].name = row.name
this.category[2].id = row.id
}
// ID
// this.baseInfoForm.categoryId = row.id;
// this.categoryId = row.id;
// this.baseInfoForm.categoryName = row.name;
},
/** 查询下一级 商城商品分类*/
GET_NextLevelCategory(row) {
@ -195,11 +186,8 @@ export default {
//
next() {
window.scrollTo(0, 0);
/** 1级校验 */
this.loading = true;
if (!this.goodsType) {
if (!this.goodsType && !this.selectedTemplate.goodsName) {
this.$Message.error('请选择商品类型')
this.loading = false;
return
}
if (!this.category[0].name) {
@ -209,13 +197,17 @@ export default {
this.$Message.error("必须选择到三级分类");
return;
} 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 () {
this.GET_NextLevelCategory()
this.selectGoodsType = true;
}
}
</script>

View File

@ -6,10 +6,10 @@
<h4>基本信息</h4>
<div class="form-item-view">
<FormItem label="商品分类">
<span class="goods-category-name">{{ activeCategoryName1 }}</span>
<span v-show="activeCategoryName2">> {{ activeCategoryName2 }}</span>
<span v-show="activeCategoryName3">> {{ activeCategoryName3 }}</span>
<span v-if="!activeCategoryName1" v-html="baseInfoForm.category_name"></span>
<span class="goods-category-name">{{ this.baseInfoForm.categoryName[0] }}</span>
<span> &gt; {{ this.baseInfoForm.categoryName[1] }}</span>
<span> &gt; {{ this.baseInfoForm.categoryName[2] }}</span>
</FormItem>
<FormItem label="商品名称" prop="goodsName">
<Input type="text" v-model="baseInfoForm.goodsName" placeholder="商品名称" clearable style="width: 260px"/>
@ -169,6 +169,11 @@
<img v-if="previewPicture !== ''" :src="previewPicture"/>
</div>
<Divider/>
<vuedraggable
:list="baseInfoForm.goodsGalleryFiles"
:animation="200"
style="display:inline-block;"
>
<div class="sku-upload-list" v-for="(img, __index) in selectedSku.images" :key="__index">
<template v-if="img.status === 'finished'">
<img :src="img.url"/>
@ -181,6 +186,7 @@
<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"
:on-success="handleSuccess" :format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
@ -193,7 +199,6 @@
</Modal>
</template>
</Table>
</div>
</div>
</Panel>
@ -254,20 +259,20 @@
<div class="form-item-view">
<FormItem class="form-item-view-el" label="商品发布" prop="release">
<RadioGroup type="button" button-style="solid" v-model="baseInfoForm.release">
<Radio title="立即发布" label="true">
<Radio title="立即发布" :label="true">
<span>立即发布</span>
</Radio>
<Radio title="放入仓库" label="false">
<Radio title="放入仓库" :label="false">
<span>放入仓库</span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem class="form-item-view-el" label="商品推荐" prop="skuList">
<RadioGroup type="button" button-style="solid" v-model="baseInfoForm.recommend">
<Radio title="推荐" label="true">
<Radio title="推荐" :label="true">
<span>推荐</span>
</Radio>
<Radio title="不推荐" label="false">
<Radio title="不推荐" :label="false">
<span>不推荐</span>
</Radio>
</RadioGroup>
@ -314,7 +319,6 @@
import * as API_GOODS from "@/api/goods";
import * as API_Shop from "@/api/shops";
import cloneObj from "@/utils/index";
import bus from '@/libs/eventBus'
import vuedraggable from "vuedraggable";
import editor from "@/views/my-components/lili/editor";
import {regular} from "@/utils";
@ -322,7 +326,13 @@ import {regular} from "@/utils";
export default {
components:{
editor,
vuedraggable,
vuedraggable
},
props: {
firstData: {
default: {},
type: Object
}
},
data () {
//
@ -363,6 +373,7 @@ export default {
}
};
return {
categoryId: '', // id
//
submitLoading: false,
//
@ -387,9 +398,9 @@ export default {
/** 商品相册列表 */
goodsGalleryFiles: [],
/** 是否立即发布 true 立即发布 false 放入仓库 */
release: "true",
release: true,
/** 是否为推荐商品 */
recommend: "true",
recommend: true,
/** 店铺分类 */
storeCategoryPath: "",
brandId: 0,
@ -411,6 +422,8 @@ export default {
templateId: '',
/** 参数组*/
goodsParamsDTOList: [],
/** 商品分类中文名 */
categoryName: []
},
/** 表单数据*/
skuForm: {},
@ -482,7 +495,7 @@ export default {
/** 店铺分类列表 */
shopCategory: [],
/** 商品单位列表 */
goodsUnitList: {},
goodsUnitList: [],
ignoreColumn: [
"_index",
"_rowKey",
@ -507,6 +520,7 @@ export default {
* @value 参数选项值
*/
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
debugger
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
groupId:'',
@ -515,10 +529,9 @@ export default {
}
}
//id
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
groupId : paramsGroup.groupId,
groupName : paramsGroup.groupName
}
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupId = paramsGroup.groupId
this.baseInfoForm.goodsParamsDTOList[groupIndex].groupName = paramsGroup.groupName
//
if (!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);
},
updateSkuPicture() {
this.baseInfoForm.regeneratorSkuFlag = true;
let _index = this.selectedSku._index;
this.skuTableData[_index] = this.selectedSku;
},
@ -596,16 +610,13 @@ export default {
handleFormatError(file) {
this.$Notice.warning({
title: "文件格式不正确",
desc:
"File format of " +
file.name +
" is incorrect, please select jpg or png.",
desc: "文件 " + file.name + " 的格式不正确"
});
},
handleMaxSize(file) {
this.$Notice.warning({
title: "超过文件大小限制",
desc: "图片 " + file.name + " 不能超过2mb",
desc: "图片 " + file.name + " 不能超过2mb"
});
},
handleBeforeUploadGoodsPicture() {
@ -669,27 +680,19 @@ export default {
});
},
//
async GET_GoodData() {
async GET_GoodData(id,draftId) {
let response = {};
if (this.$route.query.draftId) {
response = await API_GOODS.getDraftGoodsDetail(this.$route.query.draftId);
if (draftId) {
response = await API_GOODS.getDraftGoodsDetail(draftId);
} else {
response = await API_GOODS.getGoods(this.$route.query.id);
response = await API_GOODS.getGoods(id);
this.goodsId = response.result.id;
}
this.baseInfoForm = {...this.baseInfoForm,...response.result};
this.baseInfoForm.release = "true";
this.baseInfoForm.recommend = this.baseInfoForm.recommend
? "true"
: "false";
this.baseInfoForm.release = true;
//
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(",");
this.categoryId = response.result.categoryPath.split(",")[2];
if (
@ -703,8 +706,6 @@ export default {
});
}
this.categoryId = this.baseInfoForm.categoryId[2];
this.Get_SkuInfoByCategory(this.categoryId)
this.renderGoodsDetailSku(response.result.skuList);
@ -1024,7 +1025,7 @@ export default {
/** 数据改变之后 抛出数据 */
updateSkuTable(row, item) {
let index = row._index;
// this.skuTableData[index][item] = row[item];
this.baseInfoForm.regeneratorSkuFlag = true;
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
if (item === "weight") {
if (
@ -1136,11 +1137,10 @@ export default {
}
});
} else {
// this.baseInfoForm.goodsType = "NORMAL";
API_GOODS.createGoods(this.baseInfoForm).then((res) => {
if (res.success) {
this.submitLoading = false;
this.activestep = 2;
this.$parent.activestep = 2;
window.scrollTo(0, 0);
} else {
this.submitLoading = false;
@ -1197,7 +1197,7 @@ export default {
API_GOODS.saveDraftGoods(this.baseInfoForm).then((res) => {
if (res.success) {
this.$Message.info("保存成功!");
this.$router.back();
this.$router.push({name: 'template-goods'});
}
});
}
@ -1212,17 +1212,35 @@ export default {
this.logisticsTemplate = res.result;
}
})
if (this.$route.query.id || this.$route.query.draftId) { //
this.GET_GoodData(this.$route.query.id, this.$route.query.draftId)
} else { //
if (this.firstData.tempId) { //
this.GET_GoodData('', this.firstData.tempId)
} else {
const cateId = []
this.firstData.category.forEach(cate => {
this.baseInfoForm.categoryName.push(cate.name)
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.baseInfoForm.categoryId);
this.Get_SkuInfoByCategory(this.categoryId);
//
this.GET_GoodsUnit();
//
this.GET_ShopGoodsLabel();
}
}
}
}
</script>
<style lang="scss" scoped>