|
|
|
|
@ -1,158 +1,158 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<el-steps :active="step" align-center>
|
|
|
|
|
<el-step title="选择预算计划"> </el-step>
|
|
|
|
|
<el-step title="新增出差事项"> </el-step>
|
|
|
|
|
<el-step title="新增成功"> </el-step>
|
|
|
|
|
</el-steps>
|
|
|
|
|
<!-- <el-steps :active="step" align-center>-->
|
|
|
|
|
<!-- <el-step title="选择预算计划"> </el-step>-->
|
|
|
|
|
<!-- <el-step title="新增出差事项"> </el-step>-->
|
|
|
|
|
<!-- <el-step title="新增成功"> </el-step>-->
|
|
|
|
|
<!-- </el-steps>-->
|
|
|
|
|
|
|
|
|
|
<div style="padding: 20px">
|
|
|
|
|
<div v-show="step === 1">
|
|
|
|
|
<div style="display: flex;justify-content: space-between;align-items: center;">
|
|
|
|
|
<DatePicker
|
|
|
|
|
:value="planSelect.year"
|
|
|
|
|
placeholder="选择所属年份"
|
|
|
|
|
placement="bottom-start"
|
|
|
|
|
style="width: 180px;margin-right: 10px;"
|
|
|
|
|
type="year"
|
|
|
|
|
@on-change="(e) => {
|
|
|
|
|
planSelect.year = e
|
|
|
|
|
getBudgets()
|
|
|
|
|
}"
|
|
|
|
|
></DatePicker>
|
|
|
|
|
<el-select
|
|
|
|
|
placeholder="科室选择"
|
|
|
|
|
clearable
|
|
|
|
|
size="small"
|
|
|
|
|
v-model="planSelect.plan_department_id"
|
|
|
|
|
style="width: 180px;margin-right: 10px;"
|
|
|
|
|
@change="getBudgets"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in departments"
|
|
|
|
|
:label="item.name"
|
|
|
|
|
:value="item.id"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
>
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
<el-cascader
|
|
|
|
|
placeholder="资金类型选择"
|
|
|
|
|
:options="planTypes"
|
|
|
|
|
:props="{
|
|
|
|
|
checkStrictly: false,
|
|
|
|
|
label: 'name',
|
|
|
|
|
value: 'id',
|
|
|
|
|
}"
|
|
|
|
|
:value="planSelect.type"
|
|
|
|
|
clearable
|
|
|
|
|
size="small"
|
|
|
|
|
style="width: 220px;margin-right: 10px;"
|
|
|
|
|
@change="(e) => {
|
|
|
|
|
planSelect.type = e[e.length - 1] || '';
|
|
|
|
|
getBudgets();
|
|
|
|
|
}"
|
|
|
|
|
/>
|
|
|
|
|
<Input
|
|
|
|
|
v-model="planSelect.name"
|
|
|
|
|
search
|
|
|
|
|
enter-button="搜 索"
|
|
|
|
|
clearable
|
|
|
|
|
placeholder="搜索预算计划.."
|
|
|
|
|
@on-search="getBudgets"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div v-show="step === 1">-->
|
|
|
|
|
<!-- <div style="display: flex;justify-content: space-between;align-items: center;">-->
|
|
|
|
|
<!-- <DatePicker-->
|
|
|
|
|
<!-- :value="planSelect.year"-->
|
|
|
|
|
<!-- placeholder="选择所属年份"-->
|
|
|
|
|
<!-- placement="bottom-start"-->
|
|
|
|
|
<!-- style="width: 180px;margin-right: 10px;"-->
|
|
|
|
|
<!-- type="year"-->
|
|
|
|
|
<!-- @on-change="(e) => {-->
|
|
|
|
|
<!-- planSelect.year = e-->
|
|
|
|
|
<!-- getBudgets()-->
|
|
|
|
|
<!-- }"-->
|
|
|
|
|
<!-- ></DatePicker>-->
|
|
|
|
|
<!-- <el-select-->
|
|
|
|
|
<!-- placeholder="科室选择"-->
|
|
|
|
|
<!-- clearable-->
|
|
|
|
|
<!-- size="small"-->
|
|
|
|
|
<!-- v-model="planSelect.plan_department_id"-->
|
|
|
|
|
<!-- style="width: 180px;margin-right: 10px;"-->
|
|
|
|
|
<!-- @change="getBudgets"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
|
<!-- v-for="item in departments"-->
|
|
|
|
|
<!-- :label="item.name"-->
|
|
|
|
|
<!-- :value="item.id"-->
|
|
|
|
|
<!-- :key="item.id"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- </el-option>-->
|
|
|
|
|
<!-- </el-select>-->
|
|
|
|
|
<!-- <el-cascader-->
|
|
|
|
|
<!-- placeholder="资金类型选择"-->
|
|
|
|
|
<!-- :options="planTypes"-->
|
|
|
|
|
<!-- :props="{-->
|
|
|
|
|
<!-- checkStrictly: false,-->
|
|
|
|
|
<!-- label: 'name',-->
|
|
|
|
|
<!-- value: 'id',-->
|
|
|
|
|
<!-- }"-->
|
|
|
|
|
<!-- :value="planSelect.type"-->
|
|
|
|
|
<!-- clearable-->
|
|
|
|
|
<!-- size="small"-->
|
|
|
|
|
<!-- style="width: 220px;margin-right: 10px;"-->
|
|
|
|
|
<!-- @change="(e) => {-->
|
|
|
|
|
<!-- planSelect.type = e[e.length - 1] || '';-->
|
|
|
|
|
<!-- getBudgets();-->
|
|
|
|
|
<!-- }"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- <Input-->
|
|
|
|
|
<!-- v-model="planSelect.name"-->
|
|
|
|
|
<!-- search-->
|
|
|
|
|
<!-- enter-button="搜 索"-->
|
|
|
|
|
<!-- clearable-->
|
|
|
|
|
<!-- placeholder="搜索预算计划.."-->
|
|
|
|
|
<!-- @on-search="getBudgets"-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
<xy-table
|
|
|
|
|
:list="plans"
|
|
|
|
|
:show-index="false"
|
|
|
|
|
:table-item="planTable"
|
|
|
|
|
:height="boxheight"
|
|
|
|
|
style="margin-top: 10px"
|
|
|
|
|
ref="editorPlanTable"
|
|
|
|
|
row-key="id"
|
|
|
|
|
border
|
|
|
|
|
default-expand-all
|
|
|
|
|
@select="planPick"
|
|
|
|
|
:tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }"
|
|
|
|
|
>
|
|
|
|
|
<template v-slot:btns>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="使用金额(元)"
|
|
|
|
|
header-align="center"
|
|
|
|
|
width="144"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope" v-if="scope.row.pid === 0">
|
|
|
|
|
<InputNumber
|
|
|
|
|
style="width: 120px"
|
|
|
|
|
:min="0"
|
|
|
|
|
:precision="2"
|
|
|
|
|
:active-change="false"
|
|
|
|
|
v-model="scope.row._inputMoney"
|
|
|
|
|
:formatter="
|
|
|
|
|
(value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
|
|
|
"
|
|
|
|
|
:parser="(value) => value.replace(/\$\s?|(,*)/g, '')"
|
|
|
|
|
></InputNumber>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
<div style="display: flex; justify-content: flex-end">
|
|
|
|
|
<Page
|
|
|
|
|
:total="planTotal"
|
|
|
|
|
show-elevator
|
|
|
|
|
@on-change="
|
|
|
|
|
(e) => {
|
|
|
|
|
planSelect.page = e;
|
|
|
|
|
getBudgets();
|
|
|
|
|
}
|
|
|
|
|
"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
<div style="text-align: center">
|
|
|
|
|
<el-button type="primary" style="margin-top: 12px" @click="() => nextStep()"
|
|
|
|
|
>下一步</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <xy-table-->
|
|
|
|
|
<!-- :list="plans"-->
|
|
|
|
|
<!-- :show-index="false"-->
|
|
|
|
|
<!-- :table-item="planTable"-->
|
|
|
|
|
<!-- :height="boxheight"-->
|
|
|
|
|
<!-- style="margin-top: 10px"-->
|
|
|
|
|
<!-- ref="editorPlanTable"-->
|
|
|
|
|
<!-- row-key="id"-->
|
|
|
|
|
<!-- border-->
|
|
|
|
|
<!-- default-expand-all-->
|
|
|
|
|
<!-- @select="planPick"-->
|
|
|
|
|
<!-- :tree-props="{ children: 'notChildren', hasChildren: 'hasChildren' }"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <template v-slot:btns>-->
|
|
|
|
|
<!-- <el-table-column-->
|
|
|
|
|
<!-- label="使用金额(元)"-->
|
|
|
|
|
<!-- header-align="center"-->
|
|
|
|
|
<!-- width="144"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <template slot-scope="scope" v-if="scope.row.pid === 0">-->
|
|
|
|
|
<!-- <InputNumber-->
|
|
|
|
|
<!-- style="width: 120px"-->
|
|
|
|
|
<!-- :min="0"-->
|
|
|
|
|
<!-- :precision="2"-->
|
|
|
|
|
<!-- :active-change="false"-->
|
|
|
|
|
<!-- v-model="scope.row._inputMoney"-->
|
|
|
|
|
<!-- :formatter="-->
|
|
|
|
|
<!-- (value) => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')-->
|
|
|
|
|
<!-- "-->
|
|
|
|
|
<!-- :parser="(value) => value.replace(/\$\s?|(,*)/g, '')"-->
|
|
|
|
|
<!-- ></InputNumber>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </xy-table>-->
|
|
|
|
|
<!-- <div style="display: flex; justify-content: flex-end">-->
|
|
|
|
|
<!-- <Page-->
|
|
|
|
|
<!-- :total="planTotal"-->
|
|
|
|
|
<!-- show-elevator-->
|
|
|
|
|
<!-- @on-change="-->
|
|
|
|
|
<!-- (e) => {-->
|
|
|
|
|
<!-- planSelect.page = e;-->
|
|
|
|
|
<!-- getBudgets();-->
|
|
|
|
|
<!-- }-->
|
|
|
|
|
<!-- "-->
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- <div style="text-align: center">-->
|
|
|
|
|
<!-- <el-button type="primary" style="margin-top: 12px" @click="() => nextStep()"-->
|
|
|
|
|
<!-- >下一步</el-button-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
<!-- </div>-->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-card v-show="step === 2">
|
|
|
|
|
<el-popover placement="right-start" width="660" trigger="click">
|
|
|
|
|
<xy-table
|
|
|
|
|
:list="planSelections"
|
|
|
|
|
size="mini"
|
|
|
|
|
:table-item="[
|
|
|
|
|
...planTable.slice(1),
|
|
|
|
|
{
|
|
|
|
|
width: 120,
|
|
|
|
|
align: 'right',
|
|
|
|
|
label: '使用金额(元)',
|
|
|
|
|
prop: '_inputMoney',
|
|
|
|
|
formatter: (v1, v2, value) =>
|
|
|
|
|
`${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','),
|
|
|
|
|
},
|
|
|
|
|
]"
|
|
|
|
|
:height="400"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
row-key="id"
|
|
|
|
|
border
|
|
|
|
|
:tree-props="{
|
|
|
|
|
children: 'notChildren',
|
|
|
|
|
hasChildren: 'hasChildren',
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
<template #btns></template>
|
|
|
|
|
</xy-table>
|
|
|
|
|
<el-button
|
|
|
|
|
icon="el-icon-s-order"
|
|
|
|
|
size="small"
|
|
|
|
|
type="primary"
|
|
|
|
|
slot="reference"
|
|
|
|
|
>查看已选预算计划({{ planSelections.length }})</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-popover>
|
|
|
|
|
<!-- <el-popover placement="right-start" width="660" trigger="click">-->
|
|
|
|
|
<!-- <xy-table-->
|
|
|
|
|
<!-- :list="planSelections"-->
|
|
|
|
|
<!-- size="mini"-->
|
|
|
|
|
<!-- :table-item="[-->
|
|
|
|
|
<!-- ...planTable.slice(1),-->
|
|
|
|
|
<!-- {-->
|
|
|
|
|
<!-- width: 120,-->
|
|
|
|
|
<!-- align: 'right',-->
|
|
|
|
|
<!-- label: '使用金额(元)',-->
|
|
|
|
|
<!-- prop: '_inputMoney',-->
|
|
|
|
|
<!-- formatter: (v1, v2, value) =>-->
|
|
|
|
|
<!-- `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ','),-->
|
|
|
|
|
<!-- },-->
|
|
|
|
|
<!-- ]"-->
|
|
|
|
|
<!-- :height="400"-->
|
|
|
|
|
<!-- style="width: 100%"-->
|
|
|
|
|
<!-- row-key="id"-->
|
|
|
|
|
<!-- border-->
|
|
|
|
|
<!-- :tree-props="{-->
|
|
|
|
|
<!-- children: 'notChildren',-->
|
|
|
|
|
<!-- hasChildren: 'hasChildren',-->
|
|
|
|
|
<!-- }"-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- <template #btns></template>-->
|
|
|
|
|
<!-- </xy-table>-->
|
|
|
|
|
<!-- <el-button-->
|
|
|
|
|
<!-- icon="el-icon-s-order"-->
|
|
|
|
|
<!-- size="small"-->
|
|
|
|
|
<!-- type="primary"-->
|
|
|
|
|
<!-- slot="reference"-->
|
|
|
|
|
<!-- >查看已选预算计划({{ planSelections.length }})</el-button-->
|
|
|
|
|
<!-- >-->
|
|
|
|
|
<!-- </el-popover>-->
|
|
|
|
|
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-width="120px" style="margin-top: 20px;">
|
|
|
|
|
<el-form-item label="出差事由" prop="title">
|
|
|
|
|
@ -181,7 +181,7 @@
|
|
|
|
|
<!-- </el-radio-group>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<div style="display: flex;justify-content: center;">
|
|
|
|
|
<el-button type="primary" plain @click="forwardStep">上一步</el-button>
|
|
|
|
|
<!-- <el-button type="primary" plain @click="forwardStep">上一步</el-button>-->
|
|
|
|
|
<el-button type="warning" plain @click="reset">重置</el-button>
|
|
|
|
|
<el-button :loading="loading" type="primary" @click="submit">提交</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
@ -206,7 +206,7 @@ export default {
|
|
|
|
|
departments: [],
|
|
|
|
|
|
|
|
|
|
id: "",
|
|
|
|
|
step: 1,
|
|
|
|
|
step: 2,
|
|
|
|
|
loading: false,
|
|
|
|
|
plans: [],
|
|
|
|
|
boxheight: 300,
|
|
|
|
|
@ -312,7 +312,7 @@ export default {
|
|
|
|
|
{
|
|
|
|
|
validator: (rule, value, callback) => {
|
|
|
|
|
if (this.form.end_date && this.form.start_date) {
|
|
|
|
|
if (this.$moment(this.form.end_date).isAfter(this.form.start_date)) {
|
|
|
|
|
if (this.$moment(this.form.end_date).isAfter(this.form.start_date) || (this.form.end_date === this.form.start_date)) {
|
|
|
|
|
callback()
|
|
|
|
|
} else {
|
|
|
|
|
callback(new Error('结束时间不能小于开始时间'))
|
|
|
|
|
@ -328,7 +328,7 @@ export default {
|
|
|
|
|
{
|
|
|
|
|
validator: (rule, value, callback) => {
|
|
|
|
|
if (this.form.end_date && this.form.start_date) {
|
|
|
|
|
if (this.$moment(this.form.end_date).isAfter(this.form.start_date)) {
|
|
|
|
|
if (this.$moment(this.form.end_date).isAfter(this.form.start_date) || (this.form.end_date === this.form.start_date)) {
|
|
|
|
|
callback()
|
|
|
|
|
} else {
|
|
|
|
|
callback(new Error('结束时间不能小于开始时间'))
|
|
|
|
|
|