Compare commits

...

9 Commits

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

@ -15,35 +15,93 @@
</div> -->
<div class="ct-md">
<div class="mt5">
申请类型{{getDictDataLabel(DICT_TYPE.BS_BILL_TYPE,itemData.billType) || ''}}
申请类型{{
getDictDataLabel(DICT_TYPE.BS_BILL_TYPE, itemData.billType) ||
''
}}
</div>
<div class="mt5">
申请人{{itemData.nickname}}
</div>
<div class="mt5">
项目名称 {{itemData.projectName}}
<div class="mt5">申请人{{ itemData.nickname }}</div>
<div class="mt5">项目名称 {{ itemData.projectName }}</div>
<div class="mt5">申请部门 {{ userInfo.dept.name }}</div>
<div style="margin-top: 0.3rem">
申请时间
{{ dayjs(itemData.createTime).format('YY/MM/DD HH:ss') }}
</div>
<div class="mt5">
申请部门 {{userInfo.dept.name}}
</div>
<div style="margin-top: 0.3rem;">
申请时间 {{dayjs(itemData.createTime).format('YY/MM/DD HH:ss')}}
</div>
<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="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>
</div>
<div class="box-rt">
<!-- {{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: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 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" />
<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
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>
@ -51,8 +109,8 @@
</template>
<script>
import { handleFilterStatus } from "@/utils/dict";
import { deleteExpenseApply, deleteMyExpenseApply } from "@/api/bs/expenseApply";
import { handleFilterStatus } from '@/utils/dict'
import { deleteExpenseApply, deleteMyExpenseApply } from '@/api/bs/expenseApply'
import dayjs from 'dayjs'
import { Dialog } from 'vant'
export default {
@ -60,13 +118,10 @@ export default {
listType: String,
itemData: {
required: true,
default: () => { }
},
},
components: {
default: () => {}
}
},
components: {},
data() {
return {
jumoStudentId: null
@ -77,13 +132,11 @@ export default {
this.handleUpdataInfo()
}
},
mounted() {
},
mounted() {},
computed: {
userInfo() {
return JSON.parse(window.localStorage.getItem('userInfo') || { dept: {} })
},
}
},
methods: {
handleShow(obj) {
@ -95,7 +148,7 @@ export default {
},
handleEdit(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
}
this.jumoStudentId = id
@ -104,16 +157,18 @@ export default {
query: { id, type: 'edit', listType: this.listType, billType }
})
},
handleDel(id, status,creator) {
if (!(status==0 || (status ==3 && this.userInfo.id ==creator))) {
handleDel(id, status, creator) {
if (!(status == 0 || (status == 3 && this.userInfo.id == creator))) {
return
}
Dialog.confirm({
title: '提示',
message: '你确定要删除吗?',
})
.then(() => {
let api = this.listType === 'myNewTrips' ? deleteMyExpenseApply : deleteExpenseApply
message: '你确定要删除吗?'
}).then(() => {
let api =
this.listType === 'myNewTrips'
? deleteMyExpenseApply
: deleteExpenseApply
api(id).then(() => {
this.$emit('onAllRefresh')
})
@ -124,7 +179,7 @@ export default {
handleUpdataInfo() {
this.jumoStudentId = null
this.$emit('onUpdataInfo', this.itemData.id)
},
}
}
}
</script>

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

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

@ -77,6 +77,25 @@
input-align="right"
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
v-model="form.reason"
: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>
</template>
@ -848,9 +889,15 @@ export default {
this.getTree()
},
// 访DOM
mounted() {},
mounted() {
console.log(this.$store.getters.bankInfo, 'this.$store.getters.bankInfo')
},
data() {
return {
showPicker2: false,
showPicker: false,
//
bankAccountList: this.$store.getters.bankInfo,
areaTree: [],
indexOne: 1,
indexTwo: 1,
@ -878,7 +925,9 @@ export default {
maxDate: new Date('2030/01/01'),
defaultDate: new Date(),
dateShow: false,
fundingSourceLabel: '',
form: {
fundingSource: null,
companyName: window.localStorage.getItem('cn'), //
nickname: JSON.parse(
window.localStorage.getItem('userInfo') || { dept: {} }
@ -896,7 +945,9 @@ export default {
projectName: null,
reason: null,
remark: null,
costDeptId: null,
costDeptId: JSON.parse(
window.localStorage.getItem('userInfo') || { dept: {} }
).deptId, //,
expenseApplyIds: [],
expenseClaimTrips: [
{
@ -943,6 +994,18 @@ export default {
//
// bs_fee_type
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() {
let arr = []
this.form.expenseClaimTrips.forEach((v) => {
@ -981,6 +1044,16 @@ export default {
watch: {},
//
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() {
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)) {
this.form.expenseClaimTrips.forEach((n) => {
n.expenseClaimDetails.forEach((z) => {

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

Loading…
Cancel
Save