Browse Source

需求分类

shibei_master
13176889840 4 years ago
parent
commit
ae6299e59b
  1. 33
      src/views/modules/workSys/demandCate.vue

33
src/views/modules/workSys/demandCate.vue

@ -4,7 +4,14 @@
<div class="resi-row-btn">
<el-form :inline="true" :model="form" class="demo-form-inline">
<el-form-item label="需求分类">
<el-input v-model="form.categoryName" placeholder="需求分类" clearable=""></el-input>
<el-select v-model="form.firstCategoryCode" filterable placeholder="请选择" clearable>
<el-option
v-for="item in demandOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSearch">查询</el-button>
@ -128,7 +135,6 @@ export default {
currentPage: 1,
pageSize: 20,
total: null,
conditions: [],
tableData: [],
addLevel: '1',
addType: 'add',
@ -142,6 +148,7 @@ export default {
value: 2
}
],
demandOptions: [],
tableHeader: [
{
label: '分类名称',
@ -162,6 +169,7 @@ export default {
],
customerId: '',
form: {
firstCategoryCode: '',
categoryName: '',
awardPoint: '',
usableFlag: false
@ -174,6 +182,7 @@ export default {
async created() {
this.customerId = localStorage.getItem('customerId')
this.getTableData()
this.getOptions()
this.pageLoading = true
},
mounted() {
@ -201,7 +210,6 @@ export default {
handleSearch(val) {
console.log('searchhh--', val)
this.currentPage = 1
this.conditions = val
this.getTableData()
},
handleAdd(type, addType, row) {
@ -363,6 +371,23 @@ export default {
return this.$message.error('网络错误')
})
},
async getOptions() {
const params = {
parentCategoryCode: 0
}
this.$http
.post('/heart/icresidemanddict/subcodelist', params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
this.demandOptions = res.data
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
async getTableData() {
this.tableLoading = true
let params = {
@ -370,7 +395,7 @@ export default {
customerId: localStorage.getItem('customerId'),
pageNo: this.currentPage,
pageSize: this.pageSize,
firstCategoryCode: ''
firstCategoryCode: this.form.firstCategoryCode
}
await this.$http
.post('/heart/icresidemanddict/pagelist', params)

Loading…
Cancel
Save