Commit b4ad653c authored by dragondean@qq.com's avatar dragondean@qq.com

修复快速新建联系人,完善报价单

parent baadbbc5
...@@ -18,13 +18,13 @@ ...@@ -18,13 +18,13 @@
</el-select> </el-select>
<el-button v-if="quickable" type="text" @click="showQuickCreate=true" class="ml-10">快速新建</el-button> <el-button v-if="quickable" type="text" @click="showQuickCreate=true" class="ml-10">快速新建</el-button>
<quick-create v-if="showQuickCreate" @success="onQuickCreateSuccess" @close="showQuickCreate=false"></quick-create> <!-- <quick-create v-if="showQuickCreate" @success="onQuickCreateSuccess" @close="showQuickCreate=false" :default="{type}"></quick-create> -->
</div> </div>
</template> </template>
<script> <script>
import {getCustomerContactsSelect, getCustomerContactsListByCustomer} from '@/api/ecw/customerContacts' import {getCustomerContactsSelect, getCustomerContactsListByCustomer} from '@/api/ecw/customerContacts'
import QuickCreate from '@/views/ecw/customer/components/quickCreate' import QuickCreate from '@/views/ecw/customer/components/quickCreate'
import Vue from 'vue'
export default { export default {
components:{QuickCreate}, components:{QuickCreate},
props:{ props:{
...@@ -32,7 +32,8 @@ export default { ...@@ -32,7 +32,8 @@ export default {
quickable: { quickable: {
type: Boolean, type: Boolean,
default: true default: true
} },
type: [String, Number], // 客户类别,新建时指定默认类别,也可以根据需要筛选联系人所属的客户类别
}, },
data(){ data(){
return { return {
...@@ -50,6 +51,49 @@ export default { ...@@ -50,6 +51,49 @@ export default {
}, },
value(val){ value(val){
this.init() this.init()
},
showQuickCreate(){
if(!this.showQuickCreate)return
const QuickCreateComp = Vue.extend(QuickCreate)
const dialog = new QuickCreateComp({
propsData:{
default: {type: this.type}
},
})
/* dialog.$on = () => {
return {
success: this.onQuickCreateSuccess,
close: () => {
console.log('关闭拉')
this.showQuickCreate = false
}
}
} */
dialog.$on('close', () => {
console.log('关闭拉')
this.showQuickCreate = false
document.body.removeChild(dialog.$el)
dialog.$destroy()
})
dialog.$on('success', (id) => {
this.onQuickCreateSuccess(id)
dialog.$emit('close')
})
dialog.$mount()
console.log({
dialog,
parent: this
})
window.dialogComp = dialog
document.body.append(dialog.$el)
/* dialog.remove = () => {
console.log('关闭拉11')
document.body.removeChild(dialog.$el)
} */
} }
}, },
created(){ created(){
......
<template> <template>
<el-dialog :visible.sync="show" title="快速新建客户" :close-on-click-modal="false" class="quick-create-customer"> <el-dialog :visible.sync="show" title="快速新建客户" :close-on-click-modal="false" class="quick-create-customer">
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px" :validate-on-rule-change="false">
<el-form-item label="客户类别" prop="type"> <el-form-item label="客户类别" prop="type">
<dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple v-model="form.type"></dict-selector> <dict-selector :type="DICT_TYPE.CUSTOMER_TYPE" form-type="checkbox" multiple v-model="form.type"></dict-selector>
</el-form-item> </el-form-item>
...@@ -59,19 +59,9 @@ import { getCountryListAll } from '@/api/ecw/country' ...@@ -59,19 +59,9 @@ import { getCountryListAll } from '@/api/ecw/country'
export default { export default {
name: "quickCreateCustomer", name: "quickCreateCustomer",
props:{ props:{
default: Object default: Object,
},
created() {
if(this.default){
this.$set(this, 'form', Object.assign({}, this.default, this.form))
}
listServiceUser().then(r => {
this.serviceUserList = r.data
})
getCountryListAll().then(r => {
this.countryList = r.data
})
}, },
data(){ data(){
return { return {
show: true, show: true,
...@@ -89,7 +79,7 @@ export default { ...@@ -89,7 +79,7 @@ export default {
source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }], source: [{ required: true, message: "客户来源不能为空", trigger: "blur" }],
customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }], customerService: [{ required: true, message: "跟进客服不能为空", trigger: "blur" }],
status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }], status: [{ required: true, message: "客户状态不能为空", trigger: "blur" }],
founder: [{ required: true, message: "创建人不能为空", trigger: "blur" }], founder: [{ required: true, message: "创建人不能为空", trigger: "blur" }],
}, },
serviceUserList: [], serviceUserList: [],
countryList: [], countryList: [],
...@@ -102,6 +92,17 @@ export default { ...@@ -102,6 +92,17 @@ export default {
} }
} }
}, },
created() {
if(this.default){
this.$set(this, 'form', Object.assign({}, this.default, this.form))
}
listServiceUser().then(r => {
this.serviceUserList = r.data
})
getCountryListAll().then(r => {
this.countryList = r.data
})
},
methods: { methods: {
open(){ open(){
this.show = true this.show = true
...@@ -127,7 +128,7 @@ export default { ...@@ -127,7 +128,7 @@ export default {
} }
} }
</script> </script>
<style scoped lang="scss"> <style lang="scss">
.quick-create-customer .el-form-item{ .quick-create-customer .el-form-item{
margin-bottom: 22px; margin-bottom: 22px;
} }
......
This diff is collapsed.
...@@ -154,7 +154,7 @@ export default { ...@@ -154,7 +154,7 @@ export default {
return false return false
} }
console.log('submit') console.log('submit')
createPick(this.formData).then(res => { createPick(Object.assign({orderId: this.orderId}, this.formData)).then(res => {
this.$message.success(res.msg || '操作成功') this.$message.success(res.msg || '操作成功')
this.closeDialog() this.closeDialog()
}) })
......
<!--拆单审核中的申请信息部分--> <!--拆单审核中的申请信息部分-->
<template> <template>
<div> <div v-if="detail">
<el-descriptions :column="4"> <el-descriptions :column="4" v-if="order">
<el-descriptions-item label="订单号">kooriookami</el-descriptions-item> <el-descriptions-item label="订单号">{{order.orderNo}}</el-descriptions-item>
<el-descriptions-item label="运输方式">18100000000</el-descriptions-item> <el-descriptions-item label="运输方式">
<el-descriptions-item label="出货方式">苏州市</el-descriptions-item> <dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="order.transportId" />
</el-descriptions-item>
<el-descriptions-item label="出货方式">
{{channel ? channel.nameZh : ''}}
</el-descriptions-item>
<el-descriptions-item label="订单状态"> <el-descriptions-item label="订单状态">
<el-tag size="small">学校</el-tag> <el-tag size="small">
<dict-tag :type="DICT_TYPE.ORDER_STATUS" :value="order.status" />
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="唛头">{{order.marks}}</el-descriptions-item>
<el-descriptions-item label="始发仓">
{{order.logisticsInfoDto.startTitleZh}}
</el-descriptions-item>
<el-descriptions-item label="目的仓">
{{order.logisticsInfoDto.destAddressZh}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="出货方式">苏州市</el-descriptions-item>
<el-descriptions-item label="唛头">苏州市</el-descriptions-item>
<el-descriptions-item label="目的仓">苏州市</el-descriptions-item>
</el-descriptions> </el-descriptions>
<template v-for="item in detail.orderSplitBackVOList"> <template v-for="item in detail.orderSplitBackVOList">
<div class="title" :key="item.orderNo"> <div class="title mt-20" :key="item.orderNo">
{{item.orderNo}} <span class="mr-10">{{item.orderNo}}</span>
<dict-tag :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="item.transportId" /> <dict-tag class="mr-10" :type="DICT_TYPE.ECW_TRANSPORT_TYPE" :value="item.transportId" />
<span class="mr-10" v-if="item.channelName">{{item.channelName}}</span>
</div> <span>发往{{item.dstWarehouseName}}</span>
<el-table :data="item.orderSplitItemBackVOList" :key="'items-' + item.orderNo"> </div>
<el-table-column label="序号"> <el-table :data="item.orderSplitItemBackVOList" :key="'items-' + item.orderNo">
<template slot-scope="scope">{{scope.$index+1}}</template> <el-table-column label="序号">
</el-table-column> <template slot-scope="scope">{{scope.$index+1}}</template>
<el-table-column label="中文品名"> </el-table-column>
<template slot-scope="{row}">{{row.prodTitleZh}}</template> <el-table-column label="中文品名">
</el-table-column> <template slot-scope="{row}">{{row.prodTitleZh}}</template>
<el-table-column label="英文品名"> </el-table-column>
<template slot-scope="{row}">{{row.prodTitleEn}}</template> <el-table-column label="英文品名">
</el-table-column> <template slot-scope="{row}">{{row.prodTitleEn}}</template>
<el-table-column label="品牌"> </el-table-column>
<template slot-scope="{row}"> <el-table-column label="品牌">
<dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brandType" /> <template slot-scope="{row}">
</template> <dict-tag :type="DICT_TYPE.ECW_IS_BRAND" :value="row.brandType" />
</el-table-column> </template>
<el-table-column label="体积"> </el-table-column>
<template slot-scope="{row}">{{row.volume}}</template> <el-table-column label="体积">
</el-table-column> <template slot-scope="{row}">{{row.volume}}</template>
<el-table-column label="重量"> </el-table-column>
<template slot-scope="{row}">{{row.weight}}kg</template> <el-table-column label="重量">
</el-table-column> <template slot-scope="{row}">{{row.weight}}kg</template>
<el-table-column label="箱数"> </el-table-column>
<template slot-scope="{row}">{{row.num}}</template></el-table-column> <el-table-column label="箱数">
</el-table> <template slot-scope="{row}">{{row.num}}</template></el-table-column>
</el-table>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
import {getApproval} from '@/api/ecw/order' import {getApproval, getOrder} from '@/api/ecw/order'
import {getChannel} from '@/api/ecw/channel'
export default { export default {
props:{ props:{
id: [String, Number] id: [String, Number]
}, },
data(){ data(){
return { return {
detail: null detail: null,
order: null,
channel: null
} }
}, },
watch:{ watch:{
id(){ id(){
this.getData() this.getData()
},
detail(){
this.getOrder()
},
order(){
if(this.order.channelId){
this.getChannel()
}
} }
}, },
created(){ created(){
...@@ -72,7 +94,26 @@ export default { ...@@ -72,7 +94,26 @@ export default {
getApproval(this.id).then(res => { getApproval(this.id).then(res => {
this.detail = JSON.parse(res.data.details) this.detail = JSON.parse(res.data.details)
}) })
},
getOrder(){
getOrder(this.detail.orderId).then(res => {
this.order = res.data
})
},
getChannel(){
getChannel(this.order.channelId).then(res => {
this.channel = res.data
})
} }
} }
} }
</script> </script>
\ No newline at end of file <style scoped lang="scss">
.title{
padding: 10px 0;
span{
font-size: 14px;
font-weight: bold;
}
}
</style>
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<el-descriptions-item label="*发货人" :labelStyle="labelStyle"> <el-descriptions-item label="*发货人" :labelStyle="labelStyle">
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consignorContactsId" required error="发货人不能为空"> <el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consignorContactsId" required error="发货人不能为空">
<customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" /> <customer-contact-selector v-model="form.consignorContactsId" @change="consignorContact = $event" type="1" />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="电话" :labelStyle="labelStyle"> <el-descriptions-item label="电话" :labelStyle="labelStyle">
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<el-descriptions :column="3" border> <el-descriptions :column="3" border>
<el-descriptions-item label="*收货人" :labelStyle="labelStyle" > <el-descriptions-item label="*收货人" :labelStyle="labelStyle" >
<el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consigneeContactsId" required error="收货人不能为空"> <el-form-item label="" label-width="0" style="margin-bottom: 0" prop="consigneeContactsId" required error="收货人不能为空">
<customer-contact-selector v-model="form.consigneeContactsId" @change="consigneeContact = $event" /> <customer-contact-selector v-model="form.consigneeContactsId" @change="consigneeContact = $event" type="2" />
</el-form-item> </el-form-item>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="电话" :labelStyle="labelStyle"> <el-descriptions-item label="电话" :labelStyle="labelStyle">
......
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