stocktaking.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911
  1. <template>
  2. <view class="nvue-page-root">
  3. <view class="head">
  4. <view class="header-wrap">
  5. <view class="index-header">
  6. <uni-icons class="fanhui" custom-prefix="iconfont" type="icon-fanhui"
  7. @click="leftClick"></uni-icons>
  8. <view class="input-wrap">
  9. <text class="iconfont">盘点管理</text>
  10. </view>
  11. <view class="map-wrap">
  12. <uni-icons class="lanya"></uni-icons>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="blank"></view>
  17. </view>
  18. <view class="uni-common-mt" style="padding: 5px;">
  19. <view class="uni-input-wrapper" style="margin: 5px auto;">
  20. <input class="uni-input" auto-focus="true" :focus="firstFocus" placeholder="请扫描托盘码" v-model="viewText"
  21. @input="hideKeyboard" style="font-weight: bold;" />
  22. </view>
  23. <view class="uni-form-item uni-column">
  24. <view class="uni-input-wrapper" style="margin: 5px auto;">
  25. <text class="uni-form-item__title" style="width: 25%;">托盘码</text>
  26. <input class="uni-input" :value="container_code" disabled="true" />
  27. </view>
  28. <view class="uni-input-wrapper" style="margin: 5px auto;">
  29. <text class="uni-form-item__title" style="width: 25%;">回库口</text>
  30. <select-lay style="width: 75%;" :zindex="2" :value="port_sn" name="port_sn" placeholder="请选择回库口"
  31. :options="portList" @selectitem="selectPort">
  32. </select-lay>
  33. </view>
  34. <view style="min-height:430px;overflow-y:auto;max-height:430px">
  35. <view class="cart-list">
  36. <!-- 滑动操作分区 -->
  37. <uni-swipe-action>
  38. <!-- 滑动操作项 -->
  39. <uni-swipe-action-item v-for="(item,index) in tableData" :key="index" class="cart-swipe">
  40. <!-- 商品信息 -->
  41. <view class="goods" style="border:1px solid #ccc">
  42. <view class="meta" style="padding-bottom:15px;">
  43. <view class="name">
  44. 货物名称:{{item.name}} 型号:{{item.model}}
  45. </br>
  46. 库存数量:{{item.num}} 盘点数量:{{item.stocktaking_num}}
  47. </view>
  48. <br>
  49. </view>
  50. <!-- 商品数量 -->
  51. <view class="numGroup">
  52. <button type="primary" @click="OutStore(item)">更改</button>
  53. </view>
  54. </view>
  55. </uni-swipe-action-item>
  56. </uni-swipe-action>
  57. </view>
  58. </view>
  59. <view class="uni-input-wrapper button-sp-area" style="padding-bottom:5px;">
  60. <button type="primary" plain="true" @click="ReturnStockWarehouse()" :disabled="BtnDisabled">盘点回库</button>
  61. <button type="primary" plain="true" @click="StocktakingProduct()" :disabled="BtnDisabled">盘点货物</button>
  62. <button type="primary" plain="true" @click="StocktakingAddProduct()" :disabled="BtnDisabled">补添货物</button>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- 盘点更改数量提示窗示例 -->
  67. <uni-popup ref="dialogReturnWarehouse" type="dialog">
  68. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="确定该托盘产品已盘点完毕?"
  69. @confirm="groupDialogeturn" @close="dialogClose"></uni-popup-dialog>
  70. </uni-popup>
  71. <!-- 盘点更改数量提示窗示例 -->
  72. <!-- <uni-popup ref="dialogStocktakingAddProduct" type="dialog">
  73. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="确定将此托盘转化为出库?"
  74. @confirm="StocktakingAddProductBtn" @close="dialogClose"></uni-popup-dialog>
  75. </uni-popup> -->
  76. <!-- 输入框示例 -->
  77. <uni-popup ref="inputDialog" type="dialog">
  78. <uni-popup-dialog ref="inputClose" mode="input" :title="title" :value="outNum" placeholder="请填写正确数量"
  79. @confirm="UpdateNum"></uni-popup-dialog>
  80. </uni-popup>
  81. </view>
  82. </template>
  83. <script>
  84. import CustomModal from "@/components/CustomModal/CustomModal.vue";
  85. let _this = null;
  86. import {
  87. mapGetters,
  88. mapActions
  89. } from 'vuex';
  90. import {
  91. GET_INFODATA,
  92. GET_CONNECTBLEDATA
  93. } from "@/store/gettersType.js";
  94. import {
  95. SET_CONNECTBLEDATA
  96. } from '@/store/actionsType.js';
  97. // #ifdef APP-PLUS
  98. const modal = uni.requireNativePlugin('modal');
  99. // #endif
  100. var reqRootUrl = plus.storage.getItem("reqRootUrl");
  101. const SpeechTTS = uni.requireNativePlugin('MT-TTS-Speech');
  102. export default {
  103. components: {
  104. CustomModal
  105. },
  106. data() {
  107. return {
  108. container_code: "",
  109. sn: "",
  110. detail_sn:"",
  111. firstFocus: false,
  112. viewText: "",
  113. tableData: [],
  114. BtnDisabled: false,
  115. attributeData: {},
  116. title: "",
  117. port_sn: "",
  118. portList: [],
  119. outNum: "",
  120. }
  121. },
  122. computed: {
  123. ...mapGetters([GET_INFODATA, GET_CONNECTBLEDATA]),
  124. },
  125. methods: {
  126. onUnload() {
  127. SpeechTTS.destroy();
  128. },
  129. speak_init() {
  130. // console.log('>> TTS:init...')
  131. SpeechTTS.init((callback) => {
  132. // SpeechTTS.setEngine("com.iflytek.speechcloud"); // 设置引擎
  133. SpeechTTS.setEngine("com.google.android.tts"); // 设置引擎
  134. // console.log('>> tts: init success');
  135. SpeechTTS.setPitch(50); // 设置语调 setPitch(num) 0-100, 默认 50
  136. SpeechTTS.setSpeed(65); // 设置语速 setSpeed(num) 0-100, 默认 50
  137. });
  138. SpeechTTS.onDone((res) => {
  139. // console.log(">> tts: play end " + res)
  140. });
  141. },
  142. leftClick: function() {
  143. setTimeout(() => {
  144. uni.navigateBack();
  145. // uni.redirectTo({
  146. // url: '/pages/sample/main',
  147. // })
  148. }, 30);
  149. // this.$emit('change', this.value)
  150. },
  151. rightClick: function() {
  152. setTimeout(() => {
  153. uni.navigateTo({
  154. url: '/pages/sample/richAlert',
  155. })
  156. }, 30);
  157. // this.$emit("rightClick")
  158. },
  159. onLoad(options) {
  160. _this = this;
  161. _this.firstFocus = true;
  162. console.log(options.containerCode);
  163. _this.container_code = options.containerCode;
  164. },
  165. onShow() {
  166. uni.hideKeyboard();
  167. setTimeout(() => {
  168. _this.firstFocus = true;
  169. this.getList();
  170. this.CateGet();
  171. this.speak_init();
  172. }, 500);
  173. },
  174. CateGet() {
  175. let warehouse_id = uni.getStorageSync("warehouse_id");
  176. _this.warehouse_id = warehouse_id;
  177. uni.request({
  178. url: reqRootUrl + '/stocktakingPortQuery',
  179. method: 'POST',
  180. headers: {
  181. 'Content-Type': 'application/json'
  182. },
  183. data: JSON.stringify({
  184. "warehouse_id": _this.warehouse_id,
  185. }),
  186. success: (ret) => {
  187. // console.log("ret", ret)
  188. if (ret.statusCode === 200) {
  189. this.portList = [];
  190. let rows = ret.data;
  191. // console.log("rows", rows[0]["addr"]["f"])
  192. for (var i = 0; i < rows.length; i++) {
  193. let lab = rows[i]["addr"]["f"] + "-" + rows[i]["addr"]["c"] +
  194. "-" + rows[i]["addr"]["r"]
  195. this.portList.push({
  196. label: lab,
  197. value: JSON.stringify(rows[i]["addr"])
  198. })
  199. }
  200. }
  201. },
  202. fail: (err) => {
  203. // console.log('request fail', err);
  204. },
  205. complete: () => {
  206. // console.log('complete');
  207. }
  208. }),
  209. uni.request({
  210. url: reqRootUrl + '/SpaceQuery',
  211. method: 'POST',
  212. headers: {
  213. 'Content-Type': 'application/json'
  214. },
  215. data: JSON.stringify({
  216. "warehouse_id": _this.warehouse_id,
  217. }),
  218. success: (ret) => {
  219. // console.log("ret", ret)
  220. if (ret.statusCode === 200) {
  221. this.addrList = [];
  222. let rows = ret.data;
  223. // console.log("rows", rows);
  224. if (!_this.isEmpty(rows)) {
  225. for (var i = 0; i < rows.length; i++) {
  226. this.addrList.push({
  227. label: rows[i]["addr_view"],
  228. value: rows[i]["sn"]
  229. })
  230. }
  231. }
  232. }
  233. },
  234. fail: (err) => {
  235. // console.log('request fail', err);
  236. },
  237. complete: () => {
  238. // console.log('complete');
  239. }
  240. })
  241. },
  242. selectPort(index, item) {
  243. if (index >= 0) {
  244. _this.port_sn = item.value;
  245. } else {
  246. _this.port_sn = ""
  247. }
  248. },
  249. // 托盘上的盘点产品
  250. hideKeyboard: function(event) {
  251. uni.hideKeyboard();
  252. let Value = event.detail.value;
  253. Value = Value.trim();
  254. _this.firstFocus = false;
  255. if (Value !== "" && Value !== null && Value !== undefined) {
  256. uni.request({
  257. url: reqRootUrl + '/StocktakingGetByCode',
  258. method: 'POST',
  259. headers: {
  260. 'Content-Type': 'application/json'
  261. },
  262. data: JSON.stringify({
  263. "container_code": Value,
  264. }),
  265. success: (ret) => {
  266. //处理成功逻辑
  267. if (ret.statusCode === 200) {
  268. // console.log(ret);
  269. let data = ret.data;
  270. _this.tableData = data;
  271. _this.alertInfo("扫码成功!")
  272. _this.BtnDisabled = false
  273. _this.container_code = Value;
  274. uni.setStorageSync("container_code", Value)
  275. _this.$nextTick(() => {
  276. _this.firstFocus = true;
  277. _this.viewText = "";
  278. })
  279. } else {
  280. _this.alertInfo("托盘码错误,请重新扫描!")
  281. // _this.getSn();
  282. _this.tableData = [];
  283. _this.$nextTick(() => {
  284. _this.firstFocus = true;
  285. _this.viewText = "";
  286. _this.container_code = "";
  287. uni.setStorageSync("container_code", "")
  288. })
  289. _this.$forceUpdate()
  290. }
  291. },
  292. fail: (err) => {
  293. // console.log('request fail', err);
  294. },
  295. complete: () => {
  296. // console.log('complete');
  297. }
  298. })
  299. }
  300. },
  301. closeModal() {
  302. // 关闭模态框
  303. },
  304. OutStore(item) {
  305. _this.sn = item["sn"]
  306. _this.detail_sn = item["detail_sn"]
  307. _this.title = "盘点数量:" + item["stocktaking_num"];
  308. _this.outNum = item["stocktaking_num"]
  309. this.$refs.inputDialog.open()
  310. },
  311. // 更改库存明细
  312. UpdateNum(val) {
  313. setTimeout(() => {
  314. uni.hideLoading()
  315. if (parseFloat(val) < 0 ) {
  316. _this.alertInfo("请输入正确的数量!");
  317. return
  318. }
  319. uni.request({
  320. url: reqRootUrl + '/PDAUpdateDetail',
  321. method: 'POST',
  322. headers: {
  323. 'Content-Type': 'application/json'
  324. },
  325. data: JSON.stringify({
  326. "detail_sn": _this.detail_sn,
  327. "upNum": parseFloat(val),
  328. }),
  329. success: (ret) => {
  330. this.$refs.inputDialog.close();
  331. if (ret.statusCode === 200) {
  332. if(ret.data.ret =="failed"){
  333. _this.alertInfo(ret.data.msg);
  334. }else{
  335. _this.alertInfo("更改成功!");
  336. _this.out_tips = "";
  337. _this.detail_sn ="";
  338. _this.sn = "";
  339. _this.outNum = 0;
  340. _this.getList();
  341. }
  342. }else{
  343. _this.alertInfo("更改失败!");
  344. _this.out_tips = "";
  345. _this.detail_sn ="";
  346. _this.sn = "";
  347. _this.outNum = 0;
  348. _this.getList();
  349. }
  350. //处理成功逻辑
  351. },
  352. fail: (err) => {
  353. console.log('request fail', err);
  354. },
  355. complete: () => {
  356. // console.log('complete');
  357. }
  358. })
  359. // 关闭窗口后,恢复默认内容
  360. this.$refs.inputDialog.close()
  361. }, 30)
  362. },
  363. dialogClose() {
  364. _this.getList();
  365. },
  366. Update(item) {
  367. _this.setView(item);
  368. _this.sn = item["sn"];
  369. _this.detail_sn = item["detail_sn"]
  370. },
  371. getList() {
  372. _this.$forceUpdate()
  373. _this.tableData = [];
  374. if (_this.container_code === "") {
  375. return
  376. }
  377. uni.request({
  378. url: reqRootUrl + '/StocktakingGetByCode',
  379. method: 'POST',
  380. headers: {
  381. 'Content-Type': 'application/json'
  382. },
  383. data: JSON.stringify({
  384. "container_code": _this.container_code,
  385. }),
  386. success: (ret) => {
  387. //console.log(ret);
  388. //处理成功逻辑
  389. if (ret.statusCode === 200) {
  390. //console.log(ret.statusCode);
  391. let data = ret.data;
  392. _this.tableData = data;
  393. // console.log("tableData");
  394. // console.log(_this.tableData);
  395. _this.BtnDisabled = false
  396. }
  397. },
  398. fail: (err) => {
  399. // console.log('request fail', err);
  400. },
  401. complete: () => {
  402. // console.log('complete');
  403. }
  404. })
  405. },
  406. // StocktakingAddProduct: function() {
  407. // _this.firstFocus = false;
  408. // setTimeout(() => {
  409. // if (_this.isEmpty(_this.container_code)) {
  410. // _this.alertInfo("请扫描托盘码!")
  411. // return
  412. // }
  413. // this.$refs.dialogStocktakingAddProduct.open()
  414. // }, 30)
  415. // },
  416. // StocktakingAddProductBtn() {
  417. // if (_this.isEmpty(_this.container_code)) {
  418. // _this.alertInfo("操作失败!请扫描托盘码!")
  419. // return
  420. // }
  421. // setTimeout(() => {
  422. // uni.hideLoading()
  423. // uni.request({
  424. // url: reqRootUrl + '/StocktakingAddProduct',
  425. // method: 'POST',
  426. // headers: {
  427. // 'Content-Type': 'application/json'
  428. // },
  429. // data: JSON.stringify({
  430. // "container_code": _this.container_code,
  431. // }),
  432. // success: (ret) => {
  433. // this.$refs.dialogReturnWarehouse.close();
  434. // if (ret.statusCode === 200) {
  435. // if(ret.data.ret =="failed"){
  436. // _this.alertInfo(ret.data.msg);
  437. // }else{
  438. // _this.alertInfo("盘点转出库成功!");
  439. // _this.sn = "";
  440. // _this.detail_sn = "";
  441. // _this.port_sn = "";
  442. // _this.container_code = "";
  443. // _this.tableData = [];
  444. // uni.setStorageSync("container_code", "")
  445. // }
  446. // }else{
  447. // _this.alertInfo("盘点转出库失败!");
  448. // _this.sn = "";
  449. // _this.detail_sn = "";
  450. // _this.port_sn = "";
  451. // _this.container_code = "";
  452. // uni.setStorageSync("container_code", "")
  453. // }
  454. // _this.getList();
  455. // },
  456. // fail: (err) => {
  457. // // console.log('request fail', err);
  458. // },
  459. // complete: () => {
  460. // // console.log('complete');
  461. // }
  462. // })
  463. // }, 30)
  464. // },
  465. StocktakingAddProduct() {
  466. uni.setStorageSync("source", "stocktaking")
  467. if(_this.container_code == ""){
  468. _this.alertInfo("请扫描托盘码!")
  469. return
  470. }
  471. setTimeout(() => {
  472. _this.firstFocus = false;
  473. uni.navigateTo({
  474. url: '/pages/sample/stocktaking_add_product?containerCode='+_this.container_code,
  475. })
  476. }, 30);
  477. },
  478. StocktakingProduct(){
  479. setTimeout(() => {
  480. uni.hideLoading()
  481. uni.request({
  482. url: reqRootUrl + '/autoStocktaking',
  483. method: 'POST',
  484. headers: {
  485. 'Content-Type': 'application/json'
  486. },
  487. data: JSON.stringify({
  488. }),
  489. success: (ret) => {
  490. this.$refs.dialogReturnWarehouse.close();
  491. if (ret.statusCode === 200) {
  492. if(ret.data.ret =="failed"){
  493. _this.alertInfo(ret.data.msg);
  494. }else{
  495. _this.alertInfo("盘点操作成功!");
  496. _this.sn = "";
  497. _this.detail_sn = "";
  498. _this.port_sn = "";
  499. _this.container_code = "";
  500. _this.tableData = [];
  501. uni.setStorageSync("container_code", "")
  502. }
  503. _this.getList();
  504. }else{
  505. _this.alertInfo("盘点操作失败,请确认是否存在未完成的盘点任务!");
  506. _this.sn = "";
  507. _this.detail_sn = "";
  508. _this.port_sn = "";
  509. _this.container_code = "";
  510. uni.setStorageSync("container_code", "")
  511. }
  512. _this.getList();
  513. },
  514. fail: (err) => {
  515. _this.alertInfo("存在出库任务未完成!");
  516. // console.log('request fail', err);
  517. },
  518. complete: () => {
  519. // console.log('complete');
  520. }
  521. })
  522. }, 30)
  523. },
  524. ReturnStockWarehouse: function() {
  525. _this.firstFocus = false;
  526. setTimeout(() => {
  527. if (_this.isEmpty(_this.container_code)) {
  528. _this.alertInfo("请扫描托盘码!")
  529. return
  530. }
  531. // if (_this.isEmpty(_this.port_sn)) {
  532. // _this.alertInfo("请选择回库口")
  533. // return
  534. // }
  535. this.$refs.dialogReturnWarehouse.open()
  536. }, 30)
  537. },
  538. // 回库确认
  539. groupDialogeturn() {
  540. if (_this.isEmpty(_this.container_code)) {
  541. _this.alertInfo("操作失败!请扫描托盘码!")
  542. return
  543. }
  544. // let srcaddr =""
  545. // if (!_this.isEmpty(_this.container_code)) {
  546. // srcaddr =JSON.parse(_this.port_sn)
  547. // }
  548. // console.log(srcaddr);
  549. console.log(_this.port_sn);
  550. if (_this.isEmpty(_this.port_sn)){
  551. setTimeout(() => {
  552. uni.hideLoading()
  553. uni.request({
  554. url: reqRootUrl + '/ReturnStockWarehouse',
  555. method: 'POST',
  556. headers: {
  557. 'Content-Type': 'application/json'
  558. },
  559. data: JSON.stringify({
  560. "container_code": _this.container_code,
  561. }),
  562. success: (ret) => {
  563. this.$refs.dialogReturnWarehouse.close();
  564. if (ret.statusCode === 200) {
  565. if(ret.data.ret =="failed"){
  566. _this.alertInfo(ret.data.msg);
  567. }else{
  568. _this.alertInfo("盘点回库操作成功!");
  569. _this.sn = "";
  570. _this.detail_sn = "";
  571. _this.port_sn = "";
  572. _this.container_code = "";
  573. _this.tableData = [];
  574. uni.setStorageSync("container_code", "")
  575. }
  576. _this.getList();
  577. }else{
  578. _this.alertInfo("盘点回库操作失败!");
  579. _this.sn = "";
  580. _this.detail_sn = "";
  581. _this.port_sn = "";
  582. _this.container_code = "";
  583. uni.setStorageSync("container_code", "")
  584. }
  585. _this.getList();
  586. },
  587. fail: (err) => {
  588. // console.log('request fail', err);
  589. },
  590. complete: () => {
  591. // console.log('complete');
  592. }
  593. })
  594. }, 30)
  595. }else{
  596. setTimeout(() => {
  597. uni.hideLoading()
  598. uni.request({
  599. url: reqRootUrl + '/ReturnStockWarehouse',
  600. method: 'POST',
  601. headers: {
  602. 'Content-Type': 'application/json'
  603. },
  604. data: JSON.stringify({
  605. "srcAddr": JSON.parse(_this.port_sn),
  606. "container_code": _this.container_code,
  607. }),
  608. success: (ret) => {
  609. this.$refs.dialogReturnWarehouse.close();
  610. if (ret.statusCode === 200) {
  611. if(ret.data.ret =="failed"){
  612. _this.alertInfo(ret.data.msg);
  613. }else{
  614. _this.alertInfo("盘点回库操作成功!");
  615. _this.sn = "";
  616. _this.detail_sn = "";
  617. _this.port_sn = "";
  618. _this.container_code = "";
  619. _this.tableData = [];
  620. uni.setStorageSync("container_code", "")
  621. }
  622. _this.getList();
  623. }else{
  624. _this.alertInfo("盘点回库操作失败!");
  625. _this.sn = "";
  626. _this.detail_sn = "";
  627. _this.port_sn = "";
  628. _this.container_code = "";
  629. uni.setStorageSync("container_code", "")
  630. }
  631. _this.getList();
  632. },
  633. fail: (err) => {
  634. // console.log('request fail', err);
  635. },
  636. complete: () => {
  637. // console.log('complete');
  638. }
  639. })
  640. }, 30)
  641. }
  642. },
  643. isEmpty: function(obj) {
  644. return typeof obj === undefined || obj == null || obj === "" || obj ===
  645. "000000000000000000000000" ||
  646. obj.length === 0;
  647. },
  648. alertInfo(str) {
  649. SpeechTTS.speak({
  650. text: str,
  651. });
  652. modal.toast({
  653. message: str,
  654. duration: 6,
  655. });
  656. },
  657. onNavigationBarButtonTap: function(e) {
  658. setTimeout(() => {
  659. uni.navigateTo({
  660. url: '/pages/sample/richAlert',
  661. })
  662. }, 500);
  663. },
  664. getSn() {
  665. // return;
  666. let today = new Date();
  667. let year = today.getFullYear();
  668. let month = today.getMonth() + 1;
  669. let date = today.getDate();
  670. let hours = today.getHours();
  671. let minutes = today.getMinutes();
  672. let seconds = today.getSeconds();
  673. let millisecond = today.getMilliseconds()
  674. if (month <= 9) {
  675. month = '0' + month
  676. }
  677. if (minutes <= 9) {
  678. minutes = '0' + minutes;
  679. }
  680. if (date <= 9) {
  681. date = '0' + date;
  682. }
  683. if (seconds <= 9) {
  684. seconds = '0' + seconds;
  685. }
  686. let sn = year + '' + month + '' + date + '' + hours + '' + minutes + '' + seconds + '' + millisecond
  687. uni.removeStorageSync('port_sn');
  688. return sn
  689. },
  690. formattedDate(d) {
  691. const date = new Date(d);
  692. const year = date.getFullYear();
  693. const month = String(date.getMonth() + 1).padStart(2, '0');
  694. const day = String(date.getDate()).padStart(2, '0');
  695. const hours = String(date.getHours()).padStart(2, '0');
  696. const minutes = String(date.getMinutes()).padStart(2, '0');
  697. const seconds = String(date.getSeconds()).padStart(2, '0');
  698. return `${year}-${month}-${day}`;
  699. },
  700. },
  701. }
  702. </script>
  703. <style scoped>
  704. .nvue-page-root {
  705. background-color: #F8F8F8;
  706. padding-bottom: 0px;
  707. }
  708. .uni-form-item__title {
  709. margin: 5px auto;
  710. }
  711. .uni-input-wrapper {
  712. /* #ifndef APP-NVUE */
  713. display: flex;
  714. /* #endif */
  715. flex-direction: row;
  716. flex-wrap: nowrap;
  717. background-color: #FFFFFF;
  718. }
  719. .uni-input {
  720. height: 28px;
  721. line-height: 28px;
  722. font-size: 15px;
  723. padding: 1px;
  724. flex: 1;
  725. border-radius: 5px;
  726. border: 1px solid #cfdadd;
  727. background-color: #FFFFFF;
  728. }
  729. .mini-btn {
  730. height: 30px;
  731. padding-left: 1px;
  732. padding-right: 1px;
  733. }
  734. .uni-eye-active {
  735. color: #007AFF;
  736. }
  737. .table-title {
  738. background-color: aliceblue;
  739. font-weight: 700;
  740. margin-top: 10px;
  741. height: 40px;
  742. }
  743. .table-data {
  744. background-color: aliceblue;
  745. font-weight: 700;
  746. margin-top: 1px;
  747. height: 40px;
  748. }
  749. .tab-tr {
  750. width: 25%;
  751. line-height: 50px;
  752. border-right: 1px solid #ccc;
  753. margin: auto;
  754. text-align: center;
  755. }
  756. .tab-tr-end {
  757. width: 25%;
  758. line-height: 50px;
  759. border-right: 0px solid #ccc;
  760. margin: auto;
  761. text-align: center;
  762. }
  763. </style>
  764. <style lang="scss">
  765. $color-base: #0039a6;
  766. $words-color-base: #333333;
  767. $words-color-light: #999999;
  768. .header-wrap {
  769. width: 100%;
  770. position: fixed;
  771. top: 0;
  772. z-index: 999;
  773. .index-header {
  774. height: 88upx;
  775. line-height: 88upx;
  776. padding: 0 30upx;
  777. padding-top: 40upx;
  778. background-color: $color-base;
  779. font-Size: 28upx;
  780. color: #fff;
  781. display: flex;
  782. align-items: center;
  783. justify-content: space-between;
  784. .fanhui {
  785. color: #fff !important;
  786. font-size: 28px;
  787. padding-top: 5px;
  788. font-weight: 700;
  789. }
  790. .lanya {
  791. color: #fff !important;
  792. font-size: 28px;
  793. padding-top: 5px;
  794. }
  795. .map-wrap {
  796. padding-top: 5px;
  797. }
  798. }
  799. }
  800. .blank {
  801. height: 126upx;
  802. }
  803. // 购物车列表
  804. .cart-list {
  805. padding: 0 5rpx;
  806. // 购物车商品
  807. .goods {
  808. display: flex;
  809. padding: 5rpx;
  810. border-radius: 10rpx;
  811. background-color: #fff;
  812. position: relative;
  813. .meta {
  814. // border:1px solid red;
  815. flex: 1;
  816. display: flex;
  817. flex-direction: column;
  818. justify-content: space-between;
  819. margin-left: 5rpx;
  820. }
  821. .name {
  822. height: auto;
  823. font-size: 18px;
  824. color: #000000;
  825. }
  826. // 商品数量
  827. .numGroup {
  828. // border: 1px solid green;
  829. position: absolute;
  830. bottom: 40rpx;
  831. right: 5rpx;
  832. display: flex;
  833. justify-content: space-between;
  834. align-items: center;
  835. // width: 100px;
  836. height: 30rpx;
  837. .text_1 {
  838. // border: 1px solid red;
  839. width: 50px;
  840. height: 100%;
  841. padding: 0 5rpx;
  842. font-size: 15px;
  843. color: #444;
  844. }
  845. .text {
  846. height: 100%;
  847. padding: 0 5rpx;
  848. font-size: 32rpx;
  849. color: #444;
  850. }
  851. }
  852. }
  853. .cart-swipe {
  854. display: block;
  855. margin: 20rpx 0;
  856. }
  857. }
  858. </style>