szh-new
张同海 4 months ago
parent 654bf6f8a7
commit 613868169f

@ -1,5 +1,12 @@
<template> <template>
<div> <BasicModal
v-bind="$attrs"
:use-wrapper="true"
title="箱状态批量维护"
width="55%"
@register="registerModal"
@ok="handleSave"
>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -15,41 +22,32 @@
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<TenantAuditStepModal @register="registerModal" @success="handleSuccess" /> </BasicModal>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { defineExpose, defineComponent, onMounted, ref } from 'vue' import { defineExpose, defineComponent, onMounted, ref } from 'vue'
import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table' import { BasicTable, useTable, TableAction, SorterResult } from '/@/components/Table'
import { ApiBasicsList, ApiExistList } from './api' import { ApiExistList } from './api'
import { useModal } from '/@/components/Modal' import { ApiChangeList } from '../StateChange/api'
import TenantAuditStepModal from './TenantAuditStepModal.vue' import { BasicModal, useModalInner } from '/@/components/Modal'
import { columns, searchFormSchema } from './columns' import { columns } from './columns'
const [registerModal, { openModal }] = useModal() const cntrno = ref('')
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
setModalProps({ confirmLoading: false, loading: true })
reload()
cntrno.value = data.cntrno
setModalProps({ loading: false })
})
const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({ const [registerTable, { reload, getForm, getPaginationRef, getSelectRows }] = useTable({
// title: '', // title: '',
maxHeight: 300, maxHeight: 300,
rowSelection: { type: 'checkbox' }, rowSelection: { type: 'checkbox' },
// rowSelection: { type: 'radio' }, // rowSelection: { type: 'radio' },
api: async (p) => { api: async (p) => {
const res: API.DataResult = await ApiBasicsList(p) const res: API.DataResult = await ApiChangeList(p)
const res2: API.DataResult = await ApiExistList()
let data = []
res.data.forEach((item) => {
let type = true
res2.data.forEach((item2) => {
if (item.id == item2) {
type = false
}
})
if (type) {
data.push(item)
}
})
console.log(data)
return new Promise((resolve) => { return new Promise((resolve) => {
resolve({ data: [...data] }) resolve({ data: [...res.data], total: res.count })
}) })
}, },
beforeFetch: () => { beforeFetch: () => {
@ -66,8 +64,8 @@
let condition: API.ConditionItem[] = [] let condition: API.ConditionItem[] = []
if (!!data.CtnName) { if (!!data.CtnName) {
condition.push({ condition.push({
FieldName: 'CtnName', FieldName: 'Cntrno',
FieldValue: data.CtnName, FieldValue: cntrno.value,
ConditionalType: 1, ConditionalType: 1,
}) })
} }
@ -75,10 +73,6 @@
return postParam return postParam
}, },
columns, columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
},
pagination: true, pagination: true,
bordered: true, bordered: true,
useSearchForm: true, useSearchForm: true,
@ -108,9 +102,7 @@
isUpdate: true, isUpdate: true,
}) })
} }
function handleSuccess() {
reload()
}
function getSelectData() { function getSelectData() {
return getSelectRows() return getSelectRows()
} }

@ -142,20 +142,23 @@
visible.value = false visible.value = false
} }
function handleAudit(record: Recordable) { function handleAudit(record: Recordable) {
let ApiData: any = { openModal(true, {
queryCondition: `[{"FieldName":"Cntrno","FieldValue":"${record.cntrno}","ConditionalType":1}]`, cntrno: record.cntrno,
otherQueryCondition: '',
pageCondition: {
isExport: false,
pageIndex: 1,
pageSize: 50,
sortConditions: [],
},
}
ApiChangeList(ApiData).then((res) => {
console.log(res)
// visible.value = true
}) })
// // visible.value = true
// let ApiData: any = {
// queryCondition: `[{"FieldName":"Cntrno","FieldValue":"${record.cntrno}","ConditionalType":1}]`,
// otherQueryCondition: '',
// pageCondition: {
// isExport: false,
// pageIndex: 1,
// pageSize: 50,
// sortConditions: [],
// },
// }
// ApiChangeList(ApiData).then((res) => {
// console.log(res)
// })
} }
function handleSuccess() { function handleSuccess() {
reload() reload()

Loading…
Cancel
Save