Browse Source

Merge branch 'dev-statics'

V1.0
13176889840 3 years ago
parent
commit
f2fda154ed
  1. 465
      src/views/modules/shequzhili/xiangmu/index.vue

465
src/views/modules/shequzhili/xiangmu/index.vue

@ -10,72 +10,127 @@
class="demo-form-inline" class="demo-form-inline"
> >
<div> <div>
<el-form-item label="项目标题" prop="title">
<el-input <el-form-item label="所属组织" label-width="100px"
v-model="fmData.title" prop="orgId">
class="resi-cell-input" <el-cascader ref="cascaderUnit" v-model="orgId"
size="small" :options="optionsA"
clearable :props="{ checkStrictly: true,
placeholder="请输入" emitPath: false,children:'subAgencyList',label:'agencyName', value: 'orgLevel'}"
> clearable
@change="handleCalscChange"/>
</el-form-item>
<el-form-item label="上报渠道"
prop="origin">
<el-select v-model="fmData.origin"
placeholder="请选择"
size="small"
clearable
class="item_width_2">
<el-option v-for="item in qudaoArray"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="上报人"
prop="staffName">
<el-input v-model="fmData.staffName"
class="item_width_2"
size="small"
clearable
placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="手机号"
prop="mobile">
<el-input v-model="fmData.mobile"
class="item_width_2"
size="small"
clearable
placeholder="请输入">
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item label="事件内容"
prop="backGround">
<el-input v-model="fmData.backGround"
class="item_width_2"
size="small"
clearable
placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="事件类型"
prop="firstIdList">
<el-cascader ref="cascaderEvent" v-model="eventTypeCheck" :options="cateOptions"
collapse-tags
:show-all-levels="false"
:props="{
multiple: true,
checkStrictly: false,
emitPath: false,
children:'subCategory',
label:'name',
value:'id'
}" clearable class="item_width_2" @change="handleEventType" />
<!-- <template slot-scope="{ node, data }">
<div @click="cascaderClick(node, data)">
<span>{{ data.name }}</span>
</div>
</template>
</el-cascader> -->
</el-form-item>
<el-form-item label="事件状态"
prop="status">
<el-select class="item_width_2"
v-model="fmData.status"
placeholder="全部"
size="small"
clearable>
<el-option v-for="item in optionsStatus"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-form-item label="转项目时间" prop="date"> </el-form-item>
<el-date-picker
v-model="fmData.startDate" <el-form-item label="上报时间"
size="small" prop="startTime">
type="date" <el-date-picker v-model="fmData.startTime"
value-format="yyyy-MM-dd" :picker-options="startPickerOptions"
style="width: 150px" class="item_width_2"
placeholder="开始时间" size="small"
> type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间">
</el-date-picker> </el-date-picker>
<span style="margin:0 8px;"></span> <span class="data-tag"></span>
<el-date-picker <el-date-picker v-model="fmData.endTime"
v-model="fmData.endDate" :picker-options="endPickerOptions"
size="small" class="item_width_2 data-tag"
type="date" size="small"
style="width: 150px" type="datetime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss"
placeholder="结束时间" placeholder="结束时间">
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="处置选项"
<el-select prop="staffId">
v-model.trim="fmData.status" <el-checkbox v-model="checkStaffId" @change="handleCheckbox"></el-checkbox>
placeholder="请选择"
size="small"
clearable
style="width: 150px"
class="resi-cell-select"
>
<el-option
v-for="item in optionsStatus"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item style="margin-left: 35px">
<el-button
class="diy-button--search"
size="small"
@click="handleSearch"
>查询</el-button
>
<el-button
class="diy-button--reset"
size="small"
@click="resetForm('searchForm')"
>重置</el-button
>
</el-form-item> </el-form-item>
<el-button style="margin-left:30px"
size="small"
class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
size="small"
class="diy-button--reset"
@click="resetForm('searchForm')">重置</el-button>
</div> </div>
</el-form> </el-form>
</el-card> </el-card>
@ -120,7 +175,7 @@
</el-upload> </el-upload>
<el-button @click="handleChu" class="diy-button--reset" size="small" <el-button @click="handleChu" class="diy-button--reset" size="small"
>导出</el-button :loading="exportLoading">导出</el-button
> >
</div> </div>
@ -141,59 +196,115 @@
<el-table-column <el-table-column
prop="gridName" prop="gridName"
align="center" align="center"
label="所属网格" label="所属组织/网格"
min-width="140"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="title" prop="firstName"
label="项目标题" label="事件类型"
min-width="140"
align="center" align="center"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template slot-scope="scope">
{{ scope.row.firstName + '-' + scope.row.secondName }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="shiftProjectTime" prop="staffName"
width="100" width="100"
align="center" align="center"
label="转项目时间" label="报事人"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="projectScheme" prop="mobile"
align="center" align="center"
label="项目方案" label="手机号"
width="140"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="internalRemark" prop="createdTime"
align="center" align="center"
label="内部备注" label="上报时间"
width="160"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="departmentNameList" prop="backGround"
align="center" align="center"
label="当前处理部门 " label="事件内容"
min-width="160"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="detentionDays" prop="publicReply"
align="center" align="center"
label="滞留工作日 " min-width="160"
label="办理结果(结案说明)"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
<template slot-scope="scope">
{{ scope.row.publicReply }}
</template>
</el-table-column>
<el-table-column
prop="urlList"
align="center"
label="图片 "
>
<template slot-scope="scope">
<el-image v-if="scope.row.urlList&&scope.row.urlList.length>0"
style="width: 40px; height: 40px"
:src="scope.row.urlList[0]"
:preview-src-list="scope.row.urlList">
</el-image>
<span v-else></span>
</template>
</el-table-column> </el-table-column>
<el-table-column
prop="origin"
align="center"
label="上报渠道"
width="120"
/>
<!-- <template slot-scope="scope">
<span v-if="scope.row.origin == 'agency'">网格上报</span>
<span v-else-if="scope.row.origin == 'ic_event'">居民上报</span>
<span v-else-if="scope.row.origin == 'work_event'">巡查上报</span>
<span v-else-if="scope.row.origin == 'issue'">议题上报</span>
</template>
</el-table-column> -->
<el-table-column
prop="address"
align="center"
label="地址 "
:show-overflow-tooltip="true"
/>
<el-table-column
prop="status"
align="center"
label="状态 "
width="70"
/>
<!-- <template slot-scope="scope">
{{ scope.row.status == 'pending' ? '处理中' : '已结案' }}
</template>
</el-table-column> -->
<el-table-column <el-table-column
fixed="right" fixed="right"
@ -203,7 +314,7 @@
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-if="scope.row.status == 'pending' && scope.row.processable" v-if="scope.row.processable"
@click="handleEdit(scope.$index)" @click="handleEdit(scope.$index)"
type="text" type="text"
size="small" size="small"
@ -271,11 +382,38 @@ import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import projectInfo from "./cpts/project-info"; import projectInfo from "./cpts/project-info";
import axios from "axios"; import axios from "axios";
const _form = {
orgId: '',
orgType: '',
origin: '',
backGround: '',
staffName: '',
mobile: '',
startTime: '',
endTime: '',
status: '',
firstIdList: [],
secondIdList: [],
staffId: ''
}
export default { export default {
components: { projectInfo }, components: { projectInfo },
data() { data() {
let endDisabledDate = (time) => {//datareturn
let nowData = Date.now()
if (this.fmData.startTime) {
let startTime = new Date(this.fmData.startTime)
return time.getTime() > nowData || time.getTime() < startTime || time.getTime() === startTime
} else {
return time.getTime() > nowData
}
}
let startDisabledDate = (time) => {//datareturn
let nowData = Date.now()
return time.getTime() > nowData
}
return { return {
pageType: "list", // list dispose info issue-info pageType: "list", // list dispose info issue-info
@ -288,25 +426,46 @@ export default {
optionsStatus: [ optionsStatus: [
{ {
value: "pending", value: "pending",
label: "未结案", label: "处理中",
}, },
{ {
value: "closed", value: "closed",
label: "已结案", label: "已结案",
}, },
], ],
qudaoArray: [
fmData: { {
title: "", value: "agency",
status: "", label: "网格上报",
startDate: "", },
endDate: "", {
date: ["", ""], value: "ic_event",
label: "居民上报",
},
{
value: "work_event",
label: "巡查上报",
},
{
value: "issue",
label: "议题上报",
}
],
orgId: '',
checkStaffId: false,
exportLoading: false,
cateOptions: [],
optionsA: [],
fmData: { ..._form },
endPickerOptions: {
disabledDate: endDisabledDate
},
startPickerOptions: {
disabledDate: startDisabledDate
}, },
importBtnTitle: "导入", importBtnTitle: "导入",
importLoading: false, importLoading: false,
eventTypeCheck: [],
currentProject: { currentProject: {
projectId: "", projectId: "",
userId: "", userId: "",
@ -317,8 +476,8 @@ export default {
computed: { computed: {
maxTableHeight() { maxTableHeight() {
return this.$store.state.inIframe return this.$store.state.inIframe
? this.clientHeight - 360 + this.iframeHeigh ? this.clientHeight - 410 + this.iframeHeigh
: this.clientHeight - 360; : this.clientHeight - 410;
}, },
...mapGetters(["clientHeight", "iframeHeight"]), ...mapGetters(["clientHeight", "iframeHeight"]),
}, },
@ -335,6 +494,8 @@ export default {
}, },
mounted() { mounted() {
this.getTableData(); this.getTableData();
this.getGridList()
this.getCateOptions()
}, },
methods: { methods: {
async handleExportModule() { async handleExportModule() {
@ -410,12 +571,12 @@ export default {
message: "导入中,请到系统管理-导入记录中查看进度", message: "导入中,请到系统管理-导入记录中查看进度",
duration: 0, duration: 0,
}); });
const formData = new FormData(); //FormDataappend('key', value) const fmData = new FormData(); //FormDataappend('key', value)
formData.append("file", file.file); // fmData.append("file", file.file); //
await this.$http await this.$http
.post( .post(
"/heart/iccommunityselforganization/importcommunityselforganization", "/heart/iccommunityselforganization/importcommunityselforganization",
formData fmData
) )
.then((res) => { .then((res) => {
console.log("res-up", res); console.log("res-up", res);
@ -434,7 +595,7 @@ export default {
// window.SITE_CONFIG["apiURL"] + // window.SITE_CONFIG["apiURL"] +
// "/heart/iccommunityselforganization/importcommunityselforganization", // "/heart/iccommunityselforganization/importcommunityselforganization",
// method: "post", // method: "post",
// data: formData, // data: fmData,
// // responseType: "blob", // // responseType: "blob",
// }) // })
// .then((res) => { // .then((res) => {
@ -456,7 +617,48 @@ export default {
this.importBtnTitle = "导入"; this.importBtnTitle = "导入";
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
}, },
handleCalscChange(val) {
console.log('val-----', val)
const arr = val.split('-')
this.fmData.orgId = arr[0]
this.fmData.orgType = arr[1] === 'grid' ? 'grid' : 'agency'
},
handleCheckbox(val) {
const { user } = this.$store.state
console.log('val---', val)
if (val) this.fmData.staffId = user.id
else this.fmData.staffId = ''
},
handleEventType(val) {
// console.log('val-----eee', val)
console.log('nodes---', this.$refs.cascaderEvent.getCheckedNodes())
const nodes = this.$refs.cascaderEvent.getCheckedNodes()
this.fmData.firstIdList = []
this.fmData.secondIdList = []
let level1 = nodes.filter(item => item.level === 1)
let level2 = nodes.filter(item => item.level === 2)
console.log('level2----1', level2)
level1.forEach(item => {
console.log('level2----2', level2)
if (item.hasChildren) {
for (let i = level2.length - 1; i >= 0; i--) {
if (level2[i].parent.value === item.value) level2.splice(i, 1)
}
}
})
this.fmData.firstIdList = level1.map(item => item.value)
this.fmData.secondIdList = level2.map(item => item.value)
},
cascaderClick (node, nodeData) {
console.log('node---', node)
console.log('nodeData---', nodeData)
// this.fmData.agencyId = nodeData.objectId;
// this.fmData.level = nodeData.objectType
// this.$refs.cascaderUnit.checkedValue = nodeData.id;
// this.$refs.cascaderUnit.computePresentText();
// this.$refs.cascaderUnit.toggleDropDownVisible(false);
},
handleSizeChange(val) { handleSizeChange(val) {
console.log(`每页 ${val}`); console.log(`每页 ${val}`);
this.pageSize = val; this.pageSize = val;
@ -470,18 +672,26 @@ export default {
}, },
handleSearch(val) { handleSearch(val) {
console.log(this.fmData); console.log(JSON.stringify(this.fmData));
this.pageNo = 1; this.pageNo = 1;
this.getTableData(); this.getTableData();
}, },
resetForm(formName) { resetForm(formName) {
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
this.fmData = {
..._form
}
this.eventTypeCheck = []
this.orgId = ''
this.checkStaffId = false
this.handleSearch(); this.handleSearch();
}, },
async handleChu() { async handleChu() {
const url = "/gov/project/project/project-list-export"; // const url = "/gov/project/project/project-list-export";
const url = '/gov/project/project/orgprojectexport'
const { pageSize, pageNo, fmData } = this; const { pageSize, pageNo, fmData } = this;
this.exportLoading = true
axios({ axios({
url: window.SITE_CONFIG["apiURL"] + url, url: window.SITE_CONFIG["apiURL"] + url,
method: "post", method: "post",
@ -507,8 +717,10 @@ export default {
aLink.click(); aLink.click();
document.body.removeChild(aLink); // document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob window.URL.revokeObjectURL(url); //blob
this.exportLoading = false
}) })
.catch((err) => { .catch((err) => {
this.exportLoading = false
console.log("获取导出情失败", err); console.log("获取导出情失败", err);
return this.$message.error("网络错误"); return this.$message.error("网络错误");
}); });
@ -563,7 +775,8 @@ export default {
async getTableData() { async getTableData() {
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list"; // const url = "http://yapi.elinkservice.cn/mock/245/gov/project/project/project-list";
const url = "/gov/project/project/project-list"; // const url = "/gov/project/project/project-list";
const url ='/gov/project/project/orgprojectlist'
const { pageSize, pageNo, fmData } = this; const { pageSize, pageNo, fmData } = this;
const { data, code, msg } = await requestPost(url, { const { data, code, msg } = await requestPost(url, {
pageSize, pageSize,
@ -575,12 +788,71 @@ export default {
this.total = data.total || 0; this.total = data.total || 0;
this.tableData = data.list this.tableData = data.list
? data.list.map((item) => { ? data.list.map((item) => {
return item; return {
...item,
urlList: item.urlList && item.urlList.map(n => n.url)
};
}) })
: []; : [];
} else { } else {
} }
}, },
async getCateOptions() {
const url = "/gov/issue/issueprojectcategorydict/list";
const { data, code, msg } = await requestPost(url, {});
if (code === 0) {
// this.cateOptions = data.map((item) => {
// item.subCategory.forEach((subitem) => {
// delete subitem.subCategory;
// });
// return item;
// });
this.cateOptions = this.deepTree(data, 'subCategory')
} else {
this.$message.error(msg);
}
},
getGridList() {
const { user } = this.$store.state
this.dataListLoading = true
const params = {
agencyId: user.agencyId,
client: 'gov'
}
this.$http
// .post('/gov/org/userhouse/service/serviceScopeTree')
// .post('/data/aggregator/org/agencytree', params)
// .post('/gov/org/customeragency/staffinagencylist')
.post('/gov/org/customeragency/agencygridtree')
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
} else {
console.log('获取查询详情成功', res.data)
// let { agencyList, subAgencyList } = res.data
let _arr = []
_arr.push(res.data)
this.optionsA = this.deepTree(_arr, 'subAgencyList')
console.log('optionsA----', this.optionsA)
}
})
.catch(() => {
return this.$message.error('网络错误')
})
},
deepTree(arr, child) {
if (Array.isArray(arr) && arr.length > 0) {
return arr.map(item => {
// if (child === 'subAgencyList') item.value = item.orgType + '-' + item.orgId
return {
...item,
[child]: item[child] && item[child].length > 0 && this.deepTree(item[child], child) || null
}
})
}
}
}, },
}; };
</script> </script>
@ -662,6 +934,13 @@ export default {
.resi-cell-select:last-child { .resi-cell-select:last-child {
margin-right: 0; margin-right: 0;
} }
.item_width_2 {
width: 200px;
}
}
.data-tag {
margin: 0 5px;
} }
.mt10 { .mt10 {

Loading…
Cancel
Save