|
|
|
@ -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'])
|
|
|
|
|
// 添加费用明细
|
|
|
|
|