张同海 3 months ago
commit f41ea97cd8

@ -103,7 +103,7 @@
</span> </span>
</a-tooltip> </a-tooltip>
</div> </div>
<DsPrint ref="dsPrint" :code="code" /> <DsPrint ref="dsPrint" :code="code" :paramJsonStr="paramJsonStr" />
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
@ -171,6 +171,11 @@
showBtns: { showBtns: {
type: Array, type: Array,
default: ['save', 'submit', 'copy', 'print', 'next', 'last'] default: ['save', 'submit', 'copy', 'print', 'next', 'last']
},
//
paramJsonStr: {
type: String,
default: null
} }
}, },
emits: ['copy'], emits: ['copy'],

@ -43,15 +43,15 @@
{{ item.templateName }} {{ item.templateName }}
</span> </span>
<span class="flex flex-btns"> <span class="flex flex-btns">
<dl @click="toPrint(item.id, '1')"> <dl @click="toPrint(item, '1')">
<dt><img src="../../assets/images/PDF2.png" alt=""></dt> <dt><img src="../../assets/images/PDF2.png" alt=""></dt>
<dd>pdf</dd> <dd>pdf</dd>
</dl> </dl>
<dl @click="toPrint(item.id, '2', item.name)"> <dl @click="toPrint(item, '2', item.name)">
<dt><img src="../../assets/images/xksx2.png" alt=""></dt> <dt><img src="../../assets/images/xksx2.png" alt=""></dt>
<dd>xlsx</dd> <dd>xlsx</dd>
</dl> </dl>
<dl @click="toPrint(item.id, '3')"> <dl @click="toPrint(item, '3')">
<dt><img src="../../assets/images/DOC2.png" alt=""></dt> <dt><img src="../../assets/images/DOC2.png" alt=""></dt>
<dd>doc</dd> <dd>doc</dd>
</dl> </dl>
@ -72,7 +72,8 @@
<script lang="ts" setup name="DsPrint"> <script lang="ts" setup name="DsPrint">
import { ref, defineExpose, defineProps } from 'vue' import { ref, defineExpose, defineProps } from 'vue'
import { GetOpenPrintTemplateList, GetOpenJsonPrintInfo } from '/@/views/operation/seaexport/api/BookingLedger.js' import { useUserStore } from '/@/store/modules/user'
import { GetOpenPrintTemplateList, GetOpenJsonPrintInfo, GetOpenSqlPrintInfo } from '/@/views/operation/seaexport/api/BookingLedger.js'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage() const { createMessage } = useMessage()
const props = defineProps({ const props = defineProps({
@ -80,6 +81,11 @@
code: { code: {
type: String, type: String,
default: null default: null
},
//
paramJsonStr: {
type: String,
default: null
} }
}) })
// //
@ -141,11 +147,37 @@
} }
// //
const toPrint = (id, type, name) => { const toPrint = (item, type) => {
if (item.isUseDataSource) {
const userStore = useUserStore()
const postData = {
printType: type,
templateId: item.id,
paramJsonStr: props.paramJsonStr,
templateCode: item.templateCode,
tenantId: userStore.getUserInfo.tenantId
}
loading.value = true
GetOpenSqlPrintInfo(postData).then(res => {
loading.value = false
if (res.succeeded) {
let fileURL = `http://118.190.144.189:3008/printtempfile/${res.data}`
if (type == 1) {
window.open(fileURL)
} else {
window.open(`//118.190.144.189:3008/printtempfile/${res.data}`, '_blank')
}
} else {
createMessage.error(res.message)
}
}).catch(() => {
loading.value = false
})
} else {
const postData = { const postData = {
jsonDataStr: jsonDataStr.value || '', jsonDataStr: jsonDataStr.value || '',
printType: type, printType: type,
templateId: id templateId: item.id
} }
loading.value = true loading.value = true
GetOpenJsonPrintInfo(postData).then(res => { GetOpenJsonPrintInfo(postData).then(res => {
@ -164,6 +196,7 @@
loading.value = false loading.value = false
}) })
} }
}
defineExpose({ defineExpose({
init init

@ -350,7 +350,7 @@ export function GetOpenPrintTemplateList(data) {
data, data,
}) })
} }
// 获取Json打印信息 (Auth) // 获取Json打印信息 (不使用数据源)
export function GetOpenJsonPrintInfo(parameter) { export function GetOpenJsonPrintInfo(parameter) {
return request({ return request({
url: '/printApi/OpenPrint/GetOpenJsonPrintInfoAsync', url: '/printApi/OpenPrint/GetOpenJsonPrintInfoAsync',
@ -359,6 +359,15 @@ export function GetOpenJsonPrintInfo(parameter) {
}) })
} }
// 获取Json打印信息 (使用数据源)
export function GetOpenSqlPrintInfo(parameter) {
return request({
url: '/printApi/OpenPrint/GetOpenSqlPrintInfo',
method: 'post',
data: parameter,
})
}
// 获取服务项目列表 (Auth) // 获取服务项目列表 (Auth)
export function GetServiceProjectList(parameter) { export function GetServiceProjectList(parameter) {
return request({ return request({

@ -25,6 +25,7 @@
:save="save" :save="save"
:copy="copyData" :copy="copyData"
:submit="submit" :submit="submit"
:paramJsonStr="'{id:' + id + '}'"
:showBtns="(route.query.source == 'Create' && route.query.status == 'WAIT_ORDER_AUDIT') ? ['save'] : ['save', 'submit', 'copy', 'print', 'next', 'last']" :showBtns="(route.query.source == 'Create' && route.query.status == 'WAIT_ORDER_AUDIT') ? ['save'] : ['save', 'submit', 'copy', 'print', 'next', 'last']"
layout="horizontal" layout="horizontal"
></ActionBar> ></ActionBar>

@ -822,6 +822,10 @@ export const mailingInfoFormSchemaR: FormSchema[] = [
formActionType ? formActionType.linkageForm({ key: 'dischargePortCode', value: obj }) : null formActionType ? formActionType.linkageForm({ key: 'dischargePortCode', value: obj }) : null
formModel.dischargePortId = obj.id formModel.dischargePortId = obj.id
formModel.dischargePort = obj.portName formModel.dischargePort = obj.portName
// 带出交货地
formModel.deliveryPlaceId = obj.id
formModel.deliveryPlace = obj.portName
formModel.deliveryPlaceCode = e
} }
if (!e && !obj) { if (!e && !obj) {
formActionType ? formActionType.linkageForm({ key: 'dischargePortCode', value: null }) : null formActionType ? formActionType.linkageForm({ key: 'dischargePortCode', value: null }) : null
@ -2760,6 +2764,7 @@ export const personFormSchema: FormSchema[] = [
filterOption: (input: string, option: any) => { filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}, },
mode: 'SECRET_COMBOBOX_MODE_DO_NOT_USE',
onChange: (v, obj) => { onChange: (v, obj) => {
if (obj) { if (obj) {
formModel.name = obj.label formModel.name = obj.label

Loading…
Cancel
Save