zth
sunzehua 3 weeks ago
parent 6150236abc
commit 82a743695c

@ -22,14 +22,14 @@
<Checkbox v-model:checked="checkIndex" @change="handleIndexCheckChange">
{{ t('component.table.settingIndexColumnShow') }}
</Checkbox>
<Checkbox
<!-- 暂时隐藏 默认所有的表格都带着勾选列 -->
<!-- <Checkbox
v-model:checked="checkSelect"
:disabled="!defaultRowSelection"
@change="handleSelectCheckChange"
>
{{ t('component.table.settingSelectColumnShow') }}
</Checkbox>
</Checkbox> -->
<a-button size="small" type="link" @click="reset">
{{ t('common.resetText') }}
@ -299,7 +299,10 @@
columns = [...columns, ...columns2]
}
table.setProps({
rowSelection: JSON.parse(res.data.content).rowSelection ? defaultRowSelection : undefined,
rowSelection: {
type:'checkbox',
fixed: true,
},
})
table.setProps({
showIndexColumn: JSON.parse(res.data.content).showIndexColumn,

@ -51,6 +51,7 @@
const table = useTableContext()
const getSetting = computed((): TableSetting => {
console.log(props.setting,123313)
return {
redo: true,
size: true,

@ -3,8 +3,8 @@
<a-modal width="1600px" @cancel="open = false" :visible="open" title="添加发票申请明细" :footer="null">
<div style="padding-bottom:5px ;">
<div>
<BasicTable class="ds-table" :row-selection="{ onChange: onSelectChange }"
:rowClassName="rowClassName" @row-click="handleClick" @register="registerTable" @row-dbClick="(e) => {
<BasicTable class="ds-table" @selection-change="onSelectChange" :rowClassName="rowClassName"
@row-click="handleClick" @register="registerTable" @row-dbClick="(e) => {
GoDetailed(true, e)
}
">
@ -41,13 +41,6 @@
<div>
<div class="bold">申请开票明细</div>
<div style="display: flex;">
<div class="apply" :class="{ active: form.isRMB }">
<a-checkbox @change="handleChangeApply1"
:disabled="route.query.id ? true : false"
v-model:checked="form.isRMB">折算人民币申请</a-checkbox>
<span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span>
</div>
<div class="apply" :class="{ active: form.isYB }">
<a-checkbox :disabled="route.query.id ? true : false"
v-model:checked="form.isYB" @change="handleChangeApply">
@ -58,6 +51,13 @@
item.currency }}</span>
</a-checkbox>
</div>
<div class="apply" :class="{ active: form.isRMB }">
<a-checkbox @change="handleChangeApply1"
:disabled="route.query.id ? true : false"
v-model:checked="form.isRMB">折算人民币申请</a-checkbox>
<span class="rmb" v-if="totalRmb != 0">{{ totalRmb }} RMB</span>
<span></span>
</div>
</div>
<div>
<span class="bold">发票申请明细</span>
@ -103,18 +103,16 @@
<span class="bold" style="margin-right: 10px;width:66px;display: inline-block">1{{ item.currencyTo
}}
=</span>
<a-input-number addon-after="RMB" :precision="4" size="small" :controls="false"
<a-input-number @change="changeRmb(1,index)" addon-after="RMB" :precision="4" size="small" :controls="false"
v-model:value="item.reverseRate" />
</div>
<div>
<span class="bold" style="margin-right: 10px;width:66px;display: inline-block">1RMB =</span>
<a-input-number :addon-after="item.currencyTo" :precision="4" size="small" :controls="false"
<a-input-number @change="changeRmb(2,index)" :addon-after="item.currencyTo" :precision="4" size="small" :controls="false"
v-model:value="item.rate" />
</div>
</div>
</a-modal>
</div>
</template>
@ -231,6 +229,9 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
labelWidth: 120,
schemas: detailSearchFormSchema,
},
rowSelection: {//
type: 'checkbox',
},
useSearchForm: true,
showIndexColumn: false,
maxHeight: 450,
@ -267,14 +268,22 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
const exchangeFlag = ref(false)
const loading = ref(false)
const form = ref({
isYB: false,
isRMB: true
isYB: true,
isRMB: false
}) as any
function handleChangeApply(e) {
form.value.isRMB = !e.target.checked
totalRmb.value = 0
onSelectAmount()
}
function changeRmb(type,index){
if(type==1){
exchangeData.value[index].rate = (1/exchangeData.value[index].reverseRate).toFixed(4)
}
if(type==2){
exchangeData.value[index].reverseRate = (1/exchangeData.value[index].rate).toFixed(4)
}
}
const exchangeData = ref({}) as any
//
function handleChangeApply1(e) {
@ -393,9 +402,11 @@ function handleSureExhange() {
}
const activeRow = ref(null)
//
function handleClick(record, index) {
setSelectedRowKeys([index])
activeRow.value = index
function handleClick(record, index,type) {
if(type!='select'){
setSelectedRowKeys([index])
activeRow.value = index
}
const queryDataStr = JSON.parse(queryData.value.queryCondition)
const arr = [] as any
queryDataStr.forEach(item => {
@ -443,7 +454,11 @@ function rowClassName(record, index) {
function init(data) {
open.value = true
setTimeout(() => {
setProps({
rowSelection: {
onChange: onSelectAmount
},
})
setPropsFee({
rowSelection: {
onChange: onSelectAmount
@ -462,33 +477,21 @@ function init(data) {
form.value.isYB = true
form.value.isRMB = false
}
watch(
() => getSelectRows(),
(data) => {
console.log(data)
onSelectChange(data)
},
{ immediate: false, deep: true }
)
}, 500)
}
const rmbTotal = ref(0)
const usdTotal = ref(0)
const otherTotal = ref(0)
function onSelectChange(selectedRowKeys) {
const list = getRawDataSource()
function onSelectChange({ keys, rows }) {
rmbTotal.value = 0
usdTotal.value = 0
otherTotal.value = 0
list.forEach(item => {
selectedRowKeys.forEach(ite => {
if (item.id == ite.id) {
rmbTotal.value += Number(item.unBilledRMB)
usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther)
}
})
rows.forEach(item => {
rmbTotal.value += Number(item.unBilledRMB)
usdTotal.value += Number(item.unBilledUSD)
otherTotal.value += Number(item.unBilledOther)
})
handleClick(rows[rows.length-1],rows.length,'select')
}
const emits = defineEmits(['updateList', 'addLeft'])
//

@ -269,13 +269,13 @@ const columns = [
type: 'numeric',
format: '0.00',
},
{
title: '不含税单价',
width: 150,
data: 'unitPrice',
type: 'numeric',
readOnly: true,
},
// {
// title: '',
// width: 150,
// data: 'unitPrice',
// type: 'numeric',
// readOnly: true,
// },
{
title: '金额',
width: 150,

@ -431,7 +431,7 @@ const EditBankForm = [
]
const markFormS = [
{
field: 'invoiceRemark',
field: 'note',
label: '开票要求',
component: 'InputTextArea',
colProps: { span: 12 },
@ -442,7 +442,7 @@ const markFormS = [
},
},
{
field: 'note',
field: 'invoiceRemark',
label: '',
component: 'InputTextArea',
colProps: { span: 12 },
@ -831,6 +831,9 @@ function openTemp() {
tempList.value.forEach((item) => {
item.value = item.name
})
tempName.value = res.data[0].name
tempId.value = res.data[0].id
tempContent.value = res.data[0].content
})
}
function handleApply() {
@ -1140,24 +1143,30 @@ function addLeftSave(arr, query, exchang, type) {
}
const tempNameId = ref('')
function handleRender() {
let temp = ''
let temp = null
tempList.value.forEach((item) => {
if (item.id == tempNameId.value) {
temp = item.content
}
})
const data = {
id: id.value,
template: temp,
}
RenderTemplate(data).then((res) => {
if (res.succeeded) {
marksetFieldsValue({
note: res.data
})
nameFlag.value = false
if (temp != null && temp != '') {
const data = {
id: id.value,
template: temp ? temp : null,
}
})
RenderTemplate(data).then((res) => {
if (res.succeeded) {
marksetFieldsValue({
invoiceRemark: res.data
})
nameFlag.value = false
}
})
} else {
createMessage.warning('模板暂未内容')
return false
}
}
function mergeByCurrency(arr) {
const result = {};

@ -29,10 +29,25 @@
<div>
<div>
<span class="bold">发票申请</span>
<a-button v-repeat type="link" @click="addDetailed()">
<!-- <a-button v-repeat type="link" @click="addDetailed()">
<span class="iconfont icon-jia"></span>
添加申请明细
</a-button>
</a-button> -->
<a-dropdown>
<template #overlay>
<a-menu>
<a-menu-item @click="addDetailed('all')"></a-menu-item>
<a-menu-item @click="addDetailed('rmb')">RMB</a-menu-item>
<a-menu-item @click="addDetailed('usd')">USD</a-menu-item>
</a-menu>
</template>
<a-button class="ml15" type="link">
<span class="iconfont icon-zengjiatianjiajiajian"
:style="{ fontSize: '12px' }"></span>
添加申请明细
<span class="iconfont icon-30jiantouxiangxiafill"></span>
</a-button>
</a-dropdown>
</div>
</div>
@ -43,16 +58,16 @@
<span v-if="record.businessType == 1"></span>
</template>
<template v-if="column.dataIndex == 'amountRMB'">
<a-input-number :disabled="record.amountRMB == null" :precision="2" size="small"
<a-input-number :disabled="record.amountRMBTotal == null" :precision="2" size="small"
:controls="false" :max="record.amountRMBTotal" v-model:value="record.amountRMB" />
</template>
<template v-if="column.dataIndex == 'amountOther'">
<a-input-number :disabled="record.amountOther == null" :precision="2" size="small"
<a-input-number :disabled="record.amountOtherTotal == null" :precision="2" size="small"
:controls="false" :max="record.amountOtherTotal"
v-model:value="record.amountOther" />
</template>
<template v-if="column.dataIndex == 'amountUSD'">
<a-input-number :disabled="record.amountUSD == null" :precision="2" size="small"
<a-input-number :disabled="record.amountUSDTotal == null" :precision="2" size="small"
:controls="false" :max="record.amountUSDTotal" v-model:value="record.amountUSD" />
</template>
</template>
@ -551,7 +566,7 @@ function handleSureExhange() {
})
freeFlag.value = false
exchangeFlag.value = false
emits('updateListFreeLeft', currenciesData.value,arrQuery)
emits('updateListFreeLeft', currenciesData.value, arrQuery)
}
if (freeType.value == 'right') {
let arr = [] as any
@ -697,7 +712,7 @@ function mergeByCurrency(arr) {
const applications = ref([]) as any
const exchangarr = ref([]) as any
//
function addDetailed() {
function addDetailed(type) {
const arrRight = getSelectRows() ? getSelectRows() : []
const arr0 = []
arrRight.forEach(item => {
@ -729,16 +744,39 @@ function addDetailed() {
}
if (item.currency) {
const arr = item.currency.split(' ')
arr.forEach(ite => {
applications.value.push({
amountOther: item.amountOther,
amountRMB: item.amountRMB,
amountUSD: item.amountUSD,
applicationId: item.id,
currency: ite,
exchangeRate: 0
if (type == 'all') {
arr.forEach(ite => {
applications.value.push({
amountOther: item.amountOther,
amountRMB: item.amountRMB,
amountUSD: item.amountUSD,
applicationId: item.id,
currency: ite,
exchangeRate: 0
})
})
})
}
if (type == 'rmb') {
arr.forEach(ite => {
applications.value.push({
amountRMB: item.amountRMB,
applicationId: item.id,
currency: ite,
exchangeRate: 0
})
})
}
if (type == 'usd') {
arr.forEach(ite => {
applications.value.push({
amountUSD: item.amountUSD,
applicationId: item.id,
currency: ite,
exchangeRate: 0
})
})
}
}
})
const currencySet = new Set();

@ -1223,13 +1223,13 @@ const columns = [
type: 'numeric',
format: '0.00',
},
{
title: '不含税单价',
width: 100,
data: 'unitPrice',
type: 'numeric',
readOnly: true,
},
// {
// title: '',
// width: 100,
// data: 'unitPrice',
// type: 'numeric',
// readOnly: true,
// },
{
title: '金额',
width: 80,

Loading…
Cancel
Save