老产品前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

724 lines
22 KiB

3 years ago
<template>
<div class="div_main">
3 years ago
<div>
3 years ago
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'80px'">
<div>
3 years ago
<el-form-item label="服务名称"
prop="serviceName">
<el-input v-model="formData.serviceName"
3 years ago
class="item_width_1"
size="small"
clearable
placeholder="请输入">
</el-input>
</el-form-item>
<el-form-item label="服务组织"
3 years ago
prop="serviceOrgType">
<el-select v-model="formData.serviceOrgType"
class="input-width-small"
placeholder="请选择"
clearable
@change="handleServiceChange('add', $event)">
<el-option v-for="item in serviceOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
-
<el-select v-model="formData.serviceOrgId"
class="input-width-middle"
filterable
placeholder="请选择"
clearable>
<el-option v-for="item in serviceOptiondList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
3 years ago
</el-form-item>
<el-form-item label="服务时间"
3 years ago
prop="serviceTimeStart">
<el-date-picker v-model="formData.serviceTimeStart"
3 years ago
:picker-options="startPickerOptions"
class="item_width_2"
size="small"
type="date"
3 years ago
value-format="yyyy-MM-dd"
3 years ago
value="yyyy-MM-dd"
placeholder="开始时间">
</el-date-picker>
<span class="data-tag"></span>
3 years ago
<el-date-picker v-model="formData.serviceTimeEnd"
3 years ago
:picker-options="endPickerOptions"
class="item_width_2 data-tag"
size="small"
type="date"
3 years ago
value-format="yyyy-MM-dd"
3 years ago
value="yyyy-MM-dd"
placeholder="结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="服务状态"
3 years ago
prop="serviceStatus">
3 years ago
<el-select class="item_width_2"
3 years ago
v-model="formData.serviceStatus"
3 years ago
placeholder="全部"
size="small"
clearable>
<el-option v-for="item in statusArray"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="满意度"
3 years ago
prop="satisfaction">
3 years ago
<el-select class="item_width_2"
3 years ago
v-model="formData.satisfaction"
3 years ago
placeholder="全部"
size="small"
clearable>
3 years ago
<el-option v-for="item in satisfyArray"
3 years ago
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</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="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button class="diy-button--add"
size="small"
3 years ago
@click="handleAdd">发起服务</el-button>
3 years ago
3 years ago
<!-- <el-button @click="handleExport"
3 years ago
class="diy-button--reset"
3 years ago
size="small">导出</el-button> -->
3 years ago
</div>
<el-table :data="tableData"
border
3 years ago
v-loading="tableLoading"
3 years ago
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
class="table"
style="width: 100%"
:height="maxTableHeight">
<el-table-column label="序号"
fixed="left"
type="index"
align="center"
width="50" />
3 years ago
<el-table-column prop="serviceName"
label="服务名称"
3 years ago
align="center"
:show-overflow-tooltip="true">
</el-table-column>
3 years ago
<el-table-column prop="serviceOrgName"
3 years ago
align="center"
3 years ago
min-width="150"
3 years ago
label="服务组织名称"
:show-overflow-tooltip="true">
3 years ago
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="serviceTimeStart"
3 years ago
align="center"
3 years ago
width="300"
3 years ago
:show-overflow-tooltip="true"
label="服务时间">
3 years ago
<template slot-scope="scope">
<span>{{scope.row.serviceTimeStart}}-{{scope.row.serviceTimeEnd}}</span>
</template>
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="serviceStatus"
3 years ago
align="center"
width="100"
label="服务状态"
:show-overflow-tooltip="true">
3 years ago
<template slot-scope="scope">
3 years ago
<span>{{scope.row.serviceStatus==='in_service'?'进行中':'已完成'}}</span>
3 years ago
</template>
3 years ago
</el-table-column>
3 years ago
<el-table-column prop="servicePeopleNumber"
3 years ago
align="center"
width="110"
label="服务人数"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column fixed="right"
label="操作"
align="center"
3 years ago
width="220">
3 years ago
<template slot-scope="scope">
3 years ago
<el-button @click="handleDetail(scope.row)"
3 years ago
type="text"
size="small"
3 years ago
class="div-table-button--detail">查看</el-button>
3 years ago
<el-button v-if="scope.row.serviceStatus==='in_service'"
@click="handleEdit(scope.row)"
3 years ago
type="text"
size="small"
3 years ago
class="div-table-button--edit">编辑</el-button>
3 years ago
<el-button v-if="scope.row.serviceStatus==='in_service'"
3 years ago
@click="handleFeedback(scope.row)"
3 years ago
type="text"
3 years ago
size="small"
class="div-table-button--edit">反馈</el-button>
3 years ago
<el-button v-if="scope.row.policyId"
3 years ago
@click="handlePersonList(scope.row)"
3 years ago
type="text"
size="small"
class="div-table-button--edit">人员名单</el-button>
3 years ago
<el-button v-if="scope.row.serviceStatus==='in_service'"
3 years ago
@click="handleDel(scope.row)"
3 years ago
type="text"
size="small"
3 years ago
class="div-table-button--delete">取消</el-button>
3 years ago
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
</div>
3 years ago
<el-dialog v-if="showAdd"
:visible.sync="showAdd"
:close-on-click-modal="false"
:close-on-press-escape="false"
3 years ago
:title="addDiaTitle"
3 years ago
:modal-append-to-body="false"
3 years ago
width="850px"
3 years ago
top="5vh"
class="dialog-h"
3 years ago
@closed="showAdd = false">
<add-form ref="ref_add_form"
:formType="formType"
:serviceCategoryKey="serviceCategoryKey"
3 years ago
:statusArray="statusArray"
:satisfyArray="satisfyArray"
3 years ago
:serviceRecordId="serviceRecordId"
3 years ago
:serviceName="serviceName"
3 years ago
@handleOk="handleOk"
@handleClose="handleClose"></add-form>
</el-dialog>
3 years ago
<el-dialog v-if="showEdit"
:visible.sync="showEdit"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'编辑'"
:modal-append-to-body="false"
width="850px"
top="5vh"
class="dialog-h"
@closed="showEdit = false">
<edit-form ref="ref_edit_form"
:serviceRecordId="serviceRecordId"
:serviceOrgName="serviceOrgName"
:satisfyArray="satisfyArray"
:statusArray="statusArray"
@handleOk="handleOk"
@handleClose="handleClose"
:formType="formType">
</edit-form>
</el-dialog>
3 years ago
<el-dialog v-if="showDetail"
:visible.sync="showDetail"
3 years ago
:close-on-click-modal="false"
:close-on-press-escape="false"
3 years ago
:title="detailDiaTitle"
3 years ago
:modal-append-to-body="false"
3 years ago
width="850px"
top="5vh"
class="dialog-h"
3 years ago
@closed="diaDetailClose">
3 years ago
<detail-form ref="ref_detail_form"
3 years ago
:serviceRecordId="serviceRecordId"
3 years ago
:serviceOrgName="serviceOrgName"
3 years ago
:satisfyArray="satisfyArray"
:statusArray="statusArray"
@diaDetailClose="diaDetailClose">
3 years ago
</detail-form>
3 years ago
</el-dialog>
3 years ago
<el-dialog v-if="showPersonList"
:visible.sync="showPersonList"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'人员名单'"
width="1150px"
top="5vh"
class="dialog-h"
@closed="showPersonList = false">
<person-list ref="ref_detail_form"
:policyId="policyId"
:ruleList="ruleList"
@handleOk="handleOk"
@handleClose="handleClose"
:formType="formType">
</person-list>
</el-dialog>
3 years ago
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import { mapGetters } from "vuex";
// import eventInfo from "./cpts/event-info";
import axios from "axios";
3 years ago
import addForm from "./addForm";
import detailForm from "./detailForm";
3 years ago
import editForm from "./editForm";
3 years ago
import feedBackForm from "./addForm";
3 years ago
import personList from "../policy/personList";
3 years ago
export default {
3 years ago
components: { addForm, detailForm, feedBackForm, personList, editForm },
3 years ago
data () {
let endDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键
let nowData = Date.now()
3 years ago
3 years ago
if (this.formData.serviceTimeStart) {
let serviceTimeStart = new Date(this.formData.serviceTimeStart)
return time.getTime() > nowData || time.getTime() < serviceTimeStart || time.getTime() === serviceTimeStart
3 years ago
} else {
return time.getTime() > nowData
}
}
let startDisabledDate = (time) => {//这个关键属性我们一定要写在data的里面并且return的外面,这是动态改变区间的关键
let nowData = Date.now()
return time.getTime() > nowData
}
return {
3 years ago
tableLoading: false,
3 years ago
user: {},
agencyId: '',
tableData: [],
3 years ago
3 years ago
statusArray: [
{
3 years ago
value: "in_service",
label: "进行中",
3 years ago
},
{
3 years ago
value: "completed",
3 years ago
label: "已完成",
},
],
3 years ago
satisfyArray: [
3 years ago
{
3 years ago
value: "bad",
label: "不满意",
3 years ago
},
{
3 years ago
value: "good",
label: "基本满意",
3 years ago
},
{
3 years ago
value: "perfect",
label: "非常满意",
3 years ago
},
3 years ago
3 years ago
],
formData: {
3 years ago
serviceName: '',//项目名称
serviceOrgType: '',//服务组织类型
serviceOrgId: '',//服务组织Id
3 years ago
serviceTimeStart: '',//服务开始时间yyyy-MM-dd
serviceTimeEnd: '',//服务结束时间yyyy-MM-dd
serviceStatus: '',//服务状态。in_service服务中;completed:已完成
satisfaction: '',//满意度.不满意:bad、基本满意:good、非常满意:perfect
3 years ago
},
pageNo: 1,
pageSize: window.localStorage.getItem("pageSize") || 20,
total: 1,
endPickerOptions: {
disabledDate: endDisabledDate
},
startPickerOptions: {
disabledDate: startDisabledDate
},
3 years ago
serviceRecordId: '',
3 years ago
serviceName: '',
serviceOrgName: '',
3 years ago
3 years ago
showAdd: false,
3 years ago
showEdit: false,
3 years ago
showDetail: false,
showFeedback: false,
3 years ago
formType: 'add',
addDiaTitle: '发起服务',
detailDiaTitle: '服务详情',
3 years ago
3 years ago
serviceOptions: [],
serviceOptiondList: [],
3 years ago
policyId: '',
showPersonList: false,
ruleList: []
3 years ago
};
},
computed: {
maxTableHeight () {
return this.$store.state.inIframe
? this.clientHeight - 410 + this.iframeHeigh
: this.clientHeight - 410;
},
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {
3 years ago
// "formData.serviceTimeEnd": function (val) {
// if (val && val != '') {
// let arrayTemp = val.split(' ')
// this.formData.serviceTimeEnd = arrayTemp[0] + ' 23:59:59'
// }
3 years ago
3 years ago
// },
3 years ago
},
mounted () {
console.log(this.$store.state)
this.user = this.$store.state.user
this.agencyId = this.user.agencyId
3 years ago
this.getDictOptions()
3 years ago
this.getTableData();
},
methods: {
handleSearch (val) {
console.log(this.formData);
this.pageNo = 1;
this.getTableData();
},
3 years ago
// 获取服务组织
async getDictOptions () {
3 years ago
const url = "/sys/dict/data/dictlist"
3 years ago
3 years ago
let params = {
3 years ago
dictType: 'user_demand_service_type'
3 years ago
}
3 years ago
3 years ago
const { data, code, msg } = await requestPost(url, params)
3 years ago
3 years ago
if (code === 0) {
3 years ago
this.serviceOptions = data;
3 years ago
} else {
this.$message.error(msg)
}
3 years ago
},
3 years ago
handleServiceChange (type, val) {
this.formData.serviceOrgId = ''
if (val === "social_org") {
if (type === "add") {
this.getServiceuserList(val, "add_demand");
} else {
this.getServiceuserList(val, "query_demand");
}
} else {
this.getServiceuserList(val, "");
}
},
async getServiceuserList (serviceType, query) {
if (!serviceType) return false;
const params = {
serviceName: "",
serviceType: serviceType,
queryPurpose: query,
};
await this.$http
.post("/heart/userdemand/servicelist", params)
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg);
} else {
this.serviceOptiondList = res.data
}
})
.catch(() => {
return this.$message.error("网络错误");
});
},
3 years ago
//加载组织数据
async handlePersonList (row) {
this.policyId = row.policyId
await this.loadRuleList()
this.formType = 'personList'
this.showPersonList = true;
},
async loadRuleList () {
const url = "/heart/policy/rulelist/" + this.policyId
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.ruleList = data
} else {
this.$message.error(msg)
}
},
3 years ago
3 years ago
3 years ago
async handleAdd () {
3 years ago
this.addDiaTitle = '发起服务'
3 years ago
this.formType = 'add'
this.showAdd = true;
},
3 years ago
3 years ago
async handleDetail (row) {
3 years ago
this.detailDiaTitle = "服务详情"
3 years ago
this.serviceRecordId = row.serviceRecordId
3 years ago
this.serviceOrgName = row.serviceOrgName
3 years ago
3 years ago
// this.formType = 'detail'
3 years ago
this.showDetail = true
},
3 years ago
diaDetailClose () {
console.log(this.$refs.ref_detail)
this.$refs.ref_detail_form.diaDestroy()
this.showDetail = false
},
3 years ago
async handleEdit (row) {
3 years ago
// this.detailDiaTitle = "编辑服务"
3 years ago
this.serviceRecordId = row.serviceRecordId
3 years ago
this.serviceOrgName = row.serviceOrgName
3 years ago
this.formType = 'edit'
3 years ago
this.showEdit = true
3 years ago
3 years ago
},
//加载组织数据
3 years ago
async handleFeedback (row) {
3 years ago
3 years ago
this.serviceRecordId = row.serviceRecordId
3 years ago
this.serviceName = row.serviceName
3 years ago
this.addDiaTitle = '服务反馈'
3 years ago
this.formType = 'feedback'
3 years ago
this.showAdd = true;
3 years ago
},
handleClose () {
3 years ago
this.serviceRecordId = ""
this.formType = ''
3 years ago
this.showAdd = false
this.showDetail = false
3 years ago
this.showEdit = false
3 years ago
3 years ago
},
handleOk () {
3 years ago
this.handleClose()
3 years ago
this.pageNo = 1
3 years ago
this.getTableData()
3 years ago
},
3 years ago
async handleDel (row) {
3 years ago
3 years ago
this.serviceRecordId = row.serviceRecordId
3 years ago
this.$confirm("确认取消服务?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.cancelFuwu()
})
.catch(err => {
if (err == "cancel") {
// this.$message({
// type: "info",
// message: "已取消删除"
// });
}
});
},
async cancelFuwu () {
3 years ago
const url = '/heart/icServiceRecordV2/cancel';
let params = {
serviceRecordId: this.serviceRecordId
}
3 years ago
3 years ago
const { data, code, msg } = await requestPost(url, params);
3 years ago
if (code === 0) {
3 years ago
this.$message.success("取消成功!");
3 years ago
this.getTableData();
} else {
this.$message.error("操作失败!");
}
},
async getTableData () {
3 years ago
this.tableLoading = true
3 years ago
const url = "/heart/icServiceRecordV2/list";
3 years ago
const { pageSize, pageNo, formData } = this;
const { data, code, msg } = await requestPost(url, {
pageSize,
pageNo,
serviceCategoryKey: this.serviceCategoryKey,
3 years ago
...formData,
});
3 years ago
this.tableLoading = false
3 years ago
if (code === 0) {
this.total = data.total || 0;
this.tableData = data.list
3 years ago
3 years ago
} else {
this.$message.error(msg);
}
},
3 years ago
async handleExport () {
const url = "/gov/project/icEvent/export";
const { pageSize, pageNo, formData } = this;
axios({
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data: {
pageSize,
pageNo,
...formData,
},
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
})
.catch((err) => {
console.log("获取导出情失败", err);
return this.$message.error("网络错误");
});
},
3 years ago
handleSizeChange (val) {
this.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getTableData();
},
handleCurrentChange (val) {
this.pageNo = val;
this.getTableData();
},
resetSearch () {
this.formData = {
3 years ago
serviceName: '',//项目名称
serviceOrgType: '',//服务组织类型
serviceOrgId: '',//服务组织Id
serviceTimeStart: '',//服务开始时间yyyy-MM-dd
serviceTimeEnd: '',//服务结束时间yyyy-MM-dd
serviceStatus: '',//服务状态。in_service服务中;completed:已完成
satisfaction: '',//满意度.不满意:bad、基本满意:good、非常满意:perfect
3 years ago
}
3 years ago
this.pageNo = 1
3 years ago
this.getTableData()
3 years ago
},
},
props: {
serviceCategoryKey: {
type: String,
required: 'true'
},
}
3 years ago
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
@import "@/assets/scss/modules/management/list-main.scss";
@import "@/assets/scss/modules/shequzhili/event-info.scss";
</style>