ソースを参照

冷冻要求权限修改

AaronBruin 6 ヶ月 前
コミット
024a48b74e
2 ファイル変更42 行追加35 行削除
  1. 2 2
      manifest.json
  2. 40 33
      pages/order/delivery.vue

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "冷链送药",
     "appid" : "__UNI__49186F9",
     "description" : "",
-    "versionName" : "1.1.9",
-    "versionCode" : 119,
+    "versionName" : "1.1.10",
+    "versionCode" : 120,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 40 - 33
pages/order/delivery.vue

@@ -77,7 +77,7 @@
 			</view>
 		</view>
 		<u-modal :show="logoutShow" showCancelButton :title="title" :content='content' @cancel="cancel"
-			@confirm="confirm"></u-modal>
+			@confirm="confirm(200)"></u-modal>
 	</view>
 </template>
 
@@ -198,7 +198,7 @@
 								this.content = res.msg
 								this.logoutShow = true
 							} else if (res.code == 1201) {
-								this.confirm()
+								this.confirm(1201)
 							} else {
 								uni.$u.toast(res.msg)
 							}
@@ -209,44 +209,51 @@
 				}
 			},
 			// 确定
-			confirm() {
-				this.logoutShow = false
+			confirm(event) {
 				if (this.userInfo.dept) {
 					if (!this.userInfo.dept.isOutStorage) {
-						this.loading = true
-						// 出库
-						this.$api.post('/api/ice-raft/out-storage', {
-							code: this.list,
-							coolerBoxId: this.incubator.id,
-							suitableForCold: Number(this.suitableForCold),
-						}).then(res => {
-							if (res.code == 200) {
-								this.list = []
-								this.suitableForCold = null
-								this.frequencyCoding = ''
-								this.incubator.id = null
-								this.incubator.name = ''
-								uni.showToast({
-									icon: 'none',
-									title: res.msg,
-									duration: 3000
-								});
-							} else {
-								uni.showToast({
-									icon: 'none',
-									title: res.msg,
-									duration: 3000
-								});
-							}
-							this.loading = false
-						})
+						this.getOutStorage()
 					} else {
-						uni.$u.toast('冰排暂未到达冷冻要求')
+						if (event == 200) {
+							this.$message.error('冰排暂未到达冷冻要求');
+						} else if (event == 1201) {
+							this.getOutStorage()
+						}
 					}
 				} else {
-					uni.$u.toast('当前账户无公司信息')
+					this.$message.error('当前账户无公司信息');
 				}
 			},
+			getOutStorage() {
+				this.logoutShow = false
+				this.loading = true
+				// 出库
+				this.$api.post('/api/ice-raft/out-storage', {
+					code: this.list,
+					coolerBoxId: this.incubator.id,
+					suitableForCold: Number(this.suitableForCold),
+				}).then(res => {
+					if (res.code == 200) {
+						this.list = []
+						this.suitableForCold = null
+						this.frequencyCoding = ''
+						this.incubator.id = null
+						this.incubator.name = ''
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 3000
+						});
+					} else {
+						uni.showToast({
+							icon: 'none',
+							title: res.msg,
+							duration: 3000
+						});
+					}
+					this.loading = false
+				})
+			},
 			// 取消
 			cancel() {
 				this.logoutShow = false