|
@@ -4,41 +4,61 @@
|
|
|
|
|
|
<div class="common common_content">
|
|
|
<div class="optionBtnFuc">
|
|
|
- <el-button type="primary" @click="createNew">新建</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="createNew">新建</el-button>
|
|
|
</div>
|
|
|
- <div class="filingList clearFix" >
|
|
|
- <div class="singleFiling fl" v-for="(item,index) in tableData" :key="index" @click="toTargetList(item)">
|
|
|
+ <div class="filingList clearFix">
|
|
|
+ <div class="singleFiling fl"
|
|
|
+ v-for="(item, index) in tableData"
|
|
|
+ :key="index"
|
|
|
+ @click="toTargetList(item)">
|
|
|
<div class="tempImg">
|
|
|
- <img src="../../../assets/fileIcon.png" alt="">
|
|
|
+ <img src="../../../assets/fileIcon.png"
|
|
|
+ alt="">
|
|
|
</div>
|
|
|
- <p>{{item.xjb_bbt}}</p>
|
|
|
+ <p>{{ item.xjb_bbt }}</p>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 新建归档 -->
|
|
|
- <el-dialog title="新建归档" :visible.sync="dialogCreateVisible">
|
|
|
- <el-form :model="creatForm" :rules="GDRules" ref="GDcreatForm">
|
|
|
- <el-form-item label="归档名称" prop="title" :label-width="formLabelWidth">
|
|
|
- <el-input v-model="creatForm.title" autocomplete="off" placeholder="请输入归档名称"></el-input>
|
|
|
+ <el-dialog title="新建归档"
|
|
|
+ :visible.sync="dialogCreateVisible">
|
|
|
+ <el-form :model="creatForm"
|
|
|
+ :rules="GDRules"
|
|
|
+ ref="GDcreatForm">
|
|
|
+ <el-form-item label="归档名称"
|
|
|
+ prop="title"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-input v-model="creatForm.title"
|
|
|
+ autocomplete="off"
|
|
|
+ placeholder="请输入归档名称"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="类型" prop="regionType" :label-width="formLabelWidth">
|
|
|
- <el-select v-model="creatForm.regionType" placeholder="请选择类型">
|
|
|
- <el-option label="普通" value="2"></el-option>
|
|
|
- <el-option label="加急" value="1"></el-option>
|
|
|
+ <el-form-item label="类型"
|
|
|
+ prop="regionType"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-select v-model="creatForm.regionType"
|
|
|
+ placeholder="请选择类型">
|
|
|
+ <el-option label="普通"
|
|
|
+ value="2"></el-option>
|
|
|
+ <el-option label="加急"
|
|
|
+ value="1"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="创建人" prop="regionCreater" :label-width="formLabelWidth">
|
|
|
- <el-select v-model="creatForm.regionCreater" placeholder="请选择创建人">
|
|
|
- <el-option label="李天然" value="李天然"></el-option>
|
|
|
- <el-option label="李风起" value="李风起"></el-option>
|
|
|
+ <el-form-item label="创建人"
|
|
|
+ prop="regionCreater"
|
|
|
+ :label-width="formLabelWidth">
|
|
|
+ <el-select v-model="creatForm.regionCreater" placeholder="请选择创建人" filterable="">
|
|
|
+ <el-option v-for="(item,index) in userList" :key="index" :label="item.label" :value="item.value"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
- <div slot="footer" class="dialog-footer">
|
|
|
+ <div slot="footer"
|
|
|
+ class="dialog-footer">
|
|
|
<el-button @click="dialogCreateVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="onSubmit('GDcreatForm')">确 定</el-button>
|
|
|
+ <el-button type="primary"
|
|
|
+ @click="onSubmit('GDcreatForm')">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -46,110 +66,133 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { queryApi ,addApi,editApi,detailApi,deleteApi } from './apiItem';
|
|
|
-import { useUserStore } from '@/stores/user';
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tableData:[],
|
|
|
- dialogCreateVisible: false,
|
|
|
- creatForm: {
|
|
|
- title: '',
|
|
|
- regionType: '',
|
|
|
- regionCreater:'',
|
|
|
- },
|
|
|
- GDRules: {
|
|
|
- title: [
|
|
|
- { required: true, message: '请输入标题', trigger: 'blur' },
|
|
|
- ],
|
|
|
- regionType: [
|
|
|
- { required: true, message: '请选择类型', trigger: 'change' }
|
|
|
- ],
|
|
|
- regionCreater: [
|
|
|
- { required: true, message: '请选择创建人', trigger: 'change' }
|
|
|
- ]
|
|
|
- },
|
|
|
- formLabelWidth: '80px',
|
|
|
- dialog:{
|
|
|
- title:'添加归档',
|
|
|
- option:'create'
|
|
|
- },
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.initList(1);
|
|
|
- },
|
|
|
- methods: {
|
|
|
- initList(choosePage,keyword){
|
|
|
- queryApi(choosePage,keyword).then(res => {
|
|
|
- this.tableData = res.data.page_data;
|
|
|
- this.paganationsTotal=Number(res.data.total_rows);
|
|
|
- })
|
|
|
+import { queryApi, addApi, editApi, detailApi, deleteApi, org_users } from './apiItem';
|
|
|
+import { useUserStore } from "@/stores/user";
|
|
|
+const { real_name, user_id, dept_ids, uo_id, uo_name, } = useUserStore();
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tableData: [],
|
|
|
+ dialogCreateVisible: false,
|
|
|
+ creatForm: {
|
|
|
+ title: '',
|
|
|
+ regionType: '',
|
|
|
+ regionCreater: '',
|
|
|
},
|
|
|
- /**跳转对应路由*/
|
|
|
- toTargetList(markLable){
|
|
|
- var markText=markLable.xjb_bbt;
|
|
|
- switch(markText){
|
|
|
- case '事业单位报表'://事业单位报表
|
|
|
+ GDRules: {
|
|
|
+ title: [
|
|
|
+ { required: true, message: '请输入标题', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ regionType: [
|
|
|
+ { required: true, message: '请选择类型', trigger: 'change' }
|
|
|
+ ],
|
|
|
+ regionCreater: [
|
|
|
+ { required: true, message: '请选择创建人', trigger: 'change' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ formLabelWidth: '80px',
|
|
|
+ dialog: {
|
|
|
+ title: '添加归档',
|
|
|
+ option: 'create'
|
|
|
+ },
|
|
|
+ userList: '',
|
|
|
+ paganationsTotal: '',
|
|
|
+
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getUserList();
|
|
|
+ this.initList(1);
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initList(choosePage, keyword) {
|
|
|
+ queryApi(choosePage, keyword).then(res => {
|
|
|
+ this.tableData = res.data.page_data;
|
|
|
+ this.paganationsTotal = Number(res.data.total_rows);
|
|
|
+ })
|
|
|
+ },
|
|
|
+ /**跳转对应路由*/
|
|
|
+ toTargetList(markLable) {
|
|
|
+ var markText = markLable.xjb_bbt;
|
|
|
+ switch (markText) {
|
|
|
+ case '事业单位报表'://事业单位报表
|
|
|
this.$router.push("sydwbb");
|
|
|
break;
|
|
|
- case '干部报表'://干部报表
|
|
|
+ case '干部报表'://干部报表
|
|
|
this.$router.push("gbbb");
|
|
|
break;
|
|
|
- case '党员报表'://党员报表
|
|
|
+ case '党员报表'://党员报表
|
|
|
this.$router.push("dybb");
|
|
|
break;
|
|
|
- }
|
|
|
- },
|
|
|
- /**打开dialog*/
|
|
|
- createNew(){
|
|
|
- this.dialogCreateVisible=true;
|
|
|
- },
|
|
|
- /**提交*/
|
|
|
- onSubmit(formName){
|
|
|
- const judgeOption=this.dialog.option;
|
|
|
- this.$refs[formName].validate((valid)=>{
|
|
|
- if (valid) {
|
|
|
- var transParams={
|
|
|
- xjb_bbt:this.creatForm.title,
|
|
|
- xjb_lx:this.creatForm.regionType,
|
|
|
- xjb_cjr:this.creatForm.regionCreater
|
|
|
- }
|
|
|
- if(judgeOption=="create"){//添加按钮
|
|
|
- addApi(transParams)
|
|
|
- .then((res)=>{
|
|
|
- if(res.code=='1'){
|
|
|
- this.dialogCreateVisible=false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /**打开dialog*/
|
|
|
+ createNew() {
|
|
|
+ this.dialogCreateVisible = true;
|
|
|
+ },
|
|
|
+ /**提交*/
|
|
|
+ onSubmit(formName) {
|
|
|
+ const judgeOption = this.dialog.option;
|
|
|
+ this.$refs[formName].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ var transParams = {
|
|
|
+ xjb_bbt: this.creatForm.title,
|
|
|
+ xjb_lx: this.creatForm.regionType,
|
|
|
+ xjb_cjr: this.creatForm.regionCreater
|
|
|
+ }
|
|
|
+ if (judgeOption == "create") {//添加按钮
|
|
|
+ addApi(transParams)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == '1') {
|
|
|
+ this.dialogCreateVisible = false;
|
|
|
this.$message({
|
|
|
- message:"数据添加成功",
|
|
|
- type:'success'
|
|
|
+ message: "数据添加成功",
|
|
|
+ type: 'success'
|
|
|
});
|
|
|
this.initList();
|
|
|
}
|
|
|
});
|
|
|
- }else{//编辑按钮
|
|
|
- var chooseId=Number(this.creatForm.id);
|
|
|
- editApi(chooseId,transParams)
|
|
|
- .then((res)=>{
|
|
|
- if(res.code=="1"){
|
|
|
- this.dialogCreateVisible=false;
|
|
|
+ } else {//编辑按钮
|
|
|
+ var chooseId = Number(this.creatForm.id);
|
|
|
+ editApi(chooseId, transParams)
|
|
|
+ .then((res) => {
|
|
|
+ if (res.code == "1") {
|
|
|
+ this.dialogCreateVisible = false;
|
|
|
this.initList();
|
|
|
}
|
|
|
})
|
|
|
- .catch((error)=>{
|
|
|
+ .catch((error) => {
|
|
|
console.log(error);
|
|
|
})
|
|
|
- }
|
|
|
- }else{
|
|
|
- return false;
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //获取用户数据
|
|
|
+ getUserList() {
|
|
|
+ let data = {
|
|
|
+ dept_id: dept_ids[0],
|
|
|
+ page: 1,
|
|
|
+ limit: 99999
|
|
|
+ }
|
|
|
+ org_users(data).then(res => {
|
|
|
+ if (res.code == 1) {
|
|
|
+ let tempArray = [];
|
|
|
+ res.data.page_data.forEach(item => {
|
|
|
+ tempArray.push({
|
|
|
+ label: item.user_realname,
|
|
|
+ value:item.user_id
|
|
|
+ })
|
|
|
+ });
|
|
|
+ this.userList = tempArray;
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- }
|
|
|
-</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
|
|
|
-</style>
|
|
|
+<style scoped></style>
|