master
parent
3e2561eefb
commit
618b3eefa0
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,164 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog :title="title+'项目类别'" :visible.sync="dialogFormVisible" width="500px" :before-close="handleClose">
|
||||||
|
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||||
|
<el-form-item label="上级" prop="parentId" v-if="!form.children">
|
||||||
|
<treeselect v-model="form.parentId" :options="options" :disable-branch-nodes="false" :show-count="true" :normalizer="normalizer" :flatten-search-results="false" noOptionsText="无上级可选" placeholder="请选择上级" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="编码:" prop='projectTypeNum'>
|
||||||
|
<el-input ref="projectTypeNum" type="number" v-model="form.projectTypeNum" autocomplete="on" style="width:200px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="名称:" prop='projectTypeName'>
|
||||||
|
<el-input v-model="form.projectTypeName" autocomplete="on" style="width:200px"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleClose" size="mini">取 消</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="save">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
|
import { handleTree } from "@/utils/index";
|
||||||
|
import {
|
||||||
|
proTypepage,
|
||||||
|
proTypeStates,
|
||||||
|
addproType,
|
||||||
|
delproType,
|
||||||
|
editproType,
|
||||||
|
proTypeDownload,
|
||||||
|
proTypeExport,
|
||||||
|
proTypeImport,
|
||||||
|
} from "@/api/storeManage.js";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "DeptEdit",
|
||||||
|
components: { Treeselect },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
form: {}, //主对象
|
||||||
|
rules: {
|
||||||
|
projectTypeNum: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入项目类别编码",
|
||||||
|
trigger: ["blur", "change"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
deptName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "请输入项目类别名称",
|
||||||
|
trigger: ["blur", "change"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
title: "", //弹窗标题
|
||||||
|
dialogFormVisible: false, //弹窗开关
|
||||||
|
options: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//关闭弹窗前的回调方法
|
||||||
|
handleClose() {
|
||||||
|
this.form = {};
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
this.$refs.form.clearValidate();
|
||||||
|
},
|
||||||
|
async fetchData() {
|
||||||
|
await proTypepage({ pageSize: 9999 }).then((res) => {
|
||||||
|
if (res.code == "000000") {
|
||||||
|
let list = [];
|
||||||
|
res.pageInfo.list.forEach((item) => {
|
||||||
|
if (this.form.projectTypeNum == item.projectTypeNum) {
|
||||||
|
} else {
|
||||||
|
list.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.options = handleTree(
|
||||||
|
list,
|
||||||
|
"projectTypeNum",
|
||||||
|
"parentId",
|
||||||
|
"children",
|
||||||
|
0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
normalizer(node) {
|
||||||
|
if (node.children && !node.children.length) {
|
||||||
|
delete node.children;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
id: node.id,
|
||||||
|
label: node.projectTypeNum + "--" + node.projectTypeName,
|
||||||
|
children: node.children,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
//组件传值
|
||||||
|
show(row) {
|
||||||
|
this.form = Object.assign({});
|
||||||
|
if (row == "添加") {
|
||||||
|
this.title = row;
|
||||||
|
} else {
|
||||||
|
this.title = "修改";
|
||||||
|
this.form = Object.assign({}, row);
|
||||||
|
if (this.form.parentId == 0) {
|
||||||
|
this.form.parentId = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setTimeout(() => {
|
||||||
|
this.$refs.projectTypeNum.focus();
|
||||||
|
this.$refs.projectTypeNum.select();
|
||||||
|
this.$refs.form.clearValidate();
|
||||||
|
}, 300);
|
||||||
|
this.fetchData();
|
||||||
|
this.dialogFormVisible = true;
|
||||||
|
},
|
||||||
|
close() {
|
||||||
|
this.$refs["form"].resetFields();
|
||||||
|
this.form = this.$options.data().form;
|
||||||
|
this.dialogFormVisible = false;
|
||||||
|
},
|
||||||
|
//保存确定方法
|
||||||
|
save() {
|
||||||
|
this.$refs["form"].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.title == "添加") {
|
||||||
|
await addproType(this.form).then((res) => this.callbackFun(res));
|
||||||
|
} else {
|
||||||
|
var form = {
|
||||||
|
id: this.form.id,
|
||||||
|
projectTypeName: this.form.projectTypeName,
|
||||||
|
projectTypeNum: this.form.projectTypeNum,
|
||||||
|
parentId: this.form.parentId,
|
||||||
|
};
|
||||||
|
await editproType(form).then((res) => this.callbackFun(res));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
callbackFun(res) {
|
||||||
|
if (res.code == "000000") {
|
||||||
|
this.$message.success({ message: this.title + "成功" });
|
||||||
|
this.$emit("editData");
|
||||||
|
this.close();
|
||||||
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog title="导出" :visible.sync="searchDialog" :modal-append-to-body="false" append-to-body :close-on-click-modal="false">
|
||||||
|
<el-form :model="searchForm">
|
||||||
|
<el-form-item label="请选择日期:" label-width="120px">
|
||||||
|
<div class="block">
|
||||||
|
<el-date-picker style="width: 2rem;" @change='changeDate' size="large" v-model="date" type="daterange" align="center" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" >
|
||||||
|
</el-date-picker>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="请选择门店:" label-width="120px">
|
||||||
|
<div class="block">
|
||||||
|
<selec @selecData="selecData"/>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button size="mini" type="primary" plain @click="searchDialog = false">取 消</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="search ">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import selec from "@/components/store/select/index";
|
||||||
|
export default {
|
||||||
|
components:{
|
||||||
|
selec
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchDialog:false,
|
||||||
|
storeIds:[],
|
||||||
|
searchForm:{},
|
||||||
|
date:[new Date(),new Date()]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
selecData(v){
|
||||||
|
this.storeIds = v
|
||||||
|
},
|
||||||
|
show(){
|
||||||
|
this.searchDialog = true
|
||||||
|
this.date = [new Date(),new Date()]
|
||||||
|
},
|
||||||
|
search(){
|
||||||
|
if(!this.date){
|
||||||
|
this.$message.warning({ message: "请选择正确日期" });
|
||||||
|
}else{
|
||||||
|
if(!this.storeIds.length){
|
||||||
|
this.$message.warning({ message: "请选择门店" });
|
||||||
|
}else{
|
||||||
|
this.searchDialog = false
|
||||||
|
let date1 = this.formatTime(this.date[0], "YYYY-MM-DD 00:00:00");
|
||||||
|
let date2 = this.formatTime(this.date[1], "YYYY-MM-DD 23:59:59");
|
||||||
|
let params = {
|
||||||
|
storeIds:this.storeIds,
|
||||||
|
startTime:date1,
|
||||||
|
endTime:date2
|
||||||
|
}
|
||||||
|
this.$emit('confirmExport',params)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
changeDate(date){
|
||||||
|
if(!date){
|
||||||
|
this.date = []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
@ -1,58 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-dialog title="搜索" :visible.sync="searchDialog">
|
|
||||||
<el-form :model="searchForm">
|
|
||||||
<el-form-item label="单据号搜索:" label-width="120px">
|
|
||||||
<div class="searchDiv">
|
|
||||||
<el-input size="medium" v-model="searchForm.refundNum" placeholder="输入要查询的单据号" clearable></el-input>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="跟单人员:" label-width="120px">
|
|
||||||
<div class="searchDiv">
|
|
||||||
<el-input size="medium" v-model="searchForm.memberName" placeholder="输入跟单人员" clearable></el-input>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="次数金额:" label-width="120px">
|
|
||||||
<div class="searchDiv">
|
|
||||||
<el-input size="medium" v-model="searchForm.mobilePhone" placeholder="输入次数金额" oninput="this.value=this.value.replace(/\D/g,'')" maxlength="11" pattern="[0-9]*" clearable></el-input>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="单据日期搜索:" label-width="120px">
|
|
||||||
<div class="block">
|
|
||||||
<el-date-picker style="width:1.25rem" @change='changeDate' size="large" v-model="searchForm.date" type="daterange" :default-time="['00:00:01', '23:59:59']" value-format="yyyy-MM-dd HH:mm:ss" align="center" unlink-panels range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" >
|
|
||||||
</el-date-picker>
|
|
||||||
</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<span slot="footer" class="dialog-footer">
|
|
||||||
<el-button size="mini" type="primary" plain @click="searchDialog = false">取 消</el-button>
|
|
||||||
<el-button type="primary" size="mini" @click="search(searchDialog = false) ">确 定</el-button>
|
|
||||||
</span>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchDialog:false,
|
|
||||||
searchForm:{}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
show(){
|
|
||||||
this.searchDialog = true
|
|
||||||
},
|
|
||||||
search(){},
|
|
||||||
changeDate(date){
|
|
||||||
if(!date){
|
|
||||||
this.searchForm.date = ''
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@ -1,75 +1,481 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div class="proType">
|
||||||
|
<div class="header_flex">
|
||||||
|
</div>
|
||||||
|
<el-table style="width: 100%;margin-top:5px" max-height="700" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)' ,color:'#eeeeee'}" ref="deptRef" border v-loading="listLoading" :data="list" :element-loading-text="elementLoadingText" default-expand-all row-key="id" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }" @row-click="handleRowClick">
|
||||||
|
<el-table-column align="center" prop="projectTypeNum" sortable label="编码" min-width="100"></el-table-column>
|
||||||
|
<el-table-column align="center" prop="projectTypeName" :show-overflow-tooltip="true" label="名称" min-width="100"></el-table-column>
|
||||||
|
<el-table-column align="center" fixed="right" label="操作" width="76" >
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button size="mini" type="primary" @click="handleExport(scope.row)" plain>导出</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
<div>
|
<div>
|
||||||
<div class="staffRanking_header padding-bottom-xs">
|
<el-dialog :close-on-click-modal="false" title="修改" :visible.sync="dialogFormVisible" width="50%" v-dialogDrag>
|
||||||
<div></div>
|
<el-form :model="editForm">
|
||||||
<div class="block">
|
<el-form-item label="编码:" :label-width="formLabelwidth">
|
||||||
<el-date-picker
|
<el-input oninput="this.value=this.value.replace(/[^\w_]/g,'');" v-model="editForm.projectTypeNum" style="width:200px" autocomplete="on" :disabled="true">
|
||||||
v-model="Time"
|
</el-input>
|
||||||
placeholder="选择月份"
|
</el-form-item>
|
||||||
type="month"
|
<el-form-item label="名称:" :label-width="formLabelwidth">
|
||||||
range-separator="至"
|
<el-input v-model="editForm.projectTypeName" style="width:200px" autocomplete="on"></el-input>
|
||||||
>
|
</el-form-item>
|
||||||
</el-date-picker>
|
</el-form>
|
||||||
<el-button size="mini" type="primary" @click="selectShow">高级搜索</el-button>
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button size="mini" type="primary" @click="exit">导出</el-button>
|
<el-button size="mini" type="primary" @click="dialogFormVisible = false">取 消</el-button>
|
||||||
|
<el-button size="mini" type="primary" @click="confirm(dialogFormVisible=false)">确 定</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
<el-table v-loading="loading" :data="list" :header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee', }" show-summary border max-height="600" ref="table">
|
<el-dialog title="搜索" :visible.sync="searchDialog">
|
||||||
<el-table-column align="center" min-width="80" prop="storeNum" label="门店" ></el-table-column>
|
<el-form :model="searchForm">
|
||||||
<el-table-column align="center" min-width="100" prop="storeName" label="日期" ></el-table-column>
|
<el-form-item label="类别名称搜索:" label-width="120px">
|
||||||
<el-table-column align="center" min-width="90" prop="date" label="顾客姓名"></el-table-column>
|
<div class="searchDiv">
|
||||||
<el-table-column align="center" min-width="50" prop="allRows" label="项目名称"></el-table-column>
|
<el-input size="medium" v-model="searchForm.projectTypeName" placeholder="输入要查询的项目类别名称" clearable></el-input>
|
||||||
<el-table-column align="center" min-width="50" prop="cashRows" label="数量"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="50" prop="courseRows" label="会员编码"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="50" prop="rechargeRows" label="单据号"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="60" prop="allCashNumber" label="业绩(元)"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="50" prop="cashManNumber" label="次数"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="50" prop="cashWomanNumber" label="员工工号"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="95" prop="allAmount" label="跟蛋管理层"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="95" prop="allCardAmount" label="专家组老师"></el-table-column>
|
|
||||||
<el-table-column align="center" min-width="75" prop="allRepayAmount" label="备注"></el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<select-dialog ref="select" />
|
|
||||||
</div>
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="根据状态搜索:" label-width="120px">
|
||||||
|
<div class="searchDiv">
|
||||||
|
<el-radio-group v-model="searchForm.state" fill="#f78989">
|
||||||
|
<el-radio :label="1" @click.native.prevent="clickitem(1)" size="medium" type="primary">启用中</el-radio>
|
||||||
|
<el-radio :label="0" @click.native.prevent="clickitem(0)" size="medium" type="primary">已停用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<span slot="footer" class="dialog-footer">
|
||||||
|
<el-button size="mini" type="primary" plain @click="searchDialog = false">取 消</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="search(searchDialog = false) ">确 定</el-button>
|
||||||
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
<el-dialog title="导入表格" :visible.sync="infoDialog" :close-on-click-modal='false'>
|
||||||
|
<excel @fileData='fileData' @infoDialogV='infoDialogV'></excel>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="导入提示" :visible.sync="infoErrorDialog">
|
||||||
|
<span>以下导入的项目类别的 <q>编码</q> 或者 <q>名称</q> 存在重复 , 请检查修改后重新导入</span>
|
||||||
|
<el-table :data="infoList">
|
||||||
|
<el-table-column align="center" prop="projectTypeNum" label="编码" sortable min-width="100">
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" prop="projectTypeName" :show-overflow-tooltip="true" label="名称" min-width="100"></el-table-column>
|
||||||
|
<el-table-column align="center" label="状态" min-width="80" v-role='4004005'>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch v-model="scope.row.state" active-text="启用 " inactive-text="停用" :active-value="1" :inactive-value="0" inactive-color="#cccccc" class="demo" @change="state(scope.row)" />
|
||||||
</template>
|
</template>
|
||||||
<script>
|
</el-table-column>
|
||||||
import selectDialog from './components/select.vue'
|
</el-table>
|
||||||
export default {
|
<span slot="footer" class="dialog-footer">
|
||||||
components:{
|
<el-button size="mini" type="primary" plain @click="infoErrorDialog = false">关 闭</el-button>
|
||||||
selectDialog
|
</span>
|
||||||
|
</el-dialog>
|
||||||
|
<edit ref="edit" @editData="getData"></edit>
|
||||||
|
<date-export ref="dateExport" @confirmExport="handleDateExport"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<style>
|
||||||
|
.proType .el-table th {
|
||||||
|
padding: 5px 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
import edit from "./components/Edit.vue";
|
||||||
|
import excel from "@/components/excel";
|
||||||
|
import { handleTree } from "@/utils/index";
|
||||||
|
import dateExport from './components/dateExport.vue'
|
||||||
|
import {
|
||||||
|
proTypepage,
|
||||||
|
proTypeStates,
|
||||||
|
delproType,
|
||||||
|
proTypeDownload,
|
||||||
|
proTypeExport,
|
||||||
|
proTypeImport,
|
||||||
|
queryTree,
|
||||||
|
groupCourse
|
||||||
|
} from "@/api/storeManage.js";
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
excel,
|
||||||
|
edit,
|
||||||
|
dateExport
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: false,
|
currentRow:null,
|
||||||
list: [],
|
listLoading: true,
|
||||||
Time:new Date()
|
elementLoadingText: "正在加载...",
|
||||||
|
dialogFormVisible: false, //弹窗开关
|
||||||
|
addialogFormVisible: false,
|
||||||
|
searchDialog: false, //搜索弹窗开关
|
||||||
|
refreshtext: false, //搜索判断字符
|
||||||
|
infoErrorDialog: false,
|
||||||
|
infoList: [],
|
||||||
|
headOffice: sessionStorage.getItem("headOffice") * 1,
|
||||||
|
searchForm: {
|
||||||
|
//搜索表单
|
||||||
|
state: 1,
|
||||||
|
projectTypeName: "",
|
||||||
|
},
|
||||||
|
value1: 0,
|
||||||
|
date: [],
|
||||||
|
list: [], //主数组
|
||||||
|
formLabelwidth: "180px",
|
||||||
|
formLabelwidth1: "180px",
|
||||||
|
pageNum: 1, // 当前页码
|
||||||
|
total: 0, //分页总条数 // 总条数
|
||||||
|
pageSize: 999, // 每页的数据条数,
|
||||||
|
editForm: [],
|
||||||
|
addForm: {},
|
||||||
|
pageInfo: {
|
||||||
|
total: 0, //分页总条数
|
||||||
|
tableList: [],
|
||||||
|
},
|
||||||
|
searchTrue: false, //搜索判断
|
||||||
|
infoDialog: false, //上传文件弹窗开关
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
selectShow(){
|
handleDateExport(v){
|
||||||
this.$refs.select.show()
|
let params = {
|
||||||
|
...v,
|
||||||
|
projectType:this.currentRow.id
|
||||||
|
}
|
||||||
|
console.log(params)
|
||||||
|
groupCourse(params).then(res=>{
|
||||||
|
let blob = new Blob([res]);
|
||||||
|
var a = document.createElement("a");
|
||||||
|
var url = window.URL.createObjectURL(blob);
|
||||||
|
console.log(url);
|
||||||
|
a.href = url;
|
||||||
|
a.download = "疗程统计导出表.xlsx";
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleExport(row){
|
||||||
|
this.currentRow = {...row}
|
||||||
|
this.$refs.dateExport.show()
|
||||||
},
|
},
|
||||||
dateChange(date){
|
handleRowClick(row, event, column) {
|
||||||
|
this.$refs.deptRef.toggleRowExpansion(row);
|
||||||
},
|
},
|
||||||
exit(){
|
//树形组件子集自定义返回方法
|
||||||
|
hasChildren(row) {
|
||||||
|
if (row.children) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
|
clickitem(e) {
|
||||||
|
e === this.searchForm.state
|
||||||
|
? (this.searchForm.state = null)
|
||||||
|
: (this.searchForm.state = e);
|
||||||
},
|
},
|
||||||
timestampToTime(timestamp) {
|
//下载模板方法
|
||||||
const date = new Date(timestamp);
|
download() {
|
||||||
const year = date.getFullYear();
|
proTypeDownload().then((res) => {
|
||||||
const month = ("0" + (date.getMonth() + 1)).slice(-2);
|
let blob = new Blob([res]);
|
||||||
const day = ("0" + date.getDate()).slice(-2);
|
console.log(blob);
|
||||||
const hour = ("0" + date.getHours()).slice(-2);
|
var a = document.createElement("a");
|
||||||
const minute = ("0" + date.getMinutes()).slice(-2);
|
var url = window.URL.createObjectURL(blob);
|
||||||
const second = ("0" + date.getSeconds()).slice(-2);
|
console.log(url);
|
||||||
const formattedTime = `${year}-${month}-${day}`;
|
a.href = url;
|
||||||
return formattedTime;
|
a.download = "项目类别模板.xlsx";
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
init(){
|
|
||||||
this.loading = true
|
//导出方法
|
||||||
|
exit() {
|
||||||
|
if (this.searchForm.projectTypeName == "") {
|
||||||
|
delete this.searchForm.projectTypeName;
|
||||||
|
}
|
||||||
|
proTypeExport(this.searchForm).then((res) => {
|
||||||
|
let blob = new Blob([res]);
|
||||||
|
var a = document.createElement("a");
|
||||||
|
var url = window.URL.createObjectURL(blob);
|
||||||
|
console.log(url);
|
||||||
|
a.href = url;
|
||||||
|
a.download = "项目类别导出表.xlsx";
|
||||||
|
a.click();
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//上传文件方法
|
||||||
|
fileData(v) {
|
||||||
|
console.log(v);
|
||||||
|
var fileData = new FormData();
|
||||||
|
if (v == null) {
|
||||||
|
this.$alert("请选择需要上传的文件", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
fileData.append("multipartFile", v);
|
||||||
|
proTypeImport(fileData).then((res) => {
|
||||||
|
if (res.rows != undefined) {
|
||||||
|
this.infoList = res.rows;
|
||||||
|
this.infoErrorDialog = true;
|
||||||
|
} else {
|
||||||
|
if (res.code == "000000") {
|
||||||
|
this.$message.success({
|
||||||
|
message: res.message,
|
||||||
|
});
|
||||||
|
|
||||||
|
this.getData();
|
||||||
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//返回上传文件弹窗状态
|
||||||
|
infoDialogV(v) {
|
||||||
|
this.infoDialog = v;
|
||||||
|
},
|
||||||
|
//搜索方法
|
||||||
|
search() {
|
||||||
|
//条件搜索
|
||||||
|
proTypepage(this.searchForm).then((res) => {
|
||||||
|
if (res.code == "000000") {
|
||||||
|
this.searchTrue = true;
|
||||||
|
this.list = res.pageInfo.list;
|
||||||
|
this.pageInfo = res.pageInfo;
|
||||||
|
if (res.pageInfo.total == 0) {
|
||||||
|
this.$message.warning({
|
||||||
|
message: "没有找到相对应的项目类别",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.$message.error({
|
||||||
|
message: res.message,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
change(value) {
|
||||||
|
var da = new Date(value).toLocaleString("chinese", {
|
||||||
|
hour12: false,
|
||||||
|
});
|
||||||
|
//console.log(da);
|
||||||
|
// if(da.indexOf("上午")||da.indexOf("下午")){
|
||||||
|
// //console.log("有上午或者下午");
|
||||||
|
// }
|
||||||
|
this.date = da;
|
||||||
|
},
|
||||||
|
//编辑
|
||||||
|
edit(row) {
|
||||||
|
this.$refs.edit.show(row);
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
del(row) {
|
||||||
|
var id = {
|
||||||
|
id: row.id,
|
||||||
};
|
};
|
||||||
</script>
|
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
cancelButtonClass: "cancelbtnFalses",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
delproType(id).then((res) => {
|
||||||
|
if (res.code == "000000") {
|
||||||
|
this.$message.success({
|
||||||
|
message: row.projectTypeName + " 删除成功!",
|
||||||
|
});
|
||||||
|
if (this.pageInfo.total % this.pageSize == 1) {
|
||||||
|
this.pageNum = this.pageNum - 1;
|
||||||
|
}
|
||||||
|
this.getData();
|
||||||
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message.info({
|
||||||
|
message: "已取消操作!",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
<style scoped>
|
//状态 0 1
|
||||||
</style>
|
state(row) {
|
||||||
|
var state = {
|
||||||
|
id: row.id,
|
||||||
|
state: row.state,
|
||||||
|
};
|
||||||
|
if (row.state == 0) {
|
||||||
|
this.$confirm(
|
||||||
|
"如有该项目类别的项目在启用中,不能停用此项目类别, 是否继续?",
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
cancelButtonClass: "cancelbtnFalses",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
proTypeStates(state).then((res) => {
|
||||||
|
//console.log(res);
|
||||||
|
if (res.code == "000000") {
|
||||||
|
this.getData();
|
||||||
|
this.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "项目类别已停用",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
row.state = 1;
|
||||||
|
this.$message({
|
||||||
|
type: "info",
|
||||||
|
message: "取消停用!",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$confirm("启用项目类别, 是否继续?", "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
cancelButtonText: "取消",
|
||||||
|
type: "warning",
|
||||||
|
cancelButtonClass: "cancelbtnFalses",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
proTypeStates(state).then((res) => {
|
||||||
|
//console.log(res);
|
||||||
|
if (res.code == "000000") {
|
||||||
|
this.getData();
|
||||||
|
this.$message({
|
||||||
|
type: "success",
|
||||||
|
message: "启用成功!",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
row.state = 0;
|
||||||
|
this.$message({
|
||||||
|
type: "info",
|
||||||
|
message: "取消启用",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//分页方法
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
if (this.searchTrue == true) {
|
||||||
|
this.search();
|
||||||
|
} else {
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.pageNum = val;
|
||||||
|
if (this.searchTrue == true) {
|
||||||
|
this.search();
|
||||||
|
} else {
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//获取数据
|
||||||
|
async getData() {
|
||||||
|
var page = {
|
||||||
|
pageNum: this.pageNum,
|
||||||
|
pageSize: this.pageSize,
|
||||||
|
};
|
||||||
|
queryTree().then();
|
||||||
|
proTypepage(page).then((res) => {
|
||||||
|
this.listLoading = false;
|
||||||
|
if (res.code == "000000") {
|
||||||
|
if (this.refreshtext == true) {
|
||||||
|
this.$message.success({
|
||||||
|
message: "已刷新最新数据",
|
||||||
|
});
|
||||||
|
this.refreshtext = false;
|
||||||
|
this.searchTrue = false;
|
||||||
|
}
|
||||||
|
let list = [
|
||||||
|
{ id: "1", projectTypeNum: "1001", parentId: 0 },
|
||||||
|
{ id: "1002", projectTypeNum: "1002", parentId: "1" },
|
||||||
|
{ id: "1003", projectTypeNum: "1003", parentId: "1" },
|
||||||
|
{ id: "1004", projectTypeNum: "1004", parentId: "1" },
|
||||||
|
];
|
||||||
|
res.pageInfo.list.forEach((item) => {
|
||||||
|
// console.log(JSON.parse(JSON.stringify(item)));
|
||||||
|
if (!item.parentId) {
|
||||||
|
item.parentId = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.list = handleTree(
|
||||||
|
res.pageInfo.list,
|
||||||
|
"id",
|
||||||
|
"parentId",
|
||||||
|
"children",
|
||||||
|
0
|
||||||
|
);
|
||||||
|
this.pageInfo = res.pageInfo;
|
||||||
|
} else {
|
||||||
|
this.$alert(res.message, "提示", {
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
confirmButtonClass: "confirmbtnFalses",
|
||||||
|
type: "warning",
|
||||||
|
center: true,
|
||||||
|
callback: (action) => {},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
created() {
|
||||||
|
let list = JSON.parse(sessionStorage.getItem("list"));
|
||||||
|
list.forEach((item) => {
|
||||||
|
if (item.id == 4004001) {
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|||||||
Loading…
Reference in New Issue