| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- <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"
- alt="商品图"
- />
- <view class="item-info">
- <view class="info-line">
- <text class="item-name">{{ item.itemName }}</text>
- <text class="item-price">
- <text class="unit">¥</text>
- <text class="price">
- {{ getSelectItemPrice(item) }}
- </text>
- </text>
- </view>
- <view class="info-line">
- <text class="item-type">{{ item.rank }}级</text>
- <text class="item-count">
- <text v-if="item.bigCount > 0 || item.smallCount > 0">{{
- `${item.bigCount}`
- }}</text>
- <text v-if="item.smallCount > 0">/</text>
- <text v-if="item.smallCount > 0">{{ item.smallCount }}</text>
- </text>
- </view>
- </view>
- </view>
- </view>
- <view class="summary-bar">
- <view
- class="operate-view"
- @click="gobackEvent"
- >
- <text class="iconfont icongouwuche"></text>
- 重选花材
- </view>
- <view class="describe-view">
- 共{{ allCount }}种,
- <!-- 共16扎9支, -->
- 合计 ¥<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>
- <button
- class="admin-button-com mini-btn"
- :class="payType==i?'blue':'default'"
- style="margin-right: 10upx"
- @tap="payType=i"
- v-for="(res,i) in distributionList"
- :key="i"
- >
- {{ res }}
- </button>
- </tui-list-cell>
- <tui-list-cell
- class="line-cell"
- :hover="false"
- :arrow="true"
- >
- <view class="tui-title ">配送时间</view>
- <view
- class="tui-input"
- v-if="clientInfo.id"
- @click="showCustomer = true"
- >{{ clientInfo.name }}</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>
- <input
- type="number"
- placeholder="请填写包装费和材料费"
- v-model="packingMoney"
- placeholder-class="tui-placeholder"
- >
- </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"
- placeholder-class="tui-placeholder"
- >
- </tui-list-cell>
- <textarea
- name=""
- id=""
- cols="15"
- rows="5"
- placeholder="备注..."
- class="remarks"
- maxlength="60"
- ></textarea>
- <!-- <appFormSend :form.sync="form"> </appFormSend>-->
- </view>
- </form>
- </view>
- <view class="under-bar">
- <view class="price-view">
- <text class="price-title">收款</text>
- <text class="price-number">
- ¥ <text class="large">{{ allPrice+Number(packingMoney)+Number(freight) }}</text>
- </text>
- </view>
- <button
- class="admin-button-com blue middle"
- @click="affirmFormSubmit"
- >开单</button>
- </view>
- <!-- 选择客户 -->
- <AppCustomerSel
- :show.sync="showCustomer"
- @change="changeCustomerFn"
- />
- </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 AppCustomerSel from "@/components/app-customer-sel";
- import productMins from "@/mixins/product";
- import appFormRadioBtn from "@/components/app-formRadio-btn";
- import appAddressGroup from "@/components/app-address-group";
- import appSendTime from "@/components/app-send-time";
- import appFormSend from "@/components/app-form-send";
- const formUtil = require("@/utils/formValidation.js");
- import { createOrder, freight } from "@/api/order/index";
- // import { freight } from "@/api/order";
- import { mapActions, mapGetters } from "vuex";
- export default {
- name: "BillingAffirm", // 开单确认
- components: {
- TuiListCell,
- AppAvatarModule,
- SimpleAddress,
- AppAreaSel,
- AppCustomerSel,
- appFormRadioBtn,
- appAddressGroup,
- appSendTime,
- appFormSend
- },
- mixins: [productMins],
- data () {
- return {
- autoLoad: false,
- packingMoney: '',//包装费
- freight: '',//运费
- payType: null,//选中的-支付类型
- clientInfo: '',//客户信息
- showCustomer: false,
- distributionList: ['配送', '自取']
- };
- },
- onLoad () {
- if (!this.getMerchantInfo) {
- this.initMerchantInfo().then(data => {
- uni.setNavigationBarTitle({
- title: data.name
- });
- });
- } else {
- uni.setNavigationBarTitle({
- title: this.getMerchantInfo.name
- });
- }
- },
- computed: {
- ...mapGetters(["getMerchantInfo", "getLoginInfo", "getDictionariesInfo"])
- },
- methods: {
- ...mapActions(["initMerchantInfo"]),
- // 选取客户
- changeCustomerFn (info) {
- console.log("changeCustomerFn", info);
- this.clientInfo = info;
- },
- //确定开单
- affirmFormSubmit () {
- if (this.clientInfo == '') { uni.showToast({ title: '请选择客户!', icon: 'none' }); return; }
- if (this.packingMoney == '') { uni.showToast({ title: '请输入包装费!', icon: 'none' }); return; }
- if (this.payType == null) { uni.showToast({ title: '请选择结算方式!', icon: 'none' }); return; }
- const product = this.selectList.map(ele => {
- return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
- });
- let options = {
- orderType: 2,// 开单类型,1商品开单 2花材开单
- packingFee: this.packingMoney,// 包装费
- sendCost: this.freight,// 运费
- customId: this.clientInfo.id,// 客户
- payWay: this.payType,//付款方式
- product: JSON.stringify(product),//下单商品
- };
- let self = this;
- uni.showModal({
- title: '提示',
- content: '确认开单?',
- success: function (res) {
- if (res.confirm) {
- createOrder(options).then(res => {
- // this.$msg("下单成功");
- self.resetSelectInfoByType(self.pageType);
- const {
- data: { orderId, orderSn }
- } = res;
- let url = `/admin/billing/result?orderId=${orderId}&orderSn=${orderSn}&type=zuhe`;
- uni.redirectTo({ url: url });
- });
- }
- }
- });
- },
- gobackEvent () {
- uni.navigateBack({
- delta: 1
- });
- }
- }
- };
- </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: #666;
- font-size: 28upx;
- }
- .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: 26upx;
- .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: 36upx;
- }
- }
- }
- }
- .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;
- }
- }
- // .tui-placeholder,
- // .tui-input {
- // padding-right: 30upx;
- // width: 100%;
- // text-align: right;
- // }
- }
- }
- .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;
- }
- }
- }
- .remarks {
- padding: 30upx;
- font-size: 26upx;
- line-height: 30upx;
- height: 150upx;
- color: #666;
- }
- </style>
|