|
|
@ -13,7 +13,7 @@
|
|
|
|
<a-card :bodyStyle="tstyle" :bordered="false">
|
|
|
|
<a-card :bodyStyle="tstyle" :bordered="false">
|
|
|
|
<div class="title"><i class="iconfont icon-fuwu"></i><span>服务项目</span></div>
|
|
|
|
<div class="title"><i class="iconfont icon-fuwu"></i><span>服务项目</span></div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
<div class="items" v-for="(serive, sindex) in serviceLabel" :key="sindex">{{ serive.fieldLabel }}</div>
|
|
|
|
<div class="items" v-for="(serive, sindex) in bookingServiceItem" :key="sindex">{{ serive.name }}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a-card>
|
|
|
|
</a-card>
|
|
|
|
<a-card :bodyStyle="tstyle" :bordered="false">
|
|
|
|
<a-card :bodyStyle="tstyle" :bordered="false">
|
|
|
@ -121,25 +121,24 @@
|
|
|
|
title="添加附件"
|
|
|
|
title="添加附件"
|
|
|
|
:width="900"
|
|
|
|
:width="900"
|
|
|
|
:visible="fileModelvisible"
|
|
|
|
:visible="fileModelvisible"
|
|
|
|
:confirmLoading="fileModelconfirm"
|
|
|
|
:confirmLoading="uploading"
|
|
|
|
cancelText="关闭"
|
|
|
|
cancelText="关闭"
|
|
|
|
okText="保存"
|
|
|
|
okText="保存"
|
|
|
|
@ok="fileModelSubmit"
|
|
|
|
@ok="handleUpload"
|
|
|
|
@cancel="fileModelCancel"
|
|
|
|
@cancel="fileModelCancel"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<div class="clearfix">
|
|
|
|
<div class="clearfix">
|
|
|
|
<a-upload :file-list="upFileList" :remove="handleRemove" :before-upload="beforeUpload">
|
|
|
|
<a-upload :file-list="upFileList" :remove="handleRemove" :before-upload="beforeUpload">
|
|
|
|
<a-button> <a-icon type="upload" /> 选择文件 </a-button>
|
|
|
|
<a-button> <a-icon type="upload" /> 选择文件 </a-button>
|
|
|
|
</a-upload>
|
|
|
|
</a-upload>
|
|
|
|
<a-button
|
|
|
|
<div class="uplad-type">
|
|
|
|
type="primary"
|
|
|
|
<div class="upload-label">附件类型:</div>
|
|
|
|
:disabled="upFileList.length === 0"
|
|
|
|
<a-select style="width: 120px" @change="handleAttachChange" placeholder="请输入附件类型">
|
|
|
|
:loading="uploading"
|
|
|
|
<a-select-option v-for="(attach, aindex) in bookingAttachType" :key="aindex" :value="aindex">
|
|
|
|
style="margin-top: 16px"
|
|
|
|
{{ attach.name }}
|
|
|
|
@click="handleUpload"
|
|
|
|
</a-select-option>
|
|
|
|
>
|
|
|
|
</a-select>
|
|
|
|
{{ uploading ? '上传中' : '确定' }}
|
|
|
|
</div>
|
|
|
|
</a-button>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</a-modal>
|
|
|
|
</a-modal>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -147,7 +146,7 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import { GetRemark, AddRemark, GetFile, GetBookingLog, GetLog } from '@/api/modular/main/BookingLedger'
|
|
|
|
import { GetRemark, AddRemark, GetFile, GetBookingLog, GetLog } from '@/api/modular/main/BookingLedger'
|
|
|
|
import Vue from 'vue'
|
|
|
|
import Vue from 'vue'
|
|
|
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
|
|
import { ACCESS_TOKEN, DICT_TYPE_TREE_DATA } from '@/store/mutation-types'
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
@ -164,73 +163,6 @@ export default {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
id: this.$route.query.id,
|
|
|
|
id: this.$route.query.id,
|
|
|
|
tstyle: { padding: '0 15px 20px', 'margin-bottom': '10px', background: '#fff' },
|
|
|
|
tstyle: { padding: '0 15px 20px', 'margin-bottom': '10px', background: '#fff' },
|
|
|
|
serviceLabel: [
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '熏蒸',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
frame: true,
|
|
|
|
|
|
|
|
name: 'ISFUMIGATION',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '仓储',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISSTORAGE',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '陆运',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISLAND',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '报关',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISCUSTOMES',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '报检',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISINSPECTION',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '订舱',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISBOOKING',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '使用代理',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISAGENT',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xtype: 'checkboxfield',
|
|
|
|
|
|
|
|
fieldLabel: '分单签单',
|
|
|
|
|
|
|
|
flex: 1,
|
|
|
|
|
|
|
|
labelAlign: 'right',
|
|
|
|
|
|
|
|
readOnly: true,
|
|
|
|
|
|
|
|
name: 'ISHBLNO',
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
remarkModelvisible: false,
|
|
|
|
remarkModelvisible: false,
|
|
|
|
bookingModelconfirm: false,
|
|
|
|
bookingModelconfirm: false,
|
|
|
|
remarkVal: '',
|
|
|
|
remarkVal: '',
|
|
|
@ -245,7 +177,11 @@ export default {
|
|
|
|
file: {},
|
|
|
|
file: {},
|
|
|
|
upFileList: [],
|
|
|
|
upFileList: [],
|
|
|
|
uploading: false,
|
|
|
|
uploading: false,
|
|
|
|
realTimePercent: null
|
|
|
|
realTimePercent: null,
|
|
|
|
|
|
|
|
bookingServiceItem: [],
|
|
|
|
|
|
|
|
bookingAttachType: [],
|
|
|
|
|
|
|
|
attachName: '',
|
|
|
|
|
|
|
|
attachCode: '',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created() {
|
|
|
|
created() {
|
|
|
@ -253,8 +189,20 @@ export default {
|
|
|
|
this.getFile()
|
|
|
|
this.getFile()
|
|
|
|
this.getBookingLog()
|
|
|
|
this.getBookingLog()
|
|
|
|
this.getLog()
|
|
|
|
this.getLog()
|
|
|
|
|
|
|
|
this.getLocal()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
getLocal() {
|
|
|
|
|
|
|
|
const dictTypeTree = Vue.ls.get(DICT_TYPE_TREE_DATA)
|
|
|
|
|
|
|
|
dictTypeTree.map((item, index) => {
|
|
|
|
|
|
|
|
if (item.code === 'booking_service_item') {
|
|
|
|
|
|
|
|
this.bookingServiceItem = item.children
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (item.code === 'booking_attach_type') {
|
|
|
|
|
|
|
|
this.bookingAttachType = item.children
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
},
|
|
|
|
// 备注 - start
|
|
|
|
// 备注 - start
|
|
|
|
getRemark() {
|
|
|
|
getRemark() {
|
|
|
|
GetRemark({
|
|
|
|
GetRemark({
|
|
|
@ -322,6 +270,9 @@ export default {
|
|
|
|
this.handleUpload()
|
|
|
|
this.handleUpload()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
fileModelCancel() {
|
|
|
|
fileModelCancel() {
|
|
|
|
|
|
|
|
this.upFileList = []
|
|
|
|
|
|
|
|
this.attachCode = ''
|
|
|
|
|
|
|
|
this.attachName = ''
|
|
|
|
this.fileModelvisible = false
|
|
|
|
this.fileModelvisible = false
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleRemove(file) {
|
|
|
|
handleRemove(file) {
|
|
|
@ -334,20 +285,21 @@ export default {
|
|
|
|
this.upFileList = [...this.upFileList, file];
|
|
|
|
this.upFileList = [...this.upFileList, file];
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
binary2base64(bi) {
|
|
|
|
|
|
|
|
let str = '';
|
|
|
|
|
|
|
|
for (let i = 0, len = bi.length; i < len; i++) {
|
|
|
|
|
|
|
|
str += String.fromCharCode(bi[i]);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return btoa(str);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handleUpload() {
|
|
|
|
handleUpload() {
|
|
|
|
const { upFileList } = this;
|
|
|
|
const { upFileList, attachCode, attachName } = this;
|
|
|
|
|
|
|
|
if (!upFileList) {
|
|
|
|
|
|
|
|
this.$message.error('请上传文件')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!attachCode || !attachName) {
|
|
|
|
|
|
|
|
this.$message.error('请选择附件类型')
|
|
|
|
|
|
|
|
return false
|
|
|
|
|
|
|
|
}
|
|
|
|
const formData = new FormData();
|
|
|
|
const formData = new FormData();
|
|
|
|
formData.append('file', upFileList[0])
|
|
|
|
formData.append('file', upFileList[0])
|
|
|
|
formData.append('BookingId', this.id)
|
|
|
|
formData.append('BookingId', this.id)
|
|
|
|
formData.append('TypeCode', '')
|
|
|
|
formData.append('TypeCode', attachCode)
|
|
|
|
formData.append('TypeName', '')
|
|
|
|
formData.append('TypeName', attachName)
|
|
|
|
console.log('formData', formData, formData.get('file'))
|
|
|
|
console.log('formData', formData, formData.get('file'))
|
|
|
|
this.uploading = true;
|
|
|
|
this.uploading = true;
|
|
|
|
const token = Vue.ls.get(ACCESS_TOKEN)
|
|
|
|
const token = Vue.ls.get(ACCESS_TOKEN)
|
|
|
@ -360,91 +312,17 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data: formData
|
|
|
|
data: formData
|
|
|
|
}).then((res) => {
|
|
|
|
}).then((res) => {
|
|
|
|
console.log(res.data)
|
|
|
|
this.uploading = false;
|
|
|
|
|
|
|
|
if (res.data.success) {
|
|
|
|
|
|
|
|
this.$message.success('上传成功')
|
|
|
|
|
|
|
|
this.getFile()
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
this.$message.error(res.data.message)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.fileModelCancel()
|
|
|
|
}).catch((err) => {
|
|
|
|
}).catch((err) => {
|
|
|
|
console.log(err)
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 默认接口上传
|
|
|
|
|
|
|
|
// AddFile({
|
|
|
|
|
|
|
|
// file: formData,
|
|
|
|
|
|
|
|
// BookingId: this.id,
|
|
|
|
|
|
|
|
// TypeCode: '',
|
|
|
|
|
|
|
|
// TypeName: ''
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
|
|
|
// if (res.success) {
|
|
|
|
|
|
|
|
// this.fileList = res.data
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .catch((err) => {
|
|
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// 普通上传
|
|
|
|
|
|
|
|
// const xml = new XMLHttpRequest();
|
|
|
|
|
|
|
|
// const token = 'Bearer ' + Vue.ls.get(ACCESS_TOKEN)
|
|
|
|
|
|
|
|
// const url = process.env.VUE_APP_API_BASE_URL + '/BookingOrder/addFile'
|
|
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
|
|
// xml.open('POST', url, true) // 第三个值指定接口是否异步
|
|
|
|
|
|
|
|
// // 设置请求头信息
|
|
|
|
|
|
|
|
// xml.setRequestHeader('Authorization', token);
|
|
|
|
|
|
|
|
// // 监控上传进度
|
|
|
|
|
|
|
|
// xml.upload.onprogress = this.onprogressEvent
|
|
|
|
|
|
|
|
// // 接口调用成功回调
|
|
|
|
|
|
|
|
// xml.onload = this.onloadEvent
|
|
|
|
|
|
|
|
// // 接口调用失败处理
|
|
|
|
|
|
|
|
// xml.onerror = this.onerrorEvent
|
|
|
|
|
|
|
|
// xml.send({
|
|
|
|
|
|
|
|
// file: formData,
|
|
|
|
|
|
|
|
// BookingId: this.id,
|
|
|
|
|
|
|
|
// TypeCode: '',
|
|
|
|
|
|
|
|
// TypeName: ''
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 二进制上传
|
|
|
|
|
|
|
|
// const _this = this;
|
|
|
|
|
|
|
|
// const reader = new FileReader();
|
|
|
|
|
|
|
|
// reader.readAsArrayBuffer(upFileList[0]);
|
|
|
|
|
|
|
|
// reader.onload = function () {
|
|
|
|
|
|
|
|
// const file = this.result;
|
|
|
|
|
|
|
|
// const view = new Uint8Array(file);
|
|
|
|
|
|
|
|
// const str = _this.binary2base64(view);
|
|
|
|
|
|
|
|
// console.log('读取', str);
|
|
|
|
|
|
|
|
// AddFile({
|
|
|
|
|
|
|
|
// file: str,
|
|
|
|
|
|
|
|
// BookingId: _this.id,
|
|
|
|
|
|
|
|
// TypeCode: '',
|
|
|
|
|
|
|
|
// TypeName: ''
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .then((res) => {
|
|
|
|
|
|
|
|
// debugger
|
|
|
|
|
|
|
|
// if (res.success) {
|
|
|
|
|
|
|
|
// _this.upFileList = [];
|
|
|
|
|
|
|
|
// _this.uploading = false;
|
|
|
|
|
|
|
|
// _this.$message.success('upload successfully.');
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// .catch((err) => {
|
|
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onprogressEvent(e) {
|
|
|
|
|
|
|
|
if (e.lengthComputable) {
|
|
|
|
|
|
|
|
// 可以获取到实时的接口进度
|
|
|
|
|
|
|
|
this.realTimePercent = +parseInt((e.loaded / e.total) * 100);
|
|
|
|
|
|
|
|
console.log('可以获取到实时的接口进度', this.realTimePercent)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onloadEvent(e) {
|
|
|
|
|
|
|
|
// 获取到接口调用成功后的返回数据
|
|
|
|
|
|
|
|
const res = JSON.parse(e.currentTarget.response);
|
|
|
|
|
|
|
|
console.log('获取到接口调用成功后的返回数据', res)
|
|
|
|
|
|
|
|
this.uploading = false
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
onerrorEvent(e) {
|
|
|
|
|
|
|
|
// 接口调用失败后的处理
|
|
|
|
|
|
|
|
console.log('接口调用失败后的处理', e)
|
|
|
|
|
|
|
|
this.uploading = false
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 附件 - end
|
|
|
|
// 附件 - end
|
|
|
|
|
|
|
|
|
|
|
@ -476,6 +354,10 @@ export default {
|
|
|
|
console.log(err)
|
|
|
|
console.log(err)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
handleAttachChange(index) {
|
|
|
|
|
|
|
|
this.attachCode = this.bookingAttachType[index].code
|
|
|
|
|
|
|
|
this.attachName = this.bookingAttachType[index].name
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
@ -747,4 +629,14 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.uplad-type{
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
|
|
|
.upload-label{
|
|
|
|
|
|
|
|
height: 30px;
|
|
|
|
|
|
|
|
line-height: 30px;
|
|
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
|
|
color: #666;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|