Pārlūkot izejas kodu

fix:快件入库的正则和结束返回

sunChengjie 11 mēneši atpakaļ
vecāks
revīzija
b235863618
3 mainītis faili ar 56 papildinājumiem un 33 dzēšanām
  1. 10 0
      src/api/index.js
  2. 9 20
      src/pages/forgetpassword.vue
  3. 37 13
      src/pages/new/storage.vue

+ 10 - 0
src/api/index.js

@@ -136,6 +136,16 @@ export function appStatistics(data) {
     })
 }
 
+//修改密码
+export function LJYforgetPassword(data) {
+    return request({
+        url: '/tianzong/appSysUser/LJYforgetPassword',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
+
 
 
 

+ 9 - 20
src/pages/forgetpassword.vue

@@ -29,6 +29,7 @@
 </template>
 
 <script>
+import { LJYforgetPassword } from '../api/index'
 import { Toast, Dialog } from 'vant'
 export default {
 
@@ -47,7 +48,7 @@ export default {
 		this.userId = localStorage.getItem('userId');
 	},
 	methods: {
-		save() {
+		async save() {
 			if (this.password == '' || this.password == undefined) {
 				Toast('请输入密码!');
 				return;
@@ -60,28 +61,16 @@ export default {
 				Toast('两次输入密码不相同!');
 				return;
 			}
-			//交互
-			this.$http.post('http://192.168.31.47:8080/tianzong' + "/appSysUser/LJYforgetPassword", {
+			const res = await LJYforgetPassword({
 				userId: this.userId,
 				password: this.password
-			}, {
-				emulateJSON: true
 			})
-				.then(res => {
-					//发送成功
-					if (res.body.msg == 'success') {
-						localStorage.removeItem("userId");
-						this.$router.push({ path: '/' });
-					} else {
-						Toast('修改失败!');
-					}
-
-					//if()
-				}, res => {
-					//发送失败
-				})
-
-
+			if (res.msg == 'success') {
+				localStorage.removeItem("userId");
+				this.$router.push({ path: '/' });
+			} else {
+				Toast('修改失败!');
+			}
 		}
 	}
 }

+ 37 - 13
src/pages/new/storage.vue

@@ -11,8 +11,8 @@
 
                 </div>
 
-                <van-field readonly clickable name="expressCompany" label="快递公司" :value="value" placeholder="请选择快递公司"
-                    @click="onShowPicker" :rules="[{ required: true }]" />
+                <van-field readonly clickable name="expressCompany" label="快递公司" :value="object.value"
+                    placeholder="请选择快递公司" @click="onShowPicker" :rules="[{ required: true }]" />
                 <van-popup v-model="showPicker" position="bottom">
                     <van-picker show-toolbar :columns="GeLogisticsList" @confirm="onConfirm"
                         @cancel="showPicker = false" />
@@ -42,8 +42,8 @@
 
                 <van-field value="1" name="expressQuantity" placeholder="请输入快递数量" label="快递数量" readonly />
 
-                <van-field readonly clickable name="shelfInformation" label="货架信息" :value="value4" placeholder="请选择货架"
-                    @click="shelf = true" :rules="[{ required: true }]" />
+                <van-field readonly clickable name="shelfInformation" label="货架信息" :value="object.value4"
+                    placeholder="请选择货架" @click="shelf = true" :rules="[{ required: true }]" />
                 <van-popup v-model="shelf" position="bottom">
                     <van-picker show-toolbar :columns="shelfs" @confirm="onShelf" @cancel="shelf = false" />
                 </van-popup>
@@ -119,15 +119,20 @@ export default {
                 radio: '文件',
                 payMoney: '',//应付金额
                 expressNo: '',//快递单号
+                value4: '', //货架信息
+                value: '', //快递公司
             },
             checkbox: false,
             isdisabled: true,//是否选中多选
-            value: '', //快递公司
+
             showPicker: false, //快递公司
-            value4: '', //快递公司
+
             shelfs: ['货架A', '货架B', '货架C'], //收发室
             shelf: false, //收发室
-            pattern: /^[\d]*$/,
+            // pattern: /^[\d]*$/,
+            // pattern: /^\d+$/,
+            pattern: /^[0-9]*$/,
+
         };
     },
     methods: {
@@ -161,22 +166,23 @@ export default {
         },
         // 选择快递公司
         onConfirm(value) {
-            this.value = value;
+            this.object.value = value;
             this.showPicker = false;
         },
         // 货架信息
         onShelf(value) {
-            this.value4 = value;
+            this.object.value4 = value;
             this.shelf = false;
         },
+
         // 提交
         async onSubmit(values) {
-            console.log(values, 'values')
-            if (this.pattern.test(this.object.remark)) {
+
+            if (!this.pattern.test(this.object.payMoney)) {
                 return this.$toast('到付金额只能输入数字')
             }
 
-            const phone = values.phone.split(",")[0]
+            // const phone = values.phone.split(",")[0]
             const params = {
                 isCompany: '否',
                 mailRoomId: this.onGroupObject.ROOM_ID,//收发室Id
@@ -191,7 +197,7 @@ export default {
                 // expressType,
                 // expressQuantity,
                 // expressCompany,
-                phone
+                // phone
                 // remark,
             }
             const originalObj = {
@@ -206,6 +212,24 @@ export default {
             console.log(res[0], 'res===')
             if (res.msg == 'success') {
                 this.$toast('打印成功')
+                this.object = {
+                    remark: '',
+                    radio: '文件',
+                    payMoney: '',
+                    expressNo: '',
+                    value4: '',
+                    value: '',
+                }
+                this.onGroupObject = {
+                    phone: '',
+                    NAME: '',
+                    departmentName: "",
+                    mailRoomName: "",
+                    mailFloor: '',
+                    seat_no: '',
+                },
+                    this.checkbox = false
+
             } else if (res.msg == 'already') {
                 this.$toast('该账号已添加过')
             }