This commit is contained in:
2024-04-24 14:56:11 +08:00
parent 07bf68feaa
commit 303445c19b
6 changed files with 31 additions and 15 deletions

View File

@@ -2,8 +2,8 @@
"name" : "干巷仓库APP",
"appid" : "__UNI__A67E78B",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"versionName" : "2.1.3",
"versionCode" : 213,
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,

View File

@@ -28,8 +28,8 @@
</view>
<!-- 底部按钮 -->
<view class="button-box">
<u-button style="width: 40%" type="error" @click="clear">清空</u-button>
<u-button style="width: 40%" type="primary" @click="handlerSubmit">拼箱</u-button>
<u-button style="width: 40%" type="error" @click="clear" :disabled="loading" :loading="loading">清空</u-button>
<u-button style="width: 40%" type="primary" @click="handlerSubmit" :disabled="loading" :loading="loading">拼箱</u-button>
</view>
<!-- 数量选择 -->
<u-modal :show="modalShow" showCancelButton title="请输入次箱拼入数量" @confirm="modalConfirm" @cancel="modalCancel">
@@ -216,6 +216,10 @@ export default {
}
},
modalConfirm() {
this.loading = true;
setTimeout(()=>{
this.loading = false;
},30000)
let data = {
packageList: this.newMaterialList,
createBy: 'admin',
@@ -230,6 +234,7 @@ export default {
confirmText: '确认'
});
this.modalShow = false;
this.loading = false;
this.clear();
} else {
uni.showToast({
@@ -237,6 +242,7 @@ export default {
title: '拼箱失败!'
});
this.modalShow = false;
this.loading = false;
}
});
},

View File

@@ -31,8 +31,8 @@
<!-- 底部按钮 -->
<view class="button-box">
<u-button style="width: 40%" type="error" @click="clear">清空</u-button>
<u-button style="width: 40%" type="primary" @click="handlerSubmit">拆箱</u-button>
<u-button style="width: 40%" type="error" @click="clear" :disabled="loading" :loading="loading">清空</u-button>
<u-button style="width: 40%" type="primary" @click="handlerSubmit" :disabled="loading" :loading="loading">拆箱</u-button>
</view>
<!-- 数量选择 -->
<u-modal :show="modalShow" showCancelButton title="请输入拆箱后数量" @confirm="modalConfirm" @cancel="modalCancel">
@@ -191,6 +191,10 @@
}
},
modalConfirm() {
this.loading = true;
setTimeout(()=>{
this.loading = false;
},30000)
let data = {
package: this.newMaterialList[0],
createBy: "admin",
@@ -205,12 +209,15 @@
confirmText: '确认'
});
this.modalShow = false;
this.loading = false;
this.clear();
} else {
uni.showToast({
icon: 'error',
title: '拆箱失败!'
});
this.modalShow = false;
this.loading = false;
}
});
},

View File

@@ -55,15 +55,14 @@
])
},
onLoad() {
console.log(this.name, this.avatar);
this.version = uni.$u.sys().appWgtVersion;
},
onShow() {
this.GetInfo();
},
data() {
return {
version:'V2.1.0',
version:'V2.1.2',
outLoginShow: false,
gridList: [{
name: 'photo',

View File

@@ -5,7 +5,8 @@
export function toast(content) {
uni.showToast({
icon: 'none',
title: content
title: content,
duration:5000
})
}

View File

@@ -53,8 +53,8 @@ const request = config => {
// console.log('token:','Bearer ' + getToAccess-Control-Allow-Originken());
// console.log('request:',storageBaseUrl + config.url,response);
if (error) {
console.log(error)
toast('后端接口连接异常')
showConfirm(error)
// toast('后端接口连接异常')
reject('后端接口连接异常')
return
}
@@ -72,10 +72,12 @@ const request = config => {
})
reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
toast(msg)
// toast(msg)
showConfirm(message)
reject('500')
} else if (code !== 200) {
toast(msg)
// toast(msg)
showConfirm(message)
reject(code)
}
resolve(res.data)
@@ -91,7 +93,8 @@ const request = config => {
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
}
toast(message)
// toast(message)
showConfirm(message)
reject(error)
})
})