|
|
@ -1,11 +1,7 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<!-- 导航返回上一页 --> |
|
|
|
<van-nav-bar |
|
|
|
title="发起申请" |
|
|
|
left-arrow |
|
|
|
@click-left="onClickLeft" |
|
|
|
/> |
|
|
|
<van-nav-bar title="发起申请" left-arrow @click-left="onClickLeft" /> |
|
|
|
<!-- 申请发票需要输入的数据 --> |
|
|
|
<div class="bg-white pb-3"> |
|
|
|
<div class="text-gray-500 px-4 py-3 font-semibold">发票信息</div> |
|
|
@ -18,9 +14,19 @@ |
|
|
|
<span class="text-gray-500">上传票据凭证 </span> |
|
|
|
<span class="text-gray-400 text-xs">(仅支持ipg格式)</span> |
|
|
|
</div> |
|
|
|
<van-button plain type="primary" size="mini" @click="data.isInvoice = false">手动输入</van-button> |
|
|
|
<van-button |
|
|
|
plain |
|
|
|
type="primary" |
|
|
|
size="mini" |
|
|
|
@click="data.isInvoice = false" |
|
|
|
>手动输入</van-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div class="text-center border-b w-52 h-24 bg-gray-100 border-dashed border-2" @click="uploadBill" v-show="!data.isSuccess"> |
|
|
|
<div |
|
|
|
class="text-center border-b w-52 h-24 bg-gray-100 border-dashed border-2" |
|
|
|
@click="uploadBill" |
|
|
|
v-show="!data.isSuccess" |
|
|
|
> |
|
|
|
<p class="text-gray-400 text-xl pt-3">+</p> |
|
|
|
<p class="text-gray-400 text-xs">上传并识别凭证</p> |
|
|
|
</div> |
|
|
@ -75,7 +81,11 @@ |
|
|
|
size="mini" |
|
|
|
v-for="item in data.reviewerList" |
|
|
|
:key="item.userId" |
|
|
|
:type="data.checkerList.find(checker => checker === item.userId) ? 'primary' : 'default'" |
|
|
|
:type=" |
|
|
|
data.checkerList.find(checker => checker === item.userId) |
|
|
|
? 'primary' |
|
|
|
: 'default' |
|
|
|
" |
|
|
|
@click="handleSelectChecker(item.userId)" |
|
|
|
> |
|
|
|
{{ item.name }} |
|
|
@ -118,10 +128,7 @@ |
|
|
|
disabled |
|
|
|
/> |
|
|
|
<van-popup v-model:show="data.projectName" round position="bottom"> |
|
|
|
<van-cascader |
|
|
|
active-color="#1989fa" |
|
|
|
class="p-0" |
|
|
|
/> |
|
|
|
<van-cascader active-color="#1989fa" class="p-0" /> |
|
|
|
</van-popup> |
|
|
|
<!-- 所属任务的 --> |
|
|
|
<van-field |
|
|
@ -135,10 +142,7 @@ |
|
|
|
disabled |
|
|
|
/> |
|
|
|
<van-popup v-model:show="data.taskName" round position="bottom"> |
|
|
|
<van-cascader |
|
|
|
active-color="#1989fa" |
|
|
|
class="p-0" |
|
|
|
/> |
|
|
|
<van-cascader active-color="#1989fa" class="p-0" /> |
|
|
|
</van-popup> |
|
|
|
<!-- 类目选择 --> |
|
|
|
<van-field |
|
|
@ -178,10 +182,19 @@ |
|
|
|
<!-- 个人手动申请 --> |
|
|
|
<div v-show="!data.isInvoice"> |
|
|
|
<div class="pl-2"> |
|
|
|
<van-cell title="单元格" is-link :value="data.personalType" required/> |
|
|
|
<van-cell title="单元格" is-link :value="data.personalCategory" required/> |
|
|
|
<van-cell |
|
|
|
title="单元格" |
|
|
|
is-link |
|
|
|
:value="data.personalType" |
|
|
|
required |
|
|
|
/> |
|
|
|
<van-cell |
|
|
|
title="单元格" |
|
|
|
is-link |
|
|
|
:value="data.personalCategory" |
|
|
|
required |
|
|
|
/> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 提交人信息 --> |
|
|
@ -218,15 +231,15 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script setup> |
|
|
|
import {ref, reactive} from 'vue' |
|
|
|
import { ref, reactive } from 'vue'; |
|
|
|
// import useApplication from 'hooks/useApplication'; |
|
|
|
import { queryChecker } from 'apis/member' |
|
|
|
import { queryType } from 'apis/finance' |
|
|
|
import { queryChecker } from 'apis/member'; |
|
|
|
import { queryType } from 'apis/finance'; |
|
|
|
|
|
|
|
// const getApplication = useApplication(); |
|
|
|
const projectName = useProjectName() |
|
|
|
const taskName = useTaskName() |
|
|
|
const projectId = useProjectId() |
|
|
|
const projectName = useProjectName(); |
|
|
|
const taskName = useTaskName(); |
|
|
|
const projectId = useProjectId(); |
|
|
|
const data = reactive({ |
|
|
|
isInvoice: true, |
|
|
|
remark: '', |
|
|
@ -235,32 +248,32 @@ const data = reactive({ |
|
|
|
{ |
|
|
|
name: '发票代码', |
|
|
|
values: 0, |
|
|
|
label: 'invoiceCode' |
|
|
|
label: 'invoiceCode', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '发票号码', |
|
|
|
values: 1, |
|
|
|
label: 'invoiceNumber' |
|
|
|
label: 'invoiceNumber', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '合计金额(元)', |
|
|
|
values: 2, |
|
|
|
label: 'money' |
|
|
|
label: 'money', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '税额(元)', |
|
|
|
values: 3, |
|
|
|
label: 'taxMoney' |
|
|
|
label: 'taxMoney', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '开票日期', |
|
|
|
values: 4, |
|
|
|
label: 'invoiceTime' |
|
|
|
label: 'invoiceTime', |
|
|
|
}, |
|
|
|
{ |
|
|
|
name: '发票备注信息', |
|
|
|
values: 5, |
|
|
|
label: 'remark' |
|
|
|
label: 'remark', |
|
|
|
}, |
|
|
|
], |
|
|
|
reviewerList: [], // 审核人数组 |
|
|
@ -270,13 +283,13 @@ const data = reactive({ |
|
|
|
applicant: '代用名1', |
|
|
|
money: 100, |
|
|
|
time: '2021/12/31 12:31', |
|
|
|
type: 1 |
|
|
|
type: 1, |
|
|
|
}, |
|
|
|
{ |
|
|
|
applicant: '代用名2', |
|
|
|
money: 100, |
|
|
|
time: '2021/12/31 12:31', |
|
|
|
type: 2 |
|
|
|
type: 2, |
|
|
|
}, |
|
|
|
], // 申请的记录 |
|
|
|
isSuccess: false, // 上传票据是否成功 |
|
|
@ -303,7 +316,7 @@ const data = reactive({ |
|
|
|
applyNameOptions: [], |
|
|
|
applyName: '', // 选择的名目的值 |
|
|
|
rowId: '', |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
// 发票信息 |
|
|
|
function cahngeInvoiceList(e, item) { |
|
|
@ -314,37 +327,37 @@ function cahngeInvoiceList(e,item){ |
|
|
|
function finishApplyType(e) { |
|
|
|
data.showType = false; |
|
|
|
data.applyType = e; |
|
|
|
const type = data.applyTypes.find((option) => option.name === e); |
|
|
|
const type = data.applyTypes.find(option => option.name === e); |
|
|
|
data.typeId = type.id; |
|
|
|
// 类目 |
|
|
|
handleQueryType(data.typeId, 1) |
|
|
|
handleQueryType(data.typeId, 1); |
|
|
|
} |
|
|
|
|
|
|
|
// 所属的类目 |
|
|
|
function finishApplyCategory(e) { |
|
|
|
data.showCategory = false; |
|
|
|
data.applyCategory = e; |
|
|
|
const category = data.applyCategories.find((option) => option.name === e); |
|
|
|
const category = data.applyCategories.find(option => option.name === e); |
|
|
|
data.categoryId = category.id; |
|
|
|
// 名目 |
|
|
|
handleQueryType(data.categoryId, 2) |
|
|
|
handleQueryType(data.categoryId, 2); |
|
|
|
} |
|
|
|
|
|
|
|
// 所属的名目 |
|
|
|
function finishApplyName(e) { |
|
|
|
data.showName = false; |
|
|
|
data.applyName = e; |
|
|
|
const row = data.applyNames.find((option) => option.name === e); |
|
|
|
const row = data.applyNames.find(option => option.name === e); |
|
|
|
data.rowId = row.id; |
|
|
|
} |
|
|
|
|
|
|
|
// 检查被选中的审核人的状态 |
|
|
|
function handleSelectChecker(id) { |
|
|
|
const target = data.checkerList.find(item =>item === id) |
|
|
|
const target = data.checkerList.find(item => item === id); |
|
|
|
if (target) { |
|
|
|
data.checkerList = data.checkerList.filter(item =>item !== id) |
|
|
|
data.checkerList = data.checkerList.filter(item => item !== id); |
|
|
|
} else { |
|
|
|
data.checkerList.push(id) |
|
|
|
data.checkerList.push(id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -352,9 +365,9 @@ function handleSelectChecker(id){ |
|
|
|
function uploadBill() { |
|
|
|
//TODO:调取接口识别票据 |
|
|
|
setTimeout(() => { |
|
|
|
data.titleHidden = false |
|
|
|
data.isSuccess = true |
|
|
|
},1000) |
|
|
|
data.titleHidden = false; |
|
|
|
data.isSuccess = true; |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -365,11 +378,11 @@ async function handleQueryChecker(){ |
|
|
|
try { |
|
|
|
const params = { |
|
|
|
param: { |
|
|
|
projectId: projectId.value |
|
|
|
} |
|
|
|
} |
|
|
|
const res = await queryChecker(params) |
|
|
|
data.reviewerList = res |
|
|
|
projectId: projectId.value, |
|
|
|
}, |
|
|
|
}; |
|
|
|
const res = await queryChecker(params); |
|
|
|
data.reviewerList = res; |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
|
} |
|
|
@ -387,26 +400,26 @@ async function handleQueryType(parentId, type){ |
|
|
|
param: { |
|
|
|
parentId, |
|
|
|
type, |
|
|
|
} |
|
|
|
} |
|
|
|
const res = await queryType(params) |
|
|
|
}, |
|
|
|
}; |
|
|
|
const res = await queryType(params); |
|
|
|
if (type === 0) { |
|
|
|
data.applyTypes = res |
|
|
|
res.forEach((item) => { |
|
|
|
data.applyTypeOptions.push(item.name) |
|
|
|
}) |
|
|
|
data.applyTypes = res; |
|
|
|
res.forEach(item => { |
|
|
|
data.applyTypeOptions.push(item.name); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (type === 1) { |
|
|
|
data.applyCategories = res |
|
|
|
res.forEach((item) => { |
|
|
|
data.applyCategoryOptions.push(item.name) |
|
|
|
}) |
|
|
|
data.applyCategories = res; |
|
|
|
res.forEach(item => { |
|
|
|
data.applyCategoryOptions.push(item.name); |
|
|
|
}); |
|
|
|
} |
|
|
|
if (type === 2) { |
|
|
|
data.applyNames = res |
|
|
|
res.forEach((item) => { |
|
|
|
data.applyNameOptions.push(item.name) |
|
|
|
}) |
|
|
|
data.applyNames = res; |
|
|
|
res.forEach(item => { |
|
|
|
data.applyNameOptions.push(item.name); |
|
|
|
}); |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
console.error('error: ', error); |
|
|
@ -415,15 +428,14 @@ async function handleQueryType(parentId, type){ |
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
// 查询所有成员 |
|
|
|
handleQueryChecker() |
|
|
|
handleQueryChecker(); |
|
|
|
// 查询费用申请类型 |
|
|
|
handleQueryType(0, 0) |
|
|
|
}) |
|
|
|
handleQueryType(0, 0); |
|
|
|
}); |
|
|
|
|
|
|
|
function onClickLeft() { |
|
|
|
console.log(1) |
|
|
|
console.log(1); |
|
|
|
} |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less" scoped> |
|
|
@ -435,7 +447,7 @@ function onClickLeft(){ |
|
|
|
} |
|
|
|
.bill-name { |
|
|
|
font-weight: 600; |
|
|
|
color: #6F6F6F; |
|
|
|
color: #6f6f6f; |
|
|
|
border-bottom: 1px solid #eee; |
|
|
|
padding: 0.75rem 0px; |
|
|
|
} |
|
|
|