4 changed files with 1500 additions and 41 deletions
@ -1,36 +1,41 @@ |
|||||
export function getItemByIdInCascader(arr, vals, idName, childName) { |
export function getItemByIdInCascader(arr, ids, idName, childName) { |
||||
let item = arr.find((v) => v[idName] == vals[0]); |
let item = arr.find((v) => v[idName] == ids[0]); |
||||
if (vals.length > 1) { |
if (ids.length > 1) { |
||||
return [ |
return [ |
||||
item, |
item, |
||||
...getItemByIdInCascader( |
...getItemByIdInCascader( |
||||
item[childName], |
item[childName], |
||||
vals.slice(1), |
ids.slice(1), |
||||
idName, |
idName, |
||||
childName |
childName |
||||
), |
), |
||||
]; |
]; |
||||
} else { |
} else { |
||||
return [item]; |
return [item]; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
export function collapse(arr, childName) { |
export function collapse(arr, childName) { |
||||
if (arr.length > 0) { |
if (arr.length > 0) { |
||||
let ret = [...arr]; |
let ret = [...arr]; |
||||
arr.forEach((element) => { |
arr.forEach((element) => { |
||||
let childs = element[childName]; |
let childs = element[childName]; |
||||
if (childs && Array.isArray(childs)) { |
if (childs && Array.isArray(childs)) { |
||||
ret.push(...collapse(childs, childName)); |
ret.push(...collapse(childs, childName)); |
||||
} |
} |
||||
}); |
}); |
||||
return ret; |
return ret; |
||||
} else { |
} else { |
||||
return []; |
return []; |
||||
} |
} |
||||
|
} |
||||
|
|
||||
|
export function getItemBySingleIdInCascader(arr, id, idName, childName) { |
||||
|
let collapseArr = collapse(arr); |
||||
|
return getItemByIdInCascader(collapseArr, [id], idName, childName); |
||||
} |
} |
||||
|
|
||||
export default { |
export default { |
||||
getItemByIdInCascader, |
getItemByIdInCascader, |
||||
collapse, |
collapse, |
||||
}; |
}; |
||||
|
@ -0,0 +1,391 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<base-page |
||||
|
ref="basePage" |
||||
|
:searchParams="searchParams" |
||||
|
:tableParams="tableParams" |
||||
|
:tableUrl="tableUrl" |
||||
|
:addUrl="addUrl" |
||||
|
:editUrl="editUrl" |
||||
|
:delUrl="delUrl" |
||||
|
:editAuth="editAuth" |
||||
|
:delAuth="delAuth" |
||||
|
:infoUrl="infoUrl" |
||||
|
:exportUrl="exportUrl" |
||||
|
:importUrl="importUrl" |
||||
|
:mubanUrl="mubanUrl" |
||||
|
:editParams="editParams" |
||||
|
:editFixedParams="editFixedParams" |
||||
|
:editElseRules="editElseRules" |
||||
|
:editConfig="editConfig" |
||||
|
:editParamsDiv="5" |
||||
|
:editBtnName="(item) => '修改'" |
||||
|
:formBtnFixed="true" |
||||
|
idName="id" |
||||
|
> |
||||
|
</base-page> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import basePage from "@/views/modules/cpts/base/index"; |
||||
|
import { getItemBySingleIdInCascader } from "@/utils/cascader"; |
||||
|
import dateFormat from "dai-js/tools/dateFormat.js"; |
||||
|
|
||||
|
const optionList = { |
||||
|
satisfication: [ |
||||
|
{ |
||||
|
label: "不满意", |
||||
|
value: -1, |
||||
|
}, |
||||
|
{ |
||||
|
label: "基本满意", |
||||
|
value: 0, |
||||
|
}, |
||||
|
{ |
||||
|
label: "非常满意", |
||||
|
value: 1, |
||||
|
}, |
||||
|
], |
||||
|
|
||||
|
status: [ |
||||
|
{ |
||||
|
label: "未办结", |
||||
|
value: "0", |
||||
|
}, |
||||
|
{ |
||||
|
label: "已办结", |
||||
|
value: "1", |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
|
||||
|
export default { |
||||
|
props: {}, |
||||
|
|
||||
|
data() { |
||||
|
return { |
||||
|
offlineShowed: false, |
||||
|
|
||||
|
draftBtnDisable: false, |
||||
|
|
||||
|
searchParams: [ |
||||
|
{ |
||||
|
field: "所属组织", |
||||
|
keyName: "orgId", |
||||
|
type: "cascader", |
||||
|
optionUrl: "/gov/org/customeragency/agencygridtree", |
||||
|
optionUrlParams: { |
||||
|
agencyId: this.$store.state.user.agencyId, |
||||
|
}, |
||||
|
optionList: [], |
||||
|
optionProps: { |
||||
|
multiple: false, |
||||
|
value: "agencyId", |
||||
|
label: "agencyName", |
||||
|
children: "subAgencyList", |
||||
|
checkStrictly: true, |
||||
|
emitPath: false, |
||||
|
}, |
||||
|
optionCook(obj) { |
||||
|
return [obj]; |
||||
|
}, |
||||
|
supKeys: ["orgType"], |
||||
|
supValues: [""], |
||||
|
handleChangeFn(val, item) { |
||||
|
const { optionList } = item; |
||||
|
if (val.length > 0) { |
||||
|
item["supValues"][0] = getItemBySingleIdInCascader( |
||||
|
optionList, |
||||
|
val, |
||||
|
"agencyId", |
||||
|
"subAgencyList" |
||||
|
)["level"]; |
||||
|
item["supValues"][0] = |
||||
|
item["supValues"][0] == "grid" |
||||
|
? "grid" |
||||
|
: "agency"; |
||||
|
} else { |
||||
|
item["supValues"][0] = ""; |
||||
|
} |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
field: "业务类型", |
||||
|
keyName: "categoryCode", |
||||
|
type: "select", |
||||
|
value: "", |
||||
|
multiple: false, |
||||
|
optionUrl: `/sys/dict/data/dictlist`, |
||||
|
optionUrlParams: { |
||||
|
dictType: "lingshan_office_hall_service_record", |
||||
|
}, |
||||
|
optionList: [], |
||||
|
}, |
||||
|
{ field: "事项说明", keyName: "content", type: "input" }, |
||||
|
{ |
||||
|
field: "满意度", |
||||
|
keyName: "satisfication", |
||||
|
type: "select", |
||||
|
multiple: false, |
||||
|
optionUrl: "", |
||||
|
optionUrlParams: {}, |
||||
|
optionList: optionList.satisfication, |
||||
|
}, |
||||
|
{ |
||||
|
field: "申请时间", |
||||
|
keyName: "applicantTime", |
||||
|
type: "date-range", |
||||
|
supKeys: ["applicantStartDate", "applicantEndDate"], |
||||
|
supValues: ["", ""], |
||||
|
}, |
||||
|
{ |
||||
|
field: "办结时间", |
||||
|
keyName: "closeTime", |
||||
|
type: "date-range", |
||||
|
supKeys: ["closeStartDate", "closeEndDate"], |
||||
|
supValues: ["", ""], |
||||
|
}, |
||||
|
{ |
||||
|
field: "状态", |
||||
|
keyName: "status", |
||||
|
value: "", |
||||
|
type: "select", |
||||
|
optionUrl: "", |
||||
|
optionUrlParams: {}, |
||||
|
optionList: optionList.status, |
||||
|
}, |
||||
|
], |
||||
|
|
||||
|
tableParams: [ |
||||
|
{ field: "序号", keyName: "", type: "no" }, |
||||
|
{ |
||||
|
field: "所属组织", |
||||
|
keyName: "applicantOrgName", |
||||
|
type: "text", |
||||
|
}, |
||||
|
{ field: "业务类型", keyName: "categoryName", type: "text" }, |
||||
|
{ field: "事项说明", keyName: "content", type: "text" }, |
||||
|
{ field: "申请人", keyName: "applicantName", type: "text" }, |
||||
|
{ field: "申请日期", keyName: "applicantTime", type: "text" }, |
||||
|
{ field: "办理人", keyName: "transactorName", type: "text" }, |
||||
|
{ field: "办理状态", keyName: "statusName", type: "text" }, |
||||
|
{ field: "办理日期", keyName: "closeTime", type: "text" }, |
||||
|
{ field: "满意度", keyName: "satisficationName", type: "text" }, |
||||
|
], |
||||
|
|
||||
|
tableUrl: "/heart/lingshanOfficeHallServiceRecord/page", |
||||
|
mubanUrl: "", |
||||
|
importUrl: "", |
||||
|
exportUrl: "/heart/lingshanOfficeHallServiceRecord/export", |
||||
|
|
||||
|
addUrl: "/heart/lingshanOfficeHallServiceRecord/save", |
||||
|
editUrl: "/heart/lingshanOfficeHallServiceRecord/update", |
||||
|
infoUrl: "/heart/lingshanOfficeHallServiceRecord/detail/", |
||||
|
delUrl: "/heart/lingshanOfficeHallServiceRecord/delete批量", |
||||
|
editAuth(item) { |
||||
|
return true; |
||||
|
}, |
||||
|
delAuth(item) { |
||||
|
return true; |
||||
|
}, |
||||
|
|
||||
|
editParams: [ |
||||
|
{ |
||||
|
field: "业务类型", |
||||
|
keyName: "categoryCode", |
||||
|
type: "select", |
||||
|
value: "", |
||||
|
multiple: false, |
||||
|
optionUrl: `/sys/dict/data/dictlist`, |
||||
|
optionUrlParams: { |
||||
|
dictType: "lingshan_office_hall_service_record", |
||||
|
}, |
||||
|
optionList: [], |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: "业务类型不能为空", |
||||
|
trigger: "blur", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "事项说明", |
||||
|
keyName: "content", |
||||
|
type: "textarea", |
||||
|
maxlength: 1000, |
||||
|
editDisabled: true, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: "事项说明不能为空", |
||||
|
trigger: "blur", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "申请人所属组织", |
||||
|
keyName: "applicantOrgId", |
||||
|
type: "cascader", |
||||
|
optionUrl: "/gov/org/customeragency/agencygridtree", |
||||
|
optionUrlParams: { |
||||
|
agencyId: this.$store.state.user.agencyId, |
||||
|
}, |
||||
|
optionList: [], |
||||
|
optionProps: { |
||||
|
multiple: false, |
||||
|
value: "agencyId", |
||||
|
label: "agencyName", |
||||
|
children: "subAgencyList", |
||||
|
checkStrictly: true, |
||||
|
emitPath: false, |
||||
|
}, |
||||
|
optionCook(obj) { |
||||
|
return [obj]; |
||||
|
}, |
||||
|
supKeys: ["applicantOrgType"], |
||||
|
supValues: [""], |
||||
|
handleChangeFn(val, item) { |
||||
|
const { optionList } = item; |
||||
|
if (val.length > 0) { |
||||
|
item["supValues"][0] = getItemBySingleIdInCascader( |
||||
|
optionList, |
||||
|
val, |
||||
|
"agencyId", |
||||
|
"subAgencyList" |
||||
|
)["level"]; |
||||
|
item["supValues"][0] = |
||||
|
item["supValues"][0] == "grid" |
||||
|
? "grid" |
||||
|
: "agency"; |
||||
|
} else { |
||||
|
item["supValues"][0] = ""; |
||||
|
} |
||||
|
}, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: "申请人所属组织不能为空", |
||||
|
trigger: "blur", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "申请人姓名", |
||||
|
keyName: "applicantName", |
||||
|
type: "input", |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "申请人电话", |
||||
|
keyName: "applicantMobile", |
||||
|
type: "input", |
||||
|
}, |
||||
|
{ |
||||
|
field: "申请人身份证号", |
||||
|
keyName: "applicantIdCard", |
||||
|
type: "input", |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "申请日期", |
||||
|
keyName: "applicantTime", |
||||
|
type: "date", |
||||
|
value: () => dateFormat(new Date(), "yyyy-MM-dd"), |
||||
|
pickerOptions: { |
||||
|
// disabledDate(time) { |
||||
|
// return time.getTime() > Date.now(); |
||||
|
// }, |
||||
|
}, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: "申请日期不能为空", |
||||
|
trigger: "blur", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "办理人", |
||||
|
keyName: "transactorName", |
||||
|
type: "input", |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: "办理人不能为空", |
||||
|
trigger: "blur", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "办理状态", |
||||
|
keyName: "status", |
||||
|
value: "", |
||||
|
type: "select", |
||||
|
optionUrl: "", |
||||
|
optionUrlParams: {}, |
||||
|
optionList: optionList.status, |
||||
|
rules: [ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: "办理状态不能为空", |
||||
|
trigger: "blur", |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "办结日期", |
||||
|
keyName: "closeTime", |
||||
|
type: "date", |
||||
|
value: () => dateFormat(new Date(), "yyyy-MM-dd"), |
||||
|
pickerOptions: { |
||||
|
// disabledDate(time) { |
||||
|
// return time.getTime() > Date.now(); |
||||
|
// }, |
||||
|
}, |
||||
|
}, |
||||
|
|
||||
|
{ |
||||
|
field: "满意度", |
||||
|
keyName: "satisfication", |
||||
|
type: "select", |
||||
|
multiple: false, |
||||
|
optionUrl: "", |
||||
|
optionUrlParams: {}, |
||||
|
optionList: optionList.satisfication, |
||||
|
}, |
||||
|
], |
||||
|
editFixedParams: { |
||||
|
type: "article", |
||||
|
}, |
||||
|
editElseRules: {}, |
||||
|
editConfig: { |
||||
|
confirmBtnName: "发布", |
||||
|
cookInfoFn(data) { |
||||
|
return data; |
||||
|
}, |
||||
|
|
||||
|
beforeSubmit(formType, fmData, that) { |
||||
|
return true; |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
}, |
||||
|
components: { basePage }, |
||||
|
computed: {}, |
||||
|
watch: {}, |
||||
|
|
||||
|
async mounted() {}, |
||||
|
|
||||
|
methods: {}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped></style> |
File diff suppressed because it is too large
Loading…
Reference in new issue