| | |
| | | <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" |
| | | :componentData="fileComponentData" :key="upIndex" style="height: 400px;" /> |
| | | </el-dialog> |
| | | <el-dialog title="更新印章" :visible.sync="upFileVisible" width="400px"> |
| | |
| | | <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" |
| | |
| | | :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> |
| | |
| | | type: 'text', |
| | | method: 'fileManagement' |
| | | }], |
| | | tagField: {}, |
| | | tagField: { |
| | | type:{ |
| | | select:[] |
| | | } |
| | | }, |
| | | selectField: {}, |
| | | requiredAdd: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'], |
| | | requiredUp: ['laboratoryName', 'laboratoryNumber', 'head', 'phoneNumber'] |
| | | }, |
| | | fileComponentData: { |
| | | entity: { |
| | | labId:null, |
| | | orderBy: { |
| | | field: 'id', |
| | | order: 'asc' |
| | |
| | | select: false, |
| | | do: [], |
| | | 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() { |
| | |
| | | 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() { |
| | |
| | | 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() |
| | | }) |
| | | }, |
| | | confirmConnect(){ |
| | | if(!this.dataForm.pic1){ |
| | | this.$message.error('未上传企业印章'); |
| | | if(!this.dataForm.type){ |
| | | this.$message.error('未上选择印章类型'); |
| | | return |
| | | } |
| | | if(!this.dataForm.pic2){ |
| | | this.$message.error('未上传CNAS印章'); |
| | | 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() |
| | | this.upFileVisible = false; |
| | | }) |
| | | }, |
| | | handleSuccess(response,){ |
| | | if (response.code == 200) { |
| | | this.dataForm.pic1 = response.data |
| | | this.dataForm.address = response.data.url |
| | | } |
| | | }, |
| | | beforeUpload(file,type) { |
| | |
| | | let up = false |
| | | let del = false |
| | | let add = false |
| | | let file = false |
| | | for (var i = 0; i < power.length; i++) { |
| | | if (power[i].menuMethod == 'upParameter') { |
| | | up = true |
| | |
| | | if (power[i].menuMethod == 'addParameter') { |
| | | add = true |
| | | } |
| | | if (power[i].menuMethod == 'addSeal') { |
| | | file = true |
| | | } |
| | | } |
| | | if (!file) { |
| | | this.componentData.do.splice(2, 1) |
| | | } |
| | | if (!del) { |
| | | this.componentData.do.splice(1, 1) |