作者 shenhailong

公寓 查询

... ... @@ -41,7 +41,7 @@
<!--<el-button type="primary" size="small" @click="handleUpdate(scope.row)">快速编辑</el-button>-->
<el-button v-if="scope.row.type=='3'" disabled type="primary" size="small" @click="handleAdd(scope.row)">新增</el-button>
<el-button v-else type="primary" size="small" @click="handleAdd(scope.row)">新增</el-button>
<el-button size="mini" type="primary" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button size="mini" type="danger" @click="handleDel(scope.row)">删除</el-button>
<!--<el-button v-if="scope.row.type=='3'" type="primary" size="small" @click="pay(scope.row)">缴费</el-button>-->
... ... @@ -265,6 +265,22 @@
</div>
</el-dialog>
<!--location编辑界面-->
<el-dialog title="编辑" :visible.sync="editFormLocationVisible" :close-on-click-modal="false">
<el-form :model="editLocationForm" label-width="80px" :rules="editLocationFormRules" ref="editLocationForm">
<el-input type="hidden" v-model="editLocationForm.id"></el-input>
<el-form-item label="公寓名称" prop="adrName">
<el-input v-model="editLocationForm.adrname" auto-complete="off" placeholder="请输入名称"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click.native="editFormLocationVisible = false">取消</el-button>
<el-button type="primary" @click.native="editLocationAdrName" :loading="addLoading">提交</el-button>
</div>
</el-dialog>
</section>
</template>
<style>
... ... @@ -281,14 +297,16 @@
}
</style>
<script>
import { getList,add, remove} from '@/api/empt/location_api';
import { getList,add, remove, edit as editLocation} from '@/api/empt/location_api';
import {add as electicity, getEEModel, edit} from '@/api/empt/electricityParams';
import {findRealTime } from '@/api/empt/waterMeter';
import moment from 'moment'
import parseTime from '@/utils'
import loginUserInfo from '@/api/base'
import ElInput from "../../../node_modules/element-ui/packages/input/src/input.vue";
export default {
components: {ElInput},
data() {
return {
filters: {
... ... @@ -309,12 +327,21 @@
waterMeterVisible:false,
addFormLocationVisible: false,
editFormLocationVisible: false,
addLocationFormRules:{
adrName: [
{required: true, message: '请输入公寓名称', trigger: 'blur'}
]
},
editLocationFormRules:{
adrName: [
{required: false, message: '请输入公寓名称', trigger: 'blur'}
]
},
editLoading: false,
editFormRules: {
roleName: [
... ... @@ -395,6 +422,12 @@
parent: '',
type:''
},
// 公寓编辑
editLocationForm:{
adrname: '',
parent: '',
type:''
},
centerDialogVisible: false,
dialogData:{
process:{
... ... @@ -496,7 +529,7 @@
let para = {
pageNum: this.pageNum,
pageSize: this.pageSize,
processName: this.processName
processName: this.filters.processName
};
this.listLoading = true;
//NProgress.start();
... ... @@ -616,7 +649,48 @@
});
},
// 楼层新增
// 楼层编辑
/**
* 显示编辑界面
* @param index
* @param row 为这行的数据对象
*/
handleEdit: function (index, row) {
this.editFormLocationVisible = true;
this.editLocationForm = row;
},
//编辑
editLocationAdrName: function () {
this.$refs.editLocationForm.validate((valid) => {
if (valid) {
this.$confirm('确认提交吗?', '提示', {}).then(() => {
this.addLoading = true;
let para = Object.assign({}, this.editLocationForm);
this.addLoading = false;
editLocation(para).then((res) => {
if(res.data.code == 200){
//NProgress.done();
this.$message({
message: '提交成功',
type: 'success'
});
this.$refs['editLocationForm'].resetFields();
this.editFormLocationVisible = false;
this.getList();
}else {
this.$message({
message: '编辑失败',
type: 'error'
});
}
}).catch(error => alert(error));
});
}
});
},
//电表参数配置新增界面,每次点开初始化数据
electrixityMeterConfiguration: function (row) {
... ...