|
|
@ -39,12 +39,12 @@
|
|
|
|
<!-- 元素控制-->
|
|
|
|
<!-- 元素控制-->
|
|
|
|
<template v-for="(item,index) in form.fieldTemplateList">
|
|
|
|
<template v-for="(item,index) in form.fieldTemplateList">
|
|
|
|
<van-field v-if="item.type == '1'" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" :required="item.required" v-model="item.value" :label="item.label" :disabled="disabled || oaListIsDisabled" :name="item.field" placeholder="请输入" input-align="right"></van-field>
|
|
|
|
<van-field v-if="item.type == '1'" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" :required="item.required" v-model="item.value" :label="item.label" :disabled="disabled || oaListIsDisabled" :name="item.field" placeholder="请输入" input-align="right"></van-field>
|
|
|
|
<van-field v-if="item.type == '2'" :label="item.label" required :name="item.field" :disabled="disabled || oaListIsDisabled" input-align="right" :rules="[{ message: `${item.label}不能为空`, required: false}]" label-width="9em">
|
|
|
|
<van-field v-if="item.type == '2'" :label="item.label" required :name="item.field" :disabled="disabled || oaListIsDisabled" input-align="right" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" label-width="9em">
|
|
|
|
<template #input>
|
|
|
|
<template #input>
|
|
|
|
<van-switch v-model="item.value" :disabled="disabled || oaListIsDisabled"/>
|
|
|
|
<van-switch v-model="item.value" :disabled="disabled || oaListIsDisabled" />
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</van-field>
|
|
|
|
</van-field>
|
|
|
|
<van-field v-if="item.type == '3'" right-icon="arrow" :required="item.required" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" :disabled="disabled || oaListIsDisabled" :class="item.value ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.fieldTemplateList[index][`${item.field}1`]" @click="handleDateShow(item.field,index)" :label="item.label" clear-trigger="always" input-align="right" />
|
|
|
|
<van-field v-if="item.type == '3'" right-icon="arrow" :required="item.required" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" :disabled="disabled || oaListIsDisabled" :class="item.value ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.fieldTemplateList[index][`${item.field}1`]" @click="handleDateShow(item.field,index)" :label="item.label" clear-trigger="always" input-align="right" />
|
|
|
|
<van-field v-if="item.type == '4'" type="number" :required="item.required" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" v-model="item.value" :label="item.label" :disabled="disabled || oaListIsDisabled" :name="item.field" placeholder="请输入" input-align="right"></van-field>
|
|
|
|
<van-field v-if="item.type == '4'" type="number" :required="item.required" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" v-model="item.value" :label="item.label" :disabled="disabled || oaListIsDisabled" :name="item.field" placeholder="请输入" input-align="right"></van-field>
|
|
|
|
<RePick v-if="item.type == '5'" :isRequrie="item.required" v-model="item.value" :disabled="disabled || oaListIsDisabled" titleKey="label" idKey="value" :label="item.label" :name="item.field" :list="item.map" isCell clearable />
|
|
|
|
<RePick v-if="item.type == '5'" :isRequrie="item.required" v-model="item.value" :disabled="disabled || oaListIsDisabled" titleKey="label" idKey="value" :label="item.label" :name="item.field" :list="item.map" isCell clearable />
|
|
|
|
<RePick v-if="item.type == '6'" :isRequrie="item.required" v-model="item.value" :disabled="disabled || oaListIsDisabled" titleKey="label" idKey="value" :label="item.label" :name="item.field" :list="item.map" multiple isCell clearable />
|
|
|
|
<RePick v-if="item.type == '6'" :isRequrie="item.required" v-model="item.value" :disabled="disabled || oaListIsDisabled" titleKey="label" idKey="value" :label="item.label" :name="item.field" :list="item.map" multiple isCell clearable />
|
|
|
@ -463,23 +463,23 @@ export default {
|
|
|
|
this.$set(this.form, 'proposerTime1', `${dayjs(this.form.proposerTime).format('YYYY/MM/DD')}`)
|
|
|
|
this.$set(this.form, 'proposerTime1', `${dayjs(this.form.proposerTime).format('YYYY/MM/DD')}`)
|
|
|
|
this.$set(this.form, 'startTime1', `${dayjs(this.form.startTime).format('YYYY/MM/DD')}`)
|
|
|
|
this.$set(this.form, 'startTime1', `${dayjs(this.form.startTime).format('YYYY/MM/DD')}`)
|
|
|
|
this.$set(this.form, 'endTime1', `${dayjs(this.form.endTime).format('YYYY/MM/DD')}`)
|
|
|
|
this.$set(this.form, 'endTime1', `${dayjs(this.form.endTime).format('YYYY/MM/DD')}`)
|
|
|
|
res.data.fieldTemplateList.forEach(function (item){
|
|
|
|
res.data.fieldTemplateList.forEach(function (item) {
|
|
|
|
if(item.type == 3){
|
|
|
|
if (item.type == 3) {
|
|
|
|
_this.$set(item, `${item.field}1`, `${dayjs(Number(item.value)).format('YYYY/MM/DD')}`)
|
|
|
|
_this.$set(item, `${item.field}1`, `${dayjs(item.value).format('YYYY/MM/DD')}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(item.type == 2){
|
|
|
|
if (item.type == 2) {
|
|
|
|
item.value =item.value? Boolean(item.value):false
|
|
|
|
item.value = item.value ? Boolean(item.value) : false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
console.log('this.form..', this.form);
|
|
|
|
console.log('this.form..', this.form);
|
|
|
|
}).finally(() => {
|
|
|
|
}).finally(() => {
|
|
|
|
this.$loading(false, 'loadingSb')
|
|
|
|
this.$loading(false, 'loadingSb')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
queryFieldTemplate(2).then((res) => {
|
|
|
|
queryFieldTemplate(2).then((res) => {
|
|
|
|
res.data.forEach(function (item){
|
|
|
|
res.data.forEach(function (item) {
|
|
|
|
if(item.type == 6){
|
|
|
|
if (item.type == 6) {
|
|
|
|
item.value = item.value?item.value:[]
|
|
|
|
item.value = item.value ? item.value : []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
this.fieldTemplateList = res.data
|
|
|
|
this.fieldTemplateList = res.data
|
|
|
|