| | |
| | | <view @click.stop="clickButton('inpass')" class="button button-search-inpass" style="flex:5"></view>
|
| | | <view @click.stop="clickButton('delete')" class="button button-search-delete" style="margin-top: -1rpx;">
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="top-buttons" v-if="type==='delete'">
|
| | | <view v-if="type === 'delete'" class="button t-red " @click.stop="deleteSelected()">删除</view>
|
| | | <view v-if="type === 'delete'" class="button " @click.stop="recoverSelected()">恢复</view>
|
| | | </view>
|
| | | <view class="p15" style="min-height: calc(100vh - 500rpx);">
|
| | | <no-data v-if="!list||list.length==0" style="width: 100%;"></no-data>
|
| | | |
| | | <view v-for="(item,index) in list" :key="index" class="m-b-24 flow-manage-list">
|
| | | <!-- <view v-if="type === 'delete'"><checkbox class="checkbox" :value="item.id" v-model="selectedFlowers" /> </view>
|
| | | -->
|
| | | <view class="flow-manage-list-item-radio" v-if="type === 'delete'"><radio :checked="isSelected(item.id)" @click="changeItem(item)"></radio></view>
|
| | | <view class="flow-manage-list-item">
|
| | | <view class="flex m-r-6">
|
| | | <view class="img flower-img m-r-6">
|
| | | <view class="img flower-img m-r-6"> |
| | | <image class="flower-img img100 " :src="item.cover"
|
| | | :class="[!item.stock?'component-stock-zero':'']" @click="previewImg(item.cover)">
|
| | |
|
| | | </image>
|
| | | <view class="status" :class="[!item.stock?'zero':'']" v-if="item.statusStr">
|
| | | {{ item.statusStr}}
|
| | |
| | | <view class="flex1">
|
| | | <view class=" flex">
|
| | | <view class="title">{{item.name}}<span class="level">{{item.levelStr}}</span></view>
|
| | | <view class="m-l-a m-r-0" ><span class="label">排名</span><span class="value">{{item.typeRank || '-'}}</span></view>
|
| | | |
| | | <view class="m-l-a m-r-0">
|
| | | {{item.categoryStr || '-'}}
|
| | | </view>
|
| | |
| | | currentInputDto: {},
|
| | | currentInputKey: '',
|
| | | inputplaceholder: '',
|
| | | selectedFlowers: [], // 存储选中的花的 ID
|
| | | ids: [],
|
| | | }
|
| | | },
|
| | | onShow() {
|
| | |
| | | })
|
| | | }
|
| | | },
|
| | | // 删除选中的花卉
|
| | | async deleteSelected() {
|
| | | if (this.selectedFlowers.length === 0) {
|
| | | this.$message.showToast('请选择要删除的商品');
|
| | | return;
|
| | | }
|
| | | |
| | | // 确认框
|
| | | await this.$message.confirm('确定删除此商品吗')
|
| | | |
| | | var dto = {
|
| | | ids: this.selectedFlowers,
|
| | | }
|
| | | |
| | | this.$message.showLoading()
|
| | | this.$http.request('post', '/api/supplier/flower/list/delete/batch' , {
|
| | | data: dto
|
| | | }).then(res => {
|
| | | if (res.code == 0) {
|
| | | this.$message.showToast('操作成功')
|
| | | this.refreshList()
|
| | | |
| | | }
|
| | | }).finally(() => {
|
| | | this.$message.hideLoading()
|
| | | })
|
| | | |
| | | |
| | | },
|
| | | async recoverSelected() {
|
| | | if (this.selectedFlowers.length === 0) {
|
| | | this.$message.showToast('请选择恢复的商品');
|
| | | return;
|
| | | }
|
| | | |
| | | // 确认框
|
| | | await this.$message.confirm('确定恢复此商品吗')
|
| | | |
| | | var dto = {
|
| | | ids: this.selectedFlowers,
|
| | | }
|
| | | |
| | | this.$message.showLoading()
|
| | | this.$http.request('post', '/api/supplier/flower/list/restore/batch' , {
|
| | | data: dto
|
| | | }).then(res => {
|
| | | if (res.code == 0) {
|
| | | this.$message.showToast('操作成功')
|
| | | this.refreshList()
|
| | | }
|
| | | }).finally(() => {
|
| | | this.$message.hideLoading()
|
| | | })
|
| | | |
| | | |
| | | },
|
| | | changeItem(item) {
|
| | | const id = item.id;
|
| | | // 判断selectedFlowers里面是否有item.id, 如果有则去掉,没有就加入
|
| | | if (this.selectedFlowers.includes(id)) {
|
| | | // 移除选中的ID
|
| | | this.selectedFlowers = this.selectedFlowers.filter(flowerId => flowerId !== id);
|
| | | } else {
|
| | | // 添加选中的ID
|
| | | this.selectedFlowers.push(id);
|
| | | }
|
| | | },
|
| | | isSelected(id) {
|
| | | // 检查ID是否在selectedFlowers中
|
| | | return this.selectedFlowers.includes(id);
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | </script>
|
| | |
| | | // padding: 20rpx 30rpx;
|
| | | padding: 22rpx 22rpx 20rpx 22rpx;
|
| | | background-color: #fff;
|
| | | display: flex;
|
| | | |
| | | .flow-manage-list-item-radio{
|
| | | width: 50rpx;
|
| | | height: 50rpx;
|
| | | }
|
| | |
|
| | | .flow-manage-list-item {
|
| | | .title {
|
| | |
| | | line-height: 40rpx;
|
| | | margin-left: 20rpx;
|
| | | }
|
| | | }
|
| | | .label {
|
| | | |
| | | font-weight: 400;
|
| | | font-size: 24rpx;
|
| | | color: #666666;
|
| | | text-align: left;
|
| | | // padding-left: 10rpx;
|
| | | // padding-right: 10rpx;
|
| | | }
|
| | | |
| | | .label::after {
|
| | | content: ": "
|
| | | }
|
| | | |
| | | .value {
|
| | | font-weight: 400;
|
| | | font-size: 24rpx;
|
| | | color: #666666;
|
| | | }
|
| | |
|
| | | .buttons {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | .top-buttons {
|
| | | display: flex;
|
| | | padding: 22rpx 42rpx;
|