|
@@ -2736,6 +2736,7 @@ class Sale extends Base
|
|
|
* @throws \think\db\exception\DbException
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
*/
|
|
|
+ //工差单审核
|
|
|
public function diffcheck()
|
|
|
{
|
|
|
$token = isset($this->post['token']) && $this->post['token'] !== "" ? trim($this->post['token']) : "";
|
|
@@ -3828,11 +3829,19 @@ class Sale extends Base
|
|
|
|
|
|
$good_data = [];
|
|
|
|
|
|
+ $temp_out_codes=[];
|
|
|
+
|
|
|
foreach ($param['list'] as $value) {
|
|
|
|
|
|
if (!isset($order_out_infos[$value['outCode']])) throw new Exception($value['outCode'] . '该发货单未找到或状态不允许发货');
|
|
|
|
|
|
if (!isset($sale_infos[$order_out_infos[$value['outCode']]['orderCode']])) throw new Exception($value['outCode'] . '该发货单对应的销售单未找到');
|
|
|
+
|
|
|
+ //判断发货单是否重复
|
|
|
+ if (isset($temp_out_codes[$value['outCode']])) {
|
|
|
+ Db::rollback();
|
|
|
+ return app_show(1005, '下列发货申请单号重复', $value);
|
|
|
+ } else $temp_out_codes[$value['outCode']] = $value['outCode'];
|
|
|
|
|
|
//【发货单】
|
|
|
//查询已有发货单信息及状态
|