17 files modified
4 files added
| | |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | @click="handleBatchExam" |
| | | |
| | | >生成考试 |
| | | </el-button> |
| | | <!-- v-if="examPersission" --> |
| | |
| | | size="small" |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | @click="handleImport" |
| | | @click="handleImport" |
| | | >清册导入 |
| | | </el-button> |
| | | </template> |
| | |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-receiving" |
| | | v-if="row.candidateNo!=''" |
| | | v-if="row.candidateNo != ''" |
| | | @click="handlePrint(row)" |
| | | >准考证打印 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="age"> |
| | | {{ row.age==-1? '':row.age }} |
| | | {{ row.age == -1 ? "" : row.age }} |
| | | </template> |
| | | </avue-crud> |
| | | |
| | |
| | | @reset-change="emptytChange" |
| | | @submit="submit" |
| | | ></avue-form> |
| | | |
| | | </el-dialog> |
| | | |
| | | <el-dialog |
| | | title="清册数据导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | title="清册数据导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog |
| | | title="考试生成" |
| | | append-to-body |
| | | :visible.sync="dialogExamFormVisible" |
| | | width="900px" |
| | | @close='closeDialog' |
| | | @close="closeDialog" |
| | | > |
| | | <avue-form |
| | | ref="formExamApply" |
| | |
| | | addApply, |
| | | cancelApply, |
| | | remove, |
| | | addExam |
| | | addExam, |
| | | } from "@/api/examapi/applyexam"; |
| | | import { mapState } from "vuex"; |
| | | |
| | |
| | | return { |
| | | dialogFormVisible: false, |
| | | dialogExamFormVisible: false, |
| | | examPersission:false, |
| | | applyExport:false, |
| | | excelBox:false, |
| | | examPersission: false, |
| | | applyExport: false, |
| | | excelBox: false, |
| | | Audit: {}, |
| | | excelForm: {}, |
| | | excelOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "模板上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | label: "模板上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/apply/import-apply", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/apply/import-apply", |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | ], |
| | | }, |
| | | optionAudit: { |
| | | height: "auto", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | { |
| | | label: "年龄", |
| | | prop: "age", |
| | | slot:true, |
| | | slot: true, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | |
| | | editDisplay: false, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | viewDisplay: true |
| | | viewDisplay: true, |
| | | }, |
| | | // { |
| | | // label: "考试名称", |
| | |
| | | // editDetail: false, |
| | | // width: 150, |
| | | // }, |
| | | |
| | | |
| | | { |
| | | label: "审查状态", |
| | | prop: "examinationType", |
| | | slot: true, |
| | | searchSpan:5, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | | addDisplay: false, |
| | | // 表单新增时是否为查看模式 |
| | | addDetail: false, |
| | | // 表单编辑时是否禁止 |
| | | editDisabled: false, |
| | | // 表单编辑时是否可见 |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | dicData:[ |
| | | { |
| | | label: '正常', |
| | | value: "1" |
| | | }, |
| | | { |
| | | label: '异常', |
| | | value: "2" |
| | | } |
| | | ], |
| | | search:true, |
| | | type:"select" |
| | | label: "审查状态", |
| | | prop: "examinationType", |
| | | slot: true, |
| | | searchSpan: 5, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | | addDisplay: false, |
| | | // 表单新增时是否为查看模式 |
| | | addDetail: false, |
| | | // 表单编辑时是否禁止 |
| | | editDisabled: false, |
| | | // 表单编辑时是否可见 |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | dicData: [ |
| | | { |
| | | label: "正常", |
| | | value: "1", |
| | | }, |
| | | { |
| | | label: "异常", |
| | | value: "2", |
| | | }, |
| | | ], |
| | | search: true, |
| | | type: "select", |
| | | }, |
| | | { |
| | | label: "审查明细", |
| | |
| | | editDisplay: true, |
| | | // 表单编辑时是否为查看模式 |
| | | editDetail: false, |
| | | overHidden:true, |
| | | width:150, |
| | | overHidden: true, |
| | | width: 150, |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | console.log(this.userInfo); |
| | | |
| | | if (this.userInfo.role_name.indexOf("ksxtadmin") != -1) { |
| | | this.examPersission = true; |
| | | this.examPersission = true; |
| | | } |
| | | }, |
| | | mounted() {}, |
| | |
| | | }, |
| | | |
| | | //生成考试弹窗 |
| | | handleBatchExam(){ |
| | | handleBatchExam() { |
| | | this.dialogExamFormVisible = true; |
| | | if (this.questionBankSelectionList.length === 0) { |
| | | this.ids = ""; |
| | | } |
| | | }, |
| | | //生成考试 |
| | | submitExamApply(row, done, loading){ |
| | | submitExamApply(row, done, loading) { |
| | | var that = this; |
| | | var startTime = row.startTime+":00"; |
| | | var startTime = row.startTime + ":00"; |
| | | // var endTime = row.examTime[1]; |
| | | // var examTime = JSON.stringify(row.examTime); |
| | | // console.log(this.ids,111); |
| | |
| | | ); |
| | | }, |
| | | //关闭窗口清除数据 |
| | | closeDialog(){ |
| | | closeDialog() { |
| | | this.$refs.formExamApply.resetFields(); |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | handleTemplate() { |
| | | window.open( |
| | | `/api/apply/export-template` |
| | | ); |
| | | window.open(`/api/apply/export-template`); |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | |
| | | refreshChange() { |
| | | this.questionBankOnLoad(this.page, this.query); |
| | | this.questionBankOnLoad(this.page, this.query); |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | append-to-body |
| | | :visible.sync="dialogBatchFormVisible" |
| | | width="1000px" |
| | | @close='closeDialog' |
| | | @close="closeDialog" |
| | | > |
| | | <avue-form |
| | | ref="formBatchApply" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { addApply, cancelApplyNotApplyId, remove } from "@/api/examapi/applyexam"; |
| | | import { getListApply,addBatchApply } from "@/api/securityGuard/securityGuard"; |
| | | import { |
| | | addApply, |
| | | cancelApplyNotApplyId, |
| | | remove, |
| | | } from "@/api/examapi/applyexam"; |
| | | import { getListApply, addBatchApply } from "@/api/securityGuard/securityGuard"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | var DIC = { |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: false, |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | value: "id", |
| | | }, |
| | | //不包含父节点值 |
| | | leafOnly:true, |
| | | leafOnly: true, |
| | | multiple: true, |
| | | searchSpan: 5, |
| | | rules: [ |
| | |
| | | // } |
| | | |
| | | this.optionBatchApply.column[0].dicUrl = |
| | | "/api/blade-user/security-apply-tree?deptId=" + |
| | | this.userInfo.dept_id; |
| | | "/api/blade-user/security-apply-tree?deptId=" + this.userInfo.dept_id; |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | mounted() {}, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: (state) => state.user.userInfo, |
| | |
| | | }) |
| | | .then(() => { |
| | | row.applyStatus = 4; |
| | | row['userId'] = row.id; |
| | | row["userId"] = row.id; |
| | | return cancelApplyNotApplyId(row); |
| | | }) |
| | | .then(() => { |
| | |
| | | handleBatchApply() { |
| | | // this.dialogBatchFormVisible = true; |
| | | if (this.questionBankSelectionList.length === 0) { |
| | | this.$confirm("确定全部人员报名?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | var userIds = ""; |
| | | addBatchApply(userIds,this.userInfo.dept_id).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | this.$confirm("确定全部人员报名?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | var userIds = ""; |
| | | addBatchApply(userIds, this.userInfo.dept_id).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | ); |
| | | }) |
| | | }else{ |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }); |
| | | } else { |
| | | this.$confirm("确定选择人员报名?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | addBatchApply(this.ids,this.userInfo.dept_id).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }).then(() => { |
| | | addBatchApply(this.ids, this.userInfo.dept_id).then( |
| | | (res) => { |
| | | this.questionBankOnLoad(this.questionBankPage); |
| | | if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "已报名,不能重复报名", |
| | | }); |
| | | } else if (res.data.data == 201) { |
| | | this.$message({ |
| | | type: "warning", |
| | | message: "报名失败", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | type: "success", |
| | | message: "报名成功", |
| | | }); |
| | | this.$refs.formBatchApply.resetFields(); |
| | | this.dialogBatchFormVisible = false; |
| | | } |
| | | ); |
| | | }) |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | } |
| | | ); |
| | | }); |
| | | } |
| | | }, |
| | | |
| | |
| | | // }, |
| | | |
| | | //关闭窗口清除数据 |
| | | closeDialog(){ |
| | | this.$refs.formBatchApply.resetFields(); |
| | | closeDialog() { |
| | | this.$refs.formBatchApply.resetFields(); |
| | | }, |
| | | |
| | | questionBankHandleDelete() { |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | excelBtn: false, |
| | | addBtnText:"发布", |
| | | addTitle:"发布", |
| | | saveBtnText:'发布', |
| | | addBtnText: "发布", |
| | | addTitle: "发布", |
| | | saveBtnText: "发布", |
| | | menuWidth: 320, |
| | | dialogClickModal: false, |
| | | column: [ |
| | |
| | | path: `/resource/uploadNotice`, |
| | | query: { |
| | | deptId: row.deptId, |
| | | noticeId:row.id, |
| | | noticeId: row.id, |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | <template> |
| | | <el-dialog |
| | | :title="this.id?'修改':'新增'" |
| | | width="60%" |
| | | modal-append-to-body='false' |
| | | append-to-body='true' |
| | | :close-on-click-model="true" |
| | | :visible.sync="visible" |
| | | @close='closeDialog' |
| | | <el-dialog |
| | | :title="this.id ? '修改' : '新增'" |
| | | width="60%" |
| | | modal-append-to-body="false" |
| | | append-to-body="true" |
| | | :close-on-click-model="true" |
| | | :visible.sync="visible" |
| | | @close="closeDialog" |
| | | > |
| | | <el-row style="margin-left: 60px; margin-bottom: 40px"> |
| | | <el-radio-group v-model="choicesType"> |
| | | <el-radio label="0">单选题</el-radio> |
| | | <el-radio label="1">多选题</el-radio> |
| | | <el-radio label="2">判断题</el-radio> |
| | | <el-radio label="3">实操题</el-radio> |
| | | </el-radio-group> |
| | | </el-row> |
| | | <avue-form |
| | | ref="form" |
| | | :option="option" |
| | | v-model="form" |
| | | @submit="submit" |
| | | v-if="choicesType == '0'" |
| | | ></avue-form> |
| | | <avue-form |
| | | ref="formCheckbox" |
| | | :option="optionCheckbox" |
| | | v-model="formCheckbox" |
| | | @submit="submitCheckbox" |
| | | v-if="choicesType == '1'" |
| | | ></avue-form> |
| | | <avue-form |
| | | ref="formJudge" |
| | | :option="optionJudge" |
| | | v-model="formJudge" |
| | | @submit="submitJudge" |
| | | v-if="choicesType == '2'" |
| | | ></avue-form> |
| | | <avue-form |
| | | ref="formFill" |
| | | :option="optionFill" |
| | | v-model="formFill" |
| | | @submit="submitFill" |
| | | v-if="choicesType == '3'" |
| | | > |
| | | <el-row style="margin-left:60px;margin-bottom:40px"> |
| | | <el-radio-group v-model="choicesType"> |
| | | <el-radio label="0">单选题</el-radio> |
| | | <el-radio label="1">多选题</el-radio> |
| | | <el-radio label="2">判断题</el-radio> |
| | | <el-radio label="3">实操题</el-radio> |
| | | </el-radio-group> |
| | | </el-row> |
| | | <avue-form ref="form" :option="option" v-model="form" @submit="submit" v-if="choicesType=='0'"></avue-form> |
| | | <avue-form ref="formCheckbox" :option="optionCheckbox" v-model="formCheckbox" @submit="submitCheckbox" v-if="choicesType=='1'"></avue-form> |
| | | <avue-form ref="formJudge" :option="optionJudge" v-model="formJudge" @submit="submitJudge" v-if="choicesType=='2'"></avue-form> |
| | | <avue-form ref="formFill" :option="optionFill" v-model="formFill" @submit="submitFill" v-if="choicesType=='3'"> |
| | | <template slot="optionContent"> |
| | | <!-- <el-button type="success" icon="el-icon-plus" circle style="margin-bottom:20px" @click="addRows"></el-button> |
| | | <template slot="optionContent"> |
| | | <!-- <el-button type="success" icon="el-icon-plus" circle style="margin-bottom:20px" @click="addRows"></el-button> |
| | | <div v-for="(item,index) in list" :key="index"> |
| | | <div class="optionContent-suffix"> |
| | | <span>{{index+1}}: </span> |
| | |
| | | <el-button type="danger" class="optionContent-botton" icon="el-icon-delete" circle @click="deleteRows(index)"></el-button> |
| | | </div> |
| | | </div> --> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | import {saveSubjectChoicesAndOption} from "@/api/examapi/examSubjects"; |
| | | import {getSubjectAnswer} from "@/api/exam/subject"; |
| | | import { mapState } from "vuex"; |
| | | import { saveSubjectChoicesAndOption } from "@/api/examapi/examSubjects"; |
| | | import { getSubjectAnswer } from "@/api/exam/subject"; |
| | | |
| | | export default { |
| | | name: "add", |
| | | data() { |
| | | return { |
| | | inputs:{ |
| | | inputs: { |
| | | input1: 1, |
| | | }, |
| | | optionContentAId:null, |
| | | optionContentBId:null, |
| | | optionContentCId:null, |
| | | optionContentDId:null, |
| | | arrContent:["1"], |
| | | list:[ |
| | | optionContentAId: null, |
| | | optionContentBId: null, |
| | | optionContentCId: null, |
| | | optionContentDId: null, |
| | | arrContent: ["1"], |
| | | list: [ |
| | | { |
| | | data:1 |
| | | data: 1, |
| | | }, |
| | | { |
| | | data:1 |
| | | data: 1, |
| | | }, |
| | | { |
| | | data:1 |
| | | data: 1, |
| | | }, |
| | | ], |
| | | // index:1, |
| | | visible:false, |
| | | choicesType:"0", |
| | | visible: false, |
| | | choicesType: "0", |
| | | loading: true, |
| | | form:{ |
| | | score:1 |
| | | form: { |
| | | score: 1, |
| | | }, |
| | | option: { |
| | | height: "auto", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | align: "center", |
| | | index: true, |
| | |
| | | label: "题目名称", |
| | | prop: "subjectName", |
| | | search: true, |
| | | type:"textarea", |
| | | type: "textarea", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "类型", |
| | |
| | | type: "checkbox", |
| | | dicData: [ |
| | | { |
| | | label: '简易题库', |
| | | value: 'A' |
| | | }, |
| | | label: "简易题库", |
| | | value: "A", |
| | | }, |
| | | { |
| | | label: '复杂题库', |
| | | value: 'B' |
| | | }, |
| | | label: "复杂题库", |
| | | value: "B", |
| | | }, |
| | | { |
| | | label: '模拟题库', |
| | | value: 'C' |
| | | } |
| | | label: "模拟题库", |
| | | value: "C", |
| | | }, |
| | | ], |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "选项", |
| | | prop: "", |
| | | type:"text", |
| | | span:24 |
| | | type: "text", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "A", |
| | | prop: "optionContentA", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "B", |
| | | prop: "optionContentB", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "C", |
| | | prop: "optionContentC", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "D", |
| | | prop: "optionContentD", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | type: "radio", |
| | | dicData: [ |
| | | { |
| | | label: 'A', |
| | | value: 'A' |
| | | }, |
| | | label: "A", |
| | | value: "A", |
| | | }, |
| | | { |
| | | label: 'B', |
| | | value: 'B' |
| | | }, |
| | | label: "B", |
| | | value: "B", |
| | | }, |
| | | { |
| | | label: 'C', |
| | | value: 'C' |
| | | }, |
| | | label: "C", |
| | | value: "C", |
| | | }, |
| | | { |
| | | label: 'D', |
| | | value: 'D' |
| | | } |
| | | label: "D", |
| | | value: "D", |
| | | }, |
| | | ], |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | label: "解析", |
| | | prop: "analysis", |
| | | span:24, |
| | | type:"textarea" |
| | | span: 24, |
| | | type: "textarea", |
| | | }, |
| | | { |
| | | label: "分值", |
| | | prop: "score", |
| | | span:24, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | ], |
| | | |
| | | }, |
| | | formCheckbox:{ |
| | | score:1 |
| | | formCheckbox: { |
| | | score: 1, |
| | | }, |
| | | optionCheckbox: { |
| | | height: "auto", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | align: "center", |
| | | index: true, |
| | |
| | | defaultExpandAll: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | { |
| | | label: "题目名称", |
| | | prop: "subjectName", |
| | | search: true, |
| | | type:"textarea", |
| | | type: "textarea", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "类型", |
| | |
| | | type: "checkbox", |
| | | dicData: [ |
| | | { |
| | | label: '简易题库', |
| | | value: 'A' |
| | | }, |
| | | label: "简易题库", |
| | | value: "A", |
| | | }, |
| | | { |
| | | label: '复杂题库', |
| | | value: 'B' |
| | | }, |
| | | label: "复杂题库", |
| | | value: "B", |
| | | }, |
| | | { |
| | | label: '模拟题库', |
| | | value: 'C' |
| | | } |
| | | label: "模拟题库", |
| | | value: "C", |
| | | }, |
| | | ], |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "选项", |
| | | prop: "", |
| | | type:"text", |
| | | span:24 |
| | | type: "text", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "A", |
| | | prop: "optionContentA", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "B", |
| | | prop: "optionContentB", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "C", |
| | | prop: "optionContentC", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "D", |
| | | prop: "optionContentD", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | // type: "radio", |
| | | dicData: [ |
| | | { |
| | | label: 'A', |
| | | value: 'A' |
| | | }, |
| | | label: "A", |
| | | value: "A", |
| | | }, |
| | | { |
| | | label: 'B', |
| | | value: 'B' |
| | | }, |
| | | label: "B", |
| | | value: "B", |
| | | }, |
| | | { |
| | | label: 'C', |
| | | value: 'C' |
| | | }, |
| | | label: "C", |
| | | value: "C", |
| | | }, |
| | | { |
| | | label: 'D', |
| | | value: 'D' |
| | | } |
| | | label: "D", |
| | | value: "D", |
| | | }, |
| | | ], |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | label: "解析", |
| | | prop: "analysis", |
| | | span:24, |
| | | type:"textarea" |
| | | span: 24, |
| | | type: "textarea", |
| | | }, |
| | | { |
| | | label: "分值", |
| | | prop: "score", |
| | | span:24, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | ], |
| | | |
| | | }, |
| | | formJudge:{ |
| | | score:1 |
| | | formJudge: { |
| | | score: 1, |
| | | }, |
| | | optionJudge: { |
| | | height: "auto", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | align: "center", |
| | | index: true, |
| | |
| | | label: "题目名称", |
| | | prop: "subjectName", |
| | | search: true, |
| | | type:"textarea", |
| | | type: "textarea", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "类型", |
| | |
| | | type: "checkbox", |
| | | dicData: [ |
| | | { |
| | | label: '简易题库', |
| | | value: 'A' |
| | | }, |
| | | label: "简易题库", |
| | | value: "A", |
| | | }, |
| | | { |
| | | label: '复杂题库', |
| | | value: 'B' |
| | | }, |
| | | label: "复杂题库", |
| | | value: "B", |
| | | }, |
| | | { |
| | | label: '模拟题库', |
| | | value: 'C' |
| | | } |
| | | label: "模拟题库", |
| | | value: "C", |
| | | }, |
| | | ], |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | // { |
| | | // label: "选项", |
| | |
| | | type: "radio", |
| | | dicData: [ |
| | | { |
| | | label: '正确', |
| | | value: '正确' |
| | | }, |
| | | label: "正确", |
| | | value: "正确", |
| | | }, |
| | | { |
| | | label: '错误', |
| | | value: '错误' |
| | | } |
| | | label: "错误", |
| | | value: "错误", |
| | | }, |
| | | ], |
| | | mock:{ |
| | | type:'dic', |
| | | mock: { |
| | | type: "dic", |
| | | }, |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | label: "解析", |
| | | prop: "analysis", |
| | | span:24, |
| | | type:"textarea" |
| | | span: 24, |
| | | type: "textarea", |
| | | }, |
| | | { |
| | | label: "分值", |
| | | prop: "score", |
| | | defaultValue:2, |
| | | span:24, |
| | | defaultValue: 2, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | ], |
| | | |
| | | }, |
| | | formFill:{ |
| | | score:1 |
| | | formFill: { |
| | | score: 1, |
| | | }, |
| | | optionFill: { |
| | | height: "auto", |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | align: "center", |
| | | index: true, |
| | |
| | | { |
| | | label: "题目名称", |
| | | prop: "subjectName", |
| | | type:"textarea", |
| | | type: "textarea", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "类型", |
| | |
| | | type: "checkbox", |
| | | dicData: [ |
| | | { |
| | | label: '简易题库', |
| | | value: 'A' |
| | | }, |
| | | label: "简易题库", |
| | | value: "A", |
| | | }, |
| | | { |
| | | label: '复杂题库', |
| | | value: 'B' |
| | | }, |
| | | label: "复杂题库", |
| | | value: "B", |
| | | }, |
| | | { |
| | | label: '模拟题库', |
| | | value: 'C' |
| | | } |
| | | label: "模拟题库", |
| | | value: "C", |
| | | }, |
| | | ], |
| | | rules: [ |
| | | { |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | span:24 |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "选项", |
| | | prop: "", |
| | | type:"text", |
| | | span:24 |
| | | type: "text", |
| | | span: 24, |
| | | }, |
| | | { |
| | | label: "1", |
| | | prop: "optionContent1", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "2", |
| | | prop: "optionContent2", |
| | | span:24, |
| | | placeholder:"请输入内容", |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | label: "3", |
| | | prop: "optionContent3", |
| | | span:24, |
| | | placeholder:"请输入内容" |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | }, |
| | | { |
| | | label: "4", |
| | | prop: "optionContent4", |
| | | span:24, |
| | | placeholder:"请输入内容" |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | }, |
| | | { |
| | | label: "5", |
| | | prop: "optionContent5", |
| | | span:24, |
| | | placeholder:"请输入内容" |
| | | span: 24, |
| | | placeholder: "请输入内容", |
| | | }, |
| | | { |
| | | label: "答案", |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }, |
| | | { |
| | | label: "解析", |
| | | prop: "analysis", |
| | | span:24, |
| | | type:"textarea" |
| | | span: 24, |
| | | type: "textarea", |
| | | }, |
| | | { |
| | | label: "分值", |
| | | prop: "score", |
| | | span:24, |
| | | span: 24, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | } |
| | | |
| | | }, |
| | | ], |
| | | |
| | | }, |
| | | data: [], |
| | | } |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState({ |
| | | userInfo: state => state.user.userInfo |
| | | }) |
| | | userInfo: (state) => state.user.userInfo, |
| | | }), |
| | | }, |
| | | mounted() { |
| | | |
| | | }, |
| | | mounted() {}, |
| | | methods: { |
| | | //初始化 |
| | | inits(id) { |
| | | this.id = id || 0; |
| | | this.visible = true; |
| | | this.list = [{data:1}] |
| | | if(this.id){ |
| | | this.list = [{ data: 1 }]; |
| | | if (this.id) { |
| | | //查询题目信息 |
| | | this.getSubjectInfo(id); |
| | | } |
| | | }, |
| | | //查询题目信息 |
| | | getSubjectInfo(id){ |
| | | getSubjectInfo(id) { |
| | | var that = this; |
| | | var param = { |
| | | id:id |
| | | } |
| | | getSubjectAnswer((param)).then(res => { |
| | | id: id, |
| | | }; |
| | | getSubjectAnswer(param).then((res) => { |
| | | var data = res.data.data; |
| | | that.choicesType = data.choicesType.toString(); |
| | | //单选题 |
| | | if(data.choicesType==0){ |
| | | that.form = data; |
| | | that.optionContentAId = data.examSubjectOptions[0].id; |
| | | that.optionContentBId = data.examSubjectOptions[1].id; |
| | | that.optionContentCId = data.examSubjectOptions[2].id; |
| | | that.optionContentDId = data.examSubjectOptions[3].id; |
| | | that.form.optionContentA = data.examSubjectOptions[0].optionContent; |
| | | that.form.optionContentB = data.examSubjectOptions[1].optionContent; |
| | | that.form.optionContentC = data.examSubjectOptions[2].optionContent; |
| | | that.form.optionContentD = data.examSubjectOptions[3].optionContent; |
| | | if (data.choicesType == 0) { |
| | | that.form = data; |
| | | that.optionContentAId = data.examSubjectOptions[0].id; |
| | | that.optionContentBId = data.examSubjectOptions[1].id; |
| | | that.optionContentCId = data.examSubjectOptions[2].id; |
| | | that.optionContentDId = data.examSubjectOptions[3].id; |
| | | that.form.optionContentA = data.examSubjectOptions[0].optionContent; |
| | | that.form.optionContentB = data.examSubjectOptions[1].optionContent; |
| | | that.form.optionContentC = data.examSubjectOptions[2].optionContent; |
| | | that.form.optionContentD = data.examSubjectOptions[3].optionContent; |
| | | } |
| | | //多选题 |
| | | if(data.choicesType==1){ |
| | | that.formCheckbox = data; |
| | | that.optionContentAId = data.examSubjectOptions[0].id; |
| | | that.optionContentBId = data.examSubjectOptions[1].id; |
| | | that.optionContentCId = data.examSubjectOptions[2].id; |
| | | that.optionContentDId = data.examSubjectOptions[3].id; |
| | | that.formCheckbox.optionContentA = data.examSubjectOptions[0].optionContent; |
| | | that.formCheckbox.optionContentB = data.examSubjectOptions[1].optionContent; |
| | | that.formCheckbox.optionContentC = data.examSubjectOptions[2].optionContent; |
| | | that.formCheckbox.optionContentD = data.examSubjectOptions[3].optionContent; |
| | | if (data.choicesType == 1) { |
| | | that.formCheckbox = data; |
| | | that.optionContentAId = data.examSubjectOptions[0].id; |
| | | that.optionContentBId = data.examSubjectOptions[1].id; |
| | | that.optionContentCId = data.examSubjectOptions[2].id; |
| | | that.optionContentDId = data.examSubjectOptions[3].id; |
| | | that.formCheckbox.optionContentA = |
| | | data.examSubjectOptions[0].optionContent; |
| | | that.formCheckbox.optionContentB = |
| | | data.examSubjectOptions[1].optionContent; |
| | | that.formCheckbox.optionContentC = |
| | | data.examSubjectOptions[2].optionContent; |
| | | that.formCheckbox.optionContentD = |
| | | data.examSubjectOptions[3].optionContent; |
| | | } |
| | | //判断题 |
| | | if(data.choicesType==2){ |
| | | that.formJudge = data; |
| | | if (data.choicesType == 2) { |
| | | that.formJudge = data; |
| | | } |
| | | //实操题 |
| | | if(data.choicesType==3){ |
| | | that.formFill = data; |
| | | that.formFill.optionContent1 = data.examSubjectOptions[0].optionContent; |
| | | that.formFill.optionContent2 = data.examSubjectOptions[1].optionContent; |
| | | that.formFill.optionContent3 = data.examSubjectOptions[2].optionContent; |
| | | that.formFill.optionContent4 = data.examSubjectOptions[3].optionContent; |
| | | that.formFill.optionContent5 = data.examSubjectOptions[4].optionContent; |
| | | if (data.choicesType == 3) { |
| | | that.formFill = data; |
| | | that.formFill.optionContent1 = |
| | | data.examSubjectOptions[0].optionContent; |
| | | that.formFill.optionContent2 = |
| | | data.examSubjectOptions[1].optionContent; |
| | | that.formFill.optionContent3 = |
| | | data.examSubjectOptions[2].optionContent; |
| | | that.formFill.optionContent4 = |
| | | data.examSubjectOptions[3].optionContent; |
| | | that.formFill.optionContent5 = |
| | | data.examSubjectOptions[4].optionContent; |
| | | } |
| | | }); |
| | | }, |
| | | //加一行 |
| | | addRows(){ |
| | | addRows() { |
| | | //获取已有行的数据 |
| | | // debugger; |
| | | if(this.index==6){ |
| | | if (this.index == 6) { |
| | | return; |
| | | } |
| | | this.index++; |
| | | this.list.push({ |
| | | data:this.index |
| | | }) |
| | | this.inputs[`input${this.index+1}`] = ''; |
| | | console.log(this.inputs) |
| | | console.log(this.list,111); |
| | | data: this.index, |
| | | }); |
| | | this.inputs[`input${this.index + 1}`] = ""; |
| | | console.log(this.inputs); |
| | | console.log(this.list, 111); |
| | | }, |
| | | //减一行 |
| | | deleteRows(index){ |
| | | if(this.index==1){ |
| | | deleteRows(index) { |
| | | if (this.index == 1) { |
| | | return; |
| | | } |
| | | this.index--; |
| | | this.list.splice(index,1); |
| | | this.list.splice(index, 1); |
| | | }, |
| | | //单选题提交(新增)数据 |
| | | submit(row, done, loading) { |
| | | var that = this; |
| | | row['choicesType'] = this.choicesType; |
| | | row['creator'] = this.userInfo.user_name; |
| | | row["choicesType"] = this.choicesType; |
| | | row["creator"] = this.userInfo.user_name; |
| | | row.tktype = row.tktype.join(","); |
| | | //选项信息 |
| | | const examSubjectOptions = [ |
| | | { |
| | | id:that.optionContentAId, |
| | | optionName:"A", |
| | | optionContent:row.optionContentA, |
| | | creator:this.userInfo.user_name, |
| | | id: that.optionContentAId, |
| | | optionName: "A", |
| | | optionContent: row.optionContentA, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | { |
| | | id:that.optionContentBId, |
| | | optionName:"B", |
| | | optionContent:row.optionContentB, |
| | | creator:this.userInfo.user_name, |
| | | id: that.optionContentBId, |
| | | optionName: "B", |
| | | optionContent: row.optionContentB, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | { |
| | | id:that.optionContentCId, |
| | | optionName:"C", |
| | | optionContent:row.optionContentC, |
| | | creator:this.userInfo.user_name, |
| | | id: that.optionContentCId, |
| | | optionName: "C", |
| | | optionContent: row.optionContentC, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | { |
| | | id:that.optionContentDId, |
| | | optionName:"D", |
| | | optionContent:row.optionContentD, |
| | | creator:this.userInfo.user_name, |
| | | } |
| | | ] |
| | | row['examSubjectOptions'] = examSubjectOptions; |
| | | id: that.optionContentDId, |
| | | optionName: "D", |
| | | optionContent: row.optionContentD, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | ]; |
| | | row["examSubjectOptions"] = examSubjectOptions; |
| | | saveSubjectChoicesAndOption(row).then( |
| | | () => { |
| | | this.$message({ |
| | |
| | | //多选题提交(新增)数据 |
| | | submitCheckbox(row, done, loading) { |
| | | var that = this; |
| | | row['choicesType'] = this.choicesType; |
| | | row['creator'] = this.userInfo.user_name; |
| | | row["choicesType"] = this.choicesType; |
| | | row["creator"] = this.userInfo.user_name; |
| | | row.tktype = row.tktype.join(","); |
| | | row.answer = row.answer.join(","); |
| | | //选项信息 |
| | | const examSubjectOptions = [ |
| | | { |
| | | id:that.optionContentAId, |
| | | optionName:"A", |
| | | optionContent:row.optionContentA, |
| | | creator:this.userInfo.user_name, |
| | | id: that.optionContentAId, |
| | | optionName: "A", |
| | | optionContent: row.optionContentA, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | { |
| | | id:that.optionContentBId, |
| | | optionName:"B", |
| | | optionContent:row.optionContentB, |
| | | creator:this.userInfo.user_name, |
| | | id: that.optionContentBId, |
| | | optionName: "B", |
| | | optionContent: row.optionContentB, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | { |
| | | id:that.optionContentCId, |
| | | optionName:"C", |
| | | optionContent:row.optionContentC, |
| | | creator:this.userInfo.user_name, |
| | | id: that.optionContentCId, |
| | | optionName: "C", |
| | | optionContent: row.optionContentC, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | { |
| | | id:that.optionContentDId, |
| | | optionName:"D", |
| | | optionContent:row.optionContentD, |
| | | creator:this.userInfo.user_name, |
| | | } |
| | | ] |
| | | row['examSubjectOptions'] = examSubjectOptions; |
| | | id: that.optionContentDId, |
| | | optionName: "D", |
| | | optionContent: row.optionContentD, |
| | | creator: this.userInfo.user_name, |
| | | }, |
| | | ]; |
| | | row["examSubjectOptions"] = examSubjectOptions; |
| | | saveSubjectChoicesAndOption(row).then( |
| | | () => { |
| | | this.$message({ |
| | |
| | | //判断题提交(新增)数据 |
| | | submitJudge(row, done, loading) { |
| | | var that = this; |
| | | row['choicesType'] = this.choicesType; |
| | | row['creator'] = this.userInfo.user_name; |
| | | row["choicesType"] = this.choicesType; |
| | | row["creator"] = this.userInfo.user_name; |
| | | row.tktype = row.tktype.join(","); |
| | | saveSubjectChoicesAndOption(row).then( |
| | | () => { |
| | |
| | | //填空排序题提交(新增)数据 |
| | | submitFill(row, done, loading) { |
| | | var that = this; |
| | | row['choicesType'] = this.choicesType; |
| | | row['creator'] = this.userInfo.user_name; |
| | | row["choicesType"] = this.choicesType; |
| | | row["creator"] = this.userInfo.user_name; |
| | | row.tktype = row.tktype.join(","); |
| | | //选项信息 |
| | | var examSubjectOptions = []; |
| | | if(row.optionContent1){ |
| | | examSubjectOptions.push({ |
| | | optionName:"1", |
| | | optionContent:row.optionContent1, |
| | | creator:this.userInfo.user_name, |
| | | }) |
| | | if (row.optionContent1) { |
| | | examSubjectOptions.push({ |
| | | optionName: "1", |
| | | optionContent: row.optionContent1, |
| | | creator: this.userInfo.user_name, |
| | | }); |
| | | } |
| | | if(row.optionContent2){ |
| | | examSubjectOptions.push({ |
| | | optionName:"2", |
| | | optionContent:row.optionContent2, |
| | | creator:this.userInfo.user_name, |
| | | }) |
| | | if (row.optionContent2) { |
| | | examSubjectOptions.push({ |
| | | optionName: "2", |
| | | optionContent: row.optionContent2, |
| | | creator: this.userInfo.user_name, |
| | | }); |
| | | } |
| | | if(row.optionContent3){ |
| | | examSubjectOptions.push({ |
| | | optionName:"3", |
| | | optionContent:row.optionContent3, |
| | | creator:this.userInfo.user_name, |
| | | }) |
| | | if (row.optionContent3) { |
| | | examSubjectOptions.push({ |
| | | optionName: "3", |
| | | optionContent: row.optionContent3, |
| | | creator: this.userInfo.user_name, |
| | | }); |
| | | } |
| | | if(row.optionContent4){ |
| | | examSubjectOptions.push({ |
| | | optionName:"4", |
| | | optionContent:row.optionContent4, |
| | | creator:this.userInfo.user_name, |
| | | }) |
| | | if (row.optionContent4) { |
| | | examSubjectOptions.push({ |
| | | optionName: "4", |
| | | optionContent: row.optionContent4, |
| | | creator: this.userInfo.user_name, |
| | | }); |
| | | } |
| | | if(row.optionContent5){ |
| | | examSubjectOptions.push({ |
| | | optionName:"5", |
| | | optionContent:row.optionContent5, |
| | | creator:this.userInfo.user_name, |
| | | }) |
| | | if (row.optionContent5) { |
| | | examSubjectOptions.push({ |
| | | optionName: "5", |
| | | optionContent: row.optionContent5, |
| | | creator: this.userInfo.user_name, |
| | | }); |
| | | } |
| | | row['examSubjectOptions'] = examSubjectOptions; |
| | | row["examSubjectOptions"] = examSubjectOptions; |
| | | saveSubjectChoicesAndOption(row).then( |
| | | () => { |
| | | this.$message({ |
| | |
| | | ); |
| | | }, |
| | | //关闭窗口清除数据 |
| | | closeDialog(){ |
| | | if(this.choicesType==0){ |
| | | this.$refs.form.resetFields(); |
| | | closeDialog() { |
| | | if (this.choicesType == 0) { |
| | | this.$refs.form.resetFields(); |
| | | } |
| | | |
| | | if(this.choicesType==1){ |
| | | |
| | | if (this.choicesType == 1) { |
| | | this.$refs.formCheckbox.resetFields(); |
| | | } |
| | | |
| | | if(this.choicesType==2){ |
| | | if (this.choicesType == 2) { |
| | | this.$refs.formJudge.resetFields(); |
| | | } |
| | | |
| | | if(this.choicesType==3){ |
| | | if (this.choicesType == 3) { |
| | | this.$refs.formFill.resetFields(); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style scoped> |
| | | |
| | | .optionContent-suffix{ |
| | | .optionContent-suffix { |
| | | margin-top: 5px; |
| | | } |
| | | |
| | | .optionContent-suffix span{ |
| | | .optionContent-suffix span { |
| | | margin-left: -20px; |
| | | } |
| | | |
| | | |
| | | .optionContent-suffix .optionContent-input{ |
| | | .optionContent-suffix .optionContent-input { |
| | | width: 90%; |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | |
| | | .optionContent-suffix .optionContent-botton{ |
| | | .optionContent-suffix .optionContent-botton { |
| | | margin-left: 10px; |
| | | } |
| | | |
| | | </style> |
| | |
| | | height: "auto", |
| | | widtd: "auto", |
| | | calcHeight: 54, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | tip: false, |
| | | index: true, |
| | |
| | | height: "auto", |
| | | widtd: "auto", |
| | | calcHeight: 54, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | tip: false, |
| | | index: true, |
| | |
| | | <template> |
| | | <basic-container class="hasButTwo"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)">下载222 |
| | | </el-button> |
| | | <el-button type="text" |
| | | icon="el-icon-picture-outline-round" |
| | | size="small" |
| | | v-show="!fileFormat(scope.row)" |
| | | @click="seeImages(scope.row)">预览 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" |
| | | slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px"> |
| | | <avue-form ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter"> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <basic-container class="hasButTwo"> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload" |
| | | >上 传 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)" |
| | | >下载222 |
| | | </el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-picture-outline-round" |
| | | size="small" |
| | | v-show="!fileFormat(scope.row)" |
| | | @click="seeImages(scope.row)" |
| | | >预览 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog |
| | | title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="预览" |
| | | append-to-body |
| | | :visible.sync="imgSee" |
| | | class="see-img-box"> |
| | | |
| | | <div class="img" |
| | | :style="{background: imgUrl}"> |
| | | |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | |
| | | </basic-container> |
| | | <el-dialog |
| | | title="预览" |
| | | append-to-body |
| | | :visible.sync="imgSee" |
| | | class="see-img-box" |
| | | > |
| | | <div class="img" :style="{ background: imgUrl }"></div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | data () { |
| | | var type = 4; |
| | | var deptid = this.$route.query.deptId; |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | putParam: "", |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | data() { |
| | | var type = 4; |
| | | var deptid = this.$route.query.deptId; |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | putParam: "", |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "附件地址", |
| | | prop: "link", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件域名", |
| | | prop: "domain", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件域名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件名称", |
| | | prop: "name", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件原名", |
| | | prop: "originalName", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件原名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件拓展名", |
| | | prop: "extension", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件拓展名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件大小", |
| | | prop: "attachSize", |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件大小", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | attachForm: {}, |
| | | attachOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "附件上传", |
| | | prop: "attachFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "附件地址", |
| | | prop: "link", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件域名", |
| | | prop: "domain", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件域名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件名称", |
| | | prop: "name", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件原名", |
| | | prop: "originalName", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件原名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件拓展名", |
| | | prop: "extension", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件拓展名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件大小", |
| | | prop: "attachSize", |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件大小", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | attachForm: {}, |
| | | attachOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "附件上传", |
| | | prop: "attachFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | action: |
| | | "/api/blade-resource/oss/endpoint/put-file-attach?type=" + |
| | | type + |
| | | "&deptid=" + |
| | | deptid, |
| | | }, |
| | | ], |
| | | }, |
| | | imgSee: false, |
| | | imgUrl: "" |
| | | }; |
| | | action: |
| | | "/api/blade-resource/oss/endpoint/put-file-attach?type=" + |
| | | type + |
| | | "&deptid=" + |
| | | deptid, |
| | | }, |
| | | ], |
| | | }, |
| | | imgSee: false, |
| | | imgUrl: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false), |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList () { |
| | | return { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false), |
| | | }; |
| | | }, |
| | | ids () { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | mounted () { |
| | | var flag = false, |
| | | i = 0, |
| | | ind = null; |
| | | this.$store.state.tags.tagList.forEach((item, index) => { |
| | | if (item.label == "附件上传") { |
| | | if (flag == false) { |
| | | ind = index; |
| | | flag = true; |
| | | } |
| | | i++; |
| | | } |
| | | }, |
| | | mounted() { |
| | | var flag = false, |
| | | i = 0, |
| | | ind = null; |
| | | this.$store.state.tags.tagList.forEach((item, index) => { |
| | | if (item.label == "附件上传") { |
| | | if (flag == false) { |
| | | ind = index; |
| | | flag = true; |
| | | } |
| | | i++; |
| | | } |
| | | }); |
| | | if (i > 1) { |
| | | this.$store.state.tags.tagList.splice(ind, 1); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleUpload() { |
| | | this.attachBox = true; |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.attachBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleDownload(row) { |
| | | window.open(`${row.link}`); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | if (i > 1) { |
| | | this.$store.state.tags.tagList.splice(ind, 1); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleUpload () { |
| | | this.attachBox = true; |
| | | }, |
| | | uploadAfter (res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.attachBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleDownload (row) { |
| | | window.open(`${row.link}`); |
| | | }, |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset () { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange (params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | params.type = 4; |
| | | params.deptid = this.$route.query.deptId; |
| | | this.loading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | |
| | | seeImages (row) { |
| | | this.imgUrl = ""; |
| | | this.imgUrl = "url(" + row.link + ") center center / contain no-repeat"; |
| | | |
| | | this.imgSee = true; |
| | | }, |
| | | |
| | | fileFormat (row) { |
| | | var index = row.link.lastIndexOf("."); |
| | | var ext = row.link.substr(index + 1); |
| | | |
| | | return [ |
| | | 'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff']. |
| | | indexOf(ext.toLowerCase()) == -1; |
| | | } |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params.type = 4; |
| | | params.deptid = this.$route.query.deptId; |
| | | this.loading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | |
| | | seeImages(row) { |
| | | this.imgUrl = ""; |
| | | this.imgUrl = "url(" + row.link + ") center center / contain no-repeat"; |
| | | |
| | | this.imgSee = true; |
| | | }, |
| | | |
| | | fileFormat(row) { |
| | | var index = row.link.lastIndexOf("."); |
| | | var ext = row.link.substr(index + 1); |
| | | |
| | | return ( |
| | | [ |
| | | "png", |
| | | "jpg", |
| | | "jpeg", |
| | | "bmp", |
| | | "gif", |
| | | "webp", |
| | | "psd", |
| | | "svg", |
| | | "tiff", |
| | | ].indexOf(ext.toLowerCase()) == -1 |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | <template> |
| | | <basic-container class="hasButTwo"> |
| | | <avue-crud :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload">上 传 |
| | | </el-button> |
| | | <el-button type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete">删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" |
| | | slot="menu"> |
| | | <el-button type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)">下载 |
| | | </el-button> |
| | | <el-button type="text" |
| | | icon="el-icon-picture-outline-round" |
| | | size="small" |
| | | v-show="!fileFormat(scope.row)" |
| | | @click="seeImages(scope.row)">预览 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" |
| | | slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px"> |
| | | <avue-form ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter"> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <basic-container class="hasButTwo"> |
| | | <avue-crud |
| | | :option="option" |
| | | :table-loading="loading" |
| | | :data="data" |
| | | :page.sync="page" |
| | | :permission="permissionList" |
| | | :before-open="beforeOpen" |
| | | v-model="form" |
| | | ref="crud" |
| | | @row-del="rowDel" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @selection-change="selectionChange" |
| | | @current-change="currentChange" |
| | | @size-change="sizeChange" |
| | | @refresh-change="refreshChange" |
| | | @on-load="onLoad" |
| | | > |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | plain |
| | | v-if="permission.attach_upload" |
| | | icon="el-icon-upload2" |
| | | @click="handleUpload" |
| | | >上 传 |
| | | </el-button> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | icon="el-icon-delete" |
| | | plain |
| | | v-if="permission.attach_delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="scope" slot="menu"> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-download" |
| | | size="small" |
| | | v-if="permission.attach_download" |
| | | @click="handleDownload(scope.row)" |
| | | >下载 |
| | | </el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="el-icon-picture-outline-round" |
| | | size="small" |
| | | v-show="!fileFormat(scope.row)" |
| | | @click="seeImages(scope.row)" |
| | | >预览 |
| | | </el-button> |
| | | </template> |
| | | <template slot-scope="{ row }" slot="attachSize"> |
| | | <el-tag>{{ `${row.attachSize} KB` }}</el-tag> |
| | | </template> |
| | | </avue-crud> |
| | | <el-dialog |
| | | title="附件管理" |
| | | append-to-body |
| | | :visible.sync="attachBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | ref="form" |
| | | :option="attachOption" |
| | | v-model="attachForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | <el-dialog title="预览" |
| | | append-to-body |
| | | :visible.sync="imgSee" |
| | | class="see-img-box"> |
| | | |
| | | <div class="img" |
| | | :style="{background: imgUrl}"> |
| | | |
| | | </div> |
| | | |
| | | </el-dialog> |
| | | </basic-container> |
| | | <el-dialog |
| | | title="预览" |
| | | append-to-body |
| | | :visible.sync="imgSee" |
| | | class="see-img-box" |
| | | > |
| | | <div class="img" :style="{ background: imgUrl }"></div> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | import { mapGetters } from "vuex"; |
| | | |
| | | export default { |
| | | data () { |
| | | var type = 4; |
| | | var deptid = this.$route.query.deptId; |
| | | var noticeId = this.$route.query.noticeId; |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | putParam: "", |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | data() { |
| | | var type = 4; |
| | | var deptid = this.$route.query.deptId; |
| | | var noticeId = this.$route.query.noticeId; |
| | | return { |
| | | form: {}, |
| | | query: {}, |
| | | putParam: "", |
| | | loading: true, |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: true, //liu |
| | | index: true, |
| | | // align: center, |
| | | stripe: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "附件地址", |
| | | prop: "link", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件域名", |
| | | prop: "domain", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件域名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件名称", |
| | | prop: "name", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件原名", |
| | | prop: "originalName", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件原名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件拓展名", |
| | | prop: "extension", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件拓展名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件大小", |
| | | prop: "attachSize", |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件大小", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | attachForm: {}, |
| | | attachOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "附件上传", |
| | | prop: "attachFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | attachBox: false, |
| | | selectionList: [], |
| | | option: { |
| | | height: "auto", |
| | | calcHeight: 30, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | index: true, |
| | | // align: center, |
| | | stripe: true, |
| | | viewBtn: true, |
| | | selection: true, |
| | | dialogClickModal: false, |
| | | column: [ |
| | | { |
| | | label: "附件地址", |
| | | prop: "link", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件地址", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件域名", |
| | | prop: "domain", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件域名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件名称", |
| | | prop: "name", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件名称", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件原名", |
| | | prop: "originalName", |
| | | search: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件原名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件拓展名", |
| | | prop: "extension", |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件拓展名", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | | label: "附件大小", |
| | | prop: "attachSize", |
| | | slot: true, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: "请输入附件大小", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | ], |
| | | }, |
| | | data: [], |
| | | attachForm: {}, |
| | | attachOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "附件上传", |
| | | prop: "attachFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | action: |
| | | "/api/blade-resource/oss/endpoint/put-file-attach?type=" + |
| | | type + |
| | | "&deptid=" + |
| | | deptid + |
| | | "¬iceId=" + |
| | | noticeId |
| | | action: |
| | | "/api/blade-resource/oss/endpoint/put-file-attach?type=" + |
| | | type + |
| | | "&deptid=" + |
| | | deptid + |
| | | "¬iceId=" + |
| | | noticeId, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | imgSee: false, |
| | | imgUrl: "" |
| | | }; |
| | | imgSee: false, |
| | | imgUrl: "", |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList() { |
| | | return { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false), |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["permission"]), |
| | | permissionList () { |
| | | return { |
| | | addBtn: false, |
| | | editBtn: false, |
| | | viewBtn: false, |
| | | delBtn: this.vaildData(this.permission.attach_delete, false), |
| | | }; |
| | | }, |
| | | ids () { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.id); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | mounted () { |
| | | var flag = false, |
| | | i = 0, |
| | | ind = null; |
| | | this.$store.state.tags.tagList.forEach((item, index) => { |
| | | if (item.label == "通知公告>附件上传") { |
| | | if (flag == false) { |
| | | ind = index; |
| | | flag = true; |
| | | } |
| | | i++; |
| | | } |
| | | }, |
| | | mounted() { |
| | | var flag = false, |
| | | i = 0, |
| | | ind = null; |
| | | this.$store.state.tags.tagList.forEach((item, index) => { |
| | | if (item.label == "通知公告>附件上传") { |
| | | if (flag == false) { |
| | | ind = index; |
| | | flag = true; |
| | | } |
| | | i++; |
| | | } |
| | | }); |
| | | if (i > 1) { |
| | | this.$store.state.tags.tagList.splice(ind, 1); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleUpload() { |
| | | this.attachBox = true; |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.attachBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleDownload(row) { |
| | | window.open(`${row.link}`); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | if (i > 1) { |
| | | this.$store.state.tags.tagList.splice(ind, 1); |
| | | } |
| | | }, |
| | | methods: { |
| | | handleUpload () { |
| | | this.attachBox = true; |
| | | }, |
| | | uploadAfter (res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.attachBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleDownload (row) { |
| | | window.open(`${row.link}`); |
| | | }, |
| | | rowDel (row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(row.id); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | handleDelete () { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen (done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset () { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange (params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange (list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear () { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange (currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange (pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange () { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad (page, params = {}) { |
| | | params.type = 4; |
| | | params.deptid = this.$route.query.deptId; |
| | | params.noticeId = this.$route.query.noticeId; |
| | | this.loading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | |
| | | seeImages (row) { |
| | | this.imgUrl = ""; |
| | | this.imgUrl = "url(" + row.link + ") center center / contain no-repeat"; |
| | | |
| | | this.imgSee = true; |
| | | }, |
| | | |
| | | fileFormat (row) { |
| | | var index = row.link.lastIndexOf("."); |
| | | var ext = row.link.substr(index + 1); |
| | | |
| | | return [ |
| | | 'png', 'jpg', 'jpeg', 'bmp', 'gif', 'webp', 'psd', 'svg', 'tiff']. |
| | | indexOf(ext.toLowerCase()) == -1; |
| | | } |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crud.toggleSelection(); |
| | | }); |
| | | }, |
| | | beforeOpen(done, type) { |
| | | if (["edit", "view"].includes(type)) { |
| | | getDetail(this.form.id).then((res) => { |
| | | this.form = res.data.data; |
| | | }); |
| | | } |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | selectionClear() { |
| | | this.selectionList = []; |
| | | this.$refs.crud.toggleSelection(); |
| | | }, |
| | | currentChange(currentPage) { |
| | | this.page.currentPage = currentPage; |
| | | }, |
| | | sizeChange(pageSize) { |
| | | this.page.pageSize = pageSize; |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | params.type = 4; |
| | | params.deptid = this.$route.query.deptId; |
| | | params.noticeId = this.$route.query.noticeId; |
| | | this.loading = true; |
| | | getList( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | |
| | | seeImages(row) { |
| | | this.imgUrl = ""; |
| | | this.imgUrl = "url(" + row.link + ") center center / contain no-repeat"; |
| | | |
| | | this.imgSee = true; |
| | | }, |
| | | |
| | | fileFormat(row) { |
| | | var index = row.link.lastIndexOf("."); |
| | | var ext = row.link.substr(index + 1); |
| | | |
| | | return ( |
| | | [ |
| | | "png", |
| | | "jpg", |
| | | "jpeg", |
| | | "bmp", |
| | | "gif", |
| | | "webp", |
| | | "psd", |
| | | "svg", |
| | | "tiff", |
| | | ].indexOf(ext.toLowerCase()) == -1 |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | } from "@/api/system/user"; |
| | | import { getList } from "@/api/securityGuard/securityGuard"; |
| | | import { getDeptLazyTree } from "@/api/system/dept"; |
| | | import { getRoleTree,getRoleDetail } from "@/api/system/role"; |
| | | import { getRoleTree, getRoleDetail } from "@/api/system/role"; |
| | | import { getPostList } from "@/api/system/post"; |
| | | import { mapGetters } from "vuex"; |
| | | import website from "@/config/website"; |
| | | import { getToken } from "@/util/auth"; |
| | | import { securityFormPageColumn } from "./data"; |
| | | import { mapState } from 'vuex'; |
| | | import { mapState } from "vuex"; |
| | | |
| | | export default { |
| | | data() { |
| | |
| | | } |
| | | }; |
| | | return { |
| | | securityid:"", |
| | | securityid: "", |
| | | excelBox1: false, |
| | | excelForm1: {}, |
| | | excelOption1: { |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | align: "center", |
| | | index: true, |
| | |
| | | row: true, |
| | | prop: "myPicture", |
| | | }, |
| | | |
| | | |
| | | // { |
| | | // label: "编号", |
| | | // prop: "code", |
| | | // }, |
| | | |
| | | |
| | | { |
| | | label: "所属辖区", |
| | | prop: "jurisdiction", |
| | |
| | | { |
| | | prop: "UserPractitionersInfo", |
| | | type: "dynamic", |
| | | border: false, |
| | | border: true, //liu |
| | | span: 24, |
| | | children: { |
| | | align: "left", |
| | |
| | | return ids.join(","); |
| | | }, |
| | | ...mapState({ |
| | | userInfo: state => state.user.userInfo |
| | | }) |
| | | userInfo: (state) => state.user.userInfo, |
| | | }), |
| | | }, |
| | | mounted() { |
| | | // this.option.column[0].hide = true |
| | |
| | | |
| | | //获取当前登录人员的角色信息 |
| | | var roleIds = this.userInfo.role_id.split(","); |
| | | roleIds.forEach(roleId =>{ |
| | | getRoleDetail(roleId).then((res) => { |
| | | var roleAlias = res.data.data.roleAlias; |
| | | if(roleAlias=="保安公司管理员" || roleAlias=="保安" || roleAlias=="未持证保安"){ |
| | | const column = this.findObject(this.option.column, "deptId"); |
| | | column.search = false; |
| | | |
| | | } |
| | | }) |
| | | }) |
| | | roleIds.forEach((roleId) => { |
| | | getRoleDetail(roleId).then((res) => { |
| | | var roleAlias = res.data.data.roleAlias; |
| | | if ( |
| | | roleAlias == "保安公司管理员" || |
| | | roleAlias == "保安" || |
| | | roleAlias == "未持证保安" |
| | | ) { |
| | | const column = this.findObject(this.option.column, "deptId"); |
| | | column.search = false; |
| | | } |
| | | }); |
| | | }); |
| | | }, |
| | | methods: { |
| | | handleImport1() { |
| | |
| | | }); |
| | | } |
| | | const user = { |
| | | account: row.account, |
| | | address: row.address, |
| | | birthday: row.birthday, |
| | | cardid: row.cardid, |
| | | deptId: row.deptId, |
| | | education: row.education, |
| | | email: row.email, |
| | | height: row.height, |
| | | hold: row.hold, |
| | | jurisdiction: row.jurisdiction, |
| | | myPicture: row.myPicture, |
| | | name:row.name, |
| | | nation:row.nation, |
| | | nativeplace:row.nativeplace, |
| | | password: row.password, |
| | | password2:row.password2, |
| | | phone: row.phone, |
| | | politicaloutlook:row.politicaloutlook, |
| | | realName: row.realName, |
| | | registered:row.registered, |
| | | rtime: row.rtime, |
| | | securitynumber:row.securitynumber, |
| | | sex: row.sex |
| | | } |
| | | account: row.account, |
| | | address: row.address, |
| | | birthday: row.birthday, |
| | | cardid: row.cardid, |
| | | deptId: row.deptId, |
| | | education: row.education, |
| | | email: row.email, |
| | | height: row.height, |
| | | hold: row.hold, |
| | | jurisdiction: row.jurisdiction, |
| | | myPicture: row.myPicture, |
| | | name: row.name, |
| | | nation: row.nation, |
| | | nativeplace: row.nativeplace, |
| | | password: row.password, |
| | | password2: row.password2, |
| | | phone: row.phone, |
| | | politicaloutlook: row.politicaloutlook, |
| | | realName: row.realName, |
| | | registered: row.registered, |
| | | rtime: row.rtime, |
| | | securitynumber: row.securitynumber, |
| | | sex: row.sex, |
| | | }; |
| | | const userMap = { |
| | | user: user, |
| | | userPractitionersInfo: userPractitionersList, |
| | | }; |
| | | user: user, |
| | | userPractitionersInfo: userPractitionersList, |
| | | }; |
| | | securitySave(userMap).then( |
| | | () => { |
| | | this.$message({ |
| | |
| | | }; |
| | | values = { |
| | | ...params, |
| | | roleAlias:"111", |
| | | roleAlias: "111", |
| | | ...this.query, |
| | | }; |
| | | |
| | | //获取当前登录人员的角色信息 |
| | | var roleIds = this.userInfo.role_id.split(","); |
| | | roleIds.forEach(roleId =>{ |
| | | getRoleDetail(roleId).then((res) => { |
| | | var roleAlias = res.data.data.roleAlias; |
| | | if(roleAlias=="保安公司管理员"){ |
| | | values["deptId"] = this.userInfo.dept_id; |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | roleIds.forEach((roleId) => { |
| | | getRoleDetail(roleId).then((res) => { |
| | | var roleAlias = res.data.data.roleAlias; |
| | | if (roleAlias == "保安公司管理员") { |
| | | values["deptId"] = this.userInfo.dept_id; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | if (this.userInfo.role_id == "1414840172333842433") { |
| | | console.log("是公安add jurisdiction"); |
| | |
| | | height: "auto", |
| | | widtd: "auto", |
| | | calcHeight: 54, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | tip: false, |
| | | index: true, |
| | |
| | | height: "auto", |
| | | widtd: "auto", |
| | | calcHeight: 54, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | tip: false, |
| | | index: true, |
| | |
| | | <template> |
| | | <el-dialog |
| | | :title="!form1.id?'新增':'修改'" |
| | | width="60%" |
| | | modal-append-to-body='false' |
| | | append-to-body='true' |
| | | :close-on-click-model="true" |
| | | :visible.sync="visible" |
| | | > |
| | | <avue-form :option="option" v-model="form1" @submit="update"> |
| | | <template slot-scope="{ row }" slot="input"> |
| | | <el-tag>{{ row }}</el-tag> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | <el-dialog |
| | | :title="!form1.id ? '新增' : '修改'" |
| | | width="60%" |
| | | modal-append-to-body="false" |
| | | append-to-body="true" |
| | | :close-on-click-model="true" |
| | | :visible.sync="visible" |
| | | > |
| | | <avue-form :option="option" v-model="form1" @submit="update"> |
| | | <template slot-scope="{ row }" slot="input"> |
| | | <el-tag>{{ row }}</el-tag> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | stripe: true, |
| | | index: true, |
| | | selection: true, |
| | |
| | | label: "所属组织机构", |
| | | prop: "deptId", |
| | | type: "tree", |
| | | dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697", |
| | | dicUrl: |
| | | "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697", |
| | | props: { |
| | | label: "title", |
| | | value: "id", |
| | |
| | | required: true, |
| | | message: "请选择组织机构", |
| | | trigger: "blur", |
| | | } |
| | | }, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | required: true, |
| | | message: "请输入登录账号", |
| | | trigger: "blur", |
| | | } |
| | | }, |
| | | ], |
| | | // disabled: true, |
| | | }, |
| | |
| | | { |
| | | label: "用户昵称", |
| | | prop: "name", |
| | | }, { |
| | | }, |
| | | { |
| | | label: "所属行政区", |
| | | prop: "jurisdiction", |
| | | // multiple: true, |
| | |
| | | trigger: "click", |
| | | }, |
| | | ], |
| | | },{ |
| | | }, |
| | | { |
| | | label: "所属角色", |
| | | prop: "roleId", |
| | | multiple: true, |
| | |
| | | trigger: "click", |
| | | }, |
| | | ], |
| | | },{ |
| | | }, |
| | | { |
| | | label: "所属岗位", |
| | | prop: "postId", |
| | | type: "tree", |
| | |
| | | value: "dictKey", |
| | | }, |
| | | dataType: "number", |
| | | slot: true |
| | | slot: true, |
| | | }, |
| | | { |
| | | label: "政治面貌", |
| | |
| | | { |
| | | prop: "UserPractitionersInfo", |
| | | type: "dynamic", |
| | | border: false, |
| | | border: true, //liu |
| | | span: 24, |
| | | children: { |
| | | align: "left", |
| | |
| | | }, |
| | | datachild: [], |
| | | }; |
| | | |
| | | }, |
| | | watch: { |
| | | "form.tenantId"() { |
| | |
| | | margin-left: 0px !important; |
| | | } */ |
| | | |
| | | |
| | | .addorupdatetitle{ |
| | | .addorupdatetitle { |
| | | position: absolute; |
| | | left: 10px; |
| | | top: 70px; |
| | |
| | | height: 10px; |
| | | font-size: 10px; |
| | | cursor: pointer; |
| | | |
| | | } |
| | | .xx { |
| | | position: absolute; |
| | |
| | | label: "企业名称", |
| | | prop: "enterprisename", |
| | | search: true, |
| | | width: 260, |
| | | searchSpan: 4, |
| | | labelWidth: 160, |
| | | // width: 130, |
| | |
| | | label: "企业类型", |
| | | prop: "stats", |
| | | type: "tree", |
| | | hide: true, |
| | | labelWidth: 160, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=stats", |
| | | props: { |
| | |
| | | searchLabelWidth: 100 |
| | | }, |
| | | { |
| | | label: "代表人电话", |
| | | label: "法人电话", |
| | | labelWidth: 160, |
| | | prop: "representativecell", |
| | | width: 98, |
| | |
| | | { |
| | | label: "注册资本", |
| | | prop: "registeredcapital", |
| | | hide: true, |
| | | labelWidth: 160, |
| | | // search: true, |
| | | width: 80, |
| | |
| | | overHidden: true |
| | | }, |
| | | { |
| | | label: "所属地区", |
| | | label: "所属辖区", |
| | | prop: "region", |
| | | labelWidth: 160, |
| | | // width: 110, |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <div class="securityUnit"> |
| | | <avue-crud |
| | | :option="option" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crudrec" |
| | | @on-load="onLoad" |
| | | :table-loading="loading" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-update="rowUpdate" |
| | | @row-del="rowDel" |
| | | @selection-change="selectionChange" |
| | | @refresh-change="refreshChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | :size="size" |
| | | :type="type" |
| | | @click="handleUploadPage(row)" |
| | | icon="el-icon-circle-check" |
| | | >附件上传 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | plain |
| | | @click.stop="rowSave" |
| | | >新增</el-button |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleImport1" |
| | | >批量导入 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div class="lod" v-show="forms != -1"> |
| | | <div class="lod-in"> |
| | | <!-- <el-col class="trees" v-if="forms == 0"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree |
| | | :option="treeOption" |
| | | :data="treeData" |
| | | @node-click="nodeClick" |
| | | /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> --> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="obj0" |
| | | :option="option0" |
| | | v-if="forms == 0" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip0">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form1" |
| | | v-model="obj1" |
| | | :option="option1" |
| | | v-else-if="forms == 1" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip1up1">上一页</el-button> |
| | | <el-button type="primary" @click="tip1">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form2" |
| | | v-model="obj2" |
| | | :option="option2" |
| | | v-else-if="forms == 2" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip2up2">上一页</el-button> |
| | | <el-button type="primary" @click="tip2">提交</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="保安单位导入" |
| | | append-to-body |
| | | :visible.sync="excelBox1" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption1" |
| | | v-model="excelForm1" |
| | | :upload-after="uploadAfter1" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate1"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { column, column0, column1, column2 } from "./data"; |
| | | import { |
| | | getdata, |
| | | adddata, |
| | | update, |
| | | remove, |
| | | adddata1, |
| | | adddata2, |
| | | getDeptLazyTree, |
| | | } from "@/api/securityUnit/securityUnit"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | data() { |
| | | var w = 160, |
| | | s = 12; |
| | | return { |
| | | excelBox1: false, |
| | | excelForm1: {}, |
| | | excelOption1: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "文件上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "文件上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/information/import-informaton", |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | loading: true, //保安单位基本信息 |
| | | selectionList: [], |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | |
| | | treeData: [], |
| | | treeOption: { |
| | | title: "我是标题", |
| | | filterText: "搜索关键字自定义", |
| | | defaultExpandAll: true, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: "small", |
| | | formOption: { |
| | | labelWidth: 100, |
| | | column: [ |
| | | { |
| | | label: "自定义项", |
| | | prop: "label", |
| | | }, |
| | | ], |
| | | }, |
| | | props: { |
| | | labelText: "标题", |
| | | label: "title", |
| | | value: "id", |
| | | children: "children", |
| | | }, |
| | | }, |
| | | // treeOption: { |
| | | // nodeKey: "id", |
| | | // // lazy: true, |
| | | // // treeLoad: function (node, resolve) { |
| | | // // // const parentId = node.level === 0 ? 0 : node.data.id; |
| | | // // getDeptLazyTree().then((res) => { |
| | | // // resolve( |
| | | // // res.data.data.map((item) => { |
| | | // // console.log({ |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }); |
| | | // // return { |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }; |
| | | // // }) |
| | | // // ); |
| | | // // }); |
| | | // // }, |
| | | // addBtn: false, |
| | | // menu: false, |
| | | // size: "small", |
| | | // props: { |
| | | // labelText: "标题", |
| | | // label: "title", |
| | | // value: "value", |
| | | // children: "children", |
| | | // }, |
| | | // }, |
| | | |
| | | obj0: { |
| | | title0: "保安单位基本信息", |
| | | }, |
| | | option0: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column0, |
| | | }, |
| | | obj1: { |
| | | title1: "保安单位出资人员", |
| | | }, |
| | | option1: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column1, |
| | | }, |
| | | obj2: { |
| | | title2: "主要管理人员信息", |
| | | }, |
| | | option2: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column2, |
| | | }, |
| | | |
| | | forms: -1, |
| | | data0: {}, |
| | | data1: {}, |
| | | data2: {}, |
| | | b0: {}, |
| | | b1: {}, |
| | | b2: {}, |
| | | noshehuibianma: 0, |
| | | nobumen: 0, |
| | | |
| | | query: {}, |
| | | data: [], |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | // card: true, |
| | | tip: false, |
| | | searchSize: "mini", |
| | | searchMenuSpan: 6, |
| | | height: 583, |
| | | menuWidth: 220, |
| | | align: "center", |
| | | selection: true, |
| | | column: column, |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.creditcode); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ids1() { |
| | | let ids1 = []; |
| | | this.selectionList1.forEach((ele) => { |
| | | ids1.push(ele.id); |
| | | }); |
| | | return ids1.join(","); |
| | | }, |
| | | ids2() { |
| | | let ids2 = []; |
| | | this.selectionList2.forEach((ele) => { |
| | | ids2.push(ele.id); |
| | | }); |
| | | return ids2.join(","); |
| | | }, |
| | | haveID() { |
| | | return this.obj0.creditcode; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleImport1() { |
| | | this.excelBox1 = true; |
| | | }, |
| | | uploadAfter1(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox1 = false; |
| | | // this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleTemplate1() { |
| | | window.open(`/api/examSubjectChoices/export-template`); |
| | | }, |
| | | |
| | | // handleChangeTABS(column) { |
| | | // this.typeTABS = column; |
| | | // // this.$message.success(JSON.stringify(column)); |
| | | // if (column.prop == "tab1") { |
| | | // this.loading1 = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad(this.page); |
| | | // } else if (column.prop == "tab2") { |
| | | // this.loading = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad1(this.page1); //第二个表格不会自动执行 |
| | | // } else if (column.prop == "tab3") { |
| | | // this.loading1 = false; |
| | | // this.loading = false; |
| | | // this.onLoad2(this.page2); //第二个表格不会自动执行 |
| | | // } |
| | | // }, |
| | | //保安单位基本信息 |
| | | sizeChange(val) { |
| | | this.page1.currentPage = 1; |
| | | this.page1.pageSize = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("行数" + val); |
| | | }, |
| | | currentChange(val) { |
| | | this.page1.currentPage = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("页码" + val); |
| | | }, |
| | | rowSave(form, done, loading) { |
| | | // console.log("save1"); |
| | | this.forms = 0; |
| | | var that = this; |
| | | //先获取部门接口 |
| | | getDeptLazyTree().then((res) => { |
| | | var d = res.data.data; |
| | | that.treeData = d; |
| | | // console.log(d); |
| | | }); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | delete row.tenantid; |
| | | delete row.regstsat; |
| | | console.log(row, 0); |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(row); |
| | | return remove(row.creditcode, row.departmentid); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定批量将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(this.ids); |
| | | // return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crudrec.toggleSelection(); |
| | | }); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | rowClick(row) { |
| | | // console.log(row); |
| | | // row.identificationnumber; //统一社会信用代 码 |
| | | window.localStorage.setItem("danweidata", JSON.stringify(row)); |
| | | this.$router.push({ |
| | | path: "/securityUnitChild", |
| | | // redirect: { name: "foo" }, |
| | | query: { rowsecurity: "fromSecurity" }, |
| | | // params: { row: row.identificationnumber }, |
| | | }); |
| | | }, |
| | | //跳转到附近列表页面 |
| | | handleUploadPage(row) { |
| | | this.$router.push({ |
| | | path: `/resource/attachCopy`, |
| | | query: { |
| | | deptId: row.departmentid, |
| | | enterprisename: row.enterprisename, |
| | | }, |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.userInfo.role_id == "1414840172333842433") { |
| | | console.log("是公安add jurisdiction"); |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | } |
| | | params["stats"] = "2"; |
| | | this.loading = true; |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | window.localStorage.setItem("danweidataS", JSON.stringify(this.data)); |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // nodeClick(data) {//分局 不在这添加 |
| | | // // this.treeDeptId = data.id; |
| | | // // this.page.currentPage = 1; |
| | | // // this.onLoad(this.page); |
| | | // // this.$message.success(JSON.stringify(data)); |
| | | // this.obj0["departmentid"] = data.title; |
| | | // this.obj1["departmentid"] = data.title; |
| | | // this.obj2["departmentid"] = data.title; |
| | | // this.obj0["useid"] = data.id; |
| | | // this.obj1["useid"] = data.id; |
| | | // this.obj2["useid"] = data.id; |
| | | // this.nobumen = 1; |
| | | // }, |
| | | tip0() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj0) { |
| | | for (var i in column0) { |
| | | if (k == column0[i].prop && k != "title0") { |
| | | d[k] = this.obj0[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 0); |
| | | this.data0 = d; |
| | | this.forms = 1; |
| | | }, |
| | | tip1() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj1) { |
| | | for (var i in column1) { |
| | | if (k == column1[i].prop && k != "title1") { |
| | | d[k] = this.obj1[k]; |
| | | } |
| | | } |
| | | } |
| | | d["capital"] = d["capital2"]; |
| | | delete d["capital2"]; |
| | | // console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 1); |
| | | this.data1 = d; |
| | | this.forms = 2; |
| | | }, |
| | | tip2() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj2) { |
| | | for (var i in column2) { |
| | | if (k == column2[i].prop && k != "title2") { |
| | | d[k] = this.obj2[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | d["cardid"] = d["cardid2"]; |
| | | delete d["cardid2"]; |
| | | d["cell"] = d["cell2"]; |
| | | delete d["cell2"]; |
| | | // d["shareholdingratio"] = d["shareholdingratio2"]; |
| | | // delete d["shareholdingratio2"]; |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 2); |
| | | this.data2 = d; |
| | | |
| | | // this.data0.departmentid = this.data0.useid; |
| | | // this.data1.departmentid = this.data1.useid; |
| | | // this.data2.departmentid = this.data2.useid; |
| | | // delete this.data0.useid; |
| | | // delete this.data1.useid; |
| | | // delete this.data2.useid; |
| | | |
| | | adddata(this.data0).then((res) => { |
| | | console.log(res, 0); |
| | | }); |
| | | adddata1(this.data1).then((res) => { |
| | | console.log(res, 1); |
| | | }); |
| | | adddata2(this.data2).then((res) => { |
| | | console.log(res, 2); |
| | | }); |
| | | var time = setTimeout(() => { |
| | | this.onLoad(this.page, this.query); |
| | | console.log(this.data0, this.data1, this.data2, "已刷新"); |
| | | }, 500); |
| | | this.tipover(); |
| | | }, |
| | | tip1up1() { |
| | | this.forms = 0; |
| | | }, |
| | | tip2up2() { |
| | | this.forms = 1; |
| | | }, |
| | | tipover() { |
| | | this.forms = -1; |
| | | this.obj0 = { |
| | | title0: "保安单位基本信息", |
| | | }; |
| | | this.obj1 = { |
| | | title1: "保安单位出资人员", |
| | | }; |
| | | this.obj2 = { |
| | | title2: "主要管理人员信息", |
| | | }; |
| | | this.data0 = {}; |
| | | this.data1 = {}; |
| | | this.data2 = {}; |
| | | this.noshehuibianma = 0; |
| | | this.nobumen = 0; |
| | | }, |
| | | panduanmeiyouziduan() { |
| | | if (this.noshehuibianma == 0) { |
| | | this.$message.warning("请输入统一社会信用代码"); |
| | | return true; |
| | | } |
| | | if (this.nobumen == 0) { |
| | | return false; |
| | | this.$message.warning("请选则部门"); |
| | | } |
| | | return false; |
| | | }, |
| | | }, |
| | | watch: { |
| | | haveID() { |
| | | // console.log(this.haveID); |
| | | if (this.haveID != undefined) { |
| | | if (this.haveID.length > 5) { |
| | | //统一社会信用代码判断 |
| | | this.noshehuibianma = 1; |
| | | } else { |
| | | this.noshehuibianma = 0; |
| | | } |
| | | } |
| | | }, |
| | | havedata() { |
| | | console.log(this.havedata, "qqqqq"); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .securityUnit { |
| | | width: 100%; |
| | | height: 100%; |
| | | // border: 1px solid #000; |
| | | box-sizing: border-box; |
| | | } |
| | | // .el-card__body { |
| | | // padding-bottom: 5px !important; |
| | | // } |
| | | // .avue-crud__tip, |
| | | // .el-tag, |
| | | // .el-tag--light { |
| | | // padding: 0 !important; |
| | | // } |
| | | |
| | | .lod { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba($color: #000000, $alpha: 0.5); |
| | | padding: 100px 0 0 0; |
| | | z-index: 500 !important; |
| | | display: flex; |
| | | // align-items: center; |
| | | justify-content: center; |
| | | .trees { |
| | | z-index: 501 !important; |
| | | position: absolute; |
| | | width: 15%; |
| | | top: 100px; |
| | | left: 0; |
| | | // display: none; |
| | | } |
| | | .lod-in { |
| | | width: 70%; |
| | | height: auto; |
| | | background-color: transparent; |
| | | |
| | | // padding: 10px 0 0 0; |
| | | } |
| | | |
| | | .el-collapse-item { |
| | | padding-top: 15px !important; |
| | | } |
| | | } |
| | | .el-collapse { |
| | | border-top: 1px solid transparent !important; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <div class="securityUnit"> |
| | | <avue-crud |
| | | :option="option" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crudrec" |
| | | @on-load="onLoad" |
| | | :table-loading="loading" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-update="rowUpdate" |
| | | @row-del="rowDel" |
| | | @selection-change="selectionChange" |
| | | @refresh-change="refreshChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | :size="size" |
| | | :type="type" |
| | | @click="handleUploadPage(row)" |
| | | icon="el-icon-circle-check" |
| | | >附件上传 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | plain |
| | | @click.stop="rowSave" |
| | | >新增</el-button |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleImport1" |
| | | >批量导入 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div class="lod" v-show="forms != -1"> |
| | | <div class="lod-in"> |
| | | <!-- <el-col class="trees" v-if="forms == 0"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree |
| | | :option="treeOption" |
| | | :data="treeData" |
| | | @node-click="nodeClick" |
| | | /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> --> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="obj0" |
| | | :option="option0" |
| | | v-if="forms == 0" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip0">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form1" |
| | | v-model="obj1" |
| | | :option="option1" |
| | | v-else-if="forms == 1" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip1up1">上一页</el-button> |
| | | <el-button type="primary" @click="tip1">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form2" |
| | | v-model="obj2" |
| | | :option="option2" |
| | | v-else-if="forms == 2" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip2up2">上一页</el-button> |
| | | <el-button type="primary" @click="tip2">提交</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="保安单位导入" |
| | | append-to-body |
| | | :visible.sync="excelBox1" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption1" |
| | | v-model="excelForm1" |
| | | :upload-after="uploadAfter1" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate1"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { column, column0, column1, column2 } from "./data"; |
| | | import { |
| | | getdata, |
| | | adddata, |
| | | update, |
| | | remove, |
| | | adddata1, |
| | | adddata2, |
| | | getDeptLazyTree, |
| | | } from "@/api/securityUnit/securityUnit"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | data() { |
| | | var w = 160, |
| | | s = 12; |
| | | return { |
| | | excelBox1: false, |
| | | excelForm1: {}, |
| | | excelOption1: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "文件上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "文件上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/information/import-informaton", |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | loading: true, //保安单位基本信息 |
| | | selectionList: [], |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | |
| | | treeData: [], |
| | | treeOption: { |
| | | title: "我是标题", |
| | | filterText: "搜索关键字自定义", |
| | | defaultExpandAll: true, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: "small", |
| | | formOption: { |
| | | labelWidth: 100, |
| | | column: [ |
| | | { |
| | | label: "自定义项", |
| | | prop: "label", |
| | | }, |
| | | ], |
| | | }, |
| | | props: { |
| | | labelText: "标题", |
| | | label: "title", |
| | | value: "id", |
| | | children: "children", |
| | | }, |
| | | }, |
| | | // treeOption: { |
| | | // nodeKey: "id", |
| | | // // lazy: true, |
| | | // // treeLoad: function (node, resolve) { |
| | | // // // const parentId = node.level === 0 ? 0 : node.data.id; |
| | | // // getDeptLazyTree().then((res) => { |
| | | // // resolve( |
| | | // // res.data.data.map((item) => { |
| | | // // console.log({ |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }); |
| | | // // return { |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }; |
| | | // // }) |
| | | // // ); |
| | | // // }); |
| | | // // }, |
| | | // addBtn: false, |
| | | // menu: false, |
| | | // size: "small", |
| | | // props: { |
| | | // labelText: "标题", |
| | | // label: "title", |
| | | // value: "value", |
| | | // children: "children", |
| | | // }, |
| | | // }, |
| | | |
| | | obj0: { |
| | | title0: "保安单位基本信息", |
| | | }, |
| | | option0: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column0, |
| | | }, |
| | | obj1: { |
| | | title1: "保安单位出资人员", |
| | | }, |
| | | option1: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column1, |
| | | }, |
| | | obj2: { |
| | | title2: "主要管理人员信息", |
| | | }, |
| | | option2: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column2, |
| | | }, |
| | | |
| | | forms: -1, |
| | | data0: {}, |
| | | data1: {}, |
| | | data2: {}, |
| | | b0: {}, |
| | | b1: {}, |
| | | b2: {}, |
| | | noshehuibianma: 0, |
| | | nobumen: 0, |
| | | |
| | | query: {}, |
| | | data: [], |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | // card: true, |
| | | tip: false, |
| | | searchSize: "mini", |
| | | searchMenuSpan: 6, |
| | | height: 583, |
| | | menuWidth: 220, |
| | | align: "center", |
| | | selection: true, |
| | | column: column, |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.creditcode); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ids1() { |
| | | let ids1 = []; |
| | | this.selectionList1.forEach((ele) => { |
| | | ids1.push(ele.id); |
| | | }); |
| | | return ids1.join(","); |
| | | }, |
| | | ids2() { |
| | | let ids2 = []; |
| | | this.selectionList2.forEach((ele) => { |
| | | ids2.push(ele.id); |
| | | }); |
| | | return ids2.join(","); |
| | | }, |
| | | haveID() { |
| | | return this.obj0.creditcode; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleImport1() { |
| | | this.excelBox1 = true; |
| | | }, |
| | | uploadAfter1(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox1 = false; |
| | | // this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleTemplate1() { |
| | | window.open(`/api/examSubjectChoices/export-template`); |
| | | }, |
| | | |
| | | // handleChangeTABS(column) { |
| | | // this.typeTABS = column; |
| | | // // this.$message.success(JSON.stringify(column)); |
| | | // if (column.prop == "tab1") { |
| | | // this.loading1 = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad(this.page); |
| | | // } else if (column.prop == "tab2") { |
| | | // this.loading = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad1(this.page1); //第二个表格不会自动执行 |
| | | // } else if (column.prop == "tab3") { |
| | | // this.loading1 = false; |
| | | // this.loading = false; |
| | | // this.onLoad2(this.page2); //第二个表格不会自动执行 |
| | | // } |
| | | // }, |
| | | //保安单位基本信息 |
| | | sizeChange(val) { |
| | | this.page1.currentPage = 1; |
| | | this.page1.pageSize = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("行数" + val); |
| | | }, |
| | | currentChange(val) { |
| | | this.page1.currentPage = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("页码" + val); |
| | | }, |
| | | rowSave(form, done, loading) { |
| | | // console.log("save1"); |
| | | this.forms = 0; |
| | | var that = this; |
| | | //先获取部门接口 |
| | | getDeptLazyTree().then((res) => { |
| | | var d = res.data.data; |
| | | that.treeData = d; |
| | | // console.log(d); |
| | | }); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | delete row.tenantid; |
| | | delete row.regstsat; |
| | | console.log(row, 0); |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(row); |
| | | return remove(row.creditcode, row.departmentid); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定批量将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(this.ids); |
| | | // return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crudrec.toggleSelection(); |
| | | }); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | rowClick(row) { |
| | | // console.log(row); |
| | | // row.identificationnumber; //统一社会信用代 码 |
| | | window.localStorage.setItem("danweidata", JSON.stringify(row)); |
| | | this.$router.push({ |
| | | path: "/securityUnitChild", |
| | | // redirect: { name: "foo" }, |
| | | query: { rowsecurity: "fromSecurity" }, |
| | | // params: { row: row.identificationnumber }, |
| | | }); |
| | | }, |
| | | //跳转到附近列表页面 |
| | | handleUploadPage(row) { |
| | | this.$router.push({ |
| | | path: `/resource/attachCopy`, |
| | | query: { |
| | | deptId: row.departmentid, |
| | | enterprisename: row.enterprisename, |
| | | }, |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.userInfo.role_id == "1414840172333842433") { |
| | | console.log("是公安add jurisdiction"); |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | } |
| | | params["stats"] = 1; |
| | | this.loading = true; |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | window.localStorage.setItem("danweidataS", JSON.stringify(this.data)); |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // nodeClick(data) {//分局 不在这添加 |
| | | // // this.treeDeptId = data.id; |
| | | // // this.page.currentPage = 1; |
| | | // // this.onLoad(this.page); |
| | | // // this.$message.success(JSON.stringify(data)); |
| | | // this.obj0["departmentid"] = data.title; |
| | | // this.obj1["departmentid"] = data.title; |
| | | // this.obj2["departmentid"] = data.title; |
| | | // this.obj0["useid"] = data.id; |
| | | // this.obj1["useid"] = data.id; |
| | | // this.obj2["useid"] = data.id; |
| | | // this.nobumen = 1; |
| | | // }, |
| | | tip0() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj0) { |
| | | for (var i in column0) { |
| | | if (k == column0[i].prop && k != "title0") { |
| | | d[k] = this.obj0[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 0); |
| | | this.data0 = d; |
| | | this.forms = 1; |
| | | }, |
| | | tip1() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj1) { |
| | | for (var i in column1) { |
| | | if (k == column1[i].prop && k != "title1") { |
| | | d[k] = this.obj1[k]; |
| | | } |
| | | } |
| | | } |
| | | d["capital"] = d["capital2"]; |
| | | delete d["capital2"]; |
| | | // console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 1); |
| | | this.data1 = d; |
| | | this.forms = 2; |
| | | }, |
| | | tip2() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj2) { |
| | | for (var i in column2) { |
| | | if (k == column2[i].prop && k != "title2") { |
| | | d[k] = this.obj2[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | d["cardid"] = d["cardid2"]; |
| | | delete d["cardid2"]; |
| | | d["cell"] = d["cell2"]; |
| | | delete d["cell2"]; |
| | | // d["shareholdingratio"] = d["shareholdingratio2"]; |
| | | // delete d["shareholdingratio2"]; |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 2); |
| | | this.data2 = d; |
| | | |
| | | // this.data0.departmentid = this.data0.useid; |
| | | // this.data1.departmentid = this.data1.useid; |
| | | // this.data2.departmentid = this.data2.useid; |
| | | // delete this.data0.useid; |
| | | // delete this.data1.useid; |
| | | // delete this.data2.useid; |
| | | |
| | | adddata(this.data0).then((res) => { |
| | | console.log(res, 0); |
| | | }); |
| | | adddata1(this.data1).then((res) => { |
| | | console.log(res, 1); |
| | | }); |
| | | adddata2(this.data2).then((res) => { |
| | | console.log(res, 2); |
| | | }); |
| | | var time = setTimeout(() => { |
| | | this.onLoad(this.page, this.query); |
| | | console.log(this.data0, this.data1, this.data2, "已刷新"); |
| | | }, 500); |
| | | this.tipover(); |
| | | }, |
| | | tip1up1() { |
| | | this.forms = 0; |
| | | }, |
| | | tip2up2() { |
| | | this.forms = 1; |
| | | }, |
| | | tipover() { |
| | | this.forms = -1; |
| | | this.obj0 = { |
| | | title0: "保安单位基本信息", |
| | | }; |
| | | this.obj1 = { |
| | | title1: "保安单位出资人员", |
| | | }; |
| | | this.obj2 = { |
| | | title2: "主要管理人员信息", |
| | | }; |
| | | this.data0 = {}; |
| | | this.data1 = {}; |
| | | this.data2 = {}; |
| | | this.noshehuibianma = 0; |
| | | this.nobumen = 0; |
| | | }, |
| | | panduanmeiyouziduan() { |
| | | if (this.noshehuibianma == 0) { |
| | | this.$message.warning("请输入统一社会信用代码"); |
| | | return true; |
| | | } |
| | | if (this.nobumen == 0) { |
| | | return false; |
| | | this.$message.warning("请选则部门"); |
| | | } |
| | | return false; |
| | | }, |
| | | }, |
| | | watch: { |
| | | haveID() { |
| | | // console.log(this.haveID); |
| | | if (this.haveID != undefined) { |
| | | if (this.haveID.length > 5) { |
| | | //统一社会信用代码判断 |
| | | this.noshehuibianma = 1; |
| | | } else { |
| | | this.noshehuibianma = 0; |
| | | } |
| | | } |
| | | }, |
| | | havedata() { |
| | | console.log(this.havedata, "qqqqq"); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .securityUnit { |
| | | width: 100%; |
| | | height: 100%; |
| | | // border: 1px solid #000; |
| | | box-sizing: border-box; |
| | | } |
| | | // .el-card__body { |
| | | // padding-bottom: 5px !important; |
| | | // } |
| | | // .avue-crud__tip, |
| | | // .el-tag, |
| | | // .el-tag--light { |
| | | // padding: 0 !important; |
| | | // } |
| | | |
| | | .lod { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba($color: #000000, $alpha: 0.5); |
| | | padding: 100px 0 0 0; |
| | | z-index: 500 !important; |
| | | display: flex; |
| | | // align-items: center; |
| | | justify-content: center; |
| | | .trees { |
| | | z-index: 501 !important; |
| | | position: absolute; |
| | | width: 15%; |
| | | top: 100px; |
| | | left: 0; |
| | | // display: none; |
| | | } |
| | | .lod-in { |
| | | width: 70%; |
| | | height: auto; |
| | | background-color: transparent; |
| | | |
| | | // padding: 10px 0 0 0; |
| | | } |
| | | |
| | | .el-collapse-item { |
| | | padding-top: 15px !important; |
| | | } |
| | | } |
| | | .el-collapse { |
| | | border-top: 1px solid transparent !important; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <div class="securityUnit"> |
| | | <avue-crud |
| | | :option="option" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crudrec" |
| | | @on-load="onLoad" |
| | | :table-loading="loading" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-update="rowUpdate" |
| | | @row-del="rowDel" |
| | | @selection-change="selectionChange" |
| | | @refresh-change="refreshChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | :size="size" |
| | | :type="type" |
| | | @click="handleUploadPage(row)" |
| | | icon="el-icon-circle-check" |
| | | >附件上传 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | plain |
| | | @click.stop="rowSave" |
| | | >新增</el-button |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleImport1" |
| | | >批量导入 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div class="lod" v-show="forms != -1"> |
| | | <div class="lod-in"> |
| | | <!-- <el-col class="trees" v-if="forms == 0"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree |
| | | :option="treeOption" |
| | | :data="treeData" |
| | | @node-click="nodeClick" |
| | | /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> --> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="obj0" |
| | | :option="option0" |
| | | v-if="forms == 0" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip0">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form1" |
| | | v-model="obj1" |
| | | :option="option1" |
| | | v-else-if="forms == 1" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip1up1">上一页</el-button> |
| | | <el-button type="primary" @click="tip1">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form2" |
| | | v-model="obj2" |
| | | :option="option2" |
| | | v-else-if="forms == 2" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip2up2">上一页</el-button> |
| | | <el-button type="primary" @click="tip2">提交</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="保安单位导入" |
| | | append-to-body |
| | | :visible.sync="excelBox1" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption1" |
| | | v-model="excelForm1" |
| | | :upload-after="uploadAfter1" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate1"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { column, column0, column1, column2 } from "./data"; |
| | | import { |
| | | getdata, |
| | | adddata, |
| | | update, |
| | | remove, |
| | | adddata1, |
| | | adddata2, |
| | | getDeptLazyTree, |
| | | } from "@/api/securityUnit/securityUnit"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | data() { |
| | | var w = 160, |
| | | s = 12; |
| | | return { |
| | | excelBox1: false, |
| | | excelForm1: {}, |
| | | excelOption1: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "文件上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "文件上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/information/import-informaton", |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | loading: true, //保安单位基本信息 |
| | | selectionList: [], |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | |
| | | treeData: [], |
| | | treeOption: { |
| | | title: "我是标题", |
| | | filterText: "搜索关键字自定义", |
| | | defaultExpandAll: true, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: "small", |
| | | formOption: { |
| | | labelWidth: 100, |
| | | column: [ |
| | | { |
| | | label: "自定义项", |
| | | prop: "label", |
| | | }, |
| | | ], |
| | | }, |
| | | props: { |
| | | labelText: "标题", |
| | | label: "title", |
| | | value: "id", |
| | | children: "children", |
| | | }, |
| | | }, |
| | | // treeOption: { |
| | | // nodeKey: "id", |
| | | // // lazy: true, |
| | | // // treeLoad: function (node, resolve) { |
| | | // // // const parentId = node.level === 0 ? 0 : node.data.id; |
| | | // // getDeptLazyTree().then((res) => { |
| | | // // resolve( |
| | | // // res.data.data.map((item) => { |
| | | // // console.log({ |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }); |
| | | // // return { |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }; |
| | | // // }) |
| | | // // ); |
| | | // // }); |
| | | // // }, |
| | | // addBtn: false, |
| | | // menu: false, |
| | | // size: "small", |
| | | // props: { |
| | | // labelText: "标题", |
| | | // label: "title", |
| | | // value: "value", |
| | | // children: "children", |
| | | // }, |
| | | // }, |
| | | |
| | | obj0: { |
| | | title0: "保安单位基本信息", |
| | | }, |
| | | option0: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column0, |
| | | }, |
| | | obj1: { |
| | | title1: "保安单位出资人员", |
| | | }, |
| | | option1: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column1, |
| | | }, |
| | | obj2: { |
| | | title2: "主要管理人员信息", |
| | | }, |
| | | option2: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column2, |
| | | }, |
| | | |
| | | forms: -1, |
| | | data0: {}, |
| | | data1: {}, |
| | | data2: {}, |
| | | b0: {}, |
| | | b1: {}, |
| | | b2: {}, |
| | | noshehuibianma: 0, |
| | | nobumen: 0, |
| | | |
| | | query: {}, |
| | | data: [], |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | // card: true, |
| | | tip: false, |
| | | searchSize: "mini", |
| | | searchMenuSpan: 6, |
| | | height: 583, |
| | | menuWidth: 220, |
| | | align: "center", |
| | | selection: true, |
| | | column: column, |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.creditcode); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ids1() { |
| | | let ids1 = []; |
| | | this.selectionList1.forEach((ele) => { |
| | | ids1.push(ele.id); |
| | | }); |
| | | return ids1.join(","); |
| | | }, |
| | | ids2() { |
| | | let ids2 = []; |
| | | this.selectionList2.forEach((ele) => { |
| | | ids2.push(ele.id); |
| | | }); |
| | | return ids2.join(","); |
| | | }, |
| | | haveID() { |
| | | return this.obj0.creditcode; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleImport1() { |
| | | this.excelBox1 = true; |
| | | }, |
| | | uploadAfter1(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox1 = false; |
| | | // this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleTemplate1() { |
| | | window.open(`/api/examSubjectChoices/export-template`); |
| | | }, |
| | | |
| | | // handleChangeTABS(column) { |
| | | // this.typeTABS = column; |
| | | // // this.$message.success(JSON.stringify(column)); |
| | | // if (column.prop == "tab1") { |
| | | // this.loading1 = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad(this.page); |
| | | // } else if (column.prop == "tab2") { |
| | | // this.loading = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad1(this.page1); //第二个表格不会自动执行 |
| | | // } else if (column.prop == "tab3") { |
| | | // this.loading1 = false; |
| | | // this.loading = false; |
| | | // this.onLoad2(this.page2); //第二个表格不会自动执行 |
| | | // } |
| | | // }, |
| | | //保安单位基本信息 |
| | | sizeChange(val) { |
| | | this.page1.currentPage = 1; |
| | | this.page1.pageSize = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("行数" + val); |
| | | }, |
| | | currentChange(val) { |
| | | this.page1.currentPage = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("页码" + val); |
| | | }, |
| | | rowSave(form, done, loading) { |
| | | // console.log("save1"); |
| | | this.forms = 0; |
| | | var that = this; |
| | | //先获取部门接口 |
| | | getDeptLazyTree().then((res) => { |
| | | var d = res.data.data; |
| | | that.treeData = d; |
| | | // console.log(d); |
| | | }); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | delete row.tenantid; |
| | | delete row.regstsat; |
| | | console.log(row, 0); |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(row); |
| | | return remove(row.creditcode, row.departmentid); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定批量将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(this.ids); |
| | | // return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crudrec.toggleSelection(); |
| | | }); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | rowClick(row) { |
| | | // console.log(row); |
| | | // row.identificationnumber; //统一社会信用代 码 |
| | | window.localStorage.setItem("danweidata", JSON.stringify(row)); |
| | | this.$router.push({ |
| | | path: "/securityUnitChild", |
| | | // redirect: { name: "foo" }, |
| | | query: { rowsecurity: "fromSecurity" }, |
| | | // params: { row: row.identificationnumber }, |
| | | }); |
| | | }, |
| | | //跳转到附近列表页面 |
| | | handleUploadPage(row) { |
| | | this.$router.push({ |
| | | path: `/resource/attachCopy`, |
| | | query: { |
| | | deptId: row.departmentid, |
| | | enterprisename: row.enterprisename, |
| | | }, |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.userInfo.role_id == "1414840172333842433") { |
| | | console.log("是公安add jurisdiction"); |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | } |
| | | params["stats"] = 0; |
| | | this.loading = true; |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | window.localStorage.setItem("danweidataS", JSON.stringify(this.data)); |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // nodeClick(data) {//分局 不在这添加 |
| | | // // this.treeDeptId = data.id; |
| | | // // this.page.currentPage = 1; |
| | | // // this.onLoad(this.page); |
| | | // // this.$message.success(JSON.stringify(data)); |
| | | // this.obj0["departmentid"] = data.title; |
| | | // this.obj1["departmentid"] = data.title; |
| | | // this.obj2["departmentid"] = data.title; |
| | | // this.obj0["useid"] = data.id; |
| | | // this.obj1["useid"] = data.id; |
| | | // this.obj2["useid"] = data.id; |
| | | // this.nobumen = 1; |
| | | // }, |
| | | tip0() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj0) { |
| | | for (var i in column0) { |
| | | if (k == column0[i].prop && k != "title0") { |
| | | d[k] = this.obj0[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 0); |
| | | this.data0 = d; |
| | | this.forms = 1; |
| | | }, |
| | | tip1() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj1) { |
| | | for (var i in column1) { |
| | | if (k == column1[i].prop && k != "title1") { |
| | | d[k] = this.obj1[k]; |
| | | } |
| | | } |
| | | } |
| | | d["capital"] = d["capital2"]; |
| | | delete d["capital2"]; |
| | | // console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 1); |
| | | this.data1 = d; |
| | | this.forms = 2; |
| | | }, |
| | | tip2() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj2) { |
| | | for (var i in column2) { |
| | | if (k == column2[i].prop && k != "title2") { |
| | | d[k] = this.obj2[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | d["cardid"] = d["cardid2"]; |
| | | delete d["cardid2"]; |
| | | d["cell"] = d["cell2"]; |
| | | delete d["cell2"]; |
| | | // d["shareholdingratio"] = d["shareholdingratio2"]; |
| | | // delete d["shareholdingratio2"]; |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 2); |
| | | this.data2 = d; |
| | | |
| | | // this.data0.departmentid = this.data0.useid; |
| | | // this.data1.departmentid = this.data1.useid; |
| | | // this.data2.departmentid = this.data2.useid; |
| | | // delete this.data0.useid; |
| | | // delete this.data1.useid; |
| | | // delete this.data2.useid; |
| | | |
| | | adddata(this.data0).then((res) => { |
| | | console.log(res, 0); |
| | | }); |
| | | adddata1(this.data1).then((res) => { |
| | | console.log(res, 1); |
| | | }); |
| | | adddata2(this.data2).then((res) => { |
| | | console.log(res, 2); |
| | | }); |
| | | var time = setTimeout(() => { |
| | | this.onLoad(this.page, this.query); |
| | | console.log(this.data0, this.data1, this.data2, "已刷新"); |
| | | }, 500); |
| | | this.tipover(); |
| | | }, |
| | | tip1up1() { |
| | | this.forms = 0; |
| | | }, |
| | | tip2up2() { |
| | | this.forms = 1; |
| | | }, |
| | | tipover() { |
| | | this.forms = -1; |
| | | this.obj0 = { |
| | | title0: "保安单位基本信息", |
| | | }; |
| | | this.obj1 = { |
| | | title1: "保安单位出资人员", |
| | | }; |
| | | this.obj2 = { |
| | | title2: "主要管理人员信息", |
| | | }; |
| | | this.data0 = {}; |
| | | this.data1 = {}; |
| | | this.data2 = {}; |
| | | this.noshehuibianma = 0; |
| | | this.nobumen = 0; |
| | | }, |
| | | panduanmeiyouziduan() { |
| | | if (this.noshehuibianma == 0) { |
| | | this.$message.warning("请输入统一社会信用代码"); |
| | | return true; |
| | | } |
| | | if (this.nobumen == 0) { |
| | | return false; |
| | | this.$message.warning("请选则部门"); |
| | | } |
| | | return false; |
| | | }, |
| | | }, |
| | | watch: { |
| | | haveID() { |
| | | // console.log(this.haveID); |
| | | if (this.haveID != undefined) { |
| | | if (this.haveID.length > 5) { |
| | | //统一社会信用代码判断 |
| | | this.noshehuibianma = 1; |
| | | } else { |
| | | this.noshehuibianma = 0; |
| | | } |
| | | } |
| | | }, |
| | | havedata() { |
| | | console.log(this.havedata, "qqqqq"); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .securityUnit { |
| | | width: 100%; |
| | | height: 100%; |
| | | // border: 1px solid #000; |
| | | box-sizing: border-box; |
| | | } |
| | | // .el-card__body { |
| | | // padding-bottom: 5px !important; |
| | | // } |
| | | // .avue-crud__tip, |
| | | // .el-tag, |
| | | // .el-tag--light { |
| | | // padding: 0 !important; |
| | | // } |
| | | |
| | | .lod { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba($color: #000000, $alpha: 0.5); |
| | | padding: 100px 0 0 0; |
| | | z-index: 500 !important; |
| | | display: flex; |
| | | // align-items: center; |
| | | justify-content: center; |
| | | .trees { |
| | | z-index: 501 !important; |
| | | position: absolute; |
| | | width: 15%; |
| | | top: 100px; |
| | | left: 0; |
| | | // display: none; |
| | | } |
| | | .lod-in { |
| | | width: 70%; |
| | | height: auto; |
| | | background-color: transparent; |
| | | |
| | | // padding: 10px 0 0 0; |
| | | } |
| | | |
| | | .el-collapse-item { |
| | | padding-top: 15px !important; |
| | | } |
| | | } |
| | | .el-collapse { |
| | | border-top: 1px solid transparent !important; |
| | | } |
| | | </style> |
| New file |
| | |
| | | <template> |
| | | <basic-container> |
| | | <div class="securityUnit"> |
| | | <avue-crud |
| | | :option="option" |
| | | :data="data" |
| | | :page.sync="page" |
| | | ref="crudrec" |
| | | @on-load="onLoad" |
| | | :table-loading="loading" |
| | | @row-save="rowSave" |
| | | @search-change="searchChange" |
| | | @search-reset="searchReset" |
| | | @row-update="rowUpdate" |
| | | @row-del="rowDel" |
| | | @selection-change="selectionChange" |
| | | @refresh-change="refreshChange" |
| | | @row-click="rowClick" |
| | | > |
| | | <template slot-scope="{ type, size, row }" slot="menu"> |
| | | <el-button |
| | | :size="size" |
| | | :type="type" |
| | | @click="handleUploadPage(row)" |
| | | icon="el-icon-circle-check" |
| | | >附件上传 |
| | | </el-button> |
| | | </template> |
| | | <template slot="menuLeft"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="small" |
| | | plain |
| | | @click.stop="rowSave" |
| | | >新增</el-button |
| | | > |
| | | |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-delete" |
| | | @click="handleDelete" |
| | | >删 除 |
| | | </el-button> |
| | | <el-button |
| | | type="success" |
| | | size="small" |
| | | plain |
| | | icon="el-icon-upload2" |
| | | @click="handleImport1" |
| | | >批量导入 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div class="lod" v-show="forms != -1"> |
| | | <div class="lod-in"> |
| | | <!-- <el-col class="trees" v-if="forms == 0"> |
| | | <div class="box"> |
| | | <el-scrollbar> |
| | | <basic-container> |
| | | <avue-tree |
| | | :option="treeOption" |
| | | :data="treeData" |
| | | @node-click="nodeClick" |
| | | /> |
| | | </basic-container> |
| | | </el-scrollbar> |
| | | </div> |
| | | </el-col> --> |
| | | <avue-form |
| | | ref="form" |
| | | v-model="obj0" |
| | | :option="option0" |
| | | v-if="forms == 0" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip0">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form1" |
| | | v-model="obj1" |
| | | :option="option1" |
| | | v-else-if="forms == 1" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip1up1">上一页</el-button> |
| | | <el-button type="primary" @click="tip1">下一页</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | <avue-form |
| | | ref="form2" |
| | | v-model="obj2" |
| | | :option="option2" |
| | | v-else-if="forms == 2" |
| | | > |
| | | <template slot="menuForm"> |
| | | <el-button type="primary" @click="tip2up2">上一页</el-button> |
| | | <el-button type="primary" @click="tip2">提交</el-button> |
| | | <el-button type="info" @click="tipover">取消</el-button> |
| | | </template> |
| | | </avue-form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | title="保安单位导入" |
| | | append-to-body |
| | | :visible.sync="excelBox1" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption1" |
| | | v-model="excelForm1" |
| | | :upload-after="uploadAfter1" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate1"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | </basic-container> |
| | | </template> |
| | | |
| | | <script> |
| | | import { column, column0, column1, column2 } from "./data"; |
| | | import { |
| | | getdata, |
| | | adddata, |
| | | update, |
| | | remove, |
| | | adddata1, |
| | | adddata2, |
| | | getDeptLazyTree, |
| | | } from "@/api/securityUnit/securityUnit"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | data() { |
| | | var w = 160, |
| | | s = 12; |
| | | return { |
| | | excelBox1: false, |
| | | excelForm1: {}, |
| | | excelOption1: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "文件上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "文件上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/information/import-informaton", |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | }, |
| | | |
| | | loading: true, //保安单位基本信息 |
| | | selectionList: [], |
| | | page: { |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | | total: 0, |
| | | }, |
| | | |
| | | treeData: [], |
| | | treeOption: { |
| | | title: "我是标题", |
| | | filterText: "搜索关键字自定义", |
| | | defaultExpandAll: true, |
| | | addBtn: false, |
| | | menu: false, |
| | | size: "small", |
| | | formOption: { |
| | | labelWidth: 100, |
| | | column: [ |
| | | { |
| | | label: "自定义项", |
| | | prop: "label", |
| | | }, |
| | | ], |
| | | }, |
| | | props: { |
| | | labelText: "标题", |
| | | label: "title", |
| | | value: "id", |
| | | children: "children", |
| | | }, |
| | | }, |
| | | // treeOption: { |
| | | // nodeKey: "id", |
| | | // // lazy: true, |
| | | // // treeLoad: function (node, resolve) { |
| | | // // // const parentId = node.level === 0 ? 0 : node.data.id; |
| | | // // getDeptLazyTree().then((res) => { |
| | | // // resolve( |
| | | // // res.data.data.map((item) => { |
| | | // // console.log({ |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }); |
| | | // // return { |
| | | // // ...item, |
| | | // // leaf: !item.hasChildren, |
| | | // // }; |
| | | // // }) |
| | | // // ); |
| | | // // }); |
| | | // // }, |
| | | // addBtn: false, |
| | | // menu: false, |
| | | // size: "small", |
| | | // props: { |
| | | // labelText: "标题", |
| | | // label: "title", |
| | | // value: "value", |
| | | // children: "children", |
| | | // }, |
| | | // }, |
| | | |
| | | obj0: { |
| | | title0: "保安单位基本信息", |
| | | }, |
| | | option0: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column0, |
| | | }, |
| | | obj1: { |
| | | title1: "保安单位出资人员", |
| | | }, |
| | | option1: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column1, |
| | | }, |
| | | obj2: { |
| | | title2: "主要管理人员信息", |
| | | }, |
| | | option2: { |
| | | emptyBtn: false, |
| | | submitBtn: false, |
| | | gutter: 30, |
| | | column: column2, |
| | | }, |
| | | |
| | | forms: -1, |
| | | data0: {}, |
| | | data1: {}, |
| | | data2: {}, |
| | | b0: {}, |
| | | b1: {}, |
| | | b2: {}, |
| | | noshehuibianma: 0, |
| | | nobumen: 0, |
| | | |
| | | query: {}, |
| | | data: [], |
| | | option: { |
| | | index: true, |
| | | addBtn: false, |
| | | // card: true, |
| | | tip: false, |
| | | searchSize: "mini", |
| | | searchMenuSpan: 6, |
| | | height: 583, |
| | | menuWidth: 220, |
| | | align: "center", |
| | | selection: true, |
| | | column: column, |
| | | }, |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapGetters(["userInfo"]), |
| | | ids() { |
| | | let ids = []; |
| | | this.selectionList.forEach((ele) => { |
| | | ids.push(ele.creditcode); |
| | | }); |
| | | return ids.join(","); |
| | | }, |
| | | ids1() { |
| | | let ids1 = []; |
| | | this.selectionList1.forEach((ele) => { |
| | | ids1.push(ele.id); |
| | | }); |
| | | return ids1.join(","); |
| | | }, |
| | | ids2() { |
| | | let ids2 = []; |
| | | this.selectionList2.forEach((ele) => { |
| | | ids2.push(ele.id); |
| | | }); |
| | | return ids2.join(","); |
| | | }, |
| | | haveID() { |
| | | return this.obj0.creditcode; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleImport1() { |
| | | this.excelBox1 = true; |
| | | }, |
| | | uploadAfter1(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox1 = false; |
| | | // this.refreshChange(); |
| | | done(); |
| | | }, |
| | | handleTemplate1() { |
| | | window.open(`/api/examSubjectChoices/export-template`); |
| | | }, |
| | | |
| | | // handleChangeTABS(column) { |
| | | // this.typeTABS = column; |
| | | // // this.$message.success(JSON.stringify(column)); |
| | | // if (column.prop == "tab1") { |
| | | // this.loading1 = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad(this.page); |
| | | // } else if (column.prop == "tab2") { |
| | | // this.loading = false; |
| | | // this.loading2 = false; |
| | | // this.onLoad1(this.page1); //第二个表格不会自动执行 |
| | | // } else if (column.prop == "tab3") { |
| | | // this.loading1 = false; |
| | | // this.loading = false; |
| | | // this.onLoad2(this.page2); //第二个表格不会自动执行 |
| | | // } |
| | | // }, |
| | | //保安单位基本信息 |
| | | sizeChange(val) { |
| | | this.page1.currentPage = 1; |
| | | this.page1.pageSize = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("行数" + val); |
| | | }, |
| | | currentChange(val) { |
| | | this.page1.currentPage = val; |
| | | // this.getData(); |
| | | this.onLoad(this.page, this.query); |
| | | // this.$message.success("页码" + val); |
| | | }, |
| | | rowSave(form, done, loading) { |
| | | // console.log("save1"); |
| | | this.forms = 0; |
| | | var that = this; |
| | | //先获取部门接口 |
| | | getDeptLazyTree().then((res) => { |
| | | var d = res.data.data; |
| | | that.treeData = d; |
| | | // console.log(d); |
| | | }); |
| | | }, |
| | | searchChange(params, done) { |
| | | this.query = params; |
| | | this.page.currentPage = 1; |
| | | this.onLoad(this.page, params); |
| | | done(); |
| | | }, |
| | | searchReset() { |
| | | this.query = {}; |
| | | this.onLoad(this.page); |
| | | }, |
| | | rowUpdate(row, index, done, loading) { |
| | | delete row.tenantid; |
| | | delete row.regstsat; |
| | | console.log(row, 0); |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | }, |
| | | rowDel(row) { |
| | | this.$confirm("确定将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(row); |
| | | return remove(row.creditcode, row.departmentid); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | }); |
| | | }, |
| | | selectionChange(list) { |
| | | this.selectionList = list; |
| | | }, |
| | | handleDelete() { |
| | | if (this.selectionList.length === 0) { |
| | | this.$message.warning("请选择至少一条数据"); |
| | | return; |
| | | } |
| | | this.$confirm("确定批量将选择数据删除?", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | console.log(this.ids); |
| | | // return remove(this.ids); |
| | | }) |
| | | .then(() => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | this.$refs.crudrec.toggleSelection(); |
| | | }); |
| | | }, |
| | | refreshChange() { |
| | | this.onLoad(this.page, this.query); |
| | | }, |
| | | rowClick(row) { |
| | | // console.log(row); |
| | | // row.identificationnumber; //统一社会信用代 码 |
| | | window.localStorage.setItem("danweidata", JSON.stringify(row)); |
| | | this.$router.push({ |
| | | path: "/securityUnitChild", |
| | | // redirect: { name: "foo" }, |
| | | query: { rowsecurity: "fromSecurity" }, |
| | | // params: { row: row.identificationnumber }, |
| | | }); |
| | | }, |
| | | //跳转到附近列表页面 |
| | | handleUploadPage(row) { |
| | | this.$router.push({ |
| | | path: `/resource/attachCopy`, |
| | | query: { |
| | | deptId: row.departmentid, |
| | | enterprisename: row.enterprisename, |
| | | }, |
| | | }); |
| | | }, |
| | | onLoad(page, params = {}) { |
| | | if (this.userInfo.role_id == "1414840172333842433") { |
| | | console.log("是公安add jurisdiction"); |
| | | params["jurisdiction"] = this.userInfo.jurisdiction; |
| | | } |
| | | params["stats"] = 4; |
| | | this.loading = true; |
| | | getdata( |
| | | page.currentPage, |
| | | page.pageSize, |
| | | Object.assign(params, this.query) |
| | | ).then((res) => { |
| | | const data = res.data.data; |
| | | this.page.total = data.total; |
| | | this.data = data.records; |
| | | window.localStorage.setItem("danweidataS", JSON.stringify(this.data)); |
| | | console.log(this.data); |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // nodeClick(data) {//分局 不在这添加 |
| | | // // this.treeDeptId = data.id; |
| | | // // this.page.currentPage = 1; |
| | | // // this.onLoad(this.page); |
| | | // // this.$message.success(JSON.stringify(data)); |
| | | // this.obj0["departmentid"] = data.title; |
| | | // this.obj1["departmentid"] = data.title; |
| | | // this.obj2["departmentid"] = data.title; |
| | | // this.obj0["useid"] = data.id; |
| | | // this.obj1["useid"] = data.id; |
| | | // this.obj2["useid"] = data.id; |
| | | // this.nobumen = 1; |
| | | // }, |
| | | tip0() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj0) { |
| | | for (var i in column0) { |
| | | if (k == column0[i].prop && k != "title0") { |
| | | d[k] = this.obj0[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 0); |
| | | this.data0 = d; |
| | | this.forms = 1; |
| | | }, |
| | | tip1() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj1) { |
| | | for (var i in column1) { |
| | | if (k == column1[i].prop && k != "title1") { |
| | | d[k] = this.obj1[k]; |
| | | } |
| | | } |
| | | } |
| | | d["capital"] = d["capital2"]; |
| | | delete d["capital2"]; |
| | | // console.log(d); |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 1); |
| | | this.data1 = d; |
| | | this.forms = 2; |
| | | }, |
| | | tip2() { |
| | | if (this.panduanmeiyouziduan()) { |
| | | return; |
| | | } |
| | | var d = {}; |
| | | for (var k in this.obj2) { |
| | | for (var i in column2) { |
| | | if (k == column2[i].prop && k != "title2") { |
| | | d[k] = this.obj2[k]; |
| | | } |
| | | } |
| | | } |
| | | console.log(d); |
| | | d["cardid"] = d["cardid2"]; |
| | | delete d["cardid2"]; |
| | | d["cell"] = d["cell2"]; |
| | | delete d["cell2"]; |
| | | // d["shareholdingratio"] = d["shareholdingratio2"]; |
| | | // delete d["shareholdingratio2"]; |
| | | for (var k in d) { |
| | | if (d[k] == "" || d[k] == undefined) { |
| | | console.log(k); |
| | | this.$message.warning("请检查表单是否填写完整!"); |
| | | return; |
| | | } |
| | | } |
| | | console.log(d, 2); |
| | | this.data2 = d; |
| | | |
| | | // this.data0.departmentid = this.data0.useid; |
| | | // this.data1.departmentid = this.data1.useid; |
| | | // this.data2.departmentid = this.data2.useid; |
| | | // delete this.data0.useid; |
| | | // delete this.data1.useid; |
| | | // delete this.data2.useid; |
| | | |
| | | adddata(this.data0).then((res) => { |
| | | console.log(res, 0); |
| | | }); |
| | | adddata1(this.data1).then((res) => { |
| | | console.log(res, 1); |
| | | }); |
| | | adddata2(this.data2).then((res) => { |
| | | console.log(res, 2); |
| | | }); |
| | | var time = setTimeout(() => { |
| | | this.onLoad(this.page, this.query); |
| | | console.log(this.data0, this.data1, this.data2, "已刷新"); |
| | | }, 500); |
| | | this.tipover(); |
| | | }, |
| | | tip1up1() { |
| | | this.forms = 0; |
| | | }, |
| | | tip2up2() { |
| | | this.forms = 1; |
| | | }, |
| | | tipover() { |
| | | this.forms = -1; |
| | | this.obj0 = { |
| | | title0: "保安单位基本信息", |
| | | }; |
| | | this.obj1 = { |
| | | title1: "保安单位出资人员", |
| | | }; |
| | | this.obj2 = { |
| | | title2: "主要管理人员信息", |
| | | }; |
| | | this.data0 = {}; |
| | | this.data1 = {}; |
| | | this.data2 = {}; |
| | | this.noshehuibianma = 0; |
| | | this.nobumen = 0; |
| | | }, |
| | | panduanmeiyouziduan() { |
| | | if (this.noshehuibianma == 0) { |
| | | this.$message.warning("请输入统一社会信用代码"); |
| | | return true; |
| | | } |
| | | if (this.nobumen == 0) { |
| | | return false; |
| | | this.$message.warning("请选则部门"); |
| | | } |
| | | return false; |
| | | }, |
| | | }, |
| | | watch: { |
| | | haveID() { |
| | | // console.log(this.haveID); |
| | | if (this.haveID != undefined) { |
| | | if (this.haveID.length > 5) { |
| | | //统一社会信用代码判断 |
| | | this.noshehuibianma = 1; |
| | | } else { |
| | | this.noshehuibianma = 0; |
| | | } |
| | | } |
| | | }, |
| | | havedata() { |
| | | console.log(this.havedata, "qqqqq"); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss"> |
| | | .securityUnit { |
| | | width: 100%; |
| | | height: 100%; |
| | | // border: 1px solid #000; |
| | | box-sizing: border-box; |
| | | } |
| | | // .el-card__body { |
| | | // padding-bottom: 5px !important; |
| | | // } |
| | | // .avue-crud__tip, |
| | | // .el-tag, |
| | | // .el-tag--light { |
| | | // padding: 0 !important; |
| | | // } |
| | | |
| | | .lod { |
| | | position: absolute; |
| | | top: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | height: 100%; |
| | | background-color: rgba($color: #000000, $alpha: 0.5); |
| | | padding: 100px 0 0 0; |
| | | z-index: 500 !important; |
| | | display: flex; |
| | | // align-items: center; |
| | | justify-content: center; |
| | | .trees { |
| | | z-index: 501 !important; |
| | | position: absolute; |
| | | width: 15%; |
| | | top: 100px; |
| | | left: 0; |
| | | // display: none; |
| | | } |
| | | .lod-in { |
| | | width: 70%; |
| | | height: auto; |
| | | background-color: transparent; |
| | | |
| | | // padding: 10px 0 0 0; |
| | | } |
| | | |
| | | .el-collapse-item { |
| | | padding-top: 15px !important; |
| | | } |
| | | } |
| | | .el-collapse { |
| | | border-top: 1px solid transparent !important; |
| | | } |
| | | </style> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getList, add, remove, update,updateAudit } from "@/api/examapi/examination"; |
| | | import { |
| | | getList, |
| | | add, |
| | | remove, |
| | | update, |
| | | updateAudit, |
| | | } from "@/api/examapi/examination"; |
| | | import { auditColumn } from "./data"; |
| | | export default { |
| | | data() { |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | width:200, |
| | | width: 200, |
| | | }, |
| | | // { |
| | | // label: "试卷分数", |
| | |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd HH:mm", |
| | | valueFormat: "yyyy-MM-dd HH:mm", |
| | | hide:true, |
| | | hide: true, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | | // 表单新增时是否可见 |
| | |
| | | label: "备注", |
| | | prop: "remark", |
| | | span: 24, |
| | | hide:true, |
| | | hide: true, |
| | | slot: true, |
| | | // 表单新增时是否禁止 |
| | | addDisabled: false, |
| | |
| | | this.questionBankPage.pageSize = pageSize; |
| | | }, |
| | | //审核 |
| | | submit(row,done,loading){ |
| | | submit(row, done, loading) { |
| | | updateAudit(row).then( |
| | | () => { |
| | | this.dialogFormVisible = false; |
| | |
| | | }, |
| | | // 新增 |
| | | questionBankRowSave(row, done, loading) { |
| | | row.startTime = row.startTime+":00"; |
| | | row.startTime = row.startTime + ":00"; |
| | | // row.endTime = row.examTime[1]; |
| | | // row.examTime = JSON.stringify(row.examTime); |
| | | add(row).then( |
| | |
| | | // if (Array.isArray(row.examTime) != true) { |
| | | // row.examTime = row.examTime.split(","); |
| | | // } |
| | | row.startTime = row.startTime+":00"; |
| | | row.startTime = row.startTime + ":00"; |
| | | // row.endTime = row.examTime[1]; |
| | | // row.examTime = JSON.stringify(row.examTime); |
| | | update(row).then( |
| | |
| | | plain |
| | | icon="el-icon-folder-checked" |
| | | @click="handleBatchExam" |
| | | |
| | | >考试申请 |
| | | </el-button> |
| | | <el-button |
| | |
| | | :type="type" |
| | | size="small" |
| | | icon="el-icon-receiving" |
| | | :disabled="row.candidateNo==''" |
| | | :disabled="row.candidateNo == ''" |
| | | @click="handlePrint(row)" |
| | | >准考证打印 |
| | | </el-button> |
| | |
| | | </avue-crud> |
| | | |
| | | <el-dialog |
| | | title="清册数据导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | title="清册数据导入" |
| | | append-to-body |
| | | :visible.sync="excelBox" |
| | | width="555px" |
| | | > |
| | | <avue-form |
| | | :option="excelOption" |
| | | v-model="excelForm" |
| | | :upload-after="uploadAfter" |
| | | > |
| | | <template slot="excelTemplate"> |
| | | <el-button type="primary" @click="handleTemplate"> |
| | | 点击下载<i class="el-icon-download el-icon--right"></i> |
| | | </el-button> |
| | | </template> |
| | | </avue-form> |
| | | </el-dialog> |
| | | |
| | | |
| | | <el-dialog |
| | | title="考试申请" |
| | | append-to-body |
| | | :visible.sync="dialogExamFormVisible" |
| | | width="1000px" |
| | | @close='closeDialog' |
| | | @close="closeDialog" |
| | | > |
| | | <avue-form |
| | | ref="formExamApply" |
| | |
| | | update, |
| | | remove, |
| | | cancelTrain, |
| | | addExam |
| | | addExam, |
| | | } from "@/api/trainingRegistration/trainingRegistration"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | loading: true, |
| | | excelBox:false, |
| | | dialogExamFormVisible:false, |
| | | excelBox: false, |
| | | dialogExamFormVisible: false, |
| | | optionExamApply: { |
| | | height: "auto", |
| | | filterBtn: true, |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | }, |
| | | excelForm: {}, |
| | | excelOption: { |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | submitBtn: false, |
| | | emptyBtn: false, |
| | | column: [ |
| | | { |
| | | label: "模板上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | label: "模板上传", |
| | | prop: "excelFile", |
| | | type: "upload", |
| | | drag: true, |
| | | loadText: "模板上传中,请稍等", |
| | | span: 24, |
| | | propsHttp: { |
| | | res: "data", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/trainingRegistration/import-trainingRegistration", |
| | | }, |
| | | tip: "请上传 .xls,.xlsx 标准格式文件", |
| | | action: "/api/trainingRegistration/import-trainingRegistration", |
| | | }, |
| | | { |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | label: "模板下载", |
| | | prop: "excelTemplate", |
| | | formslot: true, |
| | | span: 24, |
| | | }, |
| | | ], |
| | | ], |
| | | }, |
| | | selectionList: [], |
| | | page: { |
| | |
| | | methods: { |
| | | //准考证查看 |
| | | handlePrint(row) { |
| | | var obj = row; |
| | | obj["name"] = "准考证信息"; |
| | | this.$router.push({ |
| | | path: `/applyexam/papers`, |
| | | query: obj, |
| | | }); |
| | | var obj = row; |
| | | obj["name"] = "准考证信息"; |
| | | this.$router.push({ |
| | | path: `/applyexam/papers`, |
| | | query: obj, |
| | | }); |
| | | }, |
| | | sizeChange(val) { |
| | | this.page1.currentPage = 1; |
| | |
| | | }, |
| | | |
| | | handleTemplate() { |
| | | window.open( |
| | | `/api/trainingRegistration/export-template` |
| | | ); |
| | | window.open(`/api/trainingRegistration/export-template`); |
| | | }, |
| | | uploadAfter(res, done, loading, column) { |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | window.console.log(column); |
| | | this.excelBox = false; |
| | | this.refreshChange(); |
| | | done(); |
| | | }, |
| | | |
| | | //生成考试弹窗 |
| | | handleBatchExam(){ |
| | | handleBatchExam() { |
| | | this.dialogExamFormVisible = true; |
| | | if (this.selectionList.length === 0) { |
| | | this.ids = ""; |
| | | } |
| | | }, |
| | | //生成考试 |
| | | submitExamApply(row, done, loading){ |
| | | submitExamApply(row, done, loading) { |
| | | var that = this; |
| | | var startTime = row.startTime+":00"; |
| | | var startTime = row.startTime + ":00"; |
| | | // var endTime = row.examTime[1]; |
| | | // var examTime = JSON.stringify(row.examTime); |
| | | // console.log(this.ids,111); |
| | |
| | | ); |
| | | }, |
| | | //关闭窗口清除数据 |
| | | closeDialog(){ |
| | | closeDialog() { |
| | | this.$refs.formExamApply.resetFields(); |
| | | }, |
| | | }, |
| | |
| | | editBtnText: "回复", |
| | | updateBtnText: "提交", |
| | | editTitle: "回复", |
| | | border: false, |
| | | border: true, //liu |
| | | index: true, |
| | | stripe: true, |
| | | viewBtn: true, |
| | |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | border: false, |
| | | border: true, //liu |
| | | addBtnText: "发起", |
| | | index: true, |
| | | stripe: true, |