parent
1f7291f950
commit
42b2a45093
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,169 @@
|
||||
<template>
|
||||
<el-dialog title="详情" :close-on-click-modal="false" append-to-body :visible.sync="visible"
|
||||
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right">
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="申请单号" prop="applicationNumber">
|
||||
<p>{{ dataForm.applicationNumber }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="商户名称" prop="merchantId">
|
||||
<p>{{ dataForm.merchantId }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="合同名称" prop="contractId">
|
||||
<p>{{ dataForm.contractId }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="空间名称" prop="spaceId">
|
||||
<p>{{ dataForm.spaceId }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预计开始时间" prop="expectedStartTime">
|
||||
<p>{{ dataForm.expectedStartTime }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预计结束时间" prop="expectedEndTime">
|
||||
<p>{{ dataForm.expectedEndTime }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="联系人" prop="contacts">
|
||||
<p>{{ dataForm.contacts }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="联系电话" prop="contactsPhone">
|
||||
<p>{{ dataForm.contactsPhone }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="押金金额" prop="depositAmount">
|
||||
<p>{{ dataForm.depositAmount }}元</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="押金是否退回" prop="isTheDepositRefunded">
|
||||
<p>{{ dataForm.isTheDepositRefunded }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="押金退回日期" prop="depositRefundDate">
|
||||
<p>{{ dataForm.depositRefundDate }}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="装修进度" prop="decorationProgress">
|
||||
<p>{{ dataForm.decorationProgress }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="实地照片" prop="fieldPhoto">
|
||||
<JnpfUploadImg v-model="dataForm.fieldPhoto" disabled detailed :fileSize="10" sizeUnit="MB"
|
||||
:limit="9" pathType="defaultPath" :isAccount="0">
|
||||
</JnpfUploadImg>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
</span>
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: { Detail },
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
|
||||
dataForm: {
|
||||
id: '',
|
||||
applicationNumber: '',
|
||||
merchantId: "",
|
||||
contractId: "",
|
||||
spaceId: "3",
|
||||
expectedStartTime: '',
|
||||
expectedEndTime: '',
|
||||
contacts: '',
|
||||
contactsPhone: '',
|
||||
depositAmount: '',
|
||||
isTheDepositRefunded: "2",
|
||||
depositRefundDate: '',
|
||||
decorationProgress: "1",
|
||||
fieldPhoto: [],
|
||||
creationTime: "",
|
||||
merchantName: '',
|
||||
spaceName: '',
|
||||
},
|
||||
isTheDepositRefundedOptions: [{ "fullName": "是", "id": "1" }, { "fullName": "否", "id": "2" }],
|
||||
isTheDepositRefundedProps: { "label": "fullName", "value": "id" },
|
||||
decorationProgressOptions: [{ "fullName": "待装修", "id": "1" }, { "fullName": "装修中", "id": "2" }, { "fullName": "已装修", "id": "3" }],
|
||||
decorationProgressProps: { "label": "fullName", "value": "id" },
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/DecorationApplicationForm/detail/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,611 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false" append-to-body :visible.sync="visible"
|
||||
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="申请单号" prop="applicationNumber">
|
||||
<JnpfInput v-model="dataForm.applicationNumber" @change="changeData('applicationNumber', -1)"
|
||||
placeholder="自动生成" disabled clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="商户名称" prop="merchantId">
|
||||
<JnpfPopupSelect v-model="dataForm.merchantId" @change="changeData('merchantId', -1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.merchantId"
|
||||
placeholder="请选择商户" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='cmp_nm' field='merchantId'
|
||||
interfaceId="583216109528809989" :pageSize="20" :columnOptions="merchantIdcolumnOptions"
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="合同名称" prop="contractId">
|
||||
<JnpfPopupSelect v-model="dataForm.contractId" @change="changeData('contractId', -1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.contractId"
|
||||
placeholder="请选择合同" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='contract_name' field='contractId'
|
||||
interfaceId="583555851390812933" :pageSize="20" :columnOptions="contractIdcolumnOptions"
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="空间名称" prop="spaceId">
|
||||
<JnpfPopupSelect v-model="dataForm.spaceId" @change="changeData('spaceId', -1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.spaceId"
|
||||
placeholder="请选择空间" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' field='spaceId' interfaceId="582825768971670725"
|
||||
:pageSize="20" :columnOptions="spaceIdcolumnOptions" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预计开始时间" prop="expectedStartTime">
|
||||
<JnpfDatePicker v-model="dataForm.expectedStartTime"
|
||||
@change="changeData('expectedStartTime', -1)" :startTime="dateTime(false, 1, 1, '', '')"
|
||||
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择预计开始时间" clearable
|
||||
:style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预计结束时间" prop="expectedEndTime">
|
||||
<JnpfDatePicker v-model="dataForm.expectedEndTime"
|
||||
@change="changeData('expectedEndTime', -1)" :startTime="dateTime(false, 1, 1, '', '')"
|
||||
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择预计结束时间" clearable
|
||||
:style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="联系人" prop="contacts">
|
||||
<JnpfInput v-model="dataForm.contacts" @change="changeData('contacts', -1)"
|
||||
placeholder="请输入联系人" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="联系电话" prop="contactsPhone">
|
||||
<JnpfInput v-model="dataForm.contactsPhone" @change="changeData('contactsPhone', -1)"
|
||||
placeholder="请输入联系电话" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="押金金额" prop="depositAmount">
|
||||
<JnpfInput v-model="dataForm.depositAmount" @change="changeData('depositAmount', -1)"
|
||||
placeholder="请输入" addonAfter="元" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="押金是否退回" prop="isTheDepositRefunded">
|
||||
<JnpfSelect v-model="dataForm.isTheDepositRefunded"
|
||||
@change="changeData('isTheDepositRefunded', -1)" placeholder="请选择" clearable
|
||||
:style='{ "width": "100%" }' :options="isTheDepositRefundedOptions"
|
||||
:props="isTheDepositRefundedProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="押金退回日期" prop="depositRefundDate">
|
||||
<JnpfDatePicker v-model="dataForm.depositRefundDate"
|
||||
@change="changeData('depositRefundDate', -1)" :startTime="dateTime(false, 1, 1, '', '')"
|
||||
:endTime="dateTime(false, 1, 1, '', '')" placeholder="请选择" clearable
|
||||
:style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="装修进度" prop="decorationProgress">
|
||||
<JnpfSelect v-model="dataForm.decorationProgress"
|
||||
@change="changeData('decorationProgress', -1)" placeholder="请选择" clearable
|
||||
:style='{ "width": "100%" }' :options="decorationProgressOptions"
|
||||
:props="decorationProgressProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item label="实地照片" prop="fieldPhoto">
|
||||
<JnpfUploadImg v-model="dataForm.fieldPhoto" @change="changeData('fieldPhoto', -1)"
|
||||
:fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0">
|
||||
</JnpfUploadImg>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<!-- 表单结束 -->
|
||||
</template>
|
||||
</el-form>
|
||||
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
||||
@select="addForSelect" @close="selectDialogVisible = false" />
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="upAndDown-button" v-if="dataForm.id">
|
||||
<el-button @click="prev" :disabled='prevDis'>
|
||||
{{ '上一条' }}
|
||||
</el-button>
|
||||
<el-button @click="next" :disabled='nextDis'>
|
||||
{{ '下一条' }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
|
||||
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-button>
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
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"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
applicationNumber: undefined,
|
||||
merchantId: undefined,
|
||||
contractId: undefined,
|
||||
spaceId: undefined,
|
||||
expectedStartTime: undefined,
|
||||
expectedEndTime: undefined,
|
||||
contacts: undefined,
|
||||
contactsPhone: undefined,
|
||||
depositAmount: undefined,
|
||||
isTheDepositRefunded: "2",
|
||||
depositRefundDate: undefined,
|
||||
decorationProgress: "1",
|
||||
fieldPhoto: [],
|
||||
creationTime: undefined,
|
||||
merchantName: undefined,
|
||||
spaceName: undefined,
|
||||
version: 0,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule:
|
||||
{
|
||||
merchantId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择商户',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
contractId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择合同',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
spaceId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
expectedStartTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择预计开始时间',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
expectedEndTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择预计结束时间',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
contacts: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入联系人',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
contactsPhone: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入联系电话',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
|
||||
message: '请输入正确的联系方式',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
depositAmount: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||
message: '请输入正确的金额',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
decorationProgress: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
fieldPhoto: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
merchantIdcolumnOptions: [{ "label": "公司编码", "value": "cmp_no" }, { "label": "公司名称", "value": "cmp_nm" }, { "label": "入驻状态", "value": "entry_status" }, { "label": "园区名称", "value": "park_name" },],
|
||||
contractIdcolumnOptions: [{ "label": "合同编码", "value": "contract_number" }, { "label": "合同名称", "value": "contract_name" }, { "label": "合同状态", "value": "contract_status" }, { "label": "商户名称", "value": "merchant_id" }, { "label": "园区名称", "value": "park_name" },],
|
||||
spaceIdcolumnOptions: [{ "label": "空间编码", "value": "code" }, { "label": "空间名称", "value": "name" }, { "label": "空间面积", "value": "space_area" }, { "label": "空间状态", "value": "state" },],
|
||||
isTheDepositRefundedOptions: [{ "fullName": "是", "id": "1" }, { "fullName": "否", "id": "2" }],
|
||||
isTheDepositRefundedProps: { "label": "fullName", "value": "id" },
|
||||
decorationProgressOptions: [{ "fullName": "待装修", "id": "1" }, { "fullName": "装修中", "id": "2" }, { "fullName": "已装修", "id": "3" }],
|
||||
decorationProgressProps: { "label": "fullName", "value": "id" },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
applicationNumber: [],
|
||||
merchantId: [],
|
||||
contractId: [],
|
||||
spaceId: [],
|
||||
expectedStartTime: [],
|
||||
expectedEndTime: [],
|
||||
contacts: [],
|
||||
contactsPhone: [],
|
||||
depositAmount: [],
|
||||
isTheDepositRefunded: [],
|
||||
depositRefundDate: [],
|
||||
decorationProgress: [],
|
||||
fieldPhoto: [],
|
||||
creationTime: [],
|
||||
merchantName: [],
|
||||
spaceName: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/example/DecorationApplicationForm/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/DecorationApplicationForm/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/DecorationApplicationForm',
|
||||
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/example/DecorationApplicationForm/' + 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.$nextTick(() => {
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
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
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,159 @@
|
||||
<template>
|
||||
<el-dialog title="详情"
|
||||
:close-on-click-modal="false" append-to-body
|
||||
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||
width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
|
||||
<template v-if="!loading">
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="申请单号"
|
||||
prop="applicationNumber" >
|
||||
<p>{{dataForm.applicationNumber}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="商户名称"
|
||||
prop="merchantId" >
|
||||
<p>{{dataForm.merchantId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="空间名称"
|
||||
prop="spaceId" >
|
||||
<p>{{dataForm.spaceId}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="开始时间"
|
||||
prop="startTime" >
|
||||
<p>{{dataForm.startTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="结束时间"
|
||||
prop="endTime" >
|
||||
<p>{{dataForm.endTime}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="联系人"
|
||||
prop="contacts" >
|
||||
<p>{{dataForm.contacts}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="联系电话"
|
||||
prop="contactsPhone" >
|
||||
<p>{{dataForm.contactsPhone}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="预约人数"
|
||||
prop="reservationsNumber" >
|
||||
<p>{{dataForm.reservationsNumber}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="预约事由"
|
||||
prop="reservationsThing" >
|
||||
<p>{{dataForm.reservationsThing}}</p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" >
|
||||
<jnpf-form-tip-item label="预约进度"
|
||||
prop="usageProgress" >
|
||||
<p>{{ dataForm.usageProgress }} </p>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-form>
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
</span>
|
||||
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import request from '@/utils/request'
|
||||
|
||||
import { getConfigData } from '@/api/onlineDev/visualDev'
|
||||
import jnpf from '@/utils/jnpf'
|
||||
import Detail from '@/views/basic/dynamicModel/list/detail'
|
||||
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||
export default {
|
||||
components: { Detail},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
detailVisible: false,
|
||||
loading: false,
|
||||
|
||||
dataForm: {
|
||||
id :'',
|
||||
applicationNumber : '',
|
||||
merchantId : "",
|
||||
spaceId : "",
|
||||
startTime : '',
|
||||
endTime : '',
|
||||
contacts : '',
|
||||
contactsPhone : '',
|
||||
reservationsNumber : '',
|
||||
reservationsThing : '',
|
||||
usageProgress : "1",
|
||||
creationTime : "",
|
||||
spaceName : '',
|
||||
merchantName : '',
|
||||
},
|
||||
usageProgressOptions:[{"fullName":"预约中","id":"1"},{"fullName":"已结束","id":"2"}],
|
||||
usageProgressProps:{"label":"fullName","value":"id" },
|
||||
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
watch: {},
|
||||
created() {
|
||||
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
toDetail(defaultValue, modelId) {
|
||||
if (!defaultValue) return
|
||||
getConfigData(modelId).then(res => {
|
||||
if (!res.data || !res.data.formData) return
|
||||
let formData = JSON.parse(res.data.formData)
|
||||
formData.popupType = 'general'
|
||||
this.detailVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.Detail.init(formData, modelId, defaultValue)
|
||||
})
|
||||
})
|
||||
},
|
||||
dataInfo(dataAll){
|
||||
let _dataAll =dataAll
|
||||
this.dataForm = _dataAll
|
||||
},
|
||||
|
||||
init(id) {
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if(this.dataForm.id){
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/VenueReservationRecord/detail/'+this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,566 @@
|
||||
<template>
|
||||
<el-dialog :title="!dataForm.id ? '新建' : '编辑'" :close-on-click-modal="false" append-to-body :visible.sync="visible"
|
||||
class="JNPF-dialog JNPF-dialog_center" lock-scroll width="1000px">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px"
|
||||
label-position="right">
|
||||
<template v-if="!loading">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="申请单号" prop="applicationNumber">
|
||||
<JnpfInput v-model="dataForm.applicationNumber" @change="changeData('applicationNumber', -1)"
|
||||
placeholder="自动生成" disabled clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="商户名称" prop="merchantId">
|
||||
<JnpfPopupSelect v-model="dataForm.merchantId" @change="changeData('merchantId', -1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.merchantId"
|
||||
placeholder="请选择商户" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='cmp_nm' field='merchantId'
|
||||
interfaceId="583216109528809989" :pageSize="20" :columnOptions="merchantIdcolumnOptions"
|
||||
clearable :style='{ "width": "100%" }'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="空间名称" prop="spaceId">
|
||||
<JnpfPopupSelect v-model="dataForm.spaceId" @change="changeData('spaceId', -1)"
|
||||
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.spaceId"
|
||||
placeholder="请选择空间" hasPage propsValue="id" popupWidth="800px" popupTitle="选择数据"
|
||||
popupType="dialog" relationField='name' field='spaceId' interfaceId="583567455855575941"
|
||||
:pageSize="20" :columnOptions="spaceIdcolumnOptions" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfPopupSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="开始时间" prop="startTime">
|
||||
<JnpfDatePicker v-model="dataForm.startTime" @change="changeData('startTime', -1)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
||||
placeholder="请选择开始时间" clearable :style='{ "width": "100%" }' type="date"
|
||||
format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="结束时间" prop="endTime">
|
||||
<JnpfDatePicker v-model="dataForm.endTime" @change="changeData('endTime', -1)"
|
||||
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
||||
placeholder="请选择结束时间" clearable :style='{ "width": "100%" }' type="date"
|
||||
format="yyyy-MM-dd">
|
||||
</JnpfDatePicker>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="联系人" prop="contacts">
|
||||
<JnpfInput v-model="dataForm.contacts" @change="changeData('contacts', -1)"
|
||||
placeholder="请输入联系人" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="联系电话" prop="contactsPhone">
|
||||
<JnpfInput v-model="dataForm.contactsPhone" @change="changeData('contactsPhone', -1)"
|
||||
placeholder="请输入联系电话" clearable :style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预约人数" prop="reservationsNumber">
|
||||
<JnpfInput v-model="dataForm.reservationsNumber"
|
||||
@change="changeData('reservationsNumber', -1)" placeholder="请输入" clearable
|
||||
:style='{ "width": "100%" }'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预约事由" prop="reservationsThing">
|
||||
<JnpfTextarea v-model="dataForm.reservationsThing"
|
||||
@change="changeData('reservationsThing', -1)" placeholder="请输入预约事由"
|
||||
:style='{ "width": "100%" }' true type="textarea" :autosize='{ "minRows": 4, "maxRows": 4 }'>
|
||||
</JnpfTextarea>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<jnpf-form-tip-item label="预约进度" prop="usageProgress">
|
||||
<JnpfSelect v-model="dataForm.usageProgress" @change="changeData('usageProgress', -1)"
|
||||
placeholder="请选择预约进度" clearable :style='{ "width": "100%" }'
|
||||
:options="usageProgressOptions" :props="usageProgressProps">
|
||||
</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" />
|
||||
</el-row>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<div class="upAndDown-button" v-if="dataForm.id">
|
||||
<el-button @click="prev" :disabled='prevDis'>
|
||||
{{ '上一条' }}
|
||||
</el-button>
|
||||
<el-button @click="next" :disabled='nextDis'>
|
||||
{{ '下一条' }}
|
||||
</el-button>
|
||||
</div>
|
||||
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
|
||||
{{ !dataForm.id ? '确定并新增' : '确定并继续' }}</el-button>
|
||||
<el-button @click="visible = false"> 取 消</el-button>
|
||||
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
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"
|
||||
export default {
|
||||
components: {},
|
||||
props: [],
|
||||
data() {
|
||||
return {
|
||||
dataFormSubmitType: 0,
|
||||
continueBtnLoading: false,
|
||||
index: 0,
|
||||
prevDis: false,
|
||||
nextDis: false,
|
||||
allList: [],
|
||||
visible: false,
|
||||
loading: false,
|
||||
btnLoading: false,
|
||||
formRef: 'formRef',
|
||||
setting: {},
|
||||
eventType: '',
|
||||
userBoxVisible: false,
|
||||
selectDialogVisible: false,
|
||||
currTableConf: {},
|
||||
dataValueAll: {},
|
||||
addTableConf: {
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
applicationNumber: undefined,
|
||||
merchantId: undefined,
|
||||
spaceId: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
contacts: undefined,
|
||||
contactsPhone: undefined,
|
||||
reservationsNumber: undefined,
|
||||
reservationsThing: undefined,
|
||||
usageProgress: "1",
|
||||
creationTime: undefined,
|
||||
spaceName: undefined,
|
||||
merchantName: undefined,
|
||||
version: 0,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule:
|
||||
{
|
||||
merchantId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择商户',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
spaceId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择空间',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
startTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择开始时间',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
endTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择结束时间',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
contacts: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入联系人',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
contactsPhone: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入联系电话',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
|
||||
message: '请输入正确的联系方式',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
reservationsNumber: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
pattern: /^\d+$/,
|
||||
message: '请输入正确的数字',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
reservationsThing: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入预约事由',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
usageProgress: [
|
||||
{
|
||||
required: true,
|
||||
message: '请至少选择一个',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
merchantIdcolumnOptions: [{ "label": "公司编码", "value": "cmp_no" }, { "label": "公司名称", "value": "cmp_nm" }, { "label": "入住状态", "value": "entry_status" }, { "label": "园区名称", "value": "park_name" },],
|
||||
spaceIdcolumnOptions: [{ "label": "空间编码", "value": "code" }, { "label": "空间名称", "value": "name" }, { "label": "空间面积", "value": "space_area" }, { "label": "空间状态", "value": "state" },],
|
||||
usageProgressOptions: [{ "fullName": "预约中", "id": "1" }, { "fullName": "已结束", "id": "2" }],
|
||||
usageProgressProps: { "label": "fullName", "value": "id" },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
applicationNumber: [],
|
||||
merchantId: [],
|
||||
spaceId: [],
|
||||
startTime: [],
|
||||
endTime: [],
|
||||
contacts: [],
|
||||
contactsPhone: [],
|
||||
reservationsNumber: [],
|
||||
reservationsThing: [],
|
||||
usageProgress: [],
|
||||
creationTime: [],
|
||||
spaceName: [],
|
||||
merchantName: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['userInfo'])
|
||||
},
|
||||
watch: {},
|
||||
created() {
|
||||
this.dataAll()
|
||||
this.initDefaultData()
|
||||
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||
},
|
||||
mounted() { },
|
||||
methods: {
|
||||
prev() {
|
||||
this.index--
|
||||
if (this.index === 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
next() {
|
||||
this.index++
|
||||
if (this.index === this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
getInfo(id) {
|
||||
request({
|
||||
url: '/api/example/VenueReservationRecord/' + id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
});
|
||||
},
|
||||
goBack() {
|
||||
this.visible = false
|
||||
this.$emit('refreshDataList', true)
|
||||
},
|
||||
changeData(model, index) {
|
||||
this.isEdit = false
|
||||
this.childIndex = index
|
||||
let modelAll = model.split("-");
|
||||
let faceMode = "";
|
||||
for (let i = 0; i < modelAll.length; i++) {
|
||||
faceMode += modelAll[i];
|
||||
}
|
||||
for (let key in this.interfaceRes) {
|
||||
if (key != faceMode) {
|
||||
let faceReList = this.interfaceRes[key]
|
||||
for (let i = 0; i < faceReList.length; i++) {
|
||||
if (faceReList[i].relationField == model) {
|
||||
let options = 'get' + key + 'Options';
|
||||
if (this[options]) {
|
||||
this[options]()
|
||||
}
|
||||
this.changeData(key, index)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
changeDataFormData(type, data, model, index, defaultValue) {
|
||||
if (!this.isEdit) {
|
||||
if (type == 2) {
|
||||
for (let i = 0; i < this.dataForm[data].length; i++) {
|
||||
if (index == -1) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
} else if (index == i) {
|
||||
this.dataForm[data][i][model] = defaultValue
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.dataForm[data] = defaultValue
|
||||
}
|
||||
}
|
||||
},
|
||||
dataAll() {
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
init(id, isDetail, allList) {
|
||||
this.prevDis = false
|
||||
this.nextDis = false
|
||||
this.allList = allList || []
|
||||
if (allList.length) {
|
||||
this.index = this.allList.findIndex(item => item.id === id)
|
||||
if (this.index == 0) {
|
||||
this.prevDis = true
|
||||
}
|
||||
if (this.index == this.allList.length - 1) {
|
||||
this.nextDis = true
|
||||
}
|
||||
} else {
|
||||
this.prevDis = true
|
||||
this.nextDis = true
|
||||
}
|
||||
this.dataForm.id = id || 0;
|
||||
this.visible = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.dataForm.id) {
|
||||
this.loading = true
|
||||
request({
|
||||
url: '/api/example/VenueReservationRecord/' + this.dataForm.id,
|
||||
method: 'get'
|
||||
}).then(res => {
|
||||
this.dataInfo(res.data)
|
||||
this.loading = false
|
||||
});
|
||||
} else {
|
||||
this.clearData()
|
||||
this.initDefaultData()
|
||||
}
|
||||
});
|
||||
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
// 表单提交
|
||||
dataFormSubmit(type) {
|
||||
this.dataFormSubmitType = type ? type : 0
|
||||
this.$refs['formRef'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.request()
|
||||
}
|
||||
})
|
||||
},
|
||||
request() {
|
||||
let _data = this.dataList()
|
||||
if (this.dataFormSubmitType == 2) {
|
||||
this.continueBtnLoading = true
|
||||
} else {
|
||||
this.btnLoading = true
|
||||
}
|
||||
if (!this.dataForm.id) {
|
||||
request({
|
||||
url: '/api/example/VenueReservationRecord',
|
||||
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/example/VenueReservationRecord/' + 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.$nextTick(() => {
|
||||
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)
|
||||
}
|
||||
}
|
||||
},
|
||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||
let timeDataValue = null;
|
||||
let timeValue = Number(timeValueData)
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = new Date().getTime()
|
||||
} else if (timeType == 4) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getBeforeData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||
}
|
||||
} else if (timeType == 5) {
|
||||
let previousDate = '';
|
||||
if (timeTarget == 1 || timeTarget == 2) {
|
||||
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else if (timeTarget == 3) {
|
||||
previousDate = getLaterData(timeValue)
|
||||
timeDataValue = new Date(previousDate).getTime()
|
||||
} else {
|
||||
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
|
||||
if (timeRule) {
|
||||
if (timeType == 1) {
|
||||
timeDataValue = timeValue || '00:00:00'
|
||||
if (timeDataValue.split(':').length == 3) {
|
||||
timeDataValue = timeDataValue
|
||||
} else {
|
||||
timeDataValue = timeDataValue + ':00'
|
||||
}
|
||||
} else if (timeType == 2) {
|
||||
timeDataValue = dataValue
|
||||
} else if (timeType == 3) {
|
||||
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||
} else if (timeType == 4) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
return timeDataValue;
|
||||
},
|
||||
dataList() {
|
||||
var _data = this.dataForm;
|
||||
return _data;
|
||||
},
|
||||
dataInfo(dataAll) {
|
||||
let _dataAll = dataAll
|
||||
this.dataForm = _dataAll
|
||||
this.isEdit = true
|
||||
this.dataAll()
|
||||
this.childIndex = -1
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue