Exemple #1
0
 public function view_getIsNotBackSkuList()
 {
     $iostoreAct = new IoStoreAct();
     $isNotBackArr = $iostoreAct->act_getIsNotBackSkuList();
     $navlist = array(array('url' => 'index.php?mod=products&act=getProductsComfirmList', 'title' => '产品制作'), array('url' => "index.php?mod=products&act=getIsNotBackSkuList", 'title' => "未归还产品查询"));
     $count = count($isNotBackArr);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('onevar', 5);
     $this->smarty->assign('twovar', 511);
     $this->smarty->assign('show_page', "共有 {$count} 条记录");
     $this->smarty->assign('title', '未归还产品查询');
     $this->smarty->assign('isNotBackArr', empty($isNotBackArr) ? array() : $isNotBackArr);
     $this->smarty->display("isNotBackSkuList.htm");
 }
Exemple #2
0
 function act_confirmReceivingByMFG()
 {
     $ioStoreId = !empty($_POST['ioStoreId']) ? $_POST['ioStoreId'] : 0;
     $comfirmUserId = $_SESSION['userId'];
     $now = time();
     if (intval($ioStoreId) <= 0) {
         self::$errCode = '101';
         self::$errMsg = "id有误";
         return false;
     }
     if (intval($comfirmUserId) <= 0) {
         self::$errCode = '102';
         self::$errMsg = "登陆超时,请重试";
         return false;
     }
     $tName = 'pc_products_iostore';
     $select = '*';
     $where = "WHERE is_delete=0 AND isAudit=2 AND id='{$ioStoreId}'";
     $ioStoreList = OmAvailableModel::getTNameList($tName, $select, $where);
     if (empty($ioStoreList)) {
         self::$errCode = '103';
         self::$errMsg = "该单据不存在或者未审核通过";
         return false;
     }
     try {
         BaseModel::begin();
         //标记表头已经确认
         $dataIoStore = array();
         $dataIoStore['isComfirm'] = 2;
         //标记单据已经确认
         $dataIoStore['comfirmUserId'] = $comfirmUserId;
         $dataIoStore['comfirmTime'] = $now;
         OmAvailableModel::updateTNameRow2arr($tName, $dataIoStore, $where);
         //标记表体确认
         $tName = 'pc_products_iostore_detail';
         $dataIoStoreDetail = array();
         $dataIoStoreDetail['isComfirm'] = 2;
         $where = "WHERE iostoreId='{$ioStoreId}'";
         OmAvailableModel::updateTNameRow2arr($tName, $dataIoStoreDetail, $where);
         //如果是新品领料单,则产品部确认后,该单据下的sku才进入产品制作表
         if ($ioStoreList[0]['iostoreTypeId'] == 1 && $ioStoreList[0]['useTypeId'] == 1) {
             $select = 'sku';
             $skuList = OmAvailableModel::getTNameList($tName, $select, $where);
             foreach ($skuList as $value) {
                 $sku = $value['sku'];
                 $tName = 'pc_products';
                 $dataProducts = array();
                 $dataProducts['sku'] = $sku;
                 OmAvailableModel::addTNameRow2arr($tName, $dataProducts);
                 //将detail中的sku加入到产品制作表中
             }
         }
         BaseModel::commit();
         BaseModel::autoCommit();
         self::$errCode = '200';
         self::$errMsg = "确认收货成功";
         return true;
     } catch (Exception $e) {
         BaseModel::rollback();
         BaseModel::autoCommit();
         self::$errCode = '404';
         self::$errMsg = $e->getMessage();
         return false;
     }
 }