lvhao 2 недель назад
Родитель
Сommit
ce25915aa6
2 измененных файлов с 969 добавлено и 0 удалено
  1. 409 0
      core/CoreApp/controllers/Fullorderabf.php
  2. 560 0
      template/erp/fullorderabf_yjtj.html

+ 409 - 0
core/CoreApp/controllers/Fullorderabf.php

@@ -0,0 +1,409 @@
+<?php defined('BASEPATH') OR exit('No direct script access allowed');
+/**
+ * 作为fullorder的替补文件  因为fullorder的文件代码太长了 这里分担下压力
+ */
+class Fullorderabf extends Start_Controller {
+	 public function __construct(){
+		parent::__construct();
+    $this->load->_model('Model_user','user');
+    $this->load->_model('Model_fullorder','fullorder');
+    $this->load->_model('Model_shop','shop');
+    $this->load->_model('Model_express','express');
+		$this->load->_model('Model_country','country');
+  }
+    //定义方法的调用规则 获取URI第二段值
+  public function _remap($arg,$arg_array)
+    {
+		if($arg == 'yjtj')//一件添加订单
+        {
+             $this->_addOrder();
+        }
+		else
+		{
+			 $this->_index();
+		}
+  }
+
+	//管理
+	public function _index()
+	{
+        exit('No direct script access allowed');
+  }
+  //一键添加订单
+  private function _addOrder(){
+    $user = $this->user->get_api($_SESSION['api']);
+		if($user)
+		{
+			$uu = $user;
+		    $fgshop = "";$sid = "";
+			$u = $user;
+		    $user = explode('|',trim($user['shop'],'|'));
+			foreach ($user as $value) 
+		    {
+				$fgshop .= " shop = ".$value." or";
+				$sid .= " id = ".$value." or";
+			}
+		}
+		$post = $this->input->post(NULL, TRUE);
+		if(isset($post['shop']))
+		{
+			$fpcount = $this->input->post('fpcount',true);
+			if(!$fpcount)
+			{
+				echo json_encode(array('msg'=>'需要先清理浏览器缓存,刷新当前页面后再试!','success'=>false));exit;
+			}
+			$customerid = $this->input->post('customerid',true);
+			$shop = $this->input->post('shop',true);
+			$sp = $this->shop->read($shop);
+			$num = $this->fullorder->find_count('shop = "'.$sp['id'].'" and gtime = "'.date('Ymd',time()).'"');
+			$post['source'] = 1;//订单类型:1.线下订单2.PC3.手机
+			$post['state'] = 207;//订单状态:207等待发货
+			$post['review'] = 2;//审核状态:1.未送审2.待审核3.不通过4取消重审5.审核通过6.自动通过
+			$post['print'] = 1;//打印状态:1.不可打印2.未打印3.已打印
+			$post['library'] = 1;//出库状态:1.未出库2.已出库3.已退库
+			$post['libraryconfirm'] = 1;//出库确认:1.不允许2.允许
+			$post['link'] = $sp['link'];
+			$post['issku'] = $sp['sku'];
+			if($post['print'] != 3)
+			{
+			    $post['librarynot'] = "订单未打印,未审核或未通过";//不能出库原因
+			}
+			$orderinfo = $this->input->post('orderinfo',true);
+			$post['shop'] = $sp['id'];
+			$post['user'] = $sp['shopuser'];
+			$post['number'] = $sp['shortname'].'-'.date('ymd',time()).'-'.(substr(strval($num+1+1000),1,3));//编号 
+			if($orderinfo != "")
+			{
+				$ordefin = $this->fullorder->get_orderinfo($orderinfo);
+				if($ordefin)
+				{
+					echo json_encode(array('msg'=>'订单号重复!','success'=>false));exit;
+				}
+				else
+				{
+				    $post['orderinfo'] = $orderinfo;
+				}
+			}
+			else
+			{
+			    $post['orderinfo'] = $sp['id'].date('ymdHis',time()).rand(0,1);//订单号
+			}
+		
+
+
+			if($post['paypal'] != '')
+			{
+			    $pp = $this->fullorder->get_paypal($post['paypal']);	
+			    if($pp)
+			    {
+				    echo json_encode(array('msg'=>'此交易号的订单已存在!','success'=>false));exit;
+			    }
+		    }
+			$post['client'] = $this->input->post('client',true);//客户名称
+			$btime = $this->input->post('buytime',true);//付款时间
+			$post['buytime'] = strtotime($btime);//时间转UX
+			$post['dtime'] = time();//订单时间
+			$post['gtime'] = date('Ymd',time());//格式化时间
+			$post['pay'] = $this->input->post('pay',true);//支付方式
+			$post['capital'] = $this->input->post('capital',true);//资金状态
+			$post['type'] = $this->input->post('warehouse',true);//发货仓库
+			$post['currency'] = $this->input->post('currency',true);//币种
+			$currency = $this->typeclass->read($post['currency']);
+			$post['currencytitle'] = $currency['title'];//币种名称
+			$post['freight'] = $this->input->post('freight',true);//运费
+			$post['expressmoney'] = $this->input->post('expressmoney',true);//物流金额
+			$post['shouldmoney'] = $this->input->post('shouldmoney',true);//应收金额
+			$post['skje'] = $post['shouldmoney'];//收款金额
+			$product = $this->input->post('product');//产品名称
+			$product = str_replace(array('%26','%2B'),array('&','+'),$product);
+			$post['product'] = preg_replace('/( | | |\s)/',' ',$product);
+			$orderremarks = $this->input->post('orderremarks');//订单备注
+			$orderremarks = str_replace(array('%26','%2B'),array('&','+'),$orderremarks);
+			$post['orderremarks'] = preg_replace('/( | | |\s)/',' ',$orderremarks);
+			$shipremarks = $this->input->post('shipremarks');//仓库品名
+			$shipremarks = str_replace(array('%26','%2B'),array('&','+'),$shipremarks);//仓库品名
+			$post['shipremarks'] = preg_replace('/( | | |\s)/',' ',$shipremarks);
+			$post['email'] = $this->input->post('email',true);//邮箱
+			$name = $this->input->post('name',true);//名称
+			$post['name'] = preg_replace('/( | | |\s)/',' ',$name);
+			$post['phone'] = $this->input->post('phone',true);//电话
+			$post['phone'] = preg_replace('/\D/s','',$post['phone']);
+			$post['country'] = $this->input->post('country',true);//国家
+			$ct = $this->country->read($post['country']);//国家
+			$post['al'] = $ct['lb'];//国家二字码
+			$post['province'] = $this->input->post('province',true);//省、州
+			$post['province'] = preg_replace("/^[\s\v".chr(227).chr(128)."]+/","", $post['province']); //替换开头空字符
+            $post['province'] = preg_replace("/[\s\v".chr(227).chr(128)."]+$/","", $post['province']); //替换结尾空字符
+			$post['city'] = $this->input->post('city',true);//城市
+			$post['city'] = preg_replace("/^[\s\v".chr(227).chr(128)."]+/","", $post['city']); //替换开头空字符
+            $post['city'] = preg_replace("/[\s\v".chr(227).chr(128)."]+$/","", $post['city']); //替换结尾空字符
+			$post['zipcode'] = $this->input->post('zipcode',true);//邮编
+			$post['zipcode'] = preg_replace("/^[\s\v".chr(227).chr(128)."]+/","", $post['zipcode']); //替换开头空字符
+            $post['zipcode'] = preg_replace("/[\s\v".chr(227).chr(128)."]+$/","", $post['zipcode']); //替换结尾空字符
+			$post['address'] = $this->input->post('address',true);//地址
+			$post['printtype'] = $this->input->post('printtype',true);//打印类型
+			$fpdata = $this->input->post('fpdata');//购买产品内容
+			$fpdata = str_replace(array('%26','%2B'),array('&','+'),$fpdata);
+			$post['fpdata'] = $fpdata;
+			$post['sbpm'] = $this->input->post('sbpm',true);//申报品名
+			$post['zwpm'] = $this->input->post('zwpm',true);//中文品名
+			$post['ts'] = $this->input->post('ts',true);//条数
+			$post['dtsbjz'] = $this->input->post('dtsbjz',true);//单条申报价
+			$post['zsbjz'] = $this->input->post('zsbjz',true);//总申报价
+			$post['zzl'] = $this->input->post('zzl',true);//总重量
+			$post['zjs'] = $this->input->post('zjs',true);//总件数
+			$post['express'] = $this->input->post('express',true);//快递公司
+			$post['printtype'] = $this->input->post('printtype',true);//打印类型
+			$post['quantity'] = $this->input->post('quantity',true);//数量
+			$post['paypal'] = $this->input->post('paypal',true);//支付号
+			$post['guarantee'] = $this->input->post('guarantee',true);//卖家保障
+			$post['msg'] = $this->input->post('msg',true);//发送留言类型
+			$post['ioss'] = $this->input->post('ioss',true);
+			$post['sbpm'] = $this->input->post('sbpm',true);
+			$pay = $this->pay->get_typeclass($post['pay']);
+			$yga = $post['shouldmoney'];
+			$post['budget'] = 0;
+			if($pay)
+			{
+				$ygc = $pay['estimaterate'];//预估到账公式
+				$ifbudget = eval("return $yga*1.$ygc;");
+				$post['estimaterate'] = $pay['estimaterate'];
+				if($ifbudget > 0)
+				{
+				    $post['budget'] = eval("return $yga*1.$ygc;");//预估到帐金额
+				}
+			}
+			else
+			{
+				$ygb = $sp['estimaterate'];//店铺默认到账公式
+				$ifbudget = eval("return $yga*1.$ygb;");
+				$post['estimaterate'] = $sp['estimaterate'];
+				if($ifbudget > 0)
+				{
+		    	    $post['budget'] = eval("return $yga*1.$ygb;");//预估到帐金额
+				}
+			}
+			$baddress = $this->input->post('baddress',true);
+			$saddress = $this->input->post('saddress',true);
+			$baddress = array_reverse(explode(',',$baddress));
+			$saddress = array_reverse(explode(',',$saddress));
+			$bar = '';$sar = '';
+			$cr = $this->country->read($post['country']);
+			$baddress[1] = $cr['lb'];
+			$saddress[1] = $cr['lb'];
+			$baddress = array_reverse($baddress);
+			$saddress = array_reverse($saddress);
+			for($i=0;$i<count($baddress);$i++)
+			{
+				$bar .= $baddress[$i].',';
+			}
+			for($i=0;$i<count($saddress);$i++)
+			{
+				$sar .= $saddress[$i].',';
+			}
+			$post['baddress'] = rtrim($bar,',');//卖家保障
+			$post['saddress'] = rtrim($sar,',');//卖家保障
+			$whlabel = $this->input->post('whlabel',true);
+			if($post['express'] == 2 && (stripos($post['name'],'&') !== false || stripos($post['name'],"'") !== false))
+			{
+				echo json_encode(array('msg'=>'USPS收件人或公司名不可用特殊符号!','success'=>false));exit;
+			}
+			if(strlen($post['client']) > 35 || strlen($post['name']) > 35)//收件人姓名或公司名不允许超过35位
+			{
+				echo json_encode(array('msg'=>'收件人姓名或公司名不可超过35个字符!','success'=>false));exit;
+			}
+			if(($post['express'] == '5' || $post['express'] == '24' || $post['express'] == '42' || $post['express'] == '31') && $post['country'] != 192)
+			{
+				echo json_encode(array('msg'=>'非美国无法选择Fedex、DHL官方-美国!','success'=>false));exit;
+			}
+			if($post['express'] == '3' && $post['country'] != 192 && $post['country'] != 35)
+			{
+				echo json_encode(array('msg'=>'非美国和加拿大无法选择UPS!','success'=>false));exit;
+			}
+			if($post['express'] == '3' && $post['country'] == 35 && $post['zsbjz'] > 20)
+			{
+				echo json_encode(array('msg'=>'UPS加拿大最高申报不可超过20','success'=>false));exit;
+			}
+			if($post['express'] == '2' && $post['warehouse'] != 5)
+			{
+				echo json_encode(array('msg'=>'非美国仓无法选择USPS!','success'=>false));exit;
+			}
+			if($post['express'] == '99' && $post['bx'] > 0)
+			{
+				echo json_encode(array('msg'=>'此物流不允许购买保险','success'=>false));exit;
+			}
+			if($post['express'] == 42 && $post['sbpm'] != 'Human Hair Wigs' && $post['sbpm'] != 'Human Hair Goods')//$post['express'] == 3 || 
+			{
+				echo json_encode(array('msg'=>'此快递方式必须选择Human Hair Wigs/Human Hair Goods!','success'=>false));exit;
+			}
+			if($post['express'] == 24 && $post['sbpm'] != 'Hair Sample' && $post['sbpm'] != 'Human Hair Wigs' && $post['sbpm'] != 'Human Hair Goods')//$post['express'] == 3 || 
+			{
+				echo json_encode(array('msg'=>'此快递方式必须选择Hair Sample/Human Hair Wigs/Human Hair Goods!','success'=>false));exit;
+			}
+			if($post['country'] != 192 && $post['express'] == 1 && $post['sbpm'] != 'Synthetic Hair Wigs' && $post['sbpm'] != 'Synthetic Hair Goods')//$post['express'] == 3 || 
+			{
+				echo json_encode(array('msg'=>'非美国选择官方DHL必须选择Synthetic Hair Wigs/Synthetic Hair Goods','success'=>false));exit;
+			}
+			if($post['pay'] == '22' && ($post['paypal'] == '' || $post['guarantee'] == ''))
+			{
+				echo json_encode(array('msg'=>'交易号和卖家保障必须填写','success'=>false));exit;
+			}
+			if($post['pay'] == '23' && $post['paypal'] == '')
+			{
+				echo json_encode(array('msg'=>'交易号必须填写','success'=>false));exit;
+			}
+			if(empty($post['paypal'])){
+				echo json_encode(array('msg'=>'交易号必须填写','success'=>false));exit;
+			}
+			$express = $this->express->read($post['express']);
+			if($post['zsbjz'] > $express['sbjz'])
+			{
+				echo json_encode(array('msg'=>'总申报价值不可超出'.$express['sbjz'],'success'=>false));exit;
+			}
+			if($post['shouldmoney'] > $express['shouldmoney'] && $express['shouldmoney'] != 0)
+			{
+				echo json_encode(array('msg'=>'订单金额不可超出'.$express['shouldmoney'],'success'=>false));exit;
+			}
+			if($express['ioss'] == 1 && $post['ioss'] == '')
+			{
+				 echo json_encode(array('msg'=>'此快递方式必须选择IOSS!','success'=>false));exit;
+			}
+			if(strlen($post['address']) > $express['addresssize'] || strlen($post['address2']) > $express['addresssize'])
+			{
+				echo json_encode(array('msg'=>'此快递方地址不可超出'.$express['addresssize'].'个字符','success'=>false));exit;
+			}
+			if(strlen($post['address']) < 5)
+			{
+				echo json_encode(array('msg'=>'地址不可留空!','success'=>false));exit;
+			}
+			if($post['express'] == '2' && $post['zzl'] > '16' && $post['js'] == '0')
+			{
+				echo json_encode(array('msg'=>'重量大于16不可按Ground Advantage提交!','success'=>false));exit;
+			}
+			if($post['express'] == '2' && isset($post['js']) && $post['js'] == '0'&& $post['qm'] == '1')
+			{
+				echo json_encode(array('msg'=>'Ground Advantage不可使用签名服务!','success'=>false));exit;
+			}
+			if(($post['express'] == '3' || $post['express'] == '42' || $post['express'] == '24') && $post['shouldmoney'] < 1)
+			{
+				echo json_encode(array('msg'=>'零金额订单不可发 UPS/DHL官方-美国/Fedex(杭州)','success'=>false));exit;
+			}
+			if($post['express'] == '42' && $post['zsbjz'] < 1)
+			{
+				echo json_encode(array('msg'=>'零申报金额不可发 DHL官方-美国','success'=>false));exit;
+			}
+			if($post['express'] == '6' && $post['province'] == '')
+			{
+				echo json_encode(array('msg'=>'选择DPEX必须填写州信息','success'=>false));exit;
+			}
+
+
+			//仅独立站 地址美国对电话 10或者11位进行判断
+			if($post['country'] == 192){
+				if((strlen($post['phone'])!= 10) && (strlen($post['phone'])!= 11)){
+					echo json_encode(array('msg'=>'美国电话号码应为10/11位!','success'=>false));exit;
+				}
+			}
+
+			//减少代码复用吧
+			$lo_ret = $this->logic_order->checkEditCustomer($post);
+			if($lo_ret['code'] != 1){
+				echo json_encode(array('msg'=>$lo_ret['msg'],'success'=>false));exit;
+			}
+		
+			$dtctitle = array();
+			$dictionaries = $this->typeclass->find_all();
+			foreach ($dictionaries as $v)
+			{
+				$dtctitle[$v['id']] = array($v['title'],$v['bqsku']);
+			}
+			$fpdata = $post['fpdata'];
+			if(stripos($fpdata,'-128-') !== false || stripos($fpdata,'-127-') !== false)
+			{
+			    $dfp =  explode(';',trim($fpdata,';'));
+			    $fdata = '';
+			    foreach ($dfp as $k=>$v)
+			    {
+				    $ptitleb = '';
+				    $fp = explode('|',trim($v,'|'));
+				    $fp0 = explode(',',$fp[0]);
+					if(isset($fp0[1]))
+					{
+				        $fp1 = explode('-',trim($fp0[1],'-'));
+					}
+					else
+					{
+						$fp1 = explode('-',trim($fp[0],'-'));
+					}
+				    foreach ($fp1 as $vv)
+				    {
+					    $ptitleb .= isset($dtctitle[$vv])?$dtctitle[$vv][0].' ':'';
+				    }
+					if(isset($fp0[1]))
+					{
+				         $ptitleb .= $dtctitle[$fp0[0]][1].'inch ';
+				         $fp[1] = $ptitleb;
+					}
+				    $fdata .= implode("|",$fp).";";
+			    }
+			    $fpdata = $fdata;
+			}
+			
+			$warehouse = $this->warehouse->read($post['type']);
+			if($warehouse['bdcountry'] != 0 && $post['country'] != $warehouse['bdcountry'])
+			{
+				echo json_encode(array('msg'=>'当前国家无法选择'.$warehouse['title'].'!','success'=>false));exit;
+			}
+			    $kcyz = $this->ck->get_kc($post['state'],$warehouse,$post['shop'],$post['number'],$whlabel,$fpdata);
+			    if($kcyz['t'] > '0')
+			    {
+					echo $kcyz['m'];exit;
+			    }
+			    else if($kcyz['fpdata'] != '')
+			    {
+				    $post['whlabel'] = $kcyz['whlabel'];
+				    $post['fpdata'] = $kcyz['fpdata'];
+			    }
+				$fl = $this->ck->get_fl($warehouse['hz'],$whlabel,$fpdata);
+				$post['sfxh'] = $fl['sfxh'];
+				$post['ckfl'] = $fl['ckfl'];
+				
+				//查询净重开始
+			$post['jweight'] = $this->weight->get_weightcx($post['fpdata']);
+			//查询净重结束
+					$cusnum = $this->customer->read($customerid);
+					$this->customer->save(array('num'=>$cusnum['num']+1,'time'=>$post['buytime']),$customerid);
+					unset($post['id']);
+					$this->fullorder->insert($post);
+					echo json_encode(array('msg'=>'下单成功','success'=>true));exit;	
+		}
+		$customer = [
+      "shop"=>'28',
+      "source"=>10,
+      'name'=>"何总客户",
+      'province'=>'河南省',
+      'city'=>"许昌市",
+      'street'=>"",
+      'zipcode'=>"461000",
+      'al'=>"",
+      'phone'=>"15393779998",
+      'email'=>"hzkh@xcly.com",
+      'country'=>"41",
+      "express"=>"14",
+      "address"=>"建安区英豪路与滨河路交叉路口往东约50米路北 龙盈实业(客户自提)",
+    ];
+    
+		$this->data['customer'] = $customer;
+		$country = $this->country->find_all('1=1','id,name','name asc');//国家
+		$this->data['country'] = $country;
+		$express = $this->express->find_all();//物流商
+		$this->data['express'] = $express;
+		$bm = $this->country->read($customer['country']);
+		$this->data['bm'] = $bm;
+		$wlshop = $this->shop->find_all('1=1 and '.rtrim($sid,'or'));
+		$this->data['wlshop'] = $wlshop;
+		$this->data['user'] = $u['userid'];
+		$this->_Template('fullorderabf_yjtj',$this->data);
+
+  }
+}

+ 560 - 0
template/erp/fullorderabf_yjtj.html

@@ -0,0 +1,560 @@
+{Template header}
+
+<style>
+.isjiaji{
+	color:red;
+	font-size:20px;
+	font-weight: bold;
+	padding:10px
+}
+.isjiaji_hid{
+	display: none;
+}
+</style>
+<body>
+<div class="warp">
+<div class="packing">
+<div class="control">
+<a href="javascript:void(0);" class="exptj">添 加</a>
+<a href="javascript:void(0);" class="expxg">修 改</a>
+<a href="javascript:void(0);" class="expsc">删 除</a>
+{if $user == 'admin' || $user == 'PIFA'}
+<a href="javascript:void(0);" class="window2" data-h="/specialstock/order" data-t="库存选择">库存选择</a>
+{/if}
+</div>
+<table class="datatitle data" border="0" style="border-collapse:collapse;">
+<tr>
+<td>商品名称</td>
+<td>数量</td>
+<td class="none">单价</td>
+<td class="none">总价</td>
+<td class="none">币种</td>
+<td class="none"></td>
+<td class="none"></td>
+<td class="none"></td>
+<td class="none"></td>
+<td class="none"></td>
+<td class="none"></td>
+<td>操作</td>
+</tr>
+</table>
+<table class="datatext data" border="0" style="border-collapse:collapse;">
+{loop $fpdata as $val}
+<tr data-list="{$val['0']}">
+<td>{$val['1']}</td>
+<td>{$val['2']}</td>
+<td class="none">{$val['3']}</td>
+<td class="none">{$val['4']}</td>
+<td class="none">CNY</td>
+<td class="none">{$val['5']}</td>
+<td class="none">{$val['6']}</td>
+<td class="none">{$val['7']}</td>
+<td class="none">{$val['8']}</td>
+<td class="none val9">{if isset($val['9'])}{$val['9']}{else}0{/if}</td>
+<td class="czzd">{if $val['9'] != 'DNOTO'}<font class="jzzd">禁止占单</font>{else}<font class="yxzd">允许占单<font>{/if}</td>
+</tr>
+{/loop}
+</table>
+</div>
+
+<ul class="setting">
+<div class="need">
+<li>
+<em>订单号:</em>
+<input name="orderinfo" value="" type="text" readonly style="background-color: #ebebe4;">
+</li>
+
+<li>
+<em>线下单类型:</em>
+<select name="sourcetype" class="select class">
+<option value="1">网红单</option>
+<option value="2">批发单</option>
+<option value="3">线下单</option>
+<option value="4">售后单</option>
+<option value="5">其它</option>
+</select>
+</li>
+
+<li>
+<em>发货仓库:</em>
+<select name="warehouse" id="warehouse" class="select class">
+{loop warehouse(100) as $val}
+<option value="{$val['id']}" data-e="{$val['express']}">{$val['title']}</option>
+{/loop}</select>
+</li>
+
+<li>
+<em>结算币种:</em>
+<select name="currency" id="currency" class="select class">
+{loop typeclass(30) as $val}
+<option value="{$val['id']}" {if $val['id'] == '219'}selected="selected"{/if}>{$val['title']}</option>
+{/loop}
+</select>
+</li>
+
+<li>
+<em>资金状态:</em>
+<select name="capital" class="select class">
+<option value="3" {if $fullorder['capital'] == 3}selected="selected"{/if}>全部支付</option>
+<option value="1" {if $fullorder['capital'] == 1}selected="selected"{/if}>暂未支付</option>
+<option value="2" {if $fullorder['capital'] == 2}selected="selected"{/if}>部分支付</option>
+</select>
+</li>
+
+<li>
+<em>所属店铺:</em>
+<select name="shop" class="select class">
+{loop usershop() as $val}
+<option value="{$val['id']}" {if $customer['shop'] == $val['id']}selected="selected"{/if}>{$val['shopname']}</option>
+{/loop}</select>
+</li>
+
+<li>
+<em>订单金额:</em>
+<input name="shouldmoney" class="must currencymoney" value="" type="text" {if $fullorder['shouldmoney'] > 200}style="color:#F00"{/if}> <font class="currency">CNY</font>
+</li>
+
+
+<li class="none">
+<em>运费:</em>
+<input name="freight" class="must currencymoney" value="0" type="text"> <font class="currency">CNY</font>
+</li>
+
+<li class="none">
+<em>物流金额:</em>
+<input name="expressmoney" class="must currencymoney" value="0" type="text"> <font class="currency">CNY</font>
+</li>
+
+<li>
+<em>丢件险:</em>
+<input name="insurance" class="must currencymoney" value="0" type="text"> <font class="currency">CNY</font>
+</li>
+
+<li class="length remark">
+<em>产品标题:</em>
+<textarea class="must" name="product"></textarea>
+</li>
+
+<li>
+<em>交易号:</em>
+<input name="paypal" value="" type="text">
+</li>
+
+<li>
+<em>卖家保障:</em>
+<input name="guarantee" value="" type="text">
+</li>
+
+<li class="lengththree">
+<em>支付方式:</em>
+<select name="pay" class="select class">
+{loop typeclass(4,3,100) as $val}
+<option value="{$val['id']}">{$val['title']}</option>
+{/loop}</select>
+</li>
+
+<li class="lengththree">
+<em>Quantity:</em>
+<input class="must" name="quantity" value="" type="text">
+</li>
+
+<li class="lengththree">
+<em>付款时间:</em>
+<input id="buytime" class="must" value="" name="buytime" type="text" >
+<i class="time fa fa-calendar fa-lg"></i>
+</li>
+
+<li class="length remark">
+<em>订单备注:</em>
+<textarea name="orderremarks"></textarea>
+</li>
+
+<li class="length remark">
+<em>仓库品名:</em>
+<textarea class="must" name="shipremarks"></textarea>
+</li>
+<li class="length remark">
+	<em>是否加急:</em>
+	<select id="is_jiaji_id" name="is_jiaji" class="select" >
+	<option value="0" selected="selected">否</option>
+	<option value="1" >是</option>
+	</select>
+	
+	<span id="isjiaji_flag" class="isjiaji  {if $fullorderamz['is_jiaji'] == 0} isjiaji_hid{/if}">*</span>
+	
+</li>
+<li>
+<em>Bill Name:</em>
+<input name="bname" class="must" value="{$customer['name']}" type="text">
+</li>
+
+<li>
+<em>Ship Name:</em>
+<input name="sname" class="must" value="{$customer['name']}" type="text">
+</li>
+
+<li class="length remark">
+<em>Bill Address:</em>
+<input class="must" name="baddress" value="{$customer['address']},{$customer['city']},{$customer['province']},{$customer['zipcode']},{$bm['al']},{$customer['phone']}" type="text">
+</li>
+
+<li class="length remark">
+<em>Ship Address:</em>
+<input class="must" name="saddress" value="{$customer['address']},{$customer['city']},{$customer['province']},{$customer['zipcode']},{$bm['al']},{$customer['phone']}" type="text">
+</li>
+
+<li>
+<em>邮箱:</em>
+<input class="must" name="email" value="{$customer['email']}" type="text">
+</li>
+
+<li>
+<em>国家:</em>
+<select name="country" class="select class">
+{loop $country as $val}
+<option value="{$val['id']}" {if $customer['country'] == $val['id']}selected="selected"{/if}>{$val['name']}</option>
+{/loop}
+</select>
+</li>
+
+<li>
+<em>联系方式:</em>
+<input name="phone" class="must" value="{$customer['phone']}" type="text">
+</li>
+
+<li>
+<em>省州:</em>
+<input class="must" value="{$customer['province']}" name="province" type="text">
+</li>
+
+<li>
+<em>公司名:</em>
+<input class="must" name="client" value="{$customer['name']}" type="text">
+</li>
+
+<li>
+<em>城市:</em>
+<input class="must" value="{$customer['city']}" name="city" type="text">
+</li>
+
+<li>
+<em>收货人姓名:</em>
+<input name="name" class="must" value="{$customer['name']}" type="text">
+</li>
+
+<li>
+<em>邮编:</em>
+<input value="{$customer['zipcode']}" name="zipcode" type="text">
+</li>
+
+{if $is == 5}
+<!--
+<li class="length">
+<em>街道:</em>
+<input value="{$customer['street']}" name="street" type="text">
+</li>
+-->
+{/if}
+<li class="length">
+<em>地址2:</em>
+<input value="{$customer['address2']}" name="address2" type="text">
+</li>
+
+<li class="length">
+<em>地址1:</em>
+<input value="{$customer['address']}" name="address" type="text">
+</li>
+
+<li class="lengththree">
+<em>申报品名:</em>
+<select name="sbpm" class="select class">
+{loop customsdeclaration(50) as $val}
+<option value="{$val['ename']}">{$val['ename']}</option>
+{/loop}
+</select>
+</li>
+
+<li class="lengththree">
+<em>中文品名:</em>
+<select name="zwpm" class="select class">
+{loop customsdeclaration(50) as $val}
+<option value="{$val['zname']}">{$val['zname']}</option>
+{/loop}
+</select>
+</li>
+
+<li class="lengththree">
+<em>海关编码:</em>
+<select name="hgbm" class="select class">
+{loop customsdeclaration(50) as $val}
+<option value="{$val['bname']}">{$val['bname']}</option>
+{/loop}
+</select>
+</li>
+
+<li class="lengththree">
+<em>条数:</em>
+<input name="ts" class="must" value="1" type="text">
+</li>
+
+<li class="lengththree">
+<em>单条申报价:</em>
+<input name="dtsbjz" class="must" value="1" type="text">
+</li>
+
+<li class="lengththree">
+<em>总申报价:</em>
+<input name="zsbjz" class="must" value="1" type="text">
+</li>
+
+<li class="lengththree">
+<em>总重量:</em>
+<input name="zzl" class="must" value="0.4" type="text">
+</li>
+
+
+<li class="lengththree">
+<em>总件数:</em>
+<input name="zjs" class="must" value="1" type="text" readonly style="background-color: #ebebe4;">
+</li>
+
+<li class="lengththree">
+<em>快递方式:</em>
+<select name="express" class="select class">
+{loop express(100) as $val}
+<option value="{$val['id']}" data-type="{$val['type']}" {if $customer['express'] == $val['id']}selected="selected"{/if}>{$val['servicename']}</option>
+{/loop}
+</select>
+</li>
+
+<li class="lengththree">
+<em>打印类型:</em>
+<select name="printtype" class="printtype select class">
+<option value="1">运单</option>
+<option value="2">发货单</option>
+<option value="3">不打印单据</option>
+</select>
+</li>
+
+<li class="lengththree">
+<div class="none">
+<em>发送留言:</em>
+<select name="msg" class="printtype select class">
+<option value="1">1</option>
+<option value="2">2</option>
+</select>
+</div>
+</li>
+
+<li class="lengththree">
+<em>IOSS:</em>
+<select name="ioss" class="select class">
+<option value="">未选择</option>
+{loop ioss(100) as $val}
+<option value="{$val['ioss']}">{$val['title']}</option>
+{/loop}
+</select>
+</li>
+
+<li class="lengththree">
+<em>购买保险:</em>
+<input name="bx" class="must" value="{if $fullorder['bx']}{$fullorder['bx']}{else}0.00{/if}" type="text"> USD
+</li>
+
+<li class="lengththree">
+<em>是否签名:</em>
+<select name="qm" class="printtype select class">
+<option value="0">不需要</option>
+<option value="1">需要</option>
+</select>
+</li>
+
+<li class="lengththree">
+<em>服务类型:</em>
+<select name="js" class="printtype select class">
+<option value="0" {if $fullorder['js'] == 0}selected="selected"{/if}>Ground Advantage</option>
+<option value="1" {if $fullorder['js'] == 1}selected="selected"{/if}>PRIORITY</option>
+<option value="2" {if $fullorder['js'] == 2}selected="selected"{/if}>EXPRESS</option>
+</select>
+</li>
+
+<li class="lengththree none">
+<em>延迟发货:</em>
+<select name="yc" class="printtype select class">
+<option value="0" {if $fullorder['yc'] == 0}selected="selected"{/if}>0</option>
+<option value="1" {if $fullorder['yc'] == 1}selected="selected"{/if}>1</option>
+<option value="2" {if $fullorder['yc'] == 2}selected="selected"{/if}>2</option>
+<option value="3" {if $fullorder['yc'] == 3}selected="selected"{/if}>3</option>
+<option value="4" {if $fullorder['yc'] == 4}selected="selected"{/if}>4</option>
+<option value="5" {if $fullorder['yc'] == 5}selected="selected"{/if}>5</option>
+<option value="6" {if $fullorder['yc'] == 6}selected="selected"{/if}>6</option>
+<option value="7" {if $fullorder['yc'] == 7}selected="selected"{/if}>7</option>
+</select>
+ 天
+</li>
+<!--
+<li class="productdescription none">
+<em>产品描述:</em>
+<select name="productdescription" class="select class">
+</select>
+</li>
+
+<li class="customs none">
+<em>海关价值:</em>
+<input value="" name="customs" type="text"> <font class="currency">CNY</font>
+</li>
+-->
+
+</div>
+<div style="clear:both;"></div>
+</ul>
+<div class="need"><input type="hidden" name="id" value="" />
+<input type="hidden" name="purchase" value="" />
+<input type="hidden" name="cost" value="" />
+<input type="hidden" name="et" value="{isset($et) ?$et : '0'}" />
+<input type="hidden" name="jgyc" value="1" />
+<input type="hidden" name="customerid" value="{$customer['id']}" />
+<input type="hidden" name="shop" value="{$customer['shop']}" />
+<input type="hidden" name="mdedit" value="" />
+</div>
+<div class="button"><font class="yzaddress" style="margin-right:160px;">USPS验证地址</font> <font class="fullorderdata-ts">保 存</font> <font class="fh">关 闭</font></div>
+</div>
+
+<div class="none fullorderdata"></div>
+<div class="zm none"></div>
+<script type="text/javascript">
+var addedit="/customer/mdedit/";
+var fh="/fullorder";
+$(document).ready(function() { 
+if($("select[name='express']").find("option:selected").val() == '24')//联邦的话替换签名选项
+		{
+			 $("select[name='qm']").html('<option value="0" {if $fullorder["qm"] == 0}selected="selected"{/if}>默认</option><option value="1" {if $fullorder["qm"] == 1}selected="selected"{/if}>成人签名</option>');
+		}
+		else
+		{
+			 $("select[name='qm']").html('<option value="0" {if $fullorder["qm"] == 0}selected="selected"{/if}>不需要</option><option value="1" {if $fullorder["qm"] == 1}selected="selected"{/if}>需要</option>');
+		}
+$("#buytime").calendar();$("#buytimeCalendar").css('position','absolute')
+ var index = $("#currency").find("option:selected").text();
+	$(".currency").text(index);
+	 $(".datatext tr").each(function() {
+	$(this).find("td:eq(9)").text(index);
+	//currencymoney需要更改的价格
+		});
+custom();
+var index = $("select[name='printtype']").find("option:selected").index();
+		if(index == 0)
+	    {
+		var e = $("select[name=express]").find("option:selected").val();
+		var c = $("select[name=country]").find("option:selected").val();
+		 $.ajax({
+        url: "/fullorder/customs/",
+        data: "e="+e+"&c="+c,
+        type: "POST",
+        dataType: "json",
+        success: function(a) {
+            if (a && a.success) {
+				$("input[name=customs]").val(a.money);
+				for(i=0;i<a.msg.length;i++)
+	           {
+				$("select[name=productdescription]").append("<option value='"+a.msg[i]['id']+"'>"+a.msg[i]['title']+"</option>");
+			   }
+				$(".productdescription").show();
+				$(".customs").show();
+            } else {
+				$(".productdescription").hide();
+				$(".customs").hide();
+            }
+        }
+    });
+		
+	}else
+		{
+			$(".productdescription").hide();
+				$(".customs").hide();
+		}
+});
+function custom() {
+var num = $('.packing .datatitle tr').children().length;
+$('.data tr td').css("width","5%");
+$(".data tr").each(function() {
+$(this).find('td:eq(0)').css("width","30%");
+});}
+//监听input开始
+$("input[name=dtsbjz]").bind("input propertychange",function(event){
+	var ts = $("input[name=ts]").val()*1;
+	var dtsbjz = $("input[name=dtsbjz]").val()*1;
+	var num = ts*dtsbjz;
+      console.log($("input[name=zsbjz]").val(num.toFixed(2)))
+});
+$("input[name=ts]").bind("input propertychange",function(event){
+	var ts = $("input[name=ts]").val()*1;
+	var dtsbjz = $("input[name=dtsbjz]").val()*1;
+	var num = ts*dtsbjz;
+      console.log($("input[name=zsbjz]").val(num.toFixed(2)))
+});
+//监听input结束
+$(".window2").click(function() {
+var h = $(this).data("h");var t = $(this).data("t");
+window.parent.window2(t,h);
+	});
+	
+  $('.fullorderdata-ts').click(function()
+{
+	var tjje = $("input[name='shouldmoney']").val();
+	var tjwl = $("select[name='express']").children("option:selected").val();
+	var tjqm = $("select[name='qm']").children("option:selected").val();
+	var fwlx = $("select[name='js']").children("option:selected").val();
+	if(tjje > 750 && (tjwl == 24 || tjwl == 31 || tjwl == 2) && tjqm != 1)
+	{
+		layx.confirm('提示','此金额和物流可以选择购买“签名”服务',null,{
+    buttons:[
+        {
+            label:'操作签名',
+            callback:function(id, button, event){
+                layx.destroy(id);
+            }
+        },
+        {
+            label:'保存信息',
+            callback:function(id, button, event){
+             $('.fullorderdata').click();
+                layx.destroy(id);
+            }
+        }
+    ]
+});
+	}
+	else if(fwlx == 2)
+	{
+		layx.confirm('提示','确定要发“收费加急”吗?(请提前收取加急运费)',null,{
+    buttons:[
+        {
+            label:'确定',
+            callback:function(id, button, event){
+				 $('.fullorderdata').click();
+                layx.destroy(id);
+            }
+        },
+        {
+            label:'取消',
+            callback:function(id, button, event){
+                layx.destroy(id);
+            }
+        }
+    ]
+});
+	}
+	else
+	{
+		 $('.fullorderdata').click();
+	}
+});
+
+$("#is_jiaji_id").on('change',function(){
+	$("#isjiaji_flag").toggle()
+});
+</script>
+<script type="text/javascript" src="{$theme}js/time.js"></script>
+<script src="{$theme}js/fullorder-addedit.js?v=202309060001"></script>
+{Template footer}