shish 3 лет назад
Родитель
Сommit
a8b1841a70

+ 1 - 1
ghsApp/src/admin/home/apply.vue

@@ -77,7 +77,7 @@ export default {
                     title:'采购与供应商',
                     list:[
                         {name: "供应商",img: `${this.$constant.imgUrl}/ghs/home/icon_ghs.png`,url: "/pagesPurchase/supplier"},
-                        {name: "采购",img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,url: "/pagesPurchase/order"},
+                        {name: "采购记录",img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,url: "/pagesPurchase/order"},
                         {name: "采购设置",img: `${this.$constant.imgUrl}/ghs/home/icon_caigou.png`,url: "/admin/cg/set"},
                         {name: "采购结账单",img: `${this.$constant.imgUrl}/ghs/home/kcyjs.png`,url: "/admin/clear/list"}
                     ]

+ 5 - 5
ghsApp/src/admin/home/workbench.vue

@@ -148,15 +148,15 @@ export default {
 				{ name: "商城", img: 'ghs/home/shop.png', url: "/admin/home/mall" },
 				{ name: "改价", img: 'ghs/home/gj.png', url: "/admin/changePrice/list" },
 				{ name: "花材", img: 'ghs/home/hcgl.png', url: "/admin/item/list" },
-				{name: "供应商", img: 'ghs/home/icon_ghs.png', url: '/pagesPurchase/supplier'},
-				{ name: "采购", img: 'ghs/home/icon_caigou.png', url: "/pagesPurchase/order" },
-				{ name: "报损", img: 'ghs/home/kcyjs.png', url: "/admin/breakage/list" },
+				{name: "采购", img: 'ghs/home/icon_ghs.png', url: '/pagesPurchase/supplier'},
+				{ name: "采购记录", img: 'ghs/home/icon_caigou.png', url: "/pagesPurchase/order" },
+				{ name: "报损", img: 'ghs/home/kcyjs.png', url: "/admin/breakage/list" },
 				{ name: "预订单", img: 'ghs/home/kcyjs.png', url: "/admin/order/statBook" },
-				{ name: "新增出库", img: 'ghs/home/dbck.png', url: "/admin/shop/selectShop" },
+				{ name: "出库", img: 'ghs/home/dbck.png', url: "/admin/shop/selectShop" },
 				{ name: "出库记录", img: 'ghs/home/dbck.png', url: "/pagesStorehouse/allot/allotEx" },
 				{ name: "入库记录", img: 'ghs/home/dbrk.png', url: "/pagesStorehouse/allot/allotPut" },
 				{name : "结账记录", img : "ghs/home/kcyjs.png", url : "/admin/clear/customList"},
-				{name : "支出登记", img : "ghs/home/kcyjs.png", url : "/admin/expend/addExpend"},
+				{name : "支出", img : "ghs/home/kcyjs.png", url : "/admin/expend/addExpend"},
 			],
 			skSrc: `${this.$constant.imgUrl}/ghs/home/kj.png`,
 			pfSrc: `${this.$constant.imgUrl}/ghs/home/pf.jpg`,

+ 5 - 0
ghsApp/src/api/cg-refund/index.js

@@ -0,0 +1,5 @@
+import https from "@/plugins/luch-request_0.0.7/request";
+
+export const createOrder = data => {
+	return https.post('/cg-refund/create-order', data)
+}

+ 1 - 1
ghsApp/src/pages.json

@@ -292,7 +292,7 @@
 			"root": "pagesPurchase",
 			"pages": [
 				{ "path": "result", "style": { "navigationBarTitleText": "结果" } },
-				{ "path": "add", "style": { "navigationBarTitleText": "新增采购", "enablePullDownRefresh": true } },
+				{ "path": "add", "style": { "navigationBarTitleText": "新增采购", "enablePullDownRefresh": true } },
 				{ "path": "details", "style": { "navigationBarTitleText": "确认订单" } },
 				{ "path": "components/pageSuccess", "style": { "navigationBarBackgroundColor": "#ffffff", "navigationBarTextStyle": "black" } },
 				{ "path": "order", "style": { "navigationBarTitleText": "采购订单", "enablePullDownRefresh": true } },

+ 1 - 1
ghsApp/src/pagesGys/detailsItem.vue

@@ -16,7 +16,7 @@
 			</view>
 			<view class="item-row">
 				<view class="price">¥{{ parseFloat(info.realPrice) }}</view>
-				<view class="price" style="font-weight:normal;color:#3385FF;font-size:33upx;" @click.stop="goToDetai(info)">查看明细</view>
+				<view class="price" style="border:1upx solid #67a0f7;border-radius:10upx;font-weight:normal;color:#3385FF;font-size:32upx;width:180upx;height:80upx;justify-content:center;" @click.stop="goToDetai(info)">查看明细</view>
 			</view>
 		</view>
 	</view>

+ 2 - 5
ghsApp/src/pagesPurchase/info.vue

@@ -188,10 +188,8 @@
 		</view>
 	</view>
 </template>
-
 <script>
-
-import { getPurchaseDetailApi,updateRemark,printAll,printItem } from "@/api/purchase/index";
+import { getPurchaseDetailApi,updateRemark,printAll,printItem } from "@/api/purchase";
 import productMins from "@/mixins/product";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
@@ -214,8 +212,7 @@ export default {
 	},
 	methods: {
 		goRefund(info){
-			this.$msg('开发中')
-			this.$util.pageTo({url:'/pagesPurchase/refund?id='+info.id})
+			this.$util.pageTo({url:'/pagesPurchase/refund?orderSn='+info.orderSn})
 		},
 		printLabel(item){
 			let that = this

+ 22 - 24
ghsApp/src/pagesPurchase/refund.vue

@@ -17,13 +17,13 @@
 				<view class="list" v-for="(res,i) in product" :key="i">
 				<view class="flex list-title" >
 					<text class="product-name">{{res.name}}</text>
-					<text class="product-num">{{ `${parseFloat(res.xhNum)}` }}{{res.xhUnitName}}</text>
-					<text class="product-price">{{`${parseFloat(res.xhUnitPrice)}`}}元/{{res.xhUnitName}}</text>
+					<text class="product-num">{{ `${parseFloat(res.itemNum)}` }}{{res.bigUnit}}</text>
+					<text class="product-price">{{`${parseFloat(res.bigPrice)}`}}元/{{res.bigUnit}}</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" />
-					<text style="margin-left:10upx;">{{res.xhUnitName}}</text>
-					<text style="color:green;margin-left:20upx;">可退{{Number(res.xhNum)-Number(res.refundNum)}}{{res.xhUnitName}}</text>
+					<text style="margin-left:10upx;">{{res.bigUnit}}</text>
+					<text style="color:green;margin-left:20upx;">可退{{Number(res.itemNum)-Number(res.refundNum)}}{{res.bigUnit}}</text>
 				</view>
 			</view>
 			</view>
@@ -59,7 +59,8 @@
 </template>
 <script>
 import TuiListCell from "@/components/plugin/list-cell";
-import { getDetail,refund } from "@/api/order/index";
+import { getPurchaseDetailApi } from "@/api/purchase";
+import { createOrder } from "@/api/cg-refund"
 export default {
 	name: "refund",
 	components: {
@@ -79,12 +80,11 @@ export default {
 	},
 	computed:{
 		refundPrice(){
-			console.log('tttt')
 			let price = 0
 			if(this.product){
 				for (const item of this.product) {
 					if(Number(item.refundCount)>0){
-						let currentPrice = Number(item.refundCount)*Number(item.xhUnitPrice)
+						let currentPrice = Number(item.refundCount)*Number(item.bigPrice)
 						currentPrice.toFixed(2)
 						price = Number(price) + Number(currentPrice)
 						price.toFixed(2)
@@ -108,7 +108,7 @@ export default {
 			let that = this
 			this.product.forEach(ele=>{
 				let currentRefundCont = ele.refundCount ? Number(ele.refundCount) :0
-				let currentNum = ele.xhNum ? Number(ele.xhNum) : 0
+				let currentNum = ele.itemNum ? Number(ele.itemNum) : 0
 				let hasRefundNum = ele.refundNum ? Number(ele.refundNum) : 0
 				let couldRefundNum = Number(currentNum) - Number(hasRefundNum)
 				if(Number(currentRefundCont) > Number(couldRefundNum)){
@@ -118,12 +118,11 @@ export default {
 				}
 				if(Number(ele.refundCount)>0){
 					product.push({
-						"productId":ele.productId,
-						"num":ele.refundCount,
-						"unitType":ele.unitType,
-						unitName:ele.xhUnitName,
-						unitType:ele.xhUnitType,
-						unitPrice:ele.xhUnitPrice
+						productId:ele.productId,
+						num:ele.refundCount,
+						unitType:0,
+						unitName:ele.bigUnit,
+						unitPrice:ele.bigPrice
 					})
 				}
 			})
@@ -131,20 +130,19 @@ export default {
 				return
 			}
 			if(this.$util.isEmpty(product)&&this.refundType==1){
-				uni.showToast({title:'请选择商品',icon:'none'})
+				uni.showToast({title:'请选择花材',icon:'none'})
 				return;
 			}
 			let refundParams = {
-				id:this.option.id,
+				id:this.orderInfo.id,
 				product:JSON.stringify(product),
 				price:this.refundMoney,
 				remark:this.remark,
-				refundType:this.refundType,
-				getOriginalItem:1
+				refundType:this.refundType
 			};
-			that.$util.confirmModal({content:'确认退款?'},() => {
+			that.$util.confirmModal({content:'确认申请?'},() => {
 				uni.showLoading({title: "提交中",mask:true})
-				refund(refundParams).then(res => {
+				createOrder(refundParams).then(res => {
 					if(res.code == 1){
 						uni.hideLoading()
 						uni.navigateTo({url:'/common/success',query:{titleType:1}})
@@ -153,15 +151,15 @@ export default {
 			})
 		},
 		async init() {
-			//getOriginalItem 取原有的花材结构(小菊的花材结构有变化)
-			const res = await getDetail({ id: this.option.id,getOriginalItem:1 })
+
+			const res = await getPurchaseDetailApi(this.option.orderSn)
 			this.orderInfo = res.data
-			
+
 			this.couldRefundPrice = Number(res.data.orderPrice) - Number(res.data.tkPrice)
 			this.couldRefundPrice = this.couldRefundPrice.toFixed(2)
 			this.couldRefundPrice = parseFloat(this.couldRefundPrice)
 
-			this.product = res.data.product.map(ele=>{
+			this.product = res.data.itemInfo.map(ele=>{
 				return {...ele,refundCount:null}
 			})
 		}