|
@@ -18,12 +18,10 @@
|
|
|
</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="120" align="center"></el-table-column>
|
|
|
- <el-table-column prop="name" label="名称" width="180" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="lv" label="等级" width="180" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="unit" label="单位" width="120" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="count" label="数量" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="price" label="单价" align="center"></el-table-column>
|
|
|
|
|
- <el-table-column prop="commodityMoney" 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>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="seek-list-box" v-if="getItemList!=''">
|
|
<div class="seek-list-box" v-if="getItemList!=''">
|
|
@@ -41,20 +39,20 @@
|
|
|
</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" @keyup.enter.native="searchItemFn()" placeholder="这里搜索,光标插入 Ctrl + Q" type="text" ref="itemSearchRef" v-model="seekVal"></el-input>
|
|
|
|
|
- <div style="display: inline-block;" class="allPrice">总金额: {{ 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="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>
|
|
|
<div style="display: inline-block;" class="allPrice active"></div>
|
|
<div style="display: inline-block;" class="allPrice active"></div>
|
|
|
</div>
|
|
</div>
|
|
|
- <el-dialog title="选择花材" 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">
|
|
|
- <span>{{ getItemList[getIndex].itemName }}</span>
|
|
|
|
|
- <el-input ref="bigInput" style="width: 130px;margin-left: 15px" placeholder="0" @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="enterFun()" 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="0" @keyup.key-backspace.native="backspaceFun('small')" @keyup.enter.native="enterFun()" type="number" v-model="small"></el-input>
|
|
|
|
|
- <span>{{ getItemList[getIndex].smallUnit }}</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>
|
|
|
|
|
+ <span>元</span>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="remark">Enter 确定,数字键 改数量,Backspace 清0,Enter 确定,Esc 取消</div>
|
|
|
|
|
|
|
+ <div class="remark">Enter 确定,Backspace 清0,Esc 取消</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<el-dialog title="改价" v-if="isAmendPrice" :visible.sync="isAmendPrice" width="30%" center>
|
|
<el-dialog title="改价" v-if="isAmendPrice" :visible.sync="isAmendPrice" width="30%" center>
|
|
@@ -63,7 +61,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
- <el-dialog title="结账" v-if="isAccounts" :visible.sync="isAccounts" width="573px" center>
|
|
|
|
|
|
|
+ <el-dialog title="确认提交" v-if="isAccounts" :visible.sync="isAccounts" width="573px" center>
|
|
|
<div class="">
|
|
<div class="">
|
|
|
<div class="accounts-list">
|
|
<div class="accounts-list">
|
|
|
客户
|
|
客户
|
|
@@ -136,7 +134,6 @@
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
|
<div class="print-html">
|
|
<div class="print-html">
|
|
|
-
|
|
|
|
|
<table border="0" width="780" style="border:solid 1px #fff;border-collapse:collapse">
|
|
<table border="0" width="780" style="border:solid 1px #fff;border-collapse:collapse">
|
|
|
<tr>
|
|
<tr>
|
|
|
<td style="padding: 0 10px;width: 260px;">客户:{{orderMsg.customName}}</td>
|
|
<td style="padding: 0 10px;width: 260px;">客户:{{orderMsg.customName}}</td>
|
|
@@ -182,6 +179,7 @@
|
|
|
</tr>
|
|
</tr>
|
|
|
</table>
|
|
</table>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
@@ -199,11 +197,12 @@ export default {
|
|
|
priceAmend:0,//修改单价弹窗
|
|
priceAmend:0,//修改单价弹窗
|
|
|
isSeek:false,
|
|
isSeek:false,
|
|
|
big:null,//大单位(扎)
|
|
big:null,//大单位(扎)
|
|
|
- small:null,//小单位(支)
|
|
|
|
|
|
|
+ small:null,//小单位(支
|
|
|
|
|
+ price:null,
|
|
|
totalMoney:0,//总价
|
|
totalMoney:0,//总价
|
|
|
modifyPrice:0,//实际收款
|
|
modifyPrice:0,//实际收款
|
|
|
- seekVal:'',//搜索值
|
|
|
|
|
- seekOldVal:'',//上一次搜索值
|
|
|
|
|
|
|
+ searchVal:'',//搜索值
|
|
|
|
|
+ searchOldVal:'',//上一次搜索值
|
|
|
getIndex:0,
|
|
getIndex:0,
|
|
|
getItemList:[],//搜索展示的列表
|
|
getItemList:[],//搜索展示的列表
|
|
|
tableDataIndex:0,
|
|
tableDataIndex:0,
|
|
@@ -218,7 +217,8 @@ export default {
|
|
|
customId:1,
|
|
customId:1,
|
|
|
customInfoList:[],
|
|
customInfoList:[],
|
|
|
loading: false,
|
|
loading: false,
|
|
|
- selectCustomName:''
|
|
|
|
|
|
|
+ selectCustomName:'',
|
|
|
|
|
+ t:null
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
created() {
|
|
created() {
|
|
@@ -232,13 +232,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
let self = this;
|
|
let self = this;
|
|
|
document.onkeydown=function(e) {
|
|
document.onkeydown=function(e) {
|
|
|
- console.log(e)
|
|
|
|
|
if(e && e.key == 'Enter' && e.ctrlKey ){
|
|
if(e && e.key == 'Enter' && e.ctrlKey ){
|
|
|
if(self.isAccounts){
|
|
if(self.isAccounts){
|
|
|
self.isAccounts = false
|
|
self.isAccounts = false
|
|
|
self.createOrder();
|
|
self.createOrder();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if(e && e.key == 'Enter'){
|
|
|
|
|
+ }
|
|
|
if(e && e.key && e.key.toLowerCase() =='c' && e.ctrlKey ){
|
|
if(e && e.key && e.key.toLowerCase() =='c' && e.ctrlKey ){
|
|
|
self.$refs['customref'].focus();
|
|
self.$refs['customref'].focus();
|
|
|
}
|
|
}
|
|
@@ -367,33 +368,48 @@ export default {
|
|
|
},
|
|
},
|
|
|
printOrder() {
|
|
printOrder() {
|
|
|
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ clearSeachVal(){
|
|
|
|
|
+ this.searchVal = ''
|
|
|
|
|
+ this.getItemList = []
|
|
|
|
|
+ },
|
|
|
|
|
+ confirmCurrentItem(){
|
|
|
|
|
+ this.big = 1
|
|
|
|
|
+ this.price = this.getItemList[this.getIndex].price
|
|
|
|
|
+ this.isSeek = false;
|
|
|
|
|
+ this.showConfirmNum = true;
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
|
+ this.$refs['bigInput'].focus()
|
|
|
|
|
+ this.$refs['bigInput'].select()
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ beginSearchItem(){
|
|
|
|
|
+ let that = this
|
|
|
|
|
+ if(this.t!=null){
|
|
|
|
|
+ clearTimeout(this.t)
|
|
|
|
|
+ }
|
|
|
|
|
+ this.t = setTimeout(function(){
|
|
|
|
|
+ that.searchItemFn()
|
|
|
|
|
+ },300)
|
|
|
},
|
|
},
|
|
|
async searchItemFn(){
|
|
async searchItemFn(){
|
|
|
- if(this.seekVal==''){
|
|
|
|
|
|
|
+ if(this.searchVal==''){
|
|
|
this.isSeek = false
|
|
this.isSeek = false
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
let that = this
|
|
let that = this
|
|
|
- if(this.seekVal == this.seekOldVal && this.seekList != ''){
|
|
|
|
|
- this.isSeek = false;
|
|
|
|
|
- this.showConfirmNum = true;
|
|
|
|
|
- this.$nextTick(()=>{
|
|
|
|
|
- this.$refs['bigInput'].focus();
|
|
|
|
|
- })
|
|
|
|
|
- }else{
|
|
|
|
|
- this.getItemList = [];
|
|
|
|
|
- this.getIndex = 0;
|
|
|
|
|
- this.seekOldVal = this.seekVal;
|
|
|
|
|
- this.isSeek = true;
|
|
|
|
|
- await this.$service.item.getItemList({search:this.seekVal,requestType:'kd',pageSize:6}).then(res=>{
|
|
|
|
|
- let list = this.$util.copyObject(res.list)
|
|
|
|
|
- if(!that.$util.isEmpty(list)){
|
|
|
|
|
- that.getItemList = list
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- if(!that.$util.isEmpty(that.getItemList)){
|
|
|
|
|
- that.$refs.showItemRef.setCurrentRow(that.getItemList[0])
|
|
|
|
|
|
|
+ this.getItemList = [];
|
|
|
|
|
+ this.getIndex = 0;
|
|
|
|
|
+ this.searchOldVal = this.searchVal;
|
|
|
|
|
+ this.isSeek = true;
|
|
|
|
|
+ await this.$service.item.getItemList({search:this.searchVal,requestType:'kd',pageSize:6}).then(res=>{
|
|
|
|
|
+ let list = this.$util.copyObject(res.list)
|
|
|
|
|
+ if(!that.$util.isEmpty(list)){
|
|
|
|
|
+ that.getItemList = list
|
|
|
}
|
|
}
|
|
|
|
|
+ })
|
|
|
|
|
+ if(!that.$util.isEmpty(that.getItemList)){
|
|
|
|
|
+ that.$refs.showItemRef.setCurrentRow(that.getItemList[0])
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
enterFun(){
|
|
enterFun(){
|
|
@@ -408,7 +424,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
let money = Number(selectList.price) * (Number(big) + Number(small) / Number(selectList.ratio))
|
|
let money = Number(selectList.price) * (Number(big) + Number(small) / Number(selectList.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.itemName){
|
|
|
|
|
|
|
+ if(this.tableData[i].name==selectList.name){
|
|
|
this.tableData.splice(i,1)
|
|
this.tableData.splice(i,1)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -416,7 +432,7 @@ export default {
|
|
|
{
|
|
{
|
|
|
index:selectList.id,
|
|
index:selectList.id,
|
|
|
id:selectList.id,
|
|
id:selectList.id,
|
|
|
- name:selectList.itemName,
|
|
|
|
|
|
|
+ name:selectList.name,
|
|
|
lv:selectList.rank,
|
|
lv:selectList.rank,
|
|
|
unit:selectList.bigUnit+'/'+selectList.smallUnit,
|
|
unit:selectList.bigUnit+'/'+selectList.smallUnit,
|
|
|
count:Number(big)+'/'+Number(small),
|
|
count:Number(big)+'/'+Number(small),
|
|
@@ -449,7 +465,7 @@ export default {
|
|
|
escFun(){
|
|
escFun(){
|
|
|
this.getAllTableDataMoney();
|
|
this.getAllTableDataMoney();
|
|
|
this.isAmendPrice = false;
|
|
this.isAmendPrice = false;
|
|
|
- this.seekVal = '';
|
|
|
|
|
|
|
+ this.searchVal = '';
|
|
|
this.getItemList = [];
|
|
this.getItemList = [];
|
|
|
this.showConfirmNum = false
|
|
this.showConfirmNum = false
|
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
@@ -461,8 +477,8 @@ export default {
|
|
|
case 'big':
|
|
case 'big':
|
|
|
this.big = null;
|
|
this.big = null;
|
|
|
break;
|
|
break;
|
|
|
- case 'small':
|
|
|
|
|
- this.small = null;
|
|
|
|
|
|
|
+ case 'price':
|
|
|
|
|
+ this.price = null;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -492,14 +508,14 @@ export default {
|
|
|
this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2),
|
|
this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2),
|
|
|
this.getAllTableDataMoney();
|
|
this.getAllTableDataMoney();
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
- this.seekVal = '';
|
|
|
|
|
|
|
+ this.searchVal = '';
|
|
|
},100)
|
|
},100)
|
|
|
},
|
|
},
|
|
|
minusSelectBig(){
|
|
minusSelectBig(){
|
|
|
let selectList = this.tableData[this.tableDataIndex];
|
|
let selectList = this.tableData[this.tableDataIndex];
|
|
|
if(this.tableData[this.tableDataIndex].big==1){
|
|
if(this.tableData[this.tableDataIndex].big==1){
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
- this.seekVal = '';
|
|
|
|
|
|
|
+ this.searchVal = '';
|
|
|
},100)
|
|
},100)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -512,9 +528,9 @@ export default {
|
|
|
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].commodityMoney = money.toFixed(2),
|
|
|
- this.getAllTableDataMoney();
|
|
|
|
|
|
|
+ this.getAllTableDataMoney();
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
|
- this.seekVal = '';
|
|
|
|
|
|
|
+ this.searchVal = '';
|
|
|
},100)
|
|
},100)
|
|
|
},
|
|
},
|
|
|
tableDataDown(){
|
|
tableDataDown(){
|