master
xy 3 years ago
parent 7b6faa16a8
commit 6c3026aa49

@ -2,9 +2,9 @@
ENV = 'development'
# base api
VUE_APP_DOMIAN=http://192.168.60.99:9003/
#VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/
#VUE_APP_DOMIAN=http://192.168.60.99:9003/
VUE_APP_DOMIAN=http://hdcontract.ali251.langye.net/
VUE_APP_BASE_API = ''
VUE_APP_UPLOAD=http://hdcontract.ali251.langye.net/api/admin/upload-file
VUE_APP_OUT_URL = http://192.168.60.18:2021

@ -1,245 +1,549 @@
<template>
<div style="padding: 0 20px;">
<lx-header icon="md-apps" text="付款登记" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
<div slot="content"></div>
<slot>
<span style="padding: 0 6px;word-break: keep-all;">创建日期</span>
<span>
<DatePicker :value="selectDate" placeholder="请选择日期" type="date" placement="bottom-start" style="width: 180px"
@on-change="(e)=>selectDate = e"></DatePicker>
</span>
<span style="padding: 0 6px;word-break: keep-all;">关键字</span>
<span>
<Input v-model="keywords" placeholder="请输入关键字" style="width: 180px"></Input>
</span>
<span style="padding: 0 6px;word-break: keep-all;">
状态
</span>
<Select v-model="status" clearable placeholder="请选择" style="width:100px;">
<Option v-for="item in [{label:'待审核',value:0},{label:'已审核',value:1}]" :key="item.value" :value="item.value">
{{ item.label }}
</Option>
</Select>
<Button type="primary" style="margin-left: 10px" ghost
@click="contractId = '',pageIndex = 1,keywords = '',selectDate = ''">重置</Button>
<Button type="primary" style="margin-left: 10px" @click="getFundLogs"></Button>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column label="操作" fixed="right" width="200" header-align="center">
<template slot-scope="scope">
<template v-if="scope.row.status === 0&&type==1">
<Poptip placement="bottom" confirm :transfer="true" title="确认要删除吗" @on-ok="deleteFundLog(scope.row)">
<Button size="small" type="error" style="margin-left: 10px;margin-bottom: 4px" ghost>删除</Button>
</Poptip>
<Button size="small" type="primary" style="margin-left: 10px;margin-bottom: 4px"
@click="$refs['detailPaymentRegistration'].getFundLog(scope.row.id),$refs['detailPaymentRegistration'].isShow = true">编辑</Button>
</template>
<Button size="small" type="primary" style="margin-left: 10px;margin-bottom: 4px"
@click="$refs['printRegistration'].getDetailFundLog(scope.row.id),$refs['printRegistration'].isShow = true">打印</Button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange" show-sizer @on-page-size-change="pageSizeChange" />
</div>
<printRegistration ref="printRegistration"></printRegistration>
<detailPaymentRegistration ref="detailPaymentRegistration" @success="getFundLogs"></detailPaymentRegistration>
</div>
</template>
<script>
import {
getFundLog,
delFundLog
} from "@/api/paymentRegistration/fundLog"
import {
parseTime
} from "@/utils"
import {
Message
} from "element-ui";
import printRegistration from "./components/printRegistration";
import detailPaymentRegistration from "./components/detailPaymentRegistration";
export default {
components: {
printRegistration,
detailPaymentRegistration
},
data() {
return {
selectDate: '',
keywords: '',
list: [],
contractId: '',
total: 0,
pageIndex: 1,
pageSize: 10,
is_auth: 1,
status: "",
table: [{
label: "项目名称",
minWidth: 250,
prop: 'contract.name',
align: 'left',
fixed: 'left'
},
{
label: "付款申请金额(元)",
prop: "apply_money",
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return Number(value).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label: '实际支付金额(元)',
prop: "act_money",
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return Number(value).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label: "款项类型",
prop: "type",
width: 120
},
{
label: "预算计划",
width: 320,
align: "left",
customFn: (row) => {
{
if (row.act_plan_link.length > 0) {
return row.act_plan_link.map(item => {
return ( < div > [{
item.plan.year
}] - {
item.plan.name
} < br / > [使用金额] {
item.use_money
}
< /div>)
})
}
}
}
},
{
prop: 'status',
label: '状态',
width: 120,
formatter: (cell, data, value) => {
if (value === 0) return '待审核'
else return '已审核'
}
},
{
label: "次数",
prop: "pay_count",
width: 95,
formatter: (cell, data, value) => {
return value + 1;
}
},
{
label: "是否为最后一笔",
prop: "is_end",
width: 145,
formatter: (cell, data, value) => {
return value == 1 ? "是" : "否"
}
},
{
label: "经办人",
minWidth: 160,
prop: 'admin.name',
align: 'center'
},
{
label: "业务科室",
minWidth: 160,
prop: 'department.name',
align: 'center'
},
{
label: "备注",
minWidth: 460,
prop: 'remark',
align: 'left'
},
{
label: "创建信息",
prop: "created_at",
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}')
}
}
]
}
},
methods: {
pageSizeChange(e) {
this.pageSize = e;
this.pageIndex = 1;
this.getFundLogs()
},
pageChange(e) {
this.pageIndex = e
this.getFundLogs()
},
async getFundLogs() {
const res = await getFundLog({
page_size: this.pageSize,
page: this.pageIndex,
contract_id: this.contractId,
keyword: this.keywords,
date: this.selectDate,
is_auth: this.is_auth,
status: this.status,
})
this.list = res.data
this.total = res.total
},
deleteFundLog(row) {
delFundLog({
id: row.id
}).then(res => {
Message({
type: 'success',
message: '操作成功'
})
this.getFundLogs()
})
}
},
mounted() {
this.contractId = this.$route.query.contractId
this.getFundLogs()
},
created() {
let type = parseInt(this.$route.path.split("_")[1]);
this.type = this.is_auth = type;
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
text="付款登记"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content"></div>
<slot>
<span style="padding: 0 6px; word-break: keep-all">创建日期</span>
<span>
<DatePicker
:value="selectDate"
placeholder="请选择日期"
type="date"
placement="bottom-start"
style="width: 180px"
@on-change="(e) => (selectDate = e)"
></DatePicker>
</span>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
v-model="keywords"
placeholder="请输入关键字"
style="width: 180px"
></Input>
</span>
<span style="padding: 0 6px; word-break: keep-all"> 状态 </span>
<Select
v-model="status"
clearable
placeholder="请选择"
style="width: 100px"
>
<Option
v-for="item in [
{ label: '待审核', value: 0 },
{ label: '已审核', value: 1 },
]"
:key="item.value"
:value="item.value"
>
{{ item.label }}
</Option>
</Select>
<span style="padding: 0 6px; word-break: keep-all">预算计划</span>
<span>
<Input
v-model="select.plan_name"
clearable
placeholder="请选择预算计划"
@on-focus="showPlanForSearch"
style="width: 200px"
@on-clear="clearSelectForSearch"
/>
</span>
<Button
type="primary"
style="margin-left: 10px"
ghost
@click="
(contractId = ''),
(pageIndex = 1),
(keywords = ''),
(selectDate = '')
"
>重置</Button
>
<Button type="primary" style="margin-left: 10px" @click="getFundLogs"
>查询</Button
>
<Button type="primary" @click="toExport()" style="margin-left: 10px"
>导出</Button
>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column
label="操作"
fixed="right"
width="200"
header-align="center"
>
<template slot-scope="scope">
<template v-if="scope.row.status === 0 && type == 1">
<Poptip
placement="bottom"
confirm
:transfer="true"
title="确认要删除吗"
@on-ok="deleteFundLog(scope.row)"
>
<Button
size="small"
type="error"
style="margin-left: 10px; margin-bottom: 4px"
ghost
>删除</Button
>
</Poptip>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
$refs['detailPaymentRegistration'].getFundLog(scope.row.id),
($refs['detailPaymentRegistration'].isShow = true)
"
>编辑</Button
>
</template>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
$refs['printRegistration'].getDetailFundLog(scope.row.id),
($refs['printRegistration'].isShow = true)
"
>打印</Button
>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page
:total="total"
show-elevator
@on-change="pageChange"
show-sizer
@on-page-size-change="pageSizeChange"
/>
</div>
<printRegistration ref="printRegistration"></printRegistration>
<detailPaymentRegistration
ref="detailPaymentRegistration"
@success="getFundLogs"
></detailPaymentRegistration>
<!-- 搜索使用 预算计划 -->
<xy-dialog
:is-show.sync="isShowPlanForSearch"
title="预算计划"
:width="720"
@on-ok="planSelectForSearch"
>
<template v-slot:normalContent>
<Input
v-model="planSearch.name"
search
enter-button="搜 索"
placeholder="搜索预算计划.."
@on-search="searchBudgets"
/>
<div
style="
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<div>
已选择<span style="margin-right: 10px">{{
select.plan_name
}}</span>
</div>
<el-link type="success" @click="clearSelectForSearch"
>清空选择</el-link
>
</div>
<xy-table
:list="plans"
@rowClick="selectPlanForSearch"
:show-index="false"
:table-item="planTableSearch"
:height="310"
style="margin-top: 10px"
ref="singlePlanTable"
>
<template v-slot:btns> </template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="planTotal" show-elevator @on-change="planPageChange" />
</div>
<el-tag type="warning">点击行进行选择</el-tag>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="confirmPlanForSearch"></Button>
</template>
</xy-dialog>
</div>
</template>
<script>
import { getFundLog, delFundLog } from "@/api/paymentRegistration/fundLog";
import { parseTime } from "@/utils";
import { Message } from "element-ui";
import printRegistration from "./components/printRegistration";
import detailPaymentRegistration from "./components/detailPaymentRegistration";
import { getBudget } from "@/api/budget/budget";
import {getparameter} from "@/api/system/dictionary";
import {getToken} from "@/utils/auth";
export default {
components: {
printRegistration,
detailPaymentRegistration,
},
data() {
return {
select: {
plan_id: "",
plan_name: "",
},
planSearch: {
name: "",
plan_department_id: "",
},
plans: [],
planTotal: 0,
plan: [],
moneyWay: [],
planTableSearch: [
{
label: "分类",
prop: "type",
formatter: (cell, data, value) => {
let res = this.moneyWay.filter((item) => {
return item.id === value;
});
return res[0]?.value || "未知";
},
width: 170,
},
{
label: "年份",
prop: "year",
align: "center",
width: 100,
},
{
label: "名称",
prop: "name",
width: 260,
align: "left",
},
{
label: "计划金额",
prop: "money",
align: "right",
width: 160,
},
],
isShowPlanForSearch: false,
selectDate: "",
keywords: "",
list: [],
contractId: "",
total: 0,
pageIndex: 1,
pageSize: 10,
is_auth: 1,
status: "",
table: [
{
label: "项目名称",
minWidth: 250,
prop: "contract.name",
align: "left",
fixed: "left",
},
{
label: "付款申请金额(元)",
prop: "apply_money",
align: "right",
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
},
},
{
label: "实际支付金额(元)",
prop: "act_money",
align: "right",
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,");
},
},
{
label: "款项类型",
prop: "type",
width: 120,
},
{
label: "预算计划",
width: 320,
align: "left",
customFn: (row) => {
{
if (row.act_plan_link.length > 0) {
return row.act_plan_link.map((item) => {
return (
<div>
{" "}
[{item.plan.year}] - {item.plan.name} <br /> [使用金额]{" "}
{item.use_money}{" "}
</div>
);
});
}
}
},
},
{
prop: "status",
label: "状态",
width: 120,
formatter: (cell, data, value) => {
if (value === 0) return "待审核";
else return "已审核";
},
},
{
label: "次数",
prop: "pay_count",
width: 95,
formatter: (cell, data, value) => {
return value + 1;
},
},
{
label: "是否为最后一笔",
prop: "is_end",
width: 145,
formatter: (cell, data, value) => {
return value == 1 ? "是" : "否";
},
},
{
label: "经办人",
minWidth: 160,
prop: "admin.name",
align: "center",
},
{
label: "业务科室",
minWidth: 160,
prop: "department.name",
align: "center",
},
{
label: "备注",
minWidth: 460,
prop: "remark",
align: "left",
},
{
label: "创建信息",
prop: "created_at",
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), "{y}-{m}-{d}");
},
},
],
};
},
methods: {
toExport() {
this.is_export = 1;
this.getFundLogs(true);
},
//
async getMoneyWay() {
this.moneyWay = (
await getparameter({
number: "money_way",
})
).detail;
},
planPageChange(e) {
this.plansPageIndex = e;
this.getBudgets();
},
confirmPlanForSearch() {
this.isShowPlanForSearch = false;
this.getFundLogs();
},
async showPlanForSearch() {
this.isShowPlanForSearch = true;
await this.getBudgets();
},
//
planSelectForSearch() {
if (this.select.plan_id == "") {
Message({
type: "warning",
message: "选择计划不能为空",
});
return;
}
this.isShowPlanForSearch = false;
},
//
searchBudgets() {
this.plansPageIndex = 1;
this.getBudgets();
},
//
selectPlanForSearch(sel) {
console.log(sel);
if (sel) {
this.select.plan_id = sel.id;
this.select.plan_name = "[" + sel.year + "]-" + sel.name;
} else {
this.select.plan_id = "";
this.select.plan_name = "";
}
},
//
async getBudgets() {
await getBudget({
name: this.planSearch.name,
page_size: 10,
page: this.plansPageIndex,
plan_department_id: this.planSearch.plan_department_id,
top_pid: 1,
}).then((res) => {
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();
}
},
clearSelectForSearch() {
this.select.plan_id = "";
this.select.plan_name = "请选择预算计划";
},
pageSizeChange(e) {
this.pageSize = e;
this.pageIndex = 1;
this.getFundLogs();
},
pageChange(e) {
this.pageIndex = e;
this.getFundLogs();
},
async getFundLogs(is_export) {
await getFundLog({
page_size: this.pageSize,
page: this.pageIndex,
keyword: this.keyword,
date: this.selectDate,
status: this.status,
act_plan_link_id: this.select.plan_id,
}).then((res) => {
let tokens = getToken();
if (is_export) {
var url = "/api/admin/fund_log/index?token=" + tokens;
if (this.selectDate) url += "&date=" + this.selectDate;
if (this.keyword) url += "&keyword=" + this.keyword;
if (typeof this.status != "undefined")
url += "&status=" + this.status;
if (this.select.plan_id)
url += "&act_plan_link_id=" + this.select.plan_id;
url += "&is_export=" + 1;
url = location.host + url;
console.log(url);
window.open("http://" + url, "_blank");
return;
}
this.list = res.data;
this.total = res.total;
});
},
deleteFundLog(row) {
delFundLog({
id: row.id,
}).then((res) => {
Message({
type: "success",
message: "操作成功",
});
this.getFundLogs();
});
},
},
mounted() {
this.contractId = this.$route.query.contractId;
this.getFundLogs();
},
created() {
let type = parseInt(this.$route.path.split("_")[1]);
this.type = this.is_auth = type;
this.getMoneyWay();
},
};
</script>
<style scoped lang="scss"></style>

@ -20,7 +20,7 @@
<div class="xy-table-item-content">
<el-input
readonly
v-model="form.project_id"
:value="rowName"
clearable
placeholder="请输入项目"
style="width: 300px"
@ -29,7 +29,7 @@
</div>
</div>
</template>
<template v-slot:plan_date>
<template v-slot:plan_date v-if="role === 0">
<div class="xy-table-item">
<div class="xy-table-item-label">计划评审时间 </div>
<div class="xy-table-item-content">
@ -42,7 +42,7 @@
</div>
</div>
</template>
<template v-slot:actually_date>
<template v-slot:actually_date v-if="role === 1">
<div class="xy-table-item">
<div class="xy-table-item-label">实际评审时间 </div>
<div class="xy-table-item-content">
@ -57,18 +57,41 @@
</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>
<div>213</div>
<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>
<script>
import { getContract } from "@/api/contract/contract"
import { show, save } from "@/api/propertyPlan";
import { getContract } from "@/api/contract/contract";
import { show, save, store } from "@/api/propertyPlan";
export default {
props: {},
props: {
role: {
type: Number,
default: 0
}
},
data() {
return {
isShowModal: false,
@ -76,6 +99,7 @@ export default {
id: "",
type: "",
rowName: "",
form: {
project_id: "",
plan_date: "",
@ -91,6 +115,109 @@ export default {
},
contracts: [],
contractTotal: 0,
contractSelect: {
page: 1,
page_size: 20,
},
contractTable: [
{
title: "名称",
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,
key: "type",
align: "center",
render: (h, { row }) => {
let map = new Map([
[1, "服务"],
[2, "货物"],
[3, "工程"],
]);
return h("span", map.get(row.type) || "无");
},
},
{
title: "采购方式",
width: 120,
align: "center",
render: (h, { row, column }) =>
h("span", row?.purchase_way?.value || "无"),
},
{
title: "资金来源",
width: 120,
align: "center",
render: (h, { row }) =>
h("div", [
row.money_way_detail.map((item) => h("span", item.value)),
]),
},
{
title: "已申请金额(元)",
key: "apply_money_total",
width: 140,
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.apply_money_total || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
{
title: "已付金额(元)",
key: "fund_log_total",
width: 140,
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.fund_log_total || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
{
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: "money",
width: 140,
align: "right",
render: (h, { row }) =>
h(
"span",
Number(row.money || 0)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")
),
},
],
};
},
methods: {
@ -145,6 +272,7 @@ export default {
async getDetail() {
const res = await show({ id: this.id });
this.$integrateData(this.form, res);
this.rowName = res.contract?.name;
},
submit() {
@ -152,6 +280,15 @@ export default {
if (this.form.hasOwnProperty("id")) {
delete this.form.id;
}
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", {
@ -160,16 +297,27 @@ export default {
configurable: true,
writable: true,
});
}
save(this.form).then((res) => {
this.$message({
type: "success",
message:
this.type === "add" ? "新增财评评审" : "编辑财评评审" + "成功",
save(this.form).then((res) => {
this.$message({
type: "success",
message:
this.type === "add" ? "新增财评评审" : "编辑财评评审" + "成功",
});
this.isShow = false;
this.$emit("refresh");
});
this.isShow = false;
this.$emit("refresh");
});
}
},
async getContracts() {
const res = await getContract(this.contractSelect);
this.contracts = res.list.data;
this.contractTotal = res.list.total;
},
rowPick(row) {
this.form.project_id = row.id;
this.rowName = row.name;
},
},
watch: {
@ -187,6 +335,9 @@ export default {
}
},
},
created() {
this.getContracts();
},
};
</script>

@ -0,0 +1,312 @@
<template>
<div>
<Modal v-model="isShow" title="附件" footer-hide :width="64">
<Button type="primary" shape="circle" icon="ios-add" @click="add"
>新增</Button
>
<Table
style="margin-top: 10px"
:height="320"
:data="detail.attachment"
:columns="columns"
>
</Table>
</Modal>
</div>
</template>
<script>
import { getToken } from "@/utils/auth";
import { show, save } from "@/api/propertyPlan";
export default {
props: {},
data() {
return {
fileList: [],
action: process.env.VUE_APP_UPLOAD,
key: 1,
isShowModal: false,
isShow: false,
id: "",
type: "",
detail: {},
columns: [
{
key: "file",
title: "文件",
width: 200,
render:(h,{ row }) => {
return h('a',{ attrs: { download: row.file.original_name, href: row.file.url } },row.file.original_name)
}
},
{
key: "content",
title: "内容",
minWidth: 220,
align: "left",
},
{
key: "date",
title: "日期",
width: 160,
},
{
key: "operate",
title: "操作",
width: 100,
align: "left",
render: (h, { row }) => {
return h("Poptip", {
props: {
transfer: true,
confirm: true,
title: "确认要删除吗",
},
scopedSlots: {
default: () => {
return h(
"Button",
{
props: {
ghost: true,
size: "small",
type: "error",
},
},
"删除"
);
},
},
on: {
["on-ok"]: (_) => {
let attachments = this.detail.attachment.filter(
(i) => i.id !== row.id
).map(i => {
return {
file: i.file.id,
date: i.date,
content: i.content
}
})
save({
...this.detail,
attachment_list: attachments,
content_list: this.detail.content.map((i) => {
return {
title: i.title,
content: i.content,
date: i.date,
};
}),
}).then((_) => {
this.$message({
type: "success",
message: "删除成功",
});
this.getDetail();
});
},
},
});
},
},
],
};
},
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.getId() });
this.detail = res;
console.log(res);
},
async add() {
let form = {
date: this.$moment(new Date()).format("YYYY-MM-DD"),
file: "",
content: "",
};
const h = this.$createElement;
this.$msgbox({
title: "新增附件",
message: h(
"el-form",
{ key: ++this.key, props: { model: form, "label-width": "80px" } },
[
h("el-form-item", {
props: { label: "文件" },
scopedSlots: {
default: () =>
h(
"el-upload",
{
props: {
action: this.action,
"file-list": this.fileList,
limit: 1,
headers: {
Authorization: "Bearer " + getToken()
},
accept: ".rar,.zip,.doc,.docx,.pdf,.jpg,.png,.gif,.mp4,.xls,.xlsx",
"on-success":(response, file, fileList) => {
this.fileList = fileList
form.file = response?.id
},
"before-upload":(file) => {
if (file.size / 1000 > 5 * 1024) {
this.$message({
type: "warning",
message: "上传文件大小超过5M",
});
return false;
}
},
"on-remove":(file, fileList) => {
this.fileList = fileList
}
},
},
[
h(
"el-button",
{
props: {
type: "primary",
size: "small",
},
slot: "trigger",
},
"选取文件"
),
h(
"div",
{
class: "el-upload__tip",
slot: "tip",
},
"只能上传jpg/png文件且不超过5Mb"
),
]
),
},
}),
h("el-form-item", {
props: { label: "内容" },
scopedSlots: {
default: () =>
h("textarea", {
class: "el-textarea__inner",
props: { value: form.content },
on: {
["input"]: (e) => {
form.content = e.target.value;
},
},
}),
},
}),
]
),
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
beforeClose: (action, instance, done) => {
if (action === "confirm") {
instance.confirmButtonLoading = true;
instance.confirmButtonText = "保存中...";
this.detail.attachment_list = [
...this.detail.attachment?.map((i) => {
return { file: i.file.id, content: i.content, date: i.date };
}),
form,
];
save(this.detail)
.then((_) => {
this.$message({
type: "success",
message: "保存成功",
});
instance.confirmButtonLoading = false;
done();
this.getDetail();
this.fileList = [];
})
.catch((_) => {
instance.confirmButtonLoading = false;
});
} else {
done();
}
},
});
},
},
watch: {
isShow(val) {
if (val) {
this.getDetail();
} else {
this.id = "";
this.fileList = [];
}
},
},
created() {},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -0,0 +1,250 @@
<template>
<div>
<Modal v-model="isShow" title="备注" footer-hide :width="64">
<Button type="primary" shape="circle" icon="ios-add" @click="add"
>新增</Button
>
<Table
style="margin-top: 10px"
:height="320"
:data="detail.content"
:columns="columns"
>
</Table>
</Modal>
</div>
</template>
<script>
import { show, save } from "@/api/propertyPlan";
export default {
props: {},
data() {
return {
key: 1,
isShowModal: false,
isShow: false,
id: "",
type: "",
detail: {},
columns: [
{
key: "title",
title: "标题",
width: 200,
},
{
key: "content",
title: "内容",
minWidth: 220,
align: "left",
},
{
key: "date",
title: "日期",
width: 160,
},
{
key: 'operate',
title: '操作',
width: 100,
align: 'left',
render: (h,{ row }) => {
return h('Poptip',{
props: {
transfer: true,
confirm: true,
title: "确认要删除吗"
},
scopedSlots: {
default: () => {
return h('Button',{
props: {
ghost: true,
size: 'small',
type: 'error'
}
},'删除')
}
},
on: {
['on-ok']:_ =>{
let contents = this.detail.content.filter(i => i.id !== row.id)
save({
...this.detail,
content_list: contents,
attachment_list: this.detail.attachment.map(i => {
return {
date: i.date,
content: i.content,
file: i.file.id
}
})
}).then(_ => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getDetail()
})
}
}
})
}
}
],
};
},
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.getId() });
this.detail = res;
console.log(res);
},
async add() {
let form = {
date: this.$moment(new Date()).format("YYYY-MM-DD"),
title: "",
content: "",
};
const h = this.$createElement;
this.$msgbox({
title: "新增备注",
message: h(
"el-form",
{ key: ++this.key, props: { model: form, "label-width": "80px" } },
[
h("el-form-item", {
props: { label: "标题" },
scopedSlots: {
default: () =>
h("input", {
class: "el-input__inner",
props: { value: form.title },
on: {
["input"]: (e) => {
form.title = e.target.value;
},
},
}),
},
}),
h("el-form-item", {
props: { label: "内容" },
scopedSlots: {
default: () =>
h("textarea", {
class: "el-textarea__inner",
props: { value: form.content },
on: {
["input"]: (e) => {
form.content = e.target.value;
},
},
}),
},
}),
]
),
showCancelButton: true,
confirmButtonText: "确定",
cancelButtonText: "取消",
beforeClose: (action, instance, done) => {
if (action === "confirm") {
instance.confirmButtonLoading = true;
instance.confirmButtonText = "保存中...";
this.detail.content_list = [
...this.detail.content.map((i) => {
return { title: i.title, content: i.content, date: i.date };
}),
form,
];
save(this.detail)
.then((_) => {
this.$message({
type: "success",
message: "保存成功",
});
instance.confirmButtonLoading = false;
done();
this.getDetail()
})
.catch((_) => {
instance.confirmButtonLoading = false;
});
} else {
done();
}
},
});
},
},
watch: {
isShow(val) {
if (val) {
this.getDetail();
} else {
this.id = "";
}
},
},
created() {},
};
</script>
<style scoped lang="scss">
::v-deep .el-input__inner {
text-align: left;
}
</style>

@ -18,9 +18,9 @@
<Button type="primary" style="margin-left: 10px" ghost @click=""
>重置</Button
>
<Button type="primary" style="margin-left: 10px" @click=""></Button>
<Button type="primary" style="margin-left: 10px" @click="getList"></Button>
<Button
v-if="type === 0"
v-if="role === 0"
type="primary"
style="margin-left: 10px"
@click="
@ -32,8 +32,25 @@
</slot>
</lx-header>
<xy-table :list="list" :table-item="table" @editor="(e) => {}">
<template v-if="type !== 0" #btns> </template>
<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">
<template #default="{ row }">
<Button size="small" type="primary" @click="$refs['file'].setId(row.id),$refs['file'].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(); })">
<Button style="margin-left: 4px;" ghost size="small" type="error">删除
</Button>
</Poptip>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
@ -49,7 +66,9 @@
/>
</div>
<addPropertyPlan ref="addPropertyPlan"></addPropertyPlan>
<addPropertyPlan ref="addPropertyPlan" :role="role" @refresh="getList"></addPropertyPlan>
<remark ref="remark"></remark>
<file ref="file"></file>
</div>
</template>
@ -57,13 +76,17 @@
import { index, destroy } from "@/api/propertyPlan";
import addPropertyPlan from "@/views/finance/components/addPropertyPlan.vue";
import remark from "./components/remark.vue";
import file from "./components/file.vue";
export default {
components: {
file,
remark,
addPropertyPlan,
},
data() {
return {
type: 0,
role: 0,//01
select: {
page: 1,
page_size: 10,
@ -74,14 +97,15 @@ export default {
label: "项目名称",
width: 220,
align: "left",
prop: 'contract.name'
},
{
prop: "",
prop: "plan_date",
label: "计划评审时间",
width: 200,
},
{
prop: "",
prop: "actually_date",
label: "实际评审时间",
width: 200,
},
@ -90,6 +114,7 @@ export default {
};
},
methods: {
destroy,
async getList() {
const res = await index(this.select);
this.total = res.total;
@ -97,12 +122,19 @@ export default {
},
},
computed: {},
created() {
this.getList();
},
beforeRouteEnter(to, from, next) {
next((vm) => {
this.type = to.path.split("_")[1];
vm.role = to.path.split("_")[1] ? Number(to.path.split("_")[1]) : '';
});
},
};
</script>
<style scoped lang="scss"></style>
<style scoped lang="scss">
Button + Button {
margin-left: 4px;
}
</style>

Loading…
Cancel
Save