|
|
@@ -27,22 +27,24 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="seek-list-box" v-if="seekList!=''">
|
|
|
- <el-table ref="seekList" :data="seekList" highlight-current-row style="width: 100%" border :header-cell-style="{background:'#fdfdfd', color: '#666'}" class="tableBox active">
|
|
|
- <el-table-column prop="itemName" label="图片" align="center"></el-table-column>
|
|
|
- <el-table-column prop="itemName" label="名称" align="center"></el-table-column>
|
|
|
+ <el-table ref="showItemRef" :data="seekList" highlight-current-row style="width:100%" border :header-cell-style="{background:'#fdfdfd', color: '#666'}" class="tableBox active">
|
|
|
+ <el-table-column prop="cover" label="图片" align="center" width="180">
|
|
|
+ <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="price" label="价格" width="180" align="center"></el-table-column>
|
|
|
<el-table-column prop="stock" label="库存" width="180" align="center"></el-table-column>
|
|
|
<el-table-column prop="bigUnit" label="单位" width="180" align="center"></el-table-column>
|
|
|
- <el-table-column prop="price" label="单价" width="180" align="center"></el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<div class="bottom_input">
|
|
|
- <span style="margin-right:10px;font-weight: 700;">花材</span>
|
|
|
- <el-input style="width: 280px;font-size:13px" @keyup.enter.native="enterSeekFun()" 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>
|
|
|
- <div style="display: inline-block;" class="allPrice active">
|
|
|
- </div>
|
|
|
+ <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>
|
|
|
+ <div style="display: inline-block;" class="allPrice active"></div>
|
|
|
</div>
|
|
|
<el-dialog title="选择花材" v-if="isSelectNumber" :visible.sync="isSelectNumber" width="30%" center>
|
|
|
<div class="el-dialog-center">
|
|
|
@@ -200,7 +202,6 @@ export default {
|
|
|
small:null,//小单位(支)
|
|
|
totalMoney:0,//总价
|
|
|
modifyPrice:0,//实际收款
|
|
|
- allList:'',
|
|
|
seekVal:'',//搜索值
|
|
|
seekOldVal:'',//上一次搜索值
|
|
|
seekListIndex:0,
|
|
|
@@ -214,7 +215,7 @@ export default {
|
|
|
printSelectList:'',
|
|
|
orderMsg:'',
|
|
|
number: 0,
|
|
|
- customId:0,
|
|
|
+ customId:1,
|
|
|
customInfoList:[],
|
|
|
loading: false,
|
|
|
selectCustomName:''
|
|
|
@@ -224,12 +225,11 @@ export default {
|
|
|
|
|
|
},
|
|
|
mounted() {
|
|
|
-
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.customref.focus()
|
|
|
- })
|
|
|
-
|
|
|
- this.getAllList()
|
|
|
+ if(this.customId == 0){
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.customref.focus()
|
|
|
+ })
|
|
|
+ }
|
|
|
let self = this;
|
|
|
document.onkeydown=function(e) {
|
|
|
console.log(e)
|
|
|
@@ -289,7 +289,6 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
self.isAccounts = true;
|
|
|
-
|
|
|
if(self.$util.isEmpty(self.allShopList)){
|
|
|
self.getShopAll();
|
|
|
}else{
|
|
|
@@ -337,11 +336,6 @@ export default {
|
|
|
}
|
|
|
return todaty
|
|
|
},
|
|
|
- getAllList(){
|
|
|
- this.$service.product.list().then(res => {
|
|
|
- this.allList = res.list;
|
|
|
- });
|
|
|
- },
|
|
|
getShopAll(){
|
|
|
this.$service.custom.shopListAll().then(res => {
|
|
|
this.allShopList = res.list;
|
|
|
@@ -375,38 +369,21 @@ export default {
|
|
|
printOrder() {
|
|
|
|
|
|
},
|
|
|
- async enterSeekFun(){
|
|
|
+ async searchItemFn(){
|
|
|
if(this.seekVal==''){
|
|
|
this.isSeek = false
|
|
|
return
|
|
|
}
|
|
|
- if(this.seekVal == this.seekOldVal && this.seekList != ''){
|
|
|
- // if(Number(this.seekList[this.seekListIndex].stock)==0){
|
|
|
- // this.$message({message: '库存不足',type: 'warning'});
|
|
|
- // return;
|
|
|
- // }
|
|
|
- this.isSeek = false;
|
|
|
- this.isSelectNumber = true;
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs['bigInput'].focus();
|
|
|
- })
|
|
|
- }else{
|
|
|
- this.seekList = [];
|
|
|
- this.seekListIndex = 0;
|
|
|
- this.seekOldVal = this.seekVal;
|
|
|
- this.isSeek = true;
|
|
|
- let list = this.$util.copyObject(this.allList);
|
|
|
- let commonList = list;
|
|
|
- await commonList.forEach(ele => {
|
|
|
- let hasName = ele.itemName && ele.itemName.indexOf(this.seekVal) >= 0;
|
|
|
- let elePy = (ele.py && ele.py.toLocaleUpperCase()) || "";
|
|
|
- let hasPy = elePy.indexOf(this.seekVal.toLocaleUpperCase()) >= 0;
|
|
|
- if (hasName || hasPy) {
|
|
|
- this.seekList.push(ele);
|
|
|
- }
|
|
|
- });
|
|
|
- this.$refs.seekList.setCurrentRow(this.seekList[0]);
|
|
|
- }
|
|
|
+ let that = this
|
|
|
+ this.seekList = [];
|
|
|
+ this.seekListIndex = 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)
|
|
|
+ that.seekList = list
|
|
|
+ })
|
|
|
+ that.$refs.showItemRef.setCurrentRow(that.seekList[0])
|
|
|
},
|
|
|
enterFun(){
|
|
|
let selectList = this.seekList[this.seekListIndex];
|
|
|
@@ -544,7 +521,7 @@ export default {
|
|
|
}else{
|
|
|
this.seekListIndex++;
|
|
|
}
|
|
|
- this.$refs.seekList.setCurrentRow(this.seekList[this.seekListIndex]);
|
|
|
+ this.$ref.showItemRef.setCurrentRow(this.seekList[this.seekListIndex]);
|
|
|
}else{
|
|
|
let tableDataLength = this.tableData.length-1;
|
|
|
if(tableDataLength==this.tableDataIndex){
|
|
|
@@ -563,7 +540,7 @@ export default {
|
|
|
}else{
|
|
|
this.seekListIndex--;
|
|
|
}
|
|
|
- this.$refs.seekList.setCurrentRow(this.seekList[this.seekListIndex]);
|
|
|
+ this.$ref.showItemRef.setCurrentRow(this.seekList[this.seekListIndex]);
|
|
|
}else{
|
|
|
if(this.tableDataIndex==0){
|
|
|
this.tableDataIndex = 0
|
|
|
@@ -572,7 +549,6 @@ export default {
|
|
|
}
|
|
|
this.$refs.singleTable.setCurrentRow(this.tableData[this.tableDataIndex]);
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
freightInput(){
|
|
|
this.totalMoney = Number(this.freight) + this.number
|
|
|
@@ -596,15 +572,6 @@ export default {
|
|
|
line-height: 45px;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-.bottom_input {
|
|
|
- text-align: center;
|
|
|
- .el-form-item {
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|
|
|
-<style lang="scss" scoped>
|
|
|
.app-list-content {
|
|
|
position: relative;
|
|
|
|
|
|
@@ -646,6 +613,7 @@ export default {
|
|
|
.bottom_input {
|
|
|
position: absolute;
|
|
|
bottom: 18px;
|
|
|
+ width:100%;
|
|
|
text-align: center;
|
|
|
.allPrice {
|
|
|
margin-left:50px;
|