|
|
|
@ -19,7 +19,9 @@ |
|
|
|
label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a type="text" size="small" @click="boxModelOpen(scope.row)">装箱</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.status==='未封箱'" @click="deleteHandle(scope.row.id)">封箱</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.status==='未封箱'" @click="fengxiang(scope.row)">封箱</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.status==='已封箱'" @click="chaixiang(scope.row)">拆箱</a> |
|
|
|
<a type="text" size="small" v-if="scope.row.status!=='已封箱'" @click="deleteBox(scope.row)">删除</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
@ -53,7 +55,7 @@ |
|
|
|
<el-input v-model="boxData.wareHouseID" disabled style="width: 130px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="扫描装箱"> |
|
|
|
<el-input v-model="boxData.wareHouseID" style="width: 200px"></el-input> |
|
|
|
<el-input v-model="scanRollNo" ref="scanRollNo" @keyup.enter.native="handleScanEnter" style="width: 200px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
@ -109,7 +111,12 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
|
|
|
|
import {newSoReceiveBoxesData, searchBoxDetail, searchSoReceiveBoxesData} from '../../../api/boxManage/boxManage' |
|
|
|
import { |
|
|
|
deleteSoReceiveBoxesData, |
|
|
|
newSoReceiveBoxesData, scanBoxRoll, |
|
|
|
searchBoxDetail, |
|
|
|
searchSoReceiveBoxesData, updateBoxStatus |
|
|
|
} from '../../../api/boxManage/boxManage' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
@ -267,6 +274,7 @@ export default { |
|
|
|
wareHouseID:'', |
|
|
|
rollsQty: 0, |
|
|
|
}, |
|
|
|
scanRollNo:'', |
|
|
|
boxModelFlag: false, |
|
|
|
|
|
|
|
} |
|
|
|
@ -318,6 +326,9 @@ export default { |
|
|
|
console.log(data2) |
|
|
|
this.searchBox(data2) |
|
|
|
this.boxModelFlag = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanRollNo.focus(); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
@ -333,7 +344,11 @@ export default { |
|
|
|
buNo: row.buNo, |
|
|
|
} |
|
|
|
this.searchBox(inData) |
|
|
|
this.scanRollNo='' |
|
|
|
this.boxModelFlag = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanRollNo.focus(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
searchBox(inData){ |
|
|
|
searchBoxDetail(inData).then(({data}) => { |
|
|
|
@ -342,8 +357,110 @@ export default { |
|
|
|
this.boxData=data.row |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
deleteBox(row){ |
|
|
|
this.$confirm(`确定删除此箱?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteSoReceiveBoxesData(row).then(({data}) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
this.searchTable(); |
|
|
|
} else { |
|
|
|
this.$message.error( data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
fengxiang(row){ |
|
|
|
this.$confirm(`确定封箱?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
let inData={ |
|
|
|
site: row.site, |
|
|
|
boxNo: row.boxNo, |
|
|
|
buNo: row.buNo, |
|
|
|
id: row.id, |
|
|
|
flag:0, |
|
|
|
} |
|
|
|
updateBoxStatus(inData).then(({data}) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
this.searchTable(); |
|
|
|
}else { |
|
|
|
this.$message.error( data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
chaixiang(row){ |
|
|
|
this.$confirm(`确定封箱?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
let inData={ |
|
|
|
site: row.site, |
|
|
|
boxNo: row.boxNo, |
|
|
|
buNo: row.buNo, |
|
|
|
id: row.id, |
|
|
|
flag:1, |
|
|
|
} |
|
|
|
updateBoxStatus(inData).then(({data}) => { |
|
|
|
if (data && data.code == 0) { |
|
|
|
this.$message.success( '操作成功') |
|
|
|
this.searchTable(); |
|
|
|
}else { |
|
|
|
this.$message.error( data.msg) |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleScanEnter() { |
|
|
|
const arr = this.scanRollNo.split(';'); |
|
|
|
if (arr.length < 3) { |
|
|
|
this.$message.error('扫描的标签格式不正确!'); |
|
|
|
return; |
|
|
|
} |
|
|
|
const inData = { |
|
|
|
site: arr[0], |
|
|
|
buNo: arr[1], |
|
|
|
finalRollNo: arr[2], |
|
|
|
boxNo: this.boxData.boxNo, |
|
|
|
}; |
|
|
|
scanBoxRoll(inData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('扫描成功'); |
|
|
|
this.searchBox({ |
|
|
|
site: this.boxData.site, |
|
|
|
boxNo: this.boxData.boxNo, |
|
|
|
buNo: this.boxData.buNo, |
|
|
|
}); |
|
|
|
this.scanRollNo = ''; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanRollNo.focus(); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '扫描失败'); |
|
|
|
this.scanRollNo = ''; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanRollNo.focus(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('网络异常,扫描失败'); |
|
|
|
this.scanRollNo = ''; |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.scanRollNo.focus(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|