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/a7-standard-method.vue | 435 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 272 insertions(+), 163 deletions(-)
diff --git a/src/components/view/a7-standard-method.vue b/src/components/view/a7-standard-method.vue
index 2e33e47..d40bad2 100644
--- a/src/components/view/a7-standard-method.vue
+++ b/src/components/view/a7-standard-method.vue
@@ -1,175 +1,284 @@
<style scoped>
- .title {
- height: 60px;
- line-height: 60px;
- }
+ .title {
+ height: 60px;
+ line-height: 60px;
+ }
- .search {
- background-color: #fff;
- height: 80px;
- display: flex;
- align-items: center;
- }
+ .search {
+ background-color: #fff;
+ height: 80px;
+ display: flex;
+ align-items: center;
+ }
- .search_thing {
- width: 350px;
- display: flex;
- align-items: center;
- }
+ .search_thing {
+ width: 350px;
+ display: flex;
+ align-items: center;
+ }
- .search_label {
- width: 110px;
- font-size: 14px;
- text-align: right;
- }
+ .search_label {
+ width: 110px;
+ font-size: 14px;
+ text-align: right;
+ }
- .search_input {
- width: calc(100% - 110px);
- }
+ .search_input {
+ width: calc(100% - 110px);
+ }
- .table {
- margin-top: 10px;
- background-color: #fff;
- width: calc(100% - 40px);
- height: calc(100% - 60px - 80px - 10px - 40px);
- padding: 20px;
- }
+ .table {
+ margin-top: 10px;
+ background-color: #fff;
+ width: calc(100% - 40px);
+ height: calc(100% - 60px - 80px - 10px - 40px);
+ padding: 20px;
+ }
</style>
<template>
- <div class="standard_method">
- <div>
- <el-row class="title">
- <el-col :span="12" style="padding-left: 20px;">鏍囧噯鏂规硶</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>
- </el-row>
- </div>
- <div class="search">
- <div class="search_thing">
- <div class="search_label">鏍囧噯缂栧彿锛�</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="componentData.entity.code" @keyup.enter.native="refreshTable()"></el-input></div>
- </div>
- <div class="search_thing">
- <div class="search_label">鏍囧噯鍚嶇О锛�</div>
- <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable
- v-model="componentData.entity.name" @keyup.enter.native="refreshTable()"></el-input></div>
- </div>
- <div class="search_thing" style="padding-left: 30px;">
- <el-button size="small" @click="refresh()">閲� 缃�</el-button>
- <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
- </div>
- </div>
- <div class="table">
- <ValueTable ref="ValueTable" :url="$api.standardMethod.selectStandardMethodList"
- :delUrl="$api.standardMethod.delStandardMethod" :upUrl="$api.standardMethod.upStandardMethod" :componentData="componentData" :key="upIndex"/>
- </div>
- </div>
+ <div class="standard_method">
+ <div>
+ <el-row class="title">
+ <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" @click="$refs.ValueTable.openUpload()" v-if="inPower">
+ <i class="el-icon-upload2" style="color: #3A7BFA;"></i>
+ <span style="color: #3A7BFA;">瀵煎叆</span></el-button>
+ <el-button size="medium" type="primary" @click="openAdd" v-if="addPower">鏂板</el-button>
+ </el-col>
+ </el-row>
+ </div>
+ <div class="search">
+ <div class="search_thing">
+ <div class="search_label">鏍囧噯缂栧彿锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.code"
+ @keyup.enter.native="refreshTable()"></el-input></div>
+ </div>
+ <div class="search_thing">
+ <div class="search_label">鏍囧噯鍚嶇О锛�</div>
+ <div class="search_input"><el-input size="small" placeholder="璇疯緭鍏�" clearable v-model="componentData.entity.name"
+ @keyup.enter.native="refreshTable()"></el-input></div>
+ </div>
+ <div class="search_thing" style="padding-left: 30px;">
+ <el-button size="small" @click="refresh()">閲� 缃�</el-button>
+ <el-button size="small" type="primary" @click="refreshTable()">鏌� 璇�</el-button>
+ </div>
+ </div>
+ <div class="table">
+ <ValueTable ref="ValueTable" :url="$api.standardMethod.selectStandardMethodList"
+ :delUrl="$api.standardMethod.delStandardMethod" :upUrl="$api.standardMethod.upStandardMethod"
+ :componentData="componentData" :key="upIndex" :inputUrl="$api.standardMethod.importStandardDetails"/>
+ </div>
+ </div>
</template>
<script>
- import ValueTable from '../tool/value-table.vue'
- export default {
- components: {
- ValueTable
- },
- data() {
- return {
- componentData: {
- entity: {
- code: null,
- name: null,
- orderBy: {
- field: 'id',
- order: 'asc'
- }
- },
- isIndex: true,
- showSelect: false,
- select: true,
- do: [{
- id: 'update',
- font: '缂栬緫',
- type: 'text',
- method: 'doDiy',
- field:['sampleType','createUserName','updateUserName','妫�楠屽璞�=structureTestObjectId']
- },{
- id: 'delete',
- font: '鍒犻櫎',
- type: 'text',
- method: 'doDiy'
- }],
- tagField: {
- structureTestObjectId:{select: []}
- },
- selectField: {
- structureTestObjectId:{select: []}
- },
- requiredAdd:['code','name','structureTestObjectId'],
- requiredUp:['code','name','structureTestObjectId']
- },
- entityCopy: {},
- upIndex: 0,
- addDia: false,
- addPower: true
- }
- },
- mounted() {
- this.entityCopy = this.HaveJson(this.componentData.entity)
- this.getPower()
- this.selectTestObjectByName()
- },
- methods: {
- refreshTable() {
- this.$refs['ValueTable'].selectList()
- },
- refresh() {
- this.componentData.entity = this.HaveJson(this.entityCopy)
- this.upIndex++
- },
- // 鏉冮檺鍒嗛厤
- getPower(){
- let power = JSON.parse(sessionStorage.getItem('power'))
- let up = false
- let del = false
- let add = false
- for (var i = 0; i < power.length; i++) {
- if(power[i].menuMethod=='addStandardMethod'){
- add = true
- }
- if(power[i].menuMethod=='delStandardMethod'){
- del = true
- }
- if(power[i].menuMethod=='upStandardMethod'){
- up = true
- }
- }
- if(!del){
- this.componentData.do.splice(1, 1)
- }
- if(!up){
- this.componentData.do.splice(0, 1)
- }
- this.addPower = add
- },
- openAdd(){
- this.$refs.ValueTable.openAddDia(this.$api.standardMethod.addStandardMethod);
- },
- selectTestObjectByName() {
- this.$axios.get(this.$api.capacityScope.selectTestObjectByName).then(res => {
- let data = []
- res.data.forEach(a => {
- data.push({
- label: a.specimenName,
- value: a.id
- })
- })
- this.componentData.selectField.structureTestObjectId.select = data
- this.componentData.tagField.structureTestObjectId.select = data
- })
- },
- }
- }
-</script>
\ No newline at end of file
+ import ValueTable from '../tool/value-table.vue'
+ export default {
+ components: {
+ ValueTable
+ },
+ data() {
+ return {
+ componentData: {
+ entity: {
+ code: null,
+ name: null,
+ orderBy: {
+ field: 'id',
+ order: 'asc'
+ }
+ },
+ isIndex: true,
+ showSelect: false,
+ select: true,
+ do: [{
+ id: 'update',
+ font: '缂栬緫',
+ type: 'text',
+ method: 'doDiy',
+ field: ['createUserName', 'updateUserName']
+ }, {
+ id: 'delete',
+ font: '鍒犻櫎',
+ type: 'text',
+ method: 'doDiy'
+ }],
+ tagField: {
+ isProduct: {
+ select: [{
+ value: 0,
+ type: 'info',
+ label: '鍚�'
+ }, {
+ value: 1,
+ label: '鏄�'
+ }]
+ },
+ isUse: {
+ select: [{
+ value: 0,
+ type: 'info',
+ label: '鍚�'
+ }, {
+ value: 1,
+ label: '鏄�'
+ }]
+ },
+ qualificationId: {
+ select: []
+ }
+ },
+ selectField: {
+ isProduct: {
+ select: [{
+ value: 0,
+ type: 'info',
+ label: '鍚�'
+ }, {
+ value: 1,
+ label: '鏄�'
+ }]
+ },
+ isUse: {
+ select: [{
+ value: 0,
+ type: 'info',
+ label: '鍚�'
+ }, {
+ value: 1,
+ label: '鏄�'
+ }]
+ },
+ qualificationId: {
+ select: []
+ }
+ },
+ cascaderField: {
+ structureTestObjectId: {
+ tree: []
+ },
+ // 瀛楁閰嶇疆
+ props: {
+ value: 'value',
+ label: 'label',
+ checkStrictly: true,
+ multiple: true
+ },
+ },
+ requiredAdd: ['code', 'name', 'isProduct', 'isUse', 'nameEn'],
+ requiredUp: ['code', 'name', 'isProduct', 'isUse', 'nameEn'],
+ accept:聽'.xlsx',
+ needSort: ['createTime', 'updateTime', 'field'],
+ inputType:聽'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+ },
+ entityCopy: {},
+ upIndex: 0,
+ addDia: false,
+ addPower: true,
+ inPower: true,
+ }
+ },
+ mounted() {
+ this.entityCopy = this.HaveJson(this.componentData.entity)
+ this.getPower()
+ this.getQualificationList()
+ this.selectTestObjectByName()
+ },
+ methods: {
+ refreshTable() {
+ this.$refs['ValueTable'].selectList()
+ this.selectTestObjectByName()
+ },
+ refresh() {
+ this.selectTestObjectByName()
+ this.componentData.entity = this.HaveJson(this.entityCopy)
+ this.upIndex++
+ },
+ // 鏉冮檺鍒嗛厤
+ getPower() {
+ let power = JSON.parse(sessionStorage.getItem('power'))
+ let up = false
+ let del = false
+ let add = false
+ let inPower = false
+ for (var i = 0; i < power.length; i++) {
+ if (power[i].menuMethod == 'addStandardMethod') {
+ add = true
+ }
+ if (power[i].menuMethod == 'delStandardMethod') {
+ del = true
+ }
+ if (power[i].menuMethod == 'upStandardMethod') {
+ up = true
+ }
+ if (power[i].menuMethod == 'importStandardDetails') {
+ inPower = true
+ }
+ }
+ if (!del) {
+ this.componentData.do.splice(1, 1)
+ }
+ if (!up) {
+ this.componentData.do.splice(0, 1)
+ }
+ this.addPower = add
+ this.inPower = inPower
+ },
+ openAdd() {
+ this.$refs.ValueTable.openAddDia(this.$api.standardMethod.addStandardMethod);
+ },
+ getQualificationList() {
+ this.$axios.post(this.$api.enums.selectEnumByCategory, {
+ category: "璧勮川鍚嶇О"
+ }).then(res => {
+ let list = res.data
+ this.componentData.selectField.qualificationId.select = list
+ this.componentData.tagField.qualificationId.select = list
+ })
+ // 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==200){
+ // let list = res.data.body.records.map(item => {
+ // item.label = item.name
+ // item.value = item.id
+ // return item
+ // });
+ // this.componentData.selectField.qualificationId.select = list
+ // this.componentData.tagField.qualificationId.select = list
+ // }
+ // })
+ },
+ selectTestObjectByName() {
+ this.$axios.get(this.$api.standardTree.getStandardTree2).then(res => {
+ res.data.forEach(a => {
+ this.cascaderFieldData(a)
+ })
+ this.componentData.cascaderField.structureTestObjectId.tree = res.data
+ })
+ },
+ cascaderFieldData(val) {
+ if (val.children === undefined) {
+ return
+ } else if (val.children.length == 0) {
+ delete val.children
+ } else {
+ val.children.forEach(a => {
+ this.cascaderFieldData(a)
+ })
+ }
+ },
+ }
+ }
+</script>
--
Gitblit v1.9.3