Zzququeu9.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. <?php
  2. defined('BASEPATH') OR exit('No direct script access allowed');
  3. class Zzququeu9 extends Start_Controller {
  4. public function __construct(){
  5. parent::__construct();
  6. $this->load->library('session');
  7. $this->load->_model('Model_zzquque_u9','zzquque_u9');
  8. $this->load->_model("Model_logic_order","logic_order");
  9. $this->load->_model("Model_logic_u9xgsd","logic_u9xgsd");
  10. $this->load->_model('Model_zzququeu9_logs','zzququeu9_logs');
  11. }
  12. public function _remap($arg,$arg_array)
  13. {
  14. if($arg == 'dc')//调出单
  15. {
  16. $this->_dc($arg_array);
  17. }
  18. elseif($arg == 'cg')//采购
  19. {
  20. $this->_cg($arg_array);
  21. }
  22. elseif($arg == 'xs')//销售单
  23. {
  24. $this->_xs($arg_array);
  25. }
  26. elseif($arg == 'bzch')//标准出货
  27. {
  28. $this->_bzch($arg_array);
  29. }
  30. elseif($arg == 'bzsh')//标准收货
  31. {
  32. $this->_bzsh($arg_array);
  33. }
  34. elseif($arg == 'dr')//调入单
  35. {
  36. $this->_dr($arg_array);
  37. }
  38. elseif($arg == 'xs_two')//调入单
  39. {
  40. $this->_xs_two($arg_array);
  41. }
  42. elseif($arg == 'add'){
  43. $this->_add();
  44. }
  45. else
  46. {
  47. $this->_index();
  48. }
  49. }
  50. public function _index(){
  51. $post = $this->input->post(NULL, TRUE);
  52. if(isset($post['page']))
  53. {
  54. $page = $this->input->post('page',true);
  55. $perpage = $this->input->post('perpage',true);
  56. $timetk = $this->input->post('timetk',true);//订单开始时间
  57. $timetj = $this->input->post('timetj',true);//订单结束时间
  58. $timetk = strtotime($timetk);
  59. $timetj = strtotime($timetj);
  60. $order_no = $this->input->post('order_no',true);
  61. $where='type = 10 ';
  62. if($order_no){
  63. $where .= " and order_no = '".$order_no."' ";
  64. }
  65. if($timetk && $timetj){
  66. $where .= " and create_time > ".$timetk." and create_time < ".$timetj." ";
  67. }
  68. if(empty($page))
  69. {
  70. $start = 0;
  71. $perpage = 1;
  72. }
  73. else
  74. {
  75. $start = ($page - 1)*$perpage;
  76. }
  77. $info_list = $this->zzquque_u9->find_all($where,'*','id asc',$start,$perpage);
  78. $type_list = $this->zzquque_u9->getType();
  79. $list = [];
  80. foreach($info_list as $k=>$v){
  81. $dc_no = "";
  82. if($v['dc_status'] == 0){
  83. $dc_no = "<span data-action='dc' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调出单</span>";
  84. }elseif($v['dc_status'] == -1){
  85. $error = $this->zzququeu9_logs->find_all("oid = ".$v['id']." and one_type = 1 and two_type = 1 ","*",'id desc',0,1);
  86. if($error[0]['apply_api']=='lpck'){
  87. $ret_data = json_decode($error[0]['ret_data'],true);
  88. if(isset($ret_data[0]["ResMsg"])){
  89. $tmp_str = $ret_data[0]["ResMsg"];
  90. }else{
  91. $tmp_str = "料品同步失败";
  92. }
  93. }else{
  94. $tmp_str = "创建调出单失败";
  95. }
  96. $dc_no = "<span data-action='dc' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调出单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="'.$tmp_str.'"></i><p>';
  97. }
  98. if(!empty($v['dc_no'])){
  99. $dc_no = $v['dc_no']."<br/>".$dc_no;
  100. }
  101. $cg_no = "";
  102. if($v['cg_status'] == 0){
  103. $cg_no .= "<span data-action='cg' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建采购单</span>";
  104. }elseif($v['cg_status'] == 1){
  105. $cg_no .= "<span data-action='cg' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交采购单</span>";
  106. }elseif($v['cg_status'] == -1){
  107. $cg_no .= "<span data-action='cg' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建采购单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="采购单创建失败"></i><p>';
  108. }elseif($v['cg_status'] == 2){
  109. $cg_no .= "<span data-action='cg' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核采购单</span>";
  110. }elseif($v['cg_status'] == -2){
  111. $cg_no .= "<span data-action='cg' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交采购单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="采购单提交失败"></i><p>';
  112. }elseif($v['cg_status'] == -3){
  113. $cg_no .= "<span data-action='cg' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核采购单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="采购单审核失败"></i><p>';
  114. }
  115. if(!empty($v['cg_no'])){
  116. $cg_no = $v['cg_no']."<br/>".$cg_no;
  117. }
  118. $xs_no = "";
  119. if($v['xs_status'] == 0){
  120. $xs_no .= "<span data-action='xs' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>";
  121. }elseif($v['xs_status'] == 1){
  122. $xs_no .= "<span data-action='xs' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>";
  123. }elseif($v['xs_status'] == -1){
  124. $xs_no .= "<span data-action='xs' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="销售单创建失败"></i><p>';
  125. }elseif($v['xs_status'] == 2){
  126. $xs_no .= "<span data-action='xs' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>";
  127. }elseif($v['xs_status'] == -2){
  128. $xs_no .= "<span data-action='xs' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="销售单提交失败"></i><p>';
  129. }elseif($v['xs_status'] == -3){
  130. $xs_no .= "<span data-action='xs' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="销售单审核失败"></i><p>';
  131. }
  132. if(!empty($v['xs_no'])){
  133. $xs_no = $v['xs_no']."<br/>".$xs_no;
  134. }
  135. $xs_two_no ='';
  136. if($v['xs_two_status'] == 0){
  137. $xs_two_no .= "<span data-action='xs_two' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>";
  138. }elseif($v['xs_two_status'] == 1){
  139. $xs_two_no .= "<span data-action='xs_two' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>";
  140. }elseif($v['xs_two_status'] == -1){
  141. $xs_two_no .= "<span data-action='xs_two' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建销售单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  142. }elseif($v['xs_two_status'] == 2){
  143. $xs_two_no .= "<span data-action='xs_two' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>";
  144. }elseif($v['xs_two_status'] == -2){
  145. $xs_two_no .= "<span data-action='xs_two' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交销售单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  146. }elseif($v['xs_two_status'] == -3){
  147. $xs_two_no .= "<span data-action='xs_two' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核销售单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  148. }
  149. if(!empty($v['xs_two_no'])){
  150. $xs_two_no = $v['xs_two_no']."<br/>".$xs_two_no;
  151. }
  152. $bzch_no ="";
  153. if($v['bzch_status'] == 0){
  154. $bzch_no .= "<span data-action='bzch' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建出货单</span>";
  155. }elseif($v['bzch_status'] == 1){
  156. $bzch_no .= "<span data-action='bzch' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交出货单</span>";
  157. }elseif($v['bzch_status'] == -1){
  158. $bzch_no .= "<span data-action='bzch' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建出货单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  159. }elseif($v['bzch_status'] == 2){
  160. $bzch_no .= "<span data-action='bzch' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核出货单</span>";
  161. }elseif($v['bzch_status'] == -2){
  162. $bzch_no .= "<span data-action='bzch' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交出货单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  163. }elseif($v['bzch_status'] == -3){
  164. $bzch_no .= "<span data-action='bzch' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核出货单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  165. }
  166. //$bzsh_no =empty($v['bzsh_no'])?"":$v['bzsh_no'];
  167. if(!empty($v['bzch_no'])){
  168. $bzch_no = $v['bzch_no']."<br/>".$bzch_no;
  169. }
  170. $dr_no = "";
  171. if($v['dr_status'] == 0){
  172. $dr_no .= "<span data-action='dr' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调入单</span>";
  173. }elseif($v['dr_status'] == 1){
  174. $dr_no .= "<span data-action='dr' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交调入单</span>";
  175. }elseif($v['dr_status'] == -1){
  176. $dr_no .= "<span data-action='dr' data-process='1' data-id='".$v['id']."' onclick='doAction(this)'>创建调入单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  177. }elseif($v['dr_status'] == 2){
  178. $dr_no .= "<span data-action='dr' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核调入单</span>";
  179. }elseif($v['dr_status'] == -2){
  180. $dr_no .= "<span data-action='dr' data-process='2' data-id='".$v['id']."' onclick='doAction(this)'>提交调入单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  181. }elseif($v['dr_status'] == -3){
  182. $dr_no .= "<span data-action='dr' data-process='3' data-id='".$v['id']."' onclick='doAction(this)'>审核调入单</span>".'<p style="color:blue"><i class="method fa fa-exclamation-circle" data-t="123"></i><p>';
  183. }
  184. if(!empty($v['dr_no'])){
  185. $dr_no = $v['dr_no']."<br/>".$dr_no;
  186. }
  187. $list[] = [
  188. 'id'=>$v['id'],
  189. 'order_no'=>$v['order_no'],
  190. 'type'=>isset($type_list[$v['type']])?$type_list[$v['type']]:"异常",
  191. 'dc_no'=> $dc_no,
  192. 'cg_no'=>$cg_no,
  193. 'xs_no'=>$xs_no,
  194. 'dr_no'=>$dr_no,
  195. 'xs_two_no'=>$xs_two_no,
  196. 'bzch_no'=>$bzch_no,
  197. //'bzsh_no'=>$bzsh_no,
  198. 'create_time'=>date("Y-m-d H:i:s",$v['create_time']),
  199. 'update_time'=>date("Y-m-d H:i:s",$v['update_time'])
  200. ];
  201. }
  202. $total = $this->zzquque_u9->find_count($where);
  203. $pagenum = ceil($total/$perpage);
  204. $over = $total-($start+$perpage);
  205. $rows = array('total'=>$total,'over'=>$over,'pagenum'=>$pagenum,'rows'=>($list));
  206. echo json_encode($rows);exit;
  207. }
  208. $this->_Template('zzququeu9',$this->data);
  209. }
  210. public function _dc($arg_array){
  211. $process= $arg_array[0];
  212. $id = $arg_array[1];
  213. $info = $this->zzquque_u9->read($id);
  214. if($process == 1){
  215. if(!in_array($info['dc_status'],[0,-1])){
  216. echo json_encode(array('msg'=>'当前状态不符合创建调出单的条件','success'=>false));
  217. exit;
  218. }
  219. $r = $this->logic_u9xgsd->createDc($info);
  220. if($r['code'] == 1){
  221. echo json_encode(array('msg'=>'创建调出单成功','success'=>true));
  222. exit;
  223. }else{
  224. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  225. exit;
  226. }
  227. }else if($process == 2){
  228. if(!in_array($info['dc_status'],[1,-2])){
  229. echo json_encode(array('msg'=>'当前状态不符合提交调出单的条件','success'=>false));
  230. exit;
  231. }
  232. $r = $this->logic_u9xgsd->subDc($info);
  233. if($r['code'] == 1){
  234. echo json_encode(array('msg'=>'提交调出单成功','success'=>true));
  235. exit;
  236. }else{
  237. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  238. exit;
  239. }
  240. }else if($process == 3){
  241. if(!in_array($info['dc_status'],[2,-3])){
  242. echo json_encode(array('msg'=>'当前状态不符合审核调出单的条件','success'=>false));
  243. exit;
  244. }
  245. $r = $this->logic_u9xgsd->shDc($info);
  246. if($r['code'] == 1){
  247. echo json_encode(array('msg'=>'审核调出单成功','success'=>true));
  248. exit;
  249. }else{
  250. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  251. exit;
  252. }
  253. }else{
  254. echo json_encode(array('msg'=>'当前状态不符合创建调出单的条件','success'=>false));
  255. exit;
  256. }
  257. }
  258. public function _cg($arg_array){
  259. $process= $arg_array[0];
  260. $id = $arg_array[1];
  261. $info = $this->zzquque_u9->read($id);
  262. if($process == 1){
  263. if(!in_array($info['cg_status'],[0,-1])){
  264. echo json_encode(array('msg'=>'当前状态不符合创建采购单的条件','success'=>false));
  265. exit;
  266. }
  267. var_dump(123);
  268. die;
  269. $r = $this->logic_u9xgsd->createCg($info);
  270. if($r['code'] == 1){
  271. echo json_encode(array('msg'=>'创建采购单成功','success'=>true));
  272. exit;
  273. }else{
  274. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  275. exit;
  276. }
  277. }else if($process == 2){
  278. if(!in_array($info['cg_status'],[1,-2])){
  279. echo json_encode(array('msg'=>'当前状态不符合提交采购单的条件','success'=>false));
  280. exit;
  281. }
  282. $r = $this->logic_u9xgsd->subCg($info);
  283. if($r['code'] == 1){
  284. echo json_encode(array('msg'=>'提交采购单成功','success'=>true));
  285. exit;
  286. }else{
  287. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  288. exit;
  289. }
  290. }else if($process == 3){
  291. if(!in_array($info['cg_status'],[2,-3])){
  292. echo json_encode(array('msg'=>'当前状态不符合审核采购单的条件','success'=>false));
  293. exit;
  294. }
  295. $r = $this->logic_u9xgsd->shCg($info);
  296. if($r['code'] == 1){
  297. echo json_encode(array('msg'=>'审核采购单成功','success'=>true));
  298. exit;
  299. }else{
  300. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  301. exit;
  302. }
  303. }else{
  304. echo json_encode(array('msg'=>'当前状态不符合创建采购单的条件','success'=>false));
  305. exit;
  306. }
  307. }
  308. public function _xs($arg_array){
  309. $process= $arg_array[0];
  310. $id = $arg_array[1];
  311. $info = $this->zzquque_u9->read($id);
  312. if($process == 1){
  313. if(!in_array($info['xs_status'],[0,-1])){
  314. echo json_encode(array('msg'=>'当前状态不符合创建销售单的条件','success'=>false));
  315. exit;
  316. }
  317. $r = $this->logic_u9xgsd->createXs($info);
  318. if($r['code'] == 1){
  319. echo json_encode(array('msg'=>'创建销售单成功','success'=>true));
  320. exit;
  321. }else{
  322. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  323. exit;
  324. }
  325. }else if($process == 2){
  326. if(!in_array($info['xs_status'],[1,-2])){
  327. echo json_encode(array('msg'=>'当前状态不符合提交销售单的条件','success'=>false));
  328. exit;
  329. }
  330. $r = $this->logic_u9xgsd->subXs($info);
  331. if($r['code'] == 1){
  332. echo json_encode(array('msg'=>'提交销售单成功','success'=>true));
  333. exit;
  334. }else{
  335. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  336. exit;
  337. }
  338. }else if($process == 3){
  339. if(!in_array($info['xs_status'],[2,-3])){
  340. echo json_encode(array('msg'=>'当前状态不符合审核销售单的条件','success'=>false));
  341. exit;
  342. }
  343. $r = $this->logic_u9xgsd->shXs($info);
  344. if($r['code'] == 1){
  345. echo json_encode(array('msg'=>'审核销售单成功','success'=>true));
  346. exit;
  347. }else{
  348. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  349. exit;
  350. }
  351. }else{
  352. echo json_encode(array('msg'=>'当前状态不符合创建销售单的条件','success'=>false));
  353. exit;
  354. }
  355. }
  356. public function _dr($arg_array){
  357. $process= $arg_array[0];
  358. $id = $arg_array[1];
  359. $info = $this->zzquque_u9->read($id);
  360. if($process == 1){
  361. if(!in_array($info['dr_status'],[0,-1])){
  362. echo json_encode(array('msg'=>'当前状态不符合查询调入单的条件','success'=>false));
  363. exit;
  364. }
  365. $r = $this->logic_u9xgsd->createDr($info);
  366. if($r['code'] == 1){
  367. echo json_encode(array('msg'=>'查询调入单成功','success'=>true));
  368. exit;
  369. }else{
  370. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  371. exit;
  372. }
  373. }else if($process == 2){
  374. if(!in_array($info['dr_status'],[1,-2])){
  375. echo json_encode(array('msg'=>'当前状态不符合提交调入单的条件','success'=>false));
  376. exit;
  377. }
  378. $r = $this->logic_u9xgsd->subDr($info);
  379. if($r['code'] == 1){
  380. echo json_encode(array('msg'=>'提交调入单成功','success'=>true));
  381. exit;
  382. }else{
  383. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  384. exit;
  385. }
  386. }else if($process == 3){
  387. if(!in_array($info['dr_status'],[2,-3])){
  388. echo json_encode(array('msg'=>'当前状态不符合审核调入单的条件','success'=>false));
  389. exit;
  390. }
  391. $r = $this->logic_u9xgsd->shDr($info);
  392. if($r['code'] == 1){
  393. echo json_encode(array('msg'=>'审核调入单成功','success'=>true));
  394. exit;
  395. }else{
  396. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  397. exit;
  398. }
  399. }else{
  400. echo json_encode(array('msg'=>'当前状态不符合创建调入单的条件','success'=>false));
  401. exit;
  402. }
  403. }
  404. public function _xs_two($arg_array){
  405. $process= $arg_array[0];
  406. $id = $arg_array[1];
  407. $info = $this->zzquque_u9->read($id);
  408. if($process == 1){
  409. if(!in_array($info['xs_two_status'],[0,-1])){
  410. echo json_encode(array('msg'=>'当前状态不符合查询香港销售单的条件','success'=>false));
  411. exit;
  412. }
  413. $r = $this->logic_u9xgsd->createXsTwo($info);
  414. if($r['code'] == 1){
  415. echo json_encode(array('msg'=>'创建香港销售单成功','success'=>true));
  416. exit;
  417. }else{
  418. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  419. exit;
  420. }
  421. }else if($process == 2){
  422. if(!in_array($info['xs_two_status'],[1,-2])){
  423. echo json_encode(array('msg'=>'当前状态不符合提交香港销售单的条件','success'=>false));
  424. exit;
  425. }
  426. $r = $this->logic_u9xgsd->subXsTwo($info);
  427. if($r['code'] == 1){
  428. echo json_encode(array('msg'=>'提交香港销售单成功','success'=>true));
  429. exit;
  430. }else{
  431. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  432. exit;
  433. }
  434. }else if($process == 3){
  435. if(!in_array($info['xs_two_status'],[2,-3])){
  436. echo json_encode(array('msg'=>'当前状态不符合审核香港销售单的条件','success'=>false));
  437. exit;
  438. }
  439. $r = $this->logic_u9xgsd->shXsTwo($info);
  440. if($r['code'] == 1){
  441. echo json_encode(array('msg'=>'审核香港销售单成功','success'=>true));
  442. exit;
  443. }else{
  444. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  445. exit;
  446. }
  447. }else{
  448. echo json_encode(array('msg'=>'当前状态不符合创建香港销售单的条件','success'=>false));
  449. exit;
  450. }
  451. }
  452. public function _bzch($arg_array){
  453. $process= $arg_array[0];
  454. $id = $arg_array[1];
  455. $info = $this->zzquque_u9->read($id);
  456. if($process == 1){
  457. if(!in_array($info['bzsh_status'],[0,-1])){
  458. echo json_encode(array('msg'=>'当前状态不符合创建标准收货单的条件','success'=>false));
  459. exit;
  460. }
  461. $r = $this->logic_u9xgsd->createCh($info);
  462. if($r['code'] == 1){
  463. echo json_encode(array('msg'=>'创建标准收货单成功','success'=>true));
  464. exit;
  465. }else{
  466. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  467. exit;
  468. }
  469. }else if($process == 2){
  470. $r = $this->logic_u9xgsd->subAndShCh($info);
  471. if($r['code'] == 1){
  472. echo json_encode(array('msg'=>'审核标准收货单成功','success'=>true));
  473. exit;
  474. }else{
  475. echo json_encode(array('msg'=>$r['msg'],'success'=>false));
  476. exit;
  477. }
  478. }else{
  479. echo json_encode(array('msg'=>'当前状态不符合创建标准收货单的条件','success'=>false));
  480. exit;
  481. }
  482. }
  483. public function _bzsh($arg_array){
  484. }
  485. public function _add(){
  486. $order_no = $this->input->post('order_no',true);
  487. if(empty($order_no)){
  488. echo json_encode(['msg'=>'请输入要添加的订单编码!','success'=>false]);exit;
  489. }
  490. $info = $this->logic_order->getInfo("number = '" .$order_no."'");
  491. if(empty($info)){
  492. echo json_encode(['msg'=>'订单不存在!请仔细核对单号','success'=>false]);exit;
  493. }
  494. $num = $this->zzquque_u9->find_all("order_no = '".$info['number']."'");
  495. if(empty($num)){
  496. $this->zzquque_u9->insert([
  497. 'platform'=>$info['lv_platform'],
  498. 'warehouse'=>$info['type'],
  499. 'type'=>10,
  500. 'order_no'=>$info['number'],
  501. 'create_time'=>time(),
  502. 'update_time'=>time(),
  503. ]);
  504. echo json_encode(['msg'=>'添加成功','success'=>true]);exit;
  505. }else{
  506. echo json_encode(['msg'=>'添加失败','success'=>false]);exit;
  507. }
  508. }
  509. }