szh_zidingyibiaoti
lilu 2 years ago
commit 043e94ec3c

@ -771,3 +771,19 @@ export function DeleteBookingOrder(parameter) {
method: 'post' method: 'post'
}) })
} }
// 获取货物状态
export function BookingOrderGetGoodsStatusList(parameter) {
return axios({
url: '/BookingOrder/GetGoodsStatusList',
method: 'get',
params: parameter
})
}
// 增加货物状态
export function BookingOrderSaveGoodsStatus(parameter) {
return axios({
url: '/BookingOrder/SaveGoodsStatus',
method: 'post',
data: parameter
})
}

@ -413,7 +413,18 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters(['bookingList', 'needSavePages', 'hasbookingDetail', 'bookingList', 'bookingGridOptions', 'carrierList', 'yardList', 'packageList', 'issuetypeList', 'blfrtList']) ...mapGetters([
'bookingList',
'needSavePages',
'hasbookingDetail',
'bookingList',
'bookingGridOptions',
'carrierList',
'yardList',
'packageList',
'issuetypeList',
'blfrtList'
])
}, },
created() { created() {
this.init() this.init()
@ -1388,5 +1399,4 @@ export default {
display: none !important; display: none !important;
} }
} }
</style> </style>

@ -41,6 +41,41 @@
</div> </div>
</div> </div>
</a-card> </a-card>
<a-card :bodyStyle="tstyle" :bordered="false">
<div class="title"><i class="iconfont icon-fuwu"></i><span>货物状态</span></div>
<div class="content">
<div
class="items"
v-for="serive in booGoodsStatusItem"
:key="serive.systemCode"
:class="{ active: locaGoodsStatus.includes(serive.systemCode) }"
@click="saveGoodsStatus(serive)"
>
{{ serive.statusName }}
<div class="edit" @click.stop="FnOpenEdit(serive)"><a-icon type="edit" /></div>
</div>
</div>
</a-card>
<a-modal v-model="GoodsStatusVisible" width="600px" title="编辑" @ok="GoodsStatusHandleOk">
<a-form :form="StatusVisibleForm">
<a-row>
<a-col :span="12">
<a-form-item label="完成时间" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-date-picker
show-time
placeholder="完成时间"
v-decorator="['finishTime', { rules: [{ required: true, message: '请选择完成时间!' }] }]"
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="备注" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input placeholder="请输入备注" v-decorator="['remark']" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-modal>
<a-card :bodyStyle="tstyle" :bordered="false"> <a-card :bodyStyle="tstyle" :bordered="false">
<div class="title"> <div class="title">
<i class="iconfont icon-beizhu1"></i><span>备注</span> <i class="iconfont icon-beizhu1"></i><span>备注</span>
@ -230,7 +265,9 @@ import {
ExcuteRulesOceanBooking, ExcuteRulesOceanBooking,
BookingOrderDownload, BookingOrderDownload,
BookingOrderDeleteRemark, BookingOrderDeleteRemark,
SaveServiceItem SaveServiceItem,
BookingOrderGetGoodsStatusList,
BookingOrderSaveGoodsStatus
} from '@/api/modular/main/BookingLedger' } from '@/api/modular/main/BookingLedger'
export default { export default {
@ -275,11 +312,22 @@ export default {
uploading: false, uploading: false,
realTimePercent: null, realTimePercent: null,
bookingServiceItem: [], bookingServiceItem: [],
booGoodsStatusItem: [],
bookingAttachType: [], bookingAttachType: [],
attachName: '', attachName: '',
attachCode: '', attachCode: '',
editRemarkVal: null editRemarkVal: null,
// locaService: [], GoodsStatusVisible: false,
GoodsStatusEditData: {},
StatusVisibleForm: this.$form.createForm(this),
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 15 }
}
// serviceData: [] // serviceData: []
} }
}, },
@ -291,6 +339,25 @@ export default {
return this.details.item.map((item, index) => { return this.details.item.map((item, index) => {
return item.code return item.code
}) })
},
locaGoodsStatus() {
if (!this.details) {
return []
}
if (this.details.goodsStatus) {
// return this.details.goodsStatus.map((item, index) => {
// return item.systemCode
// })
let data = []
this.details.goodsStatus.forEach(item => {
if (item.finishTime) {
data.push(item.systemCode)
}
})
return data
} else {
return []
}
} }
}, },
created() { created() {
@ -316,6 +383,9 @@ export default {
init() { init() {
this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type') this.bookingAttachType = this.$options.filters['dictData']('booking_attach_type')
this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item') this.bookingServiceItem = this.$options.filters['dictData']('booking_service_item')
BookingOrderGetGoodsStatusList({ bookingId: this.id }).then(res => {
this.booGoodsStatusItem = res.data
})
}, },
// //
checkFun() { checkFun() {
@ -490,6 +560,7 @@ export default {
this.details.log[index].showMore = !this.details.log[index].showMore this.details.log[index].showMore = !this.details.log[index].showMore
this.$forceUpdate() this.$forceUpdate()
}, },
saveService(data) { saveService(data) {
if (!this.id) { if (!this.id) {
this.$message.error('请先保存主单') this.$message.error('请先保存主单')
@ -522,6 +593,163 @@ export default {
.catch(err => { .catch(err => {
console.log(err) console.log(err)
}) })
},
GoodsStatusHandleOk() {
const {
StatusVisibleForm: { validateFields }
} = this
this.GoodsStatusVisible = true
validateFields((errors, values) => {
if (!errors) {
for (const key in values) {
console.log(key, 1)
if (typeof values[key] === 'object' && !(values[key] === null)) {
values[key] = JSON.stringify(values[key])
}
}
console.log('计算时间')
console.log(values.finishTime)
let date = ''
if (values.finishTime._d) {
date = new Date(+new Date(values.finishTime._d) + 8 * 3600 * 1000)
} else {
console.log(values.finishTime.split('"'))
if (values.finishTime.split('"').length == 3) {
date = new Date(+new Date(values.finishTime.split('"')[1]))
} else {
date = new Date(+new Date(values.finishTime) + 8 * 3600 * 1000)
}
}
console.log(date)
let data = {
finishTime: date.toISOString(),
remark: values.remark
}
console.log(this.GoodsStatusEditData, data)
let AData = { ...this.GoodsStatusEditData, ...data }
console.log(AData)
console.log('改变样式及数据')
if (!this.id) {
this.$message.error('请先保存主单')
return false
}
if (!this.locaGoodsStatus.includes(this.GoodsStatusEditData.systemCode)) {
this.locaGoodsStatus.push(this.GoodsStatusEditData.systemCode)
this.details.goodsStatus.push({ ...this.GoodsStatusEditData })
}
console.log('编辑请求数据')
let ApiData = {
bookingId: this.id,
item: []
}
this.details.goodsStatus.forEach(item => {
if (item.systemCode == AData.systemCode) {
console.log(true)
ApiData.item.push(AData)
} else {
console.log(false)
ApiData.item.push(item)
}
})
console.log('走接口')
BookingOrderSaveGoodsStatus(ApiData)
.then(res => {
if (res.success) {
this.booGoodsStatusItem = ApiData.item
// this.$emit('upDateRight')
console.log('== 货物状态设置成功 ==')
this.$message.success('货物状态设置成功')
this.GoodsStatusVisible = false
}
})
.catch(err => {
console.log(err)
})
} else {
// this.GoodsStatusVisible = false
}
})
// this.GoodsStatusVisible = false
},
FnOpenEdit(data) {
console.log(data)
setTimeout(() => {
console.log(data)
this.StatusVisibleForm.setFieldsValue({
finishTime: data.finishTime ? data.finishTime : '',
remark: data.remark ? data.remark : ''
})
this.GoodsStatusEditData = data
this.GoodsStatusVisible = true
}, 100)
},
saveGoodsStatus(data) {
console.log(data)
if (!this.id) {
this.$message.error('请先保存主单')
return false
}
if (!this.locaGoodsStatus.includes(data.systemCode)) {
this.locaGoodsStatus.push(data.systemCode)
this.details.goodsStatus.push({ ...data })
this.savegoodsStatusItem(data, 'push')
} else {
let that = this
this.$confirm({
title: '是否取消',
okText: '是',
okType: 'danger',
cancelText: '否',
onOk() {
const index = that.locaGoodsStatus.indexOf(data.systemCode)
that.locaGoodsStatus.splice(index, 1)
that.details.goodsStatus.splice(index, 1)
that.savegoodsStatusItem(data, 'splice')
},
onCancel() {
console.log('Cancel')
return false
}
})
// this.$Modal.confirm({
// title: () => '?',
// icon: () => createVNode(ExclamationCircleOutlined),
// okText: () => '',
// okType: 'danger',
// cancelText: () => '',
// onOk() {
// },
// onCancel() {
// console.log('Cancel')
// return false
// }
// })
}
console.log('== 修改货物状态 ==', this.locaGoodsStatus, this.details.goodsStatus)
},
savegoodsStatusItem(data, type) {
let ApiData = {
bookingId: this.id,
item: this.details.goodsStatus
}
if (type == 'push') {
let date = new Date(+new Date() + 8 * 3600 * 1000)
ApiData.item[ApiData.item.length - 1].finishTime = date.toISOString()
}
console.log(ApiData)
BookingOrderSaveGoodsStatus(ApiData)
.then(res => {
if (res.success) {
// this.booGoodsStatusItem = ApiData.item
// this.$emit('upDateRight')
console.log('== 货物状态设置成功 ==')
}
})
.catch(err => {
console.log(err)
})
} }
} }
} }

@ -107,7 +107,21 @@
margin-right: 10px; margin-right: 10px;
font-size: 13px; font-size: 13px;
cursor: pointer; cursor: pointer;
position: relative;
.edit{
width: 17px;
height: 17px;
border-radius: 0 3px 0 0;
background: #c9c9c9;
display: none;
position: absolute;
right: -1px;
top: -1px;
text-align: center;
line-height: 17px;
}
&:hover { &:hover {
border: 1px dashed @primary-color; border: 1px dashed @primary-color;
position: relative; position: relative;
&::before { &::before {
@ -121,6 +135,9 @@
left: 0; left: 0;
border-radius: 4px; border-radius: 4px;
} }
.edit{
display: block;
}
} }
&.active { &.active {
background: @primary-color; background: @primary-color;

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<a-card :bordered="false" :bodyStyle="tstyle"> <!-- <a-card :bordered="false" :bodyStyle="tstyle">
<div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'"> <div class="table-page-search-wrapper" :class="advanced ? 'Open' : 'Close'">
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="48"> <a-row :gutter="48">
@ -17,16 +17,16 @@
<span class="table-page-search-submitButtons"> <span class="table-page-search-submitButtons">
<a-button type="primary" @click="FnQuery"></a-button> <a-button type="primary" @click="FnQuery"></a-button>
<a-button style="margin-left: 8px" @click="FnReset"></a-button> <a-button style="margin-left: 8px" @click="FnReset"></a-button>
<!-- <a @click="toggleAdvanced" style="margin-left: 8px"> <a @click="toggleAdvanced" style="margin-left: 8px">
{{ advanced ? '收起' : '展开' }} {{ advanced ? '收起' : '展开' }}
<a-icon :type="advanced ? 'up' : 'down'" /> <a-icon :type="advanced ? 'up' : 'down'" />
</a> --> </a>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
</a-card> </a-card> -->
<a-card :bordered="false"> <a-card :bordered="false">
<vxe-toolbar> <vxe-toolbar>
<template #buttons> <template #buttons>
@ -41,7 +41,7 @@
resizable resizable
round round
:loading="loading" :loading="loading"
height="600px" height="700px"
empty-text="没有更多数据了!" empty-text="没有更多数据了!"
> >
<vxe-column type="seq" width="50" fixed="left"></vxe-column> <vxe-column type="seq" width="50" fixed="left"></vxe-column>
@ -128,10 +128,12 @@ export default {
} }
}) })
this.DisplayLoadData = Rdata this.DisplayLoadData = Rdata
this.init()
}, },
FnReset() { FnReset() {
this.queryParam = {} this.queryParam = { currentPage: 1, pageSize: 9999, Type: 'booking_default_value' }
this.DisplayLoadData = this.loadData this.DisplayLoadData = this.loadData
this.init()
}, },
confirm(e) { confirm(e) {
this.FnDel(e) this.FnDel(e)

@ -28,7 +28,7 @@
:columns="columns" :columns="columns"
:data="loadData" :data="loadData"
:alert="true" :alert="true"
:rowKey="(record) => record.id" :rowKey="record => record.id"
:rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
> >
<template slot="operator" v-if="hasPerm('sysRole:add')"> <template slot="operator" v-if="hasPerm('sysRole:add')">
@ -48,9 +48,9 @@
<a-menu-item v-if="hasPerm('sysRole:grantMenu')"> <a-menu-item v-if="hasPerm('sysRole:grantMenu')">
<a @click="$refs.roleMenuForm.roleMenu(record)"></a> <a @click="$refs.roleMenuForm.roleMenu(record)"></a>
</a-menu-item> </a-menu-item>
<a-menu-item v-if="hasPerm('sysRole:grantData')"> <!-- <a-menu-item v-if="hasPerm('sysRole:grantData')">
<a @click="$refs.roleOrgForm.roleOrg(record)"></a> <a @click="$refs.roleOrgForm.roleOrg(record)"></a>
</a-menu-item> </a-menu-item> -->
<a-menu-item v-if="hasPerm('sysRole:delete')"> <a-menu-item v-if="hasPerm('sysRole:delete')">
<a-popconfirm placement="topRight" title="确认删除?" @confirm="() => sysRoleDelete(record)"> <a-popconfirm placement="topRight" title="确认删除?" @confirm="() => sysRoleDelete(record)">
<a>删除</a> <a>删除</a>
@ -84,7 +84,7 @@ export default {
addForm, addForm,
editForm, editForm,
roleMenuForm, roleMenuForm,
roleOrgForm, roleOrgForm
}, },
data() { data() {
@ -95,25 +95,25 @@ export default {
columns: [ columns: [
{ {
title: '角色名', title: '角色名',
dataIndex: 'name', dataIndex: 'name'
}, },
{ {
title: '唯一编码', title: '唯一编码',
dataIndex: 'code', dataIndex: 'code'
}, },
{ {
title: '排序', title: '排序',
dataIndex: 'sort', dataIndex: 'sort'
}, }
], ],
// Promise // Promise
loadData: (parameter) => { loadData: parameter => {
return getRolePage(Object.assign(parameter, this.queryParam)).then((res) => { return getRolePage(Object.assign(parameter, this.queryParam)).then(res => {
return res.data return res.data
}) })
}, },
selectedRowKeys: [], selectedRowKeys: [],
selectedRows: [], selectedRows: []
} }
}, },
@ -128,7 +128,7 @@ export default {
title: '操作', title: '操作',
width: '150px', width: '150px',
dataIndex: 'action', dataIndex: 'action',
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' }
}) })
} }
}, },
@ -136,7 +136,7 @@ export default {
methods: { methods: {
sysRoleDelete(record) { sysRoleDelete(record) {
sysRoleDelete(record) sysRoleDelete(record)
.then((res) => { .then(res => {
if (res.success) { if (res.success) {
this.$message.success('删除成功') this.$message.success('删除成功')
this.$refs.table.refresh() this.$refs.table.refresh()
@ -144,7 +144,7 @@ export default {
this.$message.error('删除失败:' + res.message) this.$message.error('删除失败:' + res.message)
} }
}) })
.catch((err) => { .catch(err => {
this.$message.error('删除错误:' + err.message) this.$message.error('删除错误:' + err.message)
}) })
}, },
@ -155,8 +155,8 @@ export default {
onSelectChange(selectedRowKeys, selectedRows) { onSelectChange(selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows this.selectedRows = selectedRows
}, }
}, }
} }
</script> </script>

Loading…
Cancel
Save