From aece48b253b2e0b814bbdf5ee3d474e8cf697122 Mon Sep 17 00:00:00 2001
From: chenlu <1320612696@qq.com>
Date: 星期四, 18 十二月 2025 16:39:48 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue |  340 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 340 insertions(+), 0 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue
new file mode 100644
index 0000000..321555c
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/sd/basicData/SearchBasicData.vue
@@ -0,0 +1,340 @@
+<script setup>
+import {reactive, ref} from "vue";
+import {VXETable} from "vxe-table";
+import {ElMessage} from "element-plus";
+import request from "@/utils/request"
+import CreateBasicData from "@/views/sd/basicData/CreateBasicData.vue"
+import {useRouter,useRoute} from "vue-router"
+import {useI18n} from "vue-i18n"
+import {changeFilterEvent, filterChanged} from "@/hook";
+const { t } = useI18n()
+
+let dialogTableVisible = ref(false)
+const router = useRouter()
+
+let basic = ref({
+  basicType : ['',''],
+})
+let options=ref([
+  { "label": t('orderBasicData.order'),
+    "value": "order",
+    "children": [
+      {
+        "label": t('orderBasicData.orderType'),
+        "value": "orderType"
+      },
+      {
+        "label": t('orderBasicData.orderClassify'),
+        "value": "orderClassify"
+      },
+      {
+        "label": t('orderBasicData.icon'),
+        "value": "icon"
+      },
+      {
+        "label": t('orderBasicData.packType'),
+        "value": "packType"
+      },
+      {
+        "label": t('orderBasicData.alType'),
+        "value": "alType"
+      },
+      {
+        "label": t('orderBasicData.saleMan'),
+        "value": "saleMan"
+      },
+      {
+        "label": t('order.edgingType'),
+        "value": "edgingType"
+      }
+    ]
+  },
+  {
+    "label": t('orderBasicData.product'),
+    "value": "product",
+    "children": [
+      {
+        "label": t('orderBasicData.stuffThickness'),
+        "value": "stuffThickness"
+      },
+      {
+        "label": t('orderBasicData.stuffColor'),
+        "value": "stuffColor"
+      },
+      {
+        "label": t('orderBasicData.stuffCraft'),
+        "value": "stuffCraft"
+      },
+      {
+        "label": t('orderBasicData.stuffPosition'),
+        "value": "stuffPosition"
+      },
+      {
+        "label": t('orderBasicData.stuffLowE'),
+        "value": "stuffLowE"
+      },
+      {
+        "label": t('orderBasicData.InterlayerThickness'),
+        "value": "InterlayerThickness"
+      },
+      {
+        "label": t('orderBasicData.InterlayerType'),
+        "value": "InterlayerType"
+      },
+      {
+        "label": t('orderBasicData.InterlayerColor'),
+        "value": "InterlayerColor"
+      },
+      {
+        "label": t('orderBasicData.process'),
+        "value": "process"
+      },
+      {
+        "label": t('orderBasicData.hollowThickness'),
+        "value": "hollowThickness"
+      },
+      {
+        "label": t('orderBasicData.hollowGasType'),
+        "value": "hollowGasType"
+      },
+      {
+        "label": t('orderBasicData.hollowType'),
+        "value": "hollowType"
+      },
+      {
+        "label": t('orderBasicData.hollowGlueDepth'),
+        "value": "hollowGlueDepth"
+      }
+    ]
+  },
+  {
+    "children": [
+      {
+        "label": t('orderBasicData.paymentTerms'),
+        "value": "paymentTerms"
+      },
+      {
+        "label": t('orderBasicData.payMethod'),
+        "value": "payMethod"
+      }
+    ],
+    "label": t('orderBasicData.delivery'),
+    "value": "delivery"
+  }
+])
+
+
+const xGrid = ref()
+const gridOptions = reactive({
+  border:  "full",//琛ㄦ牸鍔犺竟妗�
+  keepSource: true,//淇濇寔婧愭暟鎹�
+  align: 'center',//鏂囧瓧灞呬腑
+  stripe:true,//鏂戦┈绾�
+  rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+  id: 'OrderList',
+  printConfig: {},
+  importConfig: {},
+  exportConfig: {},
+  scrollY:{ enabled: true },//寮�鍚櫄鎷熸粴鍔�
+  showOverflow:true,
+  columnConfig: {
+    resizable: true,
+    useKey: true
+  },
+  filterConfig: {   //绛涢�夐厤缃」
+    //remote: true
+  },
+  customConfig: {
+    storage: true
+  },
+  editConfig: {
+    trigger: 'click',
+    mode: 'row',
+    showStatus: true
+  },
+
+  //琛ㄥご鍙傛暟
+  columns:[
+    {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'),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')},
+
+
+  ],
+
+  //琛ㄥご鎸夐挳
+  toolbarConfig: {
+    slots:{
+      buttons: "toolbar_buttons",
+      tools:'add'
+    },
+
+    // import: false,
+    // export: true,
+    // print: true,
+    zoom: true,
+    custom: true
+  },
+})
+const gridEvents = {
+  toolbarButtonClick ({ code }) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (code) {
+        case 'add': {
+          rowIndex.value = null
+          dialogTableVisible.value = true
+          break
+        }
+
+      }
+    }
+  }
+}
+
+const add = () => {
+  rowIndex.value = null
+  dialogTableVisible.value = true
+}
+
+request.get('/basicData/getBasicData').then(res => {
+  if(res.code==='200'){
+    xGrid.value.reloadData(res.data)
+  }
+})
+
+const getChildrenFunction = (flag) => {
+  if(flag){
+    dialogTableVisible.value=false
+    handleChange()
+  }
+}
+
+let rowIndex = ref(null)
+const getTableRow =  (row,type) => {
+  switch (type) {
+    case 'edit': {
+      rowIndex.value = row
+      dialogTableVisible.value = true
+      break
+    }
+    case 'delete': {
+      request.post(`/basicData/deleteBasicData`,row).then((res) => {
+        if(res.code==200){
+          ElMessage.success(t('searchOrder.msgDeleteSuccess'))
+          router.push({
+            path:'/main/orderBasicData/searchBasicData',
+            query:{random:Math.random()
+            }
+          })
+        }else{
+          ElMessage.warning(t('searchOrder.msgDeleteFail'))
+        }
+      })
+      break
+    }
+
+  }
+}
+
+const handleChange = () => {
+  if(basic.value.basicType==null){
+    request.get('/basicData/getBasicData').then(res => {
+      if(res.code==='200'){
+        xGrid.value.reloadData(res.data)
+      }
+    })
+  }else{
+    request.get(`/basicData/BasicDataByType/${basic.value.basicType[0]}/${basic.value.basicType[1]}`).then(res => {
+      if(res.code==='200'){
+        xGrid.value.reloadData(res.data)
+      }
+    })
+  }
+
+
+}
+
+</script>
+
+<template>
+  <div  style="width: 100%;height: 100%">
+
+    <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>
+        </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>
+    </div>
+    <el-dialog
+        v-model="dialogTableVisible"
+        destroy-on-close
+        :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>
\ No newline at end of file

--
Gitblit v1.8.0