From 7950bada64569143e5c63ae8eae3eded2c954985 Mon Sep 17 00:00:00 2001 From: yangsai Date: Tue, 29 Oct 2024 18:26:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=8F=E7=A5=A8=E6=9C=BA=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/v1/statistic/ProductStatistic.php | 55 +++++++++++++++++- app/services/order/StoreOrderServices.php | 32 +++++++--- .../statistic/ProductStatisticServices.php | 11 ++++ crmeb/services/printer/storage/FeiEYun.php | 8 +++ crmeb/services/printer/storage/YiLianYun.php | 7 +++ route/admin.php | 2 + ...aeae368d3e4782113252e9023cc445a1b6.json.gz | Bin 0 -> 1021 bytes ...2471700b0b67da160b1024685e5001c4fb.json.gz | Bin 0 -> 249 bytes .../714acc3736d3a1a5d7469062569fb609.json | 2 +- .../b9a863e967d933d64a86130167576886.json | 2 +- 10 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 收银台/cashier/node_modules/.cache/eslint-loader/6b0c76aeae368d3e4782113252e9023cc445a1b6.json.gz create mode 100644 收银台/cashier/node_modules/.cache/eslint-loader/b020942471700b0b67da160b1024685e5001c4fb.json.gz diff --git a/app/controller/admin/v1/statistic/ProductStatistic.php b/app/controller/admin/v1/statistic/ProductStatistic.php index a9630a9e8..c31376572 100644 --- a/app/controller/admin/v1/statistic/ProductStatistic.php +++ b/app/controller/admin/v1/statistic/ProductStatistic.php @@ -15,6 +15,10 @@ namespace app\controller\admin\v1\statistic; use app\controller\admin\AuthController; use app\services\product\category\StoreProductCategoryServices; use app\services\statistic\ProductStatisticServices; +use app\services\order\StoreOrderServices; +use app\services\store\SystemStoreServices; +use app\services\product\product\StoreProductServices; +use app\services\order\StoreOrderCartInfoServices; use think\facade\App; /** @@ -81,7 +85,56 @@ class ProductStatistic extends AuthController $where['time'] = $this->getDay($where['time']); return $this->success($this->services->getProductRanking($where)); } - + public function getProductcount(StoreProductCategoryServices $storeProductCategoryServices) + { + $where = $this->request->getMore([ + ['cate_id', ''], + ['data', '', '', 'time'], + ['sort', ''] + ]); + //查询所有已支付的订单 + /** @var StoreOrderServices $StoreOrderServices */ + $StoreOrderServices = app()->make(StoreOrderServices::class); + //商品服务层 + /** @var StoreProductServices $StoreProductServices */ + $StoreProductServices = app()->make(StoreProductServices::class); + //门店服务层 + /** @var SystemStoreServices $SystemStoreServices */ + $SystemStoreServices = app()->make(SystemStoreServices::class); + + $payOrder = $StoreOrderServices->getOrderList(['paid'=>1]); + $products = []; + foreach($payOrder['data'] as $key => $val){ + $val['pink_name'] = !empty($val['other_order'])?'[会员礼包]':$val['pink_name']; + //获取门店名称 + $val['storename'] = empty($val['store_id'])?'平台':$SystemStoreServices->getFieldValue($val['store_id'],'id', 'name'); + foreach($val['_info'] as $k => $v){ + $v['cart_info']['productInfo']['pnum'] = empty($v['cart_info']['productInfo']['pnum'])?$v['cart_info']['cart_num']:$v['cart_info']['productInfo']['pnum']; + $v['cart_info']['productInfo']['pink_name'] = $val['pink_name']; + $v['cart_info']['productInfo']['order_no'] = $val['order_id']; + $v['cart_info']['productInfo']['sum_true_price'] = empty($v['cart_info']['sum_true_price'])?'0.00':$v['cart_info']['sum_true_price']; + $v['cart_info']['productInfo']['sum_price'] = $v['cart_info']['productInfo']['pnum']*$v['cart_info']['productInfo']['attrInfo']['price']; + $v['cart_info']['productInfo']['youhui'] = $v['cart_info']['productInfo']['sum_price']-$v['cart_info']['productInfo']['sum_true_price']; + $v['cart_info']['productInfo']['cost'] = $v['cart_info']['productInfo']['pnum']*$v['cart_info']['productInfo']['attrInfo']['cost']; + $v['cart_info']['productInfo']['code'] = $v['cart_info']['productInfo']['attrInfo']['code']; + $v['cart_info']['productInfo']['cate_name'] = $storeProductCategoryServices->getColumn(['id' => $v['cart_info']['productInfo']['cate_id']], 'cate_name')[0]; + $v['cart_info']['productInfo']['storename'] = $val['storename']; + // print_r($v['cart_info']['sum_true_price']);die; + //获取商品单位 + if(empty($v['cart_info']['productInfo']['unit_name'])) $v['cart_info']['productInfo']['unit_name'] = $StoreProductServices->getColumn(['id'=>$v['cart_info']['productInfo']['product_id']], 'unit_name')[0]; + $products[] = $v['cart_info']['productInfo']; + } + } + $cateId = $where['cate_id']; + if ($cateId) { + $cateId = is_string($cateId) ? [$cateId] : $cateId; + $cateId = array_merge($cateId, $storeProductCategoryServices->getColumn(['pid' => $cateId], 'id')); + $cateId = array_unique(array_diff($cateId, [0])); + } + $where['cate_id'] = $cateId; + $where['time'] = $this->getDay($where['time']); + return $this->success($products); + } /** * 导出 * @return mixed diff --git a/app/services/order/StoreOrderServices.php b/app/services/order/StoreOrderServices.php index d97519531..ef7b7c549 100644 --- a/app/services/order/StoreOrderServices.php +++ b/app/services/order/StoreOrderServices.php @@ -47,6 +47,7 @@ use crmeb\traits\ServicesTrait; use crmeb\utils\Arr; use think\exception\ValidateException; use think\facade\Log; +use app\services\activity\collage\UserCollageCodeServices; /** * Class StoreOrderServices @@ -176,7 +177,9 @@ class StoreOrderServices extends BaseServices //查询otherorder订单是否存在订单号 $oodao = new OtherOrderDao; $other_order = $oodao->getOne(['libao_id' => $item['order_id']]); + $item['other_order']=[]; if ($other_order) { + $item['other_order']=$other_order->toArray(); $item['order_id'] = $other_order['order_id']; } foreach ($item['_info'] as &$items) { @@ -1680,6 +1683,14 @@ HTML; $relation_id = $supplier_id; } } + $table = []; + if($order['type']==10){ + /** @var UserCollageCodeServices $UserCollageCodeServices */ + $UserCollageCodeServices = app()->make(UserCollageCodeServices::class); + //查询订单所在的桌码 + $qrcode_id = $UserCollageCodeServices->getFieldValue($order['id'],'oid', 'id'); + $table = $UserCollageCodeServices->get($qrcode_id); + } /** @var ConfigServices $configServices */ $configServices = app()->make(ConfigServices::class); if ($type == 1) {//门店 可以配置多个打印机 @@ -1695,17 +1706,24 @@ HTML; throw new ValidateException('请先配置小票打印开发者'); } } - foreach ($product as $pkey => $item) { + $newproduct = $product; + foreach ($newproduct as $pkey => $item) { + $printset = !empty($item['printset'])?explode(',', $item['printset']):''; - if($printset && !in_array($print['id'], $printset)) unset($product[$pkey]); + + if($printset && !in_array($print['id'], $printset)) unset($newproduct[$pkey]); } + $configData['print_num'] = $print['print_num']; $printer = new Printer($name, $configData); - $printer->setPrinterContent([ - 'name' => sys_config('site_name'), - 'orderInfo' => is_object($order) ? $order->toArray() : $order, - 'product' => $product - ])->startPrinter(); + if(!empty($newproduct)){ + $printer->setPrinterContent([ + 'name' => sys_config('site_name'), + 'orderInfo' => is_object($order) ? $order->toArray() : $order, + 'tableInfo' => is_object($table) ? $table->toArray() : $table, + 'product' => $newproduct + ])->startPrinter(); + } } } } else { diff --git a/app/services/statistic/ProductStatisticServices.php b/app/services/statistic/ProductStatisticServices.php index 292a1d623..0cd2ce465 100644 --- a/app/services/statistic/ProductStatisticServices.php +++ b/app/services/statistic/ProductStatisticServices.php @@ -248,4 +248,15 @@ class ProductStatisticServices extends BaseServices $productLog = app()->make(StoreProductLogServices::class); return $productLog->getRanking($where); } + /** + * 商品排行 + * @param $where + * @return mixed + */ + public function getProductcount($where) + { + /** @var StoreProductLogServices $productLog */ + $productLog = app()->make(StoreProductLogServices::class); + return $productLog->getRanking($where); + } } diff --git a/crmeb/services/printer/storage/FeiEYun.php b/crmeb/services/printer/storage/FeiEYun.php index 1a04a5cc4..7f036191b 100644 --- a/crmeb/services/printer/storage/FeiEYun.php +++ b/crmeb/services/printer/storage/FeiEYun.php @@ -57,8 +57,16 @@ class FeiEYun extends BasePrinter $product = $config['product']; $orderInfo = $config['orderInfo']; $orderTime = date('Y-m-d H:i:s', $orderInfo['pay_time']); + $tableInfo = $config['tableInfo']; + $name = $config['name']; + /** @var TableQrcodeServices $qrcodeService */ + $qrcodeService = app()->make(TableQrcodeServices::class); + $Info = $qrcodeService->getQrcodeyInfo((int)$tableInfo['qrcode_id'], ['category']); $this->printerContent = '**' . $config['name'] . '**
'; $this->printerContent .= '--------------------------------
'; + $this->printerContent .= '桌码流水:' . $tableInfo['serial_number']??'' . '
'; + $this->printerContent .= '桌码分类: ' . $Info['category']['name']??'' . '
'; + $this->printerContent .= '桌码编号: ' . $Info['table_number']??'' . '
'; $this->printerContent .= '订单编号:' . $orderInfo['order_id'] . '
'; $this->printerContent .= '打印时间: ' . $printTime . '
'; $this->printerContent .= '付款时间: ' . $orderTime . '
'; diff --git a/crmeb/services/printer/storage/YiLianYun.php b/crmeb/services/printer/storage/YiLianYun.php index b34b2b6ab..afacb024b 100644 --- a/crmeb/services/printer/storage/YiLianYun.php +++ b/crmeb/services/printer/storage/YiLianYun.php @@ -99,13 +99,20 @@ class YiLianYun extends BasePrinter } $goodsStr .= ''; $orderInfo = $config['orderInfo']; + $tableInfo = $config['tableInfo']; $name = $config['name']; + /** @var TableQrcodeServices $qrcodeService */ + $qrcodeService = app()->make(TableQrcodeServices::class); + $Info = $qrcodeService->getQrcodeyInfo((int)$tableInfo['qrcode_id'], ['category']); $discountPrice = (float)bcsub((string)bcadd((string)$orderInfo['total_price'], $orderInfo['pay_postage'], 2), (string)bcadd((string)$orderInfo['deduction_price'], $orderInfo['pay_price'], 2), 2); $this->printerContent = <<{$this->accessToken->times}
** {$name} **
---------------- 订单编号:{$orderInfo['order_id']}\r +桌码流水:{$tableInfo['serial_number']}\r +桌码分类: {$Info['category']['name']} \r +桌码编号: {$Info['table_number']} \r 日 期: {$timeYmd} \r 时 间: {$timeHis}\r 姓 名: {$orderInfo['real_name']}\r diff --git a/route/admin.php b/route/admin.php index e7dac6485..41ce0fa38 100644 --- a/route/admin.php +++ b/route/admin.php @@ -2015,6 +2015,8 @@ Route::group('adminapi', function () { Route::get('product/get_trend', 'v1.statistic.ProductStatistic/getTrend')->option(['real_name' => '商品趋势']); //商品排行 Route::get('product/get_product_ranking', 'v1.statistic.ProductStatistic/getProductRanking')->option(['real_name' => '商品排行']); + //商品排行 + Route::get('product/get_product_count', 'v1.statistic.ProductStatistic/getProductcount')->option(['real_name' => '商品统计报表']); //商品数据导出 Route::get('product/get_excel', 'v1.statistic.ProductStatistic/getExcel')->option(['real_name' => '商品数据导出']); /** 交易统计 */ diff --git a/收银台/cashier/node_modules/.cache/eslint-loader/6b0c76aeae368d3e4782113252e9023cc445a1b6.json.gz b/收银台/cashier/node_modules/.cache/eslint-loader/6b0c76aeae368d3e4782113252e9023cc445a1b6.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..38d3714c469faeeb137b1227368f8cd4b0e2127d GIT binary patch literal 1021 zcmVEjC@H|`t8IE$nCx)UD-?ocN z6*FurDx*FW6%TF#wOCV8E4<xUoG4(7`LqMrZRdme+^d&SKE;Ud=dM+T#LmUXun_zHT+ala>ZMCTAuI)R7 z-?ul5O6cIS>l4O1ib?}h!u<|AxVUQV;4K@jBxG^#^>OtmyK))5zmm(PQH^kKU!%*P zeR|~*+K~T)zrGvXc^w>gg1zqtoxA@X?*6InaqCTL z)l7z#^kr08UHjlxWwo+~OvdV-S}r#ljgn3s*edCKK`+`i3f1v)l-|+Au39<}4-CmD z_~-DX`>^-p!Qk5${ry*i*9Rv@hn!UJ>5Kl+-r!|7*gN0?!ST^i@6r9xsQ;uJ-2JnE z|6cFeop&_Li#{_&(aHtA2G~I#g}d^?2-^AlL%;QYOBj6)jEUVA8F;cSHR7kc#AC<- zhS53H5_L#a(fr|^K>%bSWC)f!i8c@ajD2sj7vG6sVNQt`qTw144 zjD`tzK$Xr4qfQgB0d%69f?-j97OJuL*u{)Qy+N8;fHcLuh?QU5rkcpLhGuZ;w^QcumZNk<4k1os%%H r%-Ao4IyOD#0|MsIeKp2P=7he764w=S+$x{|^8F(Ao4j literal 0 HcmV?d00001 diff --git a/收银台/cashier/node_modules/.cache/eslint-loader/b020942471700b0b67da160b1024685e5001c4fb.json.gz b/收银台/cashier/node_modules/.cache/eslint-loader/b020942471700b0b67da160b1024685e5001c4fb.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..62d443f6dbca9a12782cc660dac6acbd6ba7cc54 GIT binary patch literal 249 zcmVsG1Lt1#YwKZ+*N0%w5oUp z26zyrz7a^g1y?mf>dt2Q|NQ$qLS~tQ3fR>VIv@CfbN~yt7IB-?hMgi(JNnpc{4`LK zp>YxM`{VTUe)@X*M06yB=Zq-Xl_Tm|5S7+}5q)fV-|Qxa3Pu(=hnH8R6u@>Agewr< zarSxud-KN?iTmPXd>>Qh)~wmlBy3V=$c&_J@Ufp$vn5r|u`!Q@K&b1O>Pv)RG?`TT zvv0Y9*XIh#obobFQNb=Mc%d9i*SshOo!_7J@2;_V`*cMw{=M%P5qEH?lK}t##c_J* literal 0 HcmV?d00001 diff --git a/收银台/cashier/node_modules/.cache/vue-loader/714acc3736d3a1a5d7469062569fb609.json b/收银台/cashier/node_modules/.cache/vue-loader/714acc3736d3a1a5d7469062569fb609.json index 7d60fa124..37018134c 100644 --- a/收银台/cashier/node_modules/.cache/vue-loader/714acc3736d3a1a5d7469062569fb609.json +++ b/收银台/cashier/node_modules/.cache/vue-loader/714acc3736d3a1a5d7469062569fb609.json @@ -1 +1 @@ -{"remainingRequest":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js??ref--0-2!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue","mtime":1729675512657},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js","mtime":1570440814000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport recharge from '@/components/recharge';\r\nimport storeList from '@/components/storeList';\r\nimport orderList from '@/components/orderList';\r\nimport goodsList from '@/pages/hang/components/goodsList';\r\nimport userOrder from '@/pages/table/components/userOrder';\r\nimport orderDetails from '@/pages/table/components/orderDetails';\r\nimport orderRecord from '@/components/orderRecord';\r\nimport orderRemark from '@/components/orderRemark';\r\nimport filterModal from '@/components/filterModal';\r\nimport orderSend from '@/pages/order/components/orderSend';\r\nimport \"../../assets/js/core.js\";\r\nimport {\r\n getOrderInfo,\r\n getRefundOrderFrom,\r\n erpConfig,\r\n getCodeList,\r\n getTableList,\r\n getTableUidAll,\r\n getCartList,\r\n cashierCartList,\r\n cashierCompute,\r\n cashierCode,\r\n cancelTable,\r\n editTableCart,\r\n staffPlace,\r\n swithUser,\r\n cashierCreate,\r\n getTableOrderInfo,\r\n payOffline,\r\n cashierPay,\r\n orderRefund,\r\n} from '@/api/order';\r\n\r\nexport default {\r\n components: {\r\n recharge,\r\n storeList,\r\n orderList,\r\n goodsList,\r\n userOrder,\r\n orderDetails,\r\n orderRemark,\r\n orderRecord,\r\n filterModal,\r\n orderSend,\r\n },\r\n data() {\r\n return {\r\n orderId: 0,\r\n orderListData: [],\r\n tabs: ['商品信息', '订单详情', '订单记录'],\r\n sle: 0,\r\n filterModal: false,\r\n userFrom: {\r\n keyword: '',\r\n page: 1,\r\n limit: 9,\r\n },\r\n orderData: {\r\n type: '10',\r\n status: '',\r\n time: '',\r\n staff_id: '',\r\n serial_number: '',\r\n page: 1,\r\n limit: 10,\r\n },\r\n selectOrderData: {},\r\n orderInfoData: {},\r\n count: 0,\r\n status: 0,\r\n pay_type: '',\r\n canSend: true,\r\n tengxun_map_key: '',\r\n open_erp: null,\r\n active: 1,\r\n modal2: false,\r\n modal: false,\r\n userInfo: {},\r\n storeInfos: {}, //门店店员信息\r\n storeList: [], //门店列表\r\n goodFrom: {\r\n store_name: '',\r\n field_key: 'all',\r\n cate_id: '',\r\n page: 1,\r\n limit: 12,\r\n uid: 0,\r\n staff_id: 0,\r\n },\r\n codeList: [],\r\n uid: 0,\r\n staff_id: 0,\r\n cart_ids: '',\r\n table_id: 0,\r\n payNum: '',\r\n createOrder: {\r\n remarks: '',\r\n change_price: 0,\r\n cart_id: [], // 购物车id\r\n userCode: '',\r\n is_price: 0,\r\n auth_code: '',\r\n },\r\n modalPay: false,\r\n priceInfo: {},\r\n orderSystem: {\r\n loadingMsg: null,\r\n timer: null,\r\n },\r\n modalCash: false,\r\n collectionArray: [],\r\n collection: 0,\r\n numList: ['7', '8', '9', '4', '5', '6', '1', '2', '3', '0', '.'],\r\n integral: false, //是否使用积分\r\n formItem: {\r\n price: 0,\r\n },\r\n discountPrice: 100,\r\n discount: false,\r\n isOrderCreate: 0,\r\n codeNum: \"\",\r\n refundVisible: false,\r\n refundData: {\r\n order_id: 0,\r\n refund_price: 0,\r\n }\r\n };\r\n },\r\n computed: {\r\n isCashierCartList: function () {\r\n let { uid, staff_id, cart_ids } = this;\r\n let { oid } = this.selectOrderData;\r\n return {\r\n uid,\r\n staff_id,\r\n cart_ids,\r\n oid,\r\n };\r\n },\r\n },\r\n watch: {\r\n count(value) {\r\n if (value) {\r\n this.table_id = this.orderListData[0].id;\r\n } else {\r\n this.selectOrderData = {};\r\n }\r\n },\r\n table_id(value) {\r\n let result = this.orderListData.find(({ id }) => id == value);\r\n this.selectOrderData = {};\r\n this.uid = 0;\r\n if (result) {\r\n this.selectOrderData = { ...result };\r\n this.getTableUidAll();\r\n }\r\n },\r\n uid(value) {\r\n if (value && this.selectOrderData.status == 1) {\r\n this.getCartList();\r\n } else {\r\n this.cart_ids = '';\r\n }\r\n },\r\n cart_ids(value) {\r\n if (value) {\r\n this.cashierCompute();\r\n } else {\r\n this.formItem.price = this.unchangedPrice = 0;\r\n }\r\n },\r\n integral() {\r\n this.cashierCompute();\r\n },\r\n isCashierCartList(newVal, oldVal) {\r\n const { uid, staff_id, cart_ids, oid } = newVal;\r\n let flag = true;\r\n for (const key in newVal) {\r\n if (Object.hasOwnProperty.call(newVal, key)) {\r\n if (newVal[key] != oldVal[key]) {\r\n flag = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (!flag) {\r\n if (uid && staff_id && cart_ids && !oid) {\r\n this.cashierCartList();\r\n }\r\n }\r\n },\r\n 'selectOrderData.oid'(value) {\r\n if (value) {\r\n this.getTableOrderInfo();\r\n }\r\n },\r\n active(value) {\r\n if (value == 2) {\r\n this.getCodeList();\r\n }\r\n if (this.timer) {\r\n clearTimeout(this.timer);\r\n }\r\n }\r\n },\r\n created() {\r\n this.getOrderList();\r\n this.getErpConfig();\r\n },\r\n methods: {\r\n numberChange(value) {\r\n this.$nextTick(() => {\r\n let string = Number(value).toString();\r\n let index = string.indexOf('.');\r\n if (-1 === index || 2 >= string.length - index - 1) {\r\n this.refundData.refund_price = Number(string);\r\n } else {\r\n this.refundData.refund_price = Number(Number(string).toFixed(2));\r\n }\r\n });\r\n },\r\n jsToJava(){\r\n try {\r\n window.Jsbridge.invoke('openCacheBox',JSON.stringify({'p1-key':'p1-value'}), this.myFunction() );\r\n }catch (e) {\r\n\r\n }\r\n },\r\n myFunction(){\r\n\r\n },\r\n // 线下确定结算\r\n payOffline() {\r\n payOffline(this.selectOrderData.oid).then(() => {\r\n this.$Message.success('支付成功');\r\n this.selectOrderData.orderId.paid = 1;\r\n for (const selectOrderData of this.orderListData) {\r\n if (selectOrderData.id == this.selectOrderData.id) {\r\n selectOrderData.orderId.paid = 1;\r\n break;\r\n }\r\n }\r\n }).catch(err => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n // 获取订单信息\r\n getTableOrderInfo() {\r\n getTableOrderInfo(this.selectOrderData.oid).then(res => {\r\n this.selectOrderData = { ...this.selectOrderData, orderId: res.data, is_cashier_yue_pay_verify: res.data.is_cashier_yue_pay_verify };\r\n this.refundData.order_id = res.data.order_id;\r\n this.refundData.refund_price = +res.data.pay_price;\r\n });\r\n },\r\n // 线上支付和余额支付\r\n confirm() {\r\n if (this.payType == \"yue\") {\r\n if (!this.createOrder.userCode && this.selectOrderData.is_cashier_yue_pay_verify) {\r\n return this.$Message.error(\"请扫描个人中心二维码\");\r\n }\r\n if (this.isOrderCreate) {\r\n this.getCashierPay(\"yue\");\r\n } else {\r\n this.orderCreate();\r\n }\r\n } else if (this.payType == \"\") {\r\n if (!this.createOrder.auth_code) {\r\n return this.$Message.error(\"请扫描您的付款码\");\r\n }\r\n if (this.isOrderCreate) {\r\n this.getCashierPay(\"\");\r\n } else {\r\n this.orderCreate();\r\n }\r\n }\r\n },\r\n getCashierPay(payType) {\r\n let data = {\r\n payType: payType,\r\n userCode: this.payNum,\r\n auth_code: this.payNum,\r\n };\r\n if (payType == \"cash\") {\r\n if (parseFloat(this.selectOrderData.payPrice) > parseFloat(this.collection)) {\r\n return this.$Message.error(\"您付款金额不足\");\r\n }\r\n }\r\n cashierPay(this.selectOrderData.orderId.order_id, data)\r\n .then((res) => {\r\n this.payNum = \"\";\r\n if (res.data.status == \"SUCCESS\") {\r\n this.isOrderCreate = 0;\r\n this.$Message.success(\"支付成功\");\r\n this.modalCash = false;\r\n this.modalPay = false;\r\n // this.changePoints();\r\n // let storage = window.localStorage;\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.clear();\r\n // this.goodList();\r\n this.selectOrderData.orderId.paid = 1;\r\n for (const selectOrderData of this.orderListData) {\r\n if (selectOrderData.id == this.selectOrderData.id) {\r\n selectOrderData.orderId.paid = 1;\r\n break;\r\n }\r\n }\r\n //现金收款打开钱箱\r\n if (payType == \"cash\") {\r\n this.jsToJava();\r\n }\r\n } else if (res.data.status == \"PAY_ING\") {\r\n let msg = this.$Message.loading({\r\n content: \"等待支付中...\",\r\n duration: 0,\r\n });\r\n this.orderSystem.loadingMsg = msg;\r\n this.orderId = res.data.order_id;\r\n this.checkOrderTime(msg);\r\n // this.confirmOrder();\r\n } else {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.error(res.data.message);\r\n }\r\n })\r\n .catch((err) => {\r\n this.payNum = \"\";\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n // 创建订单\r\n orderCreate() {\r\n if (this.payType == \"cash\") {\r\n if (parseFloat(this.selectOrderData.payPrice) > parseFloat(this.collection)) {\r\n return this.$Message.error(\"您付款金额不足\");\r\n }\r\n }\r\n // this.createOrder.tourist_uid = this.userInfo.touristId;\r\n this.createOrder.new = 1;\r\n this.createOrder.collate_code_id = this.table_id;\r\n this.createOrder.cart_id = this.cart_ids.split(',');\r\n cashierCreate(this.uid, this.createOrder)\r\n .then((res) => {\r\n let storage = window.localStorage;\r\n this.payNum = \"\";\r\n if (this.payType == \"yue\") {\r\n this.modalPay = false;\r\n this.payNum = \"\";\r\n this.createOrder.userCode = \"\";\r\n if (res.data.status == \"ORDER_CREATE\") {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.success(res.data.message);\r\n } else if (res.data.status == \"SUCCESS\") {\r\n this.isOrderCreate = 0;\r\n this.$Message.success(\"支付成功\");\r\n // let money = this.$computes.Sub(\r\n // this.userInfo.now_money,\r\n // this.priceInfo.payPrice\r\n // );\r\n // this.userInfo.now_money = money;\r\n // this.changePoints();\r\n this.payTypeModal = false;\r\n this.modalPay = false;\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.goodList();\r\n this.selectOrderData = { ...this.selectOrderData, oid: res.data.oid };\r\n for (const orderData of this.orderListData) {\r\n if (orderData.id == this.selectOrderData.id) {\r\n orderData.status = 2;\r\n orderData.oid = res.data.oid;\r\n if (Object.prototype.toString.call(orderData.orderId) != '[object Object]') {\r\n orderData.orderId = {};\r\n }\r\n orderData.orderId = { ...orderData.orderId, paid: 1 };\r\n break;\r\n }\r\n }\r\n // this.clear();\r\n } else {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.error(res.data.message);\r\n }\r\n }\r\n if (this.payType == \"cash\") {\r\n if (res.data.status == \"SUCCESS\") {\r\n this.$Message.success(\"支付成功\");\r\n // storage.removeItem(\"cashierUser\");\r\n // this.userInfo = null;\r\n // this.changePoints();\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.getOrderList();\r\n this.selectOrderData = { ...this.selectOrderData, oid: res.data.oid };\r\n for (const orderData of this.orderListData) {\r\n if (orderData.id == this.selectOrderData.id) {\r\n orderData.status = 2;\r\n orderData.oid = res.data.oid;\r\n if (Object.prototype.toString.call(orderData.orderId) != '[object Object]') {\r\n orderData.orderId = {};\r\n }\r\n orderData.orderId = { ...orderData.orderId, paid: 1 };\r\n break;\r\n }\r\n }\r\n this.modalCash = false;\r\n this.payTypeModal = false;\r\n // this.clear();\r\n this.jsToJava();\r\n }\r\n }\r\n if (this.payType == \"\") {\r\n this.payNum = \"\";\r\n this.createOrder.auth_code = \"\";\r\n if (res.data.status == \"ORDER_CREATE\") {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.success(res.data.message);\r\n } else if (res.data.status == \"PAY_ING\") {\r\n let msg = this.$Message.loading({\r\n content: \"等待支付中...\",\r\n duration: 0,\r\n });\r\n this.orderId = res.data.order_id;\r\n this.checkOrderTime(msg);\r\n } else if (res.data.status == \"SUCCESS\") {\r\n this.$Message.success(\"支付成功\");\r\n // storage.removeItem(\"cashierUser\");\r\n // this.userInfo = null;\r\n // this.setUp();\r\n // this.changePoints();\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.goodList();\r\n this.selectOrderData = { ...this.selectOrderData, oid: res.data.oid };\r\n for (const orderData of this.orderListData) {\r\n if (orderData.id == this.selectOrderData.id) {\r\n orderData.status = 2;\r\n orderData.oid = res.data.oid;\r\n if (Object.prototype.toString.call(orderData.orderId) != '[object Object]') {\r\n orderData.orderId = {};\r\n }\r\n orderData.orderId = { ...orderData.orderId, paid: 1 };\r\n break;\r\n }\r\n }\r\n this.modalPay = false;\r\n this.clear();\r\n } else {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.error(res.data.message);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n this.payNum = \"\";\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n //输入实际收款金额\r\n numTap(item) {\r\n if (this.defaultcalc === false) {\r\n this.collection = \"\";\r\n this.defaultcalc = true;\r\n }\r\n let x = String(this.collection).indexOf(\".\") + 1;\r\n let y = String(this.collection).length - x;\r\n if (x === 0 || y < 2) {\r\n if (this.collectionArray.join(\"\") <= 9999999) {\r\n this.collectionArray.push(item);\r\n }\r\n this.collection =\r\n this.collectionArray.join(\"\") > 99999999\r\n ? 99999999\r\n : this.collectionArray.join(\"\");\r\n }\r\n },\r\n getSwithUser(data){\r\n swithUser(data).then(res=>{}).catch(err=>{\r\n this.$Message.error(err.msg);\r\n })\r\n },\r\n //点击出现优惠明细\r\n discountCon() {\r\n this.discount = true;\r\n },\r\n // 打单\r\n staffPlace() {\r\n staffPlace({\r\n tableId: this.table_id,\r\n })\r\n .then((res) => {})\r\n .catch((res) => {\r\n this.$Message.error(res.msg);\r\n });\r\n },\r\n calculate(data) {\r\n editTableCart({\r\n productId: data.product_id,\r\n cartNum: 1,\r\n uniqueId: data.product_attr_unique || 0,\r\n tableId: this.table_id,\r\n isAdd: data.isAdd,\r\n })\r\n .then((res) => {\r\n this.getCartList();\r\n })\r\n .catch((res) => {\r\n this.$Message.error(res.msg);\r\n });\r\n },\r\n // 取消桌码订单\r\n cancelTable() {\r\n this.$Modal.confirm({\r\n title: '取消该桌码订单',\r\n content:\r\n '

确定要取消该桌码订单吗?

取消该桌码订单后将无法恢复,请谨慎操作!

',\r\n onOk: () => {\r\n cancelTable({\r\n tableId: this.selectOrderData.id,\r\n qrcode_id: this.selectOrderData.qrcode_id,\r\n }).then((res) => {\r\n this.$Message.success('取消该桌码订单成功');\r\n for (let i = 0; i < this.orderListData.length; i++) {\r\n if (this.orderListData[i].id == this.selectOrderData.id) {\r\n if (this.orderListData[i + 1]) {\r\n this.table_id = this.orderListData[i + 1].id;\r\n } else if (this.orderListData[i - 1]) {\r\n this.table_id = this.orderListData[i - 1].id;\r\n } else {\r\n this.table_id = 0;\r\n }\r\n this.orderListData.splice(i, 1);\r\n break;\r\n }\r\n }\r\n });\r\n },\r\n });\r\n },\r\n onSubmit2() {\r\n if (this.formItem.price >= 0 && this.formItem.price != null) {\r\n // this.priceInfo.payPrice = this.formItem.price;\r\n this.selectOrderData.payPrice = this.formItem.price;\r\n this.$Message.success('改价成功');\r\n this.createOrder.is_price = 1;\r\n this.createOrder.change_price = this.formItem.price;\r\n this.getSwithUser({ change_price: this.formItem.price });\r\n this.cancelPrice();\r\n this.modal2 = false;\r\n } else {\r\n return this.$Message.error('价格不能为空');\r\n }\r\n },\r\n tapDiscount() {\r\n this.formItem.price =\r\n this.$computes\r\n .Mul(this.unchangedPrice || 0, this.discountPrice / 100 || 0)\r\n .toFixed(2) || 0;\r\n },\r\n tapPrice() {\r\n this.formItem.price = Number(this.formItem.price.toFixed(2));\r\n let num = this.$computes.Div(\r\n this.formItem.price || 0,\r\n this.unchangedPrice || 0\r\n );\r\n this.discountPrice = Number((num * 100).toFixed(2)) || 0;\r\n },\r\n cancelPrice() {\r\n this.formItem.price = this.priceInfo.payPrice || 0;\r\n this.tapPrice();\r\n },\r\n // 点击改价\r\n changePrice() {\r\n this.modal2 = true;\r\n this.formItem.price = this.selectOrderData.payPrice || 0;\r\n },\r\n // 计算金额\r\n cartCompute() {\r\n if (!this.cartList.length) {\r\n this.priceInfo = {};\r\n return;\r\n }\r\n let ids = [];\r\n this.cartList.forEach((item) => {\r\n item.cart.forEach((good) => {\r\n ids.push(good.id);\r\n });\r\n });\r\n this.createOrder.cart_id = ids;\r\n let data = {\r\n integral: this.integral,\r\n coupon: this.coupon,\r\n coupon_id: this.couponId,\r\n cart_id: ids,\r\n };\r\n cashierCompute(this.userInfo.uid, data)\r\n .then((res) => {\r\n this.priceInfo = res.data;\r\n this.unchangedPrice = this.priceInfo.payPrice || 0;\r\n this.formItem.price = this.priceInfo.payPrice || 0;\r\n this.tapPrice();\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n this.coupon = false;\r\n });\r\n },\r\n // 是否使用积分\r\n integralTap() {\r\n if (!this.selectOrderData.uid) {\r\n this.$Message.warning('请先选择用户再使用积分');\r\n return;\r\n }\r\n this.integral = !this.integral;\r\n if (this.integral) this.createOrder.is_price = 0;\r\n // this.cartCompute();\r\n },\r\n //清除计算机输入的数字\r\n delNum() {\r\n this.collectionArray.pop();\r\n this.collection = this.collectionArray.length\r\n ? this.collectionArray.join('')\r\n : 0;\r\n },\r\n //现金收款创建订单并支付\r\n cashBnt() {\r\n if (this.cashBntLoading) return;\r\n this.cashBntLoading = true;\r\n if (this.isOrderCreate) {\r\n this.getCashierPay('cash');\r\n } else {\r\n this.orderCreate();\r\n }\r\n setTimeout(() => {\r\n this.cashBntLoading = false;\r\n }, 1000);\r\n },\r\n cancel() {\r\n this.collection = 0;\r\n this.collectionArray = [];\r\n },\r\n // 监听键盘函数\r\n keyboard() {\r\n let that = this;\r\n\r\n function delNums(item) {\r\n that.collectionArray.pop();\r\n that.collection = that.collectionArray.length\r\n ? that.collectionArray.join('')\r\n : 0;\r\n }\r\n\r\n function numTaps(item) {\r\n if (that.defaultcalc === false) {\r\n that.collection = '';\r\n that.defaultcalc = true;\r\n }\r\n let x = String(that.collection).indexOf('.') + 1;\r\n let y = String(that.collection).length - x;\r\n if (x === 0 || y < 2) {\r\n if (that.collectionArray.join('') <= 9999999) {\r\n that.collectionArray.push(item);\r\n }\r\n that.collection =\r\n that.collectionArray.join('') > 99999999\r\n ? 99999999\r\n : that.collectionArray.join('');\r\n }\r\n }\r\n\r\n document.onkeydown = function (event) {\r\n let e = event || window.event;\r\n let key = e.keyCode;\r\n if (that.modalCash) {\r\n event.stopPropagation(); // 阻止事件冒泡传递\r\n event.preventDefault(); //阻止默认事件原有功能\r\n }\r\n switch (key) {\r\n case 96:\r\n case 48:\r\n numTaps(0);\r\n break;\r\n case 97:\r\n case 49:\r\n numTaps(1);\r\n break;\r\n case 98:\r\n case 50:\r\n numTaps(2);\r\n break;\r\n case 99:\r\n case 51:\r\n numTaps(3);\r\n break;\r\n case 100:\r\n case 52:\r\n numTaps(4);\r\n break;\r\n case 101:\r\n case 53:\r\n numTaps(5);\r\n break;\r\n case 102:\r\n case 54:\r\n numTaps(6);\r\n break;\r\n case 103:\r\n case 55:\r\n numTaps(7);\r\n break;\r\n case 104:\r\n case 56:\r\n numTaps(8);\r\n break;\r\n case 105:\r\n case 57:\r\n numTaps(9);\r\n break;\r\n case 110:\r\n numTaps('.');\r\n break;\r\n case 190:\r\n numTaps('.');\r\n break;\r\n case 8:\r\n delNums();\r\n break;\r\n }\r\n };\r\n },\r\n //扫码枪扫码,针对带有字母的\r\n inputSaoMa(e) {\r\n // setTimeout定时器的作用是,等待扫码枪输入完,拿到完整的二维码信息,再调接口(扫码枪输入速度大概8~20毫秒,手动输速度大概是80毫秒),否则拿不到完整的二维信息。\r\n let val = e;\r\n if (val === '') return false;\r\n clearTimeout(this.endTimeout);\r\n this.endTimeout = null;\r\n this.endTimeout = setTimeout(() => {\r\n // if (this.payNum === val) {\r\n // \tclearTimeout(this.endTimeout)\r\n // \tif (val) {\r\n // \t\tthis.createOrder.userCode = val;\r\n // \t\tthis.createOrder.auth_code = val;\r\n // \t\tthis.confirm();\r\n // \t}\r\n // }\r\n if (this.codeNum === val) {\r\n clearTimeout(this.endTimeout);\r\n if (val) {\r\n this.codeInfo({\r\n bar_code: val,\r\n });\r\n }\r\n }\r\n }, 500);\r\n },\r\n modalPayCancel() {\r\n this.$Message.destroy();\r\n if (this.orderSystem.timer) {\r\n clearInterval(this.orderSystem.timer);\r\n this.orderSystem.timer = null;\r\n }\r\n },\r\n codeInfo(data) {\r\n // data.uid = this.userInfo ? this.userInfo.uid : 0;\r\n data.uid = this.uid;\r\n data.staff_id = this.storeInfos.id;\r\n // data.tourist_uid = this.userInfo.touristId;\r\n // if (this.userInfo == null) {\r\n // this.codeNum = '';\r\n // return this.$Message.error('请添加或选择用户');\r\n // }\r\n cashierCode(data)\r\n .then((res) => {\r\n this.codeNum = '';\r\n let data = res.data;\r\n if (data.hasOwnProperty('userInfo')) {\r\n // 用户 Object.keys(this.userInfo).length\r\n if (this.userInfo) {\r\n this.$Modal.confirm({\r\n title: '切换用户',\r\n content: '

确定要切换用户吗?

',\r\n onOk: () => {\r\n this.userInfo = res.data.userInfo;\r\n let storage = window.localStorage;\r\n storage.setItem(\r\n 'cashierUser',\r\n JSON.stringify(res.data.userInfo)\r\n );\r\n this.getCartList();\r\n },\r\n onCancel: () => {},\r\n });\r\n } else {\r\n this.userInfo = res.data.userInfo;\r\n let storage = window.localStorage;\r\n storage.setItem('cashierUser', JSON.stringify(res.data.userInfo));\r\n }\r\n }\r\n this.goodList();\r\n this.getCartList();\r\n })\r\n .catch((err) => {\r\n this.codeNum = '';\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n payPrice(payType) {\r\n this.payType = payType;\r\n if (this.selectOrderData.oid) {\r\n this.isOrderCreate = true;\r\n this.selectOrderData.payPrice = Number(this.selectOrderData.pay_price) || 0;\r\n }\r\n if (payType == '' || payType == 'yue') {\r\n this.createOrder.userCode = '';\r\n this.createOrder.auth_code = '';\r\n this.payNum = '';\r\n if (payType == '' || this.selectOrderData.is_cashier_yue_pay_verify) {\r\n this.modalPay = true;\r\n let that = this;\r\n this.$nextTick(() => {\r\n this.$refs.focusNum.focus();\r\n document.onkeydown = function (e) {\r\n if (e.which == 13) {\r\n if (that.payNum) {\r\n that.createOrder.userCode = that.payNum;\r\n that.createOrder.auth_code = that.payNum;\r\n that.confirm();\r\n }\r\n if (that.codeNum) {\r\n that.codeInfo({\r\n bar_code: that.codeNum,\r\n });\r\n }\r\n }\r\n };\r\n });\r\n } else {\r\n this.confirm();\r\n }\r\n } else if (payType == 'cash') {\r\n this.modalCash = true;\r\n // this.collection = this.priceInfo.payPrice ? this.priceInfo.payPrice : 0;\r\n if (this.selectOrderData.oid) {\r\n this.isOrderCreate = true;\r\n this.selectOrderData.payPrice = Number(this.selectOrderData.pay_price) || 0;\r\n }\r\n this.collection = this.selectOrderData.payPrice || 0;\r\n this.keyboard();\r\n }\r\n this.createOrder.integral = this.integral;\r\n this.createOrder.coupon = this.coupon;\r\n this.createOrder.coupon_id = this.couponId;\r\n if (this.coupon && !this.couponId)\r\n return this.$Message.error('请选择有效优惠券');\r\n this.createOrder.pay_type = payType;\r\n this.createOrder.staff_id = this.storeInfos.id;\r\n // this.fapi.resetFields();\r\n },\r\n // 选择用户\r\n userChange(uid) {\r\n this.uid = uid;\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n uid,\r\n };\r\n },\r\n cashierCompute() {\r\n cashierCompute(this.uid, {\r\n new: 1,\r\n coupon_id: 0,\r\n coupon: false,\r\n integral: this.integral,\r\n cart_id: this.cart_ids.split(','),\r\n }).then((res) => {\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n ...res.data,\r\n };\r\n this.formItem.price = this.unchangedPrice =\r\n this.selectOrderData.payPrice;\r\n });\r\n },\r\n // 获取购物车商品\r\n cashierCartList() {\r\n cashierCartList(this.uid, this.staff_id, {\r\n new: 1,\r\n cart_ids: this.cart_ids,\r\n }).then((res) => {\r\n let { valid } = res.data;\r\n let _info = [];\r\n if (valid.length) {\r\n _info = valid;\r\n }\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n orderId: { _info },\r\n };\r\n });\r\n },\r\n // 获取桌码订单cartid\r\n getCartList() {\r\n getCartList({\r\n table_id: this.table_id,\r\n uid: this.uid,\r\n }).then((res) => {\r\n this.cart_ids = res.msg;\r\n });\r\n },\r\n // 获取桌码订单用户\r\n getTableUidAll() {\r\n getTableUidAll({\r\n table_id: this.table_id,\r\n }).then((res) => {\r\n const data = res.data;\r\n if (data.length) {\r\n this.uid = data[0].uid;\r\n }\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n userList: data,\r\n uid: this.uid\r\n };\r\n });\r\n },\r\n // 桌码列表\r\n getCodeList() {\r\n getCodeList().then((res) => {\r\n this.codeList = res.data.filter((item) => {\r\n return item.tableQrcode.length;\r\n });\r\n this.timer = setTimeout(this.getCodeList, 60000);\r\n });\r\n },\r\n // 充值\r\n rechargeBnt(userInfo) {\r\n this.userInfo = userInfo;\r\n this.$refs.recharge.modal = true;\r\n },\r\n getSuccess(e) {\r\n let money = this.$computes.Add(this.userInfo.now_money, e);\r\n this.userInfo.now_money = money;\r\n let storage = window.localStorage;\r\n storage.setItem('cashierUser', JSON.stringify(this.userInfo));\r\n },\r\n // 选择店员\r\n storeTap() {\r\n this.$refs.store.modals = true;\r\n this.$refs.store.cancel();\r\n },\r\n // 门店店员信息以及门店店员列表\r\n getUserInfo(e) {\r\n this.staff_id = e.users.id;\r\n this.storeInfos = e.users;\r\n this.storeList = e.storeList;\r\n this.goodFrom.staff_id = e.users.id;\r\n sessionStorage.setItem('staffInfo', JSON.stringify(e.users));\r\n if (this.userInfo) {\r\n // this.getCartList();\r\n } else {\r\n // this.setUp();\r\n }\r\n // this.goodList();\r\n // this.hangDataList();\r\n // this.hangList();\r\n },\r\n // 当前选中门店店员信息\r\n getStoreId(e) {\r\n // this.clear();\r\n this.storeList.forEach((i) => {\r\n if (i.id == e.id) {\r\n this.storeInfos = i;\r\n this.staff_id = i.id;\r\n // sessionStorage.setItem('staffInfo', JSON.stringify(e));\r\n // this.goodFrom.staff_id = e.id;\r\n // this.storeInfos = i;\r\n // this.getCartList();\r\n // this.goodList();\r\n // this.hangDataList();\r\n // this.hangList();\r\n // this.getSwithUser({cashier_id:e.id});\r\n }\r\n });\r\n },\r\n orderSend() {\r\n this.$store.commit(\r\n 'store/order/setSplitOrder',\r\n this.selectOrderData.total_num\r\n );\r\n this.$refs.send.modals = true;\r\n this.orderId = this.selectOrderData.id;\r\n this.status = this.selectOrderData._status;\r\n this.pay_type = this.selectOrderData.pay_type;\r\n this.$refs.send.getList();\r\n this.$refs.send.getDeliveryList();\r\n this.$nextTick((e) => {\r\n this.$refs.send.getCartInfo(\r\n this.selectOrderData._status,\r\n this.selectOrderData.id\r\n );\r\n });\r\n },\r\n addPage() {\r\n if (this.orderListData.length < this.count) this.orderData.page++;\r\n this.getOrderList();\r\n },\r\n searchList(data) {\r\n let status = '';\r\n this.filterModal = false;\r\n switch (data.status) {\r\n case 0:\r\n status = 1;\r\n break;\r\n case 3:\r\n status = 2;\r\n break;\r\n case 4:\r\n status = 3;\r\n break;\r\n }\r\n this.orderData = { ...this.orderData, ...data, status };\r\n this.orderData.type = '';\r\n // this.orderListData = [];\r\n this.sle = 0;\r\n this.search();\r\n },\r\n point() {\r\n this.delfromData = {\r\n title: '立即打印订单',\r\n info: '您确认打印此订单吗?',\r\n url: `/order/print/${this.selectOrderData.oid}`,\r\n method: 'get',\r\n ids: '',\r\n };\r\n this.$modalSure(this.delfromData)\r\n .then((res) => {\r\n this.$Message.success(res.msg);\r\n })\r\n .catch((res) => {\r\n this.$Message.error(res.msg);\r\n });\r\n },\r\n search() {\r\n this.orderData.page = 1;\r\n this.orderListData = [];\r\n this.getOrderList();\r\n },\r\n // 设置备注\r\n remarks() {\r\n this.$refs.remarks.modals = true;\r\n this.$refs.remarks.formValidate.remark =\r\n this.selectOrderData.orderId.remark;\r\n },\r\n send() {\r\n this.canSend = false;\r\n this.search();\r\n },\r\n // 备注修改成功\r\n submitFail() {\r\n // this.getOrderList();\r\n // this.getData(this.orderId,1);\r\n },\r\n // 获取退款表单数据\r\n getRefundData() {\r\n if (this.selectOrderData.refund_type === 2) {\r\n this.delfromData = {\r\n title: '是否立即退货',\r\n url: `/refund/agree/${this.selectOrderData.id}`,\r\n method: 'get',\r\n };\r\n this.$modalSure(this.delfromData)\r\n .then((res) => {\r\n this.$Message.success(res.msg);\r\n // this.getOrderList();\r\n // this.getData(this.orderId, 1);\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n } else {\r\n this.refundVisible = true\r\n return\r\n this.$modalForm(\r\n getRefundOrderFrom(this.selectOrderData.orderId.id)\r\n ).then(() => {\r\n // this.getOrderList();\r\n // this.getData(this.orderId, 1);\r\n this.selectOrderData.orderId.refund_status = 2;\r\n this.$emit('changeGetTabs');\r\n });\r\n }\r\n },\r\n // 订单详情\r\n getOrderInfo(id) {\r\n if (id)\r\n getOrderInfo(id)\r\n .then((res) => {\r\n this.orderInfoData = res.data;\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n selectOrder(data) {\r\n this.sle = 0;\r\n this.table_id = data.id;\r\n },\r\n tabClick(index) {\r\n switch (index) {\r\n case 1:\r\n this.getOrderInfo(this.selectOrderData.oid);\r\n }\r\n this.sle = index;\r\n },\r\n // 获取订单列表\r\n getOrderList() {\r\n getTableList(this.orderData)\r\n .then((res) => {\r\n this.count = res.data.count;\r\n let orderListData = res.data.data.map((item) => {\r\n const { category, table_number } = item.qrcode;\r\n let _infoData = [];\r\n if (!Array.isArray(item.cartList)) {\r\n Object.keys(item.cartList).forEach((key) => {\r\n _infoData.push({ cart_info: item.cartList[key] });\r\n });\r\n }\r\n item.color = '#f5222d';\r\n item.pink_name = `${category.name}${table_number}`;\r\n item._infoData = _infoData;\r\n item.pay_price = item.sum_price;\r\n item.total_num = item.cart_num;\r\n return item;\r\n });\r\n this.orderListData = [\r\n ...this.orderListData,\r\n ...orderListData\r\n ];\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n getErpConfig() {\r\n erpConfig()\r\n .then((res) => {\r\n this.open_erp = res.data.open_erp;\r\n this.tengxun_map_key = res.data.tengxun_map_key;\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n orderRefund() {\r\n orderRefund(this.selectOrderData.oid, this.refundData).then(res => {\r\n this.refundVisible = false;\r\n this.$Message.success(res.msg);\r\n }).catch(err => {\r\n this.$Message.error(err.msg);\r\n });\r\n }\r\n },\r\n};\r\n",null]} \ No newline at end of file +{"remainingRequest":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js??ref--0-2!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue","mtime":1730197554391},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js","mtime":1570440814000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\r\nimport recharge from '@/components/recharge';\r\nimport storeList from '@/components/storeList';\r\nimport orderList from '@/components/orderList';\r\nimport goodsList from '@/pages/hang/components/goodsList';\r\nimport userOrder from '@/pages/table/components/userOrder';\r\nimport orderDetails from '@/pages/table/components/orderDetails';\r\nimport orderRecord from '@/components/orderRecord';\r\nimport orderRemark from '@/components/orderRemark';\r\nimport filterModal from '@/components/filterModal';\r\nimport orderSend from '@/pages/order/components/orderSend';\r\nimport \"../../assets/js/core.js\";\r\nimport {\r\n getOrderInfo,\r\n getRefundOrderFrom,\r\n erpConfig,\r\n getCodeList,\r\n getTableList,\r\n getTableUidAll,\r\n getCartList,\r\n cashierCartList,\r\n cashierCompute,\r\n cashierCode,\r\n cancelTable,\r\n editTableCart,\r\n staffPlace,\r\n swithUser,\r\n cashierCreate,\r\n getTableOrderInfo,\r\n payOffline,\r\n cashierPay,\r\n orderRefund,\r\n} from '@/api/order';\r\n\r\nexport default {\r\n components: {\r\n recharge,\r\n storeList,\r\n orderList,\r\n goodsList,\r\n userOrder,\r\n orderDetails,\r\n orderRemark,\r\n orderRecord,\r\n filterModal,\r\n orderSend,\r\n },\r\n data() {\r\n return {\r\n orderId: 0,\r\n orderListData: [],\r\n tabs: ['商品信息', '订单详情', '订单记录'],\r\n sle: 0,\r\n filterModal: false,\r\n userFrom: {\r\n keyword: '',\r\n page: 1,\r\n limit: 9,\r\n },\r\n orderData: {\r\n type: '10',\r\n status: '',\r\n time: '',\r\n staff_id: '',\r\n serial_number: '',\r\n page: 1,\r\n limit: 10,\r\n },\r\n selectOrderData: {},\r\n orderInfoData: {},\r\n count: 0,\r\n status: 0,\r\n pay_type: '',\r\n canSend: true,\r\n tengxun_map_key: '',\r\n open_erp: null,\r\n active: 1,\r\n modal2: false,\r\n modal: false,\r\n userInfo: {},\r\n storeInfos: {}, //门店店员信息\r\n storeList: [], //门店列表\r\n goodFrom: {\r\n store_name: '',\r\n field_key: 'all',\r\n cate_id: '',\r\n page: 1,\r\n limit: 12,\r\n uid: 0,\r\n staff_id: 0,\r\n },\r\n codeList: [],\r\n uid: 0,\r\n staff_id: 0,\r\n cart_ids: '',\r\n table_id: 0,\r\n payNum: '',\r\n createOrder: {\r\n remarks: '',\r\n change_price: 0,\r\n cart_id: [], // 购物车id\r\n userCode: '',\r\n is_price: 0,\r\n auth_code: '',\r\n },\r\n modalPay: false,\r\n priceInfo: {},\r\n orderSystem: {\r\n loadingMsg: null,\r\n timer: null,\r\n },\r\n modalCash: false,\r\n collectionArray: [],\r\n collection: 0,\r\n numList: ['7', '8', '9', '4', '5', '6', '1', '2', '3', '0', '.'],\r\n integral: false, //是否使用积分\r\n formItem: {\r\n price: 0,\r\n },\r\n discountPrice: 100,\r\n discount: false,\r\n isOrderCreate: 0,\r\n codeNum: \"\",\r\n refundVisible: false,\r\n refundData: {\r\n order_id: 0,\r\n refund_price: 0,\r\n }\r\n };\r\n },\r\n computed: {\r\n isCashierCartList: function () {\r\n let { uid, staff_id, cart_ids } = this;\r\n let { oid } = this.selectOrderData;\r\n return {\r\n uid,\r\n staff_id,\r\n cart_ids,\r\n oid,\r\n };\r\n },\r\n },\r\n watch: {\r\n count(value) {\r\n if (value) {\r\n this.table_id = this.orderListData[0].id;\r\n } else {\r\n this.selectOrderData = {};\r\n }\r\n },\r\n table_id(value) {\r\n let result = this.orderListData.find(({ id }) => id == value);\r\n this.selectOrderData = {};\r\n this.uid = 0;\r\n if (result) {\r\n this.selectOrderData = { ...result };\r\n this.getTableUidAll();\r\n }\r\n },\r\n uid(value) {\r\n if (value && this.selectOrderData.status == 1) {\r\n this.getCartList();\r\n } else {\r\n this.cart_ids = '';\r\n }\r\n },\r\n cart_ids(value) {\r\n if (value) {\r\n this.cashierCompute();\r\n } else {\r\n this.formItem.price = this.unchangedPrice = 0;\r\n }\r\n },\r\n integral() {\r\n this.cashierCompute();\r\n },\r\n isCashierCartList(newVal, oldVal) {\r\n const { uid, staff_id, cart_ids, oid } = newVal;\r\n let flag = true;\r\n for (const key in newVal) {\r\n if (Object.hasOwnProperty.call(newVal, key)) {\r\n if (newVal[key] != oldVal[key]) {\r\n flag = false;\r\n break;\r\n }\r\n }\r\n }\r\n if (!flag) {\r\n if (uid && staff_id && cart_ids && !oid) {\r\n this.cashierCartList();\r\n }\r\n }\r\n },\r\n 'selectOrderData.oid'(value) {\r\n if (value) {\r\n this.getTableOrderInfo();\r\n }\r\n },\r\n active(value) {\r\n if (value == 2) {\r\n this.getCodeList();\r\n }\r\n if (this.timer) {\r\n clearTimeout(this.timer);\r\n }\r\n }\r\n },\r\n created() {\r\n this.getOrderList();\r\n this.getErpConfig();\r\n },\r\n methods: {\r\n numberChange(value) {\r\n this.$nextTick(() => {\r\n let string = Number(value).toString();\r\n let index = string.indexOf('.');\r\n if (-1 === index || 2 >= string.length - index - 1) {\r\n this.refundData.refund_price = Number(string);\r\n } else {\r\n this.refundData.refund_price = Number(Number(string).toFixed(2));\r\n }\r\n });\r\n },\r\n jsToJava(){\r\n try {\r\n window.Jsbridge.invoke('openCacheBox',JSON.stringify({'p1-key':'p1-value'}), this.myFunction() );\r\n }catch (e) {\r\n\r\n }\r\n },\r\n myFunction(){\r\n\r\n },\r\n // 线下确定结算\r\n payOffline() {\r\n payOffline(this.selectOrderData.oid).then(() => {\r\n this.$Message.success('支付成功');\r\n this.selectOrderData.orderId.paid = 1;\r\n for (const selectOrderData of this.orderListData) {\r\n if (selectOrderData.id == this.selectOrderData.id) {\r\n selectOrderData.orderId.paid = 1;\r\n break;\r\n }\r\n }\r\n }).catch(err => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n // 获取订单信息\r\n getTableOrderInfo() {\r\n getTableOrderInfo(this.selectOrderData.oid).then(res => {\r\n this.selectOrderData = { ...this.selectOrderData, orderId: res.data, is_cashier_yue_pay_verify: res.data.is_cashier_yue_pay_verify };\r\n this.refundData.order_id = res.data.order_id;\r\n this.refundData.refund_price = +res.data.pay_price;\r\n });\r\n },\r\n // 线上支付和余额支付\r\n confirm() {\r\n if (this.payType == \"yue\") {\r\n if (!this.createOrder.userCode && this.selectOrderData.is_cashier_yue_pay_verify) {\r\n return this.$Message.error(\"请扫描个人中心二维码\");\r\n }\r\n if (this.isOrderCreate) {\r\n this.getCashierPay(\"yue\");\r\n } else {\r\n this.orderCreate();\r\n }\r\n } else if (this.payType == \"\") {\r\n if (!this.createOrder.auth_code) {\r\n return this.$Message.error(\"请扫描您的付款码\");\r\n }\r\n if (this.isOrderCreate) {\r\n this.getCashierPay(\"\");\r\n } else {\r\n this.orderCreate();\r\n }\r\n }\r\n },\r\n getCashierPay(payType) {\r\n let data = {\r\n payType: payType,\r\n userCode: this.payNum,\r\n auth_code: this.payNum,\r\n };\r\n if (payType == \"cash\") {\r\n if (parseFloat(this.selectOrderData.payPrice) > parseFloat(this.collection)) {\r\n return this.$Message.error(\"您付款金额不足\");\r\n }\r\n }\r\n cashierPay(this.selectOrderData.orderId.order_id, data)\r\n .then((res) => {\r\n this.payNum = \"\";\r\n if (res.data.status == \"SUCCESS\") {\r\n this.isOrderCreate = 0;\r\n this.$Message.success(\"支付成功\");\r\n this.modalCash = false;\r\n this.modalPay = false;\r\n // this.changePoints();\r\n // let storage = window.localStorage;\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.clear();\r\n // this.goodList();\r\n this.selectOrderData.orderId.paid = 1;\r\n for (const selectOrderData of this.orderListData) {\r\n if (selectOrderData.id == this.selectOrderData.id) {\r\n selectOrderData.orderId.paid = 1;\r\n break;\r\n }\r\n }\r\n //现金收款打开钱箱\r\n if (payType == \"cash\") {\r\n this.jsToJava();\r\n }\r\n } else if (res.data.status == \"PAY_ING\") {\r\n let msg = this.$Message.loading({\r\n content: \"等待支付中...\",\r\n duration: 0,\r\n });\r\n this.orderSystem.loadingMsg = msg;\r\n this.orderId = res.data.order_id;\r\n this.checkOrderTime(msg);\r\n // this.confirmOrder();\r\n } else {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.error(res.data.message);\r\n }\r\n })\r\n .catch((err) => {\r\n this.payNum = \"\";\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n // 创建订单\r\n orderCreate() {\r\n if (this.payType == \"cash\") {\r\n if (parseFloat(this.selectOrderData.payPrice) > parseFloat(this.collection)) {\r\n return this.$Message.error(\"您付款金额不足\");\r\n }\r\n }\r\n // this.createOrder.tourist_uid = this.userInfo.touristId;\r\n this.createOrder.new = 1;\r\n this.createOrder.collate_code_id = this.table_id;\r\n this.createOrder.cart_id = this.cart_ids.split(',');\r\n cashierCreate(this.uid, this.createOrder)\r\n .then((res) => {\r\n let storage = window.localStorage;\r\n this.payNum = \"\";\r\n if (this.payType == \"yue\") {\r\n this.modalPay = false;\r\n this.payNum = \"\";\r\n this.createOrder.userCode = \"\";\r\n if (res.data.status == \"ORDER_CREATE\") {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.success(res.data.message);\r\n } else if (res.data.status == \"SUCCESS\") {\r\n this.isOrderCreate = 0;\r\n this.$Message.success(\"支付成功\");\r\n // let money = this.$computes.Sub(\r\n // this.userInfo.now_money,\r\n // this.priceInfo.payPrice\r\n // );\r\n // this.userInfo.now_money = money;\r\n // this.changePoints();\r\n this.payTypeModal = false;\r\n this.modalPay = false;\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.goodList();\r\n this.selectOrderData = { ...this.selectOrderData, oid: res.data.oid };\r\n for (const orderData of this.orderListData) {\r\n if (orderData.id == this.selectOrderData.id) {\r\n orderData.status = 2;\r\n orderData.oid = res.data.oid;\r\n if (Object.prototype.toString.call(orderData.orderId) != '[object Object]') {\r\n orderData.orderId = {};\r\n }\r\n orderData.orderId = { ...orderData.orderId, paid: 1 };\r\n break;\r\n }\r\n }\r\n // this.clear();\r\n } else {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.error(res.data.message);\r\n }\r\n }\r\n if (this.payType == \"cash\") {\r\n if (res.data.status == \"SUCCESS\") {\r\n this.$Message.success(\"支付成功\");\r\n // storage.removeItem(\"cashierUser\");\r\n // this.userInfo = null;\r\n // this.changePoints();\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.getOrderList();\r\n this.selectOrderData = { ...this.selectOrderData, oid: res.data.oid };\r\n for (const orderData of this.orderListData) {\r\n if (orderData.id == this.selectOrderData.id) {\r\n orderData.status = 2;\r\n orderData.oid = res.data.oid;\r\n if (Object.prototype.toString.call(orderData.orderId) != '[object Object]') {\r\n orderData.orderId = {};\r\n }\r\n orderData.orderId = { ...orderData.orderId, paid: 1 };\r\n break;\r\n }\r\n }\r\n this.modalCash = false;\r\n this.payTypeModal = false;\r\n // this.clear();\r\n this.jsToJava();\r\n }\r\n }\r\n if (this.payType == \"\") {\r\n this.payNum = \"\";\r\n this.createOrder.auth_code = \"\";\r\n if (res.data.status == \"ORDER_CREATE\") {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.success(res.data.message);\r\n } else if (res.data.status == \"PAY_ING\") {\r\n let msg = this.$Message.loading({\r\n content: \"等待支付中...\",\r\n duration: 0,\r\n });\r\n this.orderId = res.data.order_id;\r\n this.checkOrderTime(msg);\r\n } else if (res.data.status == \"SUCCESS\") {\r\n this.$Message.success(\"支付成功\");\r\n // storage.removeItem(\"cashierUser\");\r\n // this.userInfo = null;\r\n // this.setUp();\r\n // this.changePoints();\r\n // storage.setItem(\"cashierUser\", JSON.stringify(this.userInfo));\r\n // this.goodList();\r\n this.selectOrderData = { ...this.selectOrderData, oid: res.data.oid };\r\n for (const orderData of this.orderListData) {\r\n if (orderData.id == this.selectOrderData.id) {\r\n orderData.status = 2;\r\n orderData.oid = res.data.oid;\r\n if (Object.prototype.toString.call(orderData.orderId) != '[object Object]') {\r\n orderData.orderId = {};\r\n }\r\n orderData.orderId = { ...orderData.orderId, paid: 1 };\r\n break;\r\n }\r\n }\r\n this.modalPay = false;\r\n this.clear();\r\n } else {\r\n this.isOrderCreate = 1;\r\n this.orderId = res.data.order_id;\r\n this.$Message.error(res.data.message);\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n this.payNum = \"\";\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n //输入实际收款金额\r\n numTap(item) {\r\n if (this.defaultcalc === false) {\r\n this.collection = \"\";\r\n this.defaultcalc = true;\r\n }\r\n let x = String(this.collection).indexOf(\".\") + 1;\r\n let y = String(this.collection).length - x;\r\n if (x === 0 || y < 2) {\r\n if (this.collectionArray.join(\"\") <= 9999999) {\r\n this.collectionArray.push(item);\r\n }\r\n this.collection =\r\n this.collectionArray.join(\"\") > 99999999\r\n ? 99999999\r\n : this.collectionArray.join(\"\");\r\n }\r\n },\r\n getSwithUser(data){\r\n swithUser(data).then(res=>{}).catch(err=>{\r\n this.$Message.error(err.msg);\r\n })\r\n },\r\n //点击出现优惠明细\r\n discountCon() {\r\n this.discount = true;\r\n },\r\n // 打单\r\n staffPlace() {\r\n staffPlace({\r\n tableId: this.table_id,\r\n })\r\n .then((res) => {})\r\n .catch((res) => {\r\n this.$Message.error(res.msg);\r\n });\r\n },\r\n calculate(data) {\r\n editTableCart({\r\n productId: data.product_id,\r\n cartNum: 1,\r\n uniqueId: data.product_attr_unique || 0,\r\n tableId: this.table_id,\r\n isAdd: data.isAdd,\r\n })\r\n .then((res) => {\r\n this.getCartList();\r\n })\r\n .catch((res) => {\r\n this.$Message.error(res.msg);\r\n });\r\n },\r\n // 取消桌码订单\r\n cancelTable() {\r\n this.$Modal.confirm({\r\n title: '取消该桌码订单',\r\n content:\r\n '

确定要取消该桌码订单吗?

取消该桌码订单后将无法恢复,请谨慎操作!

',\r\n onOk: () => {\r\n cancelTable({\r\n tableId: this.selectOrderData.id,\r\n qrcode_id: this.selectOrderData.qrcode_id,\r\n }).then((res) => {\r\n this.$Message.success('取消该桌码订单成功');\r\n for (let i = 0; i < this.orderListData.length; i++) {\r\n if (this.orderListData[i].id == this.selectOrderData.id) {\r\n if (this.orderListData[i + 1]) {\r\n this.table_id = this.orderListData[i + 1].id;\r\n } else if (this.orderListData[i - 1]) {\r\n this.table_id = this.orderListData[i - 1].id;\r\n } else {\r\n this.table_id = 0;\r\n }\r\n this.orderListData.splice(i, 1);\r\n break;\r\n }\r\n }\r\n });\r\n },\r\n });\r\n },\r\n onSubmit2() {\r\n if (this.formItem.price >= 0 && this.formItem.price != null) {\r\n // this.priceInfo.payPrice = this.formItem.price;\r\n this.selectOrderData.payPrice = this.formItem.price;\r\n this.$Message.success('改价成功');\r\n this.createOrder.is_price = 1;\r\n this.createOrder.change_price = this.formItem.price;\r\n this.getSwithUser({ change_price: this.formItem.price });\r\n this.cancelPrice();\r\n this.modal2 = false;\r\n } else {\r\n return this.$Message.error('价格不能为空');\r\n }\r\n },\r\n tapDiscount() {\r\n this.formItem.price =\r\n this.$computes\r\n .Mul(this.unchangedPrice || 0, this.discountPrice / 100 || 0)\r\n .toFixed(2) || 0;\r\n },\r\n tapPrice() {\r\n this.formItem.price = Number(this.formItem.price.toFixed(2));\r\n let num = this.$computes.Div(\r\n this.formItem.price || 0,\r\n this.unchangedPrice || 0\r\n );\r\n this.discountPrice = Number((num * 100).toFixed(2)) || 0;\r\n },\r\n cancelPrice() {\r\n this.formItem.price = this.priceInfo.payPrice || 0;\r\n this.tapPrice();\r\n },\r\n // 点击改价\r\n changePrice() {\r\n this.modal2 = true;\r\n this.formItem.price = this.selectOrderData.payPrice || 0;\r\n },\r\n // 计算金额\r\n cartCompute() {\r\n if (!this.cartList.length) {\r\n this.priceInfo = {};\r\n return;\r\n }\r\n let ids = [];\r\n this.cartList.forEach((item) => {\r\n item.cart.forEach((good) => {\r\n ids.push(good.id);\r\n });\r\n });\r\n this.createOrder.cart_id = ids;\r\n let data = {\r\n integral: this.integral,\r\n coupon: this.coupon,\r\n coupon_id: this.couponId,\r\n cart_id: ids,\r\n };\r\n cashierCompute(this.userInfo.uid, data)\r\n .then((res) => {\r\n this.priceInfo = res.data;\r\n this.unchangedPrice = this.priceInfo.payPrice || 0;\r\n this.formItem.price = this.priceInfo.payPrice || 0;\r\n this.tapPrice();\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n this.coupon = false;\r\n });\r\n },\r\n // 是否使用积分\r\n integralTap() {\r\n if (!this.selectOrderData.uid) {\r\n this.$Message.warning('请先选择用户再使用积分');\r\n return;\r\n }\r\n this.integral = !this.integral;\r\n if (this.integral) this.createOrder.is_price = 0;\r\n // this.cartCompute();\r\n },\r\n //清除计算机输入的数字\r\n delNum() {\r\n this.collectionArray.pop();\r\n this.collection = this.collectionArray.length\r\n ? this.collectionArray.join('')\r\n : 0;\r\n },\r\n //现金收款创建订单并支付\r\n cashBnt() {\r\n if (this.cashBntLoading) return;\r\n this.cashBntLoading = true;\r\n if (this.isOrderCreate) {\r\n this.getCashierPay('cash');\r\n } else {\r\n this.orderCreate();\r\n }\r\n setTimeout(() => {\r\n this.cashBntLoading = false;\r\n }, 1000);\r\n },\r\n cancel() {\r\n this.collection = 0;\r\n this.collectionArray = [];\r\n },\r\n // 监听键盘函数\r\n keyboard() {\r\n let that = this;\r\n\r\n function delNums(item) {\r\n that.collectionArray.pop();\r\n that.collection = that.collectionArray.length\r\n ? that.collectionArray.join('')\r\n : 0;\r\n }\r\n\r\n function numTaps(item) {\r\n if (that.defaultcalc === false) {\r\n that.collection = '';\r\n that.defaultcalc = true;\r\n }\r\n let x = String(that.collection).indexOf('.') + 1;\r\n let y = String(that.collection).length - x;\r\n if (x === 0 || y < 2) {\r\n if (that.collectionArray.join('') <= 9999999) {\r\n that.collectionArray.push(item);\r\n }\r\n that.collection =\r\n that.collectionArray.join('') > 99999999\r\n ? 99999999\r\n : that.collectionArray.join('');\r\n }\r\n }\r\n\r\n document.onkeydown = function (event) {\r\n let e = event || window.event;\r\n let key = e.keyCode;\r\n if (that.modalCash) {\r\n event.stopPropagation(); // 阻止事件冒泡传递\r\n event.preventDefault(); //阻止默认事件原有功能\r\n }\r\n switch (key) {\r\n case 96:\r\n case 48:\r\n numTaps(0);\r\n break;\r\n case 97:\r\n case 49:\r\n numTaps(1);\r\n break;\r\n case 98:\r\n case 50:\r\n numTaps(2);\r\n break;\r\n case 99:\r\n case 51:\r\n numTaps(3);\r\n break;\r\n case 100:\r\n case 52:\r\n numTaps(4);\r\n break;\r\n case 101:\r\n case 53:\r\n numTaps(5);\r\n break;\r\n case 102:\r\n case 54:\r\n numTaps(6);\r\n break;\r\n case 103:\r\n case 55:\r\n numTaps(7);\r\n break;\r\n case 104:\r\n case 56:\r\n numTaps(8);\r\n break;\r\n case 105:\r\n case 57:\r\n numTaps(9);\r\n break;\r\n case 110:\r\n numTaps('.');\r\n break;\r\n case 190:\r\n numTaps('.');\r\n break;\r\n case 8:\r\n delNums();\r\n break;\r\n }\r\n };\r\n },\r\n //扫码枪扫码,针对带有字母的\r\n inputSaoMa(e) {\r\n // setTimeout定时器的作用是,等待扫码枪输入完,拿到完整的二维码信息,再调接口(扫码枪输入速度大概8~20毫秒,手动输速度大概是80毫秒),否则拿不到完整的二维信息。\r\n let val = e;\r\n if (val === '') return false;\r\n clearTimeout(this.endTimeout);\r\n this.endTimeout = null;\r\n this.endTimeout = setTimeout(() => {\r\n // if (this.payNum === val) {\r\n // \tclearTimeout(this.endTimeout)\r\n // \tif (val) {\r\n // \t\tthis.createOrder.userCode = val;\r\n // \t\tthis.createOrder.auth_code = val;\r\n // \t\tthis.confirm();\r\n // \t}\r\n // }\r\n if (this.codeNum === val) {\r\n clearTimeout(this.endTimeout);\r\n if (val) {\r\n this.codeInfo({\r\n bar_code: val,\r\n });\r\n }\r\n }\r\n }, 500);\r\n },\r\n modalPayCancel() {\r\n this.$Message.destroy();\r\n if (this.orderSystem.timer) {\r\n clearInterval(this.orderSystem.timer);\r\n this.orderSystem.timer = null;\r\n }\r\n },\r\n codeInfo(data) {\r\n // data.uid = this.userInfo ? this.userInfo.uid : 0;\r\n data.uid = this.uid;\r\n data.staff_id = this.storeInfos.id;\r\n // data.tourist_uid = this.userInfo.touristId;\r\n // if (this.userInfo == null) {\r\n // this.codeNum = '';\r\n // return this.$Message.error('请添加或选择用户');\r\n // }\r\n cashierCode(data)\r\n .then((res) => {\r\n this.codeNum = '';\r\n let data = res.data;\r\n if (data.hasOwnProperty('userInfo')) {\r\n // 用户 Object.keys(this.userInfo).length\r\n if (this.userInfo) {\r\n this.$Modal.confirm({\r\n title: '切换用户',\r\n content: '

确定要切换用户吗?

',\r\n onOk: () => {\r\n this.userInfo = res.data.userInfo;\r\n let storage = window.localStorage;\r\n storage.setItem(\r\n 'cashierUser',\r\n JSON.stringify(res.data.userInfo)\r\n );\r\n this.getCartList();\r\n },\r\n onCancel: () => {},\r\n });\r\n } else {\r\n this.userInfo = res.data.userInfo;\r\n let storage = window.localStorage;\r\n storage.setItem('cashierUser', JSON.stringify(res.data.userInfo));\r\n }\r\n }\r\n this.goodList();\r\n this.getCartList();\r\n })\r\n .catch((err) => {\r\n this.codeNum = '';\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n payPrice(payType) {\r\n this.payType = payType;\r\n if (this.selectOrderData.oid) {\r\n this.isOrderCreate = true;\r\n this.selectOrderData.payPrice = Number(this.selectOrderData.pay_price) || 0;\r\n }\r\n if (payType == '' || payType == 'yue') {\r\n this.createOrder.userCode = '';\r\n this.createOrder.auth_code = '';\r\n this.payNum = '';\r\n if (payType == '' || this.selectOrderData.is_cashier_yue_pay_verify) {\r\n this.modalPay = true;\r\n let that = this;\r\n this.$nextTick(() => {\r\n this.$refs.focusNum.focus();\r\n document.onkeydown = function (e) {\r\n if (e.which == 13) {\r\n if (that.payNum) {\r\n that.createOrder.userCode = that.payNum;\r\n that.createOrder.auth_code = that.payNum;\r\n that.confirm();\r\n }\r\n if (that.codeNum) {\r\n that.codeInfo({\r\n bar_code: that.codeNum,\r\n });\r\n }\r\n }\r\n };\r\n });\r\n } else {\r\n this.confirm();\r\n }\r\n } else if (payType == 'cash') {\r\n this.modalCash = true;\r\n // this.collection = this.priceInfo.payPrice ? this.priceInfo.payPrice : 0;\r\n if (this.selectOrderData.oid) {\r\n this.isOrderCreate = true;\r\n this.selectOrderData.payPrice = Number(this.selectOrderData.pay_price) || 0;\r\n }\r\n this.collection = this.selectOrderData.payPrice || 0;\r\n this.keyboard();\r\n }\r\n this.createOrder.integral = this.integral;\r\n this.createOrder.coupon = this.coupon;\r\n this.createOrder.coupon_id = this.couponId;\r\n if (this.coupon && !this.couponId)\r\n return this.$Message.error('请选择有效优惠券');\r\n this.createOrder.pay_type = payType;\r\n this.createOrder.staff_id = this.storeInfos.id;\r\n // this.fapi.resetFields();\r\n },\r\n // 选择用户\r\n userChange(uid) {\r\n this.uid = uid;\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n uid,\r\n };\r\n },\r\n cashierCompute() {\r\n cashierCompute(this.uid, {\r\n new: 1,\r\n coupon_id: 0,\r\n coupon: false,\r\n integral: this.integral,\r\n cart_id: this.cart_ids.split(','),\r\n }).then((res) => {\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n ...res.data,\r\n };\r\n this.formItem.price = this.unchangedPrice =\r\n this.selectOrderData.payPrice;\r\n });\r\n },\r\n tiaozhuan(table_id) {\r\n console.log(table_id)\r\n var table_id = table_id\r\n const url = window.location.origin + '/cashier/table/index2?tiaozhuan_table_id='+table_id;\r\n window.open(url, '_blank');\r\n // this.$router.push({\r\n // path:`/cashier/table/index2`\r\n // })\r\n },\r\n\r\n\r\n // 获取购物车商品\r\n cashierCartList() {\r\n cashierCartList(this.uid, this.staff_id, {\r\n new: 1,\r\n cart_ids: this.cart_ids,\r\n }).then((res) => {\r\n let { valid } = res.data;\r\n let _info = [];\r\n if (valid.length) {\r\n _info = valid;\r\n }\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n orderId: { _info },\r\n };\r\n });\r\n },\r\n // 获取桌码订单cartid\r\n getCartList() {\r\n getCartList({\r\n table_id: this.table_id,\r\n uid: this.uid,\r\n }).then((res) => {\r\n this.cart_ids = res.msg;\r\n });\r\n },\r\n // 获取桌码订单用户\r\n getTableUidAll() {\r\n getTableUidAll({\r\n table_id: this.table_id,\r\n }).then((res) => {\r\n const data = res.data;\r\n if (data.length) {\r\n this.uid = data[0].uid;\r\n }\r\n this.selectOrderData = {\r\n ...this.selectOrderData,\r\n userList: data,\r\n uid: this.uid\r\n };\r\n });\r\n },\r\n // 桌码列表\r\n getCodeList() {\r\n getCodeList().then((res) => {\r\n this.codeList = res.data.filter((item) => {\r\n return item.tableQrcode.length;\r\n });\r\n this.timer = setTimeout(this.getCodeList, 60000);\r\n });\r\n },\r\n // 充值\r\n rechargeBnt(userInfo) {\r\n this.userInfo = userInfo;\r\n this.$refs.recharge.modal = true;\r\n },\r\n getSuccess(e) {\r\n let money = this.$computes.Add(this.userInfo.now_money, e);\r\n this.userInfo.now_money = money;\r\n let storage = window.localStorage;\r\n storage.setItem('cashierUser', JSON.stringify(this.userInfo));\r\n },\r\n // 选择店员\r\n storeTap() {\r\n this.$refs.store.modals = true;\r\n this.$refs.store.cancel();\r\n },\r\n // 门店店员信息以及门店店员列表\r\n getUserInfo(e) {\r\n this.staff_id = e.users.id;\r\n this.storeInfos = e.users;\r\n this.storeList = e.storeList;\r\n this.goodFrom.staff_id = e.users.id;\r\n sessionStorage.setItem('staffInfo', JSON.stringify(e.users));\r\n if (this.userInfo) {\r\n // this.getCartList();\r\n } else {\r\n // this.setUp();\r\n }\r\n // this.goodList();\r\n // this.hangDataList();\r\n // this.hangList();\r\n },\r\n // 当前选中门店店员信息\r\n getStoreId(e) {\r\n // this.clear();\r\n this.storeList.forEach((i) => {\r\n if (i.id == e.id) {\r\n this.storeInfos = i;\r\n this.staff_id = i.id;\r\n // sessionStorage.setItem('staffInfo', JSON.stringify(e));\r\n // this.goodFrom.staff_id = e.id;\r\n // this.storeInfos = i;\r\n // this.getCartList();\r\n // this.goodList();\r\n // this.hangDataList();\r\n // this.hangList();\r\n // this.getSwithUser({cashier_id:e.id});\r\n }\r\n });\r\n },\r\n orderSend() {\r\n this.$store.commit(\r\n 'store/order/setSplitOrder',\r\n this.selectOrderData.total_num\r\n );\r\n this.$refs.send.modals = true;\r\n this.orderId = this.selectOrderData.id;\r\n this.status = this.selectOrderData._status;\r\n this.pay_type = this.selectOrderData.pay_type;\r\n this.$refs.send.getList();\r\n this.$refs.send.getDeliveryList();\r\n this.$nextTick((e) => {\r\n this.$refs.send.getCartInfo(\r\n this.selectOrderData._status,\r\n this.selectOrderData.id\r\n );\r\n });\r\n },\r\n addPage() {\r\n if (this.orderListData.length < this.count) this.orderData.page++;\r\n this.getOrderList();\r\n },\r\n searchList(data) {\r\n let status = '';\r\n this.filterModal = false;\r\n switch (data.status) {\r\n case 0:\r\n status = 1;\r\n break;\r\n case 3:\r\n status = 2;\r\n break;\r\n case 4:\r\n status = 3;\r\n break;\r\n }\r\n this.orderData = { ...this.orderData, ...data, status };\r\n this.orderData.type = '';\r\n // this.orderListData = [];\r\n this.sle = 0;\r\n this.search();\r\n },\r\n point() {\r\n this.delfromData = {\r\n title: '立即打印订单',\r\n info: '您确认打印此订单吗?',\r\n url: `/order/print/${this.selectOrderData.oid}`,\r\n method: 'get',\r\n ids: '',\r\n };\r\n this.$modalSure(this.delfromData)\r\n .then((res) => {\r\n this.$Message.success(res.msg);\r\n })\r\n .catch((res) => {\r\n this.$Message.error(res.msg);\r\n });\r\n },\r\n search() {\r\n this.orderData.page = 1;\r\n this.orderListData = [];\r\n this.getOrderList();\r\n },\r\n // 设置备注\r\n remarks() {\r\n this.$refs.remarks.modals = true;\r\n this.$refs.remarks.formValidate.remark =\r\n this.selectOrderData.orderId.remark;\r\n },\r\n send() {\r\n this.canSend = false;\r\n this.search();\r\n },\r\n // 备注修改成功\r\n submitFail() {\r\n // this.getOrderList();\r\n // this.getData(this.orderId,1);\r\n },\r\n // 获取退款表单数据\r\n getRefundData() {\r\n if (this.selectOrderData.refund_type === 2) {\r\n this.delfromData = {\r\n title: '是否立即退货',\r\n url: `/refund/agree/${this.selectOrderData.id}`,\r\n method: 'get',\r\n };\r\n this.$modalSure(this.delfromData)\r\n .then((res) => {\r\n this.$Message.success(res.msg);\r\n // this.getOrderList();\r\n // this.getData(this.orderId, 1);\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n } else {\r\n this.refundVisible = true\r\n return\r\n this.$modalForm(\r\n getRefundOrderFrom(this.selectOrderData.orderId.id)\r\n ).then(() => {\r\n // this.getOrderList();\r\n // this.getData(this.orderId, 1);\r\n this.selectOrderData.orderId.refund_status = 2;\r\n this.$emit('changeGetTabs');\r\n });\r\n }\r\n },\r\n // 订单详情\r\n getOrderInfo(id) {\r\n if (id)\r\n getOrderInfo(id)\r\n .then((res) => {\r\n this.orderInfoData = res.data;\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n selectOrder(data) {\r\n this.sle = 0;\r\n this.table_id = data.id;\r\n },\r\n tabClick(index) {\r\n switch (index) {\r\n case 1:\r\n this.getOrderInfo(this.selectOrderData.oid);\r\n }\r\n this.sle = index;\r\n },\r\n // 获取订单列表\r\n getOrderList() {\r\n getTableList(this.orderData)\r\n .then((res) => {\r\n this.count = res.data.count;\r\n let orderListData = res.data.data.map((item) => {\r\n const { category, table_number } = item.qrcode;\r\n let _infoData = [];\r\n if (!Array.isArray(item.cartList)) {\r\n Object.keys(item.cartList).forEach((key) => {\r\n _infoData.push({ cart_info: item.cartList[key] });\r\n });\r\n }\r\n item.color = '#f5222d';\r\n item.pink_name = `${category.name}${table_number}`;\r\n item._infoData = _infoData;\r\n item.pay_price = item.sum_price;\r\n item.total_num = item.cart_num;\r\n return item;\r\n });\r\n this.orderListData = [\r\n ...this.orderListData,\r\n ...orderListData\r\n ];\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n getErpConfig() {\r\n erpConfig()\r\n .then((res) => {\r\n this.open_erp = res.data.open_erp;\r\n this.tengxun_map_key = res.data.tengxun_map_key;\r\n })\r\n .catch((err) => {\r\n this.$Message.error(err.msg);\r\n });\r\n },\r\n orderRefund() {\r\n orderRefund(this.selectOrderData.oid, this.refundData).then(res => {\r\n this.refundVisible = false;\r\n this.$Message.success(res.msg);\r\n }).catch(err => {\r\n this.$Message.error(err.msg);\r\n });\r\n }\r\n },\r\n};\r\n",null]} \ No newline at end of file diff --git a/收银台/cashier/node_modules/.cache/vue-loader/b9a863e967d933d64a86130167576886.json b/收银台/cashier/node_modules/.cache/vue-loader/b9a863e967d933d64a86130167576886.json index 0de8ec958..1f6259afe 100644 --- a/收银台/cashier/node_modules/.cache/vue-loader/b9a863e967d933d64a86130167576886.json +++ b/收银台/cashier/node_modules/.cache/vue-loader/b9a863e967d933d64a86130167576886.json @@ -1 +1 @@ -{"remainingRequest":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js??ref--0-2!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue?vue&type=template&id=68976006&scoped=true&","dependencies":[{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue","mtime":1730102795020},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\loaders\\templateLoader.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js","mtime":1570440814000}],"contextDependencies":[],"result":["\n
\n
\n
\n
\n
\n
\n 订单列表\n
\n
\n 桌码管理\n
\n
\n
\n {{ filterModal ? '关闭' : '筛选' }}\n \n
\n
\n
\n
\n \n
\n \n \n \"\"\n 噢~目前暂无订单\n
\n \n
\n
\n
\n
\n \n
\n {{ tab }}\n
\n
\n
\n
\n
\n \n\n \n \n \n
\n \"\"\n 噢~目前暂无挂单记录\n
\n
\n
\n \n
\n \n \n 0\n \"\n class=\"btn blue\"\n @click=\"getRefundData\"\n >立即退款\n
\n
\n \n \n \n
\n
\n
\n \n \n \n \n
\n
\n
\n
\n 订单列表\n
\n
\n 桌码管理\n
\n
\n
\n {{ filterModal ? '关闭' : '筛选' }}\n \n
\n
\n
\n
\n
{{ item.name }}(桌码分类)
\n\n
\n
    \n \n
    {{ qrcode.table_number }}
    \n \n\n \n\n
    空桌({{ qrcode.seat_num }}人桌)
    \n \n\n
\n\n\n\n
\n\n\n
\n
\n
\n \n \n
\n \n
\n
\n \n 元\n
\n
\n \n %\n
\n
\n
\n \n
\n ¥{{ formItem.price || 0 }}\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
应收金额(元)
\n
\n
\n ¥{{\n selectOrderData.payPrice ? selectOrderData.payPrice : 0\n }}\n
\n \n\n \n
\n
\n \n \n
\n
\n
\n
\n {{\n createOrder.pay_type == 'yue' ? '出示付款码' : '打开付款码'\n }}\n
\n
\n {{\n createOrder.pay_type == 'yue'\n ? '用户打开个人中心'\n : '微信/支付宝付款码'\n }}\n
\n
\n
\n
\n {{\n createOrder.pay_type == 'yue' ? '扫描付款码' : '贴合付款盒子'\n }}\n
\n
\n {{ createOrder.pay_type == 'yue' ? '扫码枪' : '等待完成支付' }}\n
\n
\n
\n
确认收款
\n
收银台确认
\n
\n
\n
\n \n \n
\n \n \n
\n
\n
\n \n
\n
应收金额(元)
\n
\n ¥{{ selectOrderData.payPrice || 0 }}\n
\n
\n
\n
\n
\n
实际收款(元)
\n
{{ collection }}
\n
\n
\n
需找零(元)
\n 0\n \"\n class=\"num\"\n >\n {{\n this.$computes.Sub(\n collection,\n selectOrderData.payPrice ? selectOrderData.payPrice : 0\n )\n }}\n
\n
0
\n
\n
\n \n {{ item }}\n
\n
\n \n
\n
\n
\n \n \n \n \n \n
\n
\n
订单原价
\n
¥{{ selectOrderData.sumPrice || (selectOrderData.orderId && selectOrderData.orderId.total_price) || 0 }}
\n
\n
\n
会员优惠金额:
\n
¥{{ selectOrderData.vipPrice || (selectOrderData.orderId && selectOrderData.orderId.vip_true_price) || 0 }}
\n
\n
\n
积分抵扣:
\n
¥{{ selectOrderData.usedIntegral || (selectOrderData.orderId && selectOrderData.orderId.deduction_price) || 0 }}
\n
\n \n
{{ item.title }}:
\n
¥{{ item.promotions_price || 0 }}
\n
\n \n \n \n
\n \n \n \n \n \n \n
\n
\n \n
\n
\n \n",null]} \ No newline at end of file +{"remainingRequest":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js??ref--0-2!D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue?vue&type=template&id=68976006&scoped=true&","dependencies":[{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\src\\pages\\table\\index.vue","mtime":1730197554391},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\loaders\\templateLoader.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000},{"path":"D:\\project\\admin.jiuhaosh.cn\\收银台\\cashier\\node_modules\\iview-loader\\index.js","mtime":1570440814000}],"contextDependencies":[],"result":["\n
\n
\n
\n
\n
\n
\n 订单列表\n
\n
\n 桌码管理\n
\n
\n
\n {{ filterModal ? '关闭' : '筛选' }}\n \n
\n
\n
\n
\n \n
\n \n \n \"\"\n 噢~目前暂无订单\n
\n \n
\n
\n
\n
\n \n
\n {{ tab }}\n
\n
\n
\n
\n
\n \n\n \n \n \n
\n \"\"\n 噢~目前暂无挂单记录\n
\n
\n
\n \n
\n \n \n 0\n \"\n class=\"btn blue\"\n @click=\"getRefundData\"\n >立即退款\n
\n
\n \n \n \n
\n
\n
\n \n \n \n \n
\n
\n
\n
\n 订单列表\n
\n
\n 桌码管理\n
\n
\n
\n {{ filterModal ? '关闭' : '筛选' }}\n \n
\n
\n
\n
\n
{{ item.name }}(桌码分类)
\n\n
\n
    \n \n
    {{ qrcode.table_number }}
    \n \n\n \n\n
    空桌({{ qrcode.seat_num }}人桌)
    \n \n\n
\n\n\n\n
\n\n\n
\n
\n
\n \n \n
\n \n
\n
\n \n 元\n
\n
\n \n %\n
\n
\n
\n \n
\n ¥{{ formItem.price || 0 }}\n
\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n
应收金额(元)
\n
\n
\n ¥{{\n selectOrderData.payPrice ? selectOrderData.payPrice : 0\n }}\n
\n \n\n \n
\n
\n \n \n
\n
\n
\n
\n {{\n createOrder.pay_type == 'yue' ? '出示付款码' : '打开付款码'\n }}\n
\n
\n {{\n createOrder.pay_type == 'yue'\n ? '用户打开个人中心'\n : '微信/支付宝付款码'\n }}\n
\n
\n
\n
\n {{\n createOrder.pay_type == 'yue' ? '扫描付款码' : '贴合付款盒子'\n }}\n
\n
\n {{ createOrder.pay_type == 'yue' ? '扫码枪' : '等待完成支付' }}\n
\n
\n
\n
确认收款
\n
收银台确认
\n
\n
\n
\n \n \n
\n \n \n
\n
\n
\n \n
\n
应收金额(元)
\n
\n ¥{{ selectOrderData.payPrice || 0 }}\n
\n
\n
\n
\n
\n
实际收款(元)
\n
{{ collection }}
\n
\n
\n
需找零(元)
\n 0\n \"\n class=\"num\"\n >\n {{\n this.$computes.Sub(\n collection,\n selectOrderData.payPrice ? selectOrderData.payPrice : 0\n )\n }}\n
\n
0
\n
\n
\n \n {{ item }}\n
\n
\n \n
\n
\n
\n \n \n \n \n \n
\n
\n
订单原价
\n
¥{{ selectOrderData.sumPrice || (selectOrderData.orderId && selectOrderData.orderId.total_price) || 0 }}
\n
\n
\n
会员优惠金额:
\n
¥{{ selectOrderData.vipPrice || (selectOrderData.orderId && selectOrderData.orderId.vip_true_price) || 0 }}
\n
\n
\n
积分抵扣:
\n
¥{{ selectOrderData.usedIntegral || (selectOrderData.orderId && selectOrderData.orderId.deduction_price) || 0 }}
\n
\n \n
{{ item.title }}:
\n
¥{{ item.promotions_price || 0 }}
\n
\n \n \n \n
\n \n \n \n \n \n \n
\n
\n \n
\n
\n \n",null]} \ No newline at end of file