123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688 |
- <template>
- <!-- <div style="height: 95%"> -->
- <div class="container" style="margin: 15px 0 0 0">
- <fullscreen
- :fullscreen.sync="fullscreen"
- class="container-box"
- style="margin: 0 !important; padding: 0 !important"
- >
- <div class="titbox">
- <h2 class="font-ui">部门预算模板管理</h2>
- <div>
- <i class="el-icon-refresh" @click="iconCli(1)"></i>
- <i class="el-icon-full-screen" @click="iconCli(2)"></i>
- <!-- <i class="el-icon-folder-opened"></i>-->
- <!-- <i class="el-icon-view"></i>-->
- <!-- <i class="el-icon-more"></i>-->
- </div>
- </div>
- <div class="search">
- <mySearch :searchList="searchList" @searchInfo="searchInfo"></mySearch>
- <el-button size="small" @click="addExcel" type="primary"
- >新增模板</el-button
- >
- </div>
- <div class="tabbox">
- <el-table
- height="calc(100% - 40px)"
- v-loading="loading"
- class="com-table"
- ref="multipleTable"
- :data="tableData"
- tooltip-effect="dark"
- size="small"
- border
- style="width: 100%"
- >
- <el-table-column
- align="center"
- prop="tempName"
- label="模板名称"
- show-overflow-tooltip
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="opTime"
- show-overflow-tooltip
- label="配置时间"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="opNo"
- show-overflow-tooltip
- label="配置工号"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="opName"
- show-overflow-tooltip
- label="配置姓名"
- >
- </el-table-column>
- <el-table-column
- align="center"
- prop="tempStsDesc"
- show-overflow-tooltip
- label="模板状态"
- >
- </el-table-column>
- <el-table-column align="center" prop="tempTypeDesc" label="模板类型">
- </el-table-column>
- <el-table-column
- align="center"
- prop="tempStsDesc"
- show-overflow-tooltip
- label="权限状态"
- >
- <template slot-scope="scope">
- {{ scope.row.powerFlag == 0 ? "开" : "关" }}
- </template>
- </el-table-column>
- <el-table-column
- align="center"
- prop="hotline"
- width="200"
- label="操作"
- >
- <template slot-scope="scope">
- <el-button
- :disabled="scope.row.tempStsDesc == '作废'"
- size="mini"
- type="primary"
- plain
- @click="issue(scope.row)"
- >下发</el-button
- >
- <el-button
- size="mini"
- type="primary"
- plain
- @click="detailes(scope.row)"
- >查看</el-button
- >
- <el-button
- size="mini"
- type="primary"
- plain
- @click="updates(scope.row)"
- >修改</el-button
- >
- <el-button
- :disabled="scope.row.tempStsDesc == '作废'"
- size="mini"
- type="danger"
- plain
- @click="deletes(scope.row)"
- >作废</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <el-pagination
- class="pageBox"
- @current-change="currchange"
- layout="prev, pager, next"
- background
- :total="total"
- >
- </el-pagination>
- </div>
- <myMessage
- :messTit="messTit"
- @closeMessage="closeMessage"
- :centerDialogVisible="centerDialogVisible"
- v-if="centerDialogVisible"
- ></myMessage>
- </fullscreen>
- <el-dialog
- title="下发预算"
- :visible.sync="dialogStatus"
- width="50%"
- :close-on-press-escape="false"
- :show-close="false"
- :destroy-on-close="true"
- :modal-append-to-body="false"
- :close-on-click-modal="false"
- >
- <el-form
- ref="ruleForm"
- :rules="rules"
- :model="formData"
- label-width="80px"
- >
- <el-form-item label="预算标题" prop="woTitle">
- <el-input
- placeholder="请输入预算标题"
- v-model="formData.woTitle"
- ></el-input>
- </el-form-item>
- <el-form-item label="预算说明" prop="woDesc">
- <el-input
- placeholder="请输入预算说明"
- v-model="formData.woDesc"
- ></el-input>
- </el-form-item>
- <el-form-item v-if="typeFlag == '2'" label="下发月份" prop="sendMonth">
- <el-date-picker
- style="width: 100% !important"
- v-model="formData.sendMonth"
- value-format="yyyy-MM"
- type="month"
- placeholder="选择月份"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- v-if="typeFlag == '0' || typeFlag == '1' || typeFlag == '3'"
- label="下发年份"
- prop="sendYear"
- >
- <el-date-picker
- style="width: 100% !important"
- v-model="formData.sendYear"
- value-format="yyyy"
- type="year"
- placeholder="选择年份"
- >
- </el-date-picker>
- </el-form-item>
- <el-form-item
- v-if="typeFlag == '1'"
- label="下发季度"
- prop="sendQuarter"
- >
- <el-select
- style="width: 100% !important"
- v-model="formData.sendQuarter"
- placeholder="请选择季度"
- >
- <el-option label="一季度" value="01"> </el-option>
- <el-option label="二季度" value="02"> </el-option>
- <el-option label="三季度" value="03"> </el-option>
- <el-option label="四季度" value="04"> </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="反馈时间" prop="requiredTime">
- <el-date-picker
- style="width: 100%"
- v-model="formData.requiredTime"
- type="datetime"
- placeholder="选择反馈时间"
- value-format="yyyy-MM-01 HH:mm:ss">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="接收人" prop="sendNoArr">
- <el-select
- placeholder="选择接收人"
- v-model="formData.sendNoArr"
- multiple
- filterable
- style="width: 100%"
- >
- <el-option
- v-for="items in options"
- :key="items.value"
- :label="items.label"
- :value="items.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="需要回复" prop="needReply">
- <el-select
- style="width: 100% !important"
- v-model="formData.needReply"
- placeholder="请选择是否需要回复">
- <el-option label="是" value="是"> </el-option>
- <el-option label="否" value="否"> </el-option>
- </el-select>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button @click="resetUser('ruleForm')">取 消</el-button>
- <el-button @click="subUser('ruleForm')">确 定</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import mySearch from "../../../components/search";
- import myMessage from "../../../components/myMessage.vue";
- export default {
- components: {
- mySearch,
- myMessage,
- },
- data() {
- return {
- centerDialogVisible: false,
- messTit: "",
- dataId: "",
- typeFlag: "",
- value1: "",
- options: [],
- dialogStatus: false,
- formData: {
- woTitle: "",
- woDesc: "",
- requiredTime: "",
- sendNoArr: "",
- sendYear: "",
- sendMonth: "",
- sendQuarter: "",
- needReply: "是",
- },
- rules: {
- woTitle: [
- { required: true, message: "请输入预算标题", trigger: "blur" },
- ],
- woDesc: [
- { required: true, message: "请输入预算备注", trigger: "change" },
- ],
- requiredTime: [
- {
- required: true,
- message: "请选择反馈时间",
- trigger: "change",
- },
- ],
- sendNoArr: [
- {
- required: true,
- message: "请选择接收人",
- trigger: "change",
- },
- ],
- sendYear: [
- {
- required: true,
- message: "请选择下发年份",
- trigger: "change",
- },
- ],
- sendMonth: [
- {
- required: true,
- message: "请选择下发月份",
- trigger: "change",
- },
- ],
- sendQuarter: [
- {
- required: true,
- message: "请选择下发季度",
- trigger: "change",
- },
- ],
- },
- headers: {
- agileauthtoken: sessionStorage.agileauthtoken.replace(/"/g, ""),
- },
- fullscreen: false,
- total: 0,
- pageSize: 1,
- tableData: [
- {
- name: "黑龙江公司移动成本预算简表",
- cNo: "admin",
- cUser: "admin",
- ctime: "2021-03-10",
- status: "已下发",
- },
- {
- name: "黑龙江公司移动成本预算简表1",
- cNo: "admin",
- cUser: "admin",
- ctime: "2021-03-10",
- status: "草稿",
- },
- ],
- searchList: [
- {
- type: "input",
- tit: "模板名称",
- value: "",
- width: "100%",
- options: [],
- },
- // {
- // type: "input",
- // tit: "创建时间",
- // value: "",
- // width: "100%",
- // options: [],
- // },
- // {
- // type: "input",
- // tit: "模板状态",
- // value: "",
- // width: "100%",
- // options: [],
- // },
- ],
- params: {
- tempName: "",
- },
- loading: false,
- fileList: [],
- fileName: "",
- };
- },
- methods: {
- chenckType(val) {
- if (val.tempStsDesc == "草稿") {
- this.$http({
- url: "/market/pre/updateType",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- id: val.id,
- tempType: val.tempType,
- tempTypeDesc: val.tempTypeDesc,
- },
- }).then((res) => {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- this.getList(this.params, this.pageSize);
- });
- }
- },
- chenck(val) {
- if (val.tempStsDesc == "草稿") {
- this.$http({
- url: "/market/pre/updatePower",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: { id: val.id },
- }).then((res) => {
- this.$message({
- message: "操作成功",
- type: "success",
- });
- this.getList(this.params, this.pageSize);
- });
- }
- },
- detailes(val) {
- this.$router.push("/initExcelsee?status=see&id=" + val.id + "");
- },
- // 增加表单处理
- subUser(formName) {
- let sendNoArr = [];
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.formData.sendNoArr.map((item) => {
- this.options.map((row) => {
- if (item == row.value) {
- sendNoArr.push({
- receiveNo: item,
- receiveName: row.label,
- deptCode: row.deptCode,
- deptName: row.deptName,
- });
- }
- });
- });
- let data = {
- woTitle: this.formData.woTitle,
- woDesc: this.formData.woDesc,
- requiredTime: this.formData.requiredTime,
- sendNoArr: JSON.stringify(sendNoArr),
- needReply: this.formData.needReply,
- preTempId: this.preTempId,
- sendYear: this.typeFlag == "1" ? "" : this.formData.sendYear,
- sendMonth: this.formData.sendMonth,
- sendQuarter:
- this.typeFlag == "1"
- ? this.formData.sendYear + "-" + this.formData.sendQuarter
- : "",
- tempType: this.typeFlag,
- funcCode:
- this.typeFlag == "0"
- ? "1000"
- : this.typeFlag == "1"
- ? "1004"
- : this.typeFlag == "2"
- ? "1001"
- : this.typeFlag == "3"
- ? "1003"
- : "",
- };
- // console.log(data);
- this.$http({
- url: "/market/pre/pub",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: data,
- }).then((res) => {
- if (res.data.result == 0) {
- this.$message({
- type: "success",
- message: "下发成功",
- });
- } else {
- this.$message({
- type: "error",
- message: res.data.desc,
- });
- }
- this.resetUser(formName);
- this.dialogStatus = false;
- this.getList(this.params, this.pageSize);
- });
- }
- });
- },
- // 取消提交
- resetUser(formName) {
- this.$refs[formName].resetFields();
- this.dialogStatus = false;
- },
- closeDialog() {
- this.dialogStatus = false;
- },
- issue(val) {
- this.typeFlag = val.tempType;
- console.log(this.typeFlag);
- this.preTempId = val.id;
- this.dialogStatus = true;
- },
- defaultMenu(path, name) {
- let defaults = this.$store.state.tabList.filter((item) => {
- if (item.rountPath == path) {
- return item;
- }
- });
- if (defaults.length == 1) {
- return;
- }
- let params = {
- children: "",
- name: name,
- rountPath: path,
- target: "_self",
- };
- let set = new Set([...this.$store.state.tabList, params]);
- this.$store.commit("setDefaultActive", path);
- this.$store.commit("setTabList", Array.from(set));
- },
- deletes(val) {
- this.centerDialogVisible = true;
- this.messTit = "即将作废绩效模板, 是否确定?";
- this.dataId = val.id;
- // this.$confirm("即将作废部门预算模板, 是否确定?", "提示", {
- // confirmButtonText: "确定",
- // cancelButtonText: "取消",
- // type: "warning",
- // })
- // .then(() => {
- // this.$http({
- // url: "/market/pre/cancelPre",
- // method: "post",
- // headers: {
- // "Content-Type": "application/json",
- // },
- // data: { id: val.id },
- // }).then((res) => {
- // this.$message({
- // message: "删除成功",
- // type: "success",
- // });
- // this.getList(this.params, this.pageSize);
- // });
- // })
- // .catch(() => {});
- },
- closeMessage(v) {
- this.centerDialogVisible = false;
- if (v === 1) {
- this.$http({
- url: "/market/pre/cancelPre",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: { id: this.dataId },
- }).then((res) => {
- if (res.data.result == "0") {
- this.$message({
- message: "删除成功",
- type: "success",
- });
- }
- this.getList(this.params, this.pageSize);
- });
- }
- },
- addExcel() {
- this.$router.push("/initExceladd?status=add");
- // this.defaultMenu("/initExceladd?status=add", "新增预算模板");
- },
- updates(val) {
- this.$router.push("/initExcelupdate?status=update&id=" + val.id + "");
- // this.defaultMenu("/initExcelupdate?status=update", "修改预算模板");
- },
- //搜索数据
- searchInfo(v) {
- this.params = {};
- v[0] ? (this.params.tempName = v[0]) : "";
- this.getList(this.params, this.pageSize);
- },
- //获取列表
- getList(v, n) {
- this.loading = true;
- this.pageSize = n;
- this.$http({
- url: "/market/pre/queryPage",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- page: '{"pageNo":"' + n + '","pageSize":"10"}',
- },
- data: v,
- }).then((res) => {
- this.loading = false;
- this.tableData = res.data.data;
- this.total = res.data.totalRecord;
- });
- },
- //功能栏
- iconCli(v) {
- if (v === 1) {
- this.getList(this.params, this.pageSize);
- }
- if (v === 2) {
- this.fullscreen = !this.fullscreen;
- }
- },
- // 分页
- currchange(v) {
- this.pageSize = v;
- this.getList(this.params, this.pageSize);
- },
- getOpations() {
- this.$http({
- url: "/sysmgr/sys/mk/offices/queryList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {},
- }).then((res) => {
- res.data.body.map((item) => {
- this.options.push({
- label: item.loginName,
- value: item.loginNo,
- deptCode: item.groupId,
- deptName: item.groupName,
- });
- });
- });
- },
- },
- mounted() {
- this.getOpations();
- this.getList(this.params, this.pageSize);
- // this.getList(this.params, this.pageSize);
- },
- watch: {
- $route() {
- this.getList(this.params, this.pageSize);
- },
- },
- };
- </script>
- <style scoped>
- .el-upload-list {
- float: right;
- }
- .el-input__suffix {
- cursor: pointer;
- }
- .container .el-upload {
- width: auto !important;
- }
- </style>
- <style scoped lang="scss">
- .btn-default {
- display: inline;
- margin-left: 10px;
- }
- .titbox {
- div {
- float: right;
- i {
- font-size: 22px;
- margin-left: 20px;
- cursor: pointer;
- }
- }
- }
- .tabbox {
- margin-top: 15px;
- }
- .pageBox {
- text-align: right;
- margin-top: 10px;
- }
- </style>
|