|
@@ -24,16 +24,20 @@
|
24
|
24
|
<el-input type="textarea" v-model="ruleForm.address"></el-input>
|
25
|
25
|
</el-form-item>
|
26
|
26
|
<el-form-item label="状态" prop="status">
|
27
|
|
- <el-radio-group v-model="ruleForm.status">
|
|
27
|
+ <el-radio-group v-model="ruleForm.status" >
|
28
|
28
|
<el-radio :label="1" >启用</el-radio>
|
29
|
29
|
<el-radio :label="0" >禁用</el-radio>
|
30
|
30
|
</el-radio-group>
|
31
|
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
|
41
|
</el-form-item>
|
38
|
42
|
</el-form>
|
39
|
43
|
</div>
|
|
@@ -45,7 +49,7 @@
|
45
|
49
|
</template>
|
46
|
50
|
|
47
|
51
|
<script>
|
48
|
|
-import { getcode,addstorehouse,updatestorehouse } from "@/api/warehouse";
|
|
52
|
+import { getcode,addstorehouse,updatestorehouse,getusername } from "@/api/warehouse";
|
49
|
53
|
import login from '../../../../mock/login'
|
50
|
54
|
export default {
|
51
|
55
|
data() {
|
|
@@ -55,10 +59,11 @@ export default {
|
55
|
59
|
storehouse_code:"coco",
|
56
|
60
|
dialogVisible: false,
|
57
|
61
|
labelPosition:'left',
|
|
62
|
+ adminnamelist: [],
|
58
|
63
|
ruleForm: {
|
59
|
|
- admin_name:"",
|
|
64
|
+ admin_name:"",//管理员名字
|
|
65
|
+ admin_id:"",//管理员id
|
60
|
66
|
storehouse_name: "",
|
61
|
|
- region: "",
|
62
|
67
|
date1: "",
|
63
|
68
|
date2: "",
|
64
|
69
|
delivery: false,
|
|
@@ -90,12 +95,27 @@ export default {
|
90
|
95
|
};
|
91
|
96
|
},
|
92
|
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
|
112
|
show(data, type) {
|
94
|
113
|
if (type == 1) {
|
95
|
114
|
this.initstorehouseData();
|
96
|
115
|
this.show_type = 1;
|
97
|
116
|
this.title = "新增仓库";
|
98
|
117
|
this.dialogVisible = true;
|
|
118
|
+ this.usernamelist()
|
99
|
119
|
} else if (type == 2) {
|
100
|
120
|
console.log("data:::::::::::",data);
|
101
|
121
|
this.show_type = 2;
|
|
@@ -108,6 +128,7 @@ export default {
|
108
|
128
|
this.ruleForm.admin_name = data.storehouse_admin_name;
|
109
|
129
|
console.log("this.ruleForm.admin_name",this.ruleForm.admin_name);
|
110
|
130
|
this.dialogVisible = true;
|
|
131
|
+ this.usernamelist()
|
111
|
132
|
}
|
112
|
133
|
},
|
113
|
134
|
// 获取仓库编码接口
|
|
@@ -132,6 +153,7 @@ export default {
|
132
|
153
|
this.ruleForm.address = "";
|
133
|
154
|
},
|
134
|
155
|
|
|
156
|
+ //修改仓库状态
|
135
|
157
|
|
136
|
158
|
// 验证表单内容
|
137
|
159
|
submitForm(ruleForm) {
|
|
@@ -143,12 +165,10 @@ export default {
|
143
|
165
|
storehouse_code: this.storehouse_code || "",
|
144
|
166
|
storehouse_name: this.ruleForm.storehouse_name || "",
|
145
|
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
|
172
|
addstorehouse(params).then((res) => {
|
153
|
173
|
if (res.data.state == 1) {
|
154
|
174
|
this.$message.success("新增成功");
|
|
@@ -174,9 +194,9 @@ export default {
|
174
|
194
|
storehouse_name: this.ruleForm.storehouse_name || "",
|
175
|
195
|
storehouse_address: this.ruleForm.address || "",
|
176
|
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
|
201
|
updatestorehouse(params).then((res) => {
|
182
|
202
|
if (res.data.state == 1) {
|