From 729857291aab73cfd0d61056887ce92657792ca0 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期一, 25 十二月 2023 13:54:24 +0800
Subject: [PATCH] Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
---
north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue | 288 ++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 213 insertions(+), 75 deletions(-)
diff --git a/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue b/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue
index 7037b80..8b12b58 100644
--- a/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue
+++ b/north-glass-erp/northglass-erp/src/views/mm/purchaseOrder/Payment.vue
@@ -15,7 +15,6 @@
format="YYYY/MM/DD"
value-format="YYYY-MM-DD"
/>
-
</el-col>
<el-col :span="2">
@@ -30,50 +29,44 @@
</el-header>
<el-main style="padding-top: 5px">
- <div>
+ <vxe-grid
- <el-table :data="tableData" empty-text="鏆傛棤鏁版嵁" style="width: 100%" max-height="550px" border
- show-summary
- sum-text=" ">
- <el-table-column fixed="left" prop="rIndex" label="" width="50" align="center"></el-table-column>
+ max-height="600"
+ @filter-change="filterChanged"
+ class="mytable-scrollbar"
+ ref="xGrid"
+ v-bind="PayOptions"
+ @="gridEvents"
- <el-table-column fixed="left" label="鎿嶄綔" width="100%">
- <template #default="scope">
- <el-button
- link
- type="primary"
- size="small"
- @click.prevent="editRow(scope.$index)"
- >
- 缂栬緫
- </el-button>
- <el-button
- link
- type="primary"
- size="small"
- @click.prevent="deleteRow(scope.$index)"
- >
- 鍒犻櫎
- </el-button>
- </template>
- </el-table-column>
+ >
+ <!-- @="gridEvents"-->
+ <!-- @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,'delete')" link type="primary" size="small">鍒犻櫎</el-button>-->
+ <!-- <el-button @click="cellClickEvent" link type="primary" size="small">璇︽儏</el-button>-->
+ </template>
- <el-table-column prop="ordernumber" label="閲囪喘鍗曞彿" width="200%"/>
- <el-table-column prop="name" label="鏈堜唤" width="100%"/>
- <el-table-column prop="strockNumber" label="渚涘簲鍟�" width="200%"/>
- <el-table-column prop="city" label="鏈熷垵閲戦" width="100%"/>
- <el-table-column prop="width" sortable label="鏈湡搴斾粯" width="150%"/>
- <el-table-column prop="height" sortable label="鏈湡宸蹭粯" width="150%"/>
- <el-table-column prop="thick" sortable label="鏈熸湯浣欓" width="150%"/>
- <el-table-column prop="zip" label="绋庣巼" width="150%"/>
- <el-table-column prop="zip" label="澶囨敞" width="200"/>
-
-
- </el-table>
-
-
- </div>
+ <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>
</el-main>
</el-container>
</template>
@@ -81,46 +74,192 @@
<script setup>
import {ref} from 'vue'
-import {Plus, Search} from "@element-plus/icons-vue";
-
-import dayjs from 'dayjs'
+import {Search} from "@element-plus/icons-vue";
import 'dayjs/locale/zh-cn'
+import {VXETable} from "vxe-table";
+import {reactive} from "vue";
+import {useRouter} from 'vue-router'
-const now = new Date()
+//缁勪欢鎺ユ敹鍙傛暟
+const PayOptions = 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: [
+ /* {title: '鎿嶄綔', width: '8%', slots: {default: 'button_slot'}, fixed: "left"},*/
+ {type: 'seq', fixed: "left", title: ' ', width: '5%'},
+ {type: 'checkbox', fixed: "left", title: '', width: '5%'},
+ {type: 'expand', title: '璇︽儏', fixed: "left", slots: {content: 'content'}, width: '5%'},
+ {
+ field: 'cgdh',
+ width: '10%',
+ title: '閲囪喘鍗曞彿',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ sortable: true
+ },
+ {field: 'cgzt', width: '10%', title: '鏈堜唤', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {
+ field: 'gys',
+ width: '10%',
+ title: '渚涘簲鍟�',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ sortable: true
+ },
+ {
+ field: 'wlbh',
+ width: '10%',
+ title: '鏈熷垵閲戦',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ sortable: true
+ },
+ {
+ field: 'wlmc',
+ width: '10%',
+ title: '鏈湡搴斾粯',
+ filters: [{data: ''}],
+ slots: {filter: 'num1_filter'},
+ sortable: true
+ },
+ {field: 'w', width: '10%', title: '鏈湡宸蹭粯', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: 'g', width: '10%', title: '鏈熸湯浣欓', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: 'h', width: '9%', title: '绋庣巼', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true},
+ {field: '6', width: '10%', title: '澶囨敞', filters: [{data: ''}], slots: {filter: 'num1_filter'}, sortable: true}
+ ],//琛ㄥご鍙傛暟
+ toolbarConfig: {
+ buttons: [{type:'text'},{
+ 'name': '搴斾粯纭',
+ status:'primary',
+ 'code': 'Sure',
+ }],
+ import: false,
+ export: true,
+ print: true,
+ zoom: true,
+ custom: true,
+ style: 'paddling-left:10px'
+ },//琛ㄥご鎸夐挳
+ data: [{},{},{},{}],//table body瀹為檯鏁版嵁
+ mergeFooterItems: [
+ {row: 0, col: 0, rowspan: 1, colspan: 3}
+ ],//鍚堝苟鑴�
+ footerMethod({columns, data}) {//椤佃剼鍑芥暟
+ return [
+ columns.map((column, columnIndex) => {
+ if (columnIndex === 0) {
+ return '鍚堣:'
+ }
+ /* if (props.tableProp.footList.includes(column.field)) {
+ return sumNum(data, column.field)
+ }*/
+ return ''
+ })
+ ]
+ },
-const tableData = ref([])
+})
-const autoAddRow = () => {
- for (let i = 0; i < 10; i++) {
- now.setDate(now.getDate() + 1)
- const randomInt = Math.floor(Math.random() * 999) + 1000;
- const randomOrderInt = Math.floor(Math.random() * 99) + 100;
- const randomSumInt = Math.floor(Math.random() * 99) + 10;
- var t = i % 2 === 0 ? 5 : 6;
- var s = i % 3 === 0 ? '' : i % 4 === 0 ? '宸查噰璐�' : '寰呭鏍�';
- var oNo = 'NGNO100000' + randomOrderInt;//璁㈠崟缂栧彿
- var wlNo = 'NGWL100000' + randomInt
- tableData.value.push({
- date: dayjs(now).format('YYYY-MM-DD'),
- name: '渚涘簲鍟�' + randomSumInt,
- state: s,
- city: 'Los Angeles',
- address: 'No. 189, Grove St, Los Angeles',
- zip: 'CA 90036',
- number: randomInt,
- width: '3660',
- height: '2440',
- rIndex: tableData.value.length + 1,
- ordernumber: oNo,
- strockNumber: wlNo,
- thick: t
- })
- }
+const xGrid = ref()
+const gridEvents = {
+ toolbarButtonClick({code}) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (code) {
+ case 'Add': {//鏂板
+ router.push({path: '/main/purchaseOrder/CreatePurchaseOrder'})
+ break
+ }
+ case 'Storage': {//鍏ュ簱
+ if ($grid.getCheckboxRecords().length === 0) {
+ openAlert({type: 'message', content: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�', status: 'warning'})
+ //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+ return
+ } else {
+ const type = VXETable.modal.confirm('鎮ㄩ�夋嫨浜�' + $grid.getCheckboxRecords().length + '鏉℃暟鎹紒,鏄惁纭鍏ュ簱锛�');
+ //openAlert({type:'alert', content: '鎴愬姛鍏ュ簱'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success' })
+ //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+ return
+ }
+ break
+ }
+ case 'Return': {//閫�搴�
+ if ($grid.getCheckboxRecords().length === 0) {
+ openAlert({type: 'message', content: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�', status: 'warning'})
+ //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+ return
+ } else {
+ /* async ()=>{
+ const type = await.VXETable.modal.confirm('鎮ㄩ�夋嫨浜�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒,鏄惁纭閫�搴擄紵');
+ }*/
+ const type = VXETable.modal.confirm('鎮ㄩ�夋嫨浜�' + $grid.getCheckboxRecords().length + '鏉℃暟鎹紒,鏄惁纭閫�搴擄紵');
+
+
+ /* if(VXETable.modal.confirm('鎮ㄩ�夋嫨浜�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒,鏄惁纭閫�搴擄紵' )){
+ //openAlert({type:'message', content: '鎴愬姛閫�搴�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success',lockView: false, mask: false })
+
+
+ }*/
+
+ /* if(type==='confirm'){
+ openAlert({type:'message', content: '鎴愬姛閫�搴�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success' })
+ }
+
+*/
+ //openAlert({type:'alert', content: '鎴愬姛閫�搴�'+$grid.getCheckboxRecords().length+'鏉℃暟鎹紒', status: 'success' })
+ //VXETable.modal.message( '璇烽�夋嫨涓�鏉℃暟鎹紒')
+ return
+ }
+ break
+ }
+ }
+ }
+ },
+ toolbarToolClick({code}) {
+ const $grid = xGrid.value
+ if ($grid) {
+ switch (code) {
+ case 'myPrint': {
+ $grid.print()
+ break
+ }
+ }
+ }
+ },
}
-const CreatePurchaseOrder = () => {
-
+const openAlert = (options) => {
+ if (options.type === 'message') {
+ VXETable.modal.message(options)
+ } else {
+ VXETable.modal.alert(options)
+ }
}
@@ -155,7 +294,6 @@
},
},
]
-
</script>
--
Gitblit v1.8.0