From a0010bcabbfbc3771aa05d54094f5d02bcdd5609 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 15 十二月 2025 08:42:50 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI
---
src/views/gyMaterial/GyMaterialCorrection.vue | 130 +++++++++++++++++++++---------------------
1 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/src/views/gyMaterial/GyMaterialCorrection.vue b/src/views/gyMaterial/GyMaterialCorrection.vue
index 2b20ba1..54b777f 100644
--- a/src/views/gyMaterial/GyMaterialCorrection.vue
+++ b/src/views/gyMaterial/GyMaterialCorrection.vue
@@ -15,15 +15,15 @@
<el-card class="search-card">
<div slot="header" class="clearfix">
<span>鏌ヨ鏉′欢</span>
- <el-button
- style="float: right; padding: 3px 0"
+ <el-button
+ style="float: right; padding: 3px 0"
type="text"
@click="toggleSearchMore"
>
{{ searchMore ? '鏀惰捣' : '鏇村' }}
</el-button>
</div>
-
+
<el-form :model="queryParams" ref="queryForm" label-width="80px">
<el-row :gutter="20">
<el-col :span="6">
@@ -126,7 +126,7 @@
</el-col>
</el-row>
</div>
-
+
<el-button
type="primary"
icon="el-icon-plus"
@@ -175,7 +175,7 @@
</el-button>
</div>
</div>
-
+
<div class="table-container">
<el-table
ref="mainTable"
@@ -204,7 +204,7 @@
</template>
</el-table-column>
</el-table>
-
+
<!-- 鍒嗛〉 -->
<div class="pagination-container">
<el-pagination
@@ -245,7 +245,7 @@
</el-button>
</div>
</div>
-
+
<div class="table-container">
<el-table
ref="tempTable"
@@ -270,7 +270,7 @@
size="mini"
@change="handleCellEdit(row, column.field, $index)"
/>
-
+
<!-- 涓嬫媺閫夋嫨妗� - 鐗╂枡灞炴�� -->
<el-select
v-else-if="column.field === '鐗╂枡灞炴��'"
@@ -283,7 +283,7 @@
<el-option value="鑷埗" label="鑷埗"></el-option>
<el-option value="濮斿" label="濮斿"></el-option>
</el-select>
-
+
<!-- 涓嬫媺閫夋嫨妗� - 浜嬩笟閮� -->
<el-select
v-else-if="column.field === '浜嬩笟閮�'"
@@ -296,7 +296,7 @@
<el-option value="杞浜嬩笟閮�" label="杞浜嬩笟閮�"></el-option>
<el-option value="鍏朵粬浜嬩笟閮�" label="鍏朵粬浜嬩笟閮�"></el-option>
</el-select>
-
+
<!-- 涓嶅彲缂栬緫瀛楁 -->
<span v-else>{{ row[column.field] }}</span>
</template>
@@ -347,34 +347,34 @@
loading: false,
tempLoading: false,
columnSettingVisible: false,
-
+
// 鏌ヨ鍙傛暟
queryParams: {
HNumber: '',
HName: '',
HOrgID: ''
},
-
+
// 杩囨护鏉′欢
filterConditions: [
{ colName: '0', comparator: '0', colContent: '' }
],
-
+
// 缁勭粐閫夐」
organizationOptions: [],
-
+
// 琛ㄦ牸鏁版嵁
tableData: [],
tempTableData: [],
selectedRows: [],
-
+
// 鍒嗛〉
pagination: {
page: 1,
size: 50,
total: 0
},
-
+
// 鍒楅厤缃�
allColumns: [],
mainTableColumns: [],
@@ -384,8 +384,8 @@
openColumnSetting: false,
// 妯″潡鍚嶇О
HModName: 'Gy_Material_Correction',
-
- baseURL: process.env.VUE_APP_BASE_URL || 'http://47.96.97.237/API/',
+
+ baseURL: process.env.VUE_APP_BASE_API || 'http://47.96.97.237/API/',
user: 'admin'
}
},
@@ -414,7 +414,7 @@
await this.getOrganizations()
await this.getTableData()
},
-
+
// 鑾峰彇缁勭粐鍒楄〃
async getOrganizations() {
try {
@@ -429,9 +429,9 @@
this.$modal.msgError('鑾峰彇缁勭粐鍒楄〃澶辫触!')
}
},
-
-
-
+
+
+
// 璁剧疆榛樿鍒�
setDefaultColumns() {
this.allColumns = [
@@ -459,20 +459,20 @@
{ field: '鍒涘缓浜�', title: '鍒涘缓浜�', width: 100 },
{ field: '鍒涘缓鏃堕棿', title: '鍒涘缓鏃堕棿', width: 150 }
]
-
+
this.mainTableColumns = this.allColumns.filter(col => !col.hide)
this.tempTableColumns = this.mainTableColumns.map(col => ({
...col,
editable: this.isEditableColumn(col.field)
}))
},
-
+
// 鑾峰彇琛ㄦ牸鏁版嵁
async getTableData() {
this.loading = true
try {
const sWhere = this.buildWhereCondition()
-
+
const response = await axios.get(`${this.baseURL}/Gy_Material/page`, {
params: {
sWhere: sWhere,
@@ -482,7 +482,7 @@
Organization: ''
}
})
-
+
if (response.data.code === 1) {
this.tableData = response.data.data
this.pagination.total = response.data.count
@@ -495,11 +495,11 @@
this.loading = false
}
},
-
+
// 鏋勫缓鏌ヨ鏉′欢
buildWhereCondition() {
let sWhere = ''
-
+
// 鍩烘湰鏌ヨ鏉′欢
if (this.queryParams.HNumber) {
sWhere += ` and 鐗╂枡浠g爜 like '%${this.queryParams.HNumber}%'`
@@ -510,7 +510,7 @@
if (this.queryParams.HOrgID) {
sWhere += ` and HUSEORGID = '${this.queryParams.HOrgID}'`
}
-
+
// 杩囨护鏉′欢
this.filterConditions.forEach(filter => {
if (filter.colName && filter.colName !== '0' && filter.comparator && filter.comparator !== '0') {
@@ -534,16 +534,16 @@
sWhere += ` and ${filter.colName} ${condition}`
}
})
-
+
return sWhere
},
-
+
// 鏌ヨ
handleSearch() {
this.pagination.page = 1
this.getTableData()
},
-
+
handleColumnSetting() {
this.columnSettingShow = true;
this.openColumnSetting = true;
@@ -568,7 +568,7 @@
this.pagination.page = 1
this.getTableData()
},
-
+
// 娣诲姞杩囨护鏉′欢
addFilter() {
this.filterConditions.push({
@@ -577,50 +577,50 @@
colContent: ''
})
},
-
+
// 鍒犻櫎杩囨护鏉′欢
removeFilter(index) {
this.filterConditions.splice(index, 1)
},
-
+
// 鍒囨崲鏇村鎼滅储鏉′欢
toggleSearchMore() {
this.searchMore = !this.searchMore
},
-
+
// 閫夋嫨琛屽彉鍖�
handleSelectionChange(selection) {
this.selectedRows = selection
},
-
+
// 鏁版嵁纭 - 灏嗛�変腑鐨勬暟鎹鍒跺埌涓存椂琛ㄦ牸
handleDataConfirm() {
if (this.selectedRows.length === 0) {
this.$modal.msgWarning('璇峰厛閫夋嫨瑕佹壒鏀圭殑鏁版嵁!')
return
}
-
+
// 娣辨嫹璐濋�変腑鐨勬暟鎹埌涓存椂琛ㄦ牸
this.tempTableData = JSON.parse(JSON.stringify(this.selectedRows))
-
+
// 閿佸畾涓昏〃鏍间腑宸查�変腑鐨勮锛堥�氳繃CSS绫诲悕锛�
this.$nextTick(() => {
this.$refs.mainTable.clearSelection()
})
-
+
this.$modal.msgSuccess(`宸茬‘璁� ${this.selectedRows.length} 鏉℃暟鎹紝璇峰湪鍙充晶琛ㄦ牸涓繘琛屾壒鏀筦)
},
-
+
// 淇濆瓨鎵规敼鏁版嵁
async handleSave() {
if (this.tempTableData.length === 0) {
this.$modal.msgWarning('娌℃湁闇�瑕佷繚瀛樼殑鏁版嵁!')
return
}
-
+
try {
this.tempLoading = true
-
+
// 杞崲鏁版嵁鏍煎紡
const saveData = this.tempTableData.map(item => ({
HOnceRightRate: item['涓�娆″悎鏍肩巼鏍囧噯鍊�'],
@@ -643,7 +643,7 @@
// 鍏朵粬闇�瑕佷繚瀛樼殑瀛楁...
HItemID: item.HItemID
}))
-
+
// 鏁版嵁楠岃瘉
for (const item of saveData) {
if (!item.HNumber) {
@@ -654,12 +654,12 @@
}
// 鍏朵粬楠岃瘉瑙勫垯...
}
-
+
const dataStr = JSON.stringify(saveData)
const response = await axios.post(`${this.baseURL}/Gy_Material/SaveGy_MaterialList_Batch`, {
msg: dataStr + ';' + this.user + ';' + this.queryParams.HOrgID
})
-
+
if (response.data.count === 1) {
this.$modal.msgSuccess('淇濆瓨鎴愬姛!')
this.tempTableData = []
@@ -673,14 +673,14 @@
this.tempLoading = false
}
},
-
+
// 鍒犻櫎鏁版嵁
async handleDelete() {
if (this.selectedRows.length === 0) {
this.$modal.msgWarning('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁!')
return
}
-
+
try {
await this.$confirm('纭瑕佸垹闄ら�変腑鐨勬暟鎹悧锛�', '鎻愮ず', {
type: 'warning'
@@ -693,7 +693,7 @@
}
})
}
-
+
this.$modal.msgSuccess('鍒犻櫎鎴愬姛!')
this.getTableData()
this.selectedRows = []
@@ -703,13 +703,13 @@
}
}
},
-
+
// 鍗曞厓鏍肩紪杈�
handleCellEdit(row, field, index) {
// 鍙互鍦ㄨ繖閲屾坊鍔犵紪杈戦獙璇侀�昏緫
console.log(`缂栬緫绗�${index + 1}琛岋紝瀛楁: ${field}, 鍊�: ${row[field]}`)
},
-
+
// 涓嬫媺閫夋嫨鍙樺寲
handleSelectChange(field) {
// 鎵归噺鏇存柊鐩稿悓瀛楁鐨勫��
@@ -717,12 +717,12 @@
// 杩欓噷鍙互鏍规嵁涓氬姟闇�姹傚喅瀹氭槸鍚﹀悓姝ユ洿鏂版墍鏈夎鐨勭浉鍚屽瓧娈�
})
},
-
+
// 鍒楄缃�
handleColumnSetting() {
this.columnSettingVisible = true
},
-
+
// 淇濆瓨鍒楄缃�
handleColumnSave(columns) {
this.allColumns = columns
@@ -735,7 +735,7 @@
},
-
+
// 閫�鍑�
handleExit() {
if (this.tempTableData.length > 0) {
@@ -748,26 +748,26 @@
this.handleClose()
}
},
-
+
// 鍏抽棴瀵硅瘽妗�
handleClose() {
this.openCorrect = false
this.$emit('close')
},
-
+
// 鍒嗛〉澶у皬鍙樺寲
handleSizeChange(size) {
this.pagination.size = size
this.pagination.page = 1
this.getTableData()
},
-
+
// 褰撳墠椤靛彉鍖�
handleCurrentChange(page) {
this.pagination.page = page
this.getTableData()
},
-
+
// 宸ュ叿鏂规硶
isEditableColumn(field) {
const nonEditableFields = [
@@ -775,25 +775,25 @@
]
return !nonEditableFields.includes(field)
},
-
+
isSelectColumn(field) {
return ['鐗╂枡灞炴��', '浜嬩笟閮�'].includes(field)
},
-
+
isDateColumn(field) {
return field.includes('鏃堕棿') || field.includes('鏃ユ湡')
},
-
+
formatDate(dateString) {
if (!dateString) return ''
const date = new Date(dateString)
return date.toLocaleString('zh-CN')
},
-
+
getRowClassName({ row }) {
return this.selectedRows.some(selected => selected.HItemID === row.HItemID) ? 'locked-row' : ''
},
-
+
divisionJudgment(divisionStr) {
switch (divisionStr) {
case '娉ㄥ浜嬩笟閮�': return 3
@@ -801,7 +801,7 @@
default: return 0
}
},
-
+
materClsJudgment(materClsStr) {
switch (materClsStr) {
case '澶栬喘': return '1'
@@ -910,4 +910,4 @@
::v-deep .temp-table .el-select {
width: 100%;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.1