123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459 |
- <template>
- <view class="container qualifications" :style="{ paddingBottom: isIphoneX ? '68rpx' : '0' }">
- <tui-skeleton
- v-if="skeletonShow"
- backgroundColor="#fafafa"
- borderRadius="10rpx"
- :isLoading="true"
- :loadingType="5"
- ></tui-skeleton>
- <view class="remarks-content" v-else>
- <template v-if="handleType === '1'">
- <view class="list-view-title">
- <view class="list-view-h1"
- >机构名称:<text class="none">{{ reportInfo.name }}</text></view
- >
- </view>
- <view class="list-view-title">
- <view class="list-view-h1"
- >联系人:<text class="none">{{ reportInfo.linkMan }}</text></view
- >
- </view>
- </template>
- <template v-else>
- <view class="list-view-title">
- <view class="list-view-h1"
- >咨询人:<text class="none">{{ reportInfo.questionMan }}</text></view
- >
- </view>
- </template>
- <view class="list-view-title"> <view class="list-view-h1">报备商品:</view> </view>
- <view class="tui-remarks-content">
- <view class="tui-remarks-goods-input" v-if="handleGoods.length === 0" @click="handleShowGoodPopup">
- <view class="input-add"> <text class="iconfont icon-jiahao"></text> </view>
- <view class="input-text"> 点击添加客户咨询的商品 </view>
- </view>
- <view class="tui-remarks-showgoods" v-else>
- <view class="tui-remarks-goods" v-for="(pros, index) in handleGoods" :key="index">
- <view class="goods-image"> <image :src="pros.image" mode=""></image> </view>
- <view class="goods-main">
- <view class="name"> {{ pros.name }} </view>
- <view class="shop"> 供应商:{{ pros.shopName }} </view>
- </view>
- </view>
- <view class="tui-remarks-btn">
- <view class="btn delete" @click="handleClean">删除</view>
- <view class="btn update" @click="handleShowGoodPopup">更换</view>
- </view>
- </view>
- </view>
- <view class="list-view-title">
- <view class="list-view-h1"><text>*</text>报备事由:</view>
- </view>
- <view class="remarks-textarea">
- <textarea
- class="textarea"
- v-if="handleType==='1'"
- v-model="reportClubParams.reportText"
- value=""
- placeholder="请输入其他需要说明的内容"
- maxlength="200"
- @input="conInput"
- />
- <textarea
- class="textarea"
- v-if="handleType==='2'"
- v-model="reportParams.reportText"
- value=""
- placeholder="请输入其他需要说明的内容"
- maxlength="200"
- @input="conInput"
- />
- <text class="limit-text">{{ min }}/{{ max }}</text>
- </view>
- </view>
- <view class="remarks-btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
- <view class="edit-button" @click="editButtonConfim">确定</view>
- </view>
- <!-- 商品列表弹窗 -->
- <cm-goodspopup
- ref="cmgoodspopup"
- v-if="isGoodspopup"
- :show="isGoodspopup"
- @handleChoiceaGoods="handleChoiceaGoodsData"
- >
- </cm-goodspopup>
- </view>
- </template>
- <script>
- import { mapState, mapMutations } from 'vuex'
- import authorize from '@/common/config/authorize.js'
- import cmGoodspopup from '../components/cm-goods-popup'
- export default {
- components: {
- cmGoodspopup
- },
- data() {
- return {
- isIphoneX: this.$store.state.isIphoneX,
- min: 0,
- max: 200,
- reportText: '',
- skeletonShow: true,
- isGoodspopup: false,
- handleGoods: [],
- handleType: '', // 1 机构添加报备 2 未注册客户添加报备
- reportClubParams: {
- serviceProviderId: 0,
- clubId: 0,
- productId: 0,
- reportText: ''
- },
- reportParams: {
- questionManId: 0,
- productId: 0,
- reportText: ''
- },
- reportInfo: {}
- }
- },
- onLoad(option) {
- console.log(option)
- this.handleType = option.type
- this.reportInfo = JSON.parse(option.reportInfo)
- if (this.handleType === '1') {
- // 机构新增报备
- this.reportClubParams.clubId = this.reportInfo.clubId
- } else {
- this.reportParams.questionManId = this.reportInfo.questionManId
- }
- this.initStorage()
- this.skeletonShow = false
- },
- methods: {
- ...mapMutations(['login']),
- async initStorage() {
- const userInfo = await this.$api.getStorage()
- this.reportClubParams.serviceProviderId = userInfo.serviceProviderId
- },
- editButtonConfim() {
- // 确定提交保存
- switch (this.handleType) {
- case '1': // 机构报备保存
- if (this.reportClubParams.reportText == '') {
- this.$util.msg('请输入报备事由', 2000)
- return
- }
- this.userClubReportSave()
- break
- case '2': // 咨询人报备保存
- if (this.reportParams.reportText == '') {
- this.$util.msg('请输入报备事由', 2000)
- return
- }
- this.userReportVisitorSave()
- break
- }
- },
- userClubReportSave() {
- // 机构报备保存
- this.UserService.userClubReportSave(this.reportClubParams)
- .then(response => {
- this.$util.msg('保存成功', 3000, true, 'success')
- this.isConfirmLoding = false
- setTimeout(() => {
- uni.navigateBack({
- delta: 1
- })
- }, 1000)
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- this.isConfirmLoding = false
- })
- },
- userReportVisitorSave() {
- // 未注册客户报备保存
- this.UserService.userReportVisitorSave(this.reportParams)
- .then(response => {
- this.$util.msg('保存成功', 3000, true, 'success')
- this.isConfirmLoding = false
- setTimeout(() => {
- uni.navigateBack({
- delta: 1
- })
- }, 1000)
- })
- .catch(error => {
- this.$util.msg(error.msg, 2000)
- this.isConfirmLoding = false
- })
- },
- handleShowGoodPopup() {
- // 显示添加商品弹窗
- this.isGoodspopup = true
- },
- handleClean() {
- //删除选择的商品
- this.handleGoods = []
- },
- handleChoiceaGoodsData(data) {
- this.handleGoods = []
- this.reportClubParams.productId = this.reportParams.productId = data.productId
- this.handleGoods.push(data)
- console.log('handleGoods', this.handleGoods)
- },
- conInput(e) {
- //备注文字字数限制
- let value = e.detail.value
- let len = parseInt(value.length)
- if (len > this.max) return
- this.min = len
- if (this.min == 200) {
- this.$util.msg('您输入的字数已达上限', 2000)
- }
- }
- },
- onShow() {}
- }
- </script>
- <style lang="scss">
- page {
- height: auto;
- background: #ffffff;
- }
- .remarks-content {
- width: 100%;
- height: auto;
- box-sizing: border-box;
- padding: 0 24rpx;
- padding-bottom: 80rpx;
- .list-view-title {
- width: 100%;
- height: auto;
- margin-bottom: 16rpx;
- margin-top: 40rpx;
- .list-view-h1 {
- line-height: 40rpx;
- font-size: $font-size-30;
- color: #333333;
- text-align: left;
- font-weight: bold;
- text {
- color: #ff2a2a;
- &.none {
- color: #999999;
- font-weight: normal;
- }
- }
- }
- }
- .remarks-textarea {
- width: 100%;
- height: 226rpx;
- padding: 16rpx;
- margin: 20rpx 0 0 0;
- border-radius: 6rpx;
- position: relative;
- border: 1px solid #b2b2b2;
- box-sizing: border-box;
- .textarea {
- width: 100%;
- height: 100%;
- line-height: 36rpx;
- font-size: $font-size-26;
- color: $text-color;
- z-index: 1;
- }
- .limit-text {
- position: absolute;
- right: 20rpx;
- bottom: 16rpx;
- line-height: 44rpx;
- font-size: $font-size-24;
- color: #b2b2b2;
- }
- }
- .tui-remarks-content {
- width: 100%;
- height: auto;
- margin-bottom: 24rpx;
- .tui-remarks-goods-input {
- width: 100%;
- height: 180rpx;
- box-sizing: border-box;
- background-color: #f7f7f7;
- padding: 26rpx;
- border-radius: 6rpx;
- .input-add {
- width: 128rpx;
- height: 128rpx;
- line-height: 128rpx;
- float: left;
- text-align: center;
- box-sizing: border-box;
- border: 1px dashed #b2b2b2;
- border-radius: 6rpx;
- .iconfont {
- font-size: 44rpx;
- color: #b2b2b2;
- }
- }
- .input-text {
- height: 128rpx;
- box-sizing: border-box;
- padding: 0 32rpx;
- line-height: 128rpx;
- text-align: left;
- font-size: 26rpx;
- color: #b2b2b2;
- float: left;
- }
- }
- .tui-remarks-showgoods {
- width: 100%;
- height: 180rpx;
- box-sizing: border-box;
- .tui-remarks-btn {
- width: 90rpx;
- height: 180rpx;
- float: right;
- .btn {
- width: 100%;
- height: 90rpx;
- float: left;
- line-height: 90rpx;
- text-align: center;
- font-size: 26rpx;
- &.delete {
- color: #f94b4b;
- }
- &.update {
- color: #1890f9;
- }
- }
- }
- .tui-remarks-goods {
- width: 612rpx;
- height: 180rpx;
- box-sizing: border-box;
- background-color: #f7f7f7;
- padding: 26rpx;
- border-radius: 6rpx;
- float: left;
- .goods-image {
- width: 128rpx;
- height: 128rpx;
- float: left;
- image {
- width: 128rpx;
- height: 128rpx;
- display: block;
- border-radius: 4rpx;
- }
- }
- .goods-main {
- width: 432rpx;
- height: 128rpx;
- box-sizing: border-box;
- padding-left: 32rpx;
- float: right;
- .name {
- width: 100%;
- height: 60rpx;
- box-sizing: border-box;
- line-height: 60rpx;
- color: #333333;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- line-clamp: 1;
- -webkit-box-orient: vertical;
- font-size: 26rpx;
- }
- .shop {
- line-height: 60rpx;
- color: #999999;
- font-size: 26rpx;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- line-clamp: 1;
- -webkit-box-orient: vertical;
- }
- }
- }
- }
- }
- .list-view {
- width: 100%;
- height: auto;
- margin-top: 20rpx;
- .list-view-text {
- width: 100%;
- float: left;
- .input {
- width: 500rpx;
- height: 50rpx;
- box-sizing: border-box;
- line-height: 50rpx;
- color: #333333;
- text-overflow: ellipsis;
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- line-clamp: 1;
- -webkit-box-orient: vertical;
- float: left;
- font-size: 26rpx;
- }
- .delbtn {
- width: 96rpx;
- height: 44rpx;
- border-radius: 8rpx;
- font-size: $font-size-24;
- color: #FF5B00;
- line-height: 44rpx;
- text-align: center;
- float: left;
- &.down {
- color: #1890f9;
- }
- }
- }
- }
- }
- .remarks-btn {
- width: 100%;
- padding-top: 20rpx;
- position: fixed;
- bottom: 0;
- left: 0;
- background-color: #ffffff;
- z-index: 99;
- .edit-button-canel {
- width: 100%;
- height: 88rpx;
- line-height: 88rpx;
- text-align: center;
- color: #FF5B00;
- font-size: $font-size-24;
- }
- .edit-button {
- width: 600rpx;
- height: 90rpx;
- background: $btn-confirm;
- line-height: 90rpx;
- text-align: center;
- color: #ffffff;
- font-size: $font-size-30;
- margin: 0 auto;
- border-radius: 45rpx;
- }
- }
- </style>
|