提交 ffe92945 authored 作者: 潘鹏's avatar 潘鹏

添加商品copy功能

上级 1b000ef2
...@@ -537,14 +537,19 @@ ...@@ -537,14 +537,19 @@
</div> </div>
<Card v-show="!showList"> <Card v-show="!showList">
<div class="flot-button"> <div class="flot-button">
<i-button class="fixed-submit preview" v-show="tbCfStationItem.itemId" <i-button class="fixed-submit preview"
@click="preview(tbCfStationItem.itemId,'pc')" type="primary">PC预览 @click="copy()" type="success">复制
</i-button>
<i-button class="fixed-submit preview"
v-show="show_paste_btn"
@click="paste()"
>粘贴
</i-button> </i-button>
<i-button class="fixed-submit preview" v-show="tbCfStationItem.itemId" <i-button class="fixed-submit preview" v-show="tbCfStationItem.itemId"
@click="preview(tbCfStationItem.itemId,'m')" type="primary">Mobile预览 @click="preview(tbCfStationItem.itemId,'pc')" type="primary">预览
</i-button> </i-button>
<i-button class="fixed-submit" type="primary" @click="handleSubmit('formValidate')">提交</i-button> <i-button class="fixed-submit" type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<i-button class="fixed-back" type="primary" @click="back()"/> <i-button class="fixed-back" type="warning" @click="back()"/>
返回</i-button> 返回</i-button>
</div> </div>
<p slot="title">{{title}}</p> <p slot="title">{{title}}</p>
...@@ -935,7 +940,21 @@ ...@@ -935,7 +940,21 @@
@on-ok="delAttr"> @on-ok="delAttr">
<p>确认删除此属性</p> <p>确认删除此属性</p>
</Modal> </Modal>
<!-- 粘贴提示-->
<Modal
v-model="paste_modal"
title="确认粘贴?"
@on-ok="comfirmPaste()"
>
<h4>粘贴内容如下:</h4>
<br/>
<p>1.搜索关键词。</p>
<p>2.标签。</p>
<p>3.供应商。</p>
<p>4.商品分类。</p>
<p>5.商品参数。</p>
<i>PS:如需增加可粘贴内容请与开发团队联系。</i>
</Modal>
<br/> <br/>
<br/> <br/>
...@@ -950,6 +969,12 @@ ...@@ -950,6 +969,12 @@
<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button> <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
</Form-item> </Form-item>
</i-form> </i-form>
<!-- 退出警告 -->
<Modal
v-model="showQuitHint"
@on-ok="quit">
<p>还未保存,是否退出?</p>
</Modal>
</Card> </Card>
<script src="${rc.contextPath}/js/plugins/Sortable.min.js"></script> <script src="${rc.contextPath}/js/plugins/Sortable.min.js"></script>
<script src="${rc.contextPath}/statics/libs/iview.js"></script> <script src="${rc.contextPath}/statics/libs/iview.js"></script>
......
...@@ -94,7 +94,10 @@ let vm = new Vue({ ...@@ -94,7 +94,10 @@ let vm = new Vue({
batchCount: 0, batchCount: 0,
//2020年5月20日 商品参数 //2020年5月20日 商品参数
paramster: [] paramster: [],
show_paste_btn:false,// 粘贴按钮
paste_modal:false,
showQuitHint:false,
}, },
methods: { methods: {
//预览 //预览
...@@ -239,7 +242,7 @@ let vm = new Vue({ ...@@ -239,7 +242,7 @@ let vm = new Vue({
this.showAttributeImg = Bool; this.showAttributeImg = Bool;
}, },
//获取二级分类 //获取二级分类
changeGoodstype() { changeGoodstype(e) {
let url = "../tbcfstationitem/queryByItemType?typeId=" + this.tbCfStationItem.itemCategory; let url = "../tbcfstationitem/queryByItemType?typeId=" + this.tbCfStationItem.itemCategory;
// console.log('url',url) // console.log('url',url)
let that = this; let that = this;
...@@ -250,6 +253,7 @@ let vm = new Vue({ ...@@ -250,6 +253,7 @@ let vm = new Vue({
successCallback: function (r) { successCallback: function (r) {
if (r.code === 0) { if (r.code === 0) {
that.Goodstype2 = r.list that.Goodstype2 = r.list
e?setTimeout(()=>{that.changeGoodstype2()},0):void(0);
if (r.list.length === 0) { if (r.list.length === 0) {
that.tbCfStationItem.itemCategorytwo = null that.tbCfStationItem.itemCategorytwo = null
} }
...@@ -278,6 +282,7 @@ let vm = new Vue({ ...@@ -278,6 +282,7 @@ let vm = new Vue({
vm.reload(); vm.reload();
}, },
add: function () { add: function () {
window.sessionStorage.getItem('_copy_product_info') ? this.show_paste_btn = true : void(0);
this.AttributeImgArr.length = 0; this.AttributeImgArr.length = 0;
this.paramster.length = 0; this.paramster.length = 0;
this.paramster.push( this.paramster.push(
...@@ -304,6 +309,7 @@ let vm = new Vue({ ...@@ -304,6 +309,7 @@ let vm = new Vue({
UE.getEditor('itemDesc').setContent(""); UE.getEditor('itemDesc').setContent("");
}, },
update: function (event) { update: function (event) {
window.sessionStorage.getItem('_copy_product_info') ? this.show_paste_btn = true : void(0);
this.disabledChangeAttribute = true; this.disabledChangeAttribute = true;
this.prevItem = []; this.prevItem = [];
let itemId = getSelectedRow("#jqGrid"); let itemId = getSelectedRow("#jqGrid");
...@@ -502,16 +508,7 @@ let vm = new Vue({ ...@@ -502,16 +508,7 @@ let vm = new Vue({
}, },
back() { back() {
//清除未保存商品的图片 this.showQuitHint = true;
if (!vm.tbCfStationItem.itemId) {
this.AttributeImgArr.map((item, index) => {
this.delAttributeImg(item.img_path, true);
})
setTimeout(() => {
this.AttributeImgArr = [];
}, 0)
}
this.reload();
}, },
reload: function (event) { reload: function (event) {
this.prevItem = [] this.prevItem = []
...@@ -659,7 +656,6 @@ let vm = new Vue({ ...@@ -659,7 +656,6 @@ let vm = new Vue({
/* 添加属性 */ /* 添加属性 */
addAttr() { addAttr() {
console.log(999)
if (this.attrItem.length > 2) { if (this.attrItem.length > 2) {
this.$Message.info('最多添加三种属性'); this.$Message.info('最多添加三种属性');
} else { } else {
...@@ -858,6 +854,53 @@ let vm = new Vue({ ...@@ -858,6 +854,53 @@ let vm = new Vue({
} }
}) })
this.paramster = arr; this.paramster = arr;
},
//复制
copy(){
window.sessionStorage.setItem('_copy_product_info',
JSON.stringify({
search_keyword:this.tbCfStationItem.itemTags,
tags:this.isSelectedArr,
spe:this.tbCfStationItem.supplier,
catagory:{
level_one:this.tbCfStationItem.itemCategory,
level_two:this.tbCfStationItem.itemCategorytwo,
level_three:this.tbCfStationItem.itemDescritionId,
},
product_paramster:this.paramster
})
)
this.$Message.success('复制成功 0.0');
},
paste(){
this.paste_modal = true;
},
comfirmPaste(){
this.paste_modal = false;
this.$Message.success('粘贴成功 0.0');
let _paste_data = null;
_paste_data = JSON.parse(window.sessionStorage.getItem('_copy_product_info'));
this.tbCfStationItem.itemTags = _paste_data.search_keyword;
this.isSelectedAr = _paste_data.tags;
this.tbCfStationItem.supplier = _paste_data.spe;
this.tbCfStationItem.itemCategory = _paste_data.catagory.level_one || null;
this.changeGoodstype(true);
this.tbCfStationItem.itemCategorytwo = _paste_data.catagory.level_two || null;
this.tbCfStationItem.itemDescritionId = _paste_data.catagory.level_three || null;
this.paramster = _paste_data.product_paramster;
},
quit(){
//清除未保存商品的图片
if (!vm.tbCfStationItem.itemId) {
this.AttributeImgArr.map((item, index) => {
this.delAttributeImg(item.img_path, true);
})
setTimeout(() => {
this.AttributeImgArr = [];
}, 0)
}
this.reload();
} }
}, },
created() { created() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论