|
|
@ -1,87 +1,363 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="common-list-contain">
|
|
|
|
<div class="common-list-contain">
|
|
|
|
<div class="common-form">
|
|
|
|
<div class="common-form">
|
|
|
|
<van-form ref="form" :show-error-message="false" validate-trigger="" :submit-on-enter="false">
|
|
|
|
<van-form
|
|
|
|
<div class="section"> <span class="line"> </span> 基本信息</div>
|
|
|
|
ref="form"
|
|
|
|
|
|
|
|
:show-error-message="false"
|
|
|
|
|
|
|
|
validate-trigger=""
|
|
|
|
|
|
|
|
:submit-on-enter="false"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<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.applyNo" disabled label="单号" v-if="disabled" clear-trigger="always" input-align="right" />
|
|
|
|
<van-field
|
|
|
|
<van-field v-model="cn" disabled label="公司名称" clear-trigger="always" input-align="right" />
|
|
|
|
v-model="form.applyNo"
|
|
|
|
<van-field v-model="userInfo.nickname" disabled label="申请人" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
|
|
|
|
disabled
|
|
|
|
<van-field v-model="userInfo.dept.name" disabled label="申请部门" clear-trigger="always" input-align="right" maxlength="50" placeholder="请输入" />
|
|
|
|
label="单号"
|
|
|
|
<van-field v-model="form.projectName" :disabled="disabled" label="项目名称" clear-trigger="always" input-align="right" placeholder="请输入" />
|
|
|
|
v-if="disabled"
|
|
|
|
<van-field v-model="form.amount" v-if="!CLSQ" type="input" :disabled="disabled" name="amount" autosize rows="2" :rules="[{ required: false, message: '预计费用格式错误',validator: VerifyFunc.validatorMoney, type:1 }]" label="预计费用" clear-trigger="always" input-align="right" placeholder="请输入" />
|
|
|
|
clear-trigger="always"
|
|
|
|
<van-field v-model="form.reason" :disabled="disabled" name="reason" autosize rows="2" label="申请事由" required :rules="[{ required: true, message: '请输入' }]" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
|
|
|
|
input-align="right"
|
|
|
|
<van-field v-model="form.remark" :disabled="disabled" name="reason" autosize rows="2" label="备注信息" clear-trigger="always" input-align="right" placeholder="请输入" type="textarea" />
|
|
|
|
/>
|
|
|
|
|
|
|
|
<!-- <van-field
|
|
|
|
|
|
|
|
v-model="cn"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
label="公司名称"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
/> -->
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
v-model="form.companyName"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
label="公司名称"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <van-field
|
|
|
|
|
|
|
|
v-model="userInfo.nickname"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
label="申请人"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
maxlength="50"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
/> -->
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
v-model="form.nickname"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
label="申请人"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
maxlength="50"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<!-- <van-field
|
|
|
|
|
|
|
|
v-model="userInfo.dept.name"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
label="申请部门"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
maxlength="50"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
/> -->
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
v-model="form.deptName"
|
|
|
|
|
|
|
|
disabled
|
|
|
|
|
|
|
|
label="申请部门"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
maxlength="50"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
v-model="form.projectName"
|
|
|
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
|
|
|
label="项目名称"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
v-model="form.amount"
|
|
|
|
|
|
|
|
v-if="!CLSQ"
|
|
|
|
|
|
|
|
type="input"
|
|
|
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
|
|
|
name="amount"
|
|
|
|
|
|
|
|
autosize
|
|
|
|
|
|
|
|
rows="2"
|
|
|
|
|
|
|
|
:rules="[
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
required: false,
|
|
|
|
|
|
|
|
message: '预计费用格式错误',
|
|
|
|
|
|
|
|
validator: VerifyFunc.validatorMoney,
|
|
|
|
|
|
|
|
type: 1,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
]"
|
|
|
|
|
|
|
|
label="预计费用"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
v-model="form.reason"
|
|
|
|
|
|
|
|
: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.remark"
|
|
|
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
|
|
|
name="reason"
|
|
|
|
|
|
|
|
autosize
|
|
|
|
|
|
|
|
rows="2"
|
|
|
|
|
|
|
|
label="备注信息"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section mt5"> <span class="line"> </span>附件</div>
|
|
|
|
<div class="section mt5"><span class="line"> </span>附件</div>
|
|
|
|
<div class="trips-box">
|
|
|
|
<div class="trips-box">
|
|
|
|
<div class="item-box">
|
|
|
|
<div class="item-box">
|
|
|
|
<UploadFile :typeStr="typeStr" @onConfirm="handleUpload" :fileList="fileList" />
|
|
|
|
<UploadFile
|
|
|
|
|
|
|
|
:typeStr="typeStr"
|
|
|
|
|
|
|
|
@onConfirm="handleUpload"
|
|
|
|
|
|
|
|
:fileList="fileList"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="section mt5" v-if="CLSQ"> <span class="line"></span> 行程信息</div>
|
|
|
|
<div class="section mt5" v-if="CLSQ">
|
|
|
|
|
|
|
|
<span class="line"></span> 行程信息
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class="trips-box" v-if="CLSQ">
|
|
|
|
<div class="trips-box" v-if="CLSQ">
|
|
|
|
<div class="item-box" v-for="(item,index) in form.expenseApplyTrips" :key="index">
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="item-box"
|
|
|
|
|
|
|
|
v-for="(item, index) in form.expenseApplyTrips"
|
|
|
|
|
|
|
|
:key="index"
|
|
|
|
|
|
|
|
>
|
|
|
|
<div class="box-tp">
|
|
|
|
<div class="box-tp">
|
|
|
|
<div class="tp-lf"> 行程 {{index + 1}}</div>
|
|
|
|
<div class="tp-lf">行程 {{ index + 1 }}</div>
|
|
|
|
<div class="tp-rt" v-if="!(form.expenseApplyTrips.length == 1)" @click="handleDel(index)">
|
|
|
|
<div
|
|
|
|
|
|
|
|
class="tp-rt"
|
|
|
|
|
|
|
|
v-if="!(form.expenseApplyTrips.length == 1)"
|
|
|
|
|
|
|
|
@click="handleDel(index)"
|
|
|
|
|
|
|
|
>
|
|
|
|
<van-icon name="delete-o" size="20" />
|
|
|
|
<van-icon name="delete-o" size="20" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="box-tt">
|
|
|
|
<div class="box-tt">
|
|
|
|
<RePick v-model="item.departureLocation" :disabled="disabled" label="出发地" :isCascaderAllLevelName="true" :name="`departureLocation_${index}`" :list="areaTree" isLastSelect isRequrie isCascader isShowSearch title="出发地" titleKey="name" isCell clearable />
|
|
|
|
<RePick
|
|
|
|
<RePick v-model="item.destinationLocation" :disabled="disabled" label="目的地" :isCascaderAllLevelName="true" :name="`destinationLocation_${index}`" :list="areaTree" isLastSelect isRequrie isCascader isShowSearch title="destinationLocation" titleKey="name" isCell clearable />
|
|
|
|
v-model="item.departureLocation"
|
|
|
|
<van-field :value="item.time" label="行程时间" :class="disabled ? 'actived-disabled':''" placeholder="请选择" required :rules="[{ required: true, message: '请选择' }]" @click="handleDateShow(index,item)" :right-icon="item.time ? '' :'arrow' " input-align="right" readonly autosize rows="1" type="textarea">
|
|
|
|
:disabled="disabled"
|
|
|
|
<template v-if="item.time && !disabled" #button>
|
|
|
|
label="出发地"
|
|
|
|
<van-icon name="clear" color="#C8C9CC" size="16" @click.stop="handleClear(index,1)" />
|
|
|
|
:isCascaderAllLevelName="true"
|
|
|
|
|
|
|
|
:name="`departureLocation_${index}`"
|
|
|
|
|
|
|
|
:list="areaTree"
|
|
|
|
|
|
|
|
isLastSelect
|
|
|
|
|
|
|
|
isRequrie
|
|
|
|
|
|
|
|
isCascader
|
|
|
|
|
|
|
|
isShowSearch
|
|
|
|
|
|
|
|
title="出发地"
|
|
|
|
|
|
|
|
titleKey="name"
|
|
|
|
|
|
|
|
isCell
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<RePick
|
|
|
|
|
|
|
|
v-model="item.destinationLocation"
|
|
|
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
|
|
|
label="目的地"
|
|
|
|
|
|
|
|
:isCascaderAllLevelName="true"
|
|
|
|
|
|
|
|
:name="`destinationLocation_${index}`"
|
|
|
|
|
|
|
|
:list="areaTree"
|
|
|
|
|
|
|
|
isLastSelect
|
|
|
|
|
|
|
|
isRequrie
|
|
|
|
|
|
|
|
isCascader
|
|
|
|
|
|
|
|
isShowSearch
|
|
|
|
|
|
|
|
title="destinationLocation"
|
|
|
|
|
|
|
|
titleKey="name"
|
|
|
|
|
|
|
|
isCell
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<van-field
|
|
|
|
|
|
|
|
:value="item.time"
|
|
|
|
|
|
|
|
label="行程时间"
|
|
|
|
|
|
|
|
:class="disabled ? 'actived-disabled' : ''"
|
|
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
|
|
required
|
|
|
|
|
|
|
|
:rules="[{ required: true, message: '请选择' }]"
|
|
|
|
|
|
|
|
@click="handleDateShow(index, item)"
|
|
|
|
|
|
|
|
:right-icon="item.time ? '' : 'arrow'"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
readonly
|
|
|
|
|
|
|
|
autosize
|
|
|
|
|
|
|
|
rows="1"
|
|
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<template v-if="item.time && !disabled" #button>
|
|
|
|
|
|
|
|
<van-icon
|
|
|
|
|
|
|
|
name="clear"
|
|
|
|
|
|
|
|
color="#C8C9CC"
|
|
|
|
|
|
|
|
size="16"
|
|
|
|
|
|
|
|
@click.stop="handleClear(index, 1)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</van-field>
|
|
|
|
</van-field>
|
|
|
|
<van-field placeholder="请输入" :disabled="disabled" :rules="[{ required: true, message: '请输入' }]" v-model="item.tripDay" type="digit" :name="`tripDay_${index}`" label="出差天数" required clear-trigger="always" input-align="right">
|
|
|
|
<van-field
|
|
|
|
<template #button>
|
|
|
|
placeholder="请输入"
|
|
|
|
天
|
|
|
|
:disabled="disabled"
|
|
|
|
</template>
|
|
|
|
:rules="[{ required: true, message: '请输入' }]"
|
|
|
|
|
|
|
|
v-model="item.tripDay"
|
|
|
|
|
|
|
|
type="digit"
|
|
|
|
|
|
|
|
:name="`tripDay_${index}`"
|
|
|
|
|
|
|
|
label="出差天数"
|
|
|
|
|
|
|
|
required
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<template #button> 天 </template>
|
|
|
|
</van-field>
|
|
|
|
</van-field>
|
|
|
|
<RePick v-model="item.tripType" :disabled="disabled" titleKey="label" idKey="value" label="出差类型" :name="`tripType_${index}`" :list="tripTypeList" isRequrie isCell clearable />
|
|
|
|
<RePick
|
|
|
|
|
|
|
|
v-model="item.tripType"
|
|
|
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
|
|
|
titleKey="label"
|
|
|
|
|
|
|
|
idKey="value"
|
|
|
|
|
|
|
|
label="出差类型"
|
|
|
|
|
|
|
|
:name="`tripType_${index}`"
|
|
|
|
|
|
|
|
:list="tripTypeList"
|
|
|
|
|
|
|
|
isRequrie
|
|
|
|
|
|
|
|
isCell
|
|
|
|
|
|
|
|
clearable
|
|
|
|
|
|
|
|
/>
|
|
|
|
<!-- <van-field right-icon="arrow" :class="item.tripPartners.length ? 'actived-disabled':''" placeholder="请选择" @click="handlePoShow(index)" :rules="[{ required: true, message: '请选择' }]" :name="`tripPartnersName_${index}`" v-model="item.tripPartnersName" disabled label="出差同行人" required clear-trigger="always" input-align="right" /> -->
|
|
|
|
<!-- <van-field right-icon="arrow" :class="item.tripPartners.length ? 'actived-disabled':''" placeholder="请选择" @click="handlePoShow(index)" :rules="[{ required: true, message: '请选择' }]" :name="`tripPartnersName_${index}`" v-model="item.tripPartnersName" disabled label="出差同行人" required clear-trigger="always" input-align="right" /> -->
|
|
|
|
<van-field :value="item.tripPartnersName" :class="disabled ? 'actived-disabled':''" label="出差同行人" placeholder="请选择" :rules="[{ required: false, message: '请选择' }]" @click="handlePoShow(index)" :right-icon="item.tripPartners.length ? '' :'arrow' " input-align="right" readonly autosize rows="1" type="textarea">
|
|
|
|
<van-field
|
|
|
|
<template v-if="item.tripPartnersName && !disabled" #button>
|
|
|
|
:value="item.tripPartnersName"
|
|
|
|
<van-icon name="clear" color="#C8C9CC" size="16" @click.stop="handleClear(index,2)" />
|
|
|
|
:class="disabled ? 'actived-disabled' : ''"
|
|
|
|
|
|
|
|
label="出差同行人"
|
|
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
|
|
:rules="[{ required: false, message: '请选择' }]"
|
|
|
|
|
|
|
|
@click="handlePoShow(index)"
|
|
|
|
|
|
|
|
:right-icon="item.tripPartners.length ? '' : 'arrow'"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
readonly
|
|
|
|
|
|
|
|
autosize
|
|
|
|
|
|
|
|
rows="1"
|
|
|
|
|
|
|
|
type="textarea"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<template v-if="item.tripPartnersName && !disabled" #button>
|
|
|
|
|
|
|
|
<van-icon
|
|
|
|
|
|
|
|
name="clear"
|
|
|
|
|
|
|
|
color="#C8C9CC"
|
|
|
|
|
|
|
|
size="16"
|
|
|
|
|
|
|
|
@click.stop="handleClear(index, 2)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</van-field>
|
|
|
|
</van-field>
|
|
|
|
<van-field placeholder="请输入" :disabled="disabled" :rules="[{ required: false, message: '预计费用格式错误',validator: VerifyFunc.validatorMoney}]" v-model="item.amount" :name="`amount`" label="行程预计费用" clear-trigger="always" input-align="right">
|
|
|
|
<van-field
|
|
|
|
<template #button>
|
|
|
|
placeholder="请输入"
|
|
|
|
元
|
|
|
|
:disabled="disabled"
|
|
|
|
</template>
|
|
|
|
:rules="[
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
required: false,
|
|
|
|
|
|
|
|
message: '预计费用格式错误',
|
|
|
|
|
|
|
|
validator: VerifyFunc.validatorMoney,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
]"
|
|
|
|
|
|
|
|
v-model="item.amount"
|
|
|
|
|
|
|
|
:name="`amount`"
|
|
|
|
|
|
|
|
label="行程预计费用"
|
|
|
|
|
|
|
|
clear-trigger="always"
|
|
|
|
|
|
|
|
input-align="right"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<template #button> 元 </template>
|
|
|
|
</van-field>
|
|
|
|
</van-field>
|
|
|
|
<div class="po-box" v-if="['edit','add'].includes(typeStr)">
|
|
|
|
<div class="po-box" v-if="['edit', 'add'].includes(typeStr)">
|
|
|
|
<van-button type="info" plain hairline round @click.stop="handleAddPeo(index)" native-type="button" icon="plus" size="small">添加同行人</van-button>
|
|
|
|
<van-button
|
|
|
|
|
|
|
|
type="info"
|
|
|
|
|
|
|
|
plain
|
|
|
|
|
|
|
|
hairline
|
|
|
|
|
|
|
|
round
|
|
|
|
|
|
|
|
@click.stop="handleAddPeo(index)"
|
|
|
|
|
|
|
|
native-type="button"
|
|
|
|
|
|
|
|
icon="plus"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
>添加同行人</van-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<FollowPeoPle :disabled="disabled" :tripPartners="item.tripPartners" :allTripPartners="allTripPartners" :type="item.type" :isOpen="item.isOpen" @onConfirm="(arr)=>handleConfirmPo(arr,index)" @onCancel="handlePoCancel(index)" @onNewConfirm="(arr)=>handleNewConfirmPo(arr,index)" />
|
|
|
|
<FollowPeoPle
|
|
|
|
|
|
|
|
:disabled="disabled"
|
|
|
|
|
|
|
|
:tripPartners="item.tripPartners"
|
|
|
|
|
|
|
|
:allTripPartners="allTripPartners"
|
|
|
|
|
|
|
|
:type="item.type"
|
|
|
|
|
|
|
|
:isOpen="item.isOpen"
|
|
|
|
|
|
|
|
@onConfirm="(arr) => handleConfirmPo(arr, index)"
|
|
|
|
|
|
|
|
@onCancel="handlePoCancel(index)"
|
|
|
|
|
|
|
|
@onNewConfirm="(arr) => handleNewConfirmPo(arr, index)"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="add-box" v-if="['edit','add'].includes(typeStr)">
|
|
|
|
<div class="add-box" v-if="['edit', 'add'].includes(typeStr)">
|
|
|
|
<van-button type="info" round @click.stop="handleAdd" native-type="button" icon="plus" size="small">添加行程</van-button>
|
|
|
|
<van-button
|
|
|
|
|
|
|
|
type="info"
|
|
|
|
|
|
|
|
round
|
|
|
|
|
|
|
|
@click.stop="handleAdd"
|
|
|
|
|
|
|
|
native-type="button"
|
|
|
|
|
|
|
|
icon="plus"
|
|
|
|
|
|
|
|
size="small"
|
|
|
|
|
|
|
|
>添加行程</van-button
|
|
|
|
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="section mt5" v-if="['show'].includes(typeStr)"> <span class="line"> </span>审批流程</div>
|
|
|
|
<div class="section mt5" v-if="['show'].includes(typeStr)">
|
|
|
|
<ApprovalProcess v-if="['show'].includes(typeStr)" :processInstanceId="form.processInstanceId" @onSetId="handleSetAccessId" />
|
|
|
|
<span class="line"> </span>审批流程
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<ApprovalProcess
|
|
|
|
|
|
|
|
v-if="['show'].includes(typeStr)"
|
|
|
|
|
|
|
|
:processInstanceId="form.processInstanceId"
|
|
|
|
|
|
|
|
@onSetId="handleSetAccessId"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</van-form>
|
|
|
|
</van-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<BottomBtn ref="BottomBtn" :isAuthorised="isAuthorised" @onBtConfirm="handleBtConfirm" :accessId="accessId" />
|
|
|
|
<BottomBtn
|
|
|
|
|
|
|
|
ref="BottomBtn"
|
|
|
|
|
|
|
|
:isAuthorised="isAuthorised"
|
|
|
|
|
|
|
|
@onBtConfirm="handleBtConfirm"
|
|
|
|
|
|
|
|
:accessId="accessId"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
|
|
<!--行程时间范围选择 -->
|
|
|
|
<!--行程时间范围选择 -->
|
|
|
|
<van-calendar ref="vanCalendar" allow-same-day :maxDate="maxDate" v-model="dateShow" :min-date="minDate" :default-date="defaultDate" type="range" color="#0088FE" @confirm="handleDateSelect" />
|
|
|
|
<van-calendar
|
|
|
|
|
|
|
|
ref="vanCalendar"
|
|
|
|
|
|
|
|
allow-same-day
|
|
|
|
|
|
|
|
:maxDate="maxDate"
|
|
|
|
|
|
|
|
v-model="dateShow"
|
|
|
|
|
|
|
|
:min-date="minDate"
|
|
|
|
|
|
|
|
:default-date="defaultDate"
|
|
|
|
|
|
|
|
type="range"
|
|
|
|
|
|
|
|
color="#0088FE"
|
|
|
|
|
|
|
|
@confirm="handleDateSelect"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
import dayjs from 'dayjs'
|
|
|
|
import { createExpenseApply, getExpenseApply, getMyExpenseApply } from '@/api/bs/expenseApply'
|
|
|
|
import {
|
|
|
|
import { listData } from "@/api/system/dict/data";
|
|
|
|
createExpenseApply,
|
|
|
|
|
|
|
|
getExpenseApply,
|
|
|
|
|
|
|
|
getMyExpenseApply,
|
|
|
|
|
|
|
|
} from '@/api/bs/expenseApply'
|
|
|
|
|
|
|
|
import { listData } from '@/api/system/dict/data'
|
|
|
|
import VerifyFunc from '@/utils/verify'
|
|
|
|
import VerifyFunc from '@/utils/verify'
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
//import引入组件才能使用
|
|
|
|
//import引入组件才能使用
|
|
|
@ -98,8 +374,8 @@ export default {
|
|
|
|
computed: {
|
|
|
|
computed: {
|
|
|
|
allTripPartners() {
|
|
|
|
allTripPartners() {
|
|
|
|
let arr = []
|
|
|
|
let arr = []
|
|
|
|
this.form.expenseApplyTrips.forEach(v => {
|
|
|
|
this.form.expenseApplyTrips.forEach((v) => {
|
|
|
|
v.tripPartners.forEach(z => {
|
|
|
|
v.tripPartners.forEach((z) => {
|
|
|
|
arr.push(z)
|
|
|
|
arr.push(z)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -134,7 +410,7 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 生命周期:挂载完成时(可以访问DOM元素)
|
|
|
|
// 生命周期:挂载完成时(可以访问DOM元素)
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
console.log(this.userInfo, 'userInfo')
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
@ -151,6 +427,19 @@ export default {
|
|
|
|
defaultDate: new Date(),
|
|
|
|
defaultDate: new Date(),
|
|
|
|
dateShow: false,
|
|
|
|
dateShow: false,
|
|
|
|
form: {
|
|
|
|
form: {
|
|
|
|
|
|
|
|
companyName: window.localStorage.getItem('cn'), //公司名称
|
|
|
|
|
|
|
|
nickname: JSON.parse(
|
|
|
|
|
|
|
|
window.localStorage.getItem('userInfo') || { dept: {} }
|
|
|
|
|
|
|
|
).nickname, //申请人
|
|
|
|
|
|
|
|
userId: JSON.parse(
|
|
|
|
|
|
|
|
window.localStorage.getItem('userInfo') || { dept: {} }
|
|
|
|
|
|
|
|
).id, //申请人id
|
|
|
|
|
|
|
|
deptName: JSON.parse(
|
|
|
|
|
|
|
|
window.localStorage.getItem('userInfo') || { dept: {} }
|
|
|
|
|
|
|
|
).dept.name, //申请人部门
|
|
|
|
|
|
|
|
deptId: JSON.parse(
|
|
|
|
|
|
|
|
window.localStorage.getItem('userInfo') || { dept: {} }
|
|
|
|
|
|
|
|
).deptId,
|
|
|
|
applyNo: null,
|
|
|
|
applyNo: null,
|
|
|
|
projectName: null,
|
|
|
|
projectName: null,
|
|
|
|
reason: null,
|
|
|
|
reason: null,
|
|
|
@ -167,14 +456,14 @@ export default {
|
|
|
|
tripDay: undefined,
|
|
|
|
tripDay: undefined,
|
|
|
|
tripType: null,
|
|
|
|
tripType: null,
|
|
|
|
tripPartners: [], // 出差同行人
|
|
|
|
tripPartners: [], // 出差同行人
|
|
|
|
tripPartnersName: "",
|
|
|
|
tripPartnersName: '',
|
|
|
|
amount: undefined,
|
|
|
|
amount: undefined,
|
|
|
|
type: 0,
|
|
|
|
type: 0,
|
|
|
|
isOpen: false
|
|
|
|
isOpen: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
]
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 监听data中的数据变化
|
|
|
|
// 监听data中的数据变化
|
|
|
@ -197,46 +486,52 @@ export default {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$nextTick(() => {
|
|
|
|
this.$refs.form.validate().then(() => {
|
|
|
|
this.$refs.form
|
|
|
|
// 添加/修改的提交
|
|
|
|
.validate()
|
|
|
|
let newForm = {
|
|
|
|
.then(() => {
|
|
|
|
...this.form,
|
|
|
|
// 添加/修改的提交
|
|
|
|
billType: this.$route.query.billType,
|
|
|
|
let newForm = {
|
|
|
|
status: key,
|
|
|
|
...this.form,
|
|
|
|
files: this.fileList,
|
|
|
|
billType: this.$route.query.billType,
|
|
|
|
expenseApplyTrips: (this.form.expenseApplyTrips || []).map(
|
|
|
|
status: key,
|
|
|
|
item => {
|
|
|
|
files: this.fileList,
|
|
|
|
return {
|
|
|
|
expenseApplyTrips: (this.form.expenseApplyTrips || []).map(
|
|
|
|
...item
|
|
|
|
(item) => {
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$loading(true, 'form')
|
|
|
|
|
|
|
|
createExpenseApply(newForm).then((res) => {
|
|
|
|
|
|
|
|
console.log(res, 'h5网页如何使用企业微信登录')
|
|
|
|
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
|
|
|
|
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
|
|
|
|
|
|
|
|
if (!this.form.id) {
|
|
|
|
|
|
|
|
// 清楚缓存
|
|
|
|
|
|
|
|
this.$EventBus.$emit('handleResetLive', 'company-myTrips')
|
|
|
|
|
|
|
|
this.$EventBus.$emit('handleResetLive', 'company-myNewTrips')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
history.back()
|
|
|
|
}
|
|
|
|
})
|
|
|
|
this.$loading(true, 'form')
|
|
|
|
})
|
|
|
|
createExpenseApply(newForm).then((res) => {
|
|
|
|
.catch((err) => {
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$sm(`${this.form.id ? '修改成功!' : '新增成功!'}`)
|
|
|
|
if (err && err.length > 0 && err[0].name) {
|
|
|
|
if (!this.form.id) {
|
|
|
|
const fieldElement = this.$refs.form.$el.querySelector(
|
|
|
|
// 清楚缓存
|
|
|
|
`[name="${err[0].name}"]`
|
|
|
|
this.$EventBus.$emit('handleResetLive', 'company-myTrips')
|
|
|
|
)
|
|
|
|
this.$EventBus.$emit('handleResetLive', 'company-myNewTrips')
|
|
|
|
const fieldHeight = fieldElement.offsetHeight
|
|
|
|
}
|
|
|
|
const scrollHeight = fieldHeight + 50 // 假设添加了 50px 的额外高度
|
|
|
|
history.back()
|
|
|
|
this.$refs.form.scrollToField(err[0].name, scrollHeight)
|
|
|
|
});
|
|
|
|
let amount = err.find((v) => v.name === 'amount')
|
|
|
|
}).catch((err) => {
|
|
|
|
if (amount) {
|
|
|
|
this.$loading(false, 'form')
|
|
|
|
this.$fm(`${amount.message}`)
|
|
|
|
if (err && err.length > 0 && err[0].name) {
|
|
|
|
return
|
|
|
|
const fieldElement = this.$refs.form.$el.querySelector(`[name="${err[0].name}"]`);
|
|
|
|
}
|
|
|
|
const fieldHeight = fieldElement.offsetHeight;
|
|
|
|
|
|
|
|
const scrollHeight = fieldHeight + 50; // 假设添加了 50px 的额外高度
|
|
|
|
|
|
|
|
this.$refs.form.scrollToField(err[0].name, scrollHeight);
|
|
|
|
|
|
|
|
let amount = err.find(v => v.name === 'amount')
|
|
|
|
|
|
|
|
if (amount) {
|
|
|
|
|
|
|
|
this.$fm(`${amount.message}`)
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleInitForm() {
|
|
|
|
handleInitForm() {
|
|
|
@ -244,34 +539,41 @@ export default {
|
|
|
|
this.typeStr = type
|
|
|
|
this.typeStr = type
|
|
|
|
if (id) {
|
|
|
|
if (id) {
|
|
|
|
this.$loading(true, 'loadingSb')
|
|
|
|
this.$loading(true, 'loadingSb')
|
|
|
|
let api = listType === 'myNewTrips' ? getMyExpenseApply : getExpenseApply
|
|
|
|
let api =
|
|
|
|
api(id).then((res) => {
|
|
|
|
listType === 'myNewTrips' ? getMyExpenseApply : getExpenseApply
|
|
|
|
this.form = {
|
|
|
|
api(id)
|
|
|
|
...(res.data || {}),
|
|
|
|
.then((res) => {
|
|
|
|
expenseApplyTrips: (res.data.expenseApplyTrips || []).map(item => {
|
|
|
|
this.form = {
|
|
|
|
let nameArr = []
|
|
|
|
...(res.data || {}),
|
|
|
|
this.userList.forEach(element => {
|
|
|
|
expenseApplyTrips: (res.data.expenseApplyTrips || []).map(
|
|
|
|
if (item.tripPartners.includes(element.id)) {
|
|
|
|
(item) => {
|
|
|
|
nameArr.push(element.nickname)
|
|
|
|
let nameArr = []
|
|
|
|
|
|
|
|
this.userList.forEach((element) => {
|
|
|
|
|
|
|
|
if (item.tripPartners.includes(element.id)) {
|
|
|
|
|
|
|
|
nameArr.push(element.nickname)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
...item,
|
|
|
|
|
|
|
|
time: `${dayjs(item.startTime).format('YY/MM/DD')}~${dayjs(
|
|
|
|
|
|
|
|
item.endTime
|
|
|
|
|
|
|
|
).format('YY/MM/DD')}`,
|
|
|
|
|
|
|
|
tripPartnersName: nameArr.join('、'),
|
|
|
|
|
|
|
|
departureLocation: Number(item.departureLocation),
|
|
|
|
|
|
|
|
destinationLocation: Number(item.destinationLocation),
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
),
|
|
|
|
return {
|
|
|
|
}
|
|
|
|
...item,
|
|
|
|
this.fileList = res.data.files || []
|
|
|
|
time: `${dayjs(item.startTime).format('YY/MM/DD')}~${dayjs(item.endTime).format('YY/MM/DD')}`,
|
|
|
|
this.isAuthorised = res.data.isAuthorised
|
|
|
|
tripPartnersName: nameArr.join('、'),
|
|
|
|
this.$nextTick(() => {
|
|
|
|
departureLocation: Number(item.departureLocation),
|
|
|
|
this.$refs.BottomBtn.handleFilterBtnList()
|
|
|
|
destinationLocation: Number(item.destinationLocation)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
this.fileList = res.data.files || []
|
|
|
|
|
|
|
|
this.isAuthorised = res.data.isAuthorised
|
|
|
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
|
|
|
this.$refs.BottomBtn.handleFilterBtnList()
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}).finally(() => {
|
|
|
|
.finally(() => {
|
|
|
|
this.$loading(false, 'loadingSb')
|
|
|
|
this.$loading(false, 'loadingSb')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleUpload(list) {
|
|
|
|
handleUpload(list) {
|
|
|
@ -279,26 +581,37 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleNewConfirmPo(arr, index) {
|
|
|
|
handleNewConfirmPo(arr, index) {
|
|
|
|
let nameArr = []
|
|
|
|
let nameArr = []
|
|
|
|
this.userList.forEach(element => {
|
|
|
|
this.userList.forEach((element) => {
|
|
|
|
if (arr.includes(element.id)) {
|
|
|
|
if (arr.includes(element.id)) {
|
|
|
|
nameArr.push(element.nickname)
|
|
|
|
nameArr.push(element.nickname)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'tripPartners', arr)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'tripPartners', arr)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'tripPartnersName', nameArr.join('、'))
|
|
|
|
this.$set(
|
|
|
|
|
|
|
|
this.form.expenseApplyTrips[index],
|
|
|
|
|
|
|
|
'tripPartnersName',
|
|
|
|
|
|
|
|
nameArr.join('、')
|
|
|
|
|
|
|
|
)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handleConfirmPo(arr, index) {
|
|
|
|
handleConfirmPo(arr, index) {
|
|
|
|
let nameArr = this.form.expenseApplyTrips[index].tripPartnersName && this.form.expenseApplyTrips[index].tripPartnersName.split('、') || []
|
|
|
|
let nameArr =
|
|
|
|
|
|
|
|
(this.form.expenseApplyTrips[index].tripPartnersName &&
|
|
|
|
|
|
|
|
this.form.expenseApplyTrips[index].tripPartnersName.split('、')) ||
|
|
|
|
|
|
|
|
[]
|
|
|
|
let newArr = this.form.expenseApplyTrips[index].tripPartners || []
|
|
|
|
let newArr = this.form.expenseApplyTrips[index].tripPartners || []
|
|
|
|
this.userList.forEach(element => {
|
|
|
|
this.userList.forEach((element) => {
|
|
|
|
if (arr.includes(element.id)) {
|
|
|
|
if (arr.includes(element.id)) {
|
|
|
|
nameArr.push(element.nickname)
|
|
|
|
nameArr.push(element.nickname)
|
|
|
|
newArr.push(element.id)
|
|
|
|
newArr.push(element.id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
})
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'tripPartners', newArr)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'tripPartners', newArr)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'tripPartnersName', nameArr.join('、'))
|
|
|
|
this.$set(
|
|
|
|
|
|
|
|
this.form.expenseApplyTrips[index],
|
|
|
|
|
|
|
|
'tripPartnersName',
|
|
|
|
|
|
|
|
nameArr.join('、')
|
|
|
|
|
|
|
|
)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handlePoShow(index) {
|
|
|
|
handlePoShow(index) {
|
|
|
@ -307,10 +620,8 @@ export default {
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'type', 0)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'type', 0)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', true)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', true)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
|
|
|
|
this.$fm('请先添加同行人!')
|
|
|
|
this.$fm('请先添加同行人!')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
handlePoCancel(index) {
|
|
|
|
handlePoCancel(index) {
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
|
|
|
|
this.$set(this.form.expenseApplyTrips[index], 'isOpen', false)
|
|
|
@ -334,7 +645,7 @@ export default {
|
|
|
|
tripDay: undefined,
|
|
|
|
tripDay: undefined,
|
|
|
|
tripType: null,
|
|
|
|
tripType: null,
|
|
|
|
tripPartners: [], // 出差同行人
|
|
|
|
tripPartners: [], // 出差同行人
|
|
|
|
tripPartnersName: "",
|
|
|
|
tripPartnersName: '',
|
|
|
|
amount: undefined,
|
|
|
|
amount: undefined,
|
|
|
|
isOpen: false,
|
|
|
|
isOpen: false,
|
|
|
|
type: 0,
|
|
|
|
type: 0,
|
|
|
@ -359,7 +670,10 @@ export default {
|
|
|
|
this.dateShow = true
|
|
|
|
this.dateShow = true
|
|
|
|
this.index = index
|
|
|
|
this.index = index
|
|
|
|
if (startTime && endTime) {
|
|
|
|
if (startTime && endTime) {
|
|
|
|
this.defaultDate = [dayjs(startTime).toDate(), dayjs(endTime).toDate()]
|
|
|
|
this.defaultDate = [
|
|
|
|
|
|
|
|
dayjs(startTime).toDate(),
|
|
|
|
|
|
|
|
dayjs(endTime).toDate(),
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -367,24 +681,44 @@ export default {
|
|
|
|
let trips = this.form.expenseApplyTrips
|
|
|
|
let trips = this.form.expenseApplyTrips
|
|
|
|
if (trips.length && list && list.length) {
|
|
|
|
if (trips.length && list && list.length) {
|
|
|
|
// 判断行程时间是否在已经有的时间范围内
|
|
|
|
// 判断行程时间是否在已经有的时间范围内
|
|
|
|
let start1 = dayjs(list[0]);
|
|
|
|
let start1 = dayjs(list[0])
|
|
|
|
let end1 = dayjs(list[1]);
|
|
|
|
let end1 = dayjs(list[1])
|
|
|
|
let range1 = { start: start1, end: end1 };
|
|
|
|
let range1 = { start: start1, end: end1 }
|
|
|
|
for (let i = 0; i < trips.length; i++) {
|
|
|
|
for (let i = 0; i < trips.length; i++) {
|
|
|
|
let start2 = dayjs(trips[i].startTime);
|
|
|
|
let start2 = dayjs(trips[i].startTime)
|
|
|
|
let end2 = dayjs(trips[i].endTime);
|
|
|
|
let end2 = dayjs(trips[i].endTime)
|
|
|
|
let range2 = { start: start2, end: end2 };
|
|
|
|
let range2 = { start: start2, end: end2 }
|
|
|
|
if (this.index !== i && range1.start.isBefore(range2.end) && range2.start.isBefore(range1.end)
|
|
|
|
if (
|
|
|
|
|
|
|
|
this.index !== i &&
|
|
|
|
|
|
|
|
range1.start.isBefore(range2.end) &&
|
|
|
|
|
|
|
|
range2.start.isBefore(range1.end)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'time', null)
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'time', null)
|
|
|
|
return this.$fm(`行程时间范围与行程${i + 1}时间范围冲突!`)
|
|
|
|
return this.$fm(`行程时间范围与行程${i + 1}时间范围冲突!`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'time', `${dayjs(list[0]).format('YY/MM/DD')}~${dayjs(list[1]).format('YY/MM/DD')}`)
|
|
|
|
this.$set(
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'startTime', dayjs(list[0]).valueOf())
|
|
|
|
this.form.expenseApplyTrips[this.index],
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'endTime', dayjs(list[1]).valueOf())
|
|
|
|
'time',
|
|
|
|
let day = list && list.length && Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1
|
|
|
|
`${dayjs(list[0]).format('YY/MM/DD')}~${dayjs(list[1]).format(
|
|
|
|
|
|
|
|
'YY/MM/DD'
|
|
|
|
|
|
|
|
)}`
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
this.$set(
|
|
|
|
|
|
|
|
this.form.expenseApplyTrips[this.index],
|
|
|
|
|
|
|
|
'startTime',
|
|
|
|
|
|
|
|
dayjs(list[0]).valueOf()
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
this.$set(
|
|
|
|
|
|
|
|
this.form.expenseApplyTrips[this.index],
|
|
|
|
|
|
|
|
'endTime',
|
|
|
|
|
|
|
|
dayjs(list[1]).valueOf()
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
let day =
|
|
|
|
|
|
|
|
list &&
|
|
|
|
|
|
|
|
list.length &&
|
|
|
|
|
|
|
|
Number(dayjs(list[1]).diff(dayjs(list[0]), 'day')) + 1
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'tripDay', day)
|
|
|
|
this.$set(this.form.expenseApplyTrips[this.index], 'tripDay', day)
|
|
|
|
this.dateShow = false
|
|
|
|
this.dateShow = false
|
|
|
|
},
|
|
|
|
},
|
|
|
|