Zzququeu9.php 26 KB

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