index.vue 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592
  1. <template>
  2. <div id="app" class="app-container">
  3. <el-drawer
  4. :withHeader="false"
  5. :visible.sync="isOpen"
  6. direction="ttb"
  7. size="100%"
  8. :before-close="handleClose"
  9. :show-close="false"
  10. >
  11. <div class="main">
  12. <div class="top-nav">{{ $t('huan-ying-shi-yong') }} {{ systemName }}</div>
  13. <div class="left-side">
  14. <div class="logo">
  15. <!-- <i class="logout el-icon-d-arrow-left" @click="logout"></i> -->
  16. <div class="title">
  17. {{ $t('cashierDesk') }}
  18. </div>
  19. <div class="store" v-if="storeInfo">({{ storeInfo.name }})</div>
  20. <div class="account">{{ $t('hello') }},{{ accountInfo.realName }}!</div>
  21. </div>
  22. <div class="cate">
  23. <ul class="nav">
  24. <li class="nav-item" v-for="menu in menuList">
  25. <a
  26. :class="'nav-link' + (activeMenu == menu.key ? ' active' : '')"
  27. href="javascript:;"
  28. @click="switchMenu(menu.key)"
  29. >
  30. <div class="cate-logo-div">
  31. <img class="cate-logo" :src="menu.logo" />
  32. </div>
  33. <span>{{ menu.name }}</span>
  34. </a>
  35. </li>
  36. </ul>
  37. </div>
  38. </div>
  39. <div class="cart-container" v-if="activeMenu == 'cashier'">
  40. <div class="title">
  41. <div class="avatar">
  42. <img
  43. class="w-full h-full object-cover"
  44. v-if="!memberInfo || !memberInfo.avatar"
  45. src="@/assets/images/avatar.png"
  46. />
  47. <img class="w-full h-full object-cover" v-else :src="memberInfo.avatar" />
  48. </div>
  49. <div class="member-info">
  50. <span class="name" v-if="memberInfo">
  51. {{ memberInfo.mobile ? memberInfo.mobile : memberInfo.name }}
  52. </span>
  53. <span class="none" v-if="!memberInfo">当前为游客</span>
  54. <el-button v-if="hangNo" size="mini" class="switch" type="danger">
  55. {{ hangNo }}
  56. </el-button>
  57. </div>
  58. <LangTab style="position: absolute; right: 10px" size="mini"></LangTab>
  59. </div>
  60. <div class="carts">
  61. <div>
  62. <div class="tab">
  63. <div class="cart-list" v-if="cartList.length > 0">
  64. <div class="cart-item" v-for="cartInfo in cartList">
  65. <img class="image" :src="cartInfo.logo" />
  66. <div class="info">
  67. <div class="name">
  68. <template v-if="hangNo">{{ hangNo }}-</template>
  69. {{ cartInfo.name }}
  70. </div>
  71. <div class="spec" v-if="cartInfo.specList && cartInfo.specList.length > 0">
  72. <span class="item" v-for="spec in cartInfo.specList" :title="spec.value">
  73. {{ spec.value }}
  74. </span>
  75. </div>
  76. <div class="num">
  77. <el-input-number
  78. class="input"
  79. @change="changeBuyNum(cartInfo)"
  80. v-model="cartInfo.buyNum"
  81. :min="1"
  82. :max="1000"
  83. />
  84. </div>
  85. </div>
  86. <div class="option">
  87. <div
  88. class="remove el-icon-delete"
  89. @click="removeFromCart(cartInfo.cartId)"
  90. ></div>
  91. <div class="total">¥{{ (cartInfo.price * cartInfo.buyNum).toFixed(2) }}</div>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="empty" v-if="cartList.length < 1">
  96. <el-empty
  97. :description="$t('zan-wu-jie-suan-shang-pin')"
  98. :image-size="40"
  99. ></el-empty>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="footer">
  105. <div class="number">
  106. <div class="total-num">
  107. {{ $t('zong-jian-shu') }}:
  108. <b class="num">{{ cartTotalNum }}</b>
  109. </div>
  110. <div class="total-price">
  111. {{ $t('zong-jin-e') }}:
  112. <b class="num">¥{{ cartTotalPrice ? cartTotalPrice.toFixed(2) : '0.00' }}</b>
  113. </div>
  114. </div>
  115. <div class="options">
  116. <div
  117. :title="`${$t('gua-dan')} / ${$t('qu-dan')}`"
  118. class="cash truncate"
  119. @click="hangUp()"
  120. >
  121. {{ $t('gua-dan') }} / {{ $t('qu-dan') }}
  122. </div>
  123. <div class="submit truncate" v-if="cartTotalNum > 0" @click="doSettlement()">
  124. {{ $t('ti-jiao-jie-suan') }}
  125. </div>
  126. <div class="submit truncate" v-if="cartTotalNum == 0" @click="doCashier()">
  127. {{ $t('wu-shang-pin-shou-kuan') }}
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="main-list" v-if="activeMenu == 'cashier'">
  133. <div class="title">
  134. <div class="flex justify-between">
  135. <el-input
  136. v-model="searchForm.keyword"
  137. prefix-icon="el-icon-full-screen"
  138. @keyup.enter.native="doQueryGoods"
  139. :placeholder="`${$t('searchTips')}...`"
  140. clearable
  141. class="flex-1 mr-2 min-w-5"
  142. />
  143. <el-button
  144. class="search-goods mr-5 bg-[#f67f20] text-white"
  145. size="small"
  146. @click="doQueryGoods()"
  147. icon="el-icon-search"
  148. >
  149. {{ $t('cha-xun-shang-pin') }}
  150. </el-button>
  151. </div>
  152. <!-- <el-form class="search-form " ref="searchForm" :inline="true" :model="searchForm">
  153. <el-form-item prop="keyword">
  154. <el-input
  155. v-model="searchForm.keyword"
  156. prefix-icon="el-icon-full-screen"
  157. @keyup.enter.native="doQueryGoods"
  158. placeholder="请输入商品关键字:商品名称、条码、商品ID..."
  159. clearable
  160. style="width: 600px;"
  161. />
  162. </el-form-item>
  163. <el-button class="search-goods mr-5" size="small" @click="doQueryGoods()" icon="el-icon-search">
  164. 查询商品
  165. </el-button>
  166. </el-form> -->
  167. <el-tabs class="tab-box" v-model="navTab" @tab-click="switchTab">
  168. <el-tab-pane :label="$t('all')" name="0"></el-tab-pane>
  169. <el-tab-pane
  170. v-for="tab in tabList"
  171. :label="tab.name"
  172. :key="tab.id + ''"
  173. :name="tab.id + ''"
  174. ></el-tab-pane>
  175. </el-tabs>
  176. </div>
  177. <!-- <div class="grid grid-cols-3 gap-4">
  178. <div
  179. v-for="goodsInfo in goodsList"
  180. :key="product"
  181. class="bg-white rounded-lg shadow-sm overflow-hidden cursor-pointer hover:shadow-md transition"
  182. @click="clickGoods(goodsInfo)"
  183. >
  184. <img lazy :src="imagePath + goodsInfo.logo" class="w-full h-48 object-cover" />
  185. <div class="p-3">
  186. <h3 class="font-medium mb-2">{{ goodsInfo.name }}</h3>
  187. <div class="text-[#e74c3c]">¥{{ product.price }}</div>
  188. </div>
  189. </div>
  190. </div> -->
  191. <div class="goods-list">
  192. <div class="goods-item" v-for="goodsInfo in goodsList">
  193. <div
  194. class="bg-white rounded-lg shadow-sm overflow-hidden cursor-pointer hover:shadow-md transition"
  195. @click="clickGoods(goodsInfo)"
  196. >
  197. <!-- <img class="image" lazy :src="imagePath + goodsInfo.logo" />
  198. <div class="goods-name">{{ goodsInfo.name }}</div>
  199. <div class="goods-price">¥{{ goodsInfo.price }}</div> -->
  200. <img lazy :src="imagePath + goodsInfo.logo" class="w-full h-48 object-cover" />
  201. <div class="p-3">
  202. <h3 class="font-medium mb-2">{{ goodsInfo.name }}</h3>
  203. <div class="text-[#e74c3c]">¥{{ goodsInfo.price }}</div>
  204. </div>
  205. </div>
  206. </div>
  207. <pagination
  208. v-show="totalGoods > 0"
  209. :total="totalGoods"
  210. class="pagination"
  211. :page.sync="page"
  212. :limit.sync="pageSize"
  213. layout="total, sizes, prev, pager, next, jumper"
  214. @pagination="initCashier"
  215. />
  216. <el-empty
  217. v-if="goodsList.length == 0"
  218. :description="`${$t('zan-wu-shang-pin')}...`"
  219. ></el-empty>
  220. </div>
  221. </div>
  222. <!-- 订单列表组件 start-->
  223. <orderList v-if="activeMenu == 'order'" @doPayOrder="doPayOrder"></orderList>
  224. <!-- 订单列表组件 end-->
  225. <!-- 会员列表组件 start-->
  226. <memberList v-if="activeMenu == 'member'"></memberList>
  227. <!-- 会员列表组件 end-->
  228. <!-- 卡券核销组件 start-->
  229. <couponConfirm v-if="activeMenu == 'coupon'"></couponConfirm>
  230. <!-- 卡券核销组件 end-->
  231. </div>
  232. </el-drawer>
  233. <!-- 规格详情 start-->
  234. <el-dialog
  235. :title="$t('xuan-ze-shang-pin-gui-ge')"
  236. :visible.sync="openGoodsDialog"
  237. class="common-dialog"
  238. append-to-body
  239. >
  240. <div class="goods-info">
  241. <div class="name">{{ goodsInfo.name }}</div>
  242. <div class="price">¥{{ goodsInfo.price }}</div>
  243. <div class="num">
  244. <el-input-number class="input" v-model="goodsNum" :min="1" :max="1000" />
  245. </div>
  246. <div class="spec-list" v-if="goodsInfo.isSingleSpec == 'N'">
  247. <div class="spec-item" v-for="specInfo in goodsInfo.specList">
  248. <div class="spec-name">{{ specInfo.name }}</div>
  249. <div class="values">
  250. <span
  251. v-for="value in specInfo.child"
  252. :class="goodsSpecIds.includes(value.id) ? 'value active' : 'value'"
  253. @click="selectGoodsSpec(value.id)"
  254. >
  255. {{ value.name }}
  256. </span>
  257. </div>
  258. </div>
  259. </div>
  260. </div>
  261. <div slot="footer" class="dialog-footer">
  262. <el-button type="primary" class="main-button" @click="addToCart()">
  263. {{ $t('jia-ru-jie-suan') }}
  264. </el-button>
  265. <el-button @click="closeGoodsDialog()">{{ $t('qu-xiao') }}</el-button>
  266. </div>
  267. </el-dialog>
  268. <!-- 规格详情 end-->
  269. <!--关联会员对话框 start-->
  270. <switchMemberDialog :show-dialog="openSwitchMemberDialog" @doSwitchMember="doSwitchMember" />
  271. <!--关联会员对话框 end-->
  272. <!--关联员工对话框 start-->
  273. <bindStaffDialog
  274. :show-dialog="openBindStaffDialog"
  275. @doBindStaff="doBindStaff"
  276. @closeDialog="closeDialog"
  277. />
  278. <!--关联员工对话框 end-->
  279. <!--结算对话框 start-->
  280. <settlementDialog
  281. :show-dialog="openSettlementDialog"
  282. :memberInfo="memberInfo"
  283. :staffInfo="staffInfo"
  284. :totalPrice="cartTotalPrice"
  285. :remarks="cartRemark"
  286. :orderInfo="orderInfo"
  287. :couponList="couponList"
  288. @submit="submitSettlement"
  289. @switchMember="switchMember"
  290. @bindStaff="bindStaff"
  291. @closeDialog="closeDialog"
  292. />
  293. <!--结算对话框 end-->
  294. <!--扫码付款对话框 start-->
  295. <scanPayCodeDialog
  296. ref="scanPayCodeDialog"
  297. :show-dialog="openScanPayCodeDialog"
  298. :memberInfo="memberInfo"
  299. :orderId="orderId"
  300. :payType="payType"
  301. :payAmount="payAmount"
  302. @closeDialog="closeDialog"
  303. @showPayResult="showPayResult"
  304. />
  305. <!--扫码付款对话框 end-->
  306. <!--支付结果对话框 start-->
  307. <payResultDialog
  308. :show-dialog="openPayResultDialog"
  309. :payResult="payResult"
  310. @showOrderPrint="showOrderPrint"
  311. @closeDialog="closeDialog"
  312. />
  313. <!--支付结果对话框 end-->
  314. <!--打印订单对话框 start-->
  315. <orderPrintDialog
  316. :show-dialog="openOrderPrintDialog"
  317. :storeInfo="storeInfo"
  318. :orderInfo="orderInfo"
  319. @closeDialog="closeDialog"
  320. />
  321. <!--打印订单对话框 end-->
  322. <!--挂单对话框 start-->
  323. <hangUpDialog
  324. :show-dialog="openHangUpDialog"
  325. :memberInfo="memberInfo"
  326. :cartList="cartList"
  327. @getHangNo="getHangNo"
  328. @doHangUp="doHangUp"
  329. @closeDialog="closeDialog"
  330. />
  331. <!--挂单对话框 end-->
  332. <!-- 无商品收款组件 start-->
  333. <noGoodsCashier
  334. :show-dialog="openNoGoodsCashierDialog"
  335. @submit="submitCashier"
  336. @closeDialog="closeDialog"
  337. ></noGoodsCashier>
  338. <!-- 无商品收款组件 end-->
  339. </div>
  340. </template>
  341. <script>
  342. import {
  343. init,
  344. getGoodsInfo,
  345. searchGoods,
  346. getCartList,
  347. saveCart,
  348. removeFromCart,
  349. submitSettlement,
  350. doPay,
  351. getMemberInfoById,
  352. } from '@/api/cashier'
  353. import { getOrderInfo } from '@/api/order'
  354. import { useUserStore } from '@/store/user'
  355. import { getUserId, setUserId, removeUserId } from '@/utils/auth'
  356. import switchMemberDialog from './components/switchMemberDialog'
  357. import settlementDialog from './components/settlementDialog'
  358. import scanPayCodeDialog from './components/scanPayCodeDialog'
  359. import payResultDialog from './components/payResultDialog'
  360. import orderPrintDialog from './components/orderPrintDialog'
  361. import hangUpDialog from './components/hangUpDialog'
  362. import orderList from './components/orderList'
  363. import memberList from './components/memberList'
  364. import couponConfirm from './components/couponConfirm'
  365. import noGoodsCashier from './components/noGoodsCashier'
  366. import bindStaffDialog from './components/bindStaffDialog'
  367. import LangTab from '@/components/LangTab/index.vue'
  368. import { Message } from 'element-ui'
  369. const { logOut } = useUserStore()
  370. export default {
  371. name: 'Cashier',
  372. components: {
  373. switchMemberDialog,
  374. settlementDialog,
  375. scanPayCodeDialog,
  376. payResultDialog,
  377. orderPrintDialog,
  378. hangUpDialog,
  379. orderList,
  380. memberList,
  381. couponConfirm,
  382. noGoodsCashier,
  383. bindStaffDialog,
  384. LangTab,
  385. },
  386. data() {
  387. return {
  388. // 系统名称
  389. systemName: this.$t('app.title'),
  390. // 导航tab
  391. navTab: '0',
  392. isOpen: true,
  393. page: 1,
  394. pageSize: 9,
  395. totalGoods: 0,
  396. openGoodsDialog: false,
  397. openSwitchMemberDialog: false,
  398. openBindStaffDialog: false,
  399. openSettlementDialog: false,
  400. openNoGoodsCashierDialog: false,
  401. openScanPayCodeDialog: false,
  402. openPayResultDialog: false,
  403. openOrderPrintDialog: false,
  404. openHangUpDialog: false,
  405. searchForm: { keyword: '' },
  406. payResult: { isSuccess: false, payAmount: 0, orderId: 0 },
  407. goodsForm: {},
  408. // 左侧菜单
  409. menuList: [
  410. {
  411. name: this.$t('shou-yin-zhu-ye'),
  412. key: 'cashier',
  413. logo: require('../../assets/images/menu-cooker1.png'),
  414. },
  415. {
  416. name: this.$t('ding-dan-guan-li'),
  417. key: 'order',
  418. logo: require('../../assets/images/menu-cooker2.png'),
  419. },
  420. {
  421. name: this.$t('tui-chu'),
  422. key: 'exit',
  423. logo: require('../../assets/images/menu-cooker3.png'),
  424. },
  425. // { name: '会员管理', key: 'member', logo: require('../../assets/images/hot.png') },
  426. // { name: '卡券核销', key: 'coupon', logo: require('../../assets/images/life.png') }
  427. ],
  428. // 激活菜单
  429. activeMenu: 'cashier',
  430. // 导航栏tab
  431. tabList: [],
  432. // 当前操作会员
  433. memberInfo: null,
  434. // 当前登录用户
  435. accountInfo: {},
  436. // 绑定的员工
  437. staffInfo: null,
  438. // 当前门店信息
  439. storeInfo: {},
  440. // 当前操作商品
  441. goodsInfo: { num: 1, specList: [], skuList: [] },
  442. // 当前选择属性
  443. goodsSpecIds: [],
  444. // 商品数量
  445. goodsNum: 1,
  446. // 当前分类
  447. cateId: 0,
  448. // 图片目录
  449. imagePath: '',
  450. // 商品分类列表
  451. cateList: [],
  452. // 商品列表
  453. goodsList: [],
  454. // 购物车列表
  455. cartList: [],
  456. // 订单列表
  457. orderList: [],
  458. // 总金额
  459. cartTotalPrice: 0,
  460. // 购物车备注
  461. cartRemark: '',
  462. // 总件数
  463. cartTotalNum: 0,
  464. // 支付金额
  465. payAmount: 0,
  466. // 当前订单号
  467. orderId: 0,
  468. // 支付方式
  469. payType: '',
  470. // 当前订单
  471. orderInfo: {},
  472. // 可用卡券列表
  473. couponList: [],
  474. // 挂单序号
  475. hangNo: '',
  476. isSearch: false,
  477. }
  478. },
  479. mounted() {
  480. const app = this
  481. // 监听扫码枪按键
  482. let code = ''
  483. let lastTime, nextTime // 上次时间、最新时间
  484. let lastCode, nextCode // 上次按键、最新按键
  485. document.onkeypress = (e) => {
  486. // 获取按键
  487. if (window.event) {
  488. // IE
  489. nextCode = e.keyCode
  490. } else if (e.which) {
  491. // Netscape/Firefox/Opera
  492. nextCode = e.which
  493. }
  494. // 如果触发了回车事件(扫码结束时间)
  495. if (nextCode === 13) {
  496. if (code.length < 3) {
  497. return
  498. }
  499. if (app.openScanPayCodeDialog == true) {
  500. app.$refs.scanPayCodeDialog.submit(code)
  501. return false
  502. }
  503. if (app.openSwitchMemberDialog == true) {
  504. return false
  505. }
  506. if (app.openSettlementDialog == true) {
  507. app.$alert(this.$t('qing-dian-ji-que-ding-shou-kuan'))
  508. return false
  509. }
  510. if (app.activeMenu == 'cashier') {
  511. app.addToCart(code)
  512. }
  513. code = ''
  514. lastCode = ''
  515. lastTime = ''
  516. return true
  517. }
  518. nextTime = new Date().getTime() // 记录最新时间
  519. if (!lastTime && !lastCode) {
  520. // 如果上次时间和上次按键为空
  521. code += e.key // 执行叠加操作
  522. }
  523. // 如果有上次时间及上次按键
  524. if (lastCode && lastTime && nextTime - lastTime > 30) {
  525. code = e.key
  526. } else if (lastCode && lastTime) {
  527. code += e.key
  528. }
  529. lastCode = nextCode
  530. lastTime = nextTime
  531. return true
  532. }
  533. },
  534. created() {
  535. this.initCashier()
  536. this.getCartList()
  537. },
  538. methods: {
  539. // 初始化数据
  540. initCashier() {
  541. const app = this
  542. const userId = getUserId() > 0 ? getUserId() : 0
  543. init(userId, app.cateId, app.page, app.pageSize)
  544. .then((response) => {
  545. app.cateList = response.data.cateList
  546. app.tabList = response.data.cateList
  547. app.goodsList = response.data.goodsList
  548. app.imagePath = response.data.imagePath
  549. app.storeInfo = response.data.storeInfo
  550. app.accountInfo = response.data.accountInfo
  551. app.memberInfo = response.data.memberInfo
  552. app.totalGoods = response.data.totalGoods
  553. app.loading = false
  554. app.hangNo = ''
  555. app.staffInfo = null
  556. })
  557. .catch((err) => {
  558. app.loading = false
  559. console.log(err.toString())
  560. })
  561. },
  562. // 菜单切换
  563. switchMenu(menuKey) {
  564. if (menuKey == 'exit') {
  565. this.$confirm(this.$t('que-ding-zhu-xiao-bing-tui-chu-xi-tong-ma'), this.$t('ti-shi'), {
  566. confirmButtonText: this.$t('que-ding'),
  567. cancelButtonText: this.$t('qu-xiao'),
  568. type: 'warning',
  569. })
  570. .then(() => {
  571. logOut().then(() => {
  572. Message({
  573. message: this.$t('tui-chu-cheng-gong'),
  574. type: 'success',
  575. })
  576. removeUserId()
  577. this.$router.push('/login')
  578. })
  579. })
  580. .catch(() => {})
  581. } else {
  582. this.activeMenu = menuKey
  583. return menuKey
  584. }
  585. },
  586. // tab切换
  587. switchTab(el) {
  588. this.navTab = el.name
  589. this.filterCate(this.navTab)
  590. },
  591. // 过滤分类商品
  592. filterCate(cateId) {
  593. this.cateId = cateId
  594. this.initCashier()
  595. },
  596. // 购物车列表
  597. getCartList(cartIds) {
  598. const app = this
  599. if (app.loading) {
  600. return false
  601. }
  602. app.loading = true
  603. app.cartList = []
  604. const switchCartIds = cartIds ? cartIds.join(',') : ''
  605. getCartList({ userId: getUserId(), hangNo: app.hangNo, cartIds: switchCartIds })
  606. .then((response) => {
  607. const cartList = response.data.list
  608. if (cartList && cartList.length > 0) {
  609. cartList.forEach(function (item) {
  610. const specList = []
  611. if (item.specList && item.specList.length > 0) {
  612. item.specList.forEach(function (spec) {
  613. specList.push({ name: spec.specName, value: spec.specValue })
  614. })
  615. }
  616. const cartInfo = {
  617. cartId: item.id,
  618. skuId: item.skuId,
  619. goodsId: item.goodsInfo.id,
  620. name: item.goodsInfo.name,
  621. logo: item.goodsInfo.logo,
  622. price: item.goodsInfo.price,
  623. buyNum: item.num,
  624. specList: specList,
  625. }
  626. app.cartList.push(cartInfo)
  627. })
  628. }
  629. app.cartTotalPrice = response.data.payPrice
  630. app.cartTotalNum = response.data.totalNum
  631. app.couponList = response.data.couponList
  632. app.loading = false
  633. })
  634. .catch((err) => {
  635. app.loading = false
  636. console.log(err.toString())
  637. })
  638. },
  639. // 查询商品
  640. doQueryGoods() {
  641. const app = this
  642. if (!app.searchForm.keyword) {
  643. app.initCashier()
  644. return false
  645. }
  646. app.loading = true
  647. searchGoods({ keyword: app.searchForm.keyword })
  648. .then((response) => {
  649. app.loading = false
  650. if (response.data && response.data.length > 0) {
  651. app.goodsList = response.data
  652. } else {
  653. app.$alert(this.$t('bao-qian-wei-cha-xun-dao-shang-pin-xin-xi'))
  654. return false
  655. }
  656. })
  657. .catch((err) => {
  658. app.loading = false
  659. console.log(err.toString())
  660. })
  661. },
  662. // 点击商品规格弹框
  663. clickGoods(goodsInfo) {
  664. const app = this
  665. if (app.loading) {
  666. return false
  667. }
  668. app.loading = true
  669. getGoodsInfo(goodsInfo.id)
  670. .then((response) => {
  671. app.goodsInfo = response.data.goodsInfo
  672. app.goodsInfo.specList = response.data.specList
  673. app.goodsInfo.skuList = response.data.skuList
  674. app.goodsNum = 1
  675. app.loading = false
  676. if (app.goodsInfo.isSingleSpec == 'N') {
  677. app.openGoodsDialog = true
  678. } else {
  679. app.addToCart(false)
  680. }
  681. })
  682. .catch((err) => {
  683. app.loading = false
  684. console.log(err.toString())
  685. })
  686. },
  687. // 关闭规格弹框
  688. closeGoodsDialog() {
  689. this.openGoodsDialog = false
  690. },
  691. // 选择商品属性
  692. selectGoodsSpec(specId) {
  693. const app = this
  694. let specIds = []
  695. app.goodsInfo.specList.forEach(function () {
  696. specIds.push(0)
  697. })
  698. app.goodsInfo.specList.forEach(function (specItem, index) {
  699. const children = []
  700. specItem.child.forEach(function (child) {
  701. children.push(child.id)
  702. })
  703. if (children.includes(specId)) {
  704. specIds[index] = specId
  705. } else {
  706. specIds[index] = app.goodsSpecIds[index] == undefined ? 0 : app.goodsSpecIds[index]
  707. }
  708. })
  709. app.goodsSpecIds = specIds
  710. },
  711. // 加入购物车
  712. addToCart(skuNo) {
  713. const app = this
  714. app.isSearch = false
  715. // 扫码枪扫描商品条码,直接加入购物车
  716. if (skuNo) {
  717. searchGoods({ keyword: skuNo })
  718. .then((response) => {
  719. app.loading = false
  720. if (response.data && response.data.length > 0) {
  721. app.clickGoods(response.data[0])
  722. app.isSearch = true
  723. return false
  724. } else {
  725. app.$alert(this.$t('bao-qian-wei-cha-xun-dao-shang-pin-xin-xi'))
  726. return false
  727. }
  728. })
  729. .catch((err) => {
  730. app.loading = false
  731. console.log(err.toString())
  732. })
  733. }
  734. if (app.loading || app.isSearch || !app.goodsInfo.id || app.goodsNum <= 0) {
  735. return false
  736. }
  737. const specIds = app.goodsSpecIds.join('-')
  738. let skuId = 0
  739. app.goodsInfo.skuList.forEach(function (skuInfo) {
  740. if (skuInfo.specIds == specIds) {
  741. skuId = skuInfo.id
  742. }
  743. })
  744. if (app.goodsInfo.isSingleSpec == 'N' && skuId <= 0) {
  745. app.$alert(this.$t('qing-xian-que-ren-shang-pin-gui-ge'))
  746. return false
  747. }
  748. // 添加到购物车
  749. const cartInfo = {
  750. goodsId: app.goodsInfo.id,
  751. name: app.goodsInfo.name,
  752. logo: app.goodsInfo.logo,
  753. price: app.goodsInfo.price,
  754. skuId: skuId,
  755. userId: getUserId(),
  756. hangNo: app.hangNo,
  757. buyNum: app.goodsNum,
  758. }
  759. app.loading = true
  760. saveCart(cartInfo)
  761. .then((response) => {
  762. app.loading = false
  763. if (response.data.cartId) {
  764. app.getCartList()
  765. app.openGoodsDialog = false
  766. app.goodsSpecIds = []
  767. app.goodsNum = 0
  768. }
  769. })
  770. .catch((err) => {
  771. app.loading = false
  772. console.log(err.toString())
  773. })
  774. },
  775. // 删除购物车
  776. removeFromCart(cartId) {
  777. const app = this
  778. this.$confirm(this.$t('ci-cao-zuo-jiang-qing-kong-shi-fou-ji-xu'), this.$t('ti-shi'), {
  779. confirmButtonText: this.$t('que-ding'),
  780. cancelButtonText: this.$t('qu-xiao'),
  781. type: 'warning',
  782. })
  783. .then(() => {
  784. removeFromCart({ cartId: [cartId], userId: getUserId() })
  785. .then((response) => {
  786. if (response.data) {
  787. app.getCartList()
  788. this.$message({
  789. type: 'success',
  790. message: this.$t('shan-chu-cheng-gong'),
  791. })
  792. }
  793. })
  794. .catch((err) => {
  795. app.loading = false
  796. console.log(err.toString())
  797. })
  798. })
  799. .catch(() => {
  800. this.$message({
  801. type: 'info',
  802. message: this.$t('yi-qu-xiao-shan-chu'),
  803. })
  804. })
  805. },
  806. // 购物车数量变化
  807. changeBuyNum(cartInfo) {
  808. const app = this
  809. const param = {
  810. goodsId: cartInfo.goodsId,
  811. skuId: cartInfo.skuId,
  812. cartId: cartInfo.cartId,
  813. action: '=',
  814. userId: app.memberInfo ? app.memberInfo.id : null,
  815. hangNo: app.hangNo,
  816. buyNum: cartInfo.buyNum,
  817. }
  818. app.loading = true
  819. saveCart(param)
  820. .then((response) => {
  821. app.loading = false
  822. if (response.data.cartId) {
  823. app.getCartList()
  824. app.openGoodsDialog = false
  825. app.goodsSpecIds = []
  826. }
  827. })
  828. .catch(() => {
  829. app.loading = false
  830. app.getCartList()
  831. })
  832. },
  833. // 弹出关联会员
  834. switchMember() {
  835. this.openSwitchMemberDialog = true
  836. },
  837. // 弹出关联员工
  838. bindStaff() {
  839. this.openBindStaffDialog = true
  840. },
  841. // 确认关联会员
  842. doSwitchMember(memberInfo) {
  843. this.openSwitchMemberDialog = false
  844. if (memberInfo != 0) {
  845. this.memberInfo = memberInfo
  846. if (memberInfo) {
  847. let cartIds = []
  848. if (this.cartList && this.cartList.length > 0) {
  849. this.cartList.forEach(function (cart) {
  850. cartIds.push(cart.cartId)
  851. })
  852. }
  853. setUserId(memberInfo.id)
  854. this.getCartList(cartIds)
  855. } else {
  856. removeUserId()
  857. this.getCartList()
  858. }
  859. }
  860. },
  861. // 确认绑定员工
  862. doBindStaff(staff) {
  863. this.openBindStaffDialog = false
  864. this.staffInfo = staff
  865. },
  866. // 退出登录
  867. logout() {
  868. this.$router.push('/')
  869. },
  870. // 发起结算
  871. doSettlement() {
  872. if (this.cartList.length < 1) {
  873. this.$alert(this.$t('qing-xian-tian-jia-jie-suan-shang-pin'))
  874. return false
  875. }
  876. this.getCartList()
  877. this.orderInfo = {}
  878. this.openSettlementDialog = true
  879. },
  880. // 无商品结算
  881. doCashier() {
  882. this.orderInfo = {}
  883. this.openNoGoodsCashierDialog = true
  884. },
  885. // 提交结算
  886. submitCashier(param) {
  887. this.orderInfo = {}
  888. this.openSettlementDialog = true
  889. this.cartTotalPrice = parseFloat(param.amount)
  890. this.cartRemark = param.remark
  891. this.openNoGoodsCashierDialog = false
  892. },
  893. // 确认结算
  894. submitSettlement(param) {
  895. const app = this
  896. // 已生成的订单支付
  897. if (app.orderInfo.id) {
  898. // 微信、支付宝支付
  899. if (param.payType == 'MICROPAY' || param.payType == 'ALISCAN') {
  900. app.payAmount = app.orderInfo.payAmount
  901. app.orderId = app.orderInfo.id
  902. app.openScanPayCodeDialog = true
  903. app.openSettlementDialog = false
  904. app.payType = param.payType
  905. }
  906. // 现金、余额支付
  907. if (param.payType == 'CASH' || param.payType == 'BALANCE') {
  908. doPay({
  909. orderId: app.orderId,
  910. payType: param.payType,
  911. cashierPayAmount: param.totalPrice,
  912. cashierDiscountAmount: param.discountPrice,
  913. userId: getUserId(),
  914. }).then((response) => {
  915. app.openSettlementDialog = false
  916. if (response.data.orderInfo.payStatus == 'B') {
  917. app.showPayResult({
  918. isSuccess: true,
  919. payAmount: response.data.orderInfo.payAmount,
  920. orderId: response.data.orderInfo.id,
  921. })
  922. } else {
  923. app.$alert(
  924. response.data.message
  925. ? response.data.message
  926. : this.$t('bao-qian-ding-dan-cao-zuo-yi-chang'),
  927. )
  928. }
  929. })
  930. }
  931. return false
  932. }
  933. // 购物车提交结算
  934. let cartIds = []
  935. app.cartList.forEach(function (cart) {
  936. cartIds.push(cart.cartId)
  937. })
  938. const data = {
  939. cashierPayAmount: param.totalPrice,
  940. cashierDiscountAmount: param.discountPrice,
  941. cartIds: cartIds.join(','),
  942. orderMode: 'oneself',
  943. payType: param.payType,
  944. remark: param.remark,
  945. type: app.cartList.length > 0 ? 'goods' : 'payment',
  946. couponId: param.userCouponId ? param.userCouponId : 0,
  947. userId: getUserId(),
  948. staffId: app.staffInfo ? app.staffInfo.id : 0,
  949. }
  950. if (app.loading) {
  951. return false
  952. }
  953. app.loading = true
  954. submitSettlement(data)
  955. .then((response) => {
  956. app.loading = false
  957. app.doSwitchMember(null)
  958. app.initCashier()
  959. app.getCartList()
  960. // 微信支付,弹出扫码框
  961. if (response.data.orderInfo.payType == 'MICROPAY' || param.payType == 'ALISCAN') {
  962. app.payAmount = response.data.orderInfo.payAmount
  963. app.orderId = response.data.orderInfo.id
  964. app.openScanPayCodeDialog = true
  965. app.openSettlementDialog = false
  966. app.payType = param.payType
  967. return false
  968. }
  969. // 现金、余额支付
  970. if (
  971. response.data.orderInfo.payType == 'CASH' ||
  972. response.data.orderInfo.payType == 'BALANCE'
  973. ) {
  974. app.openSettlementDialog = false
  975. if (response.data.orderInfo.payStatus == 'B') {
  976. app.showPayResult({
  977. isSuccess: true,
  978. payAmount: response.data.orderInfo.payAmount,
  979. orderId: response.data.orderInfo.id,
  980. })
  981. } else {
  982. app.$alert(response.data.message)
  983. }
  984. return false
  985. }
  986. if (response.code == '201') {
  987. app.$alert(response.data.message)
  988. }
  989. return false
  990. })
  991. .catch((err) => {
  992. app.loading = false
  993. console.log(err.toString())
  994. })
  995. },
  996. // 点击挂单/取单
  997. hangUp() {
  998. this.openHangUpDialog = true
  999. },
  1000. // 取单
  1001. getHangNo(data) {
  1002. this.openHangUpDialog = false
  1003. this.hangNo = data.hangNo
  1004. this.getCartList()
  1005. // 关联会员信息
  1006. if (data.hangNo && data.hangNo.length > 0) {
  1007. this.doSwitchMember(data.memberInfo)
  1008. }
  1009. },
  1010. // 执行挂单
  1011. doHangUp() {
  1012. this.hangNo = ''
  1013. this.getCartList()
  1014. removeUserId()
  1015. this.memberInfo = null
  1016. },
  1017. // 关闭对话框
  1018. closeDialog(dialog) {
  1019. if (dialog == 'settlementDialog') {
  1020. this.openSettlementDialog = false
  1021. } else if (dialog == 'switchMemberDialog') {
  1022. this.openSwitchMemberDialog = false
  1023. } else if (dialog == 'scanPayCodeDialog') {
  1024. this.openScanPayCodeDialog = false
  1025. } else if (dialog == 'payResultDialog') {
  1026. this.openPayResultDialog = false
  1027. } else if (dialog == 'printOrder') {
  1028. this.openOrderPrintDialog = false
  1029. } else if (dialog == 'hangUpDialog') {
  1030. this.openHangUpDialog = false
  1031. } else if (dialog == 'openNoGoodsCashierDialog') {
  1032. this.openNoGoodsCashierDialog = false
  1033. } else if (dialog == 'openBindStaffDialog') {
  1034. this.openBindStaffDialog = false
  1035. }
  1036. },
  1037. // 展示支付结果
  1038. showPayResult(payResult) {
  1039. this.payResult = payResult
  1040. this.openPayResultDialog = true
  1041. },
  1042. // 订单支付
  1043. doPayOrder(orderInfo) {
  1044. const app = this
  1045. app.navTab = 0
  1046. app.payAmount = orderInfo.amount
  1047. app.orderId = orderInfo.id
  1048. app.orderInfo = orderInfo
  1049. let userId = 0
  1050. if (orderInfo.isVisitor !== 'Y') {
  1051. userId = app.orderInfo.userInfo.id
  1052. }
  1053. getMemberInfoById(userId)
  1054. .then((response) => {
  1055. if (response.data.memberInfo) {
  1056. app.memberInfo = response.data.memberInfo
  1057. } else {
  1058. app.memberInfo = null
  1059. }
  1060. })
  1061. .catch((err) => {
  1062. app.loading = false
  1063. console.log(err.toString())
  1064. })
  1065. app.doSwitchMember(app.memberInfo)
  1066. app.openSettlementDialog = true
  1067. },
  1068. // 打印小票
  1069. showOrderPrint(orderId) {
  1070. const app = this
  1071. getOrderInfo(orderId)
  1072. .then((response) => {
  1073. if (response.data.orderInfo) {
  1074. app.orderInfo = response.data.orderInfo
  1075. app.openOrderPrintDialog = true
  1076. }
  1077. })
  1078. .catch((err) => {
  1079. app.loading = false
  1080. console.log(err.toString())
  1081. })
  1082. },
  1083. // 确认关闭
  1084. handleClose() {
  1085. return false
  1086. },
  1087. },
  1088. }
  1089. </script>
  1090. <style lang="scss" scoped>
  1091. .main {
  1092. height: 100%;
  1093. width: 100%;
  1094. display: flex;
  1095. flex-direction: row;
  1096. .pagination {
  1097. position: absolute;
  1098. bottom: 10px;
  1099. height: 50px;
  1100. min-width: 750px;
  1101. line-height: 50px;
  1102. right: 10px;
  1103. margin-top: 10px;
  1104. display: block;
  1105. background-color: transparent !important;
  1106. border-color: transparent !important;
  1107. color: #000;
  1108. border-radius: 5px;
  1109. z-index: 99999;
  1110. }
  1111. .top-nav {
  1112. display: block;
  1113. clear: both;
  1114. height: 45px;
  1115. width: 100%;
  1116. background: #f5f5f5;
  1117. border-bottom: #cccccc solid 1px;
  1118. position: absolute;
  1119. padding: 10px 0px 0px 40px;
  1120. top: 0;
  1121. }
  1122. .left-side {
  1123. width: 160px;
  1124. height: 100vh;
  1125. // background: #113a28;
  1126. // border-right: #888888 solid 2px;
  1127. position: absolute;
  1128. left: 0;
  1129. top: 45px;
  1130. padding: 0px;
  1131. // color: #ffffff;
  1132. overflow-x: hidden;
  1133. overflow-y: auto;
  1134. display: block;
  1135. text-align: center;
  1136. .logo {
  1137. height: 90px;
  1138. padding: 20px 12px 10px 12px;
  1139. font-weight: bold;
  1140. .logout {
  1141. float: left;
  1142. height: 20px;
  1143. line-height: 20px;
  1144. text-align: left;
  1145. width: 100%;
  1146. cursor: pointer;
  1147. }
  1148. .store {
  1149. font-size: 12px;
  1150. }
  1151. .account {
  1152. font-size: 12px;
  1153. // border: solid 2px #ffffff;
  1154. // background: #6c757d;
  1155. cursor: pointer;
  1156. margin-top: 6px;
  1157. padding: 2px;
  1158. border-radius: 2px;
  1159. }
  1160. }
  1161. .cate {
  1162. text-align: center;
  1163. margin-left: 14px;
  1164. margin-top: 10px;
  1165. height: calc(100vh - 190px);
  1166. .nav {
  1167. list-style: none;
  1168. display: flex;
  1169. flex-direction: column;
  1170. align-items: center;
  1171. justify-content: space-around;
  1172. margin: 0px;
  1173. padding: 5px;
  1174. text-align: center;
  1175. height: 100%;
  1176. .nav-item {
  1177. margin-top: 20px;
  1178. font-size: 14px;
  1179. width: 120px;
  1180. text-align: center;
  1181. .nav-link {
  1182. position: relative;
  1183. padding: 0.5356875rem 0.9375rem;
  1184. white-space: nowrap;
  1185. text-align: center;
  1186. font-weight: 400;
  1187. color: #333;
  1188. display: flex;
  1189. align-items: center;
  1190. flex-direction: column;
  1191. justify-content: center;
  1192. border-radius: 5px;
  1193. transition: color 0.2s linear;
  1194. border: 2px solid #ffffff;
  1195. .cate-logo-div {
  1196. width: 60px;
  1197. height: 60px;
  1198. display: flex;
  1199. justify-content: center;
  1200. align-items: center;
  1201. border-radius: 10px;
  1202. .cate-logo {
  1203. display: block;
  1204. width: 50px;
  1205. height: 50px;
  1206. }
  1207. }
  1208. }
  1209. .active {
  1210. font-weight: bold;
  1211. .cate-logo-div {
  1212. background-color: #f67f20;
  1213. box-shadow: 0px 12px 38px 0px rgba(234, 124, 105, 0.32);
  1214. }
  1215. }
  1216. }
  1217. }
  1218. }
  1219. }
  1220. .cart-container {
  1221. width: 310px;
  1222. height: 100%;
  1223. background: #ffffff;
  1224. display: block;
  1225. position: absolute;
  1226. left: 165px;
  1227. top: 45px;
  1228. overflow-x: hidden;
  1229. overflow-y: auto;
  1230. border: #cccccc solid 1px;
  1231. border-top-color: transparent !important;
  1232. .title {
  1233. height: 70px;
  1234. width: 310px;
  1235. border-bottom: #cccccc 1px solid;
  1236. // padding-top: 16px;
  1237. padding-left: 1px;
  1238. display: flex;
  1239. align-items: center;
  1240. // position: fixed;
  1241. // top: 45px;
  1242. z-index: 999;
  1243. clear: both;
  1244. .avatar {
  1245. display: inline-block;
  1246. width: 30px;
  1247. height: 30px;
  1248. border-radius: 50%;
  1249. margin: 5px 0px 5px 5px;
  1250. overflow: hidden;
  1251. }
  1252. .member-info {
  1253. display: inline-block;
  1254. margin-left: 5px;
  1255. border-top: none;
  1256. .name {
  1257. margin-left: 2px;
  1258. margin-right: 3px;
  1259. }
  1260. .none {
  1261. margin-left: 2px;
  1262. margin-right: 5px;
  1263. font-size: 13px;
  1264. }
  1265. .switch {
  1266. padding: 8px 8px 8px 4px;
  1267. }
  1268. }
  1269. }
  1270. .carts {
  1271. display: block;
  1272. width: 100%;
  1273. color: #666666;
  1274. margin-bottom: 120px;
  1275. // margin-top: 70px;
  1276. padding: 0px;
  1277. .tab {
  1278. width: 50%;
  1279. .cart-list {
  1280. margin-bottom: 60px;
  1281. .cart-item {
  1282. border-bottom: dashed 1px #cccccc;
  1283. height: 110px;
  1284. width: 310px;
  1285. padding-top: 5px;
  1286. .image {
  1287. width: 50px;
  1288. height: 50px;
  1289. margin-left: 5px;
  1290. border-radius: 5px;
  1291. border: solid 1px #ccc;
  1292. float: left;
  1293. margin-top: 20px;
  1294. }
  1295. .info {
  1296. float: left;
  1297. padding-left: 5px;
  1298. margin-top: 5px;
  1299. .name {
  1300. font-weight: bold;
  1301. font-size: 12px;
  1302. width: 160px;
  1303. max-height: 30px;
  1304. overflow: hidden;
  1305. display: -webkit-box;
  1306. -webkit-box-orient: vertical;
  1307. -webkit-line-clamp: 2;
  1308. }
  1309. .spec {
  1310. font-size: 12px;
  1311. width: 160px;
  1312. height: 20px;
  1313. margin-top: 2px;
  1314. .item {
  1315. margin-right: 2px;
  1316. border-radius: 5px;
  1317. text-align: center;
  1318. max-width: 50px;
  1319. height: 20px;
  1320. line-height: 20px;
  1321. float: left;
  1322. display: block;
  1323. overflow: hidden;
  1324. color: #606266;
  1325. cursor: pointer;
  1326. background: #cceeee;
  1327. padding: 0px 3px 0px 3px;
  1328. white-space: nowrap;
  1329. text-overflow: ellipsis;
  1330. }
  1331. }
  1332. .input {
  1333. width: 120px;
  1334. margin-top: 2px;
  1335. }
  1336. }
  1337. .option {
  1338. float: right;
  1339. text-align: right;
  1340. margin-right: 10px;
  1341. .remove {
  1342. font-size: 12px;
  1343. cursor: pointer;
  1344. }
  1345. .total {
  1346. margin-top: 10px;
  1347. font-size: 16px;
  1348. color: #ff5b57;
  1349. }
  1350. }
  1351. }
  1352. }
  1353. .empty {
  1354. margin-top: 200px;
  1355. width: 310px;
  1356. }
  1357. }
  1358. }
  1359. .footer {
  1360. position: fixed;
  1361. z-index: 999;
  1362. bottom: 0;
  1363. height: 120px;
  1364. padding-top: 5px;
  1365. padding-right: 15px;
  1366. display: block;
  1367. width: 310px;
  1368. margin-bottom: 10px;
  1369. .number {
  1370. float: right;
  1371. margin: 5px;
  1372. font-size: 13px;
  1373. .total-price {
  1374. margin-top: 3px;
  1375. .num {
  1376. color: #ff5b57;
  1377. font-size: 20px;
  1378. }
  1379. }
  1380. }
  1381. .options {
  1382. text-align: center;
  1383. cursor: pointer;
  1384. float: right;
  1385. color: white;
  1386. // box-sizing: border-box;
  1387. // padding-bottom: 20px;
  1388. .cash {
  1389. float: left;
  1390. height: 50px;
  1391. border: solid 1px #f67f20;
  1392. // padding-top: 15px;
  1393. padding: 15px 5px 0px 5px;
  1394. width: 135px;
  1395. border-radius: 5px;
  1396. color: #f67f20;
  1397. // background: #113a28;
  1398. font-weight: bold;
  1399. }
  1400. .submit {
  1401. float: left;
  1402. height: 50px;
  1403. border: solid 1px #ff5b57;
  1404. margin-left: 10px;
  1405. padding: 15px 5px 0px 5px;
  1406. width: 135px;
  1407. border-radius: 5px;
  1408. background: #ff5b57;
  1409. font-weight: bold;
  1410. }
  1411. }
  1412. }
  1413. }
  1414. .main-list {
  1415. height: 100%;
  1416. width: 100%;
  1417. min-width: 760px;
  1418. margin-left: 475px;
  1419. margin-right: 2px;
  1420. overflow: auto;
  1421. display: block;
  1422. background: #ffffff;
  1423. margin-bottom: 10px;
  1424. .title {
  1425. position: fixed;
  1426. height: 106px;
  1427. width: calc(100% - 475px);
  1428. min-width: 700px;
  1429. background: #ffffff;
  1430. padding: 5px;
  1431. color: red;
  1432. top: 45px;
  1433. .search-form {
  1434. height: 50px;
  1435. .form-item {
  1436. margin-right: -2px;
  1437. width: 100%;
  1438. }
  1439. .input-item {
  1440. min-width: 456px;
  1441. width: 100%;
  1442. }
  1443. .search-goods {
  1444. height: 40px;
  1445. background: #f67f20;
  1446. color: #fff;
  1447. }
  1448. }
  1449. .tab-box {
  1450. margin-top: 3px;
  1451. width: 100%;
  1452. }
  1453. }
  1454. .goods-list {
  1455. height: 100%;
  1456. width: 100%;
  1457. margin-top: 148px;
  1458. margin-left: 2px;
  1459. margin-bottom: 200px;
  1460. .goods-item {
  1461. width: 33.3%;
  1462. min-height: 300px;
  1463. min-width: 220px;
  1464. padding: 3px;
  1465. float: left;
  1466. background: #ffffff;
  1467. text-align: left;
  1468. cursor: pointer;
  1469. .item {
  1470. background: #ffffff;
  1471. padding: 5px;
  1472. border-radius: 5px;
  1473. border: solid 1px #cccccc;
  1474. margin: 0px;
  1475. .goods-name {
  1476. margin-top: 10px;
  1477. font-size: 18px;
  1478. color: #666666;
  1479. height: 30px;
  1480. overflow: hidden;
  1481. white-space: nowrap;
  1482. text-overflow: ellipsis;
  1483. }
  1484. .goods-price {
  1485. color: #ff5b57;
  1486. font-size: 18px;
  1487. font-weight: bold;
  1488. }
  1489. .image {
  1490. width: 100%;
  1491. height: 220px;
  1492. border-radius: 3px;
  1493. }
  1494. }
  1495. }
  1496. }
  1497. }
  1498. }
  1499. .goods-info {
  1500. border: solid 1px #ccc;
  1501. padding: 30px;
  1502. border-radius: 5px;
  1503. .name {
  1504. height: 40px;
  1505. font-weight: bold;
  1506. font-size: 20px;
  1507. }
  1508. .price {
  1509. height: 40px;
  1510. color: #ff5b57;
  1511. font-size: 16px;
  1512. }
  1513. .spec-list {
  1514. border: solid 1px #ccc;
  1515. padding: 20px;
  1516. margin-top: 10px;
  1517. border-radius: 6px;
  1518. .spec-item {
  1519. margin-bottom: 20px;
  1520. .spec-name {
  1521. font-weight: bold;
  1522. font-size: 16px;
  1523. }
  1524. .values {
  1525. display: block;
  1526. padding-top: 10px;
  1527. margin-left: 0px;
  1528. padding-left: 0px;
  1529. font-size: 12px;
  1530. .value {
  1531. border: solid 1px #cceeee;
  1532. margin-right: 10px;
  1533. padding: 8px 15px 5px 15px;
  1534. cursor: pointer;
  1535. border-radius: 4px;
  1536. background: rgba(0, 172, 172, 0.1);
  1537. color: #666666;
  1538. }
  1539. .active {
  1540. border: solid 1px #ff5891;
  1541. background: #ff5b57;
  1542. color: #ffffff;
  1543. }
  1544. }
  1545. }
  1546. }
  1547. }
  1548. </style>
  1549. <style scoped>
  1550. .input-item >>> .el-input__inner {
  1551. border: #e6e6e6 solid 1px;
  1552. line-height: 50px;
  1553. height: 50px;
  1554. }
  1555. .form-item >>> .el-form-item__label {
  1556. line-height: 50px;
  1557. height: 50px;
  1558. }
  1559. .el-tabs--border-card {
  1560. box-shadow: none;
  1561. border: none;
  1562. }
  1563. ::v-deep .el-tabs--border-card > .el-tabs__content {
  1564. padding: 0px;
  1565. }
  1566. ::v-deep .el-pagination.is-background span {
  1567. /* color: #fff; */
  1568. }
  1569. </style>