From d233572a40431aa56e665553a87df80c973ca5b2 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期六, 29 三月 2025 14:51:15 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/api/business/productOrder.js | 8 + src/views/CNAS/resourceDemand/device/component/management.vue | 4 src/views/business/materialOrder/customsInspection.vue | 3 src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue | 52 +++++- src/views/statisticalCharts/inspectionItemWarning/index.vue | 281 +++++++++++++++++++++++++++++++++++ src/api/statisticalCharts/dataAnalysis.js | 16 ++ src/views/business/productOrder/index.vue | 70 +++++++- src/views/business/productOrder/components/addInspectionDia.vue | 4 8 files changed, 413 insertions(+), 25 deletions(-) diff --git a/src/api/business/productOrder.js b/src/api/business/productOrder.js index 8be32b1..881ca80 100644 --- a/src/api/business/productOrder.js +++ b/src/api/business/productOrder.js @@ -122,3 +122,11 @@ data: query }) } +// 淇敼鏍峰搧鍨嬪彿 +export function updateSampleModel(query) { + return request({ + url: '/insOrder/updateSampleModel', + method: 'post', + data: query + }) +} diff --git a/src/api/statisticalCharts/dataAnalysis.js b/src/api/statisticalCharts/dataAnalysis.js index 0775c06..1ac9276 100644 --- a/src/api/statisticalCharts/dataAnalysis.js +++ b/src/api/statisticalCharts/dataAnalysis.js @@ -71,3 +71,19 @@ data: query, }); } +//鏌ヨ棰勮鍒楄〃 +export function selectDeviationWarningPage(query) { + return request({ + url: "/insProductDeviationWarning/selectDeviationWarningPage", + method: "get", + params: query, + }); +} +//鏌ヨ棰勮鍒楄〃 +export function selectDeviationWarning(query) { + return request({ + url: "/insProductDeviationWarning/selectDeviationWarning", + method: "get", + params: query, + }); +} diff --git a/src/views/CNAS/resourceDemand/device/component/management.vue b/src/views/CNAS/resourceDemand/device/component/management.vue index 5e09090..8d74156 100644 --- a/src/views/CNAS/resourceDemand/device/component/management.vue +++ b/src/views/CNAS/resourceDemand/device/component/management.vue @@ -1,7 +1,7 @@ <!-- 璁惧宸ュ叿鏄庣粏 --> <template> <div class="role_manage"> - <div class="search"> + <div class="search" v-show="!showData"> <div> <el-form :model="queryParams" ref="queryParams" size="small" :inline="true"> <el-form-item label="鐘舵��" prop="deviceStatus" class="form-item"> @@ -444,11 +444,9 @@ labelPosition: 'right', dialogVisible: false, dialogVisible2: false, - addPower: false, showData: false, // 鏁伴噰閰嶇疆椤甸潰 tableList: [], addDia: true, - addPower: true, //璁惧绫诲瀷鍒楄〃 equipmentList: [], // 璐熻矗浜哄垪琛� diff --git a/src/views/business/materialOrder/customsInspection.vue b/src/views/business/materialOrder/customsInspection.vue index 3a45a3b..c95345c 100644 --- a/src/views/business/materialOrder/customsInspection.vue +++ b/src/views/business/materialOrder/customsInspection.vue @@ -356,10 +356,9 @@ </span> </el-dialog> <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" - :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border :show-close="false" :visible.sync="bsm3Dia" title="鍖洪棿鍊煎~鍐�" width="800px"> - <el-table :data="editTable" height="80vh" style="width: 100%"> + <el-table :data="editTable" height="80vh" style="width: 100%" :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border> <!-- inspectionItemList --> <el-table-column label="妫�楠岄」" prop="inspectionItemList" width="180"> </el-table-column> diff --git a/src/views/business/productOrder/components/addInspectionDia.vue b/src/views/business/productOrder/components/addInspectionDia.vue index ae76551..b689ac4 100644 --- a/src/views/business/productOrder/components/addInspectionDia.vue +++ b/src/views/business/productOrder/components/addInspectionDia.vue @@ -27,9 +27,9 @@ size="small"></el-input> </template> </el-table-column> - <el-table-column align="center" label="妫�楠屾爣鍑�" min-width="100" prop="standardMethodListId"> + <el-table-column align="center" label="妫�楠屾爣鍑�" min-width="100" prop="standardMethodName"> <template slot-scope="scope"> - <el-input v-model="scope.row.standardMethodListId" clearable disabled placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚" + <el-input v-model="scope.row.standardMethodName" clearable disabled placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚" size="small"></el-input> </template> </el-table-column> diff --git a/src/views/business/productOrder/index.vue b/src/views/business/productOrder/index.vue index d619ab2..eb1e2c2 100644 --- a/src/views/business/productOrder/index.vue +++ b/src/views/business/productOrder/index.vue @@ -294,9 +294,28 @@ @closePrintDialog="closePrintDialog"></print-dialog> <!--娣诲姞閬楁紡妫�楠岄」寮规--> <add-inspection-dia v-if="addInspectionDia" ref="addInspectionDia"></add-inspection-dia> - <!-- <Inspection v-if="state>0" :key="InspectionKey" :inspectorList="inspectorList" :orderId="orderId"--> - <!-- :sonLaboratory="sonLaboratory" :state="state"--> - <!-- :typeSource="typeSource" @goback="goback" @refreshView="refreshView"/>--> + <!--淇敼鏍峰搧鍨嬪彿寮规--> + <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" + :visible.sync="dialogVisible" title="淇敼鏍峰搧鍨嬪彿" width="80%"> + <el-table ref="sampleTable" :data="sampleList" border highlight-current-row + :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" + max-height="400px" tooltip-effect="dark"> + <el-table-column align="center" label="搴忓彿" type="index" width="65"></el-table-column> + <el-table-column align="center" label="鏍峰搧鍚嶇О" min-width="100" prop="sample"> </el-table-column> + <el-table-column align="center" label="鏍峰搧缂栧彿" min-width="100" prop="sampleCode"></el-table-column> + <el-table-column align="center" label="鏍峰搧鍨嬪彿" min-width="60" prop="model"> + <template slot-scope="scope"> + <el-input v-model="scope.row.model" clearable placeholder="涓嶅~鍐欏垯绯荤粺鑷姩鐢熸垚" + size="small"></el-input> + </template> + </el-table-column> + <el-table-column align="center" label="妫�楠屾爣鍑�" min-width="100" prop="standardMethodName"></el-table-column> + </el-table> + <span slot="footer" class="dialog-footer"> + <el-button @click="dialogVisible = false">鍙� 娑�</el-button> + <el-button :loading="submitListLoad" type="primary" @click="submitList">纭� 瀹�</el-button> + </span> + </el-dialog> </div> </template> @@ -307,11 +326,11 @@ import AddInspectionDia from "@/views/business/productOrder/components/addInspectionDia.vue"; import limsTable from "@/components/Table/lims-table.vue"; import { - checkUpdate, delInsOrder, + checkUpdate, delInsOrder, getSampleByOrderId, rawAllInsOrderExport, selectInsOrderParameter, selectNoProducts, selectOrderManDay, updateInspected, - updateOrderEntrustCode, updateStatus, upInsOrder, upPlanUser2 + updateOrderEntrustCode, updateSampleModel, updateStatus, upInsOrder, upPlanUser2 } from "@/api/business/productOrder"; import { selectUserCondition } from "@/api/performance/class"; import { downFile, getFileList, selectSampleAndProductByOrderId } from "@/api/business/rawMaterialOrder"; @@ -349,7 +368,13 @@ dataType: "link", linkMethod: "selectAllByOne", }, - { label: '鏍峰搧鍨嬪彿', prop: 'sampleModel' }, + { + label: "鏍峰搧鍨嬪彿", + prop: "sampleModel", + width: "160px", + dataType: "link", + linkMethod: "editSampleModel", + }, { label: '鏍峰搧鏁伴噺', prop: 'sampleNum' }, { label: '妫�楠屼汉', prop: 'testingName' }, { @@ -736,7 +761,10 @@ multipleSelection: [], sonLaboratoryList: [], printDialog: false, - addInspectionDia: false + addInspectionDia: false, + dialogVisible: false, + submitListLoad: false, + sampleList: [] } }, watch: { @@ -941,7 +969,7 @@ this.dataDialogVisible = false; this.upLoad = false; }, - // 璇︽儏 + // 鐐瑰嚮鏍峰搧鍚嶇О selectAllByOne(row) { this.$router.push({ path: "/productOrder/add", query: { @@ -952,6 +980,32 @@ } }); }, + // 淇敼鏍峰搧鍨嬪彿 + editSampleModel (row) { + if (this.tabIndex !== 1) { + return + } + this.dialogVisible = true + this.getDataList(row) + }, + getDataList(row) { + this.dialogVisible = true + getSampleByOrderId({insOrderId: row.id}).then(res => { + this.sampleList = res.data + }) + }, + // 鎻愪氦鏍峰搧鍨嬪彿淇敼 + submitList () { + this.submitListLoad = true + updateSampleModel(this.sampleList).then(res => { + this.submitListLoad = false + this.dialogVisible = false + this.$message.success('淇敼鎴愬姛') + this.refreshTable() + }).catch(err => { + this.submitListLoad = false + }) + }, // 鏁版嵁鏌ョ湅 handleDataLook(row) { this.dataDialogVisible = true; diff --git a/src/views/statisticalCharts/inspectionItemWarning/index.vue b/src/views/statisticalCharts/inspectionItemWarning/index.vue new file mode 100644 index 0000000..41ef602 --- /dev/null +++ b/src/views/statisticalCharts/inspectionItemWarning/index.vue @@ -0,0 +1,281 @@ +<template> + <div class="app-container"> + <div> + <lims-table :tableData="tableData" :column="column" + :height="'calc(100vh - 500px)'" @pagination="pagination" + :rowClick="rowClick" + :page="page" :tableLoading="tableLoading"></lims-table> + </div> + <div> + <el-row> + <el-col :span="24"> + <div class="inspection-card"> + <div class="title">妫�楠岄」鍋忓樊棰勮鏁版嵁璇︽儏</div> + <Echarts ref="chart" + :chartStyle="chartStyle" + :grid="grid" + :options="echartsOptions" + :series="echartsSeries" + :tooltip="tooltip" + :xAxis="xAxis" + :yAxis="yAxis" + style="height: 40vh;"></Echarts> + </div> + </el-col> + </el-row> + </div> + <el-dialog :visible.sync="viewDia" title="鏌ョ湅璇︽儏" width="1100px"> + <lims-table :tableData="tableData1" :column="column1" + height="570" + :tableLoading="tableLoading1"></lims-table> + </el-dialog> + </div> +</template> + +<script> +import limsTable from "@/components/Table/lims-table.vue"; +import {selectDeviationWarning, selectDeviationWarningPage} from "@/api/statisticalCharts/dataAnalysis"; +import Echarts from "@/components/echarts/echarts.vue"; + +export default { + name: '', + // import 寮曞叆鐨勭粍浠堕渶瑕佹敞鍏ュ埌瀵硅薄涓墠鑳戒娇鐢� + components: {Echarts, limsTable}, + data() { + // 杩欓噷瀛樻斁鏁版嵁 + return { + viewDia: false, + queryParams: {}, + tableData: [], + tableLoading: false, + column: [ + { label: '鏍峰搧缂栧彿', prop: 'sampleCode',width: 150 }, + { label: '鏍峰搧鍚嶇О', prop: 'sampleName',width: 150 }, + { label: '鍨嬪彿', prop: 'sampleModel' }, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName',width: 150 }, + { label: '妫�楠岄」鍚嶇О', prop: 'inspectionItemName',width: 150 }, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName',width: 150 }, + { + label: "鍋忓樊鍊�", + prop: "deviationValue", + width: 150, + dataType: "tag", + formatType: (params) => { + return 'danger' + }, + }, + { label: '妫�娴嬫椂闂�', prop: 'detectionTime',width: 160 }, + { + dataType: 'action', + label: '鎿嶄綔', + operation: [ + { + name: '鏌ョ湅', + type: 'text', + clickFun: (row) => { + this.openDia(row); + }, + } + ] + } + ], + page: { + total: 0, + size: 20, + current: 1 + }, + tableData1: [], + tableLoading1: false, + column1: [ + { label: '鏍峰搧缂栧彿', prop: 'sampleCode'}, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'}, + { label: '渚涘簲鍟嗗悕绉�', prop: 'supplierName'}, + { + label: "妫�娴嬪��", + prop: "testValue", + width: 150, + dataType: "tag", + formatType: (params) => { + if (this.tableData1.find((m) => m.testValue == params).isIssue == 1) { + return 'danger' + } else { + return 'success' + } + }, + }, + { label: '妫�娴嬫椂闂�', prop: 'detectionTime',width: 160 }, + ], + chartStyle: { + width: '100%', + height: '96%' // 璁剧疆鍥捐〃瀹瑰櫒鐨勯珮搴� + }, + grid: { + left: '3%', + right: '4%', + bottom: '3%', + containLabel: true + }, + tooltip: {}, + echartsOptions: {}, + echartsSeries: [ + { + name: '鍋忓樊鍊�', + type: 'line', + smooth: true, + tooltip: { + valueFormatter: function (value) { + return value; + } + }, + label: { + show: true, + position: 'top', + formatter: function (value) { + return value.value; + }, + distance: 14 + }, + data: [], + markArea: {}, + markPoint: {} + }, + ], + xAxis: [ + { + type: 'category', + data: [], + boundaryGap: false, + axisLabel: { + interval: 0, // 寮哄埗鏄剧ず鎵�鏈夋爣绛� + rotate: 0, // 涓嶆棆杞紙鍙互鏍规嵁闇�瑕佽皟鏁达級 + formatter: function (value) { + // 姣忛殧涓�瀹氶暱搴︽坊鍔犳崲琛岀 + const maxLength = 9; // 姣忔鏈�澶у瓧绗︽暟 + let result = ''; + for (let i = 0; i < value.length; i += maxLength) { + result += value.substring(i, i + maxLength) + '\n'; + } + return result.trim(); // 鍘绘帀鏈熬澶氫綑鐨勬崲琛岀 + }, + margin: 10, // 鏍囩涓庤酱绾跨殑璺濈 + }, + } + ], + yAxis: [{ + type: 'value', + axisLabel: { + formatter: '{value}' + } + }], + }; + }, + mounted() { + this.refreshTable() + }, + // 鏂规硶闆嗗悎 + methods: { + // 鏌ヨ鍒楄〃淇℃伅 + refreshTable() { + this.tableLoading = true + selectDeviationWarningPage({ ...this.page}).then(res => { + this.tableLoading = false + this.tableData = res.data.records + this.page.total = res.data.total + }).catch(err => { + this.tableLoading = false + }) + }, + // 鏌ヨ鎶樼嚎鍥句俊鎭� + rowClick (row) { + selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => { + console.log('res---', res) + if (res.data === null) { + this.$message.warning('鏆傛棤鏁版嵁') + return + } + let lineData = [] + let xAxis = [] + let markAreas = []; // 瀛樺偍 markArea 鐨勬暟缁� + let markPoints = []; + res.data.forEach((item, index) => { + lineData.push(item.testValue) + xAxis.push(item.sampleCode) + // 濡傛灉 isIssue 涓� 1锛屽垯鍦ㄦ绱㈠紩澶勬坊鍔犱竴涓� markArea + if (item.isIssue == 1) { + const startColumn = index > 0 ? xAxis[index - 1] : xAxis[index]; // 璧风偣锛氬墠涓�鍒楁垨褰撳墠鍒� + const endColumn = xAxis[index]; // 缁堢偣锛氬綋鍓嶅垪 + + markAreas.push([ + { + xAxis: startColumn, // 浠庡墠涓�鍒楀紑濮� + }, + { + xAxis: endColumn, // 鍒板綋鍓嶅垪缁撴潫 + } + ]); + markPoints.push({ + name: '闂鐐�', + coord: [item.sampleCode, item.testValue], + value: item.testValue, + itemStyle: { + color: 'rgba(255, 173, 177, 0.8)' + }, + label: { + show: true, + formatter: function(params) { + return params.value; // 鑷畾涔夋爣绛惧唴瀹� + }, + color: 'black', // 鏍囩鏂囧瓧棰滆壊 + fontSize: 12, + distance: 5, // 璋冩暣鏍囩涓庢皵娉$殑璺濈 + padding: [0,0], + backgroundColor: 'rgba(255, 173, 177, 0.8)', // 鏍囩鑳屾櫙鑹插強閫忔槑搴� + borderRadius: 4 + } + }); + } + }) + this.xAxis[0].data = xAxis + this.echartsSeries[0].data = lineData + // 鏇存柊 markArea 閰嶇疆 + this.echartsSeries[0].markArea = { + itemStyle: { + color: 'rgba(255, 173, 177, 0.4)' // 璁剧疆鑳屾櫙棰滆壊 + }, + data: markAreas // 鍔ㄦ�佺敓鎴愮殑 markArea 鏁版嵁 + }; + this.echartsSeries[0].markPoint = { + data: markPoints + }; + }) + }, + // 閲嶇疆 + refresh() { + // this.resetForm('entity') + this.refreshTable() + }, + // 鍒嗛〉鍒囨崲 + pagination(page) { + this.page.size = page.limit + this.refreshTable() + }, + openDia (row) { + this.viewDia = true + this.tableLoading1 = true + selectDeviationWarning({deviationWarningId: row.deviationWarningId}).then(res => { + this.tableLoading1 = false + this.tableData1 = res.data + }).catch(() => { + this.tableLoading1 = false + }) + }, + } +}; +</script> + +<style scoped> +.inspection-card{ + width: 100%; + margin-top: 10px; +} +</style> diff --git a/src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue b/src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue index 4755b92..103c747 100644 --- a/src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue +++ b/src/views/structural/capabilityAndLaboratory/capabilityComponents/EditForm.vue @@ -103,6 +103,15 @@ </el-select> </el-form-item> </el-col> + <el-col :span="12" v-if="editForm.inspectionItemType == 1"> + <el-form-item label="璁惧缁戝畾锛�" prop="deviceId"> + <el-select v-model="editForm.deviceId" clearable placeholder="璇烽�夋嫨" size="small" style="width: 100%" multiple> + <el-option v-for="item in equipOptions" :key="item.value" :label="item.label" :value="item.value"></el-option> + </el-select> + </el-form-item> + </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="妫�楠屽�肩被鍨嬶細" prop="inspectionValueType"> <el-select v-model="editForm.inspectionValueType" clearable placeholder="璇烽�夋嫨" size="small" style="width: 100%"> @@ -110,8 +119,6 @@ </el-select> </el-form-item> </el-col> - </el-row> - <el-row> <el-col :span="12"> <el-form-item label="鐗规畩鏍囪瘑锛�" prop="bsm"> <el-select v-model="editForm.bsm" clearable placeholder="璇烽�夋嫨" size="small" style="width: 100%"> @@ -119,6 +126,8 @@ </el-select> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="鍘熷璁板綍妯℃澘锛�" prop="templateId"> <el-select v-model="editForm.templateId" clearable placeholder="璇烽�夋嫨" size="small" style="width: 100%"> @@ -126,20 +135,18 @@ </el-select> </el-form-item> </el-col> - </el-row> - <el-row> <el-col :span="12"> <el-form-item label="妫�楠岄」鍒嗙被锛�" prop="inspectionItemClass"> <el-input v-model="editForm.inspectionItemClass" clearable size="small"></el-input> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="妫�楠岄」鍒嗙被EN锛�" prop="inspectionItemClassEn"> <el-input v-model="editForm.inspectionItemClassEn" clearable size="small"></el-input> </el-form-item> </el-col> - </el-row> - <el-row> <el-col :span="12"> <el-form-item label="璇曢獙鏂规硶锛�" prop="method"> <el-select v-model="editForm.method" clearable multiple placeholder="璇烽�夋嫨" size="small" style="width: 100%"> @@ -147,6 +154,8 @@ </el-select> </el-form-item> </el-col> + </el-row> + <el-row> <el-col :span="12"> <el-form-item label="鏉′欢锛�" prop="radiusList"> <el-select v-model="editForm.radiusList" allow-create default-first-option filterable multiple @@ -157,8 +166,6 @@ </el-select> </el-form-item> </el-col> - </el-row> - <el-row> <el-col :span="12"> <el-form-item label="鏀惰垂鏍囧噯(鍏�/娆�)锛�" prop="rates"> <el-input v-model="editForm.rates" clearable size="small"></el-input> @@ -191,6 +198,7 @@ upItemParameter } from "@/api/structural/capability"; import {selectStandardMethods} from "@/api/structural/standardMethod"; +import {search} from "@/api/business/inspectionTask"; export default { name: "EditForm", @@ -227,6 +235,7 @@ method: '', // 璇曢獙鏂规硶 radiusList: [], // 鏉′欢 rates: '', // 鏉′欢 + deviceId: [], // 璁惧 }, sampleList: [], // 妫�楠屽璞′笅鎷夋 laboratoryList: [], // 鍦烘墍涓嬫媺妗� @@ -262,7 +271,8 @@ { required: true, message: '璇烽�夋嫨鍘熷璁板綍妯℃澘', trigger: 'change' } ] }, - operationType: '' + operationType: '', + equipOptions: [] } }, // 鏂规硶闆嗗悎 @@ -270,6 +280,7 @@ openDia (type, row) { this.operationType = type this.editFormDia = true + this.getEquipOptions() // 鑾峰彇鎵�鏈夎澶� this.obtainItemParameterList() // 鍦烘墍绫诲瀷 this.getStandardTemplate() // 鍘熷璁板綍妯℃澘涓嬫媺妗� this.getSelectStandardMethods() // 璇曢獙鏂规硶 @@ -305,8 +316,9 @@ } else { this.editForm = this.HaveJson(row) this.editForm.sample = JSON.parse(this.editForm.sample) - this.editForm.radiusList = JSON.parse(this.editForm.radiusList) + this.editForm.radiusList = this.editForm.radiusList && JSON.parse(this.editForm.radiusList) this.editForm.method = JSON.parse(this.editForm.method) + this.$set(this.editForm, 'deviceId', this.editForm.deviceIds && this.editForm.deviceIds.split(",")) } }, // 鎻愪氦缂栬緫 @@ -321,6 +333,11 @@ obj.radiusList = JSON.stringify(obj.radiusList) } else { obj.radiusList = null + } + if (obj.deviceId?.length > 0) { + obj.deviceIds = obj.deviceId.join(',') + } else { + obj.deviceIds = null } if(obj.id){ // 淇敼 @@ -425,6 +442,21 @@ this.templateIdList = data }) }, + // 鑾峰彇鎵�鏈夎澶� + getEquipOptions() { + this.equipOptions = []; + search({ status: 0 }).then((res) => { + if (res.code === 200 && res.data) { + this.equipOptions = res.data.map((m) => { + m.value = m.managementNumber; + m.label = m.deviceName; + return m; + }); + } + }).catch((error) => { + console.error(error); + }); + }, }, } </script> -- Gitblit v1.9.3