|
@@ -1,255 +1,504 @@
|
|
|
<script setup>
|
|
|
+import { ElMessage } from 'element-plus';
|
|
|
+import { Search } from '@element-plus/icons-vue'
|
|
|
+import { adressApi } from '@/api/voice/adress';
|
|
|
+import { servicesApi } from '@/api/voice/services';
|
|
|
import SearchItemWrapper from '@/components/SearchItemWrapper';
|
|
|
|
|
|
+const loading = ref(false);
|
|
|
+const activeName = ref('first');
|
|
|
+const adressValue = ref([]);
|
|
|
const total = ref(0);
|
|
|
-const value1 = ref('');
|
|
|
-const dialogVisible = ref(true);
|
|
|
+const tableData = ref([]);
|
|
|
+// 新增小区弹窗
|
|
|
+const housingFormRef = ref(null);
|
|
|
+const housingDialogVisible = ref(false);
|
|
|
+// 新智泵站弹窗
|
|
|
+const pumpFormRef = ref(null);
|
|
|
+const pumpDialogVisible = ref(false);
|
|
|
+// 关联小区
|
|
|
+const relationVisible = ref(false);
|
|
|
+const dialogDataSource = ref([]);
|
|
|
+const housingActiveIndex = ref(0);
|
|
|
+const stationVisible = ref(false);
|
|
|
+const checkList = ref([]);
|
|
|
+const stationList = ref([]);
|
|
|
+
|
|
|
+const housingFormData = ref({
|
|
|
+ name: '',
|
|
|
+ selectOptions: [],
|
|
|
+ address: '',
|
|
|
+ buildingNum: '',
|
|
|
+ buildingNameList: []
|
|
|
+});
|
|
|
+
|
|
|
+const pumpFormData = ref({
|
|
|
+ name: '',
|
|
|
+ selectOptions: []
|
|
|
+});
|
|
|
+
|
|
|
const queryParams = ref({
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 10,
|
|
|
+ neighbourhoodName: '', // 小区名称
|
|
|
+ status: '' // 停水状态
|
|
|
+})
|
|
|
+
|
|
|
+const housingRules = reactive({
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请输入小区名称', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ selectOptions: [
|
|
|
+ { required: true, message: '请选择地区', trigger: 'change', type: 'array' },
|
|
|
+ ],
|
|
|
+ address: [
|
|
|
+ { required: true, message: '请输入详细地址', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ buildingNameList: [
|
|
|
+ { required: true, validator: (rule, value, callback) => {
|
|
|
+ if (!housingFormData.value.buildingNameList.length) {
|
|
|
+ return callback(new Error('请添加楼号'))
|
|
|
+ }
|
|
|
+ callback()
|
|
|
+ }}
|
|
|
+ ]
|
|
|
+});
|
|
|
+
|
|
|
+const floorList = computed(() => {
|
|
|
+ return dialogDataSource.value[housingActiveIndex.value]?.neighbourhoodNumberAndAddFlags;
|
|
|
})
|
|
|
-const options = [
|
|
|
- {
|
|
|
- value: 'Option1',
|
|
|
- label: 'Option1',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option2',
|
|
|
- label: 'Option2',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option3',
|
|
|
- label: 'Option3',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option4',
|
|
|
- label: 'Option4',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 'Option5',
|
|
|
- label: 'Option5',
|
|
|
- },
|
|
|
-]
|
|
|
-
|
|
|
-const tableData = [
|
|
|
- {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- }, {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
-]
|
|
|
+
|
|
|
+// 关联数据
|
|
|
+const contactCheckData = computed(() => {
|
|
|
+ console.log("dialogDataSource.value", dialogDataSource.value);
|
|
|
+ const result = dialogDataSource.value.map(({ name, checkList }) => {
|
|
|
+ const tempObj = { name, floorList: '' };
|
|
|
+ tempObj.floorList = checkList.map(item => item.buildingsNames).join('、');
|
|
|
+ return tempObj;
|
|
|
+ }).filter(item => item.floorList);
|
|
|
+ return result;
|
|
|
+})
|
|
|
+
|
|
|
+const props = {
|
|
|
+ lazy: true,
|
|
|
+ lazyLoad: async (node, resolve) => {
|
|
|
+ let nodes = null;
|
|
|
+ const { level } = node;
|
|
|
+ switch( level ) {
|
|
|
+ case 0 :
|
|
|
+ nodes = await getCityTree({ type: 1 }, level);
|
|
|
+ break;
|
|
|
+ case 1 :
|
|
|
+ nodes = await getCityTree({ type: 2, pid: node.value }, level);
|
|
|
+ break;
|
|
|
+ case 2 :
|
|
|
+ nodes = await getCityTree({ type: 3, pid: node.value}, level)
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ resolve( nodes );
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+async function getCityTree (params, level) {
|
|
|
+ const { data } = await adressApi.getAdressData(params);
|
|
|
+ const nodes = data.map(item => ({
|
|
|
+ value: item.id,
|
|
|
+ label: item.name,
|
|
|
+ leaf: level >= 2,
|
|
|
+ }))
|
|
|
+ return nodes;
|
|
|
+}
|
|
|
+
|
|
|
+// 当tabs切换
|
|
|
+const handleTabClick = (val) => {
|
|
|
+ queryParams.value = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ name: '', // 小区名称
|
|
|
+ };
|
|
|
+ adressValue.value = [];
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+// 添加楼层 - 确定
|
|
|
+const handleAddName = () => {
|
|
|
+ const buildingNum = housingFormData.value.buildingNum;
|
|
|
+ if ( buildingNum === '' ) {
|
|
|
+ return ElMessage.warning('请填写内容后,进行添加')
|
|
|
+ }
|
|
|
+ if (housingFormData.value.buildingNameList.includes(buildingNum)) {
|
|
|
+ return ElMessage.warning('该楼层号,已添加')
|
|
|
+ }
|
|
|
+ housingFormData.value.buildingNameList.push(buildingNum);
|
|
|
+ housingFormData.value.buildingNum = '';
|
|
|
+}
|
|
|
+
|
|
|
+// 删除标签
|
|
|
+const handleCloseTag = ( index ) => {
|
|
|
+ housingFormData.value.buildingNameList.splice(index, 1);
|
|
|
+}
|
|
|
+
|
|
|
+// 清除检索条件
|
|
|
+const handleCleanOptions = () => {
|
|
|
+ queryParams.value = {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ name: '',
|
|
|
+ };
|
|
|
+ adressValue.value = [];
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+const resetHousingData = () => {
|
|
|
+
|
|
|
+ housingDialogVisible.value = false;
|
|
|
+ pumpDialogVisible.value = false;
|
|
|
+
|
|
|
+ housingFormData.value = {
|
|
|
+ name: '',
|
|
|
+ selectOptions: [],
|
|
|
+ address: '',
|
|
|
+ buildingNum: '',
|
|
|
+ buildingNameList: []
|
|
|
+ }
|
|
|
+
|
|
|
+ pumpFormData.value = {
|
|
|
+ name: '',
|
|
|
+ selectOptions: []
|
|
|
+ }
|
|
|
+
|
|
|
+ housingFormRef.value?.resetFields();
|
|
|
+ pumpFormRef.value?.resetFields();
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const resetPumpData = () => {
|
|
|
+
|
|
|
+ pumpDialogVisible.value = false;
|
|
|
+
|
|
|
+ pumpFormData.value = {
|
|
|
+ name: '',
|
|
|
+ selectOptions: []
|
|
|
+ }
|
|
|
+
|
|
|
+ pumpFormRef.value?.resetFields();
|
|
|
+}
|
|
|
+
|
|
|
+// 编辑数据
|
|
|
+const handleEditData = ({ id, name, buildingsNames, address, provinceId, cityId, countryId }) => {
|
|
|
+ if ( activeName.value === 'first' ) {
|
|
|
+ housingFormData.value = {
|
|
|
+ id,
|
|
|
+ name,
|
|
|
+ selectOptions: [provinceId, cityId, countryId],
|
|
|
+ address,
|
|
|
+ buildingNameList: buildingsNames.split('、')
|
|
|
+ }
|
|
|
+ housingDialogVisible.value = true;
|
|
|
+ } else {
|
|
|
+ pumpFormData.value = {
|
|
|
+ id,
|
|
|
+ name,
|
|
|
+ selectOptions: [provinceId, cityId, countryId],
|
|
|
+ }
|
|
|
+ pumpDialogVisible.value = true;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 删除数据
|
|
|
+const onConfirm = async ({ id }) => {
|
|
|
+ if ( activeName.value === 'first' ) {
|
|
|
+ await servicesApi.delNeighborhood(id);
|
|
|
+ } else {
|
|
|
+ await servicesApi.delStation(id);
|
|
|
+ }
|
|
|
+ ElMessage.success('删除成功');
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
+// 小区弹窗 - 确定
|
|
|
+const onHousingDialogConfirm = () => {
|
|
|
+ if (!housingFormRef.value) return;
|
|
|
+ housingFormRef.value.validate(async (valid, fields) => {
|
|
|
+ if (valid) {
|
|
|
+ const { id, name, selectOptions, address, buildingNameList } = housingFormData.value;
|
|
|
+ const [provinceId, cityId, countryId] = selectOptions;
|
|
|
+ if ( id ) {
|
|
|
+ await servicesApi.putNeighborhood({ id, name, address, buildingNameList, provinceId, cityId, countryId })
|
|
|
+ ElMessage.success('小区修改成功')
|
|
|
+ } else {
|
|
|
+ await servicesApi.postNeighborhood({ name, address, buildingNameList, provinceId, cityId, countryId })
|
|
|
+ ElMessage.success('小区新增成功')
|
|
|
+ }
|
|
|
+ resetHousingData();
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 泵站弹窗 - 确定
|
|
|
+const onPumpDialogConfirm = () => {
|
|
|
+ if (!pumpFormRef.value) return;
|
|
|
+ pumpFormRef.value.validate(async (valid, fields) => {
|
|
|
+ if (valid) {
|
|
|
+ const { id, name, selectOptions } = pumpFormData.value;
|
|
|
+ const [provinceId, cityId, countryId] = selectOptions;
|
|
|
+
|
|
|
+ if ( id ) {
|
|
|
+ await servicesApi.putStation({ name, provinceId, cityId, countryId, id })
|
|
|
+ ElMessage.success('泵站修改成功')
|
|
|
+ } else {
|
|
|
+ await servicesApi.postStation({ name, provinceId, cityId, countryId })
|
|
|
+ ElMessage.success('泵站新增成功')
|
|
|
+ }
|
|
|
+ resetHousingData();
|
|
|
+ getList();
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 显示 关联小区 - dialog
|
|
|
+const handleRelation = ({ id }) => {
|
|
|
+ relationVisible.value = true;
|
|
|
+ openRelationDialog(id);
|
|
|
+}
|
|
|
+
|
|
|
+// dialog - 关联小区 - 打开
|
|
|
+const openRelationDialog = (pumpingStationId) => {
|
|
|
+ servicesApi.getSimpleNeighbourhoodList({ pumpingStationId }).then(({ data }) => {
|
|
|
+ dialogDataSource.value = data.map(item => {
|
|
|
+ item.checkList = item.neighbourhoodNumberAndAddFlags.filter(item => item.addStatus == 2)
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ checkList.value = floorList.value.filter(item => item.addStatus == 2).map(item => item.buildingId);
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// dialog 切换小区
|
|
|
+const onDialogHousingItem = (index) => {
|
|
|
+ housingActiveIndex.value = index;
|
|
|
+ checkList.value = dialogDataSource.value[housingActiveIndex.value].checkList.map(item => item.buildingId);
|
|
|
+}
|
|
|
+
|
|
|
+// 选中发生变化
|
|
|
+const onCheckoutGroupChange = (floorIds) => {
|
|
|
+ const currentData = dialogDataSource.value[housingActiveIndex.value];
|
|
|
+ currentData.checkList = floorIds.map(id => {
|
|
|
+ let tempItem = null;
|
|
|
+ currentData.neighbourhoodNumberAndAddFlags.forEach(item => {
|
|
|
+ if ( item.buildingId == id ) {
|
|
|
+ tempItem = item;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return tempItem;
|
|
|
+ }).filter(Boolean);
|
|
|
+}
|
|
|
+
|
|
|
+// 保存小区
|
|
|
+const onRelationSave = () => {
|
|
|
+
|
|
|
+ const data = dialogDataSource.value.map(item => {
|
|
|
+ return {
|
|
|
+ ...item,
|
|
|
+ neighbourhoodNumberAndAddFlags: item.checkList
|
|
|
+ };
|
|
|
+ })
|
|
|
+
|
|
|
+ servicesApi.postSaveFinalData(data).then(() => {
|
|
|
+ onRelationCancel();
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ })
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+const handleShowStationDialog = (row) => {
|
|
|
+ servicesApi.getStation({ id: row.id }).then(res => {
|
|
|
+ stationVisible.value = true;
|
|
|
+ stationList.value = res.data;
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const onRelationCancel = () => {
|
|
|
+ housingActiveIndex.value = 0;
|
|
|
+ relationVisible.value = false;
|
|
|
+ checkList.value = [];
|
|
|
+ dialogDataSource.value = [];
|
|
|
+}
|
|
|
+
|
|
|
+// table数据
|
|
|
+const getList = async () => {
|
|
|
+ loading.value = true;
|
|
|
+
|
|
|
+ const [ provinceId, cityId, countryId ] = adressValue.value;
|
|
|
+ let rows = null;
|
|
|
+ let t = null;
|
|
|
+
|
|
|
+ if ( activeName.value === 'first' ) {
|
|
|
+ const res = await servicesApi.getNeighborhoodList({ ...queryParams.value, provinceId, cityId, countryId });
|
|
|
+ rows = res.rows;
|
|
|
+ t = res.total;
|
|
|
+ } else {
|
|
|
+ const res = await servicesApi.getStationList({ ...queryParams.value, provinceId, cityId, countryId });
|
|
|
+ rows = res.rows;
|
|
|
+ t = res.total;
|
|
|
+ }
|
|
|
+
|
|
|
+ loading.value = false;
|
|
|
+ tableData.value = rows;
|
|
|
+ total.value = t;
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getList();
|
|
|
+})
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
-
|
|
|
<div class="server-viewport">
|
|
|
- <el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
|
|
+ <el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleTabClick">
|
|
|
<el-tab-pane label="服务小区管理" name="first">
|
|
|
- <div class="search-card">
|
|
|
- <el-row :gutter="24" class="mb-[24px]">
|
|
|
- <el-col :span="6">
|
|
|
- <SearchItemWrapper>
|
|
|
- <el-input class="search-input" placeholder="用户电话号码"></el-input>
|
|
|
- </SearchItemWrapper>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <SearchItemWrapper label="客服">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
- </el-select>
|
|
|
- </SearchItemWrapper>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <SearchItemWrapper label="通话状态">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
- </el-select>
|
|
|
- </SearchItemWrapper>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <div class="flex items-center justify-end space-x-[10px]">
|
|
|
- <div class="custom-btn custom-btn_primary">搜索</div>
|
|
|
- <div class="custom-btn custom-btn_default">重置</div>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="add-btn-card">
|
|
|
- <div class="btn space-x-[5px]" @click="handleJumpWaterAdd">
|
|
|
- <el-icon>
|
|
|
- <CirclePlus />
|
|
|
- </el-icon>
|
|
|
- <span>新增小区</span>
|
|
|
+ <div class="top-inner">
|
|
|
+ <div class="search-card">
|
|
|
+ <el-row :gutter="24" class="mb-[24px]">
|
|
|
+ <el-col :span="6">
|
|
|
+ <SearchItemWrapper>
|
|
|
+ <el-input class="search-input" placeholder="小区名称" v-model="queryParams.name"></el-input>
|
|
|
+ </SearchItemWrapper>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <SearchItemWrapper label="区/县">
|
|
|
+ <el-cascader :props="props" style="width: 100%;" v-model="adressValue"/>
|
|
|
+ </SearchItemWrapper>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6" :offset="6">
|
|
|
+ <div class="flex items-center justify-end space-x-[10px]">
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="getList">搜索</div>
|
|
|
+ <div class="custom-btn custom-btn_default" @click="handleCleanOptions">重置</div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="add-btn-card">
|
|
|
+ <div class="btn space-x-[5px]" @click="housingDialogVisible = true">
|
|
|
+ <el-icon>
|
|
|
+ <CirclePlus />
|
|
|
+ </el-icon>
|
|
|
+ <span>新增小区</span>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="table-card">
|
|
|
- <el-table :data="tableData" style="width: 100%" max-height="calc(100vh - 366px)">
|
|
|
- <el-table-column label="序号" align="center" type="index" width="50" fixed />
|
|
|
- <el-table-column prop="name" label="通话类型" align="center" />
|
|
|
- <el-table-column prop="address" label="通话状态" align="center">
|
|
|
+ <div class="table-card" ref="tableContainer">
|
|
|
+ <el-table :data="tableData" style="width: 100%" max-height="calc(100vh - 376px)" v-loading="loading">
|
|
|
+ <el-table-column prop="name" label="小区名称" align="center" />
|
|
|
+ <el-table-column prop="buildingsNames" label="楼号" align="center" />
|
|
|
+ <el-table-column prop="address" label="地址" align="center" />
|
|
|
+ <el-table-column prop="pumpingStationNames" label="关联泵站" align="center">
|
|
|
<template #default="scope">
|
|
|
- <div class="flex items-center justify-center space-x-[6px]">
|
|
|
- <span class="w-[6px] h-[6px] bg-[#65C734] rounded-full"></span>
|
|
|
- <span>已接通</span>
|
|
|
- </div>
|
|
|
+ <span class="station-name" @click="handleShowStationDialog(scope.row)">{{ scope.row.pumpingStationNames }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="用户电话" align="center" />
|
|
|
- <el-table-column prop="address" label="客服" align="center" />
|
|
|
- <el-table-column prop="address" label="服务类型" align="center" />
|
|
|
- <el-table-column prop="address" label="通话录音" align="center" width="350">
|
|
|
+ <el-table-column prop="createBy" label="创建人" align="center" />
|
|
|
+ <el-table-column prop="createTime" label="创建时间" align="center" />
|
|
|
+ <el-table-column prop="address" label="操作" align="center" width="120">
|
|
|
<template #default="scope">
|
|
|
- <div class="flex justify-center">
|
|
|
- <AudioPlayer></AudioPlayer>
|
|
|
+ <div class="flex justify-center space-x-[20px]">
|
|
|
+ <span class="text-[#165DFF] cursor-pointer" @click="handleEditData(scope.row)">编辑</span>
|
|
|
+ <el-popconfirm
|
|
|
+ width="220"
|
|
|
+ icon-color="#626AEF"
|
|
|
+ title="确认要删除本条数据吗?"
|
|
|
+ @confirm="onConfirm(scope.row)"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <span class="text-[#165DFF] cursor-pointer">删除</span>
|
|
|
+ </template>
|
|
|
+ <template #actions="{ confirm, cancel }">
|
|
|
+ <el-button size="small" @click="cancel">否</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="confirm">是</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="通话发起时间" align="center" />
|
|
|
- <el-table-column prop="address" label="操作" align="center" fixed="right" />
|
|
|
</el-table>
|
|
|
|
|
|
<pagination v-show="total >= 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane label="泵站管理" name="second">
|
|
|
+ <el-tab-pane label="泵站管理" name="second" >
|
|
|
+
|
|
|
<div class="search-card">
|
|
|
<el-row :gutter="24" class="mb-[24px]">
|
|
|
<el-col :span="6">
|
|
|
<SearchItemWrapper>
|
|
|
- <el-input class="search-input" placeholder="用户电话号码"></el-input>
|
|
|
- </SearchItemWrapper>
|
|
|
- </el-col>
|
|
|
- <el-col :span="6">
|
|
|
- <SearchItemWrapper label="客服">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
- </el-select>
|
|
|
+ <el-input class="search-input" placeholder="泵站名称" v-model="queryParams.name"></el-input>
|
|
|
</SearchItemWrapper>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <SearchItemWrapper label="通话状态">
|
|
|
- <el-select v-model="value" placeholder="Select" size="large">
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
|
|
- </el-select>
|
|
|
+ <SearchItemWrapper label="区/县">
|
|
|
+ <el-cascader :props="props" style="width: 100%;" v-model="adressValue"/>
|
|
|
</SearchItemWrapper>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="6" :offset="6">
|
|
|
<div class="flex items-center justify-end space-x-[10px]">
|
|
|
- <div class="custom-btn custom-btn_primary">搜索</div>
|
|
|
- <div class="custom-btn custom-btn_default">重置</div>
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="getList">搜索</div>
|
|
|
+ <div class="custom-btn custom-btn_default" @click="handleCleanOptions">重置</div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
|
|
|
<div class="add-btn-card">
|
|
|
- <div class="btn space-x-[5px]" @click="handleJumpWaterAdd">
|
|
|
+ <div class="btn space-x-[5px]" @click="pumpDialogVisible = true">
|
|
|
<el-icon>
|
|
|
<CirclePlus />
|
|
|
</el-icon>
|
|
|
- <span>新增小区</span>
|
|
|
+ <span>新增泵站</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <div class="table-card">
|
|
|
- <el-table :data="tableData" style="width: 100%" max-height="calc(100vh - 366px)">
|
|
|
- <el-table-column label="序号" align="center" type="index" width="50" fixed />
|
|
|
- <el-table-column prop="name" label="通话类型" align="center" />
|
|
|
- <el-table-column prop="address" label="通话状态" align="center">
|
|
|
+ <div class="table-card" >
|
|
|
+ <el-table :data="tableData" style="width: 100%" max-height="calc(100vh - 376px)">
|
|
|
+ <el-table-column prop="name" label="泵站名称" align="center" />
|
|
|
+ <el-table-column prop="buildingsNames" label="楼号" align="center" />
|
|
|
+ <el-table-column prop="address" label="地址" align="center">
|
|
|
<template #default="scope">
|
|
|
- <div class="flex items-center justify-center space-x-[6px]">
|
|
|
- <span class="w-[6px] h-[6px] bg-[#65C734] rounded-full"></span>
|
|
|
- <span>已接通</span>
|
|
|
- </div>
|
|
|
+ <p class="space-x-[10px]">
|
|
|
+ <span>{{ scope.row.provinceName }}</span>
|
|
|
+ <span>{{ scope.row.cityName }}</span>
|
|
|
+ <span>{{ scope.row.countryName }}</span>
|
|
|
+ </p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="用户电话" align="center" />
|
|
|
- <el-table-column prop="address" label="客服" align="center" />
|
|
|
- <el-table-column prop="address" label="服务类型" align="center" />
|
|
|
- <el-table-column prop="address" label="通话录音" align="center" width="350">
|
|
|
+ <el-table-column prop="neighbourhoodAndBuildings" label="关联小区" align="center" />
|
|
|
+ <el-table-column prop="createBy" label="创建人" align="center" />
|
|
|
+ <el-table-column prop="createTime" label="创建时间" align="center" />
|
|
|
+ <el-table-column prop="address" label="操作" align="center" width="200">
|
|
|
<template #default="scope">
|
|
|
- <div class="flex justify-center">
|
|
|
- <AudioPlayer></AudioPlayer>
|
|
|
+ <div class="flex justify-center space-x-[20px]">
|
|
|
+ <span class="text-[#165DFF] cursor-pointer" @click="handleEditData(scope.row)">编辑</span>
|
|
|
+ <el-popconfirm
|
|
|
+ width="220"
|
|
|
+ icon-color="#626AEF"
|
|
|
+ title="确认要删除本条数据吗?"
|
|
|
+ @confirm="onConfirm(scope.row)"
|
|
|
+ >
|
|
|
+ <template #reference>
|
|
|
+ <span class="text-[#165DFF] cursor-pointer">删除</span>
|
|
|
+ </template>
|
|
|
+ <template #actions="{ confirm, cancel }">
|
|
|
+ <el-button size="small" @click="cancel">否</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="confirm">是</el-button>
|
|
|
+ </template>
|
|
|
+ </el-popconfirm>
|
|
|
+ <span class="text-[#165DFF] cursor-pointer" @click="handleRelation(scope.row)">关联小区</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="address" label="通话发起时间" align="center" />
|
|
|
- <el-table-column prop="address" label="操作" align="center" fixed="right" />
|
|
|
</el-table>
|
|
|
|
|
|
<pagination v-show="total >= 0" :total="total" v-model:page="queryParams.pageNum"
|
|
@@ -258,34 +507,40 @@ const tableData = [
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
|
|
|
-
|
|
|
- <el-dialog v-model="dialogVisible" title="编辑备注" width="600" modal-class="custom-workbench-dialog" align-center>
|
|
|
- <template #header="{ close, titleId, titleClass }">
|
|
|
+ <el-dialog
|
|
|
+ v-model="housingDialogVisible"
|
|
|
+ title="编辑备注"
|
|
|
+ width="600"
|
|
|
+ modal-class="custom-workbench-dialog"
|
|
|
+ align-center
|
|
|
+ @closed="resetHousingData"
|
|
|
+ >
|
|
|
+ <template #header>
|
|
|
<div class="dialog-header">
|
|
|
<h4>新增小区</h4>
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="dialog-body">
|
|
|
<div class="dialog-form_inner">
|
|
|
- <el-form :model="form" label-width="auto" style="width: 100%;">
|
|
|
- <el-form-item label="小区名称">
|
|
|
- <el-input />
|
|
|
+ <el-form :model="housingFormData" label-width="auto" style="width: 100%;" :rules="housingRules" ref="housingFormRef">
|
|
|
+ <el-form-item label="小区名称" prop="name">
|
|
|
+ <el-input v-model.trim="housingFormData.name" placeholder="请输入"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="地区">
|
|
|
- <el-input />
|
|
|
+ <el-form-item label="地区" prop="selectOptions">
|
|
|
+ <el-cascader :props="props" style="width: 100%;" v-model="housingFormData.selectOptions"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="详细地址">
|
|
|
- <el-input />
|
|
|
+ <el-form-item label="详细地址" prop="address">
|
|
|
+ <el-input placeholder="请输入" v-model.trim="housingFormData.address"/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="楼号">
|
|
|
+ <el-form-item label="楼号" prop="buildingNameList">
|
|
|
<div class="floor-add-card">
|
|
|
<div class="flex space-x-[10px]">
|
|
|
- <el-input />
|
|
|
- <p>添加</p>
|
|
|
+ <el-input placeholder="请输入" v-model="housingFormData.buildingNum" :validate-event="false"/>
|
|
|
+ <p @click="handleAddName">添加</p>
|
|
|
</div>
|
|
|
<ul class="floor-list">
|
|
|
- <li v-for="item in 20">
|
|
|
- <el-tag type="primary" closable >{{ item }}#</el-tag>
|
|
|
+ <li v-for="item, index in housingFormData.buildingNameList">
|
|
|
+ <el-tag type="primary" closable @close="handleCloseTag(index)">{{ item }}</el-tag>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -295,8 +550,153 @@ const tableData = [
|
|
|
</div>
|
|
|
<template #footer>
|
|
|
<div class="dialog-footer space-x-[14px]">
|
|
|
- <div class="custom-btn custom-btn_primary">确定</div>
|
|
|
- <div class="custom-btn custom-btn_default">取消</div>
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="onHousingDialogConfirm">确定</div>
|
|
|
+ <div class="custom-btn custom-btn_default" @click="resetHousingData">取消</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="pumpDialogVisible"
|
|
|
+ title="编辑备注"
|
|
|
+ width="600"
|
|
|
+ modal-class="custom-workbench-dialog"
|
|
|
+ align-center
|
|
|
+ @closed="resetPumpData"
|
|
|
+ >
|
|
|
+ <template #header>
|
|
|
+ <div class="dialog-header">
|
|
|
+ <h4>新增泵站</h4>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div class="dialog-body">
|
|
|
+ <div class="dialog-form_inner">
|
|
|
+ <el-form :model="pumpFormData" label-width="auto" style="width: 100%;" :rules="housingRules" ref="pumpFormRef">
|
|
|
+ <el-form-item label="泵站名称" prop="name">
|
|
|
+ <el-input v-model.trim="pumpFormData.name" placeholder="请输入"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="地区" prop="selectOptions">
|
|
|
+ <el-cascader :props="props" style="width: 100%;" v-model="pumpFormData.selectOptions"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer space-x-[14px]">
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="onPumpDialogConfirm">确定</div>
|
|
|
+ <div class="custom-btn custom-btn_default" @click="resetHousingData">取消</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="relationVisible"
|
|
|
+ title="关联小区"
|
|
|
+ width="750"
|
|
|
+ class="relation-dialog"
|
|
|
+ >
|
|
|
+ <template #header>
|
|
|
+ <div class="dialog-header pl-[16px]">
|
|
|
+ <h4>关联小区</h4>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div class="relation-dialog-body space-x-[16px]">
|
|
|
+ <div class="dialog-inner_left">
|
|
|
+ <div class="header">
|
|
|
+ <el-input :suffix-icon="Search"></el-input>
|
|
|
+ </div>
|
|
|
+ <div class="body">
|
|
|
+ <div class="body-inner_left">
|
|
|
+ <el-scrollbar style="height: 100%;">
|
|
|
+ <ul class="housing-list">
|
|
|
+ <li
|
|
|
+ v-for="item, index in dialogDataSource"
|
|
|
+ :key="item.id"
|
|
|
+ :class="{active: housingActiveIndex === index}"
|
|
|
+ @click="onDialogHousingItem(index)"
|
|
|
+ >
|
|
|
+ <el-tooltip
|
|
|
+ effect="dark"
|
|
|
+ placement="left"
|
|
|
+ :content="item.name"
|
|
|
+ >
|
|
|
+ <p>{{ item.name }}</p>
|
|
|
+ </el-tooltip>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ <div class="body-inner_right">
|
|
|
+ <el-scrollbar style="height: 100%;">
|
|
|
+ <el-checkbox-group v-model="checkList" @change="onCheckoutGroupChange">
|
|
|
+ <div v-for="item, index in floorList" :key="index">
|
|
|
+ <el-checkbox :label="item.buildingsNames" :value="item.buildingId" :disabled="item.addStatus === 1"/>
|
|
|
+ </div>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="dialog-inner_right">
|
|
|
+ <div class="header">
|
|
|
+ 已选小区
|
|
|
+ </div>
|
|
|
+ <div class="body">
|
|
|
+ <el-scrollbar style="height: 100%;">
|
|
|
+ <ul class="body_inner space-y-[10px]">
|
|
|
+ <li v-for="item, index in contactCheckData" :key="index">
|
|
|
+ <p class="name">{{ item.name }}</p>
|
|
|
+ <p>{{ item.floorList }}</p>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer space-x-[14px]">
|
|
|
+ <div class="custom-btn custom-btn_primary" @click="onRelationSave">保存</div>
|
|
|
+ <div class="custom-btn custom-btn_default" @click="onRelationCancel">取消</div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog
|
|
|
+ v-model="stationVisible"
|
|
|
+ title="关联泵站"
|
|
|
+ width="650"
|
|
|
+ class="relation-dialog"
|
|
|
+ >
|
|
|
+ <template #header>
|
|
|
+ <div class="dialog-header pl-[16px]">
|
|
|
+ <h4>关联泵站</h4>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <div class="station-dialog-body space-x-[16px]">
|
|
|
+ <el-scrollbar style="height: 100%;" >
|
|
|
+ <div class="space-y-[20px]">
|
|
|
+ <ul v-for="item, index in stationList" :key="index">
|
|
|
+ <li class="space-x-[10px]">
|
|
|
+ <span class="flex-shrink-0">泵站名称:</span>
|
|
|
+ <span>{{ item.pumpingStationName === 'NULL' ? '' : item.pumpingStationName }}</span>
|
|
|
+ </li>
|
|
|
+ <li class="space-x-[10px] flex">
|
|
|
+ <span class="flex-shrink-0">关联楼号:</span>
|
|
|
+ <span>{{ item.buildingsNames }}</span>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+ </div>
|
|
|
+ </el-scrollbar>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer space-x-[14px]">
|
|
|
+ <div class="custom-btn custom-btn_default" @click="stationVisible = false">关闭</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
@@ -312,8 +712,33 @@ const tableData = [
|
|
|
border-radius: 8px;
|
|
|
background: #FFF;
|
|
|
|
|
|
+ .station-name {
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ color: #165DFF;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .custom-tab-pane {
|
|
|
+ display: flex;
|
|
|
+ flex-flow: column;
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ .top-inner {
|
|
|
+ flex-shrink: 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .table-card {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.search-card {
|
|
|
border-bottom: 1px dashed #E5E6EB;
|
|
|
+
|
|
|
+ :deep(.el-input__wrapper) {
|
|
|
+ box-shadow: none;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.add-btn-card {
|
|
@@ -368,6 +793,10 @@ const tableData = [
|
|
|
grid-gap: 4px;
|
|
|
}
|
|
|
|
|
|
+ :deep(.el-tabs) {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
:deep(.el-tabs__item) {
|
|
|
color: #4E5969;
|
|
|
}
|
|
@@ -380,4 +809,103 @@ const tableData = [
|
|
|
background-color: #165DFF;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.relation-dialog-body {
|
|
|
+ display: flex;
|
|
|
+ height: 360px;
|
|
|
+ padding: 16px;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #f1f3f7;
|
|
|
+
|
|
|
+ .dialog-inner_left, .dialog-inner_right {
|
|
|
+ height: 100%;
|
|
|
+ border-radius: 4px;
|
|
|
+ }
|
|
|
+ .dialog-inner_left {
|
|
|
+ width: 70%;
|
|
|
+ padding: 10px;
|
|
|
+ background: #fff;
|
|
|
+ .header {
|
|
|
+ padding-bottom: 10px;
|
|
|
+ }
|
|
|
+ .body {
|
|
|
+ display: flex;
|
|
|
+ height: calc(100% - 42px);
|
|
|
+ .body-inner_left, .body-inner_right {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .body-inner_left {
|
|
|
+ width: 60%;
|
|
|
+ border-right: 1px solid #eff1f5;
|
|
|
+ .housing-list {
|
|
|
+ padding-right: 10px;
|
|
|
+ line-height: 30px;
|
|
|
+ li {
|
|
|
+ padding-left: 10px;
|
|
|
+ cursor: pointer;
|
|
|
+ p {
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ &:hover {
|
|
|
+ background: #eff1f5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ background: #eff1f5;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .body-inner_right {
|
|
|
+ flex: 1;
|
|
|
+ padding: 0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .dialog-inner_right {
|
|
|
+ width: 30%;
|
|
|
+ background: #fff;
|
|
|
+ .header {
|
|
|
+ padding: 10px;
|
|
|
+ border-bottom: 1px solid #eff1f5;
|
|
|
+ line-height: 21px;
|
|
|
+ }
|
|
|
+ .body {
|
|
|
+ height: calc(100% - 42px);
|
|
|
+ .body_inner {
|
|
|
+ padding: 10px;
|
|
|
+ li {
|
|
|
+ padding-bottom: 10px;
|
|
|
+ p:first-child {
|
|
|
+ color: #1D2129;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ p:nth-child(2) {
|
|
|
+ color: #606266;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ li:not(:last-child) {
|
|
|
+ border-bottom: 1px solid #eff1f5;
|
|
|
+ }
|
|
|
+ .name {
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+ .station-dialog-body {
|
|
|
+ padding: 0 16px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+.relation-dialog {
|
|
|
+ padding: 16px 0;
|
|
|
+}
|
|
|
</style>
|