Browse Source

绿植盆栽采购

shish 4 years ago
parent
commit
7b599b1fca

+ 8 - 15
hdApp/src/admin/goodsManage/plantConfirm.vue

@@ -14,7 +14,7 @@
                     <text class="item-price">
                       <text class="unit"></text>
                       <text class="price">
-                        <text>{{`${item.bigCount}`}}</text>
+                        <text>{{item.bigCount}}*¥{{parseFloat(item.userPrice)}}</text>
                       </text>
                     </text>
                   </view>
@@ -50,7 +50,7 @@
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
 import productMins from "@/mixins/cgPlantProduct";
-import { wastage } from "@/api/order/index";
+import { cgPlant } from "@/api/goods/index";
 import { mapActions, mapGetters } from "vuex";
 export default {
   name: "plantConfirm",
@@ -77,18 +77,18 @@ export default {
   },
   methods: {
     init () {
-      
+
     },
     confirmToSubmit () {
       let that = this
-      let product = this.selectList.map((ele) => {
-        return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount, classId: ele.classId, itemId: ele.itemId }
+      let goods = this.selectList.map((ele) => {
+        return { goodsId: ele.id, num: ele.bigCount,price: ele.userPrice }
       })
-      that.$util.confirmModal({content:'确认报损?'},() => {
-          wastage({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
+      that.$util.confirmModal({content:'确认提交?'},() => {
+          cgPlant({goods:JSON.stringify(goods),remark:that.form.remark}).then((res) => {
             //删除记忆
             that.removeFromSaveDirect()
-            that.pageTo({url: '/admin/breakage/result',type:2})
+            that.pageTo({url: '/admin/goodsManage/plantResult',type:2})
           });
       })
     },
@@ -107,13 +107,11 @@ export default {
   height: 100%;
   display: flex;
   flex-direction: column;
-
   .affirm-view {
     flex: 1;
     margin-bottom:90upx;
     padding: 20upx;
     background-color: #f0f2f6;
-
     .commodity-view {
       display: flex;
       flex-direction: column;
@@ -166,13 +164,11 @@ export default {
         padding: 0 20upx;
         height: 90upx;
         display: flex;
-
         align-items: center;
         justify-content: space-between;
         border-top: 1upx solid #eeeeee;
         .operate-view {
           display: flex;
-
           align-items: center;
           color: #3385ff;
           font-size: 26upx;
@@ -183,7 +179,6 @@ export default {
         }
         .describe-view {
           display: flex;
-
           align-items: center;
           color: #333;
           font-size: 24upx;
@@ -194,7 +189,6 @@ export default {
         }
       }
     }
-
     .module-com {
       background-color: #fff;
       margin-bottom: 20upx;
@@ -247,7 +241,6 @@ export default {
     } 
     height: 100upx;
     background-color: #fff;
-
     box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
     .price-view {
       display: flex;

+ 5 - 0
hdApp/src/api/goods/index.js

@@ -1,5 +1,10 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+//盆栽绿植采购
+export const cgPlant = data => {
+	return https.post('/goods/cg-plant', data)
+}
+
 /** *
  * 商品详情 m
  */

+ 7 - 11
hdApp/src/mixins/cgPlantProduct.js

@@ -135,18 +135,14 @@ export default {
 			uni.removeStorageSync('selectList_'+that.selectJobType+'_target_'+that.selectJobId)
 			that.reSetSelectInfo({selectJobType:that.selectJobType,selectJobId:that.selectJobId})
 
-			if(!this.$util.isEmpty(this.globalClassItemList)){
-				this.globalClassItemList.forEach((item,index,arr) =>{
-					if(!this.$util.isEmpty(arr[index].child)){
-						arr[index].child.forEach((ele,i,son)=>{
-							arr[index].child[i].bigCount = 0;
-							arr[index].child[i].smallCount = 0;
-							arr[index].child[i].userPrice = 0;
-						})
-					}
-				})
-				this.$forceUpdate()
+			if (this.list && this.list.data && !this.$util.isEmpty(this.list.data)){
+				this.list.data.forEach((currentItem)=>{
+					currentItem.bigCount = null
+					currentItem.userPrice = null
+			  })
+			  this.$forceUpdate()
 			}
+
 		},
 		//请求商品数据
 		async initData(extendInfo) {