diff --git a/src/views/modules/communityService/measure/index.vue b/src/views/modules/communityService/measure/index.vue
index 509e0d99..65d05927 100644
--- a/src/views/modules/communityService/measure/index.vue
+++ b/src/views/modules/communityService/measure/index.vue
@@ -2,15 +2,27 @@
-
+
-
+
+ :value="item.value"
+ >
@@ -20,7 +32,8 @@
:options="searchdemandOptions"
:props="{ checkStrictly: true }"
clearable
- @change="handleCateCHange">
+ @change="handleCateCHange"
+ >
-
+
-
-
+
+ :value="item.value"
+ >
@@ -55,31 +77,43 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
- clearable="">
+ clearable=""
+ >
-
-
-
+
+ :value="item.value"
+ >
-
+
+ :value="item.value"
+ >
@@ -92,23 +126,25 @@
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
- clearable>
+ clearable
+ >
查询
- 重置
-
+ 重置
+
-
新增需求
-
+
指派
-
-
+ >指派
+
+
完成情况
+ >完成情况
完成情况
+ >完成情况
编辑
+ v-if="scope.row.status === 'pending'"
+ @click="handleEdit(scope.row, 'edit')"
+ type="text"
+ size="small"
+ class="btn-color-edit"
+ >编辑
查看
-
@@ -215,32 +272,57 @@
:close-on-click-modal="false"
:before-close="handlerCancle"
>
-
+
-
+
-
+
+ :value="item.value"
+ >
-
+
+ @change="handleCateSlect"
+ >
-
-
+
+
+ :value="item.value"
+ >
-
+
-
+
+ placeholder="选择日期时间"
+ >
-
-
+
+ v-model="selectDemandUser"
+ class="input-width"
+ filterable
+ :disabled="disabled"
+ placeholder="请选择"
+ clearable
+ @change="handleDemandChange"
+ >
+ :value="item"
+ >
@@ -306,61 +420,88 @@
type="datetime"
class="input-width"
clearable
- :disabled="disabled"
+ :disabled="disabled"
value-format="yyyy-MM-dd HH:mm:ss"
- placeholder="选择日期时间">
+ placeholder="选择日期时间"
+ >
-
+
-
+
-
+
-
+
+ :value="item.value"
+ >
-
-
+
+ :value="item.value"
+ >
-
+
{{ form.cancelTime }}
-
-
+
+ >
- 已解决
- 未解决
+ 已解决
+ 未解决
-
+
-
+
-
+
+ >
-
- {{ addType != 'look' ? '取消' : '关闭'}}
+ {{
+ addType != "look" ? "取消" : "关闭"
+ }}
-
@@ -441,51 +598,59 @@ export default {
pageSize: 20,
total: null,
tableData: [],
- addLevel: '1',
- addType: 'add',
- value: '',
+ addLevel: "1",
+ addType: "add",
+ value: "",
statusOptions: [
{
- label: '待处理',
- value: 'pending'
- }, {
- label: '已取消',
- value: 'canceled'
- }, {
- label: '已指派',
- value: 'assigned'
- }, {
- label: '已接单',
- value: 'have_order'
- }, {
- label: '已完成',
- value: 'finished'
- }
+ label: "待处理",
+ value: "pending",
+ },
+ {
+ label: "已取消",
+ value: "canceled",
+ },
+ {
+ label: "已指派",
+ value: "assigned",
+ },
+ {
+ label: "已接单",
+ value: "have_order",
+ },
+ {
+ label: "已完成",
+ value: "finished",
+ },
],
serviceOptions: [
{
- label: '志愿者',
- value: 'volunteer'
- }, {
- label: '社会组织',
- value: 'social_org'
- }, {
- label: '社区自组织',
- value: 'community_org'
- }, {
- label: '区域党建单位',
- value: 'party_unit'
- }
+ label: "志愿者",
+ value: "volunteer",
+ },
+ // {
+ // label: '社会组织',
+ // value: 'social_org'
+ // },
+ {
+ label: "社区自组织",
+ value: "community_org",
+ },
+ {
+ label: "区域党建单位",
+ value: "party_unit",
+ },
],
serviceOptiondList: [],
options: [
{
- label: '是',
- value: 1
- },{
- label: '否',
- value: 2
- }
+ label: "是",
+ value: 1,
+ },
+ {
+ label: "否",
+ value: 2,
+ },
],
reportOptions: [],
demandOptions: [],
@@ -495,257 +660,293 @@ export default {
optionsEditG: [],
tableHeader: [
{
- label: '状态',
- align: 'center',
- columnName: 'statusName',
- width: '120',
+ label: "状态",
+ align: "center",
+ columnName: "statusName",
+ width: "120",
options: [
{
- 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',
+ 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: [
{
- 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: []
- }
+ 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: [],
+ },
],
- customerId: '',
- reportTime: '',
- serviceTime: '',
- finishServiceTime: '',
+ customerId: "",
+ reportTime: "",
+ serviceTime: "",
+ finishServiceTime: "",
searchForm: {
- gridId: '',
- categoryCode: '',
- level: '',
- demandUserName: '',
- reportStartTime: '',
- reportEndTime: '',
- status: '',
- serviceType: '',
- serverId: '',
- wantServiceStartTime: '',
- wantServiceEndTime: ''
+ gridId: "",
+ categoryCode: "",
+ level: "",
+ demandUserName: "",
+ reportStartTime: "",
+ reportEndTime: "",
+ status: "",
+ serviceType: "",
+ serverId: "",
+ wantServiceStartTime: "",
+ wantServiceEndTime: "",
},
- selectDemandUser: '',
+ selectDemandUser: "",
form: {
- gridId: '',
- categoryCode: '',
- parentCode: '',
- content: '',
- reportType: '',
- reportUserName: '',
- reportUserMobile: '',
- reportTime: '',
- wantServiceTime: '',
- demandUserId: '',
- demandUserName: '',
- demandUserMobile: ''
+ gridId: "",
+ categoryCode: "",
+ parentCode: "",
+ content: "",
+ reportType: "",
+ reportUserName: "",
+ reportUserMobile: "",
+ reportTime: "",
+ wantServiceTime: "",
+ demandUserId: "",
+ demandUserName: "",
+ demandUserMobile: "",
},
rules: {
- 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' }],
+ 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" }],
// finishDesc: [{ required: true, message: '备注不能为空', trigger: 'blur' }],
- finishResult: [{ required: true, message: '完成情况不能为空', trigger: 'blur' }],
- }
- }
+ finishResult: [
+ { required: true, message: "完成情况不能为空", trigger: "blur" },
+ ],
+ },
+ };
},
async created() {
- this.customerId = localStorage.getItem('customerId')
-
- this.getTableData()
- this.getDemandOptions()
- this.getDictOptions()
+ this.customerId = localStorage.getItem("customerId");
+
+ this.getTableData();
+ this.getDemandOptions();
+ this.getDictOptions();
setTimeout(() => {
- this.getGridList('query')
- this.getGridList('addorupdate')
- }, 200)
- this.pageLoading = true
- },
- mounted() {
+ this.getGridList("query");
+ this.getGridList("addorupdate");
+ }, 200);
+ this.pageLoading = true;
},
+ mounted() {},
methods: {
handleSizeChange(val) {
- console.log(`每页 ${val} 条`)
- this.pageSize = val
- this.getTableData()
+ console.log(`每页 ${val} 条`);
+ this.pageSize = val;
+ this.getTableData();
},
handleCurrentChange(val) {
- console.log(`当前页: ${val}`)
- this.currentPage = val
- this.getTableData()
+ console.log(`当前页: ${val}`);
+ this.currentPage = val;
+ this.getTableData();
},
handleFilterSpan(row, item) {
- let _val = ''
+ let _val = "";
if (item.options && item.options.length > 0) {
item.options.forEach((n) => {
- if (n.value === row[item.columnName]) _val = n.label
- })
+ if (n.value === row[item.columnName]) _val = n.label;
+ });
}
- return _val || row[item.columnName]
+ return _val || row[item.columnName];
},
filterEdit(id) {
- const { user } = this.$store.state
- return id === user.agencyId
+ const { user } = this.$store.state;
+ return id === user.agencyId;
},
resetForm(formName) {
- 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()
+ 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();
},
handleCateCHange(val) {
- console.log('val', val)
- this.searchForm.categoryCode = val[1] || val[0]
- this.searchForm.level = val.length
+ console.log("val", val);
+ this.searchForm.categoryCode = val[1] || val[0];
+ this.searchForm.level = val.length;
},
handleCateSlect(val) {
- console.log('val', val)
+ console.log("val", val);
if (val.length === 1) {
- this.demandOptions.forEach(item => {
- if (item.value == val[0]) this.form.parentCode = item.pvalue
- })
- this.form.categoryCode = val[0]
+ this.demandOptions.forEach((item) => {
+ if (item.value == val[0]) this.form.parentCode = item.pvalue;
+ });
+ this.form.categoryCode = val[0];
} else {
- this.form.parentCode = val[0]
- this.form.categoryCode = val[1]
+ this.form.parentCode = val[0];
+ this.form.categoryCode = val[1];
}
-
},
handleDemandChange(val) {
- 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
+ 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;
},
handleSearch(val) {
- console.log('searchhh--', val)
- this.currentPage = 1
+ console.log("searchhh--", val);
+ this.currentPage = 1;
if (Array.isArray(this.reportTime) && this.reportTime.length > 0) {
- this.searchForm.reportStartTime = this.reportTime[0]
- this.searchForm.reportEndTime = this.reportTime[1]
+ this.searchForm.reportStartTime = this.reportTime[0];
+ this.searchForm.reportEndTime = this.reportTime[1];
}
if (Array.isArray(this.serviceTime) && this.serviceTime.length > 0) {
- this.searchForm.wantServiceStartTime = this.serviceTime[0]
- this.searchForm.wantServiceEndTime = this.serviceTime[1]
+ this.searchForm.wantServiceStartTime = this.serviceTime[0];
+ this.searchForm.wantServiceEndTime = this.serviceTime[1];
}
- this.getTableData()
+ this.getTableData();
},
handelBlurServiceTime(val) {
- console.log('val', val)
+ console.log("val", val);
if (val.length > 0) {
- this.form.serviceStartTime = val[0]
- this.form.serviceEndTime = val[1]
+ this.form.serviceStartTime = val[0];
+ this.form.serviceEndTime = val[1];
}
-
},
handleServiceChange(type, val) {
- if (val === 'social_org') {
- if (type === 'add') this.getServiceuserList(val, 'add_demand')
- else this.getServiceuserList(val, 'query_demand')
- } else this.getServiceuserList(val, '')
-
+ if (val === "social_org") {
+ if (type === "add") this.getServiceuserList(val, "add_demand");
+ else this.getServiceuserList(val, "query_demand");
+ } else this.getServiceuserList(val, "");
},
handleGridChange(val) {
- this.getDemandUserList()
+ this.getDemandUserList();
},
handleAdd(addType) {
- this.addType = addType
- this.dialogVisible = true
+ this.addType = addType;
+ this.dialogVisible = true;
},
handlerCancle() {
// this.form.categoryCode = ''
@@ -753,60 +954,68 @@ export default {
// this.form.demandUserName = ''
// this.form.demandUserMobile = ''
// this.form.demandUserId = ''
- this.$delete(this.form, 'demandRecId')
- this.selectDemandUser = ''
- this.finishServiceTime = ''
- for(const n in this.form) {
- this.form[n] = ''
+ this.$delete(this.form, "demandRecId");
+ this.selectDemandUser = "";
+ this.finishServiceTime = "";
+ for (const n in this.form) {
+ this.form[n] = "";
}
- this.disabled = false
+ this.disabled = false;
// this.$refs.ruleForm.resetFields()
- this.dialogVisible = false
+ this.dialogVisible = false;
},
async formatRowForm(row, addType, disabled) {
- this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] }
- this.addType = addType
-
+ this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] };
+ this.addType = addType;
+
if (disabled) {
// await this.getGridList('query', row.agencyId)
- this.disabled = disabled
+ this.disabled = disabled;
}
- if (addType == 'look') {
- this.finishServiceTime = row.serviceStartTime && [row.serviceStartTime, row.serviceEndTime] || ''
+ if (addType == "look") {
+ this.finishServiceTime =
+ (row.serviceStartTime && [
+ row.serviceStartTime,
+ row.serviceEndTime,
+ ]) ||
+ "";
}
- if (addType == 'finish') {
- if (row.serviceStartTime) this.finishServiceTime = [row.serviceStartTime, row.serviceEndTime]
-
- this.form.finishResult = 'resolved'
- this.form.score = 5
+ if (addType == "finish") {
+ if (row.serviceStartTime)
+ this.finishServiceTime = [row.serviceStartTime, row.serviceEndTime];
+
+ this.form.finishResult = "resolved";
+ this.form.score = 5;
}
- if (addType == 'appoint' && row.serviceType) {
- const type = row.serviceType == 'social_org' ? 'add_demand' : ''
- await this.getServiceuserList(row.serviceType, type)
+ if (addType == "appoint" && row.serviceType) {
+ const type = row.serviceType == "social_org" ? "add_demand" : "";
+ await this.getServiceuserList(row.serviceType, type);
}
- 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
- })
+ 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;
+ });
}
-
- this.dialogVisible = true
+
+ this.dialogVisible = true;
},
async handleLook(row, type) {
- await this.formatRowForm(row, type, true)
+ await this.formatRowForm(row, type, true);
},
async handleAppoint(row, type) {
- await this.formatRowForm(row, type, true)
+ await this.formatRowForm(row, type, true);
},
async handleFinish(row, type) {
- await this.formatRowForm(row, type, true)
+ await this.formatRowForm(row, type, true);
},
async handleEdit(row, type) {
- await this.formatRowForm(row, type, false)
+ await this.formatRowForm(row, type, false);
// this.form = { ...row, categoryCode: [row.parentCode, row.categoryCode] }
// this.addType = addType
// this.demandOptions.forEach(item => {
@@ -821,307 +1030,320 @@ export default {
},
async addNew() {
const _form = {
- ...this.form
- }
+ ...this.form,
+ };
await this.$http
- .post('/heart/userdemand/add', _form)
+ .post("/heart/userdemand/add", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.handlerCancle()
- this.getTableData()
- }
+ this.handlerCancle();
+ this.getTableData();
+ }
})
.catch(() => {
- return this.$message.error('网络错误')
- })
- this.btnLoading = false
+ return this.$message.error("网络错误");
+ });
+ this.btnLoading = false;
},
async appointAjax() {
const _form = {
demandRecId: this.form.demandRecId,
serviceType: this.form.serviceType,
- serverId: this.form.serverId
- }
+ serverId: this.form.serverId,
+ };
await this.$http
- .post('/heart/userdemand/assign', _form)
+ .post("/heart/userdemand/assign", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.handlerCancle()
- this.getTableData()
- }
+ this.handlerCancle();
+ this.getTableData();
+ }
})
.catch(() => {
- return this.$message.error('网络错误')
- })
- this.btnLoading = false
+ return this.$message.error("网络错误");
+ });
+ this.btnLoading = false;
},
async finishAjax() {
- const { reportType, serviceShowFlag, serviceType } = this.form
+ const { reportType, serviceShowFlag, serviceType } = this.form;
const _form = {
demandRecId: this.form.demandRecId,
serviceStartTime: this.form.serviceStartTime,
serviceEndTime: this.form.serviceEndTime,
- finishResult: reportType == 'self_help' ? '' : this.form.finishResult,
- finishDesc: reportType == 'self_help' ? '' : this.form.finishDesc,
+ finishResult: reportType == "self_help" ? "" : this.form.finishResult,
+ finishDesc: reportType == "self_help" ? "" : this.form.finishDesc,
serviceId: this.form.serviceId,
- score: reportType == 'self_help' ? 0 : this.form.score
- }
+ score: reportType == "self_help" ? 0 : this.form.score,
+ };
await this.$http
- .post('/heart/userdemand/finish', _form)
+ .post("/heart/userdemand/finish", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.handlerCancle()
- this.getTableData()
- }
+ this.handlerCancle();
+ this.getTableData();
+ }
})
.catch(() => {
- return this.$message.error('网络错误')
- })
- this.btnLoading = false
+ return this.$message.error("网络错误");
+ });
+ this.btnLoading = false;
},
async editCate() {
- const categoryCode = this.form.categoryCode
+ const categoryCode = this.form.categoryCode;
if (Array.isArray(categoryCode)) {
if (categoryCode.length === 1) {
- this.demandOptions.forEach(item => {
- if (item.value == categoryCode[0]) this.form.parentCode = item.pvalue
- })
- this.form.categoryCode = categoryCode[0]
+ this.demandOptions.forEach((item) => {
+ if (item.value == categoryCode[0])
+ this.form.parentCode = item.pvalue;
+ });
+ this.form.categoryCode = categoryCode[0];
} else {
- this.form.parentCode = categoryCode[0]
- this.form.categoryCode = categoryCode[1]
+ this.form.parentCode = categoryCode[0];
+ this.form.categoryCode = categoryCode[1];
}
}
-
+
const _form = {
- ...this.form
- }
+ ...this.form,
+ };
await this.$http
- .post('/heart/userdemand/update', _form)
+ .post("/heart/userdemand/update", _form)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.handlerCancle()
- this.getTableData()
- }
+ this.handlerCancle();
+ this.getTableData();
+ }
})
.catch(() => {
- return this.$message.error('网络错误')
- })
- this.btnLoading = false
+ return this.$message.error("网络错误");
+ });
+ this.btnLoading = false;
},
handleSUbmit() {
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
- 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()
-
+ 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 {
- console.log('error submit!!');
+ console.log("error submit!!");
return false;
}
});
-
},
handleDel(row) {
let params = {
- demandRecId: row.demandRecId
- }
- console.log('row1', row)
+ demandRecId: row.demandRecId,
+ };
+ console.log("row1", row);
this.$http
- .post('/heart/userdemand/cancel', params)
+ .post("/heart/userdemand/cancel", params)
.then(({ data: res }) => {
- console.log('row2', row)
+ console.log("row2", row);
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- console.log('row3', row)
- this.$message.success('取消成功')
- this.getTableData()
+ console.log("row3", row);
+ this.$message.success("取消成功");
+ this.getTableData();
}
})
.catch((err) => {
- console.log('row4', err)
- return this.$message.error('网络错误')
- })
+ console.log("row4", err);
+ return this.$message.error("网络错误");
+ });
},
- getTreeData(data){
- if (!Array.isArray(data)) return []
- let arr = data.map(item => {
- let _item = {}
+ getTreeData(data) {
+ if (!Array.isArray(data)) return [];
+ let arr = data.map((item) => {
+ let _item = {};
if (item.children) {
- if (item.children.length === 0) _item = { ...item, children: undefined }
- else _item = { ...item, children: this.getTreeData(item.children)}
+ if (item.children.length === 0)
+ _item = { ...item, children: undefined };
+ else _item = { ...item, children: this.getTreeData(item.children) };
} else {
- _item = { ...item }
+ _item = { ...item };
}
- return _item
- })
- return arr
+ return _item;
+ });
+ return arr;
},
getFlagData(data, flag) {
- 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
- })
+ 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)
- return arr2
+ return arr2;
},
async getGridList(type, agencyId) {
- const { user } = await this.$store.state
- console.log('user---ppp', user)
+ const { user } = await this.$store.state;
+ console.log("user---ppp", user);
// addorupdate query
await this.$http
- .post('/gov/org/customergrid/gridoption', { agencyId: agencyId || user.agencyId, purpose: type })
+ .post("/gov/org/customergrid/gridoption", {
+ agencyId: agencyId || user.agencyId,
+ purpose: type,
+ })
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- console.log('获取查询详情成功', res.data)
-
- if (type === 'query') this.optionsG = res.data
- else this.optionsEditG = res.data
+ console.log("获取查询详情成功", res.data);
+
+ if (type === "query") this.optionsG = res.data;
+ else this.optionsEditG = res.data;
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
},
async getDemandUserList() {
- const { user } = await this.$store.state
- console.log('user---ppp', user)
+ const { user } = await this.$store.state;
+ console.log("user---ppp", user);
const params = {
agencyId: user.agencyId,
gridId: this.form.gridId,
- name: ''
- }
+ name: "",
+ };
// addorupdate
await this.$http
- .post('/epmetuser/icresiuser/demandusers', params)
+ .post("/epmetuser/icresiuser/demandusers", params)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- console.log('获取查询详情成功', res.data)
- this.demandUserList = res.data
+ console.log("获取查询详情成功", res.data);
+ this.demandUserList = res.data;
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
},
async getDemandOptions() {
this.$http
- .post('/heart/icresidemanddict/demandoption')
+ .post("/heart/icresidemanddict/demandoption")
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.searchdemandOptions = this.getTreeData(res.data)
- this.demandOptions = this.getFlagData(this.getTreeData(res.data), 'usableFlag')
+ this.searchdemandOptions = this.getTreeData(res.data);
+ this.demandOptions = this.getFlagData(
+ this.getTreeData(res.data),
+ "usableFlag"
+ );
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
},
async getServiceuserList(serviceType, query) {
- if (!serviceType) return false
- const { demandUserId } = this.form
+ if (!serviceType) return false;
+ const { demandUserId } = this.form;
const params = {
- serviceName: '',
+ serviceName: "",
serviceType: serviceType,
- queryPurpose: query
- }
+ queryPurpose: query,
+ };
await this.$http
- .post('/heart/userdemand/servicelist', params)
+ .post("/heart/userdemand/servicelist", params)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.serviceOptiondList = res.data.filter(item => item.value != demandUserId)
+ this.serviceOptiondList = res.data.filter(
+ (item) => item.value != demandUserId
+ );
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
},
async getDictOptions() {
this.$http
- .post('/sys/dict/data/dictlist', { dictType: 'user_demand_status' })
+ .post("/sys/dict/data/dictlist", { dictType: "user_demand_status" })
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.statusOptions = res.data
+ this.statusOptions = res.data;
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
this.$http
- .post('/sys/dict/data/dictlist', { dictType: 'user_demand_report_type' })
+ .post("/sys/dict/data/dictlist", {
+ dictType: "user_demand_report_type",
+ })
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.reportOptions = res.data && res.data.filter(item => item.value != 'self_help')
+ this.reportOptions =
+ res.data && res.data.filter((item) => item.value != "self_help");
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
this.$http
- .post('/sys/dict/data/dictlist', { dictType: 'user_demand_service_type' })
+ .post("/sys/dict/data/dictlist", {
+ dictType: "user_demand_service_type",
+ })
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.serviceOptions = res.data
+ this.serviceOptions = res.data;
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
+ return this.$message.error("网络错误");
+ });
},
async getTableData() {
- this.tableLoading = true
+ this.tableLoading = true;
let params = {
...this.searchForm,
pageNo: this.currentPage,
- pageSize: this.pageSize
- }
+ pageSize: this.pageSize,
+ };
await this.$http
- .post('/heart/userdemand/pagelist', params)
+ .post("/heart/userdemand/pagelist", params)
.then(({ data: res }) => {
if (res.code !== 0) {
- return this.$message.error(res.msg)
+ return this.$message.error(res.msg);
} else {
- this.tableData = res.data.list
- this.total = res.data.total
+ this.tableData = res.data.list;
+ this.total = res.data.total;
}
})
.catch(() => {
- return this.$message.error('网络错误')
- })
- this.tableLoading = false
- }
-
- }
-}
+ return this.$message.error("网络错误");
+ });
+ this.tableLoading = false;
+ },
+ },
+};