Browse Source

减半扎

shish 1 year ago
parent
commit
259300ed9b

+ 3 - 3
ghsApp/src/admin/billing/affirm.vue

@@ -30,10 +30,10 @@
                     <view style="text-align:right;position: relative;">
 
                       <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-if="item.bigCount > 0">¥{{ parseFloat((Number(item.bigCount)*Number(item.userPrice)).toFixed(2)) }}</text>
-                      <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-else > 0">¥{{ parseFloat((Number(item.smallCount)*Number(item.userPrice)).toFixed(2)) }}</text>
-                      <text :class="[Number(item.cost) > Number(item.userPrice) ? 'warning-price' : 'normal-price']" style="position: absolute;right:0upx;top:55upx;font-size:24upx;font-weight:bold;width:350upx;text-align:right;">
+                      <text style="position: absolute;right:300upx;top:2upx;font-size:28upx;color:green;font-weight:bold;" v-else>¥{{ parseFloat((Number(item.smallCount)*Number(item.userPrice)).toFixed(2)) }}</text>
+                      <text :class="[Number(item.cost) > Number(item.userPrice) && item.bigCount > 0 ? 'warning-price' : 'normal-price']" style="position: absolute;right:0upx;top:55upx;font-size:24upx;font-weight:bold;width:350upx;text-align:right;">
                         ¥{{ item.cost?parseFloat(item.cost):0 }}
-                        <text style="margin-left:8upx;" v-if="Number(item.cost) > Number(item.userPrice)">售价过低</text>
+                        <text style="margin-left:8upx;" v-if="Number(item.cost) > Number(item.userPrice) && item.bigCount > 0">售价过低</text>
                       </text>
 
                       <view class="open-bx" >

+ 17 - 1
ghsApp/src/admin/billing/result.vue

@@ -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 }]

+ 4 - 0
ghsApp/src/api/item/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const changeHalf = data => {
+	return https.post('/item/change-half', data)
+}
+
 //单个花材采购人修改
 export const modifyCgStaff = data => {
 	return https.get('/item/modify-cg-staff', data)

+ 16 - 1
ghsApp/src/pagesOrder/refund.vue

@@ -21,9 +21,10 @@
 					<text class="product-price">{{`${parseFloat(res.xhUnitPrice)}`}}元/{{res.xhUnitName}}</text>
 				</view>
 				<view class="flex list-val" style="font-size:26upx;font-weight:bold;">
-					<input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" />
+					<input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" style="height:60upx;width:160upx;" />
 					<text style="margin-left:10upx;">{{res.xhUnitName}}</text>
 					<text style="color:green;margin-left:20upx;">可退{{Number(res.xhNum)-Number(res.refundNum)}}{{res.xhUnitName}}</text>
+					<button class="admin-button-com mini-btn" @click="addHalf(res)" v-if="res.xhUnitType == 1" style="margin-left:10upx;">退半份</button>
 				</view>
 			</view>
 			</view>
@@ -117,6 +118,7 @@ import TuiListCell from "@/components/plugin/list-cell";
 import { getDetail,refund } from "@/api/order/index";
 import { ORDER_STATUS } from "@/utils/declare";
 import { getUnClear } from "@/api/clear"
+import { changeHalf } from "@/api/item"
 export default {
 	name: "orderDetail",
 	components: {
@@ -165,6 +167,19 @@ export default {
 	watch:{
 	},
 	methods: {
+		addHalf(item){
+			let that = this
+			let orderSn = this.orderInfo.orderSn
+			let remark = "售后订单"+orderSn+",退回半份"
+			that.$util.confirmModal({content:'确认退回半份?'},() => {
+				uni.showLoading()
+				changeHalf({productId:item.productId,add:1,remark:remark}).then((res) => {
+					uni.hideLoading()
+					let stock = res.data.stock ? res.data.stock : 0
+					uni.showToast({title: '成功,剩 '+stock,duration:3000,icon:'success'})
+				})
+			})
+		},
 		cancelRefund(){
 			uni.navigateBack({delta: 1});
 		},

+ 18 - 2
hdApp/src/admin/order/refund.vue

@@ -36,9 +36,10 @@
 							<text class="product-price">{{`${parseFloat(res.unitPrice)}`}}元/{{res.unitName}}</text>
 						</view>
 						<view class="flex list-val" style="font-size:26upx;font-weight:bold;">
-							<input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" />
+							<input type="number" placeholder="退货数" v-model="res.refundCount" placeholder-style="color:#CCCCCC" style="height:60upx;width:160upx;" />
 							<text style="margin-left:10upx;">{{res.unitName}}</text>
 							<text style="color:green;margin-left:20upx;">可退{{Number(res.num)-Number(res.refundNum)}}{{res.unitName}}</text>
+							<button class="admin-button-com mini-btn" @click="addHalf(res)" v-if="res.unitType == 1" style="margin-left:10upx;">退半份</button>
 						</view>
 					</view>
 				</template>
@@ -76,6 +77,7 @@
 <script>
 import { getDetail,refund } from "@/api/order/index";
 import { allRefund } from "@/api/refund"
+import { changeHalf } from "@/api/item"
 export default {
 	name: "orderDetail",
 	components: {},
@@ -91,7 +93,8 @@ export default {
 			coundRefundPrice:0
 		};
 	},
-	onShow() {
+	onShow(){
+
 	},
 	computed:{
 		refundPrice(){
@@ -125,6 +128,19 @@ export default {
 	watch:{
 	},
 	methods: {
+		addHalf(item){
+			let that = this
+			let orderSn = this.orderInfo.orderSn
+			let remark = "零售订单"+orderSn+"售后,退回半份"
+			that.$util.confirmModal({content:'确认退回半份?'},() => {
+				uni.showLoading()
+				changeHalf({productId:item.itemId,add:1,remark:remark}).then((res) => {
+					uni.hideLoading()
+					let stock = res.data.stock ? res.data.stock : 0
+					uni.showToast({title: '成功,剩 '+stock,duration:3000,icon:'success'})
+				})
+			})
+		},
 		cancelRefund(){
 			uni.navigateBack({delta: 1});
 		},

+ 4 - 0
hdApp/src/api/item/index.js

@@ -2,4 +2,8 @@ import https from '@/plugins/luch-request_0.0.7/request'
 
 export const getPriceChangeList = data => {
 	return https.get('/price-change/list', data)
+}
+
+export const changeHalf = data => {
+	return https.post('/item/change-half', data)
 }