| | |
| | | <template> |
| | | <zt-dialog ref="dialog" @confirm="formSubmit" :hasConfirm="true"> |
| | | <zt-dialog ref="dialog" append-to-body @confirm="formSubmit" :hasConfirm="true"> |
| | | <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px"> |
| | | <zt-form-item label="总体节点" prop="shipName"> |
| | | <el-input v-model="dataForm.shipName" :readonly="true"></el-input> |
| | |
| | | <div style="display:inline-block;font-size: 14px;" class="el-upload__tip"> 只能上传.xlsx或.xls的文件,且不超过2G</div> |
| | | <el-button slot="trigger" size="small" type="primary" style="font-size: 15px">选取文件</el-button> |
| | | <el-button type="primary" size="small" style="margin-left:20px;font-size: 15px" @click="submitUpload()">提 交</el-button> |
| | | <el-button type="primary" size="small" style="margin-left:20px;font-size: 15px" @click="exportData()">下载数据模板</el-button> |
| | | </el-upload> |
| | | </zt-form-item> |
| | | <el-progress :text-inside="true" :stroke-width="30" :percentage="progress.speed"></el-progress> |
| | |
| | | import Cookies from "js-cookie"; |
| | | |
| | | export default { |
| | | name:'assess-AddOrUpdate', |
| | | data() { |
| | | return { |
| | | dataForm: { |
| | | id:'', |
| | | name:'', |
| | | productId:'' |
| | | }, |
| | |
| | | }, |
| | | methods: { |
| | | async init(id, param) { |
| | | let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`) |
| | | this.dataForm.itemId = result.data |
| | | if(id){ |
| | | this.dataForm.itemId=id |
| | | this.dataForm.id=id |
| | | this.dataForm.name=param.name |
| | | }else{ |
| | | let result = await this.$http.get(`/basicInfo/TyProductModel/getUuid`) |
| | | this.dataForm.itemId = result.data |
| | | } |
| | | this.dataForm.productId = param.productId |
| | | this.dataForm.shipName = param.shipName |
| | | this.fileList = [] |
| | | this.resultData = [] |
| | | this.progress.id = guid() |
| | | let params = qs.stringify({ |
| | |
| | | name:this.dataForm.name, |
| | | productId:this.dataForm.productId |
| | | } |
| | | let res = await this.$http.post('/taskReliability/ReliabilityAssess/add', param) |
| | | let res |
| | | if (this.dataForm.id){ |
| | | res = await this.$http.post('/taskReliability/ReliabilityAssess/update', param) |
| | | }else{ |
| | | res = await this.$http.post('/taskReliability/ReliabilityAssess/add', param) |
| | | } |
| | | if (res.success) { |
| | | await this.$tip.success() |
| | | this.$refs.dialog.close() |
| | | this.$emit('refreshDataList') |
| | | } |
| | | }, |
| | | exportData() { |
| | | window.location.href = './评定数据导入模板.xlsx' |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |