group.vue 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575
  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-form-item uni-column">
  20. <view class="uni-input-wrapper" style="margin: 5px auto;">
  21. <text class="uni-form-item__title" style="width: 25%;">托盘码</text>
  22. <input class="uni-input" ref="trayCodeInput" auto-focus="true" placeholder="请扫描托盘码"
  23. v-model="container_code" @input="handleTrayCodeInput" style="font-weight: bold;" />
  24. </view>
  25. <!-- 新增的到货单编号输入框 -->
  26. <view class="uni-input-wrapper" style="margin: 5px auto;">
  27. <text class="uni-form-item__title" style="width: 25%;">到货单编号</text>
  28. <input class="uni-input" ref="receiptCodeInput" placeholder="请扫描到货单编号" v-model="number"
  29. @input="handleReceiptCodeInput" style="font-weight: bold;" />
  30. </view>
  31. <view class="uni-input-wrapper" style="margin: 5px auto;">
  32. <text class="uni-form-item__title" style="width: 25%;">存货编码</text>
  33. <input class="uni-input" ref="pruductCodeInput" placeholder="请扫描存货编码" v-model="pruduct_code"
  34. @input="handlepruductCodeInput" style="font-weight: bold;" />
  35. </view>
  36. <view class="uni-input-wrapper" style="margin: 5px auto;">
  37. <text class="uni-form-item__title" style="width: 25%;">入库类别</text>
  38. <select-lay style="width: 75%;" :zindex="zindex5" :value="category_sn" name="category_sn"
  39. placeholder="请选择入库类别" :options="categoryList" @selectitem="selectCategory">
  40. </select-lay>
  41. </view>
  42. <view class="uni-input-wrapper" style="margin: 5px auto;">
  43. <text class="uni-form-item__title" style="width: 25%;">入库状态</text>
  44. <select-lay style="width: 75%;" :zindex="zindex4" :value="qualified" name="qualified"
  45. placeholder="请选择入库状态" :options="qualifiedList" @selectitem="selectQualified">
  46. </select-lay>
  47. </view>
  48. <view class="uni-input-wrapper" style="margin: 5px auto;">
  49. <text class="uni-form-item__title" style="width: 25%;">U8仓库 </text>
  50. <select-lay style="width: 75%;" :zindex="zindex3" :value="stockarea" name="stockarea"
  51. placeholder="请选择U8仓库" :options="stockareaList" @selectitem="selectStockArea">
  52. </select-lay>
  53. </view>
  54. <view class="uni-input-wrapper" style="margin: 5px auto;">
  55. <text class="uni-form-item__title" style="width: 25%;">库区</text>
  56. <select-lay style="width: 75%;" :zindex="zindex2" :value="area_sn" name="area_sn"
  57. placeholder="请选择库区" :options="areaList" @selectitem="selectArea">
  58. </select-lay>
  59. </view>
  60. <view class="uni-input-wrapper" style="margin: 5px auto;">
  61. <text class="uni-form-item__title" style="width: 25%;">入库口</text>
  62. <select-lay style="width: 75%;" :zindex="zindex1" :value="port_sn" name="port_sn"
  63. placeholder="请选择入库口" :options="portList" @selectitem="selectPort">
  64. </select-lay>
  65. </view>
  66. <!-- <view class="uni-input-wrapper button-sp-area">
  67. <button type="primary" @click="SelectProduct()">添加存货</button>
  68. </view> -->
  69. <view style="min-height:230px;overflow-y:auto;max-height:230px">
  70. <view class="cart-list">
  71. <!-- 滑动操作分区 -->
  72. <uni-swipe-action>
  73. <!-- 滑动操作项 -->
  74. <uni-swipe-action-item v-for="(item,index) in tableData" :key="index" class="cart-swipe">
  75. <!-- 商品信息 -->
  76. <view class="goods" style="border:1px solid #ccc">
  77. <view class="meta" style="padding-bottom:10px;width: 70%;">
  78. <view class="name" @click="Delete(item)">
  79. 编码:{{item.code}}
  80. 名称:{{item.name}}
  81. 型号:{{item.model}}
  82. 状态:{{item.status_view}}
  83. </view>
  84. </view>
  85. <!-- 商品数量 -->
  86. <view class="numGroup" @click="Update(item)">
  87. <text class="text_1">数量</text>
  88. <text class="inputs">{{item.num}}</text>
  89. <text class="text">{{item.unit}}</text>
  90. </view>
  91. </view>
  92. </uni-swipe-action-item>
  93. </uni-swipe-action>
  94. </view>
  95. </view>
  96. <view class="uni-input-wrapper button-sp-area">
  97. <button type="primary" plain="true" @click="groupDisk()" :disabled="BtnDisabled">组盘入库</button>
  98. <button type="primary" @click="SelectProduct()">添加存货</button>
  99. <button type="primary" plain="true" @click="addMaterial()">空筐入库</button>
  100. </view>
  101. <view class="uni-input-wrapper button-sp-area" style="margin: 5px auto;">
  102. <button type="primary" plain="true" @click="getOneNilCode()">1号口</button>
  103. <button type="primary" style="visibility: hidden;">1111</button>
  104. <button type="primary" plain="true" @click="getTwoNilCode()">2号口</button>
  105. </view>
  106. </view>
  107. </view>
  108. <!-- 提示窗示例 -->
  109. <uni-popup ref="deleteDialog" type="dialog">
  110. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" :content="del_tips"
  111. @confirm="dialogConfirm" @close="dialogClose"></uni-popup-dialog>
  112. </uni-popup>
  113. <!-- 提示窗示例 -->
  114. <uni-popup ref="groupDialog" type="dialog">
  115. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="确定组盘?"
  116. @confirm="dialogGroup" @close="dialogClose"></uni-popup-dialog>
  117. </uni-popup>
  118. <uni-popup ref="groupMaterialDialog" type="dialog">
  119. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="确定空筐入库?"
  120. @confirm="dialogMaterialGroup" @close="dialogClose"></uni-popup-dialog>
  121. </uni-popup>
  122. <uni-popup ref="nilCodeOneDialog" type="dialog">
  123. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="确定叫空托到1号入库口?"
  124. @confirm="dialogNilCodeOne" @close="dialogClose"></uni-popup-dialog>
  125. </uni-popup>
  126. <uni-popup ref="nilCodeTwoDialog" type="dialog">
  127. <uni-popup-dialog type="info" cancelText="取消" confirmText="确定" title="提示" content="确定叫空托到2号入库口?"
  128. @confirm="dialogNilCodeTwo" @close="dialogClose"></uni-popup-dialog>
  129. </uni-popup>
  130. <!-- 引入自定义模态框 -->
  131. <custom-modal :visible="updateModalVisible">
  132. <!-- 模态框的内容 -->
  133. <view>
  134. <text>提示</text>
  135. <view class="uni-input-wrapper" style="margin: 5px auto;">
  136. <text class="uni-form-item__title" style="width: 30%;">存货编码</text>
  137. <input class="uni-input" :value="code" disabled="true" />
  138. </view>
  139. <view class="uni-input-wrapper" style="margin: 5px auto;">
  140. <text class="uni-form-item__title" style="width: 30%;">存货名称</text>
  141. <input class="uni-input" :value="name" disabled="true" />
  142. </view>
  143. <view class="uni-input-wrapper" style="margin: 5px auto;">
  144. <text class="uni-form-item__title" style="width: 30%;">存货型号</text>
  145. <input class="uni-input" :value="model" disabled="true" />
  146. </view>
  147. <view class="uni-input-wrapper" style="margin: 5px auto;">
  148. <text class="uni-form-item__title" style="width: 30%;">存货品牌</text>
  149. <input class="uni-input" :value="brand" disabled="true" />
  150. </view>
  151. <view class="uni-input-wrapper" style="margin: 5px auto;">
  152. <text class="uni-form-item__title" style="width: 30%;">存货单位</text>
  153. <input class="uni-input" :value="unit" disabled="true" />
  154. </view>
  155. <view class="uni-input-wrapper" style="margin: 5px auto;">
  156. <text class="uni-form-item__title" style="width: 30%;">数量</text>
  157. <input type="number" class="uni-input" :value="num" @input="numChange" />
  158. </view>
  159. <view class="uni-input-wrapper" style="margin: 5px auto;">
  160. <text class="uni-form-item__title" style="width: 30%;">仓库备注</text>
  161. <input class="uni-input" :value="remark" @input="remarkChange" />
  162. </view>
  163. <br><br>
  164. <button class="mini-btn" size="mini" @click="closeUpdateModal"
  165. style="width: 50%;float: left;">关闭</button>
  166. <button class="mini-btn" type="primary" size="mini" @click="UpdateProduct"
  167. style="width: 50%;">更新</button>
  168. </view>
  169. </custom-modal>
  170. <!-- 引入自定义模态框 -->
  171. <custom-modal :visible="addModalVisible">
  172. <!-- 模态框的内容 -->
  173. <view>
  174. <text>提示</text>
  175. <view class="uni-input-wrapper" style="margin: 5px auto;">
  176. <text class="uni-form-item__title" style="width: 30%;">存货编码</text>
  177. <input class="uni-input" :value="code" disabled="true" />
  178. </view>
  179. <view class="uni-input-wrapper" style="margin: 5px auto;">
  180. <text class="uni-form-item__title" style="width: 30%;">存货名称</text>
  181. <input class="uni-input" :value="name" disabled="true" />
  182. </view>
  183. <view class="uni-input-wrapper" style="margin: 5px auto;">
  184. <text class="uni-form-item__title" style="width: 30%;">存货型号</text>
  185. <input class="uni-input" :value="model" disabled="true" />
  186. </view>
  187. <view class="uni-input-wrapper" style="margin: 5px auto;">
  188. <text class="uni-form-item__title" style="width: 30%;">存货品牌</text>
  189. <input class="uni-input" :value="brand" disabled="true" />
  190. </view>
  191. <view class="uni-input-wrapper" style="margin: 5px auto;">
  192. <text class="uni-form-item__title" style="width: 30%;">存货单位</text>
  193. <input class="uni-input" :value="unit" disabled="true" />
  194. </view>
  195. <view class="uni-input-wrapper" style="margin: 5px auto;">
  196. <text class="uni-form-item__title" style="width: 30%;">数量</text>
  197. <input type="number" class="uni-input" :value="num" @input="numChange" />
  198. </view>
  199. <view class="uni-input-wrapper" style="margin: 5px auto;">
  200. <text class="uni-form-item__title" style="width: 30%;">仓库备注</text>
  201. <input class="uni-input" :value="remark" @input="remarkChange" />
  202. </view>
  203. <br><br>
  204. <button class="mini-btn" size="mini" @click="closeAddModal" style="width: 50%;float: left;">关闭</button>
  205. <button class="mini-btn" type="primary" size="mini" @click="AddProduct" style="width: 50%;">添加</button>
  206. </view>
  207. </custom-modal>
  208. </view>
  209. </template>
  210. <script>
  211. import CustomModal from "@/components/CustomModal/CustomModal.vue";
  212. let _this = null;
  213. import {
  214. mapGetters,
  215. mapActions
  216. } from 'vuex';
  217. import {
  218. GET_INFODATA,
  219. GET_CONNECTBLEDATA
  220. } from "@/store/gettersType.js";
  221. import {
  222. SET_CONNECTBLEDATA
  223. } from '@/store/actionsType.js';
  224. // #ifdef APP-PLUS
  225. const modal = uni.requireNativePlugin('modal');
  226. // #endif
  227. let print;
  228. const reqRootUrl = plus.storage.getItem("reqRootUrl");
  229. const ParamreqRootUrl = reqRootUrl + "/wms/api";
  230. const SpeechTTS = uni.requireNativePlugin('MT-TTS-Speech');
  231. export default {
  232. components: {
  233. CustomModal
  234. },
  235. data() {
  236. return {
  237. types: "",
  238. port_sn: "",
  239. container_code: "",
  240. del_tips: "",
  241. updateModalVisible: false,
  242. addModalVisible: false,
  243. tableData: [],
  244. portList: [],
  245. BtnDisabled: false,
  246. sn: "",
  247. name: "",
  248. code:"",
  249. model: "",
  250. brand: "",
  251. unit: "",
  252. remark: "",
  253. num: 0,
  254. area_sn: "",
  255. areaList: [],
  256. category_sn: "",
  257. stockarea : "",
  258. categoryList: [],
  259. stockareaList :[],
  260. qualified: "合格",
  261. qualifiedList: [{
  262. "label": "合格",
  263. "value": "合格"
  264. }, {
  265. "label": "不良",
  266. "value": "不良"
  267. }],
  268. zindex1: 1,
  269. zindex2: 2,
  270. zindex3 :3,
  271. zindex4: 4,
  272. zindex5: 5,
  273. number: "",
  274. pruduct_code: "",
  275. }
  276. },
  277. computed: {
  278. ...mapGetters([GET_INFODATA, GET_CONNECTBLEDATA]),
  279. },
  280. methods: {
  281. onUnload() {
  282. SpeechTTS.destroy();
  283. },
  284. speak_init() {
  285. // console.log('>> TTS:init...')
  286. SpeechTTS.init((callback) => {
  287. // SpeechTTS.setEngine("com.iflytek.speechcloud"); // 设置引擎
  288. SpeechTTS.setEngine("com.google.android.tts"); // 设置引擎
  289. // console.log('>> tts: init success');
  290. SpeechTTS.setPitch(50); // 设置语调 setPitch(num) 0-100, 默认 50
  291. SpeechTTS.setSpeed(65); // 设置语速 setSpeed(num) 0-100, 默认 50
  292. });
  293. SpeechTTS.onDone((res) => {
  294. // console.log(">> tts: play end " + res)
  295. });
  296. },
  297. leftClick: function() {
  298. setTimeout(() => {
  299. uni.navigateBack();
  300. // uni.redirectTo({
  301. // url: '/pages/sample/main',
  302. // })
  303. }, 30);
  304. // this.$emit('change', this.value)
  305. },
  306. CateGet() {
  307. uni.request({
  308. url: ParamreqRootUrl + '/PortGet',
  309. method: 'POST',
  310. headers: {
  311. 'Content-Type': 'application/json'
  312. },
  313. data: JSON.stringify({
  314. "types": "in"
  315. }),
  316. success: (ret) => {
  317. // console.log("ret", ret)
  318. if (ret.statusCode === 200) {
  319. this.portList = [];
  320. let rows = ret.data.data;
  321. // console.log("rows", rows[0]["addr"]["f"])
  322. for (var i = 0; i < rows.length; i++) {
  323. let lab = rows[i]["alias"]
  324. this.portList.push({
  325. label: lab,
  326. value: JSON.stringify(rows[i]["addr"])
  327. })
  328. }
  329. }
  330. },
  331. fail: (err) => {
  332. // console.log('request fail', err);
  333. },
  334. complete: () => {
  335. // console.log('complete');
  336. }
  337. })
  338. uni.request({
  339. url: ParamreqRootUrl + '/AreaAvailable',
  340. method: 'POST',
  341. headers: {
  342. 'Content-Type': 'application/json'
  343. },
  344. data: JSON.stringify({
  345. "disable": false,
  346. }),
  347. success: (ret) => {
  348. // console.log("ret", ret)
  349. if (ret.statusCode === 200) {
  350. this.areaList = [];
  351. let rows = ret.data.data;
  352. // console.log("rows", rows);
  353. if (!_this.isEmpty(rows)) {
  354. for (var i = 0; i < rows.length; i++) {
  355. this.areaList.push({
  356. label: rows[i]["name"],
  357. value: rows[i]["sn"]
  358. })
  359. }
  360. }
  361. }
  362. },
  363. fail: (err) => {
  364. // console.log('request fail', err);
  365. },
  366. complete: () => {
  367. // console.log('complete');
  368. }
  369. })
  370. uni.request({
  371. url: ParamreqRootUrl + '/CategoryFind',
  372. method: 'POST',
  373. headers: {
  374. 'Content-Type': 'application/json'
  375. },
  376. data: JSON.stringify({
  377. "disable": false,
  378. "types": "in"
  379. }),
  380. success: (ret) => {
  381. if (ret.statusCode === 200) {
  382. this.categoryList = [];
  383. let rows = ret.data.data;
  384. if (!_this.isEmpty(rows)) {
  385. for (var i = 0; i < rows.length; i++) {
  386. this.categoryList.push({
  387. label: rows[i]["full_name"],
  388. value: rows[i]["sn"]
  389. })
  390. if (rows[i]["full_name"] == "BOM采购入库") {
  391. this.category_sn = rows[i]["sn"]
  392. }
  393. }
  394. }
  395. }
  396. },
  397. fail: (err) => {
  398. // console.log('request fail', err);
  399. },
  400. complete: () => {
  401. // console.log('complete');
  402. }
  403. })
  404. uni.request({
  405. url: ParamreqRootUrl + '/StockU8Find',
  406. method: 'POST',
  407. headers: {
  408. 'Content-Type': 'application/json'
  409. },
  410. data: JSON.stringify({
  411. "disable": false
  412. }),
  413. success: (ret) => {
  414. if (ret.statusCode === 200) {
  415. this.stockareaList = [];
  416. let rows = ret.data.data;
  417. if (!_this.isEmpty(rows)) {
  418. for (var i = 0; i < rows.length; i++) {
  419. this.stockareaList.push({
  420. label: rows[i]["name"],
  421. value: rows[i]["name"]
  422. })
  423. if (rows[i]["name"] == "原材料库") {
  424. this.stockarea = rows[i]["name"]
  425. }
  426. }
  427. }
  428. }
  429. },
  430. fail: (err) => {
  431. // console.log('request fail', err);
  432. },
  433. complete: () => {
  434. // console.log('complete');
  435. }
  436. })
  437. },
  438. selectArea(index, item) {
  439. if (index >= 0) {
  440. _this.area_sn = item.value;
  441. } else {
  442. _this.area_sn = ""
  443. }
  444. },
  445. selectPort(index, item) {
  446. if (index >= 0) {
  447. _this.port_sn = item.value;
  448. } else {
  449. _this.port_sn = ""
  450. }
  451. },
  452. selectCategory(index, item) {
  453. if (index >= 0) {
  454. _this.category_sn = item.value;
  455. } else {
  456. _this.category_sn = ""
  457. }
  458. },
  459. selectStockArea(index, item) {
  460. if (index >= 0) {
  461. _this.stockarea = item.value;
  462. } else {
  463. _this.stockarea = ""
  464. }
  465. },
  466. rightClick: function() {
  467. setTimeout(() => {
  468. uni.navigateTo({
  469. url: '/pages/sample/richAlert',
  470. })
  471. }, 30);
  472. // this.$emit("rightClick")
  473. },
  474. onLoad(options) {
  475. _this = this;
  476. _this.firstFocus = true;
  477. _this.getSn(),
  478. _this.types = options.types || ""
  479. },
  480. onShow() {
  481. uni.hideKeyboard();
  482. setTimeout(() => {
  483. _this.firstFocus = true;
  484. this.getList();
  485. this.speak_init();
  486. this.CateGet();
  487. }, 500);
  488. },
  489. selectQualified(index, item) {
  490. if (index >= 0) {
  491. _this.qualified = item.value;
  492. if (item.value == "不良") {
  493. _this.part = "无"
  494. } else {
  495. _this.part = "生产用料"
  496. }
  497. } else {
  498. _this.qualified = ""
  499. }
  500. },
  501. numChange: function(e) {
  502. this.num = e.target.value
  503. },
  504. remarkChange: function(e) {
  505. this.remark = e.target.value
  506. },
  507. // 新增明细单号处理方法
  508. handleReceiptCodeInput(event) {
  509. const code = event.target.value.trim();
  510. this.number = code;
  511. uni.setStorageSync("number", code);
  512. },
  513. // 新增方法:处理托盘码扫描
  514. handleTrayCodeScan() {
  515. const code = this.container_code.trim();
  516. if (!code) return;
  517. // 验证托盘码
  518. this.validateTrayCode(code);
  519. },
  520. handleTrayCodeInput(event) {
  521. const code = event.target.value.trim();
  522. if (code.length >= 1) { // 假设托盘码至少需要1个字符才触发验证
  523. this.validateTrayCode(code);
  524. }
  525. },
  526. // 修改后的方法:验证托盘码
  527. validateTrayCode(code) {
  528. uni.request({
  529. url: ParamreqRootUrl + '/CodeGet',
  530. method: 'POST',
  531. headers: {
  532. 'Content-Type': 'application/json'
  533. },
  534. data: JSON.stringify({
  535. "code": code,
  536. }),
  537. success: (ret) => {
  538. if (ret.statusCode !== 200) {
  539. _this.alertInfo("托盘码错误,请重新扫描!");
  540. _this.container_code = "";
  541. _this.focusInput();
  542. return;
  543. }
  544. let rows = ret.data.data;
  545. if (_this.isEmpty(rows)) {
  546. _this.alertInfo("托盘码错误,请重新扫描!");
  547. _this.container_code = "";
  548. _this.focusInput();
  549. return;
  550. }
  551. this.container_code = code;
  552. uni.setStorageSync("container_code", code);
  553. if (!_this.isEmpty(rows["group_disk"])) {
  554. let disk = [];
  555. for (var i = 0; i < rows["group_disk"].length; i++) {
  556. if (rows["group_disk"][i]["status"] === "status_wait") {
  557. rows["group_disk"][i]["status_view"] = "待组盘"
  558. }
  559. if (rows["group_disk"][i]["status"] === "status_yes") {
  560. _this.BtnDisabled = true
  561. rows["group_disk"][i]["status_view"] = "已组盘"
  562. }
  563. disk.push(rows["group_disk"][i])
  564. }
  565. let rData = disk;
  566. if (rData.length > 0) {
  567. _this.product_name = rData[0]["product_name"];
  568. uni.setStorageSync("product_types", rData[0]["types"])
  569. _this.product_code = rData[0]["product_code"];
  570. _this.container_code = rData[0]["container_code"];
  571. uni.setStorageSync("container_code", rData[0]["container_code"])
  572. uni.setStorageSync("receipt_num", rData[0]["receipt_num"])
  573. }
  574. this.tableData = disk;
  575. }
  576. if (!_this.isEmpty(rows["container_code"])) {
  577. _this.container_code = code;
  578. uni.removeStorageSync('container_code');
  579. uni.setStorageSync("container_code", code)
  580. if (_this.tableData.length > 0) {
  581. for (let i = 0; i < _this.tableData.length; i++) {
  582. if (_this.tableData[i]["container_code"] === "") {
  583. uni.request({
  584. url: reqRootUrl + '/wms/api',
  585. method: 'POST',
  586. headers: {
  587. 'Content-Type': 'application/json'
  588. },
  589. data: JSON.stringify({
  590. "method": "GroupDiskUpdate",
  591. "param": {
  592. "sn": _this.tableData[i]["sn"],
  593. "container_code": code
  594. }
  595. }),
  596. success: (ret) => {
  597. _this.alertInfo("更新成功!")
  598. _this.getList()
  599. //处理成功逻辑
  600. },
  601. })
  602. } else {
  603. if (_this.tableData[i]["container_code"] !== code) {
  604. _this.getSn();
  605. _this.getList();
  606. }
  607. }
  608. }
  609. } else {
  610. _this.getList();
  611. }
  612. }
  613. },
  614. fail: (err) => {
  615. this.focusInput()
  616. this.alertInfo("请求失败,请重试!");
  617. },
  618. complete: () => {
  619. // 可以在这里添加一些完成后的操作
  620. }
  621. });
  622. },
  623. // 修改后的方法:隐藏键盘(可选)
  624. hideKeyboard: function(event) {
  625. // 不再自动隐藏键盘,让用户自己决定何时隐藏
  626. // 或者可以添加延迟自动隐藏
  627. // setTimeout(() => {
  628. // uni.hideKeyboard();
  629. // }, 100);
  630. },
  631. handlepruductCodeInput(event) {
  632. const code = event.target.value.trim();
  633. if (code.length >= 1) { // 假设明细单号至少需要1个字符才触发验证
  634. /**/if (_this.isEmpty(_this.container_code)) {
  635. _this.alertInfo("请先扫描托盘码");
  636. _this.focusInput();
  637. return
  638. }
  639. this.pruduct_code = code;
  640. uni.request({
  641. url: ParamreqRootUrl + '/ProductGet',
  642. method: 'POST',
  643. headers: {
  644. 'Content-Type': 'application/json'
  645. },
  646. data: JSON.stringify({
  647. "code": code,
  648. "disable": false,
  649. // "source": "U8"
  650. }),
  651. success: (ret) => {
  652. if (ret.statusCode !== 200) {
  653. _this.product_code = "";
  654. _this.alertInfo("存货编码错误,请重新扫描!");
  655. _this.focusInput();
  656. return;
  657. }
  658. let rows = ret.data.data;
  659. if (_this.isEmpty(rows)) {
  660. _this.product_code = "";
  661. _this.alertInfo("存货编码错误,请重新扫描!");
  662. _this.focusInput();
  663. return;
  664. }
  665. // AAAA
  666. _this.Add(rows[0])
  667. },
  668. fail: (err) => {
  669. this.alertInfo("请求失败,请重试!");
  670. },
  671. })
  672. }
  673. },
  674. closeAddModal() {
  675. // 关闭模态框
  676. _this.sn = "";
  677. _this.name = "";
  678. _this.code = "";
  679. _this.model = "";
  680. _this.brand = "";
  681. _this.unit = "";
  682. _this.remark = "";
  683. _this.num = 0;
  684. _this.zindex1 = 1;
  685. _this.zindex2 = 2;
  686. _this.zindex3 = 3;
  687. _this.zindex4 = 4;
  688. _this.zindex5 = 5;
  689. this.addModalVisible = false;
  690. },
  691. Add(item) {
  692. _this.sn = item.sn;
  693. _this.name = item.name;
  694. _this.code = item.code;
  695. _this.model = item.model;
  696. _this.brand = item.brand;
  697. _this.unit = item.unit;
  698. _this.remark = item.remark;
  699. _this.num = 1;
  700. _this.zindex1 = 0;
  701. _this.zindex2 = 0;
  702. _this.zindex3 = 0;
  703. _this.zindex4 = 0;
  704. _this.zindex5 = 0;
  705. _this.addModalVisible = true;
  706. },
  707. AddProduct() {
  708. let data = {};
  709. if (parseFloat(_this.num) <= 0) {
  710. _this.alertInfo("请填写正确的数量!")
  711. return
  712. }
  713. setTimeout(() => {
  714. let receiptNum = uni.getStorageSync("receipt_num")
  715. let number = uni.getStorageSync("number")
  716. let containerCode = uni.getStorageSync("container_code")
  717. uni.request({
  718. url: ParamreqRootUrl + '/GroupDiskAdd',
  719. method: 'POST',
  720. async: false,
  721. headers: {
  722. 'Content-Type': 'application/json'
  723. },
  724. data: JSON.stringify({
  725. "code": _this.pruduct_code,
  726. "num": parseFloat(_this.num),
  727. "remark": _this.remark,
  728. "types": "normal",
  729. "receipt_num": receiptNum,
  730. "number": number,
  731. "container_code": containerCode,
  732. }),
  733. success: (ret) => {
  734. if (ret.statusCode === 200) {
  735. setTimeout(() => {
  736. if(ret.data.ret == "failed"){
  737. _this.alertInfo(ret.data.msg)
  738. }else{
  739. _this.alertInfo("添加成功!")
  740. }
  741. _this.$nextTick(() => {
  742. _this.pruduct_code = "";
  743. _this.number ="";
  744. _this.sn = "";
  745. _this.name = "";
  746. _this.code ="";
  747. _this.model = "";
  748. _this.brand = "";
  749. _this.unit = "";
  750. _this.remark = "";
  751. _this.num = 0;
  752. _this.zindex1 = 1;
  753. _this.zindex2 = 2;
  754. _this.zindex3 = 3;
  755. _this.zindex4 = 4;
  756. _this.zindex5 = 5;
  757. // 关闭窗口后,恢复默认内容
  758. _this.addModalVisible = false;
  759. _this.getList();
  760. })
  761. }, 30);
  762. }
  763. },
  764. fail: (err) => {
  765. // console.log("BBBBBBBBBBBBBB ", err)
  766. // console.log('request fail', err);
  767. },
  768. complete: (DATE) => {
  769. // console.log("BBBBBBBBBBBBBB ", DATE)
  770. // console.log('complete');
  771. }
  772. })
  773. }, 30)
  774. },
  775. closeUpdateModal() {
  776. _this.zindex1 = 1;
  777. _this.zindex2 = 2;
  778. _this.zindex3 = 3;
  779. _this.zindex4 = 4;
  780. _this.zindex5 = 5;
  781. // 关闭模态框
  782. _this.sn = "";
  783. _this.name = "";
  784. _this.code ="";
  785. _this.model = "";
  786. _this.brand = "";
  787. _this.unit = "";
  788. _this.remark = "";
  789. _this.num = 0;
  790. this.updateModalVisible = false;
  791. },
  792. Update(item) {
  793. if (item["allow_updates"] === false) {
  794. return
  795. }
  796. _this.sn = item.sn;
  797. _this.name = item.name;
  798. _this.code = item.code;
  799. _this.model = item.model;
  800. _this.brand = item.brand;
  801. _this.unit = item.unit;
  802. _this.remark = item.remark;
  803. _this.num = item.num;
  804. _this.zindex1 = 0;
  805. _this.zindex2 = 0;
  806. _this.zindex3 = 0;
  807. _this.zindex4 = 0;
  808. _this.zindex5 = 0;
  809. _this.updateModalVisible = true;
  810. },
  811. UpdateProduct() {
  812. let data = {};
  813. if (parseFloat(_this.num) <= 0) {
  814. _this.alertInfo("请填写正确的数量!")
  815. return
  816. }
  817. setTimeout(() => {
  818. let receiptNum = uni.getStorageSync("receipt_num")
  819. let containerCode = uni.getStorageSync("container_code")
  820. uni.request({
  821. url: ParamreqRootUrl + '/GroupDiskUpdate',
  822. method: 'POST',
  823. async: false,
  824. headers: {
  825. 'Content-Type': 'application/json'
  826. },
  827. data: JSON.stringify({
  828. "sn": _this.sn,
  829. "num": parseFloat(_this.num),
  830. "remark": _this.remark
  831. }),
  832. success: (ret) => {
  833. if (ret.statusCode === 200) {
  834. setTimeout(() => {
  835. _this.alertInfo("更新成功!")
  836. _this.$nextTick(() => {
  837. _this.sn = "";
  838. _this.name = "";
  839. _this.code ="";
  840. _this.model = "";
  841. _this.brand = "";
  842. _this.remark = "";
  843. _this.num = 0;
  844. _this.zindex1 = 1;
  845. _this.zindex2 = 2;
  846. _this.zindex3 = 3;
  847. _this.zindex4 = 4;
  848. _this.zindex5 = 5;
  849. // 关闭窗口后,恢复默认内容
  850. _this.updateModalVisible = false;
  851. _this.getList();
  852. })
  853. }, 30);
  854. }
  855. },
  856. fail: (err) => {
  857. // console.log("BBBBBBBBBBBBBB ", err)
  858. // console.log('request fail', err);
  859. },
  860. complete: (DATE) => {
  861. // console.log("BBBBBBBBBBBBBB ", DATE)
  862. // console.log('complete');
  863. }
  864. })
  865. }, 30)
  866. },
  867. Delete(item) {
  868. // 出库后 扫码再次组盘的条目 不允许删除和更新数量 allow_updates
  869. if (item["allow_updates"] === false) {
  870. return
  871. }
  872. this.sn = item["sn"]
  873. this.del_tips = "确定删除" + item["name"] + "?";
  874. this.$refs.deleteDialog.open()
  875. },
  876. dialogConfirm() {
  877. setTimeout(() => {
  878. uni.hideLoading()
  879. uni.request({
  880. url: ParamreqRootUrl + '/GroupDiskDelete',
  881. method: 'POST',
  882. async: false,
  883. headers: {
  884. 'Content-Type': 'application/json'
  885. },
  886. data: JSON.stringify({
  887. [_this.sn]: {}
  888. }),
  889. success: (ret) => {
  890. this.$refs.deleteDialog.close()
  891. _this.alertInfo("删除成功!")
  892. _this.getList()
  893. //处理成功逻辑
  894. },
  895. fail: (err) => {
  896. // console.log('request fail', err);
  897. },
  898. complete: () => {
  899. // console.log('complete');
  900. }
  901. })
  902. }, 30)
  903. },
  904. dialogClose() {
  905. _this.getList();
  906. },
  907. getList() {
  908. _this.$forceUpdate()
  909. _this.tableData = [];
  910. let receiptNum = uni.getStorageSync("receipt_num")
  911. // let number = uni.getStorageSync("number");
  912. let containerCode = uni.getStorageSync("container_code");
  913. /* if (!_this.isEmpty(number) && _this.isEmpty(_this.number)) {
  914. _this.number = number;
  915. } */
  916. if (!_this.isEmpty(containerCode) && _this.isEmpty(_this.container_code)) {
  917. _this.container_code = containerCode;
  918. }
  919. /**/
  920. if (_this.isEmpty(_this.container_code)) {
  921. return
  922. }
  923. uni.request({
  924. url: ParamreqRootUrl + '/GroupDiskGetByCode',
  925. method: 'POST',
  926. async: false,
  927. headers: {
  928. 'Content-Type': 'application/json'
  929. },
  930. data: JSON.stringify({
  931. /* "number": _this.number, */
  932. "code": _this.container_code,
  933. // "receipt_num": receiptNum,
  934. }),
  935. success: (ret) => {
  936. //处理成功逻辑
  937. if (ret.statusCode === 200) {
  938. let rows = ret.data.data;
  939. if (!_this.isEmpty(rows)) {
  940. for (var c = 0; c < rows.length; c++) {
  941. if (rows[c]["status"] === "status_yes") {
  942. rows[c]["status_view"] = "已组盘"
  943. } else {
  944. rows[c]["status_view"] = "待组盘"
  945. }
  946. }
  947. _this.tableData = rows
  948. }
  949. }
  950. },
  951. fail: (err) => {
  952. // console.log('request fail', err);
  953. },
  954. complete: () => {
  955. // console.log('complete');
  956. }
  957. })
  958. },
  959. // 组盘入库
  960. groupDisk: function() {
  961. _this.firstFocus = false;
  962. // console.log("_this.BtnDisabled ", _this.BtnDisabled)
  963. if (_this.isEmpty(_this.container_code)) {
  964. _this.alertInfo("托盘码不能为空")
  965. return
  966. }
  967. if (_this.BtnDisabled) {
  968. _this.alertInfo("已组盘货物不能再次组盘")
  969. return;
  970. }
  971. if (_this.qualified == "不良" && _this.isEmpty(_this.area_sn)) {
  972. _this.alertInfo("不良品入库,请选择库区")
  973. return;
  974. }
  975. if (_this.isEmpty(_this.category_sn)) {
  976. _this.alertInfo("请选择入库类别")
  977. return
  978. }
  979. if (_this.isEmpty(_this.qualified)) {
  980. _this.alertInfo("请选择入库状态")
  981. return
  982. }
  983. if (_this.isEmpty(_this.stockarea)) {
  984. _this.alertInfo("请选择U8仓库")
  985. return
  986. }
  987. if (_this.isEmpty(_this.port_sn) && _this.types != "out") {
  988. _this.alertInfo("请选择入库口")
  989. return
  990. }
  991. setTimeout(() => {
  992. this.$refs.groupDialog.open()
  993. }, 30)
  994. },
  995. // 空筐入库
  996. addMaterial: function() {
  997. _this.firstFocus = false;
  998. // console.log("_this.BtnDisabled ", _this.BtnDisabled)
  999. if (_this.isEmpty(_this.container_code)) {
  1000. _this.alertInfo("托盘码不能为空")
  1001. return
  1002. }
  1003. if (_this.isEmpty(_this.port_sn) && _this.types != "out") {
  1004. _this.alertInfo("请选择入库口")
  1005. return
  1006. }
  1007. setTimeout(() => {
  1008. this.$refs.groupMaterialDialog.open()
  1009. }, 30)
  1010. },
  1011. // 确定组盘
  1012. dialogGroup() {
  1013. let sns = [];
  1014. for (var d = 0; d < _this.tableData.length; d++) {
  1015. if (this.tableData[d]["status"] !== "status_wait") {
  1016. continue
  1017. }
  1018. sns.push(this.tableData[d].sn)
  1019. }
  1020. let receiptNum = uni.getStorageSync("receipt_num")
  1021. if (_this.isEmpty(_this.container_code)) {
  1022. _this.alertInfo("组盘失败!托盘码不能为空")
  1023. return
  1024. }
  1025. if (_this.isEmpty(_this.category_sn)) {
  1026. _this.alertInfo("请选择入库类别")
  1027. return
  1028. }
  1029. if (_this.isEmpty(_this.qualified)) {
  1030. _this.alertInfo("请选择入库状态")
  1031. return
  1032. }
  1033. if (_this.isEmpty(_this.stockarea)) {
  1034. _this.alertInfo("请选择U8仓库")
  1035. return
  1036. }
  1037. uni.request({
  1038. url: ParamreqRootUrl + '/ReceiptAdd',
  1039. method: 'POST',
  1040. async: false,
  1041. headers: {
  1042. 'Content-Type': 'application/json'
  1043. },
  1044. data: JSON.stringify({
  1045. "group_disk_sn_list": sns,
  1046. "container_code": _this.container_code,
  1047. "receipt_num": receiptNum,
  1048. "types": _this.types,
  1049. "areaSn": _this.area_sn,
  1050. "category_sn": _this.category_sn,
  1051. "upstreamstock" : _this.stockarea,
  1052. "qualified": _this.qualified,
  1053. "srcaddr": JSON.parse(_this.port_sn)
  1054. }),
  1055. success: (ret) => {
  1056. _this.alertInfo("操作成功")
  1057. _this.$nextTick(() => {
  1058. _this.container_code = "";
  1059. uni.setStorageSync("container_code", "")
  1060. _this.number = "";
  1061. uni.setStorageSync("number", "")
  1062. _this.area_sn = "";
  1063. _this.port_sn = "";
  1064. console.log("_this.number ", _this.number)
  1065. _this.getSn();
  1066. _this.tableData = [];
  1067. sns = [];
  1068. })
  1069. _this.$forceUpdate()
  1070. //_this.handlePrint(receiptNum)
  1071. },
  1072. fail: (err) => {
  1073. // console.log('request fail', err);
  1074. },
  1075. complete: () => {
  1076. // console.log('complete');
  1077. }
  1078. })
  1079. },
  1080. // 空筐确定
  1081. dialogMaterialGroup() {
  1082. let receiptNum = uni.getStorageSync("receipt_num")
  1083. if (_this.isEmpty(_this.container_code)) {
  1084. _this.alertInfo("组盘失败!托盘码不能为空")
  1085. return
  1086. }
  1087. uni.request({
  1088. url: ParamreqRootUrl + '/MaterialAdd',
  1089. method: 'POST',
  1090. async: false,
  1091. headers: {
  1092. 'Content-Type': 'application/json'
  1093. },
  1094. data: JSON.stringify({
  1095. "container_code": _this.container_code,
  1096. "receipt_num": receiptNum,
  1097. "srcaddr": JSON.parse(_this.port_sn)
  1098. }),
  1099. success: (ret) => {
  1100. _this.alertInfo("操作成功")
  1101. _this.$nextTick(() => {
  1102. _this.container_code = "";
  1103. uni.setStorageSync("container_code", "")
  1104. _this.number = "";
  1105. uni.setStorageSync("number", "")
  1106. _this.area_sn = "";
  1107. _this.getSn();
  1108. _this.getList();
  1109. })
  1110. _this.$forceUpdate()
  1111. //_this.handlePrint(receiptNum)
  1112. },
  1113. fail: (err) => {
  1114. // console.log('request fail', err);
  1115. },
  1116. complete: () => {
  1117. // console.log('complete');
  1118. }
  1119. })
  1120. },
  1121. // 1号口
  1122. getOneNilCode: function() {
  1123. _this.firstFocus = false;
  1124. setTimeout(() => {
  1125. this.$refs.nilCodeOneDialog.open()
  1126. }, 30)
  1127. },
  1128. // 1号口确定
  1129. dialogNilCodeOne() {
  1130. uni.request({
  1131. url: ParamreqRootUrl + '/PDACallEmptyTray',
  1132. method: 'POST',
  1133. async: false,
  1134. headers: {
  1135. 'Content-Type': 'application/json'
  1136. },
  1137. data: JSON.stringify({
  1138. "export": "1",
  1139. }),
  1140. success: (ret) => {
  1141. if (ret.statusCode == "200") {
  1142. if (ret.data.ret == "failed") {
  1143. _this.alertInfo(ret.data.msg)
  1144. return
  1145. } else {
  1146. _this.alertInfo("操作成功")
  1147. return
  1148. }
  1149. } else {
  1150. _this.alertInfo("操作失败")
  1151. }
  1152. },
  1153. fail: (err) => {
  1154. // console.log('request fail', err);
  1155. },
  1156. complete: () => {
  1157. // console.log('complete');
  1158. }
  1159. })
  1160. },
  1161. // 2号口
  1162. getTwoNilCode: function() {
  1163. _this.firstFocus = false;
  1164. setTimeout(() => {
  1165. this.$refs.nilCodeTwoDialog.open()
  1166. }, 30)
  1167. },
  1168. // 2号口确定
  1169. dialogNilCodeTwo() {
  1170. uni.request({
  1171. url: ParamreqRootUrl + '/PDACallEmptyTray',
  1172. method: 'POST',
  1173. async: false,
  1174. headers: {
  1175. 'Content-Type': 'application/json'
  1176. },
  1177. data: JSON.stringify({
  1178. "export": "2",
  1179. }),
  1180. success: (ret) => {
  1181. if (ret.statusCode == "200") {
  1182. if (ret.data.ret == "failed") {
  1183. _this.alertInfo(ret.data.msg)
  1184. return
  1185. } else {
  1186. _this.alertInfo("操作成功")
  1187. return
  1188. }
  1189. } else {
  1190. _this.alertInfo("操作失败")
  1191. }
  1192. },
  1193. fail: (err) => {
  1194. // console.log('request fail', err);
  1195. },
  1196. complete: () => {
  1197. // console.log('complete');
  1198. }
  1199. })
  1200. },
  1201. isEmpty: function(obj) {
  1202. return typeof obj === undefined || obj == null || obj === "" || obj ===
  1203. "000000000000000000000000" ||
  1204. obj.length === 0;
  1205. },
  1206. alertInfo(str) {
  1207. SpeechTTS.speak({
  1208. text: str,
  1209. });
  1210. modal.toast({
  1211. message: str,
  1212. duration: 6,
  1213. });
  1214. },
  1215. onNavigationBarButtonTap: function(e) {
  1216. setTimeout(() => {
  1217. uni.navigateTo({
  1218. url: '/pages/sample/richAlert',
  1219. })
  1220. }, 500);
  1221. },
  1222. SelectProduct() {
  1223. setTimeout(() => {
  1224. _this.firstFocus = false;
  1225. uni.navigateTo({
  1226. url: '/pages/sample/product',
  1227. })
  1228. }, 30)
  1229. },
  1230. getSn() {
  1231. let today = new Date();
  1232. let year = today.getFullYear();
  1233. let month = today.getMonth() + 1;
  1234. let date = today.getDate();
  1235. let hours = today.getHours();
  1236. let minutes = today.getMinutes();
  1237. let seconds = today.getSeconds();
  1238. let millisecond = today.getMilliseconds()
  1239. if (month <= 9) {
  1240. month = '0' + month
  1241. }
  1242. if (minutes <= 9) {
  1243. minutes = '0' + minutes;
  1244. }
  1245. if (date <= 9) {
  1246. date = '0' + date;
  1247. }
  1248. if (seconds <= 9) {
  1249. seconds = '0' + seconds;
  1250. }
  1251. let sn = year + '' + month + '' + date + '' + hours + '' + minutes + '' + seconds + '' + millisecond
  1252. uni.removeStorageSync('receipt_num');
  1253. uni.setStorageSync("receipt_num", sn)
  1254. uni.removeStorageSync('port_sn');
  1255. return sn
  1256. },
  1257. formattedDate(d) {
  1258. const date = new Date(d);
  1259. const year = date.getFullYear();
  1260. const month = String(date.getMonth() + 1).padStart(2, '0');
  1261. const day = String(date.getDate()).padStart(2, '0');
  1262. const hours = String(date.getHours()).padStart(2, '0');
  1263. const minutes = String(date.getMinutes()).padStart(2, '0');
  1264. const seconds = String(date.getSeconds()).padStart(2, '0');
  1265. return `${year}-${month}-${day}`;
  1266. },
  1267. focusInput() {
  1268. setTimeout(() => {
  1269. _this.$refs.trayCodeInput.focus();
  1270. }, 0);
  1271. },
  1272. // 新增聚焦到明细单号输入框的方法
  1273. focusReceiptInput() {
  1274. setTimeout(() => {
  1275. _this.$refs.receiptCodeInput.focus();
  1276. }, 0);
  1277. },
  1278. // 新增聚焦到明细单号输入框的方法
  1279. focuspruductCodeInput() {
  1280. setTimeout(() => {
  1281. _this.$refs.pruductCodeInput.focus();
  1282. }, 0);
  1283. },
  1284. },
  1285. }
  1286. </script>
  1287. <style scoped>
  1288. .nvue-page-root {
  1289. background-color: #F8F8F8;
  1290. padding-bottom: 0px;
  1291. }
  1292. .uni-form-item__title {
  1293. margin: 5px auto;
  1294. }
  1295. .uni-input-wrapper {
  1296. /* #ifndef APP-NVUE */
  1297. display: flex;
  1298. /* #endif */
  1299. flex-direction: row;
  1300. flex-wrap: nowrap;
  1301. background-color: #FFFFFF;
  1302. }
  1303. .uni-input {
  1304. height: 28px;
  1305. line-height: 28px;
  1306. font-size: 15px;
  1307. padding: 1px;
  1308. flex: 1;
  1309. border-radius: 5px;
  1310. border: 1px solid #cfdadd;
  1311. background-color: #FFFFFF;
  1312. }
  1313. .mini-btn {
  1314. height: 30px;
  1315. padding-left: 1px;
  1316. padding-right: 1px;
  1317. }
  1318. .uni-eye-active {
  1319. color: #007AFF;
  1320. }
  1321. .table-title {
  1322. background-color: aliceblue;
  1323. font-weight: 700;
  1324. margin-top: 10px;
  1325. height: 40px;
  1326. }
  1327. .table-data {
  1328. background-color: aliceblue;
  1329. font-weight: 700;
  1330. margin-top: 1px;
  1331. height: 40px;
  1332. }
  1333. .tab-tr {
  1334. width: 25%;
  1335. line-height: 50px;
  1336. border-right: 1px solid #ccc;
  1337. margin: auto;
  1338. text-align: center;
  1339. }
  1340. .tab-tr-end {
  1341. width: 25%;
  1342. line-height: 50px;
  1343. border-right: 0px solid #ccc;
  1344. margin: auto;
  1345. text-align: center;
  1346. }
  1347. </style>
  1348. <style lang="scss">
  1349. $color-base: #0039a6;
  1350. $words-color-base: #333333;
  1351. $words-color-light: #999999;
  1352. .header-wrap {
  1353. width: 100%;
  1354. position: fixed;
  1355. top: 0;
  1356. z-index: 999;
  1357. .index-header {
  1358. height: 88upx;
  1359. line-height: 88upx;
  1360. padding: 0 30upx;
  1361. padding-top: 40upx;
  1362. background-color: $color-base;
  1363. font-Size: 28upx;
  1364. color: #fff;
  1365. display: flex;
  1366. align-items: center;
  1367. justify-content: space-between;
  1368. .fanhui {
  1369. color: #fff !important;
  1370. font-size: 28px;
  1371. padding-top: 5px;
  1372. font-weight: 700;
  1373. }
  1374. .lanya {
  1375. color: #fff !important;
  1376. font-size: 28px;
  1377. padding-top: 5px;
  1378. }
  1379. .map-wrap {
  1380. padding-top: 5px;
  1381. }
  1382. }
  1383. }
  1384. .blank {
  1385. height: 126upx;
  1386. }
  1387. // 购物车列表
  1388. .cart-list {
  1389. padding: 0 5rpx;
  1390. // 购物车商品
  1391. .goods {
  1392. display: flex;
  1393. padding: 5rpx;
  1394. border-radius: 10rpx;
  1395. background-color: #fff;
  1396. position: relative;
  1397. .meta {
  1398. // border:1px solid red;
  1399. flex: 1;
  1400. display: flex;
  1401. flex-direction: column;
  1402. justify-content: space-between;
  1403. margin-left: 5rpx;
  1404. }
  1405. .name {
  1406. height: auto;
  1407. font-size: 18px;
  1408. color: #000000;
  1409. }
  1410. .specs {
  1411. line-height: 2;
  1412. padding: 0 15rpx;
  1413. font-size: 16px;
  1414. align-self: flex-start;
  1415. border-radius: 4rpx;
  1416. color: #888;
  1417. background-color: #f7f7f8;
  1418. }
  1419. .status_view {
  1420. line-height: 1;
  1421. font-size: 18px;
  1422. color: #444;
  1423. margin-bottom: 2rpx;
  1424. color: #000000;
  1425. padding-top: 5px;
  1426. }
  1427. // 商品数量
  1428. .numGroup {
  1429. // border: 1px solid green;
  1430. // position: absolute;
  1431. // bottom: 70rpx;
  1432. // right: 5rpx;
  1433. display: flex;
  1434. justify-content: space-between;
  1435. align-items: center;
  1436. // width: 120px;
  1437. height: 48rpx;
  1438. .text_1 {
  1439. // border: 1px solid red;
  1440. width: 50px;
  1441. height: 100%;
  1442. padding: 0 5rpx;
  1443. font-size: 15px;
  1444. color: #444;
  1445. }
  1446. .text {
  1447. height: 100%;
  1448. padding: 0 5rpx;
  1449. font-size: 32rpx;
  1450. color: #444;
  1451. }
  1452. .inputs {
  1453. // border: 1px solid blue;
  1454. height: 100%;
  1455. padding-bottom: 10px;
  1456. text-align: center;
  1457. border-radius: 4rpx;
  1458. font-size: 20px;
  1459. color: #ff0000;
  1460. // background-color: #f6f6f6;
  1461. }
  1462. }
  1463. // 商品数量
  1464. .weightGroup {
  1465. // border: 1px solid green;
  1466. position: absolute;
  1467. bottom: 20rpx;
  1468. right: 5rpx;
  1469. display: flex;
  1470. justify-content: space-between;
  1471. align-items: center;
  1472. width: 120px;
  1473. height: 48rpx;
  1474. .text_1 {
  1475. // border: 1px solid red;
  1476. width: 50px;
  1477. height: 100%;
  1478. padding: 0 5rpx;
  1479. font-size: 15px;
  1480. color: #444;
  1481. }
  1482. .text {
  1483. height: 100%;
  1484. padding: 0 5rpx;
  1485. font-size: 32rpx;
  1486. color: #444;
  1487. }
  1488. .inputs {
  1489. // border: 1px solid blue;
  1490. height: 100%;
  1491. padding-bottom: 10px;
  1492. text-align: center;
  1493. border-radius: 4rpx;
  1494. font-size: 20px;
  1495. color: #ff0000;
  1496. // background-color: #f6f6f6;
  1497. }
  1498. }
  1499. }
  1500. .cart-swipe {
  1501. display: block;
  1502. margin: 20rpx 0;
  1503. }
  1504. }
  1505. </style>