《工厂订单出入库信息管理系统》模块5 -- 扫码装箱
生活随笔
收集整理的這篇文章主要介紹了
《工厂订单出入库信息管理系统》模块5 -- 扫码装箱
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
一、前言
工廠訂單及出入庫(kù)業(yè)務(wù)的趨勢(shì)是客戶要求越來越高,客戶需要快捷、方便、簡(jiǎn)單、一站式的出入庫(kù)手續(xù)。因此,貨物出入庫(kù)管理信息系統(tǒng)要簡(jiǎn)化出入庫(kù)手續(xù),減輕人員作業(yè)量,提高工作效率,助力企業(yè)數(shù)字信息化轉(zhuǎn)型。
之前整理過該系統(tǒng)的完整解決方案,有興趣的參考文章:https://blog.csdn.net/lildkdkdkjf/article/details/117841646
二、整體架構(gòu)設(shè)計(jì)
開發(fā)語言:
- Golang:Go 極其地快。其性能與 Java 或 C++相似。在我們的使用中,Go 一般比 Python 要快 30 倍。
- Vue: 輕量級(jí)框架, 大小只有幾十kb, 國(guó)人開發(fā),中文文檔,不存在語言障礙,易于理解和學(xué)習(xí)。運(yùn)行速度更快,相比較與react而言,同樣都是操作虛擬dom,就性能而言,vue存在很大的優(yōu)勢(shì)。
部署方式:??
- 服務(wù)器系統(tǒng):基于免安裝可執(zhí)行程序:支持Windows、Linux,Centos,Ubuntu操作系統(tǒng);
- 數(shù)據(jù)庫(kù)類型:目前已支持PostgreSQL、MySQL、Oracle、Microsoft SQL Server、SQLite等,還可以定制其它類型數(shù)據(jù)庫(kù)。
- 熱數(shù)據(jù)緩存服務(wù):基于Key-Value 的Redis?數(shù)據(jù)庫(kù),關(guān)鍵熱活數(shù)據(jù)存儲(chǔ)在Redis服務(wù)中,提高響應(yīng)速率。
- 主備雙活服務(wù)器:確保穩(wěn)定性,如果主服務(wù)器故障,自動(dòng)切換到備服務(wù)器。熱數(shù)據(jù)
- 數(shù)據(jù)庫(kù)備份:定時(shí)增量備份,定期全量備份。
三、編碼實(shí)現(xiàn) (基于篇幅及可讀性考慮,此處展示部分關(guān)鍵代碼)
1、模塊截圖
2、Go?關(guān)鍵代碼
package controllersimport ("encoding/json""fmt""productManage/common"writelog "productManage/log""productManage/models" )// LogController operations for Log type BoxController struct {BaseController }// URLMapping ... func (c *BoxController) URLMapping() {c.Mapping("Post", c.Post) }func (c *BoxController) Post() {if c.CheckToken() < 0 {return}ret := common.RetOKact := c.GetString("Act")writelog.WriteDebug("||||||||||||||||||||||||||||||-----------> %+v ", act)if act == common.ActAddBox {SnStart := c.GetString("SnStart")SnEnd := c.GetString("SnEnd")BoxNum, _ := c.GetInt("BoxNum")BoxTotal, _ := c.GetInt("BoxTotal")OrderID := c.GetString("OrderID")DistributeID, _ := c.GetInt64("DistributeID")RecipientID, _ := c.GetInt64("RecipientID")var m models.Boxm.SnStart = SnStartm.SnEnd = SnEndm.BoxNum = BoxNumm.BoxTotal = BoxTotalm.OrderID = OrderIDm.DistributeID = DistributeIDm.RecipientID = RecipientIDid, _ := models.AddBox(&m)c.jsonStandardResult(ret, "OK", id)return}if act == common.ActGetBoxBySnStart {SnStart := c.GetString("SnStart")SnStart,_, SnType := models.GetSnBySnOrKsn(SnStart)//如果輸入的是Ksn,這里會(huì)轉(zhuǎn)成真正的Snv, err := models.GetBoxBySnStart(SnStart)if err != nil {ret = common.RetErrorBoxEmptyc.jsonStandardResult(ret, "", "")return}writelog.WriteDebug("%+v", v)type rsp struct {SnStart stringSnEnd stringBox stringStatusBox int8SnList []string}var r rspwritelog.WriteDebug("snType %s", SnType)if SnType == "sn" { // snr.Box = fmt.Sprintf("%d/%d", v.BoxNum, v.BoxTotal)r.SnStart = v.SnStartr.SnEnd = v.SnEnd_, SnList, _, _ := models.GetSnListByOrderIDAndBoxNum(v.OrderID, v.BoxNum)for _, v := range SnList {r.SnList = append(r.SnList, v.Sn)}}else { // ksnr.Box = fmt.Sprintf("%d/%d", v.BoxNum, v.BoxTotal)sStart, _ := models.GetKsnBySn(v.SnStart)r.SnStart = sStart.KsnsEnd, _ := models.GetKsnBySn(v.SnEnd)r.SnEnd = sEnd.Ksn_, SnList, _, _ := models.GetSnListByOrderIDAndBoxNum(v.OrderID, v.BoxNum)for _, v := range SnList {r.SnList = append(r.SnList, v.Ksn)}}r.StatusBox = v.StatusBoxc.jsonStandardResult(ret, "", r)return}if act == common.ActGetBoxList {StartTime, _ := c.GetInt64("StartTime")EndTime, _ := c.GetInt64("EndTime")OrderID := c.GetString("OrderID")Box := c.GetString("Box")BoxNum, BoxTotal := common.SplitBoxNumAndTotal(Box)StatusBox, _ := c.GetInt("StatusBox")Page, _ := c.GetInt("Page")RowNum, _ := c.GetInt("RowNum")recordcount, b, err := models.GetBoxList(StartTime, EndTime, StatusBox, BoxNum, BoxTotal, OrderID, Page, RowNum)if err != nil {ret = common.RetErrorBoxEmptyc.jsonStandardResult(ret, "", err.Error())return}writelog.WriteDebug("%+v", b)type rsp struct {SnStart stringSnEnd stringBox stringStatusBox int8StatusBoxOkNum stringOrderID stringCreateTime int64}var rList []rspvar r rspfor _, v := range b {r.Box = fmt.Sprintf("%d/%d", v.BoxNum, v.BoxTotal)r.StatusBox = v.StatusBoxr.SnEnd = v.SnEndr.SnStart = v.SnStartr.CreateTime = v.CreateTimer.OrderID = v.OrderIDo, _ := models.GetOrderById(v.OrderID)OkNum,_ := models.CountSnByStatusBox( v.BoxNum, v.OrderID, common.StatusOk)r.StatusBoxOkNum = common.MergeBoxNumAndTotal(OkNum, o.NumberPerBox)rList = append(rList, r)}//c.jsonStandardResult(ret, "", rList)c.Data["json"] = struct {Ret intMsg stringRecordcount int64Data interface{}}{Ret: common.RetOK,Msg: common.GetErrMsg(common.RetOK),Recordcount: recordcount,Data: rList,}c.ServeJSON()return}if act == common.ActSetStatusBox {SnStart := c.GetString("SnStart")SnEnd := c.GetString("SnEnd")SnStart,_, _type := models.GetSnBySnOrKsn(SnStart)//如果輸入的是Ksn,這里會(huì)轉(zhuǎn)成真正的Sn//SnEnd,_, _type = models.GetSnBySnOrKsn(SnEnd)Box := c.GetString("Box")SnOkList := c.GetString("SnOkList")var OkList []stringerr := json.Unmarshal([]byte(SnOkList), &OkList)if err != nil {c.jsonStandardResult(common.RetErrorBoxSetStatusBoxParseJsonData, "", "")return}go setBoxStatusExt(c.GetString("Token"), _type, SnStart, SnEnd , Box, OkList)c.jsonStandardResult(ret, "", 0)//log := fmt.Sprintf("掃描裝箱: 箱號(hào)[%s] %s起止[%s-%s] 數(shù)量[%d]", Box, _type, SnStart, SnEnd, len(OkList))//models.AddSystemLogByToken(c.GetString("Token"), common.LogType_Update, log)return}if act == common.ActSetStatusBoxBySn {Sn := c.GetString("Sn")SnStart := c.GetString("SnStart")SnEnd := c.GetString("SnEnd")Sn,_, _ = models.GetSnBySnOrKsn(Sn)SnStart,_, _ = models.GetSnBySnOrKsn(SnStart)SnEnd,_, _ = models.GetSnBySnOrKsn(SnEnd)Box := c.GetString("Box")//判斷sn是否為該箱if (len(Sn) <= 0) || (Sn > SnEnd) || (Sn < SnStart){ret = common.RetErrorSnNotInBoxc.jsonStandardResult(ret, "", "")return}//1. 更新sn表狀態(tài),根據(jù)箱號(hào)BoxNum和訂單號(hào)OrderIDBoxNum, _ := common.SplitBoxNumAndTotal(Box)// 獲取訂單號(hào)v, err := models.GetBoxBySnStart(SnStart)if err != nil {ret = common.RetErrorBoxEmptyc.jsonStandardResult(ret, "", "")return}OrderID := v.OrderIDRecipientID := v.RecipientIDmodels.UpdateSnBoxStatusBySn(BoxNum, OrderID, Sn, common.StatusOk)//2. 更新box表狀態(tài), 獲取每箱的產(chǎn)品數(shù) NumberPerBoxBoxStatusBox := getBoxStatusBox(BoxNum, OrderID)models.UpdateBoxStatusBoxBySnStart(SnStart, BoxStatusBox)//3. 更新Recipient表狀態(tài): 判斷 RecipientID 對(duì)應(yīng)的StatusBox是否均為okRecipientStatusBox := getRecipientStatusBox(RecipientID)_, err = models.EditRecipientStatusBox(RecipientID, RecipientStatusBox)if err != nil {ret = common.RetErrorEditRecipientStatusBoxc.jsonStandardResult(ret, "", "")return}//4. 更新Distribute表狀態(tài)//5. 更新Order表狀態(tài)OrderStatusBox := getOrderStatusBox(OrderID)_, err = models.UpdateOrderStatusBox(OrderID, OrderStatusBox)if err != nil {ret = common.RetErrorUpdateOrderStatusBoxc.jsonStandardResult(ret, "", "")return}//提示正確多少sn,總共多少snsnTotalOk ,_ :=models.CountSnByStatusBox(BoxNum, OrderID, common.StatusOk)snTotal ,_ := models.CountSnByBoxNumAndOrderID(BoxStatusBox, OrderID)msg:=""if snTotalOk < snTotal{msg = fmt.Sprintf("總SN數(shù)[%d], 裝箱正確的SN數(shù)[%d], 待處理的SN數(shù)[%d]", snTotal, snTotalOk, snTotal - snTotalOk)c.jsonStandardResult(common.RetErrorBoxSetStatusBoxOKAlertMsg, msg, 0)}else{c.jsonStandardResult(ret, "", 0)}log := fmt.Sprintf("掃描裝箱->維修SN: 箱號(hào)[%s] SN起止[%s-%s] SN[%s] %s", Box, SnStart, SnEnd, Sn, msg)models.AddSystemLogByToken(c.GetString("Token"), common.LogType_Update, log)return}c.jsonStandardResult(common.RetErrorAct, "", nil)return }func getBoxStatusBox(BoxNum int, OrderID string) (BoxStatus int){//orderV, err := models.GetOrderById(OrderID)//if err != nil {// writelog.WriteDebug("%+v" , err.Error())// return common.StatusError//}//NumberPerBox := orderV.NumberPerBox 可能存在散箱,所以不能這么判斷,需要用實(shí)際的SN個(gè)數(shù)判斷//Box 只有正確或異常狀態(tài)StatusBoxAllNum, _ := models.CountSnByBoxNumAndOrderID(BoxNum, OrderID)StatusBoxOkNum, _ := models.CountSnByStatusBox(BoxNum, OrderID, common.StatusOk)if StatusBoxOkNum == StatusBoxAllNum {return common.StatusOk}return common.StatusException//StatusBoxExceptionNum, _ := models.CountSnByStatusBox(BoxNum, OrderID, common.StatusException)//if StatusBoxExceptionNum > 0 {// return common.StatusException//}////return common.StatusDoing }func getRecipientStatusBox(RecipientID int64) (BoxStatus int) {if RecipientID == 0{return common.StatusAll}BoxTotal, _ := models.CountBoxByRecipientID(RecipientID)StatusBoxOkNum, _ := models.CountBoxByStatusBox(RecipientID, common.StatusOk)if StatusBoxOkNum == BoxTotal {return common.StatusOk}StatusBoxExceptionNum, _ := models.CountBoxByStatusBox(RecipientID, common.StatusException)if StatusBoxExceptionNum > 0 {return common.StatusException}return common.StatusDoing }func getOrderStatusBox(OrderID string) (StatusBox int) {// 1.獲取收件人個(gè)數(shù)o, _ := models.GetOrderById(OrderID)RecipientTotal := o.RecipientTotal// 2.獲取ok狀態(tài)的個(gè)數(shù)StatusOkNum, _ := models.CountRecipientByStatusBox(OrderID, common.StatusOk)if StatusOkNum == RecipientTotal {return common.StatusOk}// 2.獲取Exception狀態(tài)的個(gè)數(shù)StatusExceptionNum, _ := models.CountRecipientByStatusBox(OrderID, common.StatusException)if StatusExceptionNum > 0 {return common.StatusException}return common.StatusDoing }func setBoxStatusExt(token string, _type string, SnStart string, SnEnd string, Box string, OkList []string) (ret int){if _type == "ksn" {for i, v := range OkList{OkList[i], _, _ = models.GetSnByKsn(v)}SnEnd,_, _ = models.GetSnByKsn(SnEnd)}//1. 更新sn表狀態(tài),根據(jù)箱號(hào)BoxNum和訂單號(hào)OrderIDBoxNum, _ := common.SplitBoxNumAndTotal(Box)// 獲取訂單號(hào)v, err := models.GetBoxBySnStart(SnStart)if err != nil {//ret = common.RetErrorBoxEmpty//c.jsonStandardResult(ret, "", "")return common.RetErrorBoxEmpty}OrderID := v.OrderIDRecipientID := v.RecipientIDmodels.UpdateSnStatusBox(OkList, common.StatusOk)//2. 更新box表狀態(tài), 獲取每箱的產(chǎn)品數(shù) NumberPerBoxBoxStatusBox := getBoxStatusBox(BoxNum, OrderID)_, err = models.UpdateBoxStatusBoxBySnStart(SnStart, BoxStatusBox)if err != nil {log := fmt.Sprintf("掃描裝箱錯(cuò)誤(%v): 箱號(hào)[%s] %s起止[%s-%s] 數(shù)量[%d]", common.RetErrorBoxUpdateBoxStatus, Box, _type, SnStart, SnEnd, len(OkList))models.AddSystemLogByToken(token, common.LogType_Update, log)return common.RetErrorBoxUpdateBoxStatus}//3. 更新Recipient表狀態(tài): 判斷 RecipientID 對(duì)應(yīng)的StatusBox是否均為okif RecipientID >0{RecipientStatusBox := getRecipientStatusBox(RecipientID)_, err = models.EditRecipientStatusBox(RecipientID, RecipientStatusBox)if err != nil {//ret = common.RetErrorEditRecipientStatusBox//c.jsonStandardResult(ret, "", "")log := fmt.Sprintf("掃描裝箱錯(cuò)誤(%v): 箱號(hào)[%s] %s起止[%s-%s] 數(shù)量[%d]", common.RetErrorEditRecipientStatusBox, Box, _type, SnStart, SnEnd, len(OkList))models.AddSystemLogByToken(token, common.LogType_Update, log)return common.RetErrorEditRecipientStatusBox}}//4. 更新Distribute表狀態(tài)//5. 更新Order表狀態(tài)OrderStatusBox := getOrderStatusBox(OrderID)_, err = models.UpdateOrderStatusBox(OrderID, OrderStatusBox)if err != nil {//ret = common.RetErrorUpdateOrderStatusBox//c.jsonStandardResult(ret, "", "")log := fmt.Sprintf("掃描裝箱錯(cuò)誤(%v): 箱號(hào)[%s] %s起止[%s-%s] 數(shù)量[%d]", common.RetErrorUpdateOrderStatusBox, Box, _type, SnStart, SnEnd, len(OkList))models.AddSystemLogByToken(token, common.LogType_Update, log)return common.RetErrorUpdateOrderStatusBox}log := fmt.Sprintf("掃描裝箱正確: 箱號(hào)[%s] %s起止[%s-%s] 數(shù)量[%d]", Box, _type, SnStart, SnEnd, len(OkList))models.AddSystemLogByToken(token, common.LogType_Update, log)return common.RetOK}3、vue代碼?
<template><div class="page-container"><div class="el-form"><div style="margin-bottom: 20px;">第{{ currentNum }}/{{ totalNum }}箱</div><div class="form-group"><div class="flex"><div class="label">快運(yùn)單號(hào)</div><el-input v-model="formData.expressId" ref="expressIdRef" placeholder="請(qǐng)掃描快運(yùn)單號(hào)" @input="changeInput" @focus="focusInput('expressId')"></el-input></div></div><div class="form-group"><div class="flex"><div class="label">SN號(hào)起始</div><el-input v-model="formData.snStart" ref="snStartRef" placeholder="請(qǐng)掃描SN號(hào)起始" @input="changeInput" @focus="focusInput('snStart')"></el-input></div></div><div class="form-group"><div class="flex"><div class="label">SN號(hào)終止</div><el-input v-model="formData.snEnd" ref="snEndRef" @input="changeInput" placeholder="請(qǐng)掃描SN號(hào)終止" @focus="focusInput('snEnd')"></el-input></div></div><div class="form-group"><div class="flex"><div class="label">箱號(hào)</div><el-input v-model="formData.boxNum" ref="boxNumRef" placeholder="請(qǐng)掃描箱號(hào)" @input="changeInput" @focus="focusInput('boxNum')"></el-input><div class="box-right" src="../../assets/right.png" v-if="boxChecked && boxRight"></div><div class="box-error" src="../../assets/error.png" v-if="boxChecked && !boxRight"></div></div><div class="error" v-if="boxChecked && !boxRight">快運(yùn)單號(hào) {{ formData.expressId }} 和箱號(hào) {{ box }} 不匹配</div></div><div class="operates"><el-button type="primary" style="margin-top:50px;" @click="confirmTypeByScan">強(qiáng)制確認(rèn)</el-button></div></div></div> </template> <script> import { RECIPIENT_API_PATH } from '../../service/api'; import Vue from 'vue'; Vue.directive('paste', {// 因?yàn)橐粋€(gè)元素只有插入dom之后,才能獲取焦點(diǎn)updated: function(el) {alert(el.value);} });export default {data() {return {path: '',focus: 'expressId',totalNum: 0,currentNum: 0,boxChecked: false,boxRight: true,hasError: false,snList: [], //從后臺(tái)獲取的每箱數(shù)據(jù)ksnList: [],errorBoxList: [],snOkList: [],ksnOkList: [],box:"",hasEnter:false,formData: {boxNum: '',snStart: '',snEnd: '',expressId: ''}};},mounted() {this.path = this.$route.query.type;console.log('path=' + this.path);document.body.onkeydown = e => {if (e.keyCode == 13) {this.enterInput()} else if (e.keyCode == 86) {}};this.$nextTick(() => {this.$refs.expressIdRef.focus();});},methods: {changeInput(){this.hasEnter = falseconsole.log("ctrl+v")setTimeout(()=>{if(!this.hasEnter){console.log("程序自動(dòng)enter")this.enterInput()}},1000)},enterInput(){this.hasEnter = trueif (this.focus == 'expressId') {this.focus = 'snStart';this.$refs.snStartRef.focus();this.getBoxListByExpressID(this.snStart);} else if (this.focus == 'snStart') {this.checkSnStart();this.focus = 'snEnd';this.$refs.snEndRef.focus();this.boxChecked = false;} else if (this.focus == 'snEnd') {this.checkSnEnd();this.focus = 'boxNum';this.$refs.boxNumRef.focus();} else if (this.focus == 'boxNum') {this.checkBox();console.log('currentNum=' + this.currentNum);if (this.currentNum < this.totalNum) {this.focus = 'snStart';this.$refs.snStartRef.focus();this.formData.snStart = '';this.formData.snEnd = '';this.formData.boxNum = '';} else {this.confirmTypeByScan();}}},focusInput(str) {this.focus = str;},checkBox() {this.boxChecked = true;this.box = this.formData.boxNumif (this.snList.find(v => v.Box == this.formData.boxNum)) {this.boxRight = true;if (this.snOkList[this.currentNum]) {Object.assign(this.snOkList[this.currentNum], {Box: this.formData.boxNum});} else {this.snOkList[this.currentNum] = {Box: this.formData.boxNum};}this.currentNum = this.snOkList.length;return true;} else {if (this.ksnList.find(v => v.Box == this.formData.boxNum)) {this.boxRight = true;if (this.ksnOkList[this.currentNum]) {Object.assign(this.ksnOkList[this.currentNum], {Box: this.formData.boxNum});} else {this.ksnOkList[this.currentNum] = {Box: this.formData.boxNum};}this.currentNum = this.ksnOkList.length;return true;} else {this.boxRight = false;this.errorBoxList.push(this.formData.boxNum);if (this.snOkList[this.currentNum]) {this.snOkList.splice(this.currentNum, 1);}if (this.ksnOkList[this.currentNum]) {this.ksnOkList.splice(this.currentNum, 1);}return false;}}},checkSnStart() {if (this.snList.find(v => v.SnStart == this.formData.snStart)) {if (this.snOkList[this.currentNum]) {Object.assign(this.snOkList[this.currentNum], {SnStart: this.formData.snStart});} else {this.snOkList[this.currentNum] = {SnStart: this.formData.snStart};}return true;} else {if (this.ksnList.find(v => v.SnStart == this.formData.snStart)) {if (this.ksnOkList[this.currentNum]) {Object.assign(this.ksnOkList[this.currentNum], {SnStart: this.formData.snStart});} else {this.ksnOkList[this.currentNum] = {SnStart: this.formData.snStart};}return true;} else {this.hasError = true;this.$message({type:'error',message:'Sn號(hào)起始與快運(yùn)單號(hào)不匹配'});if (this.snOkList[this.currentNum]) {this.snOkList.splice(this.currentNum, 1);}if (this.ksnOkList[this.currentNum]) {this.ksnOkList.splice(this.currentNum, 1);}return false;}return false;}},checkSnEnd() {if (this.snList.find(v => v.SnEnd == this.formData.snEnd)) {if (this.snOkList[this.currentNum]) {Object.assign(this.snOkList[this.currentNum], {SnEnd: this.formData.snEnd});} else {this.snOkList[this.currentNum] = {SnEnd: this.formData.snEnd};}return true;} else {if (this.ksnList.find(v => v.SnEnd == this.formData.snEnd)) {if (this.ksnOkList[this.currentNum]) {Object.assign(this.ksnOkList[this.currentNum], {SnEnd: this.formData.snEnd});} else {this.ksnOkList[this.currentNum] = {SnEnd: this.formData.snEnd};}return true;} else {this.hasError = true;this.$message({message:'Sn號(hào)終止與快運(yùn)單號(hào)不匹配',type:"error"});if (this.snOkList[this.currentNum]) {this.snOkList.splice(this.currentNum, 1);}if (this.ksnOkList[this.currentNum]) {this.ksnOkList.splice(this.currentNum, 1);}return false;}}},confirmTypeByScan() {if (!this.hasError && this.errorBoxList.length <= 0) {let formData = new FormData();formData.append('Token', sessionStorage.getItem('token'));formData.append('ExpressID', this.formData.expressId);if (this.path == 'choice') {formData.append('Act', 'SetStatusPrepareByExpressID');//formData.append("StatusPrepare",item.StatusPrepare)} else {formData.append('Act', 'SetStatusQcByExpressID');//formData.append("StatusQc",item.StatusQc)}formData.append('ConfirmType', 2);this.$axios.post(RECIPIENT_API_PATH, formData).then(res => {if (res.data.Ret == 0) {this.$message({type:"success",message:"整單正確",duration:3000})} else {this.$message({message:res.data.Msg,type:"error",duration:3000});}}).finally(() => {this.focus = 'expressId';this.$refs.expressIdRef.focus();this.formData = {boxNum: '',snStart: '',snEnd: '',expressId: ''};this.box = ""this.totalNum = 0;this.currentNum = 0;this.boxChecked = false;});} else {let formData = new FormData();formData.append('Token', sessionStorage.getItem('token'));formData.append('ExpressID', this.formData.expressId);if (this.path == 'choice') {formData.append('Act', 'SetStatusPrepare');} else {formData.append('Act', 'SetStatusQc');}this.snOkList = this.snOkList.filter(v => {return v && v.SnStart && v.SnEnd && v.Box;});this.ksnOkList = this.ksnOkList.filter(v => {return v && v.SnStart && v.SnEnd && v.Box;});formData.append('SnOkList', JSON.stringify(this.snOkList));formData.append('KsnOkList', JSON.stringify(this.ksnOkList));this.$axios.post(RECIPIENT_API_PATH, formData).then(res => {if (res.data.Ret == 0) {} else {this.$message({type:"error",message:res.data.Msg});}}).finally(()=>{this.focus = 'expressId';this.$refs.expressIdRef.focus();this.formData = {boxNum: '',snStart: '',snEnd: '',expressId: ''};this.totalNum = 0;this.currentNum = 0;this.boxChecked = false;});}},getBoxListByExpressID() {let formData = new FormData();formData.append('Act', 'GetBoxListByExpressID');formData.append('Token', sessionStorage.getItem('token'));formData.append('ExpressID', this.formData.expressId);this.$axios.post(RECIPIENT_API_PATH, formData).then(res => {if (res.data.Ret == 0) {this.snList = res.data.Data && res.data.Data.SnList ? res.data.Data.SnList : [];this.ksnList = res.data.Data && res.data.Data.KsnList ? res.data.Data.KsnList : [];this.totalNum = res.data.Data&& res.data.Data.SnList?res.data.Data.SnList.length:0console.log("snList="+JSON.stringify(this.snList))console.log("ksnList="+JSON.stringify(this.ksnList))}else{this.$message({message:res.data.Msg,type:"error"})}});},pasteSn(e) {console.log(e.target.value);this.formData.boxNum = e.target.value;}} }; </script><style scoped="scoped"> .div {position: relative; } .label{width: 150px;text-align: right; } .error {padding-right: 160px;left: 0px;color: red;top: 100%;margin-top: 10px; } .el-icon-check, .el-icon-close {position: absolute;left: 100%;margin-left: 10px;top: 50%;transform: translateY(-50%); } .box-right, .box-error {position: absolute;width: 50px;height: 50px;left: 100%;margin-left: 10px;top: 0px; } .box-right {background: url(../../assets/right.png) no-repeat center;background-size: contain; } .box-error {background: url(../../assets/error.png) no-repeat center;background-size: contain; } .el-form {width: 90%; } .el-button{width: 100%; } .el-table,.div__label,.div__content,.error,.el-menu-item,.el-submenu__title,.el-message__content,div{font-size:28px; } </style>四、結(jié)語
本次分享結(jié)束,歡迎來撩!
完整方案介紹:https://blog.csdn.net/lildkdkdkjf/article/details/117841646
系統(tǒng)演示網(wǎng)址:http://47.113.115.218:81 演示密碼:123456
微信:6550523?
總結(jié)
以上是生活随笔為你收集整理的《工厂订单出入库信息管理系统》模块5 -- 扫码装箱的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 7-2 换硬币
- 下一篇: iPhone 共享 文件服务器,iPho