Exemplo n.º 1
0
 public function actionViewquo()
 {
     $params['inqid'] = Yii::app()->request->getParam('inqid');
     //获取询价单信息
     $inqres = InquiryService::getinqinfo($params['inqid']);
     //查询是否已经发送报价单
     $params['type'] = 1;
     $quoid = InquiryService::ifsendquo($params);
     if ($quoid) {
         //获取报价单方案
         $schparams['quoid'] = $quoid;
         $schparams['type'] = 4;
         $res = QuotationService::getschemelists($schparams);
     }
     $this->render('viewquo', array('inqres' => $inqres, 'schinfo' => $res['schinfo'], 'quoinfo' => $res['quoinfo']));
 }
Exemplo n.º 2
0
 public function actionViewquo()
 {
     $quoID = Yii::app()->request->getParam('quoID');
     $result = QuotationService::getschemelists(array('quoid' => $quoID, 'type' => 2));
     $schinfo = $result['schinfo'];
     $quoinfo = $result['quoinfo'];
     $organparams['organID'] = $quoinfo['ServiceID'];
     $organparams['identity'] = 3;
     $organparams['quoid'] = $quoID;
     $service = QuotationService::getorganinfo($organparams);
     $organparams['organID'] = $quoinfo['DealerID'];
     $organparams['identity'] = 2;
     $dealer = QuotationService::getorganinfo($organparams);
     $this->render('quodetails', array('service' => $service, 'schinfo' => $schinfo, 'dealer' => $dealer, 'quoinfo' => $quoinfo));
 }
Exemplo n.º 3
0
 public function actionInquirydetail()
 {
     $inquiryid = Yii::app()->request->getParam('inquiryID');
     if (!$inquiryid) {
         throw new CHttpException('404');
     }
     //获取询价单信息
     $inquiryinfo = RPCClient::call('InquiryorderService_getinquirybyid', $inquiryid);
     if (!$inquiryinfo) {
         throw new CHttpException('404', '没有该询价单');
     }
     //获取发送经销商信息
     $dealerID = str_replace(',', '', $inquiryinfo['DealerID']);
     $sql_senddealer = 'select * from jpd_organ where ID=' . $dealerID;
     $delaer_info = InquiryorderService::excutesql(array('sql' => $sql_senddealer, 'db' => 'jpd'));
     //获取附件信息
     $inquiryimgs = RPCClient::call('InquiryorderService_getinquiryimgs', $inquiryid);
     //获取配件信息
     $sql = 'select * from pap_inquiry_category where InquiryID=' . $inquiryid;
     $categpry = InquiryorderService::excutesql(array('sql' => $sql, 'db' => 'pap'));
     if (!empty($categpry)) {
         $datacate = new CArrayDataProvider($categpry, array('pagination' => array('pageSize' => count($categpry))));
     } else {
         $datacate = '';
     }
     $prams = array('inquiryID' => $inquiryid, 'dealerids' => $inquiryinfo['DealerID']);
     $res;
     if ($inquiryinfo['Make']) {
         $paramas['Make'] = $inquiryinfo['Make'];
         $paramas['Car'] = $inquiryinfo['Car'];
         $paramas['Year'] = $inquiryinfo['Year'];
         $paramas['Model'] = $inquiryinfo['Model'];
         $res = InquiryService::getcarmodel($paramas);
     }
     //获取报价单信息
     $sql_findquo = 'select * from pap_quotation where InquiryID=' . $inquiryid . ' and IfSend="2"';
     $ars = InquiryorderService::excutesql(array('sql' => $sql_findquo, 'db' => 'pap'));
     $schinfo = '';
     $discount;
     if (!empty($ars)) {
         $schparams['quoid'] = $ars[0]['QuoID'];
         $schparams['type'] = 6;
         $schparams['sid'] = Yii::app()->user->getOrganID();
         $schinfo = QuotationService::getschemelists($schparams);
         //获取经销商最小交易额
         $miniprice = 0;
         $sql_findmini = 'select MinTurnover from pap_order_min_turnover where OrganID=' . $ars[0]['DealerID'];
         $lms_results = InquiryorderService::excutesql(array('sql' => $sql_findmini, 'db' => 'pap'));
         if ($lms_results && $lms_results[0]['MinTurnover']) {
             $miniprice = $lms_results[0]['MinTurnover'];
         }
         //获取经销商的折扣率
         $sql_finddiscount = 'select * from pap_order_discount where OrderType=2 ';
         $discount = InquiryorderService::excutesql(array('sql' => $sql_finddiscount, 'db' => 'pap'));
         if ($discount) {
             $discount[0]['OrderAlipay'] = $discount[0]['OrderAlipay'] ? $discount[0]['OrderAlipay'] . '%' : '';
             $discount[0]['OrderLogis'] = $discount[0]['OrderLogis'] ? $discount[0]['OrderLogis'] . '%' : '';
         }
     }
     //如果报价单已确认,查询订单ID
     $goodsdata;
     $sumtotal = 0;
     if (!empty($ars) && $ars[0]['OrderID']) {
         $sql_find_sum = 'select GoodsAmount from pap_order where ID=' . $ars[0]['OrderID'];
         $sum = Yii::app()->papdb->createCommand($sql_find_sum)->queryRow();
         $sumtotal = $sum['GoodsAmount'];
         $sql_find_goods = 'select * from pap_order_goods where OrderID=' . $ars[0]['OrderID'];
         $goodsinfo = Yii::app()->papdb->createCommand($sql_find_goods)->queryAll();
         $rearray = array();
         $partlevel = Yii::app()->getParams()->PartsLevel;
         $totals = 0;
         foreach ($goodsinfo as $key => $value) {
             //插入配件档次
             $pat_sql = 'select PartsLevel from pap_goods where ID=' . $value['GoodsID'];
             $final = Yii::app()->papdb->createCommand($pat_sql)->queryRow();
             $value['PL'] = $partlevel[$final['PartsLevel']];
             $value['GoodsOE'] = '<div style="width: 120px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;" title="' . $value['GoodsOE'] . '" >' . $value['GoodsOE'] . '</div>';
             //self::getmaxlength($value['GoodsOE'], 8, true);
             $value['rowNo'] = $key + 1;
             $value['GoodsName'] = '<div  href="javascript:void(0);" goodsid="' . $value['GoodsID'] . '"  orderid="' . $value['OrderID'] . '" version="' . $value['Version'] . '" class="quottion_goods_href" title="' . $value['GoodsName'] . '"  style="width: 100px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;cursor:pointer;">' . $value['GoodsName'] . '</div>';
             $value['GoodsNum'] = '<div   href="javascript:void(0);" goodsid="' . $value['GoodsID'] . '"  orderid="' . $value['OrderID'] . '" version="' . $value['Version'] . '" class="quottion_goods_href"  title="' . $value['GoodsNum'] . '" style="width: 80px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;cursor:pointer;">' . $value['GoodsNum'] . '</div>';
             $rearray[$key] = $value;
         }
         $goodsdata = new CArrayDataProvider($rearray, array('pagination' => array('pageSize' => count($rearray))));
     }
     //己方地址
     $address = RPCClient::call('InquiryorderService_getaddressid', Yii::app()->user->getOrganID());
     $addressprovider = RPCClient::call('InquiryorderService_dataproviderpage', $address);
     $model = new JpdReceiveAddress();
     $this->render('inquirydetail', array('inquiryinfo' => $inquiryinfo, 'res' => $res, 'imsgs' => $inquiryimgs, 'category' => $datacate ? $datacate : '', 'schinfo' => $schinfo ? $schinfo['schinfo'] : $schinfo, 'model' => $model, 'quoinfo' => $ars ? $ars[0] : $ars, 'address' => $addressprovider, 'discount' => $discount ? $discount[0] : $discount, 'mini' => $miniprice, 'goodsdata' => $goodsdata ? $goodsdata : '', 'sumtotal' => $sumtotal, 'dealer_info' => $delaer_info ? $delaer_info[0] : ''));
 }