master
xy 3 years ago
parent 09ddec0e27
commit 20a6a8b942

@ -177,7 +177,7 @@ export default {
prop={item.prop}
scopedSlots={{
default( scope ){
return item.customFn(scope.row)
return item.customFn(scope.row,scope)
}
}}>
</el-table-column>
@ -201,7 +201,7 @@ export default {
sortable={item1.sortable ?? true}
scopedSlots={{
default( scope ){
return item1.customFn(scope.row)
return item1.customFn(scope.row,scope)
}
}}>
</el-table-column>

@ -158,12 +158,6 @@
<el-table-column fixed="right" header-align="center" label="操作" width="200">
<template slot-scope="scope">
<div class="slot-btns">
<template>
<Button class="slot-btns-item" size="small" type="primary"
@click="$refs['addPropertyPlan'].project_id = scope.row.id,$refs['addPropertyPlan'].setType('add'),$refs['addPropertyPlan'].show()">
财评评审
</Button>
</template>
<template v-if="scope.row.status === 2&&scope.row.is_end===0">
<template v-if="scope.row.is_assurance==1">
<!-- 如果是 履约文件-->
@ -490,7 +484,6 @@
<govPlane ref="govPlane" @selected="row => form.gov_plane_id = row.id"></govPlane>
<addPropertyPlan ref="addPropertyPlan"></addPropertyPlan>
</div>
</template>
@ -531,7 +524,6 @@ import paymentRegistration from "./components/paymentRegistration";
import contractSign from "@/views/contract/components/contractSign";
import contractPaymentRegistration from "@/views/contract/components/contractPaymentRegistration";
import govPlane from './components/govPlane.vue';
import addPropertyPlan from "./components/addPropertyPlan.vue";
import {
download
} from '@/utils/downloadRequest'
@ -542,8 +534,7 @@ export default {
paymentRegistration,
contractSign,
contractPaymentRegistration,
govPlane,
addPropertyPlan
govPlane
},
data() {
var planPass = (rule, value, callback) => {

@ -9,7 +9,7 @@
:rules="rules"
@submit="submit"
>
<template v-slot:project_id>
<template v-slot:plan_id>
<div class="xy-table-item">
<div class="xy-table-item-label">
<span style="color: red; font-weight: 600; padding-right: 4px"
@ -20,6 +20,7 @@
<div class="xy-table-item-content">
<el-input
readonly
:disabled="type === 'editor'"
:value="rowName"
clearable
placeholder="请输入项目"
@ -30,7 +31,7 @@
</div>
</template>
<template v-slot:content>
<div class="xy-table-item ">
<div class="xy-table-item">
<div class="xy-table-item-label">评审内容 </div>
<div class="xy-table-item-content">
<el-input
@ -69,42 +70,110 @@
</div>
</div>
</template>
<template #item_list>
<el-button
v-if="role == 0"
icon="el-icon-plus"
type="primary"
size="small"
@click="
form.item_list.push({
content: '',
plan_date: '',
actually_date: '',
})
"
>新增</el-button
>
<xy-table
style="margin-top: 20px"
:height="320"
:table-item="itemTable"
:list="form.item_list"
>
<template #btns> </template>
</xy-table>
</template>
</xy-dialog>
<!-- <Modal title="项目" v-model="isShowModal" footer-hide :width="50">-->
<!-- <Table-->
<!-- :height="440"-->
<!-- :data="contracts"-->
<!-- :columns="contractTable"-->
<!-- highlight-row-->
<!-- @on-row-click="rowPick"-->
<!-- ></Table>-->
<Modal title="项目" v-model="isShowModal" footer-hide :width="50">
<div class="select">
<DatePicker
:value="budgetSelect.year"
placeholder="选择所属年份"
placement="bottom"
style="width: 130px"
type="year"
@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>
<!-- <div style="padding: 10px 0; display: flex; justify-content: center">-->
<!-- <Page-->
<!-- :total="contractTotal"-->
<!-- show-elevator-->
<!-- @on-change="-->
<!-- (e) => {-->
<!-- contractSelect.page = e;-->
<!-- getContracts();-->
<!-- }-->
<!-- "-->
<!-- />-->
<!-- </div>-->
<!-- </Modal>-->
<Select
placeholder="科室选择"
clearable
v-model="budgetSelect.department"
style="width: 160px"
>
<Option
v-for="item in departments"
:value="item.id"
:key="item.id"
>{{item.name}}
</Option>
</Select>
<Button style="float: right;" type="primary" @click="getBudgets"
>查询</Button
>
</div>
<Table
:height="440"
:data="budgets"
:columns="budgetTable"
highlight-row
@on-row-click="rowPick"
></Table>
<div style="padding: 10px 0; display: flex; justify-content: center">
<Page
:total="budgetTotal"
show-elevator
@on-change="
(e) => {
budgetSelect.page = e;
getBudgets();
}
"
/>
</div>
</Modal>
</div>
</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";
import { getparameter } from "@/api/system/dictionary";
import {listdeptNoAuth} from "@/api/system/department";
export default {
props: {
role: {
type: Number,
default: 0
}
default: 0,
},
},
data() {
return {
@ -114,22 +183,114 @@ export default {
pid: "",
type: "",
itemTable: [
{
prop: "plan_date",
label: "计划评审时间",
sortable: false,
width: 160,
customFn: (row) => {
return (
<el-date-picker
placeholder="计划评审时间"
readonly={this.role == 1}
style="width: 100%;"
value-format="yyyy-MM-dd"
v-model={row.plan_date}
size="mini"
clearable={true}
></el-date-picker>
);
},
},
{
prop: "actually_date",
label: "实际评审时间",
sortable: false,
width: 160,
customFn: (row) => {
return (
<el-date-picker
placeholder="实际评审时间"
readonly={this.role == 0}
style="width: 100%;"
value-format="yyyy-MM-dd"
v-model={row.actually_date}
size="mini"
clearable={true}
></el-date-picker>
);
},
},
{
prop: "content",
label: "评审内容",
minWidth: 200,
sortable: false,
customFn: (row) => {
return (
<el-input
placeholder="评审内容"
readonly={this.role == 1}
style="width: 100%;"
v-model={row.content}
size="mini"
clearable={true}
></el-input>
);
},
},
{
label: "操作",
width: 180,
align: "left",
sortable: false,
customFn: (row, scope) => {
return (
<Poptip
confirm={true}
transfer={true}
placement="bottom"
title="确认要删除吗"
on={{
["on-ok"]: (_) => {
this.form.item_list.splice(scope.$index, 1);
},
}}
>
<Button
style="margin-left: 4px;"
ghost
size="small"
type="error"
>
删除
</Button>
</Poptip>
);
},
},
],
detail: {},
rowName: "",
form: {
project_id: "",
content: "",
plan_date: "",
actually_date: "",
plan_id: "",
state: 0,
item_list: [],
content_list: [],
attachment_list: [],
// content: "",
// plan_date: "",
// actually_date: "",
},
rules: {
actually_date: [
{
validator: (rule, value, callback) => {
if (this.role == 1) {
value ? callback() : callback(new Error('请选择实际时间'))
value ? callback() : callback(new Error("请选择实际时间"));
} else {
callback()
callback();
}
},
message: "请选择实际时间",
@ -139,118 +300,92 @@ export default {
{
validator: (rule, value, callback) => {
if (this.role == 0) {
value ? callback() : callback(new Error('请选择计划时间'))
value ? callback() : callback(new Error("请选择计划时间"));
} else {
callback()
callback();
}
},
message: "请选择计划时间",
},
]
],
},
contracts: [],
contractTotal: 0,
contractSelect: {
departments: [],
moneyWay: [],
budgets: [],
budgetTotal: 0,
budgetSelect: {
department: '',
type: '',
year: '',
page: 1,
page_size: 20,
},
contractTable: [
budgetTable: [
{
title: "名称",
title: "项目名称",
key: "name",
width: 200,
align: "left",
key: "name",
fixed: "left",
},
{
title: "采购形式",
width: 120,
align: "center",
render: (h, { row, column }) =>
h("span", row?.purchase_type?.value || "无"),
},
{
title: "项目类型",
width: 120,
title: "预算类型",
key: "type",
align: "center",
width: 115,
render: (h, { row }) => {
let map = new Map([
[1, "服务"],
[2, "货物"],
[3, "工程"],
]);
return h("span", map.get(row.type) || "无");
return h(
"span",
this.moneyWay.find((item) => {
return item.id === row.type;
})?.value || "未知"
);
},
},
{
title: "采购方式",
width: 120,
align: "center",
render: (h, { row, column }) =>
h("span", row?.purchase_way?.value || "无"),
title: "所属年份",
key: "year",
width: 105,
},
{
title: "资金来源",
width: 120,
align: "center",
render: (h, { row }) =>
h("div", [
row.money_way_detail.map((item) => h("span", item.value)),
]),
title: "相关科室",
key: "plan_department.name",
width: 110,
render: (h, { row }) => {
return h("span", row.plan_department?.name);
},
},
{
title: "已申请金额(元)",
key: "apply_money_total",
width: 140,
title: "年初预算金额(元)",
key: "money",
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.apply_money_total || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
width: 180,
render: (h, { row }) => {
return h("span", row.money == 0 ? "--" : moneyFormatter(row.money));
},
},
{
title: "已付金额(元)",
key: "fund_log_total",
width: 140,
title: "调整后预算金额(元)",
key: "update_money",
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.fund_log_total || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
width: 200,
render: (h, { row }) => {
return h("span", moneyFormatter(row.update_money));
},
},
{
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: "创建信息",
key: "created_at",
width: 180,
formatter: (cell, data, value) => {
return parseTime(new Date(value), "{y}-{m}-{d}");
},
},
{
title: "合同签订价(元)",
key: "money",
width: 140,
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.money || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
title: "描述",
minWidth: 300,
key: "content",
align: "left",
},
],
};
@ -306,42 +441,85 @@ export default {
async getDetail() {
const res = await show({ id: this.pid });
console.log(res.item.find(i => i.id === this.id))
this.$integrateData(this.form, res.item.find(i => i.id === this.id));
this.rowName = res.contract?.name;
this.detail = res
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.form.item_list = res.item?.map((i) => {
return {
content: i.content || '',
plan_date: i.plan_date || '',
actually_date: i.actually_date || '',
};
});
},
submit() {
let temp = this.detail.item?.find(i => i.id === this.id)
let index = this.detail.item?.indexOf(temp)
this.detail.item?.splice(index,1,this.form)
this.detail.item_list = this.detail.item.map(i => {
return {
content: i.content,
actually_date: i.actually_date,
plan_date: i.plan_date
}
})
if (this.type === "add") {
store(this.form).then((res) => {
this.$message({
type: "success",
message: "新增成功",
});
this.hidden();
this.$emit("refresh");
});
}
if (this.type === "editor") {
save({
id: this.pid,
...this.form,
}).then((res) => {
this.$message({
type: "success",
message: "编辑成功",
});
this.hidden();
this.$emit("refresh");
});
}
// let temp = this.detail.item?.find((i) => i.id === this.id);
// let index = this.detail.item?.indexOf(temp);
// this.detail.item?.splice(index, 1, this.form);
// this.detail.item_list = this.detail.item.map((i) => {
// return {
// content: i.content,
// actually_date: i.actually_date,
// plan_date: i.plan_date,
// };
// });
//
// save(this.detail).then((res) => {
// this.$message({
// type: "success",
// message: "",
// });
// this.hidden();
// this.$emit("refresh");
// });
},
async getBudgets() {
const res = await getBudget(this.budgetSelect);
this.budgets = res.list.data;
this.budgetTotal = res.list.total;
},
save(this.detail).then(res => {
this.$message({
type: 'success',
message: '保存成功'
})
this.hidden();
this.$emit('refresh');
})
async getMoneyWay() {
const res = await getparameter({
number: "money_way",
});
this.moneyWay = res.detail;
},
async getContracts() {
const res = await getContract(this.contractSelect);
this.contracts = res.list.data;
this.contractTotal = res.list.total;
getDepartment() {
listdeptNoAuth().then((res) => {
this.departments = res;
});
},
rowPick(row) {
this.form.project_id = row.id;
this.form.plan_id = row.id;
this.rowName = row.name;
},
},
@ -354,6 +532,7 @@ export default {
} else {
this.id = "";
this.type = "";
this.rowName = "";
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;
@ -361,7 +540,9 @@ export default {
},
},
created() {
// this.getContracts();
this.getMoneyWay();
this.getBudgets();
this.getDepartment();
},
};
</script>
@ -373,4 +554,13 @@ export default {
.xy-table-item-label {
width: 150px;
}
.select {
margin-bottom: 10px;
& > * {
margin-left: 6px;
}
}
</style>

@ -20,7 +20,7 @@
>
<Button type="primary" style="margin-left: 10px" @click="getList"></Button>
<Button
v-if="false"
v-if="role === 0"
type="primary"
style="margin-left: 10px"
@click="
@ -34,25 +34,21 @@
<xy-table :show-index="false" :list="list" :table-item="table" :object-span-method="objectSpanMethod">
<template #btns>
<el-table-column label="操作" 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>
<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>
<Poptip v-if="role == 0" transfer confirm placement="bottom" title="确认要删除吗"
<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 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>
<Button size="small" type="primary" @click="$refs['remark'].setId(row.pid),$refs['remark'].show()">
</Button>
</template>
</el-table-column>
</template>
</xy-table>
@ -107,7 +103,7 @@ export default {
label: "项目名称",
minWidth: 220,
align: "left",
prop: 'contract.name'
prop: 'plan.name'
},
{
prop: "plan_date",
@ -145,19 +141,29 @@ export default {
this.total = res.total;
let list = [];
res.data.forEach((i,index) => {
i.item.forEach(item => {
if (i.item && i.item.length > 0) {
i.item.forEach(item => {
list.push({
type: 0,
index: index+1,
plan: i.plan,
pid: i.id,
...item
})
})
} else {
list.push({
index: index+1,
contract: i.contract,
pid: i.id,
...item
type: 1,
...i
})
})
}
})
this.list = mergeTableRow({
data: list,
mergeColNames: ['index','contract.name','more'],
mergeColNames: ['index','plan.name','more'],
firstMergeColNames: ['index',"pid",'pid'], // firstMerge
firstMerge: "index",
})
@ -178,7 +184,7 @@ export default {
},
beforeRouteEnter(to, from, next) {
next((vm) => {
vm.role = 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;
});
},
};

@ -47,7 +47,7 @@
"
@delete="destroy"
>
<template v-if="type !== 0 || type !== 1" #btns> </template>
<template v-if="type !== 0 && type !== 1" #btns> </template>
</xy-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
@ -76,7 +76,7 @@ export default {
},
data() {
return {
type: 0,//01
type: -1,//01
select: {
page: 1,
page_size: 10,
@ -210,7 +210,7 @@ export default {
beforeRouteEnter (to, from , next) {
let type = to.path.split('_')[1]
next(vm => {
vm.type = Number(type) ? Number(type) : 0
vm.type = !isNaN(Number(type)) ? Number(type) : -1
})
}
};

Loading…
Cancel
Save