Commit 3cb1994a authored by 我在何方's avatar 我在何方

订单创建添加关联报价单

parent 0e7c5761
......@@ -142,4 +142,20 @@ export function exportDeptOfferExcel(query) {
params: query,
responseType: 'blob'
})
}
// 报价单
export function getOfferSelect(params) {
return request({
url: '/ecw/offer/select',
method: 'get',
params
})
}
// 报价单
export function getOfferCheck(params) {
return request({
url: '/ecw/offer/check',
method: 'get',
params
})
}
\ No newline at end of file
......@@ -108,6 +108,12 @@
<el-descriptions-item :label="$t('单证报关')">
<dict-tag :type="DICT_TYPE.ECW_CUSTOMS_TYPE" :value="order.customsType" />
</el-descriptions-item>
<el-descriptions-item :label="$t('关联报价单')">
<router-link v-if="offerData" :to="{path: '/offer/detail',query: {offerId: offerData.offerId}}" class="link-type">
<span>{{ offerData.number }}</span>
</router-link>
<span v-else>/</span>
</el-descriptions-item>
</el-descriptions>
<el-descriptions class="mr-10" border :column="2" :class="showMore?'showInfo':'hiddenInfo'" :labelStyle="{width:'110px'}" :contentStyle="{width:'150px'}">
<el-descriptions-item :label="$t('出单方式')">
......@@ -479,6 +485,7 @@
<script>
import {getOrder, operateLogPage} from '@/api/ecw/order'
import {getOfferCheck} from '@/api/ecw/offer'
import { getDictDatas, DICT_TYPE, getDictData } from '@/utils/dict';
import PrintWarehouseReceipt from './components/PrintWarehouseReceipt'
import PrintLadingBill from './components/PrintLadingBill'
......@@ -553,6 +560,7 @@ export default {
packAfterData:null,//显示打包历史详情
showDeclaration:false, //显示报关资料
showFeeSummary: false, // 是否显示费用汇总
offerData:'' //关联报价单
}
},
computed:{
......@@ -614,6 +622,7 @@ export default {
if (this.$route.query.orderId) {
this.orderId = this.$route.query.orderId
this.getOrder();
this.getOfferNumber()
}
getCurrencyList().then(res => this.currencyList = res.data)
......@@ -811,6 +820,12 @@ export default {
//查看打包历史详情
showPackDetail(packAfterData){
this.packAfterData = packAfterData
},
getOfferNumber() {
const that = this
getOfferCheck({ orderId: that.orderId }).then(response => {
that.offerData = response.data
})
}
}
};
......
......@@ -448,6 +448,22 @@
</el-table>
</el-form-item>
</div>
<el-form-item :label="$t('关联报价单')" prop="offerId">
<el-select
v-model="form.offerId"
filterable
clearable
reserve-keyword
:placeholder="$t('请选择')"
>
<el-option
v-for="(item, index) in offerData"
:key="index"
:label="item.number"
:value="item.offerId"
/>
</el-select>
</el-form-item>
</el-card>
<el-card class="mt-10" v-if="transport">
......@@ -595,6 +611,7 @@ import Decimal from 'decimal.js'
import WorkFlow from '@/components/WorkFlow'
import { getCustomer } from "@/api/ecw/customer";
import {debounce} from "@/utils";
import { getOfferSelect, getOfferCheck } from "@/api/ecw/offer"
// 缓存默认的表单数据
let makeDefaultFormData = () => {
......@@ -608,7 +625,7 @@ let makeDefaultFormData = () => {
externalWarehouseDtoList:[],
orderItemVOList:[],
drawee: 2,
harvestMethod: "1"
harvestMethod: "1",
}
}
window.Decimal = Decimal
......@@ -662,7 +679,8 @@ export default {
showWorkFlow: false, // 是否显示工作流表单
calculating: false, // 是否正在计算费用,防止频繁重新请求
initing: true, // 初始化中,
updateChannel: false // 是否更新渠道
updateChannel: false, // 是否更新渠道
offerData: []// 关联报价单
};
},
computed:{
......@@ -877,6 +895,18 @@ export default {
'form.channelId'(){
this.calculationPrice()
},
'form.consigneeCountryCode'(){
if(this.form.lineId) this.getOfferData()
},
'form.consignorCountryCode'(){
if(this.form.lineId) this.getOfferData()
},
'form.consigneePhone'(){
if(this.form.lineId) this.getOfferData()
},
'form.consignorPhone'(){
if(this.form.lineId) this.getOfferData()
},
'form.lineId'(lineId){
let router = this.routerList.find(item => item.id == lineId)
if(!router){
......@@ -897,7 +927,7 @@ export default {
this.$set(this.form, 'isCargoControl', false)
}
})
this.getOfferData()
},
/* 'form.packageTypeArr'(val){
console.log('packageType', val, val.length)
......@@ -1024,7 +1054,7 @@ export default {
this.initing = true
getUpdateInfo(this.$route.query.id).then(res => {
this.form = Object.assign({}, {...res.data}, {orderItemVOList: []})
this.getOfferData()
/* this.form.orderItemVOList = []; */
this.form.type = this.form.type ? this.form.type.split(',').filter(item => item != '') : []
......@@ -1114,6 +1144,7 @@ export default {
this.$set(this.form, this.contactChooseType + 'Phone', contact.phoneNew)
this.contactChooseType = null
this.quickCreateType = null
if(this.form.lineId) this.getOfferData()
},
upload(e){
console.log({upload: e})
......@@ -1370,7 +1401,46 @@ export default {
arr.push(tmp)
})
return arr
}
},
// 关联报价单
getOfferData() {
const that = this
const offParams = {}
if (that.form.lineId) {
offParams.lineId = that.form.lineId
}
if (that.form.channelId) {
offParams.channelId = that.form.channelId
}
if (that.form.consigneeContactsId) {
offParams.consigneeId = that.form.consigneeContactsId
} else {
offParams.consigneeCode = that.form.consigneeCountryCode
offParams.consigneePhone = that.form.consigneePhone
}
if (that.form.consignorContactsId) {
offParams.consignorId = that.form.consignorContactsId
} else {
offParams.consignorCode = that.form.consignorCountryCode
offParams.consignorPhone = that.form.consignorPhone
}
getOfferSelect(offParams).then((res) => {
that.offerData = res.data
if (!that.form.offerId && that.form.orderId) {
that.getOfferNumber(that.form.orderId)
}
})
},
getOfferNumber(id) {
const that = this
getOfferCheck({ orderId: id }).then(response => {
if(that.offerData.length==0){
that.offerData.push(response.data)
}
console.log(that.offerData)
that.$set(that.form, 'offerId', response.data.offerId)
})
},
}
};
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment