Explorar el Código

二级库-仓库管理

mainqaq hace 3 años
padre
commit
1976394765

+ 15 - 11
src/xt_pages/stock/warehouseManage/components/AddWareHouse.vue Ver fichero

@@ -1,6 +1,6 @@
1 1
 <template>
2 2
   <el-dialog
3
-    title="新增仓库信息"
3
+    :title="title"
4 4
     :visible.sync="dialogVisible"
5 5
     width="30%"
6 6
     :before-close="closePop"
@@ -29,13 +29,13 @@
29 29
             <el-radio :label="0" >禁用</el-radio>
30 30
           </el-radio-group>
31 31
         </el-form-item>
32
-        <el-form-item label="仓库管理员" prop="storehouse_admin_name" >
33
-          <el-select v-model="ruleForm.region" @change="changeadmin">
32
+        <el-form-item label="仓库管理员" prop="admin_id" >
33
+          <el-select v-model="ruleForm.admin_id" @select="handleSelect" @change="changeadmin">
34 34
             <el-option
35 35
               v-for="item in adminnamelist"
36
-              :key="item.id"
36
+              :key="item.user_id"
37 37
               :label="item.user_name"
38
-              :value="item.id"
38
+              :value="item.user_id"
39 39
             ></el-option>
40 40
           </el-select>
41 41
         </el-form-item>
@@ -54,6 +54,7 @@ import login from '../../../../mock/login'
54 54
 export default {
55 55
   data() {
56 56
     return {
57
+      title: "",
57 58
       show_type: 1,
58 59
       storehouse_id: "",
59 60
       storehouse_code:"coco",
@@ -99,14 +100,18 @@ export default {
99 100
     aa(){
100 101
       console.log('op')
101 102
     },
102
-    changeadmin() {
103
-      console.log("rrrrrrrrrrrrrrrrrrr")
103
+    changeadmin(item) {
104
+      console.log("aaaaabbaaaaa",this.ruleForm.admin_id)
105
+    },
106
+    handleSelect() {
107
+
104 108
     },
105 109
     usernamelist(){
106 110
       //获取管理员列表
107 111
       getusername().then((res) => {
108 112
         if (res.data.state == 1){
109 113
           this.adminnamelist = res.data.data.list;
114
+          // console.log("adminnamelist",this.adminnamelist)
110 115
         }
111 116
       })
112 117
       .catch((err) => {
@@ -130,7 +135,7 @@ export default {
130 135
         this.ruleForm.status = data.storehouse_status;
131 136
         this.ruleForm.storehouse_name = data.storehouse_name;
132 137
         this.ruleForm.admin_name = data.storehouse_admin_name;
133
-        console.log("this.ruleForm.admin_name",this.ruleForm.admin_name);
138
+        this.ruleForm.admin_id = data.storehouse_admin_id;
134 139
         this.dialogVisible = true;
135 140
         this.usernamelist()
136 141
       }
@@ -148,8 +153,9 @@ export default {
148 153
     closePop() {
149 154
       console.log("this.ruleForm",this.ruleForm)
150 155
       this.dialogVisible = false;
156
+      this.ruleForm.admin_name = "";
157
+      this.ruleForm.admin_id = "";
151 158
       this.ruleForm.storehouse_name = "";
152
-      this.ruleForm.region = "";
153 159
       this.ruleForm.date1 = "";
154 160
       this.ruleForm.date2 = "";
155 161
       this.ruleForm.type = [];
@@ -171,7 +177,6 @@ export default {
171 177
               storehouse_address: this.ruleForm.address || "",
172 178
               storehouse_status:parseInt(this.ruleForm.status),
173 179
               storehouse_admin_id: this.ruleForm.admin_id || "",
174
-              storehouse_admin_name: this.ruleForm.admin_name || "",
175 180
             };
176 181
             addstorehouse(params).then((res) => {
177 182
               if (res.data.state == 1) {
@@ -200,7 +205,6 @@ export default {
200 205
               storehouse_status:parseInt(this.ruleForm.status),
201 206
               id: this.storehouse_id,
202 207
               storehouse_admin_id: this.ruleForm.admin_id || "",
203
-              storehouse_admin_name: this.ruleForm.admin_name || "",
204 208
             };
205 209
             updatestorehouse(params).then((res) => {
206 210
               if (res.data.state == 1) {

+ 5 - 1
src/xt_pages/stock/warehouseManage/query.vue Ver fichero

@@ -235,7 +235,11 @@ export default {
235 235
     },
236 236
     // 编辑仓库
237 237
     toEdit(data,val) {
238
-      this.$refs.AddWareHouse.show(data,val);
238
+      this.$nextTick(() => {
239
+        console.log("aaaaaaaaa",data)
240
+        console.log("bbbbbbbbbb",val)
241
+        this.$refs.AddWareHouse.show(data, val);
242
+      })
239 243
     },
240 244
     // 禁用仓库
241 245
     toDisable(val, index) {