|
|
@ -1264,11 +1264,17 @@ export default { |
|
|
this.$message.error("请先上传文件!") |
|
|
this.$message.error("请先上传文件!") |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
this.isLoading = true |
|
|
|
|
|
|
|
|
// 提示将删除之前的数据 |
|
|
|
|
|
this.$confirm('Do you confirm the upload? If the Part Info already exists, we will delete it!', 'Warning', { |
|
|
|
|
|
confirmButtonText: 'OK', |
|
|
|
|
|
cancelButtonText: 'Cancel', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
const formData = new FormData() |
|
|
const formData = new FormData() |
|
|
formData.append("file", this.fileList[0].raw) |
|
|
formData.append("file", this.fileList[0].raw) |
|
|
formData.append("createBy", this.$store.state.user.name) |
|
|
formData.append("createBy", this.$store.state.user.name) |
|
|
formData.append("site", this.$store.state.user.site.toString()) |
|
|
formData.append("site", this.$store.state.user.site.toString()) |
|
|
|
|
|
this.isLoading = true |
|
|
savePartInfoByExcel(formData).then(({data}) => { |
|
|
savePartInfoByExcel(formData).then(({data}) => { |
|
|
if (data.code === 0) { |
|
|
if (data.code === 0) { |
|
|
// 关闭窗口并刷新页面 |
|
|
// 关闭窗口并刷新页面 |
|
|
@ -1278,6 +1284,12 @@ export default { |
|
|
this.$message.warning(data.msg) |
|
|
this.$message.warning(data.msg) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
type: 'info', |
|
|
|
|
|
message: 'Cancel upload' |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
provisionalDataDialogHandle () { |
|
|
provisionalDataDialogHandle () { |
|
|
@ -1643,7 +1655,7 @@ export default { |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog title="File Import" @close="closeUploadDialog" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog"> |
|
|
|
|
|
|
|
|
<el-dialog title="File Import" @close="closeUploadDialog" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;"> |
|
|
<el-form :inline="true" label-position="top" label-width="80px"> |
|
|
<el-form :inline="true" label-position="top" label-width="80px"> |
|
|
<el-form-item label="Site"> |
|
|
<el-form-item label="Site"> |
|
|
<el-input v-model="this.$store.state.user.site" disabled></el-input> |
|
|
<el-input v-model="this.$store.state.user.site" disabled></el-input> |
|
|
@ -1662,7 +1674,7 @@ export default { |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<span slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="saveUploadFile">{{ isLoading ? 'Saving...' : 'Save' }} </el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" :disabled="isLoading" @click="saveUploadFile">{{ isLoading ? 'Saving...' : 'Save' }} </el-button> |
|
|
<el-button type="primary" @click="closeUploadDialog">Cancel</el-button> |
|
|
<el-button type="primary" @click="closeUploadDialog">Cancel</el-button> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|