From 4153ad698ed765a572c70e4315aefa6a4aead35c Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期一, 17 二月 2025 17:33:56 +0800
Subject: [PATCH] 1.场所或设施联调
---
src/components/Table/lims-table.vue | 5
src/views/system/customer/index.vue | 14 +
src/views/structural/premises/index.vue | 314 ++++++++++++++++++++++++++++++--------------
src/api/structural/laboratoryScope.js | 48 ++++++
src/views/structural/capabilityAndLaboratory/laboratory/index.vue | 4
src/views/structural/capabilityAndLaboratory/capability/index.vue | 7
6 files changed, 284 insertions(+), 108 deletions(-)
diff --git a/src/api/structural/laboratoryScope.js b/src/api/structural/laboratoryScope.js
index bd8680b..30cb640 100644
--- a/src/api/structural/laboratoryScope.js
+++ b/src/api/structural/laboratoryScope.js
@@ -15,3 +15,51 @@
params: query
})
}
+// 娣诲姞瀹為獙瀹ゅ弬鏁�
+export function addParameter(query) {
+ return request({
+ url: '/laboratoryScope/addParameter',
+ method: 'post',
+ data: query
+ })
+}
+// 淇敼瀹為獙瀹ゅ弬鏁�
+export function upParameter(query) {
+ return request({
+ url: '/laboratoryScope/upParameter',
+ method: 'post',
+ data: query
+ })
+}
+// 鍒犻櫎瀹為獙瀹ゅ弬鏁�
+export function delParameter(query) {
+ return request({
+ url: '/laboratoryScope/delParameter',
+ method: 'delete',
+ params: query
+ })
+}
+// 鏌ヨ鍗扮珷鍒楄〃
+export function selectSeal(query) {
+ return request({
+ url: '/sealScope/selectSeal',
+ method: 'get',
+ params: query
+ })
+}
+// 鏌ヨ鍗扮珷鍒楄〃
+export function addSeal(query) {
+ return request({
+ url: '/sealScope/addSeal',
+ method: 'post',
+ data: query
+ })
+}
+// 鏌ヨ璧勮川鏄庣粏鍒楄〃
+export function getCertificationDetail(query) {
+ return request({
+ url: '/certification/getCertificationDetail',
+ method: 'get',
+ params: query
+ })
+}
diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 3150e97..b09c885 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -77,6 +77,11 @@
<div v-else-if="item.dataType == 'progress'">
<el-progress :percentage="Number(scope.row[item.prop])" />
</div>
+ <!-- 鍥剧墖 -->
+ <div v-else-if="item.dataType == 'image'">
+ <img :src="javaApi+'/img/'+item.prop"
+ alt="" style="width: 40px;height: 40px;margin-top: 10px;">
+ </div>
<!-- tag -->
<div v-else-if="item.dataType == 'tag'">
diff --git a/src/views/structural/capabilityAndLaboratory/capability/index.vue b/src/views/structural/capabilityAndLaboratory/capability/index.vue
index 033f101..3b7e31d 100644
--- a/src/views/structural/capabilityAndLaboratory/capability/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/capability/index.vue
@@ -46,13 +46,13 @@
<!-- 妫�楠岄」鐩弬鏁拌〃鏍�-->
<div class="table" v-if="radio===0">
<lims-table :tableData="tableData" :column="column"
- @pagination="pagination"
+ @pagination="pagination" :height="'calc(100vh - 290px)'"
:page="page" :tableLoading="tableLoading"></lims-table>
</div>
<!-- 妫�楠屽璞¤〃鏍�-->
<div class="table" v-if="radio===1">
<lims-table :tableData="testObjectTableData" :column="testObjectColumn"
- @pagination="pagination"
+ @pagination="pagination" :height="'calc(100vh - 290px)'"
:page="testObjectPage" :tableLoading="tableLoading"></lims-table>
</div>
</div>
@@ -462,10 +462,11 @@
},
refresh() {
this.resetForm('itemParameterForm')
+ this.page.current = 1
this.refreshTable()
},
pagination (page) {
- this.page.size = page.pageNum.limit
+ this.page.size = page.limit
this.refreshTable()
},
// 妫�楠岄」鐩弬鏁版柊澧�
diff --git a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
index 8d66a13..c0bf840 100644
--- a/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
+++ b/src/views/structural/capabilityAndLaboratory/laboratory/index.vue
@@ -32,7 +32,7 @@
<div v-if="radio===0">
<lims-table :tableData="tableData" :column="column"
:isSelection="true" :handleSelectionChange="handleSelectionChange"
- @pagination="pagination"
+ @pagination="pagination" :height="'calc(100vh - 300px)'"
:page="page" :tableLoading="tableLoading"></lims-table>
</div>
<div class="table" v-if="radio===1" v-loading="pageLoading" @scroll="scrollFn">
@@ -288,7 +288,7 @@
this.selection = selection;
},
pagination (page) {
- this.page.size = page.pageNum.limit
+ this.page.size = page.limit
this.refreshTable()
},
// 璧勮川鏄庣粏鎵归噺鍒犻櫎
diff --git a/src/views/structural/premises/index.vue b/src/views/structural/premises/index.vue
index 9b45c72..0204f36 100644
--- a/src/views/structural/premises/index.vue
+++ b/src/views/structural/premises/index.vue
@@ -18,25 +18,55 @@
</el-form>
</div>
<div>
- <el-button size="small" type="primary" @click="openAdd" icon="el-icon-plus">鏂板</el-button>
+ <el-button size="small" type="primary" @click="openAdd('add')" icon="el-icon-plus">鏂板</el-button>
</div>
</div>
<div class="table">
<lims-table :tableData="tableData" :column="column"
+ :height="'calc(100vh - 250px)'"
@pagination="pagination"
:page="page" :tableLoading="tableLoading"></lims-table>
</div>
+<!-- 鏂板瀹為獙瀹�-->
+ <el-dialog :title="formTitle" :visible.sync="addDia" width="450px">
+ <el-form ref="laboratoryForm" :model="laboratoryForm" :rules="userRules"
+ label-position="right" label-width="100px">
+ <el-form-item label="瀹為獙瀹ゅ悕绉�" prop="laboratoryName">
+ <el-input v-model="laboratoryForm.laboratoryName" size="small" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="鍦烘墍缂栫爜" prop="laboratoryNumber">
+ <el-input v-model="laboratoryForm.laboratoryNumber" size="small" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="瀹為獙瀹や唬鍙�" prop="laboratoryCode">
+ <el-input v-model="laboratoryForm.laboratoryCode" size="small" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="璐熻矗浜�" prop="head">
+ <el-input v-model="laboratoryForm.head" size="small" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="璐熻矗浜虹數璇�" prop="phoneNumber">
+ <el-input v-model="laboratoryForm.phoneNumber" size="small" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="鍦板潃" prop="address">
+ <el-input v-model="laboratoryForm.address" size="small" clearable></el-input>
+ </el-form-item>
+ </el-form>
+ <span slot="footer" class="dialog-footer">
+ <el-button @click="reset">鍙� 娑�</el-button>
+ <el-button type="primary" @click="customAdd" :loading="loading">纭� 瀹�</el-button>
+ </span>
+ </el-dialog>
<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;" />-->
+ <lims-table :tableData="fileComponentData" :column="fileComponentDataColumn"
+ @pagination="fileComponentPagination" height="500px"
+ :page="fileComponentPage" :tableLoading="fileComponentTableLoading"></lims-table>
</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-form ref="dataForm" :model="dataForm" :rules="dataFormRules"
+ label-position="right" label-width="80px">
+ <el-form-item label="鍗扮珷绫诲瀷" prop="type">
<el-cascader
v-model="dataForm.type"
:options="options"
@@ -46,12 +76,10 @@
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-form-item>
+ <el-form-item label="鍗扮珷鍥剧墖" prop="address">
<el-upload
+ class="avatar-uploader"
:action="action"
:headers="headers"
accept='image/jpg,image/jpeg,image/png'
@@ -59,13 +87,12 @@
: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;" >
+ :on-error="onError">
+ <img v-if="dataForm.address" :src="javaApi+'/img/'+dataForm.address" class="avatar" >
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
- </div>
- </div>
+ </el-form-item>
+ </el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="upFileVisible = false">鍙� 娑�</el-button>
<el-button type="primary" @click="confirmConnect" :loading="loading">纭� 瀹�</el-button>
@@ -76,7 +103,15 @@
<script>
import limsTable from "@/components/Table/lims-table.vue";
-import {selectItemParameter} from "@/api/structural/laboratoryScope";
+import {
+ addParameter,
+ addSeal,
+ delParameter,
+ selectItemParameter,
+ selectSeal,
+ upParameter
+} from "@/api/structural/laboratoryScope";
+import {getCertificationDetail} from "@/api/structural/laboratory";
export default {
components: {
@@ -120,7 +155,7 @@
name: '缂栬緫',
type: 'text',
clickFun: (row) => {
- this.editForm(row);
+ this.openAdd('edit', row);
},
},
{
@@ -145,29 +180,31 @@
size:10,
current:1
},
- 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'],
+ addDia: false,
+ formTitle: '',
+ laboratoryForm: {
+
+ },
+ operationType: '',
+ userRules: {
+ laboratoryName: [{ required: true, message: '璇疯緭鍏ュ疄楠屽鍚嶇О', trigger: 'blur' }],
+ laboratoryNumber: [{ required: true, message: '璇疯緭鍏ュ満鎵�缂栫爜', trigger: 'blur' }],
+ head: [{ required: true, message: '璇疯緭鍏ヨ礋璐d汉', trigger: 'blur' }],
+ phoneNumber: [{ required: true, message: '璇疯緭鍏ヨ礋璐d汉鐢佃瘽', trigger: 'blur' }],
+ },
+ currentRow: {},
+ fileComponentTableLoading: false,
+ fileComponentData: [],
+ fileComponentDataColumn: [
+ {label: '瀹為獙瀹ゅ悕绉�', prop: 'laboratoryName'},
+ {label: '鍗扮珷鍥剧墖', prop: 'address', dataType: 'image'},
+ {label: '鍗扮珷绫诲瀷', prop: 'type'},
+ ],
+ fileComponentPage: {
+ total:0,
+ size:10,
+ current:1,
+ layout: 'total, prev, pager, next'
},
fileVisible:false,
upFileVisible:false,
@@ -175,6 +212,10 @@
dataForm:{
type:'',
address:'',
+ },
+ dataFormRules: {
+ type: [{ required: true, message: '璇烽�夋嫨鍗扮珷绫诲瀷', trigger: 'change' }],
+ address: [{ required: false, message: '璇蜂笂浼犲浘鐗�', trigger: 'change' }],
},
props: { multiple: false,emitPath:false,},
options:[
@@ -212,83 +253,130 @@
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.resetForm('queryForm')
this.refreshTable()
},
+ // 鍒嗛〉鍒囨崲
pagination (page) {
- this.page.size = page.pageNum.limit
+ this.page.size = page.limit
this.refreshTable()
},
- openAdd() {
- this.$refs.ValueTable.openAddDia(this.$api.laboratoryScope.addParameter);
+ openAdd(type, row) {
+ this.formTitle = type === 'add' ? '鏂板瀹為獙瀹�' : '缂栬緫瀹為獙瀹�'
+ this.operationType = type
+ if (type === 'edit') {
+ this.laboratoryForm = this.HaveJson(row)
+ }
+ this.addDia = true
},
+ // 鎻愪氦鏂板銆佺紪杈戝疄楠屽琛ㄥ崟
+ customAdd() {
+ this.$refs['laboratoryForm'].validate((valid) => {
+ if (valid) {
+ this.loading = true
+ if (this.operationType === 'add') {
+ addParameter(this.laboratoryForm).then(res => {
+ this.loading = false
+ if (res.code !== 200) return
+ this.$message.success('鏂板鎴愬姛')
+ this.refreshTable()
+ this.reset()
+ }).catch(err => {
+ this.loading = false
+ })
+ } else {
+ upParameter(this.laboratoryForm).then(res => {
+ this.loading = false
+ if (res.code !== 200) return
+ this.$message.success('淇敼鎴愬姛')
+ this.refreshTable()
+ this.reset()
+ }).catch(err => {
+ this.loading = false
+ })
+ }
+ }
+ })
+ },
+ reset () {
+ this.resetForm('laboratoryForm')
+ this.addDia = false
+ },
+ // 鍒犻櫎瀹為獙瀹�
+ delete (row) {
+ this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
+ confirmButtonText: "纭畾",
+ cancelButtonText: "鍙栨秷",
+ type: "warning"
+ }).then(() => {
+ delParameter({id: row.id}).then(res => {
+ this.$message.success('鍒犻櫎鎴愬姛')
+ this.refreshTable()
+ }).catch(e => {
+ this.$message.error('鍒犻櫎澶辫触')
+ })
+ }).catch(() => {})
+ },
+ // 鎵撳紑鍗扮珷绠$悊寮规
+ fileManagement(row){
+ this.fileVisible = true;
+ this.fileComponentTableLoading = true
+ this.currentRow = row
+ this.getFileComponentList()
+ },
+ getFileComponentList () {
+ selectSeal({id: this.currentRow.id, ...this.fileComponentPage}).then(res => {
+ this.fileComponentTableLoading = false
+ if (res.code === 200) {
+ this.fileComponentData = res.data.records
+ this.fileComponentPage.total = res.data.total
+ }
+ }).catch(err => {
+ this.fileComponentTableLoading = false
+ })
+ },
+ fileComponentPagination (page) {
+ this.fileComponentPage.size = page.limit
+ this.getFileComponentList()
+ },
+ // 鎵撳紑鏇存柊鍗扮珷寮规
openUpload(){
this.dataForm.type = '';
this.dataForm.address = '';
this.upFileVisible = true;
+ this.getCertificationOperation()
},
- fileManagement(row){
- this.fileVisible = true;
- this.fileComponentData.entity.labId = row.id;
- this.$nextTick(function () {
- this.$refs['ValueTable0'].selectList('page')
+ // 鏌ヨ鍗扮珷绫诲瀷
+ getCertificationOperation(){
+ const params = {
+ current: -1,
+ size: -1,
+ }
+ getCertificationDetail(params).then(res => {
+ this.options[0].children = res.data.records.map(m => {
+ m.value = m.name;
+ m.label = m.name;
+ return m
+ });
})
},
+ // 鎻愪氦鏇存柊鍗扮珷
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'
+ this.$refs['dataForm'].validate((valid) => {
+ if (valid) {
+ this.loading = true;
+ addSeal({labId:this.currentRow.id, ...this.dataForm}).then(res => {
+ this.loading = false;
+ this.getFileComponentList()
+ this.upFileVisible = false;
+ })
}
- }).then(res => {
- this.loading = false;
- if (res.code === 201) {
- return
- }
- this.$refs['ValueTable0'].selectList('page')
- this.upFileVisible = false;
})
},
handleSuccess(response,){
- if (response.code == 200) {
+ if (response.code === 200) {
this.dataForm.address = response.data.url
}
},
@@ -314,4 +402,34 @@
display: flex;
justify-content: space-between;
}
+.btns{
+ text-align: right;
+ margin-bottom: 10px;
+}
+::v-deep .el-dialog__body {
+ padding-top: 8px !important;
+}
+.avatar-uploader ::v-deep .el-upload {
+ border: 1px dashed #666666;
+ border-radius: 6px;
+ cursor: pointer;
+ position: relative;
+ overflow: hidden;
+}
+.avatar-uploader ::v-deep .el-upload:hover {
+ border-color: #409EFF;
+}
+.avatar-uploader-icon {
+ font-size: 20px;
+ color: #8c939d;
+ width: 90px;
+ height: 90px;
+ line-height: 90px;
+ text-align: center;
+}
+.avatar {
+ width: 90px;
+ height: 90px;
+ display: block;
+}
</style>
diff --git a/src/views/system/customer/index.vue b/src/views/system/customer/index.vue
index 6e24596..e88b72b 100644
--- a/src/views/system/customer/index.vue
+++ b/src/views/system/customer/index.vue
@@ -18,7 +18,10 @@
</div>
</div>
<div>
- <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading" @pagination="pagination"></lims-table>
+ <lims-table :tableData="tableData" :column="column"
+ :height="'calc(100vh - 250px)'"
+ :page="page" :tableLoading="tableLoading"
+ @pagination="pagination"></lims-table>
</div>
<el-dialog :title="formTitle" :visible.sync="addDia" width="450px">
<el-form ref="userForm" :model="user" :rules="userRules" label-position="right" label-width="100px">
@@ -118,7 +121,7 @@
company: [{ required: true, message: '璇疯緭鍏ュ鎴峰悕绉�', trigger: 'blur' }],
companyEn: [{ required: true, message: '璇疯緭鍏ュ鎴峰悕绉癊N', trigger: 'blur' }],
address: [{ required: true, message: '璇疯緭鍏ュ崟浣嶅湴鍧�', trigger: 'blur' }],
- addressEn: [{ required: true, message: '璇疯緭鍗曚綅鍦板潃EN', trigger: 'blur' }],
+ addressEn: [{ required: true, message: '璇疯緭鍏ュ崟浣嶅湴鍧�EN', trigger: 'blur' }],
num: [{ required: true, message: '璇疯緭鍏ュ姞鎬ラ搴�', trigger: 'blur' }],
code2: [{ required: true, message: '璇疯緭鍏ュ鎴风紪鍙�', trigger: 'blur' }],
},
@@ -148,8 +151,9 @@
this.queryParams.company = ''
this.getList()
},
- pagination () {
-
+ pagination (page) {
+ this.page.size = page.limit
+ this.getList()
},
openFormDia (type, row) {
this.addDia = true
@@ -190,8 +194,8 @@
},
reset () {
this.user = {}
- this.addDia = false
this.resetForm("userForm");
+ this.addDia = false
},
delete (row) {
this.$confirm('鏄惁鍒犻櫎褰撳墠鏁版嵁?', "璀﹀憡", {
--
Gitblit v1.9.3