修改bug
parent
1cf6ff214d
commit
943e1c306c
@ -0,0 +1,506 @@
|
||||
<template>
|
||||
<a-modal v-model="SlotVisible" title="生成方式选择" @ok="handleOk1" width="40%">
|
||||
<a-spin :spinning="spinning">
|
||||
<a-form class="Editing">
|
||||
<a-radio-group v-model="CreateData.generateMethod" v-if="type == 'A'">
|
||||
<a-radio value="UPD_BOOKING">
|
||||
更新订舱
|
||||
</a-radio>
|
||||
<a-radio value="GEN_BOOKING_SLOT">
|
||||
直接生成舱位和订舱
|
||||
</a-radio>
|
||||
<a-radio value="GEN_BOOKING">
|
||||
只生成订舱
|
||||
</a-radio>
|
||||
<a-radio value="GEN_SLOT">
|
||||
只生成舱位
|
||||
</a-radio>
|
||||
<a-radio value="GEN_EXIST_BOOKING">
|
||||
匹配已有订舱
|
||||
</a-radio>
|
||||
</a-radio-group>
|
||||
<!-- <a-checkbox style="margin-top: 10px;" v-model="CreateData.isDirectSend">是否直接发送邮件给订舱联系人</a-checkbox> -->
|
||||
<a-row>
|
||||
<a-col :span="16">
|
||||
<a-form-item label="委托单位:" :label-col="formItemLayout.labelCol3" :wrapper-col="formItemLayout.wrapperCol3">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.customerId"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchCustomer"
|
||||
@change="ChangeCustomer">
|
||||
<a-select-option v-for="(item, index) in CustomerList" :key="index" :value="item.id">
|
||||
{{ item.shortName }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-spin :spinning="fetching">
|
||||
<a-form-item label="联系人:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
mode="multiple"
|
||||
v-model="CreateData.customerContactId"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@change="handleChangeUser"
|
||||
@search="SearchUser">
|
||||
<a-select-option v-for="item in customerByList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-spin>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row style="padding-left: 20px;margin-bottom: 10px">
|
||||
<span style="margin-right: 10px;" v-for="(item, index) in userInfoList" :key="index">
|
||||
{{ item.name }} {{ item.email }}
|
||||
</span>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="销售:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.saleId"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchUser"
|
||||
@change="e => {
|
||||
ChangeUser(e, 'saleName')
|
||||
}
|
||||
">
|
||||
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="操作:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.opId"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchUser"
|
||||
@change="e => {
|
||||
ChangeUser(e, 'opName')
|
||||
}
|
||||
">
|
||||
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="单证:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.docId"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchUser"
|
||||
@change="e => {
|
||||
ChangeUser(e, 'docName')
|
||||
}
|
||||
">
|
||||
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="客服:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.custserviceId"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchUser"
|
||||
@change="e => {
|
||||
ChangeUser(e, 'custserviceName')
|
||||
}
|
||||
">
|
||||
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="航线操作:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.routeID"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchUser"
|
||||
@change="e => {
|
||||
ChangeUser(e, 'route')
|
||||
}
|
||||
">
|
||||
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="8">
|
||||
<a-form-item label="航线管理:" :label-col="formItemLayout.labelCol2" :wrapper-col="formItemLayout.wrapperCol2">
|
||||
<a-select
|
||||
show-search
|
||||
v-model="CreateData.lineManageID"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
@search="SearchUser"
|
||||
@change="e => {
|
||||
ChangeUser(e, 'lineManage')
|
||||
}
|
||||
">
|
||||
<a-select-option v-for="item in UserList" :key="item.id" :value="item.id">
|
||||
{{ item.name }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="16">
|
||||
<a-form-item label="操作备注:" :label-col="formItemLayout.labelCol3" :wrapper-col="formItemLayout.wrapperCol3">
|
||||
<a-input v-model="CreateData.czRemark" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="16">
|
||||
<a-form-item label="申请箱使:" :label-col="formItemLayout.labelCol3" :wrapper-col="formItemLayout.wrapperCol3">
|
||||
<a-input v-model="CreateData.shenQingXiangShi" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row>
|
||||
<a-col :span="16">
|
||||
<a-form-item label="服务项目:" :label-col="formItemLayout.labelCol3" :wrapper-col="formItemLayout.wrapperCol3">
|
||||
<div class="content">
|
||||
<div
|
||||
class="items"
|
||||
v-for="(serive, sindex) in bookingServiceItem"
|
||||
:key="sindex"
|
||||
:class="{ active: serive.isYield }"
|
||||
@click="saveService(serive)">
|
||||
{{ serive.serviceProjectName }}
|
||||
</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { DjyCustomerSuggest, GetSysUserPage, DjyCustomerContacts, DjyCustomerdetail } from '@/api/modular/main/BookingLedger'
|
||||
import { GetProjectList, CreateBookingAndSlot, GetBookingOrder } from '@/api/modular/main/TaskmanageList'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { ValidateCreateBookingOrder, CreateBooking0rder } from '@/api/modular/main/CompanySiteaccount'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
SlotVisible: false,
|
||||
formItemLayout: {
|
||||
labelCol1: { span: 6 },
|
||||
wrapperCol1: { span: 18 },
|
||||
labelCol2: { span: 8 },
|
||||
wrapperCol2: { span: 16 },
|
||||
labelCol3: { span: 4 },
|
||||
wrapperCol3: { span: 20 },
|
||||
labelCol4: { span: 8 },
|
||||
wrapperCol4: { span: 16 },
|
||||
labelCol5: { span: 14 },
|
||||
wrapperCol5: { span: 10 },
|
||||
labelCol6: { span: 8 },
|
||||
wrapperCol6: { span: 16 }
|
||||
},
|
||||
CreateData: {
|
||||
saleId: '',
|
||||
opId: '',
|
||||
docId: '',
|
||||
custserviceId: ''
|
||||
},
|
||||
CustomerList: [],
|
||||
UserList: [],
|
||||
fetching: false,
|
||||
spinning: false,
|
||||
customerByList: [],
|
||||
type: '',
|
||||
userInfoList: [],
|
||||
slotEdit: {},
|
||||
bookingServiceItem: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'userInfo'
|
||||
])
|
||||
},
|
||||
mounted() {
|
||||
DjyCustomerSuggest({ keyword: '', type: 'consignor' }).then(res => {
|
||||
this.CustomerList = res.data.rows
|
||||
})
|
||||
GetProjectList().then(res => {
|
||||
res.data.forEach(item => {
|
||||
item.isYield = false
|
||||
})
|
||||
this.bookingServiceItem = res.data
|
||||
})
|
||||
GetSysUserPage().then(res => {
|
||||
this.UserList = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleOk1() {
|
||||
if (this.type == 'A') {
|
||||
this.handleOkA()
|
||||
} else {
|
||||
const projectList = []
|
||||
this.bookingServiceItem.forEach(item => {
|
||||
if (item.isYield) {
|
||||
projectList.push(item.serviceProjectCode)
|
||||
}
|
||||
})
|
||||
|
||||
const ApiData = {
|
||||
slotId: this.slotEdit.id,
|
||||
projectList,
|
||||
...this.CreateData
|
||||
}
|
||||
this.spinning = true
|
||||
CreateBooking0rder(ApiData).then(res => {
|
||||
if (res.success) {
|
||||
this.SlotVisible = false
|
||||
this.$message.success(res.message)
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
this.spinning = false
|
||||
})
|
||||
}
|
||||
},
|
||||
saveService(data) {
|
||||
data.isYield = !data.isYield
|
||||
},
|
||||
init1() {
|
||||
this.CreateData = {
|
||||
generateMethod: 'GEN_BOOKING',
|
||||
customerList: [],
|
||||
isDirectSend: false
|
||||
}
|
||||
this.UserList.forEach(item => {
|
||||
if (item.id == this.userInfo.id) {
|
||||
this.CreateData.opId = item.id
|
||||
this.CreateData.opName = item.name
|
||||
}
|
||||
})
|
||||
this.type = 'A'
|
||||
this.userInfoList = []
|
||||
this.$forceUpdate()
|
||||
this.SlotVisible = true
|
||||
},
|
||||
init(row) {
|
||||
this.type = 'B'
|
||||
this.userInfoList = []
|
||||
this.$forceUpdate()
|
||||
this.CreateData = {}
|
||||
this.SlotVisible = true
|
||||
this.spinning = true
|
||||
ValidateCreateBookingOrder({ id: row.id }).then(res => {
|
||||
if (res.success) {
|
||||
this.slotEdit = row
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
this.spinning = false
|
||||
})
|
||||
},
|
||||
init2() {
|
||||
this.SlotVisible = true
|
||||
this.spinning = true
|
||||
this.userInfoList = []
|
||||
this.$forceUpdate()
|
||||
this.type = 'A'
|
||||
GetBookingOrder({ taskPkId: this.$route.query.taskPKId }).then(res => {
|
||||
if (res.data.ext) {
|
||||
this.CreateData = {
|
||||
generateMethod: 'UPD_BOOKING',
|
||||
customerList: [],
|
||||
isDirectSend: false,
|
||||
...res.data.ext
|
||||
}
|
||||
} else {
|
||||
this.CreateData = {
|
||||
generateMethod: 'UPD_BOOKING',
|
||||
customerList: [],
|
||||
isDirectSend: false
|
||||
}
|
||||
}
|
||||
this.spinning = false
|
||||
})
|
||||
},
|
||||
handleOkA() {
|
||||
const projectList = []
|
||||
this.bookingServiceItem.forEach(item => {
|
||||
if (item.isYield) {
|
||||
projectList.push(item.serviceProjectCode)
|
||||
}
|
||||
})
|
||||
|
||||
const ApiData = {
|
||||
bcTaskId: this.$route.query.taskPKId,
|
||||
projectList,
|
||||
...this.CreateData
|
||||
}
|
||||
if (this.CreateData.customerList.length > 0) {
|
||||
const arr = []
|
||||
this.customerByList.forEach(item => {
|
||||
this.CreateData.customerList.forEach(ite => {
|
||||
if (ite == item.id) {
|
||||
arr.push({
|
||||
customerContactId: item.id,
|
||||
customerContactName: item.name
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
ApiData.customerContactList = arr
|
||||
}
|
||||
this.spinning = true
|
||||
console.log(ApiData)
|
||||
CreateBookingAndSlot(ApiData).then(res => {
|
||||
if (res.data.succ) {
|
||||
this.visible = false
|
||||
this.$message.success(res.data.msg)
|
||||
} else {
|
||||
this.$message.error(res.data.msg)
|
||||
}
|
||||
this.spinning = false
|
||||
})
|
||||
},
|
||||
SearchCustomer(e) {
|
||||
DjyCustomerSuggest({ keyword: e, type: 'consignor' }).then(res => {
|
||||
this.CustomerList = res.data.rows
|
||||
})
|
||||
},
|
||||
handleChangeUser(val) {
|
||||
const arr = []
|
||||
this.customerByList.forEach(item => {
|
||||
val.forEach(ite => {
|
||||
if (item.id == ite) {
|
||||
arr.push(item)
|
||||
}
|
||||
})
|
||||
})
|
||||
this.userInfoList = arr
|
||||
},
|
||||
SearchUser(e) {
|
||||
GetSysUserPage({ name: e }).then(res => {
|
||||
this.UserList = res.data
|
||||
})
|
||||
},
|
||||
ChangeUser(e, Tname) {
|
||||
this.UserList.forEach(item => {
|
||||
if (item.id == e) {
|
||||
this.CreateData[Tname] = item.name
|
||||
}
|
||||
})
|
||||
},
|
||||
ChangeCustomer(e) {
|
||||
this.customerByList = []
|
||||
this.CreateData.customerContactId = []
|
||||
this.CustomerList.forEach(item => {
|
||||
if (item.id == e) {
|
||||
this.CreateData.customerName = item.shortName
|
||||
}
|
||||
})
|
||||
this.fetching = true
|
||||
// DjyCustomerContacts({ customerId: e }).then(res => {
|
||||
// if (res.success) {
|
||||
// this.customerByList = res.data
|
||||
// } else {
|
||||
// this.$message.error(res.message)
|
||||
// }
|
||||
// this.fetching = false
|
||||
// })
|
||||
DjyCustomerdetail({ id: e }).then(res => {
|
||||
if (res.success) {
|
||||
this.customerByList = res.data.contacts
|
||||
if (res.data.custserviceid) {
|
||||
this.CreateData.custserviceId = Number(res.data.custserviceid)
|
||||
this.CreateData.custserviceName = res.data.doc
|
||||
} else {
|
||||
this.CreateData.custserviceId = ''
|
||||
this.CreateData.custserviceName = ''
|
||||
}
|
||||
if (res.data.docid) {
|
||||
this.CreateData.docId = Number(res.data.docid)
|
||||
this.CreateData.docName = res.data.custservice
|
||||
} else {
|
||||
this.CreateData.docId = ''
|
||||
this.CreateData.docName = ''
|
||||
}
|
||||
if (res.data.opid) {
|
||||
this.CreateData.opId = Number(res.data.opid)
|
||||
this.CreateData.opName = res.data.op
|
||||
} else {
|
||||
this.CreateData.opId = ''
|
||||
this.CreateData.opName = ''
|
||||
}
|
||||
if (res.data.saleid) {
|
||||
this.CreateData.saleId = Number(res.data.saleid)
|
||||
this.CreateData.saleName = res.data.sale
|
||||
} else {
|
||||
this.CreateData.saleId = ''
|
||||
this.CreateData.saleName = ''
|
||||
}
|
||||
this.$forceUpdate()
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
}
|
||||
this.fetching = false
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import url('../../views/main/BookingLedger/detail/style/rightContent.less');
|
||||
|
||||
/deep/ .ant-form-item {
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue