diff --git a/src/api/system/baseForm.js b/src/api/system/baseForm.js index d16d26a..024f26d 100644 --- a/src/api/system/baseForm.js +++ b/src/api/system/baseForm.js @@ -33,11 +33,12 @@ export function show(params, isLoading = true) { }) } -export function save(data) { +export function save(data, isLoading = true) { return request({ method: "post", url: "/api/admin/base-form/save", - data + data, + isLoading }) } @@ -49,10 +50,11 @@ export function destroy(params) { }) } -export function imports(data) { +export function imports(data,isLoading = true) { return request({ method: "post", url: "/api/admin/base-form/import", - data + data, + isLoading }) } diff --git a/src/utils/createDialog.js b/src/utils/createDialog.js index a6c5fa4..cf830f6 100644 --- a/src/utils/createDialog.js +++ b/src/utils/createDialog.js @@ -174,7 +174,7 @@ export class CreateDialog { : false, }, }, - replace && replace.render + (replace && replace.render) ? [replace.render] : [ h( diff --git a/src/views/assets/detail.vue b/src/views/assets/detail.vue index a20d8a5..72f9390 100644 --- a/src/views/assets/detail.vue +++ b/src/views/assets/detail.vue @@ -200,7 +200,7 @@ 租赁合同 - + @@ -378,6 +378,7 @@ export default { }, histories: [], + leases: [], inspections: [], keeps: [], units: new Map([ @@ -437,15 +438,26 @@ export default { }, { label: '地块名称', - prop: 'dikuaimingcheng', + prop: 'assets', width: 180, fixed: 'left', - align: 'left' - }, - { - label: '出租房', - prop: 'chuzufang', - width: 150 + align: 'left', + customFn: row => { + return ( +
+ { + row.land?.map(i => ( + { i.name } + )) + } + { + row.house?.map(i => ( + { i.name } + )) + } +
+ ) + } }, { label: '承租方', @@ -466,32 +478,30 @@ export default { } }, { - label: '应收租金', - prop: 'yingshouzujin', - align: 'right', - width: 120 + label: '合同交租期限', + width: 190, + customFn:row => { + return ( +
+ { this.$moment(new Date(row.hetongjiaozukaishishijian)).format('YYYY.MM.DD') } + - + { this.$moment(new Date(row.hetongjiaozujieshushijian)).format('YYYY.MM.DD') } +
+ ) + } }, { - label: '实收租金', - prop: 'shishouzujin', + label: '年租金单价', + prop: 'nianzujindanjia', align: 'right', width: 120 }, { - label: '保证金', - prop: 'baozhengjin', - width: 120, - customFn:row => { - return ( -
{ row.baozhengjin }
- ) - } + label: '签订年月', + prop: 'qiandingnianyue', + align: 'right', + width: 120 }, - { - label: '未到位原因', - prop: 'weidaoweiyuanyin', - minWidth: 140 - } ], @@ -683,6 +693,26 @@ export default { }) }, + async getLeases () { + const res = await index({ + table_name: 'leases', + page: 1, + page_size: 999, + filter:[ + { + key: "id", + op: 'range', + value: this.detail.leases.map(i => i.id).toString() + } + ] + }) + this.leases = res.data; + + res.data.forEach(i => { + this.myFiles.push(...i.fujian_detail) + }) + }, + async getKeeps () { const res = await index({ table_name: 'asset_safety_keeps', @@ -828,6 +858,7 @@ export default { this.getFields().then(res => { this.getHistories() this.getKeeps() + this.getLeases() // this.getInspections() }) }, diff --git a/src/views/component/dialog.vue b/src/views/component/dialog.vue index 39270af..b2476d6 100644 --- a/src/views/component/dialog.vue +++ b/src/views/component/dialog.vue @@ -436,7 +436,7 @@ export default { this.dialogVisible = false; }, setType(type = "add") { - let types = ["add", "editor"]; + let types = ["add", "editor", "renew"]; if (types.includes(type)) { this.type = type; } else { @@ -493,7 +493,7 @@ export default { submit() { let promiseAll = []; - if (this.type === "add") { + if (this.type === "add" || this.type === "renew") { if (this.form.hasOwnProperty("id")) { delete this.form.id; } @@ -600,7 +600,7 @@ export default { ); Promise.all(promiseAll).then((res) => { this.$Message.success({ - content: `${this.type === "add" ? "新增" : "编辑"}成功`, + content: `${(this.type === "add" || this.type === "renew") ? "新增" : "编辑"}成功`, }); this.$emit("refresh"); this.hidden(); @@ -665,7 +665,7 @@ export default { }, dialogVisible(val) { if (val) { - if (this.type === "editor") { + if (this.type === "editor" || this.type === "renew") { this.$nextTick(() => this.getDetail()); } } else { diff --git a/src/views/lease/component/addPay.vue b/src/views/lease/component/addPay.vue new file mode 100644 index 0000000..07bcbf0 --- /dev/null +++ b/src/views/lease/component/addPay.vue @@ -0,0 +1,154 @@ + + + diff --git a/src/views/lease/index.vue b/src/views/lease/index.vue index 859240b..1d69bec 100644 --- a/src/views/lease/index.vue +++ b/src/views/lease/index.vue @@ -262,10 +262,14 @@ @loaded="adjustAlignment" > @@ -307,16 +301,14 @@ import { listdept } from "@/api/system/department" import add from "./component/addLease.vue"; import LxHeader from "@/components/LxHeader/index.vue"; import headerContent from "@/components/LxHeader/XyContent.vue"; -import drawer from "@/views/component/drawer.vue"; -import imports from "@/views/component/imports.vue"; +import addPay from "@/views/lease/component/addPay.vue"; export default { name: 'tableList', components: { LxHeader, add, headerContent, - drawer, - imports, + addPay }, mixins: [authMixin], provide: { @@ -503,10 +495,10 @@ export default { linkOb.customFn = (row) => { let paramMap = new Map(); keys.forEach((key) => { - paramMap.set(i.select_item[key], key); + paramMap.set(/^\d*$/.test(i.select_item[key]) ? Number(i.select_item[key]) : i.select_item[key], key); }); - return { paramMap.get(row[i.field]) ? paramMap.get(row[i.field].toString()) : row[i.field] }; + return { paramMap.get(row[i.field]) ? paramMap.get(row[i.field]) : row[i.field] }; }; } if (i._relations) { @@ -611,7 +603,6 @@ export default { } }) } catch (err) { - console.error(err); } this.$nextTick(() => { this.$refs['xyTable'].doLayout(); diff --git a/src/views/lease/let.vue b/src/views/lease/let.vue index 403226f..91c82ac 100644 --- a/src/views/lease/let.vue +++ b/src/views/lease/let.vue @@ -640,7 +640,15 @@ export default { } }, created() { - this.getFormDetail(); + this.getFormDetail().then(res => { + this.$nextTick(() => { + if (this.$route.query.renewId && !isNaN(Number(this.$route.query.renewId))) { + this.$refs['dialog'].setId(Number(this.$route.query.renewId)); + this.$refs['dialog'].setType('renew'); + this.$refs['dialog'].show(); + } + }) + }) }, }; diff --git a/src/views/lease/plan.vue b/src/views/lease/plan.vue new file mode 100644 index 0000000..e938e3e --- /dev/null +++ b/src/views/lease/plan.vue @@ -0,0 +1,673 @@ + + + + + diff --git a/src/views/lease/sign.vue b/src/views/lease/sign.vue index 7d6f78d..bcc4b96 100644 --- a/src/views/lease/sign.vue +++ b/src/views/lease/sign.vue @@ -1,5 +1,5 @@