|
|
|
|
@ -0,0 +1,450 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="container">
|
|
|
|
|
<!-- 查询配置 -->
|
|
|
|
|
<div style="padding: 0px 20px">
|
|
|
|
|
<div ref="lxHeader">
|
|
|
|
|
<LxHeader icon="md-apps" text="需求公告" style="margin-bottom: 10px; border: 0px; margin-top: 15px">
|
|
|
|
|
<div slot="content"></div>
|
|
|
|
|
<slot>
|
|
|
|
|
<div>
|
|
|
|
|
<Input style="width: 200px; margin-right: 10px" v-model="searchFields.KeyWord" placeholder="关键字搜索" />
|
|
|
|
|
<Button type="primary" @click="load" style="margin-left: 10px">查询</Button>
|
|
|
|
|
<Button type="primary" @click="edit()" style="margin-left: 10px">新增</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</slot>
|
|
|
|
|
</LxHeader>
|
|
|
|
|
</div>
|
|
|
|
|
<div ref="lxTable">
|
|
|
|
|
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
|
|
|
|
|
<el-table-column type="index" width="50" align="center"> </el-table-column>
|
|
|
|
|
<el-table-column :prop="column.field" :align="column.align" v-for="(column,index) in columns"
|
|
|
|
|
:label="column.title" :width="column.width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<div v-if="column.type=='opt'">
|
|
|
|
|
<!-- <Button v-if="scope.row['status']==0" ghost size="small" @click="check(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">审核</Button> -->
|
|
|
|
|
<Button ghost size="small" @click="edit(scope.row)" type="primary"
|
|
|
|
|
style="margin-left: 10px;">编辑</Button>
|
|
|
|
|
<Button ghost size="small" @click="del(scope.row)" type="error" style="margin-left: 10px;">删除</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else-if="column.type=='status_id'">
|
|
|
|
|
<div v-for="item in selects.statuslist">
|
|
|
|
|
<div v-if="item.id==scope.row[column.field]">{{item.value}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>{{scope.row[column.field]}}</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="pagination">
|
|
|
|
|
<el-pagination @current-change="handleCurrentChange" :current-page="paginations.page"
|
|
|
|
|
:page-size="paginations.page_size" background layout="prev, pager, next" :total="paginations.total">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-dialog title="内容编辑" :visible.sync="dialogFormVisible" fullscreen width="90%">
|
|
|
|
|
<div class="dialogConcent" :style="{height:clientHeight+'px'}">
|
|
|
|
|
<el-scrollbar style="flex: 1">
|
|
|
|
|
<el-form :model="form" :rules="rules" ref="form" label-position="right" :label-width="formLabelWidth">
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="需求名称" prop="title">
|
|
|
|
|
<el-input v-model="form.title" placeholder="请填写公示公告名称" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="需求编号" prop="number">
|
|
|
|
|
<el-input v-model="form.number" readonly placeholder="请填写需求编号" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="服务对象" prop="object">
|
|
|
|
|
<el-input v-model="form.object" placeholder="请填写服务对象" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="截止时间" prop="end_time">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
class="width100"
|
|
|
|
|
value-format="yyyy-MM-dd HH:mm:ss"
|
|
|
|
|
v-model="form.end_time"
|
|
|
|
|
type="datetime"
|
|
|
|
|
placeholder="请选择截止时间">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="项目类型" prop="item_type_id">
|
|
|
|
|
<el-select class="width100" v-model="form.item_type_id" placeholder="请选择项目类型">
|
|
|
|
|
<el-option v-for="item in selects.itemslist" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="状态" prop="status_id">
|
|
|
|
|
<el-select class="width100" v-model="form.status_id" placeholder="请选择状态">
|
|
|
|
|
<el-option v-for="item in selects.statuslist" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="需求类型" prop="need_type_id">
|
|
|
|
|
<el-select class="width100" v-model="form.need_type_id" placeholder="请选择需求类型">
|
|
|
|
|
<el-option v-for="item in selects.needslist" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="所属区域" prop="area_id">
|
|
|
|
|
<el-select class="width100" v-model="form.area_id" placeholder="全部">
|
|
|
|
|
<el-option v-for="item in selects.streetType" :key="item.id" :label="item.value"
|
|
|
|
|
:value="item.id">
|
|
|
|
|
</el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="采购单位" prop="purchase">
|
|
|
|
|
<el-input v-model="form.purchase" placeholder="请填写采购单位" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="预算" prop="plan_money">
|
|
|
|
|
<el-input v-model="form.plan_money" placeholder="请填写预算" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10">
|
|
|
|
|
<el-form-item label="联系人" prop="link_name">
|
|
|
|
|
<el-input v-model="form.link_name" placeholder="请填写联系人" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="10" :offset="4">
|
|
|
|
|
<el-form-item label="联系电话" prop="link_mobile">
|
|
|
|
|
<el-input v-model="form.link_mobile" placeholder="请填写联系电话" autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="附件" prop="files_list">
|
|
|
|
|
<el-upload class="upload-demo" :on-success="handlesuccess" :data="uploadOther"
|
|
|
|
|
action="/api/admin/upload-file" :on-remove="handleRemove" :before-remove="beforeRemove"
|
|
|
|
|
:on-exceed="handleExceed" :file-list="fileList">
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
</el-upload>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<el-form-item label="简介" prop="content">
|
|
|
|
|
|
|
|
|
|
<el-input class="width100" type="textarea" :rows="3" placeholder="请输入简介" v-model="form.content">
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-scrollbar>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button @click="resetForm('form')">取 消</el-button>
|
|
|
|
|
<el-button type="primary" v-preventReClick @click="submitForm('form')">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
getToken
|
|
|
|
|
} from '@/utils/auth'
|
|
|
|
|
import LxHeader from "@/components/LxHeader/index.vue";
|
|
|
|
|
import {
|
|
|
|
|
listNeedList,
|
|
|
|
|
store,
|
|
|
|
|
del,
|
|
|
|
|
save,
|
|
|
|
|
get
|
|
|
|
|
} from "../../api/requirement/index.js";
|
|
|
|
|
import {
|
|
|
|
|
getparameteritem
|
|
|
|
|
} from "../../api/system/dictionary.js"
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
LxHeader,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
selects:{
|
|
|
|
|
itemslist:[],
|
|
|
|
|
statuslist:[],
|
|
|
|
|
needslist:[],
|
|
|
|
|
streetType:[]
|
|
|
|
|
},
|
|
|
|
|
uploadOther: {
|
|
|
|
|
token: ""
|
|
|
|
|
},
|
|
|
|
|
paginations: {
|
|
|
|
|
page: 1,
|
|
|
|
|
page_size: 15,
|
|
|
|
|
total: 0
|
|
|
|
|
},
|
|
|
|
|
tableHeight: 0,
|
|
|
|
|
dialogFormVisible: false,
|
|
|
|
|
formLabelWidth: "120px",
|
|
|
|
|
clientHeight: 0,
|
|
|
|
|
form: {
|
|
|
|
|
item_type_id:"",
|
|
|
|
|
status_id:"",
|
|
|
|
|
need_type_id:"",
|
|
|
|
|
area_id:"",
|
|
|
|
|
title:"",
|
|
|
|
|
content: "",
|
|
|
|
|
number:"",
|
|
|
|
|
object:"",
|
|
|
|
|
purchase:"",
|
|
|
|
|
end_time:"",
|
|
|
|
|
link_name:"",
|
|
|
|
|
link_mobile:"",
|
|
|
|
|
plan_money:'',
|
|
|
|
|
files_list: []
|
|
|
|
|
},
|
|
|
|
|
tableData: [],
|
|
|
|
|
fileList: [],
|
|
|
|
|
rules: {
|
|
|
|
|
},
|
|
|
|
|
tableHeight: 900,
|
|
|
|
|
searchFields: {
|
|
|
|
|
KeyWord: ""
|
|
|
|
|
},
|
|
|
|
|
columns: [{
|
|
|
|
|
field: "title",
|
|
|
|
|
title: "需求名称",
|
|
|
|
|
type: "string",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
field: "purchase",
|
|
|
|
|
title: "采购对象",
|
|
|
|
|
type: "string",
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "status_id",
|
|
|
|
|
title: "状态",
|
|
|
|
|
type: "status_id",
|
|
|
|
|
width: 200,
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "end_time",
|
|
|
|
|
title: "截止时间",
|
|
|
|
|
type: "string",
|
|
|
|
|
width: 200,
|
|
|
|
|
align: "center"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: "操作",
|
|
|
|
|
title: "操作",
|
|
|
|
|
width: 220,
|
|
|
|
|
type: "opt",
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.uploadOther.token = getToken();
|
|
|
|
|
this.initLoad();
|
|
|
|
|
this.load();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
|
|
|
|
|
initLoad() {
|
|
|
|
|
var that = this;
|
|
|
|
|
var clientHeight = document.documentElement.clientHeight
|
|
|
|
|
var lxHeader_height = 96.5; //查询 头部
|
|
|
|
|
var paginationHeight = 37; //分页的高度
|
|
|
|
|
var topHeight = 50; //页面 头部
|
|
|
|
|
let tableHeight = clientHeight - lxHeader_height - topHeight - paginationHeight - 20;
|
|
|
|
|
that.tableHeight = tableHeight;
|
|
|
|
|
|
|
|
|
|
getparameteritem("itemslist").then(res => {
|
|
|
|
|
this.selects.itemslist = res.detail;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getparameteritem("statuslist").then(res => {
|
|
|
|
|
this.selects.statuslist = res.detail;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getparameteritem("needslist").then(res => {
|
|
|
|
|
this.selects.needslist = res.detail;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
getparameteritem("streetList").then(res => {
|
|
|
|
|
this.selects.streetType = res.detail;
|
|
|
|
|
this.form.area_id = res.detail[0].id;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
load() {
|
|
|
|
|
listNeedList({
|
|
|
|
|
page: this.paginations.page,
|
|
|
|
|
page_size: this.paginations.page_size,
|
|
|
|
|
keyword:this.searchFields.KeyWord
|
|
|
|
|
}).then(response => {
|
|
|
|
|
this.tableData = response.data;
|
|
|
|
|
this.paginations.page_size = response.total;
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
info(obj) {
|
|
|
|
|
var that = this;
|
|
|
|
|
get(obj.id).then(res => {
|
|
|
|
|
let result = Object.assign(that.form, res);
|
|
|
|
|
that.form = result;
|
|
|
|
|
let _files = [];
|
|
|
|
|
for (var mod of result.files) {
|
|
|
|
|
let m = Object.assign({}, mod);
|
|
|
|
|
m.url = mod.upload.url;
|
|
|
|
|
m.name = mod.upload.original_name;
|
|
|
|
|
m.id = mod.upload.id;
|
|
|
|
|
_files.push(m);
|
|
|
|
|
}
|
|
|
|
|
that.fileList = _files;
|
|
|
|
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
edit(obj) {
|
|
|
|
|
this.form = this.$options.data().form;
|
|
|
|
|
this.clientHeight = document.documentElement.clientHeight - 84 - 110;
|
|
|
|
|
if (obj) {
|
|
|
|
|
var that = this;
|
|
|
|
|
that.info(obj);
|
|
|
|
|
} else {
|
|
|
|
|
this.form.number = new Date().getTime();
|
|
|
|
|
}
|
|
|
|
|
this.dialogFormVisible = true;
|
|
|
|
|
},
|
|
|
|
|
submitForm(formName) {
|
|
|
|
|
var that = this;
|
|
|
|
|
this.$refs[formName].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (that.form.id) {
|
|
|
|
|
save(that.form).then(response => {
|
|
|
|
|
//console.log(response)
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
that.load();
|
|
|
|
|
that.dialogFormVisible = false;
|
|
|
|
|
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
store(that.form).then(response => {
|
|
|
|
|
//console.log(response)
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
that.load();
|
|
|
|
|
that.dialogFormVisible = false;
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
//reject(error)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
that.fileList = [];
|
|
|
|
|
} else {
|
|
|
|
|
this.$Message.error('数据校验失败');
|
|
|
|
|
console.log('error submit!!');
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
resetForm(formName) {
|
|
|
|
|
var that = this;
|
|
|
|
|
this.fileList = [];
|
|
|
|
|
this.$refs[formName].resetFields();
|
|
|
|
|
that.dialogFormVisible = false;
|
|
|
|
|
},
|
|
|
|
|
del(obj) {
|
|
|
|
|
var that = this;
|
|
|
|
|
if (obj) {
|
|
|
|
|
this.$Modal.confirm({
|
|
|
|
|
title: '确认要删除数据?',
|
|
|
|
|
onOk: () => {
|
|
|
|
|
del(obj.id).then(response => {
|
|
|
|
|
this.$Message.success('操作成功');
|
|
|
|
|
that.load();
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
console.log(error)
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onCancel: () => {
|
|
|
|
|
//this.$Message.info('Clicked cancel');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
handleCurrentChange(page) {
|
|
|
|
|
this.paginations.page = page;
|
|
|
|
|
this.load();
|
|
|
|
|
},
|
|
|
|
|
handleRemove(file, fileList) {
|
|
|
|
|
console.log(fileList);
|
|
|
|
|
let listUrl = [];
|
|
|
|
|
for (var m of fileList) {
|
|
|
|
|
if (m.response)
|
|
|
|
|
listUrl.push({
|
|
|
|
|
'upload_id': m.response.id
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
listUrl.push({
|
|
|
|
|
'upload_id': m.id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.form.files_list = listUrl;
|
|
|
|
|
},
|
|
|
|
|
handleExceed(files, fileList) {},
|
|
|
|
|
beforeRemove(file, fileList) {
|
|
|
|
|
return this.$confirm(`确定移除 ${ file.name }?`);
|
|
|
|
|
},
|
|
|
|
|
handlesuccess(response, file, fileList) {
|
|
|
|
|
console.log(fileList);
|
|
|
|
|
let listUrl = [];
|
|
|
|
|
for (var m of fileList) {
|
|
|
|
|
if (m.response)
|
|
|
|
|
listUrl.push({
|
|
|
|
|
'upload_id': m.response.id
|
|
|
|
|
});
|
|
|
|
|
else
|
|
|
|
|
listUrl.push({
|
|
|
|
|
'upload_id': m.id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
this.form.files_list = listUrl;
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
.dialogConcent {
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.width100 {
|
|
|
|
|
width: 100% !important
|
|
|
|
|
}
|
|
|
|
|
</style>
|