|
@@ -22,8 +22,7 @@
|
|
|
<div class="hc-form-item">
|
|
|
<el-form-item label="开票人:" prop="invoiceUserId">
|
|
|
<el-select block v-model="otherInfo.invoiceUserId">
|
|
|
- <el-option label="暂无接口1" value="1" />
|
|
|
- <el-option label="暂无接口2" value="2" />
|
|
|
+ <el-option v-for="item in userList" :label="item.name" :value="item.id"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开户银行:">
|
|
@@ -63,8 +62,7 @@
|
|
|
<div class="hc-form-item">
|
|
|
<el-form-item label="开票内容:" prop="invoiceContentType">
|
|
|
<el-select block v-model="otherInfo.invoiceContentType">
|
|
|
- <el-option label="暂无接口1" value="1" />
|
|
|
- <el-option label="暂无接口2" value="2" />
|
|
|
+ <el-option v-for="item in invoiceContentList" :label="item" :value="item"/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
@@ -79,10 +77,16 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref, watch,onActivated } from 'vue'
|
|
|
-import {getProjectList} from "~api/other";
|
|
|
+import {getProjectList,getuserList,getDictInfo} from "~api/other";
|
|
|
import {getArrValue} from "js-fast-way";
|
|
|
+import {useAppStore} from "~src/store";
|
|
|
+import mainApi from "~api/expense/invoice";
|
|
|
+const useAppState = useAppStore();
|
|
|
onActivated(()=>{
|
|
|
-
|
|
|
+ getUserDict()
|
|
|
+ getInvoiceContentList()
|
|
|
+ getInvoiceType()
|
|
|
+ getProjectData()
|
|
|
})
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
@@ -100,7 +104,49 @@ watch(() => [
|
|
|
console.log(otherInfo, 'otherInfo');
|
|
|
|
|
|
})
|
|
|
+//获取所有员工
|
|
|
+const userList=ref([])
|
|
|
+const getUserDict=async()=>{
|
|
|
+ const {error, code, data} = await getuserList({tenantId:useAppState.tenantId})
|
|
|
+ if (!error && code === 200) {
|
|
|
+ userList.value = getArrValue(data)
|
|
|
+
|
|
|
+ } else {
|
|
|
+ userList.value = []
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+//获取开票内容
|
|
|
+const invoiceContentList=ref([])
|
|
|
+const getInvoiceContentList=async()=>{
|
|
|
+ const {error, code, data} = await mainApi.getInvoiceContentList()
|
|
|
+ if (!error && code === 200) {
|
|
|
+ invoiceContentList.value = getArrValue(data)
|
|
|
|
|
|
+ } else {
|
|
|
+ invoiceContentList.value = []
|
|
|
|
|
|
+ }
|
|
|
+}
|
|
|
+//发票类型字典
|
|
|
+const getInvoiceType = async () => {
|
|
|
+ const {error, code, data} = await getDictInfo('invoice_type')
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ invoiceTypeData.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ invoiceTypeData.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
+//项目类型
|
|
|
+const getProjectData = async () => {
|
|
|
+ const {error, code, data} = await getProjectList()
|
|
|
+ //判断状态
|
|
|
+ if (!error && code === 200) {
|
|
|
+ projectType.value = getArrValue(data)
|
|
|
+ } else {
|
|
|
+ projectType.value = []
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang='scss' scoped></style>
|