stocktaking.vue 24 KB

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