表单设置逻辑

szh-new
lijingjia 3 months ago
parent f5154b03b4
commit f7ea2ec551

@ -87,6 +87,8 @@ enum Api {
GetClientFrtSelectList = '/mainApi/Common/GetClientFrtSelectList',
// 委托单位下拉
GetControllerClientList = '/mainApi/ClientCommon/GetControllerClientListByKey',
// 根据权限id获取表单设置
GetFormSetListByModule = '/mainApi/FormSet/GetFormSetListByModule'
}
// 委托单位下拉数据
@ -469,6 +471,14 @@ export function GetCarrierSelectList(params) {
})
}
export function GetFormSetListByModule(params) {
return request({
url: Api.GetFormSetListByModule,
method: 'get',
params
})
}
/**
* api
*/

@ -9,7 +9,7 @@
</BasicForm>
<div class="table-wrapper" >
<slot name="left" class="left" ></slot>
<Table class="basic-table" v-show="getEmptyDataIsShowTable" ref="tableElRef" v-bind="getBindValues" :row-class-name="getRowClassName"
<Table class="basic-table" :virtual="true" v-show="getEmptyDataIsShowTable" ref="tableElRef" v-bind="getBindValues" :row-class-name="getRowClassName"
@change="handleTableChange" @resize-column="resizeColumn">
<template v-for="item in Object.keys($slots)" #[item]="data" :key="item">
<slot :name="item" v-bind="data || {}"></slot>

@ -38,7 +38,6 @@ interface AppState {
deleteId: string
FlowInstanceHistory:any
inBookingDetailsSave: boolean
topDown: boolean
saveFlag: boolean
ctnallList: any
FlowInstancesDetailsType:String
@ -70,7 +69,6 @@ export const useAppStore = defineStore({
saveNeedNumber: '',
deleteId: '',
inBookingDetailsSave: false,
topDown: false,
saveFlag: false,
ctnallList: [],
needSavePages: {},
@ -119,9 +117,6 @@ export const useAppStore = defineStore({
getsaveFlag(): any {
return this.saveFlag
},
gettopDown(): any {
return this.topDown
},
getinBookingDetailsSave(): any {
return this.inBookingDetailsSave
},
@ -214,9 +209,6 @@ export const useAppStore = defineStore({
setctnallList(data): void {
this.ctnallList = data
},
settopDown(data): void {
this.topDown = data
},
setinBookingDetailsSave(data): void {
this.inBookingDetailsSave = data
},

@ -236,6 +236,8 @@ import { FormSchema } from '/@/components/Table'
}
.table-box {
padding: 0 15px;
height: 65vh;
overflow: auto;
flex: 1;
.ant-input-disabled {
cursor: pointer;

@ -65,6 +65,7 @@
rowId.value = data.record.id
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
if (res.data.type) res.data.type = res.data.type.split(',')
setFieldsValue({
...res.data,
})
@ -83,10 +84,8 @@
async function handleSave(exit) {
try {
const values = await validate()
if (values.type) values.type = String(values.type)
setModalProps({ confirmLoading: true, loading: true })
// TODO custom api
console.log(values)
// loading.value = true;
const res: API.DataResult = await ApiEdit(values)
console.log(res)
if (res.succeeded) {
@ -115,6 +114,7 @@
async function refresh() {
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
if (res.succeeded) {
if (res.data.type) res.data.type = res.data.type.split(',')
await setFieldsValue({
...res.data,
})

@ -1,3 +1,4 @@
import { multiply } from 'lodash-es'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetCountrySelectList } from '/@/views/baseinfo/port/api'
import { ref } from 'vue'
@ -53,11 +54,12 @@ export const columns: BasicColumn[] = [
width: 200,
customRender: ({ record }) => {
let RData = ''
TypeList.forEach((item) => {
if (item.value == record.type) {
RData = item.label
}
})
if (record.type) {
RData = record.type
}
RData = RData.replace("1", "收货人")
RData = RData.replace("2", "发货人")
RData = RData.replace("3", "通知人")
return RData
},
},
@ -169,7 +171,7 @@ export const formSchema: FormSchema[] = [
field: 'type',
label: '类型',
component: 'Select',
required: false,
required: true,
dynamicDisabled: false,
colProps: { span: 12 },
componentProps: ({ formModel }) => {
@ -177,6 +179,7 @@ export const formSchema: FormSchema[] = [
options: TypeList,
allowClear: true,
showSearch: true,
mode: 'multiple',
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
},

@ -36,6 +36,12 @@
const props = defineProps({
id: {
type: String
},
data: {
type: Array,
default: () => {
return []
}
}
})
//
@ -43,19 +49,11 @@
const logLoading = ref(false)
//
const init = () => {
if (props.id) {
logLoading.value = true
GetSeaExportLogList({ id: props.id }).then((res) => {
const { data } = res
data.forEach(item => {
if (item.createTime) item.createTime = item.createTime.split(' ')[0]
})
logList.value = data
logLoading.value = false
}).catch(() => {
logLoading.value = false
})
}
const data = props.data
data.forEach(item => {
if (item.createTime) item.createTime = item.createTime.split(' ')[0]
})
logList.value = data
}
onMounted(() => {
init()

@ -7,7 +7,6 @@
<div class="sea-export-detail" :class="{ 'ds-view-box': source != 'edit' }">
<a-tabs
size="small"
:class="!Showtabs ? 'Showtabs' : ''"
class="main-tab mt10"
:activeKey="tabActiveKey"
@change="changeTab"
@ -116,11 +115,12 @@
>
<Divider type="horizontal" />
<!-- 联系人信息 -->
<ContactList :id="id"></ContactList>
<ContactList :id="id" :data="bookingDetails.orderContactList"></ContactList>
</otherInfo>
</transition>
<transition name="slide">
<rightContent
v-if="id"
class="right-content"
ref="RefrightContent"
:id="id"
@ -130,7 +130,6 @@
@fileNewUpadte="fileNewUpadte"
@changeAtd="changeAtd"
@changeDetail="changeDetailFun"
@handleComplete="handleComplete"
@rules="getRules"
@inGoodsSave="inGoodsSaveFun"
@handleRefsh="handleRefshRight"
@ -179,20 +178,20 @@
import ApproveBtns from '/@/components/ApproveBtns/index.vue'
//
import StorageSpace from './components/storageSpace.vue'
// idname
import { permissionsInfo } from '/@/hooks/web/usePermission'
const router = useRouter()
const route = useRoute()
import {
BookingOrderGet,
BookingOrderSave,
GetCtnListRefsh,
GetClientSourceDetailSelectList,
GetSaleList,
GetDeptList,
SeaExportCopy,
SeaExportTaskAudit,
CreateTask,
SetTaskStatus
} from '../api/BookingLedger'
import { GetFormSetListByModule } from '/@/api/common'
const appStore = useAppStore()
const { notification, createMessage } = useMessage()
import operationArea from './modules/operationArea.vue'
@ -221,8 +220,9 @@
//
const source = ref(route.query.source || 'edit')
// const isCopy = ref(route.query.isCopy || false)
const Showtabs = ref(false)
const bookingDetails = ref({})
const bookingDetails = ref({
})
// // const bookingDetails = ref()
const tabActiveKey = ref('1')
const inChildLoading = ref(false)
@ -272,16 +272,25 @@
return '完成任务'
}
})
watch(
() => bookingDetails.value,
(val) => {
console.log(val)
},
{
deep: true,
},
)
//
const getFormSet = () => {
GetFormSetListByModule({ permissionId: permissionsInfo().permissionId }).then(res => {
const { data } = res
if (data && data.length) {
const content = JSON.parse(data[0].content).columns
//
RefNoteInfo.value.updateSchema(content)
RefbasicInfo.value.updateSchema(content)
RefmailingInfo.value.updateSchemaL(content)
RefmailingInfo.value.updateSchemaR(content)
RefcargoInfo.value.updateSchema(content)
OtherInfo.value.updateSchema(content)
}
})
}
onMounted(() => {
// permission
getFormSet()
// tab
if (source.value != 'edit') document.getElementsByClassName('main-tab')[0].getElementsByClassName('ant-tabs-nav-wrap')[0].style.display = 'none'
})
@ -291,13 +300,16 @@
if (route.query.id && !id.value) {
id.value = route.query.id
}
bookingDetails.value = {}
excuteRules.value = []
excuteRulesType.value = ''
Showtabs.value = false
bookingDetails.value = {
orderContactList: []
}
if (id.value) {
//
excuteRules.value = []
excuteRulesType.value = ''
getDetail()
} else {
//
detailsLoadOver.value = false
isLockBooking.value = false
}
@ -329,121 +341,16 @@
res.data.ctnPriceInfo = [{}]
}
bookingDetails.value = res.data
appStore.settopDown(false)
inPageLoading.value = false
//
// if (res.data.sourceId) {
// let sourceDetailIdArr: any = []
// await GetClientSourceDetailSelectList({ id: res.data.sourceId }).then((res) => {
// res.data.forEach((item) => {
// sourceDetailIdArr.push({ label: item.detailName, value: item.id })
// })
// })
// RefbasicInfo.value.updateSchema({
// label: '',
// field: 'sourceDetailId',
// component: 'Select',
// required: false,
// dynamicDisabled: ({ values }) => {
// return !values.sourceId || source.value != 'edit'
// },
// colProps: { span: 4 },
// componentProps: {
// allowClear: true,
// options: sourceDetailIdArr,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// },
// })
// }
// if (res.data.saleId) {
// const FnsaleId: any = await GetSaleList()
// FnsaleId.data.forEach(async (item) => {
// if (item.id == res.data.saleId) {
// let saleDeptIdArr: any = []
// let saleOrgIdArr: any = []
// item.saleOrgList.forEach((item) => {
// saleOrgIdArr.push({ label: item.orgName, value: item.orgId })
// })
// if (item.defaultOrgId) {
// await GetDeptList({ orgId: item.defaultOrgId }).then((res) => {
// console.log(res, ' ')
// res.data.forEach((item) => {
// saleDeptIdArr.push({ label: item.orgName, value: item.id })
// })
// })
// }
// RefbasicInfo.value.updateSchema([
// {
// label: '',
// field: 'saleOrgId',
// component: 'Select',
// required: false,
// dynamicDisabled: source.value == 'edit' ? false : true,
// // defaultValue: '',
// colProps: { span: 4 },
// componentProps: {
// allowClear: true,
// options: saleOrgIdArr,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// onChange: (e, obj) => {
// // formModel.saleDeptId = ''
// GetDeptList({ orgId: e }).then((res) => {
// console.log(res, ' ')
// let Arr: any = []
// res.data.forEach((item) => {
// Arr.push({ label: item.orgName, value: item.id })
// })
// updateSchema({
// label: '',
// field: 'saleDeptId',
// component: 'Select',
// required: false,
// dynamicDisabled: source.value == 'edit' ? false : true,
// // defaultValue: '',
// colProps: { span: 4 },
// componentProps: {
// allowClear: true,
// options: Arr,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// },
// })
// })
// },
// },
// },
// {
// label: '',
// field: 'saleDeptId',
// component: 'Select',
// required: false,
// dynamicDisabled: source.value == 'edit' ? false : true,
// // defaultValue: '',
// colProps: { span: 4 },
// componentProps: {
// allowClear: true,
// options: saleDeptIdArr,
// showSearch: true,
// filterOption: (input: string, option: any) => {
// return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
// },
// },
// },
// ])
// }
// })
// }
//
if (res.data.formSetList && res.data.formSetList.length) {
const formSetContent = JSON.parse(res.data.formSetList[0].content)
console.log(formSetContent)
// RefbasicInfo.value.updateSchema()
}
})
.catch(() => {
appStore.settopDown(false)
loading.value = false
})
}
@ -600,23 +507,23 @@
//
function changeDetailFun(data) {
const { detail } = data
// if (ifCompare(bookingDetails.value, detail.value) && !inChildLoading.value) {
// checkSaveFun({ type: 'details', hasChange: true })
// }
// bookingDetails.value = detail.value
}
// //
// // function ifCompare(object1, object2) {
// // var o1keys = Object.keys(object1)
// // var o2keys = Object.keys(object2)
// // if (o2keys.length !== o1keys.length) return false
// // for (let i = 0; i <= o1keys.length - 1; i++) {
// // const key = o1keys[i]
// // if (!o2keys.includes(key)) return false
// // if (object2[key] !== object1[key]) return false
// // }
// // return true
// // }
if (ifCompare(bookingDetails.value, detail.value) && !inChildLoading.value) {
checkSaveFun({ type: 'details', hasChange: true })
}
bookingDetails.value = detail.value
}
//
function ifCompare(object1, object2) {
var o1keys = Object.keys(object1)
var o2keys = Object.keys(object2)
if (o2keys.length !== o1keys.length) return false
for (let i = 0; i <= o1keys.length - 1; i++) {
const key = o1keys[i]
if (!o2keys.includes(key)) return false
if (object2[key] !== object1[key]) return false
}
return true
}
function checkSaveFun(data) {
if (inGoodsSave.value) {
return false
@ -751,9 +658,6 @@
bookingDetails.value.atd = time + ':00'
}
}
function handleComplete() {
checkSaveFun({ type: 'details', hasChange: false })
}
function inGoodsSaveFun(data) {
inGoodsSave.value = data
}
@ -828,7 +732,6 @@
const { rows, type } = data
excuteRules.value = rows
excuteRulesType.value = type
console.log(excuteRules.value, excuteRulesType.value)
}
//
const submitDc = (v) => {

@ -10,7 +10,7 @@
@ok="handleSave"
>
<!-- 包装表单 -->
<BasicForm @register="registerForm">
<BasicForm @register="registerForm" @linkageForm="linkageForm" >
</BasicForm>
<!--右下角按钮-->
<template #footer>
@ -89,6 +89,10 @@
setModalProps({ loading: false })
})
//
const linkageForm = (v) => {
console.log(v)
}
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'))
//
const personChange = (e, obj) => {
@ -107,7 +111,7 @@
loading.value = false
if (res.succeeded) {
createMessage.success(res.message)
emit('success')
emit('success', values)
}
exit && closeModal()
} finally {

@ -270,6 +270,7 @@ export const basicInfoFormSchema: FormSchema[] = [
field: 'forwarder',
component: 'ApiSelect',
required: false,
defaultValue: null,
dynamicDisabled: false,
colProps: { span: 5 },
componentProps: ({ formModel }) => {
@ -1187,7 +1188,7 @@ export const noteFormSchema: FormSchema[] = [
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
// defaultValue: '',
defaultValue: null,
colProps: { span: 5 },
componentProps: ({ formModel }) => {
return {
@ -1210,7 +1211,7 @@ export const noteFormSchema: FormSchema[] = [
}
}
}
},
}
},
{
field: 'serviceCode',
@ -1224,7 +1225,7 @@ export const noteFormSchema: FormSchema[] = [
component: 'ApiSelect',
required: false,
dynamicDisabled: false,
// defaultValue: '',
defaultValue: null,
colProps: { span: 5 },
componentProps: ({ formModel }) => {
return {
@ -1827,6 +1828,7 @@ export const cargoInfoFormSchema3: FormSchema[] = [
label: '',
field: 'cargoId',
component: 'Input',
defaultValue: 'S',
show: false
},
// 危险品
@ -1834,21 +1836,25 @@ export const cargoInfoFormSchema3: FormSchema[] = [
label: '危险品等级',
field: 'dangerClass',
component: 'Input',
required: false,
required: ({ values }) => {
return values.cargoId == 'D'
},
colProps: { span: 5 },
show: ({ values }) => {
return values.cargoId == 'D'
},
}
},
{
label: '危险品编号',
field: 'dangerNo',
component: 'Input',
required: false,
required: ({ values }) => {
return values.cargoId == 'D'
},
colProps: { span: 5 },
show: ({ values }) => {
return values.cargoId == 'D'
},
}
},
{
label: '危险品页号',
@ -2729,7 +2735,7 @@ export const personFormSchema: FormSchema[] = [
label: '客户类型',
component: 'Select',
colProps: { span: 12 },
componentProps: ({ formModel }) => {
componentProps: ({ formModel, formActionType }) => {
return {
options: customTypeDict.value,
allowClear: true,
@ -2752,12 +2758,11 @@ export const personFormSchema: FormSchema[] = [
// 情况联系人和
formModel.customerTypeName = ''
}
formModel.customerId = ''
formModel.customerName = ''
formModel.customerContactId = ''
formModel.name = ''
formModel.email = ''
formModel.tel = ''
formActionType ? formActionType.linkageForm(v) : null
},
}
},
@ -2841,12 +2846,15 @@ export const personFormSchema: FormSchema[] = [
field: 'email',
component: 'Input',
colProps: { span: 12 },
required: true,
rules: [{ type: 'email', message: '请填写正确的邮箱地址' }]
},
{
label: '电话',
field: 'tel',
component: 'Input',
colProps: { span: 12 },
required: true,
colProps: { span: 12 }
},
{
field: 'customerTypeName',
@ -2877,7 +2885,7 @@ export const personColumns: BasicColumn[] = [
dataIndex: 'email',
title: '邮箱',
sorter: true,
width: 150,
width: 150
},
{
dataIndex: 'tel',
@ -2904,3 +2912,15 @@ export const personColumns: BasicColumn[] = [
width: 220,
},
]
// 海运出口基础信息总表单
export const basicInfoFormAllSchema: FormSchema[] = [
...basicInfoFormSchema,
...mailingInfoFormSchemaL,
...mailingInfoFormSchemaR,
...noteFormSchema,
...cargoInfoFormSchema1,
...cargoInfoFormSchema2,
...cargoInfoFormSchema4,
...otherInfoFormSchema
]

@ -7,7 +7,7 @@
<div class="ds-sea-basic-info">
<ConfigForm
v-if="source == 'edit'"
:form-schema="basicInfoFormSchema"
:form-schema="basicInfoFormAllSchema"
:isTransfer="true"
name="基础表单"
formNo="10"
@ -18,13 +18,18 @@
</a-button>
</ConfigForm>
<div>
<input
ref="customerNoRef"
:style="{ width: `${formData.customerNo?.length * 7}px` }"
class="customerNo"
v-model="formData.customerNo"
/>
<span @click="editCustomerNo" class="iconfont icon-bianji1"></span>
<span v-if="userStore.getUserInfo.tenantId == '1750335377144680448'" class="customerNo">
{{ formData.customerNo }}
</span>
<span v-else>
<input
ref="customerNoRef"
:style="{ width: `${formData.customerNo?.length * 7}px` }"
class="customerNo"
v-model="formData.customerNo"
/>
<span @click="editCustomerNo" class="iconfont icon-bianji1"></span>
</span>
<Divider type="vertical" />
<a-dropdown>
<template #overlay>
@ -129,15 +134,15 @@
</template>
<script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index'
import { basicInfoFormSchema } from './baseInfo.tsx'
import { basicInfoFormSchema, basicInfoFormAllSchema } from './baseInfo.tsx'
import { ref, watch, onMounted, reactive } from 'vue'
import { useMessage } from '/@/hooks/web/useMessage'
import emitter from '/@/utils/Bus'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
import { Divider } from 'ant-design-vue'
//
import { updateFormItem } from '/@/hooks/web/common'
import { useUserStore } from '/@/store/modules/user'
const userStore = useUserStore()
const route = useRoute()
//
const source = ref(route.query.source || 'edit')
@ -164,11 +169,6 @@
showActionButtonGroup: false,
size: 'small',
})
updateFormItem(updateSchema, 10)
setTimeout(() => {
console.log(basicInfoFormSchema)
}, 100)
// //
const RefChilrenRef = ref('')
//

@ -16,7 +16,7 @@
</a-button>
</a-dropdown>
</h4>
<ConfigForm
<!-- <ConfigForm
v-if="source == 'edit' && !isPreOrder"
style="position: absolute; right: 0; top: -5px;"
:form-schema="cargoInfoFormSchema2"
@ -27,7 +27,7 @@
<span class="iconfont icon-icon_tianjia"></span>
添加到表单设置
</a-button>
</ConfigForm>
</ConfigForm> -->
</div>
<a-row :gutter="15">
<a-col :span="24">
@ -103,8 +103,6 @@
import { useRoute } from 'vue-router'
import { getDictOption } from '/@/utils/dictUtil'
import { BatchDelBusinessCtnPrice } from '/@/views/operation/seaexport/api/BookingLedger'
//
import { updateFormItem } from '/@/hooks/web/common'
import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
const FncargoId = ref([])
@ -138,6 +136,7 @@
})
//
const toggleCargo = (v) => {
console.log(v)
cargoId.value = v
setFieldsValue3({
cargoId: v,
@ -182,8 +181,6 @@
submitFunc: submit,
// size: 'small',
})
//
updateFormItem(updateSchema, 12)
const [
registerForm3,
{

@ -55,27 +55,29 @@
const loading = ref(false)
const props = defineProps({
id: { type: String },
//
data: {
type: Array,
default: () => {
return []
}
}
})
//
const [registerTable, { reload, getForm, getSelectRows }] = useTable({
api: async (p) => {
const res: API.DataResult = await GetBusinessOrderContactList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
resolve({ data: props.data })
})
},
beforeFetch: (p) => {
p['businessId'] = props.id
return formatParams(p)
},
columns: personColumns,
isTreeTable: false,
pagination: true,
pagination: false,
striped: true,
useSearchForm: false,
showTableSetting: false,
bordered: true,
showIndexColumn: true,
showIndexColumn: false,
rowSelection: {
type: 'checkbox'
},
@ -87,8 +89,8 @@
fixed: 'right',
}
})
function handleSuccess() {
reload()
function handleSuccess(v) {
console.log(v)
}
//
const create = () => {

@ -71,7 +71,7 @@
<div class="">
<div style="position: relative;">
<h4>运输信息</h4>
<ConfigForm
<!-- <ConfigForm
v-if="source == 'edit'"
style="position: absolute; right: 0; top: -5px;"
:form-schema="mailingInfoFormSchemaR"
@ -83,7 +83,7 @@
<span class="iconfont icon-icon_tianjia"></span>
添加到表单设置
</a-button>
</ConfigForm>
</ConfigForm> -->
</div>
<BasicForm class="auto" @register="registerFormR" @linkageForm="linkageForm" />
</div>
@ -94,8 +94,6 @@
import { ApiEdit } from '/@/views/baseinfo/sendReciveTem/api'
import { GetShippingBillTemplateSelectList } from '/@/views/operation/seaexport/api/BookingLedger'
import { mailingInfoFormSchemaL, mailingInfoFormSchemaR } from './baseInfo.tsx'
//
import { updateFormItem } from '/@/hooks/web/common'
import { Divider } from 'ant-design-vue'
import { ref, watch, onMounted, reactive } from 'vue'
import emitter from '/@/utils/Bus'
@ -178,8 +176,6 @@
showActionButtonGroup: false,
size: 'small',
})
//
updateFormItem(updateSchemaR, 11)
//
const save = (model, key) => {
saveKey = key

@ -285,10 +285,10 @@
</div>
</div>
</a-card> -->
<div class="card" style="padding-bottom: 15px;">
<div v-if="id" class="card" style="padding-bottom: 15px;">
<Divider type="horizontal" />
<!-- 日志组件 -->
<DsJournal :id="id" />
<DsJournal :id="id" :data="details.businessLogList"/>
</div>
<a-modal
v-model:visible="GoodsStatusVisible"
@ -358,51 +358,6 @@
>
<a-textarea v-model:value="remarkVal" :auto-size="{ minRows: 5, maxRows: 7 }" />
</a-modal>
<a-modal
title="添加附件"
:width="900"
v-model:visible="fileModelvisible"
:confirmLoading="uploading"
:maskClosable="false"
cancelText="关闭"
okText="保存"
@ok="handleUpload"
@cancel="fileModelCancel"
>
<div class="clearfix uplad-bg uplad-file-bg">
<span class="tip">1. 选择上传文件</span>
<a-upload
:file-list="upFileList"
:remove="handleRemove"
:disabled="upFileList.length > 0"
:before-upload="beforeUpload"
:style="{ width: '680px' }"
>
<a-button>
<span
class="iconfont icon-shujushangchuan-shixin"
:style="{ fontSize: '12px' }"
@click="handleOpenAtd(3)"
></span>
选择文件
</a-button>
</a-upload>
<span class="format">支持格式xlsxlsxpdftxtpms</span>
</div>
<div class="uplad-bg uplad-type">
<span class="tip">2. 选择文件类型</span>
<div class="upload-label">文件类型</div>
<a-select style="width: 120px" :value="attachName" @change="handleAttachChange">
<a-select-option
v-for="(attach, aindex) in bookingAttachType"
:key="attach.name"
:value="aindex"
>
{{ attach.name }}
</a-select-option>
</a-select>
</div>
</a-modal>
<a-modal
title="规则反馈需求"
:width="1000"
@ -489,14 +444,7 @@
</template>
<script lang="ts" setup>
import {
AddRemark,
AddFile,
ExcuteRuleEngine,
BookingOrderDownload,
BookingOrderDeleteRemark,
SaveServiceItem,
BookingOrderGetGoodsStatusList,
BookingOrderSaveGoodsStatus,
refreshSailingDate,
GetRuleOpinionLog,
SubmitRule0pinion,
@ -543,12 +491,11 @@
'openFlag'
])
let { ctx: that, proxy }: any = getCurrentInstance()
// const id = ref(route.query.id)
const id = ref(route.query.id)
// ----------------------------------------
const RemarkList: any = ref([])
const remarkSpinning = ref(false)
// ----------------------------------------
const tstyle = ref({ padding: '0 15px 15px', 'margin-bottom': '10px', background: '#fff' })
const type = ref(2)
const spinningRule = ref(false)
const roleFlag = ref(false)
@ -561,7 +508,6 @@
const time: any = ref(null)
const spinning = ref(false)
const booGoodsStatusItem: Ref<Array<any>> = ref([])
const btnLoading = ref(false)
const atdFlag = ref(false)
const CqType = ref(0)
const Cqtitle = ref('')
@ -575,9 +521,6 @@
const remarkModelvisible = ref(false)
const remarkVal = ref('')
const editRemarkVal: Ref<any> = ref(null)
const fileModelvisible = ref(false)
const pdfUrl = ref()
const showKey = ref([])
const goodStatusLoading = ref(false)
const labelCol = ref({
xs: { span: 24 },
@ -596,11 +539,6 @@
sm: { span: 20 },
})
const bookingModelconfirm = ref(false)
const uploading = ref(false)
const upFileList: Ref<Array<any>> = ref([])
const attachCode = ref('')
const attachName = ref('')
const bookingAttachType: Ref<Array<any>> = ref([])
const atdLoading = ref(false)
watch(
() => props.id,
@ -947,155 +885,56 @@
window.clearTimeout(time.value)
}
function handleRefsh() {
btnLoading.value = true
refreshSailingDate({ id: props.details.id }).then((res) => {
if (res.succeeded) {
btnLoading.value = false
emit('handleRefsh', res.data)
} else {
notification.error({ message: res.message, duration: 3 })
btnLoading.value = false
}
})
}
function handleOpenAtd(type) {
atdFlag.value = true
CqType.value = type
if (type === 1) {
Cqtitle.value = 'ETA'
atdTime.value = JSON.parse(JSON.stringify(props.details)).startETA
}
if (type === 2) {
Cqtitle.value = 'ATA'
atdTime.value = JSON.parse(JSON.stringify(props.details)).startATA
}
if (type === 3) {
Cqtitle.value = 'ETD'
atdTime.value = JSON.parse(JSON.stringify(props.details)).ygtETD
}
if (type === 4) {
Cqtitle.value = 'ATD'
atdTime.value = JSON.parse(JSON.stringify(props.details)).atd
}
}
function handleTime(time) {
let Rdata = '-'
if (time && time.split(':').length == 3) {
Rdata = `${time.split(':')[0]}:${time.split(':')[1]}`
}
return Rdata
}
// function handleRefsh() {
// btnLoading.value = true
// refreshSailingDate({ id: props.details.id }).then((res) => {
// if (res.succeeded) {
// btnLoading.value = false
// emit('handleRefsh', res.data)
// } else {
// notification.error({ message: res.message, duration: 3 })
// btnLoading.value = false
// }
// })
// }
// function handleOpenAtd(type) {
// atdFlag.value = true
// CqType.value = type
// if (type === 1) {
// Cqtitle.value = 'ETA'
// atdTime.value = JSON.parse(JSON.stringify(props.details)).startETA
// }
// if (type === 2) {
// Cqtitle.value = 'ATA'
// atdTime.value = JSON.parse(JSON.stringify(props.details)).startATA
// }
// if (type === 3) {
// Cqtitle.value = 'ETD'
// atdTime.value = JSON.parse(JSON.stringify(props.details)).ygtETD
// }
// if (type === 4) {
// Cqtitle.value = 'ATD'
// atdTime.value = JSON.parse(JSON.stringify(props.details)).atd
// }
// }
// function handleTime(time) {
// let Rdata = '-'
// if (time && time.split(':').length == 3) {
// Rdata = `${time.split(':')[0]}:${time.split(':')[1]}`
// }
// return Rdata
// }
function editRemark(data) {
remarkModelvisible.value = true
remarkVal.value = data.remark
editRemarkVal.value = data
}
//
const dsFile = ref(null)
function addFile() {
dsFile.value.init()
}
function getFileType(val) {
if (val) {
return val.substr(val.lastIndexOf('.') + 1)
} else {
return ''
}
}
function getFileFun(data) {
notification.success({ message: `下载打印文件 ${data.fileName} 中...`, duration: 3 })
BookingOrderDownload({ id: data.id }).then((res) => {
pdfUrl.value = window.URL.createObjectURL(
new Blob([res], { type: 'application/pdf;charset=utf-8' }),
)
const fname = data.fileName //
const link = document.createElement('a')
link.href = pdfUrl.value
link.setAttribute('download', fname)
document.body.appendChild(link)
link.click()
})
}
function bookingShow(data) {
data.isChecked = !data.isChecked
that.$forceUpdate()
}
function showLogMore(index) {
props.details.log[index].showMore = !props.details.log[index].showMore
that.$forceUpdate()
}
function handleUpload() {
const { upFileList, attachCode, attachName } = that
if (upFileList.length === 0) {
notification.error({ message: '请上传文件', duration: 3 })
return false
}
if (!attachCode || !attachName) {
notification.error({ message: '请选择附件类型', duration: 3 })
return false
}
let Did = props.id
if (route.query.isCopy) {
Did = 0
}
if (!props.id) {
Did = 0
}
const formData = new FormData()
formData.append('file', upFileList[0])
formData.append('BookingId', Did)
formData.append('TypeCode', attachCode)
formData.append('TypeName', attachName)
uploading.value = true
AddFile(formData)
.then((res) => {
if (res.succeeded) {
notification.success({ message: '上传成功', duration: 3 })
if (Did != 0) {
emit('upDateRight')
}
if (Did == 0) {
emit('fileNewUpadte', {
tempPathName: res.data,
TypeCode: attachCode,
TypeName: attachName,
})
}
} else {
notification.error({ message: res.message, duration: 3 })
}
uploading.value = false
fileModelCancel()
})
.catch((err) => {
notification.error({ message: err.message, duration: 3 })
})
}
function fileModelCancel() {
upFileList.value = []
attachCode.value = ''
attachName.value = ''
fileModelvisible.value = false
}
function handleRemove(file: any) {
const index = upFileList.value.indexOf(file)
const newFileList = upFileList.value.slice()
newFileList.splice(index, 1)
upFileList.value = newFileList
}
function beforeUpload(file) {
if (upFileList.value.length > 1) {
return false
}
upFileList.value = [...upFileList.value, file]
return false
}
function handleAttachChange(index) {
attachCode.value = bookingAttachType.value[index].code
attachName.value = bookingAttachType.value[index].name
}
function handleSubimtRole(e) {
e.preventDefault()
ruleForm.value.validateFields((err, values) => {

@ -497,11 +497,11 @@ const checkBookStatus = (id) => {
})
}
const isAdvancedQuery = ref(false)
const showColumns = ref({})
const formAllData = ref([])
const fromTableAllData = ref({})
const fields = ref<Field[]>([])
const tableHeight = ref(0)
// const showColumns = ref({})
// const formAllData = ref([])
// const fromTableAllData = ref({})
// const fields = ref<Field[]>([])
// const tableHeight = ref(0)
const TaskShippingOrderCompareData = ref({
showDetailList: '',
total: '',
@ -525,49 +525,40 @@ const formatSheetVisible = ref(false)
function TaskShippingOrderCompareHandleCancel() {
TaskShippingOrderCompareVisible.value = false
}
const permissionId = ref<String>('')
const ConditionalList: Ref<any> = ref()
async function createdInit() {
showColumns.value = JSON.parse(JSON.stringify(initData.columns))
formAllData.value = JSON.parse(JSON.stringify(initData.condAllData))
fromTableAllData.value = JSON.parse(JSON.stringify(initData.columnsAllData))
tableHeight.value = document.body.clientHeight - 230
const res: API.DataResult = await getColumnsByClient({
tableViewName: 'op_sea_export',
})
const fullPath = ref(router.currentRoute.value.fullPath)
usePermissionStore().getWrouteList.forEach((item: Record<any, any>) => {
item.children[0].children?.forEach((item2: Record<any, any>) => {
if (fullPath.value.indexOf(item2.path) != -1) {
permissionId.value = item2.id
}
})
})
if (res.succeeded) {
console.log(res)
let data: any[] = []
res.data.forEach((item) => {
data.push({
id: item.dbColumnName,
title: item.columnDescription,
name: 'Select',
value: null,
props: {
disabled: false,
multiple: false,
// placeholder: '',
options: [],
},
style: {
width: '100%',
},
})
})
// async function createdInit() {
// showColumns.value = JSON.parse(JSON.stringify(initData.columns))
// formAllData.value = JSON.parse(JSON.stringify(initData.condAllData))
// fromTableAllData.value = JSON.parse(JSON.stringify(initData.columnsAllData))
// tableHeight.value = document.body.clientHeight - 230
// const res: API.DataResult = await getColumnsByClient({
// tableViewName: 'op_sea_export',
// })
// if (res.succeeded) {
// console.log(res)
fields.value = data
}
}
// let data: any[] = []
// res.data.forEach((item) => {
// data.push({
// id: item.dbColumnName,
// title: item.columnDescription,
// name: 'Select',
// value: null,
// props: {
// disabled: false,
// multiple: false,
// // placeholder: '',
// options: [],
// },
// style: {
// width: '100%',
// },
// })
// })
// fields.value = data
// }
// }
function handledbclick(record) {
editColumns(record)
}
@ -599,7 +590,7 @@ function compareSuccess(){
onMounted(() => {
//
reload()
createdInit()
// createdInit()
})
</script>

Loading…
Cancel
Save