|
|
@ -9,7 +9,6 @@ |
|
|
|
v-loading="loading" |
|
|
|
:modal="false" |
|
|
|
> |
|
|
|
<!-- v-loading.fullscreen.lock="loading" --> |
|
|
|
<el-button |
|
|
|
type="success" |
|
|
|
size="mini" |
|
|
@ -17,13 +16,6 @@ |
|
|
|
@click="postImportDown" |
|
|
|
>获取模板</el-button |
|
|
|
> |
|
|
|
<!-- <el-button |
|
|
|
type="warning" |
|
|
|
size="mini" |
|
|
|
icon="el-icon-upload" |
|
|
|
@click="postImportDown" |
|
|
|
>导入数据</el-button |
|
|
|
> --> |
|
|
|
<input ref="excel-upload-input" class="excel-upload-input" type="file" accept=".xlsx, .xls" @change="handleClick"> |
|
|
|
<el-button |
|
|
|
:loading="loading" |
|
|
@ -32,25 +24,7 @@ |
|
|
|
type="primary" |
|
|
|
@click="handleUpload" |
|
|
|
icon="el-icon-download" |
|
|
|
> |
|
|
|
导入数据 |
|
|
|
</el-button> |
|
|
|
<!-- <el-button |
|
|
|
:loading="loading" |
|
|
|
style="margin-left:16px;" |
|
|
|
size="mini" |
|
|
|
type="warning" |
|
|
|
@click="handlePrint()" |
|
|
|
icon="el-icon-printer" |
|
|
|
> |
|
|
|
全部打印 |
|
|
|
</el-button> --> |
|
|
|
<!-- <div class="drop" @drop="handleDrop" @dragover="handleDragover" @dragenter="handleDragover"> |
|
|
|
Drop excel file here or |
|
|
|
<el-button :loading="loading" style="margin-left:16px;" size="mini" type="primary" @click="handleUpload"> |
|
|
|
Browse |
|
|
|
</el-button> |
|
|
|
</div> --> |
|
|
|
>导入数据</el-button> |
|
|
|
<div style="height:calc(100% - 60px)" id="tableOuter"> |
|
|
|
<el-table |
|
|
|
:data="excelData.results" |
|
|
@ -59,8 +33,6 @@ |
|
|
|
style="width: 100%;margin-top:20px;" |
|
|
|
:max-height="tableMaxHeight" |
|
|
|
> |
|
|
|
<!-- @selection-change="handleSelectionPrint" --> |
|
|
|
<!-- <el-table-column type="selection" width="55"></el-table-column> --> |
|
|
|
<el-table-column |
|
|
|
v-if="excelData.header.length > 0" |
|
|
|
type="index" |
|
|
@ -75,16 +47,6 @@ |
|
|
|
:label="item" |
|
|
|
:fixed="headerFixed(item)" |
|
|
|
/> |
|
|
|
<!-- <el-table-column v-if="excelData.header.length > 0" label="明细-箱标签" fixed="right" width="100"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
{{scope.row['明细-箱标签']}} |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
<!-- <el-table-column label="操作" fixed="right"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button type="text" @click="handlePrint([scope.row])">打印</el-button> |
|
|
|
</template> |
|
|
|
</el-table-column> --> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
@ -97,7 +59,6 @@ |
|
|
|
<script> |
|
|
|
import XLSX from 'xlsx' |
|
|
|
import { mixins } from "@/mixins/mixins" |
|
|
|
import { postInventoryLabelCode } from "@/api/wms-core" |
|
|
|
import { supplierAsnExcel } from "@/filters/excelOrReportsOption"; |
|
|
|
import {SupplierAsnCtypeStaBack} from "@/filters/status" |
|
|
|
|
|
|
@ -135,7 +96,6 @@ export default { |
|
|
|
header: [], |
|
|
|
results: [] |
|
|
|
}, |
|
|
|
// printSelection:[],//已选打印 |
|
|
|
tableMaxHeight:null,//表格流体最大高度 |
|
|
|
} |
|
|
|
}, |
|
|
@ -147,7 +107,6 @@ export default { |
|
|
|
results:[] |
|
|
|
} |
|
|
|
this.loading = false |
|
|
|
// this.printSelection = []; |
|
|
|
}, |
|
|
|
headerFixed(item){ |
|
|
|
let _fix = false |
|
|
@ -165,81 +124,6 @@ export default { |
|
|
|
submitForm(index) { |
|
|
|
this.$emit("submitForm", index,this.excelData); |
|
|
|
}, |
|
|
|
// 多选 |
|
|
|
// handleSelectionPrint(val) { |
|
|
|
// this.printSelection = val; |
|
|
|
// }, |
|
|
|
/** |
|
|
|
* 打印 |
|
|
|
* arr 有参数为单独打印,无参数为批量打印 |
|
|
|
*/ |
|
|
|
// handlePrint(arr){ |
|
|
|
// let rdlx = "xiangbq.rdlx"; |
|
|
|
// let params = { |
|
|
|
// "boxlabel":[] |
|
|
|
// } |
|
|
|
// // let printArr = arr ? arr : this.printSelection; |
|
|
|
// let printArr = arr ? arr : this.excelData.results; |
|
|
|
// if(!printArr || printArr.length <= 0){ |
|
|
|
// this.$message({ |
|
|
|
// message: '请选择要打印的数据', |
|
|
|
// type: 'error' |
|
|
|
// }); |
|
|
|
// return |
|
|
|
// } |
|
|
|
// 打印操作 |
|
|
|
// this.getPackingCode(arr) |
|
|
|
// }, |
|
|
|
|
|
|
|
// 获取箱标签并回显 |
|
|
|
getPackingCode(header, results){ |
|
|
|
let createManyParams = []; |
|
|
|
results.forEach(item => { |
|
|
|
let _item = { |
|
|
|
itemCode: item[supplierAsnExcel.details.itemCode] || "", |
|
|
|
lot: item[supplierAsnExcel.details.lot] || "", |
|
|
|
labelType:1, |
|
|
|
qty: Number(item[supplierAsnExcel.details.qty]), |
|
|
|
uom: item[supplierAsnExcel.details.uom], |
|
|
|
stdPackQty:0, |
|
|
|
company:localStorage.getItem("company"), |
|
|
|
|
|
|
|
// poNumber:item[supplierAsnExcel.poNumber], |
|
|
|
// number:item[supplierAsnExcel.number], |
|
|
|
supplierCode:item[supplierAsnExcel.supplierCode], |
|
|
|
planUserCode:item[supplierAsnExcel.planUserCode], |
|
|
|
contactUserName:item[supplierAsnExcel.planUserCode], |
|
|
|
planArriveDate:item[supplierAsnExcel.planArriveDate], |
|
|
|
shipDate:item[supplierAsnExcel.shipDate], |
|
|
|
remark:item[supplierAsnExcel.remark], |
|
|
|
|
|
|
|
ctype:SupplierAsnCtypeStaBack(item[supplierAsnExcel.details.ctype]), |
|
|
|
projectCode:item[supplierAsnExcel.details.projectCode], |
|
|
|
itemCode:item[supplierAsnExcel.details.itemCode], |
|
|
|
recommendErpCode:item[supplierAsnExcel.details.recommendErpCode], |
|
|
|
qty:item[supplierAsnExcel.details.qty], |
|
|
|
uom:item[supplierAsnExcel.details.uom], |
|
|
|
lot:item[supplierAsnExcel.details.lot], |
|
|
|
produceDate:item[supplierAsnExcel.details.produceDate], |
|
|
|
expireDate:item[supplierAsnExcel.details.expireDate], |
|
|
|
}; |
|
|
|
createManyParams.push(_item) |
|
|
|
}); |
|
|
|
postInventoryLabelCode(createManyParams) |
|
|
|
.then((res,a) => { |
|
|
|
let _header = JSON.parse(JSON.stringify(header)) |
|
|
|
_header.push(supplierAsnExcel.details.packingCode) |
|
|
|
res.forEach((v,k)=>{ |
|
|
|
this.$set(results[k],supplierAsnExcel.details.packingCode, res[k].code) |
|
|
|
}) |
|
|
|
this.successShowExcel(_header, results) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
this.loading = false |
|
|
|
this.$message.error('导入失败,请重新导入'); |
|
|
|
// this.reset() |
|
|
|
}) |
|
|
|
}, |
|
|
|
postImportDown () { |
|
|
|
this.$emit('postImportDown') |
|
|
|
}, |
|
|
@ -264,7 +148,6 @@ export default { |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
this.successShowExcel(header, results) |
|
|
|
// this.getPackingCode(header, results) |
|
|
|
} |
|
|
|
}, |
|
|
|
handleDrop(e) { |