|
|
@@ -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)) {
|