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

add preview func

上级 0c3386ee
......@@ -394,6 +394,15 @@
left:50%;
transform: translateX(-50%);
}
.fixed-submit{
position: fixed;
top:30px;
right: 30px;
z-index: 100;
}
.preview{
right:120px;
}
</style>
</head>
<body>
......@@ -508,6 +517,8 @@
<table id="jqGrid"></table>
</div>
<Card v-show="!showList">
<i-button class="fixed-submit preview" v-show="tbCfStationItem.itemId" @click="preview(tbCfStationItem.itemId)" type="primary">预览</i-button>
<i-button class="fixed-submit" type="primary" @click="handleSubmit('formValidate')">提交</i-button>
<p slot="title">{{title}}</p>
<i-form ref="formValidate" :model="tbCfStationItem" :rules="ruleValidate" :label-width="80">
<Form-item label="商品编号" prop="itemCode" style="width: 800px">
......
......@@ -94,6 +94,10 @@ let vm = new Vue({
batchCount:0
},
methods: {
//预览
preview(e){
window.open(`https://www.afrieshop.com/product_detail?pid=${e}&from=backstage management system&from_fullPath=${window.location.herf}`,'_blank');
},
cancelSelectImg(){
this.prevItem[this.skuListsIndex].skuImg=null;
this.showAttributeImg = false;
......@@ -289,38 +293,42 @@ let vm = new Vue({
vm.getInfo(itemId);
},
saveOrUpdate: function (event) {
let resArr = [];
this.prevItem.forEach(item => {
resArr.push(item)
})
let label = null;
vm.tbCfStationItem.itemLabel = this.isSelectedArr.map(item => item.id).join(',');
vm.tbCfStationItem.prevItem = resArr
vm.tbCfStationItem.putaway = this.putaway
this.$set(vm.tbCfStationItem, 'tree', this.attrItem)
let _this = this
console.log(11111,vm.uploadList)
vm.tbCfStationItem.itemImg = vm.uploadList.map(res => res).join(';');
vm.tbCfStationItem.itemDesc = encodeURI(UE.getEditor('itemDesc').getContent()); // 富文本取值
vm.tbCfStationItem.itemDesc = vm.tbCfStationItem.itemDesc.replace(/&nbsp;/g, " ");
vm.tbCfStationItem.skuImgs = vm.AttributeImgArr.map( item => item.img_path).join(';');
let url = vm.tbCfStationItem.itemId == null ? "../tbcfstationitem/save" : "../tbcfstationitem/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfStationItem),
type: "POST",
data: {
putaway: _this.putaway,
prevItem: vm.prevItem,
itemDesc: itemDesc,
},
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
if(vm.prevItem.length===0){
console.log(123);
alert('请编辑完属性后再保存');
}else{
let resArr = [];
this.prevItem.forEach(item => {
resArr.push(item)
})
let label = null;
vm.tbCfStationItem.itemLabel = this.isSelectedArr.map(item => item.id).join(',');
vm.tbCfStationItem.prevItem = resArr
vm.tbCfStationItem.putaway = this.putaway
this.$set(vm.tbCfStationItem, 'tree', this.attrItem)
let _this = this
vm.tbCfStationItem.itemImg = vm.uploadList.map(res => res).join(';');
vm.tbCfStationItem.itemDesc = encodeURI(UE.getEditor('itemDesc').getContent()); // 富文本取值
vm.tbCfStationItem.itemDesc = vm.tbCfStationItem.itemDesc.replace(/&nbsp;/g, " ");
vm.tbCfStationItem.skuImgs = vm.AttributeImgArr.map( item => item.img_path).join(';');
let url = vm.tbCfStationItem.itemId == null ? "../tbcfstationitem/save" : "../tbcfstationitem/update";
Ajax.request({
url: url,
params: JSON.stringify(vm.tbCfStationItem),
type: "POST",
data: {
putaway: _this.putaway,
prevItem: vm.prevItem,
itemDesc: itemDesc,
},
contentType: "application/json",
successCallback: function (r) {
alert('操作成功', function (index) {
vm.reload();
});
}
});
}
},
del: function (event) {
let itemIds = getSelectedRows("#jqGrid");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论