parent
bd86446c9e
commit
2af278f0cf
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="jnpf.mapper.CwCostMapper">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
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,568 @@
|
|||||||
|
<template>
|
||||||
|
<div :style="{ margin: '0 auto', width: '100%' }">
|
||||||
|
<el-row :gutter="15" class="">
|
||||||
|
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="120px"
|
||||||
|
label-position="right" :disabled="setting.readonly">
|
||||||
|
<template v-if="!loading && formOperates">
|
||||||
|
<!-- 具体表单 -->
|
||||||
|
<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" v-if="judgeShow('code')">
|
||||||
|
<jnpf-form-tip-item label="单据编号" v-if="judgeShow('code')" prop="code">
|
||||||
|
<JnpfInput v-model="dataForm.code" @change="changeData('code', -1)" placeholder="系统自动生成"
|
||||||
|
:disabled="judgeWrite('code')" readonly :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="judgeShow('institutionId')">
|
||||||
|
<jnpf-form-tip-item label="费用归属" v-if="judgeShow('institutionId')" prop="institutionId">
|
||||||
|
<JnpfOrganizeSelect v-model="dataForm.institutionId" disabled
|
||||||
|
@change="changeData('institutionId', -1)" placeholder="请选择" selectType="all"
|
||||||
|
:ableIds="ableAll.institutionIdableIds" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfOrganizeSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="judgeShow('subjectId')">
|
||||||
|
<jnpf-form-tip-item label="往来单位" v-if="judgeShow('subjectId')" prop="subjectId">
|
||||||
|
<JnpfPopupSelect v-model="dataForm.subjectId" @change="changeData('subjectId', -1)"
|
||||||
|
:rowIndex="null" :formData="dataForm" :templateJson="interfaceRes.subjectId"
|
||||||
|
placeholder="请选择" :disabled="judgeWrite('subjectId')" hasPage propsValue="id"
|
||||||
|
popupWidth="800px" popupTitle="选择数据" popupType="dialog" relationField='name'
|
||||||
|
field='subjectId' interfaceId="542305697765799941" :pageSize="20"
|
||||||
|
:columnOptions="subjectIdcolumnOptions" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfPopupSelect>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="judgeShow('costTime')">
|
||||||
|
<jnpf-form-tip-item label="费用发生时间" v-if="judgeShow('costTime')" prop="costTime">
|
||||||
|
<JnpfDatePicker v-model="dataForm.costTime" @change="changeData('costTime', -1)"
|
||||||
|
:startTime="dateTime(false, 1, 1, '', '')" :endTime="dateTime(false, 1, 1, '', '')"
|
||||||
|
placeholder="请选择" :disabled="judgeWrite('costTime')" clearable
|
||||||
|
:style='{ "width": "100%" }' type="date" format="yyyy-MM-dd">
|
||||||
|
</JnpfDatePicker>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="judgeShow('businessCode')">
|
||||||
|
<jnpf-form-tip-item label="关联数据" v-if="judgeShow('businessCode')" prop="businessCode">
|
||||||
|
<JnpfInput v-model="dataForm.businessCode" @change="changeData('businessCode', -1)"
|
||||||
|
placeholder="请输入" :disabled="judgeWrite('businessCode')" clearable
|
||||||
|
:style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="judgeShow('remark')">
|
||||||
|
<jnpf-form-tip-item label="备注" v-if="judgeShow('remark')" prop="remark">
|
||||||
|
<JnpfTextarea v-model="dataForm.remark" @change="changeData('remark', -1)" placeholder="请输入"
|
||||||
|
:disabled="judgeWrite('remark')" :maxlength="300" :style='{ "width": "100%" }' true
|
||||||
|
type="textarea" :autosize='{ "minRows": 4, "maxRows": 4 }'>
|
||||||
|
</JnpfTextarea>
|
||||||
|
</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" v-if="judgeShow('costProject')">
|
||||||
|
<jnpf-form-tip-item label="费用项目" v-if="judgeShow('costProject')" prop="costProject">
|
||||||
|
<JnpfCascader v-model="dataForm.costProject" @change="changeData('costProject', -1)"
|
||||||
|
placeholder="请选择" show-all-levels :disabled="judgeWrite('costProject')" clearable
|
||||||
|
:style='{ "width": "100%" }' separator="/" :options="costProjectOptions"
|
||||||
|
:props="costProjectProps">
|
||||||
|
</JnpfCascader>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="judgeShow('type')">
|
||||||
|
<jnpf-form-tip-item label="收付类型" v-if="judgeShow('type')" prop="type">
|
||||||
|
<JnpfRadio v-model="dataForm.type" @change="changeData('type', -1)"
|
||||||
|
:disabled="judgeWrite('type')" optionType="default" direction="horizontal" size="small"
|
||||||
|
:options="typeOptions" :props="typeProps">
|
||||||
|
</JnpfRadio>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="dataForm.type == 0">
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="dataForm.type == 1">
|
||||||
|
<jnpf-form-tip-item label="付款方式" v-if="judgeShow('wayType')" prop="wayType">
|
||||||
|
<JnpfRadio v-model="dataForm.wayType" @change="changeData('wayType', -1)"
|
||||||
|
:disabled="judgeWrite('wayType')" optionType="default" direction="horizontal"
|
||||||
|
size="small" :options="wayTypeOptions" :props="wayTypeProps">
|
||||||
|
</JnpfRadio>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="dataForm.type == 2">
|
||||||
|
<jnpf-form-tip-item label="付款方式" v-if="judgeShow('wayType')" prop="wayType">
|
||||||
|
<JnpfRadio v-model="dataForm.wayType" @change="changeData('wayType', -1)"
|
||||||
|
:disabled="judgeWrite('wayType')" optionType="default" direction="horizontal"
|
||||||
|
size="small" :options="wayTypeOptionss" :props="wayTypeProps">
|
||||||
|
</JnpfRadio>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="dataForm.type == 1">
|
||||||
|
<jnpf-form-tip-item label="付款状态" v-if="judgeShow('wayStatus')" prop="wayStatus">
|
||||||
|
<JnpfRadio v-model="dataForm.wayStatus" @change="changeData('wayStatus', -1)"
|
||||||
|
:disabled="judgeWrite('wayStatus')" optionType="default" direction="horizontal"
|
||||||
|
size="small" :options="wayStatusOptions" :props="wayStatusProps">
|
||||||
|
</JnpfRadio>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="dataForm.type == 2">
|
||||||
|
<jnpf-form-tip-item label="付款状态" v-if="judgeShow('wayStatus')" prop="wayStatus">
|
||||||
|
<JnpfRadio v-model="dataForm.wayStatus" @change="changeData('wayStatus', -1)"
|
||||||
|
:disabled="judgeWrite('wayStatus')" optionType="default" direction="horizontal"
|
||||||
|
size="small" :options="wayStatusOptionss" :props="wayStatusProps">
|
||||||
|
</JnpfRadio>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :span="8" v-if="judgeShow('costPrice')">
|
||||||
|
<jnpf-form-tip-item label="费用金额" v-if="judgeShow('costPrice')" prop="costPrice">
|
||||||
|
<JnpfInput v-model="dataForm.costPrice" @change="changeData('costPrice', -1)"
|
||||||
|
placeholder="请输入" :disabled="judgeWrite('costPrice')" clearable
|
||||||
|
:style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8" v-if="judgeShow('payment')">
|
||||||
|
<jnpf-form-tip-item label="收付款单号" v-if="judgeShow('payment')" prop="payment">
|
||||||
|
<JnpfInput v-model="dataForm.payment" @change="changeData('payment', -1)" placeholder="请输入"
|
||||||
|
:disabled="judgeWrite('payment')" clearable :style='{ "width": "100%" }'>
|
||||||
|
</JnpfInput>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="judgeShow('pictures')">
|
||||||
|
<jnpf-form-tip-item label="图片" v-if="judgeShow('pictures')" prop="pictures">
|
||||||
|
<JnpfUploadImg v-model="dataForm.pictures" @change="changeData('pictures', -1)"
|
||||||
|
:disabled="judgeWrite('pictures')" :fileSize="10" sizeUnit="MB" :limit="1"
|
||||||
|
pathType="defaultPath" :isAccount="0">
|
||||||
|
</JnpfUploadImg>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24" v-if="judgeShow('annexFile')">
|
||||||
|
<jnpf-form-tip-item label="附件文件" v-if="judgeShow('annexFile')" prop="annexFile">
|
||||||
|
<JnpfUploadFile v-model="dataForm.annexFile" @change="changeData('annexFile', -1)"
|
||||||
|
:disabled="judgeWrite('annexFile')" :fileSize="10" sizeUnit="MB" :limit="1"
|
||||||
|
pathType="defaultPath" :isAccount="0" buttonText="点击上传">
|
||||||
|
</JnpfUploadFile>
|
||||||
|
</jnpf-form-tip-item>
|
||||||
|
</el-col>
|
||||||
|
<!-- 表单结束 -->
|
||||||
|
</template>
|
||||||
|
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm" ref="selectDialog"
|
||||||
|
@select="addForSelect" @close="selectDialogVisible = false" />
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
<UserBox v-if="userBoxVisible" ref="userBox" @submit="submit" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import request from '@/utils/request'
|
||||||
|
import { mapGetters } from "vuex";
|
||||||
|
import { getFormById } from '@/api/workFlow/FormDesign'
|
||||||
|
import comMixin from '@/views/workFlow/workFlowForm/mixin';
|
||||||
|
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 {
|
||||||
|
mixins: [comMixin],
|
||||||
|
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: {
|
||||||
|
code: undefined,
|
||||||
|
institutionId: [],
|
||||||
|
subjectId: undefined,
|
||||||
|
costTime: undefined,
|
||||||
|
businessCode: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
costProject: [],
|
||||||
|
type: undefined,
|
||||||
|
wayType: undefined,
|
||||||
|
wayStatus: undefined,
|
||||||
|
costPrice: undefined,
|
||||||
|
payment: undefined,
|
||||||
|
pictures: [],
|
||||||
|
annexFile: [],
|
||||||
|
version: 0,
|
||||||
|
},
|
||||||
|
tableRequiredData: {},
|
||||||
|
dataRule:
|
||||||
|
{
|
||||||
|
institutionId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
subjectId: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
costTime: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请选择',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
remark: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
costProject: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
type: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
wayType: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
wayStatus: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '不能为空',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
costPrice: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请输入',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
pattern: /^([1-9][\d]*|0)(\.[\d]+)?$/,
|
||||||
|
message: '请输入正确的金额',
|
||||||
|
trigger: 'blur'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
pictures: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
annexFile: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: '请至少选择一个',
|
||||||
|
trigger: 'change'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
subjectIdcolumnOptions: [{ "label": "类型", "value": "subjectBasicTypes" }, { "label": "名称", "value": "name" },],
|
||||||
|
costProjectOptions: [{ "children": [{ "fullName": "交易服务费", "id": "E1001" }, { "fullName": "保险费", "id": "E1002" }, { "fullName": "包装费", "id": "E1003" }, { "fullName": "运费", "id": "E1004" }, { "fullName": "装卸费", "id": "E1005" }, { "fullName": "服务费", "id": "E1011" }, { "fullName": "管理服务费", "id": "E1012" }, { "fullName": "管理服务费退回", "id": "E1013" }, { "fullName": "海关税费", "id": "E1014" }, { "fullName": "技术服务费", "id": "E1015" }, { "fullName": "技术服务费退回", "id": "E1016" }, { "fullName": "交易手续费", "id": "E1017" }, { "fullName": "交易手续费-常规交易", "id": "E1018" }, { "fullName": "交易手续费退回", "id": "E1019" }, { "fullName": "金融服务费-预付回款", "id": "E1020" }, { "fullName": "金融服务费退回-垫资回款", "id": "E1021" }, { "fullName": "金融服务费-垫资回款", "id": "E1022" }, { "fullName": "运费", "id": "E1023" }, { "fullName": "运费退回", "id": "E1024" }, { "fullName": "平台服务费-账户管理费", "id": "E1025" }, { "fullName": "平台服务费-平台分销", "id": "E1026" }, { "fullName": "手续费", "id": "E1029" }, { "fullName": "手续费补贴", "id": "E1030" }, { "fullName": "保障服务费退回-退货运费", "id": "E1031" }, { "fullName": "保障服务费-退货运费", "id": "E1032" }, { "fullName": "保障服务费-担保费", "id": "E1033" }], "fullName": "销售服务", "id": "E1000" }, { "children": [{ "fullName": "采购保证金", "id": "E2000" }, { "fullName": "质量保证金", "id": "E2001" }, { "fullName": "销售保证金", "id": "E2002" }, { "fullName": "合作保证金", "id": "E2003" }], "fullName": "保证金", "id": "E200" }, { "children": [{ "fullName": "广告费", "id": "E3001" }, { "fullName": "促销费用", "id": "E3002" }, { "fullName": "节庆费", "id": "E3003" }, { "fullName": "订单返现费用", "id": "E3009" }], "fullName": "营销活动", "id": "E3000" }, { "children": [{ "fullName": "赔付", "id": "E4001" }, { "fullName": "水费", "id": "E4002" }, { "fullName": "电费", "id": "E4003" }, { "fullName": "气费", "id": "E4004" }, { "fullName": "物业管理费", "id": "E4005" }, { "fullName": "物料消耗", "id": "E4006" }, { "fullName": "信息使用费", "id": "E4007" }, { "fullName": "展览费", "id": "E4008" }, { "fullName": "租赁费", "id": "E4009" }, { "fullName": "修理费", "id": "E4010" }], "fullName": "销售场地", "id": "E4000" }, { "children": [{ "fullName": "折旧费", "id": "E5001" }, { "fullName": "人员工资", "id": "E5002" }, { "fullName": "职工福利费", "id": "E5003" }, { "fullName": "差旅费", "id": "E5004" }], "fullName": "销售人员", "id": "E5000" }, { "children": [{ "fullName": "办公费", "id": "E6001" }, { "fullName": "委托代销手续费", "id": "E6002" }, { "fullName": "销售提成", "id": "E6003" }, { "fullName": "采购奖励", "id": "E6004" }, { "fullName": "佣金退回撤销-分销", "id": "E6006" }, { "fullName": "佣金退回-销售员", "id": "E6007" }, { "fullName": "佣金退回-分销", "id": "E6008" }, { "fullName": "佣金-销售员", "id": "E6009" }, { "fullName": "佣金-分销", "id": "E6011" }, { "fullName": "奖励", "id": "E6012" }], "fullName": "委托销售", "id": "E6000" }],
|
||||||
|
costProjectProps: { "label": "fullName", "value": "id", "children": "children" },
|
||||||
|
typeOptions: [{ "fullName": "收款", "id": "1" }, { "fullName": "付款", "id": "2" }],
|
||||||
|
typeProps: { "label": "fullName", "value": "id" },
|
||||||
|
wayTypeOptions: [{ "fullName": "单独收款", "id": "1" }, { "fullName": "账扣", "id": "2" }],
|
||||||
|
wayTypeOptionss: [{ "fullName": "单据付款", "id": "3" }, { "fullName": "账扣", "id": "4" }],
|
||||||
|
|
||||||
|
wayTypeProps: { "label": "fullName", "value": "id" },
|
||||||
|
wayStatusOptions: [{ "fullName": "未收款", "id": "1" }, { "fullName": "已收款", "id": "2" }],
|
||||||
|
wayStatusOptionss: [{ "fullName": "未付款", "id": "3" }, { "fullName": "已付款", "id": "4" }],
|
||||||
|
wayStatusProps: { "label": "fullName", "value": "id" },
|
||||||
|
childIndex: -1,
|
||||||
|
isEdit: false,
|
||||||
|
interfaceRes: {
|
||||||
|
code: [],
|
||||||
|
institutionId: [],
|
||||||
|
subjectId: [],
|
||||||
|
costTime: [],
|
||||||
|
businessCode: [],
|
||||||
|
remark: [],
|
||||||
|
costProject: [],
|
||||||
|
type: [],
|
||||||
|
wayType: [],
|
||||||
|
wayStatus: [],
|
||||||
|
costPrice: [],
|
||||||
|
payment: [],
|
||||||
|
pictures: [],
|
||||||
|
annexFile: [],
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
formOperates() {
|
||||||
|
return this.setting.formOperates
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {},
|
||||||
|
created() {
|
||||||
|
this.getFormById()
|
||||||
|
if (this.dataForm.id == null || this.dataForm.id == '' && this.dataForm.id == undefined || this.dataForm.id == 0) {
|
||||||
|
this.initDefaultData()
|
||||||
|
}
|
||||||
|
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
|
||||||
|
},
|
||||||
|
mounted() { },
|
||||||
|
methods: {
|
||||||
|
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() {
|
||||||
|
},
|
||||||
|
selfGetInfo(dataForm) {
|
||||||
|
this.dataInfo(dataForm)
|
||||||
|
},
|
||||||
|
beforeSubmit() {
|
||||||
|
const _data = this.dataList()
|
||||||
|
return _data
|
||||||
|
},
|
||||||
|
selfInit() {
|
||||||
|
this.dataAll()
|
||||||
|
},
|
||||||
|
getFormById() {
|
||||||
|
getFormById("542307079671527429").then(res => {
|
||||||
|
this.dataForm.flowId = res.data && res.data.flowId
|
||||||
|
// this.encode = res.data&&res.data.encode
|
||||||
|
})
|
||||||
|
},
|
||||||
|
exist() {
|
||||||
|
let isOk = true
|
||||||
|
for (let key in this.tableRequiredData) {
|
||||||
|
if (this.dataForm[key] && Array.isArray(this.dataForm[key])) {
|
||||||
|
for (let i = 0; i < this.dataForm[key].length; i++) {
|
||||||
|
let item = this.dataForm[key][i]
|
||||||
|
inner: for (let id in item) {
|
||||||
|
let arr = this.tableRequiredData[key].filter(o => o.id === id) || []
|
||||||
|
if (!arr.length) continue inner
|
||||||
|
if (arr[0].required) {
|
||||||
|
let msg = `${arr[0].name}不能为空`
|
||||||
|
let boo = true
|
||||||
|
if (arr[0].dataType === 'array') {
|
||||||
|
boo = !this.jnpf.isEmptyArray(item[id])
|
||||||
|
} else {
|
||||||
|
boo = !this.jnpf.isEmpty(item[id])
|
||||||
|
}
|
||||||
|
if (!boo) {
|
||||||
|
this.$message({
|
||||||
|
message: msg,
|
||||||
|
type: 'error',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
isOk = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return isOk
|
||||||
|
},
|
||||||
|
clearData() {
|
||||||
|
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||||
|
},
|
||||||
|
//初始化默认数据
|
||||||
|
initDefaultData() {
|
||||||
|
if (this.userInfo.organizeIdList instanceof Array && this.userInfo.organizeIdList.length > 0) {
|
||||||
|
this.dataForm.institutionId = this.userInfo.organizeIdList
|
||||||
|
}
|
||||||
|
// if (
|
||||||
|
// this.userInfo.organizeIdList instanceof Array &&
|
||||||
|
// this.userInfo.organizeIdList.length > 0
|
||||||
|
// ) {
|
||||||
|
// this.dataForm.institutionId = this.userInfo.organizeIdList;
|
||||||
|
// }
|
||||||
|
// this.dataForm.firstContactPerson = this.userInfo.userId;
|
||||||
|
// if (
|
||||||
|
// this.$store.getters.userInfo.organizeId &&
|
||||||
|
// this.$store.getters.userInfo.organizeId != null
|
||||||
|
// ) {
|
||||||
|
// this.dataForm.institutionId = this.$store.getters.userInfo.organizeId;
|
||||||
|
// }
|
||||||
|
this.dataForm.costTime = new Date().getTime()
|
||||||
|
|
||||||
|
},
|
||||||
|
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