Authored by 陶雨

模板商品管理

... ... @@ -5,13 +5,11 @@
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<div id="basicForm" class="form-horizontal form-bordered form-inline" data-id="<%id%>">
<input type="hidden" name="temp_id" value="108">
<div class="form-group">
<button type="button" class="btn btn-info" onclick="inputfile.click();">浏览文档</button>
<input type="file" id="inputfile" style="display:none" name="filexls">
<input id="uploadBox" name="file" type="file" style="position: absolute; top: 0;left: 0;z-index: -999">
<div id="chooseFile" class="file-name btn btn-success">上传商品</div>
<p style="color: #999">注:上传.xls文件</p>
</div>
<button class="btn btn-success" type="submit" id="upload">上传商品</button>
<p style="color: #999">注:上传.xls文件</p>
</div>
</div>
<div class="panel-body" id="condition">
... ...
... ... @@ -42,6 +42,24 @@ var g = new common.grid({
g.init("/activityTemplate/getProductListByCondition");
common.edit.ajaxfileupload("#uploadBox", {
params: {
type: "activityProduct",
__type: "batch-import",
args:id
},
valid_extensions: ['xls', 'xlsx'],
onComplete: function (response) {
if (response.status && response.code == 200) {
common.util.__tip(response.message, 'success');
g.reload();
}
else {
common.util.__tip(response.message, 'warning');
}
}
});
//编辑
$(document).on("click", ".edit", function () {
var index = $(this).data("index");
... ... @@ -84,4 +102,8 @@ $(document).on("click", "#filter-btn", function () {
//输入限制
$(document).on("keyup",".number", function () {
$(this).val($(this).val().replace(/\D/g, ''));
});
$(document).on("click", "#chooseFile", function () {
$("#uploadBox").click();
});
\ No newline at end of file
... ...