重构海运出口

szh-new
lijingjia 6 months ago
parent d8c3883d59
commit c545b3eab6

@ -27,7 +27,7 @@
</a-dropdown> </a-dropdown>
</div> </div>
<!-- <a-popconfirm <a-popconfirm
title="确定删除当前选中订舱?" title="确定删除当前选中订舱?"
ok-text="是" ok-text="是"
cancel-text="否" cancel-text="否"
@ -36,7 +36,7 @@
> >
<div class="nav"><i class="iconfont icon-shanchu2"></i>删除</div> <div class="nav"><i class="iconfont icon-shanchu2"></i>删除</div>
</a-popconfirm> </a-popconfirm>
<div class="nav"><i class="iconfont icon-shishijifei"></i>定时订舱</div> <!-- <div class="nav"><i class="iconfont icon-shishijifei"></i>定时订舱</div>
<div class="nav" @click="handleSearchTxxp"> <div class="nav" @click="handleSearchTxxp">
<a-spin :spinning="txxpLoading"> <a-spin :spinning="txxpLoading">
@ -104,7 +104,7 @@
</a-form> </a-form>
</a-modal> </a-modal>
<!-- 批量操作 --> <!-- 批量操作 -->
<BatchModification @register="registerModal" @success="BMSuccess" /> <!-- <BatchModification v-if="batchFlag" @register="registerModal" @success="BMSuccess" /> -->
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -113,7 +113,8 @@
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
import { useRouter } from 'vue-router' import { useRouter } from 'vue-router'
import { useModal } from '/@/components/Modal' import { useModal } from '/@/components/Modal'
import BatchModification from '../modules/BatchModification.vue' import { SeaExportBatchDel } from '../api/BookingLedger.js'
// import BatchModification from '../modules/BatchModification.vue'
const router = useRouter() const router = useRouter()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const go = useGo() const go = useGo()
@ -176,6 +177,8 @@
} }
// //
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
//
const batchFlag = ref(false)
// //
function batchEditing() { function batchEditing() {
const select = props.selectRow() const select = props.selectRow()
@ -186,11 +189,41 @@
const removeArr = select.map((item) => { const removeArr = select.map((item) => {
return item.id return item.id
}) })
openModal(true, { removeArr, flag: true }) batchFlag.value = true
openModal(true, { removeArr })
} }
function BMSuccess() { function BMSuccess() {
props.reload() props.reload()
} }
//
function removeMoreFun() {
const select = props.selectRow()
if (select.length === 0) {
createMessage.warning('请选择操作订单!')
return false
}
const removeArr = select.map((item) => {
return item.id
})
deleteBookingOrder(removeArr)
}
//
function deleteBookingOrder(arr) {
let api = []
arr.forEach((e, i) => {
api.push(e)
})
SeaExportBatchDel({ ids: api })
.then((res) => {
if (res.succeeded) {
createMessage.success('删除成功!')
props.reload()
}
})
.catch((err) => {
console.log(err)
})
}
</script> </script>
<style lang="scss"> <style lang="scss">

@ -1055,15 +1055,6 @@
} }
// //
function deleteBookingOrder(arr) { function deleteBookingOrder(arr) {
// let api = ''
// arr.forEach((e, i) => {
// if (i == 0) {
// api = `?Ids=${e}`
// } else {
// api = `${api}&Ids=${e}`
// }
// })
// console.log(api);
let api = [] let api = []
arr.forEach((e, i) => { arr.forEach((e, i) => {
api.push(e) api.push(e)

@ -4,7 +4,6 @@
:use-wrapper="true" :use-wrapper="true"
title="批量编辑" title="批量编辑"
width="50%" width="50%"
v-if="flag"
@register="registerModal" @register="registerModal"
@opened="afterModalOpened" @opened="afterModalOpened"
@ok="handleSave" @ok="handleSave"
@ -35,7 +34,7 @@
import { ref, computed, unref } from 'vue' import { ref, computed, unref } from 'vue'
import { BasicModal, useModalInner } from '/@/components/Modal' import { BasicModal, useModalInner } from '/@/components/Modal'
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { BatchModificationFormSchema } from '../columns' import { BatchModificationFormSchema } from '../detail/columns'
import { SeaExportBatchEdit } from '../api/BookingLedger.js' import { SeaExportBatchEdit } from '../api/BookingLedger.js'
import { useMessage } from '/@/hooks/web/useMessage' import { useMessage } from '/@/hooks/web/useMessage'
// Emits // Emits
@ -52,7 +51,6 @@
const ids = ref() const ids = ref()
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields() resetFields()
flag.value = true
setModalProps({ confirmLoading: false, loading: true }) setModalProps({ confirmLoading: false, loading: true })
ids.value = data.removeArr ids.value = data.removeArr
setModalProps({ loading: false }) setModalProps({ loading: false })

Loading…
Cancel
Save