提交 698c00b9 authored 作者: 郑伟娜's avatar 郑伟娜

Merge branch 'M-2.6' into test

......@@ -71,6 +71,7 @@
"vue-splitpane": "1.0.4",
"vuedraggable": "2.20.0",
"vuex": "3.1.0",
"wangeditor": "^4.7.11",
"xlsx": "^0.17.0"
},
"devDependencies": {
......
......@@ -18,7 +18,7 @@ export function GetCategory(query) {
})
}
// 经营类目
// 经营类目-12-23-bak
export function NewGetCategory(query) {
return request({
url: '/system/goodsNew/businessList',
......@@ -26,6 +26,16 @@ export function NewGetCategory(query) {
params: query
})
}
// 营业类目
export function NewGetCategoryData(data) {
return request({
url: '/local/getCategoryList',
method: 'post',
data: data
})
}
// 查询运费模板
export function GetFreight(query) {
return request({
......
......@@ -71,3 +71,12 @@ export function cancelOnsaleAllData(data) {
data: data
})
}
// 保存 不下架编辑商品数据
export function saveHotEditGoodsData(data) {
return request({
url: '/system/goodsNew/onsaleUpdate',
method: 'post',
data: data
})
}
@font-face {
font-family: "iconfont"; /* Project id 3034653 */
src: url('iconfont.woff2?t=1639989114597') format('woff2'),
url('iconfont.woff?t=1639989114597') format('woff'),
url('iconfont.ttf?t=1639989114597') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-iconset0435:before {
content: "\e73a";
}
!function(e){var t,n,o,i,c,d='<svg><symbol id="icon-iconset0435" viewBox="0 0 1024 1024"><path d="M810.666667 640l-192 0L618.666667 128c0-46.933333-38.4-85.333333-85.333333-85.333333l-42.666667 0c-46.933333 0-85.333333 38.4-85.333333 85.333333l0 512-192 0c-12.8 0-21.333333 8.533333-21.333333 21.333333 0 6.4 2.133333 10.666667 6.4 14.933333l298.666667 298.666667c4.266667 4.266667 8.533333 6.4 14.933333 6.4 6.4 0 10.666667-2.133333 14.933333-6.4l298.666667-298.666667c4.266667-4.266667 6.4-8.533333 6.4-14.933333C832 648.533333 823.466667 640 810.666667 640zM512 930.133333 264.533333 682.666667 448 682.666667 448 128c0-23.466667 19.2-42.666667 42.666667-42.666667l42.666667 0c23.466667 0 42.666667 19.2 42.666667 42.666667l0 554.666667 183.466667 0L512 930.133333z" ></path></symbol></svg>',l=(l=document.getElementsByTagName("script"))[l.length-1].getAttribute("data-injectcss"),s=function(e,t){t.parentNode.insertBefore(e,t)};if(l&&!e.__iconfont__svg__cssinject__){e.__iconfont__svg__cssinject__=!0;try{document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")}catch(e){console&&console.log(e)}}function a(){c||(c=!0,o())}function r(){try{i.documentElement.doScroll("left")}catch(e){return void setTimeout(r,50)}a()}t=function(){var e,t;(t=document.createElement("div")).innerHTML=d,d=null,(e=t.getElementsByTagName("svg")[0])&&(e.setAttribute("aria-hidden","true"),e.style.position="absolute",e.style.width=0,e.style.height=0,e.style.overflow="hidden",t=e,(e=document.body).firstChild?s(t,e.firstChild):e.appendChild(t))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(t,0):(n=function(){document.removeEventListener("DOMContentLoaded",n,!1),t()},document.addEventListener("DOMContentLoaded",n,!1)):document.attachEvent&&(o=t,i=e.document,c=!1,r(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,a())})}(window);
\ No newline at end of file
{
"id": "3034653",
"name": "STBZ",
"font_family": "iconfont",
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
{
"icon_id": "554469",
"name": "向下箭头",
"font_class": "iconset0435",
"unicode": "e73a",
"unicode_decimal": 59194
}
]
}
......@@ -66,6 +66,7 @@ export default {
position: relative;
height: 100%;
width: 100%;
font-size: 16px;
&.mobile.openSidebar {
position: fixed;
......
......@@ -25,6 +25,10 @@ import Pagination from "@/components/Pagination";
import VueAwesomeSwiper from 'vue-awesome-swiper' // 引入swiper
import 'swiper/css/swiper.min.css' // 引入swiper样式/
Vue.use(VueAwesomeSwiper) // 注册swiper
// 阿里图标
import './assets/icons/iconfont/iconfont.css';
// import '../../assets/icons/iconfont/iconfont.js'
// 全局方法挂载
Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey
......
......@@ -39,7 +39,7 @@ service.interceptors.request.use(config => {
if (getToken() && !isToken) {
config.headers['Authorization'] = getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
}
//config.headers['Authorization'] = 'Bearer ' + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbk5hbWUiOiIxNTcxMTEzOTg5NSIsInVpZCI6NTI4MjgsImNoYW5uZWxJZCI6MCwiZXhwIjoxNjE5ODMzMzk3LCJpc3MiOiJnaW4tYmxvZyJ9.rh-WXSaFqgqY611Tm5dhba532OYEZvm06vUmgZknoy4'
return config
}, error => {
console.log("25reject");
......
......@@ -658,7 +658,9 @@
</script>
<style lang="scss" type="text/stylus" scoped>
.fill-brand-inf {
font-size : 16px;
width: 100%;
height: 100%;
overflow-x: hidden;
......
......@@ -797,6 +797,7 @@
<style lang="scss" type="text/stylus" scoped>
.fill-store-inf {
font-size : 16px;
width: 100%;
height: 100%;
overflow-x: hidden;
......
......@@ -565,6 +565,7 @@
<style lang="scss" type="text/stylus" scoped>
.fill-store-inf {
font-size : 16px;
width: 100%;
height: 100%;
overflow-x: hidden;
......
......@@ -81,6 +81,7 @@
<style lang="scss" type="text/stylus" scoped>
.entryDetails {
font-size : 16px;
width: 100%;
height: 100%;
overflow-x: hidden;
......
......@@ -79,6 +79,7 @@
<style lang="scss" type="text/stylus" scoped>
.to-review {
font-size : 16px;
width: 100%;
height: 100%;
overflow: hidden;
......
......@@ -62,6 +62,7 @@
<style lang="scss" type="text/stylus" scoped>
.to-review {
font-size : 16px;
width: 100%;
height: 100%;
overflow: hidden;
......
......@@ -30,7 +30,8 @@
<el-row class="row-title">
<el-col :span="4" class="text-r">手续费</el-col>
<el-col :span="9" class="text-l">{{ withdrawInfo.service_fee ? withdrawInfo.service_fee / 100 : 0 }}</el-col>
<el-col :span="9" class="text-l">{{ 0 }}</el-col>
<!-- <el-col :span="9" class="text-l">{{ withdrawInfo.service_fee ? withdrawInfo.service_fee / 100 : 0 }}</el-col>-->
</el-row>
<el-row class="row-title">
......
......@@ -33,7 +33,7 @@
不允许手动输入,提现金额为全部的可提现余额,手续费将从您的提现金额中扣除,以实际到账为准(开票以实际到账金额开具)。
提现金额至少为100元才可以操作提现
</span>
<p class="withdraw-tip-spe">当前提现手续费为:{{ chargeCount }}</p>
<p class="withdraw-tip-spe">当前提现手续费为:0</p>
</el-form-item>
<el-form-item label="提现密码:" prop="pay_pass">
......
......@@ -18,7 +18,7 @@
<el-select v-model="goodsAfterSaleForm.delay_compensate" style="width:400px;" placeholder="请选择发货时效">
<el-option label="24小时" :value="24"></el-option>
<el-option label="48小时" :value="48"></el-option>
<el-option label="72小时" :value="72"></el-option>
<!-- <el-option label="72小时" :value="72"></el-option> -->
</el-select>
</el-form-item>
......
<template>
<div class="goods-img">
<div id="wangeditor" ref="editorElem">
</div>
</div>
</template>
<script>
import E from 'wangeditor'
import { UploadImg } from '@/api/module/goods'
export default {
props: {
description: {
type: String,
required: true
}
},
data() {
return {
editor: null
}
},
mounted() {
let that = this
// 富文本编辑器
const editor = new E('#wangeditor')
editor.config.height = 500
editor.config.uploadImgMaxLength = 1
editor.config.customUploadImg = function (resultFiles, insertImgFn) {
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
that.getBase64(resultFiles[0]).then((res) => {
let result = res.split(",")
let Base64img = result[1]
// 上传图片,返回结果,将图片插入到编辑器中
let data = {"img_data": Base64img}
UploadImg(data).then(res => {
if (res.code == 1) {
insertImgFn(res.data.image_url)
}
})
})
}
editor.create()
this.editor = editor
if( this.description ) {
this.editor.txt.html(this.description)
}
},
methods: {
initInfo() {
this.editor = null
},
getBase64(file) {
return new Promise(function (resolve, reject) {
let reader = new FileReader();
let imgResult = "";
reader.readAsDataURL(file);
reader.onload = function () {
imgResult = reader.result;
};
reader.onerror = function (error) {
reject(error);
};
reader.onloadend = function () {
resolve(imgResult);
};
});
},
}
}
</script>
<style scoped>
.goods-img {
padding: 20px;
}
</style>
......@@ -7,13 +7,14 @@
</p>
<div v-show="(!orgGoodsPam.pamTableList || orgGoodsPam.pamTableList.length === 0)">
<p style="margin: 10px 0;color: #333;font-size: 14px;font-weight: 400;">默认</p>
<el-table
border
size="small"
:data="singleSpecTable"
style="width: 80%;margin-right:10%;"
>
<el-table-column align="center" prop="js_price" label="协议价">
<el-table-column align="center" prop="js_price" label="协议价" >
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model="scope.row.js_price" placeholder="请输入协议价" ></el-input>
</template>
......@@ -83,6 +84,13 @@
style="width: 80%"
>
<el-table-column align="center" prop="js_price" label="协议价">
<template slot="header">
<span>协议价</span>
<el-tooltip placemetn="top" v-if="index==0 && orgGoodsPam.pamDataList.length > 1">
<span slot="content">点击可批量设置价格</span>
<span class="spe-ali-icon0435 iconfont icon-iconset0435" @click="applyAllTable('js_price')"></span>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model="scope.row.js_price" placeholder="请输入协议价"></el-input>
</template>
......@@ -93,21 +101,49 @@
</template>
</el-table-column>
<el-table-column align="center" prop="price" label="指导价">
<template slot="header">
<span>指导价</span>
<el-tooltip placemetn="top" v-if="index==0 && orgGoodsPam.pamDataList.length > 1">
<span slot="content">点击可批量设置价格</span>
<span class="spe-ali-icon0435 iconfont icon-iconset0435" @click="applyAllTable('price')"></span>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model="scope.row.price" placeholder="请输入指导价"></el-input>
</template>
</el-table-column>
<el-table-column align="center" prop="sc_price" label="市场价">
<template slot="header">
<span>市场价</span>
<el-tooltip placemetn="top" v-if="index==0 && orgGoodsPam.pamDataList.length > 1">
<span slot="content">点击可批量设置价格</span>
<span class="spe-ali-icon0435 iconfont icon-iconset0435" @click="applyAllTable('sc_price')"></span>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model="scope.row.sc_price" placeholder="请输入市场价"></el-input>
</template>
</el-table-column>
<el-table-column align="center" prop="stock" label="库存量">
<template slot="header">
<span>库存量</span>
<el-tooltip placemetn="top" v-if="index==0 && orgGoodsPam.pamDataList.length > 1">
<span slot="content">点击可批量设置价格</span>
<span class="spe-ali-icon0435 iconfont icon-iconset0435" @click="applyAllTable('stock')"></span>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model="scope.row.stock" placeholder="请输入库存量"></el-input>
</template>
</el-table-column>
<el-table-column align="center" prop="weight" label="重量">
<template slot="header">
<span>重量</span>
<el-tooltip placemetn="top" v-if="index==0 && orgGoodsPam.pamDataList.length > 1">
<span slot="content">点击可批量设置价格</span>
<span class="spe-ali-icon0435 iconfont icon-iconset0435" @click="applyAllTable('weight')"></span>
</el-tooltip>
</template>
<template slot-scope="scope">
<el-input size="mini" style="width:90%" v-model="scope.row.weight" placeholder="请输入重量"></el-input>
</template>
......@@ -352,6 +388,13 @@ export default {
// }
// }
},
/** 一键应用所有 */
applyAllTable(key) {
let val = this.orgGoodsPam.pamTableList[0][0][key]
this.orgGoodsPam.pamTableList.map(item => {
item[0][key] = val
})
},
// 删除 单个规格的图片
delSingleSpecImg(index,row) {
......@@ -366,8 +409,16 @@ export default {
speImgLeave(index, row) {
this.isHoverSpeImg = false;
},
renderHeaderJSPrice(h) {
return h(
<div>
<span>协议价</span>
<span>点击1</span>
</div>
)
},
// -- 通用 方法 --
// 图片转换为 base64
/** 图片转换为 base64*/
getBase64(file) {
return new Promise(function (resolve, reject) {
let reader = new FileReader();
......@@ -462,6 +513,12 @@ export default {
margin-left: -9px;
}
.spe-ali-icon0435 {
color: red;
vertical-align: middle;
margin-left: 3px;
}
.del-span-block {
display : none;
}
......
......@@ -23,6 +23,7 @@
:value="itemSN.name"
>
<span style="float: left" class="span-style">{{ itemSN.name }}</span>
<span style="float: right" class="spe-span-del el-icon-circle-close" @click.stop="deleteSpeOption(itemSN,index)"></span>
<div class="flag">
<svg-icon icon="edit" iconClass="template_edit_style" @click="addSpeName(index)"/>
</div>
......@@ -92,17 +93,10 @@ export default {
spec_name: '', // 规格名称
spec_value: []
},
speParamName:{
value: ''
},
speOptions: [{
id: '1',
name: '颜色'
}, {
id: '2',
name: '尺码'
}],
speOptions: [],
localSpeOptions: [],
// 规格名称,value组成的数组
speNameList: [],
......@@ -188,6 +182,7 @@ export default {
addSpeParam(index) {
let valueObj = { value: ''}
this.$set(this.speData[index].spec_value,this.speData[index].spec_value.length,valueObj);
console.log(1111,this.speData);
},
/** 删除 规格参数 */
deleteSpeParam(index,indexSV) {
......@@ -229,7 +224,6 @@ export default {
el.onclick = () => {
// 底部按钮的点击事件
_this.addSpeName(index);
// localSttorage 存储 下拉数据
if(speNameDom.toggleDropDownVisible) {
speNameDom.toggleDropDownVisible(false);
......@@ -252,12 +246,23 @@ export default {
},
/* 增加 规格名称 */
addSpeName(index) {
this.specName_sm = '';
this.addSpecNameDialog = true;
},
/** 删除 规格名称 */
deleteSpeOption(indexItem,index) {
for(let i = 0; i < this.speOptions.length; i++) {
if (indexItem.id == this.speOptions[i].id) {
this.speOptions.splice(i,1)
break
}
}
let localJSON = JSON.stringify(this.speOptions);
window.localStorage.setItem('localSpeOptions',localJSON)
},
// 添加规格名称,对话框的退出
cancelSpec() {
this.specName_sm = '';
this.addSpecNameDialog = false;
},
// 规格名称,保存
......@@ -486,6 +491,12 @@ export default {
margin: 20px 0;
}
.spe-span-del {
color: red;
font-size: 14px;
margin-top: 10px;
}
/* 商品规格 - 规格名称 - 参数input */
.spe-params-input-item {
width: 150px;
......
......@@ -10,7 +10,8 @@
<p class="goods-type-tip">为商品设置正确的类目,能让商品快速的被搜索到</p>
</div>
<div class="goods-type-options">
<el-cascader-panel v-model="SSQList" :props='props' @change="SSQChange" ref="ssqCascader"></el-cascader-panel>
<!-- <el-cascader-panel v-model="SSQList" :props='props' @change="SSQChange" ref="ssqCascader"></el-cascader-panel>-->
<el-cascader-panel v-model="SSQList" :props='propsOptions' @change="SSQChange" ref="ssqCascader"></el-cascader-panel>
</div>
<el-button type="primary" class="next-step" :disabled="isNextStep" @click="nextStep">下一步</el-button>
</div>
......@@ -51,7 +52,7 @@
<div class="floor-item">
<div class="floor-item-box">
<p class="card-header-title floor-item-box-title"><span class="blue-block-goods blue-block-goods-title"></span>商品详情</p>
<Goodsimg ref="goodsdetailsimg" :imgdata="imgdata"/>
<Goodsimg ref="goodsdetailsimg" :description="description"/>
</div>
</div>
<!-- 售后及服务 -->
......@@ -78,21 +79,21 @@
</template>
<script>
import { NewGetCategory,addGoods,getGoodsNew,updateGoodsNew } from '@/api/module/goods';
import { NewGetCategory,NewGetCategoryData,addGoods,getGoodsNew,updateGoodsNew } from '@/api/module/goods';
import Goodsinfomation from './components/goodsinfomation';
import GoodsSpecifications from './components/goodsspecifications';
import GoodsParameter from './components/goodsparameter';
import Goodsimg from './components/goodsimg';
import Goodsimg from './components/goodsimg2';
import Goodsaftersale from './components/goodsaftersale';
export default {
name: 'Index',
props: {
option: {
type: Number,
required: true
}
},
// props: {
// option: {
// type: Number,
// required: true
// }
// },
components: {
Goodsinfomation,
GoodsSpecifications,
......@@ -105,12 +106,12 @@
goodsLoading: false,
SSQList: [], // 省市区
SSQStr: '', // 省市区 拼接
props: {
propsOptions: {
expandTrigger: 'click',
lazy: true,
lazyLoad: this.lazyLoad,
value: "id",
label: 'label',
label: 'title',
leaf: 'leaf'
},
isNextStep: true,
......@@ -140,9 +141,10 @@
singleSpecTable: []
},
/* 商品详情 */
imgdata: {
description: ''
},
// imgdata: {
// description: ''
// },
description: '',
/* 售后及服务 */
goodsaftersale: {
stags: [],
......@@ -155,12 +157,14 @@
}, // 商品所有数据
TIMER: null,
hehe: 0,
option: 0
} // return end
},
created() {
// option 商品的id
//debugger
this.option = Number(this.$route.query.goods_id)
if( this.option && this.option !== 0 ) {
let data = { goodsId: this.option};
getGoodsNew(data).then(res => {
......@@ -234,7 +238,7 @@
}
// 商品详情
this.imgdata.description = res.data.description;
this.description = res.data.description;
// 售后服务
this.goodsaftersale.freight_id = res.data.freight_id;
......@@ -330,19 +334,19 @@
const level = node.level;
let limboNode = {};
if(level === 0) {
limboNode = {id: 0}
limboNode = {parent_id: 0}
}
if(level === 1) {
limboNode = { id: node.value };
limboNode = { parent_id: node.value };
}
if(level === 2) {
limboNode = { id: node.value };
limboNode = { parent_id: node.value };
}
NewGetCategory(limboNode).then(res => {
NewGetCategoryData(limboNode).then(res => {
let result = {};
result = res.data
if (level === 0) {
result = res.data
result.forEach(item => {
item.value = item.id;
item.label = item.label;
......@@ -369,13 +373,9 @@
if (level === 2) {
for(let i = 0; i < res.data.length; i++) {
if( res.data[i].children.length > 0) {
for(let j = 0; j < res.data[i].children.length; j++) {
if( limboNode.id === res.data[i].children[j].id ) {
result = res.data[i].children[j].children;
break;
}
}
if( limboNode.id === res.data[i].id ) {
result = res.data[i].children;
break;
}
}
......@@ -451,7 +451,6 @@
}
}else {
// 无规格组合数据
debugger
let slingleSpeObj = spsjData1[0];
if ( !Number(slingleSpeObj['js_price']) || Number(slingleSpeObj['js_price']) <0 ) {
goodsPriceMsg = '[ 商品售价 ]中,协议价不能为空,并且只能填大于0的数值'
......@@ -472,7 +471,8 @@
}
// 商品详情 是否填写完整
let isGoodsDetailsImgMsg = (this.$refs.goodsdetailsimg.goodsDeForm.description.indexOf('img') > -1) ? true : false;
// let isGoodsDetailsImgMsg = (this.$refs.goodsdetailsimg.goodsDeForm.description.indexOf('img') > -1) ? true : false;
let isGoodsDetailsImgMsg = (this.$refs.goodsdetailsimg.editor.txt.html()) ? true : false
// 售后服务 是否填写完整
let isGoodsAfterSaleMsg = this.$refs['goodsaftersale'].validateGoodsAfterSaleForm();
......@@ -490,9 +490,8 @@
return
}
}
if(!isGoodsDetailsImgMsg) {
this.$message({type:'error',message:'请先上传描述商品详情的图片'});
this.$message({type:'error',message:'商品详情未填写完整'});
this.setFloorNavMountClick(3);
return
}
......@@ -561,13 +560,15 @@
// 商品详情 数据
let spxqData = this.$refs.goodsdetailsimg.goodsDeForm;
// let spxqData = this.$refs.goodsdetailsimg.goodsDeForm;
let spxqData = String(this.$refs.goodsdetailsimg.editor.txt.html())
// 售后服务 数据
let ssffData = this.$refs.goodsaftersale.goodsAfterSaleForm;
// 所有数据合并
Object.assign( this.goodsAllData, spxxData, spsjData, spxqData, ssffData);
Object.assign( this.goodsAllData, spxxData, spsjData, ssffData);
this.goodsAllData.description = spxqData
// 经营类目,服务标签,需要单独处理数据格式
this.goodsAllData.category_id = spxxData.categoryList.slice(-1)[0] ? spxxData.categoryList.slice(-1)[0] : '';
......
......@@ -177,6 +177,14 @@
>还原
</el-button>
<el-divider direction="vertical" v-if="radiomodel!=3"></el-divider>
<!-- 上架销售中,不下架编辑 -->
<el-button
v-if="radiomodel==1"
size="mini"
type="text"
@click="hotEditGoods(scope.row)"
>编辑
</el-button>
<el-button
v-if="radiomodel!=4 && radiomodel!=1"
size="mini"
......@@ -184,7 +192,7 @@
@click="editgoods(scope.row)"
>编辑
</el-button>
<el-divider direction="vertical" v-if="radiomodel!=4 && radiomodel!=1"></el-divider>
<el-divider direction="vertical" v-if="radiomodel!=4"></el-divider>
<el-button
size="mini"
type="text"
......@@ -227,12 +235,65 @@
<goodDetail :goods-id="goodDetails"></goodDetail>
</el-dialog>
</el-card>
<!-- 不下架 编辑商品 -->
<el-dialog title="编辑商品" :visible.sync="isHotEditGoods" center :close-on-click-modal="false"
:before-close="cancelHotEditGoods" width="50%" class="dialog-spe">
<p class="hot-edit-goods-tips">备注:上架销售中的商品,仅可修改【发货时效、邮费模板、售后时长、商品库存量】等信息,修改后无需审核可直接上架。
如需编辑更多商品信息,请先将商品下架再进行编辑。</p>
<el-form :model="hotEditGoodsForm" ref="hotEditGoodsForm" label-width="30%" size="small">
<el-form-item label="发货时效:" prop="delay_compensate">
<el-select v-model="hotEditGoodsForm.delay_compensate" style="width:400px" placeholder="请选择发货时效">
<el-option label="24小时" :value="24"></el-option>
<el-option label="48小时" :value="48"></el-option>
</el-select>
</el-form-item>
<el-form-item label="邮费模板:" prop="freight_id">
<el-select v-model="hotEditGoodsForm.freight_id" placeholder="请选择邮费模板" style="width:400px;">
<el-option v-for="item in freightOptions" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="售后时长:" prop="aftersale_time">
<el-select v-model="hotEditGoodsForm.aftersale_time" style="width:400px;" placeholder="请选择售后时长">
<el-option label="7天" :value="7"></el-option>
<el-option label="15天" :value="15"></el-option>
<el-option label="30天" :value="30"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-table :data="speList" class="hot-edit-goods-table" border v-if="speList.length">
<el-table-column label="规格项" prop="spe" align="center">
<template slot-scope="scope">
<span v-for="(item, index) in scope.row.objArr">
{{ `${item.name}: ${item.spec_values}` }}
</span>
</template>
</el-table-column>
<el-table-column label="库存量" width="160px" prop="stock" align="center"></el-table-column>
</el-table>
<el-table :data="[1]" class="hot-edit-goods-table" border v-else>
<el-table-column label="规格项" prop="spe" align="center">
<template slot-scope="scope">
默认
</template>
</el-table-column>
<el-table-column label="库存量" width="160px" prop="stock" align="center">
<template slot-scope="scope">
{{ stock }}
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button size="small" @click="cancelHotEditGoods"> </el-button>
<el-button size="small" type="primary" @click="saveHotEditGoods"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import goodDetail from './components/goodsdetail'
import editGood from '@/views/system/goods/add/index'
import { getlistGoods, shelvesStatus, delgoodsStatus,cancelOnsale,cancelOnsaleAllData } from '@/api/module/goodsgement'
import { GetFreight,getGoodsNew } from '@/api/module/goods'
import { getlistGoods, shelvesStatus, delgoodsStatus,cancelOnsale,cancelOnsaleAllData,saveHotEditGoodsData } from '@/api/module/goodsgement'
import {dateFormat} from '@/utils'
export default {
......@@ -300,7 +361,18 @@
name: [
{required: true, message: "模板名称不能为空", trigger: "blur"}
],
}
},
// 热更新商品
isHotEditGoods: false,
hotEditGoodsForm: {
delay_compensate: 24,
freight_id: 310,
aftersale_time: 7
},
freightOptions: [],
speList: [],
stock: 0,
rowInfo: null
};
},
components: {
......@@ -325,6 +397,16 @@
// }
},
methods: {
// 运费模板
getFreightData() {
GetFreight().then(res => {
if(res.data) {
this.freightOptions = res.data;
}else {
this.freightOptions = ''
}
});
},
handledelgrain(row, isall) { //彻底删除
let good_id, is_on, title, message
if (isall == 'one') {
......@@ -588,6 +670,91 @@
});
//this.$router.push({ path: '/system/goods/editgoods' });
},
/** 不下架 编辑部分商品信息 */
hotEditGoods(row) {
let data = {
goodsId: row.goods_id
};
if (!data.goodsId) {
return
}
// 获取运费模板
this.getFreightData();
getGoodsNew(data).then(res=> {
if (res.code == 1 && res.data) {
this.isHotEditGoods = true;
this.stock = res.data.stock
this.rowInfo = res.data
this.hotEditGoodsForm.delay_compensate = res.data.delay_compensate
this.hotEditGoodsForm.freight_id = res.data.freight_id
this.hotEditGoodsForm.aftersale_time = res.data.aftersale_time
// 规格组合
this.speList = []
if (res.data.specs && res.data.specs_group) {
let nameArr = []
res.data.specs.map(item => {
nameArr.push(item.spec_name)
})
for (let i = 0, len = res.data.specs_group.length; i < len; i++) {
this.speList.push({
nameArr,
spec_name: res.data.specs_group[i].spec_values,
stock: res.data.specs_group[i].stock,
id: res.data.specs_group[i].id
})
}
for (let i = 0, len = this.speList.length; i < len; i++) {
let arr = []
for (let j = 0, len = res.data.specs.length; j < len; j++) {
arr.push({
name: this.speList[i].nameArr[j],
spec_values: this.speList[i].spec_name[j]
})
}
this.speList[i].objArr = arr
}
}
}
});
},
/** 保存 不下架 编辑商品 */
saveHotEditGoods() {
let groupArr = []
this.speList.map(item => {
groupArr.push({
id: item.id,
stock: item.stock
})
})
let data = {
goods_id: this.rowInfo.goods_id,
delay_compensate: this.hotEditGoodsForm.delay_compensate,
aftersale_time: this.hotEditGoodsForm.aftersale_time,
freight_id: this.hotEditGoodsForm.freight_id,
specs_group: this.speList.length ? groupArr : undefined,
stock: this.speList.length ? undefined : this.stock
}
saveHotEditGoodsData(data).then(res=> {
if (res.code == 1) {
this.$message({
type: 'success',
message: '保存成功'
})
this.getList()
}
});
},
/** 不下架编辑 退出*/
cancelHotEditGoods() {
this.isHotEditGoods = false;
},
lookdetail(row) {//预览商品详情
this.isOpen = true
this.goodDetails.goods_id = row.goods_id
......@@ -749,4 +916,30 @@
.queryFormInline {
padding-bottom: 20px;
}
.hot-edit-goods-tips {
color: red;
font-size: 14px;
width: 80%;
margin: 0 auto 20px;
line-height: 20px;
}
/* 弹窗 样式 重置 */
.dialog-spe >>> .el-dialog {
width: 75%;
height: 75%;
overflow: hidden;
}
.dialog-spe >>> .el-dialog .el-dialog__body {
height:calc(100% - 115px);
padding: 0 20px 20px 40px;
overflow: auto;
}
.hot-edit-goods-table {
width: 90%;
margin: 20px auto 0;
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论