作者 小范

出入库操作功能优化

@@ -19,6 +19,8 @@ export const selectNewInventroyrecords = params => { return axios.get(`${baseSer @@ -19,6 +19,8 @@ export const selectNewInventroyrecords = params => { return axios.get(`${baseSer
19 export const ExtNewinventroyrecord = params => { return axios.get(`${baseServiceURL}/newinventroyrecord/ExtNewinventroyrecord`, { params: params }); }; 19 export const ExtNewinventroyrecord = params => { return axios.get(`${baseServiceURL}/newinventroyrecord/ExtNewinventroyrecord`, { params: params }); };
20 //回库 20 //回库
21 export const ReNewinventroyrecord = params => { return axios.post(`${baseServiceURL}/newinventroyrecord/ReNewinventroyrecord`, params); }; 21 export const ReNewinventroyrecord = params => { return axios.post(`${baseServiceURL}/newinventroyrecord/ReNewinventroyrecord`, params); };
  22 +//退库
  23 +export const CancleNewinventroyrecord = params => { return axios.post(`${baseServiceURL}/newinventroyrecord/CancleNewinventroyrecord`, params); };
22 24
23 //分批出库 25 //分批出库
24 export const batchoutbound = params => { return http.post(`${baseUrl2}/batchoutbound`,params)}; 26 export const batchoutbound = params => { return http.post(`${baseUrl2}/batchoutbound`,params)};
@@ -20,8 +20,10 @@ @@ -20,8 +20,10 @@
20 <div class="my-text-area"> 20 <div class="my-text-area">
21 <div class="el-input-group__prepend prepand">出入库类型</div> 21 <div class="el-input-group__prepend prepand">出入库类型</div>
22 <el-select v-model="queryInfo.ietype" placeholder="出入库类型" size="mini" style="width: 140px"> 22 <el-select v-model="queryInfo.ietype" placeholder="出入库类型" size="mini" style="width: 140px">
  23 + <el-option label="出入库类型-全部" value=""></el-option>
23 <el-option label="出入库类型-进" value="I"></el-option> 24 <el-option label="出入库类型-进" value="I"></el-option>
24 <el-option label="出入库类型-出" value="E"></el-option> 25 <el-option label="出入库类型-出" value="E"></el-option>
  26 + <el-option label="出入库类型-退" value="C"></el-option>
25 </el-select> 27 </el-select>
26 </div> 28 </div>
27 <!-- <el-input v-model="queryInfo.ietype" prefix-icon="el-icon-search" size="small" style="width: 240px"--> 29 <!-- <el-input v-model="queryInfo.ietype" prefix-icon="el-icon-search" size="small" style="width: 240px"-->
@@ -196,6 +198,7 @@ @@ -196,6 +198,7 @@
196 <el-select v-model="addForm.ietype" placeholder="出入库类型" size="mini" style="width: 210px"> 198 <el-select v-model="addForm.ietype" placeholder="出入库类型" size="mini" style="width: 210px">
197 <el-option label="出入库类型-进" value="I"></el-option> 199 <el-option label="出入库类型-进" value="I"></el-option>
198 <el-option label="出入库类型-出" value="E"></el-option> 200 <el-option label="出入库类型-出" value="E"></el-option>
  201 + <el-option label="出入库类型-退" value="C"></el-option>
199 </el-select> 202 </el-select>
200 </div> 203 </div>
201 </el-form-item> 204 </el-form-item>
@@ -172,6 +172,7 @@ @@ -172,6 +172,7 @@
172 <template slot-scope="scope"> 172 <template slot-scope="scope">
173 <span v-if="scope.row.ietype ==='I'">进</span> 173 <span v-if="scope.row.ietype ==='I'">进</span>
174 <span v-if="scope.row.ietype ==='E'">出</span> 174 <span v-if="scope.row.ietype ==='E'">出</span>
  175 + <span v-if="scope.row.ietype ==='C'">退</span>
175 </template> 176 </template>
176 </el-table-column> 177 </el-table-column>
177 <el-table-column 178 <el-table-column
@@ -223,14 +224,14 @@ @@ -223,14 +224,14 @@
223 <el-table-column 224 <el-table-column
224 fixed="right" 225 fixed="right"
225 label="操作" 226 label="操作"
226 - width="160"> 227 + width="220">
227 <template slot-scope="scope"> 228 <template slot-scope="scope">
228 - <el-button v-if="scope.row.ietype ==='E'" disabled type="success" size="mini" @click="outBound(scope.row)">出库</el-button>  
229 - <el-button v-else type="success" size="mini" @click="outBound(scope.row)">出库</el-button>  
230 - <el-button v-if="scope.row.ietype ==='E'" type="primary" size="mini" @click="inBound(scope.row)">回库</el-button>  
231 - <el-button v-else type="primary" disabled size="mini" @click="inBound(scope.row)">回库</el-button>  
232 - <!-- <el-button type="success" size="mini" @click="applyEdit(scope.row)">编辑</el-button>-->  
233 - <!-- <el-button type="danger" size="mini" @click="applyDel(scope.$index,scope.row)">删除</el-button>--> 229 + <el-button type="success" size="mini" @click="outBound(scope.row)" :disabled="outBoundStatus(scope.row)">出库</el-button>
  230 + <!--<el-button v-else type="success" size="mini" @click="outBound(scope.row)">出库</el-button>-->
  231 + <el-button type="primary" :disabled="inBoundStatus(scope.row)" size="mini" @click="inBound(scope.row)">回库</el-button>
  232 + <!--<el-button v-else type="primary" size="mini" @click="inBound(scope.row)">回库</el-button>-->
  233 + <el-button type="warning" size="mini" @click="reBound(scope.row)" :disabled="reBoundStatus(scope.row)">退库</el-button>
  234 + <!--<el-button v-else type="warning" size="mini" @click="reBound(scope.row)">退库</el-button>-->
234 </template> 235 </template>
235 </el-table-column> 236 </el-table-column>
236 </el-table> 237 </el-table>
@@ -454,7 +455,7 @@ @@ -454,7 +455,7 @@
454 delInventoryrecord, 455 delInventoryrecord,
455 ediInventroyrecord, 456 ediInventroyrecord,
456 ExtNewinventroyrecord, 457 ExtNewinventroyrecord,
457 - selectNewInventroyrecords,ReNewinventroyrecord 458 + selectNewInventroyrecords,ReNewinventroyrecord,CancleNewinventroyrecord
458 } from "../../api/consigner/station"; 459 } from "../../api/consigner/station";
459 import packge from '@/api/nmms/packge' 460 import packge from '@/api/nmms/packge'
460 461
@@ -643,6 +644,29 @@ @@ -643,6 +644,29 @@
643 }).catch(() => { 644 }).catch(() => {
644 }) 645 })
645 }, 646 },
  647 + //退库
  648 + reBound(row) {
  649 + this.$confirm('是否确认退库?', {
  650 + confirmButtonText: '确定',
  651 + cancelButtonText: '取消',
  652 + type: 'warning'
  653 + }
  654 + ).then(() => {
  655 + // console.log(row);
  656 + CancleNewinventroyrecord(row).then((response) => {
  657 + // console.log(row)
  658 + const res = response.data
  659 + if (res.code != '200') {
  660 + return this.$message.error(res.msg)
  661 + }
  662 + this.$message.success(res.msg)
  663 + this.getList()
  664 + }).catch(error => {
  665 + this.$message.error(error)
  666 + })
  667 + }).catch(() => {
  668 + })
  669 + },
646 // 删除 670 // 删除
647 applyDel(index, row) { 671 applyDel(index, row) {
648 // 弹框询问是否删除? 672 // 弹框询问是否删除?
@@ -696,6 +720,28 @@ @@ -696,6 +720,28 @@
696 }) 720 })
697 }, 721 },
698 722
  723 + outBoundStatus:(row)=>{
  724 + if(row.ietype=='I' && row.goodsstatus=='1' ||row.ietype=='E' ||row.ietype=='C'){
  725 + return true;
  726 + }else{
  727 + return false;
  728 + }
  729 + },
  730 + inBoundStatus:(row)=>{
  731 + if(row.ietype=='I' || row.ietype=='C'){
  732 + return true;
  733 + }else{
  734 + return false;
  735 + }
  736 + },
  737 + reBoundStatus:(row)=>{
  738 + if(row.ietype=='I' && row.goodsstatus=='0'){
  739 + return false;
  740 + }else{
  741 + return true;
  742 + }
  743 + },
  744 +
699 }, 745 },
700 mounted() { 746 mounted() {
701 this.getList(); 747 this.getList();