index.vue 44 KB

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