shish 2 anni fa
parent
commit
d6f7c5db86
2 ha cambiato i file con 52 aggiunte e 7 eliminazioni
  1. 8 0
      ghs/src/service/item-class/index.js
  2. 44 7
      ghs/src/views/order/add.vue

+ 8 - 0
ghs/src/service/item-class/index.js

@@ -23,6 +23,7 @@ export class ItemClassService extends BaseService {
 			params: data
 			params: data
 		});
 		});
 	}
 	}
+
 	getAllClass(data) {
 	getAllClass(data) {
 		return this.request({
 		return this.request({
 			url: '/get-all-class',
 			url: '/get-all-class',
@@ -30,6 +31,13 @@ export class ItemClassService extends BaseService {
 		});
 		});
 	}
 	}
 
 
+	getAllClassIndex(data) {
+		return this.request({
+			url: '/get-all-class-index',
+			params: data
+		});
+	}
+
 	changeInTurn(data) {
 	changeInTurn(data) {
 		return this.request({
 		return this.request({
 			url: '/change-in-turn',
 			url: '/change-in-turn',

+ 44 - 7
ghs/src/views/order/add.vue

@@ -1,7 +1,8 @@
 <template>
 <template>
-  <div v-if="form.customId == 0" style="text-align:center;">
+  <div v-if="form.customId == 0" style="text-align:center;margin-top:30px;">
+    <span style="font-size:20px;">搜索客户:</span>
     <el-select @change="searchSelectCustom" v-model="selectCustomName" filterable remote reserve-keyword placeholder="搜索客户,光标插入 Ctrl + C" clearable ref="customref"
     <el-select @change="searchSelectCustom" v-model="selectCustomName" filterable remote reserve-keyword placeholder="搜索客户,光标插入 Ctrl + C" clearable ref="customref"
-				:remote-method="searchCustomInfo" :loading="loading" style="width:500px;margin-left:20px;" size="big">
+				:remote-method="searchCustomInfo" :loading="loading" style="width:400px;margin-left:20px;" size="big">
     				<el-option v-for="item in customInfoList" :key="item.id" :label="`${item.name}`" :value="item"></el-option>
     				<el-option v-for="item in customInfoList" :key="item.id" :label="`${item.name}`" :value="item"></el-option>
   				</el-select>
   				</el-select>
   </div>
   </div>
@@ -41,8 +42,9 @@
       </el-table>
       </el-table>
     </div>
     </div>
     <div class="seek-list-box" v-if="!$util.isEmpty(getItemList) && showGetItemList == true">
     <div class="seek-list-box" v-if="!$util.isEmpty(getItemList) && showGetItemList == true">
-      <el-table ref="showItemRef" :data="getItemList" highlight-current-row style="width:65%" border :header-cell-style="{background:'#fdfdfd', color: '#666'}" 
+      <el-table ref="showItemRef" :data="getItemList" highlight-current-row style="width:72%" border :header-cell-style="{background:'#fdfdfd', color: '#666'}" 
       class="tableBox active" height="740" @row-click="pickItem">
       class="tableBox active" height="740" @row-click="pickItem">
+        <el-table-column prop="className" label="分类" align="center" width="180"></el-table-column>
         <el-table-column prop="cover" label="图片" align="center" width="120">
         <el-table-column prop="cover" label="图片" align="center" width="120">
           <template slot-scope="scope">
           <template slot-scope="scope">
             <img :src="scope.row.cover" style="width:26px;margin:0 auto;" />
             <img :src="scope.row.cover" style="width:26px;margin:0 auto;" />
@@ -51,7 +53,16 @@
         <el-table-column prop="name" label="名称" align="center"></el-table-column>
         <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="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="stock" label="库存" width="100" align="center"></el-table-column>
-        <el-table-column prop="bigUnit" label="单位" width="100" height="10" 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>
       </el-table>
     </div>
     </div>
     <div class="bottom_input">
     <div class="bottom_input">
@@ -259,7 +270,8 @@ export default {
       currentShop:{default:0,pfLevel:0},
       currentShop:{default:0,pfLevel:0},
       diffList:[],
       diffList:[],
       showGetItemList:false,
       showGetItemList:false,
-      currentItem:{}
+      currentItem:{},
+      classList:[]
     };
     };
   },
   },
 	mixins: [productMins],
 	mixins: [productMins],
@@ -383,6 +395,11 @@ export default {
           }
           }
         })
         })
 		})
 		})
+
+    this.$service.itemClass.getAllClassIndex().then(data => {
+      this.classList = data
+    })
+
   },
   },
   methods: {
   methods: {
     changeKdStaff(info){
     changeKdStaff(info){
@@ -549,6 +566,13 @@ export default {
         that.searchItemFn()
         that.searchItemFn()
       },250)
       },250)
     },
     },
+    sorts_fun(arr) {
+      return function(a, b) {
+          var v1 = a[arr];
+          var v2 = b[arr];
+          return v1 - v2;
+      }
+    },
     async searchItemFn(){
     async searchItemFn(){
       if(this.searchVal==''){
       if(this.searchVal==''){
         this.getItemList = [];
         this.getItemList = [];
@@ -561,11 +585,24 @@ export default {
       this.getIndex = 0;
       this.getIndex = 0;
       this.searchOldVal = this.searchVal;
       this.searchOldVal = this.searchVal;
       this.isSeek = true;
       this.isSeek = true;
+      let hasExists = []
       await this.$service.item.getItemList({search:this.searchVal,requestType:'kd',pageSize:20}).then(res=>{
       await this.$service.item.getItemList({search:this.searchVal,requestType:'kd',pageSize:20}).then(res=>{
         let list = this.$util.copyObject(res.list)
         let list = this.$util.copyObject(res.list)
         if(!that.$util.isEmpty(list)){
         if(!that.$util.isEmpty(list)){
+          list = list.sort(this.sorts_fun('classId'))
+          const newList = list.map(ele => {
+            let cName = '-'
+            if(hasExists[ele.classId]){
+              //无操作
+            }else{
+              let currentClass = this.classList[ele.classId] ? this.classList[ele.classId] : null
+              cName = currentClass.name ? currentClass.name : ''
+              hasExists[ele.classId] = 1
+            }
+	          return {...ele,className:cName}
+          })
           that.showGetItemList = true
           that.showGetItemList = true
-          that.getItemList = list
+          that.getItemList = newList                
         }
         }
       })
       })
       if(!that.$util.isEmpty(that.getItemList)){
       if(!that.$util.isEmpty(that.getItemList)){
@@ -752,7 +789,7 @@ export default {
     position: absolute;
     position: absolute;
     bottom: 70px;
     bottom: 70px;
     right: 5%;
     right: 5%;
-    width: 66%;
+    width: 75%;
     min-height: 310px;
     min-height: 310px;
     overflow: hidden;
     overflow: hidden;
     z-index:9999;
     z-index:9999;