廖井涛
14 小时以前 f7a2fcdda7f1120498c5c5f75c5a99955fc54b43
north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue
@@ -42,6 +42,10 @@
      {
        "label": t('orderBasicData.saleMan'),
        "value": "saleMan"
      },
      {
        "label": t('order.edgingType'),
        "value": "edgingType"
      }
    ]
  },
@@ -154,7 +158,8 @@
    {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' },fixed:"left",},
    {type: 'seq', title: t('basicData.number'), width: 80 ,fixed:"left",},
    {field:'basicName',title: t('orderBasicData.name'),filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod: filterChanged},
    {field:'nickname',title: t('orderBasicData.alias')},
    {field:'nickname',title: t('orderBasicData.alias'),filters: [{data: ''}],slots: { default: 'showNickname' ,filter: 'num1_filter'},filterMethod: filterChanged},
    {field:'sort',title: t('processCard.sorting'),sortable: true,filters: [{data: ''}],slots: {filter: 'num1_filter'},filterMethod: filterChanged},
    {field:'createTime',title: t('basicData.creationTime')},
@@ -162,9 +167,10 @@
  //表头按钮
  toolbarConfig: {
    buttons: [
      {'code': 'add', 'name': t('basicData.insert'),status: 'primary'},
    ],
    slots:{
      buttons: "toolbar_buttons",
      tools:'add'
    },
    // import: false,
    // export: true,
@@ -189,6 +195,11 @@
  }
}
const add = () => {
  rowIndex.value = null
  dialogTableVisible.value = true
}
request.get('/basicData/getBasicData').then(res => {
  if(res.code==='200'){
    xGrid.value.reloadData(res.data)
@@ -197,11 +208,8 @@
const getChildrenFunction = (flag) => {
  if(flag){
    router.push({
      path:'/main/orderBasicData/searchBasicData',
      query:{random:Math.random()
      }
    })
    dialogTableVisible.value=false
    handleChange()
  }
}
@@ -253,58 +261,80 @@
</script>
<template>
  <div>
    <el-row>
      <el-col :span="8">
        <el-cascader
            v-model="basic.basicType"
            @change="handleChange"
            :options="options"
            clearable
            :placeholder="$t('processCard.pleaseSelect')"
        />
      </el-col>
    </el-row>
    <vxe-grid
        style="width: 40vw;"
        class="mytable-scrollbar"
        max-height="500px"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('basicData.edit') }}</el-button>
        <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')">
          <template #reference>
            <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
          </template>
        </el-popconfirm>
      </template>
  <div  style="width: 100%;height: 100%">
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input
                v-model="option.data"
                type="text"
                @keyup.enter.native="$panel.confirmFilter()"
                @input="changeFilterEvent($event, option, $panel)"/>
    <div class="main-table">
      <vxe-grid
          class="mytable-scrollbar"
          height="100%"
          ref="xGrid"
          v-bind="gridOptions"
          v-on="gridEvents"
      >
        <template #button_slot="{ row }">
          <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{ $t('basicData.edit') }}</el-button>
          <el-popconfirm @confirm="getTableRow(row,'delete')" :title="$t('searchOrder.deleteConfirm')">
            <template #reference>
              <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
            </template>
          </el-popconfirm>
        </template>
        <template #showNickname="{ row,column, $panel }">
          <span v-if="row.basicCategory==='icon' && row.nickname!=null">picture</span>
          <span v-else>{{row.nickname}}</span>
        </template>
        <template #num1_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <input
                  v-model="option.data"
                  type="text"
                  @keyup.enter.native="$panel.confirmFilter()"
                  @input="changeFilterEvent($event, option, $panel)"/>
            </div>
          </div>
        </div>
      </template>
        </template>
        <template #toolbar_buttons>
          <el-col :span="8">
            <el-cascader
                v-model="basic.basicType"
                @change="handleChange"
                :options="options"
                clearable
                :placeholder="$t('processCard.pleaseSelect')"
            />
          </el-col>
        </template>
        <template #add>
          <el-button @click="add" type="primary" style="margin-right: 3px">{{$t('basicData.insert')}}</el-button>
        </template>
    </vxe-grid>
      </vxe-grid>
    </div>
    <el-dialog
        v-model="dialogTableVisible"
        destroy-on-close
        style="width: 30%;height:40% ">
        :close-on-click-modal="false"
        :close-on-press-escape="false"
        style="width: 30%;height:50% ">
      <create-basic-data :rowIndex="rowIndex" @gaveParent='getChildrenFunction'/>
    </el-dialog>
  </div>
</template>
<style scoped>
.head{
  width: 100%;
  height: 35px;
}
.main-table{
  width: 100%;
  height: calc(100% - 0px);
}
</style>