feature(标准跟踪清单): 修改导入
This commit is contained in:
@@ -48,7 +48,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 导入失败-->
|
<!-- 导入失败-->
|
||||||
<el-dialog :visible.sync="importFailed" :close-on-click-modal="false" width="400px">
|
<el-dialog
|
||||||
|
:visible.sync="importFailed"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
width="400px"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
<p slot="title" style="color:#f60">
|
<p slot="title" style="color:#f60">
|
||||||
<span>导入失败</span>
|
<span>导入失败</span>
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
@@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
title="导入"
|
||||||
|
:visible.sync="visible"
|
||||||
|
width="500px"
|
||||||
|
class="dialog"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
class="form"
|
||||||
|
:model="form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="120px"
|
||||||
|
label-position="left"
|
||||||
|
>
|
||||||
|
<el-form-item label="核查清单名称" prop="checkListName">
|
||||||
|
<el-input
|
||||||
|
v-model="form.checkListName"
|
||||||
|
placeholder="请输入核查清单名称"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="导入模板" prop="templateName">
|
||||||
|
<div
|
||||||
|
v-for="(id, index) in form.templateId.split(',')"
|
||||||
|
:key="id"
|
||||||
|
class="fileClass"
|
||||||
|
@click="onPreview(id)"
|
||||||
|
>
|
||||||
|
{{ form.templateName.split(',')[index] }}
|
||||||
|
</div>
|
||||||
|
<el-button size="small" type="primary" @click="addImportModal">上传</el-button>
|
||||||
|
<el-button size="small" type="primary" @click="downTemplate">空白模板下载</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer">
|
||||||
|
<el-button size="small" type="primary" :loading="loading" @click="submit">确定</el-button>
|
||||||
|
<el-button size="small" type="primary" :loading="loading" @click="visible = false">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<Import
|
||||||
|
accept=".xls, .XLS, .xlsx, .XLSX"
|
||||||
|
:visible.sync="importModalShowFlag"
|
||||||
|
:action="url.uploadNew"
|
||||||
|
:limit="1"
|
||||||
|
:ids.sync="form.templateId"
|
||||||
|
:names.sync="form.templateName"
|
||||||
|
/>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Import from '@/components/hzwlComponents/Import'
|
||||||
|
export default {
|
||||||
|
name: 'ImportModel',
|
||||||
|
components: {
|
||||||
|
Import
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
const form = {
|
||||||
|
checkListName: '',
|
||||||
|
templateId: '',
|
||||||
|
templateName: '',
|
||||||
|
}
|
||||||
|
const rules = {
|
||||||
|
checkListName: [
|
||||||
|
{ required: true, message: '核查清单名称不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
templateName: [
|
||||||
|
{ required: true, message: '导入模板不能为空', trigger: 'change' }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
visible: false,
|
||||||
|
loading: false,
|
||||||
|
form,
|
||||||
|
rules,
|
||||||
|
url: {
|
||||||
|
uploadNew: 'api/att/attFile/uploadNew',
|
||||||
|
importExcelUrl: 'api/standardTrackingCheckList/importTrackingChecklist',
|
||||||
|
exportTemplateFile: 'api/standardTrackingCheckList/exportTemplateFile',
|
||||||
|
},
|
||||||
|
importModalShowFlag: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
openModel () {
|
||||||
|
Object.keys(this.form).forEach(key => this.form[key] = '')
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.formRef.clearValidate()
|
||||||
|
})
|
||||||
|
this.visible = true
|
||||||
|
},
|
||||||
|
submit () {
|
||||||
|
this.$refs.formRef.validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
const config = { _this: this, loading: 'loading' }
|
||||||
|
this.$http._postData(this.url.importExcelUrl, this.form, config).then(res => {
|
||||||
|
if (res.ok) {
|
||||||
|
this.$message.success('导入成功')
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('ok')
|
||||||
|
} else {
|
||||||
|
this.$message.warning(res.message)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
addImportModal () {
|
||||||
|
this.importModalShowFlag = true
|
||||||
|
},
|
||||||
|
onPreview (id) {
|
||||||
|
this.$preview(id)
|
||||||
|
},
|
||||||
|
downTemplate () {
|
||||||
|
window.open(`${this.url.exportTemplateFile}?fileName=标准跟踪清单导入模板`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.dialog {
|
||||||
|
/deep/ .el-dialog {
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
/deep/ .el-dialog__header {
|
||||||
|
border-bottom: 1px solid #E9E9E9;
|
||||||
|
}
|
||||||
|
/deep/ .el-form-item{
|
||||||
|
margin-bottom: 10px;
|
||||||
|
color: #666;
|
||||||
|
border-bottom: 1px dashed #E9E9E9;
|
||||||
|
.el-form-item__label {
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
.el-form-item__content{
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
.el-input__inner {
|
||||||
|
border: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.fileClass {
|
||||||
|
color: rgb(64, 158, 255);
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
sortable="custom"
|
sortable="custom"
|
||||||
>
|
>
|
||||||
<template slot-scope="{row, column, $index}">
|
<template slot-scope="{row, column, $index}">
|
||||||
<a class="table-jump" style="color: #2d8cf0" @click="handlePreview(row.id)">{{ row.processNum }}</a>
|
<a class="table-jump" style="color: #2d8cf0" @click="toProcessDetail(row.processNum)">{{ row.processNum }}</a>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
@@ -191,6 +191,7 @@
|
|||||||
<addModel ref="addModel" @ok="onClear" />
|
<addModel ref="addModel" @ok="onClear" />
|
||||||
<!-- 导入 -->
|
<!-- 导入 -->
|
||||||
<ImportZip :visible.sync="importModalShowFlag" :action="url.importExcelUrl" @onSuccess="getData" />
|
<ImportZip :visible.sync="importModalShowFlag" :action="url.importExcelUrl" @onSuccess="getData" />
|
||||||
|
<ImportModel ref="ImportModelRef" @ok="onClear" />
|
||||||
<!-- 导出 -->
|
<!-- 导出 -->
|
||||||
<ExportDialog ref="exportDialogRef" @exportName="handleExport" />
|
<ExportDialog ref="exportDialogRef" @exportName="handleExport" />
|
||||||
<el-dialog title="流程下发" :visible.sync="visible" width="600px" class="processDistributionForm">
|
<el-dialog title="流程下发" :visible.sync="visible" width="600px" class="processDistributionForm">
|
||||||
@@ -222,6 +223,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import addModel from './addModel'
|
import addModel from './addModel'
|
||||||
|
import ImportModel from './ImportModel'
|
||||||
import ImportZip from '@/components/hzwlComponents/importZip'
|
import ImportZip from '@/components/hzwlComponents/importZip'
|
||||||
import ExportDialog from '@/components/hzwlComponents/exportDialog'
|
import ExportDialog from '@/components/hzwlComponents/exportDialog'
|
||||||
import DatePickerFormItem from '@/components/hzwlComponents/DatePickerFormItem'
|
import DatePickerFormItem from '@/components/hzwlComponents/DatePickerFormItem'
|
||||||
@@ -230,6 +232,7 @@ export default {
|
|||||||
name: 'StandardTrackingList',
|
name: 'StandardTrackingList',
|
||||||
components: {
|
components: {
|
||||||
addModel,
|
addModel,
|
||||||
|
ImportModel,
|
||||||
ImportZip,
|
ImportZip,
|
||||||
ExportDialog,
|
ExportDialog,
|
||||||
DatePickerFormItem,
|
DatePickerFormItem,
|
||||||
@@ -345,7 +348,8 @@ export default {
|
|||||||
window.open(`${this.url.exportTemplateFile}?fileName=标准跟踪清单导入模板`)
|
window.open(`${this.url.exportTemplateFile}?fileName=标准跟踪清单导入模板`)
|
||||||
},
|
},
|
||||||
addImportModal () {
|
addImportModal () {
|
||||||
this.importModalShowFlag = true
|
// this.importModalShowFlag = true
|
||||||
|
this.$refs.ImportModelRef.openModel()
|
||||||
},
|
},
|
||||||
// 导出
|
// 导出
|
||||||
exportData () {
|
exportData () {
|
||||||
@@ -418,6 +422,13 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
toProcessDetail (prcNum) {
|
||||||
|
const routeUrl = this.$router.resolve({
|
||||||
|
name: 'ProcessDetail',
|
||||||
|
query: { prcNum }
|
||||||
|
})
|
||||||
|
window.open(routeUrl.href, '_blank')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user