Browse Source

工具文件导入

master
zuowenwen 4 years ago
parent
commit
fae4543ea2
  1. 62
      src/views/modules/common/excelUpload.vue
  2. 35
      src/views/modules/toolMan/repairReturnInspection.vue
  3. 7
      src/views/modules/toolMan/tool-info.vue

62
src/views/modules/common/excelUpload.vue

@ -0,0 +1,62 @@
<template>
<div>
<!-- 弹窗, 上传文件 -->
<el-upload
:action="url"
:before-upload="beforeUploadHandle"
:on-success="successHandle"
multiple
:show-file-list="false"
style="text-align: center;">
<el-button size="small" type="primary">点击上传</el-button>
</el-upload>
</div>
</template>
<script>
export default {
data () {
return {
url: '',
num: 0,
successNum: 0,
fileList: [],
rollList: {}
}
},
methods: {
init (id) {
this.url = this.$http.adornUrl(`/file/excel/upload?token=${this.$cookie.get('token')}`)
this.visible = true
},
//
beforeUploadHandle (file) {
if (file.type !== "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" && file.type !== "application/vnd.ms-excel" ) {
this.$message.error('只支持xls、xlsx、格式的文件!')
return false
}
this.num++
},
//
successHandle (response, file, fileList) {
if (response && response.code === 0) {
this.rollList = response
// this.childClick()
this.$message.success(response.msg)
} else {
this.$message.error(response.msg)
}
},
childClick () {
this.$emit('excelUploadChild', this.rollList)
}
},
created() {
this.init()
}
}
</script>
<style scoped>
</style>

35
src/views/modules/toolMan/repairReturnInspection.vue

@ -80,6 +80,17 @@
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" v-drag :title="inputLabel.modelInput.label1" :visible.sync="setUp.modelFlag" width="350px">
<el-form label-position="top">
<!-- <el-form-item :label="inputLabel.modelInput.label3">-->
<!-- <el-select v-model="defectCode" placeholder="请选择" style="width: 300px;">-->
<!-- <el-option-->
<!-- v-for="item in selectList.select1"-->
<!-- :key="item.value"-->
<!-- :label="item.label"-->
<!-- :value="item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item :label="inputLabel.modelInput.label2">
<el-input type="textarea" :rows="3" placeholder="请输入内容" style="width: 300px;padding: 0px 3px;" v-model="remark"></el-input>
</el-form-item>
@ -142,17 +153,29 @@ import {
modelInput : {
label1 : '审核信息',
label2 : '不合格原因',
label3 : '责任类型',
},
},
setUp :{
modelFlag : false,
saveModelFlag : false,
},
selectList: {
select1: [{
value: '内部责任',
label: '内部责任'
}, {
value: '供应商责任',
label: '供应商责任'
}],
},
currentData : {},
remark : '',
flag : '',
site : this.$store.state.user.site,
userName : this.$store.state.user.name,
//
defectCode : '',
// table
height:450,
//
@ -552,6 +575,16 @@ import {
});
return false
}
// if(this.defectCode.trim() == ''){
// this.$alert('', '', {
// confirmButtonText: '',
// type :"warning",
// callback: action => {
// this.saveModelFlag = false
// }
// });
// return false
// }
this.saveModelFlag = false
this.setUp.modelFlag = false
this.saveToolInspection(this.currentData ,this.flag)
@ -590,6 +623,7 @@ import {
this.currentData = row
this.flag = passFlag
this.remark = ''
this.defectCode = ''
if(passFlag == 'G'){
this.setUp.modelFlag = true
}else {
@ -625,6 +659,7 @@ import {
checkBy : this.userName,
newApplyType : newApplyType,
remark : this.remark,
defectCode : this.defectCode,
}
saveList.push(saveData)
updateSoToolInspectionApplyList(saveList).then(({data}) => {

7
src/views/modules/toolMan/tool-info.vue

@ -57,6 +57,9 @@
<el-form-item :label="inputLabel.headerInput.label13">
<el-input style="width: 205px;" readonly v-model="headerData.remark"></el-input>
</el-form-item>
<el-form-item >
<upload style="margin-top: 27px;"></upload>
</el-form-item>
</el-form>
</el-main>
@ -376,10 +379,12 @@
flagAdd,
updateSoToolInspectionApplyList,
} from '@/api/toolMan/tool-info.js'
import upload from "../common/excelUpload";
export default {
components: {
column
column,
upload
},
data() {
return {

Loading…
Cancel
Save