master
xy 3 years ago
parent 09ddec0e27
commit 20a6a8b942

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

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

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

@ -20,7 +20,7 @@
> >
<Button type="primary" style="margin-left: 10px" @click="getList">查询</Button> <Button type="primary" style="margin-left: 10px" @click="getList">查询</Button>
<Button <Button
v-if="false" v-if="role === 0"
type="primary" type="primary"
style="margin-left: 10px" style="margin-left: 10px"
@click=" @click="
@ -34,25 +34,21 @@
<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> <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 }"> <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 ghost size="small" type="primary" @click="$refs['addPropertyPlan'].setType('editor'),$refs['addPropertyPlan'].pid = row.pid,$refs['addPropertyPlan'].setId(row.id),$refs['addPropertyPlan'].show()">编辑
</Button> </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)"> @on-ok="destroy(row)">
<Button style="margin-left: 4px;" ghost size="small" type="error">删除 <Button style="margin-left: 4px;" ghost size="small" type="error">删除
</Button> </Button>
</Poptip> </Poptip>
</template> </template>
</el-table-column> </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> </template>
</xy-table> </xy-table>
@ -107,7 +103,7 @@ export default {
label: "项目名称", label: "项目名称",
minWidth: 220, minWidth: 220,
align: "left", align: "left",
prop: 'contract.name' prop: 'plan.name'
}, },
{ {
prop: "plan_date", prop: "plan_date",
@ -145,19 +141,29 @@ export default {
this.total = res.total; this.total = res.total;
let list = []; let list = [];
res.data.forEach((i,index) => { 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({ list.push({
index: index+1, index: index+1,
contract: i.contract, type: 1,
pid: i.id, ...i
...item
}) })
}) }
}) })
this.list = mergeTableRow({ this.list = mergeTableRow({
data: list, data: list,
mergeColNames: ['index','contract.name','more'], mergeColNames: ['index','plan.name','more'],
firstMergeColNames: ['index',"pid",'pid'], // 受影响的列,只合并以firstMerge为首的同类型数据 firstMergeColNames: ['index',"pid",'pid'], // 受影响的列,只合并以firstMerge为首的同类型数据
firstMerge: "index", firstMerge: "index",
}) })
@ -178,7 +184,7 @@ export default {
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next((vm) => { 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" @delete="destroy"
> >
<template v-if="type !== 0 || type !== 1" #btns> </template> <template v-if="type !== 0 && type !== 1" #btns> </template>
</xy-table> </xy-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px"> <div style="display: flex; justify-content: flex-end; margin-top: 10px">
@ -76,7 +76,7 @@ export default {
}, },
data() { data() {
return { return {
type: 0,//0为业务员1财审 type: -1,//0为业务员1财审
select: { select: {
page: 1, page: 1,
page_size: 10, page_size: 10,
@ -210,7 +210,7 @@ export default {
beforeRouteEnter (to, from , next) { beforeRouteEnter (to, from , next) {
let type = to.path.split('_')[1] let type = to.path.split('_')[1]
next(vm => { next(vm => {
vm.type = Number(type) ? Number(type) : 0 vm.type = !isNaN(Number(type)) ? Number(type) : -1
}) })
} }
}; };

Loading…
Cancel
Save