Browse Source

fix:快件入库

sunChengjie 11 months ago
parent
commit
9a64707932

+ 10 - 0
src/api/index.js

@@ -146,6 +146,16 @@ export function LJYforgetPassword(data) {
     })
 }
 
+//修改密码
+export function getSysUserInfoByUserIdAPI(data) {
+    return request({
+        url: '/tianzong/personal/getSysUserInfoByUserId.do',
+        method: 'post',
+        data: data,
+        emulateJSON: true
+    })
+}
+
 
 
 

+ 9 - 2
src/pages/components/HomePage.vue

@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import { appFindYourShipment, appStatistics } from '../../api/index'
+import { appFindYourShipment, appStatistics, getSysUserInfoByUserIdAPI } from '../../api/index'
 import {
 	Toast,
 	Dialog
@@ -85,7 +85,7 @@ export default {
 	created: function () {
 		this.isLogin();
 		this.getData()
-
+		this.getUser()
 	},
 	async mounted() {
 		// 数据图表
@@ -376,6 +376,13 @@ export default {
 
 		},
 
+		async getUser() {
+			const res = await getSysUserInfoByUserIdAPI({ userId: localStorage.getItem("userId") })
+			this.$store.state.user = res.sysUserInfo
+			console.log(this.$store.state.user, 'this.$state.state.user')
+		}
+
+
 	},
 
 }

+ 4 - 2
src/pages/my.vue

@@ -40,7 +40,7 @@ export default {
 		return {
 			titlename: "我的",
 			userId: "",
-			user: [],
+			user: {},
 			headimgurl: '',
 			active: 1,
 		};
@@ -49,7 +49,9 @@ export default {
 		this.isLogin();
 		this.userId = localStorage.getItem("userId");
 		console.log('userId:' + this.userId);
-		this.getUser();
+		// this.getUser();
+		this.user = this.$store.state.user
+
 		this.headimgurl = localStorage.getItem('headimgurl');
 	},
 	methods: {

+ 29 - 8
src/pages/new/storage.vue

@@ -21,7 +21,8 @@
                 <van-field :value="onGroupObject.phone" @focus="onFocus" name="phone" label="收件人手机号"
                     placeholder="请输入手机号" :rules="[{ required: true }]" />
 
-                <van-field :value="onGroupObject.NAME" readonly name="NAME" label="收件人姓名" placeholder="占位" />
+                <van-field :value="onGroupObject.NAME" @focus="onFocus" name="NAME" label="收件人姓名"
+                    placeholder="请输入收件人姓名" />
 
                 <van-field :value="onGroupObject.departmentName" name="departmentId" label="收件人部门" placeholder="占位"
                     readonly />
@@ -51,7 +52,8 @@
                 <div style="display: flex; justify-content: flex-start;">
                     <van-field name="isPayOnDelivery" label="到付件">
                         <template #input>
-                            <van-checkbox v-model="checkbox" @change="onCheckboxChange" shape="square" /><span>到付</span>
+                            <van-checkbox :disabled="ischeckDisabled" v-model="checkbox" @change="onCheckboxChange"
+                                shape="square" /><span>到付</span>
                         </template>
                     </van-field>
                     <van-field :rules="[{ required: checkbox }]" :disabled="isdisabled" v-model="object.payMoney"
@@ -102,15 +104,17 @@
 </template>
 
 <script>
-import { appGetEmployeeInfoByPhone, appGeLogisticsList, appSaveExpressRecord } from '@/api/index'
+import { appGetEmployeeInfoByPhone, appGeLogisticsList, appSaveExpressRecord, getSysUserInfoByUserIdAPI } from '@/api/index'
 import { Toast } from 'vant';
 export default {
     data() {
         return {
+            isCompany: '否',
+            ischeckDisabled: false,
             titlename: "快件入库",
             inputValue: '',//输入手机号后四位聚焦
             phoneShow: false, //输入手机号后弹出搜索
-            searchKey: '9270',//搜索关键
+            searchKey: '',//搜索关键
             searchKeyList: [], // 搜索后存储的数据
             onGroupObject: {},//点击后映射的参数
             GeLogisticsList: [],//存放快递公司
@@ -119,14 +123,12 @@ export default {
                 radio: '文件',
                 payMoney: '',//应付金额
                 expressNo: '',//快递单号
-                value4: '', //货架信息
+                value4: '货架A', //货架信息
                 value: '', //快递公司
             },
             checkbox: false,
             isdisabled: true,//是否选中多选
-
             showPicker: false, //快递公司
-
             shelfs: ['货架A', '货架B', '货架C'], //收发室
             shelf: false, //收发室
             // pattern: /^[\d]*$/,
@@ -135,6 +137,9 @@ export default {
 
         };
     },
+    mounted() {
+        this.getUser()
+    },
     methods: {
         // 快递单号
         wxScanCodeB() {
@@ -162,11 +167,21 @@ export default {
             this.GeLogisticsList = res.data.map((item) => {
                 return item.expressCompany
             })
+            this.GeLogisticsList.unshift(this.$store.state.user.company)
+
             this.showPicker = true
         },
         // 选择快递公司
         onConfirm(value) {
             this.object.value = value;
+            if (this.$store.state.user.company == value) {
+                this.isCompany = '是'
+                this.ischeckDisabled = true
+            } else {
+                this.isCompany = '否'
+                this.ischeckDisabled = false
+            }
+
             this.showPicker = false;
         },
         // 货架信息
@@ -184,7 +199,7 @@ export default {
 
             // const phone = values.phone.split(",")[0]
             const params = {
-                isCompany: '否',
+                isCompany: this.isCompany,
                 mailRoomId: this.onGroupObject.ROOM_ID,//收发室Id
                 // payMoney,
                 userId: this.onGroupObject.USER_ID,//收件人userID
@@ -242,6 +257,12 @@ export default {
             this.isdisabled = !this.isdisabled
         },
 
+        async getUser() {
+            const res = await getSysUserInfoByUserIdAPI({ userId: localStorage.getItem("userId") })
+            this.$store.state.user = res.sysUserInfo
+            console.log(this.$store.state.user, 'this.$state.state.user')
+        }
+
 
 
     },

+ 2 - 1
src/pages/personinfomation.vue

@@ -33,7 +33,8 @@ export default {
 	},
 	created: function () {
 		this.userId = localStorage.getItem("userId");
-		this.getUser();
+		// this.getUser();
+		this.user = this.$store.state.user
 	},
 	methods: {
 	}

+ 1 - 0
src/store/store.js

@@ -12,6 +12,7 @@ const store = new Vuex.Store({
 		regEmail: "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$",
 		regPhone: "^(1[3-9])\\d{9}$",
 		shipment: {},//扫描单号后的结果
+		user: {},//用户信息
 
 	},
 	mutations: {