From 7319ab1ce998a7d13f0192a4ccaf92d4a02929f8 Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期三, 11 十二月 2024 14:33:43 +0800
Subject: [PATCH] 电路试验上传文件报错
---
src/components/view/a5-laboratory-management.vue | 100 ++++++++++++++++++++++++++++++++++++++------------
1 files changed, 76 insertions(+), 24 deletions(-)
diff --git a/src/components/view/a5-laboratory-management.vue b/src/components/view/a5-laboratory-management.vue
index 87acad9..f2e5101 100644
--- a/src/components/view/a5-laboratory-management.vue
+++ b/src/components/view/a5-laboratory-management.vue
@@ -69,7 +69,7 @@
<div class="role_manage">
<div>
<el-row class="title">
- <el-col :span="12" style="padding-left: 20px;">鍦烘墍鎴栬鏂斤細</el-col>
+ <el-col :span="12" style="padding-left: 20px;text-align: left;">鍦烘墍鎴栬鏂斤細</el-col>
<el-col :span="12" style="text-align: right;">
<el-button size="medium" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button>
</el-col>
@@ -100,7 +100,7 @@
<div class="btns">
<el-button size="medium" type="primary" @click="openUpload">鏇存柊鍗扮珷</el-button>
</div>
- <ValueTable ref="ValueTable0" :url="$api.laboratoryScope.selectItemParameter"
+ <ValueTable ref="ValueTable0" :url="$api.sealScope.selectSeal" :delUrl="$api.sealScope.delectSeal"
:componentData="fileComponentData" :key="upIndex" style="height: 400px;" />
</el-dialog>
<el-dialog title="鏇存柊鍗扮珷" :visible.sync="upFileVisible" width="400px">
@@ -108,7 +108,7 @@
<div class="search_label" style="width:90px">鍗扮珷绫诲瀷锛�</div>
<div class="search_input">
<el-cascader
- v-model="dataForm.insProductIds"
+ v-model="dataForm.type"
:options="options"
:show-all-levels="false"
:props="props"
@@ -130,9 +130,8 @@
:on-change="beforeUpload"
ref="upload"
:on-error="onError"
- :limit="1"
>
- <img v-if="dataForm.pic1" :src="dataForm.pic1" >
+ <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>
@@ -193,13 +192,19 @@
type: 'text',
method: 'fileManagement'
}],
- tagField: {},
+ tagField: {
+ type:{
+ select:[]
+ }
+ },
selectField: {},
requiredAdd: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
- requiredUp: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber']
+ requiredUp: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'],
+ needSort: ['laboratoryName', 'createTime'],
},
fileComponentData: {
entity: {
+ labId:null,
orderBy: {
field: 'id',
order: 'asc'
@@ -210,33 +215,46 @@
isIndex: true,
showSelect: false,
select: false,
- do: [],
+ do: [{
+ id: 'delete',
+ font: '鍒犻櫎',
+ type: 'text',
+ method: 'doDiy',
+ }],
tagField: {},
- selectField: {},
+ selectField: {
+ type:{
+ select:[]
+ }
+ },
requiredAdd: [],
- requiredUp: []
+ requiredUp: [],
+ addUpload:['address'],
},
entityCopy: {},
upIndex: 0,
addDia: true,
addPower: true,
- fileVisible:true,
+ fileVisible:false,
upFileVisible:false,
loading:false,
- dataForm:{},
+ dataForm:{
+ type:'',
+ address:'',
+ },
props: { multiple: false,emitPath:false,},
options:[
{
- value:0,
+ value:'瀹為獙瀹よ祫璐�',
label:'瀹為獙瀹よ祫璐�',
children:[]
},
{
- value:1,
- label:'棰濆绫诲瀷',
+ value:'鎶ュ憡绫诲瀷',
+ label:'鎶ュ憡绫诲瀷',
children:null
},
- ]
+ ],
}
},
mounted() {
@@ -266,11 +284,12 @@
return
}
let arr = res.data.body.records.map(m=>{
- m.value = m.id;
+ m.value = m.name;
m.label = m.name;
return m
})
this.options[0].children = arr;
+ this.fileComponentData.selectField.type.select = arr;
})
},
refresh() {
@@ -281,27 +300,46 @@
this.$refs.ValueTable.openAddDia(this.$api.laboratoryScope.addParameter);
},
openUpload(){
- this.dataForm = {};
+ this.dataForm.type = '';
+ this.dataForm.address = '';
this.upFileVisible = true;
},
fileManagement(row){
- this.$refs['ValueTable0'].selectList()
this.fileVisible = true;
+ this.fileComponentData.entity.labId = row.id;
+ this.$nextTick(function () {
+ this.$refs['ValueTable0'].selectList('page')
+ })
},
confirmConnect(){
- if(!this.dataForm.pic1){
- this.$message.error('鏈笂浼犱紒涓氬嵃绔�');
+ if(!this.dataForm.type){
+ this.$message.error('鏈笂閫夋嫨鍗扮珷绫诲瀷');
return
}
- if(!this.dataForm.pic2){
- this.$message.error('鏈笂浼燙NAS鍗扮珷');
+ 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.pic1 = response.data
+ this.dataForm.address = response.data.url
}
},
beforeUpload(file,type) {
@@ -323,6 +361,8 @@
let up = false
let del = false
let add = false
+ let file = false
+ let delectSeal = false
for (var i = 0; i < power.length; i++) {
if (power[i].menuMethod == 'upParameter') {
up = true
@@ -333,6 +373,15 @@
if (power[i].menuMethod == 'addParameter') {
add = true
}
+ if (power[i].menuMethod == 'addSeal') {
+ file = true
+ }
+ if (power[i].menuMethod == 'delectSeal') {
+ delectSeal = true
+ }
+ }
+ if (!file) {
+ this.componentData.do.splice(2, 1)
}
if (!del) {
this.componentData.do.splice(1, 1)
@@ -340,6 +389,9 @@
if (!up) {
this.componentData.do.splice(0, 1)
}
+ if (!delectSeal) {
+ this.fileComponentData.do.splice(0, 1)
+ }
this.addPower = add
}
}
--
Gitblit v1.9.3