parent
6fbfd2bd5c
commit
c5e36a2041
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,711 @@
|
||||
|
||||
|
||||
div -1
|
||||
-2
|
||||
|
||||
<template>
|
||||
<div :style="{margin: '0 auto',width:'100%'}">
|
||||
<el-row :gutter="15" class="">
|
||||
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="default" label-width="100px"
|
||||
label-position="left" :disabled="setting.readonly">
|
||||
<template v-if="!loading && formOperates">
|
||||
<!-- 具体表单 -->
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="基础信息11" contentPosition="left">
|
||||
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</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('name')">
|
||||
<jnpf-form-tip-item label="生产线名称" v-if="judgeShow('name')" prop="name">
|
||||
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)" placeholder="请输入"
|
||||
:disabled="judgeWrite('name')" clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="judgeShow('simpleName')">
|
||||
<jnpf-form-tip-item label=" 简称/英文名" v-if="judgeShow('simpleName')" prop="simpleName">
|
||||
<JnpfInput v-model="dataForm.simpleName" @change="changeData('simpleName',-1)"
|
||||
placeholder="请输入" :disabled="judgeWrite('simpleName')" clearable
|
||||
:style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</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">
|
||||
<JnpfSelect v-model="dataForm.type" @change="changeData('type',-1)" placeholder="请选择"
|
||||
:disabled="judgeWrite('type')" clearable :style='{"width":"100%"}'
|
||||
:options="typeOptions" :props="typeProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="judgeShow('parentId')">
|
||||
<jnpf-form-tip-item label="所属工厂" v-if="judgeShow('parentId')" prop="parentId">
|
||||
<JnpfSelect v-model="dataForm.parentId" @change="changeData('parentId',-1)"
|
||||
placeholder="请选择" :disabled="judgeWrite('parentId')" clearable
|
||||
:style='{"width":"100%"}' :options="parentIdOptions" :props="parentIdProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="8" v-if="judgeShow('workshopId')">
|
||||
<jnpf-form-tip-item label="所属车间" v-if="judgeShow('workshopId')" prop="workshopId">
|
||||
<JnpfSelect v-model="dataForm.workshopId" @change="changeData('workshopId',-1)"
|
||||
placeholder="请选择" :disabled="judgeWrite('workshopId')" clearable
|
||||
:style='{"width":"100%"}' :options="workshopIdOptions" :props="workshopIdProps">
|
||||
</JnpfSelect>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="judgeShow('status')">
|
||||
<jnpf-form-tip-item label="状态" v-if="judgeShow('status')" prop="status">
|
||||
<JnpfRadio v-model="dataForm.status" @change="changeData('status',-1)"
|
||||
:disabled="judgeWrite('status')" optionType="button" direction="horizontal"
|
||||
:style='{"width":"100%"}' size="large" :options="statusOptions"
|
||||
:props="statusProps">
|
||||
</JnpfRadio>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="judgeShow('description')">
|
||||
<jnpf-form-tip-item label="描述" v-if="judgeShow('description')" prop="description">
|
||||
<JnpfTextarea v-model="dataForm.description" @change="changeData('description',-1)"
|
||||
placeholder="请输入" :disabled="judgeWrite('description')" clearable
|
||||
:style='{"width":"100%"}' :autosize='{"minRows":4,"maxRows":4}'>
|
||||
</JnpfTextarea>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<jnpf-form-tip-item>
|
||||
<JnpfGroupTitle content="联系人信息" contentPosition="left">
|
||||
</JnpfGroupTitle>
|
||||
</jnpf-form-tip-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="judgeShow('-${html.relationField}')">
|
||||
<jnpf-form-tip-item label-width="0">
|
||||
<div class="JNPF-common-title">
|
||||
<h2></h2>
|
||||
</div>
|
||||
<el-table :data="dataForm.businessContact1List" size='mini'>
|
||||
<el-table-column type="index" width="50" label="序号" align="center" />
|
||||
<el-table-column label="类型" v-if="judgeShow('businesscontact1-contactType')"
|
||||
prop="contactType">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-contactType')">*</span>类型
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfSelect v-model="scope.row.contactType"
|
||||
@change="changeData('businesscontact1-contactType',scope.$index)"
|
||||
placeholder="请选择"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-contactType')"
|
||||
clearable :style='{"width":"100%"}'
|
||||
:options="businesscontact1contactTypeOptions"
|
||||
:props="businesscontact1contactTypeProps">
|
||||
</JnpfSelect>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" v-if="judgeShow('businesscontact1-name')" prop="name">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-name')">*</span>姓名
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.name"
|
||||
@change="changeData('businesscontact1-name',scope.$index)" placeholder="请输入"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-name')"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="手机号" v-if="judgeShow('businesscontact1-phone')"
|
||||
prop="phone">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-phone')">*</span>手机号
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.phone"
|
||||
@change="changeData('businesscontact1-phone',scope.$index)" placeholder="请输入"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-phone')"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="座机" v-if="judgeShow('businesscontact1-landline')"
|
||||
prop="landline">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-landline')">*</span>座机
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.landline"
|
||||
@change="changeData('businesscontact1-landline',scope.$index)"
|
||||
placeholder="请输入"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-landline')"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="邮箱" v-if="judgeShow('businesscontact1-email')" prop="email">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-email')">*</span>邮箱
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.email"
|
||||
@change="changeData('businesscontact1-email',scope.$index)" placeholder="请输入"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-email')"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="传真" v-if="judgeShow('businesscontact1-fax')" prop="fax">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-fax')">*</span>传真
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.fax"
|
||||
@change="changeData('businesscontact1-fax',scope.$index)" placeholder="请输入"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-fax')"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新时间" v-if="judgeShow('businesscontact1-lastModifyTime')"
|
||||
prop="lastModifyTime">
|
||||
<template slot="header">
|
||||
<span class="required-sign"
|
||||
v-if="judgeRequired('businesscontactList-lastModifyTime')">*</span>更新时间
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<JnpfInput v-model="scope.row.lastModifyTime"
|
||||
@change="changeData('businesscontact1-lastModifyTime',scope.$index)"
|
||||
placeholder="请输入"
|
||||
:disabled="judgeWrite('businesscontactList')||judgeWrite('businesscontactList-lastModifyTime')"
|
||||
clearable :style='{"width":"100%"}'>
|
||||
</JnpfInput>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="50" v-if="!judgeWrite('businesscontactList')">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" class="JNPF-table-delBtn"
|
||||
@click="delbusinesscontact1List(scope.$index)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="table-actions" @click="addbusinesscontact1List()"
|
||||
v-if="!judgeWrite('businesscontactList')">
|
||||
<el-button type="text" icon="el-icon-plus">添加</el-button>
|
||||
</div>
|
||||
</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: {
|
||||
businessContact1List: { "popupType": "dialog", "hasPage": true, "popupTitle": "选择数据", "pageSize": 20, "columnOptions": [], "interfaceId": "", "interfaceName": "", "relationOptions": [], "templateJson": [], "popupWidth": "800px" },
|
||||
},
|
||||
//可选范围默认值
|
||||
ableAll: {
|
||||
},
|
||||
tableRows: {
|
||||
businessContact1List: {
|
||||
contactTypeOptions: [],
|
||||
name: '',
|
||||
nameOptions: [],
|
||||
phone: '',
|
||||
phoneOptions: [],
|
||||
landline: '',
|
||||
landlineOptions: [],
|
||||
email: '',
|
||||
emailOptions: [],
|
||||
fax: '',
|
||||
faxOptions: [],
|
||||
lastModifyTime: '',
|
||||
lastModifyTimeOptions: [],
|
||||
enabledmark: undefined
|
||||
},
|
||||
},
|
||||
Vmodel: "",
|
||||
currVmodel: "",
|
||||
dataForm: {
|
||||
code: undefined,
|
||||
name: undefined,
|
||||
simpleName: undefined,
|
||||
type: undefined,
|
||||
parentId: undefined,
|
||||
workshopId: undefined,
|
||||
status: 1,
|
||||
difflag: "5",
|
||||
diffFlag: "5",
|
||||
|
||||
description: undefined,
|
||||
businessContact1List: [],
|
||||
version: 0,
|
||||
},
|
||||
tableRequiredData: {},
|
||||
dataRule:
|
||||
{
|
||||
name: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入',
|
||||
trigger: 'blur'
|
||||
},
|
||||
],
|
||||
type: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
parentId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
workshopId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
status: [
|
||||
{
|
||||
required: true,
|
||||
message: '不能为空',
|
||||
trigger: 'change'
|
||||
},
|
||||
],
|
||||
},
|
||||
typeOptions: [],
|
||||
typeProps: { "label": "fullName", "value": "id" },
|
||||
parentIdOptions: [],
|
||||
parentIdProps: { "label": "name", "value": "id" },
|
||||
workshopIdOptions: [],
|
||||
workshopIdProps: { "label": "name", "value": "id" },
|
||||
statusOptions: [{ "fullName": "启用", "id": "1" }, { "fullName": "禁用", "id": "2" }],
|
||||
statusProps: { "label": "fullName", "value": "id" },
|
||||
businesscontact1contactTypeOptions: [],
|
||||
businesscontact1contactTypeProps: { "label": "fullName", "value": "id" },
|
||||
childIndex: -1,
|
||||
isEdit: false,
|
||||
interfaceRes: {
|
||||
code: [],
|
||||
name: [],
|
||||
simpleName: [],
|
||||
type: [],
|
||||
parentId: [],
|
||||
workshopId: [],
|
||||
status: [],
|
||||
description: [],
|
||||
businesscontact1contactType: [],
|
||||
businesscontact1name: [],
|
||||
businesscontact1phone: [],
|
||||
businesscontact1landline: [],
|
||||
businesscontact1email: [],
|
||||
businesscontact1fax: [],
|
||||
businesscontact1lastModifyTime: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
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() {
|
||||
this.gettypeOptions();
|
||||
this.getparentIdOptions();
|
||||
this.getworkshopIdOptions();
|
||||
this.getbusinesscontact1contactTypeOptions();
|
||||
},
|
||||
selfGetInfo(dataForm) {
|
||||
this.dataInfo(dataForm)
|
||||
},
|
||||
beforeSubmit() {
|
||||
const _data = this.dataList()
|
||||
return _data
|
||||
},
|
||||
selfInit() {
|
||||
this.dataAll()
|
||||
},
|
||||
getFormById() {
|
||||
getFormById("521949393889270917").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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.businesscontact1Exist()) return
|
||||
return isOk
|
||||
},
|
||||
businesscontact1Exist() {
|
||||
let isOk = true;
|
||||
for (let i = 0; i < this.dataForm.businessContact1List.length; i++) {
|
||||
const e = this.dataForm.businessContact1List[i];
|
||||
if (!e.contactType) {
|
||||
this.$message({
|
||||
message: '类型不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.name) {
|
||||
this.$message({
|
||||
message: '姓名不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.phone) {
|
||||
this.$message({
|
||||
message: '手机号不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
if (!e.email) {
|
||||
this.$message({
|
||||
message: '邮箱不能为空',
|
||||
type: 'error',
|
||||
duration: 1000
|
||||
});
|
||||
isOk = false
|
||||
break
|
||||
}
|
||||
}
|
||||
return isOk;
|
||||
},
|
||||
gettypeOptions() {
|
||||
getDictionaryDataSelector('521639458429212677').then(res => {
|
||||
this.typeOptions = res.data.list
|
||||
})
|
||||
},
|
||||
getparentIdOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.parentId))
|
||||
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('521651055751075845', template).then(res => {
|
||||
let data = res.data
|
||||
this.parentIdOptions = data
|
||||
this.changeDataFormData(1, 'parentId', 'parentId', index, '')
|
||||
})
|
||||
},
|
||||
getworkshopIdOptions() {
|
||||
const index = this.childIndex
|
||||
let templateJsonList = JSON.parse(JSON.stringify(this.interfaceRes.workshopId))
|
||||
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('521948662406847621', template).then(res => {
|
||||
let data = res.data
|
||||
this.workshopIdOptions = data
|
||||
this.changeDataFormData(1, 'workshopId', 'workshopId', index, '')
|
||||
})
|
||||
},
|
||||
getbusinesscontact1contactTypeOptions() {
|
||||
getDictionaryDataSelector('517959233023509701').then(res => {
|
||||
this.businesscontact1contactTypeOptions = res.data.list
|
||||
})
|
||||
},
|
||||
goBack() {
|
||||
this.$emit('refresh')
|
||||
},
|
||||
clearData() {
|
||||
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
|
||||
},
|
||||
//初始化默认数据
|
||||
initDefaultData() {
|
||||
|
||||
},
|
||||
addbusinesscontact1List() {
|
||||
let item = {
|
||||
contactType: '',
|
||||
contactTypeOptions: [],
|
||||
name: undefined,
|
||||
phone: undefined,
|
||||
landline: undefined,
|
||||
email: undefined,
|
||||
fax: undefined,
|
||||
lastModifyTime: undefined,
|
||||
}
|
||||
this.getbusinesscontact1List(item)
|
||||
},
|
||||
delbusinesscontact1List(index) {
|
||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.dataForm.businessContact1List.splice(index, 1);
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
getbusinesscontact1List(value) {
|
||||
let item = { ...this.tableRows.businessContact1List, ...value }
|
||||
this.dataForm.businessContact1List.push(item)
|
||||
this.childIndex = this.dataForm.businessContact1List.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.businesscontact1List.length; i++) {
|
||||
this.childIndex = i
|
||||
}
|
||||
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
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue