jf 5 лет назад
Родитель
Сommit
14ce5f9b59
2 измененных файлов с 36 добавлено и 34 удалено
  1. 5 0
      ghs/src/service/custom/index.js
  2. 31 34
      ghs/src/views/order/add.vue

+ 5 - 0
ghs/src/service/custom/index.js

@@ -2,6 +2,11 @@ import { BaseService, Service } from '@/cool';
 
 
 @Service('custom')
 @Service('custom')
 export class CustomService extends BaseService {
 export class CustomService extends BaseService {
+	shopListAll(data) {//姜枫 2021.04.26
+		return this.request({
+			url: '/list',
+		});
+	}
 
 
 }
 }
 export default new CustomService();
 export default new CustomService();

+ 31 - 34
ghs/src/views/order/add.vue

@@ -142,7 +142,7 @@
     <div class="bottom_input">
     <div class="bottom_input">
       <el-form ref="form" label-width="80px" style="display: inline-block">
       <el-form ref="form" label-width="80px" style="display: inline-block">
         <el-form-item label="花材">
         <el-form-item label="花材">
-        <el-input style="width: 200px" @keyup.enter.native="enterSeekFun()" placeholder="请输入名称,支持拼音首字母,按Esc取消" type="text" ref="commodityInput" v-model="seekVal"></el-input></el-form-item>
+          <el-input style="width: 200px" @keyup.enter.native="enterSeekFun()" placeholder="请输入名称,支持拼音首字母,按Esc取消" type="text" ref="commodityInput" v-model="seekVal"></el-input></el-form-item>
       </el-form>
       </el-form>
       <div style="display: inline-block;" class="allPrice">总金额: {{ totalMoney.toFixed(2) }}</div>
       <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">总数量: {{tableData.length}}</div>
@@ -306,7 +306,7 @@ export default {
       remark:'',//备注
       remark:'',//备注
       printSelectList:'',
       printSelectList:'',
       orderMsg:'',
       orderMsg:'',
-  };
+    };
   },
   },
   created() {
   created() {
     this.$nextTick(()=>{
     this.$nextTick(()=>{
@@ -374,9 +374,6 @@ export default {
             self.$refs['priceInput'].focus();
             self.$refs['priceInput'].focus();
           })
           })
         }
         }
-        // console.log('f8')
-        // alert('f8')
-        // self.escFun();
         //要做的事情
         //要做的事情
       }
       }
       if( e && e.keyCode==120 ){   //按下f9
       if( e && e.keyCode==120 ){   //按下f9
@@ -406,13 +403,11 @@ export default {
       }else if(type=='time'){
       }else if(type=='time'){
         todaty = myDate.getHours()+':'+myDate.getMinutes();
         todaty = myDate.getHours()+':'+myDate.getMinutes();
       }else{
       }else{
-        // todaty = myDate.getFullYear()+'-'+parseInt(myDate.getMonth()+1)+'-'+myDate.getDate()
         let getDate = myDate.getDate()>9?myDate.getDate():'0'+myDate.getDate()
         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)
         let getDateMonth = parseInt(myDate.getMonth()+1)>9?parseInt(myDate.getMonth()+1):'0'+parseInt(myDate.getMonth()+1)
         todaty = myDate.getFullYear()+'-'+getDateMonth+'-'+getDate
         todaty = myDate.getFullYear()+'-'+getDateMonth+'-'+getDate
       }
       }
       return todaty
       return todaty
-      // console.log(myDate.getFullYear())
     },
     },
     /**拿到所有数据*/
     /**拿到所有数据*/
     getAllList(){
     getAllList(){
@@ -422,8 +417,8 @@ export default {
     },
     },
     /**获取客户列表**/
     /**获取客户列表**/
     getShopAll(){
     getShopAll(){
-      this.$service.shop.shopAll().then(res => {
-        this.allShopList = res;
+      this.$service.custom.shopListAll().then(res => {
+        this.allShopList = res.list;
         this.$refs['selectShopListInput'].focus();
         this.$refs['selectShopListInput'].focus();
       });
       });
     },
     },
@@ -531,23 +526,23 @@ export default {
           this.tableData.splice(i,1)
           this.tableData.splice(i,1)
         }
         }
       }
       }
-        this.tableData.push(
-            {
-              index:'001',
-              id:selectList.id,
-              name:selectList.itemName,
-              lv:selectList.rank,
-              unit:selectList.bigUnit+'/'+selectList.smallUnit,
-              count:Number(big)+'/'+Number(small),
-              big:Number(big),
-              small:Number(small),
-              ratio:Number(selectList.ratio),
-              stock:Number(selectList.stock),
-              price:selectList.price,
-              commodityMoney:money.toFixed(2),
-              money:money,
-            }
-        )
+      this.tableData.push(
+          {
+            index:'001',
+            id:selectList.id,
+            name:selectList.itemName,
+            lv:selectList.rank,
+            unit:selectList.bigUnit+'/'+selectList.smallUnit,
+            count:Number(big)+'/'+Number(small),
+            big:Number(big),
+            small:Number(small),
+            ratio:Number(selectList.ratio),
+            stock:Number(selectList.stock),
+            price:selectList.price,
+            commodityMoney:money.toFixed(2),
+            money:money,
+          }
+      )
       this.tableDataIndex = this.tableData.length-1;
       this.tableDataIndex = this.tableData.length-1;
       this.$refs.singleTable.setCurrentRow(this.tableData[this.tableData.length-1]);
       this.$refs.singleTable.setCurrentRow(this.tableData[this.tableData.length-1]);
       this.$nextTick(()=>{
       this.$nextTick(()=>{
@@ -570,11 +565,11 @@ export default {
       // if(this.isSelectNumber){ }
       // if(this.isSelectNumber){ }
       this.isAmendPrice = false;
       this.isAmendPrice = false;
       this.seekVal = '';
       this.seekVal = '';
-        this.seekList = [];
-        this.isSelectNumber = false
-        this.$nextTick(()=>{
-          this.$refs['commodityInput'].focus();
-        })
+      this.seekList = [];
+      this.isSelectNumber = false
+      this.$nextTick(()=>{
+        this.$refs['commodityInput'].focus();
+      })
 
 
     },
     },
     /**清空扎、支值**/
     /**清空扎、支值**/
@@ -582,7 +577,7 @@ export default {
       switch (type){
       switch (type){
         case 'big':
         case 'big':
           this.big = null;
           this.big = null;
-        break;
+          break;
         case 'small':
         case 'small':
           this.small = null;
           this.small = null;
           break;
           break;
@@ -613,7 +608,8 @@ export default {
       let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
       let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
       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.getAllTableDataMoney();
+      this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2),
+          this.getAllTableDataMoney();
       setTimeout(()=>{
       setTimeout(()=>{
         this.seekVal = '';
         this.seekVal = '';
       },100)
       },100)
@@ -635,7 +631,8 @@ export default {
       let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
       let money = Number(selectList.price) * (Number(selectList.big) + Number(selectList.small) / Number(selectList.ratio));
       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.getAllTableDataMoney();
+      this.tableData[this.tableDataIndex].commodityMoney = money.toFixed(2),
+          this.getAllTableDataMoney();
       setTimeout(()=>{
       setTimeout(()=>{
         this.seekVal = '';
         this.seekVal = '';
       },100)
       },100)