master
xy 3 years ago
parent 3a1a5d1d8e
commit e8edb1ceee

@ -0,0 +1,76 @@
<template>
<div>
<Modal v-model="isShow" title="中标公告上传">
<el-upload
style="width: 300px"
ref="upload"
multiple
:on-success="successHandle"
:before-upload="uploadBefore"
accept=".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.mp4,.xls,.xlsx"
:action="action"
:file-list="fileList"
:auto-upload="false"
:on-remove="removeHande"
:limit="1"
>
<el-button slot="trigger" size="small" type="primary"
>选取文件</el-button
>
<el-button
style="margin-left: 10px"
size="small"
type="success"
@click="$refs['upload'].submit()"
>开始上传</el-button
>
<div slot="tip" class="el-upload__tip">
支持文件格式.rar .zip .doc .docx .pdf .jpg .png .gif .mp4 .xls
.xlsx
<br />单个文件不能超过50M
</div>
</el-upload>
</Modal>
</div>
</template>
<script>
export default {
data() {
return {
isShow: false,
action: process.env.VUE_APP_UPLOAD_API,
fileList: [],
}
},
methods: {
show() {
this.isShow = true
},
hide() {
this.isShow = false
},
//
successHandle(response, file, fileList) {
this.fileList = fileList;
},
removeHande(file, fileList) {
this.fileList = fileList;
},
uploadBefore(file) {
console.log(file);
if (file.size / 1000 > 50 * 1024) {
this.$message({
type: "warning",
message: "上传图片大小超过50M",
});
return false;
}
},
},
computed: {}
}
</script>
<style scoped lang="scss">
</style>

@ -194,7 +194,7 @@
<!-- 采购完成 -->
<template
v-if="scope.row.invite_status === 1 && scope.row.purchase_status === 3 && (scope.row.purchase_way ? scope.row.purchase_way.remark === 'true' : false) && !scope.row.is_substitute">
<Button class="slot-btns-item" size="small" type="primary" @click="bidding(scope.row)"></Button>
<Button class="slot-btns-item" size="small" type="primary" @click="$refs['biddingUpload'].show()"></Button>
</template>
<!-- <Button class="slot-btns-item" type="primary" size="small">附件管理</Button>-->
<template v-if="scope.row.req_status === 1 && scope.row.is_plan === 0 && !scope.row.is_substitute">
@ -550,6 +550,8 @@
<!-- 查看付款计划-->
<contractPaymentRegistration ref="contractPaymentRegistration"></contractPaymentRegistration>
<biddingUpload ref="biddingUpload"></biddingUpload>
</div>
</template>
@ -591,6 +593,7 @@ import detail from "./components/detailContract"
import paymentRegistration from "./components/paymentRegistration";
import contractSign from "@/views/contract/components/contractSign";
import contractPaymentRegistration from "@/views/contract/components/contractPaymentRegistration";
import biddingUpload from './components/biddingUpload.vue'
let iframe;
export default {
components: {
@ -598,7 +601,8 @@ export default {
detail,
paymentRegistration,
contractSign,
contractPaymentRegistration
contractPaymentRegistration,
biddingUpload
},
data() {
var planPass = (rule, value, callback) => {
@ -1889,7 +1893,8 @@ export default {
supply:this.form.supply,
money:this.form?.money,
status:this.form?.is_simple ? 2 : 1,
is_framework:this.form?.is_framework
is_framework:this.form?.is_framework,
contract_to_contracts:this.form.contract_to_contracts
}).then(res => {
this.isShowAdd = false
Message({

@ -0,0 +1,581 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? `新增${typeText}` : `编辑${typeText}`"
:form="form"
:rules="rules"
@submit="submit"
>
<template v-slot:name>
<div class="xy-table-item">
<div class="xy-table-item-label">
{{typeText}}事项
</div>
<div class="xy-table-item-content">
<el-input v-model="form.name" style="width: 300px;" :placeholder="'请填写'+typeText+'事项'"></el-input>
</div>
</div>
</template>
<template v-slot:report_type v-if="contractType == 2">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
报销类型
</div>
<div class="xy-table-item-content">
<el-select
v-model="form.report_type"
clearable
placeholder="请选择报销类型"
style="width: 300px"
>
<el-option
v-for="item in report_types"
:key="item.id"
:label="item.value"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:other_type v-if="contractType == 3">
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"
>*</span
>
其他支出类型
</div>
<div class="xy-table-item-content">
<el-select
v-model="form.other_type"
clearable
placeholder="请选择其他支出类型"
style="width: 300px"
>
<el-option
v-for="item in other_types"
:key="item.id"
:label="item.value"
:value="item.id"
></el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:money>
<div class="xy-table-item">
<div class="xy-table-item-label">{{typeText}}金额 </div>
<div class="xy-table-item-content">
<el-input-number
v-model="form.money"
clearable
placeholder="请输入报销金额"
style="width: 300px"
:controls="false"
></el-input-number>
</div>
</div>
</template>
<template v-slot:contract_plan_links>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red;font-weight: 600;padding-right: 4px;">*</span>关联预算计划
</div>
<div class="xy-table-item-content">
<div class="contract-add-plan" style="width: 300px;" @click="showPlan">
<template v-if="form.contract_plan_links.length > 0">
<template v-for="item in form.contract_plan_links">
<Tag closable color="primary" @on-close="delPlan(item)">{{ item.label }}</Tag>
</template>
</template>
<template v-else>
<div class="contract-add-plan-no-plan">请选择关联计划</div>
</template>
</div>
</div>
</div>
</template>
</xy-dialog>
<!-- 新增表 预算计划 -->
<xy-dialog :is-show.sync="isShowPlan" :width="820" title="预算计划" @on-ok="planSelect">
<template>
<div style="display: flex;">
<el-select placeholder="科室选择" clearable size="small" v-model="planSearch.plan_department_id"
style="width: 160px;">
<el-option v-for="item in departments" :label="item.name" :value="item.id" :key="item.id">
</el-option>
</el-select>
<Input v-model="planSearch.name" enter-button=" " placeholder="搜索预算计划.." search
@on-search="planSearch.page=1,getBudgets()"/>
</div>
<xy-table ref="planTable" :height="300" :list="plans" :show-index="false" :table-item="planTable"
style="margin-top: 10px;" @select="selectPlan">
<template v-slot:btns>
<el-table-column header-align="center" label="使用金额" fixed="right" width="140">
<template slot-scope="scope">
<Input :value="scope.row.useMoney" @input="planInput($event,scope.row)"/>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="planTotal" show-elevator @on-change="planSearch.page = e,getBudgets()"/>
</div>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="planSelect"></Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import { getparameter } from '@/api/system/dictionary'
import { addContrant,editorContract } from "@/api/contract/contract";
import { getBudget } from '@/api/budget/budget'
export default {
props: {
report_types: {
type: Array,
default: () => [
{
value: '医药报销支出',
id: 1
},
{
value: '出差报销支出',
id: 2
}
],
},
other_types: {
type: Array,
default: () => [],
},
departments: {
type: Array,
default: () => [],
}
},
data() {
return {
moneyWay: [],
plan: [],
plans: [],
planTotal: 0,
isShowPlan: false,
planSearch: {
name: "",
plan_department_id: "",
top_pid: 1,
page: 1,
page_size: 10
},
planTable: [{
width: 40,
sortable: false,
type: 'selection',
fixed: "left"
},
{
label: "分类",
prop: 'type',
formatter: (cell, data, value) => {
let res = this.moneyWay?.find(item => {
return item.id === value
})
return res?.value || '未知'
},
width: 100,
fixed: "left"
},
{
label: "科室",
prop: 'plan_department.name',
width: 100,
align: 'center'
},
{
label: "年份",
prop: 'year',
width: 80,
align: 'center'
},
{
label: "隶属",
prop: 'pid_info.name',
width: 180,
align: 'left'
},
{
label: "名称",
prop: 'name',
width: 320,
align: 'left'
},
{
label: "计划金额",
prop: 'money',
align: 'right',
width: 120,
customFn: (row) => {
let m1 = row.money;
let m2 = row.update_money;
return m2 == 0 ? m1 : m2;
}
},
{
label: "实付金额",
prop: 'use_money_total',
width: 120,
align: 'right'
},
{
label: '已用金额',
prop: 'has_money_total',
width: 120,
align: 'right'
}
],
isShow: false,
id: "",
type: "",
form: {
name: "",
outcome_type: "",
report_type: "",
other_type: "",
money: undefined,
contract_plan_links: [],
},
rules: {
report_type: [
{
required: true,
message: "请填写报销类型",
},
],
other_type: [
{
required: true,
message: "请填写其他支出类型",
},
],
},
};
},
methods: {
show() {
this.isShow = true;
},
hidden() {
this.isShow = false;
},
init() {
for (let key in this.form) {
if (this.form[key] instanceof Array) {
this.form[key] = [];
} else {
this.form[key] = "";
}
}
this.$refs["dialog"].clearValidate();
},
setId(id) {
if (typeof id == "number") {
this.id = id;
} else {
console.error("error typeof id: " + typeof id);
}
},
getId() {
return this.id;
},
setType(type = "add") {
let types = ["add", "editor"];
if (types.includes(type)) {
this.type = type;
} else {
console.warn("Unknown type: " + type);
}
},
setForm(key = [], value = []) {
if (key instanceof Array) {
key.forEach((key, index) => {
this.form[key] = value[index] ?? "";
});
}
if (typeof key === "string") {
this.form[key] = value;
}
if (!key) {
this.init();
}
},
async getDetail() {
const res = await show({ id: this.id });
this.$integrateData(this.form, res);
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
addContrant(this.form).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增支出" : "编辑支出" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
}
if (this.type === "editor") {
Object.defineProperty(this.form, "id", {
value: this.id,
enumerable: true,
configurable: true,
writable: true,
});
editorContract(this.form).then((res) => {
this.$message({
type: "success",
message: this.type === "add" ? "新增支出" : "编辑支出" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
}
},
//
async getMoneyWay() {
this.moneyWay = (await getparameter({
number: 'money_way'
})).detail
},
async showPlan() {
await this.getBudgets()
this.isShowPlan = true
},
//
async getBudgets() {
let res = await getBudget(this.planSearch)
this.plans = res.list.data
this.planTotal = res.list.total;
this.toggleSelection(this.plan.map(item => {
return item.value.plan_id
}), 1)
},
//
toggleSelection(plans, type) {
if (plans) {
this.plans.filter(plan => {
if (plans.includes(plan.id)) {
plan.useMoney = this.plan[plans.indexOf(plan.id)].value.use_money
return true
}
}).map(row => {
this.$refs.planTable.toggleRowSelection(row)
})
} else {
this.$refs.planTable.clearSelection()
}
},
delPlan(val) {
this.form.contract_plan_links.forEach((item, index) => {
if (item.value.plan_id === val.value.plan_id) {
this.form.contract_plan_links.splice(index, 1)
}
})
this.plan.forEach((item, index) => {
if (item.value.plan_id === val.value.plan_id) {
this.plan.splice(index, 1)
}
})
},
//
planInput(e, row) {
if (!/^[0-9]+.?[0-9]*$/.test(e) && e) {
this.$message({
type: 'warning',
message: '金额格式错误'
})
row.useMoney = 0
return
}
let money = Number(row.update_money) == 0 ? Number(row.money) : Number(row.update_money);
if (e <= (money - Number(row.use_money_total))) {
row.useMoney = e
this.plan.forEach(item => {
if (item.value.plan_id == row.id) {
item.value.use_money = e
}
})
return
}
this.$message({
type: 'warning',
message: '使用金额大于剩余预算'
})
row.useMoney = 0
},
//
selectPlan(sel, row) {
console.log(sel)
if (sel) {
let select = sel.map(item => {
return {
label: item.name,
value: {
plan_id: item.id,
use_money: item.useMoney,
new_money: item.money
}
}
})
//
if (!sel.find(plan => {
return plan.id == row.id
})) {
this.delPlan({
value: {
plan_id: row.id
}
})
}
let _plan = JSON.parse(JSON.stringify(this.plan));
var _select = [];
select.map(item => {
if (!_plan.find(plan => {
return plan.value.plan_id == item.value.plan_id
})) {
_select.push(item)
}
});
this.plan = [..._plan, ..._select]
} else {
this.plan = []
}
},
planSelect() {
if (this.plan.length === 0) {
this.$message({
type: 'warning',
message: '选择计划不能为空'
})
return
}
for (let item of this.plan) {
console.log(item)
if (!item.value.use_money) {
this.$message({
type: 'warning',
message: '金额不能为空'
})
return
}
}
this.form.contract_plan_links = this.plan
this.isShowPlan = false
},
},
computed: {
contractType () {
return this.$route.path.split('_')[1]
},
typeText () {
let type = this.$route.path.split('_')[1]
if (type == 2) {
return '报销'
}
if (type == 3) {
return '其他支出'
}
}
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;
}
},
},
created() {
this.getMoneyWay()
}
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.xy-table-item-label {
width: 158px;
}
.contract-add-plan {
min-height: 30px;
border: 1px solid #dcdee2;
border-radius: 4px;
display: flex;
flex-wrap: wrap;
align-items: center;
align-content: center;
padding: 0 8px;
&-no-plan {
height: 30px;
line-height: 30px;
color: #CDD0D5;
}
}
.slot-btns {
display: flex;
flex-wrap: wrap;
align-content: center;
justify-content: flex-start;
&-item {
margin: 0 6px 4px 0;
}
}
</style>

@ -1,4 +1,4 @@
<!--我的报销-->
<!--我的报销,报销列表,其他支出-->
<template>
<div style="padding: 0 20px">
<lx-header
@ -8,25 +8,66 @@
>
<div slot="content"></div>
<slot>
<div>
<span style="padding: 0 6px">年份</span>
<span>
<div class="select-bar">
<div>
<span style="padding: 0 6px">创建日期</span>
<span>
<DatePicker
:value="select.year"
placeholder="选择所属年份"
placeholder="选择开始日期"
placement="bottom"
style="width: 130px"
type="year"
style="width: 114px"
type="date"
@on-change="(e) => (select.year = e)"
></DatePicker>
<DatePicker
:value="select.year"
placeholder="选择结束日期"
placement="bottom"
style="width: 114px;margin-left: 6px;"
type="date"
@on-change="(e) => (select.year = e)"
></DatePicker>
</span>
</div>
<div>
<span style="padding: 0 6px"> 项目类型 </span>
<span>
<Select
v-model="select.type"
clearable
placeholder="选择项目类型"
style="width: 130px"
>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
item.value }}
</Option>
</Select>
</span>
</div>
<div>
<span style="padding: 0 6px"> 科室 </span>
<span>
<Select
placeholder="科室选择"
clearable
v-model="select.department"
style="width: 130px"
>
<Option v-for="item in departments" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</span>
</div>
<span style="padding: 0 6px"> 预算类型 </span>
<span>
<div>
<span style="padding: 0 6px"> 报销类型 </span>
<span>
<Select
v-model="select.type"
clearable
placeholder="选择预算类型"
placeholder="选择报销类型"
style="width: 130px"
>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
@ -34,27 +75,43 @@
}}</Option>
</Select>
</span>
</div>
<span style="padding: 0 6px"> 科室 </span>
<span>
<el-select
placeholder="科室选择"
<div>
<span style="padding: 0 6px"> 报销金额 </span>
<span>
<InputNumber
style="width: 110px;"
placeholder="最低价"
v-model="select.end_money"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\s?|(,*)/g, '')"></InputNumber>
<InputNumber
style="width: 110px;margin-left: 6px;"
placeholder="最高价"
v-model="select.end_money"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\s?|(,*)/g, '')"></InputNumber>
</span>
</div>
<div>
<span style="padding: 0 6px"> 状态 </span>
<span>
<Select
v-model="select.type"
clearable
size="small"
v-model="select.department"
style="width: 160px"
placeholder="选择状态"
style="width: 110px"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
item.value
}}</Option>
</Select>
</span>
</div>
<Button style="margin-left: 10px" type="primary" @click=""
<Button style="margin-left: 10px" type="primary" @click="$refs['addExpenseAccount'].type= 'add',$refs['addExpenseAccount'].show()"
>新增</Button
>
<Button style="margin-left: 10px" type="primary" @click=""
@ -77,15 +134,23 @@
<div style="display: flex;justify-content: flex-end;padding: 10px 0;">
<Page :total="total" @on-change="" show-elevator show-sizer @on-page-size-change="" />
</div>
<addExpenseAccount :other_types="otherType" :departments="departments" ref="addExpenseAccount"></addExpenseAccount>
</div>
</template>
<script>
import { getparameter } from '@/api/system/dictionary'
import { listdeptNoAuth } from '@/api/system/department'
import addExpenseAccount from '@/views/inOut/component/addExpenseAccount.vue'
export default {
components: {
addExpenseAccount
},
data() {
return {
otherType: [],
total: 0,
select: {
@ -155,10 +220,18 @@ export default {
async getDepartment() {
this.departments = await listdeptNoAuth()
},
async getOtherType () {
const res = await getparameter({
number: 'other_type'
})
this.otherType = res.detail
}
},
computed: {},
created() {
this.getDepartment()
this.getOtherType()
},
beforeRouteEnter (to, from , next) {
console.log(to.path.split('_')[1])
@ -168,4 +241,13 @@ export default {
</script>
<style scoped lang="scss">
.select-bar {
display: flex;
flex-wrap: wrap;
align-items: center;
& > div {
margin: 4px;
}
}
</style>

@ -1,32 +1,73 @@
<!--我的报销-->
<!--收入登记-->
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
text="我的报销"
text="收入登记"
>
<div slot="content"></div>
<slot>
<div>
<span style="padding: 0 6px">年份</span>
<span>
<div class="select-bar">
<div>
<span style="padding: 0 6px">创建日期</span>
<span>
<DatePicker
:value="select.year"
placeholder="选择所属年份"
placeholder="选择开始日期"
placement="bottom"
style="width: 130px"
type="year"
style="width: 114px"
type="date"
@on-change="(e) => (select.year = e)"
></DatePicker>
<DatePicker
:value="select.year"
placeholder="选择结束日期"
placement="bottom"
style="width: 114px;margin-left: 6px;"
type="date"
@on-change="(e) => (select.year = e)"
></DatePicker>
</span>
</div>
<div>
<span style="padding: 0 6px"> 项目类型 </span>
<span>
<Select
v-model="select.type"
clearable
placeholder="选择项目类型"
style="width: 130px"
>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
item.value }}
</Option>
</Select>
</span>
</div>
<div>
<span style="padding: 0 6px"> 科室 </span>
<span>
<Select
placeholder="科室选择"
clearable
v-model="select.department"
style="width: 130px"
>
<Option v-for="item in departments" :key="item.id" :value="item.id">{{ item.name }}</Option>
</Select>
</span>
</div>
<span style="padding: 0 6px"> 项目类型 </span>
<span>
<div>
<span style="padding: 0 6px"> 报销类型 </span>
<span>
<Select
v-model="select.type"
clearable
placeholder="选择项目类型"
placeholder="选择报销类型"
style="width: 130px"
>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
@ -34,25 +75,41 @@
}}</Option>
</Select>
</span>
</div>
<span style="padding: 0 6px"> 科室 </span>
<span>
<el-select
placeholder="科室选择"
<div>
<span style="padding: 0 6px"> 报销金额 </span>
<span>
<InputNumber
style="width: 110px;"
placeholder="最低价"
v-model="select.end_money"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\s?|(,*)/g, '')"></InputNumber>
<InputNumber
style="width: 110px;margin-left: 6px;"
placeholder="最高价"
v-model="select.end_money"
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')"
:parser="value => value.replace(/\s?|(,*)/g, '')"></InputNumber>
</span>
</div>
<div>
<span style="padding: 0 6px"> 状态 </span>
<span>
<Select
v-model="select.type"
clearable
size="small"
v-model="select.department"
style="width: 160px"
placeholder="选择状态"
style="width: 110px"
>
<el-option
v-for="item in departments"
:label="item.name"
:value="item.id"
:key="item.id"
>
</el-option>
</el-select>
<Option v-for="item in types" :key="item.id" :value="item.id">{{
item.value
}}</Option>
</Select>
</span>
</div>
<Button style="margin-left: 10px" type="primary" @click=""
>新增</Button
@ -175,4 +232,13 @@ export default {
</script>
<style scoped lang="scss">
.select-bar {
display: flex;
flex-wrap: wrap;
align-items: center;
& > div {
margin: 4px;
}
}
</style>

Loading…
Cancel
Save