车间MES:
四楼激光切割工序板材入库、板材出库和板材退库功能
master
xs 11 months ago
parent 6ccbff2d8f
commit f5d7b210bd

@ -28,10 +28,7 @@ public class MesConstants {
* : * :
*/ */
public static final String MES_BARCODE_TYPE_BIND = "4"; public static final String MES_BARCODE_TYPE_BIND = "4";
/**
* :使使
*/
public static final String MES_BARCODE_TYPE_SPLIT = "5";
/** /**
* : * :
*/ */

@ -51,6 +51,9 @@ public class WmsApiController extends BaseController {
@Autowired @Autowired
private IWmsErpScheduledTaskService wmsErpScheduledTaskService; private IWmsErpScheduledTaskService wmsErpScheduledTaskService;
@Autowired
private IWmsLocationBarcodeService wmsLocationBarcodeService;
/** /**
* *
@ -81,7 +84,6 @@ public class WmsApiController extends BaseController {
/** /**
* wcs * wcs
*/ */
// @RequiresPermissions("wms:mobile:addrawinstock")
@Log(title = "原材料出库记录", businessType = BusinessType.APPLY) @Log(title = "原材料出库记录", businessType = BusinessType.APPLY)
@PostMapping(("/applyRawOutstock")) @PostMapping(("/applyRawOutstock"))
public AjaxResult applyRawOutstock(@Validated @RequestBody WmsRawOutstock wmsRawOutstock) { public AjaxResult applyRawOutstock(@Validated @RequestBody WmsRawOutstock wmsRawOutstock) {
@ -129,6 +131,17 @@ public class WmsApiController extends BaseController {
return toAjax(wmsRawOutstockService.directRawOutstock(wmsRawOutstock)); return toAjax(wmsRawOutstockService.directRawOutstock(wmsRawOutstock));
} }
/**
* 退退
*/
@Log(title = "原材料退库记录", businessType = BusinessType.CONFIRM)
@PostMapping(("/directRawReturn"))
public AjaxResult directRawReturn(@RequestBody WmsRawReturn wmsRawReturn) {
return toAjax(wmsRawReturnService.directRawReturn(wmsRawReturn));
}
/** /**
* *
*/ */
@ -194,6 +207,17 @@ public class WmsApiController extends BaseController {
return success(wmsRawOutstockService.getNewestOutstockCabinet(wmsRawOutstock)); return success(wmsRawOutstockService.getNewestOutstockCabinet(wmsRawOutstock));
} }
/**
*
*/
@GetMapping(("/get4thFloorRegularBarcode"))
public AjaxResult get4thFloorRegularBarcode(WmsLocationBarcode wmsLocationBarcode) {
return success(wmsLocationBarcodeService.selectWmsLocationBarcodeJoinList(wmsLocationBarcode));
}
/** /**
* ERP * ERP
* @return * @return

@ -37,6 +37,14 @@ public class WmsLocationBarcode extends BaseEntity {
@Excel(name = "物料条码") @Excel(name = "物料条码")
private String barcodeInfo; private String barcodeInfo;
private String materialCode;
private String materialName;
private String materialSpec;
public void setLocationBarcodeId(Long locationBarcodeId) { public void setLocationBarcodeId(Long locationBarcodeId) {
this.locationBarcodeId = locationBarcodeId; this.locationBarcodeId = locationBarcodeId;
} }
@ -69,6 +77,30 @@ public class WmsLocationBarcode extends BaseEntity {
return barcodeInfo; return barcodeInfo;
} }
public String getMaterialCode() {
return materialCode;
}
public void setMaterialCode(String materialCode) {
this.materialCode = materialCode;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialSpec() {
return materialSpec;
}
public void setMaterialSpec(String materialSpec) {
this.materialSpec = materialSpec;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

@ -67,4 +67,13 @@ public interface WmsLocationBarcodeMapper
*/ */
public int batchWmsLocationBarcode(List<WmsLocationBarcode> wmsLocationBarcodeList); public int batchWmsLocationBarcode(List<WmsLocationBarcode> wmsLocationBarcodeList);
/**
* ,join material
*
* @param wmsLocationBarcode
* @return
*/
public List<WmsLocationBarcode> selectWmsLocationBarcodeJoinList(WmsLocationBarcode wmsLocationBarcode);
} }

@ -58,4 +58,14 @@ public interface IWmsLocationBarcodeService {
* @return * @return
*/ */
public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId); public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId);
/**
* ,Join material
*
* @param wmsLocationBarcode
* @return
*/
public List<WmsLocationBarcode> selectWmsLocationBarcodeJoinList(WmsLocationBarcode wmsLocationBarcode);
} }

@ -110,4 +110,13 @@ public interface IWmsRawReturnService
* @return * @return
*/ */
public int applyRawReturn(List<WmsRawReturn> wmsRawReturns); public int applyRawReturn(List<WmsRawReturn> wmsRawReturns);
/**
* 退退
*
* @param wmsRawReturn
* @return
*/
public int directRawReturn(WmsRawReturn wmsRawReturn);
} }

@ -86,4 +86,19 @@ public class WmsLocationBarcodeServiceImpl implements IWmsLocationBarcodeService
public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId) { public int deleteWmsLocationBarcodeByLocationBarcodeId(Long locationBarcodeId) {
return wmsLocationBarcodeMapper.deleteWmsLocationBarcodeByLocationBarcodeId(locationBarcodeId); return wmsLocationBarcodeMapper.deleteWmsLocationBarcodeByLocationBarcodeId(locationBarcodeId);
} }
/**
* ,Join material
*
* @param wmsLocationBarcode
* @return
*/
@Override
public List<WmsLocationBarcode> selectWmsLocationBarcodeJoinList(WmsLocationBarcode wmsLocationBarcode) {
return wmsLocationBarcodeMapper.selectWmsLocationBarcodeJoinList(wmsLocationBarcode);
}
} }

@ -125,7 +125,7 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
/** /**
* () * (4)
* *
* @param wmsRawInstockVo * @param wmsRawInstockVo
* @return * @return
@ -160,10 +160,13 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
} }
} }
if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)){
WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode()); WmsRawInstock existedRawInstock = wmsRawInstockMapper.selectWmsRawInstockByBarcode(wmsRawInstockVo.getMaterialBarcode());
if (existedRawInstock != null) { if (existedRawInstock != null) {
throw new ServiceException("此物料已经入库,不需重复入库"); throw new ServiceException("此物料已经入库,不需重复入库");
} }
}
Date currentDate = new Date(); Date currentDate = new Date();
String userName = SecurityUtils.getUsername(); String userName = SecurityUtils.getUsername();
@ -177,7 +180,9 @@ public class WmsRawInstockServiceImpl implements IWmsRawInstockService {
wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH); wmsRawInstock.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawInstock.setApplyBy(userName); wmsRawInstock.setApplyBy(userName);
wmsRawInstock.setApplyDate(currentDate); wmsRawInstock.setApplyDate(currentDate);
if(!baseBarcodeInfo.getBarcodeType().equals(MesConstants.MES_BARCODE_TYPE_RAW_REGULAR)) {
wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode()); wmsRawInstock.setMaterialBarcode(wmsRawInstockVo.getMaterialBarcode());
}
wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode()); wmsRawInstock.setMaterialBatchCode(baseBarcodeInfo.getBatchCode());
wmsRawInstock.setMaterialId(baseBarcodeInfo.getMaterialId()); wmsRawInstock.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawInstock.setInstockAmount(wmsRawInstockVo.getInstockAmount()); wmsRawInstock.setInstockAmount(wmsRawInstockVo.getInstockAmount());

@ -1157,6 +1157,9 @@ public class WmsRawOutstockServiceImpl implements IWmsRawOutstockService {
throw new ServiceException("物料条码有误"); throw new ServiceException("物料条码有误");
} }
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData(); MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
BigDecimal outstockAmount = wmsRawOutstock.getOutstockAmount(); BigDecimal outstockAmount = wmsRawOutstock.getOutstockAmount();
String batchCode = baseBarcodeInfo.getBatchCode(); String batchCode = baseBarcodeInfo.getBatchCode();

@ -381,12 +381,11 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
} }
private void updateRawStock(WmsRawReturnConfirmVo wmsRawReturnConfirmVo, MesBaseBarcodeInfo mesBaseBarcodeInfo, WmsBaseLocation baseLocation, public void updateRawStock(WmsRawReturnConfirmVo wmsRawReturnConfirmVo, MesBaseBarcodeInfo mesBaseBarcodeInfo, WmsBaseLocation baseLocation,
String userName, Date currentDate) { String userName, Date currentDate) {
String locationCode = wmsRawReturnConfirmVo.getLocationCode(); String locationCode = baseLocation.getLocationCode();
String instockBatch = mesBaseBarcodeInfo.getBatchCode(); String instockBatch = mesBaseBarcodeInfo.getBatchCode();
//todo 批次码
WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(instockBatch); WmsRawStock wmsRawStock = wmsRawStockMapper.selectRawStockByBarcode(instockBatch);
if (wmsRawStock == null) { if (wmsRawStock == null) {
WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(baseLocation.getWarehouseId()); WmsBaseWarehouse warehouse = wmsBaseWarehouseMapper.selectWmsBaseWarehouseByWarehouseId(baseLocation.getWarehouseId());
@ -399,6 +398,8 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
wmsRawStock.setInstockBatch(mesBaseBarcodeInfo.getBatchCode()); wmsRawStock.setInstockBatch(mesBaseBarcodeInfo.getBatchCode());
wmsRawStock.setInstockDate(mesBaseBarcodeInfo.getAcceptedDate()); wmsRawStock.setInstockDate(mesBaseBarcodeInfo.getAcceptedDate());
wmsRawStock.setLastOutstockTime(mesBaseBarcodeInfo.getLastOutstockDate()); wmsRawStock.setLastOutstockTime(mesBaseBarcodeInfo.getLastOutstockDate());
wmsRawStock.setSaleOrderId(mesBaseBarcodeInfo.getSaleOrderId());
wmsRawStock.setSafeFlag(mesBaseBarcodeInfo.getSafeFlag());
// wmsRawStock.setQualityStatus();//TODO:质检状态 // wmsRawStock.setQualityStatus();//TODO:质检状态
wmsRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_YES); wmsRawStock.setCompleteFlag(WmsConstants.WMS_RAW_STOCK_COMPLETE_FLAG_YES);
wmsRawStock.setTotalAmount(wmsRawReturnConfirmVo.getReturnAmount()); wmsRawStock.setTotalAmount(wmsRawReturnConfirmVo.getReturnAmount());
@ -539,4 +540,53 @@ public class WmsRawReturnServiceImpl implements IWmsRawReturnService {
return 1; return 1;
} }
/**
* 退退
*
* @param wmsRawReturn
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int directRawReturn(WmsRawReturn wmsRawReturn) {
String materialBarcode = wmsRawReturn.getMaterialBarcode();
String locationCode = wmsRawReturn.getLocationCode();
WmsBaseLocation baseLocation = wmsBaseLocationMapper.selectWmsBaseLocationByLocationCode(locationCode);
if (baseLocation == null) {
throw new ServiceException("库位编码错误");
}
R<MesBaseBarcodeInfo> baseBarcodeInfoR = remoteMesService.getBarcode(materialBarcode, SecurityConstants.INNER);
if (baseBarcodeInfoR == null) {
throw new ServiceException("物料条码有误");
}
MesBaseBarcodeInfo baseBarcodeInfo = baseBarcodeInfoR.getData();
if (baseBarcodeInfo == null) {
throw new ServiceException("物料条码有误");
}
BigDecimal returnAmount = wmsRawReturn.getReturnAmount();
String userName = SecurityUtils.getUsername();
Date currentDate = new Date();
wmsRawReturn.setTaskCode(Seq.getId(Seq.rawReturnSeqType, Seq.rawReturnCode));
wmsRawReturn.setWarehouseId(baseLocation.getWarehouseId());
wmsRawReturn.setMaterialId(baseBarcodeInfo.getMaterialId());
wmsRawReturn.setMaterialBarcode(materialBarcode);
wmsRawReturn.setReturnAmount(returnAmount);
wmsRawReturn.setAuditStatus(WmsConstants.WMS_AUDIT_STATUS_PASS);
wmsRawReturn.setExecuteStatus(WmsConstants.WMS_EXECUTE_STATUS_FINISH);
wmsRawReturn.setApplyBy(userName);
wmsRawReturn.setApplyDate(currentDate);
wmsRawReturnMapper.insertWmsRawReturn(wmsRawReturn);
WmsRawReturnConfirmVo wmsRawReturnConfirmVo = new WmsRawReturnConfirmVo();
wmsRawReturnConfirmVo.setReturnAmount(returnAmount);
updateRawStock(wmsRawReturnConfirmVo, baseBarcodeInfo, baseLocation,
userName, currentDate);
return 1;
}
} }

@ -12,6 +12,9 @@
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="materialSpec" column="material_spec"/>
</resultMap> </resultMap>
<sql id="selectWmsLocationBarcodeVo"> <sql id="selectWmsLocationBarcodeVo">
@ -86,4 +89,25 @@
( #{item.locationBarcodeId}, #{item.locationCode}, #{item.materialId}, #{item.barcodeInfo}, #{item.remark}, #{item.createBy}, #{item.createTime}) ( #{item.locationBarcodeId}, #{item.locationCode}, #{item.materialId}, #{item.barcodeInfo}, #{item.remark}, #{item.createBy}, #{item.createTime})
</foreach> </foreach>
</insert> </insert>
<select id="selectWmsLocationBarcodeJoinList" parameterType="WmsLocationBarcode" resultMap="WmsLocationBarcodeResult">
select wlb.location_barcode_id, wlb.location_code, wlb.material_id, wlb.barcode_info,
mbmi.material_code,mbmi.material_name,mbmi.material_spec
from wms_location_barcode wlb left join mes_base_material_info mbmi on wlb.material_id=mbmi.material_id
<where>
<if test="locationCode != null and locationCode != ''">and wlb.location_code = #{locationCode}</if>
<if test="materialId != null ">and wlb.material_id = #{materialId}</if>
<if test="barcodeInfo != null and barcodeInfo != ''">and wlb.barcode_info = #{barcodeInfo}</if>
</where>
</select>
</mapper> </mapper>

@ -222,6 +222,15 @@ export function directRawOutstock(data) {
}) })
} }
//激光切割工位板材退库
export function directRawReturn(data) {
return request({
url: '/wms/api/directRawReturn',
method: 'post',
data: data
})
}
// 柜体绑定 // 柜体绑定
@ -318,3 +327,12 @@ export function completeReturnMaterials(data) {
data: data data: data
}) })
} }
// 查询固定条码
export function get4thFloorRegularBarcode(query) {
return request({
url: '/wms/api/get4thFloorRegularBarcode',
method: 'get',
params: query
})
}

@ -36,6 +36,9 @@
<el-button type="success" @click="handleRawOutstock" <el-button type="success" @click="handleRawOutstock"
v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">板材领料 v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">板材领料
</el-button> </el-button>
<el-button type="warning" @click="handleRawReturn"
v-if="this.form.planDetailStatus!=null">板材退库
</el-button>
<el-button type="primary" @click="accomplishPlan" <el-button type="primary" @click="accomplishPlan"
v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">完成 v-if="this.form.planDetailStatus!=null && this.form.planDetailStatus==='已开始'">完成
</el-button> </el-button>
@ -130,7 +133,9 @@
width="80" width="80"
> >
<template slot-scope="scope"> <template slot-scope="scope">
{{ (scope.row.attachId && scope.row.attachId !== '') ? scope.row.attachId.split(',').length : "1(无图纸)" }} {{
(scope.row.attachId && scope.row.attachId !== '') ? scope.row.attachId.split(',').length : "1(无图纸)"
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -154,7 +159,7 @@
width="200" width="200"
> >
</el-table-column> </el-table-column>
<el-table-column <!--el-table-column
label="操作" label="操作"
width="120" width="120"
> >
@ -167,7 +172,7 @@
退库 退库
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column-->
</el-table> </el-table>
</div> </div>
</div> </div>
@ -201,16 +206,26 @@
<el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px"> <el-form ref="wmsForm" :model="wmsForm" :rules="wmsRules" label-width="80px">
<el-form-item label="库位编码" prop="locationCode"> <el-form-item label="库位编码" prop="locationCode">
<el-input v-model="wmsForm.locationCode" ref="locationCodeRef" autocomplete="off" <el-input v-model="wmsForm.locationCode" ref="locationCodeRef" autocomplete="off"
placeholder="请扫描或输入库位编码" placeholder="请扫描或输入库位编码" style="width:360px"
@focus="handleLocationCodeFocus" @blur="handleLocationCodeBlur" @focus="handleLocationCodeFocus" @blur="handleLocationCodeBlur"
suffix-icon="el-icon-full-screen"></el-input> suffix-icon="el-icon-full-screen"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="物料条码" prop="materialBarcode"> <el-form-item label="物料条码" prop="materialBarcode">
<el-input v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" autocomplete="off" <el-select v-model="wmsForm.materialBarcode" ref="materialBarcodeRef" placeholder="请扫描或输入物料条码"
placeholder="请扫描或输入物料条码" style="width:360px">
@focus="handleMaterialBarcodeFocus" @blur="handleMaterialBarcodeBlur" <el-option v-for="item in locationBarcodeList" :key="item.barcodeInfo" :label="`${item.materialName}(${item.materialSpec})`"
suffix-icon="el-icon-full-screen"></el-input> :value="item.barcodeInfo"></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="数量" prop="instockAmount">
<el-input-number v-model="wmsForm.instockAmount" ref="instockAmountRef" :min="1" :max="1000"
placeholder="请输入数量" style="width:360px"></el-input-number>
</el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -232,6 +247,8 @@ import {
addRawInstock, addRawInstock,
checkSuitableSaleOrderMaterial, checkSuitableSaleOrderMaterial,
directRawOutstock, directRawOutstock,
directRawReturn,
get4thFloorRegularBarcode
} from "@/api/board"; } from "@/api/board";
import {monitorSerialData} from "@/utils/serial" import {monitorSerialData} from "@/utils/serial"
@ -272,15 +289,19 @@ export default {
},//使 },//使
loacationCodeFocused: false, loacationCodeFocused: false,
materialBarcodeFocused: false, materialBarcodeFocused: false,
locationBarcodeList: [],
// //
wmsRules: { wmsRules: {
locationCode: [ locationCode: [
{required: true, message: "库位编码不能为空", trigger: "blur"} {required: true, message: "库位编码不能为空", trigger: "blur"}
], ],
materialBarcode: [ materialBarcode: [
{required: true, message: "物料条码不能为空", trigger: "blur"} {required: true, message: "物料条码不能为空", trigger: "change"}
], ],
instockAmount: [
{required: true, message: "数量不能为空", trigger: "blur"}
],
}, },
OUTSTOCKCODE: { OUTSTOCKCODE: {
@ -301,6 +322,13 @@ export default {
"2": "已开始", "2": "已开始",
"3": "已完成", "3": "已完成",
"9": "异常完成" "9": "异常完成"
},
STOCK_TYPE:{
INSTOCK:"1",//
OUTSTOCK:"2",//
RETURN:"3",//退
} }
} }
}, },
@ -326,7 +354,10 @@ export default {
this.form.materialCode = e.rows[0]?.materialCode this.form.materialCode = e.rows[0]?.materialCode
this.form.materialName = e.rows[0]?.materialName this.form.materialName = e.rows[0]?.materialName
this.form.saleOrderId = e.rows[0]?.saleOrderId this.form.saleOrderId = e.rows[0]?.saleOrderId
if (val.data) {
this.form.planDetailStatus = setState(val.data.planDetailStatus) this.form.planDetailStatus = setState(val.data.planDetailStatus)
}
}) })
}) })
this.$refs.chart2.setData({ this.$refs.chart2.setData({
@ -523,12 +554,15 @@ export default {
getOrderInfo(e) { getOrderInfo(e) {
this.getInfo(e) this.getInfo(e)
getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => { getNewestProductPlanDetailJoinAttach({planId: e.planId}).then(val => {
if (val.data) {
this.form = val.data this.form = val.data
this.form.materialId = e.materialId this.form.materialId = e.materialId
this.form.materialCode = e.materialCode this.form.materialCode = e.materialCode
this.form.materialName = e.materialName this.form.materialName = e.materialName
this.form.saleOrderId = e.saleOrderId this.form.saleOrderId = e.saleOrderId
this.form.planDetailStatus = setState(val.data.planDetailStatus) this.form.planDetailStatus = setState(val.data.planDetailStatus)
}
}) })
}, },
async expandChange(e, rows) { async expandChange(e, rows) {
@ -928,34 +962,17 @@ export default {
locationCode: undefined, locationCode: undefined,
materialBarcode: undefined materialBarcode: undefined
}; };
this.locationBarcodeList = [];
this.resetForm("wmsForm"); this.resetForm("wmsForm");
}, },
handleRawInstock() { handleRawInstock() {
this.resetWmsForm(); this.resetWmsForm();
this.open = true; this.open = true;
this.stockType = "1";// this.stockType = this.STOCK_TYPE.INSTOCK;//
this.title = "板材入库"; this.title = "板材入库";
this.dynamicFocus("locationCodeRef"); // this.dynamicFocus("locationCodeRef");
if (!this.checkSerialConnected()) { this.checkConnectSerial();
this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接',
showClose: true,
// beforeClose:async(action,instance,done)=>{
// if(action==='confirm'){
// }else{
// this.connectSerialPort();
// }
//
// },
showCancelButton: true,
type: 'warning'
}).then(() => {
console.log("dddd")
this.connectSerial(this.setSerialData);
}).catch(() => {
});
}
}, },
async dynamicFocus(inputRef) { async dynamicFocus(inputRef) {
@ -966,9 +983,22 @@ export default {
handleRawOutstock() { handleRawOutstock() {
this.resetWmsForm(); this.resetWmsForm();
this.open = true; this.open = true;
this.stockType = "2";// this.stockType = this.STOCK_TYPE.OUTSTOCK;//
this.title = "板材领料"; this.title = "板材领料";
this.dynamicFocus("locationCodeRef"); // this.dynamicFocus("locationCodeRef");
this.checkConnectSerial();
},
handleRawReturn() {
this.resetWmsForm();
this.open = true;
this.stockType = this.STOCK_TYPE.RETURN;//退
this.title = "板材退库";
// this.dynamicFocus("locationCodeRef");
this.checkConnectSerial();
},
checkConnectSerial(){
if (!this.checkSerialConnected()) { if (!this.checkSerialConnected()) {
this.$confirm('请连接条码枪', '提示', { this.$confirm('请连接条码枪', '提示', {
confirmButtonText: '连接', confirmButtonText: '连接',
@ -983,7 +1013,6 @@ export default {
showCancelButton: true, showCancelButton: true,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
console.log("dddd")
this.connectSerial(this.setSerialData); this.connectSerial(this.setSerialData);
}).catch(() => { }).catch(() => {
}); });
@ -997,40 +1026,79 @@ export default {
}, },
submitRawStock() { submitRawStock() {
if (this.stockType === "1") {// if (this.stockType === this.STOCK_TYPE.INSTOCK) {//
this.wmsForm.instockAmount = 1;
addRawInstock(this.wmsForm).then(response => { addRawInstock(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材入库成功"); this.$modal.msgSuccess("板材入库成功");
this.cancel(); this.cancel();
}); });
} else if (this.stockType === "2") {// } else if (this.stockType === this.STOCK_TYPE.OUTSTOCK) {//
this.wmsForm.outstockAmount = 1; this.wmsForm.outstockAmount = this.wmsForm.instockAmount;
this.wmsForm.planCode = this.form.planCode; this.wmsForm.planCode = this.form.planCode;
this.wmsForm.planDetailCode = this.form.planDetailCode; this.wmsForm.planDetailCode = this.form.planDetailCode;
this.wmsForm.operationType = '1';// this.wmsForm.operationType = '1';//
this.wmsForm.taskType = '1';// this.wmsForm.taskType = '1';//
this.wmsForm.saleOrderId = this.form.saleOrderId; this.wmsForm.saleOrderId = this.form.saleOrderId;
checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
let returnCode = response.data.code;
let returnMsg = response.data.msg;
if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
this.directRawOutstock(); this.directRawOutstock();
} else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
this.$confirm('此库存为安全库存,确认要出安全库存么?有以下销售订单库存可以优先出:' + returnMsg, '提示', {
confirmButtonText: '确定', //
cancelButtonText: '取消', // checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
type: 'warning' // let returnCode = response.data.code;
}).then(() => { // let returnMsg = response.data.msg;
this.directRawOutstock(); // if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
}).catch(() => { // this.directRawOutstock();
// } else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
// this.$confirm('' + returnMsg, '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// this.directRawOutstock();
// }).catch(() => {
// });
//
// } else {
// this.$modal.msgWarning("" + returnMsg);
// }
//
// });
} else if (this.stockType === this.STOCK_TYPE.RETURN) {//
this.wmsForm.returnAmount = this.wmsForm.instockAmount;
this.wmsForm.planCode = this.form.planCode;
this.wmsForm.planDetailCode = this.form.planDetailCode;
this.wmsForm.operationType = '1';//
this.wmsForm.taskType = '1';//退
this.wmsForm.saleOrderId = this.form.saleOrderId;
directRawReturn(this.wmsForm).then(response => {
this.$modal.msgSuccess("板材退库成功");
this.cancel();
}); });
} else {
this.$modal.msgWarning("请出库:" + returnMsg);
}
}); //
// checkSuitableSaleOrderMaterial(this.wmsForm).then(response => {
// let returnCode = response.data.code;
// let returnMsg = response.data.msg;
// if (returnCode === this.OUTSTOCKCODE.directOutstockCode) {
// this.directRawOutstock();
// } else if (returnCode === this.OUTSTOCKCODE.confirmOutstockCode) {
// this.$confirm('' + returnMsg, '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(() => {
// this.directRawOutstock();
// }).catch(() => {
// });
//
// } else {
// this.$modal.msgWarning("" + returnMsg);
// }
//
// });
} }
}, },
@ -1048,6 +1116,11 @@ export default {
handleLocationCodeBlur() { handleLocationCodeBlur() {
this.loacationCodeFocused = false; this.loacationCodeFocused = false;
if (this.wmsForm.locationCode && this.wmsForm.locationCode !== '') {
get4thFloorRegularBarcode(this.wmsForm).then(response => {
this.locationBarcodeList = response.data;
});
}
}, },
handleMaterialBarcodeFocus() { handleMaterialBarcodeFocus() {
@ -1085,7 +1158,7 @@ export default {
if (this.open) {// if (this.open) {//
if (this.loacationCodeFocused) { if (this.loacationCodeFocused) {
this.wmsForm.locationCode = this.serialData this.wmsForm.locationCode = this.serialData
this.dynamicFocus("materialBarcodeRef"); // this.dynamicFocus("materialBarcodeRef");
} else if (this.materialBarcodeFocused) { } else if (this.materialBarcodeFocused) {
this.wmsForm.materialBarcode = this.serialData; this.wmsForm.materialBarcode = this.serialData;
} }
@ -1093,7 +1166,8 @@ export default {
} }
}, }
,
} }

Loading…
Cancel
Save