epmet pc工作端
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.

1410 lines
46 KiB

<template>
3 years ago
<div v-if="pageLoading"
class="resi-container">
<el-card ref="searchCard"
class="search-card">
4 years ago
<div>
3 years ago
<el-form ref="searchForm"
:inline="true"
:model="searchForm"
class="demo-form-inline"
label-width="80px">
<div>
3 years ago
<el-form-item label="所属网格"
prop="gridId">
<el-select v-model="searchForm.gridId"
filterable
placeholder="请选择"
clearable>
<el-option v-for="item in optionsG"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="需求分类"
prop="categoryCode">
<el-cascader v-model="searchForm.categoryCode"
:options="searchdemandOptions"
:props="{ checkStrictly: true }"
clearable
@change="handleCateCHange"></el-cascader>
<!-- <el-select v-model="searchForm.categoryCode" filterable placeholder="请选择" clearable>
<el-option
v-for="item in demandOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
</el-form-item>
3 years ago
<el-form-item label="需求人"
prop="demandUserName">
<el-input v-model="searchForm.demandUserName"
placeholder="请输入内容"
clearable=""></el-input>
</el-form-item>
4 years ago
</div>
<div>
3 years ago
<el-form-item label="状态"
prop="status">
<el-select v-model="searchForm.status"
filterable
placeholder="请选择"
clearable>
<el-option v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value">
4 years ago
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="上报时间"
prop="reportStartTime">
<el-date-picker v-model="reportTime"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable="">
</el-date-picker>
</el-form-item>
</div>
<div>
3 years ago
<el-form-item label="服务类型"
prop="serviceType">
<el-select v-model="searchForm.serviceType"
filterable
placeholder="请选择"
clearable
@change="handleServiceChange('query', $event)">
<el-option v-for="item in serviceOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item prop="serverId">
3 years ago
<el-select v-model="searchForm.serverId"
filterable
:disabled="searchForm.serviceType ? false : true"
placeholder="请选择"
clearable>
<el-option v-for="item in serviceOptiondList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="服务时间"
prop="wantServiceStartTime">
<el-date-picker v-model="serviceTime"
type="daterange"
format="yyyy 年 MM 月 dd 日"
value-format="yyyy-MM-dd"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable>
</el-date-picker>
</el-form-item>
<el-form-item>
3 years ago
<el-button class="diy-button--search"
size="small"
@click="handleSearch">查询</el-button>
</el-form-item>
<el-form-item>
3 years ago
<el-button class="diy-button--reset"
size="small"
@click="resetForm('searchForm')">重置</el-button>
4 years ago
</el-form-item>
</div>
</el-form>
</div>
4 years ago
</el-card>
<el-card class="resi-card-table">
<div class="resi-row-btn">
3 years ago
<el-button class="diy-button--add"
size="small"
@click="handleAdd('add')">新增</el-button>
</div>
4 years ago
3 years ago
<el-table :data="tableData"
row-key="categoryId"
v-loading="tableLoading"
border
:height="tableHeight"
style="width: 100%"
class="resi-table">
<el-table-column label="序号"
type="index"
align="center"
width="50">
</el-table-column>
3 years ago
<el-table-column v-for="item in tableHeader"
:key="item.columnName"
:prop="item.columnName"
:label="item.label"
:align="item.align"
:min-width="item.width"
:show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ handleFilterSpan(scope.row, item) }}</span>
</template>
</el-table-column>
3 years ago
<el-table-column fixed="right"
label="操作"
align="center"
width="200">
<template slot-scope="scope">
<template v-if="filterEdit(scope.row.agencyId)">
3 years ago
<el-button v-if="
4 years ago
scope.row.status === 'pending' ||
scope.row.status === 'assigned'
"
3 years ago
type="text"
size="small"
@click="handleAppoint(scope.row, 'appoint')">指派</el-button>
4 years ago
<!-- v-if="scope.row.status === 'assigned' || scope.row.status === 'have_order'" -->
3 years ago
<template v-if="
4 years ago
scope.row.reportType == 'self_help' &&
scope.row.serviceShowFlag
3 years ago
">
<el-button v-if="
4 years ago
scope.row.serviceType !== 'volunteer' &&
scope.row.status !== 'finished'
"
3 years ago
type="text"
size="small"
@click="handleFinish(scope.row, 'finish')">完成情况</el-button>
4 years ago
</template>
4 years ago
<template v-else>
3 years ago
<el-button v-if="
4 years ago
scope.row.status === 'assigned' ||
scope.row.status === 'have_order' ||
(scope.row.status == 'finished' && !scope.row.evaluateFlag)
"
3 years ago
type="text"
size="small"
@click="handleFinish(scope.row, 'finish')">完成情况</el-button>
4 years ago
</template>
4 years ago
<template v-if="scope.row.reportType != 'self_help'">
3 years ago
<el-button v-if="scope.row.status === 'pending'"
@click="handleEdit(scope.row, 'edit')"
type="text"
size="small"
class="btn-color-edit">修改</el-button>
<el-popconfirm title="取消之后无法恢复,确认取消?"
@onConfirm="handleDel(scope.row)">
<el-button v-if="
4 years ago
scope.row.status !== 'finished' &&
scope.row.status !== 'canceled'
"
3 years ago
slot="reference"
type="text"
size="small"
class="btn-color-del">取消</el-button>
4 years ago
</el-popconfirm>
</template>
</template>
3 years ago
<el-button @click="handleLook(scope.row, 'look')"
type="text"
size="small"
class="btn-color-look">查看</el-button>
</template>
</el-table-column>
</el-table>
<div>
3 years ago
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="currentPage"
:page-sizes="[20, 50, 100, 200]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</el-card>
3 years ago
<el-dialog title="需求信息"
:visible.sync="dialogVisible"
width="50%"
top="5vh"
append-to-body
class="dialog-h"
:close-on-click-modal="false"
:before-close="handlerCancle">
<el-form v-if="dialogVisible"
label-width="120px"
:model="form"
:rules="rules"
ref="ruleForm"
class="form-wr dialog-h-content scroll-h">
<el-form-item label="所属网格"
prop="gridId">
<el-input v-if="disabled"
v-model="form.gridName"
:disabled="disabled"
class="input-width"></el-input>
<!-- <span >{{ form.gridName }}</span> -->
3 years ago
<el-select v-else
v-model="form.gridId"
filterable
placeholder="请选择"
class="input-width"
clearable
:disabled="disabled"
@change="handleGridChange">
<el-option v-for="item in disabled ? optionsG : optionsEditG"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="需求类型"
prop="categoryCode">
<el-input v-if="disabled"
v-model="form.categoryName"
:disabled="disabled"
class="input-width-min"></el-input>
<el-cascader v-else
v-model="form.categoryCode"
:options="demandOptions"
:disabled="disabled"
clearable
class="input-width"
@change="handleCateSlect"></el-cascader>
<!-- <el-select v-model="form.parentCode" filterable placeholder="请选择" class="input-width" clearable>
<el-option
v-for="item in demandOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select> -->
</el-form-item>
3 years ago
<el-form-item label="上报类型"
prop="reportType">
<el-input v-if="disabled"
v-model="form.reportTypeName"
:disabled="disabled"
class="input-width"></el-input>
<el-select v-else
v-model="form.reportType"
filterable
class="input-width"
placeholder="请选择"
clearable
:disabled="disabled">
<el-option v-for="item in reportOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="上报人"
prop="reportUserName">
<el-input v-model="form.reportUserName"
:disabled="disabled"
placeholder="请输入"
class="input-width"
clearable></el-input>
</el-form-item>
3 years ago
<el-form-item label="上报人手机号"
prop="reportUserMobile">
<el-input v-model="form.reportUserMobile"
:disabled="disabled"
placeholder="请输入"
class="input-width"
maxlength="11"
clearable></el-input>
</el-form-item>
3 years ago
<el-form-item label="上报时间"
prop="reportTime">
<el-date-picker v-model="form.reportTime"
type="datetime"
class="input-width"
clearable
:disabled="disabled"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
3 years ago
<el-form-item label="需求人"
prop="demandUserId">
<el-input v-if="disabled"
v-model="form.demandUserName"
:disabled="disabled"
class="input-width"></el-input>
<el-select v-else
v-model="selectDemandUser"
class="input-width"
filterable
:disabled="disabled"
placeholder="请选择"
clearable
@change="handleDemandChange">
<el-option v-for="item in demandUserList"
:key="item.demandUserId"
:label="item.label"
:value="item">
</el-option>
</el-select>
</el-form-item>
3 years ago
<el-form-item label="服务时间"
prop="wantServiceTime">
<el-date-picker v-model="form.wantServiceTime"
type="datetime"
class="input-width"
clearable
:disabled="disabled"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择日期时间">
</el-date-picker>
</el-form-item>
3 years ago
<el-form-item label="需求内容"
prop="content">
<el-input v-model="form.content"
:autosize="{ minRows: 2, maxRows: 10 }"
:disabled="disabled"
type="textarea"
clearable
class="input-width-textarea"
placeholder="请输入内容"></el-input>
</el-form-item>
3 years ago
<el-form-item v-if="
4 years ago
addType === 'appoint' ||
addType == 'finish' ||
(addType == 'look' && form.serviceShowFlag)
"
3 years ago
label="服务方"
prop="serviceType">
<template v-if="disabled && addType !== 'appoint'">
3 years ago
<el-input v-model="form.serviceShowName"
:disabled="disabled"
class="input-width"></el-input>
</template>
<template v-else>
3 years ago
<el-select v-model="form.serviceType"
class="input-width-small"
placeholder="请选择"
clearable
:disabled="disabled && addType !== 'appoint'"
@change="handleServiceChange('add', $event)">
<el-option v-for="item in serviceOptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
-
3 years ago
<el-select v-model="form.serverId"
class="input-width-middle"
filterable
placeholder="请选择"
clearable
:disabled="disabled && addType !== 'appoint'">
<el-option v-for="item in serviceOptiondList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-form-item>
3 years ago
<el-form-item v-if="addType == 'look' && form.status == 'canceled'"
label="取消时间"
prop="cancelTime">
4 years ago
<span>{{ form.cancelTime }}</span>
</el-form-item>
3 years ago
<template v-if="
4 years ago
(addType == 'finish' && form.reportType != 'self_help') ||
(addType == 'look' && form.status == 'finished')
3 years ago
">
<el-form-item label="实际服务时间"
prop="serviceStartTime">
<el-date-picker v-model="finishServiceTime"
class="input-width-min"
clearable
:disabled="disabled && addType != 'finish'"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handelBlurServiceTime">
</el-date-picker>
</el-form-item>
3 years ago
<el-form-item label="完成情况"
prop="finishResult">
<el-radio v-model="form.finishResult"
label="resolved"
:disabled="disabled && addType != 'finish'">已解决</el-radio>
<el-radio v-model="form.finishResult"
label="unresolved"
:disabled="disabled && addType != 'finish'">未解决</el-radio>
4 years ago
</el-form-item>
3 years ago
<el-form-item label="评价"
prop="score"
class="form-score">
<el-rate v-model="form.score"
:allow-half="true"
:disabled="disabled && addType != 'finish'"></el-rate>
</el-form-item>
3 years ago
<el-form-item label="备注"
prop="finishDesc">
<el-input v-model="form.finishDesc"
:autosize="{ minRows: 2, maxRows: 10 }"
:disabled="disabled && addType != 'finish'"
type="textarea"
clearable
class="input-width-textarea"
placeholder="请输入内容"></el-input>
</el-form-item>
</template>
4 years ago
<template v-if="addType == 'finish' && form.reportType == 'self_help'">
3 years ago
<el-form-item label="实际服务时间"
prop="serviceStartTime">
<el-date-picker v-model="finishServiceTime"
class="input-width-min"
clearable
:disabled="disabled && addType != 'finish'"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="yyyy-MM-dd HH:mm:ss"
@change="handelBlurServiceTime">
4 years ago
</el-date-picker>
</el-form-item>
</template>
</el-form>
<div class="resi-btns">
3 years ago
<el-button size="small"
@click="handlerCancle">{{
4 years ago
addType != "look" ? "取消" : "关闭"
}}</el-button>
3 years ago
<el-button v-if="addType != 'look'"
type="primary"
size="small"
:loading="btnLoading"
@click="handleSUbmit">提交</el-button>
</div>
</el-dialog>
4 years ago
3 years ago
<el-dialog title="需求详情"
:visible.sync="detailShow"
width="50%"
top="5vh"
append-to-body
class="dialog-h"
:close-on-click-modal="false"
:before-close="detailFormCancle">
<detail ref="ref_form_detail"
@diaDetailClose="detailFormCancle"></detail>
3 years ago
</el-dialog>
</div>
</template>
<script>
4 years ago
import { mapGetters } from "vuex";
import info from "./info";
3 years ago
import detail from "./detail";
4 years ago
export default {
3 years ago
components: { info, detail },
4 years ago
3 years ago
data () {
return {
tableLoading: false,
btnLoading: false,
disabled: false,
pageLoading: false,
dialogVisible: false,
currentPage: 1,
pageSize: 20,
total: null,
tableData: [],
4 years ago
searchH: 0,
4 years ago
addLevel: "1",
addType: "add",
value: "",
statusOptions: [
{
4 years ago
label: "待处理",
value: "pending",
},
{
label: "已取消",
value: "canceled",
},
{
label: "已指派",
value: "assigned",
},
{
label: "已接单",
value: "have_order",
},
{
label: "已完成",
value: "finished",
},
],
serviceOptions: [
{
4 years ago
label: "志愿者",
value: "volunteer",
},
// {
// label: '社会组织',
// value: 'social_org'
// },
{
label: "社区自组织",
value: "community_org",
},
{
label: "区域党建单位",
value: "party_unit",
},
],
serviceOptiondList: [],
options: [
{
4 years ago
label: "是",
value: 1,
},
{
label: "否",
value: 2,
},
],
reportOptions: [],
demandOptions: [],
searchdemandOptions: [],
demandUserList: [],
optionsG: [],
optionsEditG: [],
tableHeader: [
{
4 years ago
label: "状态",
align: "center",
columnName: "statusName",
width: "120",
options: [
{
4 years ago
label: "待处理",
value: "pending",
},
{
label: "已取消",
value: "canceled",
},
{
label: "已派单",
value: "assigned",
},
{
label: "已接单",
value: "have_order",
},
{
label: "已完成",
value: "finished",
},
],
},
{
label: "所属网格",
columnName: "gridName",
align: "center",
width: "",
options: [],
},
{
label: "需求类型",
columnName: "categoryName",
align: "center",
width: "",
options: [],
},
{
label: "需求内容",
columnName: "content",
align: "center",
width: "",
options: [],
},
{
label: "上报类型",
columnName: "reportTypeName",
align: "center",
width: "120",
options: [
{
4 years ago
label: "社区帮办",
value: "community",
},
{
label: "楼长帮办",
value: "building_caption",
},
{
label: "党员帮办",
value: "party",
},
{
label: "自身上报",
value: "self_help",
},
],
},
{
label: "上报人",
columnName: "reportUserName",
align: "center",
width: "120",
options: [],
},
{
label: "上报时间",
columnName: "reportTime",
align: "center",
width: "180",
options: [],
},
{
label: "需求人",
columnName: "demandUserName",
align: "center",
width: "80",
options: [],
},
{
label: "服务方",
columnName: "serviceShowName",
align: "center",
width: "120",
options: [],
},
{
label: "服务时间",
columnName: "wantServiceTime",
align: "center",
width: "180",
options: [],
},
],
4 years ago
customerId: "",
reportTime: "",
serviceTime: "",
finishServiceTime: "",
searchForm: {
4 years ago
gridId: "",
categoryCode: "",
level: "",
demandUserName: "",
reportStartTime: "",
reportEndTime: "",
status: "",
serviceType: "",
serverId: "",
wantServiceStartTime: "",
wantServiceEndTime: "",
},
4 years ago
selectDemandUser: "",
form: {
4 years ago
gridId: "",
categoryCode: "",
parentCode: "",
content: "",
reportType: "",
reportUserName: "",
reportUserMobile: "",
reportTime: "",
wantServiceTime: "",
demandUserId: "",
demandUserName: "",
demandUserMobile: "",
},
rules: {
4 years ago
gridId: [
{ required: true, message: "所属网格不能为空", trigger: "blur" },
],
categoryCode: [
{ required: true, message: "需求分类不能为空", trigger: "blur" },
],
content: [
{ required: true, message: "需求内容不能为空", trigger: "blur" },
],
reportType: [
{ required: true, message: "上报类型不能为空", trigger: "blur" },
],
reportUserName: [
{ required: true, message: "上报人不能为空", trigger: "blur" },
],
reportUserMobile: [
{ required: true, message: "上报人手机号不能为空", trigger: "blur" },
],
reportTime: [
{ required: true, message: "上报时间不能为空", trigger: "blur" },
],
demandUserId: [
{ required: true, message: "需求人不能为空", trigger: "blur" },
],
wantServiceTime: [
{ required: true, message: "服务时间不能为空", trigger: "blur" },
],
serviceType: [
{ required: true, message: "服务方不能为空", trigger: "blur" },
],
serviceStartTime: [
{ required: true, message: "实际服务时间不能为空", trigger: "blur" },
],
score: [{ required: true, message: "评分不能为空", trigger: "blur" }],
4 years ago
// finishDesc: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
4 years ago
finishResult: [
{ required: true, message: "完成情况不能为空", trigger: "blur" },
],
},
4 years ago
visitableInfo: false,
currDemandId: "",
infoAddType: "look",
3 years ago
detailShow: false
4 years ago
};
},
4 years ago
computed: {
4 years ago
...mapGetters(["clientHeight", "iframeHeight"]),
3 years ago
tableHeight () {
4 years ago
const h = this.clientHeight - this.searchH - 280 + this.iframeHeigh;
const _h = this.clientHeight - 280 - this.searchH;
return this.$store.state.inIframe ? h : _h;
},
4 years ago
},
3 years ago
async created () {
4 years ago
this.customerId = localStorage.getItem("customerId");
this.getTableData();
this.getDemandOptions();
this.getDictOptions();
setTimeout(() => {
4 years ago
this.getGridList("query");
this.getGridList("addorupdate");
}, 200);
this.pageLoading = true;
},
3 years ago
mounted () {
4 years ago
this.$nextTick(() => {
4 years ago
this.searchH = this.$refs.searchCard.$el.offsetHeight;
console.log("tableHeight", this.tableHeight);
});
4 years ago
},
methods: {
3 years ago
handleSizeChange (val) {
4 years ago
console.log(`每页 ${val}`);
this.pageSize = val;
this.getTableData();
},
3 years ago
handleCurrentChange (val) {
4 years ago
console.log(`当前页: ${val}`);
this.currentPage = val;
this.getTableData();
},
3 years ago
handleFilterSpan (row, item) {
4 years ago
let _val = "";
if (item.options && item.options.length > 0) {
item.options.forEach((n) => {
4 years ago
if (n.value === row[item.columnName]) _val = n.label;
});
}
4 years ago
return _val || row[item.columnName];
},
3 years ago
filterEdit (id) {
4 years ago
const { user } = this.$store.state;
return id === user.agencyId;
},
3 years ago
resetForm (formName) {
4 years ago
this.searchForm.reportStartTime = "";
this.searchForm.reportEndTime = "";
this.searchForm.wantServiceStartTime = "";
this.searchForm.wantServiceEndTime = "";
this.searchForm.categoryCode = "";
this.searchForm.level = "";
this.reportTime = "";
this.serviceTime = "";
this.$refs[formName].resetFields();
this.handleSearch();
},
3 years ago
handleCateCHange (val) {
4 years ago
console.log("val", val);
this.searchForm.categoryCode = val[1] || val[0];
this.searchForm.level = val.length;
},
3 years ago
handleCateSlect (val) {
4 years ago
console.log("val", val);
if (val.length === 1) {
4 years ago
this.demandOptions.forEach((item) => {
if (item.value == val[0]) this.form.parentCode = item.pvalue;
});
this.form.categoryCode = val[0];
} else {
4 years ago
this.form.parentCode = val[0];
this.form.categoryCode = val[1];
}
},
3 years ago
handleDemandChange (val) {
4 years ago
console.log("val", val, this.selectDemandUser);
this.selectDemandUser = val.label;
this.form.demandUserName = val.demandUserName;
this.form.demandUserMobile = val.demandUserMobile;
this.form.demandUserId = val.demandUserId;
},
3 years ago
handleSearch (val) {
4 years ago
console.log("searchhh--", val);
this.currentPage = 1;
if (Array.isArray(this.reportTime) && this.reportTime.length > 0) {
4 years ago
this.searchForm.reportStartTime = this.reportTime[0];
this.searchForm.reportEndTime = this.reportTime[1];
}
if (Array.isArray(this.serviceTime) && this.serviceTime.length > 0) {
4 years ago
this.searchForm.wantServiceStartTime = this.serviceTime[0];
this.searchForm.wantServiceEndTime = this.serviceTime[1];
}
4 years ago
this.getTableData();
},
3 years ago
handelBlurServiceTime (val) {
4 years ago
console.log("val", val);
4 years ago
if (val.length > 0) {
4 years ago
this.form.serviceStartTime = val[0];
this.form.serviceEndTime = val[1];
}
},
3 years ago
handleServiceChange (type, val) {
4 years ago
if (val === "social_org") {
if (type === "add") this.getServiceuserList(val, "add_demand");
else this.getServiceuserList(val, "query_demand");
} else this.getServiceuserList(val, "");
},
3 years ago
handleGridChange (val) {
4 years ago
this.getDemandUserList();
},
3 years ago
handleAdd (addType) {
4 years ago
this.addType = addType;
this.dialogVisible = true;
},
3 years ago
handlerCancle () {
// this.form.categoryCode = ''
// this.form.parentCode = ''
// this.form.demandUserName = ''
// this.form.demandUserMobile = ''
// this.form.demandUserId = ''
4 years ago
this.$delete(this.form, "demandRecId");
this.selectDemandUser = "";
this.finishServiceTime = "";
for (const n in this.form) {
this.form[n] = "";
}
4 years ago
this.disabled = false;
// this.$refs.ruleForm.resetFields()
4 years ago
this.dialogVisible = false;
},
3 years ago
async formatRowForm (row, addType, disabled) {
4 years ago
this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] };
this.addType = addType;
if (disabled) {
// await this.getGridList('query', row.agencyId)
4 years ago
this.disabled = disabled;
}
4 years ago
if (addType == "look") {
this.finishServiceTime =
(row.serviceStartTime && [
row.serviceStartTime,
row.serviceEndTime,
]) ||
"";
}
4 years ago
if (addType == "finish") {
if (row.serviceStartTime)
this.finishServiceTime = [row.serviceStartTime, row.serviceEndTime];
this.form.finishResult = "resolved";
this.form.score = 5;
4 years ago
}
4 years ago
if (addType == "appoint" && row.serviceType) {
const type = row.serviceType == "social_org" ? "add_demand" : "";
await this.getServiceuserList(row.serviceType, type);
}
4 years ago
if (addType == "edit") {
await this.getDemandUserList();
this.demandOptions.forEach((item) => {
if (item.value === row.categoryCode)
this.form.categoryCode = [row.categoryCode];
});
this.demandUserList.forEach((item) => {
if (item.demandUserId == row.demandUserId)
this.selectDemandUser = item.label;
});
}
4 years ago
this.dialogVisible = true;
},
3 years ago
async handleLook (row, type) {
3 years ago
this.detailShow = true
console.log('row', row)
3 years ago
this.$nextTick(() => {
this.$refs.ref_form_detail.initForm(row)
})
// await this.formatRowForm(row, type, true);
},
3 years ago
detailFormCancle () {
this.detailShow = false
},
3 years ago
async handleAppoint (row, type) {
4 years ago
await this.formatRowForm(row, type, true);
},
3 years ago
async handleFinish (row, type) {
4 years ago
await this.formatRowForm(row, type, true);
},
3 years ago
async handleEdit (row, type) {
4 years ago
await this.formatRowForm(row, type, false);
// this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] }
// this.addType = addType
// this.demandOptions.forEach(item => {
// if (item.value === row.categoryCode) this.form.categoryCode = [row.categoryCode]
// })
// await this.getDemandUserList()
// this.demandUserList.forEach(item => {
// if (item.demandUserId == row.demandUserId) this.selectDemandUser = item
// })
// console.log('selectDemandUser', this.selectDemandUser)
// this.dialogVisible = true
},
3 years ago
formatRowForm2 (row, type) {
4 years ago
this.visitableInfo = true;
this.currDemandId = row.demandRecId;
this.infoAddType = type;
},
3 years ago
async addNew () {
const _form = {
4 years ago
...this.form,
};
await this.$http
4 years ago
.post("/heart/userdemand/add", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.handlerCancle();
this.getTableData();
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.btnLoading = false;
},
3 years ago
async appointAjax () {
const _form = {
demandRecId: this.form.demandRecId,
serviceType: this.form.serviceType,
4 years ago
serverId: this.form.serverId,
};
await this.$http
4 years ago
.post("/heart/userdemand/assign", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.handlerCancle();
this.getTableData();
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.btnLoading = false;
},
3 years ago
async finishAjax () {
4 years ago
const { reportType, serviceShowFlag, serviceType } = this.form;
const _form = {
demandRecId: this.form.demandRecId,
serviceStartTime: this.form.serviceStartTime,
serviceEndTime: this.form.serviceEndTime,
4 years ago
finishResult: reportType == "self_help" ? "" : this.form.finishResult,
finishDesc: reportType == "self_help" ? "" : this.form.finishDesc,
serviceId: this.form.serviceId,
4 years ago
score: reportType == "self_help" ? 0 : this.form.score,
};
await this.$http
4 years ago
.post("/heart/userdemand/finish", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.handlerCancle();
this.getTableData();
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.btnLoading = false;
},
3 years ago
async editCate () {
4 years ago
const categoryCode = this.form.categoryCode;
if (Array.isArray(categoryCode)) {
if (categoryCode.length === 1) {
4 years ago
this.demandOptions.forEach((item) => {
if (item.value == categoryCode[0])
this.form.parentCode = item.pvalue;
});
this.form.categoryCode = categoryCode[0];
} else {
4 years ago
this.form.parentCode = categoryCode[0];
this.form.categoryCode = categoryCode[1];
}
}
4 years ago
const _form = {
4 years ago
...this.form,
};
await this.$http
4 years ago
.post("/heart/userdemand/update", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.handlerCancle();
this.getTableData();
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.btnLoading = false;
},
3 years ago
handleSUbmit () {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
4 years ago
this.btnLoading = true;
if (this.addType == "add") this.addNew();
else if (this.addType == "edit") this.editCate();
else if (this.addType == "appoint") this.appointAjax();
else if (this.addType == "finish") this.finishAjax();
} else {
4 years ago
console.log("error submit!!");
return false;
}
});
},
3 years ago
handleDel (row) {
let params = {
4 years ago
demandRecId: row.demandRecId,
};
console.log("row1", row);
this.$http
4 years ago
.post("/heart/userdemand/cancel", params)
.then(({ data: res }) => {
4 years ago
console.log("row2", row);
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
console.log("row3", row);
this.$message.success("取消成功");
this.getTableData();
}
})
.catch((err) => {
4 years ago
console.log("row4", err);
return this.$message.error("网络错误");
});
},
3 years ago
getTreeData (data) {
4 years ago
if (!Array.isArray(data)) return [];
let arr = data.map((item) => {
let _item = {};
if (item.children) {
4 years ago
if (item.children.length === 0)
_item = { ...item, children: undefined };
else _item = { ...item, children: this.getTreeData(item.children) };
} else {
4 years ago
_item = { ...item };
}
4 years ago
return _item;
});
return arr;
},
3 years ago
getFlagData (data, flag) {
4 years ago
if (!Array.isArray(data)) return [];
let arr1 = data.filter((item) => item[flag]);
let arr2 = arr1.map((item) => {
if (item.children)
return { ...item, children: this.getFlagData(item.children, flag) };
else return item;
});
// console.log('arrr-oppp', arr2)
4 years ago
return arr2;
},
3 years ago
async getGridList (type, agencyId) {
4 years ago
const { user } = await this.$store.state;
console.log("user---ppp", user);
// addorupdate query
await this.$http
4 years ago
.post("/gov/org/customergrid/gridoption", {
agencyId: agencyId || user.agencyId,
purpose: type,
})
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
console.log("获取查询详情成功", res.data);
if (type === "query") this.optionsG = res.data;
else this.optionsEditG = res.data;
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
},
3 years ago
async getDemandUserList () {
4 years ago
const { user } = await this.$store.state;
console.log("user---ppp", user);
const params = {
agencyId: user.agencyId,
gridId: this.form.gridId,
4 years ago
name: "",
};
// addorupdate
await this.$http
4 years ago
.post("/epmetuser/icresiuser/demandusers", params)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
console.log("获取查询详情成功", res.data);
this.demandUserList = res.data;
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
},
3 years ago
async getDemandOptions () {
this.$http
4 years ago
.post("/heart/icresidemanddict/demandoption")
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.searchdemandOptions = this.getTreeData(res.data);
this.demandOptions = this.getFlagData(
this.getTreeData(res.data),
"usableFlag"
);
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
},
3 years ago
async getServiceuserList (serviceType, query) {
4 years ago
if (!serviceType) return false;
const { demandUserId } = this.form;
const params = {
4 years ago
serviceName: "",
serviceType: serviceType,
4 years ago
queryPurpose: query,
};
await this.$http
4 years ago
.post("/heart/userdemand/servicelist", params)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.serviceOptiondList = res.data.filter(
(item) => item.value != demandUserId
);
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
},
3 years ago
async getDictOptions () {
this.$http
4 years ago
.post("/sys/dict/data/dictlist", { dictType: "user_demand_status" })
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.statusOptions = res.data;
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.$http
4 years ago
.post("/sys/dict/data/dictlist", {
dictType: "user_demand_report_type",
})
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.reportOptions =
res.data && res.data.filter((item) => item.value != "self_help");
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.$http
4 years ago
.post("/sys/dict/data/dictlist", {
dictType: "user_demand_service_type",
})
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.serviceOptions = res.data;
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
},
3 years ago
async getTableData () {
4 years ago
this.tableLoading = true;
let params = {
...this.searchForm,
pageNo: this.currentPage,
4 years ago
pageSize: this.pageSize,
};
await this.$http
4 years ago
.post("/heart/userdemand/pagelist", params)
.then(({ data: res }) => {
if (res.code !== 0) {
4 years ago
return this.$message.error(res.msg);
} else {
4 years ago
this.tableData = res.data.list;
this.total = res.data.total;
}
})
.catch(() => {
4 years ago
return this.$message.error("网络错误");
});
this.tableLoading = false;
},
},
};
</script>
<style lang="scss" scoped>
4 years ago
@import "@/assets/scss/buttonstyle.scss";
.resi-container .resi-card-table {
::v-deep .el-table th {
color: #fff;
background-color: rgba(33, 149, 254, 1);
// border-right: 1px solid rgba(33, 149, 254, 1);
}
}
.resi-table {
::v-deep .el-button--text {
text-decoration: underline;
}
::v-deep .btn-color-del {
margin: 0 10px;
color: rgba(213, 16, 16, 1);
}
::v-deep .btn-color-edit {
color: rgba(0, 167, 169, 1);
}
}
.form-wr {
.input-width {
width: 260px;
&-small {
width: 160px;
}
&-middle {
width: 200px;
}
&-min {
min-width: 260px;
}
}
.input-width-textarea {
width: 400px;
}
.form-score {
::v-deep .el-rate {
margin-top: 8px;
4 years ago
}
}
}
</style>
<style lang="scss" scoped>
.resi-row-btn {
display: flex;
margin-bottom: 13px;
::v-deep .el-button {
// margin-left: 10px;
border: 0;
}
::v-deep .el-select {
margin-right: 10px;
}
.el-button--success {
background: rgba(34, 193, 195, 1);
}
}
.avatar-uploader {
4 years ago
::v-deep .el-upload {
cursor: pointer;
position: relative;
overflow: hidden;
}
.el-upload:hover {
4 years ago
border-color: #409eff;
}
.avatar {
width: 70px;
height: 70px;
display: block;
}
.avatar-uploader-icon {
border: 1px dashed #d9d9d9;
border-radius: 6px;
font-size: 28px;
color: #8c939d;
width: 70px;
height: 70px;
line-height: 70px;
text-align: center;
}
}
.resi-btns {
margin-top: 20px;
text-align: center;
}
</style>