Преглед на файлове

Merge branch 'dev' into 'purchaseDev'

Dev

See merge request new-business/drp-web!294
黄梓星 преди 1 година
родител
ревизия
448db48b19

+ 1 - 1
src/views/business/spd/target/targetMk/add.vue

@@ -93,7 +93,7 @@
         </el-card>
       </el-form>
     </el-card>
-    <el-card  style="height:500px">
+    <el-card  style="height:600px">
       <Item ref="child" v-if="isItem" :pageStu="pageStu" :template="template" :form="form" :columns="headers" :latestTemplate="latestTemplate"></Item>
     </el-card>
     <el-card>

+ 1 - 0
src/views/business/spd/target/targetMk/index.vue

@@ -85,6 +85,7 @@
           :data="tableList"
           @selection-change="useSelectionRow"
           @row-dblclick="useDoubleClick"
+          height="600px"
         >
           <el-table-column show-overflow-tooltip type="selection" width="55" />
           <el-table-column label="序号" type="index" width="50" align="center" fixed/>

+ 3 - 2
src/views/business/spd/target/targetMk/item.vue

@@ -6,7 +6,7 @@
       </div>
     </el-row>
     <!-- 渲染表头 -->
-    <el-table :data="items" style="width: 100%" height="500px">
+    <el-table :data="items" height="500px">
       <el-table-column label="序号" type="index" width="50" align="center" fixed>
       </el-table-column>
       <el-table-column show-overflow-tooltip v-for="head in headers" :prop="head.prop" :label="head.modelName" width="200" align="center">
@@ -82,7 +82,6 @@ export default {
   async created() {
     this.processHeadersData(this.template.unfold,this.columns);
     this.itemTemplate = this.formatItem(this.columns);
-    console.log('this.itemTemplate',this.itemTemplate);
     if(this.pageStu == 'edit' || this.pageStu == 'see'){
       if(!this.latestTemplate){
         await this.fetchTargetItem(this.form.id);
@@ -93,6 +92,8 @@ export default {
     //增行
     useAdd(){
       this.items.push(this.itemTemplate);
+      console.log('this.itemTemplate',this.itemTemplate);
+      console.log('this.items',this.items);
     },
     //删行
     useDel(index){

+ 170 - 0
src/views/business/spd/target/targetMk/templateDownload.vue

@@ -0,0 +1,170 @@
+<template>
+  <div>
+    <el-button type="primary" size="mini" @click="openDialog">模板导出</el-button>
+    <el-dialog
+      title="选择目标模板"
+      :visible.sync="open"
+    >
+      <el-form size="mini" label-width="120px" >
+        <el-row :gutter="10">
+          <el-col :span="1.5">
+            <el-form-item label="年度">
+              <el-input
+                v-model="queryParams.year"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item label="模板名称">
+              <el-input
+                v-model="queryParams.name"
+                clearable
+                style="width: 200px"
+              />
+            </el-form-item>
+          </el-col>
+          <el-col :span="1.5">
+            <el-form-item>
+              <el-button type="primary" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
+              <el-button icon="el-icon-refresh" plain @click="useReset">重置</el-button>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <el-table 
+          :data="tableData"
+          size="mini"
+          @row-dblclick="useDoubleClick"
+          height="450px"
+        >
+        <el-table-column show-overflow-tooltip label="年度" align="center" width="100" prop="year">
+          <template slot-scope="scope">
+            {{scope.row.year}}
+          </template>
+        </el-table-column>
+        <el-table-column show-overflow-tooltip label="模板名称" align="center" width="200" prop="name"/>
+        <el-table-column show-overflow-tooltip label="开始日期" align="center" width="150" prop="startTime" />
+        <el-table-column show-overflow-tooltip label="结束日期" align="center" width="150" prop="deadlineTime" />
+        <el-table-column show-overflow-tooltip label="周期" align="center" width="100" prop="cycle">
+          <template slot-scope="scope">
+            <dict-tag
+              :options="dict.type.mk_periodic_unit"
+              :value="scope.row.cycle"
+            />
+          </template>
+        </el-table-column>
+        <el-table-column show-overflow-tooltip label="创建人" align="center" width="150" prop="createByName" />
+        <el-table-column show-overflow-tooltip label="创建时间" align="center" width="150" prop="createTime" />
+      </el-table>
+      <el-pagination
+          background
+          @size-change="useChangePageSize"
+          @current-change="useCurrentChange"
+          :current-page="queryParams.pageNum"
+          :page-sizes="[10, 15, 20]"
+          :page-size="100"
+          layout="total, sizes, prev, pager, next, jumper"
+          :total=total>
+        </el-pagination>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listTargetTemplate,download } from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: 'templateList',
+  dicts: ["mk_periodic_unit"],
+  data() {
+    return {
+      //是否打开弹窗
+      open:false,
+      //搜索框参数
+      queryParams:{
+        year: null,
+        name: null,
+        pageNum: 1,
+        pageSize: 10
+      },
+      //总条数
+      total: 0,
+      //列表数据
+      tableData:[],
+    };
+  },
+  watch: {},
+  created() {
+  },
+  methods: {
+    //打开弹窗
+    openDialog(){
+      this.open = true;
+      this.getList();
+    },
+    //获取列表数据
+    async getList() {
+      try {
+        this.loading = true;
+        const { code, rows, total } = await listTargetTemplate(this.queryParams);
+        if (code === 200) {
+          this.tableData = rows;
+          this.total = total;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //双击选择
+    async useDoubleClick(row){
+      try {
+        await download(row.id);
+      } catch (err) {
+        console.error(err);
+      } finally {
+        this.open = false;
+      }
+    },
+    //搜索
+    useSearch(){
+      this.getList(this.queryParams);
+    },
+    //重置
+    useReset(){
+      this.queryParams = {
+        year: null,
+        name: null,
+        pageNum: 1,
+        pageSize: 10
+      }
+      this.getList(this.queryParams);
+    },
+    //改变一页显示条数
+    useChangePageSize(val){
+      this.queryParams.pageSize = val
+      this.getList(this.queryParams)
+    },
+    //翻页
+    useCurrentChange(val){
+      this.queryParams.pageNum = val
+      this.getList(this.queryParams)
+    },
+  },
+  created() {},
+  mounted() {},
+  destroyed() {},
+};
+</script>
+
+<style lang="scss" scoped>
+.el-pagination {
+  margin-top: 10px;
+  text-align: right;
+}
+</style>

+ 508 - 0
src/views/business/spd/target/targetTemplate/detail.vue

@@ -0,0 +1,508 @@
+
+<template>
+    <div>
+        <el-card>
+            <el-button size="mini" plain @click="useBack">返回</el-button>
+            <el-divider></el-divider>
+            <el-form size="mini" :model="form" :rules="rules" ref="form" label-width="auto">
+                <el-row :gutter="10">
+                    <el-col :span="1.5">
+                        <el-form-item label="年份" prop="year" >
+                            <el-date-picker
+                                v-model="form.year"
+                                type="year"
+                                clearable
+                                >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="模板名称" prop="name">
+                            <el-input
+                                v-model="form.name"
+                                style="width: 200px"
+                                clearable
+                            />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="开始日期" prop="startTime">
+                            <el-date-picker
+                                v-model="form.startTime"
+                                clearable
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                style="width: 200px"
+                                >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="结束日期" prop="deadlineTime">
+                            <el-date-picker
+                                v-model="form.deadlineTime"
+                                clearable
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                style="width: 200px"
+                                >
+                            </el-date-picker>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="周期" prop="cycle">
+                            <el-select v-model="form.cycle" clearable>
+                                <el-option
+                                v-for="dict in dict.type.mk_periodic_unit"
+                                :key="dict.value"
+                                :label="dict.label"
+                                :value="dict.value"
+                                ></el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="1.5">
+                        <el-form-item label="按列展开">
+                            <el-select v-model="form.unfold" clearable>
+                                <el-option
+                                v-for="dict in dict.type.mk_expansion_mode"
+                                :key="dict.value"
+                                :label="dict.label"
+                                :value="dict.value"
+                                ></el-option>
+                            </el-select>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+        </el-card>
+        <el-card style="height:800px">
+            <div style='position: relative;'>
+                <el-tabs v-model="activeName" @tab-click="useSwitchTab">
+                    <el-tab-pane label="指标" name="indexs">
+                        <el-table :data="indexs" height="600px" size="size">
+                            <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+                            <el-table-column show-overflow-tooltip label="指标" align="center" width="200" prop="target">
+                                <template slot-scope="scope">
+                                    <el-select v-model="scope.row.target" size="mini" clearable>
+                                        <el-option
+                                        v-for="dict in dict.type.mk_index_type"
+                                        :key="dict.value"
+                                        :label="dict.label"
+                                        :value="dict.value"
+                                        ></el-option>
+                                    </el-select>
+                                </template>
+                            </el-table-column>
+                            <el-table-column fixed="right" label="操作" align="center" width="150">
+                                <template slot-scope="scope">
+                                    <el-button type="text" size="mini" @click="useRowRemove(scope.row)">删行</el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-tab-pane>
+                    <el-tab-pane label="维度" name="dimensionalitys">
+                        <el-table :data="dimensionalitys" height="600px" size="size">
+                            <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+                            <el-table-column show-overflow-tooltip label="维度" align="center" width="200" prop="dimensionality">
+                                <template slot-scope="scope">
+                                    <el-select v-model="scope.row.dimensionality" size="mini" clearable>
+                                        <el-option
+                                        v-for="dict in dict.type.mk_dimensionality"
+                                        :key="dict.value"
+                                        :label="dict.label"
+                                        :value="dict.value"
+                                        ></el-option>
+                                    </el-select>
+                                </template>
+                            </el-table-column>
+                            <el-table-column fixed="right" label="操作" align="center" width="150">
+                                <template slot-scope="scope">
+                                <el-button type="text" size="mini" @click="useRowRemove(scope.row)">删行</el-button>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-tab-pane>
+                    <el-tab-pane label="周期" name="cycles">
+                        <el-table :data="form.cycles" height="600px" size="size">
+                            <el-table-column label="序号" type="index" width="50" align="center" fixed/>
+                            <el-table-column show-overflow-tooltip label="周期" align="center" width="200" prop="name">
+                                <template slot-scope="scope">
+                                    <el-input
+                                        size="mini"
+                                        v-model="scope.row.name"
+                                        style="width: 150px"
+                                        clearable
+                                    />
+                                </template>
+                            </el-table-column>
+                            <el-table-column show-overflow-tooltip label="开始日期" align="center" width="200" prop="startTime">
+                                <template slot-scope="scope">
+                                    <el-date-picker
+                                        v-model="scope.row.startTime"
+                                        size="mini"
+                                        clearable
+                                        type="date"
+                                        value-format="yyyy-MM-dd"
+                                        style="width: 150px"
+                                        >
+                                    </el-date-picker>
+                                </template>
+                            </el-table-column>
+                            <el-table-column show-overflow-tooltip label="结束日期" align="center" width="200" prop="deadlineTime">
+                                <template slot-scope="scope">
+                                    <el-date-picker
+                                        v-model="scope.row.deadlineTime"
+                                        size="mini"
+                                        clearable
+                                        type="date"
+                                        value-format="yyyy-MM-dd"
+                                        style="width: 150px"
+                                        >
+                                    </el-date-picker>
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-tab-pane>
+                </el-tabs>
+                <el-button @click="useRowAdd" v-if="activeName == 'indexs' || activeName == 'dimensionalitys'" size='mini' style='position: absolute;right:10px;top:5px;'>增行</el-button>
+                <el-button @click="useResetCycle" v-if="activeName == 'cycles'" size='mini' style='position: absolute;right:10px;top:5px;'>重算周期</el-button>
+            </div>
+        </el-card>
+        <el-card>
+            <div class="btn_group">
+                <el-col :span="1.5">
+                    <el-button size="mini" plain @click="useBack">取消</el-button>
+                </el-col>
+                <el-col :span="1.5" style="margin: 0 10px;">
+                    <el-button type="primary" size="mini" plain @click="useSave">保存</el-button>
+                </el-col>
+            </div>
+        </el-card>
+    </div>
+</template>
+
+<script>
+import {
+  addTargetTemplate,
+  updateTargetTemplate,
+  getTargetTemplate,
+} from "@/api/business/spd/starget/targetTemplate";
+
+export default {
+  name: "targettemplateDetail",
+  dicts: ["mk_periodic_unit","mk_expansion_mode","mk_index_type","mk_dimensionality"],
+  components: {},
+  props: ['openMode','row'],
+  data() {
+    return {
+      form:{
+        indexs:[],
+        dimensionalitys:[],
+        cycles:[],
+      },
+      //表单校验
+      rules: {
+        year: [
+          { required: true, message: "年份不能为空", trigger: "blur" },
+        ],
+        name: [
+          { required: true, message: "目标名称不能为空", trigger: "blur" },
+        ],
+        startTime: [
+          { required: true, message: "开始日期不能为空", trigger: "blur" },
+        ],
+        deadlineTime: [
+          { required: true, message: "结束日期不能为空", trigger: "blur" },
+        ],
+        cycle: [
+          { required: true, message: "周期不能为空", trigger: "blur" },
+        ],
+      },
+      activeName: 'indexs',
+    };
+  },
+  computed: {
+    indexs(){
+        return this.form.indexs.filter(
+            ({ delFlag }) => delFlag !== "2"
+        );
+    },
+    dimensionalitys(){
+        return this.form.dimensionalitys.filter(
+            ({ delFlag }) => delFlag !== "2"
+        );
+    }
+  },
+  async created() {
+    switch(this.openMode){
+        case "add":
+            var date = new Date();
+            this.form.year = date.getFullYear() + '-' + '01' + '-' + '01';
+            this.form.startTime = date.getFullYear() + '-' + '01' + '-' + '01';
+            this.form.deadlineTime = date.getFullYear() + '-' + '12' + '-' + '31';
+            this.form.cycle = 'month';
+            break;
+        case "edit":
+            await this.fetchTemplate(this.row.id);
+            break;
+        case "see":
+            await this.fetchTemplate(this.row.id);
+            break;
+    }
+  },
+  methods: {
+    //保存
+    async useSave() {
+        console.log("form",this.form);
+        this.$refs["form"].validate(async (valid) => {
+            if (valid) {
+                try {
+                    let checkRes = this.checkBeforeSave(this.form);
+                    if(!checkRes){
+                        return;
+                    }
+                    this.loading = true;
+                    let res = null;
+                    if (this.openMode === "add") {
+                        res = await addTargetTemplate(this.form);
+                    }
+                    if (this.openMode === "edit") {
+                        res = await updateTargetTemplate(this.form);
+                    }
+                    if (res.code === 200) {
+                        this.$modal.msgSuccess("保存成功");
+                        this.useBack();
+                    }
+                } catch (err) {
+                    console.error(err);
+                } finally {
+                    this.loading = false;
+                }
+            } else {
+                return false;
+            }
+        });
+    },
+    //保存前校验
+    checkBeforeSave(form){
+        if(form.indexs){
+            let arr = form.indexs.filter(item => item.delFlag != '2');
+            if(arr.length < 1){
+                this.$modal.msgError("指标页签不能为空!");
+                return false;
+            }
+            arr = arr.filter(item => !item.target);
+            console.log("arr",arr);
+            if(arr.length > 0){
+                this.$modal.msgError("指标页签不能存在空数据!");
+                return false;
+            }
+        }else{
+            this.$modal.msgError("指标页签不能为空!");
+            return false;
+        }
+        if(form.dimensionalitys){
+            let arr = form.dimensionalitys.filter(item => item.delFlag != '2');
+            if(arr.length < 1){
+                this.$modal.msgError("维度页签不能为空!");
+                return false;
+            }
+            arr = arr.filter(item => !item.dimensionality);
+            if(arr.length > 0){
+                this.$modal.msgError("维度页签不能存在空数据!");
+                return false;
+            }
+        }else{
+            this.$modal.msgError("维度页签不能为空!");
+            return false;
+        }
+        if(form.cycles){
+            let arr = form.cycles.filter(item => item.delFlag != '2');
+            if(arr.length < 1){
+                this.$modal.msgError("周期页签不能为空!");
+                return false;
+            }
+        }else{
+            this.$modal.msgError("周期页签不能为空!");
+            return false;
+        }
+    },
+    //查询详情
+    async fetchTemplate(id) {
+      try {
+        // try
+        this.loading = true;
+        const { code, data } = await getTargetTemplate(id);
+        if (code === 200) {
+          this.form = data;
+          return true;
+        } else {
+          return false;
+        }
+      } catch (err) {
+        // catch
+        console.error(err);
+      } finally {
+        // finally
+        this.loading = false;
+      }
+    },
+    //增行
+    async useRowAdd() {
+        let row = {};
+        if(this.activeName == "indexs"){
+            row = {
+                target: null,
+            }
+        }
+        if(this.activeName == "dimensionalitys"){
+            row = {
+                dimensionality: null,
+            }
+        }
+        this.form[this.activeName].push({
+            delFlag: "0",
+            $index: new Date().getTime(),
+            ...row,
+        });
+        console.log("this.form[this.activeName]",this.form[this.activeName]);
+    },
+    //删行
+    async useRowRemove(row) {
+      if (row.id) {
+        this.form[this.activeName].forEach(e => {
+          if(e.id == row.id){
+            e.delFlag = '2'
+          }
+        });
+      }else{
+        this.form[this.activeName] = form[this.activeName].filter(item => item.$index != row.$index);
+      }
+      console.log("this.form[this.activeName]",this.form[this.activeName]);
+    },
+    //切换多页签
+    useSwitchTab(){
+
+    },
+    //返回
+    useBack(){
+        this.$parent.useOpenDetail();
+        this.$parent.useSearch();
+    },
+    //重算周期
+    useResetCycle(){
+      if(!this.form.startTime || !this.form.deadlineTime || !this.form.cycle){
+        this.$modal.msgError("开始日期、结束日期、周期不能存在空值!");
+        return;
+      }
+      if(this.form.startTime > this.form.deadlineTime){
+        this.$modal.msgError("开始日期不能大于结束日期!");
+        return;
+      }
+      this.form.cycles = [];
+      var cycles = [];
+      var start = new Date(this.form.startTime);
+      var deadline = new Date(this.form.deadlineTime);
+      start.setHours( 0, 0, 0);
+      deadline.setHours( 0, 0, 0);
+      if(this.form.cycle == 'period'){
+        cycles.push({
+          name:'目标期间',
+          startTime:start,
+          deadlineTime:deadline,
+        });
+      }else{
+        while(deadline >= start){
+          console.log(start);
+          if(this.form.cycle == 'day'){
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:start,
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+1);
+            start = new Date(start);
+          }
+          if(this.form.cycle == 'week'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+7),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+7);
+            start = new Date(start);
+          }
+          if(this.form.cycle == 'month'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+30),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+30);
+            start = new Date(start);
+          }
+          if(this.form.cycle == 'season'){
+            var de = start;
+            var cy = {
+              name:this.formatDateTime(start, 'yyyy-MM-dd'),
+              startTime:start,
+              deadlineTime:de.setDate(de.getDate()+90),
+            }
+            console.log(cy);
+            cycles.push(cy);
+            start = start.setDate(start.getDate()+90);
+            start = new Date(start);
+          }
+        }
+      }
+      this.form.cycles = cycles;
+      console.log('this.form.cycles',this.form.cycles);
+    },
+    //日期名称格式化
+    formatDateTime(date, format) {
+      const o = {
+        'M+': date.getMonth() + 1, // 月份
+        'd+': date.getDate(), // 日
+        'h+': date.getHours() % 12 === 0 ? 12 : date.getHours() % 12, // 小时
+        'H+': date.getHours(), // 小时
+        'm+': date.getMinutes(), // 分
+        's+': date.getSeconds(), // 秒
+        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
+        S: date.getMilliseconds(), // 毫秒
+        a: date.getHours() < 12 ? '上午' : '下午', // 上午/下午
+        A: date.getHours() < 12 ? 'AM' : 'PM', // AM/PM
+      };
+      if (/(y+)/.test(format)) {
+        format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
+      }
+      for (let k in o) {
+        if (new RegExp('(' + k + ')').test(format)) {
+          format = format.replace(
+            RegExp.$1,
+            RegExp.$1.length === 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
+          );
+        }
+      }
+      return format;
+    }
+  },
+};
+</script>
+
+<style scoped lang="scss">
+.btn_group {
+  width: 100%;
+  margin: 20px 0;
+  display: flex;
+  justify-content: right;
+} 
+</style>

+ 34 - 11
src/views/business/spd/target/targetTemplate/index.vue

@@ -6,9 +6,9 @@
         <el-form size="mini" class="search_area" label-width="120px">
           <el-row :gutter="10">
             <el-col :span="1.5">
-              <el-form-item label="年">
+              <el-form-item label="年">
                 <el-date-picker
-                  v-model="queryParams.year"
+                  v-model="queryParams.params.year"
                   type="year"
                   clearable
                   >
@@ -16,7 +16,7 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
-              <el-form-item label="目标名称">
+              <el-form-item label="模板名称">
                 <el-input
                   v-model="queryParams.name"
                   clearable
@@ -24,6 +24,20 @@
               </el-form-item>
             </el-col>
             <el-col :span="1.5">
+              <el-form-item label="开始日期">
+                <el-date-picker
+                  size="mini"
+                  v-model="dateRange"
+                  style="width: 240px"
+                  value-format="yyyy-MM-dd"
+                  type="daterange"
+                  range-separator="-"
+                  start-placeholder="开始"
+                  end-placeholder="结束"
+                ></el-date-picker>
+              </el-form-item>
+            </el-col>
+            <el-col :span="1.5">
               <el-form-item label="" label-width="20px">
                 <el-button type="primary" size="mini" icon="el-icon-search" plain @click="useSearch">搜索</el-button>
                 <el-button size="mini" icon="el-icon-refresh" plain @click="useReset">重置</el-button>
@@ -39,6 +53,7 @@
         <el-table 
           :data="tableList"
           @row-dblclick="useDoubleClick"
+          height="600px"
         >
           <el-table-column label="序号" type="index" width="50" align="center" fixed/>
           <el-table-column show-overflow-tooltip label="年度" align="center" width="200" prop="year">
@@ -105,11 +120,15 @@ export default {
     return {
       // 搜索框参数
       queryParams: {
-        year:'',
-        name:'',
+        name:null,
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
+        params:{
+          year:null,
+        }
       },
+      // 查询日期范围
+      dateRange: [],
       //总条数
       total: 0,
       //列表数据
@@ -158,12 +177,12 @@ export default {
       const { code, data } = await checkQuote(row.id);
       if (code == "200") {
         if (data) {
-          this.$modal.msgError("该目标模板存在引用,无法修改!");
+          this.$modal.msgError("该目标模板存在引用,无法删除!");
           this.visible = false;
           return;
         }
       } else {
-        this.$modal.msgError("校验该目标模板是否存在引用异常,无法修改!");
+        this.$modal.msgError("校验该目标模板是否存在引用异常,无法删除!");
         this.visible = false;
         return;
       }
@@ -178,7 +197,7 @@ export default {
     },
     //查询列表
     getList(params){
-      listTargetTemplate(params).then(res => {
+      listTargetTemplate(this.addDateRange(params, this.dateRange)).then(res => {
         if (res.code === 200) {
           this.tableList = res.rows
           this.total = res.total
@@ -203,15 +222,19 @@ export default {
     },
     //搜索
     useSearch() {
+      console.log(this.queryParams);
       this.getList(this.queryParams);
     },
     //重置
     useReset(){
+      this.dateRange = [];
       this.queryParams = {
-        year:'',
         name: '',
         pageNum: 1,
-        pageSize: 10
+        pageSize: 10,
+        params:{
+          year:'',
+        },
       }
       this.getList(this.queryParams);
     },