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/rework/SelectRework.vue | 333 +++++++++++++++++++++++++++++++++----------------------
1 files changed, 201 insertions(+), 132 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/pp/rework/SelectRework.vue b/north-glass-erp/northglass-erp/src/views/pp/rework/SelectRework.vue
index 571db7e..a97896d 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/rework/SelectRework.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/rework/SelectRework.vue
@@ -1,61 +1,9 @@
<script setup>
-import {reactive, ref} from 'vue'
-// do not use same name with ref
+import {reactive, ref} from "vue";
+import {useRouter} from 'vue-router'
+let router=useRouter()
-const value = ref('')
-const defaultTime = ref<[Date, Date]>([
- new Date(2000, 1, 1, 0, 0, 0),
- new Date(2000, 2, 1, 23, 59, 59),
-])
-const tableData = [
- {
-
- reworkNumber:'FG20202020',
- salesOrderNo:'NG23010101',
- processCardNo:'NG23010101A01',
- entryName:'xxxx',
- batch:'浜屾壒涓�',
- serialNumber:'1',
- area:'23.11',
- qualityInspector:"寮犱笁",
- number:'1',
- singlePieceName: '6mm鐧界幓骞抽挗(澶�)',
- marking: '1',
- pieces: '(澶�)',
- width: '575',
- height:"2241",
- shape: '鏅舰',
- reworkTeams:'XX浜岀彮',
- type: '鏈哄櫒',
- damage:'姘旀场瓒呮爣',
- reworkProcess:'XXXX',
- device:'XXX'
- },
- {
-
- reworkNumber:'FG20203333',
- salesOrderNo:'NG23010101',
- processCardNo:'NG23010101A01',
- entryName:'xxxx',
- batch:'浜屾壒涓�',
- serialNumber:'1',
- area:'23.11',
- qualityInspector:"寮犱笁",
- number:'1',
- singlePieceName: '6mm鐧界幓骞抽挗(澶�)',
- marking: '1',
- pieces: '(澶�)',
- width: '575',
- height:"2241",
- shape: '鏅舰',
- reworkTeams:'XX浜岀彮',
- type: '鏈哄櫒',
- damage:'姘旀场瓒呮爣',
- reworkProcess:'XXXX',
- device:'XXX'
- },
-]
const dialogFormVisible = ref(false)
const formLabelWidth = '140px'
@@ -69,61 +17,217 @@
resource: '',
desc: '',
})
+const getTableRow = (row,type) =>{
+ switch (type) {
+ case 'edit' :{
+ console.log(type)
+
+ // router.push({path: '/main/Rework/SelectRework', 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 },
+ {title: '鎿嶄綔', width: 110, slots: { default: 'button_slot' },fixed:"left"},
+ {field: 'reworkNumber',width: 120, title: '杩斿伐缂栧彿',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
+ {field: 'salesOrderNo',width: 120, title: '閿�鍞崟鍙�', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+ {field: 'processCardNo',width: 120, title: '娴佺▼鍗″彿', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
+ {field: 'entryName', width: 120,title: '椤圭洰鍚嶇О',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
+ {field: 'batch',width: 80, title: '鎵规', sortable: true,showOverflow:"ellipsis"},
+ {field: 'serialNumber',width: 80, title: '搴忓彿', sortable: true},
+ {field: 'singlePieceName',width: 120, title: '鍗曠墖鍚嶇О', sortable: true},
+ {field: 'marking',width: 80, title: '鏍囪', sortable: true,showOverflow:"ellipsis"},
+ {field: 'pieces',width: 90, title: '鐗囨爣璁�', sortable: true},
+ {field: 'number',width: 80, title: '鏁伴噺', sortable: true},
+ {field: 'width',width: 80, title: '瀹�', sortable: true},
+ {field: 'height',width: 80, title: '楂�', sortable: true},
+ {field: 'shape',width: 80, title: '褰㈢姸', sortable: true},
+ {field: 'type',width: 100, title: '杩斿伐绫诲瀷', sortable: true},
+ {field: 'damage',width: 120, title: '杩斿伐鍘熷洜', sortable: true},
+ {field: 'device',width: 120, title: '璐d换璁惧', sortable: true},
+ {field: 'teams',width: 120, title: '璐d换鐝粍', sortable: true},
+ {field: 'area',width: 120, title: '杩斿伐闈㈢Н', sortable: true},
+ {field: 'reworkProcess',width: 120, title: '杩斿伐宸ュ簭', sortable: true},
+ {field: 'reworkTeams',width: 120, title: '杩斿伐鐝粍', sortable: true},
+ {field: 'qualityInspector',width: 100, title: '璐ㄦ鍛�', sortable: true}
+ ],//琛ㄥご鎸夐挳
+
+ toolbarConfig: {
+ // buttons: [{
+ //
+ // }],
+ import: false,
+ export: true,
+ print: true,
+ zoom: true,
+ custom: true
+ },
+ data: [
+ {
+
+ reworkNumber:'FG20202020',
+ salesOrderNo:'NG23010101',
+ processCardNo:'NG23010101A01',
+ entryName:'xxxx',
+ batch:'浜屾壒涓�',
+ serialNumber:'1',
+ area:'23.11',
+ qualityInspector:"寮犱笁",
+ number:'1',
+ singlePieceName: '6mm鐧界幓骞抽挗(澶�)',
+ marking: '1',
+ pieces: '(澶�)',
+ width: '575',
+ height:"2241",
+ shape: '鏅舰',
+ reworkTeams:'XX浜岀彮',
+ type: '鏈哄櫒',
+ damage:'姘旀场瓒呮爣',
+ reworkProcess:'XXXX',
+ device:'XXX'
+ },
+ {
+
+ reworkNumber:'FG20203333',
+ salesOrderNo:'NG23010101',
+ processCardNo:'NG23010101A01',
+ entryName:'xxxx',
+ batch:'浜屾壒涓�',
+ serialNumber:'1',
+ area:'23.11',
+ qualityInspector:"寮犱笁",
+ number:'1',
+ singlePieceName: '6mm鐧界幓骞抽挗(澶�)',
+ marking: '1',
+ pieces: '(澶�)',
+ width: '575',
+ height:"2241",
+ shape: '鏅舰',
+ reworkTeams:'XX浜岀彮',
+ type: '鏈哄櫒',
+ damage:'姘旀场瓒呮爣',
+ reworkProcess:'XXXX',
+ device:'XXX'
+ },
+ ],//table body瀹為檯鏁版嵁
+ //鑴氶儴姹傚拰
+ footerMethod ({ columns, data }) {//椤佃剼鍑芥暟
+ let footList=['number','area']
+ return[
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return '鍚堣:'
+ }
+ if (footList.includes(column.field)) {
+ return sumNum(data, column.field)
+ }
+ return ''
+ })
+ ]
+ }
+
+})
+
+
+
</script>
<template>
- <div>
+ <div class="main-div-customer">
<div id="head" >
-<!-- <el-input placeholder="娴佺▼鍗″彿" v-model="form.xsdh" style="width: 200px"/>-->
-<!-- -->
-
-<!-- <el-input placeholder="椤圭洰鍚嶇О" v-model="form.lckh" style="width: 200px"/>-->
-<!-- -->
<el-date-picker
v-model="value"
type="daterange"
start-placeholder="寮�濮嬫椂闂�"
end-placeholder="缁撴潫鏃堕棿"
- :default-time="defaultTime"
/>
<el-button type="primary">鏌ヨ</el-button>
</div>
+ <vxe-grid
+ max-height="100%"
+ @filter-change="filterChanged"
+ class="mytable-scrollbar"
+ ref="xGrid"
+ v-bind="gridOptions"
- <div>
- <el-table :data="tableData" border style="width: 100%" height="100%">
- <el-table-column fixed label="鎿嶄綔" width="100" >
- <el-button link type="primary" size="small" @click="dialogFormVisible = true">缂栬緫</el-button>
- <el-button link type="primary" size="small">瀹℃牳</el-button>
- </el-table-column>
- <el-table-column prop="reworkNumber" label="杩斿伐缂栧彿" width="155" />
- <el-table-column sortable prop="salesOrderNo" label="閿�鍞崟鍙�" width="120" />
- <el-table-column sortable prop="processCardNo" label="娴佺▼鍗″彿" width="130" />
- <el-table-column prop="entryName" label="椤圭洰鍚嶇О" width="120" :show-overflow-tooltip='true'/>
- <el-table-column prop="batch" label="鎵规" width="70" />
- <el-table-column prop="serialNumber" label="搴忓彿" width="60" />
- <el-table-column prop="singlePieceName" :show-overflow-tooltip='true' label="鍗曠墖鍚嶇О" width="120" />
- <el-table-column prop="marking" label="鏍囪" width="60" />
- <el-table-column prop="pieces" label="鐗囨爣璁�" width="70" />
- <el-table-column prop="number" label="鏁伴噺" width="95" />
- <el-table-column prop="width" label="瀹�" width="60" />
- <el-table-column prop="height" label="楂�" width="60" />
- <el-table-column prop="shape" label="褰㈢姸" :show-overflow-tooltip='true' width="60" />
- <el-table-column prop="type" label="杩斿伐绫诲瀷" :show-overflow-tooltip='true' width="85" />
- <el-table-column prop="damage" label="杩斿伐鍘熷洜" :show-overflow-tooltip='true' width="85" />
- <el-table-column prop="device" label="璐d换璁惧" :show-overflow-tooltip='true' width="85" />
- <el-table-column prop="teams" label="璐d换鐝粍" :show-overflow-tooltip='true' width="85" />
- <el-table-column prop="area" label="杩斿伐闈㈢Н" width="85" />
- <el-table-column prop="reworkProcess" label="杩斿伐宸ュ簭" :show-overflow-tooltip='true' width="85" />
- <el-table-column prop="reworkTeams" label="杩斿伐鐝粍" :show-overflow-tooltip='true' width="85" />
- <el-table-column prop="qualityInspector" label="璐ㄦ鍛�" width="80" />
+ >
+ <!-- @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="dialogFormVisible = true" link type="primary" size="small">缂栬緫</el-button>
+ <el-button @click="getTableRow(row,'setType')" 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>
-
-
-
- </el-table><!-- <h1>{{msg}}</h1> -->
- </div>
-
+ </vxe-grid>
<el-dialog v-model="dialogFormVisible" title="杩斿伐缂栬緫">
<el-form :model="form">
<el-form-item label="杩斿伐缂栧彿" :label-width="formLabelWidth">
@@ -149,43 +253,8 @@
</template>
<style scoped>
-#head{
- width: 70%;
-}
-
-.processCard{
- width: 140px;
-}
-.processesSt{
- height: 33px;
- width: 80px;
- background-color: #409eff;
- color: white;
- border: none;
- border-radius: 5px;
-}
-#titleTable tr,#titleTable td{
- border: 1px solid #000;
-}
-#titleTable{
- border-collapse: collapse;
- text-align: center;
- width: 100%;
+.main-div-customer{
+ width: 99%;
height: 100%;
-}
-#titleTable td{
- width: 100px;
- height: 30px;
-}
-#titleTable td:nth-child(1){
- width: 100px;
- height: 30px;
-}
-#titleTable td:nth-child(2){
- width: 100px;
-}
-.chaxun{
- background-color:#D5EAFF;
- border: none;
}
</style>
\ No newline at end of file
--
Gitblit v1.8.0