陶杰
2024-11-12 767ca1416d96ff1d2f8d346c0a1bdd36bc6557f5
sub_pages/supplier/flower-manage/flower-manage.vue
@@ -15,6 +15,33 @@
            <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>
@@ -39,8 +66,8 @@
                  <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 || '-'}}
@@ -147,7 +174,9 @@
         return {
            type: 'all',
            query: {
               type: ''
               type: '',
               name:'',
               level:'',
            },
            content: '',
            currentInputDto: {},
@@ -155,15 +184,18 @@
            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 = 20
@@ -199,6 +231,8 @@
         }
         await this.$store.dispatch('sign_clear', 'flower');
         this.getList()
         // 获取商品等级
         this.getFlowerLevel()
      },
      onReachBottom() {
         console.log('onReachBottom')
@@ -210,6 +244,28 @@
         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