|
@@ -12,12 +12,6 @@
|
|
<el-button type="primary" @click="arragne">确定排车</el-button>
|
|
<el-button type="primary" @click="arragne">确定排车</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <!-- <div class="table_form from">
|
|
|
|
- <div class="materialId">
|
|
|
|
- <span class="text"> 物资: </span>
|
|
|
|
- <el-button type="primary" class="btn" @click="table = true">浏览</el-button>
|
|
|
|
- </div>
|
|
|
|
- </div> -->
|
|
|
|
<!-- 车序号表格 -->
|
|
<!-- 车序号表格 -->
|
|
<div class="switch" v-if="selectionList.length > 0">
|
|
<div class="switch" v-if="selectionList.length > 0">
|
|
<el-tooltip placement="top">
|
|
<el-tooltip placement="top">
|
|
@@ -93,6 +87,7 @@
|
|
class="textinput1"
|
|
class="textinput1"
|
|
placeholder="(必填)"
|
|
placeholder="(必填)"
|
|
v-model.number="scope.row.cxh"
|
|
v-model.number="scope.row.cxh"
|
|
|
|
+ @change="updateArragneCxh(scope.row.cxh)"
|
|
></el-input>
|
|
></el-input>
|
|
</template>
|
|
</template>
|
|
<!-- 收货地址id -->
|
|
<!-- 收货地址id -->
|
|
@@ -162,12 +157,11 @@
|
|
|
|
|
|
<el-input
|
|
<el-input
|
|
style="width: 50px;"
|
|
style="width: 50px;"
|
|
- placeholder="(非必填)"
|
|
|
|
v-model.number="scope.row.arragneCount"
|
|
v-model.number="scope.row.arragneCount"
|
|
></el-input>
|
|
></el-input>
|
|
|
|
|
|
<el-button
|
|
<el-button
|
|
- @click="deleteRow(scope.$index)"
|
|
|
|
|
|
+ @click="deleteRow(scope.$index,scope.row)"
|
|
type="text"
|
|
type="text"
|
|
icon="el-icon-close"
|
|
icon="el-icon-close"
|
|
size="big"
|
|
size="big"
|
|
@@ -227,7 +221,7 @@
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import PageTitle from "@/components/Page/Title";
|
|
import PageTitle from "@/components/Page/Title";
|
|
-
|
|
|
|
|
|
+import { sjTime,isNumber } from "@/utils/sharedJsFile";
|
|
export default {
|
|
export default {
|
|
components: { PageTitle },
|
|
components: { PageTitle },
|
|
data() {
|
|
data() {
|
|
@@ -360,31 +354,40 @@ export default {
|
|
this.row.index = index;
|
|
this.row.index = index;
|
|
this.drawer = true;
|
|
this.drawer = true;
|
|
},
|
|
},
|
|
|
|
+ //修改输入框中的车序号,自动获取车序号最大值
|
|
|
|
+ updateArragneCxh(cxh){
|
|
|
|
+ if(this.arragneCxh<cxh){
|
|
|
|
+ this.arragneCxh = ++cxh;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
//复制多条的方法
|
|
//复制多条的方法
|
|
copyRow(index,row){
|
|
copyRow(index,row){
|
|
- console.log("this.selectionList",this.selectionList)
|
|
|
|
- console.log("row",row)
|
|
|
|
let arr = [];
|
|
let arr = [];
|
|
for(var i = 0 ;i<this.selectionList.length; i++){
|
|
for(var i = 0 ;i<this.selectionList.length; i++){
|
|
if(i == index){
|
|
if(i == index){
|
|
arr.push(this.selectionList[i]);
|
|
arr.push(this.selectionList[i]);
|
|
|
|
+ //车序号自增
|
|
|
|
+ var cxhStart = row.cxh;
|
|
for(var j = 0;j<this.selectionList[i].arragneCount; j++){
|
|
for(var j = 0;j<this.selectionList[i].arragneCount; j++){
|
|
arr.push({
|
|
arr.push({
|
|
Specification:row.Specification,
|
|
Specification:row.Specification,
|
|
arragneCount:this.arragneCount,
|
|
arragneCount:this.arragneCount,
|
|
- cxh:row.cxh,
|
|
|
|
|
|
+ cxh:++cxhStart,
|
|
materialName:row.materialName,
|
|
materialName:row.materialName,
|
|
orderPlanWeight:row.orderPlanWeight,
|
|
orderPlanWeight:row.orderPlanWeight,
|
|
saleDateOfReceipt:row.saleDateOfReceipt,
|
|
saleDateOfReceipt:row.saleDateOfReceipt,
|
|
saleMaterialId:row.saleMaterialId,
|
|
saleMaterialId:row.saleMaterialId,
|
|
saleOrderConsignee:row.saleOrderConsignee,
|
|
saleOrderConsignee:row.saleOrderConsignee,
|
|
- saleDateOfReceipt:row.saleDateOfReceipt,
|
|
|
|
saleOrderConsigneeTel:row.saleOrderConsigneeTel,
|
|
saleOrderConsigneeTel:row.saleOrderConsigneeTel,
|
|
saleShipperAddressId:row.saleShipperAddressId,
|
|
saleShipperAddressId:row.saleShipperAddressId,
|
|
saleShipperAddressName:row.saleShipperAddressName,
|
|
saleShipperAddressName:row.saleShipperAddressName,
|
|
})
|
|
})
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ //确定车序号最大值并赋值给初始化车序号
|
|
|
|
+ if(this.arragneCxh<cxhStart){
|
|
|
|
+ this.arragneCxh = ++cxhStart;
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
arr.push(this.selectionList[i]);
|
|
arr.push(this.selectionList[i]);
|
|
}
|
|
}
|
|
@@ -393,8 +396,28 @@ export default {
|
|
this.selectionList = arr;
|
|
this.selectionList = arr;
|
|
},
|
|
},
|
|
//点击删除按钮删除当前点击的对象
|
|
//点击删除按钮删除当前点击的对象
|
|
- deleteRow(index){
|
|
|
|
- this.selectionList.splice(index,1)
|
|
|
|
|
|
+ deleteRow(index,row){
|
|
|
|
+ //统计与当前最大车序号相等的车序号
|
|
|
|
+ var equalArragneCxh = 0;
|
|
|
|
+ //若为最后一个删除对象,初始化this.arragneCxh的值
|
|
|
|
+ if(this.selectionList.length==1){
|
|
|
|
+ this.arragneCxh = 1;
|
|
|
|
+ }else{
|
|
|
|
+ for(var i = 0 ;i<this.selectionList.length; i++){
|
|
|
|
+ if(this.selectionList[i].cxh==this.arragneCxh){
|
|
|
|
+ equalArragneCxh++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //判断是否要减小最大车序号数
|
|
|
|
+ if(equalArragneCxh==0){
|
|
|
|
+ if((this.arragneCxh-1)==row.cxh){
|
|
|
|
+ this.arragneCxh=row.cxh;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //删除当前点击的对象
|
|
|
|
+ this.selectionList.splice(index,1);
|
|
},
|
|
},
|
|
//监听模态框点击事件
|
|
//监听模态框点击事件
|
|
currentRadioChange1(radioList) {
|
|
currentRadioChange1(radioList) {
|
|
@@ -423,7 +446,6 @@ export default {
|
|
saleDateOfReceipt:e.saleDateOfReceipt,
|
|
saleDateOfReceipt:e.saleDateOfReceipt,
|
|
saleMaterialId:e.saleMaterialId,
|
|
saleMaterialId:e.saleMaterialId,
|
|
saleOrderConsignee:e.saleOrderConsignee,
|
|
saleOrderConsignee:e.saleOrderConsignee,
|
|
- saleDateOfReceipt:e.saleDateOfReceipt,
|
|
|
|
saleOrderConsigneeTel:e.saleOrderConsigneeTel,
|
|
saleOrderConsigneeTel:e.saleOrderConsigneeTel,
|
|
saleShipperAddressId:e.saleShipperAddressId,
|
|
saleShipperAddressId:e.saleShipperAddressId,
|
|
saleShipperAddressName:e.saleShipperAddressName,
|
|
saleShipperAddressName:e.saleShipperAddressName,
|
|
@@ -481,8 +503,6 @@ export default {
|
|
arragneCount : this.arragneCount,
|
|
arragneCount : this.arragneCount,
|
|
};
|
|
};
|
|
this.selectionList.push(addmap);
|
|
this.selectionList.push(addmap);
|
|
- //车序号自增
|
|
|
|
- this.arragneCxh++;
|
|
|
|
});
|
|
});
|
|
this.selectionList1 = [];
|
|
this.selectionList1 = [];
|
|
this.table = false;
|
|
this.table = false;
|
|
@@ -493,13 +513,11 @@ export default {
|
|
selectionChange(selection) {
|
|
selectionChange(selection) {
|
|
this.selectionList1 = [];
|
|
this.selectionList1 = [];
|
|
this.selectionList1 = selection;
|
|
this.selectionList1 = selection;
|
|
- console.log("this.selectionList1 ",this.selectionList1)
|
|
|
|
},
|
|
},
|
|
// 确定
|
|
// 确定
|
|
makeSure() {
|
|
makeSure() {
|
|
//初始化maplist
|
|
//初始化maplist
|
|
var mapList = [];
|
|
var mapList = [];
|
|
- console.log("this.selectionList",this.selectionList)
|
|
|
|
this.selectionList.forEach((item,i) => {
|
|
this.selectionList.forEach((item,i) => {
|
|
//初始化mapItem
|
|
//初始化mapItem
|
|
var mapItem={
|
|
var mapItem={
|
|
@@ -509,7 +527,7 @@ export default {
|
|
truckNo : "",
|
|
truckNo : "",
|
|
//收货地址id
|
|
//收货地址id
|
|
shippingAddressId : 0,
|
|
shippingAddressId : 0,
|
|
- //收货日期
|
|
|
|
|
|
+ //截止日期
|
|
dateOfReceipt :null,
|
|
dateOfReceipt :null,
|
|
//收货方姓名
|
|
//收货方姓名
|
|
orderConsignee :"",
|
|
orderConsignee :"",
|
|
@@ -523,14 +541,13 @@ export default {
|
|
mapItem.saleOrderId=this.$route.params.saleOrderId;
|
|
mapItem.saleOrderId=this.$route.params.saleOrderId;
|
|
mapItem.truckNo=item.cxh;
|
|
mapItem.truckNo=item.cxh;
|
|
mapItem.shippingAddressId=item.saleShipperAddressId;
|
|
mapItem.shippingAddressId=item.saleShipperAddressId;
|
|
- mapItem.dateOfReceipt=item.saleDateOfReceipt;
|
|
|
|
|
|
+ mapItem.dateOfReceipt=sjTime(item.saleDateOfReceipt);
|
|
mapItem.orderConsignee=item.saleOrderConsignee;
|
|
mapItem.orderConsignee=item.saleOrderConsignee;
|
|
mapItem.orderConsigneeTel=item.saleOrderConsigneeTel;
|
|
mapItem.orderConsigneeTel=item.saleOrderConsigneeTel;
|
|
mapItem.saleMaterialId=item.saleMaterialId;
|
|
mapItem.saleMaterialId=item.saleMaterialId;
|
|
mapItem.materialNumber=item.orderPlanWeight;
|
|
mapItem.materialNumber=item.orderPlanWeight;
|
|
mapList.push(mapItem);
|
|
mapList.push(mapItem);
|
|
});
|
|
});
|
|
- console.log("mapList",mapList);
|
|
|
|
this.axios.post("/api/v1/ams/addTruckNo", mapList).then((res) => {
|
|
this.axios.post("/api/v1/ams/addTruckNo", mapList).then((res) => {
|
|
if (res.data.code == "200") {
|
|
if (res.data.code == "200") {
|
|
this.$router.go(-1);
|
|
this.$router.go(-1);
|