手持机平库入 新增,修改,删除库存记录
This commit is contained in:
@@ -28,6 +28,15 @@
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="容量" prop="workshopId">
|
||||
<el-input
|
||||
v-model="formData.workshopId"
|
||||
placeholder="请输入容量"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单" prop="stockinDetailId">
|
||||
<el-input
|
||||
v-model="formData.stockinDetailId"
|
||||
@@ -89,6 +98,7 @@ export default {
|
||||
warehouseId: undefined,
|
||||
trayCode: undefined,
|
||||
stockinDetailId: undefined,
|
||||
workshopId: undefined
|
||||
},
|
||||
detailLoading: false,
|
||||
detailOpen: false,
|
||||
|
||||
@@ -16,18 +16,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="托盘码" prop="trayCode">
|
||||
<el-input
|
||||
v-model="formData.trayCode"
|
||||
:maxlength="8"
|
||||
show-word-limit
|
||||
placeholder="请输入条码"
|
||||
clearable
|
||||
:style="{width: '15%'}"
|
||||
@change="handleTrayChange"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库子单" prop="stockinDetailId">
|
||||
<el-input
|
||||
v-model="formData.stockinDetailId"
|
||||
@@ -39,19 +27,9 @@
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-card style="margin-top: 16px;">
|
||||
<div slot="header">托盘已绑定物料</div>
|
||||
<el-table v-if="trayMaterials && trayMaterials.length" :data="trayMaterials" size="small">
|
||||
<el-table-column label="子单编码" align="left" prop="stockinDetailId"/>
|
||||
<el-table-column label="物料名称" align="left" prop="productName"/>
|
||||
<el-table-column label="数量" align="right" prop="quantity"/>
|
||||
</el-table>
|
||||
<el-empty v-else description="暂无数据"></el-empty>
|
||||
</el-card>
|
||||
<el-form-item size="large">
|
||||
<el-button type="primary" @click="submitForm">确认入库</el-button>
|
||||
<el-button @click="resetForm">重置</el-button>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
</el-form>
|
||||
|
||||
|
||||
@@ -77,7 +55,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { getStockInDetail} from '@/api/in/stockInDetail'
|
||||
import { bindTray ,getTrayInfo ,addInJobpk} from '@/api/rf/rf'
|
||||
import {rkSurepk, getTrayInfo, addInJobpk} from '@/api/rf/rf'
|
||||
import {listWarehouse} from "@/api/bas/warehouse";
|
||||
|
||||
export default {
|
||||
@@ -89,11 +67,11 @@ export default {
|
||||
warehouseId: undefined,
|
||||
trayCode: undefined,
|
||||
stockinDetailId: undefined,
|
||||
inQuantity: null
|
||||
},
|
||||
detailLoading: false,
|
||||
detailOpen: false,
|
||||
detailRow: null,
|
||||
inQuantity: null,
|
||||
trayMaterials: [],
|
||||
warehouseOptions:[],
|
||||
queryWarehouseParams:{
|
||||
@@ -143,15 +121,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
async handleTrayChange() {
|
||||
const code = (this.formData.trayCode || '').toString().trim()
|
||||
if (!code) {
|
||||
this.trayMaterials = []
|
||||
return
|
||||
}
|
||||
const res = await getTrayInfo(code)
|
||||
this.trayMaterials = res.data || res.rows || []
|
||||
},
|
||||
async handleQueryDetail() {
|
||||
const id = (this.formData.stockinDetailId || '').toString().trim()
|
||||
if (!id) return
|
||||
@@ -170,20 +139,6 @@ export default {
|
||||
this.detailLoading = false
|
||||
}
|
||||
},
|
||||
submitForm() {
|
||||
if (!this.formData.warehouseId){
|
||||
this.$message.error('请输入仓库号')
|
||||
return
|
||||
}
|
||||
if (!this.formData.trayCode){
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
addInJobpk(this.formData).then(() => {
|
||||
this.$message.success('入库成功')
|
||||
this.resetForm()
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.$refs['elForm'].resetFields()
|
||||
this.trayMaterials = []
|
||||
@@ -204,24 +159,19 @@ export default {
|
||||
this.$message.error('入库数量不能超过剩余数量')
|
||||
return
|
||||
}
|
||||
if (!this.formData.trayCode){
|
||||
this.$message.error('请输入托盘码')
|
||||
return
|
||||
}
|
||||
if (!this.formData.warehouseId){
|
||||
this.$message.error('请输入仓库号')
|
||||
return
|
||||
}
|
||||
const payload = {
|
||||
trayCode: this.formData.trayCode,
|
||||
stockinDetailId: this.formData.stockinDetailId,
|
||||
inQuantity: qty,
|
||||
warehouseId: this.formData.warehouseId
|
||||
}
|
||||
bindTray(payload).then(() => {
|
||||
this.$message.success('绑定成功')
|
||||
rkSurepk(payload).then(() => {
|
||||
this.detailOpen = false
|
||||
this.handleTrayChange()
|
||||
this.resetForm()
|
||||
this.$message.success('入库成功')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user