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

View File

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

View File

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

View File

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

View File

@ -425,6 +425,14 @@ export default {
} }
if (list.length > 0) { if (list.length > 0) {
list.forEach((item) => { 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 = []; let arr = [];
arr[0] = item.+'-'+item.+'-'+item.; arr[0] = item.+'-'+item.+'-'+item.;
arr[1] = item.生产数; arr[1] = item.生产数;

View File

@ -52,7 +52,10 @@
</el-table-column> </el-table-column>
<el-table-column label="仓库" width="80" prop="warehouse_name"> <el-table-column label="仓库" width="80" prop="warehouse_name">
</el-table-column> </el-table-column>
<el-table-column label="物料存量" prop="count"> <el-table-column label="物料存量">
<template #default="scope">
<el-link @click="handleWpr(scope.row)" type="primary">{{ scope.row.count }}</el-link>
</template>
</el-table-column> </el-table-column>
<el-table-column label="有效期" prop="expiration_date"> <el-table-column label="有效期" prop="expiration_date">
</el-table-column> </el-table-column>
@ -72,6 +75,39 @@
:mtype="wmtype" :mtype="wmtype"
:apiObj="apiObjPrint" :apiObj="apiObjPrint"
></print-dialog> ></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> </el-container>
</template> </template>
<script> <script>
@ -86,10 +122,12 @@ export default {
apiObj: this.$API.inm.warehouse.batch, apiObj: this.$API.inm.warehouse.batch,
params: { count__gte: 1, material__type__in: "30" }, params: { count__gte: 1, material__type__in: "30" },
selection: [], selection: [],
wprList:[],
query: {}, query: {},
warehouseOptions: [], warehouseOptions: [],
wmtype:0, wmtype:0,
print_m:false, print_m:false,
wprVisibleDrawer:false,
materialsVisible:false, materialsVisible:false,
apiObjPrint:this.$API.cm.labelmat.fromMb, apiObjPrint:this.$API.cm.labelmat.fromMb,
wmId:'', wmId:'',
@ -98,6 +136,9 @@ export default {
20:'不合格', 20:'不合格',
30:'返修', 30:'返修',
}, },
wprParams:{
page:0
},
}; };
}, },
mounted() { mounted() {
@ -124,6 +165,14 @@ export default {
resetQuery() { resetQuery() {
this.query = {}; 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){ printMaterial(row){
let that = this; let that = this;

View File

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

View File

@ -750,57 +750,165 @@
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container v-loading="loading"> <el-container v-loading="loading">
<el-main style="padding: 0 20px 20px 20px"> <el-header>
<el-table :data="mioitemwList" border> <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 label="物料编号" prop="number">
</el-table-column> </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"> <template #default="scope">
<el-button @click="changeCheckItem(scope.row)" type="text">检验</el-button> <el-input-number
<el-button v-if="scope.row.wpr" @click="changeCheckRecord(scope.row)" type="text">检验记录</el-button> 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> </template>
</el-table-column> </el-table-column>
</el-table> <el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
<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">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.is_ok" type="success">合格</el-tag> <el-switch
<el-tag v-else type="warning">不合格</el-tag> :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> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" width="80"> <el-table-column prop="note" label="备注" width="80px">
<template #default="scope"> <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> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </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-container>
</el-drawer> </el-drawer>
<checkform-dialog
v-if="checkShow"
ref="checkFormDialog"
:material="objitem.material"
:mioitemw="mioitemw"
@success="checkFormSuccess"
@closed="checkShow= false"
>
</checkform-dialog>
</template> </template>
<script> <script>
import checkformDialog from "./mioitemCheckForm.vue";
export default { export default {
emits: ["success", "closed"], emits: ["success", "closed"],
components: {
checkformDialog
},
props: { props: {
mioitemId: { type: String, default: "" }, mioitemId: { type: String, default: "" },
type: { type: String, default: "" }, type: { type: String, default: "" },
@ -809,6 +917,7 @@ export default {
}, },
data() { data() {
return { return {
tableHeight:500,
tableData:[], tableData:[],
loading: false, loading: false,
form: { form: {
@ -839,23 +948,18 @@ export default {
], ],
}, },
formbw:{ formbw:{
number:'',
note:'',
mioitem:'',
test_date:'', test_date:'',
test_user:'', test_user:'',
}, },
project_code: null, project_code: null,
mioItem: {}, mioItem: {},
weight_kgs: [{ value: 0 }], weight_kgs: [{ value: 0 }],
checkShow:false,
checkShowsss:false,
visible: false, visible: false,
visibleDrawer:false, visibleDrawer:false,
isSaveing: false, isSaveing: false,
checkRecordShow:false,
recordList:[],
userList: [], userList: [],
qct_defects:[],
qct_testitems:[],
processOptions: [], processOptions: [],
deptOptions: [], deptOptions: [],
selectionFilters: [], selectionFilters: [],
@ -871,11 +975,13 @@ export default {
let that = this; let that = this;
let config_base = that.$TOOL.data.get("BASE_INFO").base; let config_base = that.$TOOL.data.get("BASE_INFO").base;
that.project_code = config_base.base_code; that.project_code = config_base.base_code;
setTimeout(() => {
this.tableHeight = document.getElementById('mioitemwMain').clientHeight-20;
},500)
that.getUserList(); that.getUserList();
if(that.project_code=='bxerp'){ if(that.project_code=='bxerp'){
that.mioitemwId = that.objitem.mioitemw[0].id; 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(); this.getMioitemw();
}else{ }else{
if (that.type == "pur_in") { 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: { methods: {
// //
open(mode = "add") { open(mode = "add") {
this.mode = mode; this.mode = mode;
let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code; let config_base = this.$TOOL.data.get("BASE_INFO").base.base_code;
if(config_base=='bxerp'){ if(config_base=='bxerp'){
this.getQctDetail();
this.visibleDrawer = true; this.visibleDrawer = true;
}else{ }else{
this.visible = true; this.visible = true;
} }
return this; return this;
}, },
changeCheckItem(row){ getMaterialItem(){
let that = this; let that = this;
that.mioitemw = row; that.$API.mtm.material.item.req(that.objitem.material).then(()=>{
that.checkShow = true;
console.log("row",row);
console.log("checkFormDialog");
that.$nextTick(() => {
that.$refs.checkFormDialog.open("add");
}) })
}, },
checkFormDetail(row){ getdefects(){
let that = this; let that = this;
that.mioitemw = row; if(that.qct!==null&&that.qct!==''){
that.checkShow = true; that.$API.qm.qct.item.req(that.qct).then((res) => {
that.$nextTick(() => { that.qct_defects = [];
that.$refs.checkFormDialog.open("show").setData(row); 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; let that = this;
this.mioitemwWpr = row.wpr; that.$API.qm.qct.list.req({ qctmat__material: that.objitem.material,page:0 }).then((res) => {
that.$API.qm.ftest.list.req({ mioitemw_ftest__wpr: row.wpr,page:0 }).then((res) => { if(res.length>0){
that.recordList = res; that.qctId = res[0].id;
}) that.$API.qm.qct.item.req(that.qctId).then((res0) => {
that.checkShow = false; //testitemdefectitem
that.checkRecordShow = true; 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(){ getMioitemw(){
let that = this; let that = this;
that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((res) => { that.$API.inm.mioitemw.list.req({ mioitem: that.mioitemId,page:0 }).then((res) => {
that.mioitemwList = 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" that.type == "other_in"
) { ) {
this.form.count_notok = this.form.count_notok =
this.form.count_n_zw + this.form.count_n_zw +
this.form.count_n_tw + this.form.count_n_tw +
this.form.count_n_qp + this.form.count_n_qp +
this.form.count_n_wq + this.form.count_n_wq +
this.form.count_n_dl + this.form.count_n_dl +
this.form.count_n_pb + this.form.count_n_pb +
this.form.count_n_dxt + this.form.count_n_dxt +
this.form.count_n_js + this.form.count_n_js +
this.form.count_n_qx + this.form.count_n_qx +
this.form.count_n_hs + this.form.count_n_hs +
this.form.count_n_ysq + this.form.count_n_ysq +
this.form.count_n_zz + this.form.count_n_zz +
this.form.count_n_b + this.form.count_n_b +
this.form.count_n_qt; this.form.count_n_qt;
} }
if (that.type == "do_in" && that.cate == "good") { if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok = this.form.count_notok =
this.form.count_n_hs + this.form.count_n_hs +
this.form.count_n_cs + this.form.count_n_cs +
this.form.count_n_zz + this.form.count_n_zz +
this.form.count_n_tw + this.form.count_n_tw +
this.form.count_n_d + this.form.count_n_d +
this.form.count_n_zdd + this.form.count_n_zdd +
this.form.count_n_zw + this.form.count_n_zw +
this.form.count_n_dl + this.form.count_n_dl +
// //
this.form.count_n_qp + this.form.count_n_qp +
this.form.count_n_bl + this.form.count_n_bl +
this.form.count_n_hw + this.form.count_n_hw +
this.form.count_n_yp + this.form.count_n_yp +
this.form.count_n_bp + this.form.count_n_bp +
this.form.count_n_sc + this.form.count_n_sc +
// //
this.form.count_n_qx + this.form.count_n_qx +
this.form.count_n_js + this.form.count_n_js +
this.form.count_n_tydd + this.form.count_n_tydd +
this.form.count_n_sw + this.form.count_n_sw +
this.form.count_n_bhpcd + this.form.count_n_bhpcd +
this.form.count_n_wq; this.form.count_n_wq;
} }
}, },
// //
@ -1060,45 +1283,45 @@ export default {
that.type == "other_in" that.type == "other_in"
) { ) {
this.form.count_notok = this.form.count_notok =
this.form.count_n_zw + this.form.count_n_zw +
this.form.count_n_tw + this.form.count_n_tw +
this.form.count_n_qp + this.form.count_n_qp +
this.form.count_n_wq + this.form.count_n_wq +
this.form.count_n_dl + this.form.count_n_dl +
this.form.count_n_pb + this.form.count_n_pb +
this.form.count_n_dxt + this.form.count_n_dxt +
this.form.count_n_js + this.form.count_n_js +
this.form.count_n_qx + this.form.count_n_qx +
this.form.count_n_hs + this.form.count_n_hs +
this.form.count_n_ysq + this.form.count_n_ysq +
this.form.count_n_zz + this.form.count_n_zz +
this.form.count_n_b + this.form.count_n_b +
this.form.count_n_qt; this.form.count_n_qt;
} }
if (that.type == "do_in" && that.cate == "good") { if (that.type == "do_in" && that.cate == "good") {
this.form.count_notok = this.form.count_notok =
this.form.count_n_hs + this.form.count_n_hs +
this.form.count_n_cs + this.form.count_n_cs +
this.form.count_n_zz + this.form.count_n_zz +
this.form.count_n_tw + this.form.count_n_tw +
this.form.count_n_d + this.form.count_n_d +
this.form.count_n_zdd + this.form.count_n_zdd +
this.form.count_n_zw + this.form.count_n_zw +
this.form.count_n_dl + this.form.count_n_dl +
// //
this.form.count_n_qp + this.form.count_n_qp +
this.form.count_n_bl + this.form.count_n_bl +
this.form.count_n_hw + this.form.count_n_hw +
this.form.count_n_yp + this.form.count_n_yp +
this.form.count_n_bp + this.form.count_n_bp +
this.form.count_n_sc + this.form.count_n_sc +
// //
this.form.count_n_qx + this.form.count_n_qx +
this.form.count_n_js + this.form.count_n_js +
this.form.count_n_tydd + this.form.count_n_tydd +
this.form.count_n_sw + this.form.count_n_sw +
this.form.count_n_bhpcd + this.form.count_n_bhpcd +
this.form.count_n_wq; this.form.count_n_wq;
} }
that.$refs.dialogForm.validate(async (valid) => { that.$refs.dialogForm.validate(async (valid) => {
if (valid) { if (valid) {
@ -1157,12 +1380,84 @@ export default {
(sum / data.weight_kgs.length) * data.count_bag; (sum / data.weight_kgs.length) * data.count_bag;
} }
}, },
checkFormSuccess(){},
// //
setFilters(filters) { setFilters(filters) {
this.selectionFilters = filters; this.selectionFilters = filters;
this.setFiltersVisible = true; 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> </script>

View File

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

View File

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

View File

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

View File

@ -138,6 +138,21 @@
/> />
</el-form-item> </el-form-item>
</el-col> </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-col :md="12" :sm="24">
<el-form-item label="计划时长" prop="hour_work"> <el-form-item label="计划时长" prop="hour_work">
<el-input-number <el-input-number
@ -233,6 +248,7 @@ const defaultForm = {
div_number:1, div_number:1,
batch_bind: false, batch_bind: false,
is_autotask: true, is_autotask: true,
material_out_tracking:null
}; };
export default { export default {
props: { props: {

View File

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

View File

@ -23,6 +23,7 @@
> >
</el-step> </el-step>
</el-steps> </el-steps>
<div v-if="active === 1" class="productNameText">{{ productName }}</div>
</el-header> </el-header>
<!--基本信息!--> <!--基本信息!-->
<el-main class="nopadding" v-if="active === 0"> <el-main class="nopadding" v-if="active === 0">
@ -59,6 +60,19 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-row> <el-row>
<el-col :md="24" :sm="12" :xs="24"> <el-col :md="24" :sm="12" :xs="24">
@ -196,6 +210,7 @@ export default {
dialog: { dialog: {
save: false, save: false,
}, },
fileList:[],
form: { form: {
name: "", name: "",
material: "", material: "",
@ -210,7 +225,8 @@ export default {
name: [{ required: true, message: "请输入" }], name: [{ required: true, message: "请输入" }],
}, },
routepack: "", routepack: "",
project_code:'' project_code:'',
productName:'',
}; };
}, },
mounted() { mounted() {
@ -227,7 +243,17 @@ export default {
}, },
setData(data) { setData(data) {
Object.assign(this.form, 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() { getMaterials() {
let that = this; let that = this;
@ -237,6 +263,9 @@ export default {
that.materials = res; that.materials = res;
}); });
}, },
handleMaterialChange(val){
console.log("val",val);
},
handleStep(val) { handleStep(val) {
// //
if (this.stepSuc.includes(val) === true) { if (this.stepSuc.includes(val) === true) {
@ -253,14 +282,12 @@ export default {
let form = {}; let form = {};
form.name = that.form.name; form.name = that.form.name;
form.material = that.form.material; form.material = that.form.material;
console.log("that.form",that.form)
if (that.form.id) { if (that.form.id) {
that.$API.mtm.routepack.update that.$API.mtm.routepack.update
.req(that.form.id, that.form) .req(that.form.id, that.form)
.then((res) => { .then((res) => {
that.routepack = res.id; that.routepack = res.id;
that.query.routepack = res.id; that.query.routepack = res.id;
console.log("that.query", that.query);
that.apiObj = that.$API.mtm.route.list; that.apiObj = that.$API.mtm.route.list;
that.active = 1; that.active = 1;
// that.$refs.tables.refresh(); // that.$refs.tables.refresh();
@ -270,9 +297,13 @@ export default {
this.active = 1; this.active = 1;
that.form.id = res.id; that.form.id = res.id;
that.routepack = 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() { table_add() {
this.dialog.save = true; this.dialog.save = true;
@ -353,3 +384,12 @@ export default {
}, },
}; };
</script> </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: [ tagsOptions: [
{value:"purin",name:"入厂检验"}, {value:"purin",name:"入厂检验"},
{value:"process",name:"过程检验"}, {value:"process",name:"过程检验"},
{value:"first",name:"首件检验"}, // {value:"first",name:""},
{value:"prod",name:"成品检验"}, // {value:"prod",name:""},
{value:"performance",name:"性能检验"}, // {value:"performance",name:""},
], ],
mcateTagsOptions: [], mcateTagsOptions: [],
processOptions: [], processOptions: [],

View File

@ -15,7 +15,7 @@
stripe stripe
:params="paramsObj" :params="paramsObj"
> >
<el-table-column type="expand" v-if="deptName=='6车间'"> <el-table-column type="expand">
<template #default="props"> <template #default="props">
<el-descriptions title="不合格列表" :column="5" border> <el-descriptions title="不合格列表" :column="5" border>
<el-descriptions-item label="划伤" width="150px"> <el-descriptions-item label="划伤" width="150px">
@ -87,7 +87,7 @@
</el-descriptions> </el-descriptions>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="expand" v-if="deptName=='7车间'"> <!-- <el-table-column type="expand" v-if="deptName=='7车间'">
<template #default="props"> <template #default="props">
<el-descriptions title="不合格列表" :column="5" border> <el-descriptions title="不合格列表" :column="5" border>
<el-descriptions-item label="炸纹" width="150px"> <el-descriptions-item label="炸纹" width="150px">
@ -102,7 +102,6 @@
<el-descriptions-item label="气泡" width="150px"> <el-descriptions-item label="气泡" width="150px">
{{props.row.count_notok_json.count_n_qp}} {{props.row.count_notok_json.count_n_qp}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="扁" width="150px"> <el-descriptions-item label="扁" width="150px">
{{props.row.count_notok_json.count_n_b}} {{props.row.count_notok_json.count_n_b}}
</el-descriptions-item> </el-descriptions-item>
@ -111,8 +110,8 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column type="expand" v-if="deptName=='10车间'"> <!-- <el-table-column type="expand" v-if="deptName=='10车间'">
<template #default="props"> <template #default="props">
<el-descriptions title="不合格列表" :column="5" border> <el-descriptions title="不合格列表" :column="5" border>
<el-descriptions-item label="椭圆/弯曲" width="150px"> <el-descriptions-item label="椭圆/弯曲" width="150px">
@ -141,7 +140,7 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="检验类型"> <el-table-column label="检验类型">
<template #default="scope"> <template #default="scope">
<el-tag v-if="scope.row.type2 == 10"> <el-tag v-if="scope.row.type2 == 10">
@ -172,14 +171,20 @@
</el-table-column> </el-table-column>
<el-table-column label="合格率"> <el-table-column label="合格率">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.type2 == 10">{{ scope.row.count_sampling_ok/scope.row.count_sampling*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 }}%</span> <span v-else>{{ (scope.row.count_ok/scope.row.count*100).toFixed(2) }}%</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="检验日期" prop="test_date"> <el-table-column label="检验日期" prop="test_date">
</el-table-column> </el-table-column>
<el-table-column label="检验人" prop="test_user_name"> <el-table-column label="检验人" prop="test_user_name">
</el-table-column> </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> </scTable>
</el-main> </el-main>
</el-container> </el-container>
@ -218,6 +223,20 @@ export default {
this.$refs.drawer_table.fetch(); 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> </script>

View File

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

View File

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

View File

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

View File

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

View File

@ -6,9 +6,6 @@
v-if="mgroupName=='清洗'" v-if="mgroupName=='清洗'"
>领料</el-button >领料</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 type="primary" v-auth="'handover.create'" @click="table_add(40)">
报废</el-button> 报废</el-button>
</div> </div>
@ -67,6 +64,15 @@
> >
</template> </template>
</el-table-column> </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 <el-table-column
label="批次号" label="批次号"
prop="batch" prop="batch"

View File

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

View File

@ -3,20 +3,20 @@
<el-drawer <el-drawer
title="日志详情" title="日志详情"
v-model="visible" v-model="visible"
:size="'90%'" :size="'95%'"
destroy-on-close destroy-on-close
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<div> <div>
<el-card style="width: 100%" header="基本信息" shadow="never"> <el-card style="width: 100%" header="基本信息" shadow="never">
<el-descriptions> <el-descriptions>
<el-descriptions-item label="工艺路线">{{ <el-descriptions-item label="工艺路线" v-if="!mlogItem.is_fix">{{
mlogItem.routepack_name mlogItem.routepack_name
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="输入物料">{{ <el-descriptions-item label="输入物料" v-if="!mlogItem.is_fix">{{
mlogItem.material_in_name mlogItem.material_in_name
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="输出物料">{{ <el-descriptions-item label="输出物料" v-if="!mlogItem.is_fix">{{
mlogItem.material_out_name mlogItem.material_out_name
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="工段名称">{{ <el-descriptions-item label="工段名称">{{
@ -40,6 +40,9 @@
<el-descriptions-item label="创建时间">{{ <el-descriptions-item label="创建时间">{{
mlogItem.create_time mlogItem.create_time
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="指导文件" v-if="route_file!==null">
<el-button @click="showFile">查看</el-button>
</el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="padding: 5px 10px;display: flex;justify-content: end;"> <div style="padding: 5px 10px;display: flex;justify-content: end;">
<el-button <el-button
@ -101,8 +104,6 @@
</el-tag> </el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="加工前不良" prop="count_pn_jgqbl">
</el-table-column> -->
<el-table-column <el-table-column
label="创建时间" label="创建时间"
prop="create_time" prop="create_time"
@ -172,63 +173,6 @@
/> />
</el-form-item> </el-form-item>
</el-col> </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-row>
</el-form> </el-form>
<template #footer> <template #footer>
@ -251,17 +195,6 @@
hidePagination hidePagination
> >
<el-table-column type="index" width="50" /> <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 <el-table-column
label="产出物料" label="产出物料"
prop="material_out_name" prop="material_out_name"
@ -288,7 +221,6 @@
width="100px" width="100px"
> >
<template #default="scope"> <template #default="scope">
<!-- 批次 v-if="mlogItem.submit_time == null&&mlogItem.material_out_&&mlogItem.material_out_.tracking==10" -->
<el-link <el-link
:underline="false" :underline="false"
type="primary" type="primary"
@ -300,7 +232,7 @@
<el-link <el-link
:underline="false" :underline="false"
type="primary" 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')" @click="table_out_check_single(scope.row,'outs')"
>详情</el-link> >详情</el-link>
</template> </template>
@ -336,6 +268,7 @@
ref="saveDialog" ref="saveDialog"
:mlog="mlogId" :mlog="mlogId"
:mgroup="mgroup" :mgroup="mgroup"
:isfix = "mlogItem.is_fix"
:routeId ="routeId" :routeId ="routeId"
:tracking="tracking" :tracking="tracking"
:materialIn="materialIn" :materialIn="materialIn"
@ -356,6 +289,8 @@
ref="checkDialogSingle" ref="checkDialogSingle"
:mlogb="mlogb" :mlogb="mlogb"
:wm = "wm" :wm = "wm"
:mgroup="mgroup"
:mgroupName= "mlogItem.mgroup_name"
:isSubmit="isSubmit" :isSubmit="isSubmit"
:batchNumber="batchNumber" :batchNumber="batchNumber"
:handle_user="handle_user" :handle_user="handle_user"
@ -378,6 +313,12 @@
<print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/> <print :baseData="mlogItem" :tableData="tableData" :tableData2="tableData2" type="102" @closePrint="printVisible=false"/>
</el-dialog> </el-dialog>
</div> </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> </el-drawer>
</template> </template>
<script> <script>
@ -467,6 +408,7 @@ export default {
}, },
], ],
}, },
route_file:null,
handle_date:'', handle_date:'',
handle_user:'', handle_user:'',
wm:'', wm:'',
@ -484,6 +426,7 @@ export default {
defectlist:[], defectlist:[],
batchNumber:'', batchNumber:'',
isSubmit:false, isSubmit:false,
fileVisible:false,
}; };
}, },
mounted() { mounted() {
@ -504,7 +447,6 @@ export default {
let that = this; let that = this;
that.$API.wpm.mlog.item.req(that.mlogId).then((res) => { that.$API.wpm.mlog.item.req(that.mlogId).then((res) => {
that.mlogItem = res; that.mlogItem = res;
console.log('that.mlogItem',that.mlogItem);
that.routeId = res.route; that.routeId = res.route;
that.tracking = res.material_in_.tracking; that.tracking = res.material_in_.tracking;
if(res.test_file!==null){ if(res.test_file!==null){
@ -520,13 +462,19 @@ export default {
that.$API.wpm.mlogb.list.req(that.paramsOut).then((res) => { that.$API.wpm.mlogb.list.req(that.paramsOut).then((res) => {
that.tableData2 = 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) { setData(data) {
Object.assign(this.form, data); Object.assign(this.form, data);
this.getRoute(data.id); // this.getRoute(data.id);
},
showFile(){
this.fileVisible = true;
}, },
// //
mlogUpdate() { mlogUpdate() {
@ -604,7 +552,7 @@ export default {
that.handle_date=that.mlogItem.handle_date; that.handle_date=that.mlogItem.handle_date;
that.handle_user = that.mlogItem.handle_user; that.handle_user = that.mlogItem.handle_user;
that.dialog.check_single = true; 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)=>{ that.$API.qm.qct.list.req({qctmat__material:row.material_out,page:0}).then((res)=>{
if(res.length>0){ if(res.length>0){
that.qct = res[0].id; that.qct = res[0].id;
@ -703,4 +651,13 @@ export default {
}; };
</script> </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" style="padding: 0 10px"
> >
<el-row> <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-form-item label="生产类型" prop="mtype">
<el-select <el-select
v-model="form.mtype" v-model="form.mtype"
@ -57,7 +57,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-form-item label="关联任务" prop="mtask">
<el-select <el-select
v-model="form.mtask" v-model="form.mtask"
@ -76,7 +76,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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-form-item label="工艺路线">
<el-select <el-select
v-model="form.route" v-model="form.route"
@ -246,6 +246,7 @@ const defaultForm = {
mgroup:'', mgroup:'',
mtask:'', mtask:'',
oinfo_json:{}, oinfo_json:{},
is_fix:false,
}; };
export default { export default {
@ -322,6 +323,7 @@ export default {
{ id: 10, name: "自产" }, { id: 10, name: "自产" },
{ id: 20, name: "外协" }, { id: 20, name: "外协" },
], ],
mlogtype:"",
visible: false, visible: false,
isSaveing: false, isSaveing: false,
options: [], options: [],
@ -400,9 +402,14 @@ export default {
}); });
}, },
// //
open(mode = "add") { open(mode = "add",type) {
this.mode = mode; this.mode = mode;
this.visible = true; this.visible = true;
if(type!==''&&type!==undefined&&type!==null){
this.mlogtype = type;
this.form.mtype=10;
this.form.is_fix=true;
}
return this; return this;
}, },
// //
@ -422,8 +429,8 @@ export default {
}else{ }else{
setTimeout(() => { setTimeout(() => {
that.testitems.forEach((item) => { that.testitems.forEach((item) => {
item.value = data.oinfo_json[item.id]; item.value = data.oinfo_json[item.id];
}); });
},500) },500)
} }
} }

View File

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

View File

@ -4,163 +4,331 @@
v-model="visible" v-model="visible"
:size="'90%'" :size="'90%'"
destroy-on-close destroy-on-close
:close-on-click-modal="false"
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<el-container> <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-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 <sc-form-table
hideDelete hideDelete
id="mlogbwlist" id="mlogbwlist"
:tableHeight="tableHeight" :tableHeight="tableHeight"
v-model="mlogbwlist" v-model="mlogbwlist"
:addTemplate="addTemplate" :addTemplate="addTemplate"
placeholder="暂无数据" placeholder="暂无数据"
> :hideAdd="hideAdd"
<el-table-column prop="number" label="物料编号" fixed min-width="120px"> >
<template #default="scope"> <el-table-column prop="number" label="物料编号" fixed min-width="120px">
<span v-if="!scope.row.isEdit">{{ scope.row.number }}</span> <template #default="scope">
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input> <!-- <span v-if="!scope.row.isEdit">{{ scope.row.number }}</span>
<el-select <el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input> -->
v-if="scope.row.isEdit&&mode == 'ins'" <el-select
v-model="scope.row.wpr" v-if="scope.row.isEdit&&mode == 'ins'"
placeholder="动态成品" v-model="scope.row.wpr"
clearable placeholder="动态成品"
style="width: 100%" clearable
@change="optionChange(scope.row)" style="width: 100%"
> @change="optionChange(scope.row)"
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
> >
</el-option> <el-option
</el-select> v-for="item in options"
</template> :key="item.id"
</el-table-column> :label="item.number"
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px"> :value="item.id"
<template #default="scope"> >
<el-input-number </el-option>
v-if="item.testitem_field_type=='input-number'" </el-select>
v-model="scope.row[item.testitem_name]" <span v-else>{{ scope.row.number }}</span>
:min="0" </template>
:disabled="!scope.row.isEdit" </el-table-column>
class="width-100" <el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
controls-position="right" <template #default="scope">
@change="defectCountSun(scope.row)" <el-input-number
> v-if="item.testitem_field_type=='input-number'"
</el-input-number> v-model="scope.row[item.testitem_name]"
<el-input-number :disabled="!scope.row.isEdit||!item.canEdit"
v-if="item.testitem_field_type=='input-int'" class="width-100"
v-model="scope.row[item.testitem_name]" controls-position="right"
:min="0" @change="defectCountSun(scope.row)"
: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-input-number>
</el-select> <el-input-number
<el-select v-if="item.testitem_field_type=='input-int'"
v-if="item.testitem_field_type=='selects-text'" v-model="scope.row[item.testitem_name]"
v-model="scope.row[item.testitem_name]" :min="0"
clearable :disabled="!scope.row.isEdit||!item.canEdit"
multiple class="width-100"
class="width-100" controls-position="right"
:disabled="!scope.row.isEdit" @change="defectCountSun(scope.row)"
@change="defectCountSun(scope.row)"
>
<el-option
v-for="item1 in item.testitem_choices"
:key="item1"
:label="item1"
:value="item1"
> >
</el-option> </el-input-number>
</el-select> <el-input
</template> v-if="item.testitem_field_type=='input-text'"
</el-table-column> v-model="scope.row[item.testitem_name]"
<el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="80px"> class="width-100"
<template #default="scope"> :disabled="!scope.row.isEdit||!item.canEdit"
<el-switch @change="defectCountSun(scope.row)"
:disabled="!scope.row.isEdit" >
v-model="scope.row[item.defect_name]" </el-input>
style="--el-switch-on-color: red" <el-select
@change="switchChange(scope.row, item)" v-if="item.testitem_field_type=='select-text'"
></el-switch> v-model="scope.row[item.testitem_name]"
</template> clearable
</el-table-column> class="width-100"
<el-table-column prop="note" label="备注" width="80px"> :disabled="!scope.row.isEdit||!item.canEdit"
<template #default="scope"> @change="defectCountSun(scope.row)"
<span v-if="!scope.row.isEdit">{{ scope.row.note }}</span> >
<el-input v-else v-model="scope.row.note" placeholder="备注"></el-input> <el-option
</template> v-for="item0 in item.testitem_choices"
</el-table-column> :key="item0"
<el-table-column prop="open" label="操作" width="90" align="center" fixed="right" v-if="!isSubmit"> :label="item0"
<template #default="scope"> :value="item0"
<el-link >
v-if="scope.row.isEdit" </el-option>
type="primary" </el-select>
size="small" <el-select
@click="formTableSave(scope.row)" v-if="item.testitem_field_type=='selects-text'"
>保存</el-link v-model="scope.row[item.testitem_name]"
> clearable
<el-link multiple
v-if="scope.row.isEdit" class="width-100"
type="danger" :disabled="!scope.row.isEdit||!item.canEdit"
size="small" @change="defectCountSun(scope.row)"
style="margin-left: 5px;" >
@click="formTableCancel(scope.row)" <el-option
>取消</el-link v-for="item1 in item.testitem_choices"
> :key="item1"
<el-link :label="item1"
v-else :value="item1"
type="primary" >
size="small" </el-option>
@click="formTableEdit(scope.row)" </el-select>
>编辑</el-link </template>
> </el-table-column>
<el-link <el-table-column prop="note" :label="item.defect_name" v-for="item in qct_defects" :key="item.id" width="120px">
v-if="!scope.row.isEdit" <template #default="scope">
type="danger" <el-switch
size="small" :disabled="!scope.row.isEdit||!item.canEdit"
style="margin-left: 5px;" v-model="scope.row[item.defect_name]"
@click="formTableDel(scope.row.id)" style="--el-switch-on-color: red"
>删除</el-link @change="switchChange(scope.row, item)"
> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
</sc-form-table> <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-main>
</el-container> </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> </el-drawer>
</template> </template>
<script> <script>
import mockData from "./mock.json";
export default { export default {
props: { props: {
mlogb: { mlogb: {
@ -183,11 +351,22 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroup:{
type: String,
default: "",
},
mgroupName:{
type:String,
default:"",
},
isSubmit:{ isSubmit:{
type: Boolean, type: Boolean,
default: false, default: false,
}, },
}, },
// components: {
// checkDrawer
// },
emits: ["success", "closed"], emits: ["success", "closed"],
data() { data() {
return { return {
@ -198,21 +377,54 @@ export default {
}, },
mode:'ins', mode:'ins',
// //
form: {}, form: {
test_user:"",
equipment:"",
cd_req_addr:"",//
equipment_name:"",
testitemids : [],
defectids : [],
},
test_user_name:"",
qct:"", qct:"",
mgroup: "", values:"",
wprNumber:"",
wprInputText:"",
params: {mlogb:'',page:0}, params: {mlogb:'',page:0},
hideAdd: true,
visible: false, visible: false,
setVisible:false,
multipleSet:false,
checkVisible:false,
descriptionVisible:false,
options:[], options:[],
qct_defects:[], qct_defects:[],
qct_testitems:[], qct_testitems:[],
mlogbwlist:[], mlogbwlist:[],
equipmentOptions:[],
process_type:"",
addTemplate:{ addTemplate:{
mlogb: "", mlogb: "",
number: "", number: "",
note: "", note: "",
isEdit: true, 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, tableHeight:500,
apiObjPrint:this.$API.cm.labelmat.fromWm, apiObjPrint:this.$API.cm.labelmat.fromWm,
printer_name:localStorage.getItem("printer_name") printer_name:localStorage.getItem("printer_name")
@ -220,21 +432,40 @@ export default {
}, },
mounted() { mounted() {
let that = this; 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.params.mlogb = that.addTemplate.mlogb = that.mlogb;
that.currentDate = this.$TOOL.dateFormat2(new Date());
// console.log(that.currentDate);
}, },
methods: { methods: {
open(mode = "ins",qct = '') { open(mode = "ins",qct = '') {
let that = this; let that = this;
this.mode = mode; this.mode = mode;
this.qct = qct; this.qct = qct;
that.getOptions(); if(that.mode == 'ins'){//
that.getdefects(); 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; this.visible = true;
setTimeout(() => { setTimeout(() => {
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20; this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
},500) },500)
},
getEquipments(){
let that = this;
that.$API.em.equipment.list.req({page:0}).then((res) => {
that.equipmentOptions = res;
})
}, },
getdefects(){ getdefects(){
let that = this; let that = this;
@ -243,12 +474,17 @@ export default {
that.qct_defects = []; that.qct_defects = [];
res.qct_defects.forEach((item) => { res.qct_defects.forEach((item) => {
that.addTemplate[item.defect_name] = false; 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 = []; that.qct_testitems = [];
res.qct_testitems.forEach((item2) => { res.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2); let obj2 = Object.assign({}, item2);
obj2.value = ''; obj2.value = '';
obj2.canEdit = that.process_type=='20'?false:true;
obj2.addto_wpr = item2.addto_wpr; obj2.addto_wpr = item2.addto_wpr;
if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){ if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){
obj2.value = 0; obj2.value = 0;
@ -262,6 +498,7 @@ export default {
} }
that.qct_testitems.push(obj2); that.qct_testitems.push(obj2);
}) })
that.qct_testitems_origin = that.qct_testitems;
that.getList(); that.getList();
}) })
}else{ }else{
@ -278,10 +515,8 @@ export default {
let that = this; let that = this;
that.options.forEach((item) => { that.options.forEach((item) => {
if(item.id == row.wpr){ if(item.id == row.wpr){
console.log('item',item);
let index = that.mlogbwlist.indexOf(row); let index = that.mlogbwlist.indexOf(row);
that.mlogbwlist[index].number = item.number; that.mlogbwlist[index].number = item.number;
// that.mlogbwlist[index].wpr = item.id;
} }
}) })
}, },
@ -319,21 +554,30 @@ export default {
} }
that.mlogbwlist.push(obj); that.mlogbwlist.push(obj);
}) })
console.log('mlogbwlistmlogbwlist',that.mlogbwlist);
} }
}) })
}, },
// //
formTableSave(row) { formTableSave(row) {
let that = this; let that = this;
let obj = {}; let obj = {};
obj.number = row.number; obj.number = row.number;
obj.mlogb = row.mlogb; obj.mlogb = row.mlogb;
obj.wpr = row.wpr; obj.wpr = row.wpr;
obj.note = row.note; 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 //qct
if(that.qct!==null&&that.qct!==''){ if(that.qct!==null&&that.qct!==''){
// //
console.log('row',row);
if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){ if(row.ftest!==null&&row.ftest!==undefined&&row.ftest!==''){
console.log('已填过'); console.log('已填过');
obj.ftest =row.ftest; obj.ftest =row.ftest;
@ -343,16 +587,15 @@ export default {
row.ftest.ftestitems.forEach((item1) => { row.ftest.ftestitems.forEach((item1) => {
item1.test_val_json = row[item1.testitem_name]; item1.test_val_json = row[item1.testitem_name];
}) })
console.log('obj',obj);
}else{// }else{//
console.log('未填过'); console.log('未填过');
obj.ftest = {}; obj.ftest = {};
obj.ftest.ftestitems = []; obj.ftest.ftestitems = [];
obj.ftest.ftestdefects = []; obj.ftest.ftestdefects = [];
obj.ftest.qct = that.qct; 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; obj.ftest.test_user = that.handle_user;
that.qct_defects.forEach((item) => { that.qct_defects_origin.forEach((item) => {
let itemObj = {}; let itemObj = {};
itemObj.defect = item.defect; itemObj.defect = item.defect;
itemObj.test_user = that.handle_user; 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){ if(row.id!==''&&row.id!==undefined&&row.id!==null){
obj.id = row.id; obj.id = row.id;
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => { that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
@ -398,6 +642,7 @@ export default {
formTableEdit(row) { formTableEdit(row) {
this.mlogbwlist.forEach((item, index) => { this.mlogbwlist.forEach((item, index) => {
if (item.id == row.id) { if (item.id == row.id) {
// console.log('row',row);
this.mlogbwlist[index].isEdit = true; this.mlogbwlist[index].isEdit = true;
} }
}); });
@ -419,11 +664,8 @@ export default {
}, },
switchChange(row,item){ switchChange(row,item){
let that = this; let that = this;
let obj = {}; let index = that.mlogbwlist.indexOf(row);
obj = Object.assign({},item); that.mlogbwlist[index][item.defect_name] = row[item.defect_name];
// that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
// })
}, },
// //
mlogbwSubmit() { mlogbwSubmit() {
@ -441,8 +683,8 @@ export default {
defectCountSun(row){ defectCountSun(row){
let that = this; let that = this;
let index = that.mlogbwlist.indexOf(row); let index = that.mlogbwlist.indexOf(row);
that.qct_defects.forEach(item => { that.qct_defects_origin.forEach(item => {
console.log('item.rule_expression',item.rule_expression); // console.log('item.rule_expression',item.rule_expression);
if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){
let str = item.rule_expression.replace(/`/g, ''); let str = item.rule_expression.replace(/`/g, '');
str = str.replace(/\${(.*?)}/g, 'row.\$1') 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> </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'" v-auth="'mlog.create'"
>新增</el-button >新增</el-button
> >
<el-button
type="primary"
icon="el-icon-plus"
@click="table_rework"
v-auth="'mlog.create'"
>返工</el-button
>
</div> </div>
<div class="right-panel"> <div class="right-panel">
<el-input <el-input
style="margin-right: 5px" style="margin-right: 5px"
@ -45,6 +53,10 @@
min-width="130" min-width="130"
fixed 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>
<el-table-column <el-table-column
label="预计工时" label="预计工时"
@ -267,11 +279,22 @@ export default {
this.$refs.saveDialog.open("add"); this.$refs.saveDialog.open("add");
}); });
}, },
table_rework(){
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add","rework");
});
},
// //
table_edit(row) { table_edit(row) {
this.dialog.save = true; this.dialog.save = true;
this.$nextTick(() => { 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> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="可用批" v-if="mgroup_name!='切片'"> <el-table-column label="可用批" v-if="mgroupName!='切片'">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -50,15 +50,6 @@
@click="mtask_submit(scope.row)" @click="mtask_submit(scope.row)"
>提交 >提交
</el-button> </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> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
@ -103,6 +94,14 @@ export default {
type: String, type: String,
default: "", default: "",
}, },
mgroupId:{
type: String,
default: "",
},
deptId:{
type: String,
default: "",
}
}, },
components: { components: {
deliverDrawer, deliverDrawer,
@ -130,14 +129,6 @@ export default {
34: "danger", 34: "danger",
40: "success", 40: "success",
}, },
// state_: {
// 10: "",
// 20: "",
// 30: "",
// 34: "",
// 40: "",
// },
deptId: null,
mgroup_name:'', mgroup_name:'',
deliverShow:false, deliverShow:false,
}; };
@ -154,7 +145,11 @@ export default {
// }, // },
}, },
mounted() { 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: { methods: {
getMgroupInfo(){ getMgroupInfo(){
@ -165,8 +160,6 @@ export default {
if(res.length>0){ if(res.length>0){
that.mgroupId = res[0].id; that.mgroupId = res[0].id;
that.deptId = res[0].belong_dept; that.deptId = res[0].belong_dept;
that.processId = res[0].process;
that.processCate = res[0].process_cate;
that.params.mgroup = res[0].id; that.params.mgroup = res[0].id;
that.apiObj = this.$API.pm.mtask.list; that.apiObj = this.$API.pm.mtask.list;
that.$refs.table.refresh(); that.$refs.table.refresh();