|
@@ -124,18 +124,27 @@ export default {
|
|
|
return false;
|
|
|
},
|
|
|
handleSuccess({ results, header }) {
|
|
|
+ console.log(results,header)
|
|
|
if (results.length === 0) {
|
|
|
this.$message.error("表格无有效数据!");
|
|
|
return;
|
|
|
}
|
|
|
let head = [
|
|
|
- "收货总数",
|
|
|
- "收货联系人",
|
|
|
- "收货联系电话",
|
|
|
- "收货省名称",
|
|
|
- "收货市名称",
|
|
|
- "收货区名称",
|
|
|
- "详细地址",
|
|
|
+ "平台订单号",
|
|
|
+ "平台商品编号",
|
|
|
+ "销售渠道",
|
|
|
+ "平台订单下单时间",
|
|
|
+ "订单单价",
|
|
|
+ "销售数量",
|
|
|
+ "订单总金额",
|
|
|
+ "活动名称",
|
|
|
+ "优惠金额",
|
|
|
+ "优惠后金额",
|
|
|
+ "收费模式",
|
|
|
+ "订单备注",
|
|
|
+ "收货人",
|
|
|
+ "联系电话",
|
|
|
+ "联系地址"
|
|
|
];
|
|
|
if (head.length !== header.length) {
|
|
|
this.$message.error("表头与导入模板不匹配!");
|
|
@@ -155,27 +164,38 @@ export default {
|
|
|
this.tableHeader = header;
|
|
|
this.tableData = [];
|
|
|
let list = results;
|
|
|
- let tableOk = true;
|
|
|
+ // let tableOk = true;
|
|
|
this.ruleForm.order_addr = [];
|
|
|
list.forEach((v1) => {
|
|
|
+
|
|
|
let b = Object.values(v1);
|
|
|
- let item = this.get_code(b[3], b[4], b[5]);
|
|
|
+ console.log(b)
|
|
|
+ // let item = this.get_code(b[3], b[4], b[5]);
|
|
|
let model = {
|
|
|
- receipt_quantity: b[0] + "",
|
|
|
- contactor: b[1] + "",
|
|
|
- mobile: b[2] + "",
|
|
|
- in_addr: b[3] + "/" + b[4] + "/" + b[5],
|
|
|
- addr_code_name: item.name + "",
|
|
|
- addr_code: item.code,
|
|
|
- addr: b[6] + "",
|
|
|
- edit: false,
|
|
|
+ cs0: b[0] + "",
|
|
|
+ cs1: b[1] + "",
|
|
|
+ cs2: b[2] + "",
|
|
|
+ cs3: b[3] + "",
|
|
|
+ cs4: b[4] + "",
|
|
|
+ cs5: b[5] + "",
|
|
|
+ cs6: b[6] + "",
|
|
|
+ cs7: b[7] + "",
|
|
|
+ cs8: b[8] + "",
|
|
|
+ cs9: b[9] + "",
|
|
|
+ cs10: b[10] + "",
|
|
|
+ cs11: b[11] + "",
|
|
|
+ cs12: b[12] + "",
|
|
|
+ cs13: b[13] + "",
|
|
|
+ cs14: b[14] + "",
|
|
|
+
|
|
|
};
|
|
|
- this.ruleForm.order_addr.push(model);
|
|
|
+ console.log(model)
|
|
|
+ this.tableData.push(model);
|
|
|
});
|
|
|
- if (!tableOk) {
|
|
|
- this.$message.error("最晚收货日期不正确,请将表格格式转为文本上传!");
|
|
|
- }
|
|
|
- console.log(this.ruleForm.order_add)
|
|
|
+ // if (!tableOk) {
|
|
|
+ // this.$message.error("最晚收货日期不正确,请将表格格式转为文本上传!");
|
|
|
+ // }
|
|
|
+ console.log(this.tableData)
|
|
|
},
|
|
|
get_code(name1, name2, name3) {
|
|
|
let name = "",
|