Selaa lähdekoodia

开始做拆散功能

shish 3 vuotta sitten
vanhempi
commit
0d447a6693

+ 1 - 1
hdApp/src/admin/home/workbench.vue

@@ -181,7 +181,7 @@ export default {
         { name: "采购结账", img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`, url: "/admin/clear/list",pf:0 },
         { name: "商品", img: `${this.$constant.imgUrl}/ghs/home/hcgl.png`, url: "/admin/goods/list",pf:1 },
         { name: "商品采购单", img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`, url: "/admin/goods/plantCg",pf:1},
-        { name: "报损", img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`, url: "/admin/breakage/list",pf:1},
+        { name: "报损", img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`, url: "/admin/breakage/list",pf:1},
         { name: "员工", img: `${this.$constant.imgUrl}/ghs/home/yggl.png`, url: "/admin/staff/list",pf:0 },
       ],
       totalData: [

+ 1 - 1
hdApp/src/pages.json

@@ -37,7 +37,7 @@
 		{
 			"root": "admin/breakage",
 			"pages": [
-				{"path": "list","style": {"navigationBarTitleText": "报损","enablePullDownRefresh": true}},
+				{"path": "list","style": {"navigationBarTitleText": "报损记录","enablePullDownRefresh": true}},
 				{"path": "info","style": {"navigationBarTitleText": "详情"}},
 				{"path": "index","style": {"navigationBarTitleText": "选择花材"}},
 				{"path": "confirm","style": {"navigationBarTitleText": "确认订单"}},

+ 5 - 0
hdPad/src/api/part/index.js

@@ -0,0 +1,5 @@
+import https from '@/plugins/luch-request_0.0.7/request'
+
+export const partItem = data => {
+	return https.post('/part/part-item', data)
+}

+ 38 - 1
hdPad/src/pages/home/components/console.vue

@@ -9,7 +9,7 @@
 	 <view class="active" 
  style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:13upx;" 
  @click="selectCustom()">选客</view>
-
+	<view class="active" @click="breakFn">拆散</view>
     <view class="active" @click="toWastage">报损</view>
 	<view class="active" style="background-color:orange;color:white;border-color:orange;height:50upx;line-height:30upx;font-size:14upx;" @click="gatheringFn()">收款</view>
     <view class="active" @click="clearItemFn">清空</view>
@@ -27,6 +27,10 @@
         <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认退出?" @confirm="confirmLogout"></uni-popup-dialog>
     </uni-popup>
 
+    <uni-popup ref="breakRef" type="dialog">
+        <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认拆散?" @confirm="confirmBreak"></uni-popup-dialog>
+    </uni-popup>
+
     <uni-popup ref="wastageRef" type="dialog">
         <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认报损?" @confirm="confirmWastage"></uni-popup-dialog>
     </uni-popup>
@@ -58,6 +62,7 @@
 import settlePop from './settlePop'
 import toPayWay from './toPay'
 import { wastageCreateOrder } from '@/api/home/index'
+import { partItem } from '@/api/part'
 import { createOrder} from '@/api/order'
 import {goodsWastage} from '@/api/wastage'
 import productMins from "@/mixins/product"
@@ -253,6 +258,38 @@ export default {
 		selectPayWayBack(price){
 			this.$util.hitVoice()
 		},
+		breakFn(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择报损花材')
+				return false
+			}
+			this.$refs.breakRef.open('center')
+		},
+		confirmBreak(){
+			this.$util.hitVoice()
+			if(this.$util.isEmpty(this.selectList)) {
+				this.$msg('请选择要拆的花材')
+				return false
+			}
+			let hasGoods = this.selectList.some((item) => {
+			  return item.property  == 0
+			})
+			if(hasGoods){
+				this.$msg('商品不能拆散')
+				return false
+			}
+			let product = this.selectList.map(i=>({ 
+				productId:i.id, unitType: i.unitType||0, num: i.currentNum, property: i.property, unitPrice: i.unitPrice,
+			}))
+			partItem({ product: JSON.stringify(product) }).then(res=>{
+				if(res.code == 1){
+					this.removeFromSaveDirect()
+					this.$refs.breakRef.close()
+					this.$msg("拆散成功")
+				}
+			})
+		},
 		toWastage(){
 			this.$util.hitVoice()
 			if(this.$util.isEmpty(this.selectList)) {

+ 1 - 1
hdPad/src/pages/home/components/rightItem.vue

@@ -105,11 +105,11 @@ export default {
             this.itemInfoList = this.allItemInfo[this.categoryId]
         },
         changeCategory(item){
-            this.$util.hitVoice()
             if(item.id === this.categoryId){
                 return false
             }
             this.categoryId = item.id
+            this.$util.hitVoice()
             this.showCatItem()
         }
     }