更新发票申请

szh-new
sunzehua 4 months ago
parent 42aa4ca14e
commit b5adb9da27

@ -14,12 +14,14 @@
</BasicForm>
</div>
<div class="ctn-box">
<a-spin :spinning="serverLoad">
<div style="margin-bottom: 10px;">服务项目</div>
<div class="project-list">
<div @click="handleClickPro(index)" :class="{ active: item.active }" class="project-item"
v-for="(item, index) in projectList" :key="index">{{
item.name }}</div>
</div>
</a-spin>
</div>
<div class="ctn-box" v-if="generationType == 'cabin'">
<div style="margin-bottom: 10px;">选择箱型</div>
@ -438,6 +440,7 @@ const [registerForm, { resetFields, setFieldsValue, getFieldsValue }] = useForm(
schemas: formSchema,
showActionButtonGroup: false,
})
const serverLoad = ref(false)
const generationType = ref('')
const taskId = ref('')
const [registerModal, { setModalProps, closeModal }] = useModalInner((data) => {
@ -451,9 +454,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner((data) => {
taskInit()
taskId.value = data.taskId
}
})
const projectList = ref([]) as any
onMounted(() => {
serverLoad.value = true
GetEnableProjectDictTreeList({ isAvoidCache: false }).then(res => {
if (res.success) {
if (res.data) {
@ -465,7 +466,12 @@ onMounted(() => {
} else {
createMessage.error(res.message)
}
serverLoad.value = false
})
})
const projectList = ref([]) as any
onMounted(() => {
})
function handleClickPro(index) {
projectList.value[index].active = !projectList.value[index].active
@ -658,6 +664,7 @@ function handleSaveTask(){
.project-list {
display: flex;
flex-wrap: wrap;
.project-item {
background-color: rgb(255, 255, 255);
color: rgb(37, 122, 250);

@ -31,6 +31,14 @@ export function GetInvoiceCodeList() {
})
}
export function InvoiceApplicationGet(parameter) {
return request({
url: '/feeApi/InvoiceApplication/Get',
method: 'get',
params:parameter
})
}
export function InvoiceApplicationSave(parameter) {
return request({
url: '/feeApi/InvoiceApplication/Save',
@ -55,3 +63,27 @@ export function InvoiceApplicationGetFees(parameter) {
data: parameter,
})
}
export function GetTemplateFields(parameter) {
return request({
url: '/feeApi/InvoiceApplication/GetTemplateFields',
method: 'get',
params:parameter
})
}
export function SaveTemplate(parameter) {
return request({
url: '/feeApi/InvoiceApplication/SaveTemplate',
method: 'post',
data: parameter,
})
}
export function GetTemplateList(parameter) {
return request({
url: '/feeApi/InvoiceApplication/GetTemplateList',
method: 'get',
params:parameter
})
}

@ -275,6 +275,12 @@ export const columns: BasicColumn[] = [
]
export const detailForm: FormSchema[] = [
{
field: 'id',
label: 'id',
component: 'Input',
show: false,
},
{
field: 'applicationNO',
label: '申请单号',
@ -388,7 +394,7 @@ export const detailForm: FormSchema[] = [
},
},
{
field: 'Category',
field: 'category',
label: '申请类型',
component: 'Select',
colProps: { span: 4 },
@ -428,8 +434,8 @@ export const detailForm: FormSchema[] = [
{
label: '委托单位',
field: 'customerId',
required: true,
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
@ -550,17 +556,13 @@ export const detailForm: FormSchema[] = [
},
{
field: 'note',
label: '备注',
label: '',
component: 'InputTextArea',
colProps: { span: 12 },
componentProps: () => {
return {
autoSize: { minRows: 4, maxRows: 7 }
}
},
slot: 'note',
},
{
field: 'note',
field: 'invoiceRemark',
label: '开票要求',
component: 'InputTextArea',
colProps: { span: 12 },

@ -42,7 +42,7 @@
添加
</a-button>
</div>
<a-table rowKey="feeId" :row-selection="{ selectedRowKeys: selectedRowKeysDetial, onChange: onSelectChangeDetail }"
<a-table rowKey="recordId" :row-selection="{ selectedRowKeys: selectedRowKeysDetial, onChange: onSelectChangeDetail }"
:loading="loading" :columns="columns" :data-source="dataSource" bordered>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'applyAmount'">
@ -196,22 +196,23 @@ function onSelectChange(selectedRowKeys) {
})
})
}
const emits = defineEmits(['updateList'])
function handleAddDetial() {
const arr = [] as any
dataSource.value.forEach(item=>{
selectedRowKeysDetial.value.forEach(ite=>{
if(item.feeId == ite){
if(item.recordId == ite){
arr.push(item)
}
})
})
const data = {
details:arr
}
InvoiceApplicationSave(data).then(res=>{
arr.forEach(item=>{
item.originalCurrency = item.currency
item.originalAmount = item.applyAmount
item.originalProcessedAmount = item.processedAmount ? item.processedAmount : 0
})
emits('updateList', arr)
}
const selectedRowKeysDetial = ref([]) as any
function onSelectChangeDetail(selectedRowKeys) {

@ -54,7 +54,7 @@
</span>
</div>
</div>
<InvoiceDetails ref="InvoiceDetailsRef"></InvoiceDetails>
<InvoiceDetails @updateList="updateList" ref="InvoiceDetailsRef"></InvoiceDetails>
</a-spin>
</template>
<script lang="ts" setup>
@ -112,7 +112,10 @@ const props = defineProps({
default: '300'
}
})
const emits = defineEmits(['updateAmount'])
const emits = defineEmits(['updateAmount','updateListSave'])
function updateList(val){
emits('updateListSave',val)
}
//
const feeDict = ref([])
//

@ -1,53 +1,180 @@
<template>
<div class="main">
<a-spin :spinning="loading">
<div>
<a-button type="link" @click="handleSave"> <i class="iconfont icon-zhcc_tidan"></i>保存</a-button>
<a-button type="link"><i class="iconfont icon-return"></i>撤销审核</a-button>
</div>
<BasicForm @register="registerForm" />
<feeTable @updateAmount="updateAmount" ref="feeTableRef"></feeTable>
<BasicForm @register="registerForm">
<template #note="{ model, field }">
<div style="display: flex;align-items: center;height: 22px;line-height: 22px;">
备注:
<a-button @click="openTempName" style="margin: 0 15px 0 20px;" type="link"> <i class="icon-a-17Btuichu iconfont"></i>
提取备注</a-button>
<a-button type="link" @click="openTemp"><i class="icon-jichupeizhi iconfont"></i>模板设置</a-button>
</div>
<a-textarea v-model:value="model[field]" :auto-size="{ minRows: 4, maxRows: 7 }" />
</template>
</BasicForm>
<feeTable @updateListSave=updateListSave @updateAmount="updateAmount" ref="feeTableRef"></feeTable>
<a-modal @cancel="open = false" width="700px" :visible="open" title="模板设置" @ok="handleSaveTemp">
<div style="display: flex;">
<div class="label-list">
<div class="label-item" @click="handleAddLabel(item)" v-for="item in labelList"
:key="item.fieldName">{{
item.displayName }}
</div>
</div>
<div style="width: 80%;margin-left: 10px">
<a-textarea style="height: 90%;" v-model:value="tempContent" />
<div style="margin-top: 15px;">
<span>发票备注模板</span>
<el-autocomplete v-model="tempName" style="width: 81%;margin-left: 10px;"
:fetch-suggestions="querySearch" clearable @select="handleSelect" />
</div>
</div>
</div>
</a-modal>
</a-spin>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, unref } from 'vue'
import { BasicForm, useForm } from '/@/components/Form/index'
import { AutoComplete } from 'ant-design-vue'
import { detailForm } from '../columns'
import feeTable from './feeTable.vue';
import { InvoiceApplicationSave } from '../api'
import { InvoiceApplicationSave, InvoiceApplicationGet, GetTemplateFields, SaveTemplate, GetTemplateList } from '../api'
import { useMessage } from '/@/hooks/web/useMessage'
import { useRoute } from 'vue-router'
const route = useRoute()
const { createMessage } = useMessage()
const id = ref(route.query.id)
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
labelWidth: 100,
schemas: detailForm,
showActionButtonGroup: false,
})
const feeTableRef = ref(null) as any
const open = ref(false)
async function handleSave() {
const values = await validate()
const data = {
...values,
invoiceDetails: feeTableRef.value.list
}
loading.value = true
InvoiceApplicationSave(data).then(res => {
if (res.succeeded) {
createMessage.success('保存成功')
} else {
createMessage.error(res.message)
}
loading.value = false
}).catch(err => {
loading.value = false
})
console.log(feeTableRef.value.list)
}
const loading = ref(false)
function updateAmount(val) {
setFieldsValue({
invoiceAmount: val
})
}
const tempContent = ref('')
function handleSaveTemp() {
const data = {
name: tempName.value,
content: tempContent.value,
id: ''
}
if (tempId.value) {
data.id = tempId.value
}
SaveTemplate([data]).then(res => {
if (res.succeeded) {
createMessage.success('保存成功')
GetTemplateList().then(res => {
tempList.value = res.data
tempList.value.forEach(item => {
item.value = item.name
})
})
} else {
createMessage.error(res.message)
}
})
}
onMounted(() => {
init()
})
const labelList = ref([]) as any
const tempList = ref([]) as any
function openTemp() {
open.value = true
GetTemplateFields().then(res => {
labelList.value = res.data
})
GetTemplateList().then(res => {
tempList.value = res.data
tempList.value.forEach(item => {
item.value = item.name
})
})
}
function init() {
if (id.value) {
getDetail()
} else {
setFieldsValue({
statusText: '未提交'
})
}
}
function handleAddLabel(val) {
tempContent.value += '[' + val.displayName + ']'
}
function getDetail() {
InvoiceApplicationGet({ id: id.value }).then(res => {
if (res.succeeded) {
setFieldsValue(res.data)
}
})
}
function openTempName(){
}
function updateListSave() {
}
const tempName = ref('')
const tempId = ref('')
const querySearch = (queryString: string, cb: any) => {
cb(tempList.value)
}
function handleSelect(value) {
tempId.value = value.id
tempContent.value = value.content
}
</script>
<style lang="less" scoped>
.main {
padding: 20px;
padding-top: 5px;
}
/deep/ .ant-btn-link {
padding: 0px !important;
}
.label-list {
max-height: 400px;
width: 20%;
overflow-y: scroll;
.label-item {
margin-bottom: 5px;
cursor: pointer;
}
}
</style>

@ -8,12 +8,18 @@
<p>
<i class="icon-PC_gangkou iconfont"
style="color: red;margin-right: 10px;font-size: 16px"></i>
截止时间变更通知({{ taskData.carrier }})
截止时间变更通知({{ carrier }})
</p>
<p>时间{{ taskData.createTime }}</p>
<p>时间{{ createTime }}</p>
</div>
<a-table :pagination="false" size="small" :scroll="{ x: 1500, y: 300 }" :columns="columns"
:data-source="taskData" bordered>
<template #bodyCell="{ column, record }">
<span v-if="column.key === 'bookingId'">
<div v-if="record.bookingId > 0" class="point"></div>
<div v-if="record.bookingId == 0">-</div>
</span>
</template>
</a-table>
</div>
</div>
@ -31,6 +37,8 @@ import taskButton from '../components/taskButton.vue'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
const route = useRoute()
const carrier = ref('')
const createTime = ref('')
const spinning = ref(false)
const taskData = ref([]) as any
const taskPKId = ref(route.query.taskPKId)
@ -48,14 +56,14 @@ const columns = [
{
title: '船名/航次',
dataIndex: 'vessel',
width: 100,
width: 150,
key: 'vessel',
align: 'center',
},
{
title: '样单截止时间',
dataIndex: 'siCutDateTxt',
width: 100,
width: 150,
key: 'siCutDateTxt',
align: 'center'
},
@ -70,7 +78,7 @@ const columns = [
title: '截港时间',
dataIndex: 'cyCutoffTimeTxt',
key: 'cyCutoffTimeTxt',
width: 100,
width: 150,
align: 'center'
},
{
@ -88,7 +96,7 @@ const columns = [
{
title: 'VGM截止时间',
dataIndex: 'vgmCutoffTimeTxt',
width: 100,
width: 150,
key: 'vgmCutoffTimeTxt',
align: 'center'
},
@ -115,8 +123,16 @@ const columns = [
]
function getInfo() {
spinning.value = true
CutDateGetInfoByTaskId({ taskPKId: taskPKId.value }).then(res => {
if (res.succeeded) {
taskData.value = res.data
carrier.value = res.data[0].carrier
createTime.value = res.data[0].noticeDate
} else {
createMessage.error(res.message)
}
spinning.value = false
})
}
@ -130,4 +146,11 @@ function loadingStop() {
</script>
<style lang="less" scoped>
@import url('./taskStyle.less');
.point {
height: 10px;
width: 10px;
border-radius: 50%;
margin: 0 auto;
background: green;
}
</style>

@ -158,6 +158,11 @@ function getInfoBasic(){
if (res.succeeded) {
if (res.data.length > 0) {
const arr = JSON.parse(res.data[0].content)
basicList.value.forEach((item,index) => {
arr[index].title = item.title
arr[index].width = item.width
arr[index].dataIndex = item.dataIndex
})
basicList.value = arr
} else {
basicList.value.forEach(item => {

Loading…
Cancel
Save