Эх сурвалжийг харах

修复用户组件设置值后不回显

landydb 6 өдөр өмнө
parent
commit
4d28ab96c8

+ 9 - 2
src/views/modules/common/user-component-all.vue

@@ -50,8 +50,15 @@
       }
     },
     watch: {
-      userId (value) {
-        this.value = value
+      // userId (value) {
+      //   this.value = value
+      // }
+      userId:{
+        immediate:true,
+        handler(newUserId){
+          this.value = newUserId
+          this.checkItem(newUserId)
+        }
       }
     },
     mounted () {

+ 12 - 4
src/views/modules/common/user-component.vue

@@ -25,10 +25,18 @@ export default {
     event: 'userSelected'
   },
   watch: {
-    userId (value) {
-      this.value = value
-      // 检查缺失item
-      this.checkItem(value)
+    // userId (value) {
+    //   console.log('userId变化:' + value)
+    //   this.value = value
+    //   // 检查缺失item
+    //   this.checkItem(value)
+    // }
+    userId:{
+      immediate:true,
+      handler(newUserId){
+        this.value = newUserId
+        this.checkItem(newUserId)
+      }
     }
   },
   data () {

+ 10 - 3
src/views/modules/common/user-components.vue

@@ -51,9 +51,16 @@ export default {
     }
   },
   watch: {
-    userIds (value) {
-      this.value = value
-      this.getList()
+    // userIds (value) {
+    //   this.value = value
+    //   this.getList()
+    // }
+    userIds:{
+      immediate:true,
+      handler(newUserIds){
+        this.value = newUserIds
+        this.getList()
+      }
     }
   },
   mounted () {

+ 3 - 0
src/views/modules/warehouse/stock-order.vue

@@ -157,6 +157,7 @@
     components: {StockOrderInbound, UserComponent, StockOrderOutbound, Detail},
     created () {
       this.optionsState = this.$store.state.common.approveStates
+      console.log(this.dataForm)
       this.queryData()
     },
     data () {
@@ -199,6 +200,8 @@
         this.detailVisible = false
       },
       queryData () {
+        this.dataForm.userId = this.$store.state.user.id
+
         this.pageIndex = 1
         this.getDataList()
       },