Commit 9abdda59 by 孙龙

up

parent daa6b500
...@@ -29,7 +29,7 @@ class BomItemModel extends BomItemMatchBaseModel{ ...@@ -29,7 +29,7 @@ class BomItemModel extends BomItemMatchBaseModel{
$page = $request->input("page",1); $page = $request->input("page",1);
$limit = $request->input("limit",10); $limit = $request->input("limit",10);
$suffix = substr(strrev($bom_id),0,1); $suffix = substr(strrev($bom_id),0,1);
$query = self::suffix($suffix)->select("*")->where('bom_id', $bom_id); $query = self::suffix($suffix)->select("*")->where('bom_id', $bom_id)->where(["del_status"=>1]);
$query = $query->paginate($limit,[],'page',$page); $query = $query->paginate($limit,[],'page',$page);
return $query; return $query;
} }
......
...@@ -52,8 +52,10 @@ class BomService { ...@@ -52,8 +52,10 @@ class BomService {
list($role_id,$sale_ids) = $this->getRole($request); list($role_id,$sale_ids) = $this->getRole($request);
// dump($role_id);
// dump($sale_ids);
$query = BomModel::select("*")->with("bomExtend")->SearchByUserNameOrKefu($username,$is_kefu) $query = BomModel::select("*")->where(["status"=>1])->with("bomExtend")->SearchByUserNameOrKefu($username,$is_kefu)
->SearchByBomName($bom_name)->SearchByIsCorder($is_corder)->SearchByTime($begin_time,$end_time) ->SearchByBomName($bom_name)->SearchByIsCorder($is_corder)->SearchByTime($begin_time,$end_time)
->SearchByrole($role_id,$sale_ids) ->SearchByrole($role_id,$sale_ids)
->orderBy("bom_id","desc"); ->orderBy("bom_id","desc");
...@@ -189,6 +191,8 @@ class BomService { ...@@ -189,6 +191,8 @@ class BomService {
$num = $num - intval($modNum); $num = $num - intval($modNum);
} }
$data = [ $data = [
"goods_id"=>$goodsInfo['goods_id'], "goods_id"=>$goodsInfo['goods_id'],
"goods_name"=>$goodsInfo['goods_name'], "goods_name"=>$goodsInfo['goods_name'],
...@@ -237,6 +241,16 @@ class BomService { ...@@ -237,6 +241,16 @@ class BomService {
$num = $num - intval($modNum); $num = $num - intval($modNum);
} }
//货期
try{
$delivery_time = $goodsInfo['delivery_time'];
if(is_array($delivery_time) && count($delivery_time) == 2){
$delivery_time = $delivery_time[$extend['delivery_type']];
}
}catch(\Exception $e){
$delivery_time = "";
}
$data = [ $data = [
"bom_id"=>$bom_item_matching['bom_id'], "bom_id"=>$bom_item_matching['bom_id'],
"bom_item_id"=>$bom_item_matching['bom_item_id'], "bom_item_id"=>$bom_item_matching['bom_item_id'],
...@@ -247,7 +261,7 @@ class BomService { ...@@ -247,7 +261,7 @@ class BomService {
"goods_type"=>static::$GOODSTYPE[$goodsInfo['goods_type']], "goods_type"=>static::$GOODSTYPE[$goodsInfo['goods_type']],
"supplier_id"=>$goodsInfo['supplier_id'], "supplier_id"=>$goodsInfo['supplier_id'],
"supplier_name"=>$goodsInfo['supplier_name'], "supplier_name"=>$goodsInfo['supplier_name'],
"delivery"=>$goodsInfo['delivery_time'], "delivery"=>$delivery_time,
"delivery_type"=>$extend['delivery_type'],//交货类型 "delivery_type"=>$extend['delivery_type'],//交货类型
"number"=>$num, "number"=>$num,
"price"=>$goods_prices['price'], "price"=>$goods_prices['price'],
...@@ -368,6 +382,7 @@ class BomService { ...@@ -368,6 +382,7 @@ class BomService {
$extend["currency"] = $currency; $extend["currency"] = $currency;
foreach($data as $k=>$item){ foreach($data as $k=>$item){
// dump($item);exit;
//已下单的不能修改 //已下单的不能修改
if(isset($item['match_is_corder']) && $item['match_is_corder'] == 1){ if(isset($item['match_is_corder']) && $item['match_is_corder'] == 1){
// array_push($err_msg,sprintf("第%s个型号已下单,无法更改;",$k)); // array_push($err_msg,sprintf("第%s个型号已下单,无法更改;",$k));
...@@ -398,6 +413,7 @@ class BomService { ...@@ -398,6 +413,7 @@ class BomService {
continue; continue;
} }
}else{ }else{
//新增 //新增
if($this->addBomItemMatchingBySearchApi($item,$res,$extend)){ if($this->addBomItemMatchingBySearchApi($item,$res,$extend)){
continue; continue;
...@@ -419,7 +435,8 @@ class BomService { ...@@ -419,7 +435,8 @@ class BomService {
}catch(BomException $e){ }catch(BomException $e){
return ['errcode'=>$e->getCode(),"errmsg"=>$e->getMessage()]; return ['errcode'=>$e->getCode(),"errmsg"=>$e->getMessage()];
}catch(\Exception $e){ }catch(\Exception $e){
return ['errcode'=>-1,"errmsg"=>$e->getMessage()];
return ['errcode'=>-1,"errmsg"=>sprintf("操作异常,请联系技术员 %s",$e->getMessage())];
} }
} }
...@@ -534,16 +551,16 @@ class BomService { ...@@ -534,16 +551,16 @@ class BomService {
$returnErrorMsg = ""; $returnErrorMsg = "";
if(isset($bk1)) if(isset($bk1))
$returnErrorMsg .= $bk1 ? "自营下单成功" : "自营下单失败"; $returnErrorMsg .= $bk1 ? "自营下单成功:\n<br/>" : "自营下单失败:\n<br/>";
if(isset($bk2)) if(isset($bk2))
$returnErrorMsg .= $bk2 ? "联营下单成功" : "联营下单失败"; $returnErrorMsg .= $bk2 ? "联营下单成功:\n<br/>" : "联营下单失败:\n<br/>";
if(!empty($err_msg)) if(!empty($err_msg))
$returnErrorMsg .= implode("\n",$err_msg); $returnErrorMsg .= implode("\n<br/>",$err_msg);
//dump($err_msg);
return ['errcode'=>0,"errmsg"=>$returnErrorMsg]; return ['errcode'=>0,"errmsg"=>$returnErrorMsg];
......
...@@ -47,48 +47,31 @@ ...@@ -47,48 +47,31 @@
<tr> <tr>
<th lay-data="">提交BOM单数量</th> <th lay-data="">提交BOM单数量</th>
<th lay-data="">BOM单数量</th> <th lay-data="">BOM单数量</th>
<th lay-data="">BOM付款数量</th> {{--<th lay-data="">BOM付款数量</th>--}}
<th lay-data="">提交型号数</th> <th lay-data="">提交型号数</th>
<th lay-data="">下单型号数</th> <th lay-data="">下单型号数</th>
<th lay-data=>付款型号数</th> {{--<th lay-data=>付款型号数</th>--}}
<th lay-data=>提交BOM金额</th> <th lay-data=>提交BOM金额</th>
<th lay-data=>下单BOM金额</th> <th lay-data=>下单BOM金额</th>
<th >无结果型号</th>
<th>询价型号数</th>
</tr> </tr>
<tr> <tr>
<th id="field1"></th> <th id="field1"></th>
<th id="field2"></th> <th id="field2"></th>
<th id="field3"></th> {{--<th id="field3"></th>--}}
<th id="field4"></th> <th id="field4"></th>
<th id="field5"></th> <th id="field5"></th>
<th id="field6"></th> {{--<th id="field6"></th>--}}
<th id="field7"></th> <th id="field7"></th>
<th id="field8"></th> <th id="field8"></th>
</tr>
<tr>
<th >付款BOM金额</th>
<th >无结果型号</th>
<th>询价型号数</th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr>
<tr>
<th id="field9"></th>
<th id="field10"></th> <th id="field10"></th>
<th id="field11"></th> <th id="field11"></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
</tr> </tr>
</table> </table>
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment