Compare commits

...

3 Commits

@ -156,7 +156,7 @@ import {
getInvoicePage02, getInvoicePage02,
getInvoicePage03, getInvoicePage03,
getInvoicePage04, getInvoicePage04,
getInvoicePage05, getInvoicePage05
} from '@/api/bs/invoice' } from '@/api/bs/invoice'
export default { export default {
props: { props: {
@ -167,11 +167,11 @@ export default {
tripPartners: Array, // tripPartners: Array, //
list: Array, // list: Array, //
type: [Number, String], type: [Number, String],
disabled: Boolean, disabled: Boolean
}, },
components: { components: {
RePick: () => import('@/components/ReComponents/RePick'), RePick: () => import('@/components/ReComponents/RePick'),
RMList: () => import('@/components/ReComponents/RMList'), RMList: () => import('@/components/ReComponents/RMList')
}, },
// //
computed: { computed: {
@ -190,10 +190,11 @@ export default {
}, },
userList() { userList() {
return this.$store.getters.userList return this.$store.getters.userList
}, }
}, },
data() { data() {
return { return {
amount: null,
tableList: [], tableList: [],
demo: false, demo: false,
isShow: false, isShow: false,
@ -205,8 +206,8 @@ export default {
listQuery: { listQuery: {
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
temClaimNo: 0, temClaimNo: 0
}, }
} }
}, },
created() { created() {
@ -227,7 +228,7 @@ export default {
} }
}, },
deep: true, deep: true,
immediate: true, immediate: true
}, },
// list: { // list: {
// handler(val) { // handler(val) {
@ -250,8 +251,8 @@ export default {
this.getList('init') this.getList('init')
}, },
deep: true, deep: true,
immediate: true, immediate: true
}, }
}, },
methods: { methods: {
handleSetCheck(index, item, type) { handleSetCheck(index, item, type) {
@ -272,6 +273,13 @@ export default {
!this.tableList[index].checked !this.tableList[index].checked
) )
} }
//
this.amount = this.tableList
.filter((e) => e.checked)
.reduce((prev, next) => {
return prev + Number(next.amountInFiguers)
}, 0)
.toFixed(2)
console.log(this.tableList[index].checked) console.log(this.tableList[index].checked)
if (this.tableList[index].checked) { if (this.tableList[index].checked) {
if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) { if (!_this.invoiceIdsCopy.hasOwnProperty(_this.invoiceType)) {
@ -286,6 +294,7 @@ export default {
_this.tableList[index].id _this.tableList[index].id
) )
} }
// _this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id) // _this.invoiceIdsCopy[_this.invoiceType].push(this.tableList[index].id)
} else { } else {
_this.invoiceIdsCopy[_this.invoiceType].forEach(function ( _this.invoiceIdsCopy[_this.invoiceType].forEach(function (
@ -311,7 +320,10 @@ export default {
handleConfirm() { handleConfirm() {
// let arr = (this.tableList.filter(item => item.checked)).map(item => item.id) || [] // let arr = (this.tableList.filter(item => item.checked)).map(item => item.id) || []
this.$emit('onConfirm', this.invoiceIdsCopy) this.$emit('onConfirm', {
invoiceIdsCopy: this.invoiceIdsCopy,
amount: this.amount
})
console.log(this.invoiceIdsCopy, 'this.invoiceIdsCopy') console.log(this.invoiceIdsCopy, 'this.invoiceIdsCopy')
}, },
@ -385,8 +397,8 @@ export default {
this.$loading(false, 'tableLoading') this.$loading(false, 'tableLoading')
}) })
}) })
}, }
}, }
} }
</script> </script>
@ -473,4 +485,4 @@ export default {
border-radius: 100%; border-radius: 100%;
margin: 0 0.5rem; margin: 0 0.5rem;
} }
</style> </style>

@ -311,7 +311,6 @@
label="出差类型" label="出差类型"
:name="`tripType_${index}`" :name="`tripType_${index}`"
:list="tripTypeList" :list="tripTypeList"
isRequrie
isCell isCell
clearable clearable
/> />
@ -371,30 +370,31 @@
:key="nIndex" :key="nIndex"
> >
<div class="box-tp" style="margin-bottom: 1rem"> <div class="box-tp" style="margin-bottom: 1rem">
<div <div class="tp-lf">
class="tp-lf"
>
费用 &nbsp;{{ nIndex + 1 }} 费用 &nbsp;{{ nIndex + 1 }}
<span class="rules" style="color: #1989fa" @click.stop="showRules(nitem, index, nIndex)" > <span
class="rules"
style="color: #1989fa"
@click.stop="showRules(nitem, index, nIndex)"
>
<van-icon <van-icon
size="18" size="18"
name="coupon-o" name="coupon-o"
color="#1989fa" color="#1989fa"
/> />
</span>
</span <span
style="color: #1989fa; padding: 5px"
@click="addInvoice"
> >
<span style="color: #1989fa; padding:5px" @click="addInvoice">
<van-icon <van-icon
size="18" size="18"
name="plus" name="plus"
color="#1989fa" color="#1989fa"
/> />
</span> </span>
</div> </div>
<div <div
class="tp-rt" class="tp-rt"
v-if="!(item.expenseClaimDetails.length == 1)" v-if="!(item.expenseClaimDetails.length == 1)"
@ -427,8 +427,8 @@
required: true, required: true,
trigger: 'onBlur', trigger: 'onBlur',
message: '格式错误', message: '格式错误',
validator: VerifyFunc.validatorMoney, validator: VerifyFunc.validatorMoney
}, }
]" ]"
type="number" type="number"
label="金额" label="金额"
@ -482,25 +482,6 @@
" "
/> />
</div> </div>
<!-- <div @click="handleShowIe('1', index, nIndex)">
<van-field
disabled
:class="
nitem.invoiceName
? 'actived-disabled tag-blue'
: 'tag-blue'
"
v-model="nitem.invoiceName"
name="reason"
autosize
rows="2"
label="关联发票"
clear-trigger="always"
input-align="right"
placeholder="请关联"
/>
</div> -->
<!--关联发票 -->
<!--关联发票 --> <!--关联发票 -->
<ConnectInvoice <ConnectInvoice
:disabled="disabled" :disabled="disabled"
@ -510,8 +491,8 @@
@onCancel="nitem.show = false" @onCancel="nitem.show = false"
:isOpen="nitem.show" :isOpen="nitem.show"
@onConfirm=" @onConfirm="
(arr) => { ({ invoiceIdsCopy, amount }) => {
handleConfirmIe(arr, index, nIndex) handleConfirmIe(invoiceIdsCopy, index, nIndex, amount)
} }
" "
/> />
@ -539,8 +520,8 @@
{ {
required: true, required: true,
message: '请输入', message: '请输入',
validator: VerifyFunc.validatorMoney, validator: VerifyFunc.validatorMoney
}, }
]" ]"
v-model="item.amount" v-model="item.amount"
type="number" type="number"
@ -631,8 +612,8 @@
required: true, required: true,
trigger: 'onBlur', trigger: 'onBlur',
message: '格式错误', message: '格式错误',
validator: VerifyFunc.validatorMoney, validator: VerifyFunc.validatorMoney
}, }
]" ]"
type="number" type="number"
label="金额" label="金额"
@ -727,8 +708,8 @@
@onCancel="nitem.show = false" @onCancel="nitem.show = false"
:isOpen="nitem.show" :isOpen="nitem.show"
@onConfirm=" @onConfirm="
(arr) => { ({ invoiceIdsCopy, amount }) => {
handleConfirmIe1(arr, nIndex) handleConfirmIe1(invoiceIdsCopy, nIndex, amount)
} }
" "
/> />
@ -836,7 +817,7 @@ import {
createExpenseClaim, createExpenseClaim,
findClaimRules, findClaimRules,
getExpenseClaim, getExpenseClaim,
getMyExpenseClaim, getMyExpenseClaim
} from '@/api/bs/expenseClaim' } from '@/api/bs/expenseClaim'
import { getInvoicePage } from '@/api/bs/invoice' import { getInvoicePage } from '@/api/bs/invoice'
import { listData } from '@/api/system/dict/data' import { listData } from '@/api/system/dict/data'
@ -857,7 +838,7 @@ export default {
FollowPeoPle: () => import('@/components/FollowPeoPle'), FollowPeoPle: () => import('@/components/FollowPeoPle'),
ConnectInvoice: () => import('@/components/ConnectInvoice'), ConnectInvoice: () => import('@/components/ConnectInvoice'),
UploadFile: () => import('@/components/UploadFile'), UploadFile: () => import('@/components/UploadFile'),
Rules: () => import('./components/Rules'), Rules: () => import('./components/Rules')
}, },
// 访this // 访this
created() { created() {
@ -888,7 +869,7 @@ export default {
{ title: '暂存', icon: 'star-o', color: '#909399', key: 0 }, { title: '暂存', icon: 'star-o', color: '#909399', key: 0 },
{ title: '提交', icon: 'edit', color: '#ff9900', key: 1 }, { title: '提交', icon: 'edit', color: '#ff9900', key: 1 },
{ title: '同意', icon: 'certificate', color: '#19be6b', key: 2 }, { title: '同意', icon: 'certificate', color: '#19be6b', key: 2 },
{ title: '驳回', icon: 'exchange', color: '#fa3534', key: 3 }, { title: '驳回', icon: 'exchange', color: '#fa3534', key: 3 }
], ],
tripTypeList: [], // tripTypeList: [], //
feeTypeList: [], // feeTypeList: [], //
@ -937,10 +918,10 @@ export default {
feeType: null, feeType: null,
amount: undefined, amount: undefined,
invoiceCount: undefined, invoiceCount: undefined,
remark: null, remark: null
}, }
], ]
}, }
], ],
// //
expenseClaimDetails: [ expenseClaimDetails: [
@ -952,11 +933,11 @@ export default {
feeType: null, feeType: null,
amount: undefined, amount: undefined,
invoiceCount: undefined, invoiceCount: undefined,
remark: null, remark: null
}, }
], ]
}, },
times: null, times: null
} }
}, },
// //
@ -994,7 +975,7 @@ export default {
}, },
RCBX() { RCBX() {
return ['RCBX'].includes(this.$route.query.billType) return ['RCBX'].includes(this.$route.query.billType)
}, }
}, },
// data // data
watch: {}, watch: {},
@ -1005,10 +986,10 @@ export default {
this.$router.push({ this.$router.push({
path: '/myInvoice', path: '/myInvoice',
query: { query: {
isAdd:'isAdd' isAdd: 'isAdd'
} }
}) })
}, },
getTree() { getTree() {
getAreaTree().then((res) => { getAreaTree().then((res) => {
let tree = res.data || [] let tree = res.data || []
@ -1050,7 +1031,7 @@ export default {
? destinationLocation[destinationLocation.length - 1] ? destinationLocation[destinationLocation.length - 1]
: destinationLocation, : destinationLocation,
feeType, feeType,
costDeptId: this.form.costDeptId, costDeptId: this.form.costDeptId
}).then((res) => { }).then((res) => {
this.dialogObj = { this.dialogObj = {
dept: getTreeIds(this.userDeptTree, this.form.costDeptId).join('-'), dept: getTreeIds(this.userDeptTree, this.form.costDeptId).join('-'),
@ -1062,7 +1043,7 @@ export default {
).join('-'), ).join('-'),
feetypeName: this.feeTypeList.find((item) => item.value == feeType) feetypeName: this.feeTypeList.find((item) => item.value == feeType)
.label, .label,
maxMoney: res.data === 0 || res.data ? res.data : '未设置', maxMoney: res.data === 0 || res.data ? res.data : '未设置'
} }
this.isShow = true this.isShow = true
}) })
@ -1112,7 +1093,7 @@ export default {
files: this.fileList, files: this.fileList,
billType: this.$route.query.billType, billType: this.$route.query.billType,
ignoreFeeTip, ignoreFeeTip,
status: key, status: key
} }
if (this.$route.query.billType === 'RCBX') { if (this.$route.query.billType === 'RCBX') {
delete newForm.expenseClaimTrips delete newForm.expenseClaimTrips
@ -1146,7 +1127,7 @@ export default {
if (!response.data) { if (!response.data) {
Dialog.confirm({ Dialog.confirm({
title: '提示', title: '提示',
message: `${response.msg} 您确认要提交吗?`, message: `${response.msg} 您确认要提交吗?`
}).then(() => { }).then(() => {
this.handleBtConfirm(key, 1) this.handleBtConfirm(key, 1)
}) })
@ -1294,13 +1275,18 @@ export default {
// //
// }) // })
}, },
handleConfirmIe(arr, index, nIndex) { handleConfirmIe(arr, index, nIndex, amount) {
// let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('') // let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('')
this.$set( this.$set(
this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex],
'invoiceIds', 'invoiceIds',
arr arr
) )
this.$set(
this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex],
'amount',
amount
)
this.$set( this.$set(
this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex], this.form.expenseClaimTrips[index].expenseClaimDetails[nIndex],
'show', 'show',
@ -1317,7 +1303,7 @@ export default {
this.totalCount(arr) == 0 ? '请关联' : '已关联发票' this.totalCount(arr) == 0 ? '请关联' : '已关联发票'
) )
}, },
handleConfirmIe1(arr, nIndex) { handleConfirmIe1(arr, nIndex, amount) {
// let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('') // let nameArr = ((this.ieList.filter(item => arr.includes(item.id)) || []).map(item => item.invoiceCode)).join('')
this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceIds', arr) this.$set(this.form.expenseClaimDetails[nIndex], 'invoiceIds', arr)
this.$set(this.form.expenseClaimDetails[nIndex], 'show', false) this.$set(this.form.expenseClaimDetails[nIndex], 'show', false)
@ -1331,6 +1317,7 @@ export default {
'invoiceName', 'invoiceName',
this.totalCount(arr) == 0 ? '请关联' : '已关联发票' this.totalCount(arr) == 0 ? '请关联' : '已关联发票'
) )
this.$set(this.form.expenseClaimDetails[nIndex], 'amount', amount)
}, },
totalCount(obj) { totalCount(obj) {
@ -1361,7 +1348,7 @@ export default {
feeType: null, feeType: null,
amount: undefined, amount: undefined,
invoiceCount: undefined, invoiceCount: undefined,
remark: null, remark: null
}) })
}, },
@ -1371,7 +1358,7 @@ export default {
feeType: null, feeType: null,
amount: undefined, amount: undefined,
invoiceCount: undefined, invoiceCount: undefined,
remark: null, remark: null
}) })
}, },
handleInitForm() { handleInitForm() {
@ -1403,10 +1390,10 @@ export default {
).format('YY/MM/DD')}`, ).format('YY/MM/DD')}`,
tripPartnersName: nameArr.join('、'), tripPartnersName: nameArr.join('、'),
departureLocation: Number(item.departureLocation), departureLocation: Number(item.departureLocation),
destinationLocation: Number(item.destinationLocation), destinationLocation: Number(item.destinationLocation)
} }
} }
), )
} }
if (Array.isArray(this.form.expenseClaimTrips)) { if (Array.isArray(this.form.expenseClaimTrips)) {
this.form.expenseClaimTrips.forEach((n) => { this.form.expenseClaimTrips.forEach((n) => {
@ -1514,16 +1501,16 @@ export default {
feeType: null, feeType: null,
amount: undefined, amount: undefined,
invoiceCount: undefined, invoiceCount: undefined,
remark: null, remark: null
}, }
], ]
}) })
}, },
handleGetInvoiceList(ids = []) { handleGetInvoiceList(ids = []) {
return new Promise((resolve) => { return new Promise((resolve) => {
getInvoicePage({ getInvoicePage({
pageNo: 1, pageNo: 1,
pageSize: this.$store.getters.requestPageSize, pageSize: this.$store.getters.requestPageSize
}).then((res) => { }).then((res) => {
this.ieList = (res.data && res.data.list) || [] this.ieList = (res.data && res.data.list) || []
getExpenseApplyMyPage({ getExpenseApplyMyPage({
@ -1538,7 +1525,7 @@ export default {
ids: ids.length ? ids.join(',') : null, ids: ids.length ? ids.join(',') : null,
sortingFieldStr: encodeURIComponent( sortingFieldStr: encodeURIComponent(
JSON.stringify([{ field: 'id', order: 'desc' }]) JSON.stringify([{ field: 'id', order: 'desc' }])
), )
}).then((res) => { }).then((res) => {
let list = (res.data.list || []).map((item) => { let list = (res.data.list || []).map((item) => {
return { return {
@ -1558,7 +1545,7 @@ export default {
( (
findAreaIdName(this.areaTree, item.destinationLocation) || findAreaIdName(this.areaTree, item.destinationLocation) ||
{} {}
).name, ).name
] ]
}), }),
time: time:
@ -1571,7 +1558,7 @@ export default {
item.expenseApplyTrips.length - 1 item.expenseApplyTrips.length - 1
].endTime ].endTime
).format('YYYY/MM/DD')}` ).format('YYYY/MM/DD')}`
: '-', : '-'
} }
}) })
list.forEach((element) => { list.forEach((element) => {
@ -1594,7 +1581,7 @@ export default {
title: `序号:${index + 1} 编号:${item.applyNo}申请人:${ title: `序号:${index + 1} 编号:${item.applyNo}申请人:${
item.nickname item.nickname
}行程路线:${item.rode}出差天数:${item.tripDay || 0}`, }行程路线:${item.rode}出差天数:${item.tripDay || 0}`,
disabled: item.status != 2 ? true : false, disabled: item.status != 2 ? true : false
} }
}) })
@ -1610,7 +1597,7 @@ export default {
listData({ listData({
pageNo: 1, pageNo: 1,
pageSize: this.$store.getters.requestPageSize, pageSize: this.$store.getters.requestPageSize,
dictType: 'bs_trip_type', dictType: 'bs_trip_type'
}).then((res) => { }).then((res) => {
// //
this.tripTypeList = res.data.list || [] this.tripTypeList = res.data.list || []
@ -1618,7 +1605,7 @@ export default {
listData({ listData({
pageNo: 1, pageNo: 1,
pageSize: this.$store.getters.requestPageSize, pageSize: this.$store.getters.requestPageSize,
dictType: 'bs_fee_type', dictType: 'bs_fee_type'
}).then((res) => { }).then((res) => {
// //
this.feeTypeList = res.data.list || [] this.feeTypeList = res.data.list || []
@ -1640,7 +1627,7 @@ export default {
if (startTime && endTime) { if (startTime && endTime) {
this.defaultDate = [ this.defaultDate = [
dayjs(startTime).toDate(), dayjs(startTime).toDate(),
dayjs(endTime).toDate(), dayjs(endTime).toDate()
] ]
} }
}) })
@ -1689,10 +1676,10 @@ export default {
Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1 Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1
this.$set(this.form.expenseClaimTrips[this.index], 'tripDay', day) this.$set(this.form.expenseClaimTrips[this.index], 'tripDay', day)
this.dateShow = false this.dateShow = false
}, }
}, }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@import '~@/assets/style/common/form.scss'; @import '~@/assets/style/common/form.scss';
</style> </style>

Loading…
Cancel
Save