master
xy 2 years ago
parent cd74e047b1
commit 37ea7438ee

@ -9,7 +9,7 @@
:rules="rules"
@submit="submit"
>
<template v-slot:plan_id>
<template v-slot:project_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"
@ -111,21 +111,11 @@
@on-change="(e) => (budgetSelect.year = e)"
></DatePicker>
<Select
v-model="budgetSelect.type"
clearable
placeholder="选择预算类型"
style="width: 130px"
>
<Option v-for="item in moneyWay" :key="item.id" :value="item.id">{{
item.value
}}</Option>
</Select>
<Select
placeholder="科室选择"
clearable
v-model="budgetSelect.department"
v-model="budgetSelect.department_id"
style="width: 160px"
>
<Option
@ -136,7 +126,9 @@
</Option>
</Select>
<Button style="float: right;" type="primary" @click="budgetSelect.page=1,getBudgets()"
<Input v-model="budgetSelect.keyword" placeholder="关键词" clearable style="width: 160px"></Input>
<Button style="float: right;" type="primary" @click="budgetSelect.page=1,getContract()"
>查询</Button
>
</div>
@ -152,12 +144,13 @@
<div style="padding: 10px 0; display: flex; justify-content: center">
<Page
:page-size="20"
:total="budgetTotal"
show-elevator
@on-change="
(e) => {
budgetSelect.page = e;
getBudgets();
getContract();
}
"
/>
@ -167,6 +160,7 @@
</template>
<script>
import { getContract } from "@/api/contract/contract"
import { getBudget } from "@/api/budget/budget";
import { show, save, store } from "@/api/propertyPlan";
import { moneyFormatter, parseTime } from "@/utils";
@ -174,6 +168,7 @@ import { getparameter } from "@/api/system/dictionary";
import {listdeptNoAuth} from "@/api/system/department";
export default {
props: {
departments: Array,
role: {
type: Number,
default: 0,
@ -196,6 +191,8 @@ export default {
customFn: (row) => {
return (
<el-select
filterable={true}
allow-create={true}
placeholder="评审内容"
readonly={this.role == 1}
style="width: 100%;"
@ -222,7 +219,7 @@ export default {
customFn: (row) => {
return (
<el-date-picker
type="money"
type="month"
placeholder="计划评审时间"
readonly={this.role == 1}
style="width: 100%;"
@ -288,7 +285,7 @@ export default {
rowName: "",
tempRow: {},
form: {
plan_id: "",
project_id: "",
state: 0,
item_list: [],
content_list: [],
@ -324,87 +321,121 @@ export default {
],
},
departments: [],
moneyWay: [],
budgets: [],
budgetTotal: 0,
budgetSelect: {
department: '',
type: '',
keyword: '',
department_id: '',
year: '',
page: 1,
page_size: 20,
purchase_type_id: 1
},
budgetTable: [
{
title: "项目名称",
key: "name",
title: "名称",
width: 200,
align: "left",
key: "name",
fixed: "left",
},
{
title: "预算类型",
title: "采购形式",
width: 120,
align: "center",
render: (h, { row, column }) =>
h("span", row?.purchase_type?.value || "无"),
},
{
title: "项目类型",
width: 120,
key: "type",
width: 115,
align: "center",
render: (h, { row }) => {
return h(
"span",
this.moneyWay.find((item) => {
return item.id === row.type;
})?.value || "未知"
);
let map = new Map([
[1, "服务"],
[2, "货物"],
[3, "工程"],
]);
return h("span", map.get(row.type) || "无");
},
},
{
title: "所属年份",
key: "year",
width: 105,
title: "采购方式",
width: 120,
align: "center",
render: (h, { row, column }) =>
h("span", row?.purchase_way?.value || "无"),
},
{
title: "相关科室",
key: "plan_department.name",
width: 110,
render: (h, { row }) => {
return h("span", row.plan_department?.name);
},
title: "资金来源",
width: 120,
align: "center",
render: (h, { row }) =>
h("div", [
row.money_way_detail.map((item) => h("span", item.value)),
]),
},
{
title: "年初预算金额(元)",
key: "money",
title: "已申请金额(元)",
key: "apply_money_total",
width: 140,
align: "right",
width: 180,
render: (h, { row }) => {
return h("span", row.money == 0 ? "--" : moneyFormatter(row.money));
},
render: (h, { row }) =>
h(
"span",
Number(row.apply_money_total || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
{
title: "调整后预算金额(元)",
key: "update_money",
title: "已付金额(元)",
key: "fund_log_total",
width: 140,
align: "right",
width: 200,
render: (h, { row }) => {
return h("span", moneyFormatter(row.update_money));
},
render: (h, { row }) =>
h(
"span",
Number(row.fund_log_total || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
{
title: "创建信息",
key: "created_at",
width: 180,
formatter: (cell, data, value) => {
return parseTime(new Date(value), "{y}-{m}-{d}");
},
title: "合同预算价(元)",
key: "plan_price",
width: 140,
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.plan_price || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
{
title: "描述",
minWidth: 300,
key: "content",
align: "left",
title: "合同签订价(元)",
key: "money",
width: 140,
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.money || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
],
};
},
methods: {
showModal () {
this.isShowModal = true
},
show() {
this.isShow = true;
},
@ -458,7 +489,7 @@ export default {
console.log(res.item.find((i) => i.id === this.id));
this.$integrateData(this.form, res);
console.log(this.form)
this.rowName = res.plan?.name;
this.rowName = res.project?.name;
this.form.item_list = res.item?.map((i) => {
return {
content: i.content || '',
@ -513,8 +544,8 @@ export default {
// });
},
async getBudgets() {
const res = await getBudget(this.budgetSelect);
async getContract() {
const res = await getContract(this.budgetSelect);
this.budgets = res.list.data;
this.budgetTotal = res.list.total;
},
@ -526,15 +557,12 @@ export default {
this.moneyWay = res.detail;
},
getDepartment() {
listdeptNoAuth().then((res) => {
this.departments = res;
});
},
rowPick(row) {
this.form.plan_id = row.id;
if (this.isShow) {
this.form.project_id = row.id;
this.rowName = row.name;
}
this.$emit('rowPick', row)
},
},
watch: {
@ -555,8 +583,7 @@ export default {
},
created() {
this.getMoneyWay();
this.getBudgets();
this.getDepartment();
this.getContract();
},
};
</script>

@ -7,18 +7,50 @@
>
<div slot="content"></div>
<slot>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span style="padding: 0 6px; word-break: keep-all">部门</span>
<span>
<Select
placeholder="科室选择"
clearable
v-model="select.department_id"
style="width: 160px"
>
<Option v-for="item in departments" :value="item.id" :key="item.id"
>{{ item.name }}
</Option>
</Select>
</span>
<span style="padding: 0 6px; word-break: keep-all">项目</span>
<span>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
:value="select.projectName"
readonly
clearable
placeholder="项目选择"
style="width: 200px"
@on-clear="select.project_id = ''"
@on-focus="$refs['addPropertyPlan'].showModal()"
></Input>
</span>
<Button type="primary" style="margin-left: 10px" ghost @click=""
<Button
type="primary"
style="margin-left: 10px"
ghost
@click="
select = {
page: 1,
page_size: 10,
department_id: '',
projectName: '',
project_id: '',
}
"
>重置</Button
>
<Button type="primary" style="margin-left: 10px" @click="getList"></Button>
<Button type="primary" style="margin-left: 10px" @click="getList"
>查询</Button
>
<Button
v-if="role === 0"
type="primary"
@ -32,27 +64,75 @@
</slot>
</lx-header>
<xy-table :show-index="false" :list="list" :table-item="table" :object-span-method="objectSpanMethod">
<xy-table
:show-index="false"
:list="list"
:table-item="table"
:object-span-method="objectSpanMethod"
>
<template #btns>
<el-table-column label="操作" prop="more" header-align="center" align="left" v-if="role === 1 || role === 0" >
<el-table-column
label="操作"
prop="more"
header-align="center"
align="left"
v-if="role === 1 || role === 0"
>
<template #default="{ row }">
<Button size="small" type="primary" @click="$refs['file'].setId(row.pid),$refs['file'].show()">
<Button
size="small"
type="primary"
@click="$refs['file'].setId(row.pid), $refs['file'].show()"
>附件
</Button>
<Button size="small" type="primary" @click="$refs['remark'].setId(row.pid),$refs['remark'].show()">
<Button
size="small"
type="primary"
@click="$refs['remark'].setId(row.pid), $refs['remark'].show()"
>备注
</Button>
<Button ghost size="small" type="primary" @click="$refs['addPropertyPlan'].setType('editor'),$refs['addPropertyPlan'].pid = row.pid,$refs['addPropertyPlan'].setId(row.id),$refs['addPropertyPlan'].show()">编辑
<Button
ghost
size="small"
type="primary"
@click="
$refs['addPropertyPlan'].setType('editor'),
($refs['addPropertyPlan'].pid = row.pid),
$refs['addPropertyPlan'].setId(row.id),
$refs['addPropertyPlan'].show()
"
>编辑
</Button>
<Poptip v-if="role === 0" transfer confirm placement="bottom" title="确认要删除吗"
@on-ok="destroy(row)">
<Button style="margin-left: 4px;" ghost size="small" type="error">删除
<Poptip
v-if="role === 0"
transfer
confirm
placement="bottom"
title="确认要删除吗"
@on-ok="destroy(row)"
>
<Button style="margin-left: 4px" ghost size="small" type="error"
>删除
</Button>
</Poptip>
</template>
</el-table-column>
<el-table-column v-else label="操作" prop="more" header-align="center" align="center" width="100">
<el-table-column
v-else
label="操作"
prop="more"
header-align="center"
align="center"
width="100"
>
<template #default="{ row }">
<Button size="small" type="primary" @click="$refs['file'].setId(row.pid),$refs['file'].show()"></Button>
<Button
size="small"
type="primary"
@click="$refs['file'].setId(row.pid), $refs['file'].show()"
>附件查看</Button
>
</template>
</el-table-column>
</template>
@ -71,7 +151,18 @@
/>
</div>
<addPropertyPlan ref="addPropertyPlan" :role="role" @refresh="getList"></addPropertyPlan>
<addPropertyPlan
ref="addPropertyPlan"
:departments="departments"
:role="role"
@refresh="getList"
@rowPick="
(row) => {
select.project_id = row.id;
select.projectName = row.name;
}
"
></addPropertyPlan>
<remark ref="remark"></remark>
<file :role="role" ref="file"></file>
</div>
@ -84,6 +175,7 @@ import { index, destroy, save } from "@/api/propertyPlan";
import addPropertyPlan from "@/views/finance/components/addPropertyPlan.vue";
import remark from "./components/remark.vue";
import file from "./components/file.vue";
import { listdeptNoAuth } from "@/api/system/department";
export default {
components: {
file,
@ -92,16 +184,21 @@ export default {
},
data() {
return {
role: -1,//01
role: -1, //01
select: {
page: 1,
page_size: 10,
department_id: "",
projectName: "",
project_id: "",
},
departments: [],
originalList: [],
list: [],
table: [
{
prop: 'index',
prop: "index",
width: 60,
sortable: false,
},
@ -109,20 +206,21 @@ export default {
label: "项目名称",
minWidth: 220,
align: "left",
prop: 'plan.name'
prop: "project.name",
},
{
prop: "content",
label: "评审内容",
minWidth: 220,
align: 'left'
width: 220,
},
{
prop: "plan_date",
label: "计划评审时间",
width: 170,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月")
: "未完成";
},
},
{
@ -130,7 +228,9 @@ export default {
label: "实际评审时间",
width: 170,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月DD")
: "未完成";
},
},
],
@ -138,52 +238,58 @@ export default {
};
},
methods: {
destroy (row) {
console.log(row)
getDepartment() {
listdeptNoAuth().then((res) => {
this.departments = res;
});
},
destroy(row) {
console.log(row);
destroy({
id: row.pid
}).then(res => {
id: row.pid,
}).then((res) => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
type: "success",
message: "删除成功",
});
this.getList();
});
},
async getList() {
const res = await index(this.select);
this.originalList = res.data;
this.total = res.total;
let list = [];
res.data.forEach((i,index) => {
res.data.forEach((i, index) => {
if (i.item && i.item.length > 0) {
i.item.forEach(item => {
i.item.forEach((item) => {
list.push({
type: 0,
index: index+1,
plan: i.plan,
index: index + 1,
project: i.project,
pid: i.id,
...item
})
})
...item,
});
});
} else {
list.push({
pid: i.id,
index: index+1,
index: index + 1,
type: 1,
...i
})
...i,
});
}
})
});
this.list = mergeTableRow({
data: list,
mergeColNames: ['index','plan.name','more'],
firstMergeColNames: ['index',"pid",'pid'], // firstMerge
mergeColNames: ["index", "project.name", "more"],
firstMergeColNames: ["index", "pid", "pid"], // firstMerge
firstMerge: "index",
})
});
console.log(this.list)
console.log(this.list);
},
//
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
@ -195,11 +301,15 @@ export default {
},
computed: {},
created() {
this.getDepartment();
this.getList();
},
beforeRouteEnter(to, from, next) {
next((vm) => {
vm.role = (to.path.split("_")[1] && !isNaN(Number(to.path.split("_")[1]))) ? Number(to.path.split("_")[1]) : -1;
vm.role =
to.path.split("_")[1] && !isNaN(Number(to.path.split("_")[1]))
? Number(to.path.split("_")[1])
: -1;
});
},
};

@ -34,7 +34,18 @@
style="width: 180px"
></Input>
</span>
<Button type="primary" style="margin-left: 10px" ghost @click=""
<Button
type="primary"
style="margin-left: 10px"
ghost
@click="
select = {
department_id: '',
page: 1,
page_size: 10,
keyword: '',
}
"
>重置</Button
>
<Button type="primary" style="margin-left: 10px" @click="getList"
@ -56,7 +67,6 @@
:cell-style="cellStyle"
:list="list"
:table-item="table"
@editor="
(e) => {
$refs['addGovPlane'].setType('editor');
@ -82,24 +92,28 @@
/>
</div>
<addGovPlane ref="addGovPlane" :role="type" @refresh="getList"></addGovPlane>
<addGovPlane
ref="addGovPlane"
:role="type"
@refresh="getList"
></addGovPlane>
</div>
</template>
<script>
import addGovPlane from "@/views/statisticalReport/components/addGovPlane.vue";
import { index, destroy } from "@/api/govPlane";
import {listdeptNoAuth} from "@/api/system/department";
import { listdeptNoAuth } from "@/api/system/department";
export default {
components: {
addGovPlane,
},
data() {
return {
type: -1,//01
type: -1, //01
departments: [],
select: {
department_id: '',
department_id: "",
page: 1,
page_size: 10,
keyword: "",
@ -116,7 +130,7 @@ export default {
prop: "name",
label: "项目名称",
width: 180,
align: 'left'
align: "left",
},
{
prop: "content",
@ -138,7 +152,9 @@ export default {
label: "采购意向公开计划时间",
width: 190,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月")
: "未完成";
},
},
{
@ -146,7 +162,9 @@ export default {
label: "采购意向公开实际时间",
width: 190,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月DD")
: "未完成";
},
},
{
@ -154,7 +172,9 @@ export default {
label: "招标文件挂网计划时间",
width: 190,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月")
: "未完成";
},
},
{
@ -162,7 +182,9 @@ export default {
label: "招标文件挂网实际时间",
width: 190,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月DD")
: "未完成";
},
},
{
@ -170,7 +192,9 @@ export default {
label: "项目开标计划时间",
width: 180,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月")
: "未完成";
},
},
{
@ -178,34 +202,36 @@ export default {
label: "项目开标实际时间",
width: 180,
formatter: (cell, data, value) => {
return value ? this.$moment(new Date(value)).format("YYYY年MM月DD") : '未完成';
return value
? this.$moment(new Date(value)).format("YYYY年MM月DD")
: "未完成";
},
},
{
prop: 'plan.name',
label: '关联计划',
prop: "plan.name",
label: "关联计划",
width: 220,
align: 'left'
align: "left",
},
{
prop: 'department.name',
label: '部门',
width: 150
}
prop: "department.name",
label: "部门",
width: 150,
},
],
};
},
methods: {
cellStyle ({ column }) {
cellStyle({ column }) {
if (/计划时间/g.test(column.label)) {
return {
background: 'rgba(200,0,0,.1)'
}
background: "rgba(200,0,0,.1)",
};
}
if (/实际时间/g.test(column.label)) {
return {
background: 'rgba(0,200,0,.1)'
}
background: "rgba(0,200,0,.1)",
};
}
},
@ -222,27 +248,27 @@ export default {
});
},
destroy (row) {
destroy({ id: row.id }).then(res => {
destroy(row) {
destroy({ id: row.id }).then((res) => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
type: "success",
message: "删除成功",
});
this.getList();
});
},
},
computed: {},
created() {
this.getDepartment();
this.getList();
},
beforeRouteEnter (to, from , next) {
let type = to.path.split('_')[1]
next(vm => {
vm.type = !isNaN(Number(type)) ? Number(type) : -1
})
}
beforeRouteEnter(to, from, next) {
let type = to.path.split("_")[1];
next((vm) => {
vm.type = !isNaN(Number(type)) ? Number(type) : -1;
});
},
};
</script>

Loading…
Cancel
Save