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

add preview func

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