From 0c0ea64faa904e2e5280994b734abb345be0eecf Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Tue, 24 Sep 2024 17:54:00 +0800 Subject: [PATCH] 20240924 --- src/api/fanucGroup/currency.js | 2 +- src/views/modules/fanuc/currency.vue | 464 ++++++++++++++++--------- src/views/modules/fanuc/fanuc.vue | 9 +- src/views/modules/fanuc/fanucGroup.vue | 2 +- 4 files changed, 306 insertions(+), 171 deletions(-) diff --git a/src/api/fanucGroup/currency.js b/src/api/fanucGroup/currency.js index 76c16db..23fe331 100644 --- a/src/api/fanucGroup/currency.js +++ b/src/api/fanucGroup/currency.js @@ -30,7 +30,7 @@ export const updateExchangeCurrency= data => createAPI(`/currency/exchange/amend export const deleteExchangeCurrency= data => createAPI(`/currency/exchange/delete`,'post',data) - +export const queryUserSite = (data) => createAPI('/site/list','post',data) diff --git a/src/views/modules/fanuc/currency.vue b/src/views/modules/fanuc/currency.vue index ba3d6a7..755deae 100644 --- a/src/views/modules/fanuc/currency.vue +++ b/src/views/modules/fanuc/currency.vue @@ -1,54 +1,44 @@ @@ -312,6 +373,8 @@ import { updateExchangeCurrency,//修改 deleteExchangeCurrency,//删除 + queryUserSite + } from '@/api/fanucGroup/currency.js' export default { @@ -639,7 +702,7 @@ export default { serialNumber: '501004TableActivationDate', tableId: '501004Table', tableName: '启用日期', - columnWidth: 110, + columnWidth: 140, columnProp: 'activationDate', headerAlign: 'center', align: 'left', @@ -687,42 +750,6 @@ export default { status: true, fixed: '', }, - { - userId: this.$store.state.user.name, - functionId: 501004, - serialNumber: '501004TableUpdateDate', - tableId: '501004Table', - tableName: '更改时间', - columnWidth: 110, - columnProp: 'updateDate', - headerAlign: 'center', - align: 'center', - columnLabel: '更改时间', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - }, - { - userId: this.$store.state.user.name, - functionId: 501004, - serialNumber: '501004TableUpdateBy', - tableId: '501004Table', - tableName: '更改人', - columnWidth: 110, - columnProp: 'updateBy', - headerAlign: 'center', - align: 'center', - columnLabel: '更改人', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - }, ], rules: { currency: [ @@ -754,6 +781,18 @@ export default { authUpdate: false, authDelete: false, menuId: this.$route.meta.menuId, + + siteList:[], + currencyVisible:false, + currency:{ + site: '', + currency: '', + currencyDesc: '', + }, + currencyList:[], + no: 1, + size: 20, + total: 0, } }, @@ -776,14 +815,18 @@ export default { }); } + }, + 'modalData1.currency'(newVal,oldVal){ + this.modalData1.currency = newVal.toUpperCase(); } }, created () { + this.handleQuerySite() //页面在加载的时候就调用查询方法 this.getDataList() // 获取用户的 site 和 bu - this.getSiteAndBuByUserName() + // this.getSiteAndBuByUserName() }, methods: { @@ -834,7 +877,7 @@ export default { refreshCurrentTabTable () { findRefCurrency(this.currentRow).then(({data}) => { //区分请求成功和失败的状况 - if (data && data.code == 0) { + if (data && data.code === 0) { this.dataList1 = data.rows } else { this.dataList1 = [] @@ -860,6 +903,7 @@ export default { //货币 // 新增按钮 addModal () { + this.handleQuerySite(); this.modalData = { flag: '1', site: this.$store.state.user.site, @@ -968,6 +1012,10 @@ export default { //货币参考 // 新增按钮 addModal1 () { + if (!this.currentRow){ + this.$message.warning('请选择货币记录!') + return + } this.modalData1 = { flag1: '1', id: '', @@ -1004,9 +1052,7 @@ export default { }).then(() => { deleteRefCurrency(row).then(({data}) => { if (data && data.code === 0) { - this.changeData() this.refreshCurrentTabTable () - this.changeData (row) this.$message({ message: '操作成功', type: 'success', @@ -1073,6 +1119,10 @@ export default { //货币汇率 // 新增按钮 addModal2 () { + if (!this.currentRow2){ + this.$message.warning('请选择参考货币记录!') + return + } this.modalData2 = { flag: '1', id: '', @@ -1156,7 +1206,6 @@ export default { }).then(() => { deleteExchangeCurrency(row).then(({data}) => { if (data && data.code === 0) { - this.changeData2() this.refreshCurrentTabTable2() this.$message({ message: '操作成功', @@ -1325,7 +1374,88 @@ export default { this.authUpdate = !updateFlag this.authDelete = !deleteFlag }, - + handleQuerySite(){ + let params = { + username: this.$store.state.user.name, + } + queryUserSite(params).then(({data})=>{ + if (data && data.code === 0){ + this.siteList = data.row2 + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, + rowStyle({row}){ + if (this.currentRow.site === row.site && this.currentRow.currency === row.currency) { + return { 'background-color': '#E8F7F6', cursor: 'pointer' }; + } + }, + rowStyle2({row}){ + if (this.currentRow2.id === row.id) { + return { 'background-color': '#E8F7F6', cursor: 'pointer' }; + } + }, + handleBlurCurrency(){ + let params = { + site: this.modalData1.site, + currency: this.modalData1.currency, + page: 1, + limit: this.searchData.limit, + } + findCurrency(params).then(({data}) => { + if ( data && data.code === 0) { + if (data.page.list.length === 1){ + this.modalData1.currency = this.dataList[0].currency + this.modalData1.currencyDesc = this.dataList[0].currencyDesc + }else { + this.modalData1.currencyDesc = '' + } + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, + handleClickCurrency(){ + this.currency.site = this.modalData1.site + this.currency.currency = this.modalData1.currency + this.queryCurrency(); + this.currencyVisible = true + }, + queryCurrency(){ + let params = { + ...this.currency, + page: this.no, + limit: this.size, + } + findCurrency(params).then(({data}) => { + if ( data && data.code === 0) { + this.currencyList = data.page.list + this.total = data.page.totalCount + }else { + this.$message.warning(data.msg) + } + }).catch((error)=>{ + this.$message.error(error) + }) + }, + handleSizeChange(val){ + this.size = val + this.queryCurrency() + }, + handleCurrentChange(val){ + this.no = val + this.queryCurrency() + }, + handleDblclick(row){ + this.modalData1.currency = row.currency + this.modalData1.currencyDesc = row.currencyDesc + this.currencyVisible = false + } } } diff --git a/src/views/modules/fanuc/fanuc.vue b/src/views/modules/fanuc/fanuc.vue index ac8f880..ecda596 100644 --- a/src/views/modules/fanuc/fanuc.vue +++ b/src/views/modules/fanuc/fanuc.vue @@ -58,8 +58,13 @@ :min-width="item.columnWidth" :label="item.columnLabel"> diff --git a/src/views/modules/fanuc/fanucGroup.vue b/src/views/modules/fanuc/fanucGroup.vue index fd7d6fd..a0c968c 100644 --- a/src/views/modules/fanuc/fanucGroup.vue +++ b/src/views/modules/fanuc/fanucGroup.vue @@ -114,7 +114,7 @@ - +