Browse Source

二级库-仓库管理

mainqaq 3 years ago
parent
commit
872e04f3ab

+ 8 - 0
src/api/warehouse.js View File

131
     params: params
131
     params: params
132
   })
132
   })
133
 }
133
 }
134
+//获取管理员列表()
135
+export function getusername(params) {
136
+  return request({
137
+    url: '/api/secondary/getusername',
138
+    method: 'get',
139
+    params: params
140
+  })
141
+}

+ 37 - 17
src/xt_pages/stock/warehouseManage/components/AddWareHouse.vue View File

24
           <el-input type="textarea" v-model="ruleForm.address"></el-input>
24
           <el-input type="textarea" v-model="ruleForm.address"></el-input>
25
         </el-form-item>
25
         </el-form-item>
26
         <el-form-item label="状态" prop="status">
26
         <el-form-item label="状态" prop="status">
27
-          <el-radio-group v-model="ruleForm.status">
27
+          <el-radio-group v-model="ruleForm.status" >
28
             <el-radio :label="1" >启用</el-radio>
28
             <el-radio :label="1" >启用</el-radio>
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="region">-->
33
-          admin
34
-<!--          <el-select v-model="ruleForm.region" placeholder="请选择管理员">-->
35
-<!--            <el-option label="admin" value="0"></el-option>-->
36
-<!--          </el-select>-->
32
+        <el-form-item label="仓库管理员" prop="storehouse_admin_name" >
33
+          <el-select v-model="ruleForm.region" @change="changeadmin">
34
+            <el-option
35
+              v-for="item in adminnamelist"
36
+              :key="item.id"
37
+              :label="item.user_name"
38
+              :value="item.id"
39
+            ></el-option>
40
+          </el-select>
37
         </el-form-item>
41
         </el-form-item>
38
       </el-form>
42
       </el-form>
39
     </div>
43
     </div>
45
 </template>
49
 </template>
46
 
50
 
47
 <script>
51
 <script>
48
-import { getcode,addstorehouse,updatestorehouse } from "@/api/warehouse";
52
+import { getcode,addstorehouse,updatestorehouse,getusername } from "@/api/warehouse";
49
 import login from '../../../../mock/login'
53
 import login from '../../../../mock/login'
50
 export default {
54
 export default {
51
   data() {
55
   data() {
55
       storehouse_code:"coco",
59
       storehouse_code:"coco",
56
       dialogVisible: false,
60
       dialogVisible: false,
57
       labelPosition:'left',
61
       labelPosition:'left',
62
+      adminnamelist: [],
58
       ruleForm: {
63
       ruleForm: {
59
-        admin_name:"",
64
+        admin_name:"",//管理员名字
65
+        admin_id:"",//管理员id
60
         storehouse_name: "",
66
         storehouse_name: "",
61
-        region: "",
62
         date1: "",
67
         date1: "",
63
         date2: "",
68
         date2: "",
64
         delivery: false,
69
         delivery: false,
90
     };
95
     };
91
   },
96
   },
92
   methods: {
97
   methods: {
98
+    changeadmin() {
99
+      console.log("rrrrrrrrrrrrrrrrrrr")
100
+    },
101
+    usernamelist(){
102
+      //获取管理员列表
103
+      getusername().then((res) => {
104
+        if (res.data.state == 1){
105
+          this.adminnamelist = res.data.data.list;
106
+        }
107
+      })
108
+      .catch((err) => {
109
+        console.log(err)
110
+      })
111
+    },
93
     show(data, type) {
112
     show(data, type) {
94
       if (type == 1) {
113
       if (type == 1) {
95
         this.initstorehouseData();
114
         this.initstorehouseData();
96
         this.show_type = 1;
115
         this.show_type = 1;
97
         this.title = "新增仓库";
116
         this.title = "新增仓库";
98
         this.dialogVisible = true;
117
         this.dialogVisible = true;
118
+        this.usernamelist()
99
       } else if (type == 2) {
119
       } else if (type == 2) {
100
         console.log("data:::::::::::",data);
120
         console.log("data:::::::::::",data);
101
         this.show_type = 2;
121
         this.show_type = 2;
108
         this.ruleForm.admin_name = data.storehouse_admin_name;
128
         this.ruleForm.admin_name = data.storehouse_admin_name;
109
         console.log("this.ruleForm.admin_name",this.ruleForm.admin_name);
129
         console.log("this.ruleForm.admin_name",this.ruleForm.admin_name);
110
         this.dialogVisible = true;
130
         this.dialogVisible = true;
131
+        this.usernamelist()
111
       }
132
       }
112
     },
133
     },
113
     // 获取仓库编码接口
134
     // 获取仓库编码接口
132
       this.ruleForm.address = "";
153
       this.ruleForm.address = "";
133
     },
154
     },
134
 
155
 
156
+    //修改仓库状态
135
 
157
 
136
     //  验证表单内容
158
     //  验证表单内容
137
     submitForm(ruleForm) {
159
     submitForm(ruleForm) {
143
               storehouse_code: this.storehouse_code || "",
165
               storehouse_code: this.storehouse_code || "",
144
               storehouse_name: this.ruleForm.storehouse_name || "",
166
               storehouse_name: this.ruleForm.storehouse_name || "",
145
               storehouse_address: this.ruleForm.address || "",
167
               storehouse_address: this.ruleForm.address || "",
146
-              storehouse_status:parseInt(this.ruleForm.status)
147
-              // storehouse_admin_id: this.ruleForm.storehouse_admin_id || "",
148
-              // storehouse_admin_name: this.ruleForm.storehouse_admin_name || "",
168
+              storehouse_status:parseInt(this.ruleForm.status),
169
+              storehouse_admin_id: this.ruleForm.admin_id || "",
170
+              storehouse_admin_name: this.ruleForm.admin_name || "",
149
             };
171
             };
150
-            console.log("params::::",params)
151
-            console.log("status::::",this.ruleForm.status)
152
             addstorehouse(params).then((res) => {
172
             addstorehouse(params).then((res) => {
153
               if (res.data.state == 1) {
173
               if (res.data.state == 1) {
154
                 this.$message.success("新增成功");
174
                 this.$message.success("新增成功");
174
               storehouse_name: this.ruleForm.storehouse_name || "",
194
               storehouse_name: this.ruleForm.storehouse_name || "",
175
               storehouse_address: this.ruleForm.address || "",
195
               storehouse_address: this.ruleForm.address || "",
176
               storehouse_status:parseInt(this.ruleForm.status),
196
               storehouse_status:parseInt(this.ruleForm.status),
177
-              id: this.storehouse_id
178
-              // storehouse_admin_id: this.ruleForm.storehouse_admin_id || "",
179
-              // storehouse_admin_name: this.ruleForm.storehouse_admin_name || "",
197
+              id: this.storehouse_id,
198
+              storehouse_admin_id: this.ruleForm.admin_id || "",
199
+              storehouse_admin_name: this.ruleForm.admin_name || "",
180
             };
200
             };
181
             updatestorehouse(params).then((res) => {
201
             updatestorehouse(params).then((res) => {
182
               if (res.data.state == 1) {
202
               if (res.data.state == 1) {

+ 0 - 3
src/xt_pages/stock/warehouseManage/query.vue View File

136
   name: "stockIn",
136
   name: "stockIn",
137
   created() {
137
   created() {
138
     var types = getDictionaryDataConfig("system", "drug_type");
138
     var types = getDictionaryDataConfig("system", "drug_type");
139
-    console.log("44444", types);
140
     var arr = [];
139
     var arr = [];
141
     var obj = { id: 0, name: "全部" };
140
     var obj = { id: 0, name: "全部" };
142
     arr.push(obj);
141
     arr.push(obj);
143
     arr.push(...types);
142
     arr.push(...types);
144
     this.drugType = arr;
143
     this.drugType = arr;
145
-    console.log("arrr", arr);
146
     this.getlist();
144
     this.getlist();
147
   },
145
   },
148
   components: {
146
   components: {
235
     },
233
     },
236
     // 编辑仓库
234
     // 编辑仓库
237
     toEdit(data,val) {
235
     toEdit(data,val) {
238
-      console.log("data is :",data)
239
       this.$refs.AddWareHouse.show(data,val);
236
       this.$refs.AddWareHouse.show(data,val);
240
     },
237
     },
241
     // 禁用仓库
238
     // 禁用仓库