|
@@ -1,5 +1,4 @@
|
|
|
<template>
|
|
|
- <!-- #ifdef H5 -->
|
|
|
<zj-page-layout :hasFooter="true">
|
|
|
<view class="all-container">
|
|
|
<view class="common-title">产品信息</view>
|
|
@@ -53,18 +52,9 @@
|
|
|
</view>
|
|
|
</template>
|
|
|
</zj-page-layout>
|
|
|
- <!-- #endif -->
|
|
|
-
|
|
|
- <!-- #ifndef H5 -->
|
|
|
- <web-view
|
|
|
- :src="webViewHref(`/packageMaterial/pages/sale/order`, pam, crossPagePam)"
|
|
|
- @message="crossPage.$listener"
|
|
|
- ></web-view>
|
|
|
- <!-- #endif -->
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-// #ifdef H5
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -85,7 +75,7 @@ export default {
|
|
|
goodsList: [],
|
|
|
serviceList: [],
|
|
|
|
|
|
- remark: '',
|
|
|
+ remark: ''
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -95,115 +85,98 @@ export default {
|
|
|
// this.goodsList.forEach(item => {
|
|
|
// val = val + item.num;
|
|
|
// })
|
|
|
- return this.goodsList.length;
|
|
|
+ return this.goodsList.length
|
|
|
},
|
|
|
totalPrice() {
|
|
|
- let val = 0;
|
|
|
+ let val = 0
|
|
|
this.goodsList.forEach(item => {
|
|
|
- val = val + (item.num * (item.goodsAmount * 100) / 100);
|
|
|
+ val = val + (item.num * (item.goodsAmount * 100)) / 100
|
|
|
})
|
|
|
- return val;
|
|
|
+ return val
|
|
|
},
|
|
|
totalServicePrice() {
|
|
|
- let val = 0;
|
|
|
+ let val = 0
|
|
|
this.serviceList.forEach(item => {
|
|
|
- val = val + (item.num * (item.goodsAmount * 100) / 100);
|
|
|
+ val = val + (item.num * (item.goodsAmount * 100)) / 100
|
|
|
})
|
|
|
- return val;
|
|
|
- },
|
|
|
+ return val
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
onLoad() {
|
|
|
- let data = this.$getStorage('materialSaleData');
|
|
|
- if(data) {
|
|
|
- this.type = data.type;
|
|
|
- this.userMobile = data.userMobile;
|
|
|
- this.orderNo = data.orderNo;
|
|
|
+ let data = this.$getStorage('materialSaleData')
|
|
|
+ if (data) {
|
|
|
+ this.type = data.type
|
|
|
+ this.userMobile = data.userMobile
|
|
|
+ this.orderNo = data.orderNo
|
|
|
// this.salesType = data.salesType;
|
|
|
// this.brandId = data.brandId;
|
|
|
// this.brandName = data.brandName;
|
|
|
- this.categoryId = data.categoryId;
|
|
|
- this.categoryName = data.categoryName;
|
|
|
- this.websitId = data.websitId;
|
|
|
- this.websitName = data.websitName;
|
|
|
- this.wbIsAllFee = data.wbIsAllFee;
|
|
|
- this.wbPayType = data.wbPayType;
|
|
|
- if(this.type == 'P') {
|
|
|
- this.goodsList = data.goodsList.filter(o => o.normType == 'M');
|
|
|
- this.serviceList = data.goodsList.filter(o => o.normType == 'S');
|
|
|
+ this.categoryId = data.categoryId
|
|
|
+ this.categoryName = data.categoryName
|
|
|
+ this.websitId = data.websitId
|
|
|
+ this.websitName = data.websitName
|
|
|
+ this.wbIsAllFee = data.wbIsAllFee
|
|
|
+ this.wbPayType = data.wbPayType
|
|
|
+ if (this.type == 'P') {
|
|
|
+ this.goodsList = data.goodsList.filter(o => o.normType == 'M')
|
|
|
+ this.serviceList = data.goodsList.filter(o => o.normType == 'S')
|
|
|
this.serviceList.forEach(o => {
|
|
|
- o.goodsAmount = '';
|
|
|
+ o.goodsAmount = ''
|
|
|
})
|
|
|
- }else {
|
|
|
- this.goodsList = data.goodsList;
|
|
|
+ } else {
|
|
|
+ this.goodsList = data.goodsList
|
|
|
}
|
|
|
}
|
|
|
- this.$removeStorage('materialSaleData');
|
|
|
-
|
|
|
+ this.$removeStorage('materialSaleData')
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
-
|
|
|
-
|
|
|
confirmPartsDialog(e) {
|
|
|
- this.parts = this.partsList[e[0]];
|
|
|
- this.isShowPartsDialog = false;
|
|
|
+ this.parts = this.partsList[e[0]]
|
|
|
+ this.isShowPartsDialog = false
|
|
|
},
|
|
|
|
|
|
submitData(type) {
|
|
|
- let serviceList = JSON.parse(JSON.stringify(this.serviceList));
|
|
|
- if(this.type == 'P') {
|
|
|
- for(let i = 0; i < serviceList.length; i++) {
|
|
|
- if(!serviceList[i].goodsAmount && serviceList[i].goodsAmount !== 0) {
|
|
|
- return this.$toast('请输入服务费用价格');
|
|
|
+ let serviceList = JSON.parse(JSON.stringify(this.serviceList))
|
|
|
+ if (this.type == 'P') {
|
|
|
+ for (let i = 0; i < serviceList.length; i++) {
|
|
|
+ if (!serviceList[i].goodsAmount && serviceList[i].goodsAmount !== 0) {
|
|
|
+ return this.$toast('请输入服务费用价格')
|
|
|
}
|
|
|
}
|
|
|
serviceList.forEach(item => {
|
|
|
- item.normAmount = Number(item.goodsAmount);
|
|
|
+ item.normAmount = Number(item.goodsAmount)
|
|
|
})
|
|
|
}
|
|
|
- let goodsList = [
|
|
|
- ...JSON.parse(JSON.stringify(this.goodsList)),
|
|
|
- ...serviceList
|
|
|
- ];
|
|
|
+ let goodsList = [...JSON.parse(JSON.stringify(this.goodsList)), ...serviceList]
|
|
|
|
|
|
- let url = '', params = {};
|
|
|
- url = '/pay/buy';
|
|
|
- params.workerOrderItems = goodsList;
|
|
|
+ let url = '',
|
|
|
+ params = {}
|
|
|
+ url = '/pay/buy'
|
|
|
+ params.workerOrderItems = goodsList
|
|
|
|
|
|
- this.$api.postJson(url, {
|
|
|
- settlementType: this.salesType,
|
|
|
- goodsType: this.type,
|
|
|
- remark: this.remark,
|
|
|
- userMobile: this.userMobile,
|
|
|
- workerOrderId: this.orderNo,
|
|
|
- categoryId: this.categoryId || '',
|
|
|
- categoryName: this.categoryName || '',
|
|
|
- websitId: this.websitId,
|
|
|
- websitName: this.websitName,
|
|
|
- ...params,
|
|
|
- }).then(res => {
|
|
|
- this.$navToPage({
|
|
|
- url: `/packageMaterial/pages/sale/pay?handleOrderId=${res.data}&wbId=`
|
|
|
+ this.$api
|
|
|
+ .postJson(url, {
|
|
|
+ settlementType: this.salesType,
|
|
|
+ goodsType: this.type,
|
|
|
+ remark: this.remark,
|
|
|
+ userMobile: this.userMobile,
|
|
|
+ workerOrderId: this.orderNo,
|
|
|
+ categoryId: this.categoryId || '',
|
|
|
+ categoryName: this.categoryName || '',
|
|
|
+ websitId: this.websitId,
|
|
|
+ websitName: this.websitName,
|
|
|
+ ...params
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.$navToPage({
|
|
|
+ url: `/packageMaterial/pages/sale/pay?handleOrderId=${res.data}&wbId=`
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
- },
|
|
|
- },
|
|
|
-}
|
|
|
-
|
|
|
-// #endif
|
|
|
-// #ifndef H5
|
|
|
-export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- pam: {},
|
|
|
}
|
|
|
- },
|
|
|
- onLoad(pam) {
|
|
|
- this.pam = pam;
|
|
|
}
|
|
|
}
|
|
|
-// #endif
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|