From 1f6c97aa5f23d09a04152038c7d53ce95721cf50 Mon Sep 17 00:00:00 2001
From: clll <1320612696@qq.com>
Date: 星期五, 22 十二月 2023 16:29:51 +0800
Subject: [PATCH] pp、sd模块界面调整,添加vxetable组件和对应界面跳转
---
north-glass-erp/northglass-erp/src/views/pp/BOM/BenchmarkBOM.vue | 262 +++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 196 insertions(+), 66 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/BOM/BenchmarkBOM.vue b/north-glass-erp/northglass-erp/src/views/pp/BOM/BenchmarkBOM.vue
index 4417046..c5b5258 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/BOM/BenchmarkBOM.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/BOM/BenchmarkBOM.vue
@@ -1,6 +1,159 @@
<script setup>
-import {reactive, ref} from 'vue'
+import {reactive, ref} from "vue";
+import {useRouter} from 'vue-router'
+let router=useRouter()
+const getTableRow = (row,type) =>{
+ switch (type) {
+ case 'edit' :{
+ //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+ router.push({path: '/main/reportingWorks/ReportingWorkDetail', query: { id: row.id }})
+ break
+ }
+ case 'delete':{
+ alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
+ break
+ }
+ case 'setType':{
+ alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍙嶅鐘舵��')
+ break
+ }
+ }
+}
+
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+ let count = 0
+ list.forEach(item => {
+ count += Number(item[field])
+ })
+ return count.toFixed(2)
+}
+
+//瀛愮粍浠舵帴鏀跺弬鏁�
+
+const gridOptions = reactive({
+ border: "full",//琛ㄦ牸鍔犺竟妗�
+ keepSource: true,//淇濇寔婧愭暟鎹�
+ align: 'center',//鏂囧瓧灞呬腑
+ stripe:true,//鏂戦┈绾�
+ rowConfig: {isCurrent: true, isHover: true,height: 50},//榧犳爣绉诲姩鎴栭�夋嫨楂樹寒
+ id: 'CustomerList',
+ 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:[
+ {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
+ { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
+ {field: 'materialCode', title: '鐗╂枡缂栫爜',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
+ {field: 'materialName', title: '鐗╂枡鍚嶇О', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+ {field: 'number',title: '鏁伴噺', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+ {field: 'materialRequisitionProcess', title: '棰嗘枡宸ュ簭',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'mainUnit',title: '涓诲崟浣�', sortable: true,showOverflow:"ellipsis"},
+ {field: 'conversionRate', title: '鎹㈢畻鐜�', sortable: true},
+ {field: 'deputyUnit', title: '鍓崟浣�', sortable: true},
+ {field: 'producer', title: '浜у湴', sortable: true,showOverflow:"ellipsis"},
+ ],//琛ㄥご鎸夐挳
+
+ toolbarConfig: {
+ buttons: [
+
+ // {
+ // name:'浜у搧绉嶇被',
+ // dropdowns: [
+ // { code: 'other1', name: '绉嶇被涓�', type: 'text', },
+ // { code: 'other2', name: '绉嶇被浜�', type: 'text', },
+ // { code: 'other2', name: '绉嶇被涓�', type: 'text', },
+ // ]
+ // },
+ {code: 'print_lck', name: '娣诲姞涓�琛�' },
+ {code: 'print_lck', name: '鍑忓皯涓�琛�' },
+ {code: 'print_lck', name: '淇濆瓨',status:'primary' ,icon:'vxe-icon-save'},
+ ],
+ import: false,
+ export: true,
+ print: true,
+ zoom: true,
+ custom: true
+ },
+ data: [
+ {
+ materialCode: '70020000000000000000000004',
+ materialName: '棰勬礂鍓�7600TRO-DS',
+ number: '4',
+ materialRequisitionProcess: '鍒堕暅',
+ mainUnit:'L',
+ conversionRate:'0.001000',
+ deputyUnit:'ml',
+ producer:'鍥涘窛',
+ },
+ {
+ materialCode: '70020000000000000000000004',
+ materialName: '棰勬礂鍓�7600TRO-DS',
+ number: '4',
+ materialRequisitionProcess: '鍒堕暅',
+ mainUnit:'L',
+ conversionRate:'0.001000',
+ deputyUnit:'ml',
+ producer:'鍥涘窛',
+ },
+
+ {
+ materialCode: '70020000000000000000000004',
+ materialName: '棰勬礂鍓�7600TRO-DS',
+ number: '4',
+ materialRequisitionProcess: '鍒堕暅',
+ mainUnit:'L',
+ conversionRate:'0.001000',
+ deputyUnit:'ml',
+ producer:'鍥涘窛',
+ },
+ {
+ materialCode: '70020000000000000000000004',
+ materialName: '棰勬礂鍓�7600TRO-DS',
+ number: '4',
+ materialRequisitionProcess: '鍒堕暅',
+ mainUnit:'L',
+ conversionRate:'0.001000',
+ deputyUnit:'ml',
+ producer:'鍥涘窛',
+ },
+ ],//table body瀹為檯鏁版嵁
+ //鑴氶儴姹傚拰
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ let footList=['number']
+ return[
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return '鍚堣:'
+ }
+ if (footList.includes(column.field)) {
+ return sumNum(data, column.field)
+ }
+ return ''
+ })
+ ]
+ }
+
+})
const value = ref('')
const options = [
@@ -17,53 +170,11 @@
label: 'Option3',
},
]
-const form = reactive({
- name: '1',
- region: '',
- date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: '',
-})
-const tableData = [
- {
- 1: '70020000000000000000000004',
- 2: '棰勬礂鍓�7600TRO-DS',
- 3: '4',
- 4: '鍒堕暅',
- 5:'L',
- 6:'0.001000',
- 7:'ml',
- 8:'鍥涘窛',
- },
- {
- 1: '70020000000000000000000004',
- 2: '棰勬礂鍓�7600TRO-DS',
- 3: '4',
- 4: '鍒堕暅',
- 5:'L',
- 6:'0.001000',
- 7:'ml',
- 8:'鍥涘窛',
- },
- {
- 1: '70020000000000000000000004',
- 2: '棰勬礂鍓�7600TRO-DS',
- 3: '4',
- 4: '鍒堕暅',
- 5:'L',
- 6:'0.001000',
- 7:'ml',
- 8:'鍥涘窛',
- },
-]
+
</script>
<template>
-<div>
- <div>
+ <div class="main-div-customer">
<el-select v-model="value" class="m-2" placeholder="浜у搧绉嶇被">
<el-option
v-for="item in options"
@@ -72,29 +183,48 @@
:value="item.value"
/>
</el-select>
-
- <label>鍩烘暟:</label>
- <el-input placeholder="鍩烘暟" style="width: 100px" v-model="form.name">1</el-input>
-
- <el-button type="primary">娣诲姞涓�琛�</el-button>
- <el-button type="primary">鍑忓皯涓�琛�</el-button>
- <el-button type="primary">淇濆瓨</el-button>
+ <vxe-grid
+ max-height="100%"
+ @filter-change="filterChanged"
+ class="mytable-scrollbar"
+ ref="xGrid"
+ v-bind="gridOptions"
+
+ >
+ <!-- @toolbar-button-click="toolbarButtonClickEvent"-->
+ <!-- 涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
+ <template #content="{ row}">
+ <ul class="expand-wrapper">
+ <li v-for="(item,key,index) in row">
+ <span style="font-weight: bold">{{key+': '}}</span>
+ <span>{{ item }}</span>
+ </li>
+ </ul>
+ </template>
+
+ <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
+ <template #button_slot="{ row }">
+ <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">缂栬緫</el-button>
+ <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">鍙嶅</el-button>
+ <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">鍒犻櫎</el-button>
+ </template>
+
+ <template #num1_filter="{ column, $panel }">
+ <div>
+ <div v-for="(option, index) in column.filters" :key="index">
+ <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
+ </div>
+ </div>
+ </template>
+
+
+ </vxe-grid>
</div>
- <div>
- <el-table :data="tableData" border style="width: 100%" height="100%">
- <el-table-column prop="1" label="鐗╂枡缂栫爜" :show-overflow-tooltip='true' width="250" />
- <el-table-column prop="2" label="鐗╂枡鍚嶇О" :show-overflow-tooltip='true' width="250" />
- <el-table-column prop="3" label="鏁伴噺" width="105" />
- <el-table-column prop="4" label="棰嗘枡宸ュ簭" width="155" />
- <el-table-column prop="5" label="涓诲崟浣�" width="142" />
- <el-table-column prop="6" label="鎹㈢畻鐜�" width="175" />
- <el-table-column prop="7" label="鍓崟浣�" width="155" />
- <el-table-column prop="8" label="浜у湴" width="115" />
- </el-table>
- </div>
-</div>
</template>
<style scoped>
-
+.main-div-customer{
+ width: 99%;
+ height: 100%;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0