Authored by shuaiguo

Merge branch 'refs/heads/feature/undertake' into develop

# Conflicts:
#	code/yarn.lock
@@ -23,6 +23,8 @@ module.exports = function (app){ @@ -23,6 +23,8 @@ module.exports = function (app){
23 if(rs.data && rs.data.shopsAddressInfo) { 23 if(rs.data && rs.data.shopsAddressInfo) {
24 rs.data.shopsAddressInfo = JSON.stringify(rs.data.shopsAddressInfo); 24 rs.data.shopsAddressInfo = JSON.stringify(rs.data.shopsAddressInfo);
25 } 25 }
  26 +
  27 + console.log('------------data------------', JSON.stringify(rs.data))
26 this.$extend={ 28 this.$extend={
27 moduleName:"店铺管理", 29 moduleName:"店铺管理",
28 pageName:"店铺编辑", 30 pageName:"店铺编辑",
@@ -28,7 +28,11 @@ module.exports={ @@ -28,7 +28,11 @@ module.exports={
28 {name:"city",type:"String"}, 28 {name:"city",type:"String"},
29 {name:"county",type:"String"}, 29 {name:"county",type:"String"},
30 {name:"street",type:"String"}, 30 {name:"street",type:"String"},
31 - {name:"detailAdd",type:"String"} 31 + {name:"detailAdd",type:"String"},
  32 + {name:"zfbAccountName",type:"String"},
  33 + {name:"zfbAccount",type:"String"},
  34 + {name:"checkTel",type:"String"}
  35 +
32 ] 36 ]
33 }, 37 },
34 38
@@ -41,13 +41,16 @@ module.exports={ @@ -41,13 +41,16 @@ module.exports={
41 {name:"unionType",type:"String"}, 41 {name:"unionType",type:"String"},
42 {name:"businessLicense",type:"String"}, 42 {name:"businessLicense",type:"String"},
43 // 客服电话 43 // 客服电话
44 - {name:"customerTel",type:"String"}, 44 + {name:"customerTel",type:"String"},
45 // 店铺地址 45 // 店铺地址
46 - {name:"province",type:"String"},  
47 - {name:"city",type:"String"},  
48 - {name:"county",type:"String"},  
49 - {name:"street",type:"String"},  
50 - {name:"detailAdd",type:"String"} 46 + {name:"province",type:"String"},
  47 + {name:"city",type:"String"},
  48 + {name:"county",type:"String"},
  49 + {name:"street",type:"String"},
  50 + {name:"detailAdd",type:"String"},
  51 + {name:"zfbAccountName",type:"String"},
  52 + {name:"zfbAccount",type:"String"},
  53 + {name:"checkTel",type:"String"}
51 ] 54 ]
52 }, 55 },
53 56
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 3
4 <form id="storeForm" role="form" class="form-horizontal form-bordered" method="post" action="<%action%>"> 4 <form id="storeForm" role="form" class="form-horizontal form-bordered" method="post" action="<%action%>">
5 <input type="hidden" id="shopsId" value="<%data.shopsId%>"> 5 <input type="hidden" id="shopsId" value="<%data.shopsId%>">
6 - <input type="hidden" id="shopsAddressInfo" value="<%data.shopsAddressInfo%>"> 6 + <input type="hidden" id="shopsAddressInfoData" value="<%data.shopsAddressInfo%>">
7 <div class="contentpanel"> 7 <div class="contentpanel">
8 <div class="panel panel-default"> 8 <div class="panel panel-default">
9 <div class="panel-heading"> 9 <div class="panel-heading">
@@ -74,7 +74,7 @@ @@ -74,7 +74,7 @@
74 </div> 74 </div>
75 <div class="form-group" id="shopsAddressInfo"> 75 <div class="form-group" id="shopsAddressInfo">
76 <div class="col-sm-1 control-label"> 76 <div class="col-sm-1 control-label">
77 - <label>店铺地址:</label> 77 + <label>店铺地址:<span class="red">*</span></label>
78 </div> 78 </div>
79 <div class="col-sm-2"> 79 <div class="col-sm-2">
80 <select name="province" id="province" 80 <select name="province" id="province"
@@ -109,9 +109,9 @@ @@ -109,9 +109,9 @@
109 <p style="margin-top: 10px"><span class="red">注:店铺地址为店铺最新可联系到的地址</span></p> 109 <p style="margin-top: 10px"><span class="red">注:店铺地址为店铺最新可联系到的地址</span></p>
110 </div> 110 </div>
111 </div> 111 </div>
112 - <div class="form-group" id="customerTel"> 112 + <div class="form-group" id="customerTelFormGroup">
113 <div class="col-sm-1 control-label"> 113 <div class="col-sm-1 control-label">
114 - <label>店铺客服电话:</label> 114 + <label>店铺客服电话:<span class="red">*</span></label>
115 </div> 115 </div>
116 <div class="col-sm-8"> 116 <div class="col-sm-8">
117 <div class="input-group"> 117 <div class="input-group">
@@ -122,6 +122,45 @@ @@ -122,6 +122,45 @@
122 <p style="margin-top: 10px"><span class="red">注:请输入手机号或固定电话号码,固定电话格式为“区号-号码-分机”,支持400或800电话</span></p> 122 <p style="margin-top: 10px"><span class="red">注:请输入手机号或固定电话号码,固定电话格式为“区号-号码-分机”,支持400或800电话</span></p>
123 </div> 123 </div>
124 </div> 124 </div>
  125 + <div class="form-group" id="zfbAccountFormGroup">
  126 + <div class="col-sm-1 control-label">
  127 + <label>支付宝账号:<span class="red">*</span></label>
  128 + </div>
  129 + <div class="col-sm-8">
  130 + <div class="input-group">
  131 + <input type="text" form="storeForm" name="zfbAccount" id="zfbAccount"
  132 + class="form-control" value="<%data.zfbAccount%>" placeholder="支付宝账号"
  133 + aria-describedby="basic-addon2">
  134 + </div>
  135 + <p style="margin-top: 10px"><span class="red">注:支付宝账号用于提现,支持邮箱和手机格式</span></p>
  136 + </div>
  137 + </div>
  138 + <div class="form-group" id="zfbAccountNameFormGroup">
  139 + <div class="col-sm-1 control-label">
  140 + <label>支付宝账号名称:<span class="red">*</span></label>
  141 + </div>
  142 + <div class="col-sm-8">
  143 + <div class="input-group">
  144 + <input type="text" form="storeForm" name="zfbAccountName" id="zfbAccountName"
  145 + class="form-control" value="<%data.zfbAccountName%>" placeholder="支付宝账号名称"
  146 + aria-describedby="basic-addon2">
  147 + </div>
  148 + <p style="margin-top: 10px"><span class="red">注:支付宝账号名称用于提现,将校验支付宝账号姓名一致性</span></p>
  149 + </div>
  150 + </div>
  151 + <div class="form-group" id="checkTelFormGroup">
  152 + <div class="col-sm-1 control-label">
  153 + <label>联系方式:<span class="red">*</span></label>
  154 + </div>
  155 + <div class="col-sm-8">
  156 + <div class="input-group">
  157 + <input type="text" form="storeForm" name="checkTel" id="checkTel"
  158 + class="form-control" value="<%data.checkTel%>" placeholder="联系方式"
  159 + aria-describedby="basic-addon2">
  160 + </div>
  161 + <p style="margin-top: 10px"><span class="red">注:请输入手机号,用于接收提现验证码</span></p>
  162 + </div>
  163 + </div>
125 <div class="form-group" id="other"> 164 <div class="form-group" id="other">
126 <div class="col-sm-1 control-label"> 165 <div class="col-sm-1 control-label">
127 <label>其他平台网址:</label> 166 <label>其他平台网址:</label>
@@ -91,7 +91,8 @@ var sellType = { @@ -91,7 +91,8 @@ var sellType = {
91 "3": "JIT", 91 "3": "JIT",
92 "4": "专营店代销入库", 92 "4": "专营店代销入库",
93 "5": "专营店代销不入库", 93 "5": "专营店代销不入库",
94 - "10": "保税经销" 94 + "10": "保税经销",
  95 + "30": "一件代发"
95 } 96 }
96 } 97 }
97 98
@@ -11,16 +11,67 @@ var util = require('../../common/util'); @@ -11,16 +11,67 @@ var util = require('../../common/util');
11 var e=new common.edit("#storeForm",{bucket:"yhb-img01"}); 11 var e=new common.edit("#storeForm",{bucket:"yhb-img01"});
12 window.UMshopintro = UM.getEditor('edit-shop-intro'); 12 window.UMshopintro = UM.getEditor('edit-shop-intro');
13 window.UMBusinessLicense = UM.getEditor('edit-business-license'); 13 window.UMBusinessLicense = UM.getEditor('edit-business-license');
14 -$(function () {  
15 - var shopNature = $("#shopNature").val();  
16 - // 一件代发  
17 - if(shopNature == 6) {  
18 - $("#customerTel").show(); 14 +
  15 +// 一件代发 选项展示
  16 +function underTakeElm(isShow) {
  17 + if(isShow) {
  18 + $("#customerTelFormGroup").show();
19 $("#shopsAddressInfo").show(); 19 $("#shopsAddressInfo").show();
  20 + $("#checkTelFormGroup").show();
  21 + $("#zfbAccountNameFormGroup").show();
  22 + $("#zfbAccountFormGroup").show();
  23 + $('#province').attr('required', true)
  24 + $('#city').attr('required', true)
  25 + $('#detailAdd').attr('required', true)
  26 + $('#customerTel').attr('required', true)
  27 +
  28 + $('#zfbAccount').attr('required', true)
  29 + $('#zfbAccountName').attr('required', true)
  30 + $('#checkTel').attr('required', true)
  31 + // 一件代发 默认选择单品 且不可修改
  32 + $('#shopsType').val('1').attr('disabled', 'disabled')
  33 +
  34 + if(!!~$("#shopsType").val()){
  35 + $("#modalId").prop("disabled",false);
  36 + }else{
  37 + $("#modalId").prop("disabled",true);
  38 + }
  39 + if(g2.grid){
  40 + g2.__rows.length=0;
  41 + g2.reload();
  42 + }
  43 +
20 }else{ 44 }else{
21 - $("#customerTel").hide(); 45 + $("#customerTelFormGroup").hide();
22 $("#shopsAddressInfo").hide(); 46 $("#shopsAddressInfo").hide();
  47 + $("#checkTelFormGroup").hide();
  48 + $("#zfbAccountNameFormGroup").hide();
  49 + $("#zfbAccountFormGroup").hide();
  50 +
  51 + $('#province').attr('required', false)
  52 + $('#city').attr('required', false)
  53 + $('#detailAdd').attr('required', false)
  54 + $('#customerTel').attr('required', false)
  55 + $('#zfbAccount').attr('required', false)
  56 + $('#zfbAccountName').attr('required', false)
  57 + $('#checkTel').attr('required', false)
  58 + $('#shopsType').attr('disabled', false).val('-1')
  59 +
  60 + if(!!~$("#shopsType").val()){
  61 + $("#modalId").prop("disabled",false);
  62 + }else{
  63 + $("#modalId").prop("disabled",true);
  64 + }
  65 + if(g2.grid){
  66 + g2.__rows.length=0;
  67 + g2.reload();
  68 + }
23 } 69 }
  70 +}
  71 +$(function () {
  72 + var shopNature = $("#shopNature").val();
  73 + // 一件代发
  74 + underTakeElm(shopNature == 6);
24 if(shopNature == 3){ 75 if(shopNature == 3){
25 $("#unionTypeDiv").show(); 76 $("#unionTypeDiv").show();
26 $("#blkShop").hide(); 77 $("#blkShop").hide();
@@ -432,7 +483,7 @@ const Region = { @@ -432,7 +483,7 @@ const Region = {
432 } 483 }
433 484
434 $(function(){ 485 $(function(){
435 - var shopsAddressInfo = $('#shopsAddressInfo').val(); 486 + var shopsAddressInfo = $('#shopsAddressInfoData').val();
436 if(shopsAddressInfo) { 487 if(shopsAddressInfo) {
437 shopsAddressInfo = JSON.parse(shopsAddressInfo); 488 shopsAddressInfo = JSON.parse(shopsAddressInfo);
438 } 489 }
@@ -504,13 +555,9 @@ $('#street').on('change',function() { @@ -504,13 +555,9 @@ $('#street').on('change',function() {
504 $("#shopNature").on('change', () => { 555 $("#shopNature").on('change', () => {
505 var shopNature = $("#shopNature").val(); 556 var shopNature = $("#shopNature").val();
506 // 一件代发 557 // 一件代发
  558 + underTakeElm(shopNature == 6);
507 if(shopNature == 6) { 559 if(shopNature == 6) {
508 - $("#customerTel").show();  
509 - $("#shopsAddressInfo").show();  
510 Region.initProvice(); 560 Region.initProvice();
511 - }else{  
512 - $("#customerTel").hide();  
513 - $("#shopsAddressInfo").hide();  
514 } 561 }
515 }); 562 });
516 563
@@ -554,7 +601,7 @@ function submitForm(callback) { @@ -554,7 +601,7 @@ function submitForm(callback) {
554 option.data.city = Region.selected.city.label; 601 option.data.city = Region.selected.city.label;
555 option.data.county = Region.selected.county.label; 602 option.data.county = Region.selected.county.label;
556 option.data.street = Region.selected.street.label; 603 option.data.street = Region.selected.street.label;
557 - 604 +
558 // if(+option.data.shopNature == 6) { 605 // if(+option.data.shopNature == 6) {
559 // option.data.shopsAddressInfo = { 606 // option.data.shopsAddressInfo = {
560 // province: Region.selected.province.label, 607 // province: Region.selected.province.label,