更新发票申请

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

@ -14,14 +14,16 @@
</BasicForm>
</div>
<div class="ctn-box">
<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 :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 class="ctn-box" v-if="generationType == 'cabin'">
<div style="margin-bottom: 10px;">选择箱型</div>
<div class="list">
<div class="item" v-for="item in CtnList" :key="item.gid">
@ -51,7 +53,7 @@
import { ref, watch, onMounted } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { getAvailableCtnsBySlot, CreateBookingOrder, GetEnableProjectDictTreeList,CreateBookingAndSlot } from './api'
import { getAvailableCtnsBySlot, CreateBookingOrder, GetEnableProjectDictTreeList, CreateBookingAndSlot } from './api'
import { useMessage } from '/@/hooks/web/useMessage'
import { getOptions } from '/@/hooks/dict'
const { createMessage } = useMessage()
@ -91,12 +93,12 @@ const formSchema: FormSchema[] = [
},
componentProps: ({ formModel }) => {
return {
options:[
{label: '更新订舱', value: 'UPD_BOOKING' },
{label: '直接生成舱位和订舱', value: 'GEN_BOOKING_SLOT' },
{label: '只生成订舱', value: 'GEN_BOOKING' },
{label: '只生成舱位', value: 'GEN_SLOT' },
{label: '匹配已有订舱', value: 'GEN_EXIST_BOOKING' }
options: [
{ label: '更新订舱', value: 'UPD_BOOKING' },
{ label: '直接生成舱位和订舱', value: 'GEN_BOOKING_SLOT' },
{ label: '只生成订舱', value: 'GEN_BOOKING' },
{ label: '只生成舱位', value: 'GEN_SLOT' },
{ label: '匹配已有订舱', value: 'GEN_EXIST_BOOKING' }
]
}
},
@ -112,8 +114,8 @@ const formSchema: FormSchema[] = [
},
componentProps: ({ formModel }) => {
return {
options:[
{label: '是否直接发送邮件给订舱联系人', value: 'isDirectSend' },
options: [
{ label: '是否直接发送邮件给订舱联系人', value: 'isDirectSend' },
]
}
},
@ -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
@ -530,7 +536,7 @@ function cabinInit(row) {
}
//
function taskInit() {
setFieldsValue({generateMethod:'GEN_BOOKING'})
setFieldsValue({ generateMethod: 'GEN_BOOKING' })
}
function handleSave() {
if (generationType.value === 'cabin') {
@ -581,7 +587,7 @@ function handleSaveCabin() {
})
}
//
function handleSaveTask(){
function handleSaveTask() {
const projectArr = [] as any
projectList.value.forEach(item => {
if (item.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',
@ -54,4 +62,28 @@ export function InvoiceApplicationGetFees(parameter) {
method: 'post',
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">
<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>
<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">
<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
async function handleSave(){
const values = await validate()
const open = ref(false)
async function handleSave() {
const values = await validate()
const data = {
...values,
invoiceDetails: feeTableRef.value.list
}
InvoiceApplicationSave(data).then(res=>{
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)
}
function updateAmount(val){
const loading = ref(false)
function updateAmount(val) {
setFieldsValue({
invoiceAmount:val
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()
})
function init(){
setFieldsValue({
statusText:'未提交'
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{
<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