|
@@ -0,0 +1,324 @@
|
|
|
+<template>
|
|
|
+ <div class="mis-pageBox">
|
|
|
+ <!-- 主页 -->
|
|
|
+ <el-container>
|
|
|
+ <el-header height="40px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="20">
|
|
|
+ <div style="display:flex;align-items:center;">
|
|
|
+ <!--区域联动组件:公司、片区、抄表册-->
|
|
|
+ <cpsLinkageArea :queryParams="queryParams" widthValue="150px"></cpsLinkageArea>
|
|
|
+ 关 键 字: <el-input v-model="queryParams.searchText" size="small" style="width:150px;"
|
|
|
+ placeholder="输入关键字" clearable @keyup.enter.native="clickQuery()" />
|
|
|
+ <el-button type="primary" size="small" icon="el-icon-search"
|
|
|
+ @click="clickQuery()">查询</el-button>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="4" class="list-opCol">
|
|
|
+ <el-button type="warning" size="small" icon="el-icon-edit" @click="clickModify()"
|
|
|
+ :disabled="disabledModify">恢复用水</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-header>
|
|
|
+ <el-main>
|
|
|
+ <tfTable :table-data="dataList" :column="columns" :for-id="true" :pagination="true"
|
|
|
+ :currentpage="pageInfo.current" :pagesize="pageInfo.size" :total="pageInfo.tableTotal" :border="true"
|
|
|
+ :multiple="false" :fixed="true" :isdelete="false" :is-select="false" :stripe="true"
|
|
|
+ @handleCurrentChange="handleCurrentChange" @handleSizeChange="handleSizeChange"
|
|
|
+ @rowClick="handleRowClick" @sortChange="onCustomerSortChange" />
|
|
|
+ </el-main>
|
|
|
+ </el-container>
|
|
|
+ <!-- 详情页 -->
|
|
|
+ <el-dialog v-if="dialogVisible" v-dialogDrag top="15vh" :title="dialogTitle" :visible.sync="dialogVisible"
|
|
|
+ width="800px" class="dialog">
|
|
|
+ <tfDetail :detailData="detailData" :editState="editState" ref="dForm" />
|
|
|
+ <template slot="footer">
|
|
|
+ <el-button type="primary" icon="el-icon-check" @click="clickSave()" v-if="!editState">确 定</el-button>
|
|
|
+ <el-button icon="el-icon-close" @click="clickCancel()">关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import '@/views/mis/common/assets/styles/misStyle.scss'
|
|
|
+import { DateHelper } from '@/views/mis/common/assets/scripts/utils.js'
|
|
|
+import { Customer, CustomerHfys } from '@/views/mis/common/api/customerManagement.js'
|
|
|
+import tfTable from '@/components/TableAuto/index.vue'
|
|
|
+import cpsLinkageArea from '@/views/mis/common/components/cps-linkageArea.vue';
|
|
|
+import tfDetail from './customerHfys-form.vue'
|
|
|
+export default {
|
|
|
+ components: { cpsLinkageArea, tfTable, tfDetail },
|
|
|
+ props: ['data'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ /* ----- 主页 ----- */
|
|
|
+ queryParams: {
|
|
|
+ companyBranch: undefined,//公司
|
|
|
+ mrArea: undefined,//片区
|
|
|
+ mrBook: undefined,//抄表本
|
|
|
+ searchText: undefined,//模糊查询
|
|
|
+
|
|
|
+ customerState: '2'//用户状态
|
|
|
+ },
|
|
|
+ disabledModify: true,
|
|
|
+ /**
|
|
|
+ * 操作类型(0:查询,1:添加,2:修改,3:删除,4:查看详情)
|
|
|
+ */
|
|
|
+ opType: 0,
|
|
|
+ pageInfo: { current: 1, size: 20, tableTotal: 1, 'orders[0].asc': 'true', 'orders[0].column': 'customerNo' }, // 分页数据
|
|
|
+ columns: [
|
|
|
+ {
|
|
|
+ label: '所属片区',
|
|
|
+ prop: 'mrAreaName',
|
|
|
+ align: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '所属表册',
|
|
|
+ prop: 'mrBookName',
|
|
|
+ align: 'left'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '用户编号',
|
|
|
+ prop: 'customerNo',
|
|
|
+ align: 'center',
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '用户姓名',
|
|
|
+ prop: 'customerName',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '用户地址',
|
|
|
+ prop: 'customerAddress',
|
|
|
+ align: 'left',
|
|
|
+ sortable: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '联系电话',
|
|
|
+ prop: 'customerPhone',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '申请日期',
|
|
|
+ prop: 'applyDatetime',
|
|
|
+ align: 'center',
|
|
|
+ sortable: true,
|
|
|
+ formatter: function (row, column, value, index) {
|
|
|
+ return DateHelper.formatterDate(value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '建档日期',
|
|
|
+ prop: 'createdDatetime',
|
|
|
+ align: 'center',
|
|
|
+ sortable: true,
|
|
|
+ formatter: function (row, column, value, index) {
|
|
|
+ return DateHelper.formatterDate(value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '建档人员',
|
|
|
+ prop: 'createdOname',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '用户状态',
|
|
|
+ prop: 'customerState',
|
|
|
+ align: 'center',
|
|
|
+ formatter: function (row, column, value, index) {
|
|
|
+ if (value == '作废用户') {
|
|
|
+ // return Object.assign({}, { 'background-color': '#CDCDCD', 'text-decoration': 'line-through' }, definedParams)
|
|
|
+ return '<div><span class="el-tag el-tag--danger el-tag--light">' + value + '</span></div>'
|
|
|
+ }
|
|
|
+ return value;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ dataList: [], // 表格数据
|
|
|
+ selectedRow: null, //表格选中行
|
|
|
+
|
|
|
+ /* ----- 详情页 ----- */
|
|
|
+ dialogTitle: '添加',
|
|
|
+ editState: false,//编辑状态,true:禁用;false:启用
|
|
|
+ dialogVisible: false,
|
|
|
+ detailData: {
|
|
|
+ //id: undefined,//编号
|
|
|
+ companyBranch: undefined,//所属公司
|
|
|
+ mrArea: undefined,//所属抄表片区
|
|
|
+ mrBook: undefined,//所属抄表本
|
|
|
+ customerNo: undefined,//用户编号
|
|
|
+ customerAddr: undefined,//用户地址
|
|
|
+ customerName: undefined,//用户姓名
|
|
|
+ customerPhone: undefined,
|
|
|
+ applyName: undefined,//申请人姓名
|
|
|
+ phone: undefined,//申请人电话
|
|
|
+ applyDate: undefined,//申请时间
|
|
|
+ remark: undefined,//备注说明
|
|
|
+ yzqf: undefined,//验证欠费(1:验证;0:不验证)
|
|
|
+ operatorOcode: undefined,//操作人员编码
|
|
|
+ operatorOname: undefined,//操作人员姓名
|
|
|
+ operatorDate: undefined//操作时间
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ selectedRow(value) {
|
|
|
+ this.disabledModify = this.selectedRow == null;
|
|
|
+ },
|
|
|
+ dialogVisible(newVal, oldVal) {
|
|
|
+ if (!newVal) {
|
|
|
+ this.resetDetailData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.bindList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /* ----- 方法 ----- */
|
|
|
+ /**
|
|
|
+ * @description 绑定列表
|
|
|
+ */
|
|
|
+ bindList() {
|
|
|
+ // 追加分页参数
|
|
|
+ let params = Object.assign({}, this.pageInfo, this.queryParams);
|
|
|
+
|
|
|
+ this.dataList = []
|
|
|
+ this.selectedRow = null
|
|
|
+ Customer.query(params).then((res) => {
|
|
|
+ if (res.code !== 1) {
|
|
|
+ this.$message.error('查询失败!')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 数据总数
|
|
|
+ this.pageInfo.tableTotal = res.result.total
|
|
|
+ this.dataList = res.result.records
|
|
|
+ }).catch((ex) => {
|
|
|
+ this.$message.error("查询失败!");
|
|
|
+ }).finally(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ resetDetailData() {
|
|
|
+ // 表单数据
|
|
|
+ for (var key in this.detailData) {
|
|
|
+ //console.log("key值:" + key)
|
|
|
+ this.detailData[key] = undefined
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 保存方法
|
|
|
+ */
|
|
|
+ save() {
|
|
|
+ let params = Object.assign({}, this.detailData);
|
|
|
+ params.customerNo = this.selectedRow.customerNo;
|
|
|
+ params.companyBranch = this.selectedRow.companyBranch;
|
|
|
+ params.mrArea = this.selectedRow.mrArea;
|
|
|
+ params.mrBook = this.selectedRow.mrBook;
|
|
|
+
|
|
|
+ params.operatorOcode = this.$store.state.user.username;
|
|
|
+ params.operatorOname = this.$store.state.user.realName;
|
|
|
+ params.operatorDate = DateHelper.getNowFormatDate(true);
|
|
|
+
|
|
|
+ //console.log(JSON.stringify(params));
|
|
|
+ CustomerHfys.save(params, { yzqf: this.detailData.yzqf }).then(res => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ this.bindList();
|
|
|
+ this.$message.success("恢复用水成功!");
|
|
|
+ this.dialogVisible = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res);
|
|
|
+ }
|
|
|
+ }).catch((ex) => {
|
|
|
+ this.$message.error("恢复用水失败!");
|
|
|
+ }).finally(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ /* ----- dom事件 ----- */
|
|
|
+ /**
|
|
|
+ * @description 查询
|
|
|
+ */
|
|
|
+ clickQuery() {
|
|
|
+ this.pageInfo.current = 1
|
|
|
+ this.bindList()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @description 恢复用水
|
|
|
+ */
|
|
|
+ clickModify() {
|
|
|
+ if (this.selectedRow != null) {
|
|
|
+ if (this.selectedRow.customerState == '作废用户' || this.selectedRow.customerState == '销户用户') {
|
|
|
+ this.$message({
|
|
|
+ message: '作废用户、销户用户不能操作恢复用水!',
|
|
|
+ type: 'warning'
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ this.detailData.customerNo = this.selectedRow.customerNo
|
|
|
+ this.detailData.customerName = this.selectedRow.customerName
|
|
|
+ this.detailData.customerPhone = this.selectedRow.customerPhone
|
|
|
+ this.detailData.customerAddr = this.selectedRow.customerAddress
|
|
|
+ this.detailData.applyDate = DateHelper.getNowDateZeroTime();
|
|
|
+ this.detailData.yzqf = '1';
|
|
|
+ this.detailData.operatorOname = this.$store.state.user.realName
|
|
|
+ this.detailData.operatorDate = DateHelper.getNowFormatDate(true);
|
|
|
+
|
|
|
+ this.opType = 1;
|
|
|
+ this.dialogTitle = "恢复用水";
|
|
|
+ this.editState = false;
|
|
|
+ this.dialogVisible = true;// 显示弹窗
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 点击关闭(取消)
|
|
|
+ */
|
|
|
+ clickCancel() {
|
|
|
+ this.dialogVisible = false // 关闭弹窗
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 点击确定(保存)
|
|
|
+ */
|
|
|
+ clickSave() {
|
|
|
+ let flag = this.$refs.dForm.validate();
|
|
|
+ if (flag) {
|
|
|
+ if (this.opType === 1) this.save();// 添加
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ /* ----- 组件事件 ----- */
|
|
|
+ /**
|
|
|
+ * @description 改变当前页
|
|
|
+ */
|
|
|
+ handleCurrentChange(current) {
|
|
|
+ this.pageInfo.current = current
|
|
|
+ this.bindList()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @description 分页每页条数
|
|
|
+ */
|
|
|
+ handleSizeChange(size) {
|
|
|
+ this.pageInfo.size = size
|
|
|
+ this.bindList()
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * @description 选择改变
|
|
|
+ */
|
|
|
+ handleRowClick(row) {
|
|
|
+ this.selectedRow = row
|
|
|
+ },
|
|
|
+ //排序事件
|
|
|
+ onCustomerSortChange(arrOrder) {
|
|
|
+ this.pageInfo['orders[0].asc'] = arrOrder[0];
|
|
|
+ this.pageInfo['orders[0].column'] = arrOrder[1];
|
|
|
+ this.bindList();
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|