|
@@ -20,13 +20,20 @@
|
|
|
</div>
|
|
|
<div class="importedTable" style="height:300px;overflow:scroll;">
|
|
|
<el-table
|
|
|
+ ref="importExcel"
|
|
|
highlight-current-row
|
|
|
:data="tableData"
|
|
|
:row-style="{height:'40px'}"
|
|
|
+ @row-click="rowClick"
|
|
|
+ style="width: 100%;font-size: 14px"
|
|
|
id="domesticTable">
|
|
|
+ <el-table-column
|
|
|
+ type="selection"
|
|
|
+ width="55">
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
type="index"
|
|
|
- width="50"
|
|
|
+ width="50px"
|
|
|
prop="number"
|
|
|
label="序号"
|
|
|
align="center"
|
|
@@ -34,6 +41,13 @@
|
|
|
:resizable="false"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
+ prop="purchaseOrderNo"
|
|
|
+ label="采购订单号"
|
|
|
+ width="150px"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="productName"
|
|
@@ -43,19 +57,19 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="mineral"
|
|
|
- label="矿种"
|
|
|
+ prop="supplierName"
|
|
|
+ label="发货单位"
|
|
|
width="150px"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="wagonNo"
|
|
|
- label="车号"
|
|
|
+ prop="materialName"
|
|
|
+ label="物资名"
|
|
|
width="150px"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
- <el-table-column
|
|
|
+ <el-table-column
|
|
|
align="center"
|
|
|
prop="unloadPoint"
|
|
|
label="卸货地点"
|
|
@@ -64,16 +78,16 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- prop="sendStation"
|
|
|
- label="发站"
|
|
|
- width="100px"
|
|
|
+ prop="wagonNo"
|
|
|
+ label="车号"
|
|
|
+ width="150px"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
+ prop="sendStation"
|
|
|
+ label="发站"
|
|
|
width="100px"
|
|
|
- prop="arrivalStation"
|
|
|
- label="到站"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -97,6 +111,19 @@
|
|
|
label="标重"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ width="70">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ @click.native.prevent="ondrawer(scope)"
|
|
|
+ type="text"
|
|
|
+ size="small">
|
|
|
+ 手动配单
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="form">
|
|
@@ -122,6 +149,49 @@
|
|
|
<dil-form :formId="364" v-model="form1" ref="from1"></dil-form>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!-- 模态框 -->
|
|
|
+ <el-drawer
|
|
|
+ :visible.sync="drawer"
|
|
|
+ :direction="direction"
|
|
|
+ :before-close="handleClose"
|
|
|
+ size="50%"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ placeholder="发货单位"
|
|
|
+ v-model="supplierName"
|
|
|
+ style="margin-top: 10px; margin-left: 20px; width: 150px"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="物资名"
|
|
|
+ v-model="materialName"
|
|
|
+ style="margin-top: 10px; margin-left: 20px; width: 150px"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-input
|
|
|
+ placeholder="卸货地点"
|
|
|
+ v-model="resultForeignShipName"
|
|
|
+ style="margin-top: 10px; margin-left: 20px; width: 150px"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ class="btn"
|
|
|
+ @click="onclick"
|
|
|
+ style="margin-bottom: 15px">
|
|
|
+ <i class="el-icon-search"></i>查询
|
|
|
+ </el-button>
|
|
|
+ <div v-show="drawer">
|
|
|
+ <dilTable
|
|
|
+ ref="ordertable"
|
|
|
+ v-bind.sync="purchaseOption"
|
|
|
+ @radio-change="orderChange"
|
|
|
+ ></dilTable>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
<div class="button_box_domestic">
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
<el-button type="primary" :loading="isLoading" @click="makeSure"
|
|
@@ -154,9 +224,10 @@ export default {
|
|
|
//采购订单号
|
|
|
purchaseOrderNo: null,
|
|
|
//物资名称
|
|
|
- materialName: null,
|
|
|
+ materialName: '',
|
|
|
//发货单位名称
|
|
|
- supplierName: null,
|
|
|
+ supplierName: '',
|
|
|
+ resultForeignShipName:'',
|
|
|
//发货单位id
|
|
|
supplierId: null,
|
|
|
//物资id
|
|
@@ -172,6 +243,7 @@ export default {
|
|
|
a: 1,
|
|
|
direction: "rtl",
|
|
|
inputText: "",
|
|
|
+ index:null,
|
|
|
frist: {
|
|
|
requestUrl: "/api/v1/uc/queryAPOMaterialByLike?apiId=244&startNum=050",
|
|
|
selectionType: "radio",
|
|
@@ -187,6 +259,13 @@ export default {
|
|
|
requestUrl: "/api/v1/uc/getUnloadingMesByLike?apiId=374",
|
|
|
selectionType: "radio"
|
|
|
},
|
|
|
+ purchaseOption:{
|
|
|
+ // 表格请求数据的地址
|
|
|
+ requestUrl: "/api/v1/tms/findPurchaseOrderList?apiId=81",
|
|
|
+ // 控制选择单列
|
|
|
+ selectionType: "radio",
|
|
|
+ pageSize:5,
|
|
|
+ },
|
|
|
sendStationId: null,
|
|
|
toTheStationId: 1,
|
|
|
sendStation: null,
|
|
@@ -276,10 +355,14 @@ export default {
|
|
|
// 确定
|
|
|
makeSure() {
|
|
|
let that = this;
|
|
|
+ let selection=this.$refs.importExcel.selection;
|
|
|
this.isLoading = true;
|
|
|
+ //校验
|
|
|
if (
|
|
|
this.tableData.length <= 0 ||
|
|
|
!this.toTheStationId ||
|
|
|
+ !selection ||
|
|
|
+ selection.length<=0 ||
|
|
|
!this.form1.resultLoadingDate
|
|
|
) {
|
|
|
if (this.tableData.length <= 0) {
|
|
@@ -287,7 +370,12 @@ export default {
|
|
|
type: "warning",
|
|
|
message: "请导入数据!"
|
|
|
});
|
|
|
- } else if (!this.toTheStationId) {
|
|
|
+ }else if(!selection ||selection.length<=0){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请选择车皮!"
|
|
|
+ });
|
|
|
+ }else if (!this.toTheStationId) {
|
|
|
this.$message({
|
|
|
type: "warning",
|
|
|
message: "请选择到站!"
|
|
@@ -301,15 +389,28 @@ export default {
|
|
|
this.isLoading = false;
|
|
|
return;
|
|
|
}
|
|
|
+ let error=selection.find(item=>!item.purchaseOrderId ||
|
|
|
+ !item.purchaseOrderNo ||
|
|
|
+ !item.batchId ||
|
|
|
+ !item.materialId ||
|
|
|
+ !item.supplierId);
|
|
|
+ if(error){
|
|
|
+ this.$message({
|
|
|
+ type: "warning",
|
|
|
+ message: "请先配单再勾选!"
|
|
|
+ });
|
|
|
+ this.isLoading = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
//绑定通用字段
|
|
|
- this.tableData.forEach(row => {
|
|
|
+ selection.forEach(row => {
|
|
|
row.resultType = 3; //装车类型为国产矿
|
|
|
row.arrivalStationId = that.form1.arrivalStationId; //到站id,默认老区轨道衡
|
|
|
row.resultLoadingDate = sjTime(that.form1.resultLoadingDate); //装车日期
|
|
|
row.resultRemarks = that.form1.resultRemarks; //备注
|
|
|
});
|
|
|
let data = {
|
|
|
- list: this.tableData,
|
|
|
+ list: selection,
|
|
|
userId: getCookie("userId")
|
|
|
};
|
|
|
console.log(data);
|
|
@@ -328,6 +429,7 @@ export default {
|
|
|
message: res.data.data
|
|
|
});
|
|
|
}
|
|
|
+ }).then(()=>{
|
|
|
this.isLoading = false;
|
|
|
});
|
|
|
},
|
|
@@ -344,7 +446,7 @@ export default {
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
- this.tableData = [];
|
|
|
+ let excelData = [];
|
|
|
var reader = new FileReader();
|
|
|
var data = null;
|
|
|
var workbook = null;
|
|
@@ -545,10 +647,27 @@ export default {
|
|
|
});
|
|
|
continue;
|
|
|
}
|
|
|
- that.tableData.push(tableRow);
|
|
|
+ excelData.push(tableRow);
|
|
|
}
|
|
|
}
|
|
|
- console.log(that.tableData);
|
|
|
+ console.log(excelData);
|
|
|
+ let map={
|
|
|
+ list:excelData
|
|
|
+ }
|
|
|
+ //导入exceL
|
|
|
+ that.axios.post("/api/v1/tms/importDomesticLoadResult",map).then(res => {
|
|
|
+ console.log(res);
|
|
|
+ if (res.data.code == "200") {
|
|
|
+ that.tableData=res.data.data;
|
|
|
+ } else {
|
|
|
+ that.$message({
|
|
|
+ type: "error",
|
|
|
+ message: res.data.data
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }).then(()=>{
|
|
|
+ // that.isLoading = false;
|
|
|
+ });
|
|
|
};
|
|
|
reader.readAsBinaryString(file.raw); //以二进制方式读取
|
|
|
},
|
|
@@ -562,8 +681,56 @@ export default {
|
|
|
return year + format + month + format + date
|
|
|
}
|
|
|
return year + '年' + (month < 10 ? '0' + month : month)+ '月' + (date < 10 ? '0' + date : date) + '日'
|
|
|
+ },
|
|
|
+ //点击行勾选
|
|
|
+ rowClick(row, column, event) {
|
|
|
+ console.log("selected:",row);
|
|
|
+ //没有配单直接返回
|
|
|
+ if(!row.purchaseOrderId){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let importExcel = this.$refs.importExcel; // 获取表格对象
|
|
|
+ //判断是否已存在
|
|
|
+ let findRow = importExcel.selection.find(item => item.wagonNo == row.wagonNo);
|
|
|
+ if (findRow) {
|
|
|
+ importExcel.toggleRowSelection(row, false);
|
|
|
+ }else{
|
|
|
+ importExcel.toggleRowSelection(row);
|
|
|
+ }
|
|
|
+ console.log(importExcel.selection);
|
|
|
+ },
|
|
|
+ onclick() {
|
|
|
+ this.purchaseOption.requestUrl=
|
|
|
+ "/api/v1/tms/findPurchaseOrderList?apiId=81&supplierName="+this.supplierName
|
|
|
+ +"&materialName="+this.materialName
|
|
|
+ +"&resultForeignShipName="+this.resultForeignShipName
|
|
|
+ +"&i="+new Date();
|
|
|
+ },
|
|
|
+ ondrawer(scope) {
|
|
|
+ this.drawer = true;
|
|
|
+ console.log("scope:",scope);
|
|
|
+ this.index=scope.$index;
|
|
|
+ },
|
|
|
+ //修改选中
|
|
|
+ orderChange(selection) {
|
|
|
+ console.log("order:",selection);
|
|
|
+ this.batchId=selection.batchId;
|
|
|
+ this.purchaseOrderId=selection.purchaseOrderId;
|
|
|
+ console.log("temp",this.tableData[0]);
|
|
|
+ this.tableData[this.index].batchId=selection.batchId;
|
|
|
+ this.tableData[this.index].purchaseOrderId=selection.purchaseOrderId;
|
|
|
+ this.tableData[this.index].supplierId=selection.supplierId;
|
|
|
+ this.tableData[this.index].supplierName=selection.supplierName;
|
|
|
+ this.tableData[this.index].materialId=selection.materialId;
|
|
|
+ this.tableData[this.index].materialName=selection.materialName;
|
|
|
+ this.tableData[this.index].purchaseOrderNo=selection.purchaseOrderNo;
|
|
|
+ this.tableData[this.index].unloadPoint=selection.resultForeignShipName;
|
|
|
+ console.log("index:",this.tableData[this.index]);
|
|
|
+ },
|
|
|
+ handleClose(done) {
|
|
|
+ this.$refs.ordertable.$refs.mainTable.setCurrentRow();//清除选项
|
|
|
+ done();
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
};
|
|
|
</script>
|