zuozhengqing
2024-04-10 96aea12d4cbbda5d51fd8e85fdfb871c1f20a7fc
src/views/systemSetting/dataDictionary/index.vue
@@ -1,7 +1,7 @@
<template>
  <div class="silkStandardSetting-container">
    <div class="filter-card">
      <CommonSearch :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
      <CommonSearch ref="searchRef" :show-add="false" :amount-view="false" placeholder="请输入关键词" @searchClick="onFilterSearch">
        <template slot="leftButton">
          <el-button size="small" type="primary" @click="addBtnClick">新增</el-button>
          <el-button size="small" type="primary" @click="refreshClick">刷新</el-button>
@@ -9,7 +9,7 @@
      </CommonSearch>
    </div>
    <div class="body-card">
      <div>
      <div class="list-view">
        <div class="bottom-tabs" >
          <div class="tab-pane" @click="getTab(0)" :style="{
            background: TabsIndex == 0 ? '#2a78fb' : '#F1F3F8',
@@ -36,7 +36,7 @@
            规格
          </div>
        </div>
        <div class="list-view">
        <div >
          <TableCommonView :loading="loading" :table-list="productTableList" @selTableCol="selBottomTableCol">
            <template slot="tableButton">
              <el-table-column label="操作" width="160" fixed="right">
@@ -51,6 +51,9 @@
          </TableCommonView>
        </div>
      </div>
      <div class="btn-pager">
        <PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
      </div>
    </div>
    <AddDataDictionaries 
      :editDiaConfig="editConfig"
@@ -60,12 +63,13 @@
<script>
import AddDataDictionaries from "@/views/systemSetting/dataDictionary/components/addDataDictionaries.vue"
import {getDict} from "@/api/systemSetting/dataDictionary"
import {getDict,deleteDict} from "@/api/systemSetting/dataDictionary"
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
export default {
  name: "dataDictionary",
  props: {},
  components: {AddDataDictionaries},
  mixins: [],
  mixins: [pageMixin],
  computed: {},
  data() {
    return {
@@ -92,12 +96,12 @@
      ],
      showWorkshopCol: ["编码","车间名称", "描述",],
      colorTableColumn:[
        { label: "带号颜色", prop: "member_name" },
        { label: "带号颜色", prop: "name" },
        { label: "描述", prop: "remark" },
      ],
      showColorCol: ["带号颜色", "描述",],
      specsTableColumn:[
        { label: "规格", prop: "member_name" },
        { label: "规格", prop: "name" },
        { label: "描述", prop: "remark" },
      ],
      showSpecsCol: ["规格", "描述",],
@@ -105,6 +109,7 @@
        page: 1,
        pageSize:10,
        dictType:0,
        keyword:""
      },
    }
  },
@@ -116,16 +121,24 @@
  methods: {
    // 搜索
    onFilterSearch(searchText) {
      console.log(searchText)
      this.getDataParams.keyword=searchText,
      this.getData()
    },
    // 新增
    addBtnClick() {
      this.editConfig.dialogTitle="新增"
      this.editConfig.infomitton={}
      this.editConfig.infomitton.TabsIndex=this.TabsIndex
      this.editConfig.visible=true
    },
    // 刷新
    refreshClick() {
      console.log("a")
      this.getDataParams.keyword = ""
      this.pagerOptions.currPage = 1
      this.pagerOptions.pageSize = 15
      this.$refs.searchRef.searchInput=""
      this.TabsIndex=0,
      this.getData()
     },
    // 打印
    printClick() { 
@@ -225,22 +238,39 @@
    getData(){
      getDict({
        dictType:this.TabsIndex,
        page:this.getDataParams.page,
        pageSize:this.getDataParams.pageSize,
        page: this.pagerOptions.currPage,
        pageSize: this.pagerOptions.pageSize,
        keyword:this.getDataParams.keyword,
      }).then((res)=>{
        console.log(res,"res")
        this.productTableList.tableInfomation=res.data
              this.pagerOptions.totalCount = res.total
      })
    },
    rowClick(row,type){
      if(type==="查看"){
        this.editConfig.dialogTitle="查看"
        this.editConfig.visible=true
        this.editConfig.infomitton={...row,TabsIndex:this.TabsIndex}
      }else if(type==="修改"){
        this.editConfig.dialogTitle="修改"
        this.editConfig.visible=true
        this.editConfig.infomitton={...row,TabsIndex:this.TabsIndex}
      }else if(type==="删除"){
        console.log("删除")
        this.$confirm('确认删除吗?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          deleteDict({id:row.ID}).then((res)=>{
            if(res&&res.code===200){
              this.getData()
              this.$message({
                type: 'success',
                message: '删除成功!'
              });
            }
          })
        })
      }
    }
  }
@@ -313,4 +343,17 @@
.bgcWhite {
  background: #fff !important;
}</style>
}
.list-view {
  height: calc(100% - 60px);
  overflow: hidden;
}
.btn-pager {
  display: flex;
  margin-top: 10px;
  .page {
    margin-left: auto;
  }
}
</style>