shish 2 lat temu
rodzic
commit
e456429d52
2 zmienionych plików z 14 dodań i 30 usunięć
  1. 6 4
      ghs/src/mixins/product2.js
  2. 8 26
      ghs/src/views/order/add.vue

+ 6 - 4
ghs/src/mixins/product2.js

@@ -309,17 +309,19 @@ export default {
 			}
 			this.pushToSave(list)
 		},
-		delSelectedItem(product){
+		delItem(product){
 			let item = this.$util.copyObject(product)
 			const list = this.selectList
 			let index = list.findIndex(element => element.id == item.id)
 			if(index != -1){
 				list.splice(index,1)
 			}
+			if(this.$util.isEmpty(list)){
+				this.removeFromSaveDirect()
+			}else{
+				this.pushToSave(list)
+			}
 		},
-		listenScanItem(){
-
-    	},
 		takeItem(code){
 			if(this.$util.isEmpty(code)){
 				return false

+ 8 - 26
ghs/src/views/order/add.vue

@@ -68,14 +68,14 @@
         <el-button type="primary" size="medium" style="margin-left:50px;" @click="comeBack()">返回 Ctrl + B</el-button>
     </div>
 
-    <el-dialog :title="getItemList[getIndex].name" v-if="showConfirmNum" :visible.sync="showConfirmNum" width="30%" center>
+    <el-dialog :title="currentItem.name" v-if="showConfirmNum" :visible.sync="showConfirmNum" width="30%" 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="confirmNumPrice()" type="number" v-model="customData.bigCount"></el-input>
-        <span>{{getItemList[getIndex].bigUnit}}</span>
-        <el-input style="width: 130px;margin-left: 15px" placeholder="价格" @keyup.key-backspace.native="backspaceFun('price')" @keyup.enter.native="confirmNumPrice()" type="number" v-model="customData.userPrice"></el-input>
+        <el-input ref="bigInput" style="width: 130px;margin-left: 15px" placeholder="数量" @keyup.enter.native="confirmNumPrice()" type="number" v-model="customData.bigCount"></el-input>
+        <span>{{currentItem.bigUnit}}</span>
+        <el-input style="width: 130px;margin-left: 15px" placeholder="价格" @keyup.enter.native="confirmNumPrice()" type="number" v-model="customData.userPrice"></el-input>
         <span>元</span>
       </div>
-      <div style="text-align:center;margin:20px 0 5px 0;font-weight:bold;font-size:18px;">剩 {{ getItemList[getIndex].stock ? parseFloat(getItemList[getIndex].stock) : 0 }} {{ getItemList[getIndex].bigUnit}}</div>
+      <div style="text-align:center;margin:20px 0 5px 0;font-weight:bold;font-size:18px;">剩 {{ currentItem.stock ? parseFloat(currentItem.stock) : 0 }} {{ currentItem.bigUnit}}</div>
       <div class="remark">Enter 确定,Backspace 清0,Esc 取消</div>
     </el-dialog>
 
@@ -188,7 +188,7 @@
       </div>
       <div style="text-align:center;margin-top:10px;font-size:16px;" v-if="!$util.isEmpty(diffList)">
         <div style="font-size:16px;margin-bottom:10px;color:red;font-weight:bold;">
-          以下花材,开单价和系统售价不一样,确认要提交吗? <el-button type="primary" @click="diffPriceConfirm" size="mini">确认</el-button>
+          以下花材,开单价和系统售价不一样,确认要提交吗? <el-button type="primary" @click="diffConfirm" size="mini">确认</el-button>
         </div>
         <div v-for="(item, index) in diffList" :key="index" style="color:blue;margin-bottom:4px;">
             {{ item.name }} 系统售价¥{{ item.price }} 你开价<span style="color:red;font-weight:bold;">¥{{ item.kdPrice }}</span>
@@ -431,25 +431,7 @@ export default {
 				this.customInfoList = []
 			}
 		},
-    modifyPriceFun(money){
-      let modifyPrice =  this.$util.copyObject(money)
-      return modifyPrice.toFixed(2);
-    },
-    todays(type) {
-      var myDate = new Date();
-      let todaty = '';
-      if(type==1){
-        todaty = myDate.getFullYear()+'-'+parseInt(myDate.getMonth()+1)+'-'+myDate.getDate()+' '+myDate.getHours()+':'+myDate.getMinutes()+':'+myDate.getSeconds()
-      }else if(type=='time'){
-        todaty = myDate.getHours()+':'+myDate.getMinutes();
-      }else{
-        let getDate = myDate.getDate()>9?myDate.getDate():'0'+myDate.getDate()
-        let getDateMonth = parseInt(myDate.getMonth()+1)>9?parseInt(myDate.getMonth()+1):'0'+parseInt(myDate.getMonth()+1)
-        todaty = myDate.getFullYear()+'-'+getDateMonth+'-'+getDate
-      }
-      return todaty
-    },
-    diffPriceConfirm(){
+    diffConfirm(){
       this.form.dealPrice = 1
       this.createOrder()
     },
@@ -535,7 +517,7 @@ export default {
         this.currentItem = currentItem
         this.customData.bigCount = 1
         this.customData.userPrice = parseFloat(this.currentItem.price)
-        this.desk = 'confirmNumPrice';
+        this.desk = 'confirmPriceNum';
         this.showGetItemList = false
         this.showConfirmNum = true;
         this.$nextTick(()=>{