Commit 9efd7e6c authored by dragondean@qq.com's avatar dragondean@qq.com

完善新建订单

parent f043c9b4
...@@ -51,6 +51,14 @@ export function getCustomerContactsPage(query) { ...@@ -51,6 +51,14 @@ export function getCustomerContactsPage(query) {
}) })
} }
// 获得客户联系人下拉列表
export function getCustomerContactsSelect(query) {
return request({
url: '/ecw/customer-contacts/select',
method: 'get',
params: query
})
}
// 导出客户联系人 Excel // 导出客户联系人 Excel
export function exportCustomerContactsExcel(query) { export function exportCustomerContactsExcel(query) {
return request({ return request({
......
...@@ -69,3 +69,12 @@ export function batchUpdateProduct(data) { ...@@ -69,3 +69,12 @@ export function batchUpdateProduct(data) {
data: data data: data
}) })
} }
// 计算单种运输方式的商品费用(单个商品也做数组传参)
export function calculationPrice(data){
return request({
url: '/product/line/price/calculation',
method: 'post',
data: data
})
}
\ No newline at end of file
<template>
<div>
<el-select v-model="formData.country">
<el-option v-for="(item) in treeList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
<el-select v-model="formData.province">
<el-option v-for="(item) in provinceList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
<el-select v-model="formData.city">
<el-option v-for="(item) in cityList" :value="item.id" :label="item.titleZh" :key="item.id" />
</el-select>
</div>
</template>
<script>
import { getListTree } from "@/api/ecw/region";
export default {
data(){
return {
formData:{
},
treeList: [],
provinceList: [],
cityList:[]
}
},
watch:{
'formData.city'(city){
this.$emit('cityChange', city)
},
'formData.country'(country){
this.$emit('countryChange', country)
this.treeList.forEach(item => {
if(item.id == country){
this.provinceList = item.children || []
}
})
},
'formData.province'(province){
this.$emit('provinceChange', province)
this.provinceList.forEach(item => {
if(item.id == province){
this.cityList = item.children || []
}
})
}
},
created(){
getListTree({treeType: 1}).then(response => {
this.treeList = response.data
})
}
}
</script>
\ No newline at end of file
<template>
<el-select
v-model="index"
filterable
clearable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="(item, index) in list"
:key="item.id"
:label="`${item.contactsName}(${item.customerName})`"
:value="index">
</el-option>
</el-select>
</template>
<script>
import {getCustomerContactsSelect, getCustomerContacts} from '@/api/ecw/customerContacts'
export default {
props:{
value: [String, Number]
},
data(){
return {
index: null,
list:[],
loading: false,
size: 20
}
},
watch:{
index(val){
this.$emit('input', val !== null ? this.list[val].customerContactsId: null)
this.$emit('change', val !== null ? this.list[val]: null)
},
value(val){
this.init()
}
},
created(){
this.init()
},
methods:{
init(){
if(!this.value) return
let index = this.list.findIndex(item => item.customerContactsId == this.value)
if(index < 0){
getCustomerContacts(this.value).then(res => {
this.list.unshift(res.data)
this.index = 0
})
}
},
remoteMethod(keyword){
let params = {
size: this.size
}
params.searchKey = keyword
this.loading = true
getCustomerContactsSelect(params)
.then(res => this.list = res.data)
.finally(() => this.loading = false)
}
}
}
</script>
\ No newline at end of file
...@@ -6,12 +6,14 @@ ...@@ -6,12 +6,14 @@
remote remote
reserve-keyword reserve-keyword
placeholder="请输入商品关键词" placeholder="请输入商品关键词"
:disabled="disabled"
:remote-method="remoteMethod" :remote-method="remoteMethod"
:loading="loading"> :loading="loading">
<el-option <el-option
v-for="(item, index) in list" v-for="(item, index) in list"
:key="item.id" :key="item.id"
:label="item.titleZh" :label="item.titleZh"
:value="index"> :value="index">
</el-option> </el-option>
</el-select> </el-select>
...@@ -22,19 +24,23 @@ import {getProduct, getProductPage} from '@/api/ecw/product' ...@@ -22,19 +24,23 @@ import {getProduct, getProductPage} from '@/api/ecw/product'
export default { export default {
props:{ props:{
productType: [String, Number], productType: [String, Number],
value: [String, Number] value: [String, Number],
disabled: Boolean
}, },
data(){ data(){
return { return {
index: {}, index: null,
list:[], list:[],
loading: false loading: false
} }
}, },
watch:{ watch:{
index(val){ index(val){
this.$emit('input', val !== null ? this.list[val].id : null)
this.$emit('change', val !== null ? this.list[val] : null) let productId = val !== '' && val !== null ? this.list[val].id : null
console.log('index val', val, productId)
this.$emit('input', productId)
this.$emit('change', val != '' && val !== null ? this.list[val] : null)
}, },
value(val){ value(val){
console.log('初始化内容', val) console.log('初始化内容', val)
......
...@@ -97,6 +97,8 @@ export const DICT_TYPE = { ...@@ -97,6 +97,8 @@ export const DICT_TYPE = {
ECW_OFFER_TYPE: 'offer_type', // 跟进类型 ECW_OFFER_TYPE: 'offer_type', // 跟进类型
ECW_OFFER_METHOD: 'offer_method', // 跟进方式 ECW_OFFER_METHOD: 'offer_method', // 跟进方式
ECW_RECEIPT_STATE: 'receipt_state',//收款单状态 ECW_RECEIPT_STATE: 'receipt_state',//收款单状态
ECW_SUING_METHOD: 'suing_method', // 出单方式
ECW_HARVEST_METHOD: 'harvest_method', // 收货方式
//--------ecw--------- //--------ecw---------
CUSTOMER_STATUS: 'customer_status', CUSTOMER_STATUS: 'customer_status',
CUSTOMER_SOURCE: 'customer_source', CUSTOMER_SOURCE: 'customer_source',
......
This diff is collapsed.
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