Authored by 陶雨

合并

... ... @@ -155,6 +155,11 @@ if(param&&(RESPONSEDATA.isAuditing==100)){
}else{
tabTree.isfeeze=true;
}
if(RESPONSEDATA.isAuditing==200){
$("#goodsYears").add("#goodsSeason").add("#attribute")
.add("#retailPriceStr").add("#salesPriceStr").add("#stock")
.add("#expectShelfTimeStr").add("#expectArrivalTimeStr").prop("disabled",true);
}
... ... @@ -176,7 +181,7 @@ if(!param){//RESPONSEDATA.isAuditing!=200
}});
new common.dropDown({el:"#supplierId",ajax:"getjitSup",params:function(){
return {brandId:$("#brandId").val()}
return {brandId:$("#brandId").val(),shopId:$("#shopId").val()}
}});
}
... ...
... ... @@ -39,6 +39,10 @@ var util = {
if (typeof options.data == "string") {
util.__tip(options.data, "warning");
} else {
if(options.url.indexOf('?')==-1){
options.url+="?";
}
options.url+="_datetime_="+Date.now();
$.ajax({
type: 'POST',
url: options.url,
... ... @@ -293,7 +297,12 @@ var util = {
// 判断是否是有效的json字串
__isJsonString: function (str) {
try {
JSON.parse(str);
var a=JSON.parse(str);
if(typeof a=="object"){
return true;
}else{
return false;
}
} catch (e) {
return false;
}
... ...
... ... @@ -193,6 +193,11 @@ $('#basicTable').on('click', '.modify-btn', function() {
var discountType = data.vip_discount_type; //折扣类型
console.log("返回Yoho币数量:" + returnCoin);
if(data.return_coin>0){
$vipPrice.attr('disabled', true);
}
vipPrice();
if(returnCoin > 0){ //yoho币已设置
if(retailPrice == salePrice && discountType == 3){
... ...
... ... @@ -211,6 +211,10 @@ function checkYohoCoin(yohoCoin, auditor, price){
common.util.__tip("YOHO币金额不能小于0!");
return false;
}
if(!/^\d+(\.\d{1,2})?$/g.test(yohoCoin.val())){
common.util.__tip("YOHO币的小数点最多只能2位!");
return false;
}
//yoho币大于等于销售额的20%需要校验审核人
if(yohoCoin.val() >= (price * pricePercent)){
return checkAuditor(auditor);
... ... @@ -330,6 +334,8 @@ $(document).on('click', '.btn-save', function() {
}
});
//显示修改
$(document).on('click', '.btn-modify', function() {
if($(this).hasClass("openEditor")){
... ...
... ... @@ -78,6 +78,7 @@ if(type != "add") {
data: {id: id}
}, function (res) {
editBean = res.data;
editBean.reqDepartment = editBean.reqDepartment.split("/");
if(!editBean.reqDepartment.length) {
editBean.reqDepartment = [
... ... @@ -176,7 +177,10 @@ $(document).on("click","#save_brand", function() {
}
}
}
editBean.reqDepartment = editBean.reqDepartment.join("/");
if(typeof editBean.reqDepartment=="string"){
editBean.reqDepartment=[editBean.reqDepartment];
}
editBean.reqDepartment =editBean.reqDepartment.join("/");
editBean.creatorId = $("#auth_id").val();
editBean.creatorName = $("#auth_name").val();
if (editBean.status != 1) {
... ...
... ... @@ -31,8 +31,8 @@ var tableGird = new common.grid({
//name: "attributeValues"
render: function (item) {
var propType = item.attributeValues;
var propsStr = "";
console.log(item);
if (common.util.__isJsonString(propType)) {
var props = JSON.parse(propType);
[].slice.call(props, 0).forEach(function (prop) {
... ... @@ -173,7 +173,7 @@ $(document).on('change', '#inputType', function () {
function attributeOp(prefix, url, item) {
var a = new common.edit(".confirm");
var a = new common.edit(".modal-body");
if (item.attributeValues) {
... ... @@ -187,111 +187,116 @@ function attributeOp(prefix, url, item) {
propValueGrid.__rows = [{'name': "", 'id': "1"}];
}
common.dialog.confirm(prefix + "属性", common.util.__template($("#template").html(), item), function () {
var inputType = $('#inputType').val();
var propVlaueArr = propValueGrid.__rows.splice(0).map(function (v, index) {
return {
id: v.id,
name: v.name
}
});
if (inputType == 'textarea' || inputType == 'text' || inputType == "") {
// 不显示属性列表
return a.submit(url, function (option) {
option.data.categoryId = item.categoryId;
option.data.attributeId = item.attributeId;
var d=new common.dialog({
title:prefix + "属性",
width:'80%',
content:common.util.__template($("#template").html(), item),
button:[
{
value: "确定",
callback: function(){
var inputType = $('#inputType').val();
var propVlaueArr = propValueGrid.__rows.map(function (v, index) {
return {
id: v.id,
name: v.name
}
});
// 检查所有属性值是否为空
if (inputType == 'textarea' || inputType == 'text' || inputType == "") {
// 不显示属性列表
a.submit(url, function (option) {
option.data.categoryId = item.categoryId;
option.data.attributeId = item.attributeId;
console.log(inputType);
// 单行文本 或者 多行文本 时不显示表格
if (inputType == 'textarea' || inputType == 'text' || inputType == "") {
// 检查所有属性值是否为空
} else {
option.data.attributeValues = JSON.stringify(propVlaueArr);
}
console.log(inputType);
// 单行文本 或者 多行文本 时不显示表格
if (inputType == 'textarea' || inputType == 'text' || inputType == "") {
console.log(propVlaueArr);
//option.debug = true;
} else {
option.data.attributeValues = JSON.stringify(propVlaueArr);
}
propValueGrid.__rows = [];
option.success = function (res) {
console.log(propVlaueArr);
//option.debug = true;
propValueGrid.__rows = [];
option.success = function (res) {
res = res.data;
if (res.code == "200") {
a.$tip("提交成功", function () {
tableGird.reload();
d.close();
}, 'growl-success');
} else {
a.$tip(res.message);
}
return false;
},
option.error = function (res) {
a.$tip(res.message);
}
});
res = res.data;
if (res.code == "200") {
a.$tip("提交成功", function () {
tableGird.reload();
}, 'growl-success');
} else {
a.$tip(res.message);
}
return false;
},
option.error = function (res) {
a.$tip(res.message);
}
});
} else {
// 显示属性列表
if (propVlaueArr) {
propVlaueArr.forEach(function (pv) {
if (!pv.name) {
a.$tip('属性值不能为空');
return false;
}
return a.submit(url, function (option) {
option.data.categoryId = item.categoryId;
option.data.attributeId = item.attributeId;
// 检查所有属性值是否为空
console.log(inputType);
// 单行文本 或者 多行文本 时不显示表格
if (inputType == 'textarea' || inputType == 'text' || inputType == "") {
// 显示属性列表
if (propVlaueArr) {
propVlaueArr.forEach(function (pv) {
if (!pv.name) {
a.$tip('属性值不能为空');
return false;
}
a.submit(url+"?_datetime_="+Date.now(), function (option) {
option.data.categoryId = item.categoryId;
option.data.attributeId = item.attributeId;
// 检查所有属性值是否为空
console.log(inputType);
// 单行文本 或者 多行文本 时不显示表格
if (inputType == 'textarea' || inputType == 'text' || inputType == "") {
} else {
option.data.attributeValues = JSON.stringify(propVlaueArr);
}
console.log(propVlaueArr);
//option.debug = true;
propValueGrid.__rows = [];
option.success = function (res) {
res = res.data;
if (res.code == "200") {
tableGird.reload();
d.close();
} else {
a.$tip(res.message);
}
return false;
},
option.error = function (res) {
a.$tip(res.message);
}
});
});
} else {
option.data.attributeValues = JSON.stringify(propVlaueArr);
a.$tip('属性值不能为空');
return false;
}
console.log(propVlaueArr);
//option.debug = true;
propValueGrid.__rows = [];
option.success = function (res) {
res = res.data;
if (res.code == "200") {
a.$tip("提交成功", function () {
tableGird.reload();
}, 'growl-success');
} else {
a.$tip(res.message);
}
return false;
},
option.error = function (res) {
a.$tip(res.message);
}
});
});
} else {
a.$tip('属性值不能为空');
return false;
}
return false;
},
css: "btn-primary"
}
}
]
});
a.init();
// 属性值列表的初始化
... ...
... ... @@ -4,26 +4,13 @@ var ExtractTextPlugin = require("extract-text-webpack-plugin");
var fs=require('fs'),
path=require('path');
var commons=["./js/common/common.js"];
var commons=["./js/common/common.js","jquery"];
var config = JSON.parse(fs.readFileSync('./package.json').toString());
var spmroot=path.join(__dirname, 'spm_modules');
var alias={};
for(key in config.spm.dependencies){
var alias={
jquery:path.join(__dirname, './js/util/jquery.min.js')
};
var edition=path.join(key,config.spm.dependencies[key]);
var json=path.join(spmroot,path.join(edition,'package.json'));
var mainjs=JSON.parse(fs.readFileSync(json).toString()).spm.main;
if(!alias[key]){
alias[key]=path.join(edition,mainjs).replace('/\\/ig','/');
}
}
for (key in config.spm.dependencies) {
commons.push(key);
}
var entry={index:[],libs:[]};
entry.libs=commons;
... ... @@ -78,7 +65,6 @@ module.exports = {
filename:'[name].js'
},
resolve:{
root: [spmroot],
extension:['','.js'],
alias:alias
},
... ...
... ... @@ -139,7 +139,8 @@ exports.res = [
method:'POST',
url:'/AgreementRest/getJitSupplierByBrandId',
params:[
{name:"brandId",type:"Number"}
{name:"brandId",type:"Number"},
{name:"shopId",type:"Number"}
]
},{
route:'/ajax/guang/article/getSortList',
... ...
... ... @@ -125,7 +125,7 @@
</div>
<label class="col-sm-3 control-label">SKN值:</label>
<div class="col-sm-4">
<input id="limitSkn" type="text" maxlength="8" placeholder="SKN" class="form-control observe number noEdit" data-field="limitSkn" value="[[limitSkn]]" [[limitCodeType=="N"?'':'required']]>
<input id="limitSkn" type="text" maxlength="8" placeholder="SKN" class="form-control observe number" data-field="limitSkn" value="[[limitSkn]]" [[limitCodeType=="N"?'':'required']]>
</div><br>
<div id="skus" class="col-sm-10" [[limitCodeType=="U"?"":"hidden"]]>
<table class="table table-bordered responsive dataTable no-footer">
... ...