mirror of
https://gitee.com/ShopeX/OMS
synced 2026-03-31 05:25:32 +08:00
174 lines
8.2 KiB
HTML
174 lines
8.2 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.
|
||
-->
|
||
|
||
<{capture name="header"}>
|
||
<{css app="ome" src="ome.css"}>
|
||
<{css app="ome" src="style.css"}>
|
||
<{script src="coms/modedialog.js" app="desktop"}>
|
||
<{script src="coms/autocompleter.js" app="desktop"}>
|
||
<{script src="coms/pager.js" app="desktop"}>
|
||
<{/capture}>
|
||
<link href="../../../../app/desktop/statics/perfect/main.css" rel="stylesheet" type="text/css">
|
||
<div class="form-layout">
|
||
<form method="post" id="series_form" action="index.php?app=dealer&ctl=admin_series&act=toEditMain">
|
||
<input type="hidden" id="series_id" name="series_id" value="<{$series_info.series_id}>">
|
||
<div class="form-layout-block">
|
||
<h3>编辑产品线</h3>
|
||
<div class="form-layout-fields form-layout-fields-column">
|
||
<div class="form-field">
|
||
<span class="form-field-label"><span style="color:red;">*</span>产品线编码:</span>
|
||
<{$series_info.series_code}>
|
||
<input class="form-input" placeholder="请输入产品线编码" type="hidden" name="series_code" vtype="alphaint&&required" value="<{$series_info.series_code}>" />
|
||
</div>
|
||
<div class="form-field">
|
||
<span class="form-field-label"><span style="color:red;">*</span>产品线名称:</span>
|
||
<input class="form-input" placeholder="请输入产品线名称" type="text" name="series_name" vtype="required" value="<{$series_info.series_name}>" />
|
||
</div>
|
||
<div class="form-field">
|
||
<span class="form-field-label"><span style="color:red;">*</span>产品线描述:</span>
|
||
<input class="form-input" placeholder="请输入产品线描述" type="text" name="description" vtype="required" value="<{$series_info.description}>" />
|
||
</div>
|
||
<div class="form-field">
|
||
<span class="form-field-label"><span style="color:red;">*</span>产品线分类:</span>
|
||
<input class="form-input" placeholder="请输入产品线分类" type="text" name="cat_name" vtype="required" value="<{$series_info.cat_name}>" />
|
||
</div>
|
||
<div class="form-field">
|
||
<span class="form-field-label">产品线备注:</span>
|
||
<input class="form-input" placeholder="请输入产品线备注" type="text" name="remark" value="<{$series_info.remark}>" />
|
||
</div>
|
||
<div class="form-field">
|
||
<span class="form-field-label">所属贸易公司:</span>
|
||
<select name='betc_id' id="betc_id">
|
||
<option value="">请选择...</option>
|
||
<{foreach from=$betcs item=betc}>
|
||
<option value="<{$betc.betc_id}>" <{if $series_info.betc_id == $betc.betc_id}>selected<{/if}>><{$betc.betc_name}></option>
|
||
<{/foreach}>
|
||
</select>
|
||
</div>
|
||
<!--
|
||
<div class="form-field" id="bind_basic_material">
|
||
<span class="form-field-label">基础物料:</span>
|
||
<{*input type='dealer_object' object='basic_material@material' multiple=true breakpoint='0' name='bm_id' textcol='material_name' value=$bind_bm_ids callback='product_object_callback' replacehtml=$replacehtml emptytext='选择基础物料' style='float:left;width:500px;' filter=""*}>
|
||
</div>
|
||
<div class="form-field">
|
||
<span class="form-field-label">经销店铺:</span>
|
||
<div id="ajax_get_div_contents_shop"></div>
|
||
</div>
|
||
-->
|
||
</div>
|
||
<div id="cc" class="noprint table-action">
|
||
<{button type="button" id="series_btn" label="保 存"}>
|
||
<{button type="button" class="btn-secondary" id="return-btn" label="关 闭" onclick="javascript:void(window.close());"}>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
<script>
|
||
/*
|
||
//基础物料选择后展示模块
|
||
function product_object_callback(rs,handle){
|
||
var length = handle.getElements('.row').length;
|
||
var html = '已选择了'+length+'个基础物料,'+"<a href='javascript:void(0);' onclick='product_selected_show()'>查看选中的基础物料.</a>";
|
||
if ($defined($('hand-selected-product'))){
|
||
$('hand-selected-product').setHTML(html);
|
||
}else{
|
||
var div = new Element('div',{'html':html,'id':'hand-selected-product'});
|
||
div.injectBefore(handle);
|
||
}
|
||
}
|
||
|
||
//基础物料明细展示
|
||
function product_selected_show(){
|
||
new Dialog('index.php?app=dealer&ctl=admin_series&act=showProducts',{
|
||
ajaxoptions:{data:$('hand-selected-product').getNext('div'),method:'post'}
|
||
});
|
||
}
|
||
|
||
//经销店铺选择后展示模块
|
||
function shop_object_callback(rs,handle){
|
||
var length = handle.getElements('.row').length;
|
||
var html = '已选择了'+length+'个经销店铺,'+"<a href='javascript:void(0);' onclick='shop_selected_show()'>查看选中的经销店铺.</a>";
|
||
if ($defined($('hand-selected-shop'))){
|
||
$('hand-selected-shop').setHTML(html);
|
||
}else{
|
||
var div = new Element('div',{'html':html,'id':'hand-selected-shop'});
|
||
div.injectBefore(handle);
|
||
}
|
||
}
|
||
|
||
//经销店明细展示
|
||
function shop_selected_show(){
|
||
new Dialog('index.php?app=dealer&ctl=admin_series&act=showShops',{
|
||
ajaxoptions:{data:$('hand-selected-shop').getNext('div'),method:'post'}
|
||
});
|
||
}
|
||
|
||
// 根据贸易公司ID更新经销店铺选项
|
||
function updateShopOptions(betcId) {
|
||
new Request.HTML({
|
||
url: 'index.php?app=dealer&ctl=admin_series&act=ajax_shopyjdf_html&p[0]='+$('series_id').value,
|
||
method: 'post',
|
||
update: $('ajax_get_div_contents_shop'),
|
||
data: {'betc_id': betcId}, // 动态传入betc_id
|
||
onSuccess: function () {
|
||
// 请求成功后的处理(如果需要)
|
||
}
|
||
}).send();
|
||
}
|
||
|
||
//基础物料和经销店铺选择按钮展示
|
||
function ajax_onload_html(){
|
||
// 经销店铺请求逻辑,这里不再直接发送请求,而是通过updateShopOptions函数根据betc_id动态发送
|
||
updateShopOptions($('betc_id').value); // 初始化时可以考虑是否需要立即根据默认选择的贸易公司加载
|
||
}
|
||
*/
|
||
|
||
(function() {
|
||
window.addEvent('domready', function() {
|
||
// ajax_onload_html();
|
||
// // 监听所属贸易公司下拉框的变化
|
||
// $('betc_id').addEvent('change', function (e) {
|
||
// var selectedBetcId = this.value; // 获取选中的贸易公司ID
|
||
// updateShopOptions(selectedBetcId); // 更新经销店铺选项
|
||
// });
|
||
|
||
//点击提交表单
|
||
$('series_btn').addEvent('click',function(e){
|
||
var _this = this;
|
||
var form = this.getParent('form');
|
||
form.store('target',{
|
||
onRequest:function(){
|
||
_this.disabled=true;
|
||
},
|
||
onComplete:function(jsontext){
|
||
try{
|
||
var json = JSON.decode(jsontext);
|
||
if (typeof(json.error)!='undefined'){
|
||
_this.disabled=false;
|
||
}else{
|
||
_this.disabled=true;
|
||
if(opener.finderGroup['<{$env.get.finder_id}>']) opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(100,opener.finderGroup['<{$env.get.finder_id}>']);
|
||
setTimeout('window.close()',200);
|
||
}
|
||
}catch(e){}
|
||
}
|
||
});
|
||
form.fireEvent('submit',e);
|
||
});
|
||
});
|
||
})();
|
||
</script>
|