作者 小范

仓库场站管理功能完善

@@ -21,6 +21,9 @@ export const delStation = params => { return axios.get(`${baseUrl}/delStation`, @@ -21,6 +21,9 @@ export const delStation = params => { return axios.get(`${baseUrl}/delStation`,
21 export const addStation = params => { return http.post(`${baseUrl}/addStation`,params)}; 21 export const addStation = params => { return http.post(`${baseUrl}/addStation`,params)};
22 22
23 export const ediStation = params => { return http.post(`${baseUrl}/ediStation`,params)}; 23 export const ediStation = params => { return http.post(`${baseUrl}/ediStation`,params)};
  24 +
  25 +export const selectByStationno = params => { return axios.get(`${baseUrl}/selectByStationno`, { params: params }); };
  26 +
24 //仓库管理 27 //仓库管理
25 export const selectHouses = params => { return axios.get(`${baseUrl1}/selectHouses`, { params: params }); }; 28 export const selectHouses = params => { return axios.get(`${baseUrl1}/selectHouses`, { params: params }); };
26 29
@@ -29,6 +32,9 @@ export const delHouse = params => { return axios.get(`${baseUrl1}/delHouse`, { p @@ -29,6 +32,9 @@ export const delHouse = params => { return axios.get(`${baseUrl1}/delHouse`, { p
29 export const addHouse = params => { return http.post(`${baseUrl1}/addHouse`,params)}; 32 export const addHouse = params => { return http.post(`${baseUrl1}/addHouse`,params)};
30 33
31 export const ediHouse = params => { return http.post(`${baseUrl1}/ediHouse`,params)}; 34 export const ediHouse = params => { return http.post(`${baseUrl1}/ediHouse`,params)};
  35 +
  36 +export const selectByHouseid = params => { return axios.get(`${baseUrl1}/selectByHouseid`, { params: params }); };
  37 +
32 //库存变更记录 38 //库存变更记录
33 export const selectInventroyrecords = params => { return axios.get(`${baseUrl2}/selectInventroyrecords`, { params: params }); }; 39 export const selectInventroyrecords = params => { return axios.get(`${baseUrl2}/selectInventroyrecords`, { params: params }); };
34 40
@@ -61,3 +67,5 @@ export const delArea = params => { return axios.get(`${baseUrl5}/delArea`, { par @@ -61,3 +67,5 @@ export const delArea = params => { return axios.get(`${baseUrl5}/delArea`, { par
61 export const addArea = params => { return http.post(`${baseUrl5}/addArea`,params)}; 67 export const addArea = params => { return http.post(`${baseUrl5}/addArea`,params)};
62 68
63 export const ediArea = params => { return http.post(`${baseUrl5}/ediArea`,params)}; 69 export const ediArea = params => { return http.post(`${baseUrl5}/ediArea`,params)};
  70 +
  71 +export const selectByAreaid = params => { return axios.get(`${baseUrl5}/selectByAreaid`, { params: params }); };
@@ -80,32 +80,32 @@ @@ -80,32 +80,32 @@
80 <el-table-column 80 <el-table-column
81 prop="xstart" 81 prop="xstart"
82 label="库区X起始位" 82 label="库区X起始位"
83 - width="80"> 83 + width="90">
84 </el-table-column> 84 </el-table-column>
85 <el-table-column 85 <el-table-column
86 prop="xend" 86 prop="xend"
87 label="库区X结束位" 87 label="库区X结束位"
88 - width="80"> 88 + width="90">
89 </el-table-column> 89 </el-table-column>
90 <el-table-column 90 <el-table-column
91 prop="ystart" 91 prop="ystart"
92 label="库区Y起始位" 92 label="库区Y起始位"
93 - width="80"> 93 + width="90">
94 </el-table-column> 94 </el-table-column>
95 <el-table-column 95 <el-table-column
96 prop="yend" 96 prop="yend"
97 label="库区Y结束位" 97 label="库区Y结束位"
98 - width="80"> 98 + width="90">
99 </el-table-column> 99 </el-table-column>
100 <el-table-column 100 <el-table-column
101 prop="zstart" 101 prop="zstart"
102 label="库区Z起始位" 102 label="库区Z起始位"
103 - width="80"> 103 + width="90">
104 </el-table-column> 104 </el-table-column>
105 <el-table-column 105 <el-table-column
106 prop="zend" 106 prop="zend"
107 label="库区Z结束位" 107 label="库区Z结束位"
108 - width="80"> 108 + width="90">
109 </el-table-column> 109 </el-table-column>
110 <el-table-column 110 <el-table-column
111 fixed="right" 111 fixed="right"
@@ -135,6 +135,27 @@ @@ -135,6 +135,27 @@
135 <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 40px"> 135 <el-form :model="addForm" :rules="rules" ref="addForm" style="margin-top: 40px">
136 <el-row> 136 <el-row>
137 <el-col :span="7"> 137 <el-col :span="7">
  138 + <el-form-item label="" :label-width="formLabelWidth" prop="houseid">
  139 + <!-- <el-input v-model="addForm.houseid" autocomplete="off" size="small" style="width: 300px">-->
  140 + <!-- <template slot="prepend">所属仓库</template>-->
  141 + <!-- </el-input>-->
  142 + <el-select v-model="addForm.houseid"
  143 + filterable
  144 + allow-create
  145 + default-first-option
  146 + remote size="small"
  147 + :remote-method="getHouseid"
  148 + :loading="loading" placeholder="请输入所属仓库" style="width: 300px">
  149 + <el-option
  150 + v-for="item in houseids"
  151 + :key="item.houseid"
  152 + :label="item.houseid"
  153 + :value="item.houseid">
  154 + </el-option>
  155 + </el-select>
  156 + </el-form-item>
  157 + </el-col>
  158 + <el-col :span="8">
138 <el-form-item label="" :label-width="formLabelWidth" prop="areano"> 159 <el-form-item label="" :label-width="formLabelWidth" prop="areano">
139 <el-input v-model="addForm.areano" autocomplete="off" size="small" style="width: 300px"> 160 <el-input v-model="addForm.areano" autocomplete="off" size="small" style="width: 300px">
140 <template slot="prepend">库区编号</template> 161 <template slot="prepend">库区编号</template>
@@ -148,13 +169,7 @@ @@ -148,13 +169,7 @@
148 </el-input> 169 </el-input>
149 </el-form-item> 170 </el-form-item>
150 </el-col> 171 </el-col>
151 - <el-col :span="8">  
152 - <el-form-item label="" :label-width="formLabelWidth" prop="houseid">  
153 - <el-input v-model="addForm.houseid" autocomplete="off" size="small" style="width: 300px">  
154 - <template slot="prepend">所属仓库</template>  
155 - </el-input>  
156 - </el-form-item>  
157 - </el-col> 172 +
158 </el-row> 173 </el-row>
159 <el-row> 174 <el-row>
160 <el-col :span="7"> 175 <el-col :span="7">
@@ -269,10 +284,16 @@ @@ -269,10 +284,16 @@
269 </template> 284 </template>
270 285
271 <script> 286 <script>
272 - import {selectAreas,delArea,addArea,ediArea} from '../../api/consigner/station'; 287 + import {
  288 + selectAreas,
  289 + delArea,
  290 + addArea,
  291 + ediArea,
  292 + selectByHouseid
  293 + } from '../../api/consigner/station';
273 294
274 export default { 295 export default {
275 - name: "area", 296 + // name: "area",
276 data() { 297 data() {
277 return { 298 return {
278 queryInfo: { 299 queryInfo: {
@@ -318,6 +339,9 @@ @@ -318,6 +339,9 @@
318 remark3:'', 339 remark3:'',
319 remark4:'', 340 remark4:'',
320 }, 341 },
  342 + houseids:[],
  343 + houseid: '',
  344 + loading:false,
321 formLabelWidth: '120px', 345 formLabelWidth: '120px',
322 rules: { 346 rules: {
323 userName: [ 347 userName: [
@@ -341,6 +365,22 @@ @@ -341,6 +365,22 @@
341 } 365 }
342 }, 366 },
343 methods: { 367 methods: {
  368 + //获取所属仓库
  369 + getHouseid:function(query){
  370 + this.houseids=[];
  371 + this.loading = true;
  372 + selectByHouseid({houseid:query}).then(res =>{
  373 + if (res !== '') {
  374 + setTimeout(() => {
  375 + this.loading = false;
  376 + this.houseids=res.data.data;
  377 + }, 200);
  378 + } else {
  379 + this.houseids = [];
  380 + }
  381 +
  382 + });
  383 + },
344 handleSizeChange(val) { 384 handleSizeChange(val) {
345 this.queryInfo.pageSize = val 385 this.queryInfo.pageSize = val
346 this.getList() 386 this.getList()
@@ -170,9 +170,23 @@ @@ -170,9 +170,23 @@
170 </el-col> 170 </el-col>
171 <el-col :span="12"> 171 <el-col :span="12">
172 <el-form-item label="" :label-width="formLabelWidth" prop="stationid"> 172 <el-form-item label="" :label-width="formLabelWidth" prop="stationid">
173 - <el-input v-model="addForm.stationid" autocomplete="off" size="small" style="width: 260px">  
174 - <template slot="prepend">场站&emsp;id</template>  
175 - </el-input> 173 +<!-- <el-input v-model="addForm.stationid" autocomplete="off" size="small" style="width: 260px">-->
  174 +<!-- <template slot="prepend">场站&emsp;id</template>-->
  175 +<!-- </el-input>-->
  176 + <el-select v-model="addForm.stationid"
  177 + filterable
  178 + allow-create
  179 + default-first-option
  180 + remote autocomplete="off" size="small"
  181 + :remote-method="getStationno"
  182 + :loading="loading" placeholder="请输入场站id" style="width: 260px">
  183 + <el-option
  184 + v-for="item in stationids"
  185 + :key="item.stationno"
  186 + :label="item.stationno"
  187 + :value="item.stationno">
  188 + </el-option>
  189 + </el-select>
176 </el-form-item> 190 </el-form-item>
177 </el-col> 191 </el-col>
178 </el-row> 192 </el-row>
@@ -246,7 +260,7 @@ @@ -246,7 +260,7 @@
246 </template> 260 </template>
247 261
248 <script> 262 <script>
249 - import {selectHouses,delHouse,addHouse,ediHouse} from '../../api/consigner/station'; 263 + import {selectHouses,delHouse,addHouse,ediHouse,selectByStationno} from '../../api/consigner/station';
250 264
251 export default { 265 export default {
252 name: "house", 266 name: "house",
@@ -290,6 +304,9 @@ @@ -290,6 +304,9 @@
290 remark2:'', 304 remark2:'',
291 remark3:'' 305 remark3:''
292 }, 306 },
  307 + stationids:[],
  308 + stationno: '',
  309 + loading:false,
293 formLabelWidth: '220px', 310 formLabelWidth: '220px',
294 rules: { 311 rules: {
295 userName: [ 312 userName: [
@@ -313,6 +330,23 @@ @@ -313,6 +330,23 @@
313 } 330 }
314 }, 331 },
315 methods: { 332 methods: {
  333 + //获取场站ID
  334 + getStationno:function(query){
  335 + this.stationids=[];
  336 + let params={stationno:query};
  337 + this.loading = true;
  338 + selectByStationno(params).then(res =>{
  339 + if (res !== '') {
  340 + setTimeout(() => {
  341 + this.loading = false;
  342 + this.stationids=res.data.data;
  343 + }, 200);
  344 + } else {
  345 + this.stationids = [];
  346 + }
  347 +
  348 + });
  349 + },
316 handleSizeChange(val) { 350 handleSizeChange(val) {
317 this.queryInfo.pageSize = val 351 this.queryInfo.pageSize = val
318 this.getList() 352 this.getList()
@@ -122,9 +122,23 @@ @@ -122,9 +122,23 @@
122 <el-row> 122 <el-row>
123 <el-col :span="9"> 123 <el-col :span="9">
124 <el-form-item label="" :label-width="formLabelWidth" prop="areaid"> 124 <el-form-item label="" :label-width="formLabelWidth" prop="areaid">
125 - <el-input v-model="addForm.areaid" autocomplete="off" size="small" style="width: 260px">  
126 - <template slot="prepend">所属库区</template>  
127 - </el-input> 125 +<!-- <el-input v-model="addForm.areaid" autocomplete="off" size="small" style="width: 260px">-->
  126 +<!-- <template slot="prepend">所属库区</template>-->
  127 +<!-- </el-input>-->
  128 + <el-select v-model="addForm.areaid"
  129 + filterable
  130 + allow-create
  131 + default-first-option
  132 + remote size="small"
  133 + :remote-method="getArea"
  134 + :loading="loading" placeholder="请输入所属库区" style="width: 260px">
  135 + <el-option
  136 + v-for="item in areaids"
  137 + :key="item.areano"
  138 + :label="item.areano"
  139 + :value="item.areano">
  140 + </el-option>
  141 + </el-select>
128 </el-form-item> 142 </el-form-item>
129 </el-col> 143 </el-col>
130 <el-col :span="12"> 144 <el-col :span="12">
@@ -195,7 +209,13 @@ @@ -195,7 +209,13 @@
195 </template> 209 </template>
196 210
197 <script> 211 <script>
198 - import {selectLocations,delLocation,addLocation,ediLocation} from '../../api/consigner/station'; 212 + import {
  213 + selectLocations,
  214 + delLocation,
  215 + addLocation,
  216 + ediLocation,
  217 + selectByAreaid
  218 + } from '../../api/consigner/station';
199 219
200 export default { 220 export default {
201 name: "locations", 221 name: "locations",
@@ -239,6 +259,9 @@ @@ -239,6 +259,9 @@
239 remark3:'', 259 remark3:'',
240 remark4:'', 260 remark4:'',
241 }, 261 },
  262 + areaids:[],
  263 + areano: '',
  264 + loading:false,
242 formLabelWidth: '220px', 265 formLabelWidth: '220px',
243 rules: { 266 rules: {
244 userName: [ 267 userName: [
@@ -262,6 +285,22 @@ @@ -262,6 +285,22 @@
262 } 285 }
263 }, 286 },
264 methods: { 287 methods: {
  288 + //获取所属库区
  289 + getArea:function(query){
  290 + this.areaids=[];
  291 + this.loading = true;
  292 + selectByAreaid({areano:query}).then(res =>{
  293 + if (res !== '') {
  294 + setTimeout(() => {
  295 + this.loading = false;
  296 + this.areaids=res.data.data;
  297 + }, 200);
  298 + } else {
  299 + this.areaids = [];
  300 + }
  301 +
  302 + });
  303 + },
265 handleSizeChange(val) { 304 handleSizeChange(val) {
266 this.queryInfo.pageSize = val 305 this.queryInfo.pageSize = val
267 this.getList() 306 this.getList()