From 050114072f1c0213ac1f1f303007f66dc5cef23d Mon Sep 17 00:00:00 2001
From: zhuzhuanzhuan
Date: 星期五, 01 十二月 2023 13:00:59 +0800
Subject: [PATCH] 删除测试代码
---
src/views/spare/modules/sparePartInventory/SparePart2List.vue | 183 ++++++++++++++++++++++++++-------------------
1 files changed, 107 insertions(+), 76 deletions(-)
diff --git a/src/views/spare/modules/sparePartInventory/SparePart2List.vue b/src/views/spare/modules/sparePartInventory/SparePart2List.vue
index b6fae00..50d8e89 100644
--- a/src/views/spare/modules/sparePartInventory/SparePart2List.vue
+++ b/src/views/spare/modules/sparePartInventory/SparePart2List.vue
@@ -53,11 +53,19 @@
type="primary"
@click="searchQuery"
icon="search"
- >鏌ヨ</a-button>
+ >鏌ヨ
+ </a-button>
<a-button
@click="searchReset"
icon="reload"
- >閲嶇疆</a-button>
+ >閲嶇疆
+ </a-button>
+ <a-button
+ type="primary"
+ icon="download"
+ @click="handleExportXls('澶囦欢搴撳瓨')"
+ >瀵煎嚭
+ </a-button>
<a-upload
name="file"
:showUploadList="false"
@@ -67,6 +75,10 @@
@change="handleImportExcel">
<a-button type="primary" icon="import">瀵煎叆</a-button>
</a-upload>
+ <a-tag color="#55acee" style="height:15px"></a-tag>
+ 搴撳瓨绉帇
+ <a-tag color="#cd201f" style="height:15px"></a-tag>
+ 搴撳瓨涓嶈冻
</div>
<a-table
@@ -132,12 +144,13 @@
},
data() {
return {
+ mainId: '',
ipagination: {
current: 1,
pageSize: 5,
pageSizeOptions: ['5', '10', '20'],
showTotal: (total, range) => {
- return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�"
+ return range[0] + '-' + range[1] + ' 鍏�' + total + '鏉�'
},
showQuickJumper: true,
showSizeChanger: true,
@@ -148,7 +161,7 @@
//榛樿鎺掑簭
isorter: {
column: 'num',
- order: 'asc',
+ order: 'asc'
},
columns: [
@@ -157,94 +170,95 @@
dataIndex: '',
key: 'rowIndex',
align: 'center',
- customRender: function (t, r, index) {
+ customRender: function(t, r, index) {
return parseInt(index) + 1
},
- width: 50,
+ width: 50
},
{
title: '澶囦欢缂栫爜',
- align: "center",
- dataIndex: 'num',
+ align: 'center',
+ dataIndex: 'num'
},
{
title: '澶囦欢鍚嶇О',
- align: "center",
- dataIndex: 'name',
+ align: 'center',
+ dataIndex: 'name'
},
{
title: '鍨嬪彿',
- align: "center",
- dataIndex: 'model',
+ align: 'center',
+ dataIndex: 'model'
},
{
title: '瑙勬牸',
- align: "center",
- dataIndex: 'specification',
+ align: 'center',
+ dataIndex: 'specification'
},
{
title: '鍒堕�犲晢',
- align: "center",
- dataIndex: 'constructorId_dictText',
+ align: 'center',
+ dataIndex: 'constructorId_dictText'
},
{
title: '鍗曚綅',
- align: "center",
- dataIndex: 'mainUnitId_dictText',
+ align: 'center',
+ dataIndex: 'mainUnitId_dictText'
},
- /* {
- title: '杈呭崟浣�',
- align: "center",
- dataIndex: 'auxiliaryUnitId_dictText',
- }, */
+ /* {
+ title: '杈呭崟浣�',
+ align: "center",
+ dataIndex: 'auxiliaryUnitId_dictText',
+ }, */
{
title: '鎬绘暟閲�',
- align: "center",
- dataIndex: 'totalMainQuantity',
+ align: 'center',
+ dataIndex: 'totalMainQuantity'
},
- /* {
- title: '鎬昏緟鏁伴噺',
- align: "center",
- dataIndex: 'totalAuxiliaryQuantity',
- }, */
+ /* {
+ title: '鎬昏緟鏁伴噺',
+ align: "center",
+ dataIndex: 'totalAuxiliaryQuantity',
+ }, */
{
title: '鏈夋晥鏈�',
- align: "center",
- dataIndex: 'validityPeriod',
+ align: 'center',
+ dataIndex: 'validityPeriod'
},
{
title: '鏈夋晥鍗曚綅',
- align: "center",
- dataIndex: 'validityPeriodUnitId_dictText',
+ align: 'center',
+ dataIndex: 'validityPeriodUnitId_dictText'
},
{
title: '搴撳瓨涓婇檺鍊�',
- align: "center",
- dataIndex: 'inventoryUpperLimit',
+ align: 'center',
+ dataIndex: 'inventoryUpperLimit'
},
{
title: '搴撳瓨涓嬮檺鍊�',
- align: "center",
- dataIndex: 'inventoryLowerLimit',
+ align: 'center',
+ dataIndex: 'inventoryLowerLimit'
},
{
title: '缁忔祹璁㈣揣閲�',
- align: "center",
- dataIndex: 'economicOrderQuantity',
+ align: 'center',
+ dataIndex: 'economicOrderQuantity'
},
{
title: '閲囪喘鎻愬墠鏈�',
- align: "center",
- dataIndex: 'purchaseLeadTime',
- },
+ align: 'center',
+ dataIndex: 'purchaseLeadTime'
+ }
],
url: {
- list: "/spare/sparePart/sparePartInventoryList",
- importExcelUrl:'/spare/SparesPartInventory/importExcel'
+ list: '/spare/sparePart/sparePartInventoryList',
+ importUrl: '/spare/SparesPartInventory/importExcel',
+ exportXlsUrl: '/spare/sparePart/exportXls',
},
//鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴��
- alterFlag: "",
- };
+ alterFlag: ''
+ }
},
computed: {
@@ -252,12 +266,17 @@
return {
type: 'radio',
onChange: (selectedRowKeys, selectedRows) => {
- this.selectedRowKeys = selectedRowKeys;
- this.onSelectChange(selectedRowKeys, selectedRows);
+ this.selectedRowKeys = selectedRowKeys
+ this.onSelectChange(selectedRowKeys, selectedRows)
},
- selectedRowKeys: this.selectedRowKeys,
- };
+ selectedRowKeys: this.selectedRowKeys
+ }
},
+ importExcelUrl: function() {
+ console.log(this.mainId)
+ /* return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; */
+ return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`
+ }
},
methods: {
@@ -265,7 +284,7 @@
return {
on: {
click: () => {
- this.onSelectChange(record.id.split(","), [record]);
+ this.onSelectChange(record.id.split(','), [record])
}
}
}
@@ -274,73 +293,76 @@
onSelectChange(selectedRowKeys, selectionRows) {
if (selectedRowKeys.length == 1) {
this.$refs.SparePartInventoryList.sparePartId = selectedRowKeys[0]
+ this.mainId = selectedRowKeys[0]
} else {
this.$refs.SparePartInventoryList.sparePartId = '-1'
}
- this.selectedRowKeys = selectedRowKeys;
- this.selectionRows = selectionRows;
+ this.selectedRowKeys = selectedRowKeys
+ this.selectionRows = selectionRows
},
//绂佺敤鐘舵�佹牱寮�
tableRowClass(record, index) {
- if (record.totalMainQuantity < record.inventoryLowerLimit) {
- return 'error'
- }else if(record.totalMainQuantity > record.inventoryUpperLimit){
- return 'yellow'
- }
+ if (record.totalMainQuantity < record.inventoryLowerLimit) {
+ return 'downLimit'
+ } else if (record.totalMainQuantity > record.inventoryUpperLimit) {
+ return 'upLimit'
+ }
- },
+ },
searchReset() {
- this.queryParam = {};
+ this.queryParam = {}
if (this.nodeSelected.key != -1) {
- this.queryParam.sparePartCategoryId = this.nodeSelected.key;
+ this.queryParam.sparePartCategoryId = this.nodeSelected.key
}
this.selectedRowKeys = []
this.selectionRows = []
this.$refs.SparePartInventoryList.sparePartId = '-1'
- this.loadData(1);
+ this.loadData(1)
},
searchQuery() {
this.selectedRowKeys = []
this.selectionRows = []
this.$refs.SparePartInventoryList.sparePartId = '-1'
- this.loadData(1);
- },
+ this.loadData(1)
+ }
},
watch: {
alterFlag() {
- this.$bus.$emit('queryTreeData');
+ this.$bus.$emit('queryTreeData')
},
nodeSelected() {
- this.queryParam = {};
+ this.queryParam = {}
if (this.nodeSelected.key != -1) {
- this.queryParam.sparePartCategoryId = this.nodeSelected.key;
+ this.queryParam.sparePartCategoryId = this.nodeSelected.key
}
this.selectedRowKeys = []
this.selectionRows = []
this.$refs.SparePartInventoryList.sparePartId = '-1'
- this.loadData(1);
- },
+ this.loadData(1)
+ }
},
created() {
- this.queryParam = {};
- this.queryParam.sparePartCategoryId = this.nodeSelected.key;
+ this.queryParam = {}
+ this.queryParam.sparePartCategoryId = this.nodeSelected.key
this.selectedRowKeys = []
this.selectionRows = []
- this.loadData(1);
+ this.loadData(1)
}
}
</script>
-<style lang="less" >
+<style lang="less">
@import '~@assets/less/common.less';
.frozenRowClass {
color: #c9c9c9;
}
+
.success {
color: green;
}
+
.error {
color: red;
}
@@ -349,11 +371,20 @@
color: yellow;
}
+.downLimit {
+ color: red;
+}
+
+.upLimit {
+ color: blue;
+}
+
+
.fontweight {
font-weight: bold;
}
.ant-table-tbody .red {
- background-color: red !important
- }
+ background-color: red !important
+}
</style>
\ No newline at end of file
--
Gitblit v1.9.3