Jelajahi Sumber

查询商品编号

shish 8 bulan lalu
induk
melakukan
b5528a6511
3 mengubah file dengan 36 tambahan dan 5 penghapusan
  1. 16 2
      ghsPad/src/mixins/product.js
  2. 4 3
      hdApp/src/admin/goods/list.vue
  3. 16 0
      hdPad/src/mixins/product.js

+ 16 - 2
ghsPad/src/mixins/product.js

@@ -321,9 +321,23 @@ export default {
 					this.customData.property = 0
 					this.$refs.selectNumPriceRef.open('center')
 				}
+			}else if (code.indexOf('#') == 0){
+				//成品
+				const res = await getBySn({sn:code})
+				if(res.code == 1){
+					current = res.data
+					if(this.$util.isEmpty(current)){
+						return false
+					}
+					unitName = '份'
+					unitPrice = Number(res.data.price)
+					this.customData = current
+					this.customData.currentNum = 1
+					this.customData.unitPrice = unitPrice
+					this.customData.property = 0
+					this.$refs.selectNumPriceRef.open('center')
+				}
 			}else{
-				console.log('---000---')
-				console.log(this.globalAllProduct)
 				//花材
 				current = this.globalAllProduct.find(function(val){
 					return Number(val.itemId) == Number(code)

+ 4 - 3
hdApp/src/admin/goods/list.vue

@@ -23,8 +23,8 @@
 
 		<view class="input-wrap">
       <view>
-        <button class="admin-button-com middle blue" style="width:100upx;margin-right:8upx;" @click="">名称</button>
-        <button class="admin-button-com middle default" style="width:100upx;margin-right:8upx;" @click="">编号</button>
+        <button class="admin-button-com middle " :class="[searchType == 0 ? 'blue' : 'default']" style="width:100upx;margin-right:8upx;" @click="searchType=0">名称</button>
+        <button class="admin-button-com middle " :class="[searchType == 1 ? 'blue' : 'default']" style="width:100upx;margin-right:8upx;" @click="searchType=1">编号</button>
       </view>
 			<view class="search-bar">
 				<app-search-module v-model="searchText" placeholder="输入内容" @input="searchFn" />
@@ -202,6 +202,7 @@ export default {
       catId: "",
       flowerNum:0,
       searchText:'',
+      searchType:0,
       lastSearchText:'', // 上次的搜索内容
       searchTimer: null, // 搜索防抖定时器
       riseData: {}, // 价格上涨配置
@@ -411,7 +412,7 @@ export default {
       }
     },
     getGoodsList() {
-      return getCategoryToGoods({page: this.list.page,searchText:this.lastSearchText,catId:this.catId, flowerNum:this.flowerNum, priceType:this.priceType, hasStock:this.hasStock,requestType:'goodsList'}).then(res => {
+      return getCategoryToGoods({page: this.list.page,searchText:this.lastSearchText,searchType:this.searchType,catId:this.catId, flowerNum:this.flowerNum, priceType:this.priceType, hasStock:this.hasStock,requestType:'goodsList'}).then(res => {
         this.completes(res)
       })
     },

+ 16 - 0
hdPad/src/mixins/product.js

@@ -321,6 +321,22 @@ export default {
 					this.customData.property = 0
 					this.$refs.selectNumPriceRef.open('center')
 				}
+			}else if (code.indexOf('#') == 0){
+				//成品
+				const res = await getBySn({sn:code})
+				if(res.code == 1){
+					current = res.data
+					if(this.$util.isEmpty(current)){
+						return false
+					}
+					unitName = '份'
+					unitPrice = Number(res.data.price)
+					this.customData = current
+					this.customData.currentNum = 1
+					this.customData.unitPrice = unitPrice
+					this.customData.property = 0
+					this.$refs.selectNumPriceRef.open('center')
+				}
 			}else{
 				//花材
 				current = this.globalAllProduct.find(function(val){