This commit is contained in:
caoqianming 2025-04-10 12:36:28 +08:00
commit 748c15042c
27 changed files with 1259 additions and 254 deletions

View File

@ -1,3 +1,14 @@
## 2.6.2025040316
- fix: 问题修复
- 出入库时物料选择更换组件xselect [shijing]
- 批次统计完善 [shijing]
- fix性能检验析晶选型纠正 [shijing]
- dag优化 [shijing]
- 成品检验时批次选择实用xselect组件 [shijing]
- 登录页展示前后端版本号 [shijing]
- 扭转工段mlog中不填设备和人员mlogb中选择设备、操作人、开始时间和结束时间 [shijing]
- 检验表中添加检验物料搜索时展示full_name [shijing]
## 2.6.2025040209
- feat: 新增功能

View File

@ -440,8 +440,8 @@ export default {
},
copy:{
name: "复制",
req: async function (id,data) {
return await http.post(`${config.API_URL}/mtm/routepack/${id}/copy/`,data)
req: async function (data) {
return await http.post(`${config.API_URL}/mtm/routepack/copy/`,data)
}
},
togglestate:{

View File

@ -58,7 +58,7 @@ export default {
let that = this;
that.$nextTick(() => {
if(that.g!==null){
that.updataGraph();
that.updateGraph();
}else{
that.g = new dagreD3.graphlib.Graph().setGraph({
rankdir: that.rankdir,
@ -104,7 +104,6 @@ export default {
let mySvgWdith =document.getElementsByClassName("output")[0].getBoundingClientRect().width+150 ;
document.getElementById('mySvg').setAttribute("height", mySvgHeight);
document.getElementById('mySvg').setAttribute("width", mySvgWdith);
svg.selectAll("g.node").on("click", function(event, d) {
//
const node = d3.select(this);
@ -125,15 +124,17 @@ export default {
});
//
function onNodeClick(nodeData) {
console.log("Node clicked:", nodeData);
this.$emit("nodeClick", nodeData);
let batch = "";
that.nodes.forEach((item) => {
if (item.id === nodeData){
batch = item.label;
}
})
that.$emit("nodeClick", batch);
//
}
}
})
},
updataGraph(){
},
//
updateGraph() {

View File

@ -6,7 +6,7 @@ const DEFAULT_CONFIG = {
DASHBOARD_URL: "/dashboard",
//版本号
APP_VER: "2.6.2025040209",
APP_VER: "2.6.2025040813",
//内核版本号
CORE_VER: "1.6.9",

202
src/views/home/chatTest.vue Normal file
View File

@ -0,0 +1,202 @@
<template>
<div style="padding:0;width: 99%;height: 99%;border-radius: 0.375rem;margin: 0.5vh auto 0;box-shadow: 0 4px 6px -1px rgba(0, 0, 0 ,.1), 0 2px 4px -2px rgba(0, 0, 0 ,.1);">
<div style="width: 100%;height: 100%;position: relative; background: #fff;border-radius: 6px;">
<div style=" max-width: 260px;width: 260px;border-right: 1px solid rgb(229, 231, 235);box-sizing: border-box;height: 100%;position: absolute;left: 0;top: 0;">
<main style="display: flex;flex-direction: column;min-height: 0;flex:1 1 0%">
<el-button type="line" style="margin: 1rem;">新建聊天</el-button>
<div style="padding-bottom: 1rem;overflow: hidden;flex: 1 1 0%;min-height: 0px;">
<div style="overflow: hidden; position: relative;z-index: auto;height: 100%;width: 100%;padding: 0 1rem;"></div>
</div>
</main>
<footer style="padding: 1rem;border-top: 1px solid rgb(229, 231, 235);">
<div style="align-items: center;display: flex;">
<img style="width: 2.5rem;height: 2.5rem;border-radius: 50%;flex-shrink: 0;" src="img/icon_nbyg.png" alt="">
<div style="font-weight: 700;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;flex: 1 1 0%;min-width: 0px;margin-left: 0.5rem;"> {{ userName }}</div>
</div>
</footer>
</div>
<div style="padding-left: 260px;height: 100%;box-sizing: border-box;position: relative;z-index: auto;">
<el-container>
<el-main>
<div>
<div class="right_layout_myselfChat">
<div id="datatime" style="flex:2;font-size:13px;color:lightgray"></div>
<div style="flex:1">
<div class="user_icons" style="width:40px;height:40px;"></div>
</div>
</div>
<div class="myself_chat">
前端有哪些性能优化
</div>
</div>
</el-main>
<el-footer style="padding: 1rem;height: 5rem;text-align: left;border-top: 1px solid rgb(229, 231, 235);">
<div style="display: flex;align-items: center;justify-content: space-between;">
<div style="width: 100%;height:100%;padding: 0 0.5rem;">
<el-input class="search_input" placeholder="来说点什么吧..."></el-input>
</div>
<el-button icon="el-icon-promotion" size="success"></el-button>
</div>
</el-footer>
</el-container>
</div>
</div>
<!-- <el-container>
<el-side style=" max-width: 260px;width: 260px;border-right: 1px solid #ddd;box-sizing: border-box;">
<div class="common-layout">
<el-container>
<el-header style="padding:0 6px 0 0;"></el-header>
<el-main style="padding:0 6px 0 0;">
<div style="display: flex;flex-direction: column;height: 100%;">
<el-button type="line" style="margin: 1rem;">新建聊天</el-button>
<div class="chat_list">
<div class="chat_list_item" v-for="(item,index) in 10" :key="index">
<div class="chat_list_item_icon" style="border:1px solid rgb(75, 158, 95);border-radius:20% 20% 0 20%;color:rgb(75,158,95);">...</div>
<div class="chat_list_item_text" style="flex:8;color:rgb(75,158,95);">前端有哪些性能优化</div>
</div>
</div>
</div>
</el-main>
<el-footer>
<div style="align-items: center;display: flex;">
<img style="width: 2.5rem;height: 2.5rem;border-radius: 50%;margin-right: 1rem;" src="img/icon_nbyg.png" alt="">
<div style="font-weight: 700;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;"> {{ userName }}</div>
</div>
</el-footer>
</el-container>
</div>
</el-side>
<el-main>
<el-container>
<el-main>
<div class="right_layout_son">
<div class="right_layout_myselfChat">
<div id="datatime" style="flex:2;font-size:13px;color:lightgray"></div>
<div style="flex:1">
<div class="user_icons" style="width:40px;height:40px;"></div>
</div>
</div>
<div class="myself_chat">
前端有哪些性能优化
</div>
</div>
</el-main>
<el-footer>
<div class="right_layout_son_ipt">
<input class="ipt" type="text" placeholder="来说点什么吧...">
<button class="btn">发送</button>
</div>
</el-footer>
</el-container>
</el-main>
</el-container> -->
</div>
</template>
<script>
// import xSelects from "@/components/xtSelect/index2.vue";
export default {
name: "testx",
components: {},
data() {
return {
userName: "",
};
},
mounted() {
var userInfo = this.$TOOL.data.get("USER_INFO");
this.userName = userInfo.username;
},
methods: {
},
};
</script>
<style scoped>
.right_layout {
flex: 6;
}
.icons {
background-color: white;
z-index: 99;
position: absolute;
font-size: 20px;
border-radius: 50%;
border: 1px solid lightgray;
padding: 0px 5px;
box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
color: gray;
}
.icons_display {
top: 48vh;
right: -15px;
}
.icons_hideen {
top: 48vh;
left: 10px;
display: none;
}
.new_chat_text {
border: 1px solid #4b9e5f;
display: flex;
}
.user_icons {
width: 50px;
height: 50px;
background: linear-gradient(-135deg, #0000cc, #009dff);
border: 1px solid lightblue;
border-radius: 50%;
}
.right_layout_flex{
display:flex;
justify-content: center;
align-items: center;
}
.right_layout_son{
margin:0 auto 0 auto;
width:100vh;
height:98vh;
/* border:1px solid gray; */
position: relative;
}
.right_layout_son_ipt{
position: absolute;
bottom:0;
}
.btn{
border:none;
padding:10px 15px;
background-color: #18a058;
border-radius: 1px;
color:white;
}
.search_input{
width: 100%;
padding:0.5rem 1rem;
/* border:1px solid lightgray; */
}
.right_layout_myselfChat{
width:200px;
position: absolute;
top:5px;
right:0;
display:flex;
}
.myself_chat{
position: absolute;
top:30px;
right:80px;
padding:10px 20px;
border-radius: 10px;
background-color: #7ae1b6;
opacity: 0.8;
}
</style>

View File

@ -799,7 +799,6 @@
<el-input-number
v-if="item.testitem_field_type=='input-number'"
v-model="scope.row[item.testitem_name]"
:min="0"
:disabled="!scope.row.isEdit"
class="width-100"
controls-position="right"
@ -809,7 +808,6 @@
<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"
@ -1042,7 +1040,7 @@ export default {
//
this.qct_testitems.forEach(item => {
if (!(item.testitem_name in this.form)) {
this.form[item.testitem_name] = ''
this.form[item.testitem_name] = null;
}
});
},
@ -1090,17 +1088,17 @@ export default {
that.qct_testitems = [];
res.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
obj2.value = null;
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;
obj2.value =null;
that.addTemplate[item2.testitem_name] = null;
}
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.addTemplate[item2.testitem_name] = null;
}
that.qct_testitems.push(obj2);
})
@ -1123,7 +1121,7 @@ export default {
if(res0.qct_defects.length>0){
res0.qct_defects.forEach((item1) => {
let obj = Object.assign({}, item1);
obj.value = '';
obj.value = false;
that.qct_defects.push(obj);
})
}else{
@ -1132,7 +1130,7 @@ export default {
if(res0.qct_testitems.length>0){
res0.qct_testitems.forEach((item2) => {
let obj2 = Object.assign({}, item2);
obj2.value = '';
obj2.value = null;
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);
@ -1186,11 +1184,12 @@ export default {
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] = "";
}
obj[item2.testitem_name] = null;
// if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
// obj[item2.testitem_name] = null;
// }else{
// obj[item2.testitem_name] = "";
// }
})
}
that.mioitemwList.push(obj);
@ -1394,27 +1393,32 @@ export default {
if(row.ftest!==null){
ftestdefects = row.ftest.ftestdefects;
ftestdefects.forEach((item) => {
item.test_user = that.formbw.test_user;
item.test_date = that.formbw.test_date;
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]:"";
item1.test_user = that.formbw.test_user;
item1.test_date = that.formbw.test_date;
item1.test_val_json = row[item1.testitem_name]?row[item1.testitem_name]:null;
})
}else{
that.qct_testitems.forEach((item) => {
let obj0 = {};
obj0.testitem = item.testitem;
obj0.test_user = row.test_user;
obj0.test_user = that.formbw.test_user;
obj0.test_date = that.formbw.test_date;
obj0.testitem_name = item.testitem_name;
obj0.test_val_json = row[item.testitem_name]?row[item.testitem_name]:"";
obj0.test_val_json = row[item.testitem_name]?row[item.testitem_name]:null;
ftestitems.push(obj0);
})
that.qct_defects.forEach((item1) => {
let obj1 = {};
obj1.defect = item1.defect;
obj1.test_user = row.test_user;
obj1.test_user = that.formbw.test_user;
obj1.defect_name = item1.defect_name;
obj1.test_date = that.formbw.test_date;
obj1.has = row[item1.defect_name]?row[item1.defect_name]:false;
ftestdefects.push(obj1);
})

View File

@ -15,7 +15,18 @@
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="物料" prop="material">
<el-select
<xtSelect
:apiObj="apiObj"
v-model="form.material"
v-model:obj="selectObj"
:labelField="'full_name'"
style="width:100%"
:params="query"
@change="selectMaterialChange"
>
<el-table-column label="物料" prop="full_name"></el-table-column>
</xtSelect>
<!-- <el-select
v-model="selectMaterial"
value-key="id"
clearable
@ -40,7 +51,7 @@
></span
>
</el-option>
</el-select>
</el-select> -->
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
@ -83,7 +94,6 @@
style="width: 100%"
@change="selectBatchChange"
@clear="selectBatchClear"
:disabled="selectBatchDisable"
>
<el-option
v-for="item in batchOptions"
@ -255,6 +265,7 @@ export default {
},
],
},
selectObj:{},
visible: false,
isSaveing: false,
materialOptions: [],
@ -272,6 +283,7 @@ export default {
mioitemw:[],
project_code:'',
mTracking:10,
apiObj:this.$API.mtm.material.list,
};
},
mounted() {
@ -373,9 +385,11 @@ export default {
} else {
query = { page: 0 ,is_hidden:false};
}
this.$API.mtm.material.list.req(query).then((res) => {
this.materialOptions = res;
});
this.query = query;
this.apiObj=this.$API.mtm.material.list;
// this.$API.mtm.material.list.req(query).then((res) => {
// this.materialOptions = res;
// });
},
async initAssemb(item) {
this.selectBatchDisable = true;
@ -423,15 +437,14 @@ export default {
})
},
selectMaterialChange(item) {
selectMaterialChange() {
var that = this;
var type = this.form.type;
var material = item.id;
that.form.material = material;
that.mTracking = item.tracking;
that.form.material = that.selectObj.id;
that.mTracking = that.selectObj.tracking;
if (type == "do_in") {
if (item.is_assemb) {
this.initAssemb(item);
if (that.selectObj.is_assemb) {
this.initAssemb(that.selectObj);
} else {
this.selectBatchDisable = false;
this.components = [];

View File

@ -62,7 +62,8 @@
<el-button type="default" @click="faceLogin">刷脸登录</el-button>
</div> -->
<!-- <div class="copyright">Copyright © 2024 {{ baseConfig.base_right }}</div> -->
<div class="version">VERSION @ {{ config_index.APP_VER }}</div>
<div class="version version_web">WEB版本{{ config_index.APP_VER }}</div>
<div class="version ">SERVER版本{{ baseConfig.sys_version }}</div>
</div>
</div>
</div>
@ -406,10 +407,13 @@ export default {
}
.version {
position: absolute;
bottom: 30px;
left: 30px;
font-size: 16px;
color: #fff;
bottom: 15px;
right: 30px;
font-size: 14px;
color: rgb(36, 93, 116);
}
.version_web{
bottom: 40px;
}
.copyright {
position: absolute;

View File

@ -93,14 +93,14 @@
@click="table_show(scope.row, scope.$index)"
>查看
</el-button>
<!-- <el-button
<el-button
link
type="success"
size="small"
v-if="scope.row.state == 30"
@click="table_copy(scope.row)"
>复制
</el-button> -->
</el-button>
<el-button
link
type="success"
@ -127,6 +127,57 @@
</scTable>
</el-main>
</el-container>
<el-dialog title="复制工艺" v-model="dialogVisible">
<el-form ref="dialogForm" :model="form" :rules="rules" label-position="right" label-width="80px">
<el-row>
<el-col>
<el-form-item label="名称" prop="new_name">
<el-input
v-model="form.new_name"
type="text"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="原料" prop="material_in">
<el-select
v-model="form.material_in"
style="width: 100%"
filterable
>
<el-option
v-for="item in materialIn"
:key="item.id"
:label="item.full_name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="产品" prop="material_out">
<el-select
v-model="form.material_out"
style="width: 100%"
filterable
>
<el-option
v-for="item in materialOut"
:key="item.id"
:label="item.full_name"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button type="primary" :loading="isSaveing" @click="form_save">保存</el-button>
<el-button @click="dialogVisible = false">取消</el-button>
</template>
</el-dialog>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@ -183,9 +234,22 @@ export default {
search: "",
keyword: null,
},
form:{
routepack:"",
new_name:"",
material_in:"",
material_out:""
},
rules: {
new_name:[{required: true,message: "请填写新工艺名称",trigger: "blur"}],
material_in:[{required: true,message: "请选择新工艺所用原料",trigger: "blur"}],
material_out:[{required: true,message: "请选择新工艺最终产品",trigger: "blur"}],
},
nodes:[],
edges:[],
timeRange: [],
materialIn: [],
materialOut: [],
filteType: "all",
stateOptions: [
{
@ -209,13 +273,28 @@ export default {
filterType: "all",
isSaveing:false,
limitedWatch:false,
dialogVisible:false,
};
},
mounted() {
let userInfo = this.$TOOL.data.get("USER_INFO");
this.userId = userInfo.id;
this.getMaterialIn();
this.getMaterialOut();
},
methods: {
getMaterialIn() {
let that = this;
that.$API.mtm.material.list.req({ page: 0, type__in: "20,30",is_hidden: false}).then((res) => {
that.materialIn = res;
});
},
getMaterialOut() {
let that = this;
that.$API.mtm.material.list.req({ page: 0, type__in: "10,20",is_hidden: false}).then((res) => {
that.materialOut = res;
});
},
getType(state) {
if (state == 10) {
return "warning";
@ -252,13 +331,30 @@ export default {
},
//
table_copy(row){
this.$API.mtm.routepack.copy.req(row.id).then((res) => {
this.$message.success("复制成功");
this.$refs.table.refresh();
return res;
}).catch((err) => {
return err;
});
let that = this;
that.form.routepack = row.id;
that.form.new_name = '';
that.form.material_in = '';
that.form.material_out ='';
that.dialogVisible = true;
},
form_save(){
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
that.isSaveing = true;
that.$API.mtm.routepack.copy.req(that.form).then((res) => {
that.$message.success("复制成功");
that.$refs.table.refresh();
that.isSaveing = false;
that.dialogVisible = false;
return res;
}).catch((err) => {
that.isSaveing = false;
return err;
});
}
})
},
// handleWatch(row) {
// let that = this;

View File

@ -45,18 +45,18 @@
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="产品" prop="type">
<el-select
<span style="font-weight: 600;">{{ form.material_name }}</span>
<xtSelect
:apiObj="apiObjM"
v-model="form.material"
style="width: 100%"
filterable
v-model:obj="selectObj"
:labelField="'full_name'"
style="margin-left: 10px;"
:params = "{type__in: '10,20',is_hidden: false}"
>
<el-option
v-for="item in materials"
:key="item.id"
:label="item.full_name"
:value="item.id"
/>
</el-select>
<el-table-column label="物料" prop="full_name"></el-table-column>
</xtSelect>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
@ -134,6 +134,11 @@
</el-table-column>
<el-table-column label="输出" prop="material_out_name">
</el-table-column>
<el-table-column label="追踪方式">
<template #default="scope">
<span>{{ tracking_[scope.row.material_out_tracking] }}</span>
</template>
</el-table-column>
<el-table-column label="出材率" prop="out_rate">
</el-table-column>
<el-table-column label="工时" prop="hour_work">
@ -224,12 +229,18 @@ export default {
apiworkerObj: null,
materials: [],
apiObj: null,
apiObjM:this.$API.mtm.material.list,
query: {
routepack: "",
},
selectObj:{},
rules: {
name: [{ required: true, message: "请输入" }],
},
tracking_:{
10:"批次",
20:"单个",
},
nodes:[],
edges:[],
routepack: "",
@ -242,7 +253,7 @@ export default {
this.isSaveing = false;
this.project_code = this.$TOOL.data.get("BASE_INFO").base.base_code;
this.getInit();
this.getMaterials();
// this.getMaterials();
},
methods: {
open(mode) {

View File

@ -12,6 +12,7 @@
></el-avatar>
<h3>{{ form.base_name }}</h3>
<p>SERVER版本: {{ form.sys_version }}</p>
<p>WEB版本: {{ config.APP_VER }}</p>
</div>
</el-header>
<el-main class="nopadding">
@ -54,7 +55,7 @@
<script>
import { defineAsyncComponent } from "vue";
import config from "@/config"
export default {
name: "userCenter",
components: {
@ -65,6 +66,7 @@ export default {
},
data() {
return {
config,
form: {},
menu: [
{

View File

@ -228,7 +228,7 @@ export default {
},
state_xj: {
S: "析晶",
K: "不析晶",
R: "不析晶",
θ: "未化",
},
form: {

View File

@ -262,6 +262,13 @@ export default {
trigger: "blur",
},
],
sample_number:[
{
required: true,
message: "请输入样品编号",
trigger: "blur"
},
],
test_user: [
{
required: true,
@ -297,7 +304,7 @@ export default {
],
xjOptios: [
{ id: "S", name: "析晶" },
{ id: "K", name: "不析晶" },
{ id: "R", name: "不析晶" },
{ id: "θ", name: "未化" },
],
visible: false,

View File

@ -16,24 +16,19 @@
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="物料批次" prop="batch">
<el-select
v-model="form.batch"
placeholder="物料批次"
clearable
filterable
style="width: 100%"
@change="handleChange"
:disabled="mode != 'add'"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
<el-form-item label="物料批次" required="true">
<xtSelect
:apiObj="apiObjBatch"
v-model="form.batch"
v-model:obj="selectBatch"
:valueField="'batch'"
:labelField="'batch'"
style="width:100%"
@change="handleBatchChange"
>
<el-table-column label="物料批次" prop="batch"></el-table-column>
<el-table-column label="数量" prop="count"></el-table-column>
</xtSelect>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
@ -104,6 +99,7 @@ export default {
emits: ["success", "closed"],
data() {
return {
apiObjBatch:this.$API.inm.warehouse.batch,
apiUserObj: this.$API.system.user.list,
loading: false,
form: {
@ -126,6 +122,7 @@ export default {
},
],
},
selectBatch:null,
visible: false,
isSaveing: false,
options: [],
@ -170,46 +167,38 @@ export default {
that.options = res;
});
},
handleChange(val) {
handleBatchChange() {
let that = this;
console.log(val);
that.options.forEach((item) => {
if (item.id == val) {
that.form.count = item.count;
that.form.batch = item.batch;
that.form.material = item.material;
that.form.mb = item.id;
}
});
that.form.count = that.selectBatch.count;
that.form.batch = that.selectBatch.batch;
that.form.material = that.selectBatch.material;
that.form.mb = that.selectBatch.id;
},
//
submit() {
this.$refs.dialogForm.validate(async (valid) => {
let that = this;
that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
this.isSaveing = true;
that.isSaveing = true;
try {
if (this.mode == "add") {
this.$API.qm.ftestwork.create
.req(this.form)
.then((res) => {
this.isSaveing = false;
this.visible = false;
this.$emit("success");
this.$message.success("操作成功");
});
} else if (this.mode == "edit") {
this.$API.qm.ftestwork.update
.req(this.form.id, this.form)
.then((res) => {
this.isSaveing = false;
this.visible = false;
this.$emit("success");
this.$message.success("操作成功");
});
if (that.mode == "add") {
that.$API.qm.ftestwork.create.req(that.form).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("操作成功");
}).catch(err => {that.isSaveing = false;});
} else if (that.mode == "edit") {
that.$API.qm.ftestwork.update.req(that.form.id, that.form).then((res) => {
that.isSaveing = false;
that.visible = false;
that.$emit("success");
that.$message.success("操作成功");
}).catch(err => {that.isSaveing = false;});
}
} catch (err) {
//
this.isSaveing = false;
that.isSaveing = false;
return err;
}
}

View File

@ -37,13 +37,14 @@
<xtSelect
v-else
:apiObj="apiObj"
:labelField="'full_name'"
v-model="scope.row.material"
v-model:label="scope.row.material_name"
v-model:label="scope.row.full_name"
style="width:100%"
>
<el-table-column label="名称" prop="name"></el-table-column>
<el-table-column label="工序" prop="process_name"></el-table-column>
<el-table-column label="规格" prop="specification"></el-table-column>
<el-table-column label="物料名称" prop="full_name"></el-table-column>
<!-- <el-table-column label="工序" prop="process_name"></el-table-column>
<el-table-column label="规格" prop="specification"></el-table-column> -->
</xtSelect>
</template>
</el-table-column>

View File

@ -0,0 +1,372 @@
<template>
<el-container>
<el-side>
<el-container>
<el-header style="height: 40px;">
<el-select
v-model="query.material_start__type"
placeholder="请选择"
style="width: 90px;"
>
<el-option label="成品" :value="10"></el-option>
<el-option label="半成品" :value="20"></el-option>
<el-option label="原料" :value="30"></el-option>
</el-select>
<el-input
v-model="query.batch"
placeholder="请输入批次号"
clearable
style="width: 150px;"
>
</el-input>
<el-button type="primary" @click="search">查询</el-button>
</el-header>
<el-main style="padding: 0 1px;">
<scTable
ref="tablets"
:apiObj="apiObj"
row-key="id"
:params="query"
:query="query"
stripe
@row-click="rowClick"
hideDo
:paginationLayout="'total, sizes, jumper'"
>
<el-table-column prop="batch" label="批次号"></el-table-column>
</scTable>
</el-main>
</el-container>
</el-side>
<el-main id="elMain">
<el-container>
<el-header style="height: 40%;flex-direction: column;align-items: start;overflow: scroll;">
<p style="position: fixed;">批次流转图</p>
<scDegra
style="margin-top: 50px;"
v-if="limitedWatch"
ref="degraDialogs"
:nodes="nodes"
:edges="edges"
:rankdir="'LR'"
@nodeClick ="nodeClick"
@closeDialog="limitedWatch = false"
>
</scDegra>
</el-header>
<el-main style="height: 60%;background: #fff;">
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick">
<el-tab-pane name="mlog" label="生产日志">
<scTable
ref="tableMlog"
:apiObj="apiObj_mlog"
row-key="id"
:params="params"
:query="params"
>
<el-table-column label="#" type="index" width="50" fixed></el-table-column>
<el-table-column label="工艺路线" prop="material_out_name" min-width="130" fixed>
<template #default="scope">
<span v-if="scope.row.material_out_name!==null">{{scope.row.material_out_name}}</span>
<span v-else>返工</span>
</template>
</el-table-column>
<el-table-column
label="生产设备"
prop="equipment_name"
min-width="150"
></el-table-column>
<el-table-column label="部门/工段">
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
</el-table-column>
<el-table-column
label="处理人"
prop="handle_user_name"
width="80"
></el-table-column>
<el-table-column label="保温剩余时间" v-if="mgroup_name=='黑化'||mgroup_name=='退火'">
<template #default="scope">
{{ getRemaTime(scope.row) }}
</template>
</el-table-column>
<el-table-column
label="开始时间"
prop="work_start_time"
></el-table-column>
<el-table-column
label="结束时间"
prop="work_end_time"
></el-table-column>
<el-table-column
label="提交时间"
prop="submit_time"
></el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane name="handover" label="交接记录">
<scTable
ref="tableHandover"
:apiObj="apiObj_handover"
row-key="id"
:query="params"
:params="params"
>
<el-table-column
label="#"
type="index"
width="50"
></el-table-column>
<el-table-column type="expand">
<template #default="props">
<div style="padding-left: 50px">
<template v-for="item in props.row.handoverb" :key="item.id">
<el-descriptions :column="3">
<el-descriptions-item label="批次">
{{item.batch}}
</el-descriptions-item>
<el-descriptions-item label="数量">
{{item.count}}
</el-descriptions-item>
<el-descriptions-item label="不合格标记" v-if="item.defect_name!==null">
{{item.defect_name}}
</el-descriptions-item>
</el-descriptions>
</template>
</div>
</template>
</el-table-column>
<el-table-column
label="物料"
prop="material_name"
min-width="140"
></el-table-column>
<el-table-column label="批次" prop="batch" min-width="80">
<template #default="scope">
<el-text v-if="scope.row.handoverb.length>0" type="primary">{{scope.row.handoverb.length}}</el-text>
</template>
</el-table-column>
<el-table-column label="数量" prop="count" min-width="80"></el-table-column>
<el-table-column label="交接类型" prop="type" min-width="80">
<template #default="scope" v-if="mgroup_name=='size'||mgroup_name=='facade'">
<el-text v-if="scope.row.send_dept == deptId" type="primary">交送</el-text>
<el-text v-if="scope.row.recive_dept == deptId" type="success">接收</el-text>
</template>
<template #default="scope" v-else>
<el-text v-if="scope.row.send_mgroup == mgroupId" type="primary">交送</el-text>
<el-text v-if="scope.row.recive_mgroup == mgroupId" type="success">接收</el-text>
</template>
</el-table-column>
<el-table-column label="交接工段" min-width="80">
<template #default="scope">
<el-text v-if="scope.row.send_mgroup == mgroupId">{{scope.row.send_mgroup_name}}</el-text>
<el-text v-if="scope.row.recive_mgroup == mgroupId">{{scope.row.recive_mgroup_name}}</el-text>
</template>
</el-table-column>
<el-table-column label="交接类别" prop="type" width="80">
<template #default="scope">
<el-tag v-if="scope.row.type == 10" type="success"
>正常</el-tag
>
<el-tag v-if="scope.row.type == 20" type="warning"
>返工</el-tag
>
<el-tag v-if="scope.row.type == 30" type="primary"
>检验</el-tag
>
<el-tag v-if="scope.row.type == 40" type="danger"
>报废</el-tag
>
</template>
</el-table-column>
<el-table-column
label="交送人"
prop="send_user_name"
width="80"
></el-table-column>
<el-table-column
label="接收人"
prop="recive_user_name"
width="80"
></el-table-column>
<el-table-column
label="交接日期"
prop="send_date"
width="120"
></el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane name="winm" label="车间库存">
<scTable
ref="tableWinm"
:apiObj="apiObj_winm"
row-key="id"
:query="params"
:params="params"
>
<el-table-column type="selection"></el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag :type="wmState[scope.row.state]?.type">
{{wmState[scope.row.state]?.text}}
</el-tag>
</template>
</el-table-column>
<el-table-column label="物料名称" min-width="150">
<template #default="scope">
{{ scope.row.material_name }}
<span v-if="scope.row.material_origin != null">{{ scope.row.material_origin_name }}</span>
</template>
</el-table-column>
<el-table-column label="批次号" prop="batch" min-width="120"></el-table-column>
<el-table-column label="部门/工段">
<template #default="scope">
{{scope.row.belong_dept_name}}/{{scope.row.mgroup_name}}
</template>
</el-table-column>
<el-table-column label="数量" prop="count"></el-table-column>
<el-table-column label="生产中" prop="count_working"></el-table-column>
<el-table-column label="不合格标记" prop="defect_name"></el-table-column>
<el-table-column label="创建时间" prop="create_time" width="150"></el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane name="binm" label="仓库库存">
<scTable
ref="tableBinm"
:apiObj="apiObj_binm"
row-key="id"
stripe
:query="params_binm"
:params="params_binm"
>
<el-table-column type="index" width="50" />
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="物料名称" prop="material_name">
</el-table-column>
<el-table-column label="规格型号">
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.specification }}
{{ scope.row.material_.model }}
</span>
</template>
</el-table-column>
<el-table-column label="已完成工序">
<template #default="scope">
<span v-if="scope.row.material_">
{{ scope.row.material_.process_name }}
</span>
</template>
</el-table-column>
<el-table-column label="仓库" prop="warehouse_name">
</el-table-column>
<el-table-column label="物料存量" prop="count">
</el-table-column>
<el-table-column label="有效期" prop="expiration_date">
</el-table-column>
<el-table-column label="更新时间" prop="update_time">
</el-table-column>
</scTable>
</el-tab-pane>
</el-tabs>
</el-main>
</el-container>
</el-main>
</el-container>
</template>
<script>
import { wmState } from "@/utils/enum.js";
export default {
name: "batch_statistics",
data() {
return {
wmState,
apiObj:this.$API.wpm.batchst,
apiObj_mlog:null,
apiObj_handover:null,
apiObj_winm:null,
apiObj_binm:null,
nodes: [],
edges: [],
params:{
batch:'',
},
query:{
batch:'',
material_start__type:20,
},
params_binm:{
search:''
},
batch:'',
activeName:'',
limitedWatch:false,
};
},
mounted() {
},
methods: {
getBatches(){
},
getBatchDag(){
},
rowClick(row){
console.log('row',row)
let that = this;
that.$API.wpm.batchlog.dag.req({batch:row.batch}).then((res) => {
that.nodes = res.nodes;
that.edges = res.edges;
that.limitedWatch = true;
that.$nextTick(() => {
that.$refs.degraDialogs.open();
});
})
},
nodeClick(data){
let that = this;
console.log('nodeClick',data)
that.params.batch = data;
that.params_binm.search = data;
that.activeName = 'mlog';
if( that.apiObj_mlog !==null){
that.$refs.tableMlog.queryData(that.params);
that.$refs.tableHandover.queryData(that.params);
that.$refs.tableWinm.queryData(that.params);
that.$refs.tableBinm.queryData(that.params_binm);
}else{
that.apiObj_mlog = that.$API.wpm.mlog.list;
that.apiObj_handover = that.$API.wpm.handover.list;
that.apiObj_winm = that.$API.wpm.wmaterial.list;
that.apiObj_binm = that.$API.inm.warehouse.batch;
}
},
search(){
this.$refs.tablets.queryData(this.query)
},
handleClick(){
// switch (this.activeName) {
// case 'mlog':
// this.$refs.tableMlog.refresh();
// break;
// case 'handover':
// this.$refs.tableHandover.refresh();
// break;
// case 'winm':
// this.$refs.tableWinm.refresh();
// break;
// case 'binm':
// this.$refs.tableBinm.refresh();
// break;
// }
}
},
};
</script>
<style scoped>
</style>

View File

@ -727,6 +727,9 @@ export default {
//
mlogSubmit() {
let that = this;
if(that.mlogItem.work_end_time==''||that.mlogItem.work_end_time==null){
that.mlogItem.handle_date = that.$TOOL.dateFormat2(new Date());
}
that.$API.wpm.mlog.submit.req(that.mlogItem.id).then((res) => {
that.isSaveing = false;
that.visible = false;

View File

@ -96,7 +96,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="route_code!=='niuzhuan'">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
@ -172,7 +172,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="route_code!=='niuzhuan'">
<el-form-item
label="开始时间"
prop="work_start_time"
@ -187,8 +187,7 @@
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-col :md="12" :sm="12" :xs="24" v-if="route_code!=='niuzhuan'">
<el-form-item label="结束时间" prop="work_end_time">
<el-date-picker
v-model="form.work_end_time"
@ -306,6 +305,13 @@ export default {
trigger: "blur",
},
],
work_end_time: [
{
required: true,
message: "请选择结束时间",
trigger: "blur",
},
],
route: [
{
required: true,
@ -326,6 +332,7 @@ export default {
{ id: 20, name: "外协" },
],
mlogtype:"",
route_code:"",
visible: false,
isSaveing: false,
options: [],
@ -338,6 +345,8 @@ export default {
};
},
mounted() {
this.route_code = this.$route.path.split("/")[2];
this.form.work_start_time = this.$TOOL.dateFormat(new Date());
this.getRoute();
this.getUser();
this.getSupplier();

View File

@ -17,63 +17,134 @@
label-width="80px"
style="padding: 0 10px"
>
<el-form-item label="关联任务" v-if="!isfix">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
style="width: 100%"
@change="getMaterial"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
<el-row>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="关联任务" v-if="!isfix">
<el-select
v-model="form.mtask"
placeholder="关联任务"
clearable
class="width-100"
@change="getMaterial"
>
<el-option
v-for="item in options"
:key="item.id"
:label="item.number"
:value="item.id"
>
</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="batchs"
placeholder="批次选择"
clearable
class="width-100"
@change="changeMaterial"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col>
<el-form-item label="物料扫码" style="display: flex;">
<scScanner @scanResult="formWminChange"></scScanner>
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)" style="width: 200px;margin-left: 4px;"></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="使用数量" prop="count_use">
<el-input-number ref="codeInput" v-model="form.count_use" :min="0" clearable class="width-100"></el-input-number>
</el-form-item>
</el-col>
<!-- <el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item label="生产设备">
<el-select
v-model="form.equipment"
placeholder="生产设备"
clearable
filterable
style="width: 100%"
>
<el-option
v-for="item in optionsEq"
: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" v-if="route_code=='niuzhuan'">
<el-form-item label="操作人">
<ehsSelect
v-model="form.handle_user"
:showName="form.handle_user_name"
:apiObj="this.$API.system.user.list"
:params="{ depts: dept }"
class="width-100"
></ehsSelect>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item
label="开始时间"
prop="work_start_time"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="批次选择">
<el-select
v-model="batchs"
placeholder="批次选择"
clearable
style="width: 100%"
@change="changeMaterial"
>
<el-option
v-for="item in materialOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="物料扫码" style="display: flex;">
<scScanner @scanResult="formWminChange"></scScanner>
<el-input ref="codeInput" v-model="wm_in" clearable @change="formWminChange(wm_in)" style="width: 200px;margin-left: 4px;"></el-input>
</el-form-item>
<el-form-item label="使用数量" prop="count_use">
<el-input-number ref="codeInput" v-model="form.count_use" :min="0" clearable></el-input-number>
</el-form-item>
<el-form-item label="主要批次" v-if="!isfix">
<el-select
v-model="form.parent"
placeholder="主要批次"
clearable
style="width: 100%"
>
<el-option
v-for="item in mlogbInOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-date-picker
:disabled="mode == 'edit'"
v-model="form.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
popper-append-to-body
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24" v-if="route_code=='niuzhuan'">
<el-form-item label="结束时间" prop="work_end_time">
<el-date-picker
v-model="form.work_end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
:disabledDate="disabledDateFn"
popper-append-to-body
/>
</el-form-item>
</el-col> -->
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="主要批次" v-if="!isfix">
<el-select
v-model="form.parent"
placeholder="主要批次"
clearable
class="width-100"
>
<el-option
v-for="item in mlogbInOptions"
:key="item.id"
:label="item.batch"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button type="primary" :loading="isSaveing" @click="submit">提交</el-button>
@ -144,8 +215,10 @@ export default {
]
},
wm_in:'',
route_code:"",
mlogbIns:[],
options: [],
optionsEq: [],
mlogbInOptions:[],
materialOptions: [],
mgroup_code:'',
@ -168,6 +241,7 @@ export default {
};
},
mounted() {
this.route_code = this.$route.path.split("/")[2];
this.form.mlog = this.mlog;
this.params.mlog = this.mlog;
let arr = this.$route.path.split("/");
@ -176,6 +250,7 @@ export default {
this.getMtask();
this.getMaterial();
this.getParentList();
this.getEquipment();
},
methods: {
open() {
@ -195,6 +270,17 @@ export default {
that.mlogbIns = res;
})
},
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.optionsEq.push(obj);
});
});
},
getParentList(){
let that = this;
that.$API.wpm.mlogb.list.req(that.params).then((res) => {
@ -350,8 +436,6 @@ export default {
that.form.batch = '';
that.form.parent = '';
that.form.count_use = 0;
// that.scanKyes!=='mat'&&that.mlogbInCount>1
// that.bwItemForm.wpr!=""
if(that.scanKyes!=='mat'&&that.mlogbInCount>1){
that.bwItemForm.mlogb = res.id;
that.$API.wpm.mlogbw.create.req(that.bwItemForm).then((res) => {

View File

@ -42,7 +42,7 @@
<span v-if="!scope.row.isEdit&&mode == 'outs'">{{ scope.row.number }}</span>
<el-input v-if="scope.row.isEdit&&mode == 'outs'" v-model="scope.row.number" placeholder="物料编号"></el-input>
<el-select
v-if="scope.row.isEdit&&mode == 'ins'"
v-if="scope.row.isEdit&&mode == 'ins'&&route_code!=='niuzhuan'"
v-model="scope.row.wpr"
placeholder="动态成品"
clearable
@ -60,6 +60,53 @@
<span v-if="!scope.row.isEdit&&mode == 'ins'">{{ scope.row.number }}</span>
</template>
</el-table-column>
<el-table-column label="生产设备" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-select
v-model="scope.row.equip"
placeholder="生产设备"
clearable
filterable
:disabled="!scope.row.isEdit"
style="width: 100%"
>
<el-option
v-for="item in optionsEq"
: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>
</template>
</el-table-column>
<el-table-column label="开始时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-date-picker
:disabled="!scope.row.isEdit"
v-model="scope.row.work_start_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
popper-append-to-body
/>
</template>
</el-table-column>
<el-table-column label="结束时间" min-width="80px" v-if="mode == 'ins'&&route_code=='niuzhuan'">
<template #default="scope">
<el-date-picker
v-model="scope.row.work_end_time"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
style="width: 100%;"
:disabled="!scope.row.isEdit"
popper-append-to-body
/>
</template>
</el-table-column>
<el-table-column prop="note" :label="item.testitem_name" v-for="item in qct_testitems" :key="item.id" width="150px">
<template #default="scope">
<el-input-number
@ -158,7 +205,7 @@
>取消</el-link
>
<el-link
v-if="!scope.row.isEdit&&mode=='outs'"
v-if="!scope.row.isEdit&&(mode=='outs'||route_code=='niuzhuan')"
type="primary"
size="small"
@click="formTableEdit(scope.row)"
@ -328,7 +375,6 @@
</el-drawer>
</template>
<script>
import mockData from "./mock.json";
export default {
props: {
mlogb: {
@ -393,6 +439,7 @@ export default {
qct:"",
values:"",
wprNumber:"",
route_code:"",
wprInputText:"",
params: {mlogb:'',page:0},
hideAdd: true,
@ -425,6 +472,7 @@ export default {
equipment:[{ required: true, message: "请选择设备" }],
},
optionsEq:[],
defectlists:[],
testitemlists:[],
qct_defects_origin:[],
@ -436,6 +484,10 @@ export default {
},
mounted() {
let that = this;
this.route_code = this.$route.path.split("/")[2];
if(this.route_code=='niuzhuan'){
this.getEquipment4();
}
that.hideAdd = that.isSubmit;
if(that.mgroupName!=='排板'){
that.addTemplate.number = that.batchNumber;
@ -467,6 +519,12 @@ export default {
this.tableHeight = document.getElementById('mlogbwMain').clientHeight-20;
},500)
},
getEquipment4() {
let that = this;
that.$API.em.equipment.list.req({page:0,cate__code:"4"}).then((res) => {
that.optionsEq = res;
})
},
getEquipments(){
let that = this;
that.$API.em.equipment.list.req({page:0,cate__code:"6"}).then((res) => {
@ -493,14 +551,14 @@ export default {
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;
obj2.value = null;
that.addTemplate[item2.testitem_name] = null;
}
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.addTemplate[item2.testitem_name] = null;
}
that.qct_testitems.push(obj2);
})
@ -552,11 +610,12 @@ export default {
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] = "";
}
obj[item2.testitem_name] = null;
// if(item2.testitem_field_type=='input-number'||item.testitem_field_type=='input-int'){
// obj[item2.testitem_name] = null;
// }else{
// obj[item2.testitem_name] = "";
// }
})
}
}
@ -618,7 +677,12 @@ export default {
})
}
}
console.log('obj',obj);
// console.log('obj',obj);
if(that.mode == 'ins'&&that.route_code=='niuzhuan'){
obj.equip = row.equip;
obj.work_start_time = row.work_start_time;
obj.work_end_time = row.work_end_time;
}
if(row.id!==''&&row.id!==undefined&&row.id!==null){
obj.id = row.id;
that.$API.wpm.mlogbw.update.req(row.id,obj).then((res) => {
@ -867,9 +931,6 @@ export default {
//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){

View File

@ -121,15 +121,14 @@
width="150"
>
<template #default="scope">
<!-- <el-button
<el-button
link
size="small"
v-auth="'mlog.update'"
v-if="scope.row.submit_time == null"
type="primary"
@click.stop="table_edit(scope.row)"
>编辑</el-button
> -->
type="success"
v-if="route_code=='ladansi'||route_code=='yicifusi'||route_code=='ercifusi'||route_code=='zlybcl'"
@click.stop="table_monitor(scope.row)"
>监测</el-button
>
<el-button
link
size="small"
@ -180,11 +179,19 @@
@closed="detailClose"
>
</detail-drawer>
<monitor-drawer
v-if="dialog.monitor"
ref="monitorDialog"
:endTime="endTime"
:startTime="startTime"
:equipmentId="equipmentId"
></monitor-drawer>
</el-container>
</template>
<script>
import saveDialog from "./mlog_form.vue";
import detailDrawer from "./mlog_detail.vue";
import monitorDrawer from "./monitor_detail.vue";
export default {
props: {
@ -201,6 +208,7 @@ export default {
components: {
saveDialog,
detailDrawer,
monitorDrawer
},
data() {
return {
@ -210,6 +218,7 @@ export default {
dialog: {
save: false,
detail: false,
monitor:false,
},
tableData: [],
selection: [],
@ -217,6 +226,8 @@ export default {
mlogId: "",
deptId: null,
processId: "",
route_code: "",
equipmentId: "",
processCate: "",
mgroupMtype: "",
showHidden:false,
@ -234,6 +245,7 @@ export default {
},
mounted() {
let that = this;
that.route_code = this.$route.path.split("/")[2];
that.params.mgroup =that.mgroupId;
that.apiObj = that.$API.wpm.mlog.list;
this.getMgroupInfo();
@ -277,6 +289,20 @@ export default {
this.dialog.detail = false;
this.$refs.table.refresh();
},
table_monitor(row){
let that= this;
if(row.equipment!==null){
that.equipmentId = row.equipment;
that.endTime = row.work_end_time;
that.startTime = row.work_start_time;
that.dialog.monitor = true;
this.$nextTick(() => {
this.$refs.monitorDialog.open("add");
});
}else{
that.$message.error("该日志未关联设备,请选择设备后重新查看");
}
},
//
table_add() {
this.dialog.save = true;

View File

@ -0,0 +1,109 @@
<!-- 日志详情 mlog信息以及mlogb -->
<template>
<el-drawer
title="监测数据"
v-model="visible"
:size="'65%'"
destroy-on-close
@closed="$emit('closed')"
>
<div id="tableWap" style="height: 100%;">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane v-for="item in mpointList" :label="item.name" :name="item.name" :key="item.id" lazy>
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
stripe
:height="tableHeight"
:params="{'mpoint':item.id, 'timex_gte':startTime, 'timex_lte':endTime}"
hideDo
>
<el-table-column label="时间" prop="timex">
</el-table-column>
<el-table-column label="数值" prop="val_float">
</el-table-column>
</scTable>
</el-tab-pane>
</el-tabs>
</div>
</el-drawer>
</template>
<script>
export default {
props: {
equipmentId: {
type: String,
default: "",
},
endTime: {
type: String,
default: "",
},
startTime: {
type: String,
default: "",
},
},
emits: ["success", "closed"],
data() {
return {
apiObj:null,
loading: false,
isSaveing: false,
visible: false,
params:{},
query:{},
mpointList:[],
activeName: "",
tableHeight:300,
};
},
mounted() {
let that = this;
that.params.timex__gte = that.startTime;
that.params.timex__lte = that.endTime;
that.$API.enm.mpoint.list.req({ep_belong:that.equipmentId,page:0}).then((res) => {
if(res.length>0){
that.mpointList = res;
that.activeName = res[0].name;
that.params.mpoint = res[0].id;
that.apiObj = that.$API.enm.mplogx;
}else{
that.$message.error("该设备没有监测点");
}
})
},
methods: {
open() {
let that = this;
this.visible = true;
that.$nextTick(() => {
let height = document.getElementById("tableWap").clientHeight;
console.log('height',height)
that.tableHeight = height - 45;
})
},
handleClick(val){
let that = this;
that.mpointList.forEach(item=>{
if(item.name == that.activeName){
that.query.mpoint = item.id;
that.query.page = 1;
}
})
},
},
};
</script>
<style scoped>
.file_show{
position: absolute;
width: 100%;
height: 100%;
top: 0;
background: rgb(255,255,255);
z-index: 999;
}
</style>

View File

@ -354,6 +354,7 @@ export default {
},
qct:'',
codeText:'',
codeBatch:'',
mgroupName:'',
materialCount:1,//
material_in:'',
@ -481,7 +482,7 @@ export default {
that.materialOptions = res;
if(that.codeText!==''){
res.forEach(item=>{
if(item.batch == that.codeText){
if(item.batch == that.codeBatch){
that.form.wm_in = item.id;
that.form.batch = item.batch;
that.materialCount = that.form.count_use = that.form.count_ok = item.count_cando;
@ -506,12 +507,21 @@ export default {
},
//
open(mode = "add",codeText) {
this.mode = mode;
this.visible = true;
if(codeText){
this.codeText = codeText;
let that = this;
that.mode = mode;
that.visible = true;
if(codeText!==''){
that.codeText = codeText;
let id = codeText.split('#')[1];
that.$API.cm.labelmat.item.req(id).then((res) => {
that.codeBatch = res.batch;
that.getMaterial();
}).catch((err) => {
that.getMaterial();
})
}else{
that.getMaterial();
}
this.getMaterial();
return this;
},
//

View File

@ -173,8 +173,8 @@
</el-card>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
:fmlog="params.fmlog"
ref="saveDialogs"
:fmlog="fmlogId"
:mgroup="mgroup"
:mtask="mtask"
:process="processId"
@ -209,6 +209,14 @@ export default {
type: String,
default: "",
},
mgroup: {
type: String,
default: "",
},
mtask: {
type: String,
default: "",
}
},
components: {
saveDialog,
@ -237,7 +245,6 @@ export default {
page: 0,
fmlog: "",
},
mgroup: "",
fmlogItem: {},
saveInForm: {
count_use: 0,
@ -278,11 +285,18 @@ export default {
mounted() {
this.getfmlogItem();
this.params.fmlog = this.fmlogId;
this.paramsWm.mgroup = this.mgroup;
this.apiObj = this.$API.wpm.mlog.list;
},
methods: {
open(codeText="") {
this.codeText = codeText;
if(this.codeText!=""){
this.$nextTick(() => {
this.codeTextChange(codeText);
})
}
this.visible = true;
},
@ -290,8 +304,6 @@ export default {
let that = this;
that.$API.wpm.fmlog.item.req(that.fmlogId).then((res) => {
that.fmlogItem = res;
that.mgroup = res.mgroup;
that.mtask = res.mtask;
that.paramsWm.mgroup = res.mgroup;
that.$API.wpm.mlog.list.req(that.params).then((res) => {
that.tableData = res;
@ -301,9 +313,6 @@ export default {
})
that.paramsWm.search = that.batchContains;
that.apiObjWm = that.$API.wpm.wmaterial.list;
if(that.codeText!=""){
this.codeTextChange(that.codeText);
}
}else{}
});
});
@ -316,21 +325,19 @@ export default {
table_add() {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('add');
this.$refs.saveDialogs.open('add');
});
},
codeTextChange(codeText){
let that = this;
that.codeText = codeText;
that.dialog.save = true;
that.$nextTick(() => {
that.$refs.saveDialog.open('add',codeText);
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialogs.open('add',codeText);
});
},
table_edit(row){
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open('edit').setData(row);
this.$refs.saveDialogs.open('edit').setData(row);
});
},
//

View File

@ -148,6 +148,8 @@
<detail-drawer
v-if="dialog.detail"
ref="detailDialog"
:mtask="mtaskId"
:mgroup="mgroupId"
:fmlogId="fmlogId"
:processId="processId"
@closed="detailClose"
@ -245,6 +247,7 @@ export default {
},
//
table_detail(row) {
this.mtaskId = row.mtask;
this.fmlogId = row.id;
this.dialog.detail = true;
this.$nextTick(() => {
@ -271,30 +274,23 @@ export default {
codeTextChange(codeText){
let that = this;
that.codeText = codeText;
//
let obj = {};
obj.page=0;
obj.tag = 'todo';
obj.mgroup=that.mgroupId;
obj.batch=that.codeText;
that.$API.wpm.wmaterial.list.req(obj).then(res=>{
//
let id = codeText.split('#')[1];
that.$API.cm.labelmat.item.req(id).then((res) => {
let params = {}
params.page = 0;
params.state = 20;
params.mgroup = that.mgroupId;
params.route__material_in = res[0].material;
params.route__material_in = res.material;
that.$API.pm.mtask.list.req(params).then(res1=>{
if(res1.length==1){//
that.mtaskId =res1[0].id;
that.changeMtask();
// that.table_detail(res2[0]);
}else{//
that.mtaskoptions = res1;
that.dialog.mtask = true;
}
})
})
}).catch((err) => {})
},
changeMtask(){
let that = this;

View File

@ -186,7 +186,6 @@
</el-dialog>
</template>
<script>
import scanDialog from "./../template/scan.vue";
export default {
emits: ["success", "closed"],
props: {
@ -217,9 +216,6 @@ export default {
default:false
}
},
components: {
scanDialog
},
data() {
return {
change_batch:false,
@ -598,22 +594,14 @@ export default {
let that = this;
data = data.replace(' ','');
let id = data.split('#')[1];
console.log('id',id);
this.$API.cm.labelmat.item.req(id).then((res) => {
console.log('res',res);
let arr = that.form.handoverb.filter((item) => {
return item.batch == res.batch;
})
console.log('arr',arr);
if(arr.length>0){
that.$message.error("该批次已存在")
}else{
console.log('that.materialOptions',that.materialOptions);
that.materialOptions.forEach((item) => {
console.log('item',item);
console.log('item.batch',item.batch);
console.log('res.batch',res.batch);
console.log('item.batch == res.batch',item.batch == res.batch);
if(item.batch == res.batch){
let obj = {};
obj.wm = item.id;
@ -621,7 +609,6 @@ export default {
obj.counts = item.count;
obj.count = item.count;
that.form.handoverb.push(obj)
that.$refs.scanDialog.closed();
that.getResaveMgroups(item.material);
}
})

View File

@ -88,7 +88,7 @@
<el-form-item label="开始层数">
<el-input-number
v-model="cell_start"
:min="0"
:min="1"
class="width-100"
@change="cellStartChanges"
controls-position="right"
@ -119,7 +119,7 @@
<el-input-number
style="width:90%"
v-model="item.floor"
:min="0"
:min="1"
class="width-100"
placeholder="层数"
controls-position="right"
@ -227,7 +227,7 @@ export default {
},
cells:0,//
count_cell:0,//
cell_start:0,//
cell_start:1,//
codeBatch:"",
options: [],
cellsList:[],