Compare commits

..

No commits in common. '8af169e325b790fc12fafcff9a7b1033ef00cabd' and '9f83f8cbb6032b9f5fe5654224b76abaa11bf6d4' have entirely different histories.

@ -1,37 +0,0 @@
import request from '@/plugin/axios'
// 创建供应商合同
export function getFieldTemplate(type) {
return request({
url: '/bs/field-template/type/' + type,
method: 'get'
})
}
export function addFieldTemplate(data) {
return request({
url: '/bs/field-template/addField',
method: 'post',
data: data
})
}
export function deleteField(field,type) {
return request({
url: '/bs/field-template/'+field+'/'+type,
method: 'delete',
})
}
export function queryOption(field,type) {
return request({
url: '/bs/field-template/option/'+field+'/'+type,
method: 'get',
})
}
export function queryFieldTemplate(type) {
return request({
url: '/bs/field-template/type/'+type,
method: 'get',
})
}

@ -5,7 +5,7 @@
<div class="section"> <span class="line"> </span> 审批内容</div> <div class="section"> <span class="line"> </span> 审批内容</div>
<div class="trips-box"> <div class="trips-box">
<div class="item-box"> <div class="item-box">
<van-field v-model="form.contractNumber" :disabled="['edit','show'].includes(this.$route.query.type)" placeholder="请输入" :rules="[{ required: true, message: '请输入' }]" required label="合同编号" clear-trigger="always" input-align="right" /> <van-field v-model="form.contractNumber" :disabled="['edit','show'].includes(this.$route.query.type)" @blur="handleCtBlur" placeholder="请输入" :rules="[{ required: true, message: '请输入' }]" required label="合同编号" clear-trigger="always" input-align="right" />
<van-field v-model="form.contractName" required placeholder="请输入" :disabled="disabled" :rules="[{ required: true, message: '请输入' }]" label="合同名称" clear-trigger="always" input-align="right" /> <van-field v-model="form.contractName" required placeholder="请输入" :disabled="disabled" :rules="[{ required: true, message: '请输入' }]" label="合同名称" clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="合同开始时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="合同开始时间" clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="合同结束时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="合同结束时间" clear-trigger="always" input-align="right" />
@ -29,26 +29,12 @@
<RePick v-model="form.capitalSource" :disabled="disabled" titleKey="label" idKey="value" label="资金来源" name="capitalSource" :list="capitalSource" isCell clearable /> <RePick v-model="form.capitalSource" :disabled="disabled" titleKey="label" idKey="value" label="资金来源" name="capitalSource" :list="capitalSource" isCell clearable />
<van-field v-model="form.proposerPerson" :disabled="disabled" name="proposerPerson" type="number" placeholder="请输入" input-align="right" label="申请人" /> <van-field v-model="form.proposerPerson" :disabled="disabled" name="proposerPerson" type="number" placeholder="请输入" input-align="right" label="申请人" />
<!-- <van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />--> <van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.proposerTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.proposerTime1" @click="handleDateShow('proposerTime')" label="申请时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.proposerTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.proposerTime1" @click="handleDateShow('proposerTime')" label="申请时间" clear-trigger="always" input-align="right" />
<van-field v-model="form.taxForeheads" :disabled="disabled" name="taxForeheads" type="number" placeholder="请输入" input-align="right" label="税额" /> <van-field v-model="form.taxForeheads" :disabled="disabled" name="taxForeheads" type="number" placeholder="请输入" input-align="right" label="税额" />
<van-field v-model="form.taxRate" :disabled="disabled" name="taxRate" type="number" placeholder="请输入" input-align="right" label="税率" /> <van-field v-model="form.taxRate" :disabled="disabled" name="taxRate" type="number" placeholder="请输入" input-align="right" label="税率" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.dateSigning ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dateSigning1" @click="handleDateShow('dateSigning')" label="签订时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.dateSigning ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dateSigning1" @click="handleDateShow('dateSigning')" label="签订时间" clear-trigger="always" input-align="right" />
<van-field v-model="form.other" :disabled="disabled" name="reason" autosize rows="2" label="合同描述" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" /> <van-field v-model="form.other" :disabled="disabled" name="reason" autosize rows="2" label="合同描述" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<!-- 元素管理-->
<template v-for="(item,index) in form.fieldTemplateList">
<van-field v-if="item.type == '1'" :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 == '2'" :label="item.label" :required="item.required" :name="item.field" :disabled="disabled || oaListIsDisabled" input-align="right" :rules="[{ message: `${item.label}不能为空`, required: item.required}]" label-width="9em">
<template #input>
<van-switch v-model="item.value" :disabled="disabled || oaListIsDisabled"/>
</template>
</van-field>
<van-field v-if="item.type == '3'" :required="item.required" right-icon="arrow" :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'" :required="item.required" type="number" :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 == '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 />
</template>
</div> </div>
</div> </div>
<div class="section mt5"> <span class="line"> </span>附件</div> <div class="section mt5"> <span class="line"> </span>附件</div>
@ -109,7 +95,6 @@ import {
import { Dialog } from 'vant' import { Dialog } from 'vant'
import {getCustomerContractTypeListAll} from "@/api/bs/contractType"; import {getCustomerContractTypeListAll} from "@/api/bs/contractType";
import {getProjectPage} from "@/api/bs/project"; import {getProjectPage} from "@/api/bs/project";
import { queryFieldTemplate } from '@/api/bs/template'
export default { export default {
//import使 //import使
name: 'contract-custom', name: 'contract-custom',
@ -186,10 +171,7 @@ export default {
dealContent: null, dealContent: null,
other: null, other: null,
}, },
oaReimburseFeeitemList: [], oaReimburseFeeitemList: []
dateType:'',
fieldType:'',
fieldTemplateList:[]
}; };
}, },
@ -294,7 +276,7 @@ export default {
amount: actualAmount, amount: actualAmount,
startTime, startTime,
endTime, endTime,
managerPhone, managerPhone
} }
} }
this.$loading(false) this.$loading(false)
@ -383,8 +365,7 @@ export default {
...item, ...item,
planTime: dayjs(item.planTime).valueOf() planTime: dayjs(item.planTime).valueOf()
} }
}), })
// proposerPerson:this.userInfo.id
} }
this.$loading(true, 'form') this.$loading(true, 'form')
// this.handleCtBlur({ // this.handleCtBlur({
@ -424,7 +405,6 @@ export default {
}) })
}, },
handleInitForm() { handleInitForm() {
let _this = this
const { id, type } = this.$route.query || {} const { id, type } = this.$route.query || {}
this.typeStr = type this.typeStr = type
if (id) { if (id) {
@ -457,32 +437,10 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.BottomBtn.handleFilterBtnList() this.$refs.BottomBtn.handleFilterBtnList()
}) })
this.$set(this.form, 'dateSigning1', `${dayjs(this.form.dateSigning).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, 'endTime1', `${dayjs(this.form.endTime).format('YYYY/MM/DD')}`)
this.form.fieldTemplateList.forEach(function (item,index){
if(item.type == 3){
_this.$set(item, `${item.field}1`, `${dayjs(item.value).format('YYYY/MM/DD')}`)
}
if(item.type == 2){
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 {
queryFieldTemplate(1).then((res) => {
res.data.forEach(function (item){
if(item.type == 6){
item.value = item.value?item.value:[]
}
})
this.fieldTemplateList = res.data
this.$set(this.form, 'fieldTemplateList', res.data)
});
} }
}, },
handleNewConfirmPo(arr, index) { handleNewConfirmPo(arr, index) {
@ -582,41 +540,20 @@ export default {
this.capitalSource = res.data.list || []; this.capitalSource = res.data.list || [];
}); });
}, },
handleDateShow(dateType,type) { handleDateShow(dateType) {
let _this = this
if (this.disabled) return if (this.disabled) return
_this.dateType = dateType this.dateType = dateType
_this.fieldType = type this.$nextTick(() => {
if(type){ let date = dateType == 'dateSigning'?this.form.dateSigning:dateType=='proposerTime'?this.form.proposerTime:dateType=='startTime'?this.form.startTime:dateType=='endTime'?this.form.endTime:''
_this.$nextTick(() => { this.$refs.vanCalendar && this.$refs.vanCalendar.reset()
let date = _this.form.fieldTemplateList[type][dateType] || '' this.dateShow = true
_this.$refs.vanCalendar && _this.$refs.vanCalendar.reset() if (date) {
_this.dateShow = true let time = dayjs(Number(date)).format('YYYY/MM/DD');
if (date) { this.defaultDate = new Date(time)
let time = dayjs(Number(date)).format('YYYY/MM/DD'); }
_this.defaultDate = new Date(time) })
}
})
}else {
_this.$nextTick(() => {
let date = dateType == 'dateSigning'?_this.form.dateSigning:dateType=='proposerTime'?_this.form.proposerTime:dateType=='startTime'?_this.form.startTime:dateType=='endTime'?_this.form.endTime:''
_this.$refs.vanCalendar && _this.$refs.vanCalendar.reset()
_this.dateShow = true
if (date) {
let time = dayjs(Number(date)).format('YYYY/MM/DD');
_this.defaultDate = new Date(time)
}
})
}
}, },
handleDateSelect(val) { handleDateSelect(val) {
if(this.fieldType){
this.$set(this.form.fieldTemplateList[this.fieldType], `${this.dateType}1`, `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form.fieldTemplateList[this.fieldType], 'value', `${dayjs(val).valueOf()}`)
this.dateShow = false
return;
}
if(this.dateType == 'dateSigning'){ if(this.dateType == 'dateSigning'){
this.$set(this.form, 'dateSigning1', `${dayjs(val).format('YYYY/MM/DD')}`) this.$set(this.form, 'dateSigning1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'dateSigning', `${dayjs(val).valueOf()}`) this.$set(this.form, 'dateSigning', `${dayjs(val).valueOf()}`)

@ -11,7 +11,7 @@
<!-- </van-field>--> <!-- </van-field>-->
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="合同开始时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.startTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.startTime1" @click="handleDateShow('startTime')" label="合同开始时间" clear-trigger="always" input-align="right" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="合同结束时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled ||oaListIsDisabled" :class="form.endTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.endTime1" @click="handleDateShow('endTime')" label="合同结束时间" clear-trigger="always" input-align="right" />
<RePick v-model="form.supplierId" :disabled="disabled ||oaListIsDisabled " titleKey="companyName" idKey="id" label="供应商名称" name="supplierId" :list="supplierList" isRequrie isCell clearable /> <RePick v-model="form.supplierId" :disabled="disabled ||oaListIsDisabled " titleKey="companyAme" idKey="id" label="供应商名称" name="supplierId" :list="supplierList" isRequrie isCell clearable />
<RePick v-model="form.departmentId" :disabled="disabled" label="签约部门" @change="handleChange" :name="`departmentId`" :list="userDeptTree" isRequrie isCascader isShowSearch title="签约部门" titleKey="name" isCell clearable /> <RePick v-model="form.departmentId" :disabled="disabled" label="签约部门" @change="handleChange" :name="`departmentId`" :list="userDeptTree" isRequrie isCascader isShowSearch title="签约部门" titleKey="name" isCell clearable />
<RePick v-model="form.signatoryId" :disabled="disabled" titleKey="nickname" idKey="id" label="签约人员" name="signatoryId" :list="signatoryList" isRequrie isCell clearable /> <RePick v-model="form.signatoryId" :disabled="disabled" titleKey="nickname" idKey="id" label="签约人员" name="signatoryId" :list="signatoryList" isRequrie isCell clearable />
<RePick v-model="form.contractType" :disabled="disabled" titleKey="contractName" idKey="id" label="合同类型" name="contractType" :list="typeList" isRequrie isCell clearable /> <RePick v-model="form.contractType" :disabled="disabled" titleKey="contractName" idKey="id" label="合同类型" name="contractType" :list="typeList" isRequrie isCell clearable />
@ -29,26 +29,12 @@
<van-field v-model="form.dealContent" :disabled="disabled" name="reason" autosize rows="2" label="交易内容" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" /> <van-field v-model="form.dealContent" :disabled="disabled" name="reason" autosize rows="2" label="交易内容" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<RePick v-model="form.capitalSource" :disabled="disabled" titleKey="label" idKey="value" label="资金来源" name="capitalSource" :list="capitalSource" isCell clearable /> <RePick v-model="form.capitalSource" :disabled="disabled" titleKey="label" idKey="value" label="资金来源" name="capitalSource" :list="capitalSource" isCell clearable />
<van-field v-model="form.proposerPerson" :disabled="disabled" name="proposerPerson" type="number" placeholder="请输入" input-align="right" label="申请人" /> <van-field v-model="form.proposerPerson" :disabled="disabled" name="proposerPerson" type="number" placeholder="请输入" input-align="right" label="申请人" />
<!-- <van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />--> <van-field v-model="form.taxAmount" :disabled="disabled" name="taxAmount" type="number" placeholder="请输入" input-align="right" label="合同金额(含税)" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.proposerTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.proposerTime1" @click="handleDateShow('proposerTime')" label="申请时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.proposerTime ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.proposerTime1" @click="handleDateShow('proposerTime')" label="申请时间" clear-trigger="always" input-align="right" />
<van-field v-model="form.taxForeheads" :disabled="disabled" name="taxForeheads" type="number" placeholder="请输入" input-align="right" label="税额" /> <van-field v-model="form.taxForeheads" :disabled="disabled" name="taxForeheads" type="number" placeholder="请输入" input-align="right" label="税额" />
<van-field v-model="form.taxRate" :disabled="disabled" name="taxRate" type="number" placeholder="请输入" input-align="right" label="税率" /> <van-field v-model="form.taxRate" :disabled="disabled" name="taxRate" type="number" placeholder="请输入" input-align="right" label="税率" />
<van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.dateSigning ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dateSigning1" @click="handleDateShow('dateSigning')" label="签订时间" clear-trigger="always" input-align="right" /> <van-field right-icon="arrow" :rules="[{ required: true, message: '请选择' }]" :disabled="disabled" :class="form.dateSigning ? 'actived-disabled':''" :name="`time`" placeholder="请选择" v-model="form.dateSigning1" @click="handleDateShow('dateSigning')" label="签订时间" clear-trigger="always" input-align="right" />
<van-field v-model="form.other" :disabled="disabled" name="reason" autosize rows="2" label="合同简述" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" /> <van-field v-model="form.other" :disabled="disabled" name="reason" autosize rows="2" label="合同简述" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
<!-- 元素控制-->
<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 == '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>
<van-switch v-model="item.value" :disabled="disabled || oaListIsDisabled"/>
</template>
</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 == '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 == '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 />
</template>
</div> </div>
</div> </div>
<div class="section mt5"> <span class="line"> </span>附件</div> <div class="section mt5"> <span class="line"> </span>附件</div>
@ -109,7 +95,6 @@ import {
} from "@/api/system/user"; } from "@/api/system/user";
import { getCustomerContractTypeListAll } from '@/api/bs/contractType' import { getCustomerContractTypeListAll } from '@/api/bs/contractType'
import {getProjectPage} from "@/api/bs/project"; import {getProjectPage} from "@/api/bs/project";
import { queryFieldTemplate } from '@/api/bs/template'
export default { export default {
//import使 //import使
name: 'contract-supplier', name: 'contract-supplier',
@ -190,9 +175,7 @@ export default {
other: null, other: null,
}, },
oaReimburseFeeitemList: [], oaReimburseFeeitemList: [],
dateType:'', dateType:''
fieldType:'',
fieldTemplateList:[]
}; };
}, },
@ -390,8 +373,7 @@ export default {
...item, ...item,
planTime: dayjs(item.planTime).valueOf() planTime: dayjs(item.planTime).valueOf()
} }
}), })
// proposerPerson:this.userInfo.id
} }
this.$loading(true, 'form') this.$loading(true, 'form')
createSupplierContract(newForm).then((res) => { createSupplierContract(newForm).then((res) => {
@ -426,7 +408,6 @@ export default {
}) })
}, },
handleInitForm() { handleInitForm() {
let _this = this
const { id, type } = this.$route.query || {} const { id, type } = this.$route.query || {}
this.typeStr = type this.typeStr = type
if (id) { if (id) {
@ -459,32 +440,10 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.BottomBtn.handleFilterBtnList() this.$refs.BottomBtn.handleFilterBtnList()
}) })
this.$set(this.form, 'dateSigning1', `${dayjs(this.form.dateSigning).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, 'endTime1', `${dayjs(this.form.endTime).format('YYYY/MM/DD')}`)
res.data.fieldTemplateList.forEach(function (item){
if(item.type == 3){
_this.$set(item, `${item.field}1`, `${dayjs(item.value).format('YYYY/MM/DD')}`)
}
if(item.type == 2){
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 {
queryFieldTemplate(2).then((res) => {
res.data.forEach(function (item){
if(item.type == 6){
item.value = item.value?item.value:[]
}
})
this.fieldTemplateList = res.data
this.$set(this.form, 'fieldTemplateList', res.data)
});
} }
}, },
handleUpload(list) { handleUpload(list) {
@ -579,41 +538,31 @@ export default {
}); });
}) })
}, },
handleDateShow(dateType,type) { handleDateShow(dateType) {
let _this = this
if (this.disabled) return if (this.disabled) return
_this.dateType = dateType this.dateType = dateType
_this.fieldType = type this.$nextTick(() => {
if(type){ let date = dateType == 'dateSigning'?this.form.dateSigning:dateType=='proposerTime'?this.form.proposerTime:dateType=='startTime'?this.form.startTime:dateType=='endTime'?this.form.endTime:''
_this.$nextTick(() => { this.$refs.vanCalendar && this.$refs.vanCalendar.reset()
let date = _this.form.fieldTemplateList[type][dateType] || '' this.dateShow = true
_this.$refs.vanCalendar && _this.$refs.vanCalendar.reset() if (date) {
_this.dateShow = true let time = dayjs(Number(date)).format('YYYY/MM/DD');
if (date) { this.defaultDate = new Date(time)
let time = dayjs(Number(date)).format('YYYY/MM/DD'); }
_this.defaultDate = new Date(time) })
} },
}) handlePDateShow(time, index) {
}else { if (this.disabled) return
_this.$nextTick(() => { this.$nextTick(() => {
let date = dateType == 'dateSigning'?_this.form.dateSigning:dateType=='proposerTime'?_this.form.proposerTime:dateType=='startTime'?_this.form.startTime:dateType=='endTime'?_this.form.endTime:'' this.$refs.pVanCalendar && this.$refs.pVanCalendar.reset()
_this.$refs.vanCalendar && _this.$refs.vanCalendar.reset() this.palnTimeShow = true
_this.dateShow = true this.pIndex = index
if (date) { if (time) {
let time = dayjs(Number(date)).format('YYYY/MM/DD'); this.pDefaultDate = dayjs(time).toDate()
_this.defaultDate = new Date(time) }
} })
})
}
}, },
handleDateSelect(val) { handleDateSelect(val) {
if(this.fieldType){
this.$set(this.form.fieldTemplateList[this.fieldType], `${this.dateType}1`, `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form.fieldTemplateList[this.fieldType], 'value', `${dayjs(val).valueOf()}`)
this.dateShow = false
return;
}
if(this.dateType == 'dateSigning'){ if(this.dateType == 'dateSigning'){
this.$set(this.form, 'dateSigning1', `${dayjs(val).format('YYYY/MM/DD')}`) this.$set(this.form, 'dateSigning1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'dateSigning', `${dayjs(val).valueOf()}`) this.$set(this.form, 'dateSigning', `${dayjs(val).valueOf()}`)
@ -630,20 +579,18 @@ export default {
this.$set(this.form, 'endTime1', `${dayjs(val).format('YYYY/MM/DD')}`) this.$set(this.form, 'endTime1', `${dayjs(val).format('YYYY/MM/DD')}`)
this.$set(this.form, 'endTime', `${dayjs(val).valueOf()}`) this.$set(this.form, 'endTime', `${dayjs(val).valueOf()}`)
} }
// if (list && list.length) {
// this.$set(this.form, 'time', `${dayjs(list[0]).format('YY/MM/DD')}~${dayjs(list[1]).format('YY/MM/DD')}`)
// this.$set(this.form, 'startTime', dayjs(list[0]).valueOf())
// this.$set(this.form, 'endTime', dayjs(list[1]).valueOf())
// } else {
// this.$set(this.form, 'time', null)
// this.$set(this.form, 'startTime', null)
// this.$set(this.form, 'endTime', null)
// }
this.dateShow = false this.dateShow = false
}, },
handlePDateShow(time, index) {
if (this.disabled) return
this.$nextTick(() => {
this.$refs.pVanCalendar && this.$refs.pVanCalendar.reset()
this.palnTimeShow = true
this.pIndex = index
if (time) {
this.pDefaultDate = dayjs(time).toDate()
}
})
},
handlePlanDateSelect(date) { handlePlanDateSelect(date) {
if (date) { if (date) {
let num = this.oaReimburseFeeitemList.length - 1 let num = this.oaReimburseFeeitemList.length - 1

Loading…
Cancel
Save