From 8449b7205be9e73ddd353f9835a40fd1d72462d4 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期二, 23 四月 2024 14:46:28 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override
---
north-glass-erp/northglass-erp/src/views/mm/basicData/WarehouseSearchBasicData.vue | 185 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 185 insertions(+), 0 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/mm/basicData/WarehouseSearchBasicData.vue b/north-glass-erp/northglass-erp/src/views/mm/basicData/WarehouseSearchBasicData.vue
new file mode 100644
index 0000000..6c8a3fb
--- /dev/null
+++ b/north-glass-erp/northglass-erp/src/views/mm/basicData/WarehouseSearchBasicData.vue
@@ -0,0 +1,185 @@
+<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 WarehouseCreateBasicData from "@/views/mm/basicData/WarehouseCreateBasicData.vue";
+const { t } = useI18n()
+
+let dialogTableVisible = ref(false)
+const router = useRouter()
+const xGrid = ref()
+const gridOptions = reactive({
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe:true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true,height: 30},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'OrderList',
+ showFooter: true,//鏄剧ず鑴�
+ 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: '搴忓彿', width: 80 ,fixed:"left",},
+ {field:'operateTypeName',title: '鍚嶇О'},
+ {field:'operateType',title: '鍒О'},
+ {field:'type',title: '绫诲瀷'},
+ {field:'createTime',title: '鍒涘缓鏃ユ湡'},
+
+
+ ],
+
+ //琛ㄥご鎸夐挳
+ toolbarConfig: {
+ buttons: [
+ {'code': 'add', 'name': '鏂板',status: 'primary'},
+ ],
+
+ // import: false,
+ // export: true,
+ // print: true,
+ zoom: true,
+ custom: true
+ },
+
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ return[
+ columns.map((column, columnIndex) => {
+ // if (columnIndex === 0) {
+ // return t('basicData.total')
+ // }
+ // if (props.tableProp.footList.includes(column.field)) {
+ // return sumNum(data, column.field)
+ // }
+ return ''
+ })
+ ]
+ }
+
+})
+const gridEvents = {
+ toolbarButtonClick ({ code }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (code) {
+ case 'add': {
+ rowIndex.value = null
+ dialogTableVisible.value = true
+ break
+ }
+
+ }
+ }
+ },
+ menuClick ({ menu, row, column }) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (menu.code) {
+
+
+ }
+ }
+ }
+}
+
+request.get('/BasicWarehouse/getBasicWarehouse').then(res => {
+ if(res.code==='200'){
+ xGrid.value.reloadData(res.data)
+ }
+})
+
+const getChildrenFunction = (flag) => {
+ if(flag){
+ router.push({
+ path:'/main/warehouseBasicData/warehouseSearchBasicData',
+ query:{random:Math.random()
+ }
+ })
+ }
+}
+
+let rowIndex = ref(null)
+const getTableRow = (row,type) => {
+ switch (type) {
+ case 'edit': {
+ rowIndex.value = row
+ dialogTableVisible.value = true
+ break
+ }
+ case 'delete': {
+ request.post(`/BasicWarehouse/deleteBasicWarehouse`,row).then((res) => {
+ if(res.code==200){
+ ElMessage.success(t('searchOrder.msgDeleteSuccess'))
+ router.push({
+ path:'/main/warehouseBasicData/warehouseSearchBasicData',
+ query:{random:Math.random()
+ }
+ })
+ }else{
+ ElMessage.warning(t('searchOrder.msgDeleteFail'))
+ }
+ })
+ break
+ }
+
+ }
+}
+
+</script>
+
+<template>
+ <div>
+ <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="纭畾鍒犻櫎鏁版嵁锛�">
+ <template #reference>
+ <el-button link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
+ </template>
+ </el-popconfirm>
+ </template>
+
+ </vxe-grid>
+ <el-dialog
+ v-model="dialogTableVisible"
+ destroy-on-close
+ style="width: 30%;height:30% ">
+ <WarehouseCreateBasicData :rowIndex="rowIndex" @gaveParent='getChildrenFunction'/>
+ </el-dialog>
+ </div>
+</template>
+
+<style scoped>
+
+</style>
\ No newline at end of file
--
Gitblit v1.8.0