|
|
@@ -29,7 +29,10 @@
|
|
|
{{item.name}}
|
|
|
<text v-if="item.giveNum && Number(item.giveNum)>0" style="color:green;">,已赠{{item.giveNum}}{{item.xhUnitName}}</text>
|
|
|
</text>
|
|
|
- <button v-if="item.xhUnitType == 1" class="admin-button-com middle" style="margin:10upx auto 0 auto;" @click="partOne(item)">拆1份</button>
|
|
|
+ <view v-if="item.xhUnitType == 1" style="width:100%;">
|
|
|
+ <button class="admin-button-com middle" style="width:180upx;margin:10upx 0 0 0;" @click="partOne(item)">拆1份</button>
|
|
|
+ <button class="admin-button-com middle blue" style="width:180upx;margin:10upx 0 0 20upx;" @click="subHalf(item)">减半份</button>
|
|
|
+ </view>
|
|
|
<button v-else class="admin-button-com middle blue" style="margin:10upx auto 0 auto;" @click="giveItemFn(item)">赠送</button>
|
|
|
</view>
|
|
|
</block>
|
|
|
@@ -57,6 +60,7 @@ import { getDetail,cloudPrintOrder} from "@/api/order"
|
|
|
import { getWeixinId } from "@/api/invite"
|
|
|
import { IMGHOST } from '@/config'
|
|
|
import { partItem } from "@/api/part"
|
|
|
+import { changeHalf } from "@/api/item"
|
|
|
import { giveItem } from "@/api/order-item"
|
|
|
import ModalModule from "@/components/plugin/modal"
|
|
|
export default {
|
|
|
@@ -122,6 +126,18 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ subHalf(item){
|
|
|
+ let that = this
|
|
|
+ let orderSn = this.detailInfo.orderSn
|
|
|
+ let remark = "开订单"+orderSn+",减半份"
|
|
|
+ that.$util.confirmModal({content:'确认减半份?'},() => {
|
|
|
+ changeHalf({productId:item.productId,add:0,remark:remark}).then((res) => {
|
|
|
+ that.init()
|
|
|
+ let stock = res.data.stock ? res.data.stock : 0
|
|
|
+ uni.showToast({title: '成功,剩 '+stock,duration:4000,icon:'success'})
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
partOne(item){
|
|
|
let that = this
|
|
|
let product = [{ productId: item.productId, bigNum: 1, smallNum: 0, classId: 0, itemId: item.itemId, ratio:item.ratio }]
|