|
@@ -72,7 +72,18 @@ class OrderOutChild extends Model
|
|
{
|
|
{
|
|
if (empty($child)) throw new Exception("发货工单信息不能为空");
|
|
if (empty($child)) throw new Exception("发货工单信息不能为空");
|
|
$child['outChildCode'] = makeNo("TCD");
|
|
$child['outChildCode'] = makeNo("TCD");
|
|
- $childout = self::insert($child);
|
|
|
|
|
|
+ $childout = self::insertGetId($child);
|
|
|
|
+
|
|
|
|
+ //生成发货工单的流程数据
|
|
|
|
+ ProcessOrder::AddProcess(['id'=>request()->uid,'nickname'=>request()->uname], [
|
|
|
|
+ "order_type" => 'FHGD',
|
|
|
|
+ "order_code" => $child['outChildCode'],
|
|
|
|
+ "order_id" => $childout,
|
|
|
|
+ "order_status" => $child['status'],
|
|
|
|
+ "before_status" => 0,
|
|
|
|
+ 'holder_id'=>$child['apply_id'],
|
|
|
|
+ ]);
|
|
|
|
+
|
|
if ($childout == false) throw new \Exception("发货工单生成失败");
|
|
if ($childout == false) throw new \Exception("发货工单生成失败");
|
|
$bnadd = GoodStockInfo::ChildAddBn($child['outChildCode'], $wsm_id);
|
|
$bnadd = GoodStockInfo::ChildAddBn($child['outChildCode'], $wsm_id);
|
|
if ($bnadd == false) throw new \Exception("库存更新失败");
|
|
if ($bnadd == false) throw new \Exception("库存更新失败");
|
|
@@ -102,8 +113,19 @@ class OrderOutChild extends Model
|
|
$child['outChildCode'] = substr(makeNo("TCD"), 0, -3) . str_pad(strval($i), 3, '0', STR_PAD_LEFT);
|
|
$child['outChildCode'] = substr(makeNo("TCD"), 0, -3) . str_pad(strval($i), 3, '0', STR_PAD_LEFT);
|
|
$child['num'] = $val['desc_num'] ?? 0;
|
|
$child['num'] = $val['desc_num'] ?? 0;
|
|
$child['wsm_code'] = $val['wsm_code'];
|
|
$child['wsm_code'] = $val['wsm_code'];
|
|
- $childout = self::insert($child);
|
|
|
|
|
|
+ $childout = self::insertGetId($child);
|
|
if ($childout == false) throw new \Exception("工单生成失败");
|
|
if ($childout == false) throw new \Exception("工单生成失败");
|
|
|
|
+
|
|
|
|
+ //生成发货工单的流程数据
|
|
|
|
+ ProcessOrder::AddProcess(['id'=>request()->uid,'nickname'=>request()->uname], [
|
|
|
|
+ "order_type" => 'FHGD',
|
|
|
|
+ "order_code" => $child['outChildCode'],//出库单号
|
|
|
|
+ "order_id" => $childout,
|
|
|
|
+ "order_status" => $child['status'],
|
|
|
|
+ "before_status" => 0,
|
|
|
|
+ 'holder_id'=>$child['apply_id'],
|
|
|
|
+ ]);
|
|
|
|
+
|
|
$bnadd = GoodStockInfo::ChildAddBn($child['outChildCode'], intval($val['id']));
|
|
$bnadd = GoodStockInfo::ChildAddBn($child['outChildCode'], intval($val['id']));
|
|
if ($bnadd == false) throw new \Exception("库存更新失败");
|
|
if ($bnadd == false) throw new \Exception("库存更新失败");
|
|
}
|
|
}
|