Compare commits

...

9 Commits

@ -106,50 +106,33 @@ export default {
hanleCancel() { hanleCancel() {
this.isShow = false this.isShow = false
}, },
handleConfirm() { handleConfirm(key) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.form.validate().then(() => { if (key == 2) {
let obj = { let obj = {
id: this.accessId, id: this.accessId,
reason: this.form.reason reason: ''
} }
this.$loading(true, 'loadingSb') this.$loading(true, 'loadingSb')
if (this.key == 2) { approveTask(obj)
/* approveTask(obj) .then(() => {
.then(() => { this.$forceCloseLoading()
this.$EventBus.$emit('handleResetLive', 'company-myTrips') this.$EventBus.$emit('handleResetLive', 'company-myTrips')
this.$EventBus.$emit('handleResetLive', 'company-myClaim') this.$EventBus.$emit('handleResetLive', 'company-myClaim')
history.back() history.back()
this.$loading(false, 'loadingSb') this.$loading(false, 'loadingSb')
}) })
.catch(() => { .catch(() => {
this.$loading(false, 'loadingSb') this.$forceCloseLoading()
}) this.$loading(false, 'loadingSb')
} else { })
rejectTask(obj) } else {
.then(() => { this.$refs.form.validate().then(() => {
this.$EventBus.$emit('handleResetLive', 'company-myTrips') let obj = {
this.$EventBus.$emit('handleResetLive', 'company-myClaim') id: this.accessId,
history.back() reason: this.form.reason
this.$loading(false, 'loadingSb') }
}) this.$loading(true, 'loadingSb')
.catch(() => {
this.$loading(false, 'loadingSb')
}) */
approveTask(obj)
.then(() => {
this.$forceCloseLoading()
this.$EventBus.$emit('handleResetLive', 'company-myTrips')
this.$EventBus.$emit('handleResetLive', 'company-myClaim')
history.back()
this.$loading(false, 'loadingSb')
})
.catch(() => {
this.$forceCloseLoading()
this.$loading(false, 'loadingSb')
})
} else {
rejectTask(obj) rejectTask(obj)
.then(() => { .then(() => {
this.$forceCloseLoading() this.$forceCloseLoading()
@ -162,8 +145,8 @@ export default {
this.$forceCloseLoading() this.$forceCloseLoading()
this.$loading(false, 'loadingSb') this.$loading(false, 'loadingSb')
}) })
} })
}) }
}) })
}, },
handleSubmit(key) { handleSubmit(key) {
@ -172,7 +155,7 @@ export default {
this.title = '同意' this.title = '同意'
this.form.reason = '已同意' this.form.reason = '已同意'
// //
this.handleConfirm() this.handleConfirm(2)
} else if (key == 3) { } else if (key == 3) {
this.key = key this.key = key
this.title = '驳回' this.title = '驳回'

@ -15,35 +15,93 @@
</div> --> </div> -->
<div class="ct-md"> <div class="ct-md">
<div class="mt5"> <div class="mt5">
申请类型{{getDictDataLabel(DICT_TYPE.BS_BILL_TYPE,itemData.billType) || ''}} 申请类型{{
getDictDataLabel(DICT_TYPE.BS_BILL_TYPE, itemData.billType) ||
''
}}
</div> </div>
<div class="mt5"> <div class="mt5">申请人{{ itemData.nickname }}</div>
申请人{{itemData.nickname}} <div class="mt5">项目名称 {{ itemData.projectName }}</div>
</div> <div class="mt5">申请部门 {{ userInfo.dept.name }}</div>
<div class="mt5"> <div style="margin-top: 0.3rem">
项目名称 {{itemData.projectName}} 申请时间
</div> {{ dayjs(itemData.createTime).format('YY/MM/DD HH:ss') }}
<div class="mt5">
申请部门 {{userInfo.dept.name}}
</div>
<div style="margin-top: 0.3rem;">
申请时间 {{dayjs(itemData.createTime).format('YY/MM/DD HH:ss')}}
</div> </div>
</div> </div>
<div class="cr-bt" style="margin-top: 0.6rem;"> <div class="cr-bt" style="margin-top: 0.6rem">
<div class="tags" :style="`border: 1px solid ${handleFilterStatus(DICT_TYPE.BS_EXPENSE_APPLY_STATUS,itemData.status).color};color:${handleFilterStatus(DICT_TYPE.BS_EXPENSE_APPLY_STATUS,itemData.status).color}`"> {{handleFilterStatus(DICT_TYPE.BS_EXPENSE_APPLY_STATUS,itemData.status).label}}</div> <div
class="tags"
:style="`border: 1px solid ${
handleFilterStatus(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS,
itemData.status
).color
};color:${
handleFilterStatus(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS,
itemData.status
).color
}`"
>
{{
handleFilterStatus(
DICT_TYPE.BS_EXPENSE_APPLY_STATUS,
itemData.status
).label
}}
</div>
</div> </div>
</div> </div>
<div class="box-rt"> <div class="box-rt">
<!-- {{listType}} --> <!-- {{listType}} -->
<van-icon class="icon-box" v-hasPermi="[listType === 'myNewTrips' ? 'bs:expense-apply:myquery' : 'bs:expense-apply:query']" @click="handleShow(itemData)" name="eye-o" color="#05A9FF" size="25" /> <van-icon
class="icon-box"
v-hasPermi="[
listType === 'myNewTrips'
? 'bs:expense-apply:myquery'
: 'bs:expense-apply:query'
]"
@click="handleShow(itemData)"
name="eye-o"
color="#05A9FF"
size="25"
/>
<!-- <van-icon class="icon-box" v-hasPermi="['bs:expense-apply:create']" v-if="listType !== 'myNewTrips'" @click="handleEdit(itemData.id,itemData.status)" name="edit" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':''" size="25" /> <!-- <van-icon class="icon-box" v-hasPermi="['bs:expense-apply:create']" v-if="listType !== 'myNewTrips'" @click="handleEdit(itemData.id,itemData.status)" name="edit" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':''" size="25" />
<van-icon class="icon-box" v-hasPermi="['bs:expense-apply:delete']" v-if="listType !== 'myNewTrips'" @click="handleDel(itemData.id,itemData.status,temData.creator)" name="delete-o" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':'#EC3359'" size="25" /> <van-icon class="icon-box" v-hasPermi="['bs:expense-apply:delete']" v-if="listType !== 'myNewTrips'" @click="handleDel(itemData.id,itemData.status,temData.creator)" name="delete-o" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':'#EC3359'" size="25" />
--> -->
<van-icon class="icon-box" v-hasPermi="['bs:expense-apply:create']" v-if="listType == 'myNewTrips'" @click="handleEdit(itemData)" name="edit" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':''" size="25" /> <van-icon
<van-icon class="icon-box" v-hasPermi="['bs:expense-apply:mydelete']" v-if="listType == 'myNewTrips'" @click="handleDel(itemData.id,itemData.status,temData.creator)" name="delete-o" :color="!(itemData.status==0 || (itemData.status==3 && userInfo.id ==itemData.creator)) ?'#ccc':'#EC3359'" size="25" /> class="icon-box"
v-hasPermi="['bs:expense-apply:create']"
v-if="listType == 'myNewTrips'"
@click="handleEdit(itemData)"
name="edit"
:color="
!(
itemData.status == 0 ||
(itemData.status == 3 && userInfo.id == itemData.creator)
)
? '#ccc'
: ''
"
size="25"
/>
<van-icon
class="icon-box"
v-hasPermi="['bs:expense-apply:mydelete']"
v-if="listType == 'myNewTrips'"
@click="handleDel(itemData.id, itemData.status, itemData.creator)"
name="delete-o"
:color="
!(
itemData.status == 0 ||
(itemData.status == 3 && userInfo.id == itemData.creator)
)
? '#ccc'
: '#EC3359'
"
size="25"
/>
</div> </div>
</div> </div>
</div> </div>
@ -51,8 +109,8 @@
</template> </template>
<script> <script>
import { handleFilterStatus } from "@/utils/dict"; import { handleFilterStatus } from '@/utils/dict'
import { deleteExpenseApply, deleteMyExpenseApply } from "@/api/bs/expenseApply"; import { deleteExpenseApply, deleteMyExpenseApply } from '@/api/bs/expenseApply'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { Dialog } from 'vant' import { Dialog } from 'vant'
export default { export default {
@ -60,13 +118,10 @@ export default {
listType: String, listType: String,
itemData: { itemData: {
required: true, required: true,
default: () => { } default: () => {}
}, }
},
components: {
}, },
components: {},
data() { data() {
return { return {
jumoStudentId: null jumoStudentId: null
@ -77,13 +132,11 @@ export default {
this.handleUpdataInfo() this.handleUpdataInfo()
} }
}, },
mounted() { mounted() {},
},
computed: { computed: {
userInfo() { userInfo() {
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} }) return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
}, }
}, },
methods: { methods: {
handleShow(obj) { handleShow(obj) {
@ -95,7 +148,7 @@ export default {
}, },
handleEdit(obj) { handleEdit(obj) {
const { id, status, billType, creator } = obj const { id, status, billType, creator } = obj
if (!(status==0 || (status ==3 && this.userInfo.id ==creator))) { if (!(status == 0 || (status == 3 && this.userInfo.id == creator))) {
return return
} }
this.jumoStudentId = id this.jumoStudentId = id
@ -104,27 +157,29 @@ export default {
query: { id, type: 'edit', listType: this.listType, billType } query: { id, type: 'edit', listType: this.listType, billType }
}) })
}, },
handleDel(id, status,creator) { handleDel(id, status, creator) {
if (!(status==0 || (status ==3 && this.userInfo.id ==creator))) { if (!(status == 0 || (status == 3 && this.userInfo.id == creator))) {
return return
} }
Dialog.confirm({ Dialog.confirm({
title: '提示', title: '提示',
message: '你确定要删除吗?', message: '你确定要删除吗?'
}) }).then(() => {
.then(() => { let api =
let api = this.listType === 'myNewTrips' ? deleteMyExpenseApply : deleteExpenseApply this.listType === 'myNewTrips'
api(id).then(() => { ? deleteMyExpenseApply
this.$emit('onAllRefresh') : deleteExpenseApply
}) api(id).then(() => {
this.$emit('onAllRefresh')
}) })
})
}, },
handleFilterStatus, handleFilterStatus,
dayjs, dayjs,
handleUpdataInfo() { handleUpdataInfo() {
this.jumoStudentId = null this.jumoStudentId = null
this.$emit('onUpdataInfo', this.itemData.id) this.$emit('onUpdataInfo', this.itemData.id)
}, }
} }
} }
</script> </script>

@ -22,8 +22,12 @@ export default {
areaTree: [], areaTree: [],
userDeptTree: [], userDeptTree: [],
userList: [], userList: [],
bankInfo: [], // 账户信息
}, },
mutations: { mutations: {
SET_BANKINFO: (state, bankInfo) => {
state.bankInfo = bankInfo.length > 0 ? bankInfo : []
},
SET_AUTHORIZATION(state, authorization) { SET_AUTHORIZATION(state, authorization) {
state.authorization = authorization state.authorization = authorization
}, },
@ -207,6 +211,7 @@ export default {
setLocalStorage('userInfo', JSON.stringify(res.data)) setLocalStorage('userInfo', JSON.stringify(res.data))
let res1 = res.data let res1 = res.data
commit('SET_USERINFO', res.data) commit('SET_USERINFO', res.data)
commit('SET_BANKINFO', res.data.bankInfoList || [])
getAreaTree().then(res => { getAreaTree().then(res => {
let tree = res.data || [] let tree = res.data || []
handleAreaLoop(tree) handleAreaLoop(tree)
@ -237,7 +242,6 @@ export default {
reject(res.response.code) reject(res.response.code)
}) })
// //
// huoqu // huoqu
}).catch(e => { }).catch(e => {
console.log(e) console.log(e)

@ -9,6 +9,8 @@ const getters = {
userList: state => state.common.user.userList, userList: state => state.common.user.userList,
dict_datas: state => state.dict.dictDatas, dict_datas: state => state.dict.dictDatas,
requestPageSize: state => state.common.global.requestPageSize, requestPageSize: state => state.common.global.requestPageSize,
// 银行信息
bankInfo: state => state.common.user.bankInfo,
} }
export default getters export default getters

@ -77,6 +77,25 @@
input-align="right" input-align="right"
placeholder="请输入" placeholder="请输入"
/> />
<van-field
v-model="fundingSourceLabel"
:disabled="disabled"
label="项目资金来源"
clear-trigger="always"
input-align="right"
placeholder="请输入"
@click="showPicker = true"
/>
<van-field
v-model="form.bankAccount"
:disabled="disabled"
required
label="收款账号"
clear-trigger="always"
input-align="right"
placeholder="请输入"
@click="showPicker2 = true"
/>
<van-field <van-field
v-model="form.reason" v-model="form.reason"
:disabled="disabled" :disabled="disabled"
@ -808,6 +827,28 @@
} }
" "
/> />
<!-- 资金来源底部框 -->
<van-popup v-model="showPicker" position="bottom">
<van-picker
show-toolbar
title="选择资金来源"
:columns="fundingSourceList"
@confirm="selectFundingSource"
@cancel="showPicker = false"
/>
</van-popup>
<!-- 银行账号底部框 -->
<van-popup v-model="showPicker2" position="bottom">
<van-picker
show-toolbar
title="选择银行账号"
:columns="bankAccountList1"
@confirm="selectBankAccount"
@cancel="showPicker2 = false"
/>
</van-popup>
</div> </div>
</template> </template>
@ -848,9 +889,15 @@ export default {
this.getTree() this.getTree()
}, },
// 访DOM // 访DOM
mounted() {}, mounted() {
console.log(this.$store.getters.bankInfo, 'this.$store.getters.bankInfo')
},
data() { data() {
return { return {
showPicker2: false,
showPicker: false,
//
bankAccountList: this.$store.getters.bankInfo,
areaTree: [], areaTree: [],
indexOne: 1, indexOne: 1,
indexTwo: 1, indexTwo: 1,
@ -878,7 +925,9 @@ export default {
maxDate: new Date('2030/01/01'), maxDate: new Date('2030/01/01'),
defaultDate: new Date(), defaultDate: new Date(),
dateShow: false, dateShow: false,
fundingSourceLabel: '',
form: { form: {
fundingSource: null,
companyName: window.localStorage.getItem('cn'), // companyName: window.localStorage.getItem('cn'), //
nickname: JSON.parse( nickname: JSON.parse(
window.localStorage.getItem('userInfo') || { dept: {} } window.localStorage.getItem('userInfo') || { dept: {} }
@ -896,7 +945,9 @@ export default {
projectName: null, projectName: null,
reason: null, reason: null,
remark: null, remark: null,
costDeptId: null, costDeptId: JSON.parse(
window.localStorage.getItem('userInfo') || { dept: {} }
).deptId, //,
expenseApplyIds: [], expenseApplyIds: [],
expenseClaimTrips: [ expenseClaimTrips: [
{ {
@ -943,6 +994,18 @@ export default {
// //
// bs_fee_type // bs_fee_type
computed: { computed: {
bankAccountList1() {
return this.bankAccountList.map((e) => e.bankNumber)
},
fundingSourceList() {
const list = this.getDictDatas('funding_source')?.map((e) => {
return {
text: e.label,
value: e.value
}
})
return list || []
},
allTripPartners() { allTripPartners() {
let arr = [] let arr = []
this.form.expenseClaimTrips.forEach((v) => { this.form.expenseClaimTrips.forEach((v) => {
@ -981,6 +1044,16 @@ export default {
watch: {}, watch: {},
// //
methods: { methods: {
selectBankAccount(val) {
console.log(val, 'valvalval')
this.form.bankAccount = val
this.showPicker2 = false
},
selectFundingSource(val) {
this.form.fundingSource = val.value
this.fundingSourceLabel = val.text
this.showPicker = false
},
// //
addInvoice() { addInvoice() {
this.$router.push({ this.$router.push({
@ -1395,6 +1468,9 @@ export default {
} }
) )
} }
this.fundingSourceLabel = this.fundingSourceList.find(
(e) => e.value == this.form.fundingSource
).text
if (Array.isArray(this.form.expenseClaimTrips)) { if (Array.isArray(this.form.expenseClaimTrips)) {
this.form.expenseClaimTrips.forEach((n) => { this.form.expenseClaimTrips.forEach((n) => {
n.expenseClaimDetails.forEach((z) => { n.expenseClaimDetails.forEach((z) => {

@ -78,6 +78,15 @@
input-align="right" input-align="right"
placeholder="请输入" placeholder="请输入"
/> />
<van-field
v-model="fundingSourceLabel"
:disabled="disabled"
label="项目资金来源"
clear-trigger="always"
input-align="right"
placeholder="请输入"
@click="showPicker = true"
/>
<van-field <van-field
v-model="form.amount" v-model="form.amount"
v-if="!CLSQ" v-if="!CLSQ"
@ -91,8 +100,8 @@
required: false, required: false,
message: '预计费用格式错误', message: '预计费用格式错误',
validator: VerifyFunc.validatorMoney, validator: VerifyFunc.validatorMoney,
type: 1, type: 1
}, }
]" ]"
label="预计费用" label="预计费用"
clear-trigger="always" clear-trigger="always"
@ -236,7 +245,7 @@
label="出差类型" label="出差类型"
:name="`tripType_${index}`" :name="`tripType_${index}`"
:list="tripTypeList" :list="tripTypeList"
isRequrie
isCell isCell
clearable clearable
/> />
@ -271,8 +280,8 @@
{ {
required: false, required: false,
message: '预计费用格式错误', message: '预计费用格式错误',
validator: VerifyFunc.validatorMoney, validator: VerifyFunc.validatorMoney
}, }
]" ]"
v-model="item.amount" v-model="item.amount"
:name="`amount`" :name="`amount`"
@ -348,6 +357,15 @@
color="#0088FE" color="#0088FE"
@confirm="handleDateSelect" @confirm="handleDateSelect"
/> />
<van-popup v-model="showPicker" position="bottom">
<van-picker
show-toolbar
title="选择资金来源"
:columns="fundingSourceList"
@confirm="selectFundingSource"
@cancel="showPicker = false"
/>
</van-popup>
</div> </div>
</template> </template>
@ -356,7 +374,7 @@ import dayjs from 'dayjs'
import { import {
createExpenseApply, createExpenseApply,
getExpenseApply, getExpenseApply,
getMyExpenseApply, getMyExpenseApply
} from '@/api/bs/expenseApply' } from '@/api/bs/expenseApply'
import { listData } from '@/api/system/dict/data' import { listData } from '@/api/system/dict/data'
import VerifyFunc from '@/utils/verify' import VerifyFunc from '@/utils/verify'
@ -371,10 +389,19 @@ export default {
FollowPeoPle: () => import('@/components/FollowPeoPle'), FollowPeoPle: () => import('@/components/FollowPeoPle'),
UploadFile: () => import('@/components/UploadFile'), UploadFile: () => import('@/components/UploadFile'),
ApprovalProcess: () => import('@/components/ApprovalProcess'), ApprovalProcess: () => import('@/components/ApprovalProcess'),
BottomBtn: () => import('@/components/BottomBtn'), BottomBtn: () => import('@/components/BottomBtn')
}, },
// //
computed: { computed: {
fundingSourceList() {
const list = this.getDictDatas('funding_source')?.map((e) => {
return {
text: e.label,
value: e.value
}
})
return list || []
},
allTripPartners() { allTripPartners() {
let arr = [] let arr = []
this.form.expenseApplyTrips.forEach((v) => { this.form.expenseApplyTrips.forEach((v) => {
@ -404,7 +431,7 @@ export default {
}, },
CLSQ() { CLSQ() {
return ['CLSQ'].includes(this.$route.query.billType) return ['CLSQ'].includes(this.$route.query.billType)
}, }
}, },
// 访this // 访this
created() { created() {
@ -418,6 +445,7 @@ export default {
}, },
data() { data() {
return { return {
showPicker: false,
// //
areaTree: [], areaTree: [],
VerifyFunc, VerifyFunc,
@ -432,7 +460,9 @@ export default {
maxDate: new Date('2030/01/01'), maxDate: new Date('2030/01/01'),
defaultDate: new Date(), defaultDate: new Date(),
dateShow: false, dateShow: false,
fundingSourceLabel: '',
form: { form: {
fundingSource: null,
companyName: window.localStorage.getItem('cn'), // companyName: window.localStorage.getItem('cn'), //
nickname: JSON.parse( nickname: JSON.parse(
window.localStorage.getItem('userInfo') || { dept: {} } window.localStorage.getItem('userInfo') || { dept: {} }
@ -465,10 +495,10 @@ export default {
tripPartnersName: '', tripPartnersName: '',
amount: undefined, amount: undefined,
type: 0, type: 0,
isOpen: false, isOpen: false
}, }
], ]
}, }
} }
}, },
@ -476,6 +506,11 @@ export default {
watch: {}, watch: {},
// //
methods: { methods: {
selectFundingSource(val) {
this.form.fundingSource = val.value
this.fundingSourceLabel = val.text
this.showPicker = false
},
// //
getTree() { getTree() {
getAreaTree().then((res) => { getAreaTree().then((res) => {
@ -512,10 +547,10 @@ export default {
expenseApplyTrips: (this.form.expenseApplyTrips || []).map( expenseApplyTrips: (this.form.expenseApplyTrips || []).map(
(item) => { (item) => {
return { return {
...item, ...item
} }
} }
), )
} }
this.$loading(true, 'form') this.$loading(true, 'form')
createExpenseApply(newForm).then((res) => { createExpenseApply(newForm).then((res) => {
@ -574,11 +609,14 @@ 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)
} }
} }
), )
} }
this.fundingSourceLabel = this.fundingSourceList.find(
(e) => e.value == this.form.fundingSource
).text
this.fileList = res.data.files || [] this.fileList = res.data.files || []
this.isAuthorised = res.data.isAuthorised this.isAuthorised = res.data.isAuthorised
this.$nextTick(() => { this.$nextTick(() => {
@ -663,7 +701,7 @@ export default {
tripPartnersName: '', tripPartnersName: '',
amount: undefined, amount: undefined,
isOpen: false, isOpen: false,
type: 0, type: 0
}) })
}, },
handleInitList() { handleInitList() {
@ -672,7 +710,7 @@ export default {
listData({ listData({
pageNo: 1, pageNo: 1,
pageSize: 50, pageSize: 50,
dictType: 'bs_trip_type', dictType: 'bs_trip_type'
}).then((res) => { }).then((res) => {
this.tripTypeList = res.data.list || [] this.tripTypeList = res.data.list || []
}) })
@ -687,7 +725,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()
] ]
} }
}) })
@ -736,8 +774,8 @@ 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.expenseApplyTrips[this.index], 'tripDay', day) this.$set(this.form.expenseApplyTrips[this.index], 'tripDay', day)
this.dateShow = false this.dateShow = false
}, }
}, }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

Loading…
Cancel
Save