master
xy 3 years ago
parent a58517868e
commit 0f2b5c897e

@ -0,0 +1,41 @@
import request from "@/utils/request";
export function index (params) {
return request({
url: '/api/admin/gov-plane/index',
method: 'get',
params
})
}
export function show (params) {
return request({
url: '/api/admin/gov-plane/show',
method: 'get',
params
})
}
export function store (data) {
return request({
url: '/api/admin/gov-plane/store',
method: 'post',
data
})
}
export function save (data) {
return request({
url: '/api/admin/gov-plane/save',
method: 'post',
data
})
}
export function destroy (params) {
return request({
url: '/api/admin/gov-plane/destroy',
method: 'get',
params
})
}

@ -75,6 +75,12 @@ export default {
},
okClick(){
this.$emit('on-ok')
},
clearValidate () {
this.$refs['elForm'].clearValidate()
},
setCurrentRow (row) {
this.$refs['elForm'].setCurrentRow(row)
}
},
render(h) {

@ -24,6 +24,10 @@ export default {
type:Function,
default:()=>{}
},
highlightCurrentRow: {
type: Boolean,
default: false
},
headerRowStyle:{
type:Function,
default:()=>{}
@ -129,6 +133,7 @@ export default {
{ tableItem && tableItem.length>0 ?
(<el-table
ref="table"
highlight-current-row={this.highlightCurrentRow}
span-method={objectSpanMethod}
show-summary={showSummary}
show-header={showHeader}

@ -46,7 +46,13 @@ Vue.config.productionTip = false
import moment from 'moment'
Vue.prototype.$moment = moment;
Vue.prototype.$integrateData = (target,value) => {
for(let i in target){
if(target.hasOwnProperty(i) && value.hasOwnProperty(i)){
target[i] = value[i]
}
}
}
new Vue({
el: '#app',
router,

@ -0,0 +1,174 @@
<template>
<div>
<Modal
transfer
title="政府采购计划"
v-model="dialogVisible"
width="60">
<template>
<xy-table :table-item="table" highlight-current-row :list="data" @cellClick="cellClick">
<template #btns></template>
</xy-table>
<div style="display: flex;justify-content: center;margin-top: 10px;">
<el-pagination
small
layout="prev, pager, next"
:total="total"
@current-change="e => {
select.page = e
getData()
}">
</el-pagination>
</div>
</template>
<template #footer>
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</template>
</Modal>
</div>
</template>
<script>
import { index } from "@/api/govPlane"
export default {
data() {
return {
dialogVisible: false,
isLoading: false,
total: 0,
data: [],
table: [
{
prop: "department.name",
label: "责任科室",
width: 160,
},
{
prop: "name",
label: "项目名称",
width: 180,
},
{
prop: "content",
label: "项目内容",
minWidth: 220,
align: "left",
},
{
prop: "plan_money",
label: "采购预算",
width: 160,
align: "right",
formatter: (cell, data, value) => {
return `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
},
{
prop: "public_plane_date",
label: "采购意向公开计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "public_act_date",
label: "采购意向公开实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "invite_plane_date",
label: "招标文件挂网计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "invite_act_date",
label: "招标文件挂网实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "open_plane_date",
label: "项目开标计划时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "open_act_date",
label: "项目开标实际时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
],
select: {
page: 1,
page_size: 10,
keyword: ''
},
selected: {}
}
},
methods: {
show() {
this.dialogVisible = true
},
hide() {
this.dialogVisible = false
},
unique (arr) {
const res= new Map()
return arr.filter((a)=> !res.has(a.id) && res.set(a.id,1))
},
async getData() {
this.isLoading = true
const res = await index(this.select)
this.data = res.data
this.total = res.total
this.isLoading = false
},
selectionChange(selection) {
this.selected = selection
},
confirm () {
this.$emit('selected', this.selected)
this.hide()
},
cellClick (row) {
this.selected = row
}
},
computed: {},
watch: {
dialogVisible(newVal) {
if (newVal) {
this.getData()
}
}
}
}
</script>
<style scoped lang="scss">
</style>

@ -385,6 +385,23 @@
</div>
</div>
</template>
<template #gov_plane_id v-if="form.methods === 1">
<div class="xy-table-item">
<div class="xy-table-item-label">
政府采购项目
</div>
<div class="xy-table-item-content">
<div class="contract-add-plan" style="width: 300px;" @click="$refs['govPlane'].show()">
<template v-if="form.gov_plane_id">
<Tag closable color="primary" @on-close="form.gov_plane_id = ''">{{ $refs['govPlane'].selected.name }}</Tag>
</template>
<template v-else>
<div class="contract-add-plan-no-plan">请选择政府采购项目</div>
</template>
</div>
</div>
</div>
</template>
</xy-dialog>
@ -464,6 +481,8 @@
<!-- 查看付款计划-->
<contractPaymentRegistration ref="contractPaymentRegistration"></contractPaymentRegistration>
<govPlane ref="govPlane" @selected="row => form.gov_plane_id = row.id"></govPlane>
</div>
</template>
@ -503,9 +522,9 @@ 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 {
download
import govPlane from './components/govPlane.vue'
import {
download
} from '@/utils/downloadRequest'
export default {
components: {
@ -513,7 +532,8 @@ export default {
detail,
paymentRegistration,
contractSign,
contractPaymentRegistration
contractPaymentRegistration,
govPlane
},
data() {
var planPass = (rule, value, callback) => {
@ -1087,6 +1107,7 @@ export default {
isBudget: true,
plan: [],
is_substitute: 0,
gov_plane_id: '',
},
plan: [],
rules: {
@ -1701,7 +1722,8 @@ export default {
is_simple:this.form.is_simple,
supply:this.form.supply,
money:this.form?.money,
status:this.form?.is_simple ? 2 : 1
status:this.form?.is_simple ? 2 : 1,
gov_plane_id: this.form.gov_plane_id
}).then(res => {
this.isShowAdd = false
Message({

@ -0,0 +1,306 @@
<template>
<div>
<xy-dialog
ref="dialog"
:is-show.sync="isShow"
type="form"
:title="type === 'add' ? '新增政府采购计划' : '编辑政府采购计划'"
:form="form"
:rules="rules"
@submit="submit"
>
<template v-slot:name>
<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
v-model="form.name"
clearable
placeholder="请输入项目名称"
style="width: 300px"
></el-input>
</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"
:autosize="{ minRows: 2 }"
v-model="form.content"
clearable
placeholder="请输入项目内容"
style="width: 300px"
></el-input>
</div>
</div>
</template>
<template v-slot:plan_money>
<div class="xy-table-item">
<div class="xy-table-item-label">采购预算 </div>
<div class="xy-table-item-content xy-table-item-price">
<el-input-number
v-model="form.plan_money"
clearable
placeholder="请输入采购预算"
style="width: 300px"
:controls="false"
></el-input-number>
</div>
</div>
</template>
<template v-slot:public_plane_date>
<div class="xy-table-item">
<div class="xy-table-item-label">采购意向公开计划时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.public_plane_date"
placeholder="请选择采购意向公开计划时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:public_act_date>
<div class="xy-table-item">
<div class="xy-table-item-label">采购意向公开实际时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.public_act_date"
placeholder="请选择采购意向公开实际时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:invite_plane_date>
<div class="xy-table-item">
<div class="xy-table-item-label">招标文件挂网计划时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.invite_plane_date"
placeholder="请选择招标文件挂网计划时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:invite_act_date>
<div class="xy-table-item">
<div class="xy-table-item-label">招标文件挂网实际时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.invite_act_date"
placeholder="请选择招标文件挂网实际时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:open_plane_date>
<div class="xy-table-item">
<div class="xy-table-item-label">项目开标计划时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.open_plane_date"
placeholder="请选择项目开标计划时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
<template v-slot:open_act_date>
<div class="xy-table-item">
<div class="xy-table-item-label">项目开标实际时间 </div>
<div class="xy-table-item-content">
<el-date-picker
v-model="form.open_act_date"
placeholder="请选择项目开标实际时间"
style="width: 300px"
value-format="yyyy-MM-dd"
></el-date-picker>
</div>
</div>
</template>
</xy-dialog>
</div>
</template>
<script>
import { show, save, store } from "@/api/govPlane";
export default {
props: {},
data() {
return {
isShow: false,
id: "",
type: "",
form: {
name: "",
content: "",
plan_money: "",
public_plane_date: "",
public_act_date: "",
invite_plane_date: "",
invite_act_date: "",
open_plane_date: "",
open_act_date: "",
},
rules: {
name: [
{
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 show({ id: this.id });
this.$integrateData(this.form, res);
},
submit() {
if (this.type === "add") {
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", {
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");
});
}
},
},
watch: {
isShow(val) {
if (val) {
if (this.type === "editor") {
this.getDetail();
}
} else {
this.id = "";
this.type = "";
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: 200px;
}
.xy-table-item-price {
position: relative;
&::after {
z-index: 1;
position: absolute;
right: 0;
top: 0;
content: '(元)'
}
::v-deep .el-input__clear {
position: relative;
right: 30px;
z-index: 2;
}
}
</style>

@ -0,0 +1,182 @@
<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>
<Input
v-model="select.keyword"
placeholder="请输入关键字"
style="width: 180px"
></Input>
</span>
<Button type="primary" style="margin-left: 10px" ghost @click=""
>重置</Button
>
<Button type="primary" style="margin-left: 10px" @click="getList"
>查询</Button
>
<Button
type="primary"
style="margin-left: 10px"
@click="
$refs['addGovPlane'].setType('add'), $refs['addGovPlane'].show()
"
>新增</Button
>
</slot>
</lx-header>
<xy-table
:list="list"
:table-item="table"
@editor="
(e) => {
$refs['addGovPlane'].setType('editor');
$refs['addGovPlane'].setId(e.id);
$refs['addGovPlane'].show();
}
"
@delete="destroy"
></xy-table>
<div style="display: flex; justify-content: flex-end; margin-top: 10px">
<Page
:total="total"
show-elevator
@on-change="
(e) => {
select.page = e;
getList();
}
"
/>
</div>
<addGovPlane ref="addGovPlane" @refresh="getList"></addGovPlane>
</div>
</template>
<script>
import addGovPlane from "@/views/statisticalReport/components/addGovPlane.vue";
import { index, destroy } from "@/api/govPlane";
export default {
components: {
addGovPlane,
},
data() {
return {
select: {
page: 1,
page_size: 10,
keyword: "",
},
total: 0,
list: [],
table: [
{
prop: "department.name",
label: "责任科室",
width: 160,
},
{
prop: "name",
label: "项目名称",
width: 180,
},
{
prop: "content",
label: "项目内容",
minWidth: 220,
align: "left",
},
{
prop: "plan_money",
label: "采购预算",
width: 160,
align: "right",
formatter: (cell, data, value) => {
return `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
},
},
{
prop: "public_plane_date",
label: "采购意向公开计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "public_act_date",
label: "采购意向公开实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "invite_plane_date",
label: "招标文件挂网计划时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "invite_act_date",
label: "招标文件挂网实际时间",
width: 190,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "open_plane_date",
label: "项目开标计划时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
{
prop: "open_act_date",
label: "项目开标实际时间",
width: 180,
formatter: (cell, data, value) => {
return this.$moment(new Date(value)).format("YYYY年MM月DD");
},
},
],
};
},
methods: {
async getList() {
const res = await index(this.select);
this.total = res.total;
this.list = res.data;
},
destroy (row) {
destroy({ id: row.id }).then(res => {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
})
}
},
computed: {},
created() {
this.getList();
},
};
</script>
<style scoped lang="scss"></style>
Loading…
Cancel
Save