|
|
@@ -0,0 +1,336 @@
|
|
|
+<template>
|
|
|
+ <view class="affirm-page">
|
|
|
+ <view class="affirm-view overscroll">
|
|
|
+ <form>
|
|
|
+ <view class="module-com">
|
|
|
+ <view class="commodity-view">
|
|
|
+ <view class="commodity-list">
|
|
|
+ <view class="commodity-item" v-for="(item, index) in selectList" :key="index" >
|
|
|
+ <image class="item-icon" :src="item.cover" />
|
|
|
+ <view class="item-info">
|
|
|
+ <view class="info-line">
|
|
|
+ <text class="item-name">{{ item.itemName }}</text>
|
|
|
+ <text class="item-price">
|
|
|
+ <text class="price">
|
|
|
+ ¥
|
|
|
+ <text v-if="Number(item.bigCount) > 0">{{ parseFloat(Number(item.bigCount)*Number(item.userPrice).toFixed(2)) }}</text>
|
|
|
+ <text v-if="Number(item.smallCount) > 0">{{ parseFloat(Number(item.smallCount)*Number(item.userPrice).toFixed(2)) }}</text>
|
|
|
+ </text>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <view class="info-line">
|
|
|
+ <text class="item-type" v-if="item.ratioType == 0">{{item.ratio}}{{item.smallUnit}}/{{item.bigUnit}}</text>
|
|
|
+ <text class="item-type" v-else>若干{{item.smallUnit}}/{{item.bigUnit}}</text>
|
|
|
+ <text class="item-count">
|
|
|
+ ¥{{ item.userPrice ? parseFloat(item.userPrice) : 0 }} x
|
|
|
+ <text v-if="Number(item.bigCount) > 0">{{ item.bigCount }}{{item.bigUnit}}</text>
|
|
|
+ <text v-if="Number(item.smallCount) > 0">{{ item.smallCount }}{{item.smallUnit}}</text>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="summary-bar">
|
|
|
+ <view class="operate-view" @click="goBackChange">
|
|
|
+ <text class="iconfont icongouwuche"></text>返回修改
|
|
|
+ </view>
|
|
|
+ <view class="describe-view">
|
|
|
+ 共<text v-if="Number(allCount.bigLength)>0">{{ allCount.bigLength }}扎</text>
|
|
|
+ <text v-if="Number(allCount.smallLength)>0">{{ allCount.smallLength }}支</text>,
|
|
|
+ 合计 <text class="price">¥{{ allPrice }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="module-com input-line-wrap">
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title ">供货商</view>
|
|
|
+ <view class="tui-input" v-if="Number(ghsId)>0" @click="showCustomer = true">{{ ghsName }}</view>
|
|
|
+ <view class="tui-placeholder" style="width: 100%" v-else @click="showCustomer = true">没有供货商</view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false">
|
|
|
+ <view class="tui-title ">付款方式</view>
|
|
|
+ <button class="admin-button-com mini-btn" :class="payType==res.id?'blue':'default'"
|
|
|
+ style="margin-right: 10upx" @tap="payType=res.id" v-for="(res,i) in getDictionariesInfo.htPayWayOption" :key="i">
|
|
|
+ {{ res.name }}
|
|
|
+ </button>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title ">运费</view>
|
|
|
+ <input type="number" placeholder="选填" v-model="freight" @input="countAllPrices()" placeholder-class="tui-placeholder">
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title">总金额</view>
|
|
|
+ <text style="color: #3385FF" >{{(allPrice+Number(freight)).toFixed(2)}}</text>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ <tui-list-cell class="line-cell" :hover="false" :arrow="false" >
|
|
|
+ <view class="tui-title">实收金额</view>
|
|
|
+ <view class="flex-space" style="width: 100%;">
|
|
|
+ <input type="number" @focus="modifyPrice=''" v-model="modifyPrice" placeholder-class="tui-placeholder"/>
|
|
|
+ </view>
|
|
|
+ </tui-list-cell>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </form>
|
|
|
+ </view>
|
|
|
+ <view class="under-bar">
|
|
|
+ <view class="price-view">
|
|
|
+ <text class="price-title">总金额</text>
|
|
|
+ <text class="price-number">
|
|
|
+ <text class="large">¥{{ modifyPrice }}</text>
|
|
|
+ </text>
|
|
|
+ </view>
|
|
|
+ <button class="admin-button-com blue big" @click="affirmFormSubmit">提交</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import TuiListCell from "@/components/plugin/list-cell";
|
|
|
+import AppAvatarModule from "@/components/module/app-avatar";
|
|
|
+import SimpleAddress from "@/components/plugin/simple-address";
|
|
|
+import AppAreaSel from "@/components/app-area-sel";
|
|
|
+import productMins from "@/mixins/product";
|
|
|
+import appAddressGroup from "@/components/app-address-group";
|
|
|
+import appSendTime from "@/components/app-send-time";
|
|
|
+import { createOrder } from "@/api/order/index";
|
|
|
+import { mapActions, mapGetters } from "vuex";
|
|
|
+export default {
|
|
|
+ name: "addCgConfirm",
|
|
|
+ components: {
|
|
|
+ TuiListCell,
|
|
|
+ AppAvatarModule,
|
|
|
+ SimpleAddress,
|
|
|
+ AppAreaSel,
|
|
|
+ appAddressGroup,
|
|
|
+ appSendTime
|
|
|
+ },
|
|
|
+ mixins: [productMins],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ autoLoad: false,
|
|
|
+ freight:'',
|
|
|
+ modifyPrice:0,
|
|
|
+ payType:0,
|
|
|
+ showCustomer: false,
|
|
|
+ sendType:1,
|
|
|
+ selectJobType:'cgItem',
|
|
|
+ ghsId:0,
|
|
|
+ ghsName:''
|
|
|
+ };
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ this.selectJobId = this.option.ghsId ? this.option.ghsId : 0
|
|
|
+ this.ghsId = this.option.ghsId ? this.option.ghsId : 0
|
|
|
+ this.ghsName = this.option.ghsName ? this.option.ghsName : ''
|
|
|
+ if (!this.getMerchantInfo) {
|
|
|
+ this.initMerchantInfo().then(data => {
|
|
|
+ uni.setNavigationBarTitle({title:data.name})
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
+ title: this.getMerchantInfo.name
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.modifyPrice = this.allPrice.toFixed(2);
|
|
|
+ this.modifyPrice = parseFloat(this.modifyPrice)
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapGetters(["getMerchantInfo", "getLoginInfo","getDictionariesInfo"])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapActions(["initMerchantInfo"]),
|
|
|
+ countAllPrices(){
|
|
|
+ let allPrices = this.allPrice.toFixed(2)
|
|
|
+ this.modifyPrice = (Number(allPrices) + Number(this.freight)).toFixed(2);
|
|
|
+ this.modifyPrice = parseFloat(this.modifyPrice)
|
|
|
+ },
|
|
|
+ affirmFormSubmit(){
|
|
|
+ if(this.$util.isEmpty(this.selectList)){
|
|
|
+ this.$msg('请选择花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ let product = []
|
|
|
+ this.selectList.forEach((item,idx,arr) => {
|
|
|
+ let unitType = Number(item.bigCount)>0 ? 0 : 1
|
|
|
+ let num = Number(item.bigCount)>0 ? Number(item.bigCount) : Number(item.smallCount)
|
|
|
+ let unitPrice = item.userPrice ? item.userPrice : 0
|
|
|
+ let current = {productId:item.id,bigNum:item.bigCount,smallNum:item.smallCount,classId:item.classId,num:num,
|
|
|
+ itemId:item.itemId,property:item.property,unitType:unitType,unitPrice:unitPrice}
|
|
|
+ product.push(current)
|
|
|
+ })
|
|
|
+ let options = {
|
|
|
+ sendCost:this.freight,
|
|
|
+ ghsId:this.ghsId,
|
|
|
+ payWay:this.payType,
|
|
|
+ sendType:this.sendType,
|
|
|
+ modifyPrice: this.modifyPrice,
|
|
|
+ product:JSON.stringify(product),
|
|
|
+ hasPay:1
|
|
|
+ };
|
|
|
+ let that = this;
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确认提交?',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ createOrder(options).then(res => {
|
|
|
+ that.removeFromSaveDirect()
|
|
|
+ let url = '/pagesPurchase/addCgResult'
|
|
|
+ uni.redirectTo({url: url})
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ goBackChange() {
|
|
|
+ this.$util.pageTo({url: '/pagesPurchase/addCg',type:2,query: {ghsId: this.ghsId,ghsName:this.ghsName}})
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.admin-button-com {
|
|
|
+ margin-right: 20upx;
|
|
|
+}
|
|
|
+.affirm-page {
|
|
|
+ position: relative;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .affirm-view {
|
|
|
+ flex: 1;
|
|
|
+ padding: 20upx;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+ .commodity-view {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .commodity-list {
|
|
|
+ padding: 20upx;
|
|
|
+ .commodity-item {
|
|
|
+ display: flex;
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ .item-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ width: 140upx;
|
|
|
+ height: 140upx;
|
|
|
+ }
|
|
|
+ .item-info {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ flex: 1;
|
|
|
+ margin-left: 20upx;
|
|
|
+ .info-line {
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-end;
|
|
|
+ .item-name {
|
|
|
+ color: #333333;
|
|
|
+ font-size:30upx;
|
|
|
+ font-weight:bold;
|
|
|
+ }
|
|
|
+ .item-price {
|
|
|
+ color: #333;
|
|
|
+ font-size: 22upx;
|
|
|
+ .price {
|
|
|
+ font-size: 32upx;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .item-type {
|
|
|
+ color: #999;
|
|
|
+ font-size: 24upx;
|
|
|
+ }
|
|
|
+ .item-count {
|
|
|
+ color: #666;
|
|
|
+ font-size: 24upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .summary-bar {
|
|
|
+ padding: 0 20upx;
|
|
|
+ height: 90upx;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ border-top: 1px solid #eeeeee;
|
|
|
+ .operate-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #3385ff;
|
|
|
+ font-size: 30upx;
|
|
|
+ font-weight:bold;
|
|
|
+ .iconfont {
|
|
|
+ margin-right: 20upx;
|
|
|
+ font-size: 40upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .describe-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #333;
|
|
|
+ font-size: 24upx;
|
|
|
+ .price {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 34upx;
|
|
|
+ margin-left:8upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .module-com {
|
|
|
+ background-color: #fff;
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ border-radius: 10upx;
|
|
|
+ overflow: hidden;
|
|
|
+ .member-wrap {
|
|
|
+ .member-det {
|
|
|
+ font-size: 24upx;
|
|
|
+ margin-left: 20upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .remark-wrap {
|
|
|
+ align-items: flex-start;
|
|
|
+ .remark {
|
|
|
+ height: 240upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .under-bar {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 20upx;
|
|
|
+ width: 100%;
|
|
|
+ height: 100upx;
|
|
|
+ background-color: #fff;
|
|
|
+ box-shadow: 0upx -1px 6upx 0upx rgba(4, 0, 0, 0.06);
|
|
|
+ .price-view {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 24upx;
|
|
|
+ .price-title {
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ .price-number {
|
|
|
+ margin: 0 20upx;
|
|
|
+ color: #ff2842;
|
|
|
+ .large {
|
|
|
+ font-size: 40upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .admin-button-com {
|
|
|
+ width: 200upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|