feature-JimuReport-1106-yjl
sunzehua 1 month ago
parent 65dbb4ea66
commit dbfa58dc36

@ -161,7 +161,7 @@ export function SaveDataInList(parameter) {
export function PrintOrder(parameter) {
return request<DataResult>({
url: '/opApi/BookingSlotService/PrintOrder',
url: '/opApi/BookingSlotService/ExportOrder',
method: 'post',
data: parameter
})

@ -141,6 +141,7 @@ import { useMessage } from '../../../hooks/web/useMessage'
const { createMessage } = useMessage()
const optionsStore = useOptionsStore()
const go = useGo()
const queryStr = ref({})
const [registerModal, { openModal }] = useModal()
const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps, setSelectedRowKeys }] = useTable({
title: '',
@ -189,6 +190,7 @@ const [registerTable, { reload, setLoading, getForm, getSelectRows, setProps, se
})
},
beforeFetch: (p) => {
queryStr.value = formatParams(p)
return formatParams(p)
},
columns,
@ -396,7 +398,7 @@ function handleClickLable(index) {
const loadingExport = ref(false)
function handleSuport() {
loadingExport.value = true
PrintOrder(getForm().getFieldsValue()).then(res => {
PrintOrder(queryStr.value).then(res => {
if (res.succeeded) {
// window.open(
// ` ${process.env.VUE_APP_API_BASE_URL}/BookingOrder/downloadPrint?filename=${res.data}`,
@ -406,6 +408,8 @@ function handleSuport() {
createMessage.error(res.message)
}
loadingExport.value = false
}).catch(()=>{
loadingExport.value = false
})
}
</script>

@ -3,7 +3,7 @@
@ok="handleSave">
<!-- 费用模版表单 -->
<BasicForm @register="registerForm" @linkageForm="ChangeColumnView" />
<div style="font-weight: bold;font-size: 12px;">权限规则</div>
<div style="font-weight: bold;font-size: 12px;">主表权限规则</div>
<div style="margin-bottom: 10px">
<a-button type="link" @click="copy('{loginUser}')"><i class="icon-fuzhi3 iconfont"></i>本人</a-button>
<a-button type="link" @click="copy('{loginDept}')"><i class="icon-fuzhi3 iconfont"></i>本部门</a-button>
@ -22,6 +22,10 @@
<!-- 费用字段表格 -->
<columnView ref="RefcolumnView" title="" :IsApi="true" :schemas="ColumnViewschemas" v-show="columnViewType">
</columnView>
<div style="font-weight: bold;font-size: 12px;margin: 10px 0;">附加权限规则</div>
<columnView :Ismain="false" ref="RefcolumnView1" title="" :IsApi="true" :schemas="ColumnViewschemas" v-show="columnViewType">
</columnView>
<!--右下角按钮-->
<template #footer>
<a-button pre-icon="ant-design:close-outlined" type="warning" :loading="loading" ghost
@ -296,6 +300,7 @@ const loading = ref(false)
const rowId = ref('')
const ColumnViewschemas = ref<any>([])
const RefcolumnView = ref()
const RefcolumnView1 = ref()
const columnViewType = ref(false)
const { createMessage } = useMessage()
const [registerForm, { resetFields, setFieldsValue, getFieldsValue, validate, updateSchema }] =
@ -333,6 +338,7 @@ const [registerModal, { setModalProps, closeModal, updateFormField }] = useModal
columnViewType.value = true
setTimeout(() => {
RefcolumnView.value.init(JSON.parse(res.data.dataRules))
RefcolumnView1.value.init(JSON.parse(res.data.additionDataRules))
}, 200);
detailId.value = res.data.id
@ -344,6 +350,7 @@ const [registerModal, { setModalProps, closeModal, updateFormField }] = useModal
customerId: props.customerId,
})
RefcolumnView.value.init(null)
RefcolumnView1.value.init(null)
// feeField.value.SetData([])
// feeField.value.condition = ''
}
@ -357,10 +364,8 @@ const getTitle = computed(() => (!unref(isUpdate) ? '新增数据权限' : '编
async function handleSave(exit) {
try {
const values = await validate()
// const feeList = feeField.value.validate()
// values['details'] = feeList
// const str = changeRule(RefcolumnView.value.queryData)
values['dataRules'] = JSON.stringify(RefcolumnView.value.queryData)
values['additionDataRules'] = JSON.stringify(RefcolumnView1.value.queryData)
loading.value = true
setModalProps({ confirmLoading: true, loading: true })
const res: API.DataResult = await ApiEdit(values)

@ -16,12 +16,18 @@
style="margin-bottom: 6px; position: relative">
<div v-if="key != item.conditions.length - 1" class="r-line"></div>
<div :style="{ left: key == 0 ? '-29px' : '-16px' }" class="v-line"></div>
<a-select show-search :filter-option="filterOption" v-model:value="row.field"
<a-select v-if="Ismain" show-search :filter-option="filterOption" v-model:value="row.field"
style="width: 150px; margin-right: 6px" placeholder="查询字段" @change="changeHandle($event, row)">
<a-select-option v-for="item in schemas" :label="item.label" :key="item.field" :value="item.field">
{{ item.label }}
</a-select-option>
</a-select>
<a-select v-if="!Ismain" show-search @blur="handleBlur($event, row)" :filter-option="filterOption1" v-model:value="row.field"
style="width: 150px; margin-right: 6px" placeholder="查询字段" @change="changeHandle1($event, row)">
<a-select-option v-for="item in schemas" :label="item.label" :key="item.field" :value="item.field">
{{ item.label }}
</a-select-option>
</a-select>
<a-select v-model:value="row.operator" style="width: 90px; margin-right: 6px" placeholder="筛选符">
<a-select-option v-for="item in operatorOptions" :key="item.value" :value="item.value">
{{ item.label }}
@ -48,7 +54,7 @@
</div>
</div>
</a-spin>
<a-button class="add-group" type="link" @click="addGroup">
<a-button v-if="Ismain" class="add-group" type="link" @click="addGroup">
<span class="iconfont icon-calendar"></span>
添加条件组
</a-button>
@ -90,6 +96,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
Ismain: {
type: Boolean,
default: true,
},
})
watch(
() => props.schemas,
@ -169,6 +179,45 @@ const queryOldData = reactive({
},
],
})
const queryOldData1 = reactive({
logicalOperator: '0',
groups: [
{
logicalOperator: '0',
conditions: [
{
field: null,
operator: null,
value: null,
component: '',
},
{
field: null,
operator: null,
value: null,
component: '',
},
{
field: null,
operator: null,
value: null,
component: '',
},
{
field: null,
operator: null,
value: null,
component: '',
},
],
},
],
})
function handleBlur(val,row){
if(result.value && !changeFlag.value){
row.field = result.value
}
}
// options
const operatorOptions = [
{
@ -209,15 +258,26 @@ const sourceData = {
logicalOperator: '',
groups: '',
}
const result = ref('')
function filterOption(input, option) {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
function filterOption1(input, option) {
result.value = input
changeFlag.value = false
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
const loading = ref(false)
//
const init = (IsApiData) => {
if (props.IsApi) {
const content = IsApiData ? IsApiData : {}
const source = JSON.parse(JSON.stringify(queryOldData))
let source = {} as any
if(props.Ismain){
source = JSON.parse(JSON.stringify(queryOldData))
} else {
source = JSON.parse(JSON.stringify(queryOldData1))
}
if (content && content?.groups?.length) {
queryData.logicalOperator = content.logicalOperator
queryData.groups = content.groups
@ -226,7 +286,12 @@ const init = (IsApiData) => {
queryData.groups = source.groups
}
} else {
let source = JSON.parse(JSON.stringify(queryOldData))
let source = {} as any
if(props.Ismain){
source = JSON.parse(JSON.stringify(queryOldData))
} else {
source = JSON.parse(JSON.stringify(queryOldData1))
}
if (IsApiData) {
source = JSON.parse(IsApiData)
}
@ -244,6 +309,18 @@ const changeHandle = (e, row) => {
}
})
}
const changeFlag = ref(true)
const changeHandle1 = (e, row) => {
if(e){
changeFlag.value = true
}
row.value = null
props.schemas.forEach((item) => {
if (item.field == e) {
row.component = item.component
}
})
}
//
const deleteItem = (index, key) => {
queryData.groups[index].conditions.splice(key, 1)

@ -30,7 +30,7 @@ export const searchFormSchema: FormSchema[] = [
field: 'businessNo',
label: '编号',
component: 'Input',
placeholder: '委托编号/订舱编号/客户编号/提单号/分单号',
placeholder: '委托编号/订舱编号/客户编号/提单号/分单号/任务流水号',
colProps: { span: 5 },
},
{

Loading…
Cancel
Save