This commit is contained in:
zds
2022-11-06 20:54:32 +08:00
parent f681d81a5d
commit e9efd7b3e9
9 changed files with 142 additions and 1558 deletions

View File

@@ -401,25 +401,30 @@ public class FormulaServiceImpl implements FormulaService {
jo.put("is_"+key,bomdlts2_now+"");
}
});
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan",jo.getString("is_tan2"));
}
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty==null){
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
}
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","0");
}else{
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
}
}
//获取碳化铬
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
@@ -458,7 +463,9 @@ public class FormulaServiceImpl implements FormulaService {
jo.put("is_09030102","100");
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
//如果该物料是c粉
jo.put("is_tan","100");
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","100");
}
}
dtl_new.add(jo);
}
@@ -491,11 +498,7 @@ public class FormulaServiceImpl implements FormulaService {
//成型剂
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
jo.put("is_"+jo.getString("formingtype_code"),"100");
}/*else if(jo.getString("material_type").equals("02")){//物料分类
if(jo.getString("material_id").equals("1503644362788179968")){
jo.put("is_tan","100");
}
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
String jo_material_id = jo.getString("material_id");
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo_material_id)
@@ -526,24 +529,30 @@ public class FormulaServiceImpl implements FormulaService {
jo.put("is_"+key,bomdlts2_now+"");
}
});
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan",jo.getString("is_tan2"));
}
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty==null){
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
}
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","0");
}else{
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
}
}
//获取碳化铬
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
@@ -582,7 +591,9 @@ public class FormulaServiceImpl implements FormulaService {
jo.put("is_09030102","100");
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
//如果该物料是c粉
jo.put("is_tan","100");
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","100");
}
}
dtl_new.add(jo);
}
@@ -599,11 +610,7 @@ public class FormulaServiceImpl implements FormulaService {
//成型剂
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
jo.put("is_"+jo.getString("formingtype_code"),"100");
}/*else if(jo.getString("material_type").equals("02")){//物料分类
if(jo.getString("material_id").equals("1503644362788179968")){
jo.put("is_tan","100");
}
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
String jo_material_id = jo.getString("material_id");
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo_material_id)
@@ -634,21 +641,30 @@ public class FormulaServiceImpl implements FormulaService {
jo.put("is_"+key,bomdlts2_now+"");
}
});
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan",jo.getString("is_tan2"));
}
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty==null){
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
}
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","0");
}else{
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
}
}
//获取碳化铬
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
@@ -687,7 +703,9 @@ public class FormulaServiceImpl implements FormulaService {
jo.put("is_09030102","100");
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
//如果该物料是c粉
jo.put("is_tan","100");
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","100");
}
}
dis_new.add(jo);
}

View File

@@ -321,6 +321,7 @@ public class InitformulaServiceImpl implements InitformulaService {
Formula_01.put("waste_limit_up",whereJson.getString("waste_limit_up"));
Formula_01.put("is_again_put",whereJson.getString("is_again_put"));
Formula_01.put("formula_type",whereJson.getString("formula_type"));
Formula_01.put("c_balance",whereJson.getString("c_balance"));
Formula_01.put("bucket_type","01");
Formula_01.put("masterbucket_qty","0");
@@ -440,6 +441,7 @@ public class InitformulaServiceImpl implements InitformulaService {
Formula_02.put("waste_limit_up",whereJson.getString("waste_limit_up"));
Formula_02.put("is_again_put",whereJson.getString("is_again_put"));
Formula_02.put("formula_type",whereJson.getString("formula_type"));
Formula_02.put("c_balance",whereJson.getString("c_balance"));
Formula_02.put("bucket_type","02");
Formula_02.put("masterbucket_qty","0");
@@ -621,6 +623,7 @@ public class InitformulaServiceImpl implements InitformulaService {
Formula_01.put("waste_limit_up",whereJson.getString("waste_limit_up"));
Formula_01.put("is_again_put",whereJson.getString("is_again_put"));
Formula_01.put("formula_type",whereJson.getString("formula_type"));
Formula_01.put("c_balance",whereJson.getString("c_balance"));
Formula_01.put("bucket_type","01");
Formula_01.put("masterbucket_qty","0");
Formula_01.put("extadd_qty","0");
@@ -740,6 +743,7 @@ public class InitformulaServiceImpl implements InitformulaService {
Formula_02.put("waste_limit_up",whereJson.getString("waste_limit_up"));
Formula_02.put("is_again_put",whereJson.getString("is_again_put"));
Formula_02.put("formula_type",whereJson.getString("formula_type"));
Formula_02.put("c_balance",whereJson.getString("c_balance"));
Formula_02.put("bucket_type","02");
Formula_02.put("masterbucket_qty","0");
Formula_02.put("extadd_qty","0");
@@ -915,12 +919,16 @@ public class InitformulaServiceImpl implements InitformulaService {
if(Formula == null ){
throw new BadRequestException("当前配方信息查询失败!");
}
JSONObject material = MD_ME_ProductMaterialExt.query("material_id ='"+material_id+"'").uniqueResult(0);
if(material == null ){
throw new BadRequestException("当前成品查询不到成品物料扩展信息!");
}
Formula.put("net_rate",material.getString("net_rate"));
Formula.put("c_balance",material.getString("c_balance"));
if (StrUtil.isEmpty(Formula.getString("c_balance"))) {
Formula.put("c_balance",material.getString("c_balance"));
}
JSONArray dtl = WQL.getWO("QPF_INITFORMULA01")
.addParam("workorder_id",workorder.getString("workorder_id"))
.addParam("material_id",workorder.getString("material_id"))
@@ -934,11 +942,7 @@ public class InitformulaServiceImpl implements InitformulaService {
//成型剂
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
jo.put("is_"+jo.getString("formingtype_code"),"100");
}/*else if(jo.getString("material_type").equals("02")){//物料分类
if(jo.getString("material_id").equals("1503644362788179968")){
jo.put("is_tan","100");
}
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
String jo_material_id = jo.getString("material_id");
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo_material_id)
@@ -969,26 +973,32 @@ public class InitformulaServiceImpl implements InitformulaService {
jo.put("is_"+key,bomdlts2_now+"");
}
});
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty==null){
jo.put("is_tan","0");
}else{
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan",jo.getString("is_tan2"));
}
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
}
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","0");
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
}
}
//获取碳化铬
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
@@ -1026,7 +1036,9 @@ public class InitformulaServiceImpl implements InitformulaService {
jo.put("is_09030102","100");
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
//如果该物料是c粉
jo.put("is_tan","100");
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","100");
}
}
dtl_new.add(jo);
}
@@ -1043,11 +1055,7 @@ public class InitformulaServiceImpl implements InitformulaService {
//成型剂
if (StrUtil.isNotEmpty(jo.getString("formingtype_code"))) {
jo.put("is_"+jo.getString("formingtype_code"),"100");
}/*else if(jo.getString("material_type").equals("02")){//物料分类
if(jo.getString("material_id").equals("1503644362788179968")){
jo.put("is_tan","100");
}
}*/else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.RD_AND_PG.getClass_idStr().contains(material_type_id)){//软废
String jo_material_id = jo.getString("material_id");
JSONArray bomdlts = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo_material_id)
@@ -1078,21 +1086,30 @@ public class InitformulaServiceImpl implements InitformulaService {
jo.put("is_"+key,bomdlts2_now+"");
}
});
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan",jo.getString("is_tan2"));
}
}else if(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.THW.getClass_idStr().contains(material_type_id)){//碳化钨新料
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty==null){
if (StrUtil.isEmpty(jo.getString("change_qty"))) {
//获取修正值
double change_qty = this.getWCChange(jo.getString("material_id"),jo.getString("pcsn"));
jo.put("change_qty",change_qty);
}
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","0");
}else{
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
//获取碳含量
JSONObject FactoryWarranty = WQL.getWO("QPF_AUTOFORMULA01")
.addParam("material_id",jo.getString("material_id"))
.addParam("pcsn",jo.getString("pcsn"))
.addParam("flag","3")
.process()
.uniqueResult(0);
if(FactoryWarranty!=null){
//含碳比
double value = FactoryWarranty.getDouble("value");
//更新含碳比
jo.put("is_tan",value);
}
}
//获取碳化铬
JSONObject FactoryWarranty2 = WQL.getWO("QPF_AUTOFORMULA01")
@@ -1131,7 +1148,9 @@ public class InitformulaServiceImpl implements InitformulaService {
jo.put("is_09030102","100");
}else if(MaterOptTypeEnum.TF.getClass_idStr().contains(jo.getString("material_id")) ||(StrUtil.isNotEmpty(material_type_id) && MaterOptTypeEnum.TF.getClass_idStr().contains(material_type_id))){//C粉新料
//如果该物料是c粉
jo.put("is_tan","100");
if (StrUtil.isEmpty(jo.getString("is_tan"))) {
jo.put("is_tan","100");
}
}
dis_new.add(jo);
}

View File

@@ -359,7 +359,7 @@
SELECT
FormulaDtl.*,
Formula.bucket_type,
producmaterialext.c_balance AS is_tan,
producmaterialext.c_balance AS is_tan2,
mb.material_type_id,
case when structivt2.sum_ivt_qty>0 then '1'
else '0' end as is_rf_xl,

View File

@@ -1,205 +0,0 @@
<template>
<el-dialog
:title=title
append-to-body
width="500px"
:visible.sync="dialogVisible"
v-loading.fullscreen.lock="fullscreenLoading"
:before-close="handleClose"
destroy-on-close
@close="close"
>
<el-form ref="form" :model="outForm" size="mini" label-width="90px">
<el-row>
<el-col :span="24">
<el-form-item label="需求重量kg:">
<el-input v-model="outForm.formula_qty" :disabled="true" style="width: 350px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="系统汇总kg:">
<el-input v-model="outForm.put_qty" style="width: 120px;" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="误差率%:">
<el-input v-model="error_rate1" style="width: 120px;" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="实际称重kg:">
<el-input v-model="outForm.fact_qty" style="width: 120px;" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="误差率%:">
<el-input v-model="error_rate2" style="width: 120px;" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="info" @click="close">取消</el-button>
<el-button type="primary" @click="sysConfirm">按系统确认</el-button>
<el-button type="primary" @click="weighConfirm">按称重确认</el-button>
</div>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudFlourwork from '@/api/wms/pf/flourwork'
export default {
name: 'SunShowDialog',
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
this.outForm = this.openParam.json
this.outForm.formula_qty = this.openParam.formula_qty
this.outForm.put_qty = this.openParam.put_qty
this.outForm.sys_qty = this.openParam.sys_qty
this.outForm.fact_qty = this.openParam.fact_qty
this.openType = this.openParam.openType
this.title = this.openParam.title
// 系统汇总误差率
const number1 = (parseFloat(this.openParam.put_qty) - parseFloat(this.openParam.formula_qty)) / parseFloat(this.openParam.formula_qty)
this.error_rate1 = (number1 * 100).toFixed(2)
// 实际称重误差率
const number2 = (parseFloat(this.openParam.fact_qty) - parseFloat(this.openParam.formula_qty)) / parseFloat(this.openParam.formula_qty)
this.error_rate2 = (number2 * 100).toFixed(2)
}
}
},
data() {
return {
outForm: { formula_qty: null, sys_qty: null, fact_qty: null, put_qty: null },
error_rate1: null,
error_rate2: null,
fullscreenLoading: false,
openType: null,
confirm_type: null,
dialogVisible: false
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
close() {
this.$emit('update:dialogShow', false)
},
// 按系统确认
sysConfirm() {
this.confirm_type = '01'
if (this.openType === '0') {
// 调用投料确认
this.sendMaterConfirm()
} else if (this.openType === '1') {
// 调用物料确认
this.materConfirm()
} else if (this.openType === '2') {
// 调用配粉确认
this.flourConfirm()
}
},
// 按称重确认
weighConfirm() {
this.confirm_type = '02'
if (this.openType === '0') {
// 调用投料确认
this.sendMaterConfirm()
} else if (this.openType === '1') {
// 调用物料确认
this.materConfirm()
} else if (this.openType === '2') {
// 调用配粉确认
this.flourConfirm()
}
},
// 投料确认
sendMaterConfirm() {
const data = {
'form': this.outForm,
'confirm_type': this.confirm_type,
'error_rate1': this.error_rate1,
'error_rate2': this.error_rate2
}
this.fullscreenLoading = true
crudFlourwork.sendMaterConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.close()
this.$parent.$parent.refresh()
}).catch(() => {
this.fullscreenLoading = false
})
},
// 物料确认
materConfirm() {
const data = {
'form': this.outForm,
'confirm_type': this.confirm_type,
'error_rate1': this.error_rate1,
'error_rate2': this.error_rate2
}
this.fullscreenLoading = true
crudFlourwork.materConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.close()
this.$parent.$parent.refresh()
}).catch(() => {
this.fullscreenLoading = false
})
},
// 配粉确认
flourConfirm() {
const data = {
'form': this.outForm,
'confirm_type': this.confirm_type,
'error_rate1': this.error_rate1,
'error_rate2': this.error_rate2
}
this.fullscreenLoading = true
crudFlourwork.flourConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.dialogVisible = false
this.$parent.$parent.close()
// this.close()
this.$parent.$parent.$parent.crud.toQuery()
}).catch(() => {
this.fullscreenLoading = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -1,109 +0,0 @@
<template>
<el-dialog
title="出库确认"
append-to-body
width="500px"
v-loading.fullscreen.lock="fullscreenLoading"
:visible.sync="dialogVisible"
:before-close="handleClose"
destroy-on-close
@close="close"
>
<el-form ref="form" :model="outForm" size="mini" label-width="90px">
<el-row>
<el-col :span="24">
<el-form-item label="需出重量kg:">
<el-input v-model="outForm.needout_qty" :disabled="true" style="width: 350px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="实际称重kg:">
<el-input v-model="outForm.outfit_qty" style="width: 120px;" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="误差率%:">
<el-input v-model="error_rate" style="width: 120px;" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="info" @click="close">取消</el-button>
<el-button type="primary" @click="outConfirm">强制确认</el-button>
</div>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudFlourwork from '@/api/wms/pf/flourwork'
export default {
name: 'SunShowDialog',
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
const number = (parseFloat(this.openParam.outfit_qty) - parseFloat(this.openParam.needout_qty)) / parseFloat(this.openParam.needout_qty)
this.error_rate = (number * 100).toFixed(2)
this.outForm = this.openParam
}
}
},
data() {
return {
outForm: {},
fullscreenLoading: false,
error_rate: null,
dialogVisible: false
}
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
close() {
this.$emit('update:dialogShow', false)
},
outConfirm() {
const data = {
'form': this.outForm,
'error_rate': this.error_rate
}
this.fullscreenLoading = true
crudFlourwork.outConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('出库成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.close()
this.$parent.$parent.refresh()
}).catch(() => {
this.fullscreenLoading = false
})
}
}
}
</script>
<style scoped>
</style>

View File

@@ -188,16 +188,6 @@
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="outConfirm"
>
出库确认
</el-button>-->
<el-button
slot="left"
class="filter-item"

View File

@@ -1,575 +0,0 @@
<template>
<el-dialog
title="配粉作业"
append-to-body
fullscreen
:before-close="closeView"
v-loading.fullscreen.lock="fullscreenLoading"
:visible.sync="dialogVisible"
@open="openView"
>
<el-form ref="form" :cell-style="cellStyleMst" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="指令卡">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.workordercard_id" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="产品编码">
<el-input v-model="form.material_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="批次">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.pcsn" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="配粉槽">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.storagevehicle_code" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="重量">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.masterbucket_qty" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="明细数">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="tableDtl.length" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="已配重量" class="successOrError" :class="{success:isSuccess,error:!isSuccess}">
<el-input v-model="form.put_qty" size="mini" disabled style="width: 210px;" />
</el-form-item>
<el-form-item label="称重重量">
<el-input v-model="form.fact_qty" size="mini" disabled style="width: 210px;" />
</el-form-item>
<el-form-item label="配粉工位">
<el-input v-model="form.device_code" size="mini" disabled style="width: 210px" />
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span">配粉明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="right"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="calledMater"
>
叫料
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="refresh"
>
刷新
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="startWork"
>
开始作业
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="materConfirm"
>
物料确认
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="flourConfirm"
>
配粉确认
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
:cell-style="cellStyleDtl"
max-height="300"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="status" label="状态" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
<el-table-column show-overflow-tooltip prop="formula_qty" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="put_qty" label="已投料重量" align="center" />
<el-table-column show-overflow-tooltip prop="not_put" label="未配重量" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
<el-table-column show-overflow-tooltip prop="fact_qty" label="实际称重" align="center" />
<el-table-column show-overflow-tooltip prop="confirm_qty" label="确认重量" align="center" />
<el-table-column show-overflow-tooltip prop="dtlconfirm_type" label="物料确认" align="center" />
<el-table-column show-overflow-tooltip prop="quality_scode" label="品质类型" align="center" :formatter="formatQua"/>
<el-table-column show-overflow-tooltip prop="ivt_level" label="库存等级" align="center" :formatter="formatIvt" />
<el-table-column show-overflow-tooltip prop="is_active" label="是否可用" align="center" />
<el-table-column show-overflow-tooltip prop="is_need_move" label="是否需移库" align="center" />
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="outConfirm"
>
出库确认
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="sendMaterConfirm"
>
投料确认
</el-button>
<el-button
slot="left"
class="filter-item"
type="danger"
icon="el-icon-delete"
size="mini"
@click="delDtlTask"
>
删除桶
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="tabledis"
style="width: 100%;"
max-height="300"
:cell-style="cellStyleJob"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column show-overflow-tooltip prop="status" label="状态" align="center" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
<el-table-column show-overflow-tooltip prop="jobstoragevehicle_code" label="托盘号" align="center" />
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" align="center" />
<el-table-column show-overflow-tooltip prop="needout_qty" label="需出重量" align="center" />
<el-table-column show-overflow-tooltip prop="out_type" label="出库方式" align="center" />
<el-table-column show-overflow-tooltip prop="outfit_qty" label="出库称重" align="center" />
<el-table-column show-overflow-tooltip prop="putfit_qty" label="投料称重" align="center" />
<el-table-column show-overflow-tooltip prop="outconfirm_type" label="出库确认" align="center" />
<el-table-column show-overflow-tooltip prop="putconfirm_type" label="投料确认" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" align="center" />
<el-table-column show-overflow-tooltip prop="quality_scode" label="品质类型" align="center" :formatter="formatQua"/>
<el-table-column show-overflow-tooltip prop="ivt_level" label="库存等级" align="center" :formatter="formatIvt"/>
<el-table-column show-overflow-tooltip prop="is_active" label="是否可用" align="center" />
<el-table-column show-overflow-tooltip prop="create_name" label="创建人" align="center" />
<el-table-column show-overflow-tooltip prop="create_time" label="创建时间" align="center" />
<el-table-column show-overflow-tooltip prop="out_name" label="出库人" align="center" />
<el-table-column show-overflow-tooltip prop="out_time" label="出库时间" align="center" />
<el-table-column show-overflow-tooltip prop="put_name" label="投料人" align="center" />
<el-table-column show-overflow-tooltip prop="put_time" label="投料时间" align="center" />
</el-table>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button type="info" @click="closeView"> </el-button>
</span>
<OutConfirmDialog :dialog-show.sync="openOutConfirmDialog" :open-param="openParam"/>
<OtherConfirmDialog :dialog-show.sync="openOtherConfirmDialog" :open-param="openParam" />
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudFlourwork from '@/api/wms/pf/flourwork'
import OutConfirmDialog from '@/views/wms/pf/flourwork/OutConfirmDialog'
import OtherConfirmDialog from '@/views/wms/pf/flourwork/OtherConfirmDialog'
export default {
name: 'AddDialog',
components: { OutConfirmDialog, OtherConfirmDialog },
dicts: ['ST_QUALITY_SCODE', 'ST_IVT_LEVEL'],
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
data() {
return {
isSuccess: true,
path: 'ws://localhost:8010/webSocket/10',
webSocketResult: {},
fullscreenLoading: false,
form: {},
tableDtl: [],
tabledis: [],
dtlJson: null,
disJson: null,
openType: null, // 0投料确认 1物料确认 2配粉确认
dialogVisible: false,
openOutConfirmDialog: false,
openOtherConfirmDialog: false
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
this.form = this.openParam
}
}
},
mounted() {
this.init()
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
closeView() {
this.$emit('update:dialogShow', false)
this.dtlJson = null
this.disJson = null
},
openView() {
crudFlourwork.getDtl({ 'formula_id': this.openParam.formula_id }).then(res => {
this.tableDtl = res
this.tabledis = []
})
},
formatQua(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
formatIvt(row, column) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
handleDtlCurrentChange(current) {
this.dtlJson = current
crudFlourwork.getDis({ 'formuladtl_id': current.formuladtl_id }).then(res => {
this.tabledis = res
})
},
refresh() {
this.openView()
this.crud.notify('刷新成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.tabledis = []
},
handleDisCurrentChange(current) {
this.disJson = current
},
calledMater() {
if (this.dtlJson === null) {
return this.crud.notify('请选择明细', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = {
'dtlData': this.dtlJson,
'device_id': this.form.device_id
}
if (this.dtlJson.status === '完成') {
return this.crud.notify('选择物料必须为未完成配方明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.dtlJson.is_need_move !== '是') {
return this.crud.notify('选择物料必须为需要移库', CRUD.NOTIFICATION_TYPE.INFO)
}
this.fullscreenLoading = true
crudFlourwork.calledMater(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('叫料成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
startWork() {
if (this.dtlJson === null) {
return this.crud.notify('请选择明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.dtlJson.status !== '生成') {
return this.crud.notify('选择配方明细物料状态必须为生成状态', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = this.dtlJson
this.fullscreenLoading = true
crudFlourwork.startWork(data).then(res => {
this.fullscreenLoading = false
this.openView()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
// 出库确认按钮
outConfirm() {
if (this.disJson === null) {
return this.crud.notify('请选择作业明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.disJson.status !== '扫桶确认') {
return this.crud.notify('明细作业状态必须是扫桶确认', CRUD.NOTIFICATION_TYPE.INFO)
}
this.openParam = this.disJson
this.openOutConfirmDialog = true
},
// 投料确认按钮
sendMaterConfirm() {
if (this.disJson === null) {
return this.crud.notify('请选择作业明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.disJson.status !== '出库确认') {
return this.crud.notify('明细作业状态必须是出库确认', CRUD.NOTIFICATION_TYPE.INFO)
}
this.openType = '0'
this.openParam = {
'json': this.disJson,
'openType': this.openType,
'title': '投料确认',
'formula_qty': this.disJson.needout_qty,
'sys_qty': this.disJson.needout_qty,
'fact_qty': this.disJson.outfit_qty
}
this.openOtherConfirmDialog = true
},
// 物料确认按钮
materConfirm() {
if (this.dtlJson.status !== '生产中') {
return this.crud.notify('明细状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = this.tabledis
for (let i = 0; i < data.length; i++) {
if (data[i].status !== '投料完成') {
return this.crud.notify('明细作业状态不全部为投料完成', CRUD.NOTIFICATION_TYPE.INFO)
}
}
this.openType = '1'
this.openParam = {
'json': this.dtlJson,
'openType': this.openType,
'title': '物料确认',
'formula_qty': this.dtlJson.formula_qty,
'put_qty': this.dtlJson.put_qty,
'sys_qty': this.dtlJson.formula_qty,
'fact_qty': this.dtlJson.fact_qty
}
this.openOtherConfirmDialog = true
},
// 配粉确认按钮
flourConfirm() {
if (this.form.status !== '生产中') {
return this.crud.notify('主表状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = this.tableDtl
for (let i = 0; i < data.length; i++) {
if (data[i].status !== '完成') {
return this.crud.notify('明细状态不全部为投料完成', CRUD.NOTIFICATION_TYPE.INFO)
}
}
this.openType = '2'
this.openParam = {
'json': this.form,
'openType': this.openType,
'title': '配粉确认',
'formula_qty': this.form.masterbucket_qty,
'put_qty': this.form.put_qty,
'sys_qty': this.form.masterbucket_qty,
'fact_qty': this.form.fact_qty
}
this.openOtherConfirmDialog = true
},
delDtlTask() {
if (this.disJson === null) {
return this.crud.notify('请选择作业明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.disJson.status !== '扫桶确认') {
return this.crud.notify('已出库,不能删除!', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = this.disJson
this.fullscreenLoading = true
crudFlourwork.delDtlTask(data).then(res => {
this.fullscreenLoading = false
this.refresh()
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
// websocket 监控
init: function() {
if (typeof (WebSocket) === 'undefined') {
alert('您的浏览器不支持socket')
} else {
// 实例化socket
this.socket = new WebSocket(this.path)
// 监听socket连接
this.socket.onopen = this.open
// 监听socket错误信息
this.socket.onerror = this.error
// 监听socket消息
this.socket.onmessage = this.getMessage
}
},
open: function() {
console.log('socket连接成功')
},
error: function() {
console.log('连接错误')
},
getMessage: function(msg) {
this.webSocketResult = JSON.parse(msg.data).msg
},
send: function() {
// eslint-disable-next-line no-undef
this.socket.send(params)
},
close: function() {
console.log('socket已经关闭')
},
// 明细作业样式监控
cellStyleJob({ row, column, rowIndex, columnIndex }) {
const formuladtljob_id = this.webSocketResult.formuladtljob_id
const show_job_outfit_qty = this.webSocketResult.show_job_outfit_qty
const show_job_putfit_qty = this.webSocketResult.show_job_putfit_qty
if (row.formuladtljob_id === formuladtljob_id) {
if (column.property === 'outfit_qty') {
if (show_job_outfit_qty === true) {
return 'background: yellow'
}
}
if (column.property === 'putfit_qty') {
if (show_job_putfit_qty === true) {
return 'background: yellow'
}
}
}
},
// 明细样式监控
cellStyleDtl({ row, column, rowIndex, columnIndex }) {
const formuladtl_id = this.webSocketResult.formuladtl_id
const show_dtl_put_qty = this.webSocketResult.show_dtl_put_qty
const show_dtl_fact_qty = this.webSocketResult.show_dtl_fact_qty
if (row.formuladtl_id === formuladtl_id) {
if (column.property === 'put_qty') {
if (show_dtl_put_qty === true) {
return 'background: yellow'
}
}
if (column.property === 'fact_qty') {
if (show_dtl_fact_qty === true) {
return 'background: yellow'
}
}
}
},
// 主表样式监控
cellStyleMst({ row, column, rowIndex, columnIndex }) {
const show_mst_put_qty = this.webSocketResult.show_mst_put_qty
const show_mst_fact_qty = this.webSocketResult.show_mst_fact_qty
debugger
if (column.property === 'put_qty') {
if (show_mst_put_qty === true) {
return 'background: yellow'
}
}
if (column.property === 'fact_qty') {
if (show_mst_fact_qty === true) {
return 'background: yellow'
}
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
.crud-opt3 .el-form-item__label{
background-color: yellow;
}
.successOrError {
& .success {
background-color:green;
}
& .error{
background-color:red;
}
}
</style>

View File

@@ -1,554 +0,0 @@
<template>
<el-dialog
title="配粉作业"
append-to-body
v-loading.fullscreen.lock="fullscreenLoading"
fullscreen
:before-close="closeView"
:visible.sync="dialogVisible"
@open="openView"
>
<el-form ref="form" :cell-style="cellStyleMst" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
<el-form-item label="指令卡">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.workordercard_id" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="产品编码">
<el-input v-model="form.material_code" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="批次">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.pcsn" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="配粉槽">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.storagevehicle_code" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="重量">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="form.masterbucket_qty" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="明细数">
<label slot="label">&nbsp;&nbsp;&nbsp;:</label>
<el-input v-model="tableDtl.length" size="mini" disabled style="width: 210px" />
</el-form-item>
<el-form-item label="已配重量">
<el-input v-model="form.put_qty" size="mini" disabled style="width: 210px;" />
</el-form-item>
<el-form-item label="称重重量">
<el-input v-model="form.fact_qty" size="mini" disabled style="width: 210px;" />
</el-form-item>
<el-form-item label="配粉工位">
<el-input v-model="form.device_code" size="mini" disabled style="width: 210px" />
</el-form-item>
</el-form>
<div class="crud-opts2">
<span class="role-span">配粉明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="right"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="autoCalledMater"
>
自动叫料
</el-button>
<el-button
slot="right"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="calledMater"
>
强制叫料
</el-button>
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="refresh"
>
刷新
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="startWork"
>
开始作业
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="materConfirm"
>
物料强制确认
</el-button>
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="flourConfirm"
>
配粉强制确认
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table"
:data="tableDtl"
style="width: 100%;"
max-height="300"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDtlCurrentChange"
>
<!-- <el-table-column type="index" label="序号" width="55" align="center" />-->
<el-table-column show-overflow-tooltip prop="seq_no" label="配粉序号" align="center" />
<el-table-column show-overflow-tooltip prop="status" label="状态" align="center" :formatter="statusName1" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次号" align="center" />
<el-table-column show-overflow-tooltip prop="formula_qty" label="重量" align="center" />
<el-table-column show-overflow-tooltip prop="put_qty" label="已投料重量" align="center" />
<el-table-column show-overflow-tooltip prop="not_put" label="未配重量" align="center" />
<el-table-column show-overflow-tooltip prop="qty_unit_name" label="重量单位" align="center" />
<el-table-column show-overflow-tooltip prop="fact_qty" label="实际称重" align="center" />
<el-table-column show-overflow-tooltip prop="confirm_qty" label="确认重量" align="center" />
<el-table-column show-overflow-tooltip prop="dtlconfirm_type" label="物料确认" align="center" />
<el-table-column show-overflow-tooltip prop="quality_scode" label="品质类型" align="center" :formatter="formatQua" />
<el-table-column show-overflow-tooltip prop="ivt_level" label="库存等级" align="center" :formatter="formatIvt" />
<el-table-column show-overflow-tooltip prop="is_active" label="是否可用" align="center" />
<el-table-column show-overflow-tooltip prop="is_need_move" label="是否需移库" align="center" :formatter="statusName3" />
</el-table>
</el-card>
<div class="crud-opts2">
<span class="role-span">作业明细</span>
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<!-- <el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="outConfirm"
>
出库确认
</el-button>-->
<el-button
slot="left"
class="filter-item"
type="warning"
icon="el-icon-check"
size="mini"
@click="sendMaterConfirm"
>
投料强制确认
</el-button>
<el-button
slot="left"
class="filter-item"
type="danger"
icon="el-icon-delete"
size="mini"
@click="delDtlTask"
>
删除桶
</el-button>
</span>
</div>
<el-card class="box-card" shadow="never" :body-style="{padding:'0'}">
<!--表格渲染-->
<el-table
ref="table2"
:data="tabledis"
style="width: 100%;"
max-height="300"
border
:highlight-current-row="true"
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
@current-change="handleDisCurrentChange"
>
<!-- <el-table-column type="index" label="序号" width="55" align="center" />-->
<el-table-column show-overflow-tooltip prop="jobseq_no" label="作业序号" align="center" />
<el-table-column show-overflow-tooltip prop="status" label="状态" align="center" :formatter="statusName2" />
<el-table-column show-overflow-tooltip prop="struct_code" label="货位" align="center" />
<el-table-column show-overflow-tooltip prop="jobstoragevehicle_code" label="托盘号" align="center" />
<el-table-column show-overflow-tooltip prop="bucketunique" label="桶号" align="center" width="150px" />
<el-table-column show-overflow-tooltip prop="storage_qty" label="桶重量" align="center" />
<el-table-column show-overflow-tooltip prop="needout_qty" label="需出重量" align="center" />
<el-table-column show-overflow-tooltip prop="out_type" label="出库方式" align="center" />
<!-- <el-table-column show-overflow-tooltip prop="outfit_qty" label="出库称重" align="center" />-->
<el-table-column show-overflow-tooltip prop="putfit_qty" label="投料称重" align="center" />
<!-- <el-table-column show-overflow-tooltip prop="outconfirm_type" label="出库确认" align="center" />-->
<el-table-column show-overflow-tooltip prop="putconfirm_type" label="投料确认" align="center" />
<el-table-column show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
<el-table-column show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
<el-table-column show-overflow-tooltip prop="pcsn" label="批次" align="center" />
<el-table-column show-overflow-tooltip prop="quality_scode" label="品质类型" align="center" :formatter="formatQua" />
<el-table-column show-overflow-tooltip prop="ivt_level" label="库存等级" align="center" :formatter="formatIvt" />
<el-table-column show-overflow-tooltip prop="is_active" label="是否可用" align="center" />
<el-table-column show-overflow-tooltip prop="create_name" label="创建人" align="center" />
<el-table-column show-overflow-tooltip prop="create_time" label="创建时间" align="center" />
<el-table-column show-overflow-tooltip prop="out_name" label="出库人" align="center" />
<el-table-column show-overflow-tooltip prop="out_time" label="出库时间" align="center" />
<el-table-column show-overflow-tooltip prop="put_name" label="投料人" align="center" />
<el-table-column show-overflow-tooltip prop="put_time" label="投料时间" align="center" />
</el-table>
</el-card>
<span slot="footer" class="dialog-footer">
<el-button type="info" @click="closeView"> </el-button>
</span>
</el-dialog>
</template>
<script>
import CRUD, { crud } from '@crud/crud'
import crudFlourwork from '@/api/wms/pf/flourwork'
export default {
name: 'AddDialog',
components: { },
dicts: ['ST_QUALITY_SCODE', 'ST_IVT_LEVEL'],
mixins: [crud()],
props: {
dialogShow: {
type: Boolean,
default: false
},
openParam: {
type: Object
}
},
data() {
return {
form: {},
tableDtl: [],
tabledis: [],
fullscreenLoading: false,
dtlJson: null,
disJson: null,
dialogVisible: false
}
},
watch: {
dialogShow: {
handler(newValue, oldValue) {
this.dialogVisible = newValue
this.form = this.openParam
}
}
},
mounted() {
// 定时器
const timer = setInterval(() => {
this.crud.toQueryNoLoading()
}, 1000)
// 销毁定时器
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
})
},
methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {
})
},
closeView() {
this.$emit('update:dialogShow', false)
this.dtlJson = null
this.disJson = null
},
openView() {
crudFlourwork.getDtl({ 'formula_id': this.openParam.formula_id }).then(res => {
this.tableDtl = res
this.tabledis = []
})
crudFlourwork.getMst({ 'formula_id': this.openParam.formula_id }).then(res => {
this.form = res
})
},
formatQua(row, column) {
return this.dict.label.ST_QUALITY_SCODE[row.quality_scode]
},
formatIvt(row, column) {
return this.dict.label.ST_IVT_LEVEL[row.ivt_level]
},
handleDtlCurrentChange(current) {
this.dtlJson = current
crudFlourwork.getDis({ 'formuladtl_id': current.formuladtl_id }).then(res => {
this.tabledis = res
})
},
refresh() {
this.openView()
this.crud.notify('刷新成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.tabledis = []
},
handleDisCurrentChange(current) {
this.disJson = current
},
autoCalledMater() {
const data = {
'device_id': this.form.device_id,
'formula_id': this.form.formula_id
}
if (this.form.status !== '30') {
return this.crud.notify('配方状态必须为生产中', CRUD.NOTIFICATION_TYPE.INFO)
}
this.fullscreenLoading = true
crudFlourwork.autoCalledMater(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('叫料成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
calledMater() {
if (this.dtlJson === null) {
return this.crud.notify('请选择明细', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = {
'dtlData': this.dtlJson,
'device_id': this.form.device_id
}
if (this.form.status !== '30') {
return this.crud.notify('配方状态必须为生产中', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.dtlJson.status === '99') {
return this.crud.notify('选择物料必须为未完成配方明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.dtlJson.is_need_move !== '1') {
return this.crud.notify('选择物料必须为需要移库', CRUD.NOTIFICATION_TYPE.INFO)
}
this.fullscreenLoading = true
crudFlourwork.calledMater(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('叫料成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
startWork() {
const arr = this.tableDtl
let num = 0
for (let i = 0; i < arr.length; i++) {
const data = arr[i]
if (data.status === '99') {
num = num + 1
continue
} else if (data.status === '20') {
return this.crud.notify('当前正在作业', CRUD.NOTIFICATION_TYPE.INFO)
}
if (arr[i].status === '10') {
crudFlourwork.startWork(data).then(res => {
this.openView()
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
})
}
if (arr[i].status === '10') {
break
}
}
if (num === arr.length) {
return this.crud.notify('没有需要作业的明细', CRUD.NOTIFICATION_TYPE.INFO)
}
},
// 出库确认按钮
outConfirm() {
if (this.disJson === null) {
return this.crud.notify('请选择作业明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.disJson.status !== '10') {
return this.crud.notify('明细作业状态必须是生成', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = {
'form': this.disJson
}
this.fullscreenLoading = true
crudFlourwork.outConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('出库成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
// 投料确认按钮
sendMaterConfirm() {
if (this.disJson === null) {
return this.crud.notify('请选择作业明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.disJson.status !== '10') {
return this.crud.notify('明细作业状态必须是生成', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = {
'form': this.disJson
}
this.fullscreenLoading = true
crudFlourwork.sendMaterConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.refresh()
}).catch(() => {
this.fullscreenLoading = false
})
},
// 物料确认按钮
materConfirm() {
if (this.dtlJson.status !== '20') {
return this.crud.notify('明细状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
}
const data1 = this.tabledis
for (let i = 0; i < data1.length; i++) {
if (data1[i].status !== '99') {
return this.crud.notify('明细作业状态不全部为投料完成', CRUD.NOTIFICATION_TYPE.INFO)
}
}
const data = {
'form': this.dtlJson
}
this.fullscreenLoading = true
crudFlourwork.materConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.refresh()
}).catch(() => {
this.fullscreenLoading = false
})
},
// 配粉确认按钮
flourConfirm() {
if (this.form.status !== '30') {
return this.crud.notify('主表状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
}
const data1 = this.tableDtl
for (let i = 0; i < data1.length; i++) {
if (data1[i].status !== '99') {
return this.crud.notify('明细状态不全部为投料完成', CRUD.NOTIFICATION_TYPE.INFO)
}
}
const data = {
'form': this.form
}
this.fullscreenLoading = true
crudFlourwork.flourConfirm(data).then(res => {
this.fullscreenLoading = false
this.crud.notify('确认成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.refresh()
}).catch(() => {
this.fullscreenLoading = false
})
},
delDtlTask() {
if (this.disJson === null) {
return this.crud.notify('请选择作业明细', CRUD.NOTIFICATION_TYPE.INFO)
}
if (this.disJson.status !== '10') {
return this.crud.notify('已出库,不能删除!', CRUD.NOTIFICATION_TYPE.INFO)
}
const data = this.disJson
this.fullscreenLoading = true
crudFlourwork.delDtlTask(data).then(res => {
this.fullscreenLoading = false
this.refresh()
this.crud.notify('删除成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
}).catch(() => {
this.fullscreenLoading = false
})
},
statusName1(row, column) {
if (row.status === '10') {
return '生成'
} else if (row.status === '20') {
return '生产中'
} else if (row.status === '99') {
return '完成'
}
},
statusName2(row, column) {
if (row.status === '10') {
return '生成'
} else if (row.status === '20') {
return '出库确认'
} else if (row.status === '99') {
return '投料完成'
}
},
statusName3(row, column) {
if (row.is_need_move === '1') {
return '是'
} else if (row.is_need_move === '0') {
return '否'
}
}
}
}
</script>
<style>
.crud-opts2 {
padding: 0;
display: -webkit-flex;
display: flex;
align-items: center;
}
.crud-opts2 .el-dialog__title2 {
line-height: 24px;
font-size:20px;
color:#303133;
}
.crud-opts2 .role-span {
padding: 10px 0px 10px 0px;
}
.crud-opts2 .crud-opts-form {
padding: 10px 0px 0px 20px;
}
.input-with-select {
background-color: #fff;
}
.crud-opt3 .el-form-item__label{
background-color: yellow;
}
</style>