|
|
@@ -3,29 +3,42 @@
|
|
|
<view class="active" @click="changeProperty(1)">花材</view>
|
|
|
<view class="active" @click="changeProperty(0)">花束</view>
|
|
|
<view class="active" @click="openBox">开箱</view>
|
|
|
- <view class="active" style="background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;" @click="goSettleCommit">结算</view>
|
|
|
- <view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
|
|
|
- <view class="active" style="position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #09C567;" @click="getHandOrder()" v-else>取单</view>
|
|
|
+ <view class="active" :class="[fastAction==1 ? 'clear-fast' : 'clear']" @click="goSettleCommit">结算</view>
|
|
|
+ <view class="active2" :class="[fastAction==1 ? 'hand-fast' : 'hand']" @click="handOrder()" v-if="globalHasHand == 0">挂单</view>
|
|
|
+ <view class="active2" :class="[fastAction==1 ? 'out-fast' : 'out']" @click="getHandOrder()" v-else>取单</view>
|
|
|
<view class="active" @click="toWastage" style="color:#f1a313;border:1upx solid #f1a313;">报损</view>
|
|
|
- <view class="active" @click="selectCustom()">选客</view>
|
|
|
- <view class="active" @click="getAllProduct()">扫码</view>
|
|
|
+ <view class="active" @click="showCustomPop()" style="background-color: #09C567;border:1upx sold #09C567;color:white;">选客</view>
|
|
|
+ <view class="active" @click="part()">拆散</view>
|
|
|
+ <view class="active" @click="fastCreate()" style="font-size:9upx;">快捷开单</view>
|
|
|
<view class="active" @click="gatheringFn()" style="color:#3385FF;border:1upx solid #3385FF;">收款</view>
|
|
|
<view class="active" @click="clearItemFn" style="color:#636161;border:1upx solid #636161;">清空</view>
|
|
|
|
|
|
- <view v-if="Number(customId)>0" style="position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:#09C567;font-weight:bold;border:none;">{{customName}}</view>
|
|
|
+ <view v-if="Number(customId)>0" :class="[fastAction==1 ? 'custom-fast' : 'custom']">{{customName}}</view>
|
|
|
+
|
|
|
+ <uni-popup ref="clearItemRef" type="dialog">
|
|
|
+ <view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
|
|
|
+ <view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认清空?</view>
|
|
|
+ <view style="text-align:center;">
|
|
|
+ <button class="admin-button-com mini-btn default" @click="cancelClear">取消</button>
|
|
|
+ <button class="admin-button-com mini-btn default" @click="confirmClearItem" style="margin-left:30upx;">确认</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
|
|
|
- <!-- 清空 -->
|
|
|
- <uni-popup ref="clearItemRef" type="dialog">
|
|
|
- <uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认清空?" @confirm="confirmClearItem"></uni-popup-dialog>
|
|
|
- </uni-popup>
|
|
|
|
|
|
<uni-popup ref="logoutRef" type="dialog">
|
|
|
<uni-popup-dialog type="info" cancelText="取消" confirmText="确认" title="提示" content="确认退出?" @confirm="confirmLogout"></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>
|
|
|
+ <uni-popup ref="wastageRef" type="dialog">
|
|
|
+ <view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
|
|
|
+ <view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认报损?</view>
|
|
|
+ <view style="text-align:center;">
|
|
|
+ <button class="admin-button-com mini-btn default" @click="cancelWastage">取消</button>
|
|
|
+ <button class="admin-button-com mini-btn default" @click="confirmWastage" style="margin-left:30upx;">确认</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
|
|
|
<!-- 结算弹框 -->
|
|
|
<uni-popup ref="settlePopRef" background-color="#fff" type="center" :animation="false">
|
|
|
@@ -48,9 +61,20 @@
|
|
|
@addToClear="addToClear" @cancelKdSelectNumPrice="addItemModelHidden"></selectNumPrice>
|
|
|
</uni-popup>
|
|
|
|
|
|
+ <uni-popup ref="myPartRef" type="dialog">
|
|
|
+ <view style="width:60vw;height:70vh;background-color: white;padding:70upx 20upx 0 20upx;">
|
|
|
+ <view style="margin-bottom:40upx;text-align: center;font-size:24upx;">确认拆散?</view>
|
|
|
+ <view style="text-align:center;">
|
|
|
+ <button class="admin-button-com mini-btn default" @click="cancelPart">取消</button>
|
|
|
+ <button class="admin-button-com mini-btn default" @click="confirmPart" style="margin-left:30upx;">确认</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+
|
|
|
</view>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { mapGetters } from "vuex";
|
|
|
import settlePop from './settlePop'
|
|
|
import toPayWay from './toPay'
|
|
|
import { wastageCreateOrder } from '@/api/home/index'
|
|
|
@@ -59,6 +83,7 @@ import {goodsWastage} from '@/api/wastage'
|
|
|
import productMins from "@/mixins/product"
|
|
|
import selectPrice from './selectPrice'
|
|
|
import selectNumPrice from './selectNumPrice'
|
|
|
+import { partItem } from '@/api/part'
|
|
|
// #ifdef APP-PLUS
|
|
|
let sunmiCashboxPlugin = uni.requireNativePlugin('Tellsea-SunmiCashboxPlugin')
|
|
|
// #endif
|
|
|
@@ -92,9 +117,13 @@ export default {
|
|
|
currentJobId:0,
|
|
|
calc:'add',
|
|
|
settleOpenStatus:0,
|
|
|
- price:0
|
|
|
+ price:0,
|
|
|
+ fastAction:1
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getLoginInfo","getMyShopInfo"])
|
|
|
+ },
|
|
|
watch:{
|
|
|
changeCurrentJobType:{
|
|
|
handler(str){
|
|
|
@@ -107,10 +136,20 @@ export default {
|
|
|
this.currentJobId = Number(id)
|
|
|
},
|
|
|
immediate:true
|
|
|
- }
|
|
|
+ },
|
|
|
+ customId:{
|
|
|
+ handler(id){
|
|
|
+ if(Number(this.getMyShopInfo.defaultCustomId)==Number(id)){
|
|
|
+ this.fastAction=1
|
|
|
+ }else{
|
|
|
+ this.fastAction=0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate:true
|
|
|
+ }
|
|
|
},
|
|
|
created(){
|
|
|
-
|
|
|
+
|
|
|
//判断是否有单可取
|
|
|
let has = uni.getStorageSync('selectList_'+this.currentJobType+'_target_'+this.currentBackJobId)
|
|
|
if(!this.$util.isEmpty(has)){
|
|
|
@@ -122,15 +161,51 @@ export default {
|
|
|
this.listenScanItem()
|
|
|
},
|
|
|
destroyed(){
|
|
|
- // #ifdef APP-PLUS
|
|
|
- //避免重复,每次进来先移除全局自定义事件监听器
|
|
|
- uni.$off('listenGetScanCode')
|
|
|
- // #endif
|
|
|
},
|
|
|
methods:{
|
|
|
- selectCustom(){
|
|
|
+ part(){
|
|
|
this.$util.hitVoice()
|
|
|
- this.$util.pageTo({url:'/pages/home/selectCustom'})
|
|
|
+ if(this.$util.isEmpty(this.selectList)) {
|
|
|
+ this.$msg('请选择花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.$refs.myPartRef.open('center')
|
|
|
+ },
|
|
|
+ cancelPart(){
|
|
|
+ this.$util.hitVoice()
|
|
|
+ this.$refs.myPartRef.close()
|
|
|
+ },
|
|
|
+ confirmPart(){
|
|
|
+ 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.myPartRef.close()
|
|
|
+ this.$msg("拆散成功")
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ showCustomPop(){
|
|
|
+ this.$util.hitVoice()
|
|
|
+ this.$emit('showCustomPop')
|
|
|
+ },
|
|
|
+ fastCreate(){
|
|
|
+ this.$util.hitVoice()
|
|
|
+ this.$emit('fastCreate')
|
|
|
},
|
|
|
addToClear(){
|
|
|
let params = {
|
|
|
@@ -195,7 +270,7 @@ export default {
|
|
|
//继续监听花材扫码
|
|
|
this.listenScanItem()
|
|
|
//开单完成之后更新花材库存
|
|
|
- this.$emit('rightItemRefresh')
|
|
|
+ this.$emit('updateRightItem')
|
|
|
},
|
|
|
calcFn(){
|
|
|
this.calc = this.calc == 'add' ? 'sub' : 'add'
|
|
|
@@ -220,9 +295,8 @@ export default {
|
|
|
this.$refs.toPayRef.open('center')
|
|
|
}else{
|
|
|
this.removeFromSaveDirect()
|
|
|
- this.$emit('clearAll')
|
|
|
//开单完成之后更新花材库存
|
|
|
- this.$emit('rightItemRefresh')
|
|
|
+ this.$emit('updateRightItem')
|
|
|
uni.showToast({ title: '操作成功', duration: 1000 })
|
|
|
}
|
|
|
this.settleOpenStatus = 0
|
|
|
@@ -253,15 +327,18 @@ export default {
|
|
|
toWastage(){
|
|
|
this.$util.hitVoice()
|
|
|
if(this.$util.isEmpty(this.selectList)) {
|
|
|
- this.$msg('请选择报损花材')
|
|
|
+ this.$msg('请选择花材')
|
|
|
return false
|
|
|
}
|
|
|
this.$refs.wastageRef.open('center')
|
|
|
},
|
|
|
+ cancelWastage(){
|
|
|
+ this.$refs.wastageRef.close()
|
|
|
+ },
|
|
|
confirmWastage(){
|
|
|
this.$util.hitVoice()
|
|
|
if(this.$util.isEmpty(this.selectList)) {
|
|
|
- this.$msg('请选择报损花材')
|
|
|
+ this.$msg('请选择花材')
|
|
|
return false
|
|
|
}
|
|
|
let hasGoods = this.selectList.some((item) => {
|
|
|
@@ -282,7 +359,7 @@ export default {
|
|
|
if(res.code == 1){
|
|
|
this.removeFromSaveDirect()
|
|
|
this.$refs.wastageRef.close()
|
|
|
- this.$msg("报损成功!")
|
|
|
+ this.$msg("报损成功")
|
|
|
}
|
|
|
})
|
|
|
}else{
|
|
|
@@ -293,7 +370,7 @@ export default {
|
|
|
if(res.code == 1){
|
|
|
this.removeFromSaveDirect()
|
|
|
this.$refs.wastageRef.close()
|
|
|
- this.$msg("报损成功!")
|
|
|
+ this.$msg("报损成功")
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -311,11 +388,6 @@ export default {
|
|
|
this.settleOpenStatus = 1
|
|
|
this.$refs.settlePopRef.open('center')
|
|
|
},
|
|
|
- //清空花材弹框
|
|
|
- clearItemFn(){
|
|
|
- this.$util.hitVoice()
|
|
|
- this.$refs.clearItemRef.open()
|
|
|
- },
|
|
|
openBox(){
|
|
|
// #ifdef APP-PLUS
|
|
|
sunmiCashboxPlugin.connect((e) => {
|
|
|
@@ -331,11 +403,19 @@ export default {
|
|
|
})
|
|
|
// #endif
|
|
|
},
|
|
|
- //确认清空花材
|
|
|
+ //清空花材弹框
|
|
|
+ clearItemFn(){
|
|
|
+ this.$util.hitVoice()
|
|
|
+ this.$refs.clearItemRef.open()
|
|
|
+ },
|
|
|
+ cancelClear(){
|
|
|
+ this.$util.hitVoice()
|
|
|
+ this.$refs.clearItemRef.close()
|
|
|
+ },
|
|
|
confirmClearItem(){
|
|
|
this.$util.hitVoice()
|
|
|
+ this.$refs.clearItemRef.close()
|
|
|
this.removeFromSaveDirect()
|
|
|
- this.$emit('clearAll')
|
|
|
},
|
|
|
confirmLogout(){
|
|
|
this.$util.hitVoice()
|
|
|
@@ -372,8 +452,36 @@ export default {
|
|
|
& .active {
|
|
|
color: #09C567;
|
|
|
border-color: #09C567;
|
|
|
- font-size: 12upx;
|
|
|
+ font-size: 10upx;
|
|
|
+ font-weight:bold;
|
|
|
+ }
|
|
|
+ & .active2 {
|
|
|
+ font-size: 10upx;
|
|
|
font-weight:bold;
|
|
|
}
|
|
|
+ & .custom-fast{
|
|
|
+ position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:#09C567;font-weight:bold;border:none;
|
|
|
+ }
|
|
|
+ & .clear-fast{
|
|
|
+ background-color:#09C567;color:white;border-color:#09C567;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;
|
|
|
+ }
|
|
|
+ & .hand-fast{
|
|
|
+ position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color: #09C567;border-color: #09C567;
|
|
|
+ }
|
|
|
+ & .out-fast{
|
|
|
+ position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: #09C567;
|
|
|
+ }
|
|
|
+ & .custom{
|
|
|
+ position:fixed;left:32upx;bottom:66upx;width:189upx;height:20upx;line-height:5upx;font-size:13upx;background-color:white;color:orange;font-weight:bold;border:none;
|
|
|
+ }
|
|
|
+ & .clear{
|
|
|
+ background-color:orange;color:white;border-color:orange;position:fixed;left:135upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:16upx;
|
|
|
+ }
|
|
|
+ & .hand{
|
|
|
+ position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color: orange;border-color: orange;
|
|
|
+ }
|
|
|
+ & .out{
|
|
|
+ position:fixed;left:36upx;bottom:13upx;width:84upx;height:50upx;line-height:30upx;font-size:15upx;color:white;background-color: orange;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|