| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAllHouseHold } from "@/api/userHouse/list/houseHold" |
| | | import { getPersonPublicSelect } from "@/api/public" |
| | | import { getDetatils as householdDetail } from "@/api/userHouse/list/houseHold" |
| | | import { getList, remove, update, add, getGridWorkLog } from "@/api/grid/gridWorkLog" |
| | | import { getList as getHouseholdList, getDetatils as getHouseholdDetail } from "@/api/userHouse/list/houseHold" |
| | | import { mapGetters } from "vuex" |
| | |
| | | option: { |
| | | labelWidth: 120, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 210, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 280, |
| | | border: false, |
| | | //stripe:true, |
| | | index: true, |
| | |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | width: 120, |
| | | label: "走访类型", |
| | | prop: "type", |
| | | span: 12, |
| | | searchSpan: 4, |
| | | search: true, |
| | | searchLabelWidth: 76, |
| | | type: "select", |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=haveType", |
| | | dataType: "number", |
| | |
| | | value: 'id', |
| | | }, |
| | | dicData: [], |
| | | formatter: (row) => { |
| | | this.form.phone = row.phoneNumber |
| | | this.form.address = row.currentAddress |
| | | |
| | | return row.name |
| | | }, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | searchSpan: 4, |
| | | search: true, |
| | | }, |
| | | |
| | | { |
| | | width: 156, |
| | | overHidden: true, |
| | |
| | | display: false, |
| | | prop: "gridName", |
| | | }, |
| | | { |
| | | width: 144, |
| | | label: "走访时间", |
| | | prop: "workTime", |
| | | searchLabelWidth: 120, |
| | | type: "date", |
| | | row: true, |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入走访时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | | overHidden: true, |
| | |
| | | prop: "context", |
| | | type: "textarea", |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入走访内容", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | { |
| | |
| | | prop: "createUserName", |
| | | }, |
| | | |
| | | { |
| | | width: 144, |
| | | label: "走访时间", |
| | | prop: "workTime", |
| | | searchLabelWidth: 120, |
| | | type: "date", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入走访时间", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | |
| | | { |
| | | display: false, |
| | | width: 144, |
| | | label: "上报时间", |
| | | prop: "createTime", |
| | |
| | | }, |
| | | |
| | | watch: { |
| | | "form.householdId": { |
| | | handler (val) { |
| | | if (val) { |
| | | |
| | | householdDetail(val).then(res => { |
| | | let data = res.data.data |
| | | |
| | | this.form.phone = data.phoneNumber |
| | | this.form.address = data.currentAddress |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | 'form.personType': { |
| | | handler (newData) { |
| | | let householdIdColumn = this.findObject( |
| | |
| | | |
| | | methods: { |
| | | getUserList (param = '') { |
| | | let dicUrl = `/blade-household/household/selectHouseholdList?labelId=${param}&searchKey={{key}}` |
| | | let dicUrl = `/api/blade-household/household/selectHouseholdList?labelId=${param}&searchKey={{key}}&limit=20` |
| | | const column = this.findObject(this.option.column, "householdId") |
| | | column.dicUrl = dicUrl |
| | | |
| | | console.log(param, this.option.column, 9999) |
| | | }, |
| | | |
| | | rowSave (row, done, loading) { |
| | |
| | | if (["edit", "view"].includes(type)) { |
| | | getGridWorkLog(this.form.id).then((res) => { |
| | | this.form = res.data.data |
| | | if (this.form.url.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.url.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.url = urls.join(",") |
| | | if (this.form.url) { |
| | | if (this.form.url.length > 0) { |
| | | var urls = [] |
| | | var names = this.form.url.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | this.form.url = urls.join(",") |
| | | } |
| | | } |
| | | |
| | | let params = { |
| | | getPersonPublicSelect({ |
| | | id: this.form.householdId |
| | | } |
| | | |
| | | getAllHouseHold(params).then(res => { |
| | | }).then(res => { |
| | | const column = this.findObject(this.option.column, "householdId") |
| | | column.dicData = res.data.data |
| | | }) |
| | |
| | | this.page.total = data.total |
| | | this.data = data.records |
| | | this.data.forEach(item => { |
| | | if (item.url.length > 0) { |
| | | var urls = [] |
| | | var names = item.url.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.url = urls.join(",") |
| | | if (item.url) { |
| | | if (item.url.length > 0) { |
| | | var urls = [] |
| | | var names = item.url.split(",") |
| | | names.forEach(name => { |
| | | urls.push(website.minioUrl + name) |
| | | }) |
| | | item.url = urls.join(",") |
| | | } |
| | | } |
| | | }) |
| | | this.loading = false |