Commit d9ae8300 authored by 高宇's avatar 高宇

修复未调通接口功能;

parent 35077b75
...@@ -48,6 +48,14 @@ ...@@ -48,6 +48,14 @@
isRouteShow: 1, isRouteShow: 1,
title: "产品信息", title: "产品信息",
url: "/product" url: "/product"
},
{
appName: "addressBook",
icon: "fa-address-book",
id: 1,
isRouteShow: 1,
title: "通讯录",
url: "/addressBook"
} }
], ],
homePage: { homePage: {
......
export default {
getAddressBookList: {
url: '/vue/address-book/list'
},
getAddressBookFilter: {
url: '/vue/address-book/get-filter'
}
}
...@@ -189,11 +189,11 @@ export default { ...@@ -189,11 +189,11 @@ export default {
// 1 获取产品类别筛选 // 1 获取产品类别筛选
getProductComponentFilter: { getProductComponentFilter: {
url: '/vue/product/get-filter-component' url: '/vue/product/get-filter-product-component'
}, },
// 2 获取产品系列筛选 // 2 获取产品系列筛选
getProductSerieFilter: { getProductSerieFilter: {
url: '/vue/product/get-filter-serie' url: '/vue/product/get-filter-product-serie'
}, },
// 搜索供应商名称 // 搜索供应商名称
......
<template>
<div>
</div>
</template>
<script>
export default {
name: '',
data () {
return {}
},
methods: {},
created () {
}
}
</script>
<style scoped>
</style>
<template>
<section class="client-schedule-item">
<el-row class="client-schedule-row">
<el-col :span="4" :xs="24" class="client-schedule-left" :style="{'background-color': item.bgcolor}">
<el-row :gutter="10">
<el-col :span="24" class="entity-name">
<i class="fa fa-fw fa-star" aria-hidden="true"></i>
<a @click="toView(item)" v-if="Object.keys(item.client).length > 0">&nbsp;{{ item.client.name }}
</a>
<span v-else>客户名称{{noneText}}</span>
</el-col>
<el-col :span="12" class="entity-name" v-if="Object.keys(item.createdBy).length > 0">
<img class="user-avatar rounded-circle" :src="item.createdBy.avatar.name">
<span class="black">{{ item.createdBy.name }}</span>
</el-col>
<el-col :span="12" v-else><i class="fa fa-fw fa-user"></i> {{noneText}}
</el-col>
</el-row>
</el-col>
<el-col :span="20" :xs="24" class="client-schedule-right">
<el-row :gutter="10">
<el-col :span="6" :xs="24" class="show-picture">
合同编号:
<span>
{{item.serial_no !== '' ? item.serial_no : noneText}}
</span>
</el-col>
<el-col :span="6" :xs="24">
<span class="border border-info text-info rounded px-1">总额</span> :
{{item.amount !== '' ? item.amount : noneText}}
</el-col>
<el-col :span="6" :xs="24">
客户经理: {{item.salesRep}}
</el-col>
<el-col :span="6" :xs="24">
签订日期: <span class="date-time">{{item.signed_at !== '' ? item.signed_at : noneText}}</span>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6" :xs="24">
项目名称:
<a href="javascript:;" size="mini" @click.prevent.stop="showProject(item.project)" v-if="Object.keys(item.project).length > 0">
{{Object.keys(item.project).length > 0 ? item.project.name : noneText}}
</a>
<span v-else>{{noneText}}</span>
</el-col>
<el-col :span="6" :xs="24">
合同类型:
<span class="border border-info text-info rounded px-1"
v-if="item.contract_type !== ''">{{['产品销售', '运维服务'][parseInt(item.contract_type) - 1]}}</span>
<span v-else>{{noneText}}</span>
</el-col>
<el-col :span="6" :xs="24">
上传合同:
<a :href="getScanUrl(item, 'contractScan')" target="_blank" v-if="Object.keys(item.contractScan).length > 0">
<i class="fa fa-fw fa-file-pdf-o"></i>
</a>
<span v-else class="text-danger">扫描件待上传</span>
</el-col>
<el-col :span="6" :xs="24">
上传签收单:
<a :href="getScanUrl(item, 'receiptScan')" target="_blank" v-if="Object.keys(item.receiptScan).length > 0">
<i class="fa fa-fw fa-file-image-o"></i>
</a>
<span v-else class="text-danger">扫描件待上传</span>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="6" :xs="24">
<span class="border border-danger text-danger rounded px-1">服务截止日期</span> :
{{item.expire_date !== '' ? item.expire_date : noneText}}
</el-col>
<el-col :span="6" :xs="24">
<span class="border border-danger text-danger rounded px-1">下次巡检日期</span> :
{{item.remind_date !== '' ? item.remind_date : noneText}}
</el-col>
<el-col :span="6" :xs="24">
<span class="border border-danger text-danger rounded px-1">SLA</span> :
{{item.sla !== '' ? item.sla : noneText}}
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12" :xs="24">
<span class="border border-danger text-danger rounded px-1">备注</span> :
{{item.description !== '' ? item.description : noneText}}
</el-col>
<el-col :span="12" :xs="24">
<slot name="opearate">
</slot>
</el-col>
</el-row>
</el-col>
</el-row>
</section>
</template>
<script>
export default {
name: 'scheduleItem',
props: {
item: Object
},
data () {
return {
noneText: '(未设置)'
}
},
methods: {
showProject (project) {
this.$emit('update:showProject', project)
},
splitFileName (text) {
var pattern = /\.{1}[a-z]{1,}$/
if (pattern.exec(text) !== null) {
return (text.slice(0, pattern.exec(text).index))
} else {
return text
}
},
getScanUrl (item, key) {
let names = item[key].name.split('/')
let name = names[names.length - 1]
return '/attachment/view?name=' + this.splitFileName(name)
},
setBr (text) {
if (text === '') {
return this.noneText
} else {
return text.replace(/\n/g, '<br />')
}
},
toView (item) {
this.$router.push({
app: 'client',
name: 'viewClient',
params: {
id: item.client_id
}
})
},
toDetailView (item) {
this.$router.push({
app: 'salesOrders',
name: 'salesOrderView',
params: {
id: item.id
}
})
}
},
computed: {
isNullClient () {
return !this.item.client
},
isPublic () {
return !!this.item.is_public
}
},
mounted () {
}
}
</script>
<style scoped lang="scss">
.text-info {
color: #17a2b8 !important;
}
.border-info {
border-color: #17a2b8 !important;
}
.colRed {
color: red;
border: 1px solid red;
}
.colGreen {
color: green;
border: 1px solid green;
}
.colRed, .colGreen, .col {
border-radius: .25rem;
padding: 0 .25rem;
}
.rounded-circle {
border-radius: 50% !important;
}
.user-avatar {
width: 16px;
max-width: 16px;
height: 16px;
max-height: 16px;
}
@include c('schedule-item') {
margin-bottom: 10px;
font-size: 12px;
.border {
border: 1px solid #dee2e6;
}
.border-success {
border-color: #28a745 !important;
}
.border-danger {
border-color: #dc3545;
}
.text-success {
color: #28a745 !important;
}
.text-danger {
color: #E45744;
}
.rounded {
border-radius: .25rem !important;
}
.px-1 {
padding: 0 .25rem;
}
}
@include c('schedule-item:first-child') {
.client-schedule-left {
border-radius: 5px 0 0 0;
}
}
@include c('schedule-row') {
background-color: white;
display: flex;
flex-wrap: wrap;
}
@include c('schedule-left') {
background-color: #FF6A6A;
min-height: 100%;
padding: 10px 15px 6px;
.fa-fw {
width: 1.28571429em;
}
> .el-row {
> .el-col {
margin-bottom: 4px;
}
}
.el-row div:first-child, .el-row div:first-child a, .entity-name, .entity-name a {
color: white;
}
.entity-name .black {
color: #000000;
}
span {
display: inline-block;
padding-left: 3px;
}
span.np {
padding-left: 0;
}
@include e('private') {
display: inline-block;
// border: 1px solid black;
padding-right: 5px;
border-radius: 5px;
width: 40px;
height: 20px;
}
}
@include c('schedule-right') {
height: 100%;
padding: 10px 15px 6px;
> .el-row {
> .el-col {
margin-bottom: 4px;
.el-button {
margin: 0 2px;
padding: 7px;
}
.date-time, .show-picture {
color: #649FD7;
}
.show-picture {
cursor: pointer;
}
}
}
.badge {
border-radius: 2px;
color: #333744;
background: #ffffff;
vertical-align: baseline;
display: inline;
padding: 2px 6px;
text-align: center;
}
span.badge-unread {
&:hover {
border-color: #de321d
}
color: #fff;
background-color: #e54c3a;
border-color: #a32516
}
@include e('item') {
display: flex;
flex-direction: column;
justify-content: space-around;
padding: 5px 0 5px 5px;
flex: 1;
}
@include e('status') {
color: red;
}
@include e('content') {
display: inline-block;
border: 1px solid red;
border-radius: 5px;
height: 20px;
padding: 0 5px 0 5px;
color: red;
}
}
</style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div class="pull-right search-form"> <div class="pull-right search-form">
<el-form-item v-if="searchKey"> <el-form-item v-if="searchKey">
<el-input size="mini" v-model="model[(searchKey + '[' + keyCode + ']')]" placeholder="关键词"> <el-input size="mini" v-model="model[(searchKey + '[' + keyCode + ']')]" placeholder="关键词">
<el-button slot="append" type="primary" @click="searchKeyword">搜索</el-button> <el-button slot="append" type="primary" @click="searchKeyword()">搜索</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item v-if="searchKey"> <el-form-item v-if="searchKey">
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
title="设置类别" title="设置类别"
:title-span="6" :title-span="6"
:model="form" :model="form"
search-key="SearchForm" search-key="ProductComponents"
key-code="keyword" key-code="keyword"
type="keyword" type="keyword"
button-title="新建产品类别 " button-title="新建产品类别 "
...@@ -14,7 +14,11 @@ ...@@ -14,7 +14,11 @@
:search-keyword="searchKeyword"></client-header> :search-keyword="searchKeyword"></client-header>
<div class="page-body-content"> <div class="page-body-content">
<children-nav></children-nav> <children-nav></children-nav>
<product-component-table ref="productComponentTable" :table-list="result.list" :product-type="productType" :loading="loading"> <product-component-table ref="productComponentTable"
@update:list="form => {updateTable(form)}"
:table-list="result.list"
:product-type="productType"
:loading="loading">
<template slot="operationTable" slot-scope="scope"> <template slot="operationTable" slot-scope="scope">
<el-button <el-button
type="primary" type="primary"
...@@ -66,7 +70,7 @@ ...@@ -66,7 +70,7 @@
operationPage: '', operationPage: '',
operationTitle: '', operationTitle: '',
form: { form: {
'SearchForm[keyword]': '' 'ProductComponents[keyword]': ''
}, },
result: { result: {
list: [] list: []
...@@ -93,6 +97,7 @@ ...@@ -93,6 +97,7 @@
Object.keys(this.form).forEach(item => { Object.keys(this.form).forEach(item => {
this.form[item] = '' this.form[item] = ''
}) })
this.$refs.productComponentTable.resetForm()
this.getList() this.getList()
}, },
addNewProductComponent () { addNewProductComponent () {
...@@ -109,8 +114,12 @@ ...@@ -109,8 +114,12 @@
this.$refs.sidePopup.show(this.$refs[this.operationPage].initEdit(id)) this.$refs.sidePopup.show(this.$refs[this.operationPage].initEdit(id))
}) })
}, },
updateTable (form) {
this.subForm = Object.assign({}, this.subForm, this.form, form)
this.getList()
},
updateForm (form) { updateForm (form) {
this.subForm = Object.assign({}, this.form, form) this.subForm = Object.assign({}, this.subForm, this.form, form)
this.getList() this.getList()
}, },
searchKeyword (search) { searchKeyword (search) {
...@@ -160,7 +169,7 @@ ...@@ -160,7 +169,7 @@
this.loading = true this.loading = true
requestAPI(api.getProductComponentList, { requestAPI(api.getProductComponentList, {
data: { data: {
...Object.assign({}, this.form, this.subForm), ...Object.assign({}, this.subForm),
page: this.pagenation.page page: this.pagenation.page
} }
}).then(res => { }).then(res => {
...@@ -179,7 +188,7 @@ ...@@ -179,7 +188,7 @@
}, },
created () { created () {
requestAPI(api.getProductComponentFilter).then(res => { requestAPI(api.getProductComponentFilter).then(res => {
console.log(res) this.productType = res.options['ProductComponents[product_type]'].value
}) })
this.getList() this.getList()
} }
......
...@@ -135,6 +135,9 @@ ...@@ -135,6 +135,9 @@
initAdd () { initAdd () {
requestAPI(api.getNewProductComponent).then(res => { requestAPI(api.getNewProductComponent).then(res => {
this.ProductComponents.order = res.nextOrder this.ProductComponents.order = res.nextOrder
Object.keys(res.options).forEach(item => {
this.$set(this.options, item, res.options[item])
})
}) })
}, },
initEdit (id) { initEdit (id) {
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
label="产品分类"> label="产品分类">
<template slot="header" slot-scope="scope"> <template slot="header" slot-scope="scope">
<div style="line-height: 18px;">产品分类</div> <div style="line-height: 18px;">产品分类</div>
<el-select v-model="form.productType" placeholder="请选择" size="mini"> <el-select v-model="form['ProductComponents[product_type]']" placeholder="请选择" size="mini">
<el-option <el-option
v-for="item in productType" v-for="item in productType"
:key="item.id" :key="item.id"
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
data () { data () {
return { return {
form: { form: {
productType: '' 'ProductComponents[product_type]': ''
} }
} }
}, },
...@@ -69,9 +69,23 @@ ...@@ -69,9 +69,23 @@
if (rowIndex % 2 === 0) { if (rowIndex % 2 === 0) {
return 'stripe-class' return 'stripe-class'
} }
},
resetForm () {
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
} }
}, },
props: ['tableList', 'productType', 'loading'] props: ['tableList', 'productType', 'loading'],
watch: {
form: {
handler (val) {
console.log(val)
this.$emit('update:list', val)
},
deep: true
}
}
} }
</script> </script>
......
...@@ -99,6 +99,14 @@ ...@@ -99,6 +99,14 @@
if (rowIndex % 2 === 0) { if (rowIndex % 2 === 0) {
return 'stripe-class' return 'stripe-class'
} }
},
resetComponent () {
this.form.productComponent = ''
},
resetForm () {
Object.keys(this.form).forEach(item => {
this.form[item] = ''
})
} }
}, },
props: ['tableList', 'productComponent', 'productType', 'productBrand', 'loading'], props: ['tableList', 'productComponent', 'productType', 'productBrand', 'loading'],
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
title="设置系列" title="设置系列"
:title-span="6" :title-span="6"
:model="form" :model="form"
search-key="SearchForm" search-key="ProductSeries"
key-code="keyword" key-code="keyword"
type="keyword" type="keyword"
button-title="新建产品系列 " button-title="新建产品系列 "
...@@ -14,11 +14,12 @@ ...@@ -14,11 +14,12 @@
:search-keyword="searchKeyword"></client-header> :search-keyword="searchKeyword"></client-header>
<div class="page-body-content"> <div class="page-body-content">
<children-nav></children-nav> <children-nav></children-nav>
<product-Serie-table ref="productComponentTable" <product-Serie-table ref="productSerieTable"
:table-list="result.list" :table-list="result.list"
:product-type="productType" :product-type="productType"
:product-component="productComponent" :product-component="productComponent"
:product-brand="productBrand" @update:form="val => {updateForm(val)}" :product-brand="productBrand"
@update:form="val => {updateForm(val)}"
:loading="loading"> :loading="loading">
<template slot="operationTable" slot-scope="scope"> <template slot="operationTable" slot-scope="scope">
<el-button <el-button
...@@ -72,7 +73,7 @@ ...@@ -72,7 +73,7 @@
operationPage: '', operationPage: '',
operationTitle: '', operationTitle: '',
form: { form: {
'SearchForm[keyword]': '' 'ProductSeries[keyword]': ''
}, },
result: { result: {
list: [] list: []
...@@ -101,6 +102,8 @@ ...@@ -101,6 +102,8 @@
Object.keys(this.form).forEach(item => { Object.keys(this.form).forEach(item => {
this.form[item] = '' this.form[item] = ''
}) })
this.productComponent = []
this.$refs.productSerieTable.resetForm()
this.getList() this.getList()
}, },
addNewProductSerie () { addNewProductSerie () {
...@@ -118,7 +121,19 @@ ...@@ -118,7 +121,19 @@
}) })
}, },
updateForm (form) { updateForm (form) {
if (form.productType !== '' && form.productType !== this.subForm.productType) {
requestAPI(api.getProductComponent, {
data: {
product_type: form.productType
}
}).then(res => {
this.$refs.productSerieTable.resetComponent()
this.productComponent = []
this.productComponent = res
})
}
this.subForm = Object.assign({}, this.form, form) this.subForm = Object.assign({}, this.form, form)
console.log(this.subForm)
this.getList() this.getList()
}, },
searchKeyword (search) { searchKeyword (search) {
...@@ -187,7 +202,9 @@ ...@@ -187,7 +202,9 @@
}, },
created () { created () {
requestAPI(api.getProductSerieFilter).then(res => { requestAPI(api.getProductSerieFilter).then(res => {
console.log(res) this.productType = res.options['ProductSeries[product_type]'].value
this.productBrand = res.options['ProductSeries[product_brand]'].value
this.productComponent = res.options['ProductSeries[product_component]'].value
}) })
this.getList() this.getList()
} }
......
...@@ -4,6 +4,7 @@ import ElementRoute from './routes/project' ...@@ -4,6 +4,7 @@ import ElementRoute from './routes/project'
import salesOrder from './routes/salesOrders' import salesOrder from './routes/salesOrders'
import salesContracts from './routes/salesContracts' import salesContracts from './routes/salesContracts'
import products from './routes/products' import products from './routes/products'
import address from './routes/addressBook'
let routes = [] let routes = []
let salesRours = [] let salesRours = []
const appName = 'project' const appName = 'project'
...@@ -23,6 +24,9 @@ let RouterInit = () => { ...@@ -23,6 +24,9 @@ let RouterInit = () => {
portal.createApp('products', {}, app => { portal.createApp('products', {}, app => {
app.mapRoute(products) app.mapRoute(products)
}) })
portal.createApp('addressBook', {}, app => {
app.mapRoute(address)
})
} }
export default RouterInit export default RouterInit
import addressBookList from '../components/addressBook/list'
const projectTitle = '金畅逍BMS - '
const routes = [
{
path: '/addressBook',
name: 'addressBookList',
component: addressBookList,
meta: {
title: projectTitle + '通讯录'
}
}
]
export default routes
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