From 844c5ce8fd318f5c64c9dbb270ac01ec204e3525 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 17 二月 2025 13:14:28 +0800
Subject: [PATCH] 1.场所或设施联调
---
src/views/structural/premises/index.vue | 365 +++++++++++++++++++++++++++++++++++++++++++++++++++-
src/api/structural/laboratoryScope.js | 10 +
2 files changed, 366 insertions(+), 9 deletions(-)
diff --git a/src/api/structural/laboratoryScope.js b/src/api/structural/laboratoryScope.js
index 4fa59a1..bd8680b 100644
--- a/src/api/structural/laboratoryScope.js
+++ b/src/api/structural/laboratoryScope.js
@@ -1,9 +1,17 @@
import request from '@/utils/request'
-// 鑾峰彇鍦烘墍鏋氫妇鍊�
+// 鑾峰彇瀹為獙瀹ゅ悕绉�
export function obtainItemParameterList() {
return request({
url: '/laboratoryScope/obtainItemParameterList',
method: 'get'
})
}
+// 鏌ヨ瀹為獙瀹ょ鐞嗗垪琛�
+export function selectItemParameter(query) {
+ return request({
+ url: '/laboratoryScope/selectItemParameter',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/src/views/structural/premises/index.vue b/src/views/structural/premises/index.vue
index 65bfbb8..c2b8d10 100644
--- a/src/views/structural/premises/index.vue
+++ b/src/views/structural/premises/index.vue
@@ -1,13 +1,362 @@
-<script>
-export default {
- name: "index"
-}
-</script>
-
<template>
-
+ <div class="capacity-scope">
+ <div class="search">
+ <div>
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+ <el-form-item label="瀹為獙瀹ゅ悕绉�" prop="laboratoryName">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.laboratoryName"
+ @keyup.enter.native="refreshTable"></el-input>
+ </el-form-item>
+ <el-form-item label="瀹為獙瀹ょ紪鐮�" prop="laboratoryNumber">
+ <el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="queryParams.laboratoryNumber"
+ @keyup.enter.native="refreshTable"></el-input>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="refreshTable">鏌� 璇�</el-button>
+ <el-button icon="el-icon-refresh" size="mini" @click="refresh">閲� 缃�</el-button>
+ </el-form-item>
+ </el-form>
+ </div>
+ <div>
+ <el-button size="small" type="primary" @click="openAdd" icon="el-icon-plus">鏂板</el-button>
+ </div>
+ </div>
+ <div class="table">
+<!-- <ValueTable ref="ValueTable" :url="$api.laboratoryScope.selectItemParameter"-->
+<!-- :upUrl="$api.laboratoryScope.upParameter" :delUrl="$api.laboratoryScope.delParameter"-->
+<!-- :componentData="componentData" :key="upIndex" />-->
+ <lims-table :tableData="tableData" :column="column"
+ @pagination="pagination"
+ :page="page" :tableLoading="tableLoading"></lims-table>
+ </div>
+ <el-dialog title="鍗扮珷绠$悊" :visible.sync="fileVisible" width="60vw">
+ <div class="btns">
+ <el-button size="medium" type="primary" @click="openUpload">鏇存柊鍗扮珷</el-button>
+ </div>
+<!-- <ValueTable ref="ValueTable0" :url="$api.sealScope.selectSeal"-->
+<!-- :componentData="fileComponentData" :key="upIndex" style="height: 400px;" />-->
+ </el-dialog>
+ <el-dialog title="鏇存柊鍗扮珷" :visible.sync="upFileVisible" width="400px">
+ <div class="search_thing" style="margin-bottom: 16px;">
+ <div class="search_label" style="width:90px">鍗扮珷绫诲瀷锛�</div>
+ <div class="search_input">
+ <el-cascader
+ v-model="dataForm.type"
+ :options="options"
+ :show-all-levels="false"
+ :props="props"
+ placeholder="璇烽�夋嫨" size="small"
+ style="width:100%"
+ collapse-tags
+ clearable></el-cascader>
+ </div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label" style="width:90px">鍗扮珷鍥剧墖锛�</div>
+ <div class="search_input">
+ <el-upload
+ :action="action"
+ :headers="headers"
+ accept='image/jpg,image/jpeg,image/png'
+ :show-file-list="false"
+ :on-success="handleSuccess"
+ :on-change="beforeUpload"
+ ref="upload"
+ :on-error="onError"
+ >
+ <img v-if="dataForm.address" :src="javaApi+'/img/'+dataForm.address" style="width: 110px;height: 110px;" >
+ <i v-else class="el-icon-plus avatar-uploader-icon"></i>
+ </el-upload>
+ </div>
+ </div>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="upFileVisible = false">鍙� 娑�</el-button>
+ <el-button type="primary" @click="confirmConnect" :loading="loading">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
+ </div>
</template>
-<style scoped lang="scss">
+<script>
+import limsTable from "@/components/Table/lims-table.vue";
+import {selectItemParameter} from "@/api/structural/laboratoryScope";
+export default {
+ components: {
+ limsTable
+
+ },
+ computed: {
+ headers() {
+ return {
+ 'token': sessionStorage.getItem('token')
+ }
+ },
+ action() {
+ return this.javaApi
+ }
+ },
+ data() {
+ return {
+ queryParams: {
+ laboratoryName: '',
+ laboratoryNumber: '',
+ },
+ tableData: [],
+ tableLoading: false,
+ column: [
+ {label: '瀹為獙瀹ゅ悕绉�', prop: 'laboratoryName'},
+ {label: '鍦烘墍缂栫爜', prop: 'laboratoryNumber'},
+ {label: '瀹為獙瀹や唬鍙�', prop: 'laboratoryCode'},
+ {label: '璐熻矗浜�', prop: 'head'},
+ {label: '璐熻矗浜虹數璇�', prop: 'phoneNumber'},
+ {label: '鍦板潃', prop: 'address'},
+ {label: '鍒涘缓浜�', prop: 'createUserName'},
+ {label: '鍒涘缓鏃堕棿', prop: 'createTime'},
+ {
+ dataType: 'action',
+ fixed: 'right',
+ label: '鎿嶄綔',
+ width: '140px',
+ operation: [
+ {
+ name: '缂栬緫',
+ type: 'text',
+ clickFun: (row) => {
+ this.editForm(row);
+ },
+ },
+ {
+ name: '鍒犻櫎',
+ type: 'text',
+ clickFun: (row) => {
+ this.delete(row);
+ },
+ },
+ {
+ name: '鍗扮珷绠$悊',
+ type: 'text',
+ clickFun: (row) => {
+ this.fileManagement(row);
+ },
+ },
+ ]
+ }
+ ],
+ page: {
+ total:0,
+ size:10,
+ current:1
+ },
+ componentData: {
+ entity: {
+ laboratoryName: null,
+ laboratoryNumber: null,
+ head: null,
+ orderBy: {
+ field: 'id',
+ order: 'asc'
+ }
+ },
+ isIndex: true,
+ showSelect: false,
+ select: false,
+ do: [{
+ id: 'update',
+ font: '缂栬緫',
+ type: 'text',
+ method: 'doDiy',
+ field: ['createUserName']
+ }, {
+ id: 'delete',
+ font: '鍒犻櫎',
+ type: 'text',
+ method: 'doDiy'
+ }, {
+ id: '',
+ font: '鍗扮珷绠$悊',
+ type: 'text',
+ method: 'fileManagement'
+ }],
+ tagField: {
+ type:{
+ select:[]
+ }
+ },
+ selectField: {},
+ requiredAdd: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
+ requiredUp: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
+ needSort: ['laboratoryName', 'createTime'],
+ },
+ fileComponentData: {
+ entity: {
+ labId:null,
+ orderBy: {
+ field: 'id',
+ order: 'asc'
+ }
+ },
+ isPage:false,
+ init:false,
+ isIndex: true,
+ showSelect: false,
+ select: false,
+ do: [],
+ tagField: {},
+ selectField: {
+ type:{
+ select:[]
+ }
+ },
+ requiredAdd: [],
+ requiredUp: [],
+ addUpload:['address'],
+ },
+ entityCopy: {},
+ fileVisible:false,
+ upFileVisible:false,
+ loading:false,
+ dataForm:{
+ type:'',
+ address:'',
+ },
+ props: { multiple: false,emitPath:false,},
+ options:[
+ {
+ value:'瀹為獙瀹よ祫璐�',
+ label:'瀹為獙瀹よ祫璐�',
+ children:[]
+ },
+ {
+ value:'濮旀墭鎶ュ憡',
+ label:'濮旀墭鎶ュ憡',
+ children:null
+ },
+ {
+ value:'杩涘巶鎶ュ憡',
+ label:'杩涘巶鎶ュ憡',
+ children:null
+ },
+ ],
+ }
+ },
+ mounted() {
+ this.entityCopy = this.HaveJson(this.componentData.entity)
+ this.getCertificationDetail()
+ },
+ methods: {
+ refreshTable() {
+ this.tableLoading = true
+ selectItemParameter({...this.page, ...this.itemParameterForm}).then(res => {
+ this.tableLoading = false
+ if (res.code === 200) {
+ this.tableData = res.data.records
+ this.page.total = res.data.total
+ }
+ }).catch(err => {
+ this.tableLoading = false
+ })
+ },
+ getCertificationDetail(){
+ this.$axios.post(this.$api.certification.getCertificationDetail, {
+ page: {
+ current: -1,
+ size: -1,
+ },
+ entity: {
+ name: null,
+ }
+ }, {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ }).then(res => {
+ if (res.code === 201) {
+ return
+ }
+ let arr = res.data.body.records.map(m=>{
+ m.value = m.name;
+ m.label = m.name;
+ return m
+ })
+ this.options[0].children = arr;
+ this.fileComponentData.selectField.type.select = arr;
+ })
+ },
+ refresh() {
+ this.componentData.entity = this.HaveJson(this.entityCopy)
+ this.refreshTable()
+ },
+ pagination (page) {
+ this.page.size = page.pageNum.limit
+ this.refreshTable()
+ },
+ openAdd() {
+ this.$refs.ValueTable.openAddDia(this.$api.laboratoryScope.addParameter);
+ },
+ openUpload(){
+ this.dataForm.type = '';
+ this.dataForm.address = '';
+ this.upFileVisible = true;
+ },
+ fileManagement(row){
+ this.fileVisible = true;
+ this.fileComponentData.entity.labId = row.id;
+ this.$nextTick(function () {
+ this.$refs['ValueTable0'].selectList('page')
+ })
+ },
+ confirmConnect(){
+ if(!this.dataForm.type){
+ this.$message.error('鏈笂閫夋嫨鍗扮珷绫诲瀷');
+ return
+ }
+ if(!this.dataForm.address){
+ this.$message.error('鏈笂浼犲嵃绔�');
+ return
+ }
+ this.loading = true;
+ this.$axios.post(this.$api.sealScope.addSeal, {
+ labId:this.fileComponentData.entity.labId,
+ ...this.dataForm
+ }, {
+ headers: {
+ 'Content-Type': 'application/json'
+ }
+ }).then(res => {
+ this.loading = false;
+ if (res.code === 201) {
+ return
+ }
+ this.$refs['ValueTable0'].selectList('page')
+ this.upFileVisible = false;
+ })
+ },
+ handleSuccess(response,){
+ if (response.code == 200) {
+ this.dataForm.address = response.data.url
+ }
+ },
+ beforeUpload(file,type) {
+ if (file.size > 1024 * 1024 * 10) {
+ this.$message.error('涓婁紶鏂囦欢涓嶈秴杩�10M');
+ this.$refs.upload.clearFiles()
+ return false;
+ } else {
+ return true;
+ }
+ },
+ onError(err, file, fileList,type) {
+ this.$message.error('涓婁紶澶辫触')
+ this.$refs.upload.clearFiles()
+ },
+ }
+}
+</script>
+<style scoped>
+.search {
+ height: 46px;
+ display: flex;
+ justify-content: space-between;
+}
</style>
--
Gitblit v1.9.3