Authored by 姜敏

拍摄复尺完结、营销管理基本完结

... ... @@ -29,18 +29,20 @@ module.exports = function (app) {
//检查SKN的合法性并且获得其下的所有SKU
app.post("/limitCode/checkSknValidity", "LimitCode_checkSknValidity");
// //查看限购码页面渲染
// app.get("/market/limitcode/info/:id", "marketing.LimitCode.LimitCodeInfo",function () {
// this.$extend={
// moduleName:'营销管理',
// pageName:'查看限购码'
// }
// });
//查看限购码页面渲染
app.get("/market/limitcode/info/:id", "marketing.LimitCode.Info","LimitCode_getLimitCode",function (data) {
console.log(data);
this.$extend={
moduleName:'营销管理',
pageName:'查看限购码',
data:data.data
}
});
//查看限购码
app.post("/limitCode/getLimitCode", "LimitCode_getLimitCode");
//编辑限购码页面渲染
//修改限购码页面渲染
app.get("/market/limitcode/update/:id", "marketing.LimitCode.Edit",function () {
this.$extend={
moduleName:'营销管理',
... ...
... ... @@ -5,25 +5,23 @@ module.exports = function (app) {
/*************************************优惠码管理*************************************/
//列表页
app.get("/marketing/promotionCode", "marketing.PromotionCode.Index", function () {
app.get("/market/coupon/index", "marketing.PromotionCode.Index", function () {
this.$extend = {
moduleName: '营销管理',
pageName: '优惠码码列表',
filter: true,
createUrl: '/market/coupon/add',
gridurl: '/market/coupon/getPromotion'
createUrl: '/market/coupon/add'
}
});
//优惠码码列表
app.post("/marketing/getPromotionCodeList", "PromotionCode_getPromotionCodeList");
app.post("/market/coupon/getPromotion", "PromotionCode_getPromotionCodeList");
//添加页
app.get("/marketing/promotionCode/add", "marketing.PromotionCode.Edit", function () {
app.get("/market/coupon/add", "marketing.PromotionCode.Edit", function () {
this.$extend = {
moduleName: '营销管理',
pageName: '添加优惠码',
action: "/marketing/addPromotionCode",
action: "/market/coupon/addCode",
type: "add",
data: {
limitTimes: "0",
... ... @@ -37,38 +35,41 @@ module.exports = function (app) {
}
});
//添加限购码
app.post("/marketing/addPromotionCode", "PromotionCode_AddPromotionCode");
app.post("/market/coupon/addCode", "PromotionCode_addPromotionCode");
//编辑限购码页面渲染
app.get("/marketing/promotionCode/update/:id", "marketing.PromotionCode.Edit", function () {
app.get("/market/coupon/update/:id", "marketing.PromotionCode.Edit","PromotionCode_getPromotionCode", function (data) {
this.$extend = {
moduleName: '营销管理',
pageName: '编辑优惠码',
action: "/marketing/updateLimitCode",
type: "update"
action: "/market/coupon/updateCode",
type: "update",
data:data.data
}
});
//编辑限购码
app.post("/marketing/updatePromotionCode", "PromotionCode_updatePromotionCode");
//通过、驳回、作废限购码接口
app.post("/marketing/auditPromotion", "PromotionCode_auditPromotion");
app.post("/market/coupon/auditPromotion", "PromotionCode_auditPromotionCode");
//发放
app.post("/marketing/getPromotionCodeSendList", "PromotionCode_getPromotionCodeSendList");
app.post("/market/coupon/sendPromotion", "PromotionCode_getPromotionCodeSendList");
//tab卡数据
app.post("/marketing/getPromotionCodeCountByStatus", "PromotionCode_getPromotionCodeCountByStatus");
app.post("/market/coupon/getCodeCount", "PromotionCode_getPromotionCodeCountByStatus");
//查看限购码页面渲染
app.get("/marketing/promotionCode/info/:id", "marketing.PromotionCode.Edit", function () {
app.get("/market/coupon/info/:id", "marketing.PromotionCode.Edit", "PromotionCode_getPromotionCode", function (data) {
this.$extend = {
moduleName: '营销管理',
pageName: '优惠码详情'
pageName: '优惠码详情',
type: "info",
data:data.data
}
});
//验证优惠码
app.post("/marketing/checkPromotionCode", "PromotionCode_checkPromotionCode");
//验证优惠码
app.post("/market/coupon/checkPromotionCode", "PromotionCode_checkPromotionCode");
};
\ No newline at end of file
... ...
... ... @@ -4,26 +4,31 @@
module.exports = function (app) {
/*************************************vip累计金额翻倍*************************************/
//列表页
app.get("/marketing/vip", "marketing.Vip.Index",function(){
app.get("/market/vipamount/index", "marketing.Vip.Index",function(){
this.$extend={
moduleName:'营销管理',
pageName:'vip累计金额翻倍',
createUrl: '/market/vipamount/add',
gridurl: '/market/vipamount/list'
pageName:'vip累计金额翻倍'
}
});
//列表数据
app.post("/marketing/vipList", ["Vip_vipList","Vip_activityList"]);
app.post("/market/vipamount/list", ["Vip_vipList","Vip_activityList"],function (Vip_vipList,Vip_activityList) {
return {
data:{
activity:Vip_activityList,
vipList:Vip_vipList
}
}
});
//添加页
app.get("/marketing/vip", "marketing.Vip.Add",function(){
app.get("/market/vipamount/add", "marketing.Vip.Add",function(){
this.$extend={
moduleName:'营销管理',
pageName:'vip累计金额翻倍',
action: '/marketing/saveActivity'
pageName:'vip累计金额翻倍'
}
});
//添加
app.post("/marketing/saveActivity", "Vip_saveActivity");
app.post("/market/vipamount/save", "Vip_saveActivity");
};
\ No newline at end of file
... ...
... ... @@ -30,11 +30,19 @@ module.exports = {
getPromotionCodeSendList: {
title: "优惠码发放列表",
url: '/promotioncode/getPromotionCodeSendList', params: {
url: '/promotioncode/getPromotionCodeSendList',
params: {
skn: {type: String},
id: {type: String}
}
},
getPromotionCode: {
title: "优惠码",
url: '/promotioncode/getPromotionCode',
params: {
id: {type: String}
}
},
getPromotionCodeCountByStatus: {
title: "优惠码tab卡数据",
url: '/promotioncode/getPromotionCodeCountByStatus',
... ...
... ... @@ -108,7 +108,7 @@
<input type="text" class="form-control observe noEdit" data-field="UID" value="[[UID]]" placeholder="UID">
</div>
<input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" required placeholder="会员身份">
<input type="hidden" value="[[userTypeLimit]]" id="userTypeLimit" for="checkbox" placeholder="会员身份">
</div>
<div class="form-group" hidden>
<label class="col-sm-2 control-label">限用次数<i class="red">*</i></label>
... ...
<%include '../../../common/views/__ui/header'%>
<div class="container">
<div class="row">
<div class="col-md-offset-1 col-xs-10 col-sm-10 col-md-10 col-lg-10">
<div class="page-header">
<h4>查看限购码</h4>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">批次号 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><% data.batchNo %></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">名称 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.name%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">数量 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.limitTimes%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">申请部门 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.reqDepartment%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">使用期限 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.limitDateFrom%>至<%data.limitDateTo%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">限购码说明 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.describe%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">指定商品 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.limitSkn%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">sku :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.skus%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">sku数量 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.skuTimes%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">申请人 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.creatorName%></div>
</div>
<div class="row show-grid">
<div class="col-xs-3 col-sm-3 col-md-3 col-lg-3">申请时间 :</div>
<div class="col-xs-8 col-sm-8 col-md-8 col-lg-8"><%data.createTime%></div>
</div>
</div>
</div>
</div>
... ...
<%include '../../../common/views/__ui/header'%>
<div class="contentpanel">
<div class="row">
<div class="col-md-12">
<form id="basicForm" role="{{type}}" class="form-horizontal form-bordered" method="get" action="{{action}}">
<form id="basicForm" role="<%type%>" class="form-horizontal form-bordered" method="get" action="<%action%>">
<div class="panel panel-default">
{{# data}}
<div class="panel-heading">
<h4 class="panel-title">基本信息</h4>
</div><!-- panel-heading -->
</div>
<div class="panel-body">
<div class="row">
<div class="form-group">
<label class="col-sm-2 control-label">名称 <span class="red">*</span></label>
<div class="col-sm-8">
<input type="text" id="name" placeholder="名称" class="form-control" required maxlength="15" value="{{name}}">
<input type="text" id="name" placeholder="名称" class="form-control" required maxlength="15" value="<%data.name%>">
</div>
</div>
<div class="form-group">
<label for="limitTimes" class="col-sm-2 control-label">次数</label>
<div class="col-sm-8">
<input type="text" id="limitTimes" placeholder="0 表示不限制" class="form-control" required pattern="^[0-9]+$" value="{{limitTimes}}">
<input type="text" id="limitTimes" placeholder="0 表示不限制" class="form-control" required pattern="^[0-9]+$" value="<%data.limitTimes%>">
</div>
<!--required pattern="^[0-9]+$"-->
</div>
<div class="form-group">
<label for="code" class="col-sm-2 control-label">码值<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" id="code" placeholder="仅限数字,字母(不区分大小写),30字符内,多码值用英文逗号分隔" value='{{code}}' class="form-control" pattern="^[A-Za-z0-9]+$" maxlength="30" required>
<!--pattern="^[A-Za-z0-9]+$" maxlength="30" required-->
<input type="text" id="code" placeholder="仅限数字,字母(不区分大小写),30字符内,多码值用英文逗号分隔" value='<%data.code%>' class="form-control" pattern="^[A-Za-z0-9]+$" maxlength="30" required>
</div>
</div>
... ... @@ -51,28 +49,25 @@
<option value="店铺运营">店铺运营</option>
</select>
</div>
<input type="hidden" id="reqDepartment" value="{{reqDepartment}}" required>
<input type="hidden" id="reqDepartment" value="<%data.reqDepartment%>" required>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">营业期限<span class="red">*</span></label>
<div class="col-sm-3">
<input type="text" class="form-control" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="优惠开始时间" value="{{limitDateFrom}}" readonly required>
<input type="text" class="form-control" jsaction="time:end:limitDateTo" id="limitDateFrom" placeholder="优惠开始时间" value="<%data.limitDateFrom%>" readonly required>
</div>
<div class="col-sm-3">
<input type="text" class="form-control" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="优惠结束时间" value="{{limitDateTo}}" readonly required>
<input type="text" class="form-control" jsaction="time:start:limitDateFrom" id="limitDateTo" placeholder="优惠结束时间" value="<%data.limitDateTo%>" readonly required>
</div>
<!-- readonly require-->
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">优惠码说明<i class="red">*</i></label>
<div class="col-sm-8">
<textarea class="form-control" id="describe" placeholder="优惠码使用条件简介" required>{{describe}}</textarea>
<textarea class="form-control" id="describe" placeholder="优惠码使用条件简介" required><%data.describe%></textarea>
</div>
<!-- require-->
</div>
</div>
</div>
... ... @@ -97,8 +92,6 @@
<input type="radio" value="3" name="promotionInfo-type"> 满减
</label>
</div>
<!-- <input type="hidden" value="1" id="promotionInfo-type"> -->
<!-- required checked-->
</div>
<div class="form-group">
... ... @@ -108,7 +101,6 @@
<div class="form-group">
>=
<input type="text" class="form-control" id="promotionInfo-condition-amount_at_least" placeholder="0.00" value="0" required pattern="^[0-9]+(.\d{1,2})?$">
<!--required pattern="^[0-9]+(.\d{1,2})?$"-->
元,
</div>
<div class="form-group">
... ... @@ -116,7 +108,6 @@
<input type="text" class="form-control" id="promotionInfo-condition-count_at_least" placeholder="1" value="1" required pattern="^[1-9]+$">
</div>
<!-- required pattern="^[1-9]+$"-->
</div>
</div>
... ... @@ -129,20 +120,18 @@
<div class="form-group" id="resultdiscount">
<input type="text" class="form-control" placeholder="0.00" id="promotionInfo-action-discount" value="0.00" required pattern="^0(.\d{1,2})?$">
<!--required pattern="^0(.\d{1,2})?$"-->
折,
</div>
<div class="form-group">
最高减
<input type="text" class="form-control" placeholder="0" id="promotionInfo-action-discount_at_most" required pattern="^[0-9]+(.\d{1,2})?$">
<!--required pattern="^[0-9]+(.\d{1,2})?$"-->
</div>
</div>
</div>
</div>
<input type="hidden" id="promotionInfo" value="{{promotionInfo}}">
<input type="hidden" id="promotionInfo" value="<%data.promotionInfo%>">
</div>
</div>
... ... @@ -159,7 +148,7 @@
<input type="checkbox" value="2" name="userSourceLimit" > 安卓
</label>
</div>
<input type="hidden" value="{{userSourceLimit}}" id="userSourceLimit" for="checkbox" required>
<input type="hidden" value="<%data.userSourceLimit%>" id="userSourceLimit" for="checkbox" required>
</div>
<div class="form-group">
... ... @@ -172,29 +161,27 @@
<input type="checkbox" value="2" name="userTypeLimit"> 注册未购买
</label>
</div>
<input type="hidden" value="{{userTypeLimit}}" id="userTypeLimit" for="checkbox" required>
<input type="hidden" value="<%data.userTypeLimit%>" id="userTypeLimit" for="checkbox" required>
</div>
<div class="form-group">
<label for="name" class="col-sm-2 control-label">限制次数<i class="red">*</i></label>
<div class="col-sm-8">
<input type="number" id="userUseLimit" placeholder="限制次数" class="form-control" value="{{userUseLimit}}" required pattern="^[1-9]+$">
<!--required pattern="^[1-9]+$"-->
<input type="number" id="userUseLimit" placeholder="限制次数" class="form-control" value="<%data.userUseLimit%>" required pattern="^[1-9]+$">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">申请人</label>
<div class="col-sm-8">
<label class="form-label" id="staff">{{staff}}</label>
<label class="form-label" id="staff"><%data.staff%></label>
</div>
</div>
<input type="hidden" value="{{staff}}" id="staff" >
<input type="hidden" value="{{id}}" id="id" >
<input type="hidden" value="{{status}}" id="status" >
{{/ data}}
<input type="hidden" value="<%data.staff%>" id="staff" >
<input type="hidden" value="<%data.id%>" id="id" >
<input type="hidden" value="<%data.status%>" id="status" >
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
... ...
... ... @@ -5,9 +5,8 @@
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a href="{{createUrl}}" id="add-btn" class="btn btn-success add-btn"><i class="fa fa-plus"></i> 添加</a>
<a href="<%createUrl%>" id="add-btn" class="btn btn-success add-btn"><i class="fa fa-plus"></i> 添加</a>
</div>
{{# filter}}
<div class="panel-body">
<div class="row">
<div class="panel-col2">
... ... @@ -27,19 +26,10 @@
<option value="其他">其他</option>
</select>
</div>
{{# limitcode}}
<div class="panel-col">
<input id="filter-skn" class="form-control panel-input" type="text" placeholder="请输skn">
</div>
<div class="panel-col">
<input id="filter-sku" class="form-control panel-input" type="text" placeholder="请输sku">
</div>
{{/ limitcode}}
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
</div>
</div>
{{/ filter}}
</div>
<div class="panel panel-primary-head">
<div class="dataTab_wrapper" id="basicTab">
... ... @@ -49,12 +39,8 @@
</div>
</div>
<input type="hidden" id="btnAuthority" value="{{bottons}}">
<input type="hidden" id="gridurl" value="{{gridurl}}">
<input type="hidden" id="tabUrl" value="{{tabUrl}}">
<script type="text/template" id="template">
<p>{name}</p>
<p>[[name]]</p>
<label class="col-sm-3 control-label">*请填写原因</label>
<input id="reason" type="text" class="form-control" name="agreement-code" style="width:280px;">
</script>
... ...
<%include '../../../common/views/__ui/header'%>
<div class="contentpanel">
<form id="basicForm" role="{{type}}" class="form-horizontal form-bordered" method="get" action="{{action}}">
<form id="basicForm" class="form-horizontal form-bordered" method="get" action="/market/vipamount/save">
<div class="panel panel-default">
<div class="panel-heading">
<h4 class="panel-title">活动创建</h4>
... ... @@ -9,7 +10,7 @@
<div class="form-group">
<label for="title" class="col-sm-2 control-label">促销活动名称<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" id="title" placeholder="促销活动名称,支持中英文、数字,建议20个字以内" class="form-control" required maxlength="20" value="{{name}}">
<input type="text" id="title" placeholder="促销活动名称,支持中英文、数字,建议20个字以内" class="form-control" required maxlength="20" value="<%name%>">
</div>
</div>
<div class="form-group">
... ... @@ -49,12 +50,10 @@
<div class="col-sm-3">
<input type="text" class="form-control" jsaction="time:start:startTime" id="endTime" placeholder="活动结束时间" value="" readonly required>
</div>
<!-- readonly require-->
</div>
</div>
</div>
<div class="panel-footer">
<div class="row">
<div class="col-sm-8 col-sm-offset-2">
<a href="javascript:;" onclick="history.go(-1);" class="btn btn-default">取消</a>
... ...
... ... @@ -5,41 +5,9 @@
<div class="contentpanel">
<div class="panel panel-default" style="margin-bottom:10px;">
<div class="panel-heading">
<a href="{{createUrl}}" id="add-btn" class="btn btn-success add-btn"><i class="fa fa-plus"></i> 添加</a>
<a href="/market/vipamount/add" id="add-btn" class="btn btn-success add-btn">
<i class="fa fa-plus"></i> 添加</a>
</div>
{{# filter}}
<div class="panel-body">
<div class="row">
<div class="panel-col2">
<input id="filter-id" class="form-control panel-input" type="text" placeholder="请输入批次号">
</div>
<div class="panel-col">
<input id="filter-name" class="form-control panel-input" type="text" placeholder="请输入名称">
</div>
<div class="panel-col">
<select id="filter-dep" name="filter-dep" tabindex="-1" title="" class="select2-offscreen brandBtn-group">
<option value="-1">全部</option>
<option value="市场部">市场部</option>
<option value="会员部">会员部</option>
<option value="零售部">零售部</option>
<option value="品牌合作部">品牌合作部</option>
<option value="潮流资源部">潮流资源部</option>
<option value="其他">其他</option>
</select>
</div>
{{# limitcode}}
<div class="panel-col">
<input id="filter-skn" class="form-control panel-input" type="text" placeholder="请输skn">
</div>
<div class="panel-col">
<input id="filter-sku" class="form-control panel-input" type="text" placeholder="请输sku">
</div>
{{/ limitcode}}
<a id="filter-btn" href="javascript:;" class="btn btn-info">筛选</a>
<a id="all-btn" href="" class="btn btn-info">全部</a>
</div>
</div>
{{/ filter}}
</div>
<div class="panel panel-primary-head">
<div class="dataTab_wrapper" id="basicTab">
... ... @@ -49,13 +17,4 @@
</div>
</div>
<input type="hidden" id="btnAuthority" value="{{bottons}}">
<input type="hidden" id="gridurl" value="{{gridurl}}">
<input type="hidden" id="tabUrl" value="{{tabUrl}}">
<script type="text/template" id="template">
<p>{name}</p>
<label class="col-sm-3 control-label">*请填写原因</label>
<input id="reason" type="text" class="form-control" name="agreement-code" style="width:280px;">
</script>
... ...
... ... @@ -15,6 +15,7 @@ drag=require('./drag'),
drag2=require('./drag2'),
config=require('./config'),
popImg=require('./popImg');
sizeInfo = require('./sizeInfo');
require('./index');
... ... @@ -34,7 +35,8 @@ var common={
drag2:drag2,
popImg:popImg,
components:components,
config:config
config:config,
sizeInfo:sizeInfo
};
module.exports=common;
\ No newline at end of file
... ...
var $ = require('jquery'),
edit = require("./edit"),
dialog = require("./dialog"),
util = require("./util"),
grid = require('./grid');
var headList = [];
/**
* 界面列表显示
* @param data
*/
var list = function (data) {
var a = data.productType.replace(/<br>/g, "/");
data.productType = a.substring(0, a.length - 1);
var j = 0;//创造一个变量以供赋值
if (data.sizeRelationsList.length > 0) {
headList.push({display: "尺码", name: "sizeName"});//尺码
headList.push({
display: "参考尺码(" + data.genderName + ")", name: "referenceName", render: function (item1) {//参考尺码列
var refName = item1.referenceName ? item1.referenceName : "";//非空判断
var a = refName.split(/[|/]/g);
var refName1 = a[0] || "", refName2 = a[1] || "";
return '<div class="form-group"><div class="col-sm-5"><input class="form-control refInfo refInfo1" data-index="' + item1.__index + '"' + 'value="' + refName1 + '"/></div><div class="col-sm-1">/</div><div class="col-sm-5"><input class="form-control refInfo refInfo2" data-index="' + item1.__index + '"' + 'value="' + refName2 + '"/></div></div>';
}
});
for (var i = 0; i < data.sizeRelationsList[0].prdSizeAttributeBoList.length; i++) {//尺码列
var sizeAttributes = data.sizeRelationsList[0].prdSizeAttributeBoList[i];//参考尺码数组里的数据
var chkbox = '<label style="cursor: pointer;"><input type="checkbox" name="noMeasureIds" data-index="' + i + '" value="' + sizeAttributes.sizeAttributeId + '"/>无需测量</label>';
headList.push({
display: sizeAttributes.sizeAttributeName + "<br>" + chkbox,
name: "sizeValue",
render: function (item1) {
var prdList = item1.prdSizeAttributeBoList;
if (j >= prdList.length) j = 0;//防止越界
var sizeVal = prdList[j].sizeValue ? prdList[j].sizeValue : "";
return '<input class="form-control sizeInfo ' + prdList[j++].sizeAttributeId
+ '" data-index="' + item1.__index + '"' + 'value="' + sizeVal + '"/>';
}
});
}
}
var g1 = new grid({
el: "#content-list",
hash: false,
columns: headList
});
g1.init(data.sizeRelationsList);
};
/**
*编辑尺码弹窗
* @param url
* @param item
* @param noHead 是否包含表头信息
* @param gridList 主界面表格
*/
var toast = function (url, item, noHead, gridList) {
var e = new edit("#nidaye");
var content = "";
if (noHead) {
content = '<div id="nidaye"><input type="hidden" id="noMeasureIds" for="checkbox">'
+ '<div id="faGrid" style="height: 600px;overflow:auto;"></div></div>';
} else {
content = '<div id="nidaye"><input type="hidden" id="noMeasureIds" for="checkbox">'
+ util.__template2($("#modifySize-template").html(), item)
+ '<div id="faGrid" style="height: 600px;overflow:auto;"></div></div>';
}
var d = new dialog({
title: "编辑尺码信息",
content: content,
width: "90%",
button: [{
value: "提交",
css: 'btn-info',
callback: function () {
var noMeasureIds = JSON.stringify($("#noMeasureIds").val() ? $("#noMeasureIds").val().split("|") : []);//无需测量的列
//尺码信息列表
var sizeInfoList = [];
for (var i = 0; i < $(".sizeInfo").length; i++) {
var info = $($(".sizeInfo")[i]);//当前尺码input对象
var prdList = g.rows[info.data("index")].prdSizeAttributeBoList;//当前列的对象的尺码列表
var attrIndex = parseInt(i % prdList.length);//在当前列的索引
sizeInfoList[i] = ({
productSkn: item.productSkn,
sizeId: g.rows[info.data("index")].sizeId,
sizeAttributeId: prdList[attrIndex].sizeAttributeId,
sizeValue: info.val()
});
}
//商品参考尺码
var productSizeReferList = [];
for (var i = 0; i < $(".refInfo").length / 2; i++) {
var ref1 = $($(".refInfo1")[i]);
var ref2 = $($(".refInfo2")[i]);
productSizeReferList.push({
sizeId: g.rows[ref1.data("index")].sizeId,
gender: item.gender,
referenceName: ref1.val() + '/' + ref2.val()
});
}
var data = {
productSkn: item.productSkn,
noMeasureIds: noMeasureIds,
sizeInfoList: JSON.stringify(sizeInfoList),
productSizeReferList: JSON.stringify(productSizeReferList)
};
util.__ajax({
url: url,
data: data
}, function () {
gridList.reload();
d.close();
});
}
},
{
value: "取消",
css: 'btn-primary'
}]
});
var headList = [];
var j = 0;//创造一个变量以供赋值
if (item.sizeRelationsList.length > 0) {
headList.push({display: "尺码", name: "sizeName"});//尺码
headList.push({
display: "参考尺码(" + item.genderName + ")", name: "referenceName", render: function (item1) {//参考尺码列
var refName = item1.referenceName ? item1.referenceName : "";//非空判断
var a = refName.split(/[,|/]/g);
var refName1 = a[0] || "", refName2 = a[1] || "";
return '<div class="form-group"><div class="col-sm-5"><input class="form-control refInfo refInfo1" data-index="' + item1.__index + '"' + 'value="' + refName1 + '"/></div><div class="col-sm-1">/</div><div class="col-sm-5"><input class="form-control refInfo refInfo2" data-index="' + item1.__index + '"' + 'value="' + refName2 + '"/></div></div>';
}
});
for (var i = 0; i < item.sizeRelationsList[0].prdSizeAttributeBoList.length; i++) {//尺码列
var sizeAttributes = item.sizeRelationsList[0].prdSizeAttributeBoList[i];//参考尺码数组里的数据
var chkbox = '<label style="cursor: pointer;"><input type="checkbox" data-index="' + i + '" name="noMeasureIds" value="' + sizeAttributes.sizeAttributeId + '"/>无需测量</label>';
headList.push({
display: sizeAttributes.sizeAttributeName + "<br>" + chkbox,
name: "sizeValue",
render: function (item1) {
var prdList = item1.prdSizeAttributeBoList;
if (j >= prdList.length) j = 0;//防止越界
var sizeVal = prdList[j].sizeValue ? prdList[j].sizeValue : "";
return '<input class="form-control sizeInfo ' + prdList[j++].sizeAttributeId
+ '" data-index="' + item1.__index + '" value="' + sizeVal + '"/>';
}
});
}
}
var g = new grid({
el: "#faGrid",
hash: false,
columns: headList
});
g.init(item.sizeRelationsList);
$("#noMeasureIds").val(item.noMeasureIds ? item.noMeasureIds.join("|") : "");
e.init();
};
/**
* 当点击“无需测量”,该列输入框不可编辑
*/
var check = function () {
$(document).on("change", "input[name='noMeasureIds']", function () {
var _index = $(this).data("index");
var tbody = $(this).parents('table').children('tbody');
if ($(this).is(':checked')) {
tbody.children('tr').each(function () {
$(this).find('td').eq(_index + 2).children().attr("readonly", true);
});
}
else {
tbody.children('tr').each(function () {
$(this).find('td').eq(_index + 2).children().attr("readonly", false);
});
}
});
};
module.exports = {
list: list,
toast: toast,
check: check
};
\ No newline at end of file
... ...
... ... @@ -10,8 +10,7 @@ var limitDateFromObj;
var limitDateToObj;
var Bll = {
__render:function() {
console.log(editBean);
__render: function () {
editBean.currTime = common.util.__dateFormat(new Date(), "yyyy-MM-dd hh:mm:ss");
$("#basicForm").html(common.util.__template2($("#limitcodeEdit-template").html(), editBean));
e.init();
... ... @@ -24,26 +23,26 @@ var Bll = {
pickTime: true
}).data("datepicker");
limitDateFromObj.setEndDate(editBean.limitDateTo);
if(editBean.limitDateFrom) {
if (editBean.limitDateFrom) {
limitDateToObj.setStartDate(editBean.currTime);
} else if(new Date(editBean.currTime).getTime() < new Date(editBean.limitDateFrom)){
} else if (new Date(editBean.currTime).getTime() < new Date(editBean.limitDateFrom)) {
limitDateToObj.setStartDate(editBean.limitDateFrom);
} else {
limitDateToObj.setStartDate(editBean.currTime);
}
if(type == "edit") {
if (type == "edit") {
$('input[name="skn_sku"]').prop('disabled', true);
$(".noEdit").prop("disabled", true);
$('input[name="userTypeLimit"]').prop('disabled', true);
if((new Date(editBean.limitDateFrom).getTime() <= new Date().getTime()) && isFirst) {
if ((new Date(editBean.limitDateFrom).getTime() <= new Date().getTime()) && isFirst) {
$("#limitDateFrom").prop("disabled", true);
}
isFirst = false;
}
},
__checkSkn:function(callback) {
__checkSkn: function (callback) {
var flag = false;
if(editBean.limitSkn) {
if (editBean.limitSkn) {
common.util.__ajax2({
async: false,
url: "/limitCode/checkSknValidity",
... ... @@ -63,7 +62,7 @@ var Bll = {
common.util.__tip("SKN已上架,请先下架");
}
callback && callback(res);
}, function() {
}, function () {
flag = true;
common.util.__tip("网络请求异常");
});
... ... @@ -72,28 +71,27 @@ var Bll = {
}
};
if(type != "add") {
if (type != "add") {
var id = location.href.substring(location.href.lastIndexOf("/") + 1);
common.util.__ajax({
url: "/limitCode/getLimitCode",
data: {id: id}
}, function (res) {
editBean = res.data;
editBean.reqDepartment = editBean.reqDepartment.split("/");
if(!editBean.reqDepartment.length) {
editBean.reqDepartment = editBean.reqDepartment?editBean.reqDepartment.split("/"):"";
if (!editBean.reqDepartment.length) {
editBean.reqDepartment = [
"零售部",
"营销策划"
];
}
editBean.selected = editBean.skus ? "SKU" : "SKN";
editBean.updateType = type == "edit" ? "1":"2";
editBean.updateType = type == "edit" ? "1" : "2";
editBean.skusInfo = [];
if(editBean.skus) {
if (editBean.skus) {
var skuArr = editBean.skus.split(";");
var skuNumArr = editBean.skuTimes.split(";");
for(var i = 0; i < skuArr.length; i++) {
for (var i = 0; i < skuArr.length; i++) {
editBean.skusInfo.push({
"sku": skuArr[i],
"skuTimes": skuNumArr[i]
... ... @@ -101,7 +99,7 @@ if(type != "add") {
}
}
Bll.__render();
},true);
}, true);
} else {
Bll.__render();
}
... ... @@ -114,8 +112,8 @@ $(document).on("change", ".observe", function () {
editBean = common.util.__buildobj(name, '.', editBean, function (obj, name) {
obj[name] = $this.val();
});
if($this.prop("id") == "limitDateFrom" && new Date($this.val()).getTime() ) {
if(new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) {
if ($this.prop("id") == "limitDateFrom" && new Date($this.val()).getTime()) {
if (new Date(editBean.currTime).getTime() > new Date(editBean.limitDateFrom)) {
limitDateToObj.setStartDate(editBean.currTime);
} else {
limitDateToObj.setStartDate(editBean.limitDateFrom);
... ... @@ -124,12 +122,12 @@ $(document).on("change", ".observe", function () {
});
//输入限制
$(document).on("keyup", ".number", function() {
$(document).on("keyup", ".number", function () {
$(this).val($(this).val().replace(/\D/g, ''));
});
//单选框点击事件
$(document).on("click", ".limitProduct", function() {
$(document).on("click", ".limitProduct", function () {
editBean.limitCodeType = $(this).val();
$("#limitSkn").attr("required", !(editBean.limitCodeType == "N"));
Bll.__render();
... ... @@ -149,8 +147,8 @@ $(document).on("click", ".addSku", function () {
Bll.__render();
});
$(document).on("blur", "#limitSkn", function() {
Bll.__checkSkn(function(res) {
$(document).on("blur", "#limitSkn", function () {
Bll.__checkSkn(function (res) {
if (res.data.skuList) {
editBean.skusInfo = [];
for (var i = 0; i < res.data.skuList.length; i++) {
... ... @@ -168,45 +166,45 @@ $(document).on("blur", "#limitSkn", function() {
/**
* 保存事件
*/
$(document).on("click","#save_brand", function() {
$(document).on("click", "#save_brand", function () {
// 限购码状态0:待审核 1:审核通过 2:驳回 3:过期 4:作废
if(e.validate() && (type == "add" ? (!editBean.limitSkn || !Bll.__checkSkn()) : true)) {
if(editBean.limitCodeType == "U") {
if (e.validate() && (type == "add" ? (!editBean.limitSkn || !Bll.__checkSkn()) : true)) {
if (editBean.limitCodeType == "U") {
for (var i in editBean.skusInfo) {
if(!editBean.skusInfo[i].skuTimes || editBean.skusInfo[i].skuTimes == "0") {
if (!editBean.skusInfo[i].skuTimes || editBean.skusInfo[i].skuTimes == "0") {
common.util.__tip("SKU数量不能为0");
return;
}
}
}
if(typeof editBean.reqDepartment=="string"){
editBean.reqDepartment=[editBean.reqDepartment];
if (typeof editBean.reqDepartment == "string") {
editBean.reqDepartment = [editBean.reqDepartment];
}
editBean.reqDepartment =editBean.reqDepartment.join("/");
editBean.reqDepartment = editBean.reqDepartment.join("/");
editBean.creatorId = $("#auth_id").val();
editBean.creatorName = $("#auth_name").val();
if (editBean.status != 1) {
editBean.status = 0;
}
if(editBean.limitCodeType == "U") {
if (editBean.limitCodeType == "U") {
editBean.skus = "";
editBean.skuTimes = "";
for(var item in editBean.skusInfo) {
if(item != 0) {
editBean.skus+=";";
editBean.skuTimes+=";";
for (var item in editBean.skusInfo) {
if (item != 0) {
editBean.skus += ";";
editBean.skuTimes += ";";
}
editBean.skus += editBean.skusInfo[item].sku;
editBean.skuTimes+=editBean.skusInfo[item].skuTimes;
editBean.skuTimes += editBean.skusInfo[item].skuTimes;
}
}
console.log("action",action);
console.log("action", action);
console.log(editBean);
common.util.__ajax({
url: action,
data: editBean
}, function (res) {
console.log("res",res);
console.log("res", res);
// location.href = "/market/limitcode/index";
});
}
... ...
/**
* Created by yoho on 2016/6/24.
*/
... ...
var $ = require('jquery');
var edit=require('../common/edit');
var edit=require('../../../common/edit');
var common=require('../../../common/common');
var e=new edit("#basicForm");
... ... @@ -103,7 +104,6 @@ if(type=="add"){
data = data.data;
if (data.code == "200") {
var badcode = [];
$.each(data.data, function(index, item) {
if (item.flag == "1") {
badcode.push(item.code);
... ... @@ -140,10 +140,9 @@ var submit=function(callback){
}
return false;
},
option.error=function(res){
option.error=function(){
e.$tip("提交失败");
}
console.log(option.data);
callback&&callback(option.data);
});
};
... ...
... ... @@ -3,12 +3,12 @@
*/
'use strict';
var $ = require('jquery'),
common=require('../common/common');
common=require('../../../common/common');
var ENUM={
status:{0:'待审核',1:'审核通过',2:'驳回',3:'过期',4:'作废'},//全部
tips:{"0":0,"1":0,"2":0,"3":0,"4":0,"all":0}
}
};
//下拉框
new common.dropDown({el: '#filter-dep'});
... ... @@ -31,9 +31,6 @@ var t = new common.tab({
//grid
var g = new common.grid({
el: '#basicTable',
// tabUrl: $('#tabUrl').val(),
// tabConvert: statusConvert,
// size: 10,
parms:function(){
return {
batchNo: common.util.__input("filter-id"),
... ... @@ -95,7 +92,7 @@ var loadtab=function(){
},400);
}
loadtab();
g.init($("#gridurl").val());
g.init("/market/coupon/getPromotion");
... ... @@ -179,7 +176,7 @@ $('#basicTable').on('click', '.apply-cancel', function() {
operations:reason
};
}
Bll.toast(common.util.__template($("#template").html(),{name:"您确定要作废此优惠码吗?"}),data);
Bll.toast(common.util.__template2($("#template").html(),{name:"您确定要作废此优惠码吗?"}),data);
});
//驳回事件
... ...
var $ = require('jquery');
var edit = require('../common/edit');
var edit = require('../../../common/edit');
var e = new edit("#basicForm");
e.on("bind", function() {
$("select").change(function() {
e.on("bind", function () {
$("select").change(function () {
if ($(this).is($("#type1"))) {
$("#type").val($("#type1").val());
}
});
});
e.on("bind", function() {
$("select").change(function() {
e.on("bind", function () {
$("select").change(function () {
if ($(this).is($("#num1"))) {
$("#num").val($("#num1").val());
}
... ... @@ -24,62 +20,51 @@ e.on("bind", function() {
});
});
e.on("validate", function() {
e.on("validate", function () {
var title = $.trim($("#title").val());
if (/[~#^$@%&!*]/gi.test(title)) {
return "名称不能包含特殊字符";
}
return true;
});
e.on("validate", function() {
e.on("validate", function () {
var beginOperateTime = $.trim($("#beginOperateTime").val());
var endOperateTime = $.trim($("#endOperateTime").val());
if (new Date(endOperateTime) <= new Date(beginOperateTime)) {
return "开始时间不能小于结束时间";
}
return true;
});
e.init();
//提交
var submit = function(callback) {
e.submit($("#basicForm").attr("action"), function(option) {
option.success = function(res) {
res = res.data;
var submit = function (callback) {
e.submit($("#basicForm").attr("action"), function (option) {
option.success = function (res) {
if (res.code == "200") {
e.$tip('提交成功', function() {
e.$tip('提交成功', function () {
location.href = "/market/vipamount/index";
}, 'growl-success');
} else {
e.$tip(res.message);
}
return false;
},
option.error = function(res) {
e.$tip("提交失败");
}
};
option.error = function () {
e.$tip("提交失败");
};
option.data.startTime = new Date(option.data.startTime.replace(/-/g, '/')).getTime() / 1000;
option.data.endTime = new Date(option.data.endTime.replace(/-/g, '/')).getTime() / 1000;
console.log(option.data);
callback && callback(option.data);
});
};
$("#save_brand").click(function() {
$("#save_brand").click(function () {
submit(function (data) {
submit(function(data) {
//修改数据
/*if(data.status=="2"){
data.status=0;
}*/
});
return false;
});
\ No newline at end of file
... ...
'use strict';
var $ = require('jquery'),
common=require('../common/common');
common=require('../../../common/common');
var Bll={
getTime: function (time) {
var t = new Date(time * 1000);
return common.util.__dateFormat(t, "yyyy-MM-dd hh:mm:ss");
}
};
var g = new common.grid({
el: '#basicTable',
parms: function(){
... ... @@ -12,24 +17,16 @@ var g = new common.grid({
},
columns:[
{display: '活动名称', name: 'title'},
{display: '活动类型', render: function(item) {
{display: '活动类型', render: function() {
return '积分翻倍';
}},
{display: '倍数', name: 'num'},
{display: '活动时间', render: function(item) {
var startTime = new Date(item.startTime * 1000),
endTime = new Date(item.endTime * 1000);
return startTime.getFullYear() + '-' + (startTime.getMonth() + 1) + '-' + startTime.getDate() + ' ' +
startTime.getHours() + ':' + startTime.getMinutes() + ':' + startTime.getSeconds() + '至' +
endTime.getFullYear() + '-' + (endTime.getMonth() + 1) + '-' + endTime.getDate() + ' ' +
endTime.getHours() + ':' + endTime.getMinutes() + ':' + endTime.getSeconds();
return Bll.getTime(item.startTime)+"至"+Bll.getTime(item.endTime)
}},
{display: '创建人员', name: 'addUserName'},
{display: '活动创建时间', render: function(item) {
var date = new Date(item.createTime * 1000);
return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' '
+ date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds();
return Bll.getTime(item.createTime)
}},
{display: '操作', render: function(item) {
if (item.validFlag == 1) {
... ... @@ -48,11 +45,10 @@ var g = new common.grid({
return data.vipList.data;
}
});
g.init($("#gridurl").val());
g.init("/market/vipamount/list");
$('#basicTable').on('click', '.end-btn', function() {
var activeId = $(this).data('id');
common.dialog.confirm("温馨提示", "您确定要停止此活动吗?", function(){
common.util.__ajax({
url:'/market/vipamount/save',
... ...
... ... @@ -23,43 +23,7 @@ $(document).on('click', '#searchSku', function () {
if (res.data.list && res.data.list.length > 0) {
var e = new common.edit("#add-list");
dataList = res.data.list[0];
//拼接分类字符串
var a = dataList.productType.replace(/<br>/g, "/");
dataList.productType = a.substring(0, a.length - 1);
var headList = [];
var j = 0;//创造一个变量以供赋值
if (dataList.sizeRelationsList.length > 0) {
headList.push({display: "尺码", name: "sizeName"});//尺码
headList.push({
display: "参考尺码(" + dataList.genderName + ")", name: "referenceName", render: function (item1) {//参考尺码列
var refName = item1.referenceName ? item1.referenceName : "";//非空判断
var a = refName.split(/[|/]/g);
var refName1 = a[0] || "", refName2 = a[1] || "";
return '<input class="col-sm-5 refInfo refInfo1" data-index="' + item1.__index + '"' + 'value="' + refName1 + '"/>' + '<div class="col-sm-1">' + '/</div>' + '<input class="col-sm-5 refInfo refInfo2" data-index="' + item1.__index + '"' + 'value="' + refName2 + '"/>';
}
});
for (var i = 0; i < dataList.sizeRelationsList[0].prdSizeAttributeBoList.length; i++) {//尺码列
var sizeAttributes = dataList.sizeRelationsList[0].prdSizeAttributeBoList[i];//参考尺码数组里的数据
var chkbox = '<label style="cursor: pointer;"><input type="checkbox" name="noMeasureIds" data-index="' + i + '" value="' + sizeAttributes.sizeAttributeId + '"/>无需测量</label>';
headList.push({
display: sizeAttributes.sizeAttributeName + "<br>" + chkbox,
name: "sizeValue",
render: function (item1) {
var prdList = item1.prdSizeAttributeBoList;
if (j >= prdList.length) j = 0;//防止越界
var sizeVal = prdList[j].sizeValue ? prdList[j].sizeValue : "";
return '<input class="form-control sizeInfo ' + prdList[j++].sizeAttributeId
+ '" data-index="' + item1.__index + '"' + 'value="' + sizeVal + '"/>';
}
});
}
}
var grid = new common.grid({
el: "#content-list",
hash: false,
columns: headList
});
grid.init(dataList.sizeRelationsList);
common.sizeInfo.list(dataList);
$("#add-head").html(common.util.__template2($("#modifySize-template").html(), dataList));
$("#noMeasureIds").val(dataList.noMeasureIds ? dataList.noMeasureIds.join("|") : "");
$("#add-list").show();
... ... @@ -101,10 +65,7 @@ $(document).on('click', '#searchSku', function () {
common.util.__ajax({
url: "/meterManage/productSize/saveProdSizeInfo",
data: data
}, function (res) {
if (res.code == '200') {
}
}, function () {
});
return false;
});
... ... @@ -123,17 +84,4 @@ $("#skuInput").keydown(function () {
});
//当点击“无需测量”,该列输入框不可编辑
$(document).on("change", "input[name='noMeasureIds']", function () {
var _index = $(this).data("index");
var tbody = $(this).parents('table').children('tbody');
if ($(this).is(':checked')) {
tbody.children('tr').each(function () {
$(this).find('td').eq(_index + 2).children().attr("readonly", true);
});
}
else {
tbody.children('tr').each(function () {
$(this).find('td').eq(_index + 2).children().attr("readonly", false);
});
}
});
\ No newline at end of file
common.sizeInfo.check();
\ No newline at end of file
... ...
... ... @@ -79,20 +79,7 @@ var g = new common.grid({
g.init("/meterManage/productSize/queryProdSizeList");
//当点击“无需测量”,该列输入框不可编辑
$(document).on("change", "input[name='noMeasureIds']", function () {
var _index = $(this).data("index");
var tbody = $(this).parents('table').children('tbody');
if ($(this).is(':checked')) {
tbody.children('tr').each(function () {
$(this).find('td').eq(_index + 2).children().attr("readonly", true);
});
}
else {
tbody.children('tr').each(function () {
$(this).find('td').eq(_index + 2).children().attr("readonly", false);
});
}
});
common.sizeInfo.check();
var Bll = {
getLocalTime: function (nS) {
var date = new Date(parseInt(nS) * 1000);
... ... @@ -103,108 +90,6 @@ var Bll = {
var second = date.getSeconds();
return date.getFullYear() + "-" + (mm < 10 ? "0" + mm : mm) + "-" + (dd < 10 ? "0" + dd : dd) + " " + (h < 10 ? "0" + h : h) + ":"
+ (min < 10 ? "0" + min : min) + ":" + (second < 10 ? "0" + second : second);
},
toast: function (url, item, hint) {
var e = new common.edit("#nidaye");
var dialog = new common.dialog({
title: hint,
content: '<div id="nidaye"><input type="hidden" id="noMeasureIds" for="checkbox">'
+ common.util.__template2($("#modifySize-template").html(), item)
+ '<div id="faGrid" style="height: 600px;overflow:auto;"></div></div>',
width: "90%",
button: [{
value: "提交",
css: 'btn-info',
callback: function () {
var noMeasureIds = JSON.stringify($("#noMeasureIds").val() ? $("#noMeasureIds").val().split("|") : []);//无需测量的列
//尺码信息列表
var sizeInfoList = [];
for (var i = 0; i < $(".sizeInfo").length; i++) {
var info = $($(".sizeInfo")[i]);//当前尺码input对象
var prdList = grid.rows[info.data("index")].prdSizeAttributeBoList;//当前列的对象的尺码列表
var attrIndex = parseInt(i % prdList.length);//在当前列的索引
sizeInfoList[i] = ({
productSkn: item.productSkn,
sizeId: grid.rows[info.data("index")].sizeId,
sizeAttributeId: prdList[attrIndex].sizeAttributeId,
sizeValue: info.val()
});
}
//商品参考尺码
var productSizeReferList = [];
for (var i = 0; i < $(".refInfo").length / 2; i++) {
var ref1 = $($(".refInfo1")[i]);
var ref2 = $($(".refInfo2")[i]);
productSizeReferList.push({
sizeId: grid.rows[ref1.data("index")].sizeId,
gender: item.gender,
referenceName: ref1.val() + '/' + ref2.val()
});
}
var data = {
productSkn: item.productSkn,
noMeasureIds: noMeasureIds,
sizeInfoList: JSON.stringify(sizeInfoList),
productSizeReferList: JSON.stringify(productSizeReferList)
};
common.util.__ajax({
url: url,
data: data
}, function (res) {
if (res.code == '200') {
g.reload();
dialog.close();
}
else {
common.util.__tip(res.data.message, "warning");
}
});
}
},
{
value: "取消",
css: 'btn-primary'
}]
});
var headList = [];
var j = 0;//创造一个变量以供赋值
if (item.sizeRelationsList.length > 0) {
headList.push({display: "尺码", name: "sizeName"});//尺码
headList.push({
display: "参考尺码(" + item.genderName + ")", name: "referenceName", render: function (item1) {//参考尺码列
var refName = item1.referenceName ? item1.referenceName : "";//非空判断
var a = refName.split(/[,|/]/g);
var refName1 = a[0] || "", refName2 = a[1] || "";
return '<input class="col-sm-5 refInfo refInfo1" data-index="' + item1.__index + '"' + 'value="' + refName1 + '"/>' + '<div class="col-sm-1">' + '/</div>' + '<input class="col-sm-5 refInfo refInfo2" data-index="' + item1.__index + '"' + 'value="' + refName2 + '"/>';
}
});
for (var i = 0; i < item.sizeRelationsList[0].prdSizeAttributeBoList.length; i++) {//尺码列
var sizeAttributes = item.sizeRelationsList[0].prdSizeAttributeBoList[i];//参考尺码数组里的数据
var chkbox = '<label style="cursor: pointer;"><input type="checkbox" data-index="' + i + '" name="noMeasureIds" value="' + sizeAttributes.sizeAttributeId + '"/>无需测量</label>';
headList.push({
display: sizeAttributes.sizeAttributeName + "<br>" + chkbox,
name: "sizeValue",
render: function (item1) {
var prdList = item1.prdSizeAttributeBoList;
if (j >= prdList.length) j = 0;//防止越界
var sizeVal = prdList[j].sizeValue ? prdList[j].sizeValue : "";
return '<input class="form-control sizeInfo ' + prdList[j++].sizeAttributeId
+ '" data-index="' + item1.__index + '"' + 'value="' + sizeVal + '"/>';
}
});
}
}
var grid = new common.grid({
el: "#faGrid",
hash: false,
columns: headList
});
grid.init(item.sizeRelationsList);
$("#noMeasureIds").val(item.noMeasureIds ? item.noMeasureIds.join("|") : "");
e.init();
}
};
... ... @@ -214,8 +99,8 @@ $(document).on('click', '#filter-btn', function () {
$(document).on('click', '.add2', function () {
var item = g.rows[$(this).data("index")];
//拼接分类字符串
//拼接分类字符串
var a = item.productType.replace(/<br>/g, "/");
item.productType = a.substring(0, a.length - 1);
Bll.toast("/meterManage/productSize/saveProdSizeInfo", item, "修改尺码");
common.sizeInfo.toast("/meterManage/productSize/saveProdSizeInfo", item,false,g);
});
\ No newline at end of file
... ...
... ... @@ -15,6 +15,11 @@ var STATUS = {
var g = new common.grid({
el: '#content-list',
hash: false,
complete: function () {
$('#content-list').poptrox({
usePopupCaption: true
});
},
//查询参数
parms: function () {
return {
... ... @@ -31,11 +36,10 @@ var g = new common.grid({
{display: "英文名", name: "englishName"},
{
display: "头像", name: "avatar", render: function (item) {
if(item.avatar){
if (item.avatar) {
return '<img src="' + item.avatar + '?imageView/2/w/100/h/100" width="100" height="60"/>'
}
return ""
}
},//图片显示
{display: "国籍", name: "nationality"},
... ... @@ -63,11 +67,11 @@ var g = new common.grid({
{display: "衣服尺码", name: "dressSize"},
{
display: "模特卡", name: "modelCard ", render: function (item) {
if(item.modelCard){
return '<img src="' + item.modelCard + '?imageView/2/w/100/h/100" width="100" height="60"/>'
if (item.modelCard) {
return '<a class="pop" href="' + item.modelCard + '"> '+
'<img src="' + item.modelCard + '?imageView/2/w/100/h/100" title="模特卡" width="100" height="60"/></a>'
}
return ""
}
},
{
... ...
... ... @@ -30,7 +30,7 @@ var g = new common.grid({
{display: "姓名", name: "modelName"},
{
display: "头像", name: "avatar", render: function (item) {
if (item.avatar) {
if(item.avatar){
return '<img src="' + item.avatar + '?imageView/0/w/78/h/78" width="100" height="60"/>'
}
return ""
... ...