123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- <template>
- <!-- #ifdef H5 -->
- <zj-page-layout :hasFooter="true">
- <view class="all-container">
- <view class="common-title">产品信息</view>
- <view class="product-container card">
- <view class="it" v-for="(item, index) in goodsList" :key="index">
- <view class="name"
- >({{ { INNER: '保内', OUTSIDE: '保外' }[item.repairFlag] }}){{ item.goodsName
- }}<text>×{{ item.num }}{{ item.goodsUnit }}</text></view
- >
- <view class="price">¥{{ item.repairFlag == 'INNER' ? 0 : (item.goodsAmount * item.num) | priceFilter }}</view>
- </view>
- <view class="total">
- <view class="text">合计:</view>
- <view class="price">¥{{ totalPrice | priceFilter }}</view>
- </view>
- </view>
- <block v-if="type == 'P'">
- <view class="common-title">服务费用</view>
- <view class="form-container card">
- <view class="item">
- <view class="label">其他费用</view>
- <u--input placeholder="请输入金额" inputAlign="right" v-model="otherPrice"></u--input>
- </view>
- <view class="item">
- <view class="label">服务费用</view>
- <u--input placeholder="请输入金额" inputAlign="right" v-model="servicePrice"></u--input>
- </view>
- <view class="total">
- <view class="text">合计:</view>
- <view class="price">¥{{ (Number(otherPrice) + Number(servicePrice)) | priceFilter }}</view>
- </view>
- </view>
- </block>
- <view class="common-title">备注</view>
- <view class="remark-container card">
- <u--textarea v-model="remark" placeholder="请输入内容" border="none" autoHeight></u--textarea>
- </view>
- </view>
- <template slot="footer">
- <view class="bottom-container">
- <view class="left">
- <view class="text">共{{ totalNum }}件,合计:</view>
- <view class="price"
- >¥{{ (Number(otherPrice) + Number(servicePrice) + Number(totalPrice)) | priceFilter }}</view
- >
- </view>
- <view class="btn">
- <u-button
- type="primary"
- text="确认订单"
- @click="submitData(1)"
- v-if="!wbId || (wbId && wbIsAllFee == 'NO' && wbPayType == 'SITE')"
- ></u-button>
- <u-button type="primary" text="提交申请" @click="submitData(2)" v-else></u-button>
- </view>
- </view>
- </template>
- </zj-page-layout>
- <!-- #endif -->
- <!-- #ifndef H5 -->
- <web-view
- :src="webViewHref(`/packageMaterial/pages/newSale/order`, pam, crossPagePam)"
- @message="crossPage.$listener"
- ></web-view>
- <!-- #endif -->
- </template>
- <script>
- // #ifdef H5
- export default {
- data() {
- return {
- type: 'M',
- userMobile: '',
- orderNo: '',
- salesType: "",
- brandId: "",
- brandName: "",
- categoryId: "",
- categoryName: "",
- websitId: "",
- websitName: "",
- wbId: null, // 维保工单
- wbIsAllFee: null, // 维保工单是否包含全部费用
- wbPayType: null, // 维保工单费用支付方式
- goodsList: [],
- remark: '',
- otherPrice: "",
- servicePrice: ""
- }
- },
- computed: {
- totalNum() {
- let val = 0;
- this.goodsList.forEach(item => {
- val = val + item.num;
- })
- return val
- },
- totalPrice() {
- let val = 0;
- this.goodsList.filter(item=>item.repairFlag=='OUTSIDE').forEach(item => {
- val = val + (item.num * (item.goodsAmount * 100) / 100);
- })
- return val;
- },
- },
- onLoad() {
- let data = this.$getStorage('materialSaleDataZhiFu');
- if(data) {
- this.type = data.type;
- this.userMobile = data.userMobile;
- this.orderNo = data.orderNo;
- this.categoryId = data.categoryId;
- this.categoryName = data.categoryName;
- this.websitId = data.websitId;
- this.websitName = data.websitName;
- this.wbId = data.wbId;
- this.wbIsAllFee = data.wbIsAllFee;
- this.wbPayType = data.wbPayType;
- this.goodsList = data.goodsList;
- }
- },
- onHide: function () {
- this.$removeStorage('materialSaleData');
- },
- methods: {
- submitData(type) {
- if ((Number(this.otherPrice)+0)!==Number(this.otherPrice)) return this.$toast(`其他费用需要为数字`)
- if ((Number(this.servicePrice)+0)!==Number(this.servicePrice)) return this.$toast(`服务费用需要为数字`)
- this.$api.postJson('/pay/buy', {
- settlementType: this.salesType,
- goodsType: this.type,
- remark: this.remark,
- userMobile: this.userMobile,
- workerOrderId: this.orderNo,
- categoryId: this.categoryId || '123',
- categoryName: this.categoryName || '123',
- websitId: this.websitId,
- websitName: this.websitName,
- workerOrderItems: this.goodsList,
- otherPrice: this.otherPrice,
- servicePrice: this.servicePrice,
- }).then(res => {
- this.$navToPage({
- url: `/packageMaterial/pages/newSale/pay?handleOrderId=${res.data}&wbId=${this.wbId}`
- }, "redirectTo")
- })
- },
- },
- }
- // #endif
- // #ifndef H5
- export default {
- data() {
- return {
- pam: {},
- }
- },
- onLoad(pam) {
- this.pam = pam;
- }
- }
- // #endif
- </script>
- <style lang="scss" scoped>
- .all-container {
- padding: 0 20rpx;
- }
- .common-title {
- font-size: 32rpx;
- font-weight: 600;
- margin-top: 30rpx;
- }
- .card {
- @include zj-card;
- margin-top: 20rpx;
- padding: 30rpx;
- }
- .product-container {
- .it {
- display: flex;
- align-items: flex-end;
- margin-bottom: 20rpx;
- .name {
- flex: 1;
- font-size: 28rpx;
- font-weight: 500;
- text {
- color: $sec-font;
- margin-left: 12rpx;
- font-weight: normal;
- }
- }
- .price {
- margin-left: 30rpx;
- font-size: 28rpx;
- font-weight: 500;
- }
- }
- .total {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- margin-top: 30rpx;
- .text {
- font-size: 28rpx;
- color: $sec-font;
- }
- .price {
- font-size: 28rpx;
- color: $minor-color;
- font-weight: 500;
- }
- }
- }
- .remark-container {
- padding: 0;
- ::v-deep .u-textarea {
- padding: 20rpx 30rpx;
- min-height: 200rpx;
- }
- }
- .form-container {
- .item {
- height: 50rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-top: 30rpx;
- &:first-child {
- margin-top: 0;
- }
- .label {
- margin-right: 30rpx;
- flex-shrink: 0;
- text {
- color: $sec-font;
- margin-left: 12rpx;
- font-weight: normal;
- }
- }
- .picker {
- display: flex;
- align-items: center;
- .placeholder {
- color: $sec-font;
- }
- .iconfont {
- margin-left: 12rpx;
- color: $sec-font;
- }
- }
- .value {
- flex: 1;
- text-align: right;
- }
- }
- .total {
- display: flex;
- align-items: center;
- justify-content: flex-end;
- margin-top: 30rpx;
- .text {
- font-size: 28rpx;
- color: $sec-font;
- }
- .price {
- font-size: 28rpx;
- color: $minor-color;
- font-weight: 500;
- }
- }
- }
- .bottom-container {
- padding: 20rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- .left {
- display: flex;
- align-items: center;
- .text {
- font-size: 28rpx;
- color: $sec-font;
- }
- .price {
- font-size: 32rpx;
- color: $minor-color;
- font-weight: 500;
- }
- }
- .btn {
- width: 180rpx;
- }
- }
- </style>
|