|
@@ -2,39 +2,44 @@ $(function () {
|
|
$("#jqGrid").jqGrid({
|
|
$("#jqGrid").jqGrid({
|
|
url: '../brand/list',
|
|
url: '../brand/list',
|
|
datatype: "json",
|
|
datatype: "json",
|
|
- colModel: [{
|
|
|
|
- label: 'id', name: 'id', index: 'id', key: true, width: 140, align: 'center'
|
|
|
|
- },
|
|
|
|
|
|
+ colModel: [
|
|
|
|
+ {label: 'id', name: 'id', index: 'id', key: true, width: 140, align: 'center', hidden: true},
|
|
// {label: '所属商户', name: 'merchName', index: 'merchName', width: 180, align: 'center'},
|
|
// {label: '所属商户', name: 'merchName', index: 'merchName', width: 180, align: 'center'},
|
|
// {label: '所属门店', name: 'storeName', index: 'storeName', width: 180, align: 'center'},
|
|
// {label: '所属门店', name: 'storeName', index: 'storeName', width: 180, align: 'center'},
|
|
// {label: '所属分类', name: 'categoryName', index: 'categoryName', width: 180, align: 'center'},
|
|
// {label: '所属分类', name: 'categoryName', index: 'categoryName', width: 180, align: 'center'},
|
|
{
|
|
{
|
|
label: '品牌名称', name: 'name', index: 'name', width: 300
|
|
label: '品牌名称', name: 'name', index: 'name', width: 300
|
|
- },{
|
|
|
|
|
|
+ },
|
|
|
|
+ {
|
|
label: '品牌唯一简码', name: 'uniqueIdentifier', index: 'name', width: 100
|
|
label: '品牌唯一简码', name: 'uniqueIdentifier', index: 'name', width: 100
|
|
- }, {
|
|
|
|
- label: '图片',
|
|
|
|
- name: 'listPicUrl',
|
|
|
|
- index: 'list_pic_url',
|
|
|
|
- width: 100,
|
|
|
|
- align: 'center',
|
|
|
|
- formatter: function (value) {
|
|
|
|
- return transImg(value);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // label: '图片',
|
|
|
|
+ // name: 'listPicUrl',
|
|
|
|
+ // index: 'list_pic_url',
|
|
|
|
+ // width: 100,
|
|
|
|
+ // align: 'center',
|
|
|
|
+ // formatter: function (value) {
|
|
|
|
+ // return transImg(value);
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
label: '描述', name: 'simpleDesc', index: 'simple_desc', width: 250
|
|
label: '描述', name: 'simpleDesc', index: 'simple_desc', width: 250
|
|
- }, {
|
|
|
|
- label: '图片',
|
|
|
|
- name: 'picUrl',
|
|
|
|
- index: 'pic_url',
|
|
|
|
- width: 100,
|
|
|
|
- align: 'center',
|
|
|
|
- formatter: function (value) {
|
|
|
|
- return transImg(value);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
- label: '排序', name: 'sortOrder', index: 'sort_order', width: 100, align: 'center'
|
|
|
|
- }, {
|
|
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // label: '图片',
|
|
|
|
+ // name: 'picUrl',
|
|
|
|
+ // index: 'pic_url',
|
|
|
|
+ // width: 100,
|
|
|
|
+ // align: 'center',
|
|
|
|
+ // formatter: function (value) {
|
|
|
|
+ // return transImg(value);
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ // {
|
|
|
|
+ // label: '排序', name: 'sortOrder', index: 'sort_order', width: 100, align: 'center'
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
label: '显示',
|
|
label: '显示',
|
|
name: 'isShow',
|
|
name: 'isShow',
|
|
index: 'is_show',
|
|
index: 'is_show',
|
|
@@ -43,33 +48,36 @@ $(function () {
|
|
formatter: function (value) {
|
|
formatter: function (value) {
|
|
return transIsNot(value)
|
|
return transIsNot(value)
|
|
}
|
|
}
|
|
- }, {
|
|
|
|
- label: '展示价格', name: 'floorPrice', index: 'floor_Price', width: 100, align: 'right'
|
|
|
|
- }, {
|
|
|
|
- label: 'app显示图片',
|
|
|
|
- name: 'appListPicUrl',
|
|
|
|
- index: 'app_list_pic_url',
|
|
|
|
- align: 'center',
|
|
|
|
- width: 100,
|
|
|
|
- formatter: function (value) {
|
|
|
|
- return transImg(value);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
|
|
+ },
|
|
|
|
+ // {
|
|
|
|
+ // label: '展示价格', name: 'floorPrice', index: 'floor_Price', width: 100, align: 'right'
|
|
|
|
+ // }, {
|
|
|
|
+ // label: 'app显示图片',
|
|
|
|
+ // name: 'appListPicUrl',
|
|
|
|
+ // index: 'app_list_pic_url',
|
|
|
|
+ // align: 'center',
|
|
|
|
+ // width: 100,
|
|
|
|
+ // formatter: function (value) {
|
|
|
|
+ // return transImg(value);
|
|
|
|
+ // }
|
|
|
|
+ // },
|
|
|
|
+ {
|
|
label: '新品牌', name: 'isNew', index: 'is_new', align: 'center', width: 100, formatter: function (value) {
|
|
label: '新品牌', name: 'isNew', index: 'is_new', align: 'center', width: 100, formatter: function (value) {
|
|
return transIsNot(value)
|
|
return transIsNot(value)
|
|
}
|
|
}
|
|
- }, {
|
|
|
|
- label: '新品牌图片',
|
|
|
|
- name: 'newPicUrl',
|
|
|
|
- index: 'new_pic_url',
|
|
|
|
- align: 'center',
|
|
|
|
- width: 100,
|
|
|
|
- formatter: function (value) {
|
|
|
|
- return transImg(value);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
- label: '新品牌排序', name: 'newSortOrder', index: 'new_sort_order', align: 'center', width: 80
|
|
|
|
}
|
|
}
|
|
|
|
+ // {
|
|
|
|
+ // label: '新品牌图片',
|
|
|
|
+ // name: 'newPicUrl',
|
|
|
|
+ // index: 'new_pic_url',
|
|
|
|
+ // align: 'center',
|
|
|
|
+ // width: 100,
|
|
|
|
+ // formatter: function (value) {
|
|
|
|
+ // return transImg(value);
|
|
|
|
+ // }
|
|
|
|
+ // }, {
|
|
|
|
+ // label: '新品牌排序', name: 'newSortOrder', index: 'new_sort_order', align: 'center', width: 80
|
|
|
|
+ // }
|
|
// ,
|
|
// ,
|
|
// {label: '操作', width: 150, align: 'center', sortable: false,
|
|
// {label: '操作', width: 150, align: 'center', sortable: false,
|
|
// formatter: function (value, col, row) {
|
|
// formatter: function (value, col, row) {
|
|
@@ -113,7 +121,7 @@ $(function () {
|
|
|
|
|
|
|
|
|
|
var category_ztree;
|
|
var category_ztree;
|
|
-var exportMsg;
|
|
|
|
|
|
+
|
|
var category_setting = {
|
|
var category_setting = {
|
|
data: {
|
|
data: {
|
|
simpleData: {
|
|
simpleData: {
|
|
@@ -146,16 +154,19 @@ var vm = new Vue({
|
|
brand: {listPicUrl: '', picUrl: '', appListPicUrl: '', newPicUrl: '', isShow: 1, isNew: 0},
|
|
brand: {listPicUrl: '', picUrl: '', appListPicUrl: '', newPicUrl: '', isShow: 1, isNew: 0},
|
|
ruleValidate: {
|
|
ruleValidate: {
|
|
name: [
|
|
name: [
|
|
- {required: true, message: '品牌名称不能为空', trigger: 'blur'}
|
|
|
|
|
|
+ {required: true, message: '品牌名称不能为空', trigger: 'blur'},
|
|
|
|
+ {max: 64, message: '品牌名称长度不能超过64', trigger: 'blur'}
|
|
],
|
|
],
|
|
uniqueIdentifier: [
|
|
uniqueIdentifier: [
|
|
- {required: true, message: '品牌唯一简码不能为空', trigger: 'blur'}
|
|
|
|
|
|
+ // {required: true, message: '品牌唯一简码不能为空', trigger: 'blur'},
|
|
|
|
+ {max: 10, message: '品牌唯一简码长度不能超过10', trigger: 'blur'}
|
|
],
|
|
],
|
|
// listPicUrl: [
|
|
// listPicUrl: [
|
|
// {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
// {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
// ],
|
|
// ],
|
|
simpleDesc: [
|
|
simpleDesc: [
|
|
- {required: true, message: '品牌描述不能为空', trigger: 'blur'}
|
|
|
|
|
|
+ {required: true, message: '品牌描述不能为空', trigger: 'blur'},
|
|
|
|
+ {max: 200, message: '品牌描述长度不能超过200', trigger: 'blur'}
|
|
],
|
|
],
|
|
// picUrl: [
|
|
// picUrl: [
|
|
// {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
// {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
@@ -289,9 +300,10 @@ var vm = new Vue({
|
|
|
|
|
|
// 校验品牌唯一简码
|
|
// 校验品牌唯一简码
|
|
var uniqueIdentifier = vm.brand.uniqueIdentifier;
|
|
var uniqueIdentifier = vm.brand.uniqueIdentifier;
|
|
- var uniqueReg = /^[0-9a-zA-Z_]{1,10}$/;
|
|
|
|
|
|
+ var uniqueReg = /^[0-9a-zA-Z_]{0,10}$/;
|
|
if(!uniqueReg.test(uniqueIdentifier)){
|
|
if(!uniqueReg.test(uniqueIdentifier)){
|
|
alert("请输入正确的唯一简码");
|
|
alert("请输入正确的唯一简码");
|
|
|
|
+ return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -475,7 +487,6 @@ var vm = new Vue({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
uploadExcelSuccess: function (data) {
|
|
uploadExcelSuccess: function (data) {
|
|
- // console.log(data);
|
|
|
|
if (data.code == 0) {
|
|
if (data.code == 0) {
|
|
alert('导入成功', function (index) {
|
|
alert('导入成功', function (index) {
|
|
$("#jqGrid").trigger("reloadGrid");
|
|
$("#jqGrid").trigger("reloadGrid");
|
|
@@ -483,30 +494,22 @@ var vm = new Vue({
|
|
} else {
|
|
} else {
|
|
alert(data.msg);
|
|
alert(data.msg);
|
|
}
|
|
}
|
|
- setTimeout(exportMsg, 100);
|
|
|
|
},
|
|
},
|
|
uploadExcelError: function () {
|
|
uploadExcelError: function () {
|
|
alert('上传出现异常,请重试!');
|
|
alert('上传出现异常,请重试!');
|
|
- setTimeout(exportMsg, 100);
|
|
|
|
},
|
|
},
|
|
uploadExcelProgress: function (event, file, fileList) {
|
|
uploadExcelProgress: function (event, file, fileList) {
|
|
- console.log("上传中")
|
|
|
|
- console.log(event)
|
|
|
|
- console.log(file)
|
|
|
|
- console.log(fileList)
|
|
|
|
- console.log("上传中")
|
|
|
|
- exportMsg = this.$Message.loading({
|
|
|
|
|
|
+ const msg = this.$Message.loading({
|
|
content: 'Loading...',
|
|
content: 'Loading...',
|
|
duration: 0
|
|
duration: 0
|
|
});
|
|
});
|
|
- // setTimeout(msg, 3000);
|
|
|
|
|
|
+ setTimeout(msg, 1000);
|
|
},
|
|
},
|
|
uploadExcelFormatError: function (file) {
|
|
uploadExcelFormatError: function (file) {
|
|
this.$Notice.warning({
|
|
this.$Notice.warning({
|
|
title: '文件格式不正确',
|
|
title: '文件格式不正确',
|
|
desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
|
|
desc: '文件 ' + file.name + ' 格式不正确,请上传 xls 或 xlsx 格式的文件。'
|
|
});
|
|
});
|
|
- setTimeout(exportMsg, 100);
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|