group.vue 44 KB

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