|
@@ -17,11 +17,11 @@
|
|
|
<span>删除所有:Page Down</span>
|
|
<span>删除所有:Page Down</span>
|
|
|
</p>
|
|
</p>
|
|
|
<el-table ref="singleTable" :data="tableData" highlight-current-row style="width: 100%" border :header-cell-style="{background:'#fdfdfd', color: '#666', fontWeight: 400}" class="tableBox active">
|
|
<el-table ref="singleTable" :data="tableData" highlight-current-row style="width: 100%" border :header-cell-style="{background:'#fdfdfd', color: '#666', fontWeight: 400}" class="tableBox active">
|
|
|
- <el-table-column prop="index" label="编号" width="120" align="center"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column prop="index" label="编号" width="150" align="center"></el-table-column>
|
|
|
<el-table-column prop="name" label="名称" align="center"></el-table-column>
|
|
<el-table-column prop="name" label="名称" align="center"></el-table-column>
|
|
|
- <el-table-column prop="price" label="单价" width="180" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="count" label="数量" width="180" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="commodityMoney" label="金额" width="180" align="center"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column prop="price" label="单价" width="210" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="big" label="数量" width="210" align="center"></el-table-column>
|
|
|
|
|
+ <el-table-column prop="totalMoney" label="金额" width="210" align="center"></el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="seek-list-box" v-if="getItemList!=''">
|
|
<div class="seek-list-box" v-if="getItemList!=''">
|
|
@@ -278,7 +278,8 @@ export default {
|
|
|
self.priceAmend = 0;
|
|
self.priceAmend = 0;
|
|
|
self.priceAmend = self.tableData[self.tableDataIndex].price;
|
|
self.priceAmend = self.tableData[self.tableDataIndex].price;
|
|
|
self.$nextTick(()=>{
|
|
self.$nextTick(()=>{
|
|
|
- self.$refs['priceInput'].focus();
|
|
|
|
|
|
|
+ self.$refs['priceInput'].focus()
|
|
|
|
|
+ self.$refs['priceInput'].select()
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -413,35 +414,32 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
enterFun(){
|
|
enterFun(){
|
|
|
- let selectList = this.getItemList[this.getIndex];
|
|
|
|
|
|
|
+ let currentItem = this.getItemList[this.getIndex];
|
|
|
let big = this.big;
|
|
let big = this.big;
|
|
|
let small = this.small;
|
|
let small = this.small;
|
|
|
big==null?Number(0):big;
|
|
big==null?Number(0):big;
|
|
|
- small==null?Number(0):small;
|
|
|
|
|
- if(big<=0 && small<=0){
|
|
|
|
|
|
|
+ if(big<=0){
|
|
|
this.$message({message: '请先输入数量',type: 'warning'});
|
|
this.$message({message: '请先输入数量',type: 'warning'});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- let money = Number(selectList.price) * (Number(big) + Number(small) / Number(selectList.ratio))
|
|
|
|
|
|
|
+ let money = Number(currentItem.price) * (Number(big) + Number(small) / Number(currentItem.ratio))
|
|
|
for (let i=0;i<this.tableData.length;i++){
|
|
for (let i=0;i<this.tableData.length;i++){
|
|
|
- if(this.tableData[i].name==selectList.name){
|
|
|
|
|
|
|
+ if(this.tableData[i].name==currentItem.name){
|
|
|
this.tableData.splice(i,1)
|
|
this.tableData.splice(i,1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
this.tableData.push(
|
|
this.tableData.push(
|
|
|
{
|
|
{
|
|
|
- index:selectList.id,
|
|
|
|
|
- id:selectList.id,
|
|
|
|
|
- name:selectList.name,
|
|
|
|
|
- lv:selectList.rank,
|
|
|
|
|
- unit:selectList.bigUnit+'/'+selectList.smallUnit,
|
|
|
|
|
- count:Number(big)+'/'+Number(small),
|
|
|
|
|
|
|
+ index:currentItem.id,
|
|
|
|
|
+ id:currentItem.id,
|
|
|
|
|
+ name:currentItem.name,
|
|
|
|
|
+ lv:currentItem.rank,
|
|
|
|
|
+ unit:currentItem.bigUnit+'/'+currentItem.smallUnit,
|
|
|
big:Number(big),
|
|
big:Number(big),
|
|
|
- small:Number(small),
|
|
|
|
|
- ratio:Number(selectList.ratio),
|
|
|
|
|
- stock:Number(selectList.stock),
|
|
|
|
|
- price:selectList.price,
|
|
|
|
|
- commodityMoney:money.toFixed(2),
|
|
|
|
|
|
|
+ ratio:Number(currentItem.ratio),
|
|
|
|
|
+ stock:Number(currentItem.stock),
|
|
|
|
|
+ price:currentItem.price,
|
|
|
|
|
+ totalMoney:money.toFixed(2),
|
|
|
money:money,
|
|
money:money,
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
@@ -487,47 +485,47 @@ export default {
|
|
|
this.$message({message: '请输入大于0的值',type: 'warning'});
|
|
this.$message({message: '请输入大于0的值',type: 'warning'});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- let selectList = this.tableData[this.tableDataIndex];
|
|
|
|
|
|
|
+ let currentItem = this.tableData[this.tableDataIndex];
|
|
|
this.tableData[this.tableDataIndex].price = this.priceAmend;
|
|
this.tableData[this.tableDataIndex].price = this.priceAmend;
|
|
|
- let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
|
|
|
|
|
|
|
+ let money = Number(currentItem.price) * (Number(currentItem.big) + Number(currentItem.small) / Number(currentItem.ratio));
|
|
|
this.tableData[this.tableDataIndex].money = money;
|
|
this.tableData[this.tableDataIndex].money = money;
|
|
|
- this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2);
|
|
|
|
|
|
|
+ this.tableData[this.tableDataIndex].totalMoney = money.toFixed(2);
|
|
|
this.priceAmend = 0;
|
|
this.priceAmend = 0;
|
|
|
this.escFun();
|
|
this.escFun();
|
|
|
},
|
|
},
|
|
|
addSelectBig(){
|
|
addSelectBig(){
|
|
|
- let selectList = this.tableData[this.tableDataIndex];
|
|
|
|
|
- // if(Number(selectList.stock)<Number(selectList.big+1) + Number(selectList.small) / Number(selectList.ratio)){
|
|
|
|
|
|
|
+ let currentItem = this.tableData[this.tableDataIndex];
|
|
|
|
|
+ // if(Number(currentItem.stock)<Number(currentItem.big+1) + Number(currentItem.small) / Number(currentItem.ratio)){
|
|
|
// this.$message({message: '库存不足',type: 'warning'});
|
|
// this.$message({message: '库存不足',type: 'warning'});
|
|
|
// return;
|
|
// return;
|
|
|
// }
|
|
// }
|
|
|
this.tableData[this.tableDataIndex].big++
|
|
this.tableData[this.tableDataIndex].big++
|
|
|
- let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
|
|
|
|
|
|
|
+ let money = Number(currentItem.price) * (Number(currentItem.big) + Number(currentItem.small) / Number(currentItem.ratio));
|
|
|
this.tableData[this.tableDataIndex].count = this.tableData[this.tableDataIndex].big+'/'+Number(this.tableData[this.tableDataIndex].small);
|
|
this.tableData[this.tableDataIndex].count = this.tableData[this.tableDataIndex].big+'/'+Number(this.tableData[this.tableDataIndex].small);
|
|
|
this.tableData[this.tableDataIndex].money = money;
|
|
this.tableData[this.tableDataIndex].money = money;
|
|
|
- this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2),
|
|
|
|
|
|
|
+ this.tableData[this.tableDataIndex].totalMoney = money.toFixed(2),
|
|
|
this.getAllTableDataMoney();
|
|
this.getAllTableDataMoney();
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
this.searchVal = '';
|
|
this.searchVal = '';
|
|
|
},100)
|
|
},100)
|
|
|
},
|
|
},
|
|
|
minusSelectBig(){
|
|
minusSelectBig(){
|
|
|
- let selectList = this.tableData[this.tableDataIndex];
|
|
|
|
|
|
|
+ let currentItem = this.tableData[this.tableDataIndex];
|
|
|
if(this.tableData[this.tableDataIndex].big==1){
|
|
if(this.tableData[this.tableDataIndex].big==1){
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
this.searchVal = '';
|
|
this.searchVal = '';
|
|
|
},100)
|
|
},100)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- // if(Number(selectList.stock)<Number(selectList.big-1) + Number(selectList.small) / Number(selectList.ratio)){
|
|
|
|
|
|
|
+ // if(Number(currentItem.stock)<Number(currentItem.big-1) + Number(currentItem.small) / Number(currentItem.ratio)){
|
|
|
// this.$message({message: '库存不足',type: 'warning'});
|
|
// this.$message({message: '库存不足',type: 'warning'});
|
|
|
// return;
|
|
// return;
|
|
|
// }
|
|
// }
|
|
|
this.tableData[this.tableDataIndex].big--
|
|
this.tableData[this.tableDataIndex].big--
|
|
|
- let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
|
|
|
|
|
|
|
+ let money = Number(currentItem.price) * (Number(currentItem.big) + Number(currentItem.small) / Number(currentItem.ratio));
|
|
|
this.tableData[this.tableDataIndex].count = this.tableData[this.tableDataIndex].big+'/'+Number(this.tableData[this.tableDataIndex].small);
|
|
this.tableData[this.tableDataIndex].count = this.tableData[this.tableDataIndex].big+'/'+Number(this.tableData[this.tableDataIndex].small);
|
|
|
this.tableData[this.tableDataIndex].money = money;
|
|
this.tableData[this.tableDataIndex].money = money;
|
|
|
- this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2),
|
|
|
|
|
|
|
+ this.tableData[this.tableDataIndex].totalMoney = money.toFixed(2),
|
|
|
this.getAllTableDataMoney();
|
|
this.getAllTableDataMoney();
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
this.searchVal = '';
|
|
this.searchVal = '';
|