|
@@ -16,21 +16,22 @@
|
|
|
<span >当前导入数量:{{tableData.length}}</span>
|
|
|
</div> -->
|
|
|
<div class="tempTable">
|
|
|
- <div class="search" style="display:flex">
|
|
|
+ <div class="search" style="display:flex;margin: 10px;">
|
|
|
<el-input
|
|
|
placeholder="请输入"
|
|
|
- v-model="input"
|
|
|
- style="margin: 10px; width:20%"
|
|
|
+ value="请先导入查询,再勾选,如果查询失败,可能是港口没有出库或者已经装车"
|
|
|
+ style="margin: 10px; width:38%"
|
|
|
clearable
|
|
|
+ disabled
|
|
|
></el-input>
|
|
|
- <el-button
|
|
|
+ <!-- <el-button
|
|
|
type="primary"
|
|
|
class="btn"
|
|
|
@click="searchLoadTemp()"
|
|
|
style="margin: 10px;"
|
|
|
>
|
|
|
<i class="el-icon-search"></i>查询
|
|
|
- </el-button>
|
|
|
+ </el-button> -->
|
|
|
<el-upload style="margin: 10px;"
|
|
|
class="upload-excel"
|
|
|
action=""
|
|
@@ -40,16 +41,18 @@
|
|
|
:auto-upload="false">
|
|
|
<el-button type="primary">
|
|
|
<i class="el-icon-search"></i>导入查询</el-button>
|
|
|
+ <span >查询结果数量:{{tableDataReal.length}}</span>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
<!-- 临时表已导入配单的车皮 -->
|
|
|
<div class="tempTable" style="height:300px;overflow:scroll;float:left;margin-left:5px">
|
|
|
<el-table
|
|
|
ref="tempTable"
|
|
|
+ empty-text="请先查询,再查看数据"
|
|
|
highlight-current-row
|
|
|
@selection-change="handleSelectionChange"
|
|
|
@row-click="rowClick"
|
|
|
- :data="tableData"
|
|
|
+ :data="tableDataReal"
|
|
|
:row-style="{height:'40px'}"
|
|
|
style="width: 100%;font-size: 18px"
|
|
|
id="domesticTable">
|
|
@@ -223,6 +226,7 @@ export default {
|
|
|
list: [],
|
|
|
form1: {},
|
|
|
tableData:[],
|
|
|
+ tableDataReal:[],
|
|
|
selectionRow:[],
|
|
|
input: "",
|
|
|
value: undefined,
|
|
@@ -495,9 +499,17 @@ export default {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
+ let groupNo=1;
|
|
|
+ let isLoading=true;
|
|
|
//读取表格
|
|
|
- for(let i=1;i<=rows.length+1;i++){
|
|
|
+ for(let i=index+1;i<=rows.length+1;i++){
|
|
|
let row=workbook.Sheets[workbook.SheetNames[0]]['A'+i];
|
|
|
+ if(row && typeof row.v == "number" && isLoading==false){
|
|
|
+ isLoading=true;
|
|
|
+ groupNo++;
|
|
|
+ }else if(!row || typeof row.v != "number" && isLoading==true){
|
|
|
+ isLoading=false;
|
|
|
+ }
|
|
|
if(row!='undefined' && row!=null && typeof row.v=='number'
|
|
|
&& workbook.Sheets[workbook.SheetNames[0]]['B'+i]!='undefined'
|
|
|
&& workbook.Sheets[workbook.SheetNames[0]]['B'+i]!=null
|
|
@@ -516,13 +528,14 @@ export default {
|
|
|
let tableRow={
|
|
|
sendStation:workbook.Sheets[workbook.SheetNames[0]]['B'+i].v,
|
|
|
arrivalStation:workbook.Sheets[workbook.SheetNames[0]]['C'+i].v,
|
|
|
- sendDate:sjTime(workbook.Sheets[workbook.SheetNames[0]]['D'+i].v),
|
|
|
- arrivalDate:workbook.Sheets[workbook.SheetNames[0]]['E'+i].v,
|
|
|
+ sendDate: that.formatDate(workbook.Sheets[workbook.SheetNames[0]]["D" + i].v),
|
|
|
+ arrivalDate: that.formatDate(workbook.Sheets[workbook.SheetNames[0]]["E" + i].v),
|
|
|
unloadPoint:workbook.Sheets[workbook.SheetNames[0]]['F'+i].v,
|
|
|
productName:workbook.Sheets[workbook.SheetNames[0]]['G'+i].v,
|
|
|
wagonNo:workbook.Sheets[workbook.SheetNames[0]]['J'+i].v,
|
|
|
weight:workbook.Sheets[workbook.SheetNames[0]]['I'+i].v,
|
|
|
mineral:workbook.Sheets[workbook.SheetNames[0]]['H'+i].v,
|
|
|
+ groupNo:groupNo
|
|
|
}
|
|
|
if((tableRow.wagonNo+"").length!=7){
|
|
|
that.$message({
|
|
@@ -543,7 +556,7 @@ export default {
|
|
|
return;
|
|
|
}else if(that.tableData.length<=0){
|
|
|
that.$message({
|
|
|
- message:"当前列表没有可用数据",
|
|
|
+ message:"数据库没有可用数据",
|
|
|
type:"warning "
|
|
|
})
|
|
|
return;
|
|
@@ -552,22 +565,24 @@ export default {
|
|
|
let tableData=[];
|
|
|
importData.forEach((row)=>{
|
|
|
let temp=that.tableData.find(item=>item.wagonNo==row.wagonNo
|
|
|
- && row.productName.includes(item.foreignShipName)
|
|
|
- && item.materialName.includes(row.mineral));
|
|
|
- if(temp)
|
|
|
+ && row.productName.includes(item.foreignShipName));
|
|
|
+ if(temp){
|
|
|
+ temp.sendDate=row.sendDate;
|
|
|
+ temp.arrivalDate=row.arrivalDate;
|
|
|
+ temp.groupNo=row.groupNo;
|
|
|
tableData.push(temp);
|
|
|
+ }
|
|
|
});
|
|
|
- console.log("test",tableData);
|
|
|
that.tableDataReal=tableData;
|
|
|
- if(that.tableData.length<=0){
|
|
|
- that.$message({
|
|
|
- message: "查询不到相关车皮!",
|
|
|
- type: "warning",
|
|
|
+ if(tableData.length<=0){
|
|
|
+ that.$confirm('查询不到相关车皮!')
|
|
|
+ .then(_ => {
|
|
|
+ done();
|
|
|
});
|
|
|
- }else if(that.tableData.length<importData.length){
|
|
|
- that.$message({
|
|
|
- message: "共"+importData.length-that.tableData.length+"条车皮查询失败!",
|
|
|
- type: "warning",
|
|
|
+ }else if(tableData.length<importData.length){
|
|
|
+ that.$confirm("共"+(importData.length-tableData.length)+"条车皮查询失败!")
|
|
|
+ .then(_ => {
|
|
|
+ done();
|
|
|
});
|
|
|
}else{
|
|
|
that.$message({
|
|
@@ -593,8 +608,9 @@ export default {
|
|
|
},
|
|
|
//查询临时表
|
|
|
searchLoadTemp(){
|
|
|
+ this.tableDataReal=[];
|
|
|
this.axios.post('/api/v1/tms/getResultType?apiId=58&resultType=1&con='+this.input).then((res)=>{
|
|
|
- console.log(res);
|
|
|
+ console.log("temp:",res.data.data);
|
|
|
if(res.data.code == "200"){
|
|
|
this.tableData=res.data.data;
|
|
|
}else {
|
|
@@ -636,6 +652,17 @@ export default {
|
|
|
this.selectionRow = rows //保存已选择行
|
|
|
console.log(this.selectionRow);
|
|
|
},
|
|
|
+ formatDate(numb, format) {
|
|
|
+ const time = new Date((numb - 1) * 24 * 3600000 + 1)
|
|
|
+ time.setYear(time.getFullYear() - 70)
|
|
|
+ const year = time.getFullYear() + ''
|
|
|
+ const month = time.getMonth() + 1 + ''
|
|
|
+ const date = time.getDate() + ''
|
|
|
+ if (format && format.length === 1) {
|
|
|
+ return year + format + month + format + date
|
|
|
+ }
|
|
|
+ return year + '年' + (month < 10 ? '0' + month : month)+ '月' + (date < 10 ? '0' + date : date) + '日'
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|