From 47431e32e426d14736415ac0cc9cdcd88f7c07e5 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期一, 22 四月 2024 18:02:20 +0800
Subject: [PATCH] 优化检验任务计算
---
src/components/view/a5-laboratory-management.vue | 190 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 189 insertions(+), 1 deletions(-)
diff --git a/src/components/view/a5-laboratory-management.vue b/src/components/view/a5-laboratory-management.vue
index b37f44b..87acad9 100644
--- a/src/components/view/a5-laboratory-management.vue
+++ b/src/components/view/a5-laboratory-management.vue
@@ -34,6 +34,35 @@
height: calc(100% - 60px - 80px - 10px - 40px);
padding: 20px;
}
+ .el-upload {
+ border: 1px dashed #d9d9d9;
+ border-radius: 6px;
+ cursor: pointer;
+ position: relative;
+ overflow: hidden;
+ }
+ .el-upload:hover {
+ border-color: #409EFF;
+ }
+ .avatar-uploader-icon {
+ border: 1px dashed #d9d9d9;
+ font-size: 28px;
+ color: #8c939d;
+ width: 120px;
+ height: 120px;
+ line-height: 120px;
+ text-align: center;
+ }
+ .avatar {
+ width: 120px;
+ height: 120px;
+ display: block;
+ }
+ .btns{
+ position: absolute;
+ right: 80px;
+ top: 13px;
+ }
</style>
<template>
@@ -67,6 +96,52 @@
:upUrl="$api.laboratoryScope.upParameter" :delUrl="$api.laboratoryScope.delParameter"
:componentData="componentData" :key="upIndex" />
</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.laboratoryScope.selectItemParameter"
+ :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.insProductIds"
+ :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"
+ :limit="1"
+ >
+ <img v-if="dataForm.pic1" :src="dataForm.pic1" >
+ <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>
@@ -75,6 +150,16 @@
export default {
components: {
ValueTable
+ },
+ computed: {
+ headers() {
+ return {
+ 'token': sessionStorage.getItem('token')
+ }
+ },
+ action() {
+ return this.javaApi + this.$api.deviceScope.uploadFile
+ }
},
data() {
return {
@@ -102,26 +187,92 @@
font: '鍒犻櫎',
type: 'text',
method: 'doDiy'
+ }, {
+ id: '',
+ font: '鍗扮珷绠$悊',
+ type: 'text',
+ method: 'fileManagement'
}],
tagField: {},
selectField: {},
requiredAdd: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
requiredUp: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber']
},
+ fileComponentData: {
+ entity: {
+ orderBy: {
+ field: 'id',
+ order: 'asc'
+ }
+ },
+ isPage:false,
+ init:false,
+ isIndex: true,
+ showSelect: false,
+ select: false,
+ do: [],
+ tagField: {},
+ selectField: {},
+ requiredAdd: [],
+ requiredUp: []
+ },
entityCopy: {},
upIndex: 0,
addDia: true,
- addPower: true
+ addPower: true,
+ fileVisible:true,
+ upFileVisible:false,
+ loading:false,
+ dataForm:{},
+ props: { multiple: false,emitPath:false,},
+ options:[
+ {
+ value:0,
+ label:'瀹為獙瀹よ祫璐�',
+ children:[]
+ },
+ {
+ value:1,
+ label:'棰濆绫诲瀷',
+ children:null
+ },
+ ]
}
},
mounted() {
this.entityCopy = this.HaveJson(this.componentData.entity)
this.getPower()
+ this.getCertificationDetail()
},
methods: {
refreshTable() {
this.$refs['ValueTable'].selectList()
},
+ 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.id;
+ m.label = m.name;
+ return m
+ })
+ this.options[0].children = arr;
+ })
+ },
refresh() {
this.componentData.entity = this.HaveJson(this.entityCopy)
this.upIndex++
@@ -129,6 +280,43 @@
openAdd() {
this.$refs.ValueTable.openAddDia(this.$api.laboratoryScope.addParameter);
},
+ openUpload(){
+ this.dataForm = {};
+ this.upFileVisible = true;
+ },
+ fileManagement(row){
+ this.$refs['ValueTable0'].selectList()
+ this.fileVisible = true;
+ },
+ confirmConnect(){
+ if(!this.dataForm.pic1){
+ this.$message.error('鏈笂浼犱紒涓氬嵃绔�');
+ return
+ }
+ if(!this.dataForm.pic2){
+ this.$message.error('鏈笂浼燙NAS鍗扮珷');
+ return
+ }
+ this.loading = true;
+ },
+ handleSuccess(response,){
+ if (response.code == 200) {
+ this.dataForm.pic1 = response.data
+ }
+ },
+ 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()
+ },
// 鏉冮檺鍒嗛厤
getPower(radio) {
let power = JSON.parse(sessionStorage.getItem('power'))
--
Gitblit v1.9.3