添加 提示

dev
张同海 2 years ago
parent 51ef1680e9
commit 157586d9da

@ -6,8 +6,8 @@
<a-button class="btn" type="primary" @click="addboxLine"></a-button>
<a-button class="btn" @click="removeLine"></a-button>
<a-button class="btn" type="primary" @click="openDialog" :disabled="tableData.length === 0">多品名</a-button>
<a-button class="btn" type="primary" @click="importYarn"></a-button>
<a-button class="btn" type="primary" @click="importWeight"></a-button>
<a-button class="btn" type="primary" @click="importYarn" :loading="YarnLoading">引入场站数据</a-button>
<a-button class="btn" type="primary" @click="importWeight" :loading="WeightLoading">引入箱皮重</a-button>
</div>
<div class="table-right">
<span>合计: {{ totalCtnall }}</span>
@ -82,8 +82,8 @@ export default {
type: Object,
default: () => {
return {}
},
},
}
}
},
data() {
return {
@ -96,7 +96,7 @@ export default {
title: '',
width: 40,
operationColumn: true,
align: 'center',
align: 'center'
},
{
field: '',
@ -107,7 +107,7 @@ export default {
operationColumn: true,
renderBodyCell: ({ row, column, rowIndex }, h) => {
return ++rowIndex
},
}
},
{
field: 'ctnall',
@ -124,7 +124,7 @@ export default {
placeholder="请输入箱型"
option-filter-prop="children"
style="width: 120px"
on-change={(val) => {
on-change={val => {
const data = this.ctnList[val]
this.tableData[rowIndex].ctnall = data.name
this.tableData[rowIndex].ctncode = data.code
@ -137,35 +137,35 @@ export default {
})}
</a-select>
)
},
}
},
{
field: 'ctnnum',
key: 'ctnnum ',
title: '箱量',
align: 'left',
edit: true,
edit: true
},
{
field: 'cntrno',
key: 'cntrno',
title: '箱号',
align: 'left',
edit: true,
edit: true
},
{
field: 'sealno',
key: 'sealno',
title: '封号',
align: 'left',
edit: true,
edit: true
},
{
field: 'pkgs',
key: 'pkgs',
title: '件数',
align: 'left',
edit: true,
edit: true
},
{
field: 'kindpkgs',
@ -182,7 +182,7 @@ export default {
placeholder="请输入包装"
option-filter-prop="children"
style="width: 120px"
on-change={(val) => {
on-change={val => {
const data = this.packageList[val]
this.tableData[rowIndex].kindpkgs = data.name
row['kindpkgs'] = data.name
@ -194,28 +194,28 @@ export default {
})}
</a-select>
)
},
}
},
{
field: 'kgs',
key: 'kgs',
title: '重量',
align: 'left',
edit: true,
edit: true
},
{
field: 'cbm',
key: 'cbm',
title: '尺码',
align: 'left',
edit: true,
edit: true
},
{
field: 'tareweight',
key: 'tareweight',
title: '箱皮重',
align: 'left',
edit: true,
edit: true
},
{
field: 'weightype',
@ -231,7 +231,7 @@ export default {
placeholder="请输入箱型"
option-filter-prop="children"
style="width: 120px"
on-change={(val) => {
on-change={val => {
this.tableData[rowIndex].weightype = val
row['weightype'] = val
this.$forceUpdate()
@ -241,15 +241,15 @@ export default {
<a-select-option value="2">总重</a-select-option>
</a-select>
)
},
}
},
{
field: 'weighkgs',
key: 'weighkgs',
title: '称重重量',
align: 'left',
edit: true,
},
edit: true
}
],
modelColumns: [
{
@ -259,58 +259,58 @@ export default {
title: '',
width: 40,
operationColumn: true,
align: 'center',
align: 'center'
},
{
field: 'ctnall',
key: 'ctnall',
title: '箱型',
align: 'left',
width: 80,
width: 80
},
{
field: 'ctnnum',
key: 'ctnnum ',
title: '箱量',
align: 'left',
align: 'left'
},
{
field: 'cntrno',
key: 'cntrno',
title: '箱号',
align: 'left',
align: 'left'
},
{
field: 'sealno',
key: 'sealno',
title: '封号',
align: 'left',
align: 'left'
},
{
field: 'pkgs',
key: 'pkgs',
title: '件数',
align: 'left',
align: 'left'
},
{
field: 'kindpkgs',
key: 'kindpkgs',
title: '包装',
align: 'left',
width: 130,
width: 130
},
{
field: 'weighkgs',
key: 'weighkgs',
title: '毛重',
align: 'left',
align: 'left'
},
{
field: 'cbm',
key: 'cbm',
title: '尺码',
align: 'left',
},
align: 'left'
}
],
childColumns: [
{
@ -320,14 +320,14 @@ export default {
title: '',
width: 40,
operationColumn: true,
align: 'center',
align: 'center'
},
{
field: 'pkgs',
key: 'pkgs',
title: '件数',
align: 'left',
edit: true,
edit: true
},
{
field: 'kindpkgs',
@ -344,7 +344,7 @@ export default {
placeholder="请输入包装"
option-filter-prop="children"
style="width: 120px"
on-change={(val) => {
on-change={val => {
const data = this.packageList[val]
row['kindpkgs'] = data.name
this.childTableData[rowIndex].kindpkgs = data.name
@ -356,35 +356,35 @@ export default {
})}
</a-select>
)
},
}
},
{
field: 'weighkgs',
key: 'weighkgs',
title: '毛重',
align: 'left',
edit: true,
edit: true
},
{
field: 'cbm',
key: 'cbm',
title: '尺码',
align: 'left',
edit: true,
edit: true
},
{
field: 'hscode',
key: 'hscode',
title: 'HS代码',
align: 'left',
edit: true,
edit: true
},
{
field: 'marks',
key: 'marks',
title: '唛头',
align: 'left',
edit: true,
edit: true
},
{
field: 'description',
@ -392,8 +392,8 @@ export default {
title: '货描',
align: 'left',
width: '25%',
edit: true,
},
edit: true
}
],
tableData: [],
editOption: {
@ -406,7 +406,7 @@ export default {
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
maxCount: 3
})
this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`)
row['cntrno'] = ''
@ -452,7 +452,7 @@ export default {
},
cellValueChange: ({ row, column }) => {
console.log('编辑', row, column)
},
}
},
editChildOption: {
beforeCellValueChange: ({ row, column, changeValue }) => {
@ -464,7 +464,7 @@ export default {
this.$message.config({
top: `${height}px`,
duration: 2,
maxCount: 3,
maxCount: 3
})
this.$message.error(`输入的${this.enmuErrorLabel(column.field)}不符合规则`)
row['cntrno'] = ''
@ -489,12 +489,12 @@ export default {
},
cellValueChange: ({ row, column }) => {
console.log('编辑', row, column)
},
}
},
//
rowStyleOption: {
clickHighlight: false,
hoverHighlight: false,
hoverHighlight: false
},
cellAutofillOption: true,
checkboxOption: {
@ -510,7 +510,7 @@ export default {
} else {
this.selectArr = []
}
},
}
},
checkChildboxOption: {
hideSelectAll: false,
@ -525,7 +525,7 @@ export default {
} else {
this.selectChildArr = []
}
},
}
},
//
clipboardOption: {
@ -564,7 +564,7 @@ export default {
afterDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterDelete')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
}
},
clipboardChildOption: {
copy: true,
@ -602,7 +602,7 @@ export default {
afterDelete: ({ data, selectionRangeIndexes, selectionRangeKeys }) => {
console.log('afterDelete')
this.log({ data, selectionRangeIndexes, selectionRangeKeys })
},
}
},
tableLoaded: false,
ctnList: [],
@ -631,12 +631,14 @@ export default {
} else {
this.childTableData = []
}
},
}
},
childTableData: [],
childModelSelect: null,
childModelSelectIndex: null,
selectChildArr: [],
YarnLoading: false,
WeightLoading: false
}
},
watch: {
@ -645,18 +647,18 @@ export default {
// console.log('detail', nval)
this.$emit('changeDetail', {
detail: nval,
type: 'goodsTable',
type: 'goodsTable'
})
},
deep: true,
deep: true
},
tableData: {
handler(nval, oval) {
this.details.ctnInputs = nval
// console.log('table', nval)
},
deep: true,
},
deep: true
}
},
created() {
@ -671,12 +673,12 @@ export default {
this.details.ctnInputs.map((item, index) => {
arr.push({
...{ rowKey: index },
...item,
...item
})
if (!Object.keys(totalCtnall).includes(item.ctnall)) {
const cData = {
type: 'ctnall',
num: item.ctnnum,
num: item.ctnnum
}
this.$set(totalCtnall, item.ctnall, cData)
}
@ -697,23 +699,23 @@ export default {
},
getCtn() {
GetCtn({
Name: '',
Name: ''
})
.then((res) => {
.then(res => {
this.ctnList = res.data
})
.catch((err) => {
.catch(err => {
console.log(err)
})
},
getPackage() {
GetPackage({
Name: '',
Name: ''
})
.then((res) => {
.then(res => {
this.packageList = res.data
})
.catch((err) => {
.catch(err => {
console.log(err)
})
},
@ -746,7 +748,7 @@ export default {
tareweight: '',
weightype: '',
weighkgs: '',
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0,
rowKey: this.tableData.length > 0 ? Number(this.tableData[this.tableData.length - 1].rowKey) + 1 : 0
}
this.tableData.push(data)
},
@ -783,7 +785,7 @@ export default {
cbm: '',
hscode: this.details.hscode,
marks: this.details.marks,
description: this.details.marks,
description: this.details.marks
}
this.childTableData.push(data)
},
@ -811,11 +813,12 @@ export default {
this.$message.error('请先保存订舱信息')
return false
}
this.YarnLoading = true
GetYardData({
bookingId: this.id,
isWeb: false,
isWeb: false
})
.then((res) => {
.then(res => {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
@ -833,7 +836,7 @@ export default {
cbm: item.CBM,
tareweight: item.TAREWEIGHT,
weightype: '',
weighkgs: '',
weighkgs: ''
}
addTable.push(_data)
})
@ -842,9 +845,11 @@ export default {
} else {
this.$message.error(res.message)
}
this.YarnLoading = false
})
.catch((err) => {
.catch(err => {
console.log(err)
this.YarnLoading = false
})
},
@ -853,11 +858,12 @@ export default {
this.$message.error('请先保存订舱信息')
return false
}
this.WeightLoading = true
GetYardData({
bookingId: this.id,
isWeb: false,
isWeb: false
})
.then((res) => {
.then(res => {
if (res.success) {
const data = JSON.parse(res.data)
const addTable = []
@ -884,9 +890,11 @@ export default {
} else {
this.$message.error(res.message)
}
this.WeightLoading = false
})
.catch((err) => {
.catch(err => {
console.log(err)
this.WeightLoading = false
})
},
log({ data, selectionRangeIndexes, selectionRangeKeys }) {
@ -980,8 +988,8 @@ export default {
}
return sum
},
},
}
}
}
</script>
<style lang="less">

@ -14,7 +14,8 @@
</a-popconfirm>
<button><span class="iconfont icon-fuzhi1"></span>复制</button>
<button @click="saveFun"><span class="iconfont icon-icon_baocun"></span>保存</button>
<a-dropdown>
<a-spin size="small" v-show="TemplateLoa" />
<a-dropdown :disabled="TemplateLoa">
<!-- <a class="ant-dropdown-link" @click="e => e.preventDefault()"> Hover me <a-icon type="down" /> </a> -->
<button><span class="iconfont icon-printing"></span>打印<a-icon type="down" /></button>
<a-menu slot="overlay">
@ -100,8 +101,8 @@
</a-form>
<template slot="footer">
<a-button @click="handleModelCancel"></a-button>
<a-button type="primary" @click="handleModelSubmit('save')">EDI</a-button>
<a-button type="primary" @click="handleModelSubmit('send')">EDI</a-button>
<a-button type="primary" @click="handleModelSubmit('save')" :loading="EDISloading">保存EDI文件</a-button>
<a-button type="primary" @click="handleModelSubmit('send')" :loading="EDIUloading">上传EDI</a-button>
</template>
</template>
@ -394,9 +395,14 @@
</a-row>
</a-form>
<template slot="footer">
<a-button @click="saveModel"></a-button>
<a-button type="primary" @click="sendModel"></a-button>
<a-button type="primary" @click="removeModel" v-if="['initCabin', 'vgmlink'].includes(modelType)">
<a-button @click="saveModel" :loading="SaveLoading">保存</a-button>
<a-button type="primary" @click="sendModel" :loading="SendLoading">发送</a-button>
<a-button
type="primary"
@click="removeModel"
:loading="DelLoading"
v-if="['initCabin', 'vgmlink'].includes(modelType)"
>
删除
</a-button>
</template>
@ -477,7 +483,13 @@ export default {
hsaBillPdf: false,
billPdf: '',
billPdfTip: '',
templateType: []
templateType: [],
TemplateLoa: false,
EDISloading: false,
EDIUloading: false,
SaveLoading: false,
SendLoading: false,
DelLoading: false
}
},
mounted() {
@ -489,6 +501,7 @@ export default {
methods: {
// ========== ==========
FnCilckTemplateType(type) {
this.TemplateLoa = true
BookingOrderPrint({ type, bookingId: this.id })
.then(res => {
const exportName = new Date().getTime()
@ -502,9 +515,11 @@ export default {
if (!res.success) {
this.$message.error(res.message)
}
this.TemplateLoa = false
})
.catch(err => {
console.log(err)
this.TemplateLoa = false
})
},
@ -561,6 +576,11 @@ export default {
}
this.bookingModelFrom.send = type === 'send'
this.bookingModelFrom.orderNo = this.details.mblno
if (type == 'save') {
this.EDISloading = true
} else {
this.EDIUloading = true
}
SendBookingOrClosingEDI(this.bookingModelFrom)
.then(res => {
//
@ -570,9 +590,13 @@ export default {
} else {
this.$message.error(res.message)
}
this.EDISloading = false
this.EDIUloading = false
})
.catch(err => {
console.log(err)
this.EDISloading = false
this.EDIUloading = false
})
},
handleModelCancel() {
@ -617,8 +641,10 @@ export default {
},
sendXHZ() {
const hide = this.$message.loading('发送中..', 0)
SendXHZ(this.id)
.then(res => {
hide()
if (res.success) {
this.$message.success(`下货纸发送成功`)
} else {
@ -629,10 +655,11 @@ export default {
console.log(err)
})
},
vgmSend() {
const hide = this.$message.loading('发送中..', 0)
VgmSend(this.id)
.then(res => {
hide()
if (res.success) {
this.$message.success(`VGM发送成功`)
} else {
@ -734,6 +761,7 @@ export default {
// vgm
saveModel() {
this.SaveLoading = true
// /
if (this.modelType === 'initCabin') {
//
@ -748,6 +776,7 @@ export default {
},
sendModel() {
this.SendLoading = true
if (this.modelType === 'initCabin') {
//
this.sendLetterYard()
@ -790,9 +819,11 @@ export default {
} else {
this.$message.error(res.message)
}
this.SaveLoading = false
})
.catch(err => {
console.log(err)
this.SaveLoading = false
})
},
@ -805,9 +836,11 @@ export default {
} else {
this.$message.error(res.message)
}
this.SaveLoading = false
})
.catch(err => {
console.log(err)
this.SaveLoading = false
})
},
@ -820,9 +853,11 @@ export default {
} else {
this.$message.error(res.message)
}
this.SendLoading = false
})
.catch(err => {
console.log(err)
this.SendLoading = false
})
},

Loading…
Cancel
Save