| | |
| | | </div> |
| | | </div> |
| | | <div> |
| | | <el-table class="pallet-transports-material-table" :data="palletTransportsMaterialData" style="width: 100%;" |
| | | height="350px" border @selection-change="palletTransportsMaterialSelectionChange" stripe |
| | | <el-table class="pallet-transports-material-table" @current-change="handleCurrentChange" :data="palletTransportsMaterialData" style="width: 100%;" |
| | | height="350px" border stripe |
| | | ref="palletTransportsMaterialTable"> |
| | | <el-table-column type="selection" width="55"> </el-table-column> |
| | | <!--单选框 @selection-change="palletTransportsMaterialSelectionChange"--> |
| | | <el-table-column align="center" width="55" label="单选"> |
| | | <template slot-scope="scope"> |
| | | <el-checkbox v-model="scope.row.commonChecked" @change="handleCurrentChange(scope.row)" ></el-checkbox> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="partNo" label="零件号" align="center" show-overflow-tooltip> |
| | | </el-table-column> |
| | | <el-table-column prop="partDesc" label="零件描述" align="center" show-overflow-tooltip> |
| | |
| | | </el-table-column> |
| | | <el-table-column label="操作" align="center" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-button v-show="!scope.row.canEdit" type="text" :disabled="scope.row.detailExistState" |
| | | @click="scope.row.canEdit = true">编辑</el-button> |
| | | <el-button v-show="scope.row.canEdit" type="text" :disabled="scope.row.detailExistState" |
| | | @click="updateMaterial(scope.row)">保存</el-button> |
| | | <!-- <el-button v-show="!scope.row.canEdit" type="text" :disabled="scope.row.detailExistState" |
| | | @click="scope.row.canEdit = true">编辑</el-button> --> |
| | | <!-- <el-button v-show="scope.row.canEdit" type="text" :disabled="scope.row.detailExistState" |
| | | @click="updateMaterial(scope.row)">保存</el-button> --> |
| | | <el-button type="text" :disabled="scope.row.detailExistState" |
| | | @click="delMaterial(scope.row)">删除</el-button> |
| | | </template> |
| | |
| | | }, |
| | | created() { }, |
| | | methods: { |
| | | // 单行选中 |
| | | handleCurrentChange(row) { |
| | | this.palletTransportsMaterialData.forEach((item) => { |
| | | // 排他,每次选择时把其他选项都清除 |
| | | if (item.id !== row.id) { |
| | | item.commonChecked = false |
| | | }else{ |
| | | item.commonChecked = true |
| | | } |
| | | }) |
| | | this.palletTransportsMaterialSelectionChange([row]) |
| | | }, |
| | | // 工艺类型中文格式化 |
| | | formatStateType(row, column, cellValue) { |
| | | this.stateOptions.forEach((obj) => { |
| | |
| | | unit: item.unit, |
| | | transportsId: item.transportsId, |
| | | detailExistState: item.detailExistState, |
| | | canEdit: false |
| | | canEdit: false, |
| | | commonChecked: false |
| | | } |
| | | this.palletTransportsMaterialData.push(palletTransportsMaterial) |
| | | }) |
| | |
| | | openLocationDialog() { |
| | | if (this.palletTransportsMaterialMultipleSelection.length > 0) { |
| | | let flag = true |
| | | console.log(this.palletTransportsMaterialMultipleSelection) |
| | | this.palletTransportsMaterialMultipleSelection.forEach((item) => { |
| | | if (item.detailExistState) { |
| | | flag = false |
| | | } |
| | | console.log(item.detailExistState) |
| | | }) |
| | | if (flag) { |
| | | this.showLocation = true |
| | |
| | | }, |
| | | // 获取移库明细数据列表 |
| | | getPalletTransportsDetailData() { |
| | | // console.log("对应工单",this.WorkOrder); |
| | | // console.log("选中物料需求",this.palletTransportsMaterialMultipleSelection); |
| | | let transportsDetails =[] |
| | | transportsDetails = this.palletTransportsMaterialMultipleSelection.map(el =>{ |
| | | return{ |
| | |
| | | this.innerVisible = false |
| | | this.$message.success('添加移库明细成功') |
| | | let materialRow = selectionList[selectionList.length - 1] |
| | | console.log("materialRow-----",materialRow); |
| | | this.palletTransportsMaterialData.forEach(ele=>{ |
| | | if(ele.id==materialRow.id){ |
| | | console.log("ele-------",ele); |
| | | ele.transferQuantity = materialRow.surplusQuantity |
| | | ele.surplusQuantity = 0 |
| | | } |
| | |
| | | }, |
| | | // 打开单个明细批量更新库位弹框 |
| | | openSingleLocationDialog(row) { |
| | | console.log(row); |
| | | if (row.state === '01initial') { |
| | | this.detailList = [] |
| | | this.detailList.push(row) |
| | |
| | | }, |
| | | // 删除移库明细 |
| | | delDetail(row) { |
| | | /* const delRow = this.palletTransportsDetailData.find((item) => { |
| | | const delRow = this.palletTransportsDetailData.find((item) => { |
| | | return item.id === row.id |
| | | }) */ |
| | | |
| | | }) |
| | | delPalletTransportsDetailObj(row.id).then((response) => { |
| | | const resData = response.data |
| | | if (resData.code === 0) { |
| | | // const findRowIndex = this.palletTransportsDetailData.indexOf(delRow) |
| | | // this.palletTransportsDetailData.splice(findRowIndex, 1) |
| | | const findRowIndex = this.palletTransportsDetailData.indexOf(delRow) |
| | | this.palletTransportsDetailData.splice(findRowIndex, 1) |
| | | this.$message.success('移库明细删除成功') |
| | | // this.getPalletTransportsMaterialData() |
| | | const currRow = this.currPalletTransportsRow |
| | | this.getPallettransportsData().then(() => { |
| | | if (currRow) { |
| | |
| | | if (resData.code === 0) { |
| | | this.$message.success('执行成功') |
| | | // this.getPalletTransportsMaterialData() |
| | | this.palletTransportsDetailData=[] |
| | | const currRow = this.currPalletTransportsRow |
| | | this.getPallettransportsData().then(() => { |
| | | if (currRow) { |
| | |
| | | }, |
| | | palletTransportsMaterialSelectionChange(val) { |
| | | this.palletTransportsMaterialMultipleSelection = val |
| | | console.log(this.palletTransportsMaterialMultipleSelection); |
| | | if(val && val.length>0){ |
| | | let ids =[] |
| | | this.palletTransportsMaterialMultipleSelection.forEach(el =>{ids.push(el.id)}) |
| | | let pId = ids[ids.length - 1]; |
| | | console.log(pId); |
| | | if(pId!=null){ |
| | | selectAll({ |
| | | transportsId:this.currPalletTransportsRow.id, |