|
@@ -16,12 +16,27 @@
|
|
|
<span>删除:Delete</span>
|
|
<span>删除:Delete</span>
|
|
|
<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: '#01060a', fontWeight:800}" class="tableBox active">
|
|
|
|
|
- <el-table-column prop="index" label="编号" width="190" align="center"></el-table-column>
|
|
|
|
|
|
|
+ <el-table ref="singleTable" :data="tableData" highlight-current-row style="width:95%" border :header-cell-style="{background:'#fdfdfd', color: '#01060a', fontWeight:800}" class="tableBox active">
|
|
|
|
|
+ <el-table-column prop="index" label="编号" width="120" align="center"></el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column prop="cover" label="图片" align="center" width="130">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <img :src="scope.row.cover" style="width:40px;margin:0 auto;" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </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="250" align="center"></el-table-column>
|
|
<el-table-column prop="price" label="单价" width="250" align="center"></el-table-column>
|
|
|
<el-table-column prop="big" label="数量" width="250" align="center"></el-table-column>
|
|
<el-table-column prop="big" label="数量" width="250" align="center"></el-table-column>
|
|
|
- <el-table-column prop="totalMoney" label="金额" width="250" align="center"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column prop="totalAmount" label="金额" width="250" align="center"></el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column prop="ratioType" label="单位比" align="center" width="180">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.ratioType == 0">{{ scope.row.ratio }}{{ scope.row.smallUnit }}/{{ scope.row.bigUnit }}</span>
|
|
|
|
|
+ <span v-else>若干{{ scope.row.smallUnit }}/{{ scope.row.bigUnit }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </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!=''">
|
|
@@ -39,17 +54,17 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="bottom_input">
|
|
<div class="bottom_input">
|
|
|
<span style="margin-right:10px;font-weight: 700;">花材</span>
|
|
<span style="margin-right:10px;font-weight: 700;">花材</span>
|
|
|
- <el-input style="width: 280px;font-size:13px" @input="beginSearchItem" @keyup.enter.native="confirmCurrentItem" @focus="clearSeachVal" placeholder="这里搜索,光标插入 Ctrl + Q" type="text" ref="itemSearchRef" v-model="searchVal"></el-input>
|
|
|
|
|
- <div style="display: inline-block;" class="allPrice">总金额:¥{{ parseFloat(totalMoney.toFixed(2)) }}</div>
|
|
|
|
|
- <div style="display: inline-block;" class="allPrice">总数量:{{tableData.length}}</div>
|
|
|
|
|
|
|
+ <el-input style="width: 280px;font-size:13px" @input="beginSearchItem" @keyup.enter.native="selectCurrentItem" @focus="clearSeachVal" placeholder="这里搜索,光标插入 Ctrl + Q" type="text" ref="itemSearchRef" v-model="searchVal"></el-input>
|
|
|
|
|
+ <div style="display: inline-block;" class="allPrice">{{tableData.length}}种</div>
|
|
|
|
|
+ <div style="display: inline-block;" class="allPrice">¥{{ totalMoney }}</div>
|
|
|
<div style="display: inline-block;" class="allPrice active"></div>
|
|
<div style="display: inline-block;" class="allPrice active"></div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<el-dialog :title="getItemList[getIndex].name" v-if="showConfirmNum" :visible.sync="showConfirmNum" width="30%" center>
|
|
<el-dialog :title="getItemList[getIndex].name" v-if="showConfirmNum" :visible.sync="showConfirmNum" width="30%" center>
|
|
|
<div class="el-dialog-center">
|
|
<div class="el-dialog-center">
|
|
|
- <el-input ref="bigInput" style="width: 130px;margin-left: 15px" placeholder="数量" @keyup.key-backspace.native="backspaceFun('big')" @keyup.enter.native="enterFun()" type="number" v-model="big"></el-input>
|
|
|
|
|
|
|
+ <el-input ref="bigInput" style="width: 130px;margin-left: 15px" placeholder="数量" @keyup.key-backspace.native="backspaceFun('big')" @keyup.enter.native="confirmNumPrice()" type="number" v-model="big"></el-input>
|
|
|
<span>{{getItemList[getIndex].bigUnit}}</span>
|
|
<span>{{getItemList[getIndex].bigUnit}}</span>
|
|
|
- <el-input style="width: 130px;margin-left: 15px" placeholder="价格" @keyup.key-backspace.native="backspaceFun('price')" @keyup.enter.native="enterFun()" type="number" v-model="price"></el-input>
|
|
|
|
|
|
|
+ <el-input style="width: 130px;margin-left: 15px" placeholder="价格" @keyup.key-backspace.native="backspaceFun('price')" @keyup.enter.native="confirmNumPrice()" type="number" v-model="price"></el-input>
|
|
|
<span>元</span>
|
|
<span>元</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="remark">Enter 确定,Backspace 清0,Esc 取消</div>
|
|
<div class="remark">Enter 确定,Backspace 清0,Esc 取消</div>
|
|
@@ -377,7 +392,7 @@ export default {
|
|
|
this.searchVal = ''
|
|
this.searchVal = ''
|
|
|
this.getItemList = []
|
|
this.getItemList = []
|
|
|
},
|
|
},
|
|
|
- confirmCurrentItem(){
|
|
|
|
|
|
|
+ selectCurrentItem(){
|
|
|
this.big = 1
|
|
this.big = 1
|
|
|
this.price = this.getItemList[this.getIndex].price
|
|
this.price = this.getItemList[this.getIndex].price
|
|
|
this.isSeek = false;
|
|
this.isSeek = false;
|
|
@@ -418,18 +433,16 @@ export default {
|
|
|
that.$refs.showItemRef.setCurrentRow(that.getItemList[0])
|
|
that.$refs.showItemRef.setCurrentRow(that.getItemList[0])
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- enterFun(){
|
|
|
|
|
|
|
+ confirmNumPrice(){
|
|
|
let currentItem = this.getItemList[this.getIndex];
|
|
let currentItem = this.getItemList[this.getIndex];
|
|
|
- let big = this.big;
|
|
|
|
|
- let small = this.small;
|
|
|
|
|
- big==null?Number(0):big;
|
|
|
|
|
|
|
+ let big = this.big == null ? 0 : Number(this.big)
|
|
|
if(big<=0){
|
|
if(big<=0){
|
|
|
this.$message({message: '请先输入数量',type: 'warning'});
|
|
this.$message({message: '请先输入数量',type: 'warning'});
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
let money = Number(currentItem.price) * Number(big)
|
|
let money = Number(currentItem.price) * Number(big)
|
|
|
for (let i=0;i<this.tableData.length;i++){
|
|
for (let i=0;i<this.tableData.length;i++){
|
|
|
- if(this.tableData[i].name==currentItem.name){
|
|
|
|
|
|
|
+ if(this.tableData[i].id == currentItem.id){
|
|
|
this.tableData.splice(i,1)
|
|
this.tableData.splice(i,1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -438,14 +451,15 @@ export default {
|
|
|
index:currentItem.id,
|
|
index:currentItem.id,
|
|
|
id:currentItem.id,
|
|
id:currentItem.id,
|
|
|
name:currentItem.name,
|
|
name:currentItem.name,
|
|
|
- lv:currentItem.rank,
|
|
|
|
|
- unit:currentItem.bigUnit+'/'+currentItem.smallUnit,
|
|
|
|
|
- big:Number(big),
|
|
|
|
|
|
|
+ cover:currentItem.cover,
|
|
|
|
|
+ big:parseFloat(Number(big)),
|
|
|
ratio:Number(currentItem.ratio),
|
|
ratio:Number(currentItem.ratio),
|
|
|
- stock:Number(currentItem.stock),
|
|
|
|
|
- price:currentItem.price,
|
|
|
|
|
- totalMoney:money.toFixed(2),
|
|
|
|
|
- money:money,
|
|
|
|
|
|
|
+ ratioType:currentItem.ratioType,
|
|
|
|
|
+ bigUnit:currentItem.bigUnit,
|
|
|
|
|
+ smallUnit:currentItem.smallUnit,
|
|
|
|
|
+ stock:parseFloat(Number(currentItem.stock)),
|
|
|
|
|
+ price:parseFloat(Number(currentItem.price)),
|
|
|
|
|
+ totalAmount:money.toFixed(2)
|
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
this.tableDataIndex = this.tableData.length-1;
|
|
this.tableDataIndex = this.tableData.length-1;
|
|
@@ -459,9 +473,10 @@ export default {
|
|
|
getAllTableDataMoney(){
|
|
getAllTableDataMoney(){
|
|
|
let totalMoney = 0;
|
|
let totalMoney = 0;
|
|
|
this.tableData.forEach(ele => {
|
|
this.tableData.forEach(ele => {
|
|
|
- totalMoney= totalMoney + ele.money
|
|
|
|
|
|
|
+ totalMoney= totalMoney + ele.totalAmount
|
|
|
})
|
|
})
|
|
|
- this.totalMoney = totalMoney;
|
|
|
|
|
|
|
+ totalMoney = Number(totalMoney)
|
|
|
|
|
+ this.totalMoney = parseFloat(totalMoney.toFixed(2))
|
|
|
this.number = this.totalMoney
|
|
this.number = this.totalMoney
|
|
|
this.modifyPrice = this.totalMoney;
|
|
this.modifyPrice = this.totalMoney;
|
|
|
},
|
|
},
|