mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-30 21:15:34 +08:00
313 lines
12 KiB
HTML
313 lines
12 KiB
HTML
<!--
|
||
Copyright 2012-2026 ShopeX (https://www.shopex.cn)
|
||
|
||
Licensed under the Apache License, Version 2.0 (the "License");
|
||
you may not use this file except in compliance with the License.
|
||
You may obtain a copy of the License at
|
||
|
||
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
||
Unless required by applicable law or agreed to in writing, software
|
||
distributed under the License is distributed on an "AS IS" BASIS,
|
||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
See the License for the specific language governing permissions and
|
||
limitations under the License.
|
||
-->
|
||
|
||
<div class="tableform">
|
||
<form method="post" action="index.php?app=o2o&ctl=admin_store&act=save" id="store-form">
|
||
|
||
<input type="hidden" name="store_id" value="<{$store_prop.store_id}>">
|
||
|
||
<h4>基本信息</h4>
|
||
<div class="division">
|
||
<table>
|
||
<tbody>
|
||
<tr>
|
||
<th><em class="c-red">*</em>门店编码:</th>
|
||
<td>
|
||
<{if $store_prop.store_bn}>
|
||
<{$store_prop.store_bn}>
|
||
<input type="hidden" name="store_bn" value="<{$store_prop.store_bn}>">
|
||
<{else}>
|
||
<input class="x-input" type="text" vtype="required" name="store_bn" value="<{$store_prop.store_bn}>" >
|
||
<{/if}>
|
||
</td>
|
||
<th>
|
||
<em class="c-red">*</em>门店名称CN:
|
||
</th>
|
||
<td>
|
||
<{input type="text&&required" name="name" value=$store_prop.name}>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>状态:
|
||
</th>
|
||
<td>
|
||
<{input type="radio" name="status" value=$store_prop.status|default:"1" options=array("1"=>"开店","2"=>"关店") separator=" "}>
|
||
</td>
|
||
<th>
|
||
|
||
</th>
|
||
<td>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>所属服务端:
|
||
</th>
|
||
<td>
|
||
<select name="server_id" id="server_id">
|
||
<{foreach from=$serverList item=server}>
|
||
<option value="<{$server.server_id}>" <{if $server.server_id==$store_prop.server_id}>selected<{/if}> ><{$server.name}></option>
|
||
<{/foreach}>
|
||
</select>
|
||
</td>
|
||
<th>
|
||
|
||
</th>
|
||
<td>
|
||
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>所属组织:
|
||
</th>
|
||
<td colspan="3">
|
||
<{if $store_prop.org_name}>
|
||
<{$store_prop.org_name}>
|
||
<input type="hidden" name="org_parents_structure" value="<{$org.org_parents_structure}>">
|
||
<{else}>
|
||
<{input type='organization' app='organization' name="org_parents_structure" value=$org.org_parents_structure required="true" show='onlytree'}>
|
||
<{/if}>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>所属总店:</th>
|
||
<td colspan="3">
|
||
<select name="online_id[]" id="online_id" multiple>
|
||
<{foreach from=$shopList item=shop}>
|
||
<option value="<{$shop.shop_id}>"><{$shop.name}></option>
|
||
<{/foreach}>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<h4>地址信息</h4>
|
||
<div class="division">
|
||
<table>
|
||
<tbody>
|
||
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>地区:
|
||
</th>
|
||
<td>
|
||
<{input type="region" app="eccommon" name="area" value=$store_prop.area }>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>地址:
|
||
</th>
|
||
<td>
|
||
<{input type="text" vtype="required" name="addr" size="60" value=$store_prop.addr }>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>联系人:
|
||
</th>
|
||
<td>
|
||
<{input type="text" vtype="required" name="contacter" size="60" value=$store_prop.contacter }>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>手机:
|
||
</th>
|
||
<td>
|
||
<{input type="text" vtype="required" name="mobile" size="60" value=$store_prop.mobile }>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
固定电话:
|
||
</th>
|
||
<td>
|
||
<{input type="text" name="tel" size="60" value=$store_prop.tel }>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
邮编:
|
||
</th>
|
||
<td>
|
||
<{input type="text" name="zip" size="60" value=$store_prop.zip }>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>
|
||
传真:
|
||
</th>
|
||
<td>
|
||
<{input type="text" name="fax" size="60" value=$store_prop.fax }>
|
||
</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
|
||
<h4>扩展信息</h4>
|
||
<div class="division">
|
||
<table>
|
||
<tbody>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>营业时间:
|
||
</th>
|
||
<td>
|
||
<{input type="text" name="open_hours" value=$store_prop.open_hours }>
|
||
</td>
|
||
</tr>
|
||
<{if $env.get.store_classify != "agent"}>
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>经营模式:
|
||
</th>
|
||
<td>
|
||
<{input type="radio" vtype="requiredradio" name="store_type" value=$store_prop.store_type|default:'self' options=array("self"=>"自营","join"=>"加盟","cooperation"=>"联营") separator=" "}>
|
||
</td>
|
||
</tr>
|
||
<tr id="dealer_select_row" style="display:none;">
|
||
<th>
|
||
所属经销商:
|
||
</th>
|
||
<td>
|
||
<select name="dealer_cos_id" id="dealer_cos_id">
|
||
<option value="">请选择经销商</option>
|
||
<{foreach from=$dealerList item=dealer}>
|
||
<option value="<{$dealer.cos_id}>" <{if $dealer.cos_id==$store_prop.dealer_cos_id}>selected<{/if}> > [<{$dealer.cos_code}>]<{$dealer.cos_name}></option>
|
||
<{/foreach}>
|
||
</select>
|
||
</td>
|
||
</tr>
|
||
<{/if}>
|
||
|
||
<tr>
|
||
<th>
|
||
<em class="c-red">*</em>销售类型:
|
||
</th>
|
||
<td>
|
||
<{input type="radio" vtype="requiredradio" name="store_mode" value=$store_prop.store_mode|default:'normal' options=array("normal"=>"正价店","discount"=>"奥莱店铺") separator=" "}>
|
||
</td>
|
||
</tr>
|
||
<tr>
|
||
<th>库位:</th>
|
||
<td><{input type="text" name="storage_codes[main]" value=$store_prop.storage_code }></td>
|
||
</tr>
|
||
|
||
<tr>
|
||
<th><em class="c-red">*</em>优先级:</th>
|
||
<td><{input type="text" vtype="required" name="priority" value=$store_prop.priority|default:50 }></td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
|
||
<{area inject=".mainFoot"}>
|
||
<div class="table-action">
|
||
<{button label="确定" class="btn-primary" id="savestore"}>
|
||
<{button label="取消" class="btn-secondary" isCloseDialogBtn="true" }>
|
||
</div>
|
||
<{/area}>
|
||
|
||
<script>
|
||
tail.select($('server_id'),
|
||
{
|
||
width: 140
|
||
});
|
||
tail.select($('company_id'),
|
||
{
|
||
width: 140,
|
||
search: true,
|
||
searchMinLength: 0
|
||
});
|
||
tail.select($('online_id'),
|
||
{
|
||
width: 140,
|
||
search: true,
|
||
searchMinLength: 0,
|
||
multiple:true,
|
||
multiContainer: true
|
||
});
|
||
tail.select($('dealer_cos_id'),
|
||
{
|
||
width: 140,
|
||
search: true,
|
||
searchMinLength: 0
|
||
});
|
||
|
||
// 控制经销商选择的显示/隐藏
|
||
function toggleDealerSelect() {
|
||
var storeTypeRadios = $$('input[name=store_type]');
|
||
var dealerRow = $('dealer_select_row');
|
||
var dealerSelect = $('dealer_cos_id');
|
||
|
||
var selectedValue = '';
|
||
storeTypeRadios.each(function(radio){
|
||
if (radio.checked) {
|
||
selectedValue = radio.value;
|
||
}
|
||
});
|
||
|
||
if (selectedValue === 'join') {
|
||
dealerRow.setStyle('display', '');
|
||
} else {
|
||
dealerRow.setStyle('display', 'none');
|
||
// 清空选择
|
||
dealerSelect.set('value', '');
|
||
}
|
||
}
|
||
|
||
// 页面加载时检查初始状态
|
||
window.addEvent('domready', function(){
|
||
toggleDealerSelect();
|
||
|
||
// 监听经营模式变化
|
||
$$('input[name=store_type]').addEvent('change', toggleDealerSelect);
|
||
});
|
||
|
||
$('savestore').addEvent('click',function(event){
|
||
if (!validate($('store-form'))){
|
||
return ;
|
||
}
|
||
|
||
$('store-form').fireEvent('submit', {stop:$empty});
|
||
});
|
||
|
||
$('store-form').store('target',{
|
||
onRequest:function(){
|
||
$('savestore').set('disabled', 'true');
|
||
},
|
||
onComplete:function(resp){
|
||
resp = JSON.decode(resp)
|
||
|
||
$('savestore').set('disabled', '');
|
||
if (resp.error) return ;
|
||
|
||
$('store-form').getParent('.dialog').retrieve('instance').close();
|
||
|
||
finderGroup['<{$env.get.finder_id}>'].refresh();
|
||
}
|
||
});
|
||
|
||
</script> |