Merge branch 'master' of http://222.71.165.188:3000/yangshiqiang/NX-zhihui
# Conflicts: # jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/mapper/ParkMapper.java # jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/ParkService.java # jnpf-java-boot/jnpf-example/jnpf-example-biz/src/main/java/jnpf/service/impl/ParkServiceImpl.java # jnpf-java-boot/jnpf-example/jnpf-example-controller/src/main/java/jnpf/controller/ParkController.java # jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/entity/ParkEntity.java # jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkConstant.java # jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkExcelErrorVO.java # jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkExcelVO.java # jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkForm.java # jnpf-java-boot/jnpf-example/jnpf-example-entity/src/main/java/jnpf/model/park/ParkPagination.java # jnpf-java-boot/jnpf-web/src/views/scm/park/Detail.vue # jnpf-java-boot/jnpf-web/src/views/scm/park/form.vue # jnpf-java-boot/jnpf-web/src/views/scm/park/index.vuemaster
commit
43888861ff
File diff suppressed because one or more lines are too long
@ -0,0 +1,24 @@
|
|||||||
|
package jnpf.model.contract;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ContractRequest implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核合同单据id
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核合同目标状态
|
||||||
|
*/
|
||||||
|
private String contractStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核说明
|
||||||
|
*/
|
||||||
|
private String approveRemarks;
|
||||||
|
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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,269 @@
|
|||||||
|
<template>
|
||||||
|
<transition name="el-zoom-in-center">
|
||||||
|
<div class="JNPF-preview-main">
|
||||||
|
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||||
|
<div class="JNPF-common-page-header">
|
||||||
|
<el-page-header @back="goBack"
|
||||||
|
content="详情"/>
|
||||||
|
<div class="options">
|
||||||
|
<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" size="small" label-width="100px" label-position="right" >
|
||||||
|
<template v-if="!loading">
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="合同编号"
|
||||||
|
prop="contractNumber" >
|
||||||
|
<p>{{dataForm.contractNumber}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="合同名称"
|
||||||
|
prop="contractName" >
|
||||||
|
<p>{{dataForm.contractName}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="计价方式"
|
||||||
|
prop="pricingMethod" >
|
||||||
|
<p>{{ dataForm.pricingMethod }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="签订日期"
|
||||||
|
prop="signingDate" >
|
||||||
|
<p>{{dataForm.signingDate}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="园区名称"
|
||||||
|
prop="parkId" >
|
||||||
|
<p>{{dataForm.parkId}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="商户名称"
|
||||||
|
prop="merchantName" >
|
||||||
|
<p>{{dataForm.merchantName}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="租金总价"
|
||||||
|
prop="totalRentalPrice" >
|
||||||
|
<p>{{dataForm.totalRentalPrice}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="押金总计"
|
||||||
|
prop="totalDeposit" >
|
||||||
|
<p>{{dataForm.totalDeposit}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="支付方式"
|
||||||
|
prop="payDeposit" >
|
||||||
|
<p>{{ dataForm.payDeposit }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="退还方式"
|
||||||
|
prop="returnDeposit" >
|
||||||
|
<p>{{ dataForm.returnDeposit }} </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="leaseTerm" >
|
||||||
|
<p>{{dataForm.leaseTerm}}月</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="contractStatus" >
|
||||||
|
<p>{{ dataForm.contractStatus }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" >
|
||||||
|
<jnpf-form-tip-item label="合同说明"
|
||||||
|
prop="contractExplain" >
|
||||||
|
<p>{{dataForm.contractExplain}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" >
|
||||||
|
<jnpf-form-tip-item label="合同附件"
|
||||||
|
prop="contractEnclosure" >
|
||||||
|
<JnpfUploadFile v-model="dataForm.contractEnclosure"
|
||||||
|
disabled
|
||||||
|
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传" >
|
||||||
|
</JnpfUploadFile>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" >
|
||||||
|
<jnpf-form-tip-item label-width="0">
|
||||||
|
<div class="JNPF-common-title">
|
||||||
|
<h2>空间列表</h2>
|
||||||
|
</div>
|
||||||
|
<el-table :data="dataForm.tableField130" size='mini' >
|
||||||
|
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||||
|
<el-table-column prop="contractLineNumber" label="合同行号" >
|
||||||
|
<template slot="header">
|
||||||
|
合同行号
|
||||||
|
<span slot="label">
|
||||||
|
<el-tooltip placement="top" content='后台自动生成'>
|
||||||
|
<a class='el-icon-question tooltip-question'></a>
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p>{{scope.row.contractLineNumber}}</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="spaceName" label="空间名称" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p>{{scope.row.spaceName}}</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="spaceArea" label="空间面积" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p>{{scope.row.spaceArea}}</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="totalRentalPrice" label="租金总价" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<p>{{scope.row.totalRentalPrice}}</p>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</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 :'',
|
||||||
|
contractNumber : '',
|
||||||
|
contractName : '',
|
||||||
|
pricingMethod : "",
|
||||||
|
signingDate : '',
|
||||||
|
parkId : "",
|
||||||
|
merchantName : "",
|
||||||
|
totalRentalPrice : "",
|
||||||
|
totalDeposit : '',
|
||||||
|
payDeposit : "",
|
||||||
|
returnDeposit : "",
|
||||||
|
startTime : '',
|
||||||
|
endTime : '',
|
||||||
|
leaseTerm : '',
|
||||||
|
contacts : '',
|
||||||
|
contactsPhone : '',
|
||||||
|
contractStatus : "10",
|
||||||
|
creationTime : "",
|
||||||
|
contractExplain : '',
|
||||||
|
contractEnclosure : [],
|
||||||
|
spacecontractList:[],
|
||||||
|
},
|
||||||
|
pricingMethodOptions:[{"fullName":"月付","id":"1"},{"fullName":"季付","id":"2"},{"fullName":"年付","id":"3"}],
|
||||||
|
pricingMethodProps:{"label":"fullName","value":"id" },
|
||||||
|
parkIdProps:{"label":"park_name","value":"park_number" },
|
||||||
|
merchantNameProps:{"label":"cmp_nm","value":"id" },
|
||||||
|
payDepositOptions:[{"fullName":"选项1","id":"1"},{"fullName":"选项2","id":"2"}],
|
||||||
|
payDepositProps:{"label":"fullName","value":"id" },
|
||||||
|
returnDepositOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
|
||||||
|
returnDepositProps:{"label":"fullName","value":"id" },
|
||||||
|
contractStatusOptions:[{"fullName":"待确认","id":"10"},{"fullName":"已确认","id":"20"},{"fullName":"已结案","id":"30"},{"fullName":"待确认","id":"21"}],
|
||||||
|
contractStatusProps:{"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
|
||||||
|
},
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.$emit('refresh')
|
||||||
|
},
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || 0;
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if(this.dataForm.id){
|
||||||
|
this.loading = true
|
||||||
|
request({
|
||||||
|
url: '/api/example/Contract/detail/'+this.dataForm.id,
|
||||||
|
method: 'get'
|
||||||
|
}).then(res => {
|
||||||
|
this.dataInfo(res.data)
|
||||||
|
this.loading = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog title="合同确认" :visible.sync="showDialog" width="30%" @close="handleDialogClose">
|
||||||
|
<el-form ref="form" :model="form" label-width="120px">
|
||||||
|
<el-form-item label="审核意见">
|
||||||
|
<el-input v-model="form.adjustComm" placeholder="请输入审核意见"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||||
|
<el-button type="danger" @click="rollback">驳 回</el-button>
|
||||||
|
<el-button @click="showDialog = false">取 消</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
showDialog: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
selectedRows: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
onSubmit: {
|
||||||
|
type: Function,
|
||||||
|
default: () => { },
|
||||||
|
},
|
||||||
|
onRollback: {
|
||||||
|
type: Function,
|
||||||
|
default: () => { },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
approveRemarks: '',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleDialogClose() {
|
||||||
|
this.form.approveRemarks = ''; // 清空输入框内容
|
||||||
|
this.$emit('update:showDialog', false); // 通知父组件更新 showDialog
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
this.onSubmit({
|
||||||
|
approveRemarks: this.form.approveRemarks,
|
||||||
|
});
|
||||||
|
this.handleDialogClose(); // 关闭弹窗
|
||||||
|
},
|
||||||
|
rollback() {
|
||||||
|
this.onRollback({
|
||||||
|
approveRemarks: this.form.approveRemarks,
|
||||||
|
});
|
||||||
|
this.handleDialogClose(); // 关闭弹窗
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,51 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog title="合同结束" :visible.sync="showEndDialog" width="30%" @close="handleDialogClose">
|
||||||
|
<el-form ref="form" :model="form" label-width="120px">
|
||||||
|
<el-form-item label="备注说明">
|
||||||
|
<el-input v-model="form.adjustComm" placeholder="请输入备注说明"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleEndSubmit">确 定</el-button>
|
||||||
|
<el-button @click="showEndDialog = false">取 消</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
showEndDialog: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
selectedRows: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
onEndSubmit: {
|
||||||
|
type: Function,
|
||||||
|
default: () => { },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {
|
||||||
|
approveRemarks: '同意',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleDialogClose() {
|
||||||
|
this.form.approveRemarks = ''; // 清空输入框内容
|
||||||
|
this.$emit('update:showEndDialog', false); // 通知父组件更新 showDialog
|
||||||
|
},
|
||||||
|
handleEndSubmit() {
|
||||||
|
this.onEndSubmit({
|
||||||
|
approveRemarks: this.form.approveRemarks,
|
||||||
|
});
|
||||||
|
this.handleDialogClose(); // 关闭弹窗
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,935 @@
|
|||||||
|
<template>
|
||||||
|
<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 ? '新建' : '编辑'" />
|
||||||
|
<div class="options">
|
||||||
|
<el-dropdown class="dropdown" placement="bottom">
|
||||||
|
<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>
|
||||||
|
<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-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<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="small" label-width="100px"
|
||||||
|
label-position="right">
|
||||||
|
<template v-if="!loading">
|
||||||
|
<!-- 具体表单 -->
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="合同编号" prop="contractNumber">
|
||||||
|
<JnpfInput v-model="dataForm.contractNumber" @change="changeData('contractNumber', -1)"
|
||||||
|
placeholder="自动生成" disabled :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="合同名称" prop="contractName">
|
||||||
|
<JnpfInput v-model="dataForm.contractName" @change="changeData('contractName', -1)"
|
||||||
|
placeholder="请输入合同名称" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="计价方式" prop="pricingMethod">
|
||||||
|
<JnpfSelect v-model="dataForm.pricingMethod" @change="changeData('pricingMethod', -1)"
|
||||||
|
placeholder="请选择计价方式" clearable :style='{ "width": "100%" }'
|
||||||
|
:options="pricingMethodOptions" :props="pricingMethodProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="签订日期" prop="signingDate">
|
||||||
|
<JnpfDatePicker v-model="dataForm.signingDate" @change="changeData('signingDate', -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="parkId">
|
||||||
|
<JnpfSelect v-model="dataForm.parkId" @change="changeData('parkId', -1)"
|
||||||
|
placeholder="请选择园区" clearable :style='{ "width": "100%" }' :options="parkIdOptions"
|
||||||
|
:props="parkIdProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="商户名称" prop="merchantName">
|
||||||
|
<JnpfSelect v-model="dataForm.merchantName" @change="changeData('merchantName', -1)"
|
||||||
|
placeholder="请选择" clearable :style='{ "width": "100%" }' filterable
|
||||||
|
:options="merchantNameOptions" :props="merchantNameProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="租金总价" prop="totalRentalPrice">
|
||||||
|
<JnpfInput v-model="dataForm.totalRentalPrice"
|
||||||
|
@change="changeData('totalRentalPrice', -1)" placeholder="请输入租金总价" clearable
|
||||||
|
:style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="押金总计" prop="totalDeposit">
|
||||||
|
<JnpfInput v-model="dataForm.totalDeposit" @change="changeData('totalDeposit', -1)"
|
||||||
|
placeholder="请输入押金总计" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="支付方式" prop="payDeposit">
|
||||||
|
<JnpfSelect v-model="dataForm.payDeposit" @change="changeData('payDeposit', -1)"
|
||||||
|
placeholder="请选择押金支付方式" clearable :style='{ "width": "100%" }'
|
||||||
|
:options="payDepositOptions" :props="payDepositProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="退还方式" prop="returnDeposit">
|
||||||
|
<JnpfSelect v-model="dataForm.returnDeposit" @change="changeData('returnDeposit', -1)"
|
||||||
|
placeholder="请选择押金退还方式" clearable :style='{ "width": "100%" }'
|
||||||
|
:options="returnDepositOptions" :props="returnDepositProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</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="leaseTerm">
|
||||||
|
<JnpfInput v-model="dataForm.leaseTerm" @change="changeData('leaseTerm', -1)"
|
||||||
|
placeholder="自动生成" disabled addonAfter="月" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</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="contractStatus">
|
||||||
|
<JnpfSelect v-model="dataForm.contractStatus" @change="changeData('contractStatus', -1)"
|
||||||
|
placeholder="请选择" disabled clearable :style='{ "width": "100%" }'
|
||||||
|
:options="contractStatusOptions" :props="contractStatusProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<jnpf-form-tip-item label="合同说明" prop="contractExplain">
|
||||||
|
<JnpfTextarea v-model="dataForm.contractExplain"
|
||||||
|
@change="changeData('contractExplain', -1)" placeholder="请输入合同说明"
|
||||||
|
:style='{ "width": "100%" }' true type="textarea"
|
||||||
|
:autosize='{ "minRows": 4, "maxRows": 4 }'>
|
||||||
|
</JnpfTextarea>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<jnpf-form-tip-item label="合同附件" prop="contractEnclosure">
|
||||||
|
<JnpfUploadFile v-model="dataForm.contractEnclosure"
|
||||||
|
@change="changeData('contractEnclosure', -1)" :fileSize="10" sizeUnit="MB"
|
||||||
|
:limit="9" pathType="defaultPath" :isAccount="0" buttonText="点击上传">
|
||||||
|
</JnpfUploadFile>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<jnpf-form-tip-item label-width="0">
|
||||||
|
<div class="JNPF-common-title">
|
||||||
|
<h2>空间列表</h2>
|
||||||
|
</div>
|
||||||
|
<el-table :data="dataForm.spacecontractList" size='mini'>
|
||||||
|
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||||
|
<el-table-column label="合同行号" tipLabel="后台自动生成" prop="contractLineNumber">
|
||||||
|
<template slot="header" v-if="false">
|
||||||
|
<span class="required-sign">*</span>合同行号
|
||||||
|
<span slot="label">
|
||||||
|
<el-tooltip placement="top" content='后台自动生成'>
|
||||||
|
<a class='el-icon-question tooltip-question'></a>
|
||||||
|
</el-tooltip>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<JnpfInput v-model="scope.row.contractLineNumber"
|
||||||
|
@change="changeData('spacecontract-contractLineNumber', scope.$index)"
|
||||||
|
placeholder="合同行号" disabled clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="空间名称" prop="spaceName">
|
||||||
|
<template slot="header" v-if="false">
|
||||||
|
<span class="required-sign">*</span>空间名称
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<JnpfPopupSelect v-model="scope.row.spaceName"
|
||||||
|
@change="changeData('spacecontract-spaceName', scope.$index)"
|
||||||
|
:rowIndex="scope.$index" :formData="dataForm"
|
||||||
|
:templateJson="interfaceRes.spacecontractspaceName" placeholder="请选择"
|
||||||
|
propsValue="id" popupWidth="800px" popupTitle="选择数据" popupType="dialog"
|
||||||
|
relationField='name' :field="'spaceName' + scope.$index"
|
||||||
|
interfaceId="582491427901014533" :pageSize="20"
|
||||||
|
:columnOptions="spacecontractspaceNamecolumnOptions" clearable
|
||||||
|
:style='{ "width": "100%" }'>
|
||||||
|
</JnpfPopupSelect>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="空间面积" prop="spaceArea">
|
||||||
|
<template slot="header" v-if="false">
|
||||||
|
<span class="required-sign">*</span>空间面积
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<JnpfInput v-model="scope.row.spaceArea"
|
||||||
|
@change="changeData('spacecontract-spaceArea', scope.$index)"
|
||||||
|
placeholder="请输入空间面积" disabled clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="租金总价" prop="totalRentalPrice">
|
||||||
|
<template slot="header" v-if="false">
|
||||||
|
<span class="required-sign">*</span>租金总价
|
||||||
|
</template>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<JnpfInput v-model="scope.row.totalRentalPrice"
|
||||||
|
@change="changeData('spacecontract-totalRentalPrice', scope.$index)"
|
||||||
|
placeholder="请输入租金总价" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="50">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||||
|
@click="delspacecontractList(scope.$index)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="table-actions" @click="addspacecontractList()">
|
||||||
|
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||||
|
</div>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</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: {
|
||||||
|
spacecontractList: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
|
||||||
|
},
|
||||||
|
//可选范围默认值
|
||||||
|
ableAll: {
|
||||||
|
},
|
||||||
|
tableRows: {
|
||||||
|
spacecontractList: {
|
||||||
|
contractLineNumber: '',
|
||||||
|
contractLineNumberOptions: [],
|
||||||
|
spaceName: '',
|
||||||
|
spaceNameOptions: [],
|
||||||
|
spaceArea: '',
|
||||||
|
spaceAreaOptions: [],
|
||||||
|
totalRentalPrice: '',
|
||||||
|
totalRentalPriceOptions: [],
|
||||||
|
enabledmark: undefined
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Vmodel: "",
|
||||||
|
currVmodel: "",
|
||||||
|
dataForm: {
|
||||||
|
contractNumber: undefined,
|
||||||
|
contractName: undefined,
|
||||||
|
pricingMethod: undefined,
|
||||||
|
signingDate: undefined,
|
||||||
|
parkId: undefined,
|
||||||
|
merchantName: undefined,
|
||||||
|
totalRentalPrice: undefined,
|
||||||
|
totalDeposit: undefined,
|
||||||
|
payDeposit: undefined,
|
||||||
|
returnDeposit: undefined,
|
||||||
|
startTime: undefined,
|
||||||
|
endTime: undefined,
|
||||||
|
leaseTerm: undefined,
|
||||||
|
contacts: undefined,
|
||||||
|
contactsPhone: undefined,
|
||||||
|
contractStatus: "10",
|
||||||
|
creationTime: undefined,
|
||||||
|
contractExplain: undefined,
|
||||||
|
contractEnclosure: [],
|
||||||
|
spacecontractList: [],
|
||||||
|
version: 0,
|
||||||
|
},
|
||||||
|
tableRequiredData: {},
|
||||||
|
dataRule:
|
||||||
|
{
|
||||||
|
contractName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入合同名称',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
pricingMethod: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择计价方式',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
signingDate: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择签订日期',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
parkId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择园区',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
merchantName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
totalRentalPrice: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入租金总价',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||||
|
message: '请输入正确的金额',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
totalDeposit: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入押金总计',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||||
|
message: '请输入正确的金额',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
payDeposit: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择押金支付方式',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
returnDeposit: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择押金退还方式',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
startTime: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
endTime: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
leaseTerm: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '自动生成',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contacts: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入联系人',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contactsPhone: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入联系电话',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contractStatus: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
contractEnclosure: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
pricingMethodOptions: [{ "fullName": "月付", "id": "1" }, { "fullName": "季付", "id": "2" }, { "fullName": "年付", "id": "3" }],
|
||||||
|
pricingMethodProps: { "label": "fullName", "value": "id" },
|
||||||
|
parkIdOptions: [],
|
||||||
|
parkIdProps: { "label": "park_name", "value": "park_number" },
|
||||||
|
merchantNameOptions: [],
|
||||||
|
merchantNameProps: { "label": "cmp_nm", "value": "id" },
|
||||||
|
payDepositOptions: [{ "fullName": "选项1", "id": "1" }, { "fullName": "选项2", "id": "2" }],
|
||||||
|
payDepositProps: { "label": "fullName", "value": "id" },
|
||||||
|
returnDepositOptions: [{ "fullName": "选项一", "id": "1" }, { "fullName": "选项二", "id": "2" }],
|
||||||
|
returnDepositProps: { "label": "fullName", "value": "id" },
|
||||||
|
contractStatusOptions: [{ "fullName": "待确认", "id": "10" }, { "fullName": "已确认", "id": "20" }, { "fullName": "已结案", "id": "30" }, { "fullName": "待确认", "id": "21" }],
|
||||||
|
contractStatusProps: { "label": "fullName", "value": "id" },
|
||||||
|
spacecontractspaceNamecolumnOptions: [{ "label": "园区编码", "value": "code" }, { "label": "园区名称", "value": "name" },],
|
||||||
|
childIndex: -1,
|
||||||
|
isEdit: false,
|
||||||
|
interfaceRes: {
|
||||||
|
contractNumber: [],
|
||||||
|
contractName: [],
|
||||||
|
pricingMethod: [],
|
||||||
|
signingDate: [],
|
||||||
|
parkId: [],
|
||||||
|
merchantName: [],
|
||||||
|
totalRentalPrice: [],
|
||||||
|
totalDeposit: [],
|
||||||
|
payDeposit: [],
|
||||||
|
returnDeposit: [],
|
||||||
|
startTime: [],
|
||||||
|
endTime: [],
|
||||||
|
leaseTerm: [],
|
||||||
|
contacts: [],
|
||||||
|
contactsPhone: [],
|
||||||
|
contractStatus: [],
|
||||||
|
creationTime: [],
|
||||||
|
contractExplain: [],
|
||||||
|
contractEnclosure: [],
|
||||||
|
spacecontractcontractLineNumber: [],
|
||||||
|
spacecontractspaceName: [],
|
||||||
|
spacecontractspaceArea: [],
|
||||||
|
spacecontracttotalRentalPrice: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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/Contract/' + id,
|
||||||
|
method: 'get'
|
||||||
|
}).then(res => {
|
||||||
|
this.dataInfo(res.data)
|
||||||
|
});
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
this.visible = false
|
||||||
|
this.$emit('refreshDataList', true)
|
||||||
|
},
|
||||||
|
changeData(model, index) {
|
||||||
|
if (model == 'startTime' && this.dataForm.endTime != undefined) {
|
||||||
|
const date1 = new Date(this.dataForm.startTime);
|
||||||
|
const date2 = new Date(this.dataForm.endTime);
|
||||||
|
let yearsDiff = date2.getFullYear() - date1.getFullYear();
|
||||||
|
let monthsDiff = date2.getMonth() - date1.getMonth();
|
||||||
|
if (monthsDiff < 0) {
|
||||||
|
monthsDiff += 12;
|
||||||
|
yearsDiff--;
|
||||||
|
}
|
||||||
|
const daysDiff = date2.getDate() - date1.getDate();
|
||||||
|
if (daysDiff > 0) {
|
||||||
|
monthsDiff++;
|
||||||
|
}
|
||||||
|
this.dataForm.leaseTerm = yearsDiff * 12 + monthsDiff;
|
||||||
|
}
|
||||||
|
if (model == 'endTime' && this.dataForm.startTime != undefined) {
|
||||||
|
const date1 = new Date(this.dataForm.startTime);
|
||||||
|
const date2 = new Date(this.dataForm.endTime);
|
||||||
|
let yearsDiff = date2.getFullYear() - date1.getFullYear();
|
||||||
|
let monthsDiff = date2.getMonth() - date1.getMonth();
|
||||||
|
if (monthsDiff < 0) {
|
||||||
|
monthsDiff += 12;
|
||||||
|
yearsDiff--;
|
||||||
|
}
|
||||||
|
const daysDiff = date2.getDate() - date1.getDate();
|
||||||
|
if (daysDiff > 0) {
|
||||||
|
monthsDiff++;
|
||||||
|
}
|
||||||
|
this.dataForm.leaseTerm = yearsDiff * 12 + monthsDiff;
|
||||||
|
}
|
||||||
|
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() {
|
||||||
|
this.getparkIdOptions();
|
||||||
|
this.getmerchantNameOptions();
|
||||||
|
},
|
||||||
|
spacecontractExist() {
|
||||||
|
let isOk = true;
|
||||||
|
for (let i = 0; i < this.dataForm.spacecontractList.length; i++) {
|
||||||
|
const e = this.dataForm.spacecontractList[i];
|
||||||
|
if (e.totalRentalPrice) {
|
||||||
|
var regPos = [{ "pattern": "/^([1-9][\\d]*|0)(\\.[\\d]+)?$/", "message": "请输入正确的金额" }]
|
||||||
|
for (let i = 0; i < regPos.length; i++) {
|
||||||
|
const element = regPos[i];
|
||||||
|
if (element.pattern && !eval(element.pattern).test(e.totalRentalPrice)) {
|
||||||
|
this.$message({
|
||||||
|
message: element.message,
|
||||||
|
type: 'error',
|
||||||
|
duration: 1000
|
||||||
|
});
|
||||||
|
isOk = false
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isOk;
|
||||||
|
},
|
||||||
|
getparkIdOptions() {
|
||||||
|
const index = this.childIndex
|
||||||
|
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parkId))
|
||||||
|
for (let i = 0; i < templateJsonList.length; i++) {
|
||||||
|
let json = templateJsonList[i];
|
||||||
|
if (json.relationField) {
|
||||||
|
let relationFieldAll = json.relationField.split("-");
|
||||||
|
let val = json.defaultValue;
|
||||||
|
if (relationFieldAll.length > 1 && index > -1) {
|
||||||
|
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||||
|
} else {
|
||||||
|
val = this.dataForm[relationFieldAll]
|
||||||
|
}
|
||||||
|
json.defaultValue = val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let template = {
|
||||||
|
paramList: templateJsonList
|
||||||
|
}
|
||||||
|
getDataInterfaceRes('582491427901014533', template).then(res => {
|
||||||
|
let data = res.data
|
||||||
|
this.parkIdOptions = data
|
||||||
|
this.changeDataFormData(1, 'parkId', 'parkId', index, '')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getmerchantNameOptions() {
|
||||||
|
const index = this.childIndex
|
||||||
|
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.merchantName))
|
||||||
|
for (let i = 0; i < templateJsonList.length; i++) {
|
||||||
|
let json = templateJsonList[i];
|
||||||
|
if (json.relationField) {
|
||||||
|
let relationFieldAll = json.relationField.split("-");
|
||||||
|
let val = json.defaultValue;
|
||||||
|
if (relationFieldAll.length > 1 && index > -1) {
|
||||||
|
val = this.dataForm[relationFieldAll[0] + 'List'] && this.dataForm[relationFieldAll[0] + 'List'].length ? this.dataForm[relationFieldAll[0] + 'List'][index][relationFieldAll[1]] : ''
|
||||||
|
} else {
|
||||||
|
val = this.dataForm[relationFieldAll]
|
||||||
|
}
|
||||||
|
json.defaultValue = val
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let template = {
|
||||||
|
paramList: templateJsonList
|
||||||
|
}
|
||||||
|
getDataInterfaceRes('582842667524685829', template).then(res => {
|
||||||
|
let data = res.data
|
||||||
|
this.merchantNameOptions = data
|
||||||
|
this.changeDataFormData(1, 'merchantName', 'merchantName', index, '')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
this.$emit('refresh')
|
||||||
|
},
|
||||||
|
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/Contract/' + 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) {
|
||||||
|
if (!this.spacecontractExist()) return
|
||||||
|
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/Contract',
|
||||||
|
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/Contract/' + 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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addspacecontractList() {
|
||||||
|
let item = {
|
||||||
|
contractLineNumber: undefined,
|
||||||
|
spaceName: '',
|
||||||
|
spaceArea: undefined,
|
||||||
|
totalRentalPrice: undefined,
|
||||||
|
}
|
||||||
|
this.getspacecontractList(item)
|
||||||
|
},
|
||||||
|
delspacecontractList(index) {
|
||||||
|
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.dataForm.spacecontractList.splice(index, 1);
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getspacecontractList(value) {
|
||||||
|
let item = { ...this.tableRows.spacecontractList, ...value }
|
||||||
|
this.dataForm.spacecontractList.push(item)
|
||||||
|
this.childIndex = this.dataForm.spacecontractList.length - 1
|
||||||
|
this.isEdit = true
|
||||||
|
this.isEdit = false
|
||||||
|
this.childIndex = -1
|
||||||
|
},
|
||||||
|
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()
|
||||||
|
for (let i = 0; i < _dataAll.spacecontractList.length; i++) {
|
||||||
|
this.childIndex = i
|
||||||
|
}
|
||||||
|
this.childIndex = -1
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,258 @@
|
|||||||
|
<template>
|
||||||
|
<transition name="el-zoom-in-center">
|
||||||
|
<div class="JNPF-preview-main">
|
||||||
|
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
|
||||||
|
<div class="JNPF-common-page-header">
|
||||||
|
<el-page-header @back="goBack"
|
||||||
|
content="详情"/>
|
||||||
|
<div class="options">
|
||||||
|
<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" size="small" label-width="100px" label-position="right" >
|
||||||
|
<template v-if="!loading">
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="公司编码"
|
||||||
|
prop="cmpNo" >
|
||||||
|
<p>{{dataForm.cmpNo}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="公司名称"
|
||||||
|
prop="cmpNm" >
|
||||||
|
<p>{{dataForm.cmpNm}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="所属行业"
|
||||||
|
prop="industry" >
|
||||||
|
<p>{{dataForm.industry}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="公司规模"
|
||||||
|
prop="companySize" >
|
||||||
|
<p>{{ dataForm.companySize }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="公司类型"
|
||||||
|
prop="compType" >
|
||||||
|
<p>{{ dataForm.compType }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="公司状态"
|
||||||
|
prop="companyStatus" >
|
||||||
|
<p>{{ dataForm.companyStatus }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="联系人"
|
||||||
|
prop="userNm" >
|
||||||
|
<p>{{dataForm.userNm}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="联系电话"
|
||||||
|
prop="contactNumber" >
|
||||||
|
<p>{{dataForm.contactNumber}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="邮箱"
|
||||||
|
prop="mailbox" >
|
||||||
|
<p>{{dataForm.mailbox}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="入驻状态"
|
||||||
|
prop="entryStatus" >
|
||||||
|
<p>{{ dataForm.entryStatus }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="营业执照照片"
|
||||||
|
prop="businessLicensePhoto" >
|
||||||
|
<JnpfUploadImg v-model="dataForm.businessLicensePhoto"
|
||||||
|
disabled
|
||||||
|
detailed :fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0" >
|
||||||
|
</JnpfUploadImg>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="注册地址"
|
||||||
|
prop="registeredAddress" >
|
||||||
|
<p>{{dataForm.registeredAddress}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="统一社会信用代码"
|
||||||
|
prop="unifiedSocialCreditCode" >
|
||||||
|
<p>{{dataForm.unifiedSocialCreditCode}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="成立日期"
|
||||||
|
prop="incorporationDate" >
|
||||||
|
<p>{{dataForm.incorporationDate}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="法定代表人"
|
||||||
|
prop="lgPersonNm" >
|
||||||
|
<p>{{dataForm.lgPersonNm}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="公司注册号"
|
||||||
|
prop="companyRegistrationNumber" >
|
||||||
|
<p>{{dataForm.companyRegistrationNumber}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="办公地址"
|
||||||
|
prop="officeAddress" >
|
||||||
|
<p>{{dataForm.officeAddress}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="注册资本"
|
||||||
|
prop="registeredCapital" >
|
||||||
|
<p>{{dataForm.registeredCapital}}万</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="注册资金单位"
|
||||||
|
prop="registeredCapitalUnit" >
|
||||||
|
<p>{{ dataForm.registeredCapitalUnit }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="银行账号"
|
||||||
|
prop="bankAccount" >
|
||||||
|
<p>{{dataForm.bankAccount}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="开户银行"
|
||||||
|
prop="openingBank" >
|
||||||
|
<p>{{dataForm.openingBank}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" >
|
||||||
|
<jnpf-form-tip-item label="经营范围"
|
||||||
|
prop="natureObusiness" >
|
||||||
|
<p>{{dataForm.natureObusiness}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</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 :'',
|
||||||
|
cmpNo : '',
|
||||||
|
cmpNm : '',
|
||||||
|
industry : "",
|
||||||
|
companySize : "1",
|
||||||
|
compType : "1",
|
||||||
|
companyStatus : "1",
|
||||||
|
userNm : '',
|
||||||
|
contactNumber : '',
|
||||||
|
mailbox : '',
|
||||||
|
entryStatus : "1",
|
||||||
|
businessLicensePhoto : [],
|
||||||
|
registeredAddress : '',
|
||||||
|
unifiedSocialCreditCode : '',
|
||||||
|
incorporationDate : '',
|
||||||
|
lgPersonNm : '',
|
||||||
|
companyRegistrationNumber : '',
|
||||||
|
officeAddress : '',
|
||||||
|
registeredCapital : '',
|
||||||
|
registeredCapitalUnit : "1",
|
||||||
|
bankAccount : '',
|
||||||
|
openingBank : '',
|
||||||
|
natureObusiness : '',
|
||||||
|
},
|
||||||
|
industryProps:{"label":"fullName","value":"enCode" },
|
||||||
|
companySizeOptions:[{"fullName":"特大型","id":"1"},{"fullName":"大型","id":"2"},{"fullName":"中型","id":"3"},{"fullName":"小型","id":"4"},{"fullName":"微型","id":"5"}],
|
||||||
|
companySizeProps:{"label":"fullName","value":"id" },
|
||||||
|
compTypeOptions:[{"fullName":"有限责任公司","id":"1"},{"fullName":"股份有限公司","id":"2"}],
|
||||||
|
compTypeProps:{"label":"fullName","value":"id" },
|
||||||
|
companyStatusOptions:[{"fullName":"正常","id":"1"},{"fullName":"注销","id":"2"},{"fullName":"停业","id":"3"}],
|
||||||
|
companyStatusProps:{"label":"fullName","value":"id" },
|
||||||
|
entryStatusOptions:[{"fullName":"待签约","id":"1"},{"fullName":"已入驻","id":"2"},{"fullName":"已退出","id":"3"}],
|
||||||
|
entryStatusProps:{"label":"fullName","value":"id" },
|
||||||
|
registeredCapitalUnitOptions:[{"fullName":"人民币","id":"1"},{"fullName":"美元","id":"2"}],
|
||||||
|
registeredCapitalUnitProps:{"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
|
||||||
|
},
|
||||||
|
|
||||||
|
goBack() {
|
||||||
|
this.$emit('refresh')
|
||||||
|
},
|
||||||
|
init(id) {
|
||||||
|
this.dataForm.id = id || 0;
|
||||||
|
this.visible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
if(this.dataForm.id){
|
||||||
|
this.loading = true
|
||||||
|
request({
|
||||||
|
url: '/api/example/EnterpriseMerchants/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,819 @@
|
|||||||
|
<template>
|
||||||
|
<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 ? '新建':'编辑'" />
|
||||||
|
<div class="options">
|
||||||
|
<el-dropdown class="dropdown" placement="bottom">
|
||||||
|
<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>
|
||||||
|
<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-menu>
|
||||||
|
</el-dropdown>
|
||||||
|
<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="small" label-width="150px"
|
||||||
|
label-position="right">
|
||||||
|
<template v-if="!loading">
|
||||||
|
<!-- 具体表单 -->
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="padding:15px 0px">
|
||||||
|
<span style="color: #409EFF;">▋</span>
|
||||||
|
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">基础信息</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="公司编码" prop="cmpNo">
|
||||||
|
<JnpfInput v-model="dataForm.cmpNo" @change="changeData('cmpNo',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="公司名称" prop="cmpNm">
|
||||||
|
<JnpfInput v-model="dataForm.cmpNm" @change="changeData('cmpNm',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="所属行业" prop="industry">
|
||||||
|
<JnpfSelect v-model="dataForm.industry" @change="changeData('industry',-1)" placeholder="请选择" clearable
|
||||||
|
:style='{"width":"100%"}' :options="industryOptions" :props="industryProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="公司规模" prop="companySize">
|
||||||
|
<JnpfSelect v-model="dataForm.companySize" @change="changeData('companySize',-1)" placeholder="请选择"
|
||||||
|
clearable :style='{"width":"100%"}' :options="companySizeOptions" :props="companySizeProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="公司类型" prop="compType">
|
||||||
|
<JnpfSelect v-model="dataForm.compType" @change="changeData('compType',-1)" placeholder="请选择" clearable
|
||||||
|
:style='{"width":"100%"}' :options="compTypeOptions" :props="compTypeProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="公司状态" prop="companyStatus">
|
||||||
|
<JnpfSelect v-model="dataForm.companyStatus" @change="changeData('companyStatus',-1)" placeholder="请选择"
|
||||||
|
clearable :style='{"width":"100%"}' :options="companyStatusOptions" :props="companyStatusProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="联系人" prop="userNm">
|
||||||
|
<JnpfInput v-model="dataForm.userNm" @change="changeData('userNm',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="联系电话" prop="contactNumber">
|
||||||
|
<JnpfInput v-model="dataForm.contactNumber" @change="changeData('contactNumber',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="邮箱" prop="mailbox">
|
||||||
|
<JnpfInput v-model="dataForm.mailbox" @change="changeData('mailbox',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="入驻状态" prop="entryStatus">
|
||||||
|
<JnpfSelect v-model="dataForm.entryStatus" @change="changeData('entryStatus',-1)" placeholder="请选择"
|
||||||
|
clearable :style='{"width":"100%"}' :options="entryStatusOptions" :props="entryStatusProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="padding:15px 0px">
|
||||||
|
<span style="color: #409EFF;">▋</span>
|
||||||
|
<span style="font-size: 14px;font-weight: 500;color:rgb(102, 102, 102);">主体信息</span>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="营业执照照片" prop="businessLicensePhoto">
|
||||||
|
<JnpfUploadImg v-model="dataForm.businessLicensePhoto" @change="changeData('businessLicensePhoto',-1)"
|
||||||
|
:fileSize="10" sizeUnit="MB" :limit="1" pathType="defaultPath" :isAccount="0">
|
||||||
|
</JnpfUploadImg>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="注册地址" prop="registeredAddress">
|
||||||
|
<JnpfInput v-model="dataForm.registeredAddress" @change="changeData('registeredAddress',-1)"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="统一社会信用代码" prop="unifiedSocialCreditCode">
|
||||||
|
<JnpfInput v-model="dataForm.unifiedSocialCreditCode" @change="changeData('unifiedSocialCreditCode',-1)"
|
||||||
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="成立日期" prop="incorporationDate">
|
||||||
|
<JnpfDatePicker v-model="dataForm.incorporationDate" @change="changeData('incorporationDate',-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="lgPersonNm">
|
||||||
|
<JnpfInput v-model="dataForm.lgPersonNm" @change="changeData('lgPersonNm',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="公司注册号" prop="companyRegistrationNumber">
|
||||||
|
<JnpfInput v-model="dataForm.companyRegistrationNumber"
|
||||||
|
@change="changeData('companyRegistrationNumber',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="办公地址" prop="officeAddress">
|
||||||
|
<JnpfInput v-model="dataForm.officeAddress" @change="changeData('officeAddress',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="注册资本" prop="registeredCapital">
|
||||||
|
<JnpfInput v-model="dataForm.registeredCapital" @change="changeData('registeredCapital',-1)"
|
||||||
|
placeholder="请输入" addonAfter="万" clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="注册资金单位" prop="registeredCapitalUnit">
|
||||||
|
<JnpfSelect v-model="dataForm.registeredCapitalUnit" @change="changeData('registeredCapitalUnit',-1)"
|
||||||
|
placeholder="请选择" clearable :style='{"width":"100%"}' :options="registeredCapitalUnitOptions"
|
||||||
|
:props="registeredCapitalUnitProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="银行账号" prop="bankAccount">
|
||||||
|
<JnpfInput v-model="dataForm.bankAccount" @change="changeData('bankAccount',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="开户银行" prop="openingBank">
|
||||||
|
<JnpfInput v-model="dataForm.openingBank" @change="changeData('openingBank',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<jnpf-form-tip-item label="经营范围" prop="natureObusiness">
|
||||||
|
<JnpfTextarea v-model="dataForm.natureObusiness" @change="changeData('natureObusiness',-1)"
|
||||||
|
placeholder="请输入" :style='{"width":"100%"}' true type="textarea"
|
||||||
|
:autosize='{"minRows":4,"maxRows":4}'>
|
||||||
|
</JnpfTextarea>
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
</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: {
|
||||||
|
cmpNo: undefined,
|
||||||
|
cmpNm: undefined,
|
||||||
|
industry: undefined,
|
||||||
|
companySize: "1",
|
||||||
|
compType: "1",
|
||||||
|
companyStatus: "1",
|
||||||
|
userNm: undefined,
|
||||||
|
contactNumber: undefined,
|
||||||
|
mailbox: undefined,
|
||||||
|
entryStatus: "1",
|
||||||
|
businessLicensePhoto: [],
|
||||||
|
registeredAddress: undefined,
|
||||||
|
unifiedSocialCreditCode: undefined,
|
||||||
|
incorporationDate: undefined,
|
||||||
|
lgPersonNm: undefined,
|
||||||
|
companyRegistrationNumber: undefined,
|
||||||
|
officeAddress: undefined,
|
||||||
|
registeredCapital: undefined,
|
||||||
|
registeredCapitalUnit: "1",
|
||||||
|
bankAccount: undefined,
|
||||||
|
openingBank: undefined,
|
||||||
|
natureObusiness: undefined,
|
||||||
|
version: 0,
|
||||||
|
},
|
||||||
|
tableRequiredData: {},
|
||||||
|
dataRule: {
|
||||||
|
cmpNo: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
cmpNm: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
industry: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
companySize: [{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
compType: [{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
companyStatus: [{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
userNm: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
contactNumber: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
|
||||||
|
message: '请输入正确的联系方式',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
mailbox: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^[a-z0-9]+([._\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/,
|
||||||
|
message: '请输入正确的邮箱',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
businessLicensePhoto: [{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
registeredAddress: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
unifiedSocialCreditCode: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
incorporationDate: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
lgPersonNm: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
companyRegistrationNumber: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
officeAddress: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
registeredCapital: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||||
|
message: '请输入正确的金额',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
registeredCapitalUnit: [{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
bankAccount: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
natureObusiness: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
},
|
||||||
|
industryOptions: [],
|
||||||
|
industryProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "enCode"
|
||||||
|
},
|
||||||
|
companySizeOptions: [{
|
||||||
|
"fullName": "特大型",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "大型",
|
||||||
|
"id": "2"
|
||||||
|
}, {
|
||||||
|
"fullName": "中型",
|
||||||
|
"id": "3"
|
||||||
|
}, {
|
||||||
|
"fullName": "小型",
|
||||||
|
"id": "4"
|
||||||
|
}, {
|
||||||
|
"fullName": "微型",
|
||||||
|
"id": "5"
|
||||||
|
}],
|
||||||
|
companySizeProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
compTypeOptions: [{
|
||||||
|
"fullName": "有限责任公司",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "股份有限公司",
|
||||||
|
"id": "2"
|
||||||
|
}],
|
||||||
|
compTypeProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
companyStatusOptions: [{
|
||||||
|
"fullName": "正常",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "注销",
|
||||||
|
"id": "2"
|
||||||
|
}, {
|
||||||
|
"fullName": "停业",
|
||||||
|
"id": "3"
|
||||||
|
}],
|
||||||
|
companyStatusProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
entryStatusOptions: [{
|
||||||
|
"fullName": "待签约",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "已入驻",
|
||||||
|
"id": "2"
|
||||||
|
}, {
|
||||||
|
"fullName": "已退出",
|
||||||
|
"id": "3"
|
||||||
|
}],
|
||||||
|
entryStatusProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
registeredCapitalUnitOptions: [{
|
||||||
|
"fullName": "人民币",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "美元",
|
||||||
|
"id": "2"
|
||||||
|
}],
|
||||||
|
registeredCapitalUnitProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
childIndex: -1,
|
||||||
|
isEdit: false,
|
||||||
|
interfaceRes: {
|
||||||
|
cmpNo: [],
|
||||||
|
cmpNm: [],
|
||||||
|
industry: [],
|
||||||
|
companySize: [],
|
||||||
|
compType: [],
|
||||||
|
companyStatus: [],
|
||||||
|
userNm: [],
|
||||||
|
contactNumber: [],
|
||||||
|
mailbox: [],
|
||||||
|
entryStatus: [],
|
||||||
|
businessLicensePhoto: [],
|
||||||
|
registeredAddress: [],
|
||||||
|
unifiedSocialCreditCode: [],
|
||||||
|
incorporationDate: [],
|
||||||
|
lgPersonNm: [],
|
||||||
|
companyRegistrationNumber: [],
|
||||||
|
officeAddress: [],
|
||||||
|
registeredCapital: [],
|
||||||
|
registeredCapitalUnit: [],
|
||||||
|
bankAccount: [],
|
||||||
|
openingBank: [],
|
||||||
|
natureObusiness: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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/EnterpriseMerchants/' + 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() {
|
||||||
|
this.getindustryOptions();
|
||||||
|
},
|
||||||
|
getindustryOptions() {
|
||||||
|
getDictionaryDataSelector('d59a3cf65f9847dbb08be449e3feae16').then(res => {
|
||||||
|
this.industryOptions = res.data.list
|
||||||
|
})
|
||||||
|
},
|
||||||
|
goBack() {
|
||||||
|
this.$emit('refresh')
|
||||||
|
},
|
||||||
|
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/EnterpriseMerchants/' + 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/EnterpriseMerchants',
|
||||||
|
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/EnterpriseMerchants/' + 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
File diff suppressed because one or more lines are too long
@ -1,504 +1,438 @@
|
|||||||
<template>
|
|
||||||
<transition name="el-zoom-in-center">
|
|
||||||
<div class="JNPF-preview-main">
|
|
||||||
<div class="JNPF-common-page-header">
|
<template>
|
||||||
<el-page-header
|
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
|
||||||
@back="goBack"
|
:close-on-click-modal="false" append-to-body
|
||||||
:content="!dataForm.id ? '新建' : '编辑'"
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
/>
|
width="800px">
|
||||||
<div class="options">
|
<el-row :gutter="15" class="">
|
||||||
<el-dropdown class="dropdown" placement="bottom">
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
|
||||||
<el-button style="width:70px">
|
<template v-if="!loading">
|
||||||
更 多<i class="el-icon-arrow-down el-icon--right"></i>
|
<!-- 具体表单 -->
|
||||||
</el-button>
|
<el-col :span="12" >
|
||||||
<el-dropdown-menu slot="dropdown">
|
<jnpf-form-tip-item
|
||||||
<template v-if="dataForm.id">
|
label="园区编码" prop="code" >
|
||||||
<el-dropdown-item @click.native="prev" :disabled="prevDis">
|
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
|
||||||
{{ "上一条" }}
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-dropdown-item>
|
</JnpfInput>
|
||||||
<el-dropdown-item @click.native="next" :disabled="nextDis">
|
</jnpf-form-tip-item>
|
||||||
{{ "下一条" }}
|
</el-col>
|
||||||
</el-dropdown-item>
|
<el-col :span="12" >
|
||||||
</template>
|
<jnpf-form-tip-item
|
||||||
<el-dropdown-item
|
label="园区名称" prop="name" >
|
||||||
type="primary"
|
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)"
|
||||||
@click.native="dataFormSubmit(2)"
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
:loading="continueBtnLoading"
|
</JnpfInput>
|
||||||
:disabled="btnLoading"
|
</jnpf-form-tip-item>
|
||||||
>
|
</el-col>
|
||||||
{{
|
<el-col :span="12" >
|
||||||
!dataForm.id ? "确定并新增" : "确定并继续"
|
<jnpf-form-tip-item
|
||||||
}}</el-dropdown-item
|
label="园区描述" prop="description" >
|
||||||
>
|
<JnpfInput v-model="dataForm.description" @change="changeData('description',-1)"
|
||||||
</el-dropdown-menu>
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
</el-dropdown>
|
</JnpfInput>
|
||||||
<el-button
|
</jnpf-form-tip-item>
|
||||||
type="primary"
|
</el-col>
|
||||||
@click="dataFormSubmit()"
|
<el-col :span="24" >
|
||||||
:loading="btnLoading"
|
<jnpf-form-tip-item
|
||||||
:disabled="continueBtnLoading"
|
label="备注" prop="remark" >
|
||||||
>
|
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
|
||||||
保 存</el-button
|
placeholder="请输入" clearable :style='{"width":"100%"}'>
|
||||||
>
|
</JnpfInput>
|
||||||
<el-button @click="goBack"> 取 消</el-button>
|
</jnpf-form-tip-item>
|
||||||
</div>
|
</el-col>
|
||||||
</div>
|
<!-- 表单结束 -->
|
||||||
<el-row
|
</template>
|
||||||
:gutter="15"
|
</el-form>
|
||||||
class=" main"
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
|
||||||
:style="{ margin: '0 auto', width: '100%' }"
|
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
|
||||||
>
|
</el-row>
|
||||||
<el-form
|
<span slot="footer" class="dialog-footer">
|
||||||
ref="formRef"
|
<div class="upAndDown-button" v-if="dataForm.id">
|
||||||
:model="dataForm"
|
<el-button @click="prev" :disabled='prevDis'>
|
||||||
:rules="dataRule"
|
{{'上一条'}}
|
||||||
size="small"
|
</el-button>
|
||||||
label-width="100px"
|
<el-button @click="next" :disabled='nextDis'>
|
||||||
label-position="right"
|
{{'下一条'}}
|
||||||
>
|
</el-button>
|
||||||
<template v-if="!loading">
|
</div>
|
||||||
<!-- 具体表单 -->
|
<el-button type="primary" @click="dataFormSubmit(2)" :loading="continueBtnLoading">
|
||||||
<el-col :span="12">
|
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-button>
|
||||||
<jnpf-form-tip-item label="园区编码" prop="code">
|
<el-button @click="visible = false"> 取 消</el-button>
|
||||||
<JnpfInput
|
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading"> 确 定</el-button>
|
||||||
v-model="dataForm.code"
|
</span>
|
||||||
@change="changeData('code', -1)"
|
</el-dialog>
|
||||||
placeholder="请输入"
|
</template>
|
||||||
clearable
|
|
||||||
:style="{ width: '100%' }"
|
|
||||||
>
|
|
||||||
</JnpfInput>
|
|
||||||
</jnpf-form-tip-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<jnpf-form-tip-item label="园区名称" prop="name">
|
|
||||||
<JnpfInput
|
|
||||||
v-model="dataForm.name"
|
|
||||||
@change="changeData('name', -1)"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '100%' }"
|
|
||||||
>
|
|
||||||
</JnpfInput>
|
|
||||||
</jnpf-form-tip-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<jnpf-form-tip-item label="描述" prop="description">
|
|
||||||
<JnpfInput
|
|
||||||
v-model="dataForm.description"
|
|
||||||
@change="changeData('description', -1)"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '100%' }"
|
|
||||||
>
|
|
||||||
</JnpfInput>
|
|
||||||
</jnpf-form-tip-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<jnpf-form-tip-item label="备注" prop="remark">
|
|
||||||
<JnpfInput
|
|
||||||
v-model="dataForm.remark"
|
|
||||||
@change="changeData('remark', -1)"
|
|
||||||
placeholder="请输入"
|
|
||||||
clearable
|
|
||||||
:style="{ width: '100%' }"
|
|
||||||
>
|
|
||||||
</JnpfInput>
|
|
||||||
</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>
|
|
||||||
</div>
|
|
||||||
</transition>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import request from "@/utils/request";
|
import request from '@/utils/request'
|
||||||
import { mapGetters } from "vuex";
|
import {mapGetters} from "vuex";
|
||||||
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
|
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
|
||||||
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
|
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
|
||||||
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
|
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
|
||||||
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
|
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
|
||||||
import {
|
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
|
||||||
getDateDay,
|
import { thousandsFormat } from "@/components/Generator/utils/index"
|
||||||
getLaterData,
|
export default {
|
||||||
getBeforeData,
|
components: { },
|
||||||
getBeforeTime,
|
props: [],
|
||||||
getLaterTime
|
data() {
|
||||||
} from "@/components/Generator/utils/index.js";
|
return {
|
||||||
import { thousandsFormat } from "@/components/Generator/utils/index";
|
dataFormSubmitType: 0,
|
||||||
export default {
|
continueBtnLoading: false,
|
||||||
components: {},
|
index: 0,
|
||||||
props: [],
|
prevDis: false,
|
||||||
data() {
|
nextDis: false,
|
||||||
return {
|
allList: [],
|
||||||
dataFormSubmitType: 0,
|
visible: false,
|
||||||
continueBtnLoading: false,
|
loading: false,
|
||||||
index: 0,
|
btnLoading: false,
|
||||||
prevDis: false,
|
formRef: 'formRef',
|
||||||
nextDis: false,
|
setting:{},
|
||||||
allList: [],
|
eventType: '',
|
||||||
visible: false,
|
userBoxVisible:false,
|
||||||
loading: false,
|
selectDialogVisible: false,
|
||||||
btnLoading: false,
|
currTableConf:{},
|
||||||
formRef: "formRef",
|
dataValueAll:{},
|
||||||
setting: {},
|
addTableConf:{
|
||||||
eventType: "",
|
},
|
||||||
userBoxVisible: false,
|
//可选范围默认值
|
||||||
selectDialogVisible: false,
|
ableAll:{
|
||||||
currTableConf: {},
|
},
|
||||||
dataValueAll: {},
|
tableRows:{
|
||||||
addTableConf: {},
|
},
|
||||||
//可选范围默认值
|
Vmodel:"",
|
||||||
ableAll: {},
|
currVmodel:"",
|
||||||
tableRows: {},
|
dataForm: {
|
||||||
Vmodel: "",
|
code : undefined,
|
||||||
currVmodel: "",
|
name : undefined,
|
||||||
dataForm: {
|
description : undefined,
|
||||||
code: undefined,
|
remark : undefined,
|
||||||
name: undefined,
|
type : "1",
|
||||||
description: undefined,
|
version: 0,
|
||||||
remark: undefined,
|
},
|
||||||
type: "1",
|
tableRequiredData: {},
|
||||||
version: 0
|
dataRule:
|
||||||
},
|
{
|
||||||
tableRequiredData: {},
|
code: [
|
||||||
dataRule: {
|
{
|
||||||
code: [
|
required: true,
|
||||||
{
|
message: '请输入',
|
||||||
required: true,
|
trigger: 'blur'
|
||||||
message: "请输入",
|
},
|
||||||
trigger: "blur"
|
],
|
||||||
}
|
name: [
|
||||||
],
|
{
|
||||||
name: [
|
required: true,
|
||||||
{
|
message: '请输入',
|
||||||
required: true,
|
trigger: 'blur'
|
||||||
message: "请输入",
|
},
|
||||||
trigger: "blur"
|
],
|
||||||
}
|
},
|
||||||
]
|
typeOptions:[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],
|
||||||
},
|
typeProps:{"label":"fullName","value":"id" },
|
||||||
typeOptions: [
|
childIndex:-1,
|
||||||
{ fullName: "园区", id: "1" },
|
isEdit:false,
|
||||||
{ fullName: "区域", id: "2" },
|
interfaceRes: {
|
||||||
{ fullName: "空间", id: "3" }
|
code:[] ,
|
||||||
],
|
name:[] ,
|
||||||
typeProps: { label: "fullName", value: "id" },
|
description:[] ,
|
||||||
childIndex: -1,
|
remark:[] ,
|
||||||
isEdit: false,
|
type:[] ,
|
||||||
interfaceRes: {
|
},
|
||||||
code: [],
|
|
||||||
name: [],
|
|
||||||
description: [],
|
|
||||||
remark: [],
|
|
||||||
type: []
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
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/Park/" + 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;
|
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
computed: {
|
||||||
dataAll() {},
|
...mapGetters(['userInfo'])
|
||||||
goBack() {
|
},
|
||||||
this.$emit("refresh");
|
watch: {},
|
||||||
},
|
created() {
|
||||||
clearData() {
|
this.dataAll()
|
||||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
|
this.initDefaultData()
|
||||||
},
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||||
init(id, isDetail, allList) {
|
},
|
||||||
this.prevDis = false;
|
mounted() {},
|
||||||
this.nextDis = false;
|
methods: {
|
||||||
this.allList = allList || [];
|
prev() {
|
||||||
if (allList.length) {
|
this.index--
|
||||||
this.index = this.allList.findIndex(item => item.id === id);
|
if (this.index === 0) {
|
||||||
if (this.index == 0) {
|
this.prevDis = true
|
||||||
this.prevDis = true;
|
}
|
||||||
}
|
this.nextDis = false
|
||||||
if (this.index == this.allList.length - 1) {
|
for (let index = 0; index < this.allList.length; index++) {
|
||||||
this.nextDis = true;
|
const element = this.allList[index];
|
||||||
}
|
if (this.index == index) {
|
||||||
} else {
|
this.getInfo(element.id)
|
||||||
this.prevDis = true;
|
}
|
||||||
this.nextDis = true;
|
}
|
||||||
}
|
},
|
||||||
this.dataForm.id = id || 0;
|
next() {
|
||||||
this.visible = true;
|
this.index++
|
||||||
this.$nextTick(() => {
|
if (this.index === this.allList.length - 1) {
|
||||||
if (this.dataForm.id) {
|
this.nextDis = true
|
||||||
this.loading = true;
|
}
|
||||||
request({
|
this.prevDis = false
|
||||||
url: "/api/example/Park/" + this.dataForm.id,
|
for (let index = 0; index < this.allList.length; index++) {
|
||||||
method: "get"
|
const element = this.allList[index];
|
||||||
}).then(res => {
|
if (this.index == index) {
|
||||||
this.dataInfo(res.data);
|
this.getInfo(element.id)
|
||||||
this.loading = false;
|
}
|
||||||
});
|
}
|
||||||
} else {
|
},
|
||||||
this.clearData();
|
getInfo(id) {
|
||||||
this.initDefaultData();
|
request({
|
||||||
}
|
url: '/api/example/Park/'+ id,
|
||||||
});
|
method: 'get'
|
||||||
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
|
}).then(res => {
|
||||||
},
|
this.dataInfo(res.data)
|
||||||
//初始化默认数据
|
});
|
||||||
initDefaultData() {},
|
},
|
||||||
// 表单提交
|
goBack() {
|
||||||
dataFormSubmit(type) {
|
this.visible = false
|
||||||
this.dataFormSubmitType = type ? type : 0;
|
this.$emit('refreshDataList', true)
|
||||||
this.$refs["formRef"].validate(valid => {
|
},
|
||||||
if (valid) {
|
changeData(model, index) {
|
||||||
this.request();
|
this.isEdit = false
|
||||||
}
|
this.childIndex = index
|
||||||
});
|
let modelAll = model.split("-");
|
||||||
},
|
let faceMode = "";
|
||||||
request() {
|
for (let i = 0; i < modelAll.length; i++) {
|
||||||
let _data = this.dataList();
|
faceMode += modelAll[i];
|
||||||
if (this.dataFormSubmitType == 2) {
|
}
|
||||||
this.continueBtnLoading = true;
|
for (let key in this.interfaceRes) {
|
||||||
} else {
|
if (key != faceMode) {
|
||||||
this.btnLoading = true;
|
let faceReList = this.interfaceRes[key]
|
||||||
}
|
for (let i = 0; i < faceReList.length; i++) {
|
||||||
if (!this.dataForm.id) {
|
if (faceReList[i].relationField == model) {
|
||||||
request({
|
let options = 'get' + key + 'Options';
|
||||||
url: "/api/example/Park",
|
if(this[options]){
|
||||||
method: "post",
|
this[options]()
|
||||||
data: _data
|
}
|
||||||
})
|
this.changeData(key, index)
|
||||||
.then(res => {
|
}
|
||||||
this.$message({
|
}
|
||||||
message: res.msg,
|
}
|
||||||
type: "success",
|
}
|
||||||
duration: 1000,
|
},
|
||||||
onClose: () => {
|
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/Park/'+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) {
|
if (this.dataFormSubmitType == 2) {
|
||||||
this.$nextTick(() => {
|
this.continueBtnLoading = true
|
||||||
this.clearData();
|
} else {
|
||||||
this.initDefaultData();
|
this.btnLoading = true
|
||||||
});
|
|
||||||
this.continueBtnLoading = false;
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.visible = false;
|
if (!this.dataForm.id) {
|
||||||
this.btnLoading = false;
|
request({
|
||||||
this.$emit("refresh", true);
|
url: '/api/example/Park',
|
||||||
}
|
method: 'post',
|
||||||
});
|
data: _data
|
||||||
})
|
}).then((res) => {
|
||||||
.catch(() => {
|
this.$message({
|
||||||
this.btnLoading = false;
|
message: res.msg,
|
||||||
this.continueBtnLoading = false;
|
type: 'success',
|
||||||
});
|
duration: 1000,
|
||||||
} else {
|
onClose: () => {
|
||||||
request({
|
if (this.dataFormSubmitType == 2) {
|
||||||
url: "/api/example/Park/" + this.dataForm.id,
|
this.$nextTick(() => {
|
||||||
method: "PUT",
|
this.clearData()
|
||||||
data: _data
|
this.initDefaultData()
|
||||||
})
|
})
|
||||||
.then(res => {
|
this.continueBtnLoading = false
|
||||||
this.$message({
|
return
|
||||||
message: res.msg,
|
}
|
||||||
type: "success",
|
this.visible = false
|
||||||
duration: 1000,
|
this.btnLoading = false
|
||||||
onClose: () => {
|
this.$emit('refresh', true)
|
||||||
if (this.dataFormSubmitType == 2)
|
}
|
||||||
return (this.continueBtnLoading = false);
|
})
|
||||||
this.visible = false;
|
}).catch(()=>{
|
||||||
this.btnLoading = false;
|
this.btnLoading = false
|
||||||
this.$emit("refresh", true);
|
this.continueBtnLoading = false
|
||||||
}
|
})
|
||||||
});
|
}else{
|
||||||
})
|
request({
|
||||||
.catch(() => {
|
url: '/api/example/Park/'+this.dataForm.id,
|
||||||
this.btnLoading = false;
|
method: 'PUT',
|
||||||
this.continueBtnLoading = false;
|
data: _data
|
||||||
});
|
}).then((res) => {
|
||||||
}
|
this.$message({
|
||||||
},
|
message: res.msg,
|
||||||
openSelectDialog(key) {
|
type: 'success',
|
||||||
this.currTableConf = this.addTableConf[key];
|
duration: 1000,
|
||||||
this.currVmodel = key;
|
onClose: () => {
|
||||||
this.selectDialogVisible = true;
|
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
|
||||||
this.$nextTick(() => {
|
this.visible = false
|
||||||
this.$refs.selectDialog.init();
|
this.btnLoading = false
|
||||||
});
|
this.$emit('refresh', true)
|
||||||
},
|
}
|
||||||
addForSelect(data) {
|
})
|
||||||
for (let i = 0; i < data.length; i++) {
|
}).catch(()=>{
|
||||||
let t = data[i];
|
this.btnLoading = false
|
||||||
if (this["get" + this.currVmodel]) {
|
this.continueBtnLoading = false
|
||||||
this["get" + this.currVmodel](t);
|
})
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
openSelectDialog(key) {
|
||||||
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
this.currTableConf=this.addTableConf[key]
|
||||||
let timeDataValue = null;
|
this.currVmodel=key
|
||||||
let timeValue = Number(timeValueData);
|
this.selectDialogVisible = true
|
||||||
if (timeRule) {
|
this.$nextTick(() => {
|
||||||
if (timeType == 1) {
|
this.$refs.selectDialog.init()
|
||||||
timeDataValue = timeValue;
|
})
|
||||||
} else if (timeType == 2) {
|
},
|
||||||
timeDataValue = dataValue;
|
addForSelect(data) {
|
||||||
} else if (timeType == 3) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
timeDataValue = new Date().getTime();
|
let t = data[i]
|
||||||
} else if (timeType == 4) {
|
if(this['get'+this.currVmodel]){
|
||||||
let previousDate = "";
|
this['get'+this.currVmodel](t)
|
||||||
if (timeTarget == 1 || timeTarget == 2) {
|
}
|
||||||
previousDate = getDateDay(timeTarget, timeType, timeValue);
|
}
|
||||||
timeDataValue = new Date(previousDate).getTime();
|
},
|
||||||
} else if (timeTarget == 3) {
|
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
|
||||||
previousDate = getBeforeData(timeValue);
|
let timeDataValue = null;
|
||||||
timeDataValue = new Date(previousDate).getTime();
|
let timeValue = Number(timeValueData)
|
||||||
} else {
|
if (timeRule) {
|
||||||
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
|
if (timeType == 1) {
|
||||||
}
|
timeDataValue = timeValue
|
||||||
} else if (timeType == 5) {
|
} else if (timeType == 2) {
|
||||||
let previousDate = "";
|
timeDataValue = dataValue
|
||||||
if (timeTarget == 1 || timeTarget == 2) {
|
} else if (timeType == 3) {
|
||||||
previousDate = getDateDay(timeTarget, timeType, timeValue);
|
timeDataValue = new Date().getTime()
|
||||||
timeDataValue = new Date(previousDate).getTime();
|
} else if (timeType == 4) {
|
||||||
} else if (timeTarget == 3) {
|
let previousDate = '';
|
||||||
previousDate = getLaterData(timeValue);
|
if (timeTarget == 1 || timeTarget == 2) {
|
||||||
timeDataValue = new Date(previousDate).getTime();
|
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||||
} else {
|
timeDataValue = new Date(previousDate).getTime()
|
||||||
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
|
} else if (timeTarget == 3) {
|
||||||
}
|
previousDate = getBeforeData(timeValue)
|
||||||
}
|
timeDataValue = new Date(previousDate).getTime()
|
||||||
}
|
} else {
|
||||||
return timeDataValue;
|
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
|
||||||
},
|
}
|
||||||
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
} else if (timeType == 5) {
|
||||||
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
|
let previousDate = '';
|
||||||
let timeDataValue = null;
|
if (timeTarget == 1 || timeTarget == 2) {
|
||||||
if (timeRule) {
|
previousDate = getDateDay(timeTarget, timeType, timeValue)
|
||||||
if (timeType == 1) {
|
timeDataValue = new Date(previousDate).getTime()
|
||||||
timeDataValue = timeValue || "00:00:00";
|
} else if (timeTarget == 3) {
|
||||||
if (timeDataValue.split(":").length == 3) {
|
previousDate = getLaterData(timeValue)
|
||||||
timeDataValue = timeDataValue;
|
timeDataValue = new Date(previousDate).getTime()
|
||||||
} else {
|
} else {
|
||||||
timeDataValue = timeDataValue + ":00";
|
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
|
||||||
}
|
}
|
||||||
} else if (timeType == 2) {
|
}
|
||||||
timeDataValue = dataValue;
|
}
|
||||||
} else if (timeType == 3) {
|
return timeDataValue;
|
||||||
timeDataValue = this.jnpf.toDate(new Date(), format);
|
},
|
||||||
} else if (timeType == 4) {
|
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
|
||||||
let previousDate = "";
|
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
|
||||||
previousDate = getBeforeTime(timeTarget, timeValue);
|
let timeDataValue = null
|
||||||
timeDataValue = this.jnpf.toDate(previousDate, format);
|
if (timeRule) {
|
||||||
} else if (timeType == 5) {
|
if (timeType == 1) {
|
||||||
let previousDate = "";
|
timeDataValue = timeValue || '00:00:00'
|
||||||
previousDate = getLaterTime(timeTarget, timeValue);
|
if (timeDataValue.split(':').length == 3) {
|
||||||
timeDataValue = this.jnpf.toDate(previousDate, format);
|
timeDataValue = timeDataValue
|
||||||
}
|
} else {
|
||||||
}
|
timeDataValue = timeDataValue + ':00'
|
||||||
return timeDataValue;
|
}
|
||||||
},
|
} else if (timeType == 2) {
|
||||||
dataList() {
|
timeDataValue = dataValue
|
||||||
var _data = this.dataForm;
|
} else if (timeType == 3) {
|
||||||
return _data;
|
timeDataValue = this.jnpf.toDate(new Date(), format)
|
||||||
},
|
} else if (timeType == 4) {
|
||||||
dataInfo(dataAll) {
|
let previousDate = '';
|
||||||
let _dataAll = dataAll;
|
previousDate = getBeforeTime(timeTarget, timeValue)
|
||||||
this.dataForm = _dataAll;
|
timeDataValue = this.jnpf.toDate(previousDate, format)
|
||||||
this.isEdit = true;
|
} else if (timeType == 5) {
|
||||||
this.dataAll();
|
let previousDate = '';
|
||||||
this.childIndex = -1;
|
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>
|
</script>
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,2 +1,2 @@
|
|||||||
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区编码","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"code","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"code","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区名称","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"name","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"name","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"描述","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"describe","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"describe","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"备注","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"remark","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"multiple":false,"fullName":"类型","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"1","noShow":true,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1721036412554,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"options":[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],"__vModel__":"type","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"type","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
|
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区编码","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"code","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"code","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区名称","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"name","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"name","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区描述","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"description","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"description","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"备注","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"remark","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"multiple":false,"fullName":"类型","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"1","noShow":true,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1721036412554,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"options":[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],"__vModel__":"type","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"type","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
|
||||||
export default superQueryJson
|
export default superQueryJson
|
@ -0,0 +1,149 @@
|
|||||||
|
<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="userCode" >
|
||||||
|
<p>{{dataForm.userCode}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="用户名"
|
||||||
|
prop="userName" >
|
||||||
|
<p>{{dataForm.userName}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="身份证号"
|
||||||
|
prop="idCard" >
|
||||||
|
<p>{{dataForm.idCard}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="联系电话"
|
||||||
|
prop="phone" >
|
||||||
|
<p>{{dataForm.phone}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="人员归属"
|
||||||
|
prop="userAscription" >
|
||||||
|
<p>{{ dataForm.userAscription }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="有效开始时间"
|
||||||
|
prop="effectiveStartTime" >
|
||||||
|
<p>{{dataForm.effectiveStartTime}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="有效结束时间"
|
||||||
|
prop="effectiveEndTime" >
|
||||||
|
<p>{{dataForm.effectiveEndTime}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="出入码"
|
||||||
|
prop="entryCodes" >
|
||||||
|
<p>{{dataForm.entryCodes}}</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>
|
||||||
|
</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 :'',
|
||||||
|
userCode : '',
|
||||||
|
userName : '',
|
||||||
|
idCard : '',
|
||||||
|
phone : '',
|
||||||
|
userAscription : "1",
|
||||||
|
effectiveStartTime : '',
|
||||||
|
effectiveEndTime : '',
|
||||||
|
entryCodes : '',
|
||||||
|
merchantId : "",
|
||||||
|
},
|
||||||
|
userAscriptionOptions:[{"fullName":"商户","id":"1"},{"fullName":"公司","id":"2"}],
|
||||||
|
userAscriptionProps:{"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/Person/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,554 @@
|
|||||||
|
<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="userCode">
|
||||||
|
<JnpfInput v-model="dataForm.userCode" @change="changeData('userCode',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="用户名" prop="userName">
|
||||||
|
<JnpfInput v-model="dataForm.userName" @change="changeData('userName',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="身份证号" prop="idCard">
|
||||||
|
<JnpfInput v-model="dataForm.idCard" @change="changeData('idCard',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="联系电话" prop="phone">
|
||||||
|
<JnpfInput v-model="dataForm.phone" @change="changeData('phone',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="人员归属" prop="userAscription">
|
||||||
|
<JnpfSelect v-model="dataForm.userAscription" @change="changeData('userAscription',-1)" placeholder="请选择"
|
||||||
|
clearable :style='{"width":"100%"}' :options="userAscriptionOptions" :props="userAscriptionProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="有效开始时间" prop="effectiveStartTime">
|
||||||
|
<JnpfDatePicker v-model="dataForm.effectiveStartTime" @change="changeData('effectiveStartTime',-1)"
|
||||||
|
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable
|
||||||
|
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss">
|
||||||
|
</JnpfDatePicker>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="有效结束时间" prop="effectiveEndTime">
|
||||||
|
<JnpfDatePicker v-model="dataForm.effectiveEndTime" @change="changeData('effectiveEndTime',-1)"
|
||||||
|
:startTime="dateTime(false,1,1,'','')" :endTime="dateTime(false,1,1,'','')" placeholder="请选择" clearable
|
||||||
|
:style='{"width":"100%"}' type="datetime" format="yyyy-MM-dd HH:mm:ss">
|
||||||
|
</JnpfDatePicker>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="出入码" prop="entryCodes">
|
||||||
|
<JnpfInput v-model="dataForm.entryCodes" @change="changeData('entryCodes',-1)" placeholder="请输入" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="归属部门" prop="merchantId" v-if="dataForm.userAscription == 2">
|
||||||
|
<JnpfDepSelect v-model="dataForm.merchantId" @change="depSelectChangeData" placeholder="请选择"
|
||||||
|
selectType="all" :ableIds="ableAll.merchantIdableIds" clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfDepSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
<jnpf-form-tip-item label="归属商户" prop="merchantId" v-if="dataForm.userAscription == 1">
|
||||||
|
<JnpfPopupSelect v-model="dataForm.merchantId" @change="selectChangeData" :rowIndex="null"
|
||||||
|
:formData="dataForm" :templateJson="interfaceRes.merchantId" placeholder="请选择" propsValue="id"
|
||||||
|
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='cmp_nm' field='merchantId'
|
||||||
|
interfaceId="582919057313895877" :pageSize="20" :columnOptions="merchantIdcolumnOptions" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfPopupSelect>
|
||||||
|
</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: {
|
||||||
|
userCode: undefined,
|
||||||
|
userName: undefined,
|
||||||
|
idCard: undefined,
|
||||||
|
phone: undefined,
|
||||||
|
userAscription: "1",
|
||||||
|
effectiveStartTime: undefined,
|
||||||
|
effectiveEndTime: undefined,
|
||||||
|
entryCodes: undefined,
|
||||||
|
merchantId: undefined,
|
||||||
|
version: 0,
|
||||||
|
},
|
||||||
|
tableRequiredData: {},
|
||||||
|
dataRule: {
|
||||||
|
userCode: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
userName: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
idCard: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
phone: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^1[3456789]\d{9}$|^0\d{2,3}-?\d{7,8}$/,
|
||||||
|
message: '请输入正确的联系方式',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
userAscription: [{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
effectiveStartTime: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
effectiveEndTime: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
entryCodes: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
},
|
||||||
|
userAscriptionOptions: [{
|
||||||
|
"fullName": "商户",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "公司",
|
||||||
|
"id": "2"
|
||||||
|
}],
|
||||||
|
userAscriptionProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
merchantIdcolumnOptions: [{
|
||||||
|
"label": "编码",
|
||||||
|
"value": "cmp_no"
|
||||||
|
}, {
|
||||||
|
"label": "名称",
|
||||||
|
"value": "cmp_nm"
|
||||||
|
}, ],
|
||||||
|
childIndex: -1,
|
||||||
|
isEdit: false,
|
||||||
|
interfaceRes: {
|
||||||
|
userCode: [],
|
||||||
|
userName: [],
|
||||||
|
idCard: [],
|
||||||
|
phone: [],
|
||||||
|
userAscription: [],
|
||||||
|
effectiveStartTime: [],
|
||||||
|
effectiveEndTime: [],
|
||||||
|
entryCodes: [],
|
||||||
|
merchantId: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo'])
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.dataAll()
|
||||||
|
this.initDefaultData()
|
||||||
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
selectChangeData(var1, var2){
|
||||||
|
this.dataForm.merchantId = var2.id;
|
||||||
|
this.dataForm.merchantName = var2.cmp_nm;
|
||||||
|
},
|
||||||
|
depSelectChangeData(var1, var2){
|
||||||
|
this.dataForm.merchantId = var2.id;
|
||||||
|
this.dataForm.merchantName = var2.fullName;
|
||||||
|
},
|
||||||
|
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/Person/' + 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/Person/' + 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/Person',
|
||||||
|
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/Person/' + 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,161 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog title="详情"
|
||||||
|
:close-on-click-modal="false" append-to-body
|
||||||
|
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
|
||||||
|
width="600px">
|
||||||
|
<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="vehicleNumber" >
|
||||||
|
<p>{{dataForm.vehicleNumber}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="车辆类型"
|
||||||
|
prop="vehicleType" >
|
||||||
|
<p>{{ dataForm.vehicleType }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="车辆品牌"
|
||||||
|
prop="vehicleBrand" >
|
||||||
|
<p>{{dataForm.vehicleBrand}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="车辆颜色"
|
||||||
|
prop="vehicleColor" >
|
||||||
|
<p>{{dataForm.vehicleColor}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="联系人"
|
||||||
|
prop="contactsName" >
|
||||||
|
<p>{{dataForm.contactsName}}</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="24" >
|
||||||
|
<jnpf-form-tip-item label="车辆照片"
|
||||||
|
prop="vehiclePhotos" >
|
||||||
|
<JnpfUploadImg v-model="dataForm.vehiclePhotos"
|
||||||
|
disabled
|
||||||
|
detailed :fileSize="10" sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0" >
|
||||||
|
</JnpfUploadImg>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="车辆归属"
|
||||||
|
prop="vehicleAscription" >
|
||||||
|
<p>{{ dataForm.vehicleAscription }} </p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="归属"
|
||||||
|
prop="ascriptionId" >
|
||||||
|
<p>{{dataForm.ascriptionId}}</p>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" >
|
||||||
|
<jnpf-form-tip-item label="归属名称"
|
||||||
|
prop="ascriptionName" >
|
||||||
|
<p>{{dataForm.ascriptionName}}</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 :'',
|
||||||
|
vehicleNumber : '',
|
||||||
|
vehicleType : "",
|
||||||
|
vehicleBrand : '',
|
||||||
|
vehicleColor : '',
|
||||||
|
contactsName : '',
|
||||||
|
contactsPhone : '',
|
||||||
|
vehiclePhotos : [],
|
||||||
|
vehicleAscription : "1",
|
||||||
|
ascriptionId : '',
|
||||||
|
ascriptionName : "",
|
||||||
|
},
|
||||||
|
vehicleTypeOptions:[{"fullName":"选项一","id":"1"},{"fullName":"选项二","id":"2"}],
|
||||||
|
vehicleTypeProps:{"label":"fullName","value":"id" },
|
||||||
|
vehicleAscriptionOptions:[{"fullName":"商户","id":"1"},{"fullName":"公司","id":"2"}],
|
||||||
|
vehicleAscriptionProps:{"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/Vehicle/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="vehicleNumber">
|
||||||
|
<JnpfInput v-model="dataForm.vehicleNumber" @change="changeData('vehicleNumber',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="车辆类型" prop="vehicleType">
|
||||||
|
<JnpfSelect v-model="dataForm.vehicleType" @change="changeData('vehicleType',-1)" placeholder="请选择"
|
||||||
|
clearable :style='{"width":"100%"}' :options="vehicleTypeOptions" :props="vehicleTypeProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="车辆品牌" prop="vehicleBrand">
|
||||||
|
<JnpfInput v-model="dataForm.vehicleBrand" @change="changeData('vehicleBrand',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="车辆颜色" prop="vehicleColor">
|
||||||
|
<JnpfInput v-model="dataForm.vehicleColor" @change="changeData('vehicleColor',-1)" placeholder="请输入"
|
||||||
|
clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="联系人" prop="contactsName">
|
||||||
|
<JnpfInput v-model="dataForm.contactsName" @change="changeData('contactsName',-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="24">
|
||||||
|
<jnpf-form-tip-item label="车辆照片" prop="vehiclePhotos">
|
||||||
|
<JnpfUploadImg v-model="dataForm.vehiclePhotos" @change="changeData('vehiclePhotos',-1)" :fileSize="10"
|
||||||
|
sizeUnit="MB" :limit="9" pathType="defaultPath" :isAccount="0">
|
||||||
|
</JnpfUploadImg>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="车辆归属" prop="vehicleAscription">
|
||||||
|
<JnpfSelect v-model="dataForm.vehicleAscription" @change="changeData('vehicleAscription',-1)"
|
||||||
|
placeholder="请选择" clearable :style='{"width":"100%"}' :options="vehicleAscriptionOptions"
|
||||||
|
:props="vehicleAscriptionProps">
|
||||||
|
</JnpfSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<jnpf-form-tip-item label="归属部门" prop="ascriptionId" v-if="dataForm.vehicleAscription == 2">
|
||||||
|
<JnpfDepSelect v-model="dataForm.ascriptionId" @change="depSelectChangeData" placeholder="请选择"
|
||||||
|
selectType="all" :ableIds="ableAll.ascriptionIdableIds" clearable :style='{"width":"100%"}'>
|
||||||
|
</JnpfDepSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
<jnpf-form-tip-item label="归属商户" prop="ascriptionId" v-if="dataForm.vehicleAscription == 1">
|
||||||
|
<JnpfPopupSelect v-model="dataForm.ascriptionId" @change="selectChangeData" :rowIndex="null"
|
||||||
|
:formData="dataForm" :templateJson="interfaceRes.ascriptionName" placeholder="请选择" propsValue="id"
|
||||||
|
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='cmp_nm' field='ascriptionId'
|
||||||
|
interfaceId="582919057313895877" :pageSize="20" :columnOptions="ascriptionNamecolumnOptions" clearable
|
||||||
|
:style='{"width":"100%"}'>
|
||||||
|
</JnpfPopupSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
|
||||||
|
</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: {
|
||||||
|
vehicleNumber: undefined,
|
||||||
|
vehicleType: undefined,
|
||||||
|
vehicleBrand: undefined,
|
||||||
|
vehicleColor: undefined,
|
||||||
|
contactsName: undefined,
|
||||||
|
contactsPhone: undefined,
|
||||||
|
vehiclePhotos: [],
|
||||||
|
vehicleAscription: "1",
|
||||||
|
ascriptionId: undefined,
|
||||||
|
ascriptionName: undefined,
|
||||||
|
version: 0,
|
||||||
|
},
|
||||||
|
tableRequiredData: {},
|
||||||
|
dataRule: {
|
||||||
|
vehicleNumber: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
vehicleType: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
vehicleBrand: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
vehicleColor: [{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
}, ],
|
||||||
|
contactsName: [{
|
||||||
|
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'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ascriptionId: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
ascriptionName: [{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
}, ],
|
||||||
|
},
|
||||||
|
vehicleTypeOptions: [{
|
||||||
|
"fullName": "选项一",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "选项二",
|
||||||
|
"id": "2"
|
||||||
|
}],
|
||||||
|
vehicleTypeProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
vehicleAscriptionOptions: [{
|
||||||
|
"fullName": "商户",
|
||||||
|
"id": "1"
|
||||||
|
}, {
|
||||||
|
"fullName": "公司",
|
||||||
|
"id": "2"
|
||||||
|
}],
|
||||||
|
vehicleAscriptionProps: {
|
||||||
|
"label": "fullName",
|
||||||
|
"value": "id"
|
||||||
|
},
|
||||||
|
ascriptionNamecolumnOptions: [{
|
||||||
|
"label": "编码",
|
||||||
|
"value": "cmp_no"
|
||||||
|
}, {
|
||||||
|
"label": "名称",
|
||||||
|
"value": "cmp_nm"
|
||||||
|
}, ],
|
||||||
|
childIndex: -1,
|
||||||
|
isEdit: false,
|
||||||
|
interfaceRes: {
|
||||||
|
vehicleNumber: [],
|
||||||
|
vehicleType: [],
|
||||||
|
vehicleBrand: [],
|
||||||
|
vehicleColor: [],
|
||||||
|
contactsName: [],
|
||||||
|
contactsPhone: [],
|
||||||
|
vehiclePhotos: [],
|
||||||
|
vehicleAscription: [],
|
||||||
|
ascriptionId: [],
|
||||||
|
ascriptionName: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters(['userInfo'])
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.dataAll()
|
||||||
|
this.initDefaultData()
|
||||||
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {
|
||||||
|
selectChangeData(var1, var2){
|
||||||
|
this.dataForm.ascriptionId = var2.id;
|
||||||
|
this.dataForm.ascriptionName = var2.cmp_nm;
|
||||||
|
},
|
||||||
|
depSelectChangeData(var1, var2){
|
||||||
|
this.dataForm.ascriptionId = var2.id;
|
||||||
|
this.dataForm.ascriptionName = var2.fullName;
|
||||||
|
},
|
||||||
|
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/Vehicle/' + 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/Vehicle/' + 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/Vehicle',
|
||||||
|
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/Vehicle/' + 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