|
@@ -87,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 -->
|
|
@@ -156,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"
|
|
@@ -354,17 +354,25 @@ 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){
|
|
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,
|
|
@@ -376,6 +384,10 @@ export default {
|
|
})
|
|
})
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ //确定车序号最大值并赋值给初始化车序号
|
|
|
|
+ if(this.arragneCxh<cxhStart){
|
|
|
|
+ this.arragneCxh = ++cxhStart;
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
arr.push(this.selectionList[i]);
|
|
arr.push(this.selectionList[i]);
|
|
}
|
|
}
|
|
@@ -384,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) {
|
|
@@ -471,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;
|