master
xy 2 years ago
parent 429f8425f6
commit 34a6c32e89

@ -0,0 +1,211 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增财评评审计划' : '编辑财评评审计划'"
:form="form"
:rules="rules"
@submit="submit"
>
<template v-slot:content>
<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-input
type="textarea"
v-model="form.content"
clearable
placeholder="请输入评审内容"
style="width: 300px"
></el-input>
</div>
</div>
</template>
<template v-slot:plan_date>
<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-date-picker
v-model="form.plan_date"
placeholder="请选择计划评审时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:actually_date v-if="false">
<div class="xy-table-item">
<div class="xy-table-item-label">实际评审时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.actually_date"
placeholder="请选择实际评审时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import { index, show, store, save } from "@/api/propertyPlan";
export default {
props: {},
data() {
return {
project_id: '',
isShow: false,
id: "",
type: "",
form: {
content: "",
plan_date: "",
actually_date: "",
},
attachment_list: [],
content_list: [],
item_list: [],
rules: {
content: [
{
required: true,
message: "请填写评审内容",
},
],
plan_date: [
{
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 index({
project_id: this.project_id,
page: 1,
page_size: 1
})
console.log(res)
if (res.data[0]) {
this.setId(res.data[0].id)
this.attachment_list = res.data[0].attachment;
this.content_list = res.data[0].content;
this.item_list = res.data[0].item
}
},
submit() {
let subForm = {
id: this.id,
project_id: this.project_id,
state: 0,
attachment_list: this.attachment_list,
content_list: this.content_list,
item_list: [...this.item_list,this.form],
}
this.id ? save(subForm).then(res => {
this.$message({
type: 'success',
message: '新增成功'
})
this.hidden()
}) :
store(subForm).then(res => {
this.$message({
type: 'success',
message: '新增成功'
})
this.hidden()
})
},
},
watch: {
isShow(val) {
if (val) {
this.getDetail();
} else {
this.id = "";
this.type = "";
this.item_list = [];
this.content_list = [];
this.attachment_list = [];
this.init();
this.$refs["dialog"].clearValidate();
delete this.form.id;
}
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
.xy-table-item-label {
width: 160px;
}
</style>

@ -190,9 +190,9 @@
政府采购项目
</div>
<div class="xy-table-item-content">
<div class="contract-add-plan" style="width: 300px;" @click="$refs['govPlane'].setSelected(detail.gov_plane_id),$refs['govPlane'].show()">
<div class="contract-add-plan" style="width: 300px;" @click="$refs['govPlane'].show()">
<template v-if="detail.gov_plane_id">
<Tag closable color="primary" @on-close="detail.gov_plane_id = ''">{{ detail.gov_plane_id ? (detail.gov_plane.name || $refs['govPlane'].selected.name) : '' }}</Tag>
<Tag closable color="primary" @on-close="detail.gov_plane_id = ''">{{ $refs['govPlane'].selected.name }}</Tag>
</template>
<template v-else>
<div class="contract-add-plan-no-plan">请选择政府采购项目</div>
@ -592,6 +592,7 @@
gov_plane_id: res.gov_plane_id,
gov_plane: res.gov_plane
}
this.$refs['govPlane'].selected = res.gov_plane
this.plan = this.detail.plan
},
//y
@ -617,7 +618,8 @@
date: this.detail.date,
contract_plan_links: this.detail.plan.map(item => {
return item.value
})
}),
gov_plane_id: this.detail.gov_plane_id
}).then(res => {
this.isShowEditor = false
Message({

@ -158,6 +158,12 @@
<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">
<!-- 如果是 履约文件-->
@ -483,6 +489,8 @@
<contractPaymentRegistration ref="contractPaymentRegistration"></contractPaymentRegistration>
<govPlane ref="govPlane" @selected="row => form.gov_plane_id = row.id"></govPlane>
<addPropertyPlan ref="addPropertyPlan"></addPropertyPlan>
</div>
</template>
@ -522,7 +530,8 @@ 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 govPlane from './components/govPlane.vue'
import govPlane from './components/govPlane.vue';
import addPropertyPlan from "./components/addPropertyPlan.vue";
import {
download
} from '@/utils/downloadRequest'
@ -533,7 +542,8 @@ export default {
paymentRegistration,
contractSign,
contractPaymentRegistration,
govPlane
govPlane,
addPropertyPlan
},
data() {
var planPass = (rule, value, callback) => {

@ -29,6 +29,20 @@
</div>
</div>
</template>
<template v-slot:content>
<div class="xy-table-item ">
<div class="xy-table-item-label">评审内容 </div>
<div class="xy-table-item-content">
<el-input
type="textarea"
v-model="form.content"
clearable
placeholder="请输入评审内容"
style="width: 300px"
></el-input>
</div>
</div>
</template>
<template v-slot:plan_date v-if="role === 0">
<div class="xy-table-item">
<div class="xy-table-item-label">计划评审时间 </div>
@ -57,28 +71,28 @@
</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">-->
<!-- <Table-->
<!-- :height="440"-->
<!-- :data="contracts"-->
<!-- :columns="contractTable"-->
<!-- highlight-row-->
<!-- @on-row-click="rowPick"-->
<!-- ></Table>-->
<div style="padding: 10px 0; display: flex; justify-content: center">
<Page
:total="contractTotal"
show-elevator
@on-change="
(e) => {
contractSelect.page = e;
getContracts();
}
"
/>
</div>
</Modal>
<!-- <div style="padding: 10px 0; display: flex; justify-content: center">-->
<!-- <Page-->
<!-- :total="contractTotal"-->
<!-- show-elevator-->
<!-- @on-change="-->
<!-- (e) => {-->
<!-- contractSelect.page = e;-->
<!-- getContracts();-->
<!-- }-->
<!-- "-->
<!-- />-->
<!-- </div>-->
<!-- </Modal>-->
</div>
</template>
@ -97,21 +111,42 @@ export default {
isShowModal: false,
isShow: false,
id: "",
pid: "",
type: "",
detail: {},
rowName: "",
form: {
project_id: "",
content: "",
plan_date: "",
actually_date: "",
},
rules: {
project_id: [
actually_date: [
{
required: true,
message: "请填写项目",
validator: (rule, value, callback) => {
if (this.role == 1) {
value ? callback() : callback(new Error('请选择实际时间'))
} else {
callback()
}
},
message: "请选择实际时间",
},
],
plan_date: [
{
validator: (rule, value, callback) => {
if (this.role == 0) {
value ? callback() : callback(new Error('请选择计划时间'))
} else {
callback()
}
},
message: "请选择计划时间",
},
]
},
contracts: [],
@ -270,43 +305,33 @@ export default {
},
async getDetail() {
const res = await show({ id: this.id });
this.$integrateData(this.form, res);
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
},
submit() {
if (this.type === "add") {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
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
}
store(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,
});
save(this.form).then((res) => {
this.$message({
type: "success",
message:
this.type === "add" ? "新增财评评审" : "编辑财评评审" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
}
})
save(this.detail).then(res => {
this.$message({
type: 'success',
message: '保存成功'
})
this.hidden();
this.$emit('refresh');
})
},
async getContracts() {
@ -336,7 +361,7 @@ export default {
},
},
created() {
this.getContracts();
// this.getContracts();
},
};
</script>

@ -18,7 +18,7 @@
<script>
import { getToken } from "@/utils/auth";
import { show, save } from "@/api/propertyPlan";
import { show, save, store } from "@/api/propertyPlan";
export default {
props: {},
data() {
@ -252,6 +252,7 @@ export default {
scopedSlots: {
default: () =>
h("textarea", {
key: this.key,
class: "el-textarea__inner",
props: { value: form.content },
on: {

@ -176,6 +176,7 @@ export default {
scopedSlots: {
default: () =>
h("input", {
key: ++this.key,
class: "el-input__inner",
props: { value: form.title },
on: {
@ -191,6 +192,7 @@ export default {
scopedSlots: {
default: () =>
h("textarea", {
key: this.key,
class: "el-textarea__inner",
props: { value: form.content },
on: {

@ -20,7 +20,7 @@
>
<Button type="primary" style="margin-left: 10px" @click="getList"></Button>
<Button
v-if="role === 0"
v-if="false"
type="primary"
style="margin-left: 10px"
@click="
@ -32,24 +32,27 @@
</slot>
</lx-header>
<xy-table :list="list" :table-item="table">
<template v-if="role !== 0" #btns> </template>
<template v-else #btns>
<el-table-column label="操作" header-align="center" align="left">
<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">
<template #default="{ row }">
<Button size="small" type="primary" @click="$refs['file'].setId(row.id),$refs['file'].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 size="small" type="primary" @click="$refs['remark'].setId(row.id),$refs['remark'].show()">
</Button>
<Button ghost size="small" type="primary" @click="$refs['addPropertyPlan'].setType('editor'),$refs['addPropertyPlan'].setId(row.id),$refs['addPropertyPlan'].show()">
</Button>
<Poptip transfer confirm placement="bottom" title="确认要删除吗"
@on-ok="destroy({ id: row.id }).then(_ => { $message({ type: 'success',message: '删除成功' });getList(); })">
<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>
@ -73,7 +76,8 @@
</template>
<script>
import { index, destroy } from "@/api/propertyPlan";
import { mergeTableRow } from "@/utils/mergeTableRow";
import { index, destroy, save } from "@/api/propertyPlan";
import addPropertyPlan from "@/views/finance/components/addPropertyPlan.vue";
import remark from "./components/remark.vue";
@ -86,16 +90,22 @@ export default {
},
data() {
return {
role: 0,//01
role: -1,//01
select: {
page: 1,
page_size: 10,
},
originalList: [],
list: [],
table: [
{
prop: 'index',
width: 60,
sortable: false,
},
{
label: "项目名称",
width: 220,
minWidth: 220,
align: "left",
prop: 'contract.name'
},
@ -114,11 +124,52 @@ export default {
};
},
methods: {
destroy,
destroy (row) {
let temp = this.originalList.find(i => i.id === row.pid)
let index = temp?.item?.indexOf(temp?.item?.find(o => o.id === row.id))
temp.item.splice(index,1)
save({
...temp,
item_list: temp.item
}).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
},
async getList() {
const res = await index(this.select);
this.originalList = res.data;
this.total = res.total;
this.list = res.data;
let list = [];
res.data.forEach((i,index) => {
i.item.forEach(item => {
list.push({
index: index+1,
contract: i.contract,
pid: i.id,
...item
})
})
})
this.list = mergeTableRow({
data: list,
mergeColNames: ['index','contract.name','more'],
firstMergeColNames: ['index',"pid",'pid'], // firstMerge
firstMerge: "index",
})
console.log(this.list)
},
//
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
const span = column["property"] + "-span";
if (row[span]) {
return row[span];
}
},
},
computed: {},
@ -127,7 +178,7 @@ export default {
},
beforeRouteEnter(to, from, next) {
next((vm) => {
vm.role = to.path.split("_")[1] ? Number(to.path.split("_")[1]) : '';
vm.role = to.path.split("_")[1] ? Number(to.path.split("_")[1]) : -1;
});
},
};

@ -19,6 +19,7 @@
</div>
<div class="xy-table-item-content">
<el-input
:readonly="role === 1"
v-model="form.name"
clearable
placeholder="请输入项目名称"
@ -32,6 +33,7 @@
<div class="xy-table-item-label">项目内容 </div>
<div class="xy-table-item-content">
<el-input
:readonly="role === 1"
type="textarea"
:autosize="{ minRows: 2 }"
v-model="form.content"
@ -47,6 +49,7 @@
<div class="xy-table-item-label">采购预算 </div>
<div class="xy-table-item-content xy-table-item-price">
<el-input-number
:disabled="role === 1"
v-model="form.plan_money"
clearable
placeholder="请输入采购预算"

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

Loading…
Cancel
Save