This commit is contained in:
zty 2025-01-13 18:03:05 +08:00
commit 5f116bed5f
7 changed files with 222 additions and 215 deletions

View File

@ -240,6 +240,16 @@
<el-dialog v-model="printVisible" width="1200px"> <el-dialog v-model="printVisible" width="1200px">
<print :baseData="mioObj" :tableData="tableData" :type="mioObj.type" @closePrint="printVisible=false"/> <print :baseData="mioObj" :tableData="tableData" :type="mioObj.type" @closePrint="printVisible=false"/>
</el-dialog> </el-dialog>
<el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
<el-form label-width="100px">
<el-form-item label="打印机名称">
<el-input v-model="printer_name"></el-input>
</el-form-item>
</el-form>
<el-footer>
<el-button type="primary" @click="savePrinter">保存</el-button>
</el-footer>
</el-dialog>
</template> </template>
<script> <script>
import saveDialog from "./mioitem_form.vue"; import saveDialog from "./mioitem_form.vue";
@ -297,7 +307,9 @@ export default {
// cate: "", // cate: "",
objitem: {}, objitem: {},
mtype:10, mtype:10,
project_code:'' project_code:'',
setNameVisible:false,
printer_name:localStorage.getItem("printer_name")
}; };
}, },
mounted() { mounted() {
@ -311,6 +323,15 @@ export default {
this.getMio(); this.getMio();
}, },
methods: { methods: {
printSetting(){
this.setNameVisible = true;
},
savePrinter() {
let that = this;
localStorage.setItem("printer_name", that.printer_name);
that.setNameVisible = false;
that.$message.success("打印机设置成功,请重新进行打印操作。");
},
open() { open() {
this.visible = true; this.visible = true;
}, },
@ -423,25 +444,29 @@ export default {
// //
printMaterial(row){ printMaterial(row){
let that = this; let that = this;
that.apiObj.req({tid:row.id}).then((res) => { if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
let code = res.code_label; that.$API.cm.labelmat.fromWm.req({tid:row.id}).then((res) => {
let str = [ let code = res.code_label;
"SIZE 40 mm,70 mm", let str = [
"GAP 7 mm,7 mm", "SIZE 40 mm,70 mm",
"CLS", "GAP 7 mm,7 mm",
"REFERENCE 0,0", "CLS",
'QRCODE 30,400,H,5,A,0,"' +code +'"', "REFERENCE 0,0",
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name, 'QRCODE 30,400,H,5,A,0,"' +code +'"',
"WINTEXT 240,550,28,90,0,0,Simhei," + res.batch, "WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
"PRINT 1", "WINTEXT 240,550,28,90,0,0,Simhei," + res.batch,
]; "PRINT 1",
let obj = {}; ];
obj.printer_commands = str; let obj = {};
obj.printer_name = that.printer_name; obj.printer_commands = str;
that.$API.wpm.prints.req(obj).then((response) => { obj.printer_name = that.printer_name;
that.$message.success("打印成功"); that.$API.wpm.prints.req(obj).then((response) => {
}); that.$message.success("打印成功");
}) });
})
}else{
that.printSetting();
}
}, },
}, },
}; };

View File

@ -44,62 +44,12 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :md="12" :sm="24" v-if="form.type2==20"> <el-col :md="12" :sm="24">
<el-form-item label="检验数量">
<el-input-number
:max="batchCount"
controls-position="right"
v-model="form.count"
style="width: 100%"
precision="0"
@change="handleCountNotokChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type2==20">
<el-form-item label="合格数量">
<el-input v-model="form.count_ok" disabled></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type2==10">
<el-form-item label="抽检数量"> <el-form-item label="抽检数量">
<el-input-number <el-input-number
:max="batchCount" :max="batchCount"
controls-position="right" controls-position="right"
v-model="form.count_sampling" v-model="form.count"
style="width: 100%"
precision="0"
@change="handleCountNotokChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="form.type2==10">
<el-form-item label="抽检合格数">
<el-input-number
controls-position="right"
v-model="form.count_sampling_ok"
style="width: 100%"
disabled
precision="0"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="不合格数量">
<el-input-number
controls-position="right"
v-model="form.count_notok"
style="width: 100%"
precision="0"
@change="handleCountNotokChange"
></el-input-number>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="合格率">
<el-input-number
controls-position="right"
v-model="count_ok_rate"
style="width: 100%" style="width: 100%"
precision="0" precision="0"
></el-input-number> ></el-input-number>
@ -134,8 +84,19 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row>
<el-col :md="12" :sm="24" v-for="item in qct_defects" :key="item.id">
<el-form-item :label="item.name">
<el-input-number
:precision="0"
style="width: 100%;"
v-model="item.count"
placeholder="请输入数量"
></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
</el-main> </el-main>
<el-footer> <el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit" <el-button type="primary" :loading="isSaveing" @click="submit"
@ -172,16 +133,18 @@ export default {
type2:10, type2:10,
test_date: "", test_date: "",
batch: "", batch: "",
count: null, count: 0,
count_ok: 0, wm: "",
count_sampling_ok:'', test_user: "",
count_notok: 0, qct:"",
need_update_wm:true,
ftestworkdefect:[],
}, },
count_ok_rate:100, count_ok_rate:100,
rules: { rules: {
test_date: [{required: true,message: "请选择检验日期",trigger: "blur"}], test_date: [{required: true,message: "请选择检验日期",trigger: "blur"}],
batch: [{required: true,message: "请选择物料批次",trigger: "blur"}], batch: [{required: true,message: "请选择物料批次",trigger: "blur"}],
test_user: [{required: true,message: "请选择物料批次",trigger: "blur"}], test_user: [{required: true,message: "请选择检验人",trigger: "blur"}],
}, },
options: [], options: [],
userList : [], userList : [],
@ -200,19 +163,14 @@ export default {
}; };
}, },
mounted() { mounted() {
console.log('this.itemObj',this.itemObj); this.form.count =this.batchCount = this.itemObj.count;
this.form.count_sampling_ok =
this.form.count_sampling =
this.form.count_ok =
this.form.count =
this.batchCount =
this.itemObj.count;
this.form.batch = this.itemObj.batch; this.form.batch = this.itemObj.batch;
this.form.wm = this.itemObj.id; this.form.wm = this.itemObj.id;
this.form.supplier = this.itemObj.supplier; this.deptID = this.$TOOL.data.get('bx_deptID');
this.deptID = this.$TOOL.data.get('gx_deptID');
this.getUsers(); this.getUsers();
this.getdefects(); if(this.itemObj.material_.tracking==10){
this.getdefects();
}
}, },
methods: { methods: {
// //
@ -224,17 +182,11 @@ export default {
getUsers(){ getUsers(){
let that = this; let that = this;
let userList = []; let userList = [];
that.$API.system.user.list that.$API.system.user.list.req({ depts: that.deptID, page: 0 }).then((res2) => {
.req({ page: 0, posts__code__contains: "check" }) res2.forEach((item) => {
.then((res) => { userList.push(item);
userList = res; });
// that.$API.system.user.list.req({ depts: that.deptID, page: 0 }) that.userList = userList ;
// .then((res2) => {
// res2.forEach((item) => {
// userList.push(item);
// });
// that.userList = userList ;
// });
}); });
}, },
// //
@ -242,70 +194,55 @@ export default {
let that = this; let that = this;
that.$API.qm.qct.list.req({ page: 0, qctmat__material: that.itemObj.material }).then((res) => { that.$API.qm.qct.list.req({ page: 0, qctmat__material: that.itemObj.material }).then((res) => {
if(res.length>0){ if(res.length>0){
that.form.qct = res[0].id;
that.$API.qm.qct.item.req(res[0].id).then((res) => { that.$API.qm.qct.item.req(res[0].id).then((res) => {
that.qct_defects = res.qct_defects; let qct_defects= [];
res.qct_defects.forEach((item) => {
let obj = {};
obj.name = item.defect_name;
obj.defect = item.defect;
obj.count = 0;
qct_defects.push(obj);
})
that.qct_defects = qct_defects;
console.log('that.qct_defects',that.qct_defects);
}) })
} }
}); });
}, },
handleCountChange(type){
this.form.count_notok
this.handleCountNotokChange();
},
handleCountNotokChange(){ handleCountNotokChange(){
if(this.form.type2==10){// if(this.form.type2==10){//
this.form.count_sampling_ok = this.form.count_sampling - this.form.count_notok; this.form.count_ok = this.form.count;
this.count_ok_rate = ((this.form.count_sampling_ok/this.form.count_sampling)*100).toFixed(2);
}else if(this.form.type2==20){// }else if(this.form.type2==20){//
this.form.count_ok = this.form.count - this.form.count_notok; this.form.count_ok = this.form.count;
this.count_ok_rate = ((this.form.count_ok/this.form.count)*100).toFixed(2);
} }
}, },
//
getMaterialBatch() {
let that = this;
let obj = {page: 0, count__gte: 0, count_xtest__gte: 0};
//
obj.mgroupx = that.mgroup;
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.options = res;
});
},
// //
submit() { submit() {
let that = this; let that = this;
this.$refs.dialogForm.validate(async (valid) => { this.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
let count_notok; that.form.ftestworkdefect = [];
if(count_notok>that.form.count_notok){ that.qct_defects.forEach((item) => {
that.$notify.error("不合格数量有问题"); let obj = {};
that.isSaveing = false; obj.defect = item.defect;
}else{ obj.count = item.count;
if(count_notok<that.form.count_notok){ that.form.ftestworkdefect.push(obj);
that.count_notok_json.count_n_qt = that.form.count_notok-count_notok; })
} console.log('that.form',that.form);
if(that.supplier!== null&&that.form.type2==10){ that.$API.qm.ftestwork.create.req(that.form).then((res) => {
that.form.need_update_wm = false; that.$API.qm.ftestwork.submit.req(res.id)
} .then((res) => {
if(that.form.type2==10){//
that.form.count_sampling_ok = that.form.count_sampling - that.form.count_notok;
}else{//
that.form.count_ok = that.form.count - that.form.count_notok;
}
that.$API.qm.ftestwork.create.req(that.form).then((res) => {
that.$API.qm.ftestwork.submit.req(res.id)
.then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("操作成功");
})
}).catch( err=>{
//
that.isSaveing = false; that.isSaveing = false;
}) that.visible = false;
} that.$emit("success");
that.$message.success("操作成功");
})
}).catch( err=>{
//
that.isSaveing = false;
})
} }
}); });
}, },

View File

@ -97,13 +97,13 @@
prop="material_name" prop="material_name"
min-width="140" min-width="140"
></el-table-column> ></el-table-column>
<el-table-column label="批次" prop="batch" width="100"> <el-table-column label="批次" prop="batch" min-width="80">
<template #default="scope"> <template #default="scope">
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text> <el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="数量" prop="count" width="80"></el-table-column> <el-table-column label="数量" prop="count" min-width="80"></el-table-column>
<el-table-column label="交接类型" prop="type" width="100"> <el-table-column label="交接类型" prop="type" min-width="80">
<template #default="scope" v-if="mgroup_name=='size'||mgroup_name=='facade'"> <template #default="scope" v-if="mgroup_name=='size'||mgroup_name=='facade'">
<el-text v-if="scope.row.send_dept == deptId" type="primary">交送</el-text> <el-text v-if="scope.row.send_dept == deptId" type="primary">交送</el-text>
<el-text v-if="scope.row.recive_dept == deptId" type="success">接收</el-text> <el-text v-if="scope.row.recive_dept == deptId" type="success">接收</el-text>
@ -113,6 +113,12 @@
<el-text v-if="scope.row.recive_mgroup == mgroupId" type="success">接收</el-text> <el-text v-if="scope.row.recive_mgroup == mgroupId" type="success">接收</el-text>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="交接工段" min-width="80">
<template #default="scope">
<el-text v-if="scope.row.send_mgroup == mgroupId">{{scope.row.send_mgroup_name}}</el-text>
<el-text v-if="scope.row.recive_mgroup == mgroupId">{{scope.row.recive_mgroup_name}}</el-text>
</template>
</el-table-column>
<el-table-column label="交接类别" prop="type" width="80"> <el-table-column label="交接类别" prop="type" width="80">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.type == 10" type="success" <el-tag v-if="scope.row.type == 10" type="success"

View File

@ -111,7 +111,7 @@
width="120" width="120"
> >
<template #default="scope"> <template #default="scope">
<el-link :underline="false" @click="printMaterial(scope.row)" type="primary">物料标签</el-link> <el-link :underline="false" @click="printMaterial(scope.row,'wm')" type="primary">物料标签</el-link>
<el-link <el-link
v-if="scope.row.material_&&scope.row.material_.tracking==10" v-if="scope.row.material_&&scope.row.material_.tracking==10"
:underline="false" :underline="false"
@ -134,8 +134,6 @@
<check-dialog <check-dialog
v-if="dialog.check" v-if="dialog.check"
ref="checkDialog" ref="checkDialog"
:mgroup="mgroupId"
:mgroupName="mgroup_name"
:itemObj = "checkItem" :itemObj = "checkItem"
@success="handleSaveSuccess" @success="handleSaveSuccess"
@closed="dialog.check = false" @closed="dialog.check = false"
@ -186,6 +184,16 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column
label="操作"
fixed="right"
align="center"
width="120"
>
<template #default="scope">
<el-link :underline="false" @click="printMaterial(scope.row,'wpr')" type="primary">物料标签</el-link>
</template>
</el-table-column>
</scTable> </scTable>
</template> </template>
<template #footer> <template #footer>
@ -194,6 +202,16 @@
</div> </div>
</template> </template>
</el-drawer> </el-drawer>
<el-dialog title="打印机设置" v-model="setNameVisible" width="600px">
<el-form label-width="100px">
<el-form-item label="打印机名称">
<el-input v-model="printer_name"></el-input>
</el-form-item>
</el-form>
<el-footer>
<el-button type="primary" @click="savePrinter">保存</el-button>
</el-footer>
</el-dialog>
</el-container> </el-container>
</template> </template>
<script> <script>
@ -261,6 +279,7 @@ export default {
materialsVisible:false, materialsVisible:false,
visibleDrawer: false, visibleDrawer: false,
wprVisibleDrawer:false, wprVisibleDrawer:false,
setNameVisible:false,
wprApiObj:this.$API.wpm.wpr, wprApiObj:this.$API.wpm.wpr,
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name"), printer_name:localStorage.getItem("printer_name"),
@ -272,31 +291,19 @@ export default {
this.getMgroupInfo(); this.getMgroupInfo();
}, },
methods: { methods: {
printSetting(){
this.setNameVisible = true;
},
savePrinter() {
let that = this;
localStorage.setItem("printer_name", that.printer_name);
that.setNameVisible = false;
that.$message.success("打印机设置成功,请重新进行打印操作。");
},
getMgroupInfo(){ getMgroupInfo(){
let that = this; let that = this;
console.log('mgroupName',that.mgroupName); console.log('mgroupName',that.mgroupName);
if(that.mgroupName=="size"){ that.$API.mtm.mgroup.list
// that.params.material__process__name = "";
that.$API.system.dept.list.req({name__contains:'尺寸',page:0}).then((res) => {
if(res.length>0){
that.params.mgroupx = null;
that.params.belong_dept=res[0].id;
}
that.apiObj = that.$API.wpm.wmaterial.list;
that.$refs.table.refresh();
})
}else if(that.mgroupName=="facade"){
// that.params.material__process__name = "";
that.$API.system.dept.list.req({name__contains:'外观',page:0}).then((res) => {
if(res.length>0){
that.params.mgroupx = null;
that.params.belong_dept=res[0].id;
}
that.apiObj = that.$API.wpm.wmaterial.list;
that.$refs.table.refresh();
})
}else{
that.$API.mtm.mgroup.list
.req({ page: 0, name: that.mgroupName }) .req({ page: 0, name: that.mgroupName })
.then((res) => { .then((res) => {
if (res.length < 1) { if (res.length < 1) {
@ -311,7 +318,6 @@ export default {
that.apiObj = that.$API.wpm.wmaterial.list; that.apiObj = that.$API.wpm.wmaterial.list;
that.$refs.table.refresh(); that.$refs.table.refresh();
}); });
}
}, },
add() { add() {
this.dialog.save = true; this.dialog.save = true;
@ -383,27 +389,51 @@ export default {
this.$refs.table.refresh(); this.$refs.table.refresh();
}, },
// //
printMaterial(row){ printMaterial(row,type){
let that = this; let that = this;
that.apiObj.req({tid:row.id}).then((res) => { if(that.printer_name!==''&&that.printer_name!==null&&that.printer_name!==undefined){
let code = res.code_label; if(type=='wm'){
let str = [ that.apiObjPrint.req({tid:row.id}).then((res) => {
"SIZE 40 mm,70 mm", let code = res.code_label;
"GAP 7 mm,7 mm", let str = [
"CLS", "SIZE 40 mm,70 mm",
"REFERENCE 0,0", "GAP 7 mm,7 mm",
'QRCODE 30,400,H,5,A,0,"' +code +'"', "CLS",
"WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name, "REFERENCE 0,0",
"WINTEXT 240,550,28,90,0,0,Simhei," + res.batch, 'QRCODE 30,400,H,5,A,0,"' +code +'"',
"PRINT 1", "WINTEXT 200,550,28,90,0,0,Simhei," + res.material_name,
]; "WINTEXT 240,550,28,90,0,0,Simhei," + res.batch,
let obj = {}; "PRINT 1",
obj.printer_commands = str; ];
obj.printer_name = that.printer_name; let obj = {};
that.$API.wpm.prints.req(obj).then((response) => { obj.printer_commands = str;
that.$message.success("打印成功"); obj.printer_name = that.printer_name;
}); that.$API.wpm.prints.req(obj).then((response) => {
}) that.$message.success("打印成功");
});
})
}else{
let code = 'wpr#'+row.id;
let str = [
"SIZE 70 mm,100 mm",
"GAP 7 mm,7 mm",
"CLS",
"REFERENCE 0,0",
'QRCODE 30,400,H,5,A,0,"' +code +'"',
"WINTEXT 200,550,28,90,0,0,Simhei," + row.material_name,
"WINTEXT 240,550,28,90,0,0,Simhei," + row.number,
"PRINT 1",
];
let obj = {};
obj.printer_commands = str;
obj.printer_name = that.printer_name;
that.$API.wpm.prints.req(obj).then((response) => {
that.$message.success("打印成功");
});
}
}else{
that.printSetting();
}
}, },
inmCheck(row){ inmCheck(row){
let that = this; let that = this;

View File

@ -251,9 +251,8 @@
hidePagination hidePagination
> >
<el-table-column type="index" width="50" /> <el-table-column type="index" width="50" />
<el-table-column type="expand"> <!-- <el-table-column type="expand">
<template #default="props"> <template #default="props">
<!-- 检测项和判断项 -->
<div style="padding-left: 50px"> <div style="padding-left: 50px">
<el-descriptions :column="4"> <el-descriptions :column="4">
<el-descriptions-item label="破损"> <el-descriptions-item label="破损">
@ -262,7 +261,7 @@
</el-descriptions> </el-descriptions>
</div> </div>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column <el-table-column
label="产出物料" label="产出物料"
prop="material_out_name" prop="material_out_name"

View File

@ -181,23 +181,33 @@ export default {
}); });
}, },
// //
formWminChange(wm_in){ formWminChange(code){
// wm_in: let that = this,codeId='',arr=[];
let that = this; if(code.indexOf("#")>-1){
let arr = that.materialOptions.filter((item) => { let arrs = code.split("#");
return item.batch == wm_in; codeId = arrs[1];
}); }
if (arr.length > 0) { this.$API.cm.labelmat.item.req(codeId).then((res) => {
that.form.batch = wm_in; if(res){
that.form.wm_in = arr[0].id; arr = that.materialOptions.filter((item) => {
that.form.count_use = arr[0].count; return item.batch == res.batch&&item.material==res.material&&item.state==res.state;
// if(that.tracking==10){}else{ })
// that.submit();// if (arr.length > 0) {
// } that.form.batch = arr[0].batch;
}else{ that.form.wm_in = arr[0].id;
that.form.count_use = arr[0].count;
that.wm_in = arr[0].batch;
}else{
that.wm_in = '';
that.$message.error("批次号不存在");
}
}else{
that.wm_in = '';
}
}).catch((err) => {
that.wm_in = ''; that.wm_in = '';
that.$message.error("批次号不存在"); that.$message.error("批次号不存在");
} });
}, },
// //
submit() { submit() {

View File

@ -50,7 +50,7 @@
@click="mtask_submit(scope.row)" @click="mtask_submit(scope.row)"
>提交 >提交
</el-button> </el-button>
<el-button <!-- <el-button
link link
size="small" size="small"
v-auth="'mtask.submit'" v-auth="'mtask.submit'"
@ -58,7 +58,7 @@
v-if="scope.row.state == 20 " v-if="scope.row.state == 20 "
@click="mtask_deliver(scope.row)" @click="mtask_deliver(scope.row)"
>分配 >分配
</el-button> </el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>