Browse Source

导入添加

master
shenzhouyu 3 months ago
parent
commit
0aafbfdcf9
  1. 34
      src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue
  2. 43
      src/views/modules/noOrderIssue/noorder_upload_excel.vue

34
src/views/modules/noOrderIssue/newNoOrderIssueNotify.vue

@ -123,14 +123,14 @@
<el-input v-model="partNo" @keyup.enter.native="addRowFromQuery"></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-col :span="8">
<el-form-item label=" ">
<el-button type="primary" @click="addRowFromQuery()" :loading="addLineLoading"
class="">添加物料行</el-button>
<el-button type="primary" @click="openSelectMaterialModal()"
class="">选择物料</el-button>
<!-- <el-button type="primary" @click="importModel()"
class="">导入</el-button> -->
<el-button type="primary" @click="importModel()" :disabled="seqNoList.length>0"
class="">导入</el-button>
</el-form-item>
</el-col>
</el-row>
@ -2113,6 +2113,8 @@ export default {
needDate: '',
}
this.seqNoList.push(newRow)
console.log('添加的新行:', newRow) // ;
this.$set(this, 'partNo', '') //
} else {
this.$message.warning(data.msg || '查询无数据')
@ -2672,7 +2674,31 @@ export default {
this.authDelete = !deleteFlag
},
searchTable() {},
searchTable(rows) {
if( rows.length > 0){
for (let i = 0; i < rows.length; i++) {
//
const newRow = {
partNo: rows[i].componentPartNo || '',
height: rows[i].height || '',
isInWh: rows[i].isInWh || '',
applyQty: rows[i].qtyIssued || 0,
orderNo: '',
releaseNo: '',
sequenceNo: '',
lineItemNo: '',
materialLineStatus: '',
componentPartDesc: '',
uom: '',
startDate: '',
finishDate: '',
needDate: '',
}
this.seqNoList.push(newRow)
}
}
},
getAllNotifyStatus() {
let inData = {
site: this.$store.state.user.site,

43
src/views/modules/noOrderIssue/noorder_upload_excel.vue

@ -2,18 +2,17 @@
<div class="customer-css">
<el-dialog :title="titleCon" :close-on-click-modal="false" :visible.sync="visible" width="390px" style="height: 520px;" class="customer-dialog" @close="handleDialogClose" :show-close="!uploading">
<el-form :inline="true" label-position="top" label-width="80px">
<el-row>
<!-- <el-row>
<el-form-item label=" ">
<!-- <el-button type="primary" @click="downloadFile()" :disabled="uploading">下载文件模板</el-button>-->
<a href="/static/downLoad/NotifyUploadModel.xlsx" download="领料申请单导入模板.xlsx">
下载 Excel 模板
</a>
</el-form-item>
</el-row>
</el-row> -->
<el-row>
<el-col :span="24">
<el-upload class="customer-upload" drag action="javascript:void(0);" ref="uploadFile" :limit="1" accept=".xlsx,.xls"
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" :disabled="uploading" style="text-align: left;">
:before-upload="beforeUploadHandle" :on-change="onChange" :auto-upload="false" :disabled="uploading" style="text-align: left;" :file-list="fileList">
<i class="el-icon-upload"></i>
<div class="el-upload__text">
{{ uploading ? '正在上传中,请稍候...' : '将文件拖到此处,或点击上传' }}
@ -53,6 +52,7 @@ export default {
notifyNo: '',
},
uploading: false, //
returnData: '', //
}
},
methods: {
@ -61,6 +61,8 @@ export default {
init (data) {
this.fileList = []
this.uploading = false //
console.log("init data",this.fileList);
//
this.visible = true
this.notifyData=JSON.parse(JSON.stringify(data))
@ -106,11 +108,17 @@ export default {
deleteFile(){
this.fileList = []
this.visible = false
this.uploading = false //
//
this.$refs.uploadFile.clearFiles()
//
this.$emit('refreshTable')
},
successCallback(){
this.fileList = []
this.visible = false
this.uploading = false //
this.$emit('refreshTable',this.returnData)
},
//
@ -143,9 +151,10 @@ export default {
//
uploadNoorderNotifyExcel(formData).then(({ data }) => {
if (data.code === 0) {
this.returnData = data.rows
this.$message.success(data.msg || 'Excel文件上传成功')
//
this.closeDialog()
this.successCallback()
} else {
this.$message.error(data.msg || 'Excel文件上传失败')
}
@ -157,28 +166,6 @@ export default {
this.uploading = false
})
},
//
async downloadFile () {
//
//
this.$alert(
'模板格式说明:\n' +
'第1列:工厂编码(site)\n' +
'第2列:订单号(orderNo)\n' +
'第3列:发布号(releaseNo)\n' +
'第4列:序列号(sequenceNo)\n' +
'第5列:BOM行号(bomLineNo,必须为正整数)\n' +
'第6列:物料编码(materialPartNo)\n' +
'第7列:需求日期(needDate,格式:YYYY-MM-DD)\n' +
'第8列:数量(qty,必须为数字)',
'模板格式说明',
{
confirmButtonText: '确定',
type: 'info'
}
)
},
}
}
</script>
Loading…
Cancel
Save