|
|
|
@ -5,34 +5,60 @@
|
|
|
|
|
<transition name="el-zoom-in-center">
|
|
|
|
|
<div class="JNPF-preview-main">
|
|
|
|
|
<div class="JNPF-common-page-header">
|
|
|
|
|
<el-page-header @back="goBack" :content="!dataForm.id ? '新建':'编辑'" />
|
|
|
|
|
<el-page-header
|
|
|
|
|
@back="goBack"
|
|
|
|
|
:content="!dataForm.id ? '新建' : '编辑'"
|
|
|
|
|
/>
|
|
|
|
|
<div class="options">
|
|
|
|
|
<el-dropdown class="dropdown" placement="bottom">
|
|
|
|
|
<el-button style="width:70px">
|
|
|
|
|
<el-button style="width: 70px">
|
|
|
|
|
更 多<i class="el-icon-arrow-down el-icon--right"></i>
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<template v-if="dataForm.id">
|
|
|
|
|
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
|
|
|
|
|
{{'上一条'}}
|
|
|
|
|
<el-dropdown-item @click.native="prev" :disabled="prevDis">
|
|
|
|
|
{{ "上一条" }}
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item @click.native="next" :disabled='nextDis'>
|
|
|
|
|
{{'下一条'}}
|
|
|
|
|
<el-dropdown-item @click.native="next" :disabled="nextDis">
|
|
|
|
|
{{ "下一条" }}
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
</template>
|
|
|
|
|
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
|
|
|
|
|
:loading="continueBtnLoading" :disabled='btnLoading'>
|
|
|
|
|
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
|
|
|
|
|
<el-dropdown-item
|
|
|
|
|
type="primary"
|
|
|
|
|
@click.native="dataFormSubmit(2)"
|
|
|
|
|
:loading="continueBtnLoading"
|
|
|
|
|
:disabled="btnLoading"
|
|
|
|
|
>
|
|
|
|
|
{{
|
|
|
|
|
!dataForm.id ? "确定并新增" : "确定并继续"
|
|
|
|
|
}}</el-dropdown-item
|
|
|
|
|
>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"
|
|
|
|
|
:disabled='continueBtnLoading'> 保 存</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click="dataFormSubmit()"
|
|
|
|
|
:loading="btnLoading"
|
|
|
|
|
:disabled="continueBtnLoading"
|
|
|
|
|
>
|
|
|
|
|
保 存</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button @click="goBack"> 取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
|
|
|
|
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="default"
|
|
|
|
|
label-width="100px" label-position="right">
|
|
|
|
|
<el-row
|
|
|
|
|
:gutter="15"
|
|
|
|
|
class="main"
|
|
|
|
|
:style="{ margin: '0 auto', width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
<el-form
|
|
|
|
|
ref="formRef"
|
|
|
|
|
:model="dataForm"
|
|
|
|
|
:rules="dataRule"
|
|
|
|
|
size="default"
|
|
|
|
|
label-width="100px"
|
|
|
|
|
label-position="right"
|
|
|
|
|
>
|
|
|
|
|
<template v-if="!loading">
|
|
|
|
|
<!-- 具体表单 -->
|
|
|
|
|
<el-col :span="24">
|
|
|
|
@ -43,22 +69,53 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<jnpf-form-tip-item label="小区名" prop="name">
|
|
|
|
|
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
|
|
|
|
|
clearable :style='{"width":"100%"}'>
|
|
|
|
|
<JnpfInput
|
|
|
|
|
v-model="dataForm.name"
|
|
|
|
|
@change="changeData('name', -1)"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<!-- {{ this.$store.getters.userInfo.organizeId }} -->
|
|
|
|
|
<jnpf-form-tip-item label="所属商户" prop="enterpriseId">
|
|
|
|
|
<JnpfDepSelect
|
|
|
|
|
v-model="dataForm.enterpriseId"
|
|
|
|
|
@change="changeData('enterpriseId', -1)"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
selectType="all"
|
|
|
|
|
:ableIds="ableAll.enterpriseIdableIds"
|
|
|
|
|
clearable
|
|
|
|
|
disabled="true"
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
</JnpfDepSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<jnpf-form-tip-item label="小区详细地址" prop="address">
|
|
|
|
|
<JnpfInput v-model="dataForm.address" @change="changeData('address',-1)"
|
|
|
|
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
|
|
|
|
<JnpfInput
|
|
|
|
|
v-model="dataForm.address"
|
|
|
|
|
@change="changeData('address', -1)"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<jnpf-form-tip-item label="启用禁用" prop="enabledMark">
|
|
|
|
|
<JnpfSwitch v-model="dataForm.enabledMark" @change="changeData('enabledMark',-1)"
|
|
|
|
|
:active-value="1" :inactive-value="0">
|
|
|
|
|
<JnpfSwitch
|
|
|
|
|
v-model="dataForm.enabledMark"
|
|
|
|
|
@change="changeData('enabledMark', -1)"
|
|
|
|
|
:active-value="1"
|
|
|
|
|
:inactive-value="0"
|
|
|
|
|
>
|
|
|
|
|
</JnpfSwitch>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
@ -84,54 +141,87 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<jnpf-form-tip-item label="定时定点回收" prop="hasSchedule">
|
|
|
|
|
<JnpfSwitch v-model="dataForm.hasSchedule" @change="changeData('hasSchedule',-1)"
|
|
|
|
|
:active-value="1" :inactive-value="0">
|
|
|
|
|
<JnpfSwitch
|
|
|
|
|
v-model="dataForm.hasSchedule"
|
|
|
|
|
@change="changeData('hasSchedule', -1)"
|
|
|
|
|
:active-value="1"
|
|
|
|
|
:inactive-value="0"
|
|
|
|
|
>
|
|
|
|
|
</JnpfSwitch>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<jnpf-form-tip-item label="回收地址" prop="recycleAddress">
|
|
|
|
|
<JnpfInput v-model="dataForm.recycleAddress"
|
|
|
|
|
@change="changeData('recycleAddress',-1)" placeholder="请输入" clearable
|
|
|
|
|
:style='{"width":"100%"}'>
|
|
|
|
|
<JnpfInput
|
|
|
|
|
v-model="dataForm.recycleAddress"
|
|
|
|
|
@change="changeData('recycleAddress', -1)"
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
>
|
|
|
|
|
</JnpfInput>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<jnpf-form-tip-item label="回收时间起" prop="appointmentTimeStart">
|
|
|
|
|
<JnpfTimePicker v-model="dataForm.appointmentTimeStart"
|
|
|
|
|
@change="changeData('appointmentTimeStart',-1)"
|
|
|
|
|
:startTime="time(false,1,1,'','HH:mm','')"
|
|
|
|
|
:endTime="time(false,1,1,'','HH:mm','')" placeholder="请选择" clearable
|
|
|
|
|
:style='{"width":"100%"}' format="HH:mm">
|
|
|
|
|
<jnpf-form-tip-item
|
|
|
|
|
label="回收时间起"
|
|
|
|
|
prop="appointmentTimeStart"
|
|
|
|
|
>
|
|
|
|
|
<JnpfTimePicker
|
|
|
|
|
v-model="dataForm.appointmentTimeStart"
|
|
|
|
|
@change="changeData('appointmentTimeStart', -1)"
|
|
|
|
|
:startTime="time(false, 1, 1, '', 'HH:mm', '')"
|
|
|
|
|
:endTime="time(false, 1, 1, '', 'HH:mm', '')"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
format="HH:mm"
|
|
|
|
|
>
|
|
|
|
|
</JnpfTimePicker>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<jnpf-form-tip-item label="回收时间止" prop="appointmentTimeEnd">
|
|
|
|
|
<JnpfTimePicker v-model="dataForm.appointmentTimeEnd"
|
|
|
|
|
@change="changeData('appointmentTimeEnd',-1)"
|
|
|
|
|
:startTime="time(false,1,1,'','HH:mm','')"
|
|
|
|
|
:endTime="time(false,1,1,'','HH:mm','')" placeholder="请选择" clearable
|
|
|
|
|
:style='{"width":"100%"}' format="HH:mm">
|
|
|
|
|
<JnpfTimePicker
|
|
|
|
|
v-model="dataForm.appointmentTimeEnd"
|
|
|
|
|
@change="changeData('appointmentTimeEnd', -1)"
|
|
|
|
|
:startTime="time(false, 1, 1, '', 'HH:mm', '')"
|
|
|
|
|
:endTime="time(false, 1, 1, '', 'HH:mm', '')"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
format="HH:mm"
|
|
|
|
|
>
|
|
|
|
|
</JnpfTimePicker>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="8">
|
|
|
|
|
<jnpf-form-tip-item label="来源" prop="sourceType">
|
|
|
|
|
<JnpfSelect v-model="dataForm.sourceType" @change="changeData('sourceType',-1)"
|
|
|
|
|
placeholder="请选择" clearable :style='{"width":"100%"}' :options="sourceTypeOptions"
|
|
|
|
|
:props="sourceTypeProps">
|
|
|
|
|
<JnpfSelect
|
|
|
|
|
v-model="dataForm.sourceType"
|
|
|
|
|
@change="changeData('sourceType', -1)"
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
clearable
|
|
|
|
|
:style="{ width: '100%' }"
|
|
|
|
|
:options="sourceTypeOptions"
|
|
|
|
|
:props="sourceTypeProps"
|
|
|
|
|
>
|
|
|
|
|
</JnpfSelect>
|
|
|
|
|
</jnpf-form-tip-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<!-- 表单结束 -->
|
|
|
|
|
</template>
|
|
|
|
|
</el-form>
|
|
|
|
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
|
|
|
|
|
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false" />
|
|
|
|
|
<SelectDialog
|
|
|
|
|
v-if="selectDialogVisible"
|
|
|
|
|
:config="currTableConf"
|
|
|
|
|
:formData="dataForm"
|
|
|
|
|
ref="selectDialog"
|
|
|
|
|
@select="addForSelect"
|
|
|
|
|
@close="selectDialogVisible = false"
|
|
|
|
|
/>
|
|
|
|
|
</el-row>
|
|
|
|
|
</div>
|
|
|
|
|
</transition>
|
|
|
|
@ -139,14 +229,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import request from '@/utils/request'
|
|
|
|
|
import request from "@/utils/request";
|
|
|
|
|
import { mapGetters } from "vuex";
|
|
|
|
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
|
|
|
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
|
|
|
|
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
|
|
|
|
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
|
|
|
|
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
|
|
|
|
import { thousandsFormat } from "@/components/Generator/utils/index"
|
|
|
|
|
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
|
|
|
|
|
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
|
|
|
|
|
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
|
|
|
|
|
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
|
|
|
|
|
import {
|
|
|
|
|
getDateDay,
|
|
|
|
|
getLaterData,
|
|
|
|
|
getBeforeData,
|
|
|
|
|
getBeforeTime,
|
|
|
|
|
getLaterTime,
|
|
|
|
|
} from "@/components/Generator/utils/index.js";
|
|
|
|
|
import { thousandsFormat } from "@/components/Generator/utils/index";
|
|
|
|
|
export default {
|
|
|
|
|
components: {},
|
|
|
|
|
props: [],
|
|
|
|
@ -161,23 +257,21 @@ export default {
|
|
|
|
|
visible: false,
|
|
|
|
|
loading: false,
|
|
|
|
|
btnLoading: false,
|
|
|
|
|
formRef: 'formRef',
|
|
|
|
|
formRef: "formRef",
|
|
|
|
|
setting: {},
|
|
|
|
|
eventType: '',
|
|
|
|
|
eventType: "",
|
|
|
|
|
userBoxVisible: false,
|
|
|
|
|
selectDialogVisible: false,
|
|
|
|
|
currTableConf: {},
|
|
|
|
|
dataValueAll: {},
|
|
|
|
|
addTableConf: {
|
|
|
|
|
},
|
|
|
|
|
addTableConf: {},
|
|
|
|
|
//可选范围默认值
|
|
|
|
|
ableAll: {
|
|
|
|
|
},
|
|
|
|
|
tableRows: {
|
|
|
|
|
},
|
|
|
|
|
ableAll: {},
|
|
|
|
|
tableRows: {},
|
|
|
|
|
Vmodel: "",
|
|
|
|
|
currVmodel: "",
|
|
|
|
|
dataForm: {
|
|
|
|
|
enterpriseId: undefined,
|
|
|
|
|
name: undefined,
|
|
|
|
|
address: undefined,
|
|
|
|
|
enabledMark: 1,
|
|
|
|
@ -190,21 +284,31 @@ export default {
|
|
|
|
|
sourceType: "1",
|
|
|
|
|
},
|
|
|
|
|
tableRequiredData: {},
|
|
|
|
|
dataRule:
|
|
|
|
|
{
|
|
|
|
|
dataRule: {
|
|
|
|
|
name: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: '请输入',
|
|
|
|
|
trigger: 'blur'
|
|
|
|
|
message: "请输入",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
enterpriseId: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入",
|
|
|
|
|
trigger: "change",
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
sourceTypeOptions: [{ "fullName": "系统导入", "id": "1" }, { "fullName": "用户自定义", "id": "2" }],
|
|
|
|
|
sourceTypeProps: { "label": "fullName", "value": "id" },
|
|
|
|
|
sourceTypeOptions: [
|
|
|
|
|
{ fullName: "系统导入", id: "1" },
|
|
|
|
|
{ fullName: "用户自定义", id: "2" },
|
|
|
|
|
],
|
|
|
|
|
sourceTypeProps: { label: "fullName", value: "id" },
|
|
|
|
|
childIndex: -1,
|
|
|
|
|
isEdit: false,
|
|
|
|
|
interfaceRes: {
|
|
|
|
|
enterpriseId: [],
|
|
|
|
|
name: [],
|
|
|
|
|
address: [],
|
|
|
|
|
enabledMark: [],
|
|
|
|
@ -216,60 +320,60 @@ export default {
|
|
|
|
|
appointmentTimeEnd: [],
|
|
|
|
|
sourceType: [],
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapGetters(['userInfo'])
|
|
|
|
|
...mapGetters(["userInfo"]),
|
|
|
|
|
},
|
|
|
|
|
watch: {},
|
|
|
|
|
created() {
|
|
|
|
|
this.dataAll()
|
|
|
|
|
this.initDefaultData()
|
|
|
|
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
|
|
|
|
this.dataAll();
|
|
|
|
|
this.initDefaultData();
|
|
|
|
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
|
|
|
|
|
},
|
|
|
|
|
mounted() { },
|
|
|
|
|
mounted() {},
|
|
|
|
|
methods: {
|
|
|
|
|
prev() {
|
|
|
|
|
this.index--
|
|
|
|
|
this.index--;
|
|
|
|
|
if (this.index === 0) {
|
|
|
|
|
this.prevDis = true
|
|
|
|
|
this.prevDis = true;
|
|
|
|
|
}
|
|
|
|
|
this.nextDis = false
|
|
|
|
|
this.nextDis = false;
|
|
|
|
|
for (let index = 0; index < this.allList.length; index++) {
|
|
|
|
|
const element = this.allList[index];
|
|
|
|
|
if (this.index == index) {
|
|
|
|
|
this.getInfo(element.id)
|
|
|
|
|
this.getInfo(element.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
next() {
|
|
|
|
|
this.index++
|
|
|
|
|
this.index++;
|
|
|
|
|
if (this.index === this.allList.length - 1) {
|
|
|
|
|
this.nextDis = true
|
|
|
|
|
this.nextDis = true;
|
|
|
|
|
}
|
|
|
|
|
this.prevDis = false
|
|
|
|
|
this.prevDis = false;
|
|
|
|
|
for (let index = 0; index < this.allList.length; index++) {
|
|
|
|
|
const element = this.allList[index];
|
|
|
|
|
if (this.index == index) {
|
|
|
|
|
this.getInfo(element.id)
|
|
|
|
|
this.getInfo(element.id);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getInfo(id) {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/scm/HousingEstate/' + id,
|
|
|
|
|
method: 'get'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.dataInfo(res.data)
|
|
|
|
|
url: "/api/scm/HousingEstate/" + id,
|
|
|
|
|
method: "get",
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.dataInfo(res.data);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
goBack() {
|
|
|
|
|
this.visible = false
|
|
|
|
|
this.$emit('refreshDataList', true)
|
|
|
|
|
this.visible = false;
|
|
|
|
|
this.$emit("refreshDataList", true);
|
|
|
|
|
},
|
|
|
|
|
changeData(model, index) {
|
|
|
|
|
this.isEdit = false
|
|
|
|
|
this.childIndex = index
|
|
|
|
|
this.isEdit = false;
|
|
|
|
|
this.childIndex = index;
|
|
|
|
|
let modelAll = model.split("-");
|
|
|
|
|
let faceMode = "";
|
|
|
|
|
for (let i = 0; i < modelAll.length; i++) {
|
|
|
|
@ -277,14 +381,14 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
for (let key in this.interfaceRes) {
|
|
|
|
|
if (key != faceMode) {
|
|
|
|
|
let faceReList = this.interfaceRes[key]
|
|
|
|
|
let faceReList = this.interfaceRes[key];
|
|
|
|
|
for (let i = 0; i < faceReList.length; i++) {
|
|
|
|
|
if (faceReList[i].relationField == model) {
|
|
|
|
|
let options = 'get' + key + 'Options';
|
|
|
|
|
let options = "get" + key + "Options";
|
|
|
|
|
if (this[options]) {
|
|
|
|
|
this[options]()
|
|
|
|
|
this[options]();
|
|
|
|
|
}
|
|
|
|
|
this.changeData(key, index)
|
|
|
|
|
this.changeData(key, index);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -295,205 +399,221 @@ export default {
|
|
|
|
|
if (type == 2) {
|
|
|
|
|
for (let i = 0; i < this.dataForm[data].length; i++) {
|
|
|
|
|
if (index == -1) {
|
|
|
|
|
this.dataForm[data][i][model] = defaultValue
|
|
|
|
|
this.dataForm[data][i][model] = defaultValue;
|
|
|
|
|
} else if (index == i) {
|
|
|
|
|
this.dataForm[data][i][model] = defaultValue
|
|
|
|
|
this.dataForm[data][i][model] = defaultValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.dataForm[data] = defaultValue
|
|
|
|
|
this.dataForm[data] = defaultValue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataAll() {
|
|
|
|
|
},
|
|
|
|
|
dataAll() {},
|
|
|
|
|
goBack() {
|
|
|
|
|
this.$emit('refresh')
|
|
|
|
|
this.$emit("refresh");
|
|
|
|
|
},
|
|
|
|
|
clearData() {
|
|
|
|
|
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
|
|
|
|
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
|
|
|
|
|
},
|
|
|
|
|
init(id, isDetail, allList) {
|
|
|
|
|
this.prevDis = false
|
|
|
|
|
this.nextDis = false
|
|
|
|
|
this.allList = allList || []
|
|
|
|
|
this.prevDis = false;
|
|
|
|
|
this.nextDis = false;
|
|
|
|
|
this.allList = allList || [];
|
|
|
|
|
if (allList.length) {
|
|
|
|
|
this.index = this.allList.findIndex(item => item.id === id)
|
|
|
|
|
this.index = this.allList.findIndex((item) => item.id === id);
|
|
|
|
|
if (this.index == 0) {
|
|
|
|
|
this.prevDis = true
|
|
|
|
|
this.prevDis = true;
|
|
|
|
|
}
|
|
|
|
|
if (this.index == this.allList.length - 1) {
|
|
|
|
|
this.nextDis = true
|
|
|
|
|
this.nextDis = true;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
this.prevDis = true
|
|
|
|
|
this.nextDis = true
|
|
|
|
|
this.prevDis = true;
|
|
|
|
|
this.nextDis = true;
|
|
|
|
|
}
|
|
|
|
|
this.dataForm.id = id || 0;
|
|
|
|
|
this.visible = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
if (this.dataForm.id) {
|
|
|
|
|
this.loading = true
|
|
|
|
|
this.loading = true;
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/scm/HousingEstate/' + this.dataForm.id,
|
|
|
|
|
method: 'get'
|
|
|
|
|
}).then(res => {
|
|
|
|
|
this.dataInfo(res.data)
|
|
|
|
|
this.loading = false
|
|
|
|
|
url: "/api/scm/HousingEstate/" + this.dataForm.id,
|
|
|
|
|
method: "get",
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.dataInfo(res.data);
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.clearData()
|
|
|
|
|
this.initDefaultData()
|
|
|
|
|
this.clearData();
|
|
|
|
|
this.initDefaultData();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
|
|
|
|
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
|
|
|
|
|
},
|
|
|
|
|
//初始化默认数据
|
|
|
|
|
initDefaultData() {
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
this.userInfo.organizeIdList instanceof Array &&
|
|
|
|
|
this.userInfo.organizeIdList.length > 0
|
|
|
|
|
) {
|
|
|
|
|
this.dataForm.enterpriseId = this.userInfo.organizeIdList;
|
|
|
|
|
}
|
|
|
|
|
this.dataForm.firstContactPerson = this.userInfo.userId;
|
|
|
|
|
if (
|
|
|
|
|
this.$store.getters.userInfo.organizeId &&
|
|
|
|
|
this.$store.getters.userInfo.organizeId != null
|
|
|
|
|
) {
|
|
|
|
|
this.dataForm.enterpriseId = this.$store.getters.userInfo.organizeId;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 表单提交
|
|
|
|
|
dataFormSubmit(type) {
|
|
|
|
|
this.dataFormSubmitType = type ? type : 0
|
|
|
|
|
this.$refs['formRef'].validate((valid) => {
|
|
|
|
|
this.dataFormSubmitType = type ? type : 0;
|
|
|
|
|
this.$refs["formRef"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.request()
|
|
|
|
|
this.request();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
request() {
|
|
|
|
|
let _data = this.dataList()
|
|
|
|
|
let _data = this.dataList();
|
|
|
|
|
if (this.dataFormSubmitType == 2) {
|
|
|
|
|
this.continueBtnLoading = true
|
|
|
|
|
this.continueBtnLoading = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.btnLoading = true
|
|
|
|
|
this.btnLoading = true;
|
|
|
|
|
}
|
|
|
|
|
if (!this.dataForm.id) {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/scm/HousingEstate',
|
|
|
|
|
method: 'post',
|
|
|
|
|
data: _data
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success',
|
|
|
|
|
duration: 1000,
|
|
|
|
|
onClose: () => {
|
|
|
|
|
if (this.dataFormSubmitType == 2) {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.clearData()
|
|
|
|
|
this.initDefaultData()
|
|
|
|
|
})
|
|
|
|
|
this.continueBtnLoading = false
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
this.visible = false
|
|
|
|
|
this.btnLoading = false
|
|
|
|
|
this.$emit('refresh', true)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.btnLoading = false
|
|
|
|
|
this.continueBtnLoading = false
|
|
|
|
|
url: "/api/scm/HousingEstate",
|
|
|
|
|
method: "post",
|
|
|
|
|
data: _data,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: "success",
|
|
|
|
|
duration: 1000,
|
|
|
|
|
onClose: () => {
|
|
|
|
|
if (this.dataFormSubmitType == 2) {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.clearData();
|
|
|
|
|
this.initDefaultData();
|
|
|
|
|
});
|
|
|
|
|
this.continueBtnLoading = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
this.visible = false;
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.$emit("refresh", true);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.continueBtnLoading = false;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
request({
|
|
|
|
|
url: '/api/scm/HousingEstate/' + this.dataForm.id,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data: _data
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success',
|
|
|
|
|
duration: 1000,
|
|
|
|
|
onClose: () => {
|
|
|
|
|
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
|
|
|
|
|
this.visible = false
|
|
|
|
|
this.btnLoading = false
|
|
|
|
|
this.$emit('refresh', true)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
this.btnLoading = false
|
|
|
|
|
this.continueBtnLoading = false
|
|
|
|
|
url: "/api/scm/HousingEstate/" + this.dataForm.id,
|
|
|
|
|
method: "PUT",
|
|
|
|
|
data: _data,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: "success",
|
|
|
|
|
duration: 1000,
|
|
|
|
|
onClose: () => {
|
|
|
|
|
if (this.dataFormSubmitType == 2)
|
|
|
|
|
return (this.continueBtnLoading = false);
|
|
|
|
|
this.visible = false;
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.$emit("refresh", true);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {
|
|
|
|
|
this.btnLoading = false;
|
|
|
|
|
this.continueBtnLoading = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
openSelectDialog(key) {
|
|
|
|
|
this.currTableConf = this.addTableConf[key]
|
|
|
|
|
this.currVmodel = key
|
|
|
|
|
this.selectDialogVisible = true
|
|
|
|
|
this.currTableConf = this.addTableConf[key];
|
|
|
|
|
this.currVmodel = key;
|
|
|
|
|
this.selectDialogVisible = true;
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.$refs.selectDialog.init()
|
|
|
|
|
})
|
|
|
|
|
this.$refs.selectDialog.init();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addForSelect(data) {
|
|
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
|
|
let t = data[i]
|
|
|
|
|
if (this['get' + this.currVmodel]) {
|
|
|
|
|
this['get' + this.currVmodel](t)
|
|
|
|
|
let t = data[i];
|
|
|
|
|
if (this["get" + this.currVmodel]) {
|
|
|
|
|
this["get" + this.currVmodel](t);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
|
|
|
|
let timeDataValue = null;
|
|
|
|
|
let timeValue = Number(timeValueData)
|
|
|
|
|
let timeValue = Number(timeValueData);
|
|
|
|
|
if (timeRule) {
|
|
|
|
|
if (timeType == 1) {
|
|
|
|
|
timeDataValue = timeValue
|
|
|
|
|
timeDataValue = timeValue;
|
|
|
|
|
} else if (timeType == 2) {
|
|
|
|
|
timeDataValue = dataValue
|
|
|
|
|
timeDataValue = dataValue;
|
|
|
|
|
} else if (timeType == 3) {
|
|
|
|
|
timeDataValue = new Date().getTime()
|
|
|
|
|
timeDataValue = new Date().getTime();
|
|
|
|
|
} else if (timeType == 4) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
let previousDate = "";
|
|
|
|
|
if (timeTarget == 1 || timeTarget == 2) {
|
|
|
|
|
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
previousDate = getDateDay(timeTarget, timeType, timeValue);
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime();
|
|
|
|
|
} else if (timeTarget == 3) {
|
|
|
|
|
previousDate = getBeforeData(timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
previousDate = getBeforeData(timeValue);
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime();
|
|
|
|
|
} else {
|
|
|
|
|
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
|
|
|
|
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
|
|
|
|
|
}
|
|
|
|
|
} else if (timeType == 5) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
let previousDate = "";
|
|
|
|
|
if (timeTarget == 1 || timeTarget == 2) {
|
|
|
|
|
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
previousDate = getDateDay(timeTarget, timeType, timeValue);
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime();
|
|
|
|
|
} else if (timeTarget == 3) {
|
|
|
|
|
previousDate = getLaterData(timeValue)
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime()
|
|
|
|
|
previousDate = getLaterData(timeValue);
|
|
|
|
|
timeDataValue = new Date(previousDate).getTime();
|
|
|
|
|
} else {
|
|
|
|
|
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
|
|
|
|
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return timeDataValue;
|
|
|
|
|
},
|
|
|
|
|
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
|
|
|
|
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
|
|
|
|
let timeDataValue = null
|
|
|
|
|
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
|
|
|
|
|
let timeDataValue = null;
|
|
|
|
|
if (timeRule) {
|
|
|
|
|
if (timeType == 1) {
|
|
|
|
|
timeDataValue = timeValue || '00:00:00'
|
|
|
|
|
if (timeDataValue.split(':').length == 3) {
|
|
|
|
|
timeDataValue = timeDataValue
|
|
|
|
|
timeDataValue = timeValue || "00:00:00";
|
|
|
|
|
if (timeDataValue.split(":").length == 3) {
|
|
|
|
|
timeDataValue = timeDataValue;
|
|
|
|
|
} else {
|
|
|
|
|
timeDataValue = timeDataValue + ':00'
|
|
|
|
|
timeDataValue = timeDataValue + ":00";
|
|
|
|
|
}
|
|
|
|
|
} else if (timeType == 2) {
|
|
|
|
|
timeDataValue = dataValue
|
|
|
|
|
timeDataValue = dataValue;
|
|
|
|
|
} else if (timeType == 3) {
|
|
|
|
|
timeDataValue = this.jnpf.toDate(new Date(), format)
|
|
|
|
|
timeDataValue = this.jnpf.toDate(new Date(), format);
|
|
|
|
|
} else if (timeType == 4) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
previousDate = getBeforeTime(timeTarget, timeValue)
|
|
|
|
|
timeDataValue = this.jnpf.toDate(previousDate, format)
|
|
|
|
|
let previousDate = "";
|
|
|
|
|
previousDate = getBeforeTime(timeTarget, timeValue);
|
|
|
|
|
timeDataValue = this.jnpf.toDate(previousDate, format);
|
|
|
|
|
} else if (timeType == 5) {
|
|
|
|
|
let previousDate = '';
|
|
|
|
|
previousDate = getLaterTime(timeTarget, timeValue)
|
|
|
|
|
timeDataValue = this.jnpf.toDate(previousDate, format)
|
|
|
|
|
let previousDate = "";
|
|
|
|
|
previousDate = getLaterTime(timeTarget, timeValue);
|
|
|
|
|
timeDataValue = this.jnpf.toDate(previousDate, format);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return timeDataValue;
|
|
|
|
@ -503,13 +623,12 @@ export default {
|
|
|
|
|
return _data;
|
|
|
|
|
},
|
|
|
|
|
dataInfo(dataAll) {
|
|
|
|
|
let _dataAll = dataAll
|
|
|
|
|
this.dataForm = _dataAll
|
|
|
|
|
this.isEdit = true
|
|
|
|
|
this.dataAll()
|
|
|
|
|
this.childIndex = -1
|
|
|
|
|
let _dataAll = dataAll;
|
|
|
|
|
this.dataForm = _dataAll;
|
|
|
|
|
this.isEdit = true;
|
|
|
|
|
this.dataAll();
|
|
|
|
|
this.childIndex = -1;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|