车间生产:五楼装配页面领辅料功能
master
xins 7 months ago
parent 5775773430
commit 5fb1097b14

@ -471,6 +471,13 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
@Transactional(rollbackFor = Exception.class)
@Override
public int applyRawOutstock(WmsRawOutstock wmsRawOutstock) {
String planCode = wmsRawOutstock.getPlanCode();
String planDetailCode = wmsRawOutstock.getPlanDetailCode();
if (StringUtils.isEmpty(planCode)) {
throw new ServiceException("请选择生产详细信息再领料");
}
Long warehouseId = wmsRawOutstock.getWarehouseId();
List<WmsRawOutstockDetail> rawOutstockDetails = wmsRawOutstock.getWmsRawOutstockDetailList();
//根据物料ID分组获取总申请数量
@ -484,8 +491,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
String warehouseType = baseWarehouse.getWarehouseType();
String queryQualityStatus = WmsConstants.WMS_QUALITY_STATUS_PASS;
String planCode = wmsRawOutstock.getPlanCode();
String planDetailCode = wmsRawOutstock.getPlanDetailCode();
List<WmsRawOutstock> toInsertedRawOutstocks = new ArrayList<>();
Date currentDate = new Date();
@ -526,7 +532,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
//原材料出库记录(有break以下方法需要写在此处)
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode,taskType,
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode, taskType,
planAmount, currentDate, userName);
toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -540,7 +546,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
//原材料出库记录(有break以下方法需要写在此处)
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode,taskType,
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode, taskType,
planAmount, currentDate, userName);
toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -555,7 +561,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
wmsRawStockMapper.updateWmsRawStock(wmsRawStock);
//原材料出库记录(有break以下方法需要写在此处)
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode,taskType,
WmsRawOutstock toInsertedRawOutstock = getWmsRawOutstock(wmsRawStock, baseWarehouse, planCode, planDetailCode, materialId, taskCode, taskType,
planAmount, currentDate, userName);
toInsertedRawOutstocks.add(toInsertedRawOutstock);
@ -594,7 +600,7 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
* @return
*/
private WmsRawOutstock getWmsRawOutstock(WmsRawStock wmsRawStock, WmsBaseWarehouse baseWarehouse,
String planCode, String planDetailCode, Long materialId, String taskCode,String taskType,
String planCode, String planDetailCode, Long materialId, String taskCode, String taskType,
BigDecimal planAmount, Date currentDate, String userName) {
//出库要求 0申请出库1申请审核出库2直接出库
String outRequirement = baseWarehouse.getOutRequirement();

@ -25,10 +25,16 @@
</el-form-item>
</el-form>
<div style="text-align: center">
<el-button type="primary" @click="getMaterials"></el-button>
<el-button v-if="($route.query && $route.query.id) === '2'" type="info" @click="handleBindBarcode"></el-button>
<el-button v-if="($route.query && $route.query.id) === '2'" type="warning" @click="handleRawBack"></el-button>
<el-button :disabled="form.planDetailStatus === '已完成'" type="primary" @click="finish"></el-button>
<el-button type="success" v-if="(!$route.query || $route.query.id!=='2')" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="getMaterials('0')">
</el-button>
<el-button type="primary" v-if="($route.query && $route.query.id) === '2'" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="getMaterials('1')">
领柜体
</el-button>
<el-button v-if="($route.query && $route.query.id) === '2'" type="info" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleBindBarcode">
</el-button>
<el-button v-if="($route.query && $route.query.id) === '2'" type="warning" :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" @click="handleRawBack">
</el-button>
<el-button :disabled="form.planDetailStatus === '已完成' || !form.planDetailCode" type="primary" @click="finish"></el-button>
<el-popover
v-if="($route.query && $route.query.id) === '2'"
v-model="assignModel"
@ -42,7 +48,9 @@
</el-form-item>
<el-form-item label="工位">
<el-radio-group v-model="assignTaskForm.stationId">
<el-radio v-for="i in stationData" :label="i.stationId" :value="i.stationId" :key="i.stationId">{{i.stationName}}</el-radio>
<el-radio v-for="i in stationData" :label="i.stationId" :value="i.stationId" :key="i.stationId">
{{ i.stationName }}
</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
@ -203,7 +211,7 @@
<el-dialog
:visible.sync="dialogVisible"
title="领柜体"
:title="applyMaterialTitle"
width="40%">
<el-form ref="form" :model="form1" label-width="100px">
<el-form-item label="工单编号">
@ -212,13 +220,13 @@
<el-form-item label="明细编号">
<el-input v-model="form1.planDetailCode" disabled></el-input>
</el-form-item>
<el-form-item label="领柜体仓库">
<el-select v-model="form1.warehouseId" placeholder="请选择领柜体仓库" @change="warehouseChange">
<el-form-item label="仓库">
<el-select v-model="form1.warehouseId" placeholder="请选择仓库" @change="warehouseChange">
<el-option v-for="item in warehouseList" :key="item.warehouseId" :label="item.warehouseName"
:value="item.warehouseId"></el-option>
</el-select>
</el-form-item>
<el-form-item label="领柜体原因">
<el-form-item label="领原因">
<el-input v-model="form1.applyReason" type="textarea"></el-input>
</el-form-item>
</el-form>
@ -258,7 +266,7 @@
<el-input
v-model="scope.row.planAmount"
:min="1"
disabled="true"
:disabled="planAmountDisabled"
controls-position="right"
style="width: 100%"
>
@ -293,8 +301,6 @@
</el-dialog>
<el-dialog
:visible.sync="bindBarcodeVisible"
title="柜体绑定"
@ -413,6 +419,10 @@ export default {
nowNum1: 1,
totalNum1: 0,
getMaterialsModel: false,
applyMaterialTitle: '',
planAmount : null,
planAmountDisabled : true,
taskType:'',
dialogVisible: false,
form: {},
form1: {},
@ -422,10 +432,10 @@ export default {
},
assignTaskRules: {
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
{required: true, message: "物料条码不能为空", trigger: "blur"}
],
stationId: [
{ required: true, message: "工位不能为空", trigger: "change" }
{required: true, message: "工位不能为空", trigger: "change"}
],
},
submitAssignLoading: false,
@ -469,10 +479,10 @@ export default {
},
bindBarcodeRules: {
productBarcode: [
{ required: true, message: "成品条码不能为空", trigger: "blur" }
{required: true, message: "成品条码不能为空", trigger: "blur"}
],
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
{required: true, message: "物料条码不能为空", trigger: "blur"}
],
},
@ -483,10 +493,10 @@ export default {
},
rawBackRules: {
materialBarcode: [
{ required: true, message: "物料条码不能为空", trigger: "blur" }
{required: true, message: "物料条码不能为空", trigger: "blur"}
],
warehouseId: [
{ required: true, message: "仓库不能为空", trigger: "change" }
{required: true, message: "仓库不能为空", trigger: "change"}
]
}
}
@ -722,19 +732,18 @@ export default {
resetAssignTask() {
this.assignTaskForm = {
materialBarcode: null,
stationNo:null
stationNo: null
};
this.resetForm("assignTaskForm");
},
cancelAssignTask(){
cancelAssignTask() {
this.assignModel = false;
this.submitAssignLoading = false;
this.resetAssignTask();
},
completeStation() {
this.submitAssignLoading = true;
this.$refs["assignTaskForm"].validate(valid => {
@ -751,7 +760,6 @@ export default {
},
getInfo(e) {
this.$refs.chart1_1.setData({
series: [
@ -1109,7 +1117,19 @@ export default {
},
//
getMaterials() {
getMaterials(returnFlag) {
if (returnFlag == '1') {
this.applyMaterialTitle = "领柜体";
this.planAmount = 1;
this.planAmountDisabled = true;
this.taskType = '2';//
} else {
this.applyMaterialTitle = "领料";
this.planAmount = null;
this.planAmountDisabled = false;
this.taskType='1';//
}
this.searchMaterialValue = ''
this.dialogVisible = true
this.form1 = {
@ -1122,18 +1142,18 @@ export default {
wmsRawOutstockDetailList: []
}
//
getWarehouses({"warehouseFloor": 5,"returnFlag":1}).then(e => {
getWarehouses({"warehouseFloor": 5, "returnFlag": returnFlag}).then(e => {
this.warehouseList = e.data
this.form1.warehouseId = e.data[0]?.warehouseId
this.searchMaterial("");
this.searchMaterial();
})
},
//
searchMaterial(val) {
if(this.form1.warehouseId==null || this.form1.warehouseId == undefined
|| this.form1.warehouseId==""){
if (this.form1.warehouseId == null || this.form1.warehouseId == undefined
|| this.form1.warehouseId == "") {
return;
}
getStockTotal({
@ -1147,7 +1167,7 @@ export default {
materialName: r.materialName,
availableAmount: r.totalAmount - r.occupyAmount - r.frozenAmount,
unavailableAmount: r.occupyAmount + r.frozenAmount,
planAmount: 1
planAmount: this.planAmount
}
})
})
@ -1161,7 +1181,7 @@ export default {
},
receiveMaterial() {
this.form1.taskType = '2';//
this.form1.taskType = this.taskType;
applyRawOutstock(this.form1).then(e => {
if (e.code === 200) {
this.dialogVisible = false
@ -1199,7 +1219,7 @@ export default {
this.bindBarcodeVisible = true;
},
submitBindBarcode(){
submitBindBarcode() {
this.$refs["bindBarcodeForm"].validate(valid => {
if (valid) {
bindBarcode(this.bindBarcodeForm).then(response => {
@ -1210,7 +1230,7 @@ export default {
});
},
cancelBindBarcode(){
cancelBindBarcode() {
this.bindBarcodeVisible = false;
this.resetBindBarcode();
},
@ -1220,7 +1240,7 @@ export default {
resetRawBack() {
this.rawBackForm = {
materialBarcode: null,
warehouseId:null
warehouseId: null
};
this.resetForm("rawBackForm");
},
@ -1229,12 +1249,12 @@ export default {
handleRawBack(scope) {
this.resetRawBack();
//
if(this.warehouseList==null || this.warehouseList.length==0){
getWarehouses({"warehouseFloor": 5,"returnFlag":1}).then(e => {
if (this.warehouseList == null || this.warehouseList.length == 0) {
getWarehouses({"warehouseFloor": 5, "returnFlag": 1}).then(e => {
this.warehouseList = e.data
this.rawBackForm.warehouseId = this.warehouseList[0]?.warehouseId
})
}else{
} else {
this.rawBackForm.warehouseId = this.warehouseList[0]?.warehouseId
}
@ -1242,7 +1262,7 @@ export default {
},
submitRawBack(){
submitRawBack() {
this.$refs["rawBackForm"].validate(valid => {
if (valid) {
applyRawBack(this.rawBackForm).then(response => {
@ -1253,7 +1273,7 @@ export default {
});
},
cancelRawBack(){
cancelRawBack() {
this.rawBackVisible = false;
this.resetRawBack();
}

Loading…
Cancel
Save