|
|
@@ -54,7 +54,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="summary-bar">
|
|
|
- <view class="operate-view" v-if="isScanEnv" @click="pageToItemList()"><text class="iconfont iconzeng"></text>手动添加花材</view>
|
|
|
+ <view class="operate-view" v-if="isScanEnv"><text class="iconfont iconzeng"></text>手动添加花材</view>
|
|
|
<view class="operate-view" v-if="isScanEnv == false"><text> </text></view>
|
|
|
<view class="describe-view">
|
|
|
<text>{{ selectList.length }}种</text>
|
|
|
@@ -209,7 +209,8 @@
|
|
|
<textarea style="height:80upx;z-index:0" v-model="form.remark" placeholder-class="remark-class" placeholder="选填" />
|
|
|
</tui-list-cell>
|
|
|
|
|
|
- <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <!-- 如果是扣除库存方式开单,不显示售后付款选项 -->
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" v-if="reduceStock == 0">
|
|
|
<view class="tui-title">订单类型</view>
|
|
|
<button @tap="form.forward = 0;" class="admin-button-com mini-btn" style="width:170upx;" :class="form.forward == 0? 'blue' : 'default'">收入订单</button>
|
|
|
<button @click="form.forward = 1;" class="admin-button-com mini-btn" style="width:170upx;" :class="form.forward == 1 ? 'blue' : 'default'">售后付款</button>
|
|
|
@@ -386,7 +387,8 @@ export default {
|
|
|
calc:'add',
|
|
|
diffPriceList:[],
|
|
|
currentShop:{default:0},
|
|
|
- forwardPayWay:0//不影响原有的form.payWay方式,重新定义一个
|
|
|
+ forwardPayWay:0,//不影响原有的form.payWay方式,重新定义一个
|
|
|
+ reduceStock:0
|
|
|
};
|
|
|
},
|
|
|
onLoad (option) {
|
|
|
@@ -396,11 +398,8 @@ export default {
|
|
|
|
|
|
let that = this
|
|
|
this.initMerchantInfo().then((data) => {
|
|
|
-
|
|
|
uni.setNavigationBarTitle({ title: data.name })
|
|
|
-
|
|
|
that.currentShop = data.shopInfo
|
|
|
-
|
|
|
})
|
|
|
|
|
|
if(Number(option.customId) > 0){
|
|
|
@@ -428,6 +427,13 @@ export default {
|
|
|
}
|
|
|
//#endif
|
|
|
|
|
|
+ //如果是扣除库存方式开单,不显示售后付款选项
|
|
|
+ this.reduceStock = this.option.reduceStock?this.option.reduceStock:0
|
|
|
+ //如果扣除库存方法,付款方式默认选择赊账,这样方便提交
|
|
|
+ if(this.reduceStock == 1){
|
|
|
+ this.form.hasPay = 2
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
onShow(){
|
|
|
|
|
|
@@ -584,7 +590,7 @@ export default {
|
|
|
//售后付款单,只能走线下模式
|
|
|
this.form.hasPay = 1
|
|
|
this.form.payWay = this.forwardPayWay
|
|
|
- this.toCommit()
|
|
|
+ this.submitOrder()
|
|
|
},
|
|
|
confirmSubmit(){
|
|
|
if(this.form.forward == 1){
|
|
|
@@ -594,14 +600,14 @@ export default {
|
|
|
//客户余额充值,只能使用余额支付
|
|
|
this.$util.confirmModal({content:'客户余额充足,请使用余额支付'},() => {
|
|
|
this.form.hasPay = 4
|
|
|
- this.toCommit()
|
|
|
+ this.submitOrder()
|
|
|
})
|
|
|
}else{
|
|
|
- this.toCommit()
|
|
|
+ this.submitOrder()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- toCommit() {
|
|
|
+ submitOrder() {
|
|
|
let self = this;
|
|
|
let name = '确认提交'
|
|
|
if(this.form.hasPay == 0){
|
|
|
@@ -649,6 +655,12 @@ export default {
|
|
|
//orderType 开单类型,1商品开单 2花材开单
|
|
|
params = {...params,xj:JSON.stringify(xj),orderType:2}
|
|
|
|
|
|
+ //扣减库存
|
|
|
+ let orderId = this.option.orderId ? this.option.orderId : 0
|
|
|
+ let book = this.option.book ? this.option.book : 0
|
|
|
+ let reduceStock = this.option.reduceStock?this.option.reduceStock:0
|
|
|
+ params = {...params,orderId:orderId,book:book,reduceStock:reduceStock}
|
|
|
+
|
|
|
uni.showLoading({mask:true})
|
|
|
createOrder(params).then((res) => {
|
|
|
uni.hideLoading()
|
|
|
@@ -685,10 +697,10 @@ export default {
|
|
|
gobackEvent () {
|
|
|
let customId = this.option.customId ? this.option.customId : 0
|
|
|
let customName = this.option.customName ? this.option.customName : ''
|
|
|
- this.$util.pageTo({url: '/admin/billing/index2?customId='+customId+'&customName='+customName,type:2})
|
|
|
- },
|
|
|
- pageToItemList() {
|
|
|
- this.$util.pageTo({url: '/admin/billing/index2?customId='+this.option.customId,type:2})
|
|
|
+ let reduceStock = this.option.reduceStock?this.option.reduceStock:0
|
|
|
+ let orderId = this.option.orderId ? this.option.orderId : 0
|
|
|
+ let book = this.option.book ? this.option.book : 0
|
|
|
+ this.$util.pageTo({url: '/admin/billing/index2?customId='+customId+'&customName='+customName+'&orderId='+orderId+'&book='+book+'&reduceStock='+reduceStock,type:2})
|
|
|
}
|
|
|
}
|
|
|
};
|