Browse Source

修改新闻列表页面;其他

feature/yujt_analysis_pc
yujt 5 years ago
parent
commit
6783802bb0
  1. 69
      src/views/modules/news/allnews.vue
  2. 2
      src/views/modules/police/group-detail.vue
  3. 176
      src/views/modules/police/police.vue
  4. 198
      src/views/modules/property/property-add-or-update.vue
  5. 264
      src/views/modules/property/propertyproject-add-or-update.vue

69
src/views/modules/news/allnews.vue

@ -5,7 +5,7 @@
<el-form :inline="true"
:model="dataForm"
@keyup.enter.native="getDataList()">
<el-form-item label="所属机构">
<el-form-item label="发布部门">
<el-cascader v-model="deptIdList"
:options="options"
:props="{ checkStrictly: true }"
@ -81,7 +81,7 @@
header-align="center"
align="center"></el-table-column>
<el-table-column prop="allDeptNames"
label="所属网格"
label="发布部门"
header-align="center"
align="center"></el-table-column>
<el-table-column prop="createdTime"
@ -144,10 +144,7 @@ export default {
deleteIsBatch: true
},
dataForm: {
id: '',
streetId: '',
communityId: '',
gridId: '',
deptId: '',
startTime: '',
endTime: '',
keyword: '',
@ -156,9 +153,6 @@ export default {
time: '',
options: [],
deptIdList: [],
streetList: [],
communityList: [],
gridList: [],
categorys: [],
onLine: {
id: '',
@ -176,7 +170,6 @@ export default {
this.options = res.data.options
})
.catch(() => { })
this.getDeptInfoList('street', localStorage.getItem('street') === null ? '1169154711480528897' : localStorage.getItem('street'))
this.getListCategory()
},
methods: {
@ -201,58 +194,6 @@ export default {
return '已下线'
}
},
//
getDeptInfoList (dataReceiver, faDeptId) {
this.$http.get(`/sys/dept/sublist/` + faDeptId).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (dataReceiver === 'street') {
this.streetList = res.data
} else if (dataReceiver === 'community') {
this.communityList = res.data
} else if (dataReceiver === 'grid') {
this.gridList = res.data
}
}).catch(() => { })
},
changeStreet (event) {
if (this.dataForm.streetId === '') {
this.communityList = []
this.gridList = []
this.dataForm.communityId = ''
this.dataForm.gridId = ''
return
}
this.dataForm.streetId = event
let choosenItem = this.streetList.filter(item => item.id === this.dataForm.streetId)[0]
this.initDeptIdAndName(choosenItem)
this.dataForm.communityId = this.dataForm.gridId = null
this.communityList = this.gridList = []
this.getDeptInfoList('community', event)
},
changeCommunity (event) {
if (this.dataForm.communityId === '') {
this.gridList = []
this.dataForm.gridId = ''
return
}
this.communityId = event
let choosenItem = this.communityList.filter(item => item.id === this.dataForm.communityId)[0]
this.initDeptIdAndName(choosenItem)
this.dataForm.gridId = null
this.gridList = []
this.getDeptInfoList('grid', event)
},
changeGrid (event) {
this.dataForm.gridId = event
let choosenItem = this.gridList.filter(item => item.id === this.gridId)[0]
this.initDeptIdAndName(choosenItem)
},
initDeptIdAndName (choosenItem) {
this.dataForm.dept = choosenItem.name
this.dataForm.deptId = choosenItem.id
},
setRegistTime () {
console.log(this.time[0])
this.dataForm.startTime = this.time[0]
@ -349,9 +290,9 @@ export default {
watch: {
'deptIdList': function (val) {
if (val.length !== 0) {
this.dataForm.gridId = val[val.length - 1]
this.dataForm.deptId = val[val.length - 1]
} else {
this.dataForm.gridId = ''
this.dataForm.deptId = ''
}
}
}

2
src/views/modules/police/group-detail.vue

@ -178,7 +178,7 @@ export default {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
if (res.data.resultCode == 1) {
if (res.data.resultCode === 1) {
this.$confirm(res.data.resultMessage, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',

176
src/views/modules/police/police.vue

@ -88,96 +88,96 @@
</template>
<script>
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './police-add-or-update'
import mixinViewModule from '@/mixins/view-module'
import AddOrUpdate from './police-add-or-update'
export default {
mixins: [mixinViewModule],
data() {
return {
mixinViewModuleOptions: {
getDataListURL: '/property/police/page',
getDataListIsPage: true,
deleteURL: '/property/police',
deleteIsBatch: true
},
dataForm: {
id: ''
},
options: [],
}
},
components: {
AddOrUpdate
},
mounted() {
//
this.getByLoginUser()
},
methods: {
getByLoginUser() {
this.$http
.get(`/sys/user/deptOptions/getMiddleByLoginUser`)
.then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {
})
},
handleChange(value) {
this.dataForm.deptId = value.slice(-1).shift()
},
beforeDeleteHandle(id) {
// this.$confirm('?', this.$t('prompt.title'), {
// confirmButtonText: this.$t('confirm'),
// cancelButtonText: this.$t('cancel'),
// type: 'warning'
// }).then(() => {
this.deleteHandle(id);
// })
},
supplementHandle(data) {
if (!data && this.dataListSelections.length <= 0) {
return this.$message({
message: '请选择需要补建的社区',
type: 'warning',
duration: 500
})
}
if (!data && this.dataListSelections.length > 1) {
return this.$message({
message: '只能选择一条数据',
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', {'handle': '补建群'}), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.put('/property/police/supplement', data ? data : this.dataListSelections[0]).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
})
}).catch(() => {
})
}).catch(() => {
})
export default {
mixins: [mixinViewModule],
data () {
return {
mixinViewModuleOptions: {
getDataListURL: '/property/police/page',
getDataListIsPage: true,
deleteURL: '/property/police',
deleteIsBatch: true
},
dataForm: {
id: ''
},
options: []
}
},
components: {
AddOrUpdate
},
mounted () {
//
this.getByLoginUser()
},
methods: {
getByLoginUser () {
this.$http
.get(`/sys/user/deptOptions/getMiddleByLoginUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.options = res.data.options
})
.catch(() => {
})
},
handleChange (value) {
this.dataForm.deptId = value.slice(-1).shift()
},
beforeDeleteHandle (id) {
// this.$confirm('?', this.$t('prompt.title'), {
// confirmButtonText: this.$t('confirm'),
// cancelButtonText: this.$t('cancel'),
// type: 'warning'
// }).then(() => {
this.deleteHandle(id)
// })
},
supplementHandle (data) {
if (!data && this.dataListSelections.length <= 0) {
return this.$message({
message: '请选择需要补建的社区',
type: 'warning',
duration: 500
})
}
if (!data && this.dataListSelections.length > 1) {
return this.$message({
message: '只能选择一条数据',
type: 'warning',
duration: 500
})
}
this.$confirm(this.$t('prompt.info', { 'handle': '补建群' }), this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'),
type: 'warning'
}).then(() => {
this.$http.put('/property/police/supplement', data || this.dataListSelections[0]).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.getDataList()
}
}
})
}).catch(() => {
})
}).catch(() => {
})
}
}
}
</script>
<style scoped>
@ -185,4 +185,4 @@
width: 200px !important;
height: 200px !important;;
}
</style>
</style>

198
src/views/modules/property/property-add-or-update.vue

@ -24,105 +24,105 @@
</template>
<script>
import debounce from 'lodash/debounce'
import debounce from 'lodash/debounce'
export default {
data() {
return {
visible: false,
dataForm: {
id: '',
propertyName: '',
propertyCode: '',
effectiveFlag: '1',
revision: '',
delFlag: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: ''
}
}
},
computed: {
dataRule() {
return {
propertyName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyCode: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
effectiveFlag: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
revision: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
delFlag: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
createdBy: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
createdTime: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
updatedBy: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
updatedTime: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
]
}
}
},
methods: {
init() {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo() {
this.$http.get(`/property/property/${this.dataForm.id}`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/property/', this.dataForm).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, {'leading': true, 'trailing': false})
}
export default {
data () {
return {
visible: false,
dataForm: {
id: '',
propertyName: '',
propertyCode: '',
effectiveFlag: '1',
revision: '',
delFlag: '',
createdBy: '',
createdTime: '',
updatedBy: '',
updatedTime: ''
}
}
},
computed: {
dataRule () {
return {
propertyName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyCode: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
effectiveFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
revision: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
delFlag: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
createdTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedBy: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
updatedTime: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/property/property/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {
})
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/property/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

264
src/views/modules/property/propertyproject-add-or-update.vue

@ -45,138 +45,138 @@
</template>
<script>
import debounce from 'lodash/debounce'
import debounce from 'lodash/debounce'
export default {
data() {
return {
visible: false,
loading: true,
dataForm: {
id: '',
gridId: '',
grid: '',
projectName: '',
propertyId: '',
propertyName: '',
propertyTel: '',
propertyManager: '',
propertyAddress: ''
},
options: [],
propertyList: []
}
},
computed: {
dataRule() {
return {
projectName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyName: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyTel: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyManager: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
propertyAddress: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
]
}
}
},
methods: {
init() {
//
this.getByLoginUser();
this.getPropertyList();
this.visible = true;
this.$nextTick(() => {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getPropertyList() {
this.$http.get(`/property/property/dict`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.propertyList = res.data
}).catch(() => {
})
},
//
getByLoginUser() {
this.$http
.get(`/sys/user/deptOptions/getBusinessDeptByUser`)
.then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.loading = false
this.options = res.data.options
})
.catch(() => {
this.loading = false
})
},
deptHandleChange(value) {
this.dataForm.gridId = value.slice(-1).shift();
},
propertyHandleChange(value) {
console.log(value)
let obj = this.propertyList.find((item) => {
return item.dictValue === value;
});
console.log(obj.dictName)
this.dataForm.propertyName = obj.dictName;
},
//
getInfo() {
this.$http.get(`/property/project/${this.dataForm.id}`).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.dataForm.allDeptIds = res.data.allDeptIds.split(',').slice(1)
this.loading = false
}).catch(() => {
this.loading = false
})
},
//
dataFormSubmitHandle: debounce(function () {
this.dataForm.allDeptNames = this.$refs['grid'].inputValue;
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/project/', this.dataForm).then(({data: res}) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, {'leading': true, 'trailing': false})
}
export default {
data () {
return {
visible: false,
loading: true,
dataForm: {
id: '',
gridId: '',
grid: '',
projectName: '',
propertyId: '',
propertyName: '',
propertyTel: '',
propertyManager: '',
propertyAddress: ''
},
options: [],
propertyList: []
}
},
computed: {
dataRule () {
return {
projectName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyName: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyTel: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyManager: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
],
propertyAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' }
]
}
}
},
methods: {
init () {
//
this.getByLoginUser()
this.getPropertyList()
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getPropertyList () {
this.$http.get(`/property/property/dict`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.propertyList = res.data
}).catch(() => {
})
},
//
getByLoginUser () {
this.$http
.get(`/sys/user/deptOptions/getBusinessDeptByUser`)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.loading = false
this.options = res.data.options
})
.catch(() => {
this.loading = false
})
},
deptHandleChange (value) {
this.dataForm.gridId = value.slice(-1).shift()
},
propertyHandleChange (value) {
console.log(value)
let obj = this.propertyList.find((item) => {
return item.dictValue === value
})
console.log(obj.dictName)
this.dataForm.propertyName = obj.dictName
},
//
getInfo () {
this.$http.get(`/property/project/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
this.dataForm.allDeptIds = res.data.allDeptIds.split(',').slice(1)
this.loading = false
}).catch(() => {
this.loading = false
})
},
//
dataFormSubmitHandle: debounce(function () {
this.dataForm.allDeptNames = this.$refs['grid'].inputValue
this.$refs['dataForm'].validate((valid) => {
if (!valid) {
return false
}
this.$http[!this.dataForm.id ? 'post' : 'put']('/property/project/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.$message({
message: this.$t('prompt.success'),
type: 'success',
duration: 500,
onClose: () => {
this.visible = false
this.$emit('refreshDataList')
}
})
}).catch(() => {
})
})
}, 1000, { 'leading': true, 'trailing': false })
}
}
</script>

Loading…
Cancel
Save