|
|
@@ -0,0 +1,370 @@
|
|
|
+<!--
|
|
|
+ 无原单退款 · 选花材页
|
|
|
+ 用途:工作台「退款」选客户后选花材(含单价/数量),不改动开单 index2 / product2;不走多颜色专用页。
|
|
|
+ 谁用:selectCustom?refund=1 → 本页 → freeRefundConfirm。
|
|
|
+-->
|
|
|
+<template>
|
|
|
+ <view class="app-content">
|
|
|
+ <view class="billing_box_bg">
|
|
|
+ <view class="input-wrap">
|
|
|
+ <view class="header-action-wrap header-action-wrap--left">
|
|
|
+ <button class="admin-button-com blue header-action-btn" @click="selectFlowerNumFn()">图片分类</button>
|
|
|
+ </view>
|
|
|
+ <view class="search-bar">
|
|
|
+ <app-search-module ref="globalSearchRef" v-model="globalPy" placeholder="这里搜索" @input="globalSearch" />
|
|
|
+ </view>
|
|
|
+ <view class="header-action-wrap header-action-wrap--right">
|
|
|
+ <button class="admin-button-com blue header-action-btn header-action-btn--clear" @click="removeFromSave(0)">清除花材</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <button class="admin-button-com middle blue next-btn" @click="confirmToSave">选好了</button>
|
|
|
+
|
|
|
+ <view class="scroll-middle_bx">
|
|
|
+ <scroll-view scroll-y scroll-with-animation class="tab-view">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in globalClassData"
|
|
|
+ :key="index"
|
|
|
+ class="tab-bar-item"
|
|
|
+ :class="globalClassIndex == index ? 'active' : ''"
|
|
|
+ :data-current="index"
|
|
|
+ @tap.stop="globalSwitchClass(index, item)"
|
|
|
+ >
|
|
|
+ <text style="text-align: center;">{{ item.name || '' }}</text>
|
|
|
+ </div>
|
|
|
+ <view style="height: 120upx"></view>
|
|
|
+ </scroll-view>
|
|
|
+ <scroll-view
|
|
|
+ scroll-y
|
|
|
+ class="right-box"
|
|
|
+ :scroll-top="globalScrollTopPlace"
|
|
|
+ @scroll="globalGetScroll"
|
|
|
+ :scroll-into-view="scroll_into_view"
|
|
|
+ scroll-with-animation="true"
|
|
|
+ lower-threshold="100"
|
|
|
+ @scrolltolower="globalScrollBottom"
|
|
|
+ >
|
|
|
+ <block v-if="!$util.isEmpty(globalItemData)">
|
|
|
+ <view class="item_list_bx selectAll">
|
|
|
+ <template v-for="(productItem, productIndex) in globalItemData">
|
|
|
+ <view class="item_list_title" v-if="productItem.className && productItem.className!=''">{{ productItem.className }}</view>
|
|
|
+ <view class="item-row item-row--h175" :class="{ 'item-row--remark': productItem.itemRemark }" :key="productIndex">
|
|
|
+ <!-- 不传 selectJobType=bill,避免多颜色进开单专用页 -->
|
|
|
+ <Commondity
|
|
|
+ :globalCheckStock="false"
|
|
|
+ :selectJobType="selectJobType"
|
|
|
+ :info="productItem"
|
|
|
+ @showAddModelFn="showAddModelFn"
|
|
|
+ @replaceItemFn="replaceItemFn"
|
|
|
+ ></Commondity>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </view>
|
|
|
+ <view style="height: 200upx;"></view>
|
|
|
+ </block>
|
|
|
+ <block v-else>
|
|
|
+ <app-wrapper-empty title="加载中" :is-empty="$util.isEmpty(globalItemData)" />
|
|
|
+ </block>
|
|
|
+ </scroll-view>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- 退款选花:本页自管单价/数量弹框,不改 product2 -->
|
|
|
+ <modal-module :show="isAddModel" @cancel="addItemModelHidden" @click="confirmAddItemModel" :title="customData.name" color="#333" :size="32" padding="30rpx 30rpx">
|
|
|
+ <template slot="customContent">
|
|
|
+ <view class="select-cmd_bx" v-if="customData">
|
|
|
+ <view class="kc">
|
|
|
+ <text>库存 {{ customData.stock ? parseFloat(customData.stock) : 0 }}</text>
|
|
|
+ <text style="margin-left:14upx;">¥{{ parseFloat(customData.price || 0) }}</text>
|
|
|
+ <text style="margin-left:14upx;">{{ customData.ratio }}{{ customData.smallUnit }}/{{ customData.bigUnit }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="num_bx">
|
|
|
+ <input
|
|
|
+ style="width:280upx"
|
|
|
+ v-model="customData.userPrice"
|
|
|
+ @focus="customData.userPrice = null"
|
|
|
+ type="digit"
|
|
|
+ placeholder="退款单价"
|
|
|
+ />
|
|
|
+ <text style="font-size:35upx;font-weight:bold;color:#666666;">元</text>
|
|
|
+ </view>
|
|
|
+ <view class="num_bx">
|
|
|
+ <!-- #ifdef APP-PLUS -->
|
|
|
+ <input style="width: 280upx" v-model="customData.bigCount" v-if="globalUnitType == 0" type="number" />
|
|
|
+ <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">{{ customData.bigUnit }}</text>
|
|
|
+ <input style="width: 280upx" v-model="customData.smallCount" v-if="globalUnitType == 1" type="number" />
|
|
|
+ <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">{{ customData.smallUnit }}</text>
|
|
|
+ <!-- #endif -->
|
|
|
+ <!-- #ifdef MP-WEIXIN -->
|
|
|
+ <input style="width: 280upx" v-model="customData.bigCount" v-if="globalUnitType == 0" :focus="isAddInputFocus" type="number" />
|
|
|
+ <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 0">{{ customData.bigUnit }}</text>
|
|
|
+ <input style="width: 280upx" v-model="customData.smallCount" v-if="globalUnitType == 1" :focus="isAddInputFocus" type="number" />
|
|
|
+ <text style="font-size:35upx;font-weight:bold;color:#666666;" v-if="globalUnitType == 1">{{ customData.smallUnit }}</text>
|
|
|
+ <!-- #endif -->
|
|
|
+ <image
|
|
|
+ @click="switchGlobalUnitType"
|
|
|
+ :src="`${constant.imgUrl}/icon/switch/switch128.png`"
|
|
|
+ style="width:86upx;height:86upx;"
|
|
|
+ mode="widthFix"
|
|
|
+ ></image>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </template>
|
|
|
+ </modal-module>
|
|
|
+
|
|
|
+ <footer-cart :price="allPrice" :count="allCount" @confirm="confirmToSave"></footer-cart>
|
|
|
+
|
|
|
+ <uni-popup ref="globalClassImgRef" background-color="#fff" type="center" :animation="false" class="class-popup-style">
|
|
|
+ <view class="class-img-wrap">
|
|
|
+ <view v-for="(item, index) in globalClassData" :key="index" @tap.stop="globalChangeClass(index, item)" class="class-img-item">
|
|
|
+ <image :src="item.cover" class="class-cover"></image>
|
|
|
+ <view class="class-name">{{ item.name }}</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import AppSearchModule from '@/components/module/app-search'
|
|
|
+import AppWrapperEmpty from '@/components/app-wrapper-empty'
|
|
|
+import Commondity from '@/components/module/app-commodity'
|
|
|
+import FooterCart from '@/components/module/app-footer-cart'
|
|
|
+import ModalModule from '@/components/plugin/modal'
|
|
|
+import productMins from '@/mixins/product2'
|
|
|
+import { copyObject } from '@/utils/util'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'freeRefund',
|
|
|
+ components: {
|
|
|
+ AppSearchModule,
|
|
|
+ AppWrapperEmpty,
|
|
|
+ Commondity,
|
|
|
+ ModalModule,
|
|
|
+ FooterCart
|
|
|
+ },
|
|
|
+ mixins: [productMins],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 独立购物车键,与开单 bill 隔离
|
|
|
+ selectJobType: 'freeRefund',
|
|
|
+ autoLoad: false,
|
|
|
+ globalCheckStock: false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad() {
|
|
|
+ const name = this.option && this.option.customName ? this.option.customName : ''
|
|
|
+ uni.setNavigationBarTitle({ title: name ? (name + ' · 退款选花材') : '退款选花材' })
|
|
|
+ if (this.option && this.option.customId) {
|
|
|
+ this.selectJobId = this.option.customId
|
|
|
+ this.globalCustomId = this.option.customId
|
|
|
+ }
|
|
|
+ // 可选无库存花材(退货回库)
|
|
|
+ this.globalCheckStock = false
|
|
|
+ this.globalRequestType = 'book'
|
|
|
+ this.initData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectFlowerNumFn() {
|
|
|
+ this.$refs.globalClassImgRef.open('top')
|
|
|
+ },
|
|
|
+ switchGlobalUnitType() {
|
|
|
+ if (this.globalUnitType == 0) {
|
|
|
+ this.globalUnitType = 1
|
|
|
+ this.customData.bigCount = null
|
|
|
+ } else {
|
|
|
+ this.globalUnitType = 0
|
|
|
+ this.customData.smallCount = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 打开加购弹框:默认带单价;不校验库存;不进多颜色流程
|
|
|
+ */
|
|
|
+ showAddModelFn(info) {
|
|
|
+ if (Number(info.smallCount) > 0) {
|
|
|
+ this.globalUnitType = 1
|
|
|
+ } else {
|
|
|
+ this.globalUnitType = 0
|
|
|
+ }
|
|
|
+ this.isAddModel = true
|
|
|
+ this.customData = copyObject(info)
|
|
|
+ this.isAddInputFocus = false
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.customData.smallCount = this.customData.smallCount == 0 ? null : this.customData.smallCount
|
|
|
+ this.customData.bigCount = this.customData.bigCount == 0 ? null : this.customData.bigCount
|
|
|
+ if (this.customData.userPrice == null || this.customData.userPrice == 0) {
|
|
|
+ this.customData.userPrice = parseFloat(this.customData.bigPrice || this.customData.price || 0)
|
|
|
+ }
|
|
|
+ this.isAddInputFocus = true
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 确认加购:本页校验数量+单价(不依赖 product2 的 bill 分支)
|
|
|
+ */
|
|
|
+ confirmAddItemModel(val) {
|
|
|
+ if (val.index === 0) {
|
|
|
+ this.addItemModelHidden()
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ const bigOk = /(^[1-9]\d*$)/.test(this.customData.bigCount)
|
|
|
+ const smallOk = /(^[1-9]\d*$)/.test(this.customData.smallCount)
|
|
|
+ if (!bigOk && !smallOk) {
|
|
|
+ uni.showToast({ title: '请填写数量', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (bigOk && Number(this.customData.bigCount) <= 0) {
|
|
|
+ uni.showToast({ title: '数量要大于0', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (smallOk && Number(this.customData.smallCount) <= 0) {
|
|
|
+ uni.showToast({ title: '数量要大于0', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const priceReg = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
|
|
|
+ if (!priceReg.test(this.customData.userPrice)) {
|
|
|
+ uni.showToast({ title: '金额错误', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (Number(this.customData.userPrice) <= 0) {
|
|
|
+ uni.showToast({ title: '金额要大于0', icon: 'none' })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.replaceItemFn(this.customData, 1)
|
|
|
+ this.addItemModelHidden()
|
|
|
+ },
|
|
|
+ confirmToSave() {
|
|
|
+ if (this.$util.isEmpty(this.selectList)) {
|
|
|
+ this.$msg('请选择花材')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (this.$util.isEmpty(this.option.customId)) {
|
|
|
+ this.$msg('请选择客户')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const customName = this.option.customName ? this.option.customName : ''
|
|
|
+ this.$util.pageTo({
|
|
|
+ url: '/admin/billing/freeRefundConfirm',
|
|
|
+ type: 2,
|
|
|
+ query: {
|
|
|
+ customId: this.option.customId,
|
|
|
+ customName: customName,
|
|
|
+ refund: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+@import '@/static/css/item-list-row.scss';
|
|
|
+
|
|
|
+.billing_box_bg {
|
|
|
+ background: white;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ .input-wrap {
|
|
|
+ display: flex;
|
|
|
+ padding: 22upx 20upx 22upx 13upx;
|
|
|
+ align-items: center;
|
|
|
+ .search-bar {
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .header-action-wrap {
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+ .header-action-wrap--left {
|
|
|
+ margin-right: 10upx;
|
|
|
+ }
|
|
|
+ .header-action-wrap--right {
|
|
|
+ margin-left: 10upx;
|
|
|
+ }
|
|
|
+ .next-btn {
|
|
|
+ position: absolute;
|
|
|
+ top: 140upx;
|
|
|
+ right: 24upx;
|
|
|
+ z-index: 99;
|
|
|
+ }
|
|
|
+ .scroll-middle_bx {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
+ .tab-view {
|
|
|
+ position: relative;
|
|
|
+ height: calc(100vh - 140upx);
|
|
|
+ width: 170upx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ background-color: #f0f2f6;
|
|
|
+ .tab-bar-item {
|
|
|
+ width: 170upx;
|
|
|
+ height: 90upx;
|
|
|
+ box-sizing: border-box;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ font-size: 26upx;
|
|
|
+ color: #444;
|
|
|
+ &:last-child {
|
|
|
+ margin-bottom: 110upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ color: $mainColor;
|
|
|
+ background: #fff;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right-box {
|
|
|
+ flex: 1;
|
|
|
+ height: calc(100vh - 140upx);
|
|
|
+ }
|
|
|
+}
|
|
|
+.select-cmd_bx {
|
|
|
+ .kc {
|
|
|
+ font-size: 24upx;
|
|
|
+ color: #666;
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ }
|
|
|
+ .num_bx {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-top: 20upx;
|
|
|
+ input {
|
|
|
+ border: 1upx solid #ccc;
|
|
|
+ height: 70upx;
|
|
|
+ padding: 0 16upx;
|
|
|
+ margin-right: 12upx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.class-img-wrap {
|
|
|
+ display: flex;
|
|
|
+ padding: 20upx;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ max-height: 100vh;
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+.class-img-item {
|
|
|
+ margin-bottom: 20upx;
|
|
|
+ margin-left: 3upx;
|
|
|
+}
|
|
|
+.class-cover {
|
|
|
+ width: 120upx;
|
|
|
+ height: 120upx;
|
|
|
+ border-radius: 10upx;
|
|
|
+}
|
|
|
+.class-name {
|
|
|
+ margin-top: 5upx;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ width: 120upx;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+</style>
|