修改问题

master
sunzehua 1 year ago
parent 3e39e3f6fd
commit cf2f12ffcb

@ -103,7 +103,7 @@ export function BookingTemplate(parameter) {
*/ */
export function GetTemplateShare (parameter) { export function GetTemplateShare (parameter) {
return axios({ return axios({
url: '/BookingTemplate/GetTemplateShare ', url: '/BookingTemplate/GetTemplateShare',
method: 'get', method: 'get',
params: parameter params: parameter
}) })
@ -1025,7 +1025,7 @@ export function BookingCustomerOrderDelete (parameter) {
return axios({ return axios({
url: 'BookingCustomerOrder/Delete', url: 'BookingCustomerOrder/Delete',
method: 'post', method: 'post',
params: parameter data: parameter
}) })
} }

@ -100,6 +100,7 @@ const user = {
} }
const result = response.data const result = response.data
Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000) Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set('FIRSTFLAG', true, 7 * 24 * 60 * 60 * 1000)
commit('SET_TOKEN', result) commit('SET_TOKEN', result)
resolve() resolve()
// eslint-disable-next-line handle-callback-err // eslint-disable-next-line handle-callback-err
@ -122,6 +123,7 @@ const user = {
const result = response.data const result = response.data
console.log(response, 1111) console.log(response, 1111)
Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000) Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
Vue.ls.set('FIRSTFLAG', true, 7 * 24 * 60 * 60 * 1000)
commit('SET_TOKEN', result) commit('SET_TOKEN', result)
resolve() resolve()
}) })

@ -1,8 +1,7 @@
<template> <template>
<div class="main"> <div class="main">
<div class="btn-list"> <div class="btn-list">
<span v-if="details.bookingno">{{ details.bookingno }}</span> <a-button type="primary" v-if="details.bsstatus=='' || !details.bsstatus || details.bsstatus == '已录入' || details.bsstatus == '已驳回'" @click="handleSave"></a-button>
<a-button type="primary" @click="handleSave"></a-button>
<a-button type="primary" @click="handleCopy"></a-button> <a-button type="primary" @click="handleCopy"></a-button>
<a-button type="primary">存为模板</a-button> <a-button type="primary">存为模板</a-button>
<a-button type="danger" v-if="details.bsstatus == '已录入'" @click="handleDelete"></a-button> <a-button type="danger" v-if="details.bsstatus == '已录入'" @click="handleDelete"></a-button>
@ -11,6 +10,8 @@
@click="handleSubimt" @click="handleSubimt"
v-if="details.bsstatus == '已录入' || details.bsstatus == '已驳回'">发送订舱</a-button> v-if="details.bsstatus == '已录入' || details.bsstatus == '已驳回'">发送订舱</a-button>
<a-button type="danger" @click="handleCancle" v-if="details.bsstatus == '已提交'"></a-button> <a-button type="danger" @click="handleCancle" v-if="details.bsstatus == '已提交'"></a-button>
<span v-if="details.bookingno" style="margin: 0 10px;">:</span>
<span v-if="details.bookingno">{{ details.bookingno }}</span>
</div> </div>
<a-spin :spinning="loading"> <a-spin :spinning="loading">
<div class="box"> <div class="box">
@ -147,8 +148,8 @@
:labelCol="labelCol" :labelCol="labelCol"
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
prop="voyno"> prop="contractno">
<inputView type="voyno" :parentVal="details.voyno" @getInputChange="inputChange" /> <inputView type="contractno" :parentVal="details.contractno" @getInputChange="inputChange" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="'4-8'"> <a-col :span="'4-8'">
@ -320,6 +321,7 @@
class="save-btn" class="save-btn"
type="link" type="link"
size="small" size="small"
style="color:black"
icon="save" icon="save"
@click="saveModel('notifyparty')">保存</a-button> @click="saveModel('notifyparty')">保存</a-button>
</div> </div>
@ -365,6 +367,7 @@
<a-button <a-button
class="save-btn" class="save-btn"
type="link" type="link"
style="color: black;"
size="small" size="small"
icon="save" icon="save"
@click="saveModel('description')">保存</a-button> @click="saveModel('description')">保存</a-button>
@ -551,7 +554,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
prop="dunno"> prop="dunno">
<inputView type="dunno" size="small" :parentVal="details.dunno" @getInputChange="inputChange" /> <a-input size="small" v-model="details.dunno" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
@ -562,7 +565,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
prop="dclass"> prop="dclass">
<inputView type="dclass" size="small" :parentVal="details.dclass" @getInputChange="inputChange" /> <a-input size="small" v-model="details.dclass" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
@ -573,7 +576,7 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
prop="linkman"> prop="linkman">
<inputView type="linkman" size="small" :parentVal="details.linkman" @getInputChange="inputChange" /> <a-input size="small" v-model="details.linkman" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span="6">
@ -584,11 +587,11 @@
:wrapperCol="wrapperCol" :wrapperCol="wrapperCol"
has-feedback has-feedback
prop="linkman"> prop="linkman">
<inputView type="linkman" size="small" :parentVal="details.linkman" @getInputChange="inputChange" /> <a-input size="small" v-model="details.linkman" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row style="display: flex;" v-if="details.cargoid == 'D'"> <a-row style="display: flex;" >
<a-upload <a-upload
:customRequest="customRequest" :customRequest="customRequest"
:showUploadList="false" :showUploadList="false"
@ -850,24 +853,25 @@ export default {
ctnList: [] ctnList: []
}, },
rules: { rules: {
tempset: [ linkman: [
{ required: true, message: '请输入', trigger: 'blur' } { required: true, message: '请输入', trigger: 'blur' }
], ],
tempid: [ dclass: [
{ required: true, message: '请选择', trigger: 'blur' } { required: true, message: '请输入', trigger: 'blur' }
], ],
reeferf: [ dunno: [
{ required: true, message: '请输入', trigger: 'blur' } { required: true, message: '请输入', trigger: 'blur' }
], ],
linkman: [ tempset: [
{ required: true, message: '请输入', trigger: 'blur' } { required: true, message: '请输入', trigger: 'blur' }
], ],
dclass: [ tempid: [
{ required: true, message: '请选择', trigger: 'blur' } { required: true, message: '请选择', trigger: 'blur' }
], ],
dunno: [ reeferf: [
{ required: true, message: '请输入', trigger: 'blur' } { required: true, message: '请输入', trigger: 'blur' }
] ]
}, },
loading: false loading: false
} }
@ -998,98 +1002,100 @@ export default {
}) })
}, },
handleSave() { handleSave() {
console.log(this.details)
this.$refs.basicFrom.validate(valid => { this.$refs.basicFrom.validate(valid => {
if (valid) { if (valid) {
const data = { const data = {
...this.details ...this.details
} }
if (!this.details.serviceList) { if (!this.details.serviceList) {
this.details.serviceList = [] this.details.serviceList = []
} }
if (this.details.serviceList.length > 0) { if (this.details.serviceList.length > 0) {
const arr = [] const arr = []
this.options.forEach(item => { this.options.forEach(item => {
this.details.serviceList.forEach(ite => { this.details.serviceList.forEach(ite => {
if (item.code === ite) { if (item.code === ite) {
arr.push({ arr.push({
code: item.code, code: item.code,
value: item.name value: item.name
})
}
})
})
data.serviceItemList = arr
} else {
data.serviceItemList = []
}
if (!this.isCopy) {
const filesArr = []
const tempFileNamesArr = []
if (this.fileList.length > 0) {
this.fileList.forEach(item => {
if (item.id.indexOf('\\') != -1) {
tempFileNamesArr.push(item.id)
} else {
filesArr.push(item.id)
}
}) })
} }
}) data.files = filesArr
}) data.tempFileNames = tempFileNamesArr
data.serviceItemList = arr }
} else { if (data.ctnList.length > 0) {
data.serviceItemList = [] data.ctnList.forEach(item => {
} delete item._X_ROW_KEY
if (data.cargoid === 'D' && !this.isCopy) { delete item.oper
const filesArr = [] this.ctnallList.forEach(ite => {
const tempFileNamesArr = [] if (ite.code === item.ctncode) {
if (this.fileList.length > 0) { item.ctnall = ite.name
this.fileList.forEach(item => { }
if (item.id.indexOf('\\') != -1) { })
tempFileNamesArr.push(item.id) if (this.isCopy) {
} else { delete item.id
filesArr.push(item.id) }
} })
}) }
} if (data.files && Object.values(data.files).length === 0) {
data.files = filesArr delete data.files
data.tempFileNames = tempFileNamesArr }
} if (!data.id && !this.isCopy) {
if (data.ctnList.length > 0) { data.id = this.id
data.ctnList.forEach(item => {
delete item._X_ROW_KEY
delete item.oper
this.ctnallList.forEach(ite => {
if (ite.code === item.ctncode) {
item.ctnall = ite.name
}
})
if (this.isCopy) {
delete item.id
} }
})
}
if (data.files && Object.values(data.files).length === 0) {
delete data.files
}
if (!data.id && !this.isCopy) {
data.id = this.id
}
this.loading = true this.loading = true
BookingCustomerOrderSave(data).then(res => { BookingCustomerOrderSave(data).then(res => {
if (res.success) { if (res.success) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.loading = false this.loading = false
this.id = res.data.id this.id = res.data.id
if (this.isCopy || this.isAdd) { this.getDetail()
this.$router.replace({ setTimeout(() => {
name: 'BookingCustomerDetail', if (this.isCopy || this.isAdd) {
query: { this.$router.replace({
id: res.data.id, name: 'BookingCustomerDetail',
noOpenTab: true query: {
id: res.data.id,
noOpenTab: true
}
})
if (this.isCopy) {
this.isCopy = false
}
}
}, 500);
} else {
this.loading = false
this.$message.error(res.message)
} }
}) })
if (this.isCopy) {
this.isCopy = false
}
}
} else { } else {
this.loading = false this.$message.warning('请检查必填项')
this.$message.error(res.message)
}
})
} }
console.log(valid)
}) })
}, },
handleDelete() { handleDelete() {
const data = { BookingCustomerOrderDelete([this.id]).then(res => {
id: this.id
}
BookingCustomerOrderDelete(data).then(res => {
if (res.success) { if (res.success) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.$router.push({ path: 'BookingCustomerLedger' }) this.$router.push({ path: 'BookingCustomerLedger' })

@ -69,8 +69,8 @@
<div class="nav-box"> <div class="nav-box">
<div class="nav" @click="addBooking"><i class="iconfont icon-jiahao2fill"></i>新建</div> <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="copyBooking"><i class="iconfont icon-fuzhi"></i>复制</div>
<div class="nav" @click="copyBooking"><i class="iconfont icon-fuzhi"></i>导入</div> <div class="nav" ><i class="iconfont icon-fuzhi"></i>导入</div>
<div class="nav" @click="copyBooking"><i class="iconfont icon-fuzhi"></i>模板</div> <div class="nav" ><i class="iconfont icon-fuzhi"></i>模板</div>
<a-popconfirm <a-popconfirm
title="确定删除当前选中订舱?" title="确定删除当前选中订舱?"
ok-text="是" ok-text="是"
@ -1845,10 +1845,7 @@ export default {
this.deleteBookingOrder(removeArr) this.deleteBookingOrder(removeArr)
}, },
removeFun(row) { removeFun(row) {
const data = { BookingCustomerOrderDelete([row.id]).then(res => {
id: row.id
}
BookingCustomerOrderDelete(data).then(res => {
if (res.success) { if (res.success) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.init(this.searchData) this.init(this.searchData)
@ -1858,15 +1855,11 @@ export default {
}) })
}, },
deleteBookingOrder(arr) { deleteBookingOrder(arr) {
DeleteBookingOrder(arr.toString()) BookingCustomerOrderDelete(arr)
.then((res) => { .then((res) => {
if (res.success) { if (res.success) {
this.$message.success('删除成功') this.$message.success('删除成功')
const _data = this.gridOptions.data.filter((item) => !arr.includes(item.id)) this.init(this.searchData)
this.$refs.xGrid.reloadData(_data).then(() => {
this.gridOptions.pagerConfig.total = this.gridOptions.pagerConfig.total - arr.length
})
this.$forceUpdate()
} else { } else {
this.$message.error(res.message) this.$message.error(res.message)
} }

Loading…
Cancel
Save