This commit is contained in:
zty 2025-01-17 17:32:45 +08:00
commit a97abd2f2c
8 changed files with 232 additions and 67 deletions

View File

@ -44,12 +44,13 @@
</el-table-column> </el-table-column>
<el-table-column label="物料名称" prop="material_name"> <el-table-column label="物料名称" prop="material_name">
</el-table-column> </el-table-column>
<!-- <el-table-column label="规格型号"> <el-table-column label="类型" min-width="100" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
{{ scope.row.specification }} {{ scope.row.model }} <el-tag :type="getType(scope.row.state)">{{ state_[scope.row.state] }}</el-tag>
<el-tag type="info" v-if="scope.row.defect_name">{{ scope.row.defect_name }}</el-tag>
</template> </template>
</el-table-column> --> </el-table-column>
<el-table-column label="仓库" prop="warehouse_name"> <el-table-column label="仓库" width="80" prop="warehouse_name">
</el-table-column> </el-table-column>
<el-table-column label="物料存量" prop="count"> <el-table-column label="物料存量" prop="count">
</el-table-column> </el-table-column>
@ -92,12 +93,26 @@ export default {
materialsVisible:false, materialsVisible:false,
apiObjPrint:this.$API.cm.labelmat.fromMb, apiObjPrint:this.$API.cm.labelmat.fromMb,
wmId:'', wmId:'',
state_:{
10:'合格',
20:'不合格',
30:'返修',
},
}; };
}, },
mounted() { mounted() {
this.getWarehouse(); this.getWarehouse();
}, },
methods: { methods: {
getType(type){
if(type==10){
return 'success'
}else if(type==20){
return 'danger'
}else if(type==30){
return 'warning'
}
},
getWarehouse() { getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => { this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
this.warehouseOptions = res; this.warehouseOptions = res;

View File

@ -113,6 +113,16 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24">
<el-form-item label="更改批次">
<el-switch v-model="change_batch"></el-switch>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号">
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item label="处理备注"> <el-form-item label="处理备注">
<el-input v-model="form.note" placeholder="处理备注"></el-input> <el-input v-model="form.note" placeholder="处理备注"></el-input>
@ -182,7 +192,7 @@
v-model="listItem.count" v-model="listItem.count"
controls-position="right" controls-position="right"
:min="0" :min="0"
step="1" :step="1"
:max="listItem.count_cando" :max="listItem.count_cando"
:disabled="mode==='show'" :disabled="mode==='show'"
:step-strictly="true" :step-strictly="true"
@ -258,6 +268,7 @@ export default {
recive_user: null, recive_user: null,
recive_mgroup: null, recive_mgroup: null,
handoverb:[], handoverb:[],
new_batch:''
}, },
rules: { rules: {
batch: [ batch: [
@ -321,6 +332,7 @@ export default {
bwVisible:false, bwVisible:false,
scanVisible:false, scanVisible:false,
isSaveing: false, isSaveing: false,
change_batch:false,
setFiltersVisible: false, setFiltersVisible: false,
}; };
}, },
@ -364,7 +376,6 @@ export default {
}, },
showbw(index){ showbw(index){
this.bwIndex = index; this.bwIndex = index;
console.log('this.form.handoverb[index].handoverbw',this.form.handoverb[index].handoverbw);
this.bwVisible = true; this.bwVisible = true;
}, },
bwVisibleClose(){ bwVisibleClose(){
@ -390,6 +401,10 @@ export default {
} }
}) })
that.getCkUserList();// that.getCkUserList();//
}else if(that.type==30){
this.getUserList3();
}else{
this.getUserList2();
} }
}); });
}, },
@ -563,6 +578,9 @@ export default {
}else{ }else{
this.getUserList2(); this.getUserList2();
} }
if(data.new_batch!==''&&data.new_batch!==undefined&&data.new_batch!==null){
this.change_batch = true;
}
}, },
// //
setFilters(filters) { setFilters(filters) {
@ -592,20 +610,21 @@ export default {
//handoverb //handoverb
if(arr.length>0){ if(arr.length>0){
//wprwpr //wprwpr
if(arr[0].handoverbw&&arr[0].handoverbw.length>0){ if(that.form.handoverb[0].handoverbw&&that.form.handoverb[0].handoverbw.length>0){
let arr1 = []; let arr1 = [];
arr1 = arr[0].handoverbw.filter((item1) => { arr1 = that.form.handoverb[0].handoverbw.filter((item1) => {
item1.wpr = item1.id; return item1.wpr == res.id;
}) })
if(arr1.length>0){ if(arr1.length>0){
that.$message.error("该物料已存在"); that.$message.error("该物料已存在");
// console.log('0',that.form);
}else{ }else{
let obj1 = {}; let obj1 = {};
obj1.wpr = res.id; obj1.wpr = res.id;
obj1.number = res.number; obj1.number = res.number;
that.form.handoverb[indexs].count+=1; that.form.handoverb[indexs].count+=1;
that.form.handoverb[indexs].handoverbw.push(obj1); that.form.handoverb[indexs].handoverbw.push(obj1);
console.log('1',that.form); // console.log('1',that.form);
} }
}else{ }else{
that.form.handoverb[indexs].handoverbw = []; that.form.handoverb[indexs].handoverbw = [];
@ -614,11 +633,10 @@ export default {
obj1.number = res.number; obj1.number = res.number;
that.form.handoverb[indexs].count=1; that.form.handoverb[indexs].count=1;
that.form.handoverb[indexs].handoverbw.push(obj1); that.form.handoverb[indexs].handoverbw.push(obj1);
console.log('2',that.form); // console.log('2',that.form);
} }
}else{//handoverb }else{//handoverb
that.materialOptions.forEach((item) => { that.materialOptions.forEach((item) => {
console.log('item.id',item.id);
if(item.id == res.wm){ if(item.id == res.wm){
let obj2 = {}; let obj2 = {};
obj2.wm = item.id; obj2.wm = item.id;
@ -631,7 +649,7 @@ export default {
obj3.number = res.number; obj3.number = res.number;
obj2.handoverbw.push(obj3); obj2.handoverbw.push(obj3);
that.form.handoverb.push(obj2); that.form.handoverb.push(obj2);
console.log('3',that.form); // console.log('3',that.form);
} }
}) })
} }
@ -653,7 +671,7 @@ export default {
obj.count_cando = item.count; obj.count_cando = item.count;
obj.count = item.count; obj.count = item.count;
that.form.handoverb.push(obj); that.form.handoverb.push(obj);
console.log('4',that.form); // console.log('4',that.form);
} }
}) })
} }

View File

@ -6,9 +6,9 @@
v-if="mgroupName=='清洗'" v-if="mgroupName=='清洗'"
>领料</el-button >领料</el-button
> >
<el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'" <!-- <el-button type="primary" @click="tomio('do_in')" v-auth="'mio.do'"
>入库</el-button >入库</el-button
> > -->
<el-button type="primary" v-auth="'handover.create'" @click="table_add(40)"> <el-button type="primary" v-auth="'handover.create'" @click="table_add(40)">
报废</el-button> 报废</el-button>
</div> </div>
@ -112,7 +112,7 @@
> >
<template #default="scope"> <template #default="scope">
<el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link> <el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
<el-link :underline="false" @click="tableCheckList(scope.row)" type="primary">检验记录</el-link> <el-link :underline="false" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20" @click="tableCheckList(scope.row)" type="primary">检验记录</el-link>
<el-link <el-link
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20" v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
:underline="false" :underline="false"
@ -173,14 +173,12 @@
</template> </template>
<template #default> <template #default>
<scTable ref="wprTable" :apiObj="wprApiObj" :params="wprParams"> <scTable ref="wprTable" :apiObj="wprApiObj" :params="wprParams">
<!-- <el-table-column label="产品名称" prop="material_name"></el-table-column> -->
<el-table-column label="产品编号" prop="number"></el-table-column> <el-table-column label="产品编号" prop="number"></el-table-column>
<el-table-column label="缺陷项"> <el-table-column label="缺陷项">
<template #default="scope"> <template #default="scope">
<span v-for="item in scope.row.wprdefect" :key="item"> <span v-for="item in scope.row.wprdefect" :key="item.id">
<el-tag <el-tag
v-if="item.is_main" type="warning"
type="danger"
>{{ item.defect_name }}</el-tag> >{{ item.defect_name }}</el-tag>
</span> </span>
</template> </template>
@ -193,6 +191,7 @@
> >
<template #default="scope"> <template #default="scope">
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">物料标签</el-link> <el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">物料标签</el-link>
<!-- <el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">检验记录</el-link> -->
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>

View File

@ -152,22 +152,32 @@
hideDo hideDo
stripe stripe
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column <el-table-column
label="物料" label="物料"
prop="material" prop="material"
show-overflow-tooltip show-overflow-tooltip
> >
<template #default="scope" <template #default="scope"
>{{ scope.row.material_name }} >{{ scope.row.material_name }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="批次号" prop="batch"> <el-table-column label="批次号" prop="batch">
</el-table-column> </el-table-column>
<el-table-column label="仓库" prop="warehouse_name"> <el-table-column label="仓库" prop="warehouse_name">
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count"> <el-table-column label="数量" prop="count">
</el-table-column> </el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="60"
>
<template #default="scope">
<el-link :underline="false" @click="itemdelete(scope.row)" type="warning">删除</el-link>
</template>
</el-table-column>
</scTable> </scTable>
</el-main> </el-main>
</el-container> </el-container>
@ -482,6 +492,13 @@ export default {
that.visible = false; that.visible = false;
}); });
}, },
itemdelete(row){
let that = this;
that.$API.inm.mioitem.delete.req(row.id).then((res) => {
that.$message.success("删除成功");
that.$refs.tables.refresh();
});
},
submitOut() {}, submitOut() {},
// //
handlePrint(){ handlePrint(){

View File

@ -12,7 +12,7 @@
:rules="rules" :rules="rules"
label-width="120px" label-width="120px"
> >
<el-form-item label="物料" v-if="cate == 'do_out'"> <el-form-item label="物料" v-if="cate == 'do_out'" prop="material">
<el-select <el-select
v-model="form.material" v-model="form.material"
value-key="id" value-key="id"
@ -40,7 +40,7 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="物料批次" v-else> <el-form-item label="物料批次" v-else prop="batch">
<el-select <el-select
v-model="form.batch" v-model="form.batch"
filterable filterable
@ -91,7 +91,7 @@
</el-select> </el-select>
<scan-dialog ref="scanDialog" @closed="scanClose"> </scan-dialog> <scan-dialog ref="scanDialog" @closed="scanClose"> </scan-dialog>
</el-form-item> </el-form-item>
<el-form-item label="仓库"> <el-form-item label="仓库" prop="warehouse">
<el-select <el-select
v-model="form.warehouse" v-model="form.warehouse"
clearable clearable
@ -108,7 +108,7 @@
<el-form-item label="数量"> <el-form-item label="数量">
<el-input-number <el-input-number
v-model="form.count" v-model="form.count"
:min="0" :min="1"
:precision="0" :precision="0"
style="width: 100%" style="width: 100%"
/> />
@ -144,9 +144,13 @@ export default {
do_out: "生产领料", do_out: "生产领料",
do_in: "生产入库", do_in: "生产入库",
}, },
form: {}, form: {
count:1
},
rules: { rules: {
material: [{required: true,message: "请选择物料",trigger: "blur",},], material: [{required: true,message: "请选择物料",trigger: "blur"}],
batch: [{required: true,message: "请选择物料批次",trigger: "blur"}],
warehouse: [{required: true,message: "请选择仓库",trigger: "blur"}],
}, },
visible: false, visible: false,
isSaveing: false, isSaveing: false,
@ -158,6 +162,7 @@ export default {
selectBatchDisable: false, selectBatchDisable: false,
selectMaterial: null, selectMaterial: null,
selectBatch: null, selectBatch: null,
mioitemlist:[],
wbatchOptions: [],// wbatchOptions: [],//
}; };
}, },
@ -168,6 +173,7 @@ export default {
this.inputBatchDisable = true; this.inputBatchDisable = true;
this.getMaterialOptions(); this.getMaterialOptions();
this.getBatchOptions(); this.getBatchOptions();
this.getList();
}else{//---- }else{//----
this.getMgroupWmaterial(); this.getMgroupWmaterial();
} }
@ -180,6 +186,14 @@ export default {
this.warehouseOptions = res; this.warehouseOptions = res;
}); });
}, },
getList(){
let that = this;
that.$API.inm.mioitem.list.req({mio:that.mioId,page:0}).then(res=>{
console.log('mioitemlist',res);
that.mioitemlist = res;
})
},
// //
getMaterialOptions() { getMaterialOptions() {
let that = this; let that = this;
@ -240,9 +254,21 @@ export default {
} }
}, },
selectBatchChange(item) { selectBatchChange(item) {
this.form.batch = item.batch; let that = this;
this.form.mb = item.id; if(item&&item.batch){
this.form.warehouse = item.warehouse; let arr = this.mioitemlist.filter((mioitem) => {
return mioitem.batch == item.batch;
});
console.log('arr',arr);
if(arr.length > 0){
this.$message.error('该批次已存在');
that.selectBatchClear();
}else{
this.form.batch = item.batch;
this.form.mb = item.id;
this.form.warehouse = item.warehouse;
}
}
}, },
// //
selectwmChange(val){ selectwmChange(val){
@ -254,6 +280,7 @@ export default {
}) })
}, },
selectBatchClear() { selectBatchClear() {
this.selectBatch = "";
this.form.batch = ""; this.form.batch = "";
this.form.mb = ""; this.form.mb = "";
this.form.warehouse = ""; this.form.warehouse = "";
@ -266,24 +293,25 @@ export default {
}, },
// //
submit() { submit() {
this.$refs.dialogForm.validate(async (valid) => { let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
this.isSaveing = true; that.isSaveing = true;
this.form.mio = this.mioId; that.form.mio = that.mioId;
try { try {
var res; var res;
if (this.mode == "add") { if (that.mode == "add") {
res = await this.$API.inm.mioitem.create.req(this.form); res = await that.$API.inm.mioitem.create.req(that.form);
} else if (this.mode == "edit") { } else if (that.mode == "edit") {
res = await this.$API.inm.mioitem.update.req(this.form.id,this.form); res = await that.$API.inm.mioitem.update.req(that.form.id,that.form);
} }
this.isSaveing = false; that.isSaveing = false;
this.$emit("success"); that.$emit("success");
this.visible = false; that.visible = false;
this.$message.success("操作成功"); that.$message.success("操作成功");
} catch (err) { } catch (err) {
// //
this.isSaveing = false; that.isSaveing = false;
return err; return err;
} }
} }

View File

@ -367,6 +367,7 @@
v-if="dialog.edit" v-if="dialog.edit"
ref="editDialog" ref="editDialog"
:dept="deptId" :dept="deptId"
:process="process"
:mgroupName= "mlogItem.mgroup_name" :mgroupName= "mlogItem.mgroup_name"
@success="handleEditSuccess" @success="handleEditSuccess"
@closed="dialog.edit = false" @closed="dialog.edit = false"
@ -390,6 +391,10 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
process:{
type: String,
default: "",
}
}, },
components: { components: {
editDialog, editDialog,

View File

@ -119,6 +119,61 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-for="item in testitems" :key="item.id">
<el-form-item :label="item.name">
<el-input-number
v-if="item.field_type=='input-number'"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
<el-input-number
v-if="item.field_type=='input-int'"
v-model="item.value"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
<el-input
v-if="item.field_type=='input-text'"
v-model="item.value"
class="width-100"
>
</el-input>
<el-select
v-if="item.field_type=='select-text'"
v-model="item.value"
clearable
class="width-100"
>
<el-option
v-for="item0 in item.choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.field_type=='selects-text'"
v-model="item.value"
clearable
multiple
class="width-100"
>
<el-option
v-for="item1 in item.choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24"> <el-col :md="12" :sm="24">
<el-form-item <el-form-item
label="开始时间" label="开始时间"
@ -188,6 +243,7 @@ const defaultForm = {
note:'', note:'',
mgroup:'', mgroup:'',
mtask:'', mtask:'',
oinfo_json:{},
}; };
export default { export default {
@ -267,6 +323,7 @@ export default {
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
testitems:[],
routeOptions: [], routeOptions: [],
userOptions: [], userOptions: [],
mtaskOptions:[], mtaskOptions:[],
@ -280,12 +337,23 @@ export default {
this.getSupplier(); this.getSupplier();
this.getEquipment(); this.getEquipment();
this.getMtask(); this.getMtask();
this.gettestitem();
}, },
methods: { methods: {
disabledDateFn(time) { disabledDateFn(time) {
return time.getTime() > new Date().getTime(); return time.getTime() > new Date().getTime();
}, },
gettestitem(){
let that = this;
that.$API.qm.testitem.list.req({ process: that.process,type:20 }).then((res) => {
res.results.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.value = '';
that.testitems.push(obj);
})
});
},
// //
getUser() { getUser() {
this.$API.system.user.list.req({ depts: this.dept }).then((res) => { this.$API.system.user.list.req({ depts: this.dept }).then((res) => {
@ -337,12 +405,26 @@ export default {
}, },
// //
setData(data) { setData(data) {
let that = this;
console.log("data", data); console.log("data", data);
Object.assign(this.form, data); Object.assign(this.form, data);
if(data.test_file!==null){ if(data.test_file!==null){
this.form.test_file = data.test_file; this.form.test_file = data.test_file;
this.fileList = [{name:data.test_file,url:data.test_file}]; this.fileList = [{name:data.test_file,url:data.test_file}];
} }
if(data.oinfo_json!==null){
if(that.testitems.length>0){
that.testitems.forEach((item) => {
item.value = data.oinfo_json[item.id];
});
}else{
setTimeout(() => {
that.testitems.forEach((item) => {
item.value = data.oinfo_json[item.id];
});
},500)
}
}
this.getRoute(data.id); this.getRoute(data.id);
}, },
changeMtask(){ changeMtask(){
@ -365,6 +447,11 @@ export default {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.form.mgroup = that.mgroup; that.form.mgroup = that.mgroup;
let oinfo_json = {};
that.testitems.forEach((item) => {
oinfo_json[item.id] = item.value;
})
that.form.oinfo_json = oinfo_json;
if (that.mode === "add") { if (that.mode === "add") {
that.$API.wpm.mlog.init.req(that.form).then((res) => { that.$API.wpm.mlog.init.req(that.form).then((res) => {
that.isSaveing = false; that.isSaveing = false;

View File

@ -146,7 +146,7 @@
:process="processId" :process="processId"
:mgroup="mgroupId" :mgroup="mgroupId"
:dept="deptId" :dept="deptId"
:mgroup_name = "mgroup_name" :mgroupName = "mgroupName"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.save = false" @closed="dialog.save = false"
> >
@ -155,6 +155,7 @@
v-if="dialog.detail" v-if="dialog.detail"
ref="detailDialog" ref="detailDialog"
:mlogId="mlogId" :mlogId="mlogId"
:process="processId"
:mtask="mtask" :mtask="mtask"
@closed="detailClose" @closed="detailClose"
> >
@ -197,7 +198,6 @@ export default {
deptId: null, deptId: null,
processId: "", processId: "",
processCate: "", processCate: "",
mgroup_name:''
}; };
}, },
watch: { watch: {
@ -206,8 +206,7 @@ export default {
let that = this; let that = this;
that.params.mgroup = ""; that.params.mgroup = "";
that.apiObj = null; that.apiObj = null;
that.mgroup_name = newval; that.getMgroupInfo();
// that.getMgroupInfo();
}, },
}, },
}, },
@ -215,9 +214,7 @@ export default {
let that = this; let that = this;
that.params.mgroup =that.mgroupId; that.params.mgroup =that.mgroupId;
that.apiObj = that.$API.wpm.mlog.list; that.apiObj = that.$API.wpm.mlog.list;
// this.mgroup_name = this.mgroupName; this.getMgroupInfo();
// this.getMgroupInfo();
// console.log("mgroupName",this.mgroupName);
}, },
methods: { methods: {
getMgroupInfo(){ getMgroupInfo(){
@ -227,7 +224,6 @@ export default {
that.$message.error("获取工段错误"); that.$message.error("获取工段错误");
return; return;
} }
that.mgroupId = res.id;
that.deptId = res.belong_dept; that.deptId = res.belong_dept;
that.processId = res.process; that.processId = res.process;
that.processCate = res.process_cate; that.processCate = res.process_cate;