From b2ff4c85acdb4ea33daff52929f17408b91bbc2f Mon Sep 17 00:00:00 2001
From: Fixiaobai <fixiaobai@163.com>
Date: 星期二, 12 九月 2023 17:51:34 +0800
Subject: [PATCH] modified: config/index.js modified: src/assets/api/controller.js modified: src/components/view/processInspection.vue modified: src/components/view/standard.vue
---
src/components/view/standard.vue | 251 +----------------
config/index.js | 2
src/components/view/processInspection.vue | 527 ++++++++++++++++++-------------------
src/assets/api/controller.js | 5
4 files changed, 278 insertions(+), 507 deletions(-)
diff --git a/config/index.js b/config/index.js
index 32dd871..f8ed1cc 100644
--- a/config/index.js
+++ b/config/index.js
@@ -24,7 +24,7 @@
},
// Various Dev Server settings
- host: '127.0.0.1', // can be overwritten by process.env.HOST
+ host: '192.168.0.15', // can be overwritten by process.env.HOST
port: 80, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
autoOpenBrowser: false,
errorOverlay: true,
diff --git a/src/assets/api/controller.js b/src/assets/api/controller.js
index e9119f5..acf86ae 100644
--- a/src/assets/api/controller.js
+++ b/src/assets/api/controller.js
@@ -56,11 +56,14 @@
// listMaterial:"/finished-inspect/list_material",//娣诲姞妫�楠屽崟鏃剁殑椤圭洰鍒楄〃
finishedInspectUser: "/finished-inspect/page_user", //鑾峰彇鎵�鏈変富鏈哄伐
projectListByfinishId: "/inspection-item/list_user", //鏍规嵁id鏌ヨ鎵�鏈夐」鐩�
-
+ processInspectAddProcess: "/processInspect/addProcess",//鏂板妫�楠�
+ inspectionItemListUser: "/inspection-item/list_user",//鏌ヨ鎵�鏈夋楠岄」鐩�
}
// 杩囩▼妫�楠�
const processInspection = {
selectProcessInspectsList: "/processInspect/selectProcessInspectsList", // 鍒嗛〉鏌ヨ杩囩▼妫�楠屽崟鍒楄〃
+ chooseMaterProcessInspect: "/processInspect/chooseMater",//鏍规嵁璁㈠崟鍙烽�夋嫨浜у搧鍜屽伐鑹�
+
}
// QMS瀹為獙瀹ょ鐞�
const laboratory = {
diff --git a/src/components/view/processInspection.vue b/src/components/view/processInspection.vue
index f844244..a4d05e1 100644
--- a/src/components/view/processInspection.vue
+++ b/src/components/view/processInspection.vue
@@ -5,137 +5,70 @@
<el-row>
<el-col :span="12">杩囩▼妫�楠�</el-col>
<el-col :span="12" style="text-align: right;">
- <el-button
- @click="handleAddNew"
- type="primary"
- size="mini"
- icon="el-icon-plus"
- style="background: #004EA2; "
- >鏂板</el-button
- >
+ <el-button @click="handleAddNew" type="primary" size="mini" icon="el-icon-plus"
+ style="background: #004EA2; ">鏂板</el-button>
<el-button icon="el-icon-download" size="mini">瀵煎嚭</el-button>
</el-col>
</el-row>
</div>
<div class="nav">
<span>妫�楠岀姸鎬侊細</span>
- <el-select
- size="small"
- v-model="search.result"
- placeholder="璇烽�夋嫨妫�娴嬬姸鎬�"
- style="width: 224px;margin-right: 52px;"
- >
+ <el-select size="small" v-model="search.result" placeholder="璇烽�夋嫨妫�娴嬬姸鎬�" style="width: 224px;margin-right: 52px;">
<el-option :value="''" label="鍏ㄩ儴"></el-option>
<el-option :value="1" label="宸叉娴�"></el-option>
<el-option :value="2" label="寰呮娴�"></el-option>
</el-select>
<span>浜у搧鍚嶇О锛�</span>
- <el-input
- size="small"
- style="width: 224px;margin-right: 30px;"
- v-model="search.name"
- placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"
- ></el-input>
+ <el-input size="small" style="width: 224px;margin-right: 30px;" v-model="search.name"
+ placeholder="璇疯緭鍏ヤ骇鍝佸悕绉�"></el-input>
<span>宸ュ簭锛�</span>
- <el-input
- size="small"
- style="width: 224px;margin-right: 30px;"
- v-model="search.techfather"
- placeholder="璇疯緭鍏ュ伐搴�"
- ></el-input>
+ <el-input size="small" style="width: 224px;margin-right: 30px;" v-model="search.techfather"
+ placeholder="璇疯緭鍏ュ伐搴�"></el-input>
<el-button size="mini"><span>閲� 缃�</span></el-button>
- <el-button size="mini" type="primary" style="background: #004EA2;"
- ><span>鏌� 璇�</span></el-button
- >
+ <el-button size="mini" type="primary" style="background: #004EA2;"><span>鏌� 璇�</span></el-button>
</div>
<div class="content-body">
<div class="inspectionTable">
- <el-table
- ref="inspectionTable"
- height="calc(100vh - 320px)"
- :cell-style="{ textAlign: 'center' }"
+ <el-table ref="inspectionTable" height="calc(100vh - 320px)" :cell-style="{ textAlign: 'center' }"
:header-cell-style="{
border: '0px',
background: '#f5f7fa',
color: '#606266',
boxShadow: 'inset 0 1px 0 #ebeef5',
textAlign: 'center'
- }"
- border
- :data="inspectionTable"
- style="width: 100%"
- >
+ }" border :data="inspectionTable" style="width: 100%">
<el-table-column type="selection" width="50"> </el-table-column>
- <el-table-column
- label="搴忓彿"
- type="index"
- width="60"
- ></el-table-column>
- <el-table-column
- prop="order_number"
- label="璁㈠崟缂栧彿"
- min-width="90"
- />
+ <el-table-column label="搴忓彿" type="index" width="60"></el-table-column>
+ <el-table-column prop="order_number" label="璁㈠崟缂栧彿" min-width="90" />
<el-table-column prop="material" label="浜у搧鍚嶇О" min-width="80" />
- <el-table-column
- prop="specifications_model"
- label="瑙勬牸鍨嬪彿"
- min-width="60"
- />
+ <el-table-column prop="specifications_model" label="瑙勬牸鍨嬪彿" min-width="60" />
<el-table-column prop="techfather" label="宸ュ簭" min-width="70" />
<el-table-column prop="techname" label="宸ヨ壓鍚嶇О" min-width="70" />
<el-table-column prop="unit" label="鍗曚綅" min-width="50" />
<el-table-column prop="quantity" label="鏁伴噺" min-width="50" />
- <el-table-column
- prop="createTime"
- label="鎶ユ鏃ユ湡"
- min-width="60"
- />
+ <el-table-column prop="createTime" label="鎶ユ鏃ユ湡" min-width="60" />
<el-table-column prop="name" label="鎶ユ浜�" min-width="50" />
- <el-table-column
- prop="updateTime"
- label="妫�娴嬫棩鏈�"
- min-width="60"
- />
+ <el-table-column prop="updateTime" label="妫�娴嬫棩鏈�" min-width="60" />
<el-table-column prop="result" label="鍚堟牸鐘舵��" min-width="80">
<template slot-scope="scope">
- <span style="color: #34BD66;" v-if="scope.row.result == 1"
- >鍚堟牸</span
- >
- <span style="color: #E84738;" v-else-if="scope.row.result == 0"
- >涓嶅悎鏍�</span
- >
+ <span style="color: #34BD66;" v-if="scope.row.result == 1">鍚堟牸</span>
+ <span style="color: #E84738;" v-else-if="scope.row.result == 0">涓嶅悎鏍�</span>
</template>
</el-table-column>
<el-table-column label="鎿嶄綔" min-width="80">
<template slot-scope="scope">
- <el-button type="text" size="small" style="margin-left: 0;"
- >璇︽儏</el-button
- >
- <el-button
- type="text"
- size="small"
- @click="handleClick(scope.row)"
- >鏌ョ湅</el-button
- >
- <el-button type="text" size="small" style="margin-left: 0;"
- >缂栬緫</el-button
- >
+ <el-button type="text" size="small" style="margin-left: 0;">璇︽儏</el-button>
+ <el-button type="text" size="small" @click="handleClick(scope.row)">鏌ョ湅</el-button>
+ <el-button type="text" size="small" style="margin-left: 0;">缂栬緫</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 鍒嗛〉鍣� -->
<div class="pagination">
- <el-pagination
- :current-page="1"
- :page-sizes="[10, 20, 30, 40]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="inspectionTableTotal"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
+ <el-pagination :current-page="1" :page-sizes="[10, 20, 30, 40]" :page-size="pageSize"
+ layout="total, sizes, prev, pager, next, jumper" :total="inspectionTableTotal" @size-change="handleSizeChange"
+ @current-change="handleCurrentChange" />
</div>
</div>
</div>
@@ -146,109 +79,60 @@
<el-col :span="12">鏂板杩囩▼妫�楠屽崟</el-col>
<el-col :span="12" style="text-align: right;">
<!-- 鐐瑰嚮杩斿洖锛屽綋鍓嶉〉闈㈠�间负false -->
- <el-button
- type="primary"
- size="mini"
- style="background: #004EA2; "
- icon="el-icon-circle-plus-outline"
- >鏂板</el-button
- >
- <el-button
- @click="showAddPage = false"
- type="primary"
- size="mini"
- icon="el-icon-back"
- style="background: #004EA2; "
- >杩斿洖</el-button
- >
+ <el-button type="primary" size="mini" style="background: #004EA2; "
+ icon="el-icon-circle-plus-outline">鏂板</el-button>
+ <el-button @click="showAddPage = false" type="primary" size="mini" icon="el-icon-back"
+ style="background: #004EA2; ">杩斿洖</el-button>
</el-col>
</el-row>
- <el-form
- :model="addInspectionform"
- ref="addInspectionform"
- class="addInspectionform"
- label-position="right"
- label-width="120px"
- size="small"
- >
+ <el-form :model="processInspectVo" ref="addInspectionform" class="addInspectionform" label-position="right"
+ label-width="120px" size="small">
<div class="formwrapper">
<el-row :gutter="230">
<el-col :span="7">
<el-form-item label="璁㈠崟鍙凤細">
- <el-input
- style="width: 210px;"
- size="small"
- v-model="addInspectionform.number"
- placeholder="璇疯緭鍏ヨ鍗曞彿"
- />
+ <el-input @blur="selectInfoByOrderId" style="width: 210px;" size="small"
+ v-model="processInspectVo.orderNumber" placeholder="璇疯緭鍏ヨ鍗曞彿" />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="浜у搧鍚嶇О锛�">
- <el-input
- style="width: 210px;"
- size="small"
- v-model="addInspectionform.code"
- placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�"
- />
+ <el-select style="width: 210px;" size="small" @change="selectSample" v-model="processInspectVo.material"
+ placeholder="璇烽�夋嫨浜у搧">
+ <el-option v-for="item in optionsSamplename" :key="item.value" :label="item.name" :value="item.name">
+ </el-option>
+ </el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="浜у搧缂栫爜锛�">
- <el-input
- style="width: 210px;"
- size="small"
- disabled
- v-model="addInspectionform.code"
- placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�"
- />
+ <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.materialCode"
+ placeholder="璇疯緭鍏ヤ骇鍝佺紪鐮�" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="230">
<el-col :span="7">
<el-form-item label="瑙勬牸鍨嬪彿锛�">
- <el-input
- style="width: 210px;"
- size="small"
- disabled
- v-model="addInspectionform.number"
- placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�"
- />
+ <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.specificationsModel"
+ placeholder="璇疯緭鍏ヨ鏍煎瀷鍙�" />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="宸ュ簭鍚嶇О锛�">
- <el-select
- v-model="value"
- placeholder="璇烽�夋嫨"
- style="width: 210px;"
- size="small"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
+ <el-select @change="changeOptionSoptionSprocesses" v-model="processInspectVo.techfather"
+ placeholder="璇烽�夋嫨" style="width: 210px;" size="small">
+ <el-option v-for="item in optionSoptionSprocesses" :key="item.name" :label="item.name"
+ :value="item.name">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="宸ヨ壓鍚嶇О锛�">
- <el-select
- v-model="value"
- placeholder="璇烽�夋嫨"
- style="width: 210px;"
- size="small"
- >
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
+ <el-select v-model="processInspectVo.techname" placeholder="璇烽�夋嫨" style="width: 210px;" size="small">
+ <el-option v-for="item in optionTechnology" :key="item.id" :label="item.name"
+ :value="item.id + '-' + item.name">
</el-option>
</el-select>
</el-form-item>
@@ -257,31 +141,17 @@
<el-row :gutter="230">
<el-col :span="7">
<el-form-item label="鍗曚綅锛�">
- <el-input
- style="width: 210px;"
- size="small"
- disabled
- v-model="addInspectionform.quantity"
- placeholder="璇疯緭鍏ュ崟浣�"
- />
+ <el-input style="width: 210px;" size="small" disabled v-model="processInspectVo.unit"
+ placeholder="璇疯緭鍏ュ崟浣�" />
</el-form-item>
</el-col>
<el-col :span="7">
<el-form-item label="鏁伴噺锛�">
- <el-input
- style="width: 210px;"
- size="small"
- v-model="addInspectionform.quantity"
- placeholder="璇疯緭鍏ユ暟閲�"
- />
+ <el-input style="width: 210px;" size="small" v-model="processInspectVo.quantity" placeholder="璇疯緭鍏ユ暟閲�" />
</el-form-item>
</el-col>
- <el-col :span="7">
- <el-button
- type="primary"
- style="float: right; font-size: 14px; !important"
- >鐢熸垚妫�楠岄」鐩�</el-button
- >
+ <el-col :span="10" style="display: flex;justify-content: end;">
+ <el-button type="primary" @click="addTestProjevt">鐢熸垚妫�楠岄」鐩�</el-button>
</el-col>
</el-row>
</div>
@@ -291,92 +161,52 @@
<el-row>
<el-col :span="12" class="inspectionProject_span">妫�楠岄」鐩�</el-col>
<el-col :span="12" class="inspectionProject_span">
- <el-button size="mini" @click="clickDeleteInspectionColumn()"
- >鍒犻櫎妫�楠屽�煎垪</el-button
- >
- <el-button
- style="margin-right: 30px;"
- size="mini"
- @click="clickAddInspectionColumn()"
- >娣诲姞妫�楠屽�煎垪</el-button
- >
- <el-button
+ <el-button size="mini" @click="clickDeleteInspectionColumn()">鍒犻櫎妫�楠屽�煎垪</el-button>
+ <el-button style="margin-right: 30px;" size="mini" @click="clickAddInspectionColumn()">娣诲姞妫�楠屽�煎垪</el-button>
+ <!-- <el-button
size="mini"
style="margin-right: 30px;"
@click="clickAddLine()"
>娣诲姞妫�楠岃</el-button
- >
+ > -->
</el-col>
</el-row>
- <el-table
- :data="inspectionItems"
- height="calc(100vh - 550px)"
- style="width: 100%"
- >
- <el-table-column
- type="index"
- label="搴忓彿"
- width="60"
- ></el-table-column>
- <el-table-column prop="material" label="椤圭洰"></el-table-column>
+ <el-table :row-key="inspectionItems.id" :data="inspectionItems" max-height="420" :span-method="handleSpanMethod" height="calc(100vh - 550px)" style="width: 100%">
+ <el-table-column type="index" label="搴忓彿" width="60"></el-table-column>
+ <el-table-column label="椤圭洰" prop="father"></el-table-column>
+ <el-table-column prop="name" label="鎸囨爣"></el-table-column>
<el-table-column prop="unit" label="鍗曚綅"></el-table-column>
- <el-table-column prop="standardVal" label="鏍囧噯鍊�"></el-table-column>
- <el-table-column prop="controlVal" label="鍐呮祴鍊�"></el-table-column>
- <el-table-column
- prop="testValue"
- label="妫�娴嬪��"
- min-width="150"
- v-for="(item, index) in empiricalValueAdd"
- :key="index"
- >
- <template slot-scope="scope">
- <el-tooltip
- :disabled="scope.row.deviceId != null"
- class="item"
- effect="dark"
- content="璇峰厛閫夋嫨璁惧锛�"
- placement="top-start"
- >
- <el-input
- :disabled="scope.row.deviceId == null"
- // v-model="scope.row.testValueList[index]"
- @blur="changeState(scope.row, index)"
- placeholder="璇疯緭鍏ユ娴嬪��"
- ></el-input>
- </el-tooltip>
- </template>
- </el-table-column>
+ <el-table-column prop="required" label="鏍囧噯鍊�"></el-table-column>
+ <el-table-column prop="internal" label="鍐呮祴鍊�"></el-table-column>
+ <el-table-column prop="inspectionValue" label="妫�娴嬪��" min-width="100" style="text-align: center;">
+ <template slot-scope="scope">
+ <el-tooltip :disabled="scope.row.deviceId != null" class="item" effect="dark" content="璇峰厛閫夋嫨璁惧锛�"
+ placement="top-start">
+ <el-input :disabled="scope.row.deviceId === null" :value="item"
+ @blur="changeState(scope.row, index)" placeholder="璇疯緭鍏ユ娴嬪��"></el-input>
+ </el-tooltip>
+ </template>
+ </el-table-column>
<el-table-column label="璇曢獙璁惧">
<template slot-scope="scope">
{{ scope.row.device }}
- <el-select
- v-model="scope.row.device"
- size="small"
- slot="append"
- style="width: 100px;"
- >
+ <el-select v-model="scope.row.device" size="small" slot="append" style="width: 100px;">
<el-option value="閫夐」1"></el-option>
<el-option value="閫夐」2"></el-option>
</el-select>
</template>
</el-table-column>
- <el-table-column prop="conclusion" label="缁撹">
+ <el-table-column label="缁撹">
<template slot-scope="scope">
- <span style="color: #34BD66;" v-if="scope.row.insState == 1"
- >鍚堟牸</span
- >
- <span style="color: #E84738;" v-else-if="scope.row.insState == 0"
- >涓嶅悎鏍�</span
- >
+ <span style="color: #34BD66;" v-if="scope.row.result === 1">鍚堟牸</span>
+ <span style="color: #E84738;" v-else-if="scope.row.result === 0">涓嶅悎鏍�</span>
</template>
</el-table-column>
<el-table-column v-if="detailId == null" label="鎿嶄綔" width="100">
- <template slot-scope="scope">
- <el-button type="text" @click="clickDeleteline(scope)"
- >鍒犻櫎</el-button
- >
- </template>
- </el-table-column>
+ <template slot-scope="scope">
+ <el-button type="text" @click="clickDeleteline(scope)">鍒犻櫎</el-button>
+ </template>
+ </el-table-column>
</el-table>
</div>
<div class="inspectionResult">
@@ -397,6 +227,7 @@
export default {
data() {
return {
+ detailId: null,
search: {
countSize: 10,
pageSize: 1,
@@ -404,13 +235,29 @@
name: "", // 浜у搧鍚嶇О
techfather: "" // 宸ュ簭
},
+ optionsSamplename: [],
inspectionTable: [],
+ optionSoptionSprocesses: [],
+ optionTechnology: [],
inspectionTableTotal: "",
+ treeProject: [],
// 娣诲姞鍒�
- empiricalValueAdd: 1,
+ empiricalValueAdd: [],
// 缂栬緫鏃跺瓨鍌ㄦ渶闀跨殑鍒楁暟瀛楋紝鍋氬垹闄ゅ垽鏂�
empiricalValueAddMaxNumber: 0,
showAddPage: false,
+ processInspectVo: {
+ material: null,
+ materialCode: null,
+ orderNumber: "D-001",
+ quantity: null,
+ specificationsModel: null,
+ techfather: null,
+ techname: null,
+ technologyId: null,
+ unit: null
+ },
+ InspectioniD: null,
addInspectionform: [
{
number: "",
@@ -425,8 +272,8 @@
group: "",
worker: "",
machine: ""
- }
- ],
+ }]
+ ,
inspectionItems: [], // 鏂板妫�楠岄」鐩〃鏍�
inspectionResultForm: [
{
@@ -437,36 +284,151 @@
operation: ""
}
],
- options: [
- {
- value: "閫夐」1",
- label: "榛勯噾绯�"
- },
- {
- value: "閫夐」2",
- label: "鍙岀毊濂�"
- },
- {
- value: "閫夐」3",
- label: "铓典粩鐓�"
- },
- {
- value: "閫夐」4",
- label: "榫欓』闈�"
- },
- {
- value: "閫夐」5",
- label: "鍖椾含鐑ら腑"
- }
- ],
- value: ""
+ options: [],
+ value: "",
+ rowList: [],
+ spanArr: [],
+ position: 0
};
+ },
+ mounted() {
+ // this.getTableData()
},
methods: {
// 姣忛〉鏉℃暟鏀瑰彉鏃惰Е鍙� 閫夋嫨涓�椤垫樉绀哄灏戣
handleSizeChange(val) {
this.search.countSize = val;
this.defaultInitializationTable();
+ },
+ getInsArr(val){
+ console.log(val);
+ return val.split(",")
+ },
+ handleSpanMethod({ row, column, rowIndex, columnIndex }) {
+ if (columnIndex === 0) {
+ const _row = this.spanArr[rowIndex];
+ const _col = _row>0 ? 1 : 0;
+ return {
+ rowspan: _row,
+ colspan: _col
+ }
+ }
+ if(columnIndex === 1){
+ const _row = this.spanArr[rowIndex];
+ const _col = _row>0 ? 1 : 0;
+ return {
+ rowspan: _row,
+ colspan: _col
+ }
+ }
+ },
+ // 鍚堝苟琛ㄦ牸
+ mergeTable() {
+ this.rowList=[]
+ this.spanArr=[]
+ this.position=0
+ this.inspectionItems.forEach((item,index) => {
+ if( index === 0){
+ this.spanArr.push(1);
+ this.position = 0;
+ }else{
+ if(this.inspectionItems[index].father === this.inspectionItems[index-1].father ){
+ this.spanArr[this.position] += 1;
+ this.spanArr.push(0);
+ }else{
+ this.spanArr.push(1);
+ this.position = index;
+ }
+ }
+ })
+ },
+ changeOptionSoptionSprocesses() {
+ this.optionTechnology = []
+ let working = this.optionSoptionSprocesses.filter(item => {
+ return item.name === this.processInspectVo.techfather
+ })[0]
+ this.optionTechnology = working.children
+ },
+ addTestProjevt() {
+ let val = JSON.parse(JSON.stringify(this.processInspectVo))
+ val.techname = this.processInspectVo.techname.split("-")[1]
+ val.technologyId = this.processInspectVo.techname.split("-")[0]
+ this.$axios.post(this.$api.url.processInspectAddProcess, {
+ material: val.material,
+ materialCode: val.materialCode,
+ orderNumber: val.orderNumber,
+ quantity: val.quantity,
+ specificationsModel: val.specificationsModel,
+ techfather: val.techfather,
+ techname: val.techname,
+ technologyId: val.technologyId,
+ unit: val.unit
+ }, {
+ headers: { "Content-Type": "application/json" }
+ }).then(res => {
+ if (res.code === 201) {
+ this.$message({
+ message: res.message,
+ type: 'warning'
+ });
+ return
+ }
+ this.InspectioniD = res.data
+ this.getTableData()
+ })
+ },
+ getTableData() {
+ this.$axios.get(this.$api.url.inspectionItemListUser, {
+ params: {
+ id: 28,
+ type: 1
+ }
+ }).then(res => {
+ this.inspectionItems = res.data
+ let arr = []
+ let val=JSON.parse(JSON.stringify(this.inspectionItems))
+ //杞垚涓�缁存暟缁�
+ val.forEach(l => {
+ let father = l.father
+ l.children.forEach(c => {
+ c.father = father
+ c.empiricalValueAdd=[]
+ arr.push(c)
+ })
+ })
+ this.inspectionItems = arr
+ console.log(this.inspectionItems);
+ this.mergeTable(arr)
+ })
+ },
+ selectSample() {
+ let sample = this.optionsSamplename.filter(item => {
+ return item.name === this.processInspectVo.material
+ })[0]
+ this.processInspectVo.techfather = null
+ this.processInspectVo.techname = null
+ this.processInspectVo.materialCode = sample.code
+ this.processInspectVo.specificationsModel = sample.specifications
+ this.processInspectVo.unit = sample.unit
+ this.optionSoptionSprocesses = []
+ this.optionSoptionSprocesses = sample.children
+ },
+ selectInfoByOrderId() {
+ this.$axios.get(this.$api.url.chooseMaterProcessInspect, {
+ params: {
+ orderNumber: this.processInspectVo.orderNumber
+ }
+ }).then(res => {
+ if (res.data.length > 0) {
+ console.log(res.data);
+ this.optionsSamplename = res.data
+ } else {
+ this.$message({
+ message: '娌℃湁璇ヨ鍗曞彿锛�',
+ type: 'warning'
+ });
+ }
+ })
},
// 褰撳墠椤垫敼鍙樻椂瑙﹀彂 璺宠浆鍏朵粬椤�
handleCurrentChange(val) {
@@ -476,6 +438,7 @@
// 鏄剧ず鏂板椤甸潰
handleAddNew() {
this.showAddPage = true;
+ this.getTableData()
},
// 琛ㄦ牸鍒濆鍖栨帴鍙�
defaultInitializationTable() {
@@ -535,52 +498,66 @@
align-items: center;
background-color: #fff;
}
+
.table_header {
height: calc(100vh - 550px);
}
+
.nav * {
font-size: 14px;
}
+
.content-body .rawPage {
background-color: #fff;
overflow: hidden;
}
+
.inspectionTable {
padding: 20px 20px;
}
+
.pagination {
float: right;
margin-right: 20px;
}
+
.newPage {
overflow: hidden;
}
+
.header {
padding: 12px;
}
+
.addInspectionform {
background-color: #fff;
}
+
.addInspectionform .formwrapper {
padding: 20px 0px;
margin-left: 100px;
}
+
.inspectionProject .el-table {
background-color: #fff;
padding: 10px 12px;
}
+
.inspectionResult span {
display: block;
padding: 5px 0px;
}
+
.inspectionResult .el-table {
background-color: #fff;
padding: 10px 12px;
}
+
.inspectionProject_span {
line-height: 32px;
padding: 10px 20px;
}
+
.inspectionProject_span .el-button {
float: right;
font-size: 13px !important;
diff --git a/src/components/view/standard.vue b/src/components/view/standard.vue
index 56f6ba2..6c22674 100644
--- a/src/components/view/standard.vue
+++ b/src/components/view/standard.vue
@@ -5,7 +5,7 @@
<el-col :span="12" style="line-height: 32px;">鏍囧噯BOM</el-col>
<el-col :span="12" style="text-align: right;">
<el-button type="primary" icon="el-icon-plus" style="background: #004EA2;"
- @click="showBomAddModel">鏂板</el-button>
+ @click="bomAddModelVisible = true">鏂板</el-button>
<el-button icon="el-icon-plus">鏂板鐗堟湰</el-button>
<el-button @click="bomRightUp=true" icon="el-icon-edit-outline">淇敼</el-button>
<el-button @click="bomRightDl=true" icon="el-icon-delete">鍒犻櫎</el-button>
@@ -49,176 +49,39 @@
<el-input v-model="searchName" size="small" placeholder="璇疯緭鍏�" style="width: 224px;margin-right: 24px;"
clearable></el-input>
<span>{{ tableType == 1 ? '鐗堟湰锛�' : '鐗堟湰锛�' }}</span>
- <el-select size="small" v-model="VER" @change="verevent" style="width: 280px;" placeholder="璇烽�夋嫨">
+ <el-select v-model="VER" @change="verevent" style="width: 280px;" placeholder="璇烽�夋嫨">
<el-option v-for="item in version" :key="item" :label="item" :value="item">
</el-option>
</el-select>
- <el-button style="margin-left:10px;" size="mini" @click="() => { searchName = ''; selectProductTableData() }"><span>閲� 缃�</span></el-button>
+ <el-button size="mini" @click="() => { searchName = ''; selectProductTableData() }"><span>閲� 缃�</span></el-button>
<el-button size="mini" type="primary" style="background: #004EA2;" @click="selectProductTableData"><span>鏌�
璇�</span></el-button>
</div>
- <div v-if="this.typeselect == 0">
+ <div class="contentTable" v-if="this.typeselect == 0">
<technology :tableType="tableType" :tableData="tableData"></technology>
</div>
<div v-if="this.typeselect == 1">
<target :tableType="tableType" :tableData="tableData"></target>
</div>
<div v-if="this.typeselect == 2">
- <material :tableType="tableType" :tableData="tableData"></material>
+ <bom :tableType="tableType" :tableData="tableData"></bom>
</div>
- <div v-if="this.typeselect == 3">
- <product :tableType="tableType" :tableData="tableData"></product>
- </div>
+ <div v-if="this.typeselect == 3">鐢熶骇宸ヨ壓</div>
</div>
</div>
<div class="bom-add-model">
- <el-dialog title="BOM鏂板" :visible.sync="bomAddModelVisible" width="35%">
- <!-- 宸ヨ壓璺嚎 -->
- <div v-if="typeselect == 0">銆�
- <el-form :model="technologyForm" :inline="true" class="demo-form-inline" label-position="right"
- :rules="boomRules" ref="boomForm" label-width="90px">
- <el-form-item label="宸ュ簭:" prop="father" width="250">
- <el-select v-model="technologyForm.father"
- style="width:200px;" placeholder="璇疯緭鍏ユ垨閫夋嫨宸ュ簭">
- <el-option :value="item.father" :label="item.father" v-for="(item,index) in fatherList" :key="index"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="宸ヨ壓鍚嶇О:" prop="name" width="250">
- <el-input placeholder="璇疯緭鍏ュ伐鑹哄悕绉�" style="width:200px;"
- v-model="technologyForm.name"></el-input>
- </el-form-item>
- <el-form-item label="璁惧缁�:" prop="deviceGroup" width="250">
- <el-select placeholder="璇烽�夋嫨璁惧缁�"
- style="width:200px;"
- v-model="technologyForm.deviceGroup">
- <el-option :value="item.father"
- v-for="(item,index) in deviceList" :key="index" :label="item.father"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="鐢熶骇瀹氶:" prop="productionQuota" width="250">
- <el-input style="width:200px;" v-model.number="technologyForm.productionQuota" placeholder="璇疯緭鍏ョ敓浜у畾棰�" />
- </el-form-item>
- </el-form>
- </div>
- <!-- 鎶�鏈寚鏍� -->
- <div v-if="typeselect == 1">
- <el-form :model="targetForm" :inline="true" class="demo-form-inline" label-position="right"
- label-width="80px">
- <el-form-item label="鎸囨爣鍚嶇О:" prop="father" width="250">
- <el-input style="width:200px;" v-model="targetForm.pname" placeholder="璇疯緭鍏ュ崟浣�"/>
- </el-form-item>
- <el-form-item label="鍗曚綅:" prop="name" width="250">
- <el-input style="width:200px;" v-model="targetForm.unit" placeholder="璇疯緭鍏ュ崟浣�"/>
- </el-form-item>
- <el-form-item label="鍐呮帶鍊�:" prop="dg" width="250">
- <el-input style="width:200px;" v-model="targetForm.internal" placeholder="璇疯緭鍏ュ崟浣�"/>
- </el-form-item>
- <el-form-item label="鏍囧噯鍊�:" prop="unit" width="250">
- <el-input style="width:200px;" v-model="targetForm.required" placeholder="璇疯緭鍏ュ崟浣�"/>
- </el-form-item>
- </el-form>
- </div>
- <!-- 鐗╂枡娓呭崟 -->
- <div v-if="typeselect == 2">
- <el-form :model="materialForm" class="demo-form-inline" label-position="right"
- label-width="80px">
- <el-row>
- <el-col :span="12">
- <el-form-item label="瑙勬牸鍨嬪彿:" prop="father" width="250">
- <el-input style="width:200px;" v-model="materialForm.pname" placeholder="璇疯緭鍏ュ崟浣�"/>
- </el-form-item>
- </el-col>
- <el-col :span="12" style="text-align: right;">
- <el-form-item label="浜у搧澶х被:" prop="name" width="250">
- <el-select placeholder="璇烽�夋嫨浜у搧澶х被"
- style="width:240px;" v-model="materialForm.dg">
- <el-option value="1">1</el-option>
- <el-option value="2">2</el-option>
- <el-option value="3">3</el-option>
- <el-option value="4">4</el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="鏉愭枡淇℃伅"></el-form-item>
- </el-col>
- <el-col :span="12" style="text-align: right;">
- <el-button size="mini" style="text-align: right;">娣诲姞琛�</el-button>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-table >
- <el-table-column label="鏉愭枡鍚嶇О"></el-table-column>
- <el-table-column label="瑙勬牸鍨嬪彿"></el-table-column>
- <el-table-column label="鍗曚綅"></el-table-column>
- <el-table-column label="鏁伴噺"></el-table-column>
- </el-table>
- </el-col>
- </el-row>
- </el-form>
- </div>
- <!-- 鐢熶骇宸ヨ壓 -->
- <div v-if="typeselect == 3">
- <el-form :model="technologyForm" :inline="true" class="demo-form-inline" label-position="right"
- label-width="80px">
- <el-form-item label="宸ュ簭:" prop="father" width="250">
- <el-select v-model="technologyForm.father"
- style="width:200px;"
- placeholder="璇疯緭鍏ユ垨閫夋嫨鐢熶骇瀹氶">
- <el-option value="1">1</el-option>
- <el-option value="2">2</el-option>
- <el-option value="3">3</el-option>
- <el-option value="4">4</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="宸ヨ壓鍚嶇О:" prop="name" width="250">
- <el-select placeholder="璇疯緭鍏ユ垨閫夋嫨宸ヨ壓鍚嶇О"
- style="width:200px;"
- v-model="technologyForm.name">
- <el-option value="1">1</el-option>
- <el-option value="2">2</el-option>
- <el-option value="3">3</el-option>
- <el-option value="4">4</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="璁惧:" prop="dg" width="250">
- <el-select placeholder="璇烽�夋嫨璁惧"
- style="width:200px;"
- v-model="technologyForm.dg">
- <el-option value="1">1</el-option>
- <el-option value="2">2</el-option>
- <el-option value="3">3</el-option>
- <el-option value="4">4</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="椤圭洰:" prop="dg" width="250">
- <el-select placeholder="璇烽�夋嫨椤圭洰"
- style="width:200px;"
- v-model="technologyForm.dg">
- <el-option value="1">1</el-option>
- <el-option value="2">2</el-option>
- <el-option value="3">3</el-option>
- <el-option value="4">4</el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="鍗曚綅:" prop="unit" width="250">
- <el-input style="width:200px;" v-model="technologyForm.unit" placeholder="璇疯緭鍏ュ崟浣�"/>
- </el-form-item>
- <el-form-item label="鎸囨爣:" prop="pq" width="250">
- <el-input style="width:200px;" v-model="technologyForm.pq" placeholder="璇疯緭鍏ユ寚鏍�" />
- </el-form-item>
- </el-form>
+ <el-dialog title="BOM鏂板" :visible.sync="bomAddModelVisible" width="30%">
+ <div>
+ <!-- 鐗╂枡娓呭崟鏂板 -->
+ <bomClickAdd v-if="typeselect===2"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="bomAddModelVisible = false">鍙� 娑�</el-button>
- <el-button type="primary" @click="confirmAdd('boomForm')">纭� 瀹�</el-button>
+ <el-button type="primary" @click="bomAddModelVisible = false">纭� 瀹�</el-button>
</span>
</el-dialog>
<!-- 宸︿晶鐐瑰嚮+鎸夐挳 -->
@@ -272,40 +135,13 @@
<script>
import technology from "./standard-table/technology.vue"
import material from "./standard-table/material.vue"
-import target from "./standard-table/target.vue"
-import product from "./standard-table/product.vue"
+// import bom from "./standard-table/bom.vue"
import bomClickAdd from '@/components/view/standard-box/bomClickAdd'
export default {
- components: { technology,material,target,product,bomClickAdd },
+ components: { technology,material,bomClickAdd },
+
data() {
return {
- //宸ュ簭鍒楄〃
- fatherList:[],
- //璁惧缁勫垪琛�
- deviceList:[],
- technologyForm:{
- father:'',
- name:'',
- deviceGroup:'',
- productionQuota:''
- },
- targetForm:{
- pname:'',
- unit:'',
- internal:'',
- required: ''
- },
- formTypeOptions:[],
- materialForm:{},
- boomRules:{
- father:{required:true,message:'宸ュ簭涓嶈兘涓虹┖',trigger:'change'},
- name:{required:true,message:'宸ヨ壓鍚嶇О涓嶈兘涓虹┖',trigger:'blur'},
- deviceGroup:{required:true,message:'璁惧缁勪笉鑳戒负绌�',trigger:'change'},
- productionQuota:[
- {required:true,message:'鐢熶骇瀹氶涓嶈兘涓虹┖',trigger:'blur'},
- {type:'number',required:true,message:'鏁版嵁绫诲瀷蹇呴』鏄函鏁板瓧',trigger:'blur'}
- ]
- },
// BOM鏍戞暟鎹粨鏋�
list: [],
search: null,
@@ -351,7 +187,6 @@
this.tableType=0
this.selectMaterialTree()
this.selectVersion()
- console.log(this.formTypeOptions);
},
methods: {
changeLeftAdd(){
@@ -461,56 +296,6 @@
this.$refs[formName].resetFields();
},
leftAddBom(){
-
- },
- confirmAdd(formName){
- this.$refs[formName].validate(valid=>{
- if(valid){
- console.log(this.technologyForm);
- this.$axios.post(this.$api.url.addTechnology,
- {
- "specificationsId": this.returntree.id,
- "technologyDto": JSON.stringify({
- deviceGroup: this.technologyForm.deviceGroup,
- father: this.technologyForm.father,
- name: this.technologyForm.name,
- productionQuota: this.technologyForm.productionQuota,
- })
- },{
- headers: { "Content-Type": "application/json" }
- }).then(res=>{
- this.$message.success(res.message);
- }).catch(error=>{
- this.$message.error(error.message);
- })
- this.bomAddModelVisible = false;
- }
- })
- },
- //鑾峰彇宸ュ簭鍒楄〃
- getFatherList(){
- this.$axios.get(this.$api.url.chooseFather,{
- params:{specificationsId : this.returntree.id}
- }).then(res=>{
- this.fatherList = res.data;
- }).catch(error=>{
- this.$message.error(error.message);
- })
- },
- //鑾峰彇璁惧缁勫垪琛�
- getDeviceList(){
- this.$axios.get(this.$api.url.chooseDevice).then(res=>{
- this.deviceList = res.data;
- }).catch(error=>{
- this.$message.error(error.message);
- })
- },
- showBomAddModel(){
- this.getFatherList();
- this.getDeviceList();
- this.bomAddModelVisible = true
- },
- startLeftAdd(){
},
getType(typeName){
@@ -577,6 +362,7 @@
TYPE(val) {//绫诲瀷.鏁版嵁
// console.log(val);
this.typeselect = val
+
// console.log(this.typeselect);
this.selectVersion()
},
@@ -793,7 +579,12 @@
<style scoped>
-.standard {}
+.standard {
+
+}
+
+.standard .contentTable{
+}
.standard .title .el-button {
height: 32px;
--
Gitblit v1.9.3