Browse Source

格式化代码与修改接口调用

feature/yujt_analysis_pc
yujt 5 years ago
parent
commit
6a9960f6ca
  1. 48
      src/views/modules/property/propertyproject-add-or-update.vue
  2. 16
      src/views/modules/property/propertyproject.vue

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

@ -53,13 +53,7 @@
propertyName: '', propertyName: '',
propertyTel: '', propertyTel: '',
propertyManager: '', propertyManager: '',
propertyAddress: '', propertyAddress: ''
revision: '',
delFlag: '',
parentDeptIds: '',
parentDeptNames: '',
allDeptIds: '',
allDeptNames: ''
}, },
options: [] options: []
} }
@ -81,24 +75,6 @@
], ],
propertyAddress: [ propertyAddress: [
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } { 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'}
],
parentDeptIds: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
parentDeptNames: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
allDeptIds: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
],
allDeptNames: [
{required: true, message: this.$t('validate.required'), trigger: 'blur'}
] ]
} }
} }
@ -106,8 +82,8 @@
methods: { methods: {
init () { init () {
// //
this.getByLoginUser(); this.getByLoginUser()
this.visible = true; this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
@ -117,20 +93,20 @@
}, },
getByLoginUser () { getByLoginUser () {
this.$http this.$http
.get(`/sys/user/deptOptions/getDeptAuthByUser`) .get(`/sys/user/deptOptions/getBusinessDeptByUser`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.loading = false; this.loading = false
this.options = res.data.options this.options = res.data.options
}) })
.catch(() => { .catch(() => {
this.loading = false; this.loading = false
}) })
}, },
handleChange (value) { handleChange (value) {
this.dataForm.gridId = value.slice(-1).shift(); this.dataForm.gridId = value.slice(-1).shift()
}, },
// //
getInfo () { getInfo () {
@ -141,16 +117,16 @@
this.dataForm = { this.dataForm = {
...this.dataForm, ...this.dataForm,
...res.data ...res.data
}; }
this.dataForm.allDeptIds = res.data.allDeptIds.split(",").slice(1); this.dataForm.allDeptIds = res.data.allDeptIds.split(',').slice(1)
this.loading = false; this.loading = false
}).catch(() => { }).catch(() => {
this.loading = false; this.loading = false
}) })
}, },
// //
dataFormSubmitHandle: debounce(function () { dataFormSubmitHandle: debounce(function () {
this.dataForm.allDeptNames = this.$refs['grid'].inputValue; this.dataForm.allDeptNames = this.$refs['grid'].inputValue
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (!valid) { if (!valid) {
return false return false

16
src/views/modules/property/propertyproject.vue

@ -85,7 +85,7 @@
dataForm: { dataForm: {
id: '', id: '',
gridId: '', gridId: '',
projectName: '', projectName: ''
}, },
options: [], options: [],
deleteId: '' deleteId: ''
@ -96,12 +96,12 @@
}, },
mounted () { mounted () {
// //
this.getByLoginUser(); this.getByLoginUser()
}, },
methods: { methods: {
getByLoginUser () { getByLoginUser () {
this.$http this.$http
.get(`/sys/user/deptOptions/getDeptAuthByUser`) .get(`/sys/user/deptOptions/getBusinessDeptByUser`)
.then(({ data: res }) => { .then(({ data: res }) => {
if (res.code !== 0) { if (res.code !== 0) {
return this.$message.error(res.msg) return this.$message.error(res.msg)
@ -112,18 +112,18 @@
}) })
}, },
handleChange (value) { handleChange (value) {
this.dataForm.gridId = value.slice(-1).shift(); this.dataForm.gridId = value.slice(-1).shift()
}, },
beforeDeleteHandle (id) { beforeDeleteHandle (id) {
this.$confirm("确定解散物业项目群?", this.$t('prompt.title'), { this.$confirm('删除物业项目将会解散物业项目群,是否继续操作?', this.$t('prompt.title'), {
confirmButtonText: this.$t('confirm'), confirmButtonText: this.$t('confirm'),
cancelButtonText: this.$t('cancel'), cancelButtonText: this.$t('cancel'),
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.deleteId = id; this.deleteId = id
this.deleteHandle(this.deleteId); this.deleteHandle(this.deleteId)
}) })
}, }
} }
} }
</script> </script>

Loading…
Cancel
Save