Browse Source

Merge remote-tracking branch 'origin/master'

master
wangpengfei 2 years ago
parent
commit
0d3029fb01
  1. 109
      supervise-crm-ui/src/api/dataDict/datadict.js
  2. 25
      supervise-crm-ui/src/router/modules/codemenu.js
  3. 248
      supervise-crm-ui/src/views/dataDict/dictCommon.vue
  4. 155
      supervise-crm-ui/src/views/dataDict/dictMap.vue
  5. 200
      supervise-crm-ui/src/views/dataDict/index.vue
  6. 174
      supervise-crm-ui/src/views/industry/industryAdd.vue
  7. 228
      supervise-crm-ui/src/views/industry/industryInfo.vue
  8. 174
      supervise-crm-ui/src/views/projectType/projectTypeAdd.vue
  9. 225
      supervise-crm-ui/src/views/projectType/projectTypeInfo.vue

109
supervise-crm-ui/src/api/dataDict/datadict.js

@ -2,4 +2,113 @@ import request from '@/utils/request'
export default {
// 行业品类 分类列表
industryListPage: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/industrydictionary/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 行业品类 通过sid删除一条或多条记录
industryDelBySids: function(sid) {
return request({
baseURL: '/api/crm',
url: '/v1/industrydictionary/delete/' + sid,
method: 'delete'
})
},
// 行业品类 保存行业品类
saveindustry: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/industrydictionary/save',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 行业品类 修改行业品类
updateindustry: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/industrydictionary/update',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 行业品类 通过sid查询一条记录
industryFetchBySid: function(sid) {
return request({
baseURL: '/api/crm',
url: '/v1/industrydictionary/getIndustryBySid/' + sid
})
},
// 类别维护 类别列表
classListPage: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/projtypedictionary/listPage',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 类别维护 通过sid删除一条或多条记录
classDelBySids: function(sid) {
return request({
baseURL: '/api/crm',
url: '/v1/projtypedictionary/delete/' + sid,
method: 'delete'
})
},
// 类别维护 保存行业品类
saveClass: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/projtypedictionary/save',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 类别维护 修改行业品类
updateClass: function(params) {
return request({
baseURL: '/api/crm',
url: '/v1/projtypedictionary/update',
method: 'post',
data: params,
headers: {
'Content-Type': 'application/json'
}
})
},
// 类别维护 通过sid查询一条记录
classFetchBySid: function(sid) {
return request({
baseURL: '/api/crm',
url: '/v1/projtypedictionary/getProjTypeBySid/' + sid
})
},
}

25
supervise-crm-ui/src/router/modules/codemenu.js

@ -41,15 +41,28 @@ const codemenu = [{
}
}]
},{
path: 'dataDict',
path: 'industry',
component: Layout,
redirect: '/dataDict',
redirect: '/industry',
children: [{
path: '/dataDict/index',
component: () => import('@/views/dataDict/index.vue'),
name: 'index',
path: '/industry/industryInfo',
component: () => import('@/views/industry/industryInfo.vue'),
name: 'industryInfo',
meta: {
title: '项目行业',
noCache: true
}
}]
},{
path: 'projectType',
component: Layout,
redirect: '/projectType',
children: [{
path: '/projectType/projectTypeInfo',
component: () => import('@/views/projectType/projectTypeInfo.vue'),
name: 'projectTypeInfo',
meta: {
title: '数据字典',
title: '项目类型',
noCache: true
}
}]

248
supervise-crm-ui/src/views/dataDict/dictCommon.vue

@ -1,248 +0,0 @@
<template>
<div class="container">
<div v-show="viewState == 1">
<div class="tab-header">
<el-form ref="form" :inline="true" :model="form" label-width="80px">
<el-row :gutter="20">
<el-col :span="14">
<el-form-item label="数据value">
<el-input v-model="page.params.dictValue" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item style="float: right;">
<el-button type="primary" @click="onSearch()"> </el-button>
<el-button @click="add()"> </el-button>
<el-button @click="closeDict"> </el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData" border style="width: 100%;">
<el-table-column label="序号" width="50px" type="index" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="280px">
<template slot-scope="scope">
<!-- <el-button type="primary" size="mini" @click="add(scope.row)">-->
<!-- 添加子级-->
<!-- </el-button>-->
<el-button type="primary" size="mini" @click="editRow(scope.row)">
修改
</el-button>
<el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.row)">
删除
</el-button>
<el-button type="primary" size="mini" @click="handleMap(scope.row)">
映射
</el-button>
</template>
</el-table-column>
<el-table-column prop="dictType" label="字典分类编码" align="center">
</el-table-column>
<el-table-column prop="groupName" label="数据分组" align="center">
</el-table-column>
<el-table-column prop="dictKey" label="数据key" align="center">
</el-table-column>
<el-table-column prop="dictValue" label="数据value" align="center">
</el-table-column>
</el-table>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
<!-- 分类编辑 -->
<el-dialog :title="dialogTitle + '字典数据'" :visible.sync="editDialog" width="50%">
<table class="e-table" cellspacing="0">
<tr>
<td>字典分类编码</td>
<td>
{{ form.dictType }}
</td>
</tr>
<tr>
<td>数据分组</td>
<td>
<el-input v-model="form.groupName"></el-input>
</td>
</tr>
<tr>
<td>数据key</td>
<td>
<el-input v-model="form.dictKey"></el-input>
</td>
</tr>
<tr>
<td>数据value</td>
<td>
<el-input v-model="form.dictValue"></el-input>
</td>
</tr>
</table>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save()"> </el-button>
<el-button @click="editDialog = false"> </el-button>
</div>
</el-dialog>
</div>
<dictMap v-show="viewState == 2" ref="divAdd" @doback="resetState"/>
</div>
</template>
<script>
// import { deldictCommon, dictCommonList, putdictCommon, savedictCommon } from '@/api/system/dictType/dictCommon.js'
import dictMap from './dictMap'
export default {
components: {
dictMap
},
data() {
return {
editDialog: false,
dialogTitle: '',
viewState: 1,
form: {
dictKey: '',
dictType: '',
groupName: '',
dictValue: '',
parentSid: ''
},
page: {
total: 0, //
current: 1, //
size: 10, //
params: {
dictKey: '',
dictType: '',
dictValue: '',
parentSid: '',
sidPath: '',
}
},
tableData: []
}
},
props: ['dictData'],
watch: {
dictData: {
handler(val) {
this.form.parentSid = val.sid
this.form.dictType = val.dictType
this.form.groupName = val.groupName
this.page.params.parentSid = val.sid
this.page.params.dictType = val.dictType
this.getPageList(this.page)
},
deep: true
}
},
mounted() {
// if (this.$route.query.sid) {
// sessionStorage.setItem('dictType', this.$route.query.dictType);
// sessionStorage.setItem('parentSid', this.$route.query.sid);
// this.page.params.dictType = this.$route.query.dictType
// this.page.params.parentSid = this.$route.query.sid
// this.form.dictType = this.$route.query.dictType;
// this.form.parentSid = this.$route.query.sid
// } else {
// this.page.params.dictType = sessionStorage.getItem('dictType');
// this.page.params.parentSid = sessionStorage.getItem('parentSid');
// this.form.dictType = sessionStorage.getItem('dictType');
// this.form.parentSid = sessionStorage.getItem('parentSid');
// }
this.getPageList(this.page)
},
methods: {
pagination(val) { //
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getPageList(this.page)
},
onSearch() { //
this.getPageList(this.page)
},
resetSearch() { //
this.getPageList(this.page)
},
getPageList(data) { //
dictCommonList(data).then((res) => {
this.tableData = res.data.records
this.page.total = res.data.total
})
},
add(row) {
if (row) {
this.form.dictType = row.dictType
this.form.parentSid = row.sid
} else {
this.form.parentSid = 0
// this.form.dictType = row.dictType
}
this.dialogTitle = '新增'
this.editDialog = true
this.form.dictKey = ''
this.form.groupName = ''
this.form.dictValue = ''
this.form.sid = ''
},
closeDict() {
this.form.parentSid = ''
this.form.dictType = ''
this.form.groupName = ''
this.page.params.parentSid = ''
this.page.params.dictType = ''
this.$emit('doback')
},
editRow(row) {
this.dialogTitle = '编辑'
this.editDialog = true
this.form = Object.assign({}, row)
},
save() {
if (this.form.sid) {
putdictCommon(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
this.$message({
message: res.msg,
type: 'success'
})
})
} else {
savedictCommon(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
this.$message({
message: res.msg,
type: 'success'
})
})
}
},
deleteRow(row) {
this.$confirm('确定要删除该数据吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deldictCommon({ sid: row.sid }).then(res => {
this.getPageList(this.page)
this.$message({
type: 'success',
message: '删除成功!'
})
})
})
},
handleMap(row) {
this.viewState = 2
this.$refs['divAdd'].showAdd(row)
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>

155
supervise-crm-ui/src/views/dataDict/dictMap.vue

@ -1,155 +0,0 @@
<template>
<div class="app-app-container">
<div class="tab-header webtop">
<!--标题-->
<div>{{ viewTitle }}</div>
<!--start 添加修改按钮-->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="save()">保存
</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
</div>
<div class="listconadd">
<el-form ref="form_obj" class="formadd" :model="formobj">
<div class="title">
<div>[{{ dictionariesKey }}+{{dictionariesValue}}]映射列表</div>
<el-button type="primary" size="mini" @click="Add">添加</el-button>
</div>
<el-table :key="tableKey" :data="formobj.listDtos" :index="index" border style="width: 100%">
<el-table-column fixed width="80px" label="序号" type="index" :index="index + 1" align="center"/>
<el-table-column fixed prop="name" label="操作" width="100px" align="center" header-align="center">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="dataDelete(scope.$index)">删除
</el-button>
</template>
</el-table-column>
<el-table-column label="映射来源" align="center">
<template slot-scope="scope">
<el-select v-model="scope.row.map_sourceValue" filterable placeholder="" @change="changeSource($event, scope.row)">
<el-option v-for="item in mappingsource_list" :key="item.dictKey" :label="item.dictValue" :value="item.dictValue"></el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="映射实体名称" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.map_object" placeholder="" clearable/>
</template>
</el-table-column>
<el-table-column label="映射项目类别" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.map_item" placeholder="" clearable/>
</template>
</el-table-column>
<el-table-column label="映射项目编码" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.map_itemKey" placeholder="" clearable/>
</template>
</el-table-column>
<el-table-column label="映射项目值" align="center">
<template slot-scope="scope">
<el-input v-model="scope.row.map_itemValue" placeholder="" clearable/>
</template>
</el-table-column>
</el-table>
</el-form>
</div>
</div>
</template>
<script>
// import { typeValues } from '@/api/system/roleAdminister/index'
// import { saveMappingList, selectMappingListInfo } from '@/api/system/dictType/index.js'
export default {
data() {
return{
viewTitle: '数据字典-映射管理',
tableKey: 0,
index: 0,
dictionariesKey: '',
dictionariesValue: '',
mappingsource_list: [],
formobj: {
userSid: '',
dictSid: '',
listDtos: []
},
submitdisabled: false
}
},
methods: {
showAdd(row) {
this.formobj.dictSid = row.sid
this.dictionariesKey = row.dictType
this.dictionariesValue = row.dictValue
this.formobj.userSid = window.sessionStorage.getItem('userSid')
typeValues({ type: 'sys_mappingsource' }).then((resp) => {
if (resp.success) {
this.mappingsource_list = resp.data
}
})
selectMappingListInfo({ dictSid: row.sid }).then((resp) => {
if (resp.success) {
this.formobj.listDtos = resp.data
}
})
},
Add() {
this.formobj.listDtos.push({
map_item: '',
map_itemKey: '',
map_itemValue: '',
map_object: '',
map_sourceKey: '',
map_sourceValue: '',
sid: ''
})
},
changeSource(value, row) {
let bb = null
this.mappingsource_list.forEach((e) => {
if (e.dictValue === value) {
bb = {
value: e.dictValue,
key: e.dictKey
}
}
})
row.map_sourceKey = bb.key
},
dataDelete(index) {
this.formobj.listDtos.splice(index, 1)
},
save() {
if (this.formobj.listDtos.length === 0) {
this.$message({ showClose: true, type: 'error', message: '映射列表不能为空' })
return
}
saveMappingList(this.formobj).then((res) => {
if (res.success) {
this.$message({ showClose: true, type: 'success', message: '保存成功' })
this.handleReturn()
}
})
},
handleReturn() {
this.formobj = {
userSid: '',
dictSid: '',
listDtos: []
}
this.$emit('doback')
}
}
}
</script>
<style scoped>
.title {
padding: 7px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
</style>

200
supervise-crm-ui/src/views/dataDict/index.vue

@ -1,200 +0,0 @@
<template>
<div class="container">
<div v-show="viewState == 1">
<div class="tab-header">
<el-form ref="form" :inline="true" :model="form" label-width="80px">
<el-row :gutter="20">
<el-col :span="6">
<el-form-item label="分类名称">
<el-input clearable v-model="page.params.dictTypeName"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="说明">
<el-input clearable v-model="page.params.remarks"></el-input>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item style="float: right;">
<el-button type="primary" @click="onSearch()">查询</el-button>
<el-button @click="add()">添加</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<el-table :data="tableData" border style="width: 100%;">
<el-table-column label="序号" width="50px" type="index" align="center">
</el-table-column>
<el-table-column label="操作" align="center" width="300px">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="guanli(scope.row)">
管理
</el-button>
<el-button type="primary" size="mini" @click="editRow(scope.row)">
修改
</el-button>
<el-button type="danger" size="mini" @click.native.prevent="deleteRow(scope.row)">
删除
</el-button>
</template>
</el-table-column>
<el-table-column prop="dictTypeCode" label="字典分类编码" align="center">
</el-table-column>
<el-table-column prop="dictTypeName" label="字典分类名称" align="center">
</el-table-column>
<el-table-column prop="remarks" label="说明" align="center">
</el-table-column>
</el-table>
<pagination :total="page.total" :page.sync="page.current" :limit.sync="page.size" @pagination="pagination"/>
<!-- 分类编辑 -->
<el-dialog :title="dialogTitle + '字典分类'" :visible.sync="editDialog" width="50%">
<el-form>
<table class="e-table" cellspacing="0">
<tr>
<td>数据字典code</td>
<td>
<el-input v-model="form.dictTypeCode"></el-input>
</td>
</tr>
<tr>
<td>数据分类名称</td>
<td>
<el-input v-model="form.dictTypeName"></el-input>
</td>
</tr>
<tr>
<td>说明</td>
<td>
<el-input type="textarea" v-model="form.remarks"></el-input>
</td>
</tr>
</table>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="save()"> </el-button>
<el-button @click="editDialog = false"> </el-button>
</div>
</el-dialog>
</div>
<dict-common @doback="resetState" :dictData='dictData' v-show="viewState == 2"/>
</div>
</template>
<script>
// import { pageList, saveDictType, putDictType, delDictType } from '@/api/system/dictType/index.js'
import dictCommon from './dictCommon.vue'
export default {
data() {
return {
editDialog: false,
dialogTitle: '',
form: {},
formBackup: Object.assign({}, this.form),
page: {
total: 0, //
current: 1, //
size: 10, //
params: {
dictTypeName: '',
dictTypeCode: ''
}
},
tableData: [],
viewState: 1,
dictData: {}
}
},
components: {
dictCommon
},
mounted() {
this.getPageList(this.page)
},
methods: {
pagination(val) { //
this.page.current = val.pageNum
this.page.size = val.pageSize
this.getPageList(this.page)
},
onSearch() { //
this.getPageList()
},
resetSearch() { //
this.page.current = 1
this.getPageList()
},
getPageList() { //
pageList(this.page).then((res) => {
if (res.success) {
this.tableData = res.data.records
this.page.total = res.data.total
} else {
this.tableData = []
this.page.total = 0
}
})
},
add() {
this.dialogTitle = '新增'
this.editDialog = true
this.form = Object.assign({}, this.formBackup)
},
editRow(row) {
this.dialogTitle = '编辑'
this.editDialog = true
this.form = Object.assign({}, row)
},
save() {
if (this.form.sid) {
putDictType(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
this.$message({
message: res.msg,
type: 'success'
})
})
} else {
saveDictType(this.form).then(res => {
this.editDialog = false
this.getPageList(this.page)
this.$message({
message: res.msg,
type: 'success'
})
})
}
},
deleteRow(row) {
this.$confirm('确定要删除该条数据吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delDictType({ sid: row.sid }).then(res => {
this.getPageList(this.page)
this.$message({
type: 'success',
message: '删除成功!'
})
})
})
},
guanli(row) {
this.dictData = { dictType: row.dictTypeCode }
this.viewState = 2
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped="scoped">
.my-tabs {
margin-top: 10px;
}
</style>

174
supervise-crm-ui/src/views/industry/industryAdd.vue

@ -0,0 +1,174 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>项目行业信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div>
<el-card class="box-card">
<div class="item">
<span class="item_text">项目行业名称</span>
<el-input v-model="formobj.industryName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">项目行业说明</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/dataDict/dataDict'
export default {
data() {
return {
submitdisabled: false,
formobj: {
sid: "",
industryName: "",
remarks: ""
}
}
},
methods: {
saveOrUpdate() {
console.log(">>>>>>>>>saveOrUpdate", this.formobj)
if (this.formobj.sid) {
req.updateindustry(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
} else {
req.saveindustry(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
}
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: "",
industryName: "",
remarks: ""
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.industryFetchBySid(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

228
supervise-crm-ui/src/views/industry/industryInfo.vue

@ -0,0 +1,228 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="项目行业维护" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="项目行业名称">
<el-input v-model="queryParams.params.industryName" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">项目行业列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="handleSelectionChange">
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="industryName" label="项目行业名称" align="center" />
<el-table-column prop="remarks" label="项目行业说明" align="center"/>
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/dataDict/dataDict'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './industryAdd'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
industryName: '',
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.industryListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
code: '',
name: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.industryDelBySids(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>

174
supervise-crm-ui/src/views/projectType/projectTypeAdd.vue

@ -0,0 +1,174 @@
<template>
<div>
<div class="tab-header webtop">
<!-- 标题 -->
<div>项目类型信息</div>
<!-- start 添加修改按钮 -->
<div>
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
</div>
<!-- end 添加修改按钮 -->
<!-- end 详情按钮 -->
</div>
<div>
<el-card class="box-card">
<div class="item">
<span class="item_text">项目类型名称</span>
<el-input v-model="formobj.typeName" placeholder="" class="item_input" clearable />
</div>
<div class="item">
<span class="item_text">项目类型说明</span>
<el-input v-model="formobj.remarks" placeholder="" class="item_input" clearable />
</div>
</el-card>
</div>
</div>
</template>
<script>
import req from '@/api/dataDict/dataDict'
export default {
data() {
return {
submitdisabled: false,
formobj: {
sid: "",
typeName: "",
remarks: ""
}
}
},
methods: {
saveOrUpdate() {
console.log(">>>>>>>>>saveOrUpdate", this.formobj)
if (this.formobj.sid) {
req.updateClass(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
} else {
req.saveClass(this.formobj)
.then(resp => {
if (resp.success) {
this.$message({
showClose: true,
type: 'success',
message: resp.msg
})
this.handleReturn("true")
} else {
// resp.code
}
})
.catch(() => {})
}
},
handleReturn(isreload) {
if (isreload === 'true') this.$emit('reloadlist')
this.formobj = {
sid: "",
typeName: "",
remarks: ""
}
this.$emit('doback')
},
showAdd() {
},
showEdit(row) {
req.classFetchBySid(row.sid)
.then(resp => {
if (resp.success) {
this.formobj = resp.data
}
})
.catch(e => {
this.formobj = row
})
}
}
}
</script>
<style lang="scss">
.box-card {
margin-left: 60px;
margin-right: 60px;
min-width: 70%;
margin-top: 20px;
.item {
display: flex;
flex-direction: row;
align-items: center;
margin-top: 15px;
height: 40px;
line-height: 40px;
.item_text {
flex: 0.8;
font-size: 18px;
text-align: right;
}
.item_input {
flex: 4;
font-size: 16px;
margin-left: 10px;
margin-right: 80px;
}
.item_left_input {
width: 20%;
}
.item_left_text {
height: 30px;
margin-left: 20px;
line-height: 30px;
color: #018AD2;
padding: 0px 15px;
border: 1.5px solid #018AD2;
border-radius: 5px;
}
.item_right {
flex: 1;
justify-items: center;
.item_right_list_text {
font-size: 16px;
}
.item_right_list_delect {
color: #5E94FF;
margin-left: 20px;
font-size: 16px;
text-decoration: underline;
}
}
}
}
</style>

225
supervise-crm-ui/src/views/projectType/projectTypeInfo.vue

@ -0,0 +1,225 @@
<template>
<div class="app-container">
<div v-show="viewState == 1">
<button-bar ref="btnbar" view-title="项目类型维护" :btndisabled="btndisabled" @btnhandle="btnHandle" />
<div class="main-content">
<div class="searchcon">
<el-button size="small" class="searchbtn" @click="clicksearchShow">
{{ searchxianshitit }}
</el-button>
<div v-show="isSearchShow" class="search">
<el-form :inline="true" class="tab-header">
<el-form-item label="项目类型名称">
<el-input v-model="queryParams.params.typeName" placeholder="" clearable />
</el-form-item>
</el-form>
<div class="btn" style="text-align: center;">
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button>
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</div>
</div>
</div>
<!-- Start 项目列表头部 -->
<div class="listtop">
<div class="tit">项目类型列表</div>
</div>
<!-- End 项目列表头部 -->
<!-- Start 项目列表 -->
<div class="">
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%"
@selection-change="handleSelectionChange">
<el-table-column fixed width="80" label="序号" type="index" :index="indexMethod" align="center" />
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
<el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button>
</template>
</el-table-column>
<el-table-column prop="typeName" label="项目类型名称" align="center" />
<el-table-column prop="remarks" label="项目类型说明" align="center" />
</el-table>
</div>
<!-- End 项目列表 -->
<div class="pages">
<div class="tit" />
<!-- 翻页 -->
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
</div>
</div>
</div>
<!-- End 查询和其列表部分 -->
<!-- 新增修改部分组件 -->
<divAdd v-show="viewState == 2 || viewState == 3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
</div>
</template>
<script>
import req from '@/api/dataDict/dataDict'
import ButtonBar from '@/components/ButtonBar'
import Pagination from '@/components/pagination'
import pageye from '@/components/pagination/pageye'
import divAdd from './projectTypeAdd'
export default {
name: 'SupplierBankInfoIndex',
components: {
ButtonBar,
Pagination,
pageye,
divAdd
},
data() {
return {
btndisabled: false,
viewState: 1, // 1 2 3 4
isSearchShow: false,
searchxianshitit: '显示查询条件',
tableLoading: false,
dataList: [],
btnList: [{
type: 'primary',
size: 'small',
icon: 'plus',
btnKey: 'toAdd',
btnLabel: '新增'
},
{
type: 'info',
size: 'small',
icon: 'cross',
btnKey: 'doClose',
btnLabel: '关闭'
}
],
queryParams: {
current: 1,
size: 10,
total: 0,
params: {
typeName: '',
}
},
sids: []
}
},
mounted() {
this.$refs['btnbar'].setButtonList(this.btnList)
},
created() {
this.loadList()
},
methods: {
//
clicksearchShow() {
this.isSearchShow = !this.isSearchShow
if (this.isSearchShow) {
this.searchxianshitit = '隐藏查询条件'
} else {
this.searchxianshitit = '显示查询条件'
}
},
btnHandle(btnKey) {
switch (btnKey) {
case 'toAdd':
this.toAdd()
break
case 'doClose':
this.doClose()
break
default:
break
}
},
loadList() {
this.tableLoading = true
req.classListPage(this.queryParams).then((resp) => {
this.tableLoading = false
if (resp.success) {
const data = resp.data
this.queryParams.total = data.total
this.dataList = data.records
} else {
// resp.code
this.dataList = []
this.queryParams.total = 0
}
}).catch(() => {
this.tableLoading = false
})
},
handleSelectionChange(row) {
const aa = []
row.forEach((element) => {
aa.push(element.sid)
})
this.sids = aa
},
//
indexMethod(index) {
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
var pageindex = index + 1 + pagestart
return pageindex
},
dosearch() {
this.queryParams.current = 1
this.loadList()
},
resetQuery() {
this.queryParams = {
current: 1,
size: 10,
total: 0,
params: {
typeName: '',
}
}
this.loadList()
},
toAdd() {
this.viewState = 2
this.$refs['divadd'].showAdd()
},
toRelevancy(row) {
this.viewState = 3
this.$refs['divadd'].showEdit(row)
},
toRelevancyInfo(row) {
const tip = '请确认是否删除所选记录?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
req.classDelBySids(row.sid).then((resp) => {
loading.close()
if (resp.success) {
this.$message({
type: 'success',
message: resp.msg,
showClose: true
})
this.loadList()
} else {
// resp.code
}
}).catch(e => {
loading.close()
})
}).catch(() => {})
},
resetState() {
this.viewState = 1
}
}
}
</script>
<style scoped>
</style>
Loading…
Cancel
Save