箱管 下线审批调整

zth
张同海 2 weeks ago
parent 01bfc403ff
commit b1d3717428

@ -24,10 +24,21 @@
<div>
<BasicTable class="ds-table" @register="registerTableBotton"> </BasicTable>
</div>
<a-modal
v-model:visible="visible"
title="驳回"
width="40%"
@cancel="handleCancel"
@ok="handleOk"
>
<BasicForm @register="modalRegisterForml" />
</a-modal>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { BasicForm, useForm } from '/@/components/Form/index'
import { ApiList, ApiDetailList, ApiConfirm, ApiCancel } from './api'
import { columns, searchFormSchema, detailColumns } from './columns'
import { useMessage } from '/@/hooks/web/useMessage'
@ -109,40 +120,93 @@
resizeHeightOffset: 35,
immediate: false,
})
async function FnAudit(type, state) {
const Ctype = ref(true)
const CApiData = ref('')
function FnAudit(type, state) {
let ApiData: any = {
id: '',
ids: [],
businessType: '',
}
if (type) {
if (getSelectRows()[0].id) {
ApiData.id = getSelectRows()[0].id
try {
if (type) {
if (getSelectRows()[0]?.id) {
ApiData.id = getSelectRows()[0].id
} else {
notification.warning({ message: '请选择一条数据', duration: 3 })
throw new Error('请选择一条数据')
}
} else {
notification.warning({ message: '请选择一条数据', duration: 3 })
if (getSelectRowsBotton().length) {
getSelectRowsBotton().forEach((item) => {
ApiData.ids.push(item.id)
})
ApiData.id = getSelectRows()[0].id
} else {
notification.warning({ message: '请至少选择一条数据', duration: 3 })
throw new Error('请至少选择一条数据')
}
}
} else {
if (getSelectRowsBotton().length) {
getSelectRowsBotton().forEach((item) => {
ApiData.ids.push(item.id)
})
ApiData.id = getSelectRows()[0].id
ApiData.businessType = getSelectRows()[0]?.ctnBizStateId
if (state == 'cancel') {
Ctype.value = type
CApiData.value = JSON.stringify(ApiData)
visible.value = true
} else {
notification.warning({ message: '请至少选择一条数据', duration: 3 })
FnExamine(type, state, ApiData)
}
} catch (error) {
// console.log(error)
}
}
async function FnExamine(type, state, ApiData) {
let res: any = state == 'confirm' ? await ApiConfirm(ApiData) : await ApiCancel(ApiData)
if (res.succeeded) {
notification.success({ message: res.message, duration: 3 })
console.log(type)
if (type) {
reload()
} else {
Ctype.value = true
CApiData.value = ''
modalResetFields()
visible.value = false
reloadBotton()
}
}
}
const visible = ref(false)
const modalFormSchema = [
{
field: 'remark',
label: '驳回原因',
defaultValue: '',
component: 'InputTextArea',
required: true,
colProps: { span: 24 },
componentProps: {
autoSize: {
minRows: 4,
maxRows: 4,
},
disTrans: true,
},
},
]
const [modalRegisterForml, { resetFields: modalResetFields, validate: modalValidate }] = useForm({
labelWidth: 150,
schemas: modalFormSchema,
showActionButtonGroup: false,
})
const handleOk = async () => {
const res = await modalValidate()
FnExamine(Ctype.value, 'cancel', { ...JSON.parse(CApiData.value), remark: res.remark })
}
const handleCancel = () => {
Ctype.value = true
CApiData.value = ''
modalResetFields()
visible.value = false
}
</script>
<style lang="less" scoped>
.OfflineAudit {

@ -22,16 +22,17 @@ export const TFData = [
{ value: false, label: '否' },
]
export const RQueryArr = [
'customerId',
'createTime',
'billType',
// 'customerId',
'isDebit',
'stlName',
'currency',
'feeName',
'forwarderId',
'dischargePortId',
'loadPortId',
'currency',
// 'createTime',
// // 'billType',
// 'isDebit',
// 'stlName',
// 'forwarderId',
// // 'dischargePortId',
// // 'loadPortId',
]
// 表单
export const schemas: FormSchema[] = [
@ -90,13 +91,13 @@ export const schemas: FormSchema[] = [
colProps: { span: 4 },
show: false,
},
{
field: 'customNo',
component: 'Input',
label: '编号检索',
dynamicDisabled: false,
colProps: { span: 4 },
},
// {
// field: 'customNo',
// component: 'Input',
// label: '编号检索',
// dynamicDisabled: false,
// colProps: { span: 4 },
// },
{
field: 'etd',
label: '业务日期',
@ -199,7 +200,7 @@ export const schemas: FormSchema[] = [
})
},
immediate: true,
valueField: 'id',
valueField: 'name',
resultField: 'data',
// mode: 'multiple',
filterOption: (input: string, option: any) => {
@ -208,26 +209,26 @@ export const schemas: FormSchema[] = [
}
},
},
{
field: 'isSeaFreight',
component: 'Select',
label: '是否海运费',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: ({ formModel }) => {
return {
options: TFData,
onchange: (e) => {
if (e) {
formModel.feeName = '海运费'
}
},
}
},
},
// {
// field: 'isSeaFreight',
// component: 'Select',
// label: '是否海运费',
// dynamicDisabled: false,
// colProps: { span: 4 },
// componentProps: ({ formModel }) => {
// return {
// options: TFData,
// onchange: (e) => {
// if (e) {
// formModel.feeName = '海运费'
// }
// },
// }
// },
// },
{
label: '船名',
field: 'vessel',
field: 'vesselId',
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
@ -256,7 +257,7 @@ export const schemas: FormSchema[] = [
api: GetVoynoSelectList,
immediate: true,
labelField: 'voyNo',
valueField: 'id',
valueField: 'voyNo',
resultField: 'data',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
@ -304,7 +305,8 @@ export const schemas: FormSchema[] = [
return new Promise((resolve) => {
GetClientPortSelectList().then((res) => {
res.data.forEach((item) => {
if (item.ediCode) item.cnName = item.ediCode + '/' + item.cnName
if (item.ediCode)
item.cnName = item.ediCode + '/' + item.cnName + '/' + item.portName
})
resolve(res)
})
@ -333,7 +335,8 @@ export const schemas: FormSchema[] = [
return new Promise((resolve) => {
GetClientPortSelectList().then((res) => {
res.data.forEach((item) => {
if (item.ediCode) item.cnName = item.ediCode + '/' + item.cnName
if (item.ediCode)
item.cnName = item.ediCode + '/' + item.cnName + '/' + item.portName
})
resolve(res)
})

Loading…
Cancel
Save