shish 2 лет назад
Родитель
Сommit
3a413d514e
1 измененных файлов с 21 добавлено и 21 удалено
  1. 21 21
      ghs/src/views/order/add.vue

+ 21 - 21
ghs/src/views/order/add.vue

@@ -51,16 +51,12 @@
         <el-table-column prop="name" label="名称" align="center"></el-table-column>
         <el-table-column prop="price" label="价格" width="100" align="center"></el-table-column>
         <el-table-column prop="stock" label="库存" width="100" align="center"></el-table-column>
-
-
         <el-table-column prop="ratioType" label="单位比" align="center" width="150">
           <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>
     </div>
     <div class="bottom_input">
@@ -83,7 +79,7 @@
       <div class="remark">Enter 确定,Backspace 清0,Esc 取消</div>
     </el-dialog>
 
-    <el-dialog title="改价" v-if="isAmendPrice" :visible.sync="isAmendPrice" width="30%" center>
+    <el-dialog title="改价" v-if="clearPop" :visible.sync="clearPop" width="30%" center>
       <div class="el-dialog-center">
         <el-input ref="priceInput" style="width: 130px;margin-left: 15px" type="number" placeholder="0" @keyup.enter.native="amendPrice" @keyup.key-backspace.native="priceAmend = ''" v-model="priceAmend"></el-input>
       </div>
@@ -242,10 +238,10 @@ export default {
       type:'自提',//取货方式
       payType:'欠款',//结算方式
       showConfirmNum:false,//选择扎和支的弹窗
-      isAmendPrice:false,//修改单价弹窗
+      clearPop:false,//修改单价弹窗
       showCommitPop:false,//结账弹窗
       priceAmend:0,//修改单价弹窗
-      isSeek:false,
+      desk:'',//操作桌面
       totalMoney:0,//总价
       modifyPrice:0,//实际收款
       searchVal:'',//搜索值
@@ -336,7 +332,7 @@ export default {
       if( e && e.key=='-'){
         that.form.needPrint = 1
       }
-      if(e && e.key=='Delete' && e.ctrlKey){
+      if(e && e.key=='Delete'){
         that.selectList.splice(that.selectIndex, 1);
         that.$refs.singleTable.setCurrentRow(that.selectList[0]);
       }
@@ -348,7 +344,7 @@ export default {
           that.showCommitPop = false;
           return;
         }
-        that.escFun();
+        that.backToSearchItem();
       }
       if( e && e.key=='F9' ){
         if(that.$util.isEmpty(that.selectList)){
@@ -413,6 +409,7 @@ export default {
     },
     searchSelectCustom(e){
       if(e.id && e.name){
+        this.desk = 'selectedList'
         this.form.customId = e.id
         this.form.customName = e.name
         this.selectJobId = e.id
@@ -505,7 +502,7 @@ export default {
               that.removeFromSaveDirect()
               that.showCommitPop = false;
               that.$notify({ title: '成功', message: '开单成功', type: 'success'})
-              that.escFun()
+              that.backToSearchItem()
               setTimeout(function(){
                 that.formReset()
               },900)
@@ -538,7 +535,7 @@ export default {
         this.currentItem = currentItem
         this.customData.bigCount = 1
         this.customData.userPrice = parseFloat(this.currentItem.price)
-        this.isSeek = false;
+        this.desk = 'confirmNumPrice';
         this.showGetItemList = false
         this.showConfirmNum = true;
         this.$nextTick(()=>{
@@ -566,14 +563,14 @@ export default {
       if(this.searchVal==''){
         this.getItemList = [];
         this.getIndex = 0;
-        this.isSeek = false
+        this.desk = 'selectedList'
         return
       }
       let that = this
       this.getItemList = [];
       this.getIndex = 0;
       this.searchOldVal = this.searchVal;
-      this.isSeek = true;
+      this.desk = 'searchList';
       let hasExists = []
       await this.$service.item.getItemList({search:this.searchVal,requestType:'kd',pageSize:20}).then(res=>{
         let list = this.$util.copyObject(res.list)
@@ -623,10 +620,11 @@ export default {
         this.big = null;
         this.small = null;
       })
-      this.escFun();
+      this.backToSearchItem();
     },
-    escFun(){
-      this.isAmendPrice = false;
+    backToSearchItem(){
+      this.desk = 'selectedList'
+      this.clearPop = false;
       this.searchVal = '';
       this.getItemList = [];
       this.currentItem = {}
@@ -656,10 +654,10 @@ export default {
       this.selectList[this.selectIndex].money = money;
       this.selectList[this.selectIndex].totalMoney = money.toFixed(2);
       this.priceAmend = 0;
-      this.escFun();
+      this.backToSearchItem();
     },
     goDown(){
-      if(this.isSeek){
+      if(this.desk == 'searchList'){
         let selectListLength = this.getItemList.length-1;
         if(selectListLength==this.getIndex){
           this.getIndex = selectListLength
@@ -667,7 +665,8 @@ export default {
           this.getIndex++;
         }
         this.$refs.showItemRef.setCurrentRow(this.getItemList[this.getIndex]);
-      }else{
+      }
+      if(this.desk == 'selectedList'){
         let selectListLength = this.selectList.length-1;
         if(selectListLength==this.selectIndex){
           this.selectIndex = selectListLength
@@ -678,14 +677,15 @@ export default {
       }
     },
     goUp(){
-      if(this.isSeek){
+      if(this.desk == 'searchList'){
         if(this.getIndex==0){
           this.getIndex = 0
         }else{
           this.getIndex--;
         }
         this.$refs.showItemRef.setCurrentRow(this.getItemList[this.getIndex]);
-      }else{
+      }
+      if(this.desk == 'selectedList'){
         if(this.selectIndex==0){
           this.selectIndex = 0
         }else{