lilu 2 years ago
commit 6042cb917f

@ -630,3 +630,11 @@ export function getDjyTenantConfig(parameter) {
params: parameter
})
}
// 批量编辑
export function BookingOrderBachUpdate(parameter) {
return axios({
url: '/BookingOrder/BachUpdate',
method: 'post',
data: parameter
})
}

@ -82,7 +82,7 @@
<div class="nav" @click="addBooking"><i class="iconfont icon-jiahao2fill"></i>新建</div>
<div class="nav" @click="copyBooking"><i class="iconfont icon-fuzhi"></i>复制</div>
<div class="nav" @click="copyBookingMore"><i class="iconfont icon-fuzhi1"></i>复制多票</div>
<div class="nav"><i class="iconfont icon-bianjiwenjian"></i>批量编辑</div>
<div class="nav" @click="batchEditing"><i class="iconfont icon-bianjiwenjian"></i>批量编辑</div>
<div class="nav"><i class="iconfont icon-shujushangchuan-shixin"></i>批量VGM</div>
<div class="nav"><i class="iconfont icon-shishijifei"></i>定时订舱</div>
<div class="nav"><i class="iconfont icon-xiaopiaodayin"></i>小票状态</div>
@ -259,11 +259,199 @@
</template>
</a-modal>
<!-- 运踪弹窗 end -->
<!-- 批量编辑 start -->
<a-modal
width="44vw"
:maskClosable="false"
v-model="editingModalVisible"
title="批量编辑"
@ok="editingHandleOk"
@cancel="editingHandleCancel"
>
<div class="trace-box">
<a-form :form="editingForm">
<a-row :gutter="26">
<a-col :span="12" class="book-model-box">
<a-form-item
label="船名"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-select
placeholder="请选择船名"
v-decorator="['vessel', { rules: [{ required: true, message: '请选择船名!' }] }]"
show-search
@focus="vesselSearch"
@search="vesselSearch"
@blur="vesselBlur"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in vesselData" :key="item.name" :value="item.name">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="开船日期"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-date-picker
v-decorator="['etd', { rules: [{ required: true, message: '请选择开船日期!' }] }]"
:style="{ width: '100%' }"
placeholder="请选择开船日期"
valueFormat="YYYY-MM-DD"
/>
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="内部航次"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-input v-decorator="['voynoinner']" />
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="海关航次"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-input v-decorator="['voyno']" />
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="卸货港"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-select
placeholder="请选择卸货港"
v-decorator="['portDischarge']"
show-search
@focus="portDischargeSearch"
@search="portDischargeSearch"
@change="portDischargeChange"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in portDischargeData" :key="item.code" :value="item.enName">
{{ item.enName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="卸货代码"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-input v-decorator="['portDischargeId']" />
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="目的港"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-select
placeholder="请选择目的港"
v-decorator="['destination']"
show-search
@focus="destinationSearch"
@search="destinationSearch"
@change="destinationChange"
:default-active-first-option="false"
:show-arrow="false"
:filter-option="false"
:not-found-content="null"
>
<a-select-option v-for="item in destinationData" :key="item.code" :value="item.enName">
{{ item.enName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="目的代码"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-input v-decorator="['destinationid']" />
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="截港时间"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-date-picker
show-time
v-decorator="['closingdate']"
:style="{ width: '100%' }"
placeholder="请选择截港时间"
valueFormat="YYYY-MM-DD HH"
format="YYYY-MM-DD HH"
/>
</a-form-item>
</a-col>
<a-col :span="12" class="book-model-box">
<a-form-item
label="截单时间"
:labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
:wrapperCol="{ xs: { span: 24 }, sm: { span: 18 } }"
has-feedback
>
<a-date-picker
show-time
v-decorator="['closedocdate']"
:style="{ width: '100%' }"
placeholder="请选择截单时间"
valueFormat="YYYY-MM-DD HH"
format="YYYY-MM-DD HH"
/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
</a-modal>
<!-- 批量编辑 end -->
</div>
</template>
<script>
import { XCard, setFormModel } from '@/components'
import { BookingOrderPage, SendTrace } from '@/api/modular/main/BookingLedger'
import {
BookingOrderPage,
SendTrace,
GetVessellist,
GetPortlist,
BookingOrderBachUpdate
} from '@/api/modular/main/BookingLedger'
import columnSetting from '@/components/tableColumnSetting'
import formLabel from './modules/formLabel'
import initData from './modules/initData'
@ -353,12 +541,19 @@ export default {
remarkScreenY: 0,
remarkData: null,
traceModalVisible: false,
editingModalVisible: false,
traceOptions: [
{ label: '起运港', value: '1' },
{ label: '目的港', value: '2' }
],
traceValue: [],
addNum: 0
addNum: 0,
//
editingForm: this.$form.createForm(this),
vesselData: [],
WebVessel: '',
portDischargeData: [],
destinationData: []
}
},
created() {
@ -375,6 +570,91 @@ export default {
}
},
methods: {
//
editingHandleOk() {
const {
editingForm: { validateFields }
} = this
validateFields((errors, values) => {
if (!errors) {
values.id = []
const select = this.$refs.xGrid.getCheckboxRecords()
select.forEach(item => {
values.id.push(item.id)
})
BookingOrderBachUpdate(values).then(res => {
if (res.success) {
this.$message.success('编辑成功')
this.editingHandleCancel()
} else {
this.$message.error(`编辑失败,${res.message}`)
}
})
} else {
// this.editingModalVisible = false
}
})
},
editingHandleCancel() {
this.editingForm.resetFields()
this.editingModalVisible = false
},
vesselSearch(data) {
if (data) {
this.WebVessel = data
} else if (data === undefined) {
this.WebVessel = data
}
GetVessellist({ KeyWord: data }).then(res => {
this.vesselData = res.data
})
},
vesselBlur() {
if (this.WebVessel !== undefined) {
setTimeout(() => {
this.editingForm.setFieldsValue({
...this.editingForm.getFieldsValue(),
vessel: this.WebVessel
})
}, 100)
}
},
portDischargeSearch(data) {
GetPortlist({ KeyWord: data }).then(res => {
this.portDischargeData = res.data
})
},
portDischargeChange(value) {
this.portDischargeData.forEach(item => {
if (item.enName == value) {
setTimeout(() => {
this.editingForm.setFieldsValue({
...this.editingForm.getFieldsValue(),
portDischargeId: item.ediCode
})
}, 100)
}
})
},
destinationSearch(data) {
GetPortlist({ KeyWord: data }).then(res => {
this.destinationData = res.data
})
},
destinationChange(value) {
this.destinationData.forEach(item => {
if (item.enName == value) {
console.log(item)
setTimeout(() => {
this.editingForm.setFieldsValue({
...this.editingForm.getFieldsValue(),
destinationid: item.ediCode
})
}, 100)
}
})
},
...mapActions(['setBookingList']),
FnCopy(data) {
const el = document.createElement('input')
@ -560,7 +840,7 @@ export default {
const arr = data.map((item, index) => {
return item.label
})
console.log(arr)
this.formRes = {}
DjyUserConfigAdd({
type: 'booking_list_cond',
@ -837,6 +1117,14 @@ export default {
}
this.traceModalVisible = !this.traceModalVisible
},
batchEditing() {
const select = this.$refs.xGrid.getCheckboxRecords()
if (select.length === 0) {
this.$message.error('请选择操作订单')
return false
}
this.editingModalVisible = !this.editingModalVisible
},
onTraceChange(values) {
console.log(this.traceValue)
},

Loading…
Cancel
Save