瀏覽代碼

二级库-仓库管理

mainqaq 3 年之前
父節點
當前提交
1976394765

+ 15 - 11
src/xt_pages/stock/warehouseManage/components/AddWareHouse.vue 查看文件

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

+ 5 - 1
src/xt_pages/stock/warehouseManage/query.vue 查看文件

235
     },
235
     },
236
     // 编辑仓库
236
     // 编辑仓库
237
     toEdit(data,val) {
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
     toDisable(val, index) {
245
     toDisable(val, index) {