| | |
| | | <!-- <el-button type="warning" v-if="permissions.warehouse_pallettransports_detail_library" round |
| | | @click="openDetailLocationDialog">一键至库位</el-button> --> |
| | | <el-button type="success" v-if="permissions.warehouse_pallettransports_detail_execute" round |
| | | @click="executeMove">执 行</el-button> |
| | | @click="updateStockFun">执 行</el-button> |
| | | </div> |
| | | </div> |
| | | <div> |
| | |
| | | |
| | | <el-table-column prop="transfer_quantity" label="移库数量" align="center"> |
| | | <template slot-scope="scope"> |
| | | <el-input v-model="scope.row.transfer_quantity" border="none"></el-input> |
| | | <el-input v-model="scope.row.transfer_quantity" @change="moveLocation(scope.row)" :disabled = "scope.row.state == '02submitted' " border="none"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | |
| | | delPalletTransportsDetailObj, |
| | | executeMoveLocation, |
| | | selectAll, |
| | | updateStock, |
| | | } from '@/api/warehouse/pallettransports' |
| | | import { getByPalletTransId } from '@/api/plan/operationtask' |
| | | import ttable from '@/views/common/ztt-table.vue' |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | forbidden:false, |
| | | partDesc: null, |
| | | ajaxFun: palletTransportsFetchList, |
| | | currPalletTransportsRow: null, |
| | |
| | | palletTransportsMaterialSelectionChange() { |
| | | if(this.cid){ |
| | | selectAll({transportsId:this.cid}).then((res)=>{ |
| | | console.log(res.data.data); |
| | | this.palletTransportsDetailData = res.data.data.map(el =>{ |
| | | return{ |
| | | part_no:el.partNo, |
| | |
| | | }, |
| | | // 单行选中 |
| | | handleCurrentChange(row) { |
| | | console.log(row,"--->1"); |
| | | this.palletTransportsMaterialMultipleSelection = row |
| | | // this.palletTransportsMaterialData.forEach((item) => { |
| | | // // 排他,每次选择时把其他选项都清除 |
| | |
| | | // 获取移库明细数据列表 |
| | | getPalletTransportsDetailData() { |
| | | let transportsDetails =[] |
| | | console.log(this.palletTransportsMaterialMultipleSelection,"----+"); |
| | | transportsDetails = this.palletTransportsMaterialMultipleSelection.map(el =>{ |
| | | return{ |
| | | partNo:el.partNo, |
| | | partDesc: el.partDesc, |
| | | transferQuantity: el.surplusQuantity, |
| | | transferQuantity: 0, |
| | | toIfsLocationNo:el.toIfsLocationNo, |
| | | toIfsLocationName: el.toIfsLocationName, |
| | | transportsId: el.transportsId, |
| | |
| | | ele.surplusQuantity = 0 |
| | | } |
| | | }) |
| | | this.getPalletTransportsMaterialData() |
| | | } else { |
| | | this.$message.error('添加移库明细失败') |
| | | } |
| | |
| | | } |
| | | }) |
| | | }, |
| | | //改变 |
| | | moveLocation(val){ |
| | | let num = Number(val.transfer_quantity) |
| | | this.palletTransportsDetailMultipleSelection.forEach(el =>{ |
| | | el.transfer_quantity = num |
| | | }) |
| | | }, |
| | | updateStockFun(){ |
| | | let data = [] |
| | | data = this.palletTransportsDetailMultipleSelection.map(el =>{ |
| | | return { |
| | | id:el.id, |
| | | transferQuantity:el.transfer_quantity |
| | | } |
| | | }) |
| | | updateStock(data).then((res) =>{ |
| | | if(res.data.code===0){ |
| | | this.getPalletTransportsMaterialData() |
| | | this.executeMove() |
| | | } |
| | | }) |
| | | }, |
| | | // 执行移库 |
| | | executeMove() { |
| | | if ( |
| | |
| | | flag = false |
| | | } |
| | | }) |
| | | console.log("-----------",flag,ids); |
| | | if (flag) { |
| | | executeMoveLocation(ids).then((response) => { |
| | | const resData = response.data |
| | |
| | | } else { |
| | | this.$message.error('请选择移库明细') |
| | | } |
| | | |
| | | }, |
| | | selectDetailLocationCallback() { |
| | | this.getPalletTransportsDetailData() |
| | |
| | | this.showDetailStock = true |
| | | }, |
| | | palletTransportsDetailSelectionChange(val) { |
| | | console.log(val,"-=-=-="); |
| | | this.palletTransportsDetailMultipleSelection = val |
| | | }, |
| | | getOptasks() { |