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

View File

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

View File

@ -6,9 +6,9 @@
v-if="mgroupName=='清洗'"
>领料</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 type="primary" v-auth="'handover.create'" @click="table_add(40)">
报废</el-button>
</div>
@ -112,7 +112,7 @@
>
<template #default="scope">
<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
v-if="scope.row.material_&&scope.row.material_.tracking==10&&scope.row.state!==20"
:underline="false"
@ -173,14 +173,12 @@
</template>
<template #default>
<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="缺陷项">
<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
v-if="item.is_main"
type="danger"
type="warning"
>{{ item.defect_name }}</el-tag>
</span>
</template>
@ -193,6 +191,7 @@
>
<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> -->
</template>
</el-table-column>
</scTable>

View File

@ -152,22 +152,32 @@
hideDo
stripe
>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
prop="material"
show-overflow-tooltip
>
<template #default="scope"
>{{ scope.row.material_name }}
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch">
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</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>
</el-main>
</el-container>
@ -482,6 +492,13 @@ export default {
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() {},
//
handlePrint(){

View File

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

View File

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

View File

@ -119,6 +119,61 @@
</el-select>
</el-form-item>
</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-form-item
label="开始时间"
@ -188,6 +243,7 @@ const defaultForm = {
note:'',
mgroup:'',
mtask:'',
oinfo_json:{},
};
export default {
@ -267,6 +323,7 @@ export default {
visible: false,
isSaveing: false,
options: [],
testitems:[],
routeOptions: [],
userOptions: [],
mtaskOptions:[],
@ -280,12 +337,23 @@ export default {
this.getSupplier();
this.getEquipment();
this.getMtask();
this.gettestitem();
},
methods: {
disabledDateFn(time) {
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() {
this.$API.system.user.list.req({ depts: this.dept }).then((res) => {
@ -337,12 +405,26 @@ export default {
},
//
setData(data) {
let that = this;
console.log("data", data);
Object.assign(this.form, data);
if(data.test_file!==null){
this.form.test_file = 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);
},
changeMtask(){
@ -365,6 +447,11 @@ export default {
if (valid) {
that.isSaveing = true;
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") {
that.$API.wpm.mlog.init.req(that.form).then((res) => {
that.isSaveing = false;

View File

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