| | |
| | | <view @click.stop="clickButton('delete')" class="button button-search-delete" style="margin-top: -1rpx;">
|
| | | </view>
|
| | | </view>
|
| | | |
| | | <view class="recycle-button" v-if="type==='delete'">
|
| | | <view class="buttons" >
|
| | | <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 class="recycle-button" v-if="type==='delete'">
|
| | | <view class="buttons">
|
| | | <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>
|
| | | <view style="background-color: white; margin: 10rpx;">
|
| | | <view>
|
| | | <u--input
|
| | | placeholder="请输入商品名称"
|
| | | border="surround"
|
| | | v-model="query.name"
|
| | | @change="flowerLevelChange"
|
| | | ></u--input>
|
| | | </view>
|
| | | <view style="margin-top: 10px;">
|
| | | <u-radio-group
|
| | | v-model="query.level"
|
| | | placement="row"
|
| | | @change="flowerLevelChange"
|
| | | >
|
| | | <u-radio
|
| | | :customStyle="{marginBottom: '8px'}"
|
| | | v-for="(item, index) in columns_levels"
|
| | | :key="index"
|
| | | :label="item.label"
|
| | | :name="item.value"
|
| | | |
| | | >
|
| | | </u-radio>
|
| | | </u-radio-group>
|
| | | </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 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-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="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"><span class="label t-red">排名</span><span
|
| | | class="value t-red">{{item.typeRank || '-'}}</span></view>
|
| | |
|
| | | <view class="m-l-a m-r-0">
|
| | | {{item.categoryStr || '-'}}
|
| | | </view>
|
| | |
| | | <view class="label">价格</view>
|
| | | <view class="value">{{item.price||'-'}}</view>
|
| | | </view>
|
| | | <view class="each-item" v-if="item.limited && item.limited>0">
|
| | | <view class="label">限购数量</view>
|
| | | <view class="value">{{item.limited||'-'}}</view>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
| | | <view class="button" @click.stop="openValue(item,'stock')">库存</view>
|
| | | <view class="button" @click.stop="toDetailAdd(item)">复制</view>
|
| | |
|
| | | <view v-if="type !== 'delete' && (item.status==='OFF' || item.status==='FORCE_OFF') " class="button t-red" @click.stop="buttonDelete(item)">删除</view>
|
| | | <view v-if="type !== 'delete' && (item.status==='OFF' || item.status==='FORCE_OFF') "
|
| | | class="button t-red" @click.stop="buttonDelete(item)">删除</view>
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
| | | return {
|
| | | type: 'all',
|
| | | query: {
|
| | | type: ''
|
| | | type: '',
|
| | | name:'',
|
| | | level:'',
|
| | | },
|
| | | content: '',
|
| | | currentInputDto: {},
|
| | |
| | | inputplaceholder: '',
|
| | | selectedFlowers: [], // 存储选中的花的 ID
|
| | | ids: [],
|
| | | columns_levels:[]
|
| | | }
|
| | | },
|
| | | onShow() {
|
| | | console.log("onShow")
|
| | | if (this.sign['flower']) {
|
| | | this.$store.dispatch('sign_clear', 'flower');
|
| | | this.refreshList()
|
| | | }
|
| | | },
|
| | | async onLoad(options) {
|
| | | console.log("onLoad")
|
| | | this.type = options.type || 'all'
|
| | | var title = ''
|
| | | this.page.size = 5
|
| | | this.page.size = 20
|
| | | //todo 根据type切换查询条件
|
| | | if (this.type === 'delete') {
|
| | | this.listApi = '/api/supplier/flower/list/rc'
|
| | |
| | | }
|
| | | await this.$store.dispatch('sign_clear', 'flower');
|
| | | this.getList()
|
| | | // 获取商品等级
|
| | | this.getFlowerLevel()
|
| | | },
|
| | | onReachBottom() {
|
| | | console.log('onReachBottom')
|
| | |
| | | uni.stopPullDownRefresh()
|
| | | },
|
| | | methods: {
|
| | | |
| | | flowerLevelChange(){
|
| | | this.refreshList()
|
| | | },
|
| | | |
| | | async getFlowerLevel(){
|
| | | this.$http.request('get', '/api/code/value', {
|
| | | params: {
|
| | | type: 'FLOWER_LEVEL'
|
| | | }
|
| | | }).then(res => {
|
| | | var data = res.data
|
| | | // this.columns_levels_all = data || []
|
| | | let tmp = data || []
|
| | | tmp.unshift({
|
| | | label: '全部',
|
| | | value: ''
|
| | | })
|
| | | this.columns_levels=tmp
|
| | | |
| | | })
|
| | | },
|
| | | async openValue(item, key) {
|
| | | this.content = item[key] || ''
|
| | | this.currentInputDto = item
|
| | |
| | | })
|
| | | }
|
| | | },
|
| | | // 删除选中的花卉
|
| | | 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()
|
| | | |
| | | // 删除选中的花卉
|
| | | async deleteSelected() {
|
| | | if (this.selectedFlowers.length === 0) {
|
| | | this.$message.showToast('请选择要删除的商品');
|
| | | return;
|
| | | }
|
| | | }).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()
|
| | |
|
| | | // 确认框
|
| | | await this.$message.confirm('确定删除此商品吗')
|
| | |
|
| | | var dto = {
|
| | | ids: this.selectedFlowers,
|
| | | }
|
| | | }).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);
|
| | | }
|
| | | |
| | |
|
| | | 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: 22rpx 22rpx 20rpx 22rpx;
|
| | | background-color: #fff;
|
| | | display: flex;
|
| | | |
| | | .flow-manage-list-item-radio{
|
| | |
|
| | | .flow-manage-list-item-radio {
|
| | | width: 50rpx;
|
| | | height: 50rpx;
|
| | | }
|
| | |
| | | margin-left: 20rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .label {
|
| | | |
| | |
|
| | | font-weight: 400;
|
| | | font-size: 24rpx;
|
| | | color: #666666;
|
| | |
| | | // padding-left: 10rpx;
|
| | | // padding-right: 10rpx;
|
| | | }
|
| | | |
| | |
|
| | | .label::after {
|
| | | content: ": "
|
| | | }
|
| | | |
| | |
|
| | | .value {
|
| | | font-weight: 400;
|
| | | font-size: 24rpx;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | .top-buttons {
|
| | | display: flex;
|
| | | padding: 22rpx 42rpx;
|
| | |
| | | }
|
| | |
|
| | | .button-add {
|
| | | background-image: url('@/static/images/supplier/flower/flower-mange-icon-add-flower.png');
|
| | | // background-image: url('@/static/images/supplier/flower/flower-mange-icon-add-flower.png');
|
| | | background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/9b/9ba0066e01f445f9ade144175745cbb91TtPCakvMtBV191bed22cec1f45c715214822f5ee02e.png');
|
| | |
|
| | | }
|
| | |
|
| | | .button-search-in {
|
| | | background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-in.png');
|
| | | // background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-in.png');
|
| | | background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/f8/f8a79ebd3650409a9b461f692a718962k5etUQLrsYSP071ef78c3de46ccab3874c5a4607ca5b.png');
|
| | |
|
| | | }
|
| | |
|
| | | .button-search-unpass {
|
| | | background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-unpass.png');
|
| | | // background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-unpass.png');
|
| | | background-image: url("https://hmy-flower.oss-cn-shanghai.aliyuncs.com/cc/cc58fb61ae65427295c71f0d9caacc45de44rtPrgqFg844bca8d2930d7f517962bb64061ee43.png");
|
| | |
|
| | | }
|
| | |
|
| | | .button-search-inpass {
|
| | | background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-inpass.png');
|
| | |
|
| | | // background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-inpass.png');
|
| | | background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/47/47aec52d2a3d4c91b43bdb94685541afitjRdk4gwb9Qcb007003910ef8afa9377e8e7db26504.png');
|
| | | }
|
| | |
|
| | | .button-search-delete {
|
| | | background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-delete.png');
|
| | |
|
| | | // background-image: url('@/static/images/supplier/flower/flower-mange-icon-flower-delete.png');
|
| | | background-image: url('https://hmy-flower.oss-cn-shanghai.aliyuncs.com/21/21bf915752004adea9fed11caf0aea96re8cK9uGrYOL8bdb6e2bb41c1244509a7183b96ca476.png');
|
| | | }
|
| | | }
|
| | | |
| | | .recycle-button{
|
| | | |
| | | |
| | | |
| | |
|
| | | .recycle-button {
|
| | |
|
| | |
|
| | |
|
| | | min-height: 50rpx;
|
| | | background-color: #fff;
|
| | | |
| | |
|
| | | .buttons {
|
| | | display: flex;
|
| | | justify-content: flex-end;
|
| | | background-color: #fff;
|
| | | padding: 22rpx 42rpx;
|
| | | |
| | |
|
| | | .button {
|
| | | margin: 0 auto;
|
| | | width: 98rpx;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | </style> |