This commit is contained in:
zty 2025-02-27 14:29:03 +08:00
commit b4daca4664
30 changed files with 1751 additions and 584 deletions

View File

@ -2,6 +2,12 @@ import config from "@/config"
import http from "@/utils/request"
/*EM接口*/
export default {
cd:{
name: "执行采集数据方法",
req: async function(data){
return await http.post(`${config.API_URL}/em/cd/`,data);
}
},
// 设备分类
ecate: {
list: {

View File

@ -212,6 +212,12 @@ export default {
return await http.get(this.url, params);
}
},
item: {
name: "获取详情",
req: async function(id){
return await http.get(`${config.API_URL}/system/user/${id}/`);
}
},
read: {
name: "用户详情",
req: async function(id){

View File

@ -468,8 +468,8 @@ export default {
prints: {
name: "打印",
req: async function (data) {
return await http.post("http://localhost:8080/prints/", data);
// return await http.post("http://127.0.0.1:8080/prints/", data);
// return await http.post("http://localhost:8080/prints/", data);
return await http.post("http://127.0.0.1:8080/prints/", data);
},
},
ana:{

View File

@ -204,6 +204,7 @@ export const wmState = new EnumFactory({
10: { text: '合格', type: 'success' },
20: { text: '不合格', type: 'warning' },
30: { text: '返修', type: 'warning' },
34: { text: '返修完成', type: 'warning' },
40: { text: '检验', type: 'primary' },
50: { text: '报废', type: 'danger' },
}, parseInt)

View File

@ -425,6 +425,14 @@ export default {
}
if (list.length > 0) {
list.forEach((item) => {
let dateNow = new Date().getDate();
if(item. == dateNow){
that.sctj.rtcs = item.总重量;
that.sctj.rjgs = item.生产数;
that.sctj.rjgqbls = item.生产数-item.不合格数-item.合格数;
that.sctj.rhgs = item.合格数;
that.sctj.rbhgs = item.不合格数;
}
let arr = [];
arr[0] = item.+'-'+item.+'-'+item.;
arr[1] = item.生产数;

View File

@ -52,7 +52,10 @@
</el-table-column>
<el-table-column label="仓库" width="80" prop="warehouse_name">
</el-table-column>
<el-table-column label="物料存量" prop="count">
<el-table-column label="物料存量">
<template #default="scope">
<el-link @click="handleWpr(scope.row)" type="primary">{{ scope.row.count }}</el-link>
</template>
</el-table-column>
<el-table-column label="有效期" prop="expiration_date">
</el-table-column>
@ -72,6 +75,39 @@
:mtype="wmtype"
:apiObj="apiObjPrint"
></print-dialog>
<el-drawer v-model="wprVisibleDrawer" :size="'70%'">
<template #header>
<h4>关联产品</h4>
</template>
<template #default>
<scTable ref="wprTable" hidePagination :data="wprList">
<el-table-column type="index" width="50"></el-table-column>
<el-table-column label="产品编号" prop="number" min-width="100px"></el-table-column>
<el-table-column label="缺陷项" min-width="200px">
<template #default="scope">
<span v-for="item in scope.row.wprdefect" :key="item.id">
<el-tag type="warning">{{ item.defect_name }}</el-tag>
</span>
</template>
</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>
</template>
<template #footer>
<div style="flex: auto">
<el-button @click="wprVisibleDrawer=false">关闭</el-button>
</div>
</template>
</el-drawer>
</el-container>
</template>
<script>
@ -86,10 +122,12 @@ export default {
apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type__in: "30" },
selection: [],
wprList:[],
query: {},
warehouseOptions: [],
wmtype:0,
print_m:false,
wprVisibleDrawer:false,
materialsVisible:false,
apiObjPrint:this.$API.cm.labelmat.fromMb,
wmId:'',
@ -98,6 +136,9 @@ export default {
20:'不合格',
30:'返修',
},
wprParams:{
page:0
},
};
},
mounted() {
@ -124,6 +165,14 @@ export default {
resetQuery() {
this.query = {};
},
handleWpr(row){
let that = this;
that.wprParams.mb = row.id;
that.wprVisibleDrawer = true;
that.$API.wpm.wpr.list.req(that.wprParams).then((res) => {
that.wprList = res;
})
},
//
printMaterial(row){
let that = this;

View File

@ -2,7 +2,7 @@
<el-drawer
v-model="visible"
title="出入库记录"
:size="'90%'"
:size="'95%'"
destroy-on-close
@closed="$emit('closed')"
>
@ -77,16 +77,6 @@
hidePagination
hideDo
>
<!-- <el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px" v-if="props.row.wproducts.length > 0&&props.row.wproducts.test_json">
<el-descriptions :column="4" v-for="item in props.row.wproducts.test_json" :key="item.id">
<el-descriptions-item label="破损">
</el-descriptions-item>
</el-descriptions>
</div>
</template>
</el-table-column> -->
<el-table-column type="index" width="50" />
<el-table-column
label="物料"
@ -103,7 +93,7 @@
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="检验" prop="test_date" v-if="cate=='mainso'">
<el-table-column label="检验" prop="count_tested" v-if="cate=='mainso'">
</el-table-column>
<el-table-column
label="组合件信息"
@ -238,7 +228,7 @@
:type="type"
:objitem="objitem"
@success="handleCheckSuccess"
@closed="dialog.check = false"
@closed="checkDialogClose"
>
</check-dialog>
<el-dialog v-model="printVisible" width="1200px">
@ -311,6 +301,7 @@ export default {
// cate: "",
objitem: {},
mtype:10,
mioType:'',
project_code:'',
setNameVisible:false,
printer_name:localStorage.getItem("printer_name")
@ -340,16 +331,20 @@ export default {
this.visible = true;
},
getMio() {
this.$API.inm.mio.item.req(this.mioId).then((res) => {
this.mioObj = res;
this.belongDeptId = res.belong_dept;
let that = this;
that.$API.inm.mio.item.req(that.mioId).then((res) => {
that.mioObj = res;
that.mioType = res.type;
that.belongDeptId = res.belong_dept;
});
},
//
table_add() {
let that = this;
console.log(this.mioType);
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add", this.mioObj.type);
this.$refs.saveDialog.open("add", that.mioType);
});
},
@ -429,17 +424,17 @@ export default {
this.mioObj = res;
});
},
checkDialogClose(){
let that = this;
that.dialog.check = false;
that.$refs.table.refresh();
},
handlePrint(){
let that = this;
let params = {
mio: that.mioId,
page:0
}
// if(){
// that.mtype = 10
// }else{
// }
that.$API.inm.mioitem.list.req(params).then((res) => {
that.tableData = res;
that.printVisible = true;

View File

@ -750,57 +750,165 @@
@closed="$emit('closed')"
>
<el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px">
<el-table :data="mioitemwList" border>
<el-header>
<el-form
ref="dialogForm"
:model="formbw"
:rules="rules"
label-width="80px"
style="width: 100%;"
>
<el-row>
<el-col :md="12" :sm="12">
<el-form-item label="检验员" prop="test_user">
<el-select
v-model="formbw.test_user"
placeholder="检验员"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in userList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12">
<el-form-item label="检验时间" prop="test_date">
<el-date-picker
v-model="formbw.test_date"
type="date"
value-format="YYYY-MM-DD"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-header>
<el-main style="padding: 0 20px 20px 20px" id="mioitemwMain">
<scTable :tableHeight="tableHeight" :data="mioitemwList" border hideDo hidePagination>
<el-table-column label="物料编号" prop="number">
</el-table-column>
<el-table-column label="操作" fixed="right" width="130">
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
<template #default="scope">
<el-button @click="changeCheckItem(scope.row)" type="text">检验</el-button>
<el-button v-if="scope.row.wpr" @click="changeCheckRecord(scope.row)" type="text">检验记录</el-button>
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-model="scope.row[item.testitem_name]"
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
</el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-model="scope.row[item.testitem_name]"
clearable
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item0 in item.testitem_choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="scope.row[item.testitem_name]"
clearable
multiple
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
<scTable v-if="checkRecordShow" :data="recordList" row-key="id" height="300px" stripe>
<el-table-column type="index" width="50" />
<el-table-column label="检验日期" prop="test_date"></el-table-column>
<el-table-column label="检验人" prop="test_user_name"></el-table-column>
<el-table-column label="是否合格" prop="is_ok">
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
<template #default="scope">
<el-tag v-if="scope.row.is_ok" type="success">合格</el-tag>
<el-tag v-else type="warning">不合格</el-tag>
<el-switch
:disabled="!scope.row.isEdit"
v-model="scope.row[item.defect_name]"
style="--el-switch-on-color: red"
@change="switchChange(scope.row, item)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="80">
<el-table-column prop="note" label="备注" width="80px">
<template #default="scope">
<el-button @click="checkFormDetail(scope.row)" type="text">查看</el-button>
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="90">
<template #default="scope">
<el-link
v-if="scope.row.isEdit"
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-link
>
<el-link
v-if="scope.row.isEdit"
type="danger"
size="small"
style="margin-left: 5px;"
@click="formTableCancel(scope.row)"
>取消</el-link
>
<el-link
v-else
type="primary"
size="small"
@click="formTableEdit(scope.row)"
>检验</el-link
>
</template>
</el-table-column>
</scTable>
</el-main>
<!-- <el-footer v-if="mode == 'add'">
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
<el-button @click="visibleDrawer = false">取消</el-button>
</el-footer> -->
</el-container>
</el-drawer>
<checkform-dialog
v-if="checkShow"
ref="checkFormDialog"
:material="objitem.material"
:mioitemw="mioitemw"
@success="checkFormSuccess"
@closed="checkShow= false"
>
</checkform-dialog>
</template>
<script>
import checkformDialog from "./mioitemCheckForm.vue";
export default {
emits: ["success", "closed"],
components: {
checkformDialog
},
props: {
mioitemId: { type: String, default: "" },
type: { type: String, default: "" },
@ -809,6 +917,7 @@ export default {
},
data() {
return {
tableHeight:500,
tableData:[],
loading: false,
form: {
@ -839,23 +948,18 @@ export default {
],
},
formbw:{
number:'',
note:'',
mioitem:'',
test_date:'',
test_user:'',
},
project_code: null,
mioItem: {},
weight_kgs: [{ value: 0 }],
checkShow:false,
checkShowsss:false,
visible: false,
visibleDrawer:false,
isSaveing: false,
checkRecordShow:false,
recordList:[],
userList: [],
qct_defects:[],
qct_testitems:[],
processOptions: [],
deptOptions: [],
selectionFilters: [],
@ -871,11 +975,13 @@ export default {
let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
setTimeout(() => {
this.tableHeight = document.getElementById('mioitemwMain').clientHeight-20;
},500)
that.getUserList();
if(that.project_code=='bxerp'){
that.mioitemwId = that.objitem.mioitemw[0].id;
that.formbw.number = that.objitem.mioitemw[0].number;
that.formbw.mioitem = that.objitem.mioitemw[0].mioitem;
this.getMioitemw();
}else{
if (that.type == "pur_in") {
@ -931,49 +1037,166 @@ export default {
}
}
},
watch: {
qct_testitems: {
handler() {
//
this.qct_testitems.forEach(item => {
if (!(item.testitem_name in this.form)) {
this.form[item.testitem_name] = ''
}
});
},
immediate: true
},
qct_defects: {
handler() {
this.qct_defects.forEach(item => {
if (!(item.defect_name in this.form)) {
this.form[item.defect_name] = false;
}
});
},
immediate: true
}
},
methods: {
//
open(mode = "add") {
this.mode = mode;
let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code;
if(config_base=='bxerp'){
this.getQctDetail();
this.visibleDrawer = true;
}else{
this.visible = true;
}
return this;
},
changeCheckItem(row){
getMaterialItem(){
let that = this;
that.mioitemw = row;
that.checkShow = true;
console.log("row",row);
console.log("checkFormDialog");
that.$nextTick(() => {
that.$refs.checkFormDialog.open("add");
that.$API.mtm.material.item.req(that.objitem.material).then(()=>{
})
},
checkFormDetail(row){
getdefects(){
let that = this;
that.mioitemw = row;
that.checkShow = true;
that.$nextTick(() => {
that.$refs.checkFormDialog.open("show").setData(row);
})
if(that.qct!==null&&that.qct!==''){
that.$API.qm.qct.item.req(that.qct).then((res) => {
that.qct_defects = [];
res.qct_defects.forEach((item) => {
that.addTemplate[item.defect_name] = false;
})
that.qct_defects = res.qct_defects;
that.qct_testitems = [];
res.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
obj2.addto_wpr = item2.addto_wpr;
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
obj2.value = 0;
that.addTemplate[item2.testitem_name] = 0;
}
if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str);
obj2.testitem_choices = arr;
that.addTemplate[item2.testitem_name] = '';
}
that.qct_testitems.push(obj2);
})
that.getList();
})
}else{
that.getList();
}
},
changeCheckRecord(row){
//
getQctDetail(){
let that = this;
this.mioitemwWpr = row.wpr;
that.$API.qm.ftest.list.req({ mioitemw_ftest__wpr: row.wpr,page:0 }).then((res) => {
that.recordList = res;
})
that.checkShow = false;
that.checkRecordShow = true;
that.$API.qm.qct.list.req({ qctmat__material: that.objitem.material,page:0 }).then((res) => {
if(res.length>0){
that.qctId = res[0].id;
that.$API.qm.qct.item.req(that.qctId).then((res0) => {
//testitemdefectitem
that.qct_defects = [];
that.qct_testitems = [];
if(res0.qct_defects.length>0){
res0.qct_defects.forEach((item1) => {
let obj = Object.assign({}, item1);
obj.value = '';
that.qct_defects.push(obj);
})
}else{
that.qct_defects = [];
}
if(res0.qct_testitems.length>0){
res0.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
if(obj2.testitem_field_type=='select-text'||obj2.testitem_field_type=='selects-text'){
let str = obj2.testitem_choices.replace(/'/g, '"');
let arr = JSON.parse(str);
obj2.testitem_choices = arr;
}
that.qct_testitems.push(obj2);
})
}else{
that.qct_testitems = [];
}
})
}
});
},
defectCountSun(row){
let that = this;
that.qct_defects.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1');
let judge = eval(str);
row[item.defect_name] = judge;
}else{
row[item.defect_name] = false;
}
});
},
getMioitemw(){
let that = this;
that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((res) => {
that.mioitemwList = res;
if(res.length>0){
that.mioitemwList = [];
res.forEach((item) => {
let obj = {};
obj = Object.assign({},item);
obj.isEdit = false;
if(item.ftest!=null){
if(item.ftest.ftestdefects!==undefined&&item.ftest.ftestdefects!==''&&item.ftest.ftestdefects!==null&&item.ftest.ftestdefects.length>0){
item.ftest.ftestdefects.forEach((item1) => {
obj[item1.defect_name] = item1.has;
})
}
if(item.ftest.ftestitems!==undefined&&item.ftest.ftestitems!==''&&item.ftest.ftestitems!==null&&item.ftest.ftestitems.length>0){
item.ftest.ftestitems.forEach((item2) => {
obj[item2.testitem_name] = item2.test_val_json;
})
}
}else{
that.qct_defects.forEach((item1) => {
obj[item1.defect_name] = false;
})
that.qct_testitems.forEach((item2) => {
if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
obj[item2.testitem_name] = 0;
}else{
obj[item2.testitem_name] = "";
}
})
}
that.mioitemwList.push(obj);
})
}
});
},
//
@ -1011,45 +1234,45 @@ export default {
that.type == "other_in"
) {
this.form.count_notok =
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
}
if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
}
},
//
@ -1060,45 +1283,45 @@ export default {
that.type == "other_in"
) {
this.form.count_notok =
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
this.form.count_n_zw +
this.form.count_n_tw +
this.form.count_n_qp +
this.form.count_n_wq +
this.form.count_n_dl +
this.form.count_n_pb +
this.form.count_n_dxt +
this.form.count_n_js +
this.form.count_n_qx +
this.form.count_n_hs +
this.form.count_n_ysq +
this.form.count_n_zz +
this.form.count_n_b +
this.form.count_n_qt;
}
if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok =
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
this.form.count_n_hs +
this.form.count_n_cs +
this.form.count_n_zz +
this.form.count_n_tw +
this.form.count_n_d +
this.form.count_n_zdd +
this.form.count_n_zw +
this.form.count_n_dl +
//
this.form.count_n_qp +
this.form.count_n_bl +
this.form.count_n_hw +
this.form.count_n_yp +
this.form.count_n_bp +
this.form.count_n_sc +
//
this.form.count_n_qx +
this.form.count_n_js +
this.form.count_n_tydd +
this.form.count_n_sw +
this.form.count_n_bhpcd +
this.form.count_n_wq;
}
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
@ -1157,12 +1380,84 @@ export default {
(sum / data.weight_kgs.length) * data.count_bag;
}
},
checkFormSuccess(){},
//
setFilters(filters) {
this.selectionFilters = filters;
this.setFiltersVisible = true;
},
//
formTableSave(row) {
let that = this;
this.$refs.dialogForm.validate(async (valid) => {
if (valid) {
let ftestdefects = [],ftestitems = [];
let obj = {};
if(row.ftest!==null){
ftestdefects = row.ftest.ftestdefects;
ftestdefects.forEach((item) => {
item.has = row[item.defect_name]?row[item.defect_name]:false;
})
ftestitems = row.ftest.ftestitems;
ftestitems.forEach((item1) => {
item1.test_val_json = row[item1.testitem_name]?row[item1.testitem_name]:"";
})
}else{
that.qct_testitems.forEach((item) => {
let obj0 = {};
obj0.testitem = item.testitem;
obj0.test_user = row.test_user;
obj0.testitem_name = item.testitem_name;
obj0.test_val_json = row[item.testitem_name]?row[item.testitem_name]:"";
ftestitems.push(obj0);
})
that.qct_defects.forEach((item1) => {
let obj1 = {};
obj1.defect = item1.defect;
obj1.test_user = row.test_user;
obj1.defect_name = item1.defect_name;
obj1.has = row[item1.defect_name]?row[item1.defect_name]:false;
ftestdefects.push(obj1);
})
}
obj.note = row.note;
obj.number = row.number;
obj.mioitem = row.mioitem;
obj.ftest = {};
obj.ftest.qct = row.ftest?row.ftest.qct:that.qctId;
obj.ftest.test_user = that.formbw.test_user;
obj.ftest.test_date = that.formbw.test_date;
obj.ftest.ftestitems = ftestitems;
obj.ftest.ftestdefects = ftestdefects;
that.isSaveing = true;
console.log('row.id',row.id);
that.$API.inm.mioitemw.update.req(row.id,obj).then((res) => {
that.isSaveing = false;
that.getMioitemw();
that.$message.success("操作成功");
}).catch((err) => {
that.isSaveing = false;
})
}
})
},
formTableCancel(row){
let that = this;
that.mioitemwList.forEach((item, index) => {
if (item.id == row.id) {
that.mioitemwList[index].isEdit = false;
}
});
},
formTableEdit(row) {
let that = this;
that.mioitemwList.forEach((item, index) => {
if (item.id == row.id) {
that.mioitemwList[index].isEdit = true;
}
});
},
},
};
</script>

View File

@ -12,119 +12,142 @@
:rules="rules"
label-width="120px"
>
<el-form-item label="物料" prop="material">
<el-select
v-model="selectMaterial"
value-key="id"
clearable
filterable
style="width: 100%"
@change="selectMaterialChange"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.full_name"
:value="item"
>
<span style="float: left">{{ item.full_name }}</span>
<span
style="
float: right;
color: '#E6A23C';
font-size: 13px;
"
v-if="item.is_hidden"
></span
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="物料" prop="material">
<el-select
v-model="selectMaterial"
value-key="id"
clearable
filterable
style="width: 100%"
@change="selectMaterialChange"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次号" prop="batch">
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
<el-select
v-model="form.batch"
filterable
allow-create
clearable
style="width: 100%"
:disabled="inputBatchDisable"
>
<el-option
v-for="item in wbatchOptions"
:key="item.id"
:value="item.batch"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.full_name"
:value="item"
>
<span style="float: left">{{ item.full_name }}</span>
<span
style="
float: right;
color: '#E6A23C';
font-size: 13px;
"
v-if="item.is_hidden"
></span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="批次号" prop="batch">
<!-- <el-input v-model="form.batch" placeholder="手动输入批次号" :disabled="inputBatchDisable" /> -->
<el-select
v-model="form.batch"
filterable
allow-create
clearable
style="width: 100%"
:disabled="inputBatchDisable"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库已有批次">
<el-select
v-model="selectBatch"
value-key="id"
clearable
style="width: 100%"
@change="selectBatchChange"
@clear="selectBatchClear"
:disabled="selectBatchDisable"
>
<el-option
v-for="item in batchOptions"
:key="item.id"
:label="item.batch"
:value="item"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }} -- {{ item.warehouse_name }}</span
<el-option
v-for="item in wbatchOptions"
:key="item.id"
:value="item.batch"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="仓库已有批次">
<el-select
v-model="selectBatch"
value-key="id"
clearable
style="width: 100%"
@change="selectBatchChange"
@clear="selectBatchClear"
:disabled="selectBatchDisable"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="仓库" prop="warehouse">
<el-select
v-model="form.warehouse"
clearable
style="width: 100%"
:disabled="warehouseDisable"
>
<el-option
v-for="item in warehouseOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="数量" v-if="cate == 'mainso'">
<el-input-number
v-model="form.count"
:min="1"
:precision="3"
style="width: 100%"
/>
</el-form-item>
<el-form-item label="数量" v-else>
<el-input-number
v-model="form.count"
:min="1"
style="width: 100%"
/>
</el-form-item>
<el-option
v-for="item in batchOptions"
:key="item.id"
:label="item.batch"
:value="item"
>
<span style="float: left">{{ item.batch }}</span>
<span
style="
float: right;
color: var(--el-text-color-secondary);
font-size: 13px;
"
>{{ item.count }} -- {{ item.warehouse_name }}</span
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="仓库" prop="warehouse">
<el-select
v-model="form.warehouse"
clearable
style="width: 100%"
:disabled="warehouseDisable"
>
<el-option
v-for="item in warehouseOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="cate == 'mainso'">
<el-form-item label="数量">
<el-input-number
v-model="form.count"
:min="1"
:precision="3"
style="width: 100%"
@change="countChange"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-else>
<el-form-item label="数量">
<el-input-number
v-model="form.count"
:min="1"
style="width: 100%"
/>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="project_code=='bxerp'&&form.type == 'pur_in'">
<el-col :md="12" :sm="24" v-for="i in form.count" :key="i">
<el-form-item :label="'编号'+i">
<el-input-number v-if="i==1" v-model="mioitems[0]" @change="firstNumberChange" placeholder="请输入编号" controls-position="right" style="width:100%"/>
<el-input v-else v-model="mioitems[i-1]" placeholder="请输入编号" :disabled="true" />
</el-form-item>
</el-col>
</el-row>
<div v-if="assembShow">
<el-row
v-for="item in components"
@ -242,10 +265,14 @@ export default {
selectBatch: null,
components: [],
wbatchOptions: [],
mioitems:[''],
project_code:'',
};
},
mounted() {
// this.getBatchs();
let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code;
},
methods: {
init() {
@ -424,6 +451,39 @@ export default {
this.visible = true;
return this;
},
countChange(){
if(this.project_code=='bxerp'){
let numbers = this.mioitems[0];
if(this.form.count>this.mioitems.length){
this.mioitems = [];
for(let i=0;i<this.form.count;i++){
if(numbers!=''&&numbers!=null&&numbers!=undefined){
this.mioitems[i] = Number(numbers)+i;
}else{
this.mioitems[i] = '';
}
}
}else if(this.form.count<this.mioitems.length){
this.mioitems = [];
for(let i=0;i<this.form.count;i++){
if(numbers!=''&&numbers!=null&&numbers!=undefined){
this.mioitems[i] = Number(numbers)+i;
}else{
this.mioitems[i] = '';
}
}
}
}
},
firstNumberChange(){
let numbers = this.mioitems[0];
for(let i=0;i<this.form.count;i++){
this.mioitems[i] = Number(numbers)+i;
}
},
validateInput(i){
this.mioitems[i] = this.mioitems[i].replace(/\D/g, '');
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
@ -439,8 +499,17 @@ export default {
});
}
}
let mioitemw = [];
if(this.mioitems.length>1){
this.mioitems.forEach((item)=>{
let obj = {};
obj.number= item;
mioitemw.push(obj);
})
this.form.mioitemw = mioitemw;
}
try {
var res;
let res;
if (this.mode == "add") {
res = await this.$API.inm.mioitem.create.req(
this.form

View File

@ -192,7 +192,7 @@ export default {
{ id: 10, name: "成品" },
{ id: 20, name: "半成品" },
{ id: 30, name: "主要原料" },
{ id: 40, name: "辅助材料" },
// { id: 40, name: "" },
],
handle_user: [],
selectionFilters: [],
@ -200,9 +200,13 @@ export default {
setFiltersVisible: false,
processOptions: [],
componentList: [{ id: "", count: 1 }],
project_code : this.$TOOL.data.get("BASE_INFO").base.base_code,
};
},
mounted() {
if(this.project_code !== 'bxerp'){
this.options.push({ name: "辅助材料", id: 40 });
}
this.getProcessOptions();
},
methods: {

View File

@ -196,13 +196,14 @@ export default {
},
data() {
return {
project_code : this.$TOOL.data.get("BASE_INFO").base.base_code,
materialTemplate: " /media/default/template/material.xlsx",
dialog: {
save: false,
},
apiObj: null,
query: { type: 10, is_hidden: false },
activeName: "主要原料",
activeName: 10,
selection: [],
state_: {
10: "完好",
@ -214,30 +215,31 @@ export default {
{ label: "成品", name: 10 },
{ label: "半成品", name: 20 },
{ label: "主要原料", name: 30 },
{ label: "辅助材料", name: 40 },
// { label: "", name: 40 },//
],
typeOptions: {
10: "成品",
20: "半成品",
30: "主要原料",
40: "辅助材料",
// 40: "",//
},
project_code:"",
materialId: "",
materialName: "",
showHidden: false,
};
},
mounted() {
// console.log("materialType", this.materialType);
this.query.type = 10;
this.apiObj = this.$API.mtm.material.list;
this.$refs.table.queryData(this.query);
this.materialTemplate = this.materialTemplate+"?t=" + new Date().getTime();
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
if(this.project_code !== 'bxerp'){
this.tabOptions.push({ label: "辅助材料", name: 40 });
this.typeOptions[40] = "辅助材料";
}
},
methods: {
rowClick(row) {
// console.log("rowClick", row);
this.materialId = row.id;
this.materialName = row.full_name;
this.$emit("choseChange", row.id);

View File

@ -138,6 +138,21 @@
/>
</el-form-item>
</el-col>
<!-- 10单个 20批次 -->
<el-col :md="12" :sm="24" v-if="project_code=='bxerp'">
<el-form-item label="追踪方式">
<el-select
clearable
v-model="form.material_out_tracking"
placeholder="输出物料追踪方式"
:value-on-clear="null"
style="width: 100%"
>
<el-option label="单个" :value="10"></el-option>
<el-option label="批次" :value="20"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="计划时长" prop="hour_work">
<el-input-number
@ -233,6 +248,7 @@ const defaultForm = {
div_number:1,
batch_bind: false,
is_autotask: true,
material_out_tracking:null
};
export default {
props: {

View File

@ -2,7 +2,7 @@
<el-drawer
title="查看"
v-model="visible"
:size="1000"
:size="'90%'"
destroy-on-close
@closed="$emit('closed')"
:close-on-click-modal="false"

View File

@ -23,6 +23,7 @@
>
</el-step>
</el-steps>
<div v-if="active === 1" class="productNameText">{{ productName }}</div>
</el-header>
<!--基本信息!-->
<el-main class="nopadding" v-if="active === 0">
@ -59,6 +60,19 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="附件">
<sc-upload-file
v-model="fileList"
:multiple="false"
:limit="1"
:accept="['.pdf']"
@success = "fileUPSuccess"
>
<el-button type="primary" icon="el-icon-upload"> </el-button>
</sc-upload-file>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :md="24" :sm="12" :xs="24">
@ -196,6 +210,7 @@ export default {
dialog: {
save: false,
},
fileList:[],
form: {
name: "",
material: "",
@ -210,7 +225,8 @@ export default {
name: [{ required: true, message: "请输入" }],
},
routepack: "",
project_code:''
project_code:'',
productName:'',
};
},
mounted() {
@ -227,7 +243,17 @@ export default {
},
setData(data) {
Object.assign(this.form, data);
console.log("setData this.form", this.form);
let obj = {};
obj.name=data.document_.name;
obj.url=data.document_.file;
this.fileList.push(obj);
// console.log("setData this.form", this.form);
},
fileUPSuccess(res) {
let that = this;
// console.log('res',res);
// console.log('that.fileList',that.fileList);
that.form.document = res.id;
},
getMaterials() {
let that = this;
@ -237,6 +263,9 @@ export default {
that.materials = res;
});
},
handleMaterialChange(val){
console.log("val",val);
},
handleStep(val) {
//
if (this.stepSuc.includes(val) === true) {
@ -253,14 +282,12 @@ export default {
let form = {};
form.name = that.form.name;
form.material = that.form.material;
console.log("that.form",that.form)
if (that.form.id) {
that.$API.mtm.routepack.update
.req(that.form.id, that.form)
.then((res) => {
that.routepack = res.id;
that.query.routepack = res.id;
console.log("that.query", that.query);
that.apiObj = that.$API.mtm.route.list;
that.active = 1;
// that.$refs.tables.refresh();
@ -270,9 +297,13 @@ export default {
this.active = 1;
that.form.id = res.id;
that.routepack = res.id;
console.log("that.form",that.form)
});
}
that.materials.forEach((item) => {
if (item.id == that.form.material) {
that.productName = item.full_name;
}
})
},
table_add() {
this.dialog.save = true;
@ -353,3 +384,12 @@ export default {
},
};
</script>
<style>
.productNameText{
position: absolute;
top: 30px;
font-size: 18px;
width: 96%;
text-align: center;
color: #666666;
}</style>

View File

@ -230,9 +230,9 @@ export default {
tagsOptions: [
{value:"purin",name:"入厂检验"},
{value:"process",name:"过程检验"},
{value:"first",name:"首件检验"},
{value:"prod",name:"成品检验"},
{value:"performance",name:"性能检验"},
// {value:"first",name:""},
// {value:"prod",name:""},
// {value:"performance",name:""},
],
mcateTagsOptions: [],
processOptions: [],

View File

@ -15,7 +15,7 @@
stripe
:params="paramsObj"
>
<el-table-column type="expand" v-if="deptName=='6车间'">
<el-table-column type="expand">
<template #default="props">
<el-descriptions title="不合格列表" :column="5" border>
<el-descriptions-item label="划伤" width="150px">
@ -87,7 +87,7 @@
</el-descriptions>
</template>
</el-table-column>
<el-table-column type="expand" v-if="deptName=='7车间'">
<!-- <el-table-column type="expand" v-if="deptName=='7车间'">
<template #default="props">
<el-descriptions title="不合格列表" :column="5" border>
<el-descriptions-item label="炸纹" width="150px">
@ -102,7 +102,6 @@
<el-descriptions-item label="气泡" width="150px">
{{props.row.count_notok_json.count_n_qp}}
</el-descriptions-item>
<el-descriptions-item label="扁" width="150px">
{{props.row.count_notok_json.count_n_b}}
</el-descriptions-item>
@ -111,8 +110,8 @@
</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
<el-table-column type="expand" v-if="deptName=='10车间'">
</el-table-column> -->
<!-- <el-table-column type="expand" v-if="deptName=='10车间'">
<template #default="props">
<el-descriptions title="不合格列表" :column="5" border>
<el-descriptions-item label="椭圆/弯曲" width="150px">
@ -141,7 +140,7 @@
</el-descriptions-item>
</el-descriptions>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="检验类型">
<template #default="scope">
<el-tag v-if="scope.row.type2 == 10">
@ -172,14 +171,20 @@
</el-table-column>
<el-table-column label="合格率">
<template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok/scope.row.count_sampling*100 }}%</span>
<span v-else>{{ scope.row.count_ok/scope.row.count*100 }}%</span>
<span v-if="scope.row.type2 == 10">{{ (scope.row.count_sampling_ok/scope.row.count_sampling*100).toFixed(2) }}%</span>
<span v-else>{{ (scope.row.count_ok/scope.row.count*100).toFixed(2) }}%</span>
</template>
</el-table-column>
<el-table-column label="检验日期" prop="test_date">
</el-table-column>
<el-table-column label="检验人" prop="test_user_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="55">
<template #default="scope">
<el-link type="primary" v-if="scope.row.submit_time==null" @click.stop="testSubmit(scope.row)" v-auth="'ftestwork.submit'">提交</el-link>
<el-link type="warning" v-else @click.stop="testRevoke(scope.row)">撤回</el-link>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
@ -218,6 +223,20 @@ export default {
this.$refs.drawer_table.fetch();
});
},
testSubmit(row) {
let that = this;
that.$API.qm.ftestwork.submit.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.drawer_table.fetch();
})
},
testRevoke(row) {
let that = this;
that.$API.qm.ftestwork.revoke.req(row.id).then((res) => {
that.$message.success("操作成功");
that.$refs.drawer_table.fetch();
})
}
},
};
</script>

View File

@ -787,8 +787,7 @@ export default {
}).catch((e) => {});
},
getMlogs() {
this.$API.wpm.mlog.list
.req({ mtask: this.currentMtask.id, page: 0 })
this.$API.wpm.mlog.list.req({ mtask: this.currentMtask.id,with_mlogb:true,page: 0 })
.then((res) => {
this.mlogs = res;
});

View File

@ -320,7 +320,7 @@
</el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="55">
<template #default="scope">
<el-link link type="primary" @click.stop="inm_test(scope.row)">检验</el-link>
<el-link link type="primary" @click.stop="inm_test(scope.row)" v-auth="'ftestwork.create'">检验</el-link>
<el-link link type="success" @click.stop="inm_record(scope.row)">记录</el-link>
</template>
</el-table-column>
@ -334,6 +334,7 @@
<middle-dialog
ref="inmTestDialog"
v-if="dialogInmTest"
@success = "inmTestSuccess"
@closed="dialogInmTest = false">
</middle-dialog>
<showDrawer
@ -555,6 +556,9 @@ export default {
this.$refs.inmTestDialog.open('6车间').setData(row);
})
},
inmTestSuccess(){
this.$refs.table_wm.refresh();
},
//
inm_record(row){
this.wm = row.id;

View File

@ -70,7 +70,7 @@
</el-form-item>
</el-col>
<el-col :md="12" :sm="24" v-if="change_batch">
<el-form-item label="新批次号">
<el-form-item label="新批次号" prop="new_batch">
<el-input v-model="form.new_batch" placeholder="新批次号"></el-input>
</el-form-item>
</el-col>
@ -194,6 +194,7 @@
v-model="form.recive_mgroup"
placeholder="接收工段"
clearable
filterable
style="width: 100%"
:disabled="type==40"
@change="getUserList2"
@ -277,6 +278,13 @@ export default {
new_batch:''
},
rules: {
new_batch:[
{
required: true,
message: "请输入新批次号",
trigger: "blur",
},
],
batch: [
{
required: true,
@ -359,6 +367,9 @@ export default {
let day = date.getDate();
that.form.handle_date = year + "-" + month + "-" + day;
that.form.send_mgroup = that.mgroupId;
if(that.type==20||that.type==50){
that.form.recive_mgroup = that.mgroupId;
}
// type=10
// type=20
// type=30
@ -447,7 +458,7 @@ export default {
var req = {
mgroupx: that.mgroupId,
page: 0,
state:20,
state__in:'20,34'
};
this.$API.wpm.wmaterial.list.req(req).then((res) => {
that.materialOptions = res;

View File

@ -19,6 +19,8 @@
></mlogs>
<mtask
v-if="values == '日志'&&componentsShow"
:mgroupId="mgroupId"
:deptId = "mgroupDept"
:mgroupName="mgroupName"
style="height: 40%"
></mtask>
@ -26,11 +28,13 @@
<handover
v-else-if="values == '交接记录'&&componentsShow"
:mgroupName="mgroupName"
:mgroupId="mgroupId"
:mgroup_code="mgroup_code"
></handover>
<!-- 库存 -->
<inm v-else-if="values == '库存'&&componentsShow"
:mgroup_code="mgroup_code"
:mgroupId="mgroupId"
:mgroupName="mgroupName"></inm>
</el-main>

View File

@ -6,9 +6,6 @@
v-if="mgroupName=='清洗'"
>领料</el-button
>
<!-- <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>
@ -67,6 +64,15 @@
>
</template>
</el-table-column>
<el-table-column
label="物料已到工序"
prop="material_name"
min-width="100"
>
<template #default="scope">
{{ scope.row.material_name.split('|').at(-1) }}
</template>
</el-table-column>
<el-table-column
label="批次号"
prop="batch"

View File

@ -44,6 +44,7 @@
<el-select
v-model="form.batch"
filterable
style="width: 100%"
@change="selectwmChange"
>
<el-option
@ -110,6 +111,7 @@
v-model="form.count"
:min="1"
:precision="0"
:disabled="true"
style="width: 100%"
/>
</el-form-item>
@ -264,6 +266,7 @@ export default {
if(arr2.length > 0){
that.selectBatch = arr2[0].batch;
that.form.batch = arr2[0].batch;
that.form.count = arr2[0].count;
that.form.mb = arr2[0].id;
that.form.warehouse = arr2[0].warehouse;
that.$refs.scanDialog.visible = false;
@ -296,6 +299,7 @@ export default {
}else{
this.form.batch = item.batch;
this.form.mb = item.id;
this.form.count = item.count;
this.form.warehouse = item.warehouse;
}
}
@ -306,6 +310,7 @@ export default {
that.wbatchOptions.forEach((item) => {
if (item.batch == val) {
that.form.material = item.material;
that.form.count = item.count;
}
})
},
@ -328,6 +333,7 @@ export default {
if (valid) {
that.isSaveing = true;
that.form.mio = that.mioId;
that.form.count = parseInt(that.form.count);
try {
var res;
if (that.mode == "add") {

View File

@ -3,20 +3,20 @@
<el-drawer
title="日志详情"
v-model="visible"
:size="'90%'"
:size="'95%'"
destroy-on-close
@closed="$emit('closed')"
>
<div>
<el-card style="width: 100%" header="基本信息" shadow="never">
<el-descriptions>
<el-descriptions-item label="工艺路线">{{
<el-descriptions-item label="工艺路线" v-if="!mlogItem.is_fix">{{
mlogItem.routepack_name
}}</el-descriptions-item>
<el-descriptions-item label="输入物料">{{
<el-descriptions-item label="输入物料" v-if="!mlogItem.is_fix">{{
mlogItem.material_in_name
}}</el-descriptions-item>
<el-descriptions-item label="输出物料">{{
<el-descriptions-item label="输出物料" v-if="!mlogItem.is_fix">{{
mlogItem.material_out_name
}}</el-descriptions-item>
<el-descriptions-item label="工段名称">{{
@ -40,6 +40,9 @@
<el-descriptions-item label="创建时间">{{
mlogItem.create_time
}}</el-descriptions-item>
<el-descriptions-item label="指导文件" v-if="route_file!==null">
<el-button @click="showFile">查看</el-button>
</el-descriptions-item>
</el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button
@ -101,8 +104,6 @@
</el-tag>
</template>
</el-table-column>
<!-- <el-table-column label="加工前不良" prop="count_pn_jgqbl">
</el-table-column> -->
<el-table-column
label="创建时间"
prop="create_time"
@ -172,63 +173,6 @@
/>
</el-form-item>
</el-col>
<!-- <sc-form-table
hideDelete
:tableHeight="300"
v-model="defectlist"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="number" label="不合格项">
<template #default="scope">
<el-select
v-model="scope.row.defect"
placeholder="不合格项"
clearable
style="width: 100%"
>
<el-option
v-for="item in defectOptions"
:key="item.defect"
:label="item.defect_name"
:value="item.defect"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="数量">
<template #default="scope">
<el-input-number
v-model="scope.row.count"
:min="0"
class="width-100"
controls-position="right"
>
</el-input-number>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="60" align="center">
<template #default="scope">
<el-button
v-if="scope.row.id"
text
type="danger"
size="small"
@click="formTableDel(scope.row.id)"
>删除</el-button
>
<el-button
v-else
text
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-button
>
</template>
</el-table-column>
</sc-form-table> -->
</el-row>
</el-form>
<template #footer>
@ -251,17 +195,6 @@
hidePagination
>
<el-table-column type="index" width="50" />
<!-- <el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px">
<el-descriptions :column="4">
<el-descriptions-item label="破损">
{{props.row.count_n_hs}}
</el-descriptions-item>
</el-descriptions>
</div>
</template>
</el-table-column> -->
<el-table-column
label="产出物料"
prop="material_out_name"
@ -288,7 +221,6 @@
width="100px"
>
<template #default="scope">
<!-- 批次 v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==10" -->
<el-link
:underline="false"
type="primary"
@ -300,7 +232,7 @@
<el-link
:underline="false"
type="primary"
v-if="mlogItem.material_out_&&mlogItem.material_out_.tracking==20"
v-if="mlogItem.material_out_&&mlogItem.material_out_.tracking==20||scope.row.material_out_tracking==20"
@click="table_out_check_single(scope.row,'outs')"
>详情</el-link>
</template>
@ -336,6 +268,7 @@
ref="saveDialog"
:mlog="mlogId"
:mgroup="mgroup"
:isfix = "mlogItem.is_fix"
:routeId ="routeId"
:tracking="tracking"
:materialIn="materialIn"
@ -356,6 +289,8 @@
ref="checkDialogSingle"
:mlogb="mlogb"
:wm = "wm"
:mgroup="mgroup"
:mgroupName= "mlogItem.mgroup_name"
:isSubmit="isSubmit"
:batchNumber="batchNumber"
:handle_user="handle_user"
@ -378,6 +313,12 @@
<print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/>
</el-dialog>
</div>
<div v-if="fileVisible" class="file_show">
<div style="display: flex;justify-content: flex-end;padding: 10px 20px;">
<el-icon size="30" class="el-dialog__close" @click="fileVisible=false"><el-icon-close/></el-icon>
</div>
<iframe :src="route_file" style="width: 100%;height: 90%;">预览</iframe>
</div>
</el-drawer>
</template>
<script>
@ -467,6 +408,7 @@ export default {
},
],
},
route_file:null,
handle_date:'',
handle_user:'',
wm:'',
@ -484,6 +426,7 @@ export default {
defectlist:[],
batchNumber:'',
isSubmit:false,
fileVisible:false,
};
},
mounted() {
@ -504,7 +447,6 @@ export default {
let that = this;
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
that.mlogItem = res;
console.log('that.mlogItem',that.mlogItem);
that.routeId = res.route;
that.tracking = res.material_in_.tracking;
if(res.test_file!==null){
@ -520,13 +462,19 @@ export default {
that.$API.wpm.mlogb.list.req(that.paramsOut).then((res) => {
that.tableData2 = res;
})
that.$API.mtm.routepack.list.req({page:0,search:res.routepack_name}).then((res) => {
that.route_file = res[0].document_!==null?res[0].document_.path:null;
})
});
},
//
setData(data) {
Object.assign(this.form, data);
this.getRoute(data.id);
// this.getRoute(data.id);
},
showFile(){
this.fileVisible = true;
},
//
mlogUpdate() {
@ -604,7 +552,7 @@ export default {
that.handle_date=that.mlogItem.handle_date;
that.handle_user = that.mlogItem.handle_user;
that.dialog.check_single = true;
if(row.qct==null){
if(row.qct==null&&!that.mlogItem.is_fix){
that.$API.qm.qct.list.req({qctmat__material:row.material_out,page:0}).then((res)=>{
if(res.length>0){
that.qct = res[0].id;
@ -703,4 +651,13 @@ export default {
};
</script>
<style></style>
<style scoped>
.file_show{
position: absolute;
width: 100%;
height: 100%;
top: 0;
background: rgb(255,255,255);
z-index: 999;
}
</style>

View File

@ -17,7 +17,7 @@
style="padding: 0 10px"
>
<el-row>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="mlogtype!=='rework'">
<el-form-item label="生产类型" prop="mtype">
<el-select
v-model="form.mtype"
@ -57,7 +57,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="mode=='add'">
<el-col :md="12" :sm="12" :xs="24" v-if="mode=='add'&&mlogtype!=='rework'">
<el-form-item label="关联任务" prop="mtask">
<el-select
v-model="form.mtask"
@ -76,7 +76,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="mlogtype!=='rework'">
<el-form-item label="工艺路线">
<el-select
v-model="form.route"
@ -246,6 +246,7 @@ const defaultForm = {
mgroup:'',
mtask:'',
oinfo_json:{},
is_fix:false,
};
export default {
@ -322,6 +323,7 @@ export default {
{ id: 10, name: "自产" },
{ id: 20, name: "外协" },
],
mlogtype:"",
visible: false,
isSaveing: false,
options: [],
@ -400,9 +402,14 @@ export default {
});
},
//
open(mode = "add") {
open(mode = "add",type) {
this.mode = mode;
this.visible = true;
if(type!==''&&type!==undefined&&type!==null){
this.mlogtype = type;
this.form.mtype=10;
this.form.is_fix=true;
}
return this;
},
//
@ -422,8 +429,8 @@ export default {
}else{
setTimeout(() => {
that.testitems.forEach((item) => {
item.value = data.oinfo_json[item.id];
});
item.value = data.oinfo_json[item.id];
});
},500)
}
}

View File

@ -17,7 +17,7 @@
label-width="80px"
style="padding: 0 10px"
>
<el-form-item label="关联任务">
<el-form-item label="关联任务" v-if="!isfix">
<el-select
v-model="form.mtask"
placeholder="关联任务"
@ -40,7 +40,7 @@
<el-form-item label="使用数量" prop="count_use">
<el-input-number ref="codeInput" v-model="form.count_use" clearable></el-input-number>
</el-form-item>
<el-form-item label="主要批次">
<el-form-item label="主要批次" v-if="!isfix">
<el-select
v-model="form.parent"
placeholder="主要批次"
@ -98,6 +98,10 @@ export default {
type: String,
default: "",
},
isfix:{
type: Boolean,
default: false,
}
},
emits: ["success", "closed"],
data() {
@ -186,12 +190,15 @@ export default {
//
getMaterial() {
let that = this;
this.$API.wpm.wmaterial.list.req({
mtaskx: that.form.mtask,
mgroupx: that.mgroup,
route: that.routeId,
page: 0,
}).then((res) => {
let obj = {};
obj.mtaskx =that.form.mtask;
obj.mgroupx =that.mgroup;
obj.route =that.routeId;
obj.page =0;
if(that.isfix){
obj.state =30;
}
this.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.materialOptions = res;
});
},

View File

@ -4,163 +4,331 @@
v-model="visible"
:size="'90%'"
destroy-on-close
:close-on-click-modal="false"
@closed="$emit('closed')"
>
<el-container>
<el-header v-if="descriptionVisible">
<div style="display: flex;align-items: center;justify-content: space-between;width: 100%;">
<div>检验人:{{setForm.test_user_name}}</div>
<div>检验设备:{{setForm.equipment_name}}</div>
<div>缺陷项:
<span v-for="(item1,index1) in defectlists" :key="item1.id">{{ item1.defect_name }}
<span v-if="index1 < defectlists.length-1"></span>
</span>
</div>
<div>检测项:
<span v-for="(item2,index2) in testitemlists" :key="item2.id">{{ item2.testitem_name }}
<span v-if="index2 < testitemlists.length-1"></span>
</span>
</div>
</div>
</el-header>
<el-main id="mlogbwMain">
<el-button type="primary" v-if="!isSubmit&&process_type=='20'&&mode=='outs'" @click="check_start" style="position: absolute;top: 20px;left: 150px;">检验</el-button>
<el-button type="primary" v-if="multipleSet" @click="check_set" style="position: absolute;top: 20px;left: 210px;">批量操作</el-button>
<el-input v-if="multipleSet" v-model="wprInputText" @change="wprinputChange" style="width:200px;position: absolute;top: 20px;left: 308px;">批量操作</el-input>
<sc-form-table
hideDelete
id="mlogbwlist"
:tableHeight="tableHeight"
v-model="mlogbwlist"
:addTemplate="addTemplate"
placeholder="暂无数据"
>
<el-table-column prop="number" label="物料编号" fixed min-width="120px">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
<el-select
v-if="scope.row.isEdit&&mode == 'ins'"
v-model="scope.row.wpr"
placeholder="动态成品"
clearable
style="width: 100%"
@change="optionChange(scope.row)"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
hideDelete
id="mlogbwlist"
:tableHeight="tableHeight"
v-model="mlogbwlist"
:addTemplate="addTemplate"
placeholder="暂无数据"
:hideAdd="hideAdd"
>
<el-table-column prop="number" label="物料编号" fixed min-width="120px">
<template #default="scope">
<!-- <span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input> -->
<el-select
v-if="scope.row.isEdit&&mode == 'ins'"
v-model="scope.row.wpr"
placeholder="动态成品"
clearable
style="width: 100%"
@change="optionChange(scope.row)"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
<template #default="scope">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-model="scope.row[item.testitem_name]"
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
</el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-model="scope.row[item.testitem_name]"
clearable
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item0 in item.testitem_choices"
:key="item0"
:label="item0"
:value="item0"
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
>
</el-option>
</el-select>
<span v-else>{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
<template #default="scope">
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]"
:disabled="!scope.row.isEdit||!item.canEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="scope.row[item.testitem_name]"
clearable
multiple
class="width-100"
:disabled="!scope.row.isEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
</el-input-number>
<el-input-number
v-if="item.testitem_field_type=='input-int'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit||!item.canEdit"
class="width-100"
controls-position="right"
@change="defectCountSun(scope.row)"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="80px">
<template #default="scope">
<el-switch
:disabled="!scope.row.isEdit"
v-model="scope.row[item.defect_name]"
style="--el-switch-on-color: red"
@change="switchChange(scope.row, item)"
></el-switch>
</template>
</el-table-column>
<el-table-column prop="note" label="备注" width="80px">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="90" align="center" fixed="right" v-if="!isSubmit">
<template #default="scope">
<el-link
v-if="scope.row.isEdit"
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-link
>
<el-link
v-if="scope.row.isEdit"
type="danger"
size="small"
style="margin-left: 5px;"
@click="formTableCancel(scope.row)"
>取消</el-link
>
<el-link
v-else
type="primary"
size="small"
@click="formTableEdit(scope.row)"
>编辑</el-link
>
<el-link
v-if="!scope.row.isEdit"
type="danger"
size="small"
style="margin-left: 5px;"
@click="formTableDel(scope.row.id)"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
</el-input-number>
<el-input
v-if="item.testitem_field_type=='input-text'"
v-model="scope.row[item.testitem_name]"
class="width-100"
:disabled="!scope.row.isEdit||!item.canEdit"
@change="defectCountSun(scope.row)"
>
</el-input>
<el-select
v-if="item.testitem_field_type=='select-text'"
v-model="scope.row[item.testitem_name]"
clearable
class="width-100"
:disabled="!scope.row.isEdit||!item.canEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item0 in item.testitem_choices"
:key="item0"
:label="item0"
:value="item0"
>
</el-option>
</el-select>
<el-select
v-if="item.testitem_field_type=='selects-text'"
v-model="scope.row[item.testitem_name]"
clearable
multiple
class="width-100"
:disabled="!scope.row.isEdit||!item.canEdit"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
<template #default="scope">
<el-switch
:disabled="!scope.row.isEdit||!item.canEdit"
v-model="scope.row[item.defect_name]"
style="--el-switch-on-color: red"
@change="switchChange(scope.row, item)"
></el-switch>
</template>
</el-table-column>
<el-table-column prop="note" label="备注" width="80px">
<template #default="scope">
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span>
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input>
</template>
</el-table-column>
<el-table-column prop="open" label="操作" width="90" align="center" fixed="right" v-if="!isSubmit">
<template #default="scope">
<el-link
v-if="scope.row.isEdit"
type="primary"
size="small"
@click="formTableSave(scope.row)"
>保存</el-link
>
<el-link
v-if="scope.row.isEdit"
type="danger"
size="small"
style="margin-left: 5px;"
@click="formTableCancel(scope.row)"
>取消</el-link
>
<el-link
v-if="!scope.row.isEdit&&mode=='outs'"
type="primary"
size="small"
@click="formTableEdit(scope.row)"
>编辑</el-link
>
<el-link
v-if="!scope.row.isEdit"
type="danger"
size="small"
style="margin-left: 5px;"
@click="formTableDel(scope.row.id)"
>删除</el-link
>
</template>
</el-table-column>
</sc-form-table>
</el-main>
</el-container>
<el-dialog
title="检验"
v-model="checkVisible"
destroy-on-close
>
<el-container>
<el-main>
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="80px"
>
<el-row>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="操作人" prop="test_user">
<ehsSelect
v-model="form.test_user"
:showName="test_user_name"
:apiObj="this.$API.system.user.list"
:params="{ depts: dept }"
style="width: 100%"
@change="userChange"
></ehsSelect>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="设备">
<el-select
v-model="form.equipment"
placeholder="设备"
clearable
filterable
style="width: 100%"
@change="equipmentChange"
>
<el-option
v-for="item in equipmentOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="检测项">
<el-select
v-model="form.testitemids"
placeholder="检测项"
clearable
filterable
multiple
style="width: 100%"
@change="testitemidsChange"
>
<el-option
v-for="item in qct_testitems"
:key="item.testitem"
:label="item.testitem_name"
:value="item.testitem"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="缺陷项">
<el-select
v-model="form.defectids"
placeholder="缺陷项"
clearable
filterable
multiple
style="width: 100%"
@change="defectidsChange"
>
<el-option
v-for="item in qct_defects"
:key="item.defect"
:label="item.defect_name"
:value="item.defect"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click.stop="checkSetting" save>确定</el-button>
<el-button @click="saveCancel">取消</el-button>
</el-footer>
</el-main>
</el-container>
</el-dialog>
<el-dialog
title="批量检验"
v-model="setVisible"
destroy-on-close
style="height:100%;width:80%"
>
<el-container>
<el-main>
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="150px"
>
<el-row>
<el-col v-for="item2 in defectlists" :key="item2.id" :span="12">
<el-form-item :label="item2.defect_name">
<el-switch v-model="item2.value"></el-switch>
<!-- <el-input v-model="item2.value"></el-input> -->
</el-form-item>
</el-col>
<el-col>
<!-- 扫描物料的number 根据number对比list里的物料-->
<el-form-item label="检测物料" label-width="70px">
<el-input v-model="wprNumber" @change="wprChange(wprNumber)"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row>
<el-table :data="selectWpr" border>
<el-table-column prop="number" label="物料编号"></el-table-column>
<el-table-column v-for="item2 in defectlists" :key="item2.id" :label="item2.defect_name">
{{ item2.value }}
</el-table-column>
<el-table-column label="操作" width="90" align="center" fixed="right">
<template #default="scope">
<el-link type="danger" size="small" @click="selectWprDel(scope.row)">删除</el-link>
</template>
</el-table-column>
</el-table>
</el-row>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click.stop="saveSetting" save>保存</el-button>
<el-button @click="saveCancel">取消</el-button>
</el-footer>
</el-main>
</el-container>
</el-dialog>
</el-drawer>
</template>
<script>
import mockData from "./mock.json";
export default {
props: {
mlogb: {
@ -183,11 +351,22 @@ export default {
type: String,
default: "",
},
mgroup:{
type: String,
default: "",
},
mgroupName:{
type:String,
default:"",
},
isSubmit:{
type: Boolean,
default: false,
},
},
// components: {
// checkDrawer
// },
emits: ["success", "closed"],
data() {
return {
@ -198,21 +377,54 @@ export default {
},
mode:'ins',
//
form: {},
form: {
test_user:"",
equipment:"",
cd_req_addr:"",//
equipment_name:"",
testitemids : [],
defectids : [],
},
test_user_name:"",
qct:"",
mgroup: "",
values:"",
wprNumber:"",
wprInputText:"",
params: {mlogb:'',page:0},
hideAdd: true,
visible: false,
setVisible:false,
multipleSet:false,
checkVisible:false,
descriptionVisible:false,
options:[],
qct_defects:[],
qct_testitems:[],
mlogbwlist:[],
equipmentOptions:[],
process_type:"",
addTemplate:{
mlogb: "",
number: "",
note: "",
isEdit: true,
},
setForm:{
test_user:"",
equipment:"",
equipment_name:"",
testitemids : [],
defectids : [],
},
rules: {
test_user: [{ required: true, message: "请选择操作人" }],
equipment:[{ required: true, message: "请选择设备" }],
},
defectlists:[],
testitemlists:[],
qct_defects_origin:[],
selectWpr:[],
tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name")
@ -220,21 +432,40 @@ export default {
},
mounted() {
let that = this;
that.addTemplate.number = that.batchNumber;
that.hideAdd = that.isSubmit;
if(that.mgroupName!=='排板'){
that.addTemplate.number = that.batchNumber;
}
that.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.currentDate = this.$TOOL.dateFormat2(new Date());
// console.log(that.currentDate);
},
methods: {
open(mode = "ins",qct = '') {
let that = this;
this.mode = mode;
this.qct = qct;
that.getOptions();
that.getdefects();
if(that.mode == 'ins'){//
that.getOptions();
}
that.$API.mtm.mgroup.item.req(that.mgroup).then((res) => {
that.process_type=res.process_type;
if(that.mode == 'outs'){//
that.getdefects();
}else{
that.getList();
}
})
this.visible = true;
setTimeout(() => {
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
},500)
},
getEquipments(){
let that = this;
that.$API.em.equipment.list.req({page:0}).then((res) => {
that.equipmentOptions = res;
})
},
getdefects(){
let that = this;
@ -243,12 +474,17 @@ export default {
that.qct_defects = [];
res.qct_defects.forEach((item) => {
that.addTemplate[item.defect_name] = false;
let obj = Object.assign({}, item);
obj.canEdit = that.process_type=='20'?false:true;
that.qct_defects.push(obj);
})
that.qct_defects = res.qct_defects;
that.qct_defects_origin = that.qct_defects;
that.qct_testitems = [];
res.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
obj2.canEdit = that.process_type=='20'?false:true;
obj2.addto_wpr = item2.addto_wpr;
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
obj2.value = 0;
@ -262,6 +498,7 @@ export default {
}
that.qct_testitems.push(obj2);
})
that.qct_testitems_origin = that.qct_testitems;
that.getList();
})
}else{
@ -278,10 +515,8 @@ export default {
let that = this;
that.options.forEach((item) => {
if(item.id == row.wpr){
console.log('item',item);
let index = that.mlogbwlist.indexOf(row);
that.mlogbwlist[index].number = item.number;
// that.mlogbwlist[index].wpr = item.id;
}
})
},
@ -319,21 +554,30 @@ export default {
}
that.mlogbwlist.push(obj);
})
console.log('mlogbwlistmlogbwlist',that.mlogbwlist);
}
})
},
//
formTableSave(row) {
let that = this;
let obj = {};
obj.number = row.number;
obj.mlogb = row.mlogb;
obj.wpr = row.wpr;
obj.note = row.note;
that.qct_defects_origin.forEach(item => {
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1')
let judge = eval(str);
row[item.defect_name] = judge;
}
});
//qct
if(that.qct!==null&&that.qct!==''){
//
console.log('row',row);
if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
console.log('已填过');
obj.ftest =row.ftest;
@ -343,16 +587,15 @@ export default {
row.ftest.ftestitems.forEach((item1) => {
item1.test_val_json = row[item1.testitem_name];
})
console.log('obj',obj);
}else{//
console.log('未填过');
obj.ftest = {};
obj.ftest.ftestitems = [];
obj.ftest.ftestdefects = [];
obj.ftest.qct = that.qct;
obj.ftest.test_date = that.handle_date;
obj.ftest.test_date = that.handle_date!=null?that.handle_date:that.currentDate;
obj.ftest.test_user = that.handle_user;
that.qct_defects.forEach((item) => {
that.qct_defects_origin.forEach((item) => {
let itemObj = {};
itemObj.defect = item.defect;
itemObj.test_user = that.handle_user;
@ -369,6 +612,7 @@ export default {
})
}
}
console.log('obj',obj);
if(row.id!==''&&row.id!==undefined&&row.id!==null){
obj.id = row.id;
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
@ -398,6 +642,7 @@ export default {
formTableEdit(row) {
this.mlogbwlist.forEach((item, index) => {
if (item.id == row.id) {
// console.log('row',row);
this.mlogbwlist[index].isEdit = true;
}
});
@ -419,11 +664,8 @@ export default {
},
switchChange(row,item){
let that = this;
let obj = {};
obj = Object.assign({},item);
// that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
// })
let index = that.mlogbwlist.indexOf(row);
that.mlogbwlist[index][item.defect_name] = row[item.defect_name];
},
//
mlogbwSubmit() {
@ -441,8 +683,8 @@ export default {
defectCountSun(row){
let that = this;
let index = that.mlogbwlist.indexOf(row);
that.qct_defects.forEach(item => {
console.log('item.rule_expression',item.rule_expression);
that.qct_defects_origin.forEach(item => {
// console.log('item.rule_expression',item.rule_expression);
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1')
@ -485,6 +727,204 @@ export default {
});
})
},
userChange(val){
let that = this;
this.$API.system.user.item.req(val).then((res) => {
that.setForm.test_user_name = res.name;
})
},
equipmentChange(){
let that = this;
that.equipmentOptions.forEach(item => {
if(item.id == that.form.equipment){
that.form.equipment_name = item.name;
that.form.cd_req_addr=item.cd_req_addr;
}
});
},
testitemidsChange(){
let that = this;
that.testitemlists = [];
that.qct_testitems.forEach(item => {
if(that.form.testitemids.indexOf(item.testitem) > -1){
item.canEdit = true;
item.value=null;
that.testitemlists.push(item);
}
});
},
defectidsChange(){
let that = this;
that.defectlists = [];
that.qct_defects.forEach(item => {
if(that.form.defectids.indexOf(item.defect) > -1){
item.canEdit = true;
item.value=null;
that.defectlists.push(item);
}
})
},
check_start(){
this.checkVisible=true;
this.getEquipments();
},
checkSetting(){
let that = this;
this.$refs.dialogForm.validate((valid) => {
if (valid) {
Object.assign(that.setForm,that.form);
that.mlogbwlist.forEach(item => {
if(item.ftest!==null){
item.ftest.ftestdefects.forEach(defect => {
if(that.setForm.defectids.indexOf(defect.defect) > -1){
defect.test_user = that.setForm.test_user;
}
})
item.ftest.ftestitems.forEach(testitem => {
if(that.setForm.testitemids.indexOf(testitem.testitem) > -1){
testitem.test_user = that.setForm.test_user;
testitem.test_equip = that.setForm.equipment;
}
})
}else{
let ftest = {};
ftest.ftestitems = [];
ftest.ftestdefects = [];
ftest.qct = that.qct;
ftest.test_date =that.handle_date!=null?that.handle_date:that.currentDate;
ftest.test_user = that.handle_user;
that.qct_defects.forEach((item0) => {
let itemObj = {};
itemObj.defect = item0.defect;
itemObj.has = false;
if(that.setForm.defectids.indexOf(item0.defect) > -1){
itemObj.test_user = that.setForm.test_user;
}else{
itemObj.test_user = that.handle_user;
}
ftest.ftestdefects.push(itemObj);
})
that.qct_testitems.forEach((item1) => {
let itemObj1 = {};
itemObj1.testitem = item1.testitem;
itemObj1.addto_wpr = item1.addto_wpr;
itemObj1.test_val_json = "";
if(that.setForm.testitemids.indexOf(item1.testitem) > -1){
itemObj1.test_user = that.setForm.test_user;
itemObj1.test_equip = that.setForm.equipment;
}else{
itemObj1.test_user = that.handle_user;
}
ftest.ftestitems.push(itemObj1);
})
item.ftest = ftest;
}
});
that.$API.wpm.mlogbw.update.req("bulk",that.mlogbwlist).then((res) => {
this.form = {};
that.checkVisible = false;
this.multipleSet = true;
that.descriptionVisible = true;
that.qct_defects = [];
that.qct_defects = that.defectlists;
that.qct_testitems = [];
that.qct_testitems = that.testitemlists;
that.tableHeight = document.getElementById('mlogbwMain').clientHeight-80;
that.getList();
}).catch((err) => {
return err;
});
}
});
},
saveCancel(){
this.form = {};
this.form.test_user = "";
this.form.equipment = "";
this.form.testitemids = [];
this.form.defectids = [];
this.checkVisible = false;
},
check_set(){
this.setVisible=true;
},
//
wprinputChange(){
let that = this;
that.mlogbwlist.forEach((item,index) => {
if(item.number == that.wprInputText){
let obj = Object.assign({},item);
obj.isEdit = true;
that.mlogbwlist.splice(index,1);
that.wprInputText = "";
that.mlogbwlist.unshift(obj);
if(that.setForm.cd_req_addr!==null){
//cd_req_addr,
that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => {
//res:[{"ZValue": "-0.18", "machineId": "testMachine","XValue": "-127.5831","YValue": "-12.5523"}]
let x = res.XValue;
let y = res.YValue;
let z = res.ZValue;
//cd_expr
that.qct_testitems.forEach(item0 => {
if(item0.testitem_cd_expr!=null){
that.mlogbwlist[0][item0.testitem_name]= eval(item0.testitem_cd_expr);
}
})
}).catch((err) => {
return err;
});
}
}
})
},
wprChange(wprNumber){
let that = this;
that.mlogbwlist.forEach(item => {
if(item.number == wprNumber){
that.selectWpr.push(item);
that.wprNumber = "";
}
});
},
selectWprDel(row){
let that = this;
that.selectWpr.forEach((item,index) => {
if(item.number == row.number){
that.selectWpr.splice(index,1);
}
});
},
saveSetting(){
let that = this;
this.$refs.dialogForm.validate((valid) => {
if (valid) {
that.selectWpr.forEach(item => {
item.ftest.ftestdefects.forEach(defect => {
let defectindex = that.setForm.defectids.indexOf(defect.defect);
if(defectindex > -1){
defect.has = that.defectlists[defectindex].value;
}
})
item.ftest.ftestitems.forEach(testitem => {
let testitemindex = that.setForm.testitemids.indexOf(testitem.testitem);
if( testitemindex > -1){
testitem.test_val_json = that.testitemlists[testitemindex].value;
}
})
});
that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => {
that.setVisible = false;
// that.descriptionVisible = false;
// that.setForm = {};
that.getList();
}).catch((err) => {
return err;
});
}
});
},
},
};
</script>

View File

@ -0,0 +1,193 @@
<template>
<el-dialog
title="检验"
v-model="visible"
destroy-on-close
@closed="$emit('closed')"
>
<el-container>
<el-main id="mlogbwMain">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
label-width="80px"
>
<el-row>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="操作人">
<ehsSelect
v-model="form.handle_user"
:showName="form.handle_user_name"
:apiObj="this.$API.system.user.list"
:params="{ depts: dept }"
style="width: 100%"
></ehsSelect>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="设备">
<el-select
v-model="form.equipment"
placeholder="设备"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.label"
:value="item.id"
>
<span style="float:left">{{item.name}}</span>
<span style="float:right">{{item.number}}</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="检测项">
<el-select
v-model="form.testitemlist"
placeholder="检测项"
clearable
filterable
multiple
style="width: 100%"
>
<el-option
v-for="item in testitems"
:key="item.testitem"
:label="item.testitem_name"
:value="item.testitem"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="缺陷项">
<el-select
v-model="form.defectlist"
placeholder="缺陷项"
clearable
filterable
multiple
style="width: 100%"
>
<el-option
v-for="item in defects"
:key="item.defect"
:label="item.defect_name"
:value="item.defect"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="primary" :loading="isSaveing" @click="submit">
保存
</el-button>
<el-button @click="visible = false">取消</el-button>
</template>
</el-main>
</el-container>
</el-dialog>
</template>
<script>
export default {
props: {
defects: {
type: Object,
default: () => {}
},
mlogbwlist: {
type: Object,
default: () => {}
},
testitems:{
type: Object,
default: () => {}
}
},
emits: ["success", "closed"],
data() {
return {
loading: false,
//
form: {},
qct:"",
mgroup: "",
params: {mlogb:'',page:0},
hideAdd: true,
visible: false,
options:[],
qct_defects:[],
qct_testitems:[],
mlogbwlists:[],
tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name")
};
},
mounted() {
},
methods: {
open(qct = '') {
let that = this;
that.qct = qct;
that.getDefects();//
// that.getUsers();//
// that.getEquipment();//
that.visible = true;
console.log('this.defects',this.defects)
console.log('this.testitems',this.testitems)
console.log('this.mlogbwlist',this.mlogbwlist)
// setTimeout(() => {
// that.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
// },500)
},
getDefects(){
let that = this;
if(that.qct!==null&&that.qct!==''){
that.$API.qm.qct.item.req(that.qct).then((res) => {
that.qct_defects = [];
that.qct_defects = res.qct_defects;
})
}
},
getEquipment() {
let that = this;
this.$API.em.equipment.list.req({ page: 0, type: 10,mgroup:that.mgroup}).then((res) => {
res.forEach((item) => {
let obj = {};
Object.assign(obj, item);
obj.label = item.name+'-'+item.number;
that.options.push(obj);
});
});
},
//
mlogbSubmit() {
let that = this;
that.$API.wpm.mlogb.submit.req(that.mlogb).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$message.success("操作成功");
});
},
},
};
</script>
<style scoped>
.width-100{
width: 100%;
}
</style>

View File

@ -9,7 +9,15 @@
v-auth="'mlog.create'"
>新增</el-button
>
<el-button
type="primary"
icon="el-icon-plus"
@click="table_rework"
v-auth="'mlog.create'"
>返工</el-button
>
</div>
<div class="right-panel">
<el-input
style="margin-right: 5px"
@ -45,6 +53,10 @@
min-width="130"
fixed
>
<template #default="scope">
<span v-if="scope.row.material_out_name!==null">{{scope.row.material_out_name}}</span>
<span v-else>返工</span>
</template>
</el-table-column>
<el-table-column
label="预计工时"
@ -267,11 +279,22 @@ export default {
this.$refs.saveDialog.open("add");
});
},
table_rework(){
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add","rework");
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
if(row.is_fix){
this.$refs.saveDialog.open("edit","rework").setData(row);
}else{
this.$refs.saveDialog.open("edit").setData(row);
}
});
},
//

View File

@ -0,0 +1,7 @@
[
{
"x":2.5,
"y":3.5,
"z":5.0
}
]

View File

@ -27,7 +27,7 @@
</span>
</template>
</el-table-column>
<el-table-column label="可用批" v-if="mgroup_name!='切片'">
<el-table-column label="可用批" v-if="mgroupName!='切片'">
<template #default="scope">
<el-button
link
@ -50,15 +50,6 @@
@click="mtask_submit(scope.row)"
>提交
</el-button>
<!-- <el-button
link
size="small"
v-auth="'mtask.submit'"
type="primary"
v-if="scope.row.state == 20 "
@click="mtask_deliver(scope.row)"
>分配
</el-button> -->
</template>
</el-table-column>
</scTable>
@ -103,6 +94,14 @@ export default {
type: String,
default: "",
},
mgroupId:{
type: String,
default: "",
},
deptId:{
type: String,
default: "",
}
},
components: {
deliverDrawer,
@ -130,14 +129,6 @@ export default {
34: "danger",
40: "success",
},
// state_: {
// 10: "",
// 20: "",
// 30: "",
// 34: "",
// 40: "",
// },
deptId: null,
mgroup_name:'',
deliverShow:false,
};
@ -154,7 +145,11 @@ export default {
// },
},
mounted() {
this.getMgroupInfo();
let that = this;
that.params.mgroup = that.mgroupId;
that.apiObj = this.$API.pm.mtask.list;
that.$refs.table.refresh();
// this.getMgroupInfo();
},
methods: {
getMgroupInfo(){
@ -165,8 +160,6 @@ export default {
if(res.length>0){
that.mgroupId = res[0].id;
that.deptId = res[0].belong_dept;
that.processId = res[0].process;
that.processCate = res[0].process_cate;
that.params.mgroup = res[0].id;
that.apiObj = this.$API.pm.mtask.list;
that.$refs.table.refresh();