MES:
master
xs 3 months ago
parent c2066b4477
commit cd028831b8

@ -211,4 +211,9 @@ public class MesConstants {
*/ */
public static final String MES_MATERIAL_ACTIVE_FLAG_NORMAL = "1";//正常 public static final String MES_MATERIAL_ACTIVE_FLAG_NORMAL = "1";//正常
public static final String MES_MATERIAL_ACTIVE_FLAG_STOP = "0";//停用 public static final String MES_MATERIAL_ACTIVE_FLAG_STOP = "0";//停用
/**
*
*/
public static final String MES_PURCHASE_ORDER_STATUS_TOPURCHASE = "1";//待采购
} }

@ -32,16 +32,17 @@ public class Seq {
private static AtomicInteger productOutstockSeq = new AtomicInteger(1); private static AtomicInteger productOutstockSeq = new AtomicInteger(1);
// 成品出库记录标识 // 成品出库记录标识
public static final String productInstockCode = "PI"; public static final String productOutstockCode = "PO";
// 成品入库记录序列类型 // 成品入库记录序列类型
public static final String productInstockSeqType = "PRODUCTINSTOCK"; public static final String productInstockSeqType = "PRODUCTINSTOCK";
// 成品入库记录接口序列数 // 成品入库记录接口序列数
private static AtomicInteger productInstockSeq = new AtomicInteger(1); private static AtomicInteger productInstockSeq = new AtomicInteger(1);
// 成品入库记录标识 // 成品入库记录标识
public static final String productOutstockCode = "PO"; public static final String productInstockCode = "PI";
// 原材料出库记录序列类型 // 原材料出库记录序列类型
@ -270,6 +271,17 @@ public class Seq {
// 仓储盘点记录标识 // 仓储盘点记录标识
public static final String wmsInventoryCheckSeqCode = "IC"; public static final String wmsInventoryCheckSeqCode = "IC";
// 停用物料信息的物料编码
public static final String stopUsingSeqType = "";
// 停用物料信息的接口序列数
private static AtomicInteger stopUsingSeq = new AtomicInteger(1);
// 停用物料信息的记录标识
public static final String stopUsingCode = "DEL";
/** /**
* *
* *
@ -376,6 +388,8 @@ public class Seq {
atomicInt = wmsInventoryCheckSeq; atomicInt = wmsInventoryCheckSeq;
}else if (mesBindBarcodeSeqType.equals(type)) { }else if (mesBindBarcodeSeqType.equals(type)) {
atomicInt = mesBindBarcodeSeq; atomicInt = mesBindBarcodeSeq;
}else if (stopUsingSeqType.equals(type)) {
atomicInt = stopUsingSeq;
} }
return getId(atomicInt, 3, code); return getId(atomicInt, 3, code);
} }

@ -7,6 +7,7 @@ import com.hw.common.core.constant.MesConstants;
import com.hw.common.core.exception.ServiceException; import com.hw.common.core.exception.ServiceException;
import com.hw.common.core.utils.DateUtils; import com.hw.common.core.utils.DateUtils;
import com.hw.common.core.utils.StringUtils; import com.hw.common.core.utils.StringUtils;
import com.hw.common.core.utils.uuid.Seq;
import com.hw.common.security.utils.SecurityUtils; import com.hw.common.security.utils.SecurityUtils;
import com.hw.mes.api.domain.MesBaseBarcodeInfo; import com.hw.mes.api.domain.MesBaseBarcodeInfo;
import com.hw.mes.domain.MesOrderBind; import com.hw.mes.domain.MesOrderBind;
@ -94,6 +95,18 @@ public class MesBaseMaterialInfoServiceImpl implements IMesBaseMaterialInfoServi
// throw new ServiceException("此物料已经有采购订单和销售订单绑定信息,不能修改"); // throw new ServiceException("此物料已经有采购订单和销售订单绑定信息,不能修改");
// } // }
MesBaseMaterialInfo dbMaterialInfo = mesBaseMaterialInfoMapper.selectMesBaseMaterialInfoByMaterialId(mesBaseMaterialInfo.getMaterialId());
String dbActiveFlag = dbMaterialInfo.getActiveFlag();
if (!dbActiveFlag.equals(mesBaseMaterialInfo.getActiveFlag())) {
if (dbActiveFlag.equals(MesConstants.MES_MATERIAL_ACTIVE_FLAG_NORMAL)) {
mesBaseMaterialInfo.setOldMaterialCode(mesBaseMaterialInfo.getMaterialCode());
mesBaseMaterialInfo.setMaterialCode(Seq.getId(Seq.stopUsingSeqType, Seq.stopUsingCode));
}
if (!dbActiveFlag.equals(MesConstants.MES_MATERIAL_ACTIVE_FLAG_NORMAL)) {
throw new ServiceException("非正常状态的物料信息不能再修改状态");
}
}
mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate()); mesBaseMaterialInfo.setUpdateTime(DateUtils.getNowDate());
mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername()); mesBaseMaterialInfo.setUpdateBy(SecurityUtils.getUsername());

@ -147,6 +147,7 @@
<dict-tag :options="dict.type.mes_material_status" :value="scope.row.activeFlag"/> <dict-tag :options="dict.type.mes_material_status" :value="scope.row.activeFlag"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="旧物料编码" align="center" prop="oldMaterialCode"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -241,7 +242,7 @@
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="activeFlag"> <el-form-item label="状态" prop="activeFlag">
<el-radio-group v-model="form.activeFlag"> <el-radio-group v-model="form.activeFlag" :disabled="form.activeFlag !== '1'">
<el-radio <el-radio
v-for="dict in dict.type.mes_material_status" v-for="dict in dict.type.mes_material_status"
:key="dict.value" :key="dict.value"
@ -257,6 +258,8 @@
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
@ -279,7 +282,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default { export default {
name: "Materialinfo", name: "Materialinfo",
dicts: ['active_flag', 'material_categories', 'mes_material_bind_flag','mes_material_batch_flag','mes_material_status'], dicts: ['active_flag', 'material_categories', 'mes_material_bind_flag', 'mes_material_batch_flag', 'mes_material_status'],
components: { components: {
Treeselect Treeselect
}, },
@ -349,6 +352,7 @@ export default {
// {required: true, message: "", trigger: "blur"} // {required: true, message: "", trigger: "blur"}
// ], // ],
}, },
currentStatus: '',
}; };
}, },
created() { created() {
@ -437,6 +441,7 @@ export default {
const materialId = row.materialId || this.ids const materialId = row.materialId || this.ids
getMaterialinfo(materialId).then(response => { getMaterialinfo(materialId).then(response => {
this.form = response.data; this.form = response.data;
this.currentStatus = this.form.activeFlag;
this.open = true; this.open = true;
this.title = "修改物料信息"; this.title = "修改物料信息";
}); });
@ -446,11 +451,25 @@ export default {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
if (valid) { if (valid) {
if (this.form.materialId != null) { if (this.form.materialId != null) {
updateMaterialinfo(this.form).then(response => { let thisForm = this.form;
this.$modal.msgSuccess("修改成功"); if (this.form.activeFlag !== this.currentStatus) {
this.open = false; this.$modal.confirm('确认要修改物料信息的状态么?').then(function () {
this.getList(); return updateMaterialinfo(thisForm);
}); }).then(() => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).catch(() => {
});
} else {
updateMaterialinfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
}
} else { } else {
addMaterialinfo(this.form).then(response => { addMaterialinfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
@ -494,7 +513,9 @@ export default {
this.download('mes/materialinfo/export', { this.download('mes/materialinfo/export', {
...this.queryParams ...this.queryParams
}, `materialinfo_${new Date().getTime()}.xlsx`) }, `materialinfo_${new Date().getTime()}.xlsx`)
} },
} }
}; };
</script> </script>

Loading…
Cancel
Save