linwenling
2023-07-24 228302bc93feabc7b51a965db4374781844cc033
ruoyi-ui/src/views/collection/index.vue
@@ -51,11 +51,16 @@
                  -->
      </el-form-item>
      <el-form-item label="时间" style="padding-left:190px">
      <el-form-item label="时间">
        <el-date-picker
          v-model="dateRange"
          style="width: 240px"
          value-format="yyyy-MM-dd HH-MM"
          style="width:  197px;
          height: 30px;
          background: #FFFFFF;
          border-radius: 14px 14px 14px 14px;
          opacity: 0.5;
          border: 1px solid rgba(0,0,0,0.25);"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="-"
          start-placeholder="开始日期"
@@ -63,34 +68,23 @@
        ></el-date-picker>
      </el-form-item>
      <el-form-item label="类别" prop="type" >
        <el-input
      <el-form-item label="类别" prop="type">
        <el-select
          v-model="queryParams.type"
          placeholder="请输入类别"
          placeholder="所有类别"
          clearable
          style="width: 240px"
          @keyup.enter.native="handleQuery">
          <i slot="prefix" class="el-input__icon el-icon-search"></i>
        </el-input>
          @keyup.enter.native="handleQuery"
        >
          <el-option
            v-for="item in typeOptions"
            :key="item.value"
            :label="item.label"
            :value="item.value"
          />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="类别" prop="type">-->
<!--        <el-select-->
<!--          v-model="queryParams.type"-->
<!--          placeholder="所有类别"-->
<!--          clearable-->
<!--          style="width: 240px"-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        >-->
<!--          <el-option-->
<!--            v-for="dict in typeOptions"-->
<!--            :key="dict.value"-->
<!--            :label="dict.label"-->
<!--            :value="dict.value"-->
<!--          />-->
<!--        </el-select>-->
<!--      </el-form-item>-->
      <el-cntainer>
        <el-col :span="9" >
          <el-form-item>
@@ -125,14 +119,14 @@
    </el-form>
    <div>
      <div style="width: 100px;
      height: 24px;
      font-size: 18px;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      color: #000000;
      line-height: 21px;
      ">收藏和荣誉</div>
<!--      <div style="width: 100px;-->
<!--      height: 24px;-->
<!--      font-size: 18px;-->
<!--      font-family: Microsoft YaHei-Regular, Microsoft YaHei;-->
<!--      font-weight: 400;-->
<!--      color: #000000;-->
<!--      line-height: 21px;-->
<!--      ">收藏和荣誉</div>-->
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
@@ -189,31 +183,30 @@
            <el-button size="mini"   type="primary"
                       plain
                       icon="el-icon-plus" >导入</el-button>
          </el-upload>
        </el-col>
        <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      </el-row>
    </div>
    <el-table v-loading="loading" :data="collectionList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
      <el-table-column type="selection" width="25"  align="center" />
      <el-table-column  label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
      <el-table-column label="获得时间" prop="happenTime" sortable width="160" align="center">
    <el-table v-loading="loading" :data="collectionList" :row-key="getRowId" ref="multipleTable" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName" style="background: #FFEFF2;  border-radius: 14px 14px 14px 14px;">
      <el-table-column type="selection" :reserve-selection="true" width="25"  align="center" />
      <el-table-column fixed label="序号" sortable type="index" :index="(queryParams.pageNum-1)*queryParams.pageSize+1" width="60"/>
      <el-table-column label="获得时间" prop="happenTime" sortable width="100" align="center">
        <template slot-scope="scope">{{scope.row.happenTime? scope.row.happenTime: '————'}}</template>
      </el-table-column>
      <el-form-item label="类别" prop="type" width="120">
        <el-select v-model="formDat.type" placeholder="请选择类别" clearable :style="{width: '100%'}"  >
          <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-table-column label="类别" prop="type" sortable width="120" align="center">
        <template slot-scope="scope">{{ getSrc(scope.row.type) }}</template>
<!--        <template slot-scope="scope">{{scope.row.type? scope.row.type: '————'}}</template>-->
      </el-table-column>
      <el-table-column label="名称" prop="name" sortable :show-overflow-tooltip="true" width="120" align="center" >
        <template slot-scope="scope">{{scope.row.name? scope.row.name: '————'}}</template>
      </el-table-column>
      <el-table-column label="来源" prop="source" sortable width="120" align="center" >
        <template slot-scope="scope">{{scope.row.source? scope.row.source: '————'}}</template>
      </el-table-column>
      <el-table-column label="持有者" prop="owner" sortable width="140" align="center">
      <el-table-column label="持有者" prop="owner" sortable width="110" align="center">
        <template slot-scope="scope">{{scope.row.owner? scope.row.owner: '————'}}</template>
      </el-table-column>
      <el-table-column label="价值" prop="price" sortable width="120" align="center">
@@ -222,8 +215,13 @@
      <el-table-column label="存放位置" prop="location" sortable width="160" align="center">
        <template slot-scope="scope">{{scope.row.location? scope.row.location: '————'}}</template>
      </el-table-column>
      <el-table-column label="电子文件" prop="url" width="160" align="center">
      <el-table-column label="备注" prop="remark" sortable width="90" align="center">
        <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '————'}}</template>
      </el-table-column>
      <el-table-column label="电子文件" prop="url" width="180" align="center">
        <template slot-scope="scope" >
          <div  @click="handleCheck(scope.row)">
          <img
            class="el-upload-list__item-thumbnail"
            src="../../assets/images/deviceLis.png"
@@ -239,12 +237,8 @@
            style="width: 35px; height: 35px;"
            fit="cover"
            v-if="scope.row.url === ','"
          >
          ></div>
        </template>
      </el-table-column>
      <el-table-column label="备注" prop="remark" sortable width="120" align="center">
        <template slot-scope="scope">{{scope.row.remark? scope.row.remark: '————'}}</template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" >
        <template slot-scope="scope" v-if="scope.row.roleId !== 1">
@@ -291,12 +285,17 @@
    <!-- 添加收藏与荣誉信息配置对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="elForm" :model="formDat" :rules="rules" size="medium" label-width="100px">
<!--        <el-form-item label="获得时间" prop="happenTime">-->
<!--          <el-input v-model="formDat.happenTime" placeholder="请输入获得时间" clearable :style="{width: '100%'}" ></el-input>-->
<!--        </el-form-item>-->
        <el-form-item label="获得时间" prop="happenTime">
          <el-input v-model="formDat.happenTime" placeholder="请输入获得时间" clearable :style="{width: '100%'}" ></el-input>
          <el-date-picker v-model='formDat.happenTime' type='date' placeholder='选择日期'></el-date-picker>
        </el-form-item>
        <el-form-item label="类别" prop="type">
          <el-input v-model="formDat.type" placeholder="请输入类别" clearable :style="{width: '100%'}" >
          </el-input>
          <el-select v-model="formDat.type" placeholder="请选择类别" clearable :style="{width: '100%'}"  >
            <el-option v-for="(item, index) in typeOptions" :key="index" :label="item.label" :value="item.value"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="名称" prop="name">
          <el-input v-model="formDat.name" placeholder="请输入名称" clearable :style="{width: '100%'}" >
@@ -478,7 +477,7 @@
        type:undefined,
        owner:undefined,
        location:undefined,
        happenTime:undefined,
        // happenTime:undefined,
      },
      // searchVal:"",
@@ -497,8 +496,8 @@
          trigger: 'blur'
        }],
        happenTime: [{
          // required: true,
          message: '请输入时间',
          required: true,
          message: '请选择时间',
          trigger: 'blur'
        }],
        name: [{
@@ -535,20 +534,26 @@
      },
      typeOptions: [
        {
          value: '选项1',
          value: '邮票',
          label: '邮票'
        }, {
          value: '选项2',
          value: '日本军刀',
          label: '日本军刀'
        }, {
          value: '选项3',
          value: '茅台酒',
          label: '茅台酒'
        }, {
          value: '选项4',
          value: '红木',
          label: '红木'
        }, {
          value: '选项5',
          value: '纪念品',
          label: '纪念品'
        }, {
          value: '瓷器',
          label: '瓷器'
        }, {
          value: '书籍',
          label: '书籍'
        }
      ],
    };
@@ -566,7 +571,10 @@
      this.open = false;
      this.reset();
    },
    getRowId(row)
    {
      return row.id
    },
    //隔行变色
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 == 0) {
@@ -578,7 +586,10 @@
    /** 查询记录列表 */
    getList() {
      this.loading = true;
      // console.log(this.queryParams)
      console.log(this.queryParams)
      this.queryParams.happenStartTime = this.dateRange.length > 0 && this.dateRange[0]
      this.queryParams.happenEndTime = this.dateRange.length > 0 && this.dateRange[1]
      //  listProperty(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
      listCollection(this.queryParams).then(response => {
          //  alert(123)
@@ -601,7 +612,26 @@
        })
      })
    },
    //类别选择
    getSrc(type) {
      if (type === '邮票') {
        return '邮票'
      }else if(type === '日本军刀'){
        return '日本军刀'
      }else if(type === '茅台酒'){
        return '茅台酒'
      }else if(type === '红木'){
        return '红木'
      }else if(type === '纪念品'){
        return '纪念品'
      }else if(type === '瓷器'){
        return '瓷器'
      }else if(type === '书籍'){
        return '书籍'
      } else {
        return '其它'
      }
    },
    handleRemove(file) {
      alert(323)
    },
@@ -715,6 +745,10 @@
          });
        }
      });
      // 清空formDat对象的数据
      Object.keys(this.formDat).forEach(key => {
        this.formDat[key] = '';
      });
    },
    requestUpload(params)
    {
@@ -751,15 +785,23 @@
    },
    /** 导出按钮操作 */
    handleExport() {
      const Ids = this.ids;
      if(Ids.length==0)
      {
      this.download('zfCollection/export', {
        ...this.queryParams
      }, `zfCollection_${new Date().getTime()}.xlsx`)
      }else{
        this.download('zfCollection/export1/'+Ids, {
        }, `zfCollection_${new Date().getTime()}.xlsx`)
      }
    },
    /** 导入模板下载按钮操作 */
    handleExportModel() {
      this.downloadModel('zfCollection/model', {
        ...this.queryParams
      this.download('/zfCollection/model', {
      }, `zfCollection_model_${new Date().getTime()}.xlsx`)
    },