在双模的项目中,我遇到了一个问题,我公司的双模项目是基于ECShop的框架,在完成订单列表的页面时,我写了两个form表单来单独传输数据,第一个表单是用来做搜素的,第二个表单是用来显示表单信息的,在控制器中我并不是用index方法来渲染这个页面的,这是这个问题的关键,我用的是同一个控制器下的productionOrderList方法,所以在第一个form表单里,我需要传连个东西,分别是 app act。下面就来看看我的具体代码吧
<!-- 搜索表单 -->
<form name=\'form\' method=\'get\' style=\"padding-bottom:15px;\">
<input type=\"hidden\" name=\"app\" value=\"{$smarty.get.app}\"/> //关键所在
<input type=\"hidden\" name=\"act\" value=\"{$smarty.get.act}\"/>//关键所在
<table width=\'98%\' border=\'0\' cellpadding=\'1\' cellspacing=\'1\' bgcolor=\'#cfcfcf\' align=\"center\" style=\"margin-top:8px\">
<tr bgcolor=\'#f8f8f8\'>
<td align=\'left\'><table border=\'0\' cellpadding=\'0\' cellspacing=\'0\' height=\"32\">
<tr>
<td style=\"padding: 0px 0px 4px 3px;\">
<input name=\"order_type\" type=\"hidden\" id=\"order_type\" value=\"{$smarty.get.order_type}\" />
订单号:<input name=\"order_sn\" type=\"text\" id=\"order_sn\" value=\"{$smarty.get.order_sn}\" />
商品名称:<input name=\"goods_name\" type=\"text\" id=\"goods_name\" value=\"{$smarty.get.goods_name}\" />
生产编号:<input name=\"production_sn\" type=\"text\" id=\"production_sn\" value=\"{$smarty.get.production_sn}\" />
工艺说明:<input name=\"craft_name\" type=\"text\" id=\"craft_name\" value=\"{$smarty.get.craft_name}\" />
<br>
下单时间:<input name=\"s_time\" type=\"text\" id=\"begin_add_time\" value=\"{$smarty.get.begin_add_time}\" />
- <input name=\"e_time\" type=\"text\" id=\"end_add_time\" value=\"{$smarty.get.end_add_time}\" />
<!--联系方式:<input name=\"phone_mob\" type=\"text\" id=\"phone_mob\" value=\"{$smarty.get.phone_mob}\" />-->
{if $smarty.get.order_type}
门店筛选:
<select name=\"store_name\" id=\"store_name\">
<option value=\'\'>选择门店</option>
{foreach from=$store_name item=store_name}
<option value=\'{$store_name}\' {if $smarty.get.store_name eq $store_name}selected{/if}>{$store_name}</option>
{/foreach}
</select>
{/if}
{if $smarty.get.order_type}
服务订单<select name=\"wf_status\" id=\"wf_status\">
<option value=\'\'>全部订单</option>
<option value=11 {if $smarty.get.wf_status eq 11}selected{/if}>待付款</option>
<option value=1 {if $smarty.get.wf_status eq 1}selected{/if}>待服务</option>
<option value=2 {if $smarty.get.wf_status eq 2}selected{/if}>服务中</option>
<option value=3 {if $smarty.get.wf_status eq 3}selected{/if}>已服务</option>
</select>
{else}
生产状态:
<select name=\"status\" id=\"status\">
<option value=\'all\'>全部状态</option>
<option value=\'0\' {if $smarty.get.status eq \'0\'}selected{/if}>取消订单</option>
<option value=\'10\' {if $smarty.get.status eq \'10\'}selected{/if}>已接单</option>
<option value=\'11\' {if $smarty.get.status eq \'11\'}selected{/if}>待审核</option>
<option value=\'20\' {if $smarty.get.status eq \'20\'}selected{/if}>生产中</option>
<option value=\'30\' {if $smarty.get.status eq \'30\'}selected{/if}>生产完成</option>
<option value=\'31\' {if $smarty.get.status eq \'31\'}selected{/if}>质检完成</option>
<option value=\'40\' {if $smarty.get.status eq \'40\'}selected{/if}>已出库</option>
<option value=\'50\' {if $smarty.get.status eq \'50\'}selected{/if}>订单完成</option>
<!--<option value=\'deleted\' {if $smarty.get.status eq \'deleted\'}selected{/if}>用户已删除</option>-->
<!--
<option value=\'\'>待退货</option>
<option value=\'\'>已退货</option>
<option value=\'\'>已退款</option>
-->
</select>
{/if}
<input class=\"np\" type=\"image\" src=\"templates/images/button_search.gif\" width=\"60\" height=\"22\" border=\"0\" style=\"vertical-align: top; margin-top: 3px;\" />
</td>
</tr>
</table></td>
</tr>
</table>
</form>
<!-- 内容列表 -->
<form name=\"form2\" class=\"submitForm\" action=\"index.php?app=craft_order&productionOrderList\" load=\"index.php?app=craft_order&act=drop_craft\">
<table width=\"98%\" border=\"0\" align=\"center\" cellpadding=\"3\" cellspacing=\"1\" bgcolor=\"#D6D6D6\">
<tr>
<td height=\"28\" colspan=\"12\" background=\"{res file=images/tbg.gif}\">
<table width=\'96%\' cellpadding=\'0\' cellspacing=\'0\'>
<tr>
<td height=\"28\" background=\"/manager/templates/images/tbg.gif\" style=\"padding-left:10px;\" colspan=\"3\"> ◆工艺及客户管理 > 生产管理列表 </td>
<!--<td align=\'right\'>-->
<!--<a href=\"index.php?app=craft&act=addCraft\" class=\'np coolbg\'>增加工艺</a>-->
<!--</td>-->
</tr>
</table>
</td>
</tr>
<tr align=\"center\" bgcolor=\"#f8f8f8\" height=\"25\">
<td width=\"3%\">选择</td>
<td width=\"10%\">订单信息</td>
<td width=\"5%\">生产编号</td>
<td width=\"10%\">商品名称</td>
<td width=\"7.5%\">工艺说明</td>
<td width=\"4%\">数量</td>
<td width=\"12.5%\">提单时间</td>
<td width=\"12.5%\">生产日期</td>
<td width=\"12.5%\">质检时间</td>
<td width=\"5%\">质检结果</td>
<td width=\"5%\">生产状态</td>
<td width=\"10%\">操作</td>
</tr>
<!--{if !empty($orderList)}-->
<!-- {foreach from=$orderList item=item name=list} -->
<tr align=\"center\" bgcolor=\"#FFFFFF\" height=\"26\" align=\"center\" =\" :this.bgColor=\'#FCFDEE\';\" =\" :this.bgColor=\'#FFFFFF\';\">
<td class=\"list-text\">
<input name=\'id[]\' type=\'checkbox\' class=\"chooseNow\" value=\'{$item.id}\' />
</td>
<td>
{$item.order_sn|default:-}
</td>
<td>
{$item.production_sn|default:-}
</td>
<td>
{$item.goods_name|default:-}
</td>
<td>
{$item.craft_name|default:-}
</td>
<td>
{$item.user_goods_total|default:-}
</td>
<td>{if $item.add_time!=\'\'}{$item.production_time|date:Y-m-d H:i:g}{else}--{/if}
</td>
<td>{if $item.production_time!=\'\'}{$item.production_time|date:Y-m-d H:i:g}{else}--{/if}
</td>
<td>{if $item.production_end_time!=\'\'}{$item.production_end_time|date:Y-m-d H:i:g}{else}--{/if}
</td>
<td>
{$item.qualityTestingChinese|default:-}
</td>
<td>
{if $item.statusChinese}{$item.statusChinese}
{else}--
{/if}
</td>
<td width=\"\" class=\"list-text\">
<div class=\"lista\">
<a href=\"index.php?app=craft&act=addCraft&id={$item.id}\">查看</a>
{if $item.status==10}<span>|</span><a href=\"index.php?app=craft&act=addCraft&id={$item.id}\">随工单</a>{/if}
{if $item.status==40}<span>|</span><a =\"member_delete({$item.id})\" href=\" :;\">更改结算</a>
{/if} </div>
</td>
</tr>
<!--{/foreach}-->
<tr bgcolor=\"#ffffff\">
<!--<td height=\"36\" colspan=\"12\"> <a class=\"coolbg\" id=\"checkAll\" href=\" :;\">全选</a> <a class=\"coolbg\" id=\"unCheck\" href=\" :;\">取消</a> <a class=\"coolbg\" id=\"printing\" href=\" :;\"> 打印 </a> <a class=\"coolbg\" id=\"unCheck\" href=\" :;\">取消</a></td>-->
<td height=\"36\" colspan=\"12\">
<a href=\" :;\" id=\"checkAll\" class=\"coolbg\">全选</a>
<a href=\" :;\" id=\"unCheck\" class=\"coolbg\">取消</a>
<a href=\" :;\" id=\"print_all\" class=\"coolbg\">打印</a>
<a href=\" :;\" id=\"export_all\" class=\"coolbg\">导出</a>
<a href=\" :;\" id=\"export_condition\" class=\"coolbg\" =\"导出上面筛选条件的所有订单\">条件导出</a>
{if $site_config.store_info.store_id==267321 ||$site_config.store_info.store_id==254451 || $site_config.store_info.store_id==257417}
<a href=\" :;\" id=\"export_goods\" class=\"coolbg\" =\"导出上面筛选条件的商品汇总单\">
条件导出
</a>
{/if}
<a href=\" :;\" id=\"batch_hide\" class=\"coolbg\">批量删除</a>
<a href=\" :;\" id=\"batch_print_all\" class=\"coolbg\">批量打印随工单</a>
</td>
</tr>
<!--{else}-->
<tr align=\"right\" bgcolor=\"#f8f8f8\">
<td height=\"36\" colspan=\"12\" align=\"center\"><span>您的数据为空</span></td>
</tr>
<!--{/if}-->
<tr bgcolor=\"#f8f8f8\">
<td height=\"36\" colspan=\"12\" align=\"center\">
{$pageShow}
</td>
</tr>
</table>
</form>
</div>
这两行代码就是重点
<input type=\"hidden\" name=\"app\" value=\"{$smarty.get.app}\"/> //关键所在
<input type=\"hidden\" name=\"act\" value=\"{$smarty.get.act}\"/>//关键所在
没有这两个传输的话,点击搜索是没有效果的
本地项目在http://m.123.local.qushiyun.com/manager/index.php?app=craft_order&act=productionOrderList
感想:现在遇到的问题都是在为日后成为大神而添加的瓦片
注:本文来源于我雨中笑之个人的简书https://www.jianshu.com/p/cf56475a58b5,转载请申明来源
继续阅读与本文标签相同的文章
-
【物联网开发实战】- 设备上云方案详解
2026-05-18栏目: 教程
-
阿里云RDS for MySQL 发布三节点企业版
2026-05-18栏目: 教程
-
【转载】时隔一年多,我又用起了 Superset
2026-05-18栏目: 教程
-
《阿里巴巴Android开发手册》开放下载
2026-05-18栏目: 教程
-
CRaaS一阳指运维平台Ver 0.6.1 发布公告
2026-05-18栏目: 教程
