合并master

This commit is contained in:
lemon橪
2021-06-29 12:00:05 +08:00
14 changed files with 288 additions and 170 deletions

View File

@@ -423,7 +423,7 @@ div.base-info-item {
display:flex;
}
.demo-upload-list-cover div {
margin: 10% 0;
margin-top: 50px;
width: 100%;
> i {

View File

@@ -36,7 +36,7 @@
<DropdownItem name="uppers">批量上架</DropdownItem>
<DropdownItem name="lowers">批量下架</DropdownItem>
<DropdownItem name="deleteAll">批量删除</DropdownItem>
<DropdownItem name="batchShipTemplate">批量设置运费模板</DropdownItem>
<DropdownItem name="batchShipTemplate">批量设置物流模板</DropdownItem>
</DropdownMenu>
</Dropdown>
</Row>
@@ -87,21 +87,10 @@
</div>
</Modal>
<!-- 批量设置运费模板 -->
<Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
<!-- 批量设置物流模板 -->
<Modal title="批量设置物流模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
<Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120">
<FormItem class="form-item-view-el" label="运费" prop="freightPayer">
<RadioGroup type="button" button-style="solid" @on-change="logisticsTemplateUndertakerChange" v-model="shipTemplateForm.freightPayer">
<Radio label="STORE">
<span>卖家承担运费</span>
</Radio>
<Radio label="BUYER">
<span>使用物流规则</span>
</Radio>
</RadioGroup>
</FormItem>
<FormItem class="form-item-view-el" label="物流模板" prop="templateId" v-if="shipTemplateShow">
<FormItem class="form-item-view-el" label="物流模板" prop="templateId">
<Select v-model="shipTemplateForm.templateId" style="width: 200px">
<Option v-for="item in logisticsTemplate" :value="item.id" :key="item.id">{{ item.name }}
</Option>
@@ -124,10 +113,9 @@ import {
upGoods,
lowGoods,
deleteGoods,
batchShipTemplate,
batchShipTemplate
} from "@/api/goods";
import * as API_Store from "@/api/shops";
import * as API_Shop from "@/api/shops";
export default {
name: "goods",
@@ -135,10 +123,7 @@ export default {
return {
id: "", //要操作的id
loading: true, // 表单加载状态
shipTemplateForm: {
freightPayer: "STORE",
},
shipTemplateShow: false, //物流模板是否显示
shipTemplateForm: {},
shipTemplateModal: false, // 物流模板是否显示
logisticsTemplate: [], // 物流列表
updateStockModalVisible: false, // 更新库存模态框显隐
@@ -421,11 +406,12 @@ export default {
if (v == "deleteAll") {
this.deleteAll();
}
//批量设置运费模板
//批量设置物流模板
if (v == "batchShipTemplate") {
this.batchShipTemplate();
}
},
// 获取库存详情
getStockDetail(id) {
getGoodsSkuListDataSeller({ goodsId: id, pageSize: 1000 }).then((res) => {
if (res.success) {
@@ -435,6 +421,7 @@ export default {
}
});
},
// 更新库存
updateStock() {
let updateStockList = this.stockList.map((i) => {
let j = { skuId: i.id, quantity: i.quantity };
@@ -486,28 +473,24 @@ export default {
this.selectList = e;
this.selectCount = e.length;
},
//保存运费模板信息
//保存物流模板信息
saveShipTemplate() {
if (this.shipTemplateForm.freightPayer == "STORE") {
{
this.shipTemplateForm.templateId = 0;
}
}
this.$Modal.confirm({
title: "确认设置运费模板",
title: "确认设置物流模板",
content:
"您确认要设置所选的 " + this.selectCount + " 个商品的运费模板?",
"您确认要设置所选的 " + this.selectCount + " 个商品的物流模板?",
loading: true,
onOk: () => {
let ids = [];
this.selectList.forEach(function (e) {
ids.push(e.id);
});
// 批量设置运费模板
// 批量设置物流模板
batchShipTemplate(this.shipTemplateForm).then((res) => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("运费模板设置成功");
this.$Message.success("物流模板设置成功");
this.clearSelectAll();
this.getDataList();
}
@@ -516,12 +499,13 @@ export default {
},
});
},
//批量设置运费模板
//批量设置物流模板
batchShipTemplate() {
if (this.selectCount <= 0) {
this.$Message.warning("您还未选择要设置运费模板的商品");
this.$Message.warning("您还未选择要设置物流模板的商品");
return;
}
this.getShipTempList()
let data = [];
this.selectList.forEach(function (e) {
data.push(e.id);
@@ -529,21 +513,7 @@ export default {
this.shipTemplateForm.goodsId = data;
this.shipTemplateModal = true;
},
//运费承担者变化
logisticsTemplateUndertakerChange(v) {
//如果是卖家承担运费 需要显示运费模板
if (v == "BUYER") {
API_Store.getShipTemplate().then((res) => {
if (res.success) {
this.logisticsTemplate = res.result;
}
});
this.shipTemplateShow = true;
}
if (v == "STORE") {
this.shipTemplateShow = false;
}
},
// 获取商品列表数据
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据
@@ -555,6 +525,14 @@ export default {
}
});
},
// 获取物流模板
getShipTempList () {
API_Shop.getShipTemplate().then((res) => {
if (res.success) {
this.logisticsTemplate = res.result;
}
})
},
//下架商品
lower(v) {
this.$Modal.confirm({

View File

@@ -137,27 +137,33 @@
<Input type="text" v-model="baseInfoForm.cost" placeholder="市场价格" clearable style="width: 260px"/>
</FormItem>
<FormItem class="form-item-view-el required" label="商品图片" prop="goodsGalleryFiles">
<div class="demo-upload-list" v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index">
<template v-if="item.status === 'finished'">
<img :src="item.url"/>
<div class="demo-upload-list-cover">
<div>
<Icon type="ios-eye-outline" @click.native="handleViewGoodsPicture(item.url)"></Icon>
<Icon type="ios-trash-outline" @click.native="handleRemoveGoodsPicture(item)"></Icon>
<vuedraggable
:list="baseInfoForm.goodsGalleryFiles"
:animation="200"
style="display:inline-block;"
ghost-class="thumb-ghost"
>
<div class="demo-upload-list" v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index">
<template v-if="item.status === 'finished'">
<img :src="item.url"/>
<div class="demo-upload-list-cover">
<div>
<Icon type="ios-eye-outline" size="30" @click.native="handleViewGoodsPicture(item.url)"></Icon>
<Icon type="ios-trash-outline" size="30" @click.native="handleRemoveGoodsPicture(item)"></Icon>
</div>
<!-- <div>
<Icon type="ios-arrow-dropleft" @click.native="
handleGoodsPicRemoteUp(baseInfoForm.goodsGalleryFiles,__index)"/>
<Icon type="ios-arrow-dropright" @click.native="
handleGoodsPicRemoteDown(baseInfoForm.goodsGalleryFiles,__index)"/>
</div> -->
</div>
<div>
<Icon type="ios-arrow-dropleft" @click.native="
handleGoodsPicRemoteUp(baseInfoForm.goodsGalleryFiles,__index)"/>
<Icon type="ios-arrow-dropright" @click.native="
handleGoodsPicRemoteDown(baseInfoForm.goodsGalleryFiles,__index)"/>
</div>
</div>
</template>
<template v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</template>
</div>
</template>
<template v-else>
<Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
</template>
</div>
</vuedraggable>
<Upload ref="upload" :show-upload-list="false" :default-file-list="baseInfoForm.goodsGalleryFiles"
:on-success="handleSuccessGoodsPicture" :format="['jpg', 'jpeg', 'png']"
:on-format-error="handleFormatError" :on-exceeded-size="handleMaxSize"
@@ -167,6 +173,7 @@
<Icon type="ios-camera" size="20"></Icon>
</div>
</Upload>
<!-- <upload-pic-thumb v-model="baseInfoForm.goodsGalleryFiles" :multiple="true"></upload-pic-thumb> -->
<Modal title="View Image" v-model="goodsPictureVisible">
<img :src="previewGoodsPicture" v-if="goodsPictureVisible" style="width: 100%"/>
@@ -371,7 +378,7 @@
<Select v-model="params.paramValue" placeholder="请选择" style="width: 200px" clearable
@on-change="selectParams(paramsGroup,groupIndex,params,paramsIndex,params.paramValue)">
<Option v-for="option in params.options.split(',')" :label="option"
:value="option"></Option>
:value="option" :key="option"></Option>
</Select>
</FormItem>
</p>
@@ -428,18 +435,17 @@
<script>
import {regular} from "@/utils";
import uploadPicThumb from "@/views/my-components/lili/upload-pic-thumb";
import editor from "@/views/my-components/lili/editor";
import * as API_GOODS from "@/api/goods";
import * as API_Shop from "@/api/shops";
import cloneObj from "@/utils/index";
import vuedraggable from "vuedraggable";
export default {
name: "addGoods",
components: {
uploadPicThumb,
editor,
vuedraggable
},
watch: {
selectGoodsType: {
@@ -620,7 +626,7 @@ export default {
updateSku: true,
/** 是否重新生成sku */
regeneratorSkuFlag: false,
/** 运费模板id **/
/** 物流模板id **/
templateId: '',
/** 参数组*/
goodsParamsDTOList: [],
@@ -647,7 +653,7 @@ export default {
/** 规格图片 */
images: [],
/** 运费模板 **/
/** 物流模板 **/
logisticsTemplate: [],
/** 固定列校验提示内容 */
@@ -716,7 +722,7 @@ export default {
this.accessToken = {
accessToken: this.getStore("accessToken"),
};
// 获取运费模板
// 获取物流模板
API_Shop.getShipTemplate().then((res) => {
if (res.success) {
this.logisticsTemplate = res.result;
@@ -838,7 +844,6 @@ export default {
* @value 参数选项值
*/
selectParams(paramsGroup, groupIndex, params, paramsIndex, value) {
console.log(params.id);
if (!this.baseInfoForm.goodsParamsDTOList[groupIndex]) {
this.baseInfoForm.goodsParamsDTOList[groupIndex] = {
groupId:'',
@@ -872,14 +877,13 @@ export default {
// 编辑sku图片
editSkuPicture(row) {
console.log(row);
if (row.images && row.images.length > 0) {
this.previewPicture = row.images[0].url;
}
this.selectedSku = row;
this.showSkuPicture = true;
},
handleView(url) {
handleView (url) {
this.previewPicture = url;
this.visible = true;
},
@@ -938,7 +942,6 @@ export default {
});
},
handleBeforeUploadGoodsPicture() {
console.log(this.baseInfoForm);
const check = this.baseInfoForm.goodsGalleryFiles.length < 5;
if (!check) {
this.$Notice.warning({
@@ -1017,7 +1020,6 @@ export default {
...this.baseInfoForm,
...response.result,
};
// console.warn(this.baseInfoForm);
this.baseInfoForm.release = "true";
this.baseInfoForm.recommend = this.baseInfoForm.recommend
@@ -1141,7 +1143,6 @@ export default {
group.goodsParamsItemDTOList.forEach(param => {
param.groupId = group.groupId
paramsArr.push(param)
console.log(param);
})
})
// 循环参数分组
@@ -1155,7 +1156,6 @@ export default {
})
})
});
console.log(this.goodsParams);
} else {
this.baseInfoForm.goodsParamsDTOList = []
}
@@ -1184,10 +1184,7 @@ export default {
},
// 编辑规格值
async skuValueChange(val, index, item) {
/** 更新skuInfo数据 */
// let _arr = cloneObj(item);
// this.$set(item, "name", _arr.name);
// this.$set(this.skuInfo, index, _arr);
/**
* 渲染规格详细表格
*/
@@ -1309,7 +1306,6 @@ export default {
);
this.skuTableColumn = pushData;
console.log(this.skuTableColumn);
//克隆所有渲染的数据
let cloneTemp = cloneObj(this.skuInfo);
@@ -1329,7 +1325,6 @@ export default {
cloneTemp.splice(0, 1);
result = this.specIterator(result, cloneTemp);
this.skuTableData = result;
console.log(this.skuTableData);
}
},
/**
@@ -1459,7 +1454,6 @@ export default {
this.GET_GoodData();
return;
}
console.log(this.baseInfoForm);
this.GET_GoodsParams();
/** 1级校验 */
this.loading = true;
@@ -1582,7 +1576,6 @@ export default {
}
/** 参数校验 **/
/* Object.keys(this.baseInfoForm.goodsParamsList).forEach((item) => {
console.warn(item.paramName)
});*/
if (this.goodsId) {

View File

@@ -3,8 +3,7 @@
<Card style="height: 60px">
<div style="">
<Button v-if="allowOperation.editPrice" @click="modifyPrice" type="primary">调整价格</Button>
<Button v-if="allowOperation.editConsignee" @click="editAddress" type="primary">修改收货地址
</Button>
<Button v-if="allowOperation.editConsignee" @click="editAddress" type="primary">修改收货地址</Button>
<Button v-if="allowOperation.showLogistics" @click="logistics" type="primary">查看物流</Button>
<Button @click="orderLog" type="primary">订单日志</Button>
<Button v-if="allowOperation.take" @click="orderTake" type="primary">订单核销</Button>
@@ -181,7 +180,8 @@
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button type="success" size="large" @click="modifyPriceSubmit">调整</Button>
<Button @click="modal = false">关闭</Button>
<Button type="primary" @click="modifyPriceSubmit">调整</Button>
</div>
</Modal>
<!--收件地址弹出框-->
@@ -210,7 +210,8 @@
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button type="success" size="large" @click="editAddressSubmit">修改</Button>
<Button @click="addressModal = false">关闭</Button>
<Button type="primary" @click="editAddressSubmit">修改</Button>
</div>
</Modal>
<!-- 订单核销 -->
@@ -227,7 +228,8 @@
</Form>
</div>
<div slot="footer" style="text-align: right">
<Button type="success" size="large" @click="orderTakeSubmit">核销</Button>
<Button @click="orderTakeModal = false">关闭</Button>
<Button type="primary" @click="orderTakeSubmit">核销</Button>
</div>
</Modal>
<!-- 订单日志 -->
@@ -303,8 +305,8 @@
</div>
<div slot="footer" style="text-align: right">
<Button size="large" @click="orderDeliverHandelCancel">取消</Button>
<Button type="success" size="large" @click="orderDeliverySubmit">发货</Button>
<Button @click="orderDeliverModal = false">关闭</Button>
<Button type="primary" @click="orderDeliverySubmit">发货</Button>
</div>
</Modal>
</div>
@@ -600,10 +602,6 @@ export default {
}
});
},
//订单日志取消
orderDeliverHandelCancel() {
this.orderDeliverModal = false;
},
//订单发货提交
orderDeliverySubmit() {
this.$refs.orderDeliveryForm.validate((valid) => {