From 7823f4ef5ae7e3cc4c49f44706b06ad99bb1cfe5 Mon Sep 17 00:00:00 2001 From: pyt <626651354@qq.com> Date: 星期四, 13 二月 2025 16:16:47 +0800 Subject: [PATCH] bug修复 --- src/view/addOrder.vue | 218 ++++++++++++++++++++++++++---------------------------- 1 files changed, 105 insertions(+), 113 deletions(-) diff --git a/src/view/addOrder.vue b/src/view/addOrder.vue index 5b577e7..dd1f8d2 100644 --- a/src/view/addOrder.vue +++ b/src/view/addOrder.vue @@ -462,17 +462,26 @@ @change="onEditorChange($event)"> </quill-editor> </div> - + <div class="flex " style="padding-bottom: 27px;"> + <div class="box10"> + <div class="flex"> + <div class="box_text1">保存信息:</div> + </div> + <div class="box_text3">Save Information</div> + </div> + <el-radio v-model="isSave" :label="true">是</el-radio> + <el-radio v-model="isSave" :label="false">否</el-radio> + </div> </el-card> - <el-card class="box-card mt-13"> + <el-card v-if="type == 'detail'" class="box-card mt-13"> <div slot="header" class="clearfix"> <span class="clearfix_text">货柜动态</span> </div> <div class="box-cardes"> <div class="flex"> - <el-form-item label="" class="label1" prop="clientOrder" label-width="0"> + <el-form-item label="" class="label1" label-width="0"> <div class="flex"> <div class="box9" style="width: 200px"> <div class="flex"> @@ -481,112 +490,96 @@ </div> <div class="box_text2">Frame number</div> </div> - <el-input :disabled="type == 'detail'" v-model="form.clientOrder" placeholder="请输入"></el-input> + <el-input v-model="form.frameNumber" readonly></el-input> </div> </el-form-item> - <el-form-item label="" class="label2" prop="product" label-width="0px"> + <el-form-item label="" class="label2" label-width="0px"> <div class="flex"> <div class="box1"> <div class="flex"> - <div class="red">*</div> <div class="box_text1">最晚免费日期:</div> </div> <div class="box_text2">LFD</div> </div> - <el-input :disabled="type == 'detail'" v-model="form.product" placeholder="请输入"></el-input> + <el-input v-model="form.LFD" readonly></el-input> </div> </el-form-item> - <el-form-item label="" class="label3" prop="QTY" label-width="0px"> + <el-form-item label="" class="label3" label-width="0px"> <div class="flex"> <div class="box3"> <div class="flex"> - <div class="red">*</div> <div class="box_text1">提柜日期:</div> </div> <div class="box_text2">Pickup Date</div> </div> - <el-input :disabled="type == 'detail'" v-model="form.QTY" placeholder="请输入"></el-input> + <el-input v-model="form.pickUpDate" readonly></el-input> </div> </el-form-item> - <el-form-item label="" class="label4" prop="QTYUnit" label-width="0"> + <el-form-item label="" class="label4" label-width="0"> <div class="flex"> <div class="box2"> <div class="flex"> - <div class="red">*</div> <div class="box_text1">计划送柜日期:</div> </div> <div class="box_text2">Delivery Schedule</div> </div> - <el-select :disabled="type == 'detail'" v-model="form.QTYUnit" clearable placeholder="请选择"> - <el-option :label="item.label" :value="item.value" v-for="item in optionsUs" - :key="item.value"></el-option> - </el-select> + <el-input v-model="form.deliverySchedule" readonly></el-input> + </div> </el-form-item> </div> <div class="flex"> - <el-form-item label="" class="label6" prop="weight" label-width="0px"> + <el-form-item label="" class="label6" label-width="0px"> <div class="flex"> <div class="box9" style="width: 200px"> <div class="flex"> - <div class="red">*</div> <div class="box_text1">实际送货日期:</div> </div> <div class="box_text2"></div> </div> - <el-input type="number" :disabled="type == 'detail'" v-model="form.weight" @input="onInput" - placeholder="请输入"> - <div style="line-height: 50px;" slot="prefix-icon">KG</div> - </el-input> + <el-input v-model="form.actualSchedule" readonly></el-input> + </div> </el-form-item> - <el-form-item label="" class="label2" prop="poundWeight" label-width="0px"> + <el-form-item label="" class="label2" label-width="0px"> <div class="flex"> <div class="box1"> <div class="flex"> - <!-- <div class="red">*</div> --> <div class="box_text1">送柜日期:</div> </div> <div class="box_text2">Delivery Date</div> </div> - <el-input disabled v-model="form.poundWeight" placeholder="请输入"> - <div style="line-height: 50px;" slot="suffix">LBS</div> - </el-input> + <el-input v-model="form.deliveryDate" readonly></el-input> + </div> </el-form-item> - <el-form-item label="" class="label3" prop="volume" label-width="0px"> + <el-form-item label="" class="label3" label-width="0px"> <div class="flex"> <div class="box3"> <div class="flex"> - <div class="red">*</div> <div class="box_text1">报空日期:</div> </div> <div class="box_text2">Empty Report Date</div> </div> - <el-input type="number" :disabled="type == 'detail'" v-model="form.volume" placeholder="请输入"> - <div style="line-height: 50px;" slot="suffix">CMB</div> - </el-input> + <el-input v-model="form.emptyReportDate" readonly></el-input> </div> </el-form-item> - <el-form-item label="" class="label4" prop="QTYUnit" label-width="0"> + <el-form-item label="" class="label4" label-width="0"> <div class="flex"> <div class="box2"> <div class="flex"> - <div class="red">*</div> <div class="box_text1">还空日期:</div> </div> <div class="box_text2">Empty Return Date</div> </div> - <el-select :disabled="type == 'detail'" v-model="form.QTYUnit" clearable placeholder="请选择"> - <el-option :label="item.label" :value="item.value" v-for="item in optionsUs" - :key="item.value"></el-option> - </el-select> + <el-input v-model="form.emptyReturnDate" readonly></el-input> + </div> </el-form-item> - + </div> </div> </el-card> @@ -596,19 +589,19 @@ </div> <div class="box-carde"> <div class="flex"> - <el-form-item label="Do:" class="w-316" prop="DOFileUrl" label-width="88px"> + <el-form-item label="Do:" class="w-316" prop="DOFileUrls" label-width="88px"> <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview" :http-request="handleUpload1" action="#" :on-remove="handleRemove1" :on-exceed="handleExceed" :file-list="fileList1"> - <div class="upload_btn" v-if="form.DOFileUrl == ''">+上传附件</div> + <div class="upload_btn">+上传附件</div> </el-upload> </el-form-item> - <el-form-item label="PU#:" class="w-316" prop="PUFileUrl" label-width="88px"> + <el-form-item label="PU#:" class="w-316" prop="PUFileUrls" label-width="88px"> <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview" :on-remove="handleRemove2" :http-request="handleUpload2" action="#" :on-exceed="handleExceed" :file-list="fileList2"> - <div class="upload_btn" v-if="form.PUFileUrl == ''">+上传附件</div> + <div class="upload_btn">+上传附件</div> </el-upload> </el-form-item> <el-form-item label="PU说明:" class="" prop="PUExplain" label-width="80px"> @@ -620,14 +613,14 @@ <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview" :on-remove="handleRemove3" :http-request="handleUpload3" action="#" :on-exceed="handleExceed" :file-list="fileList3"> - <div class="upload_btn" v-if="form.PODFileUrl == ''">+上传附件</div> + <div class="upload_btn">+上传附件</div> </el-upload> </el-form-item> <el-form-item label="其他附件:" class="w-316" prop="otherFileUrls" label-width="88px"> <el-upload :disabled="type == 'detail'" class="upload-demo" :on-preview="handlePreview" :on-remove="handleRemove4" :http-request="handleUpload4" action="#" :on-exceed="handleExceed" :file-list="fileList4"> - <div class="upload_btn" v-if="form.otherFileUrl == ''">+上传附件</div> + <div class="upload_btn">+上传附件</div> </el-upload> </el-form-item> </div> @@ -647,7 +640,7 @@ </template> <script> -import { addOrder, getaddress, edit, getDetail } from './addservier' +import { addOrder, getaddress, edit, getDetail, saveInfo } from './addservier' import 'quill/dist/quill.core.css' import 'quill/dist/quill.snow.css' import 'quill/dist/quill.bubble.css' @@ -670,6 +663,7 @@ activeTab: 1, show: false, detailInfo: {}, + isSave: false, //是否保存收件人信息 form: { container: "", //集装箱号 bol: "", //提单号 @@ -697,10 +691,10 @@ QTYUnit: '',//单位 email: "", //邮箱 PUExplain: '',//PU说明 - PUFileUrl: '',//PU附件 - DOFileUrl: '',//DO附件 - PODFileUrl: '',//POD附件 - otherFileUrl: '',//其他附件 + PUFileUrls: [],//PU附件 + DOFileUrls: [],//DO附件 + PODFileUrls: [],//POD附件 + otherFileUrls: [],//其他附件 specialRequest: '',//特殊要求 remark: '',//备注 }, @@ -725,9 +719,6 @@ ], }, }, - - - fileList1: [], fileList2: [], fileList3: [], @@ -763,7 +754,7 @@ }, ], optionsSc: [ - { + { value: "COSCO", label: "COSCO", }, @@ -831,7 +822,7 @@ value: "OTHERS", label: "OTHERS", } - + ], //COSCO、OOCL、ONE、CMA CGM、EVERGREEN(EMC)、ZIM、YANG MING(YML)、WANHAI LINE(WHL)、MAERSK(MSK)、MSC、HMM、HPL、HDW、T.S.LINE、SEA LEAD、SM LINE、OTHERS optionsCpa: [ @@ -964,35 +955,32 @@ }).then(resp => { this.form = resp.data this.detailInfo = resp.data - this.form.DOFileUrl = resp.data.DOFileUrl ? resp.data.DOFileUrl : '' - this.form.PUFileUrl = resp.data.PUFileUrl ? resp.data.PUFileUrl : '' - this.form.PODFileUrl = resp.data.PODFileUrl ? resp.data.PODFileUrl : '' - this.form.otherFileUrl = resp.data.otherFileUrl ? resp.data.otherFileUrl : '' - if (resp.data.DOFileUrl) { - this.fileList1.push({ url: resp.data.DOFileUrl, name: resp.data.DOFileUrl.split('ownload/')[1] }) - + if (resp.data.DOFileUrls) { + resp.data.DOFileUrls.map(item => { + this.fileList1.push({ url: item.url, name: item.url.split('ownload/')[1] }) + }) } - if (resp.data.PUFileUrl) { - this.fileList2.push({ url: resp.data.PUFileUrl, name: resp.data.PUFileUrl.split('ownload/')[1] }) - + if (resp.data.PUFileUrls) { + resp.data.PUFileUrls.map(item => { + this.fileList2.push({ url: item.url, name: item.url.split('ownload/')[1] }) + }) } - if (resp.data.PODFileUrl) { - this.fileList3.push({ url: resp.data.PODFileUrl, name: resp.data.PODFileUrl.split('ownload/')[1] }) - + if (resp.data.PODFileUrls) { + resp.data.PODFileUrls.map(item => { + this.fileList3.push({ url: item.url, name: item.url.split('ownload/')[1] }) + }) } - if (resp.data.otherFileUrl) { - this.fileList4.push({ url: resp.data.otherFileUrl, name: resp.data.otherFileUrl.split('ownload/')[1] }) - + if (resp.data.otherFileUrls) { + resp.data.otherFileUrls.map(item => { + this.fileList4.push({ url: item.url, name: item.url.split('ownload/')[1] }) + }) } - - }) } getaddress({ extra: JSON.parse(localStorage.getItem('userInfo')).extra }).then(resp => { - console.log(resp, '----'); if (resp.data.length > 0) { this.optionsPL = resp.data[0].ports .map(item => { @@ -1047,14 +1035,27 @@ submitForm(formName) { this.$refs[formName].validate((valid) => { - if (valid) { if (!this.form.tel && !this.form.email) { this.$message.error('联系电话和邮箱至少填写其中一项'); } else { + this.form.DOFileUrls = this.fileList1.map(item => {return { url: item.url }}) + this.form.PUFileUrls = this.fileList2.map(item => {return { url: item.url }}) + this.form.PODFileUrls = this.fileList3.map(item => {return { url: item.url }}) + this.form.otherFileUrls = this.fileList4.map(item => {return { url: item.url }}) // 添加订单 if (this.type === 'add') { + if (this.isSave) { + saveInfo({ + extra: JSON.parse(localStorage.getItem('userInfo')).extra, + name: this.form.contact, + phone: this.form.tel, + email: this.form.email, + address: this.form.address, + remark: this.form.remark, + }) + } addOrder({ ...this.form, extra: JSON.parse(localStorage.getItem('userInfo')).extra @@ -1087,10 +1088,10 @@ tel: "", //联系电话 email: "", //邮箱 PUExplain: '',//PU说明 - PUFileUrl: '',//PU附件 - DOFileUrl: '',//DO附件 - PODFileUrl: '',//POD附件 - otherFileUrl: '',//其他附件 + PUFileUrls: [],//PU附件 + DOFileUrls: [],//DO附件 + PODFileUrls: [],//POD附件 + otherFileUrls: [],//其他附件 specialRequest: '',//特殊要求 remark: '',//备注 @@ -1105,6 +1106,16 @@ }) } else { + if (this.isSave) { + saveInfo({ + extra: JSON.parse(localStorage.getItem('userInfo')).extra, + name: this.form.contact, + phone: this.form.tel, + email: this.form.email, + address: this.form.address, + remark: this.form.remark, + }) + } edit({ ...this.form, extra: JSON.parse(localStorage.getItem('userInfo')).extra, @@ -1138,10 +1149,10 @@ tel: "", //联系电话 email: "", //邮箱 PUExplain: '',//PU说明 - PUFileUrl: '',//PU附件 - DOFileUrl: '',//DO附件 - PODFileUrl: '',//POD附件 - otherFileUrl: '',//其他附件 + PUFileUrls: [],//PU附件 + DOFileUrls: [],//DO附件 + PODFileUrls: [],//POD附件 + otherFileUrls: [],//其他附件 specialRequest: '',//特殊要求 remark: '',//备注 @@ -1166,29 +1177,20 @@ } }); }, - handlePreview(e) { - console.log(e, 'e'); + window.open(e.url) }, handleRemove1(e) { - console.log(e, 'e'); - this.form.DOFileUrl = ''; - this.fileList1 = [] + this.fileList1 = this.fileList1.filter(item => item.uid !== e.uid); }, handleRemove2(e) { - console.log(e, 'e'); - this.form.PUFileUrl = ''; - this.fileList2 = [] + this.fileList2 = this.fileList2.filter(item => item.uid !== e.uid); }, handleRemove3(e) { - console.log(e, 'e'); - this.form.PODFileUrl = ''; - this.fileList3 = [] + this.fileList3 = this.fileList3.filter(item => item.uid !== e.uid); }, handleRemove4(e) { - console.log(e, 'e'); - this.form.otherFileUrl = ''; - this.fileList4 = [] + this.fileList4 = this.fileList4.filter(item => item.uid !== e.uid); }, handleExceed(e) { @@ -1235,21 +1237,8 @@ axios.post('http://47.108.239.173:2020/api/oss/new_temp_upload', obj).then(res => { if (res.status == 200) { this.upFileAsArrayBuffer('http://47.108.239.173:2020/api/oss/upload_file', e.file, { methods: 'POST', fileName: res.data.data }).then(resp => { - console.log(resp, 'asdasdsad'); if (resp.data.status === 0) { - if (value == 1) { - this.form.DOFileUrl = 'http://47.108.239.173:2020/api/oss/download/' + res.data.data - console.log(this.fileList1, 'this.fileList1'); - - } else if (value == 2) { - this.form.PUFileUrl = 'http://47.108.239.173:2020/api/oss/download/' + res.data.data - console.log(this.form.PUFileUrl, 'this.form.PUFileUrl'); - - } else if (value == 3) { - this.form.PODFileUrl = 'http://47.108.239.173:2020/api/oss/download/' + res.data.data - } else { - this.form.otherFileUrl = 'http://47.108.239.173:2020/api/oss/download/' + res.data.data - } + this[`fileList${value}`].push({ name: obj.originalName, url: 'http://47.108.239.173:2020/api/oss/download/' + resp.data.data }) this.$forceUpdate() } }) @@ -1293,7 +1282,6 @@ }, handleUpload3(e) { - let obj = { orgId: JSON.parse(localStorage.getItem('userInfo')).extra, fileSize: e.file.size, @@ -1345,7 +1333,11 @@ } .w-316 { - width: 316px; + width: 400px; +} + +::v-deep .el-icon-close-tip { + display: none !important; } .noactive { -- Gitblit v1.7.1