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/processCard/ReShelving.vue | 251 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 183 insertions(+), 68 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/processCard/ReShelving.vue b/north-glass-erp/northglass-erp/src/views/pp/processCard/ReShelving.vue
index 2879136..3be6b4e 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/processCard/ReShelving.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/processCard/ReShelving.vue
@@ -1,88 +1,203 @@
-<script lang="ts" setup>
-import { reactive } from 'vue'
+<script setup>
-// do not use same name with ref
+import {reactive} from "vue";
+import {useRouter} from 'vue-router'
+let router=useRouter()
+const getTableRow = (row,type) =>{
+ switch (type) {
+ case 'edit' :{
+ //alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑缂栬緫淇℃伅')
+ router.push({path: '/main/processCard/PrintFlowCard', query: { id: row.id }})
+ break
+ }
+ case 'delete':{
+ alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鍒犻櫎淇℃伅')
+ break
+ }
+ case 'setType':{
+ alert('鎴戞帴鏀跺埌瀛愮粍浠朵紶閫佺殑鎺掔増鐘舵��')
+ break
+ }
+ }
+}
+
const form = reactive({
- name: '',
- region: '',
- date1: '',
- date2: '',
- delivery: false,
- type: [],
- resource: '',
- desc: '',
+ xsdh: 'NG231207'
})
-const tableData = [
- {
- salesOrderNo: 'NG231207',
- processCard:'NG231207A01',
- serialNumber:"1",
- number: '11',
- technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
- },
- {
- salesOrderNo: 'NG231207',
- processCard:'NG231207A01',
- serialNumber:"2",
- number: '11',
- technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+//琛ㄥ熬姹傚拰
+const sumNum = (list, field) => {
+ let count = 0
+ list.forEach(item => {
+ count += Number(item[field])
+ })
+ return count.toFixed(2)
+}
- },
- {
- salesOrderNo: 'NG231207',
- processCard:'NG231207A01',
- serialNumber:"3",
- number: '11',
- technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+//瀛愮粍浠舵帴鏀跺弬鏁�
+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
},
- {
- salesOrderNo: 'NG231207',
- processCard:'NG231207A02',
- serialNumber:"4",
- number: '11',
- technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+ filterConfig: { //绛涢�夐厤缃」
+ remote: true
+ },
+ customConfig: {
+ storage: true
+ },
+ editConfig: {
+ trigger: 'click',
+ mode: 'row',
+ showStatus: true
+ },//琛ㄥご鍙傛暟
+ columns:[
+ {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
+ { type: 'checkbox',fixed:"left", title: '閫夋嫨', width: 80 },
+ { type: 'seq',fixed:"left", title: '鑷簭', width: 50 },
+ {field: 'salesOrderNo', title: '閿�鍞崟鍙�',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
+ {field: 'processCard', title: '娴佺▼鍗″彿', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+ {field: 'serialNumber', title: '搴忓彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+ {field: 'number', title: '鏁伴噺',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'technologicalProcess', title: '宸ヨ壓娴佺▼', sortable: true,showOverflow:"ellipsis"},
+ ],//琛ㄥご鎸夐挳
+ toolbarConfig: {
+ buttons: [
+ {code: 'print_lck', name: '閲嶆柊鍒嗘灦',status:'primary' ,icon:'vxe-icon-save'},
+ ],
+ import: false,
+ export: true,
+ print: true,
+ zoom: true,
+ custom: true
},
- {
- salesOrderNo: 'NG231207',
- processCard:'NG231207A02',
- serialNumber:"5",
- number: '11',
- technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+ data: [
+ {
+ salesOrderNo: 'NG231207',
+ processCard:'NG231207A01',
+ serialNumber:"1",
+ number: '11',
+ technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
- },
-]
+ },
+ {
+ salesOrderNo: 'NG231207',
+ processCard:'NG231207A01',
+ serialNumber:"2",
+ number: '11',
+ technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+
+ },
+ {
+ salesOrderNo: 'NG231207',
+ processCard:'NG231207A01',
+ serialNumber:"3",
+ number: '11',
+ technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+
+ },
+ {
+ salesOrderNo: 'NG231207',
+ processCard:'NG231207A02',
+ serialNumber:"4",
+ number: '11',
+ technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+
+ },
+ {
+ salesOrderNo: 'NG231207',
+ processCard:'NG231207A02',
+ serialNumber:"5",
+ number: '11',
+ technologicalProcess: '鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰,鍒囧壊->纾ㄨ竟->閽㈠寲->涓┖->鍖呰',
+
+ },
+ ],//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 ''
+ })
+ ]
+ }
+
+})
+
+
+
</script>
<template>
- <div>
- <div id="selectForm">
- <el-row :gutter="0">
- <el-input placeholder="閿�鍞崟鍙�" v-model="form.name" style="width: 200px"/>
-
- <el-button type="primary">鏌ヨ</el-button>
- <el-button type="primary">閲嶆柊鍒嗘灦</el-button>
- </el-row>
+ <div class="main-div-customer">
+ <el-row :gutter="0">
+ <el-input placeholder="閿�鍞崟鍙�" v-model="form.xsdh" style="width: 200px"/>
+
+ <el-button type="primary">鏌ヨ</el-button>
+ </el-row>
+ <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>
- </div>
- <div>
- <el-table :data="tableData" border style="width: 100%" height="100%">
- <el-table-column type="selection" width="55" />
- <el-table-column label="閿�鍞崟鍙�" width="100">
- <template #default="scope">{{ scope.row.salesOrderNo }}</template>
- </el-table-column>
- <el-table-column prop="processCard" label="娴佺▼鍗″彿" :show-overflow-tooltip='true' width="130" />
- <el-table-column prop="serialNumber" label="搴忓彿" width="60" />
- <el-table-column prop="number" label="鏁伴噺" width="80" />
- <el-table-column prop="technologicalProcess" :show-overflow-tooltip='true' label="宸ヨ壓娴佺▼" />
- </el-table><!-- <h1>{{msg}}</h1> -->
- </div>
+ </vxe-grid>
</div>
</template>
<style scoped>
-
+.main-div-customer{
+ width: 99%;
+ height: 100%;
+}
</style>
\ No newline at end of file
--
Gitblit v1.8.0