diff --git a/password.txt b/password.txt index b79b823..00707ed 100644 --- a/password.txt +++ b/password.txt @@ -1,2 +1,2 @@ 别名:testalias -密码: wms3.0 \ No newline at end of file +密码: putandin \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index 949117c..be23fe5 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { - "name" : "wms", - "appid" : "__UNI__43932FE", + "name" : "投入产出", + "appid" : "__UNI__37328FF", "description" : "", "versionName" : "1.0.0", "versionCode" : 1, diff --git a/src/mycomponents/form/customerFrom.vue b/src/mycomponents/form/customerFrom.vue index eabd529..32fb2a8 100644 --- a/src/mycomponents/form/customerFrom.vue +++ b/src/mycomponents/form/customerFrom.vue @@ -36,147 +36,150 @@ - - - + + + - - - - * - {{ index + 1 }}. + + + + * + {{ index + 1 }}. + + + + 点检部位 : {{ item.Position }} - - - 点检部位 : {{ item.Position }} - - - 点检内容 : {{ item.Content }} - - - 点检方法 : {{item.Methond}} - + + 点检内容 : {{ item.Content }} + + + 点检方法 : {{item.Methond}} + - - - - 点检状态 - (单选) - - - - - - {{radio.name}} - - - - + + + + 点检状态 + (单选) - + + + + + {{radio.name}} + + + + - + + - - - - * - {{ index + 1 }}. + + + + + * + {{ index + 1 }}. + + + + 点检部位 : {{ item.Position }} - - - 点检部位 : {{ item.Position }} - - - 点检内容 : {{ item.Content }} - - - 点检方法 : {{item.Methond}} - + + 点检内容 : {{ item.Content }} + + 点检方法 : {{item.Methond}} + + + + + + + 点检状态 + (单选) + + + + + + {{radio.name}} + + + + - + + - - 点检状态 - (单选) - - - - - - {{radio.name}} - - - - + {{item.putMachine[0].Name}}({{item.putMachine[0].Limit}}~{{item.putMachine[0].Floor}}) + - - - - {{item.putMachine[0].Name}} - - - - {{item.putMachine[1].Name}} - - + + {{item.putMachine[1].Name}}({{item.putMachine[1].Limit}}~{{item.putMachine[1].Floor}}) + - + + - - - - * - {{ index + 1 }}. - - - - {{ item.Content }} - + + + + + + * + {{ index + 1 }}. + + + + {{ item.Content }} + - - - (单选) - - - - - {{radio.name}} - - + + + (单选) + + + + + {{radio.name}} + - - - + + - + + - + + @@ -240,6 +243,7 @@ current: 0, isRefresh: true, isRefreshType3: true, + isRefreshType2: true, }; @@ -273,6 +277,13 @@ } this.reload3() }, + + inputType2(item){ + // if(item.length==0){ + + // } + this.reload2() + }, submit(callBack) { @@ -303,176 +314,64 @@ } } else if (item.Type == 3) { if (item.SelectName == "") { - if(item.putMachine[0].SelectName==""){ + if (item.putMachine[0].SelectName == "") { var hint = hintIndex + ".点检内容 : " + item.Content; throw new Error(hint) - }else { - if (!this.isWithinInterval(item.putMachine[0].SelectName, item.putMachine[0].Limit, item + } else { + if (!this.isWithinInterval(item.putMachine[0].SelectName, item.putMachine[0].Limit, + item .putMachine[0] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.putMachine[0].SelectName + "】不在【" + item.putMachine[0].Limit + "】和【" + item.putMachine[0].Floor + "】之间" throw new Error(hint) } } - - if(item.putMachine[1].SelectName==""){ + + if (item.putMachine[1].SelectName == "") { var hint = hintIndex + ".点检内容 : " + item.Content; throw new Error(hint) - }else { - if (!this.isWithinInterval(item.putMachine[1].SelectName, item.putMachine[1].Limit, item + } else { + if (!this.isWithinInterval(item.putMachine[1].SelectName, item.putMachine[1].Limit, + item .putMachine[1] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.putMachine[1].SelectName + "】不在【" + item.putMachine[1].Limit + "】和【" + item.putMachine[1].Floor + "】之间" throw new Error(hint) } } - - - }else {if (!this.isExitList(item.SelectName)) { - if (!this.isWithinInterval(item.putMachine[0].SelectName, item.putMachine[0].Limit, item - .putMachine[0] - .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + - "】不在【" + item.putMachine[0].Limit + "】和【" + item.putMachine[0].Floor + "】之间" - throw new Error(hint) - } - if (!this.isWithinInterval(item.putMachine[1].SelectName, item.putMachine[1].Limit, item - .putMachine[1] - .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + - "】不在【" + item.putMachine[1].Limit + "】和【" + item.putMachine[1].Floor + "】之间" - throw new Error(hint) - } - }} - - } - } - - this.formData.forEach(res => { - if (res.SelectName.includes("班")) { - var value = this.dataClassList.filter(item => item.name == res.SelectName) - if (value.length > 0) { - res.SelectValue = value[0].value } else { - res.SelectValue = "" - } - } else { - var value = this.dataList.filter(item => item.name == res.SelectName) - if (value.length > 0) { - res.SelectValue = value[0].value - } else { - res.SelectValue = res.SelectName - } - } - }) - - callBack(this.formData) - } catch (error) { - this.showHint("", error.message) - } - - }, - - - - submitss(callBack) { - var isCheckPass = true - for (var i = 0; i < this.formData.length; i++) { - var item = this.formData[i]; - var hintIndex = i + 1 - - if (item.Type == 1) { - if (item.SelectName == "") { - this.showHint(hintIndex + ".点检内容 : " + item.Content, item.placeholder) - isCheckPass = false; - break - } - } else if (item.Type == 2) { - - } else - - if (item.Type == 3) { - if (item.SelectName == "") { - this.showHint(hintIndex + ".点检内容 : " + item.Content, item.inputLow.placeholder) - isCheckPass = false; - break - } else { - if (!this.isWithinInterval(item.inputLow.name, item.inputLow.lower, item.inputLow - .upper)) { - this.showHint(hintIndex + ".点检内容 : " + item.Content, "最低压 : 输入数量【" + item.inputLow - .name + - "】不在【" + item.inputLow.lower + "】和【" + item.inputLow.upper + "】之间") - isCheckPass = false; - break - } - } - - if (item.inputHigh.name == "") { - this.showHint(hintIndex + ".点检内容 : " + item.Content, item.inputHigh.placeholder) - isCheckPass = false; - break - } else { - if (!this.isWithinInterval(item.inputHigh.name, item.inputHigh.lower, item.inputHigh - .upper)) { - this.showHint(hintIndex + ".点检内容 : " + item.Content, "最高压 : 输入数量【" + item.inputHigh - .name + - "】不在【" + item.inputHigh.lower + "】和【" + item.inputHigh.upper + "】之间") - isCheckPass = false; - break - } - } - - } else if (item.Type == 2) { - if (item.SelectName == "") { - this.showHint(hintIndex + ".点检内容 : " + item.Content, item.placeholder) - isCheckPass = false; - break - } else { - if (!this.isExitList(item.SelectName)) { - if (item.putMachine.length > 0) { - for (var i = 0; i < item.putMachine.length; i++) { - var temp = item.putMachine[i] - if (item.SelectName == "") { - this.showHint(hintIndex + ".点检内容 : " + item.Content, temp.Name) - isCheckPass = false; - break - } - - if (!this.isWithinInterval(item.SelectName, temp.Limit, temp.Floor)) { - this.showHint(hintIndex + ".点检内容 : " + item.Content, "输入数量【" + item - .SelectName + - "】不在【" + temp.Limit + "】和【" + temp.Floor + "】之间") - isCheckPass = false; - break - } - + if (!this.isExitList(item.SelectName)) { + if (!this.isWithinInterval(item.putMachine[0].SelectName, item.putMachine[0].Limit, + item + .putMachine[0] + .Floor)) { + var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + "】不在【" + item.putMachine[0].Limit + "】和【" + item.putMachine[0].Floor + "】之间" + throw new Error(hint) } - } else { - if (!this.isWithinInterval(item.SelectName, item.Limit, item.Floor)) { - this.showHint(hintIndex + ".点检内容 : " + item.Content, "输入数量【" + item - .SelectName + - "】不在【" + item.Limit + "】和【" + item.Floor + "】之间") - isCheckPass = false; - break + if (!this.isWithinInterval(item.putMachine[1].SelectName, item.putMachine[1].Limit, + item + .putMachine[1] + .Floor)) { + var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + "】不在【" + item.putMachine[1].Limit + "】和【" + item.putMachine[1].Floor + "】之间" + throw new Error(hint) } } } - - } - } else if (item.type == "groupSelect") { - if (item.SelectName == "") { - this.showHint(hintIndex + ".点检内容 : " + item.Content, item.placeholder) - isCheckPass = false; - break + }else if(item.Type == 4){ + if (item.SelectName == "") { + var hint = hintIndex + ".点检内容 : " + item.Content; + throw new Error(hint) + } } } - } - if (isCheckPass) { + this.formData.forEach(res => { if (res.SelectName.includes("班")) { var value = this.dataClassList.filter(item => item.name == res.SelectName) @@ -486,22 +385,25 @@ if (value.length > 0) { res.SelectValue = value[0].value } else { - res.SelectValue = "" + res.SelectValue = res.SelectName } } }) - callBack(this.formData) - // this.$emit("submit",this.formData) - console.log("通过", this.formData) - } else { - console.log("失败") + callBack(this.formData) + } catch (error) { + this.showHint("", error.message) } + }, + + + + isWithinInterval(num, lower, upper) { - var num =Number(num); - var lower =Number(lower); - var upper =Number(upper); + var num = Number(num); + var lower = Number(lower); + var upper = Number(upper); if (!this.isNumber(num)) { return true; } @@ -528,23 +430,20 @@ reset() { for (var i = 0; i < this.formData.length; i++) { var item = this.formData[i]; - if (item.type == "inputRange") { - item.inputLow.name = ""; - item.inputHigh.name = "" - } else if (item.type == "inputAndSelect") { - if (item.putMachine) { - item.putMachine.name = "" - item.putMachine.value = "" - } - if (item.minor) { - item.minor.name = "" - item.minor.value = "" - } + if(item.Type == "1"){ + item.SelectName = "" + item.SelectValue= "" + }else if(item.Type == "2"){ item.SelectName = "" - item.value = "" - } else { + item.SelectValue= "" + }else if(item.Type == "3"){ + item.putMachine.forEach(res=>{ + res.SelectName="" + res.SelectValue="" + }) + }else if(item.Type == "4"){ item.SelectName = "" - item.value = "" + item.SelectValue= "" } } // var testList =deepCopyData(this.dataList) @@ -563,12 +462,19 @@ this.isRefresh = true this.isRefreshType3 = true }) + this.$forceUpdate() }, reload3() { this.isRefreshType3 = false this.$nextTick(() => { this.isRefreshType3 = true }) + }, + reload2() { + this.isRefreshType2 = false + this.$nextTick(() => { + this.isRefreshType2 = true + }) } diff --git a/src/pages.json b/src/pages.json index b741089..1271ca8 100644 --- a/src/pages.json +++ b/src/pages.json @@ -3,7 +3,7 @@ "pages": [{ "path": "pages/index/index", "style": { - "navigationBarTitleText": "WMS仓库管理系统-移动端", + "navigationBarTitleText": "投入产出管理系统-移动端", "titleNView": { // "autoBackButton": "true", "buttons": [{}] diff --git a/src/pages/foam/check.vue b/src/pages/foam/check.vue index 93981ec..de18a08 100644 --- a/src/pages/foam/check.vue +++ b/src/pages/foam/check.vue @@ -4,10 +4,10 @@ style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;"> - + 设备编号 : {{deviceCode}} - + 设备名称 : {{deviceName}} @@ -77,7 +77,7 @@ dateTime: "", deviceCode: "", deviceName: "", - worker: "admin", + worker: this.$store.state.user.id, dataList: [], formData: [{ type: "stateSelect", @@ -219,20 +219,24 @@ this.reset(); this.closeScanPopup(); var groupSelect = { - Type: "5", + Type: "4", Content: "选择班组", - placeholder: "请选择班组", - name: '', - value: "", + SelectName: "", + SelectValue: "", } // this.dataList = this.formData this.dataList = res.Result; this.dataList.push(groupSelect) this.dataList.forEach(res=>{ res.SelectName="" - res.putMachine.forEach(item=>{ - item.SelectName="" - }) + res.SelectValue="" + if(res.putMachine){ + res.putMachine.forEach(item=>{ + item.SelectName="" + item.SelectValue="" + }) + } + }) this.deviceName=this.dataList[0].Name; this.dateTime = getCurrDateTime() @@ -256,9 +260,9 @@ return } this.$refs.customerFrom.submit(data => { - data.worker ="admin"; var commitData={ - worker:"admin", + LoginUserID:this.$store.state.user.id, + UserName:this.$store.state.user.name, createTime:getCurrDateTime(), dataList:data } @@ -293,6 +297,9 @@ closeScanPopup() { this.$refs.scanPopup.closeScanPopup(); }, + showMessage(hint){ + this.$refs.comMessage.showMessage("提示", hint) + }, } } diff --git a/src/pages/foam/input.vue b/src/pages/foam/input.vue index 7878db0..c0bf4e2 100644 --- a/src/pages/foam/input.vue +++ b/src/pages/foam/input.vue @@ -26,11 +26,11 @@ - + - - + + @@ -40,11 +40,11 @@ - + - - + + @@ -206,22 +206,22 @@ uni.hideLoading() this.showMessage(error) }) - this.$refs.selectPopup.open({ - mode: 'radio', //radio checkbox 单选、多选 - dataList: getDataList(), //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig - // selected: this.userForm.values, //已选中的数据 - // proxyConfig: { //组件内部代理请求数据配置 - // reqFun: this.reqGetList, //请求方法 - // localPaging: false //前端本地分页 - // }, - search: { - type: 'local', //local本地数据搜索 | remote请求接口 - }, - fields: { - label: 'name', - value: 'code' - } - }) + // this.$refs.selectPopup.open({ + // mode: 'radio', //radio checkbox 单选、多选 + // dataList: getDataList(), //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig + // // selected: this.userForm.values, //已选中的数据 + // // proxyConfig: { //组件内部代理请求数据配置 + // // reqFun: this.reqGetList, //请求方法 + // // localPaging: false //前端本地分页 + // // }, + // search: { + // type: 'local', //local本地数据搜索 | remote请求接口 + // }, + // fields: { + // label: 'name', + // value: 'code' + // } + // }) }, diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index cca63cc..514a9b0 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -91,7 +91,8 @@ position: [-10, -10], menusCount: {}, filterList: [], - serchval: "" + serchval: "", + backButtonPress: 0 } }, onLoad() { @@ -108,8 +109,7 @@ }, - onHide() { - }, + onHide() {}, onShow() { if (uni.getStorageSync("hasLogin") == null || uni.getStorageSync("hasLogin") == false) { uni.showModal({ @@ -131,11 +131,22 @@ } } }) - } + } }, - onUnload() { + onUnload() {}, + onBackPress(e) { + // 此处一定要return为true,否则页面不会返回到指定路径 + this.backButtonPress++; + if (this.backButtonPress > 1) { + plus.runtime.quit(); + } else { + plus.nativeUI.toast('再滑一次退出应用11'); + } + setTimeout(function() { + this.backButtonPress = 0; + }, 1000); + return true; }, - mounted() {}, methods: { findList(tab) { @@ -258,7 +269,7 @@ openCheck(url) { uni.navigateTo({ - url: url + url: url }); this.filterList = [] }, diff --git a/src/pages/setter/index.vue b/src/pages/setter/index.vue index 832807d..35cbbd6 100644 --- a/src/pages/setter/index.vue +++ b/src/pages/setter/index.vue @@ -57,7 +57,7 @@ const app = createApp({}); // app.component({ // }); - const userName = ref(store.state.user.name); + const userName = ref(store.state.user.id); let test = ref("123"); let version = ref(); let userInfo = ref(null); @@ -79,30 +79,18 @@ function handlerlogout() { - store.dispatch('LogOut', {}).then(() => { - clearStorage(); - // #ifdef H5 - uni.reLaunch({ - url: '../login/index' - }) - // #endif - - // #ifdef APP - plus.runtime.quit() - // #endif - - }).catch(error=>{ - clearStorage(); - // #ifdef H5 - uni.reLaunch({ - url: '../login/index' - }) - // #endif - - // #ifdef APP - plus.runtime.quit() - // #endif + clearStorage(); + // #ifdef H5 + uni.reLaunch({ + url: '../login/index' }) + // #endif + + // #ifdef APP + plus.runtime.quit() + // #endif + + }; function clearStorage() { diff --git a/src/store/modules/user.js b/src/store/modules/user.js index c62b59f..0f4fc23 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -52,8 +52,8 @@ const user = { return new Promise((resolve, reject) => { login(username, password).then(res => { if(res){ - - // 设置 token + commit('SET_ID',res.Result.LoginUserID) + commit('SET_NAME',res.Result.UserName) resolve(res) }else { uni.showToast({ diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue index 2a2422c..b5d8bf2 100644 --- a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue @@ -4,8 +4,9 @@ @click="$emit('checkList',item)"> - {{index+1}}. - {{item[fields.label]}} + {{index+1}}. + + {{item[fields.label]}} @@ -76,10 +77,9 @@ .list-item { display: flex; align-items: center; - color: $uni-text-color-grey; + color: gray; padding: $uni-spacing-col-base; margin-bottom: $uni-spacing-col-sm; - background-color: #fff; .list-item-text { @include wz-line(2); diff --git a/test.keystore b/test.keystore index 982d16e..769beff 100644 Binary files a/test.keystore and b/test.keystore differ