group.vue 43 KB

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