|
@@ -3,56 +3,85 @@ $(function () {
|
|
url: '../brand/list',
|
|
url: '../brand/list',
|
|
datatype: "json",
|
|
datatype: "json",
|
|
colModel: [{
|
|
colModel: [{
|
|
- label: 'id', name: 'id', index: 'id', key: true, width: 140,align: 'center'
|
|
|
|
|
|
+ label: 'id', name: 'id', index: 'id', key: true, width: 140, align: 'center'
|
|
},
|
|
},
|
|
- {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: 'listPicUrl', index: 'list_pic_url', width: 100, align: 'center', formatter: function (value) {
|
|
|
|
- return transImg(value);
|
|
|
|
- }
|
|
|
|
- }, {
|
|
|
|
- label: '描述', name: 'simpleDesc', index: 'simple_desc', width: 100
|
|
|
|
- }, {
|
|
|
|
- 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: 'isShow', index: 'is_show', width: 100, align: 'center', formatter: function (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: 'isNew', index: 'is_new', align: 'center', width: 100, formatter: function (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: '操作', width: 150, align: 'center', sortable: false,
|
|
|
|
- formatter: function (value, col, row) {
|
|
|
|
- if(hasPermission('brand:saveCopyBrand')) {
|
|
|
|
- return " <button class='btn btn-primary' " +
|
|
|
|
- "onclick='vm.copyBrand(" + row.id + ")'>复制品牌</button>";
|
|
|
|
- }else {
|
|
|
|
- return '-'
|
|
|
|
- }
|
|
|
|
|
|
+ label: '品牌名称', name: 'name', index: 'name', width: 300
|
|
|
|
+ },{
|
|
|
|
+ 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: '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: 'isShow',
|
|
|
|
+ index: 'is_show',
|
|
|
|
+ width: 100,
|
|
|
|
+ align: 'center',
|
|
|
|
+ formatter: function (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: 'isNew', index: 'is_new', align: 'center', width: 100, formatter: function (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: '操作', width: 150, align: 'center', sortable: false,
|
|
|
|
+ // formatter: function (value, col, row) {
|
|
|
|
+ // if(hasPermission('brand:saveCopyBrand')) {
|
|
|
|
+ // return " <button class='btn btn-primary' " +
|
|
|
|
+ // "onclick='vm.copyBrand(" + row.id + ")'>复制品牌</button>";
|
|
|
|
+ // }else {
|
|
|
|
+ // return '-'
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ ],
|
|
viewrecords: true,
|
|
viewrecords: true,
|
|
height: 550,
|
|
height: 550,
|
|
rowNum: 10,
|
|
rowNum: 10,
|
|
@@ -101,9 +130,9 @@ var category_setting = {
|
|
enable: false,
|
|
enable: false,
|
|
nocheckInherit: true
|
|
nocheckInherit: true
|
|
},
|
|
},
|
|
- callback:{
|
|
|
|
- onClick:function(event, treeId, treeNode){
|
|
|
|
- console.log("点我干啥:"+event+","+treeId+","+treeNode.name+","+treeNode.id);
|
|
|
|
|
|
+ callback: {
|
|
|
|
+ onClick: function (event, treeId, treeNode) {
|
|
|
|
+ console.log("点我干啥:" + event + "," + treeId + "," + treeNode.name + "," + treeNode.id);
|
|
vm.brand.categoryId = treeNode.id;
|
|
vm.brand.categoryId = treeNode.id;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -119,27 +148,30 @@ var vm = new Vue({
|
|
name: [
|
|
name: [
|
|
{required: true, message: '品牌名称不能为空', trigger: 'blur'}
|
|
{required: true, message: '品牌名称不能为空', trigger: 'blur'}
|
|
],
|
|
],
|
|
- listPicUrl: [
|
|
|
|
- {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
|
|
|
|
+ uniqueIdentifier: [
|
|
|
|
+ {required: true, message: '品牌唯一简码不能为空', trigger: 'blur'}
|
|
],
|
|
],
|
|
|
|
+ // listPicUrl: [
|
|
|
|
+ // {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
|
|
+ // ],
|
|
simpleDesc: [
|
|
simpleDesc: [
|
|
{required: true, message: '品牌描述不能为空', trigger: 'blur'}
|
|
{required: true, message: '品牌描述不能为空', trigger: 'blur'}
|
|
],
|
|
],
|
|
- picUrl: [
|
|
|
|
- {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
|
|
- ],
|
|
|
|
|
|
+ // picUrl: [
|
|
|
|
+ // {required: true, message: '品牌图片不能为空', trigger: 'blur'}
|
|
|
|
+ // ],
|
|
// sortOrder: [
|
|
// sortOrder: [
|
|
// {required: true, message: '排序不能为空', trigger: 'blur'}
|
|
// {required: true, message: '排序不能为空', trigger: 'blur'}
|
|
// ],
|
|
// ],
|
|
// floorPrice: [
|
|
// floorPrice: [
|
|
// {required: true, message: '展示价格不能为空', trigger: 'blur'}
|
|
// {required: true, message: '展示价格不能为空', trigger: 'blur'}
|
|
// ],
|
|
// ],
|
|
- appListPicUrl: [
|
|
|
|
- {required: true, message: 'app显示图片不能为空', trigger: 'blur'}
|
|
|
|
- ],
|
|
|
|
- newPicUrl: [
|
|
|
|
- {required: true, message: '新品牌图片不能为空', trigger: 'blur'}
|
|
|
|
- ]
|
|
|
|
|
|
+ // appListPicUrl: [
|
|
|
|
+ // {required: true, message: 'app显示图片不能为空', trigger: 'blur'}
|
|
|
|
+ // ],
|
|
|
|
+ // newPicUrl: [
|
|
|
|
+ // {required: true, message: '新品牌图片不能为空', trigger: 'blur'}
|
|
|
|
+ // ]
|
|
},
|
|
},
|
|
q: {
|
|
q: {
|
|
name: '',
|
|
name: '',
|
|
@@ -148,13 +180,13 @@ var vm = new Vue({
|
|
storeList: [],
|
|
storeList: [],
|
|
merchList: [],
|
|
merchList: [],
|
|
categories: [],//一级分类
|
|
categories: [],//一级分类
|
|
- copyBrandDto: {brandId: '', storeList:"", categoryList:""},
|
|
|
|
|
|
+ copyBrandDto: {brandId: '', storeList: "", categoryList: ""},
|
|
showCopyList: true,
|
|
showCopyList: true,
|
|
showViewList: false,
|
|
showViewList: false,
|
|
stores: [],
|
|
stores: [],
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- copyBrand: function(id){
|
|
|
|
|
|
+ copyBrand: function (id) {
|
|
vm.copyBrandDto.brandId = id;
|
|
vm.copyBrandDto.brandId = id;
|
|
vm.copyBrandDto.storeList = "";
|
|
vm.copyBrandDto.storeList = "";
|
|
vm.copyBrandDto.categoryList = "";
|
|
vm.copyBrandDto.categoryList = "";
|
|
@@ -164,15 +196,15 @@ var vm = new Vue({
|
|
vm.title = "复制品牌";
|
|
vm.title = "复制品牌";
|
|
},
|
|
},
|
|
handleSubmitCopyBrand: function () {
|
|
handleSubmitCopyBrand: function () {
|
|
- if(vm.copyBrandDto.brandId == ""){
|
|
|
|
|
|
+ if (vm.copyBrandDto.brandId == "") {
|
|
alert('品牌id不能为空');
|
|
alert('品牌id不能为空');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if(vm.copyBrandDto.storeList == ""){
|
|
|
|
|
|
+ if (vm.copyBrandDto.storeList == "") {
|
|
alert('门店id批量上传数据没有上传或未上传成功');
|
|
alert('门店id批量上传数据没有上传或未上传成功');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- if(vm.copyBrandDto.categoryList == ""){
|
|
|
|
|
|
+ if (vm.copyBrandDto.categoryList == "") {
|
|
alert('分类id批量上传数据没有上传或未上传成功');
|
|
alert('分类id批量上传数据没有上传或未上传成功');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -197,12 +229,12 @@ var vm = new Vue({
|
|
});
|
|
});
|
|
},
|
|
},
|
|
uploadExcelSuccess: function (data) {
|
|
uploadExcelSuccess: function (data) {
|
|
- if(data.code==0){
|
|
|
|
|
|
+ if (data.code == 0) {
|
|
alert(data.msg, function (index) {
|
|
alert(data.msg, function (index) {
|
|
vm.copyBrandDto.storeList = data.copyBrandDto.storeList;
|
|
vm.copyBrandDto.storeList = data.copyBrandDto.storeList;
|
|
vm.copyBrandDto.categoryList = data.copyBrandDto.categoryList;
|
|
vm.copyBrandDto.categoryList = data.copyBrandDto.categoryList;
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
alert(data.msg);
|
|
alert(data.msg);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -247,6 +279,15 @@ var vm = new Vue({
|
|
// vm.getStoresByMerch();
|
|
// vm.getStoresByMerch();
|
|
},
|
|
},
|
|
saveOrUpdate: function (event) {
|
|
saveOrUpdate: function (event) {
|
|
|
|
+
|
|
|
|
+ // 校验品牌唯一简码
|
|
|
|
+ var uniqueIdentifier = vm.brand.uniqueIdentifier;
|
|
|
|
+ var uniqueReg = /^[0-9a-zA-Z_]{1,10}$/;
|
|
|
|
+ if(!uniqueReg.test(uniqueIdentifier)){
|
|
|
|
+ alert("请输入正确的唯一简码");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
var url = vm.brand.id == null ? "../brand/save" : "../brand/update";
|
|
var url = vm.brand.id == null ? "../brand/save" : "../brand/update";
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "POST",
|
|
type: "POST",
|
|
@@ -311,7 +352,7 @@ var vm = new Vue({
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|
|
- getMerchList: function() {
|
|
|
|
|
|
+ getMerchList: function () {
|
|
$.get("../merch/queryAll", function (r) {
|
|
$.get("../merch/queryAll", function (r) {
|
|
vm.merchList = r.list;
|
|
vm.merchList = r.list;
|
|
});
|
|
});
|
|
@@ -323,13 +364,13 @@ var vm = new Vue({
|
|
vm.showCopyList = true;
|
|
vm.showCopyList = true;
|
|
var page = $("#jqGrid").jqGrid('getGridParam', 'page');
|
|
var page = $("#jqGrid").jqGrid('getGridParam', 'page');
|
|
$("#jqGrid").jqGrid('setGridParam', {
|
|
$("#jqGrid").jqGrid('setGridParam', {
|
|
- postData: {'name': vm.q.name,'storeId':vm.q.storeId},
|
|
|
|
|
|
+ postData: {'name': vm.q.name, 'storeId': vm.q.storeId},
|
|
page: page
|
|
page: page
|
|
}).trigger("reloadGrid");
|
|
}).trigger("reloadGrid");
|
|
vm.handleReset('formValidate');
|
|
vm.handleReset('formValidate');
|
|
},
|
|
},
|
|
handleSuccessListPicUrl: function (res, file) {
|
|
handleSuccessListPicUrl: function (res, file) {
|
|
- if (res.code=="500" && res.msg=="没有权限,请联系管理员授权"){
|
|
|
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
this.$Notice.warning({
|
|
this.$Notice.warning({
|
|
title: res.msg,
|
|
title: res.msg,
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
@@ -338,7 +379,7 @@ var vm = new Vue({
|
|
vm.brand.listPicUrl = file.response.url;
|
|
vm.brand.listPicUrl = file.response.url;
|
|
},
|
|
},
|
|
handleSuccessPicUrl: function (res, file) {
|
|
handleSuccessPicUrl: function (res, file) {
|
|
- if (res.code=="500" && res.msg=="没有权限,请联系管理员授权"){
|
|
|
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
this.$Notice.warning({
|
|
this.$Notice.warning({
|
|
title: res.msg,
|
|
title: res.msg,
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
@@ -347,7 +388,7 @@ var vm = new Vue({
|
|
vm.brand.picUrl = file.response.url;
|
|
vm.brand.picUrl = file.response.url;
|
|
},
|
|
},
|
|
handleSuccessAppListPicUrl: function (res, file) {
|
|
handleSuccessAppListPicUrl: function (res, file) {
|
|
- if (res.code=="500" && res.msg=="没有权限,请联系管理员授权"){
|
|
|
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
this.$Notice.warning({
|
|
this.$Notice.warning({
|
|
title: res.msg,
|
|
title: res.msg,
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
@@ -356,7 +397,7 @@ var vm = new Vue({
|
|
vm.brand.appListPicUrl = file.response.url;
|
|
vm.brand.appListPicUrl = file.response.url;
|
|
},
|
|
},
|
|
handleSuccessNewPicUrl: function (res, file) {
|
|
handleSuccessNewPicUrl: function (res, file) {
|
|
- if (res.code=="500" && res.msg=="没有权限,请联系管理员授权"){
|
|
|
|
|
|
+ if (res.code == "500" && res.msg == "没有权限,请联系管理员授权") {
|
|
this.$Notice.warning({
|
|
this.$Notice.warning({
|
|
title: res.msg,
|
|
title: res.msg,
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
desc: "无上传文件的权限,请联系管理员授权"
|
|
@@ -400,7 +441,7 @@ var vm = new Vue({
|
|
handleReset: function (name) {
|
|
handleReset: function (name) {
|
|
handleResetForm(this, name);
|
|
handleResetForm(this, name);
|
|
},
|
|
},
|
|
- exportBrand :function () {
|
|
|
|
|
|
+ exportBrand: function () {
|
|
const msg = this.$Message.loading({
|
|
const msg = this.$Message.loading({
|
|
content: 'Loading...',
|
|
content: 'Loading...',
|
|
duration: 0
|
|
duration: 0
|
|
@@ -412,11 +453,11 @@ var vm = new Vue({
|
|
},
|
|
},
|
|
uploadExcelSuccess: function (data) {
|
|
uploadExcelSuccess: function (data) {
|
|
// console.log(data);
|
|
// console.log(data);
|
|
- if(data.code==0){
|
|
|
|
|
|
+ if (data.code == 0) {
|
|
alert('导入成功', function (index) {
|
|
alert('导入成功', function (index) {
|
|
$("#jqGrid").trigger("reloadGrid");
|
|
$("#jqGrid").trigger("reloadGrid");
|
|
});
|
|
});
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
alert(data.msg);
|
|
alert(data.msg);
|
|
}
|
|
}
|
|
setTimeout(exportMsg, 100);
|
|
setTimeout(exportMsg, 100);
|
|
@@ -425,7 +466,7 @@ var vm = new Vue({
|
|
alert('上传出现异常,请重试!');
|
|
alert('上传出现异常,请重试!');
|
|
setTimeout(exportMsg, 100);
|
|
setTimeout(exportMsg, 100);
|
|
},
|
|
},
|
|
- uploadExcelProgress:function(event, file, fileList){
|
|
|
|
|
|
+ uploadExcelProgress: function (event, file, fileList) {
|
|
console.log("上传中")
|
|
console.log("上传中")
|
|
console.log(event)
|
|
console.log(event)
|
|
console.log(file)
|
|
console.log(file)
|