| | |
| | | <template #toolbar> |
| | | <el-button v-if="permissions.warehouse_pallettransports_add" type="primary" |
| | | @click="addOrUpdateHandle()">新增</el-button> |
| | | <el-dropdown style="margin-left: 20px;" @command="handleCommand"> |
| | | <el-button > |
| | | 状态变更<i class="el-icon-arrow-down el-icon--right"></i> |
| | | </el-button> |
| | | <el-dropdown-menu slot="dropdown"> |
| | | <el-dropdown-item :key="index" |
| | | :command="item.label" |
| | | v-for="(item,index) in taskTypeArr" |
| | | >{{ item.label }}</el-dropdown-item |
| | | > |
| | | </el-dropdown-menu> |
| | | </el-dropdown> |
| | | </template> |
| | | </ttable> |
| | | |
| | |
| | | <!-- <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> |
| | | |
| | |
| | | <!-- 弹窗, 明细的IFS库位列表 --> |
| | | <detailIfsLocationDialog :currshowlist.sync="showDetailLocation" :detailList="detailList" |
| | | @refreshDataList="selectDetailLocationCallback" /> |
| | | |
| | | </basic-container> |
| | | </div> |
| | | </template> |
| | |
| | | delPalletTransportsDetailObj, |
| | | executeMoveLocation, |
| | | selectAll, |
| | | updateStock, |
| | | updataStatus, |
| | | } from '@/api/warehouse/pallettransports' |
| | | import { getByPalletTransId } from '@/api/plan/operationtask' |
| | | import ttable from '@/views/common/ztt-table.vue' |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | taskTypeArr: [ |
| | | {label:"草稿"}, |
| | | {label:"进行中"}, |
| | | {label:"已完成"}, |
| | | ], |
| | | command:"", |
| | | forbidden:false, |
| | | partDesc: null, |
| | | ajaxFun: palletTransportsFetchList, |
| | | currPalletTransportsRow: null, |
| | |
| | | // this.palletTransportsDetailData = [] |
| | | // } |
| | | // } |
| | | // palletTransportsChange(val){ |
| | | // console.log("====="); |
| | | // if(val){ |
| | | // console.log(val); |
| | | // console.log(this.command,"11111") |
| | | // }else{ |
| | | // console.log("--"); |
| | | // } |
| | | // } |
| | | command: { |
| | | handler(newVal) { |
| | | if (newVal != '') { |
| | | // 当 aa 为空字符串时触发的操作 |
| | | console.log('aa is now empty'); |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | created() { |
| | | if(this.permissions.warehouse_pallettransports_edit){ |
| | |
| | | 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, |
| | |
| | | } |
| | | }) |
| | | |
| | | }) |
| | | |
| | | } |
| | | })} |
| | | // this.palletTransportsMaterialMultipleSelection = val |
| | | // if(val && val.length>0){ |
| | | // let ids =[] |
| | |
| | | // } |
| | | // } |
| | | }, |
| | | //状态 |
| | | handleCommand(event){ |
| | | let str = "" |
| | | console.log(event); |
| | | if (event == "草稿") { |
| | | str = "draft" |
| | | }else if (event == "进行中") { |
| | | str = "processing" |
| | | }else{ |
| | | str = "finished" |
| | | } |
| | | |
| | | if (this.cid) { |
| | | updataStatus({id:this.cid,state:str}).then((res) =>{ |
| | | this.$refs.pallettransportsTable.getDataList() |
| | | }) |
| | | }else{ |
| | | this.$message.error('请选择' + str + '的对象') |
| | | } |
| | | }, |
| | | // 单行选中 |
| | | 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() { |