费用申请

szh-new
lijingjia 5 months ago
commit cf472fece1

@ -16,7 +16,8 @@ enum Api {
Withdraw = '/feeApi/FeeRecord/Withdraw',
ApplyModification = '/feeApi/FeeRecord/ApplyModification',
ApplyDeletion = '/feeApi/FeeRecord/ApplyDeletion',
GetPrintInfo = '/feeApi/FeeRecord/GetPrintInfo'
GetPrintInfo = '/feeApi/FeeRecord/GetPrintInfo',
GetFees = '/feeApi/PaymentApplication/GetFees'
}
// 列表 (Auth)
export function GetList(data: PageRequest) {
@ -105,3 +106,11 @@ export function ApplyDeletion(data: PageRequest) {
data
})
}
// 根据业务编号及类型获取关联费用记录 (Auth)
export function GetFees(data: PageRequest) {
return request<DataResult>({
url: Api.GetFees,
method: 'post',
data
})
}

@ -60,4 +60,74 @@ export const feeColumns = [
width: 230,
dataIndex: 'feeEnName'
}
]
// 费用申请的费用列
export const feeApplyColumns = [
{
title: '客户名称',
width: 150,
dataIndex: 'customerName'
}, {
title: '收付',
width: 80,
dataIndex: 'feeType',
customRender: ({ record }) => {
if (record.feeType == 1) {
return "收款"
} else if (record.feeType == 2) {
return "付款"
} else {
return '-'
}
}
}, {
title: '费用名称',
width: 150,
dataIndex: 'feeName'
}, {
title: '金额',
width: 100,
dataIndex: 'amount'
}, {
title: '币别',
width: 100,
dataIndex: 'currency'
}, {
title: '未结金额',
width: 100,
dataIndex: 'restAmount'
}, {
title: '本次申请金额',
width: 130,
dataIndex: 'applyAmount'
}, {
title: '原始汇率',
width: 100,
dataIndex: 'originalRate'
}, {
title: '开票金额',
width: 100,
dataIndex: 'invoiceAmount'
}, {
title: '备注',
width: 150,
dataIndex: 'remark'
}, {
title: '所属分部',
width: 120,
dataIndex: 'saleDeptName'
}, {
title: '录入人',
width: 120,
dataIndex: 'createByName'
}, {
title: '进项/销项税率',
width: 130,
dataIndex: 'taxRate'
}, {
title: '录入方式',
width: 120,
dataIndex: 'inputMethod'
},
]

@ -10,11 +10,23 @@
:row-selection="{ selectedRowKeys: state.infoRowKeys, onChange: infoChange }"
rowKey="id"
:scroll="{ x: '100%', y: 300 }"
:columns="feeColumns"
:columns="nowFeeColumns"
:data-source="feeData"
:pagination="false"
:customRow="onRowClick"
/>
>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'applyAmount'">
<a-input-number
v-model:value="record.applyAmount"
@change="amountChange($event, record)"
:min="0"
:step="0.000001"
string-mode
/>
</template>
</template>
</a-table>
<!-- 费用申请显示币别合计 -->
<div v-if="page == 'apply'">
选中金额<span v-for="(value, key) in currencyList" class="ml10" :key="value">{{ key }}: {{ value }}</span>
@ -24,23 +36,25 @@
<script lang="ts" setup>
import { ref, reactive, defineExpose, watch } from 'vue'
//
import { feeColumns } from './feeColumns'
import { feeColumns, feeApplyColumns } from './feeColumns'
import { feeStatusList } from '../columns'
// id
import { GetList } from '../api'
import { GetList, GetFees } from '../api'
// id
import { GetFeeTemplateDetailList } from '/@/views/fee/template/api'
import { number } from 'vue-types'
//
const state = reactive({
infoRowKeys: []
})
const nowFeeColumns = ref([])
//
const list = ref([])
//
const selectfeeData = ref([])
const loading = ref(false)
// id
const getFeeListByTem = (id) => {
const getFeeListByTem = async (id) => {
const postData = {
pageCondition: {
pageIndex: 1,
@ -52,7 +66,7 @@
])
}
loading.value = true
GetFeeTemplateDetailList(postData).then(res => {
await GetFeeTemplateDetailList(postData).then(res => {
loading.value = false
const { data } = res
data.forEach((item, index) => {
@ -64,8 +78,32 @@
}).catch(() => {
})
}
//
const amountChange = (e, row) => {
row.amount = Number(e * row.originalRate).toFixed(6)
}
// (Auth)
const getFees = async (id, businessType) => {
const postData = [{
id,
businessType
}]
loading.value = true
await GetFees(postData).then(res => {
const { data } = res
loading.value = false
data.items.forEach((item, index) => {
item['feeStatusText'] = feeStatusList[item.feeStatus]
item['id'] = item.recordId
if (item.createTime) item.createTime = item.createTime.split(' ')[0]
if (item.auditDate) item.auditDate = item.auditDate.split(' ')[0]
})
feeData.value = data.items
}).catch(() => {
})
}
// id
const getFeeList = (id) => {
const getFeeList = async (id) => {
const postData = {
pageCondition: {
pageIndex: 1,
@ -78,7 +116,7 @@
])
}
loading.value = true
GetList(postData).then(res => {
await GetList(postData).then(res => {
const { data } = res
loading.value = false
data.forEach((item, index) => {
@ -94,7 +132,6 @@
const feeData = ref([])
//
const infoChange = (v) => {
console.log(v)
state.infoRowKeys = v
list.value = []
currencyList = {}
@ -120,18 +157,28 @@
})
}
const page = ref()
const init = (ids, source) => {
const init = async (ids, source, businessType) => {
page.value = source
if (ids.length) {
if (ids[0] == undefined) {
nowFeeColumns.value = feeColumns
feeData.value = []
return
}
if (source == 'history' || source == 'apply') {
getFeeList(ids[0])
if (source == 'history') {
nowFeeColumns.value = feeColumns
await getFeeList(ids[0])
return feeData.value
}
if (source == 'tem') {
getFeeListByTem(ids[0])
nowFeeColumns.value = feeColumns
await getFeeListByTem(ids[0])
return feeData.value
}
if (source == 'apply') {
nowFeeColumns.value = feeApplyColumns
await getFees(ids[0], businessType)
return feeData.value
}
}
}
@ -175,12 +222,6 @@
}
}
}
watch(
() => selectfeeData.value,
(v) => {
console.log(v)
}
)
defineExpose({
list,
feeData,
@ -191,7 +232,7 @@
<style lang="scss">
.ds-fee-table {
padding: 0 20px;
padding: 0;
.ant-table-cell {
padding: 5px 12px;
}

@ -146,6 +146,9 @@
//
const openFileModel = () => {
if (!props.id) {
return createMessage.warning('未检索到业务id请先保存数据')
}
init()
}
const fileForm = ref(null)

@ -19,6 +19,7 @@ import {
GetServiceSelectList,
GetPackageSelectList,
GetTruckClientList,
GetDispatcherList,
} from '/@/views/operation/seaexport/api/BookingLedger'
import { getList } from '/@/views/flowcenter/flowInstances/api'
import { GetFeeCurrencySelectList, GetClientListByCode } from '/@/api/common/index'
@ -138,4 +139,10 @@ export default {
return res.data
})
},
//派车调度人员
GetDispatcherList: () => {
return GetDispatcherList().then((res) => {
return res.data
})
}
}

@ -48,6 +48,8 @@ export const useOptionsStore = defineStore({
GetClientListByCode: null,
// 银行信息
getClientBankList: null,
// 派车调度人员
GetDispatcherList:null
}),
getters: {
// 通过code获取下拉字典code)就是接口尾部单词

@ -10,7 +10,9 @@ enum Api {
list = '/feeApi/PaymentApplication/GetList',
edit = '/feeApi/FeeCurrency/EditFeeCurrency',
info = '/feeApi/FeeCurrency/GetFeeCurrencyInfo',
GetBizList = '/feeApi/PaymentApplication/GetBizList'
GetBizList = '/feeApi/PaymentApplication/GetBizList',
Save = '/feeApi/PaymentApplication/Save',
Get = '/feeApi/PaymentApplication//Get'
}
// 列表 (Auth)
export function GetList(data: PageRequest) {
@ -44,3 +46,19 @@ export function GetBizList(data: PageRequest) {
data
})
}
// 提交申请单
export function Save(data: PageRequest) {
return request<DataResult>({
url: Api.Save,
method: 'post',
data
})
}
// 获取申请单详情
export function Get(query) {
return request<DataResult>({
url: Api.Get,
method: 'get',
params: query
})
}

@ -15,13 +15,13 @@ export const businessColumns: BasicColumn[] = [
{
title: '委托编号',
dataIndex: 'customerNo',
width: 150,
width: 120,
align: 'left'
},
{
title: '主提单号',
dataIndex: 'mblno',
width: 150,
width: 120,
align: 'left'
},
{
@ -29,6 +29,162 @@ export const businessColumns: BasicColumn[] = [
dataIndex: 'customerName',
width: 150,
align: 'left'
},
{
title: 'RMB未付',
dataIndex: 'unpaidRMB',
width: 120,
align: 'left'
},
{
title: 'USD未付',
dataIndex: 'unpaidUSD',
width: 120,
align: 'left'
},
{
title: '其他未付',
dataIndex: 'unpaidOther',
width: 120,
align: 'left'
},
{
title: 'RMB未收',
dataIndex: 'unpaidOther',
width: 120,
align: 'left'
},
{
title: 'USD未收',
dataIndex: 'unpaidOther',
width: 120,
align: 'left'
},
{
title: '其他未收',
dataIndex: 'unpaidOther',
width: 120,
align: 'left'
},
{
title: '订舱编号',
dataIndex: 'unpaidOther',
width: 120,
align: 'left'
},
{
title: 'RMB付未开票',
dataIndex: 'unBilledRMB',
width: 120,
align: 'left'
},
{
title: 'USD付未开票',
dataIndex: 'unBilledUSD',
width: 120,
align: 'left'
},
{
title: '合计未收',
dataIndex: 'unreceivedTotal',
width: 120,
align: 'left'
},
{
title: '业务类别',
dataIndex: 'businessType',
width: 120,
align: 'left'
},
{
title: '分提单号',
dataIndex: 'hblno',
width: 120,
align: 'left'
},
{/////////////
title: '委托单位',
dataIndex: 'unreceivedTotal',
width: 120,
align: 'left'
},
{
title: '开船日期',
dataIndex: 'etd',
width: 120,
align: 'left'
},
{
title: '揽货人',
dataIndex: 'saleName',
width: 120,
align: 'left'
},
{
title: '更改单',
dataIndex: 'changeOrder',
width: 120,
align: 'left'
},
{/////////////
title: '会计日期',
dataIndex: 'changeOrder',
width: 120,
align: 'left'
},
{
title: '操作',
dataIndex: 'operator',
width: 120,
align: 'left'
},
{
title: '集装箱',
dataIndex: 'cntrTotal',
width: 120,
align: 'left'
},
{////////////////
title: 'RMB收费状态',
dataIndex: 'cntrTotal',
width: 120,
align: 'left'
},
{//////////////////
title: 'USD收费状态',
dataIndex: 'cntrTotal',
width: 120,
align: 'left'
},
{
title: '起运港',
dataIndex: 'loadPort',
width: 120,
align: 'left'
},
{
title: '卸货港',
dataIndex: 'dischargePort',
width: 120,
align: 'left'
},
{
title: '船名',
dataIndex: 'vessel',
width: 120,
align: 'left'
},
{
title: '航次',
dataIndex: 'voyage',
width: 120,
align: 'left'
},
{
title: '结费方式',
dataIndex: 'stlName',
width: 120,
align: 'left'
}
]
@ -37,7 +193,7 @@ export const formSchema: FormSchema[] = [
field: 'applicationNO',
label: '申请编号',
component: 'Input',
defaultValue: '自动生成',
dynamicDisabled: true,
colProps: { span: 3 },
// render: ({ model, field }) => {
// return h(resolveComponent('span') as ComponentOptions, {
@ -46,10 +202,10 @@ export const formSchema: FormSchema[] = [
// }
},
{
field: 'status',
field: 'statusText',
label: '状态',
component: 'Input',
defaultValue: '自动生成',
dynamicDisabled: true,
colProps: { span: 3 },
// render: ({ model, field }) => {
// return h(resolveComponent('span') as ComponentOptions, {
@ -123,7 +279,7 @@ export const formSchema: FormSchema[] = [
return {
option: optionsStore.getOptionsByCode('GetFeeCurrencySelectList'),
labelField: 'name',
valueField: 'id',
valueField: 'codeName',
resultField: 'data',
immediate: false,
filterOption: (input: string, option: any) => {
@ -201,24 +357,24 @@ export const formSchema: FormSchema[] = [
dynamicDisabled: false,
colProps: { span: 3 }
},
{
field: 'createBy',
label: '申请人',
component: 'Input',
dynamicDisabled: false,
colProps: { span: 3 }
},
{
field: 'createBy',
label: '计划结算其他',
component: 'Input',
dynamicDisabled: false,
colProps: { span: 3 }
},
// {
// field: 'createBy',
// label: '申请人',
// component: 'Input',
// dynamicDisabled: false,
// colProps: { span: 3 }
// },
// {
// field: 'createBy',
// label: '计划结算其他',
// component: 'Input',
// dynamicDisabled: false,
// colProps: { span: 3 }
// },
]
export const searchFormSchema: FormSchema[] = [
{
label: '费用对象',
label: '结算单位',
field: 'customerId',
component: 'ApiSelect',
dynamicDisabled: false,
@ -244,8 +400,8 @@ export const searchFormSchema: FormSchema[] = [
colProps: { span: 4 }
},
{
label: '提单号',
field: 'mblno',
label: '提单号',
field: 'hblno',
component: 'Input',
dynamicDisabled: false,
colProps: { span: 4 }

@ -10,27 +10,31 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="add"> </a-button>
<a-button type="link" @click="add"> </a-button>
</template>
</BasicTable>
</div>
</a-tab-pane>
<a-tab-pane key="3" tab="附件上传" force-render>
<DsFile
ref="dsFile"
:id='id'
/>
<div style="width: 400px;">
<DsFile
ref="dsFile"
:id='route?.query?.id'
/>
</div>
</a-tab-pane>
</a-tabs>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, defineEmits, defineProps, watch } from 'vue'
import { onMounted, ref, defineEmits, defineProps, watch, defineExpose } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { useMessage } from '/@/hooks/web/useMessage'
import { columns, searchFormSchema } from './applyInfoColumns'
//
import DsFile from "/@/components/File/index.vue"
import { useRoute } from 'vue-router'
const route = useRoute()
const { createMessage } = useMessage()
const emit = defineEmits(['add'])
const activeKey = ref('2')
@ -107,15 +111,15 @@
)
onMounted(() => {
//
// reload()
reload()
})
defineExpose({
reload
})
function handleSuccess() {
// reload()
}
</script>
<style lang="less">
.ds-pay-apply {
.ds-pay-apply-detail-fee-info {
.vben-basic-table-header__toolbar {
justify-content: space-between;
}

@ -4,10 +4,7 @@
* @Description:
-->
<template>
<div>
<data>
<a-button type="link" @click="addInfos"></a-button>
</data>
<div class="ds-bus-table">
<BasicTable
:canRowSelect="true"
:scroll="{ x: '100%', y: 188 }"
@ -16,9 +13,14 @@
@register="registerTable"
@row-click="onRowClick"
>
<template #toolbar>
<a-button type="link" @click="addInfos"></a-button>
</template>
</BasicTable>
<div class="info">
<h2 style="padding-left: 20px; font-weight: 600;">费用明细</h2>
<div>
<a-button @click="save" type="link">添加申请费用明细</a-button>
</div>
<feeTable
ref="feeTabel"
></feeTable>
@ -26,15 +28,30 @@
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, reactive, watch, defineExpose } from 'vue'
import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { GetBizList } from '../../api'
import { businessColumns, searchFormSchema } from '../columns'
import feeTable from '/@/components/CostEntry/components/feeTable.vue'
const [registerTable, { reload, getForm, getPaginationRef }] = useTable({
//
import { useMessage } from '/@/hooks/web/useMessage'
const emit = defineEmits(['save'])
const { createMessage } = useMessage()
const props = defineProps({
//
formData: {
type: Object
},
//
setFieldsValue: {
type: Function
}
})
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows, setSelectedRows }] = useTable({
api: async (p) => {
const res = await GetBizList(p)
if (res?.data?.length) state.historyRowKeys = [res.data[0].id]
setSelectedRows([res.data[0]])
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
@ -102,29 +119,105 @@
canResize: false,
immediate: false
})
//
const visible = ref(false)
//
const state = reactive({
historyRowKeys: []
})
// 2
const findDifferentElements = (arr1, arr2) => {
return [
...arr1.filter(item => !arr2.includes(item)),
...arr2.filter(item => !arr1.includes(item))
]
}
// id
const allFeeData = {}
const feeTabel = ref(null)
const historyChange = (v) => {
const historyChange = async (v) => {
state.historyRowKeys = v
}
//
const onRowClick = (record) => {
state.historyRowKeys = [record?.id]
setSelectedRows([record])
}
const feeData = () => {
return feeTabel.value.selectfeeData
}
//
const save = () => {
const data = feeTabel.value.selectfeeData
emit('save', data)
}
const addInfos = () => {
const selectRows = getSelectRows()
console.log(selectRows)
// console.log(props.formData.currency)
return
if (props.formData.customerId) {
let flag = false
selectRows.forEach(item => {
if (item.customerId == props.formData.customerId) {
flag = true
}
})
if (!flag) {
return createMessage.warning('没有选择要添加的业务!')
}
selectRows
} else {
if (state.historyRowKeys.length == 0 ) {
return createMessage.warning('没有选择要添加的业务!')
}
}
console.log(allFeeData)
//
let feeList = []
for(var key in allFeeData) {
feeList = [...feeList, ...allFeeData[key]]
}
console.log(props.formData)
feeList.forEach(item => {
if (props.formData.currency && props.formData.currency != item.currency) {
}
})
}
watch(() => state.historyRowKeys, (v) => {
if (v.length == 1) feeTabel.value.init(v, 'apply')
watch(
() => state.historyRowKeys, (v, old) => {
// id
const diffIds = findDifferentElements(v, old)
const rows = getSelectRows()
if (v.length > old.length) {
//
diffIds.forEach(item => {
//
let btype = rows.filter(row => {
return item == row.id
})
btype = btype[0]?.businessType
feeTabel.value.init([item], 'apply', btype).then(res => {
allFeeData[item] = res
})
})
} else if (v.length < old.length) {
//
diffIds.forEach(item => {
delete allFeeData[item]
})
if (v.length) {
//
let btype = rows[0].businessType
feeTabel.value.init([v[v.length - 1]], 'apply', btype)
}
} else {
//
let btype = rows[0].businessType
feeTabel.value.init(v, 'apply', btype)
}
})
onMounted(() => {
//
reload()
@ -133,4 +226,18 @@
feeData
})
</script>
<style lang="less">
.ds-bus-table {
.vben-basic-table-header__toolbar {
justify-content: space-between;
}
.vben-basic-table {
padding: 0;
}
.ant-form {
margin-bottom: 0;
padding-bottom: 0;
}
}
</style>

@ -5,30 +5,39 @@
-->
<template>
<div class="ds-pay-apply-detail ds-detail-box">
<div>
<a-button @click="save"></a-button>
</div>
<!-- 表单区域 -->
<BasicForm @register="registerForm" />
<!-- 申请明细 -->
<div>
<ApplyInfo
@add="add"
:feeData="feeData"
></ApplyInfo>
</div>
<a-spin :spinning="dloading">
<div>
<a-button @click="save"></a-button>
</div>
<!-- 表单区域 -->
<div class="form-area">
<BasicForm @register="registerForm" />
</div>
<!-- 申请明细 -->
<div>
<ApplyInfo
ref="applyInfo"
@add="add"
:feeData="feeData"
></ApplyInfo>
</div>
</a-spin>
<a-modal
class="fee-modal"
v-model:visible="visible"
title="添加支付结算明细"
width="90%"
okText="添加申请费用明细"
@ok="handleOk"
>
<!-- 业务表格 -->
<BusinessTable
ref="busTable"
></BusinessTable>
<a-spin :spinning="loading">
<!-- 业务表格 -->
<BusinessTable
ref="busTable"
:formData="getFieldsValue()"
:setFieldsValue="setFieldsValue"
@save="save"
></BusinessTable>
</a-spin>
</a-modal>
</div>
</template>
@ -41,13 +50,20 @@
//
import BusinessTable from './components/businessTable.vue'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
const route = useRoute()
const visible = ref(false)
import { formSchema } from './columns'
const [registerForm, { validate }] = useForm({
import { Save, Get } from '../api'
const [registerForm, { validate, getFieldsValue, setFieldsValue }] = useForm({
labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false
})
// loading
const loading = ref(false)
// loading
const dloading = ref(false)
const busTable = ref(null)
const feeData = ref([])
const handleOk = () => {
@ -112,13 +128,34 @@
const add = () => {
visible.value = true
}
const applyInfo = ref(null)
//
const save = () => {
const save = async (feeInfo) => {
const postData = await validate()
postData['details'] = feeInfo
loading.value = true
Save(postData).then(res => {
console.log(res)
loading.value = false
applyInfo.value.reload()
})
}
//
const init = () => {
const id = route.query.id
if (id) {
dloading.value = true
Get({ id }).then(res => {
dloading.value = false
setFieldsValue(res.data)
feeData.value = res.data.details
})
}
}
onMounted(() => {
//
// reload()
init()
})
function handleSuccess() {
// reload()
@ -126,14 +163,17 @@
</script>
<style lang="less">
.ds-pay-apply {
.vben-basic-table-header__toolbar {
justify-content: space-between;
}
.form-area {
padding: 10px;
background: #ffffff;
}
.fee-modal {
.ant-modal-body {
padding-top: 0;
padding-top: 0 10px;
border-radius: 4px;
}
.ant-modal-footer {
display: none;
}
}
</style>

@ -5,7 +5,7 @@
-->
<template>
<div class="ds-pay-apply">
<BasicTable @register="registerTable">
<BasicTable @register="registerTable" @row-dbClick="edit">
<template #toolbar>
<TableActionBar :selectRow="getSelectRows" :reload="reload"></TableActionBar>
</template>
@ -34,6 +34,8 @@
const { createMessage } = useMessage()
import { GetList } from './api'
import { columns, searchFormSchema, FeeStatus } from './columns'
import { useGo } from '/@/hooks/web/usePage'
const go = useGo()
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({
title: '',
api: async (p) => {
@ -93,6 +95,10 @@
navigator.clipboard.writeText(v)
createMessage.success("复制成功")
}
//
const edit = (row) => {
go(`/paid-apply/create?id=${row.id}`)
}
onMounted(() => {
//
reload()

@ -404,6 +404,14 @@ export function GetSaleList(parameter) {
params: parameter,
})
}
// 获取派车调度人员列表 (Auth)
export function GetDispatcherList(parameter) {
return request({
url: '/mainApi/ClientCommon/GetDispatcherList',
method: 'get',
params: parameter,
})
}
/**
* 分页查询订舱主表
* @params PageSize

@ -6,6 +6,7 @@ import { useComponentRegister } from '/@/components/Form'
useComponentRegister('Space', Space)
const optionsStore = useOptionsStore()
import { getOptions } from '/@/hooks/dict'
import { getDictOption } from '/@/utils/dictUtil'
export const columns: BasicColumn[] = [
{
title: '车队名称',
@ -427,10 +428,20 @@ export const formSchema: FormSchema[] = [
{
label: '结算方式',
field: 'payType',
component: 'Select',
defaultValue: '',
colProps: {
span: 6,
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: ({ formModel }) => {
return {
immediate: false,
option: optionsStore.getOptionsByCode('GetClientStlModeSelectList'),
labelField: 'stlName',
valueField: 'id',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
@ -605,12 +616,29 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '派车状态',
field: 'truckStatus',
component: 'Select',
defaultValue: '',
colProps: {
span: 6,
label: '派车状态',
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: () => {
return {
allowClear: true,
showSearch: true,
api: () => {
return new Promise((resolve) => {
getDictOption('truck_status').then((res) => {
resolve(res)
})
})
},
labelField: 'label',
valueField: 'value',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
}
},
},
{
@ -769,12 +797,31 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '调度人员名称',
field: 'dispatcherId',
component: 'Select',
label: '调度人员名称',
component: 'ApiSelect',
defaultValue: '',
colProps: {
span: 6,
colProps: { span: 6 },
componentProps: ({ formModel }) => {
return {
// style: 'width:100%',
allowClear: true,
showSearch: true,
option: optionsStore.getOptionsByCode('GetDispatcherList'),
labelField: 'userName',
valueField: 'id',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
onChange: (e, obj) => {
if (obj) {
console.log(obj)
formModel.dispatcherName = obj.userName
} else {
formModel.dispatcherName = ''
}
},
}
},
},
{

@ -0,0 +1,181 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
title="派车信息"
width="70%"
@register="registerModal"
>
<BasicTable @register="registerOpBusinessTruckTable">
<template #tableTitle>
<div class="buttonGroup">
<div class="nav" @click="AddOpBusinessTruck">
<i class="iconfont icon-jiahao2fill"></i>新增
</div>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<div class="nav"> <i class="iconfont icon-shanchu"></i>删除 </div>
</a-popconfirm>
</div>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: FnEditOpBusinessTruck.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<OpBusinessTruckEdit
:business-id="businessId"
@register="registerOpBusinessTruckModal"
@success="handleSuccess"
/>
<!--右下角按钮-->
<template #footer>
<span></span>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { columns, searchFormSchema } from './OpBusinessTruckColumns'
import { BasicModal, useModalInner, useModal } from '/@/components/Modal'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { GetOpBusinessTruckList, BatchDelOpBusinessTruck } from './LetterApi'
import OpBusinessTruckEdit from './OpBusinessTruckEdit.vue'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
// Emits
const emit = defineEmits(['success', 'register'])
const businessId = ref()
const [registerModal] = useModalInner(async (data) => {
businessId.value = data.id
})
const [registerOpBusinessTruckTable, { reload, getForm, getPaginationRef, getSelectRows }] =
useTable({
api: async (p) => {
const res: API.DataResult = await GetOpBusinessTruckList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
resizeHeightOffset: 200,
beforeFetch: () => {
var currentPageInfo: any = getPaginationRef()
var data = getForm().getFieldsValue()
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: currentPageInfo.current,
pageSize: currentPageInfo.pageSize,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
condition.push({
FieldName: 'businessId',
FieldValue: businessId.value,
ConditionalType: 1,
})
if (!!data.toName) {
condition.push({
FieldName: 'toName',
FieldValue: data.toName,
ConditionalType: 1,
})
}
if (!!data.toAttn) {
condition.push({
FieldName: 'toAttn',
FieldValue: data.toAttn,
ConditionalType: 1,
})
}
if (!!data.fromName) {
condition.push({
FieldName: 'fromName',
FieldValue: data.fromName,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
return postParam
},
columns,
formConfig: {
labelWidth: 160,
schemas: searchFormSchema,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
fixed: 'left',
},
canResize: true,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
},
rowSelection: { type: 'checkbox' },
})
const [registerOpBusinessTruckModal, { openModal }] = useModal()
function AddOpBusinessTruck() {
openModal(true, {
isParent: false,
isUpdate: false,
businessId: businessId.value,
})
}
//
function FnClickDel() {
if (getSelectRows().length) {
let Apidata: any = {
ids: [],
}
getSelectRows().forEach((item) => {
Apidata.ids.push(item.id)
})
BatchDelOpBusinessTruck(Apidata).then((res) => {
if (res.succeeded) {
notification.success({ message: '删除成功', duration: 3 })
handleSuccess()
}
})
} else {
notification.warning({ message: '请至少选择一条数据', duration: 3 })
}
}
function FnEditOpBusinessTruck(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
})
}
function handleSuccess() {
// businessId.value = 0
reload()
}
</script>
<style lang="less">
@import url('/@/styles/buttonGroup.scss');
</style>

@ -3,45 +3,38 @@
v-bind="$attrs"
:use-wrapper="true"
title="派车信息"
width="70%"
width="90%"
@register="registerModal"
>
<BasicTable @register="registerOpBusinessTruckTable">
<template #tableTitle>
<div class="buttonGroup">
<div class="nav" @click="AddOpBusinessTruck">
<i class="iconfont icon-jiahao2fill"></i>新增
</div>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<div class="nav"> <i class="iconfont icon-shanchu"></i>删除 </div>
</a-popconfirm>
</div>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: FnEditOpBusinessTruck.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<OpBusinessTruckEdit
:business-id="businessId"
@register="registerOpBusinessTruckModal"
@success="handleSuccess"
/>
<!--右下角按钮-->
<a-row>
<a-col :span="6">
<BasicTable @register="registerOpBusinessTruckTable">
<template #tableTitle>
<div class="buttonGroup">
<div class="nav" @click="FnClickAdd">
<i class="iconfont icon-jiahao2fill"></i>新建
</div>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<div class="nav"> <i class="iconfont icon-shanchu"></i>删除 </div>
</a-popconfirm>
</div>
</template>
</BasicTable>
</a-col>
<a-col :span="18" class="OPCol">
<OpBusinessTruckEdit
:business-id="businessId"
:select-id="selectId"
@success="handleSuccess"
/>
</a-col>
</a-row>
<template #footer>
<span></span>
</template>
@ -49,7 +42,7 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { columns, searchFormSchema } from './OpBusinessTruckColumns'
import { columns } from './OpBusinessYardColumns'
import { BasicModal, useModalInner, useModal } from '/@/components/Modal'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { GetOpBusinessTruckList, BatchDelOpBusinessTruck } from './LetterApi'
@ -59,93 +52,65 @@
// Emits
const emit = defineEmits(['success', 'register'])
const businessId = ref()
const [registerModal] = useModalInner(async (data) => {
const selectId = ref()
const [registerModal] = useModalInner((data) => {
businessId.value = data.id
})
const [registerOpBusinessTruckTable, { reload, getForm, getPaginationRef, getSelectRows }] =
useTable({
api: async (p) => {
const res: API.DataResult = await GetOpBusinessTruckList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
resizeHeightOffset: 200,
beforeFetch: () => {
var currentPageInfo: any = getPaginationRef()
var data = getForm().getFieldsValue()
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: currentPageInfo.current,
pageSize: currentPageInfo.pageSize,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
condition.push({
FieldName: 'businessId',
FieldValue: businessId.value,
ConditionalType: 1,
})
if (!!data.toName) {
condition.push({
FieldName: 'toName',
FieldValue: data.toName,
ConditionalType: 1,
})
}
if (!!data.toAttn) {
condition.push({
FieldName: 'toAttn',
FieldValue: data.toAttn,
ConditionalType: 1,
})
}
if (!!data.fromName) {
condition.push({
FieldName: 'fromName',
FieldValue: data.fromName,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
const [
registerOpBusinessTruckTable,
{ reload, setSelectedRowKeys, clearSelectedRowKeys, getSelectRows },
] = useTable({
api: async (p) => {
const res: API.DataResult = await GetOpBusinessTruckList(p)
setSelectedRowKeys([res.data[0].id])
selectId.value = res.data[0].id
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
resizeHeightOffset: 200,
beforeFetch: () => {
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: 1,
pageSize: 99999,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
condition.push({
FieldName: 'businessId',
FieldValue: businessId.value,
ConditionalType: 1,
})
postParam.queryCondition = JSON.stringify(condition)
return postParam
},
columns,
formConfig: {
labelWidth: 160,
schemas: searchFormSchema,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
fixed: 'left',
},
canResize: true,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
return postParam
},
rowKey: 'id',
columns,
isTreeTable: false,
pagination: false,
striped: true,
showTableSetting: false,
bordered: true,
showIndexColumn: false,
autoCreateKey: false,
indexColumnProps: {
fixed: 'left',
},
canResize: true,
clickToRowSelect: false,
rowSelection: {
type: 'radio',
onSelect: (e) => {
console.log(e)
selectId.value = e.id
},
rowSelection: { type: 'checkbox' },
})
},
})
const [registerOpBusinessTruckModal, { openModal }] = useModal()
function AddOpBusinessTruck() {
openModal(true, {
isParent: false,
isUpdate: false,
businessId: businessId.value,
})
}
//
function FnClickDel() {
if (getSelectRows().length) {
@ -165,17 +130,18 @@
notification.warning({ message: '请至少选择一条数据', duration: 3 })
}
}
function FnEditOpBusinessTruck(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
})
function FnClickAdd() {
clearSelectedRowKeys()
selectId.value = ''
}
function handleSuccess() {
// businessId.value = 0
reload()
async function handleSuccess() {
await reload()
}
</script>
<style lang="less">
@import url('/@/styles/buttonGroup.scss');
.OPCol {
height: 60vh;
overflow-y: auto;
}
</style>

@ -0,0 +1,362 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
width="60%"
@register="registerModal"
@ok="handleSave"
>
<BasicForm @register="registerForm" />
<div>
<div class="buttonGroup">
<div class="nav" @click="TableAdd"> <i class="iconfont icon-jiahao2fill"></i>新增明细 </div>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<div class="nav"> <i class="iconfont icon-shanchu"></i>删除明细 </div>
</a-popconfirm>
</div>
</div>
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table>
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>
</template>
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref, h } from 'vue'
import { BasicModal, useModalInner, useModal } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema, BankColumns } from './OpBusinessTruckColumns'
import { EditOpBusinessTruck, GetOpBusinessTruckInfo } from './LetterApi'
import { useMessage } from '/@/hooks/web/useMessage'
import {
GetCtnSelectList,
GetPackageSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger'
import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry'
registerAllModules()
import { propTypes } from '/@/utils/propTypes'
const props = defineProps({
businessId: propTypes.object,
})
init()
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const loading = ref(false)
const rowId = ref('')
const list = ref<any>([])
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id
const res: API.DataResult = await GetOpBusinessTruckInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增派车信息' : '编辑派车信息'))
async function handleSave(exit) {
try {
setModalProps({ confirmLoading: true, loading: true })
let ApiData: any = {
truckCtnList: [],
}
const values = await validate()
Object.keys(values).forEach((item) => {
if (item == 'businessId' && !values.businessId) {
ApiData.businessId = props.businessId
} else {
ApiData[item] = values[item]
}
})
ApiData.truckCtnList = list.value
const res: API.DataResult = await EditOpBusinessTruck(ApiData)
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
//
if (!exit) {
if (unref(isUpdate)) {
await refresh()
} else {
rowId.value = res.data
isUpdate.value = true
await refresh()
}
}
} else {
createMessage.error(res.message)
}
exit && closeModal()
} finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false })
}
}
async function refresh() {
const res: API.DataResult = await GetOpBusinessTruckInfo({ id: unref(rowId) })
if (res.succeeded) {
await setFieldsValue({
...res.data,
})
}
}
const ctnDict = ref()
const kindPkgsDict = ref()
async function init() {
await GetCtnSelectList().then((res) => {
ctnDict.value = res.data
})
await GetPackageSelectList().then((res) => {
kindPkgsDict.value = res.data
})
}
function TableAdd() {
list.value.push({ selected: false })
}
//
const columns = [
{
data: 'selected',
type: 'checkbox',
title: ' ',
width: 32,
className: 'htCenter',
readOnly: false,
},
{
title: '主键Id',
width: 80,
data: 'id',
},
{
title: '业务Id',
width: 80,
data: 'pid',
},
{
title: '箱型Id',
width: 80,
data: 'ctnId',
},
{
title: '箱型代码',
width: 80,
data: 'ctnCode',
},
{
title: '箱型',
width: 120,
data: 'ctn',
type: 'dropdown',
// (process)
source: async (query, process) => {
const res = ctnDict.value.length ? ctnDict.value : (await GetCtnSelectList())?.data
if (!ctnDict.value.length) ctnDict.value = res
const dict = res.map((res) => {
return res.ctnName
})
process(dict)
},
},
{
title: '尺寸',
width: 80,
data: 'size',
type: 'numeric',
format: '0',
},
{
title: '箱量',
width: 80,
data: 'ctnNum',
type: 'numeric',
format: '0',
},
{
title: 'TEU',
width: 80,
data: 'teu',
type: 'numeric',
format: '0',
},
{
title: '表现形式',
width: 80,
data: 'ctnAll',
},
{
title: '箱号',
width: 80,
data: 'cntrNo',
},
{
title: '封号',
width: 80,
data: 'sealNo',
},
{
title: '件数',
width: 80,
data: 'pkgs',
type: 'numeric',
format: '0',
},
{
title: '毛重',
width: 80,
data: 'kgs',
type: 'numeric',
format: '0',
},
{
title: '尺码',
width: 80,
data: 'cbm',
type: 'numeric',
format: '0',
},
{
title: '包装',
width: 80,
data: 'kindPkgs',
},
{
title: '包装',
width: 120,
data: 'kindPkgsName',
type: 'dropdown',
// (process)
source: async (query, process) => {
const res = kindPkgsDict.value.length
? kindPkgsDict.value
: (await GetPackageSelectList())?.data
if (!kindPkgsDict.value.length) {
kindPkgsDict.value.splice(0)
res.forEach((e) => {
kindPkgsDict.value.push(e)
})
}
const dict = res.map((res) => {
return res.packageName
})
process(dict)
},
},
]
//
const settings = {
height: '400',
width: '100%',
autoWrapRow: true,
autoWrapCol: true,
//
rowHeights: 32,
fixedColumnsLeft: 1,
//
hiddenColumns: {
columns: [1, 2, 3, 4, 15],
indicators: true,
},
//
enterMoves: 'row',
columnSorting: true,
//
// afterValidate: function (isValid, value, row, prop, source) {
// if (!isValid) {
// hotTb.value.hotInstance.setDataAtRowProp(row, prop, '')
// }
// },
columns: columns,
// ()
licenseKey: 'non-commercial-and-evaluation',
//
async afterChange(changes, source) {
//
if (source === 'edit' || source === 'Autofill.fill' || source === 'CopyPaste.paste') {
let dict: any = {}
if (changes[0][1] === 'ctn') {
const res = ctnDict.value.length ? ctnDict.value : (await GetCtnSelectList())?.data
if (!ctnDict.value.length) ctnDict.value = res
const item = res.filter((item) => {
return item.ctnName === changes[0][3]
})
if (item) dict = item[0]
console.log(dict)
list.value[changes[0][0]]['ctn'] = dict?.ctnName
list.value[changes[0][0]]['ctnCode'] = dict?.ediCode
list.value[changes[0][0]]['ctnId'] = dict?.id
}
if (changes[0][1] === 'kindPkgsName') {
const res = kindPkgsDict.value.length
? kindPkgsDict.value
: (await GetPackageSelectList())?.data
if (!kindPkgsDict.value.length) {
kindPkgsDict.value.splice(0)
res.forEach((e) => {
kindPkgsDict.value.push(e)
})
}
const item = res.filter((item) => {
return item.packageName === changes[0][3]
})
if (item) dict = item[0]
list.value[changes[0][0]]['kindPkgs'] = dict?.id
list.value[changes[0][0]]['kindPkgsName'] = dict?.packageName
}
}
},
}
</script>
<style lang="less">
@import url('/@/styles/buttonGroup.scss');
</style>

@ -1,12 +1,8 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
width="60%"
@register="registerModal"
@ok="handleSave"
>
<a-spin :spinning="spinning">
<div class="buttonGroup">
<div class="nav" @click="handleSave"> <i class="iconfont icon-jiahao2fill"></i>保存 </div>
</div>
<BasicForm @register="registerForm" />
<div>
<div class="buttonGroup">
@ -22,59 +18,66 @@
</div>
</div>
<hot-table ref="hotTb" :data="list" :settings="settings"></hot-table>
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>
</template>
</BasicModal>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, computed, unref, h } from 'vue'
import { BasicModal, useModalInner, useModal } from '/@/components/Modal'
import { ref, watch } from 'vue'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema, BankColumns } from './OpBusinessTruckColumns'
import { EditOpBusinessTruck, GetOpBusinessTruckInfo } from './LetterApi'
import { useMessage } from '/@/hooks/web/useMessage'
import { formSchema } from './OpBusinessTruckColumns'
import {
EditOpBusinessTruck,
GetOpBusinessTruckInfo,
GetTruckCtnList,
BatchDelTruckCtns,
} from './LetterApi'
import {
GetCtnSelectList,
GetPackageSelectList,
} from '/@/views/operation/seaexport/api/BookingLedger'
import { useMessage } from '/@/hooks/web/useMessage'
const { notification } = useMessage()
import { HotTable } from '@handsontable/vue3'
import { registerAllModules } from 'handsontable/registry'
registerAllModules()
import { propTypes } from '/@/utils/propTypes'
const props = defineProps({
businessId: propTypes.object,
selectId: propTypes.string,
})
const spinning = ref(false)
watch(
() => props.selectId,
async (nVal) => {
if (nVal) {
spinning.value = true
list.value.splice(0)
setFieldsValue({})
const res: API.DataResult = await GetOpBusinessTruckInfo({ id: nVal })
if (res.succeeded) {
let ApiData = {
queryCondition: `[{"FieldName":"pid","FieldValue":"${res.data.id}","ConditionalType":1}]`,
pageCondition: {
pageIndex: 1,
pageSize: 99999,
sortConditions: [],
},
}
await setFieldsValue({
...res.data,
})
GetTruckCtnList(ApiData).then((e) => {
list.value.push(...e.data)
spinning.value = false
})
}
} else {
resetFields()
}
},
)
init()
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const loading = ref(false)
const rowId = ref('')
const list = ref<any>([])
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
@ -83,71 +86,25 @@
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id
const res: API.DataResult = await GetOpBusinessTruckInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
async function handleSave() {
let ApiData: any = {
truckCtnList: [],
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增派车信息' : '编辑派车信息'))
async function handleSave(exit) {
try {
setModalProps({ confirmLoading: true, loading: true })
let ApiData: any = {
truckCtnList: [],
}
const values = await validate()
Object.keys(values).forEach((item) => {
if (item == 'businessId' && !values.businessId) {
ApiData.businessId = props.businessId
} else {
ApiData[item] = values[item]
}
})
ApiData.truckCtnList = list.value
const res: API.DataResult = await EditOpBusinessTruck(ApiData)
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
//
if (!exit) {
if (unref(isUpdate)) {
await refresh()
} else {
rowId.value = res.data
isUpdate.value = true
await refresh()
}
}
const values = await validate()
Object.keys(values).forEach((item) => {
if (item == 'businessId' && !values.businessId) {
ApiData.businessId = props.businessId
} else {
createMessage.error(res.message)
ApiData[item] = values[item]
}
exit && closeModal()
} finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false })
}
}
async function refresh() {
const res: API.DataResult = await GetOpBusinessTruckInfo({ id: unref(rowId) })
})
ApiData.truckCtnList = list.value
const res: API.DataResult = await EditOpBusinessTruck(ApiData)
if (res.succeeded) {
await setFieldsValue({
...res.data,
})
createMessage.success(res.message)
emit('success')
} else {
createMessage.error(res.message)
}
}
const ctnDict = ref()
@ -163,6 +120,41 @@
function TableAdd() {
list.value.push({ selected: false })
}
function FnClickDel() {
let ApiData = { ids: [] }
list.value.forEach((e, i) => {
if (e.selected) {
ApiData.ids.push(e.id)
}
})
BatchDelTruckCtns(ApiData).then(async (e) => {
spinning.value = true
list.value.splice(0)
setFieldsValue({})
const res: API.DataResult = await GetOpBusinessTruckInfo({ id: props.selectId })
if (res.succeeded) {
let ApiData = {
queryCondition: `[{"FieldName":"pid","FieldValue":"${res.data.id}","ConditionalType":1}]`,
pageCondition: {
pageIndex: 1,
pageSize: 99999,
sortConditions: [],
},
}
setFieldsValue({
...res.data,
})
GetTruckCtnList(ApiData).then((e) => {
list.value.push(...e.data)
spinning.value = false
})
}
notification.success({
message: e.message,
duration: 3,
})
})
}
//
const columns = [
{
@ -331,7 +323,6 @@
return item.ctnName === changes[0][3]
})
if (item) dict = item[0]
console.log(dict)
list.value[changes[0][0]]['ctn'] = dict?.ctnName
list.value[changes[0][0]]['ctnCode'] = dict?.ediCode
list.value[changes[0][0]]['ctnId'] = dict?.id
@ -357,6 +348,3 @@
},
}
</script>
<style lang="less">
@import url('/@/styles/buttonGroup.scss');
</style>

@ -209,26 +209,7 @@ export const columns: BasicColumn[] = [
},
]
export const searchFormSchema: FormSchema[] = [
{
field: 'toName',
label: 'TO',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'toAttn',
label: 'ATTN',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'fromName',
label: 'FROM',
component: 'Input',
colProps: { span: 4 },
},
]
export const formSchema: FormSchema[] = [
{
label: '主键Id',

@ -2,46 +2,39 @@
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
title="电放保函"
width="70%"
title="场站入货"
width="90%"
@register="registerModal"
>
<BasicTable @register="registerOpBusinessYardTable">
<template #tableTitle>
<div class="buttonGroup">
<div class="nav" @click="AddOpBusinessYard">
<i class="iconfont icon-jiahao2fill"></i>新增
</div>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<div class="nav"> <i class="iconfont icon-shanchu"></i>删除 </div>
</a-popconfirm>
</div>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{
icon: 'clarity:note-edit-line',
tooltip: '编辑',
onClick: FnEditOpBusinessYard.bind(null, record),
},
]"
/>
</template>
</template>
</BasicTable>
<OpBusinessYardEdit
:business-id="businessId"
@register="registerOpBusinessYardModal"
@success="handleSuccess"
/>
<!--右下角按钮-->
<a-row>
<a-col :span="6">
<BasicTable @register="registerOpBusinessYardTable">
<template #tableTitle>
<div class="buttonGroup">
<div class="nav" @click="FnClickAdd">
<i class="iconfont icon-jiahao2fill"></i>新建
</div>
<a-popconfirm
title="确定要删除所选数据?"
ok-text="确定"
cancel-text="取消"
@confirm="FnClickDel"
>
<div class="nav"> <i class="iconfont icon-shanchu"></i>删除 </div>
</a-popconfirm>
</div>
</template>
</BasicTable>
</a-col>
<a-col :span="18" class="OPCol">
<OpBusinessYardEdit
:business-id="businessId"
:select-id="selectId"
@success="handleSuccess"
/>
</a-col>
</a-row>
<template #footer>
<span></span>
</template>
@ -49,9 +42,9 @@
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { columns, searchFormSchema } from './OpBusinessYardColumns'
import { BasicModal, useModalInner, useModal } from '/@/components/Modal'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { columns } from './OpBusinessYardColumns'
import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicTable, useTable } from '/@/components/Table'
import { GetOpBusinessYardList, BatchDelOpBusinessYard } from './LetterApi'
import OpBusinessYardEdit from './OpBusinessYardEdit.vue'
import { useMessage } from '/@/hooks/web/useMessage'
@ -59,93 +52,63 @@
// Emits
const emit = defineEmits(['success', 'register'])
const businessId = ref()
const [registerModal] = useModalInner(async (data) => {
const selectId = ref()
const [registerModal] = useModalInner((data) => {
businessId.value = data.id
})
const [registerOpBusinessYardTable, { reload, getForm, getPaginationRef, getSelectRows }] =
useTable({
api: async (p) => {
const res: API.DataResult = await GetOpBusinessYardList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
resizeHeightOffset: 200,
beforeFetch: () => {
var currentPageInfo: any = getPaginationRef()
var data = getForm().getFieldsValue()
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: currentPageInfo.current,
pageSize: currentPageInfo.pageSize,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
condition.push({
FieldName: 'businessId',
FieldValue: businessId.value,
ConditionalType: 1,
})
if (!!data.toName) {
condition.push({
FieldName: 'toName',
FieldValue: data.toName,
ConditionalType: 1,
})
}
if (!!data.toAttn) {
condition.push({
FieldName: 'toAttn',
FieldValue: data.toAttn,
ConditionalType: 1,
})
}
if (!!data.fromName) {
condition.push({
FieldName: 'fromName',
FieldValue: data.fromName,
ConditionalType: 1,
})
}
postParam.queryCondition = JSON.stringify(condition)
const [
registerOpBusinessYardTable,
{ reload, setSelectedRowKeys, clearSelectedRowKeys, getSelectRows },
] = useTable({
api: async (p) => {
const res: API.DataResult = await GetOpBusinessYardList(p)
setSelectedRowKeys([res.data[0].id])
selectId.value = res.data[0].id
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
resizeHeightOffset: 200,
beforeFetch: () => {
const postParam: API.PageRequest = {
queryCondition: '',
pageCondition: {
pageIndex: 1,
pageSize: 99999,
sortConditions: [],
},
}
let condition: API.ConditionItem[] = []
condition.push({
FieldName: 'businessId',
FieldValue: businessId.value,
ConditionalType: 1,
})
postParam.queryCondition = JSON.stringify(condition)
return postParam
},
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
isTreeTable: false,
pagination: true,
striped: true,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: true,
indexColumnProps: {
fixed: 'left',
},
canResize: true,
actionColumn: {
width: 80,
title: '操作',
dataIndex: 'action',
fixed: 'right',
return postParam
},
rowKey: 'id',
columns,
isTreeTable: false,
pagination: false,
striped: true,
showTableSetting: false,
bordered: true,
showIndexColumn: false,
autoCreateKey: false,
indexColumnProps: {
fixed: 'left',
},
canResize: true,
rowSelection: {
type: 'radio',
onSelect: (e) => {
selectId.value = e.id
},
rowSelection: { type: 'checkbox' },
})
},
})
const [registerOpBusinessYardModal, { openModal }] = useModal()
function AddOpBusinessYard() {
openModal(true, {
isParent: false,
isUpdate: false,
businessId: businessId.value,
})
}
//
function FnClickDel() {
if (getSelectRows().length) {
@ -165,17 +128,18 @@
notification.warning({ message: '请至少选择一条数据', duration: 3 })
}
}
function FnEditOpBusinessYard(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
})
function FnClickAdd() {
clearSelectedRowKeys()
selectId.value = ''
}
function handleSuccess() {
// businessId.value = 0
reload()
async function handleSuccess() {
await reload()
}
</script>
<style lang="less">
@import url('/@/styles/buttonGroup.scss');
.OPCol {
height: 60vh;
overflow-y: auto;
}
</style>

@ -1,58 +1,41 @@
<template>
<BasicModal
v-bind="$attrs"
:use-wrapper="true"
:title="getTitle"
width="60%"
@register="registerModal"
@ok="handleSave"
>
<div>
<div class="buttonGroup">
<div class="nav" @click="handleSave"> <i class="iconfont icon-jiahao2fill"></i>保存 </div>
</div>
<BasicForm @register="registerForm" />
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="closeModal"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleSave(false)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleSave(true)"
>保存并关闭</a-button
>
</template>
</BasicModal>
</div>
</template>
<script lang="ts" setup>
import { ref, computed, unref, h } from 'vue'
import { BasicModal, useModalInner, useModal } from '/@/components/Modal'
import { ref, watch } from 'vue'
import { BasicForm, useForm } from '/@/components/Form/index'
import { formSchema, BankColumns } from './OpBusinessYardColumns'
import { formSchema } from './OpBusinessYardColumns'
import { EditOpBusinessYard, GetOpBusinessYardInfo } from './LetterApi'
import { useMessage } from '/@/hooks/web/useMessage'
import { propTypes } from '/@/utils/propTypes'
const props = defineProps({
businessId: propTypes.object,
selectId: propTypes.string,
})
watch(
() => props.selectId,
async (nVal) => {
if (nVal) {
console.log(nVal)
const res: API.DataResult = await GetOpBusinessYardInfo({ id: nVal })
if (res.succeeded) {
await setFieldsValue({
...res.data,
})
}
} else {
resetFields()
}
},
)
// Emits
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const loading = ref(false)
const rowId = ref('')
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema }] = useForm({
labelWidth: 100,
@ -60,71 +43,25 @@
showActionButtonGroup: false,
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false, loading: true })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
// setModalProps({ confirmLoading: true });
rowId.value = data.record.id
const res: API.DataResult = await GetOpBusinessYardInfo({ id: unref(rowId) })
if (res.succeeded) {
setFieldsValue({
...res.data,
})
}
} else {
setFieldsValue({ permissionIdentity: unref(2) })
async function handleSave() {
let ApiData: any = {
mainInfo: {},
}
setModalProps({ loading: false })
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增电放保函' : '编辑电放保函'))
async function handleSave(exit) {
try {
setModalProps({ confirmLoading: true, loading: true })
let ApiData: any = {
mainInfo: {},
}
const values = await validate()
console.log(values)
Object.keys(values).forEach((item) => {
if (item == 'businessId' && !values.businessId) {
ApiData.businessId = props.businessId
} else {
ApiData[item] = values[item]
}
})
const res: API.DataResult = await EditOpBusinessYard(ApiData)
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
//
if (!exit) {
if (unref(isUpdate)) {
await refresh()
} else {
rowId.value = res.data
isUpdate.value = true
await refresh()
}
}
const values = await validate()
console.log(values)
Object.keys(values).forEach((item) => {
if (item == 'businessId' && !values.businessId) {
ApiData.businessId = props.businessId
} else {
createMessage.error(res.message)
ApiData[item] = values[item]
}
exit && closeModal()
} finally {
// loading.value = false;
setModalProps({ confirmLoading: false, loading: false })
}
}
async function refresh() {
const res: API.DataResult = await GetOpBusinessYardInfo({ id: unref(rowId) })
})
const res: API.DataResult = await EditOpBusinessYard(ApiData)
if (res.succeeded) {
await setFieldsValue({
...res.data,
})
createMessage.success(res.message)
emit('success')
} else {
createMessage.error(res.message)
}
}
</script>

Loading…
Cancel
Save