123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <template>
- <div>
- <div class="simple-container">
- <simple-form
- :form="table_form"
- :handle="table_handle"
- @search="handleSearch"
- @add="handleAdd"
- ></simple-form>
- <simple-table
- :list="table_list"
- :config="table_config"
- :loading="table_loading"
- :handle-row="table_handle_row"
- @issue="handleVisible('issue')"
- @detail="handleVisible('template')"
- ></simple-table>
- <simple-pagination
- :page="page"
- :total="total"
- @change="handleChange"
- ></simple-pagination>
- </div>
- <simple-dialog
- title="查看模板"
- width="1200px"
- @cancel="handleVisible('template')"
- @confirm="handleVisible('template')"
- :visible="template_visible"
- >
- <analysis />
- </simple-dialog>
- <simple-dialog
- title="下发"
- width="500px"
- @cancel="handleVisible('issue')"
- @confirm="handleVisible('issue')"
- :visible="issue_visible"
- >
- <el-form label-width="100px" :model="form">
- <el-form-item label="填报事由">
- <el-input v-model="form.name"></el-input>
- </el-form-item>
- <el-form-item label="填报注意事项">
- <el-input v-model="form.region"></el-input>
- </el-form-item>
- <el-form-item label="截止时间">
- <el-input v-model="form.type"></el-input>
- </el-form-item>
- <el-form-item label="">
- <el-upload
- drag
- action="https://jsonplaceholder.typicode.com/posts/"
- multiple
- >
- <i class="el-icon-upload"></i>
- <div>上传附件</div>
- </el-upload>
- </el-form-item>
- </el-form>
- </simple-dialog>
- <simple-dialog
- :title="title"
- :visible="visible"
- :reload="reload"
- :width="width"
- @confirm="handleConfirm"
- @cancel="handleCancel"
- >
- <el-form :model="form" label-width="80px">
- <el-form-item label="可编辑列"
- ><el-input v-model="form.editrows"
- /></el-form-item>
- <el-form-item label="权限规则">
- <el-select v-model="form.rule">
- <el-option
- v-for="item in ruleoptions"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option> </el-select
- ></el-form-item>
- <el-form-item label="负责人">
- <el-cascader-panel
- v-model="form.charge"
- :options="chargeoptions"
- clearable
- @change="handleCascader"
- ></el-cascader-panel
- ></el-form-item>
- </el-form>
- </simple-dialog>
- </div>
- </template>
- <script>
- import analysis from "./analysis.vue";
- import simpleForm from "./components/form.vue";
- import simpleTable from "./components/table.vue";
- import simpleDialog from "./components/dialog.vue";
- import simplePagination from "./components/pagination.vue";
- export default {
- components: {
- analysis,
- simpleTable,
- simpleDialog,
- simpleForm,
- simplePagination,
- },
- data() {
- return {
- page: 1,
- rows: 10,
- total: 0,
- form: {},
- // dialog
- title: "权限设置",
- visible: false,
- reload: 0,
- width: "700px",
- form: {},
- ruleoptions: [
- {
- value: "按行号",
- label: "按行号",
- },
- {
- value: "按科室分配",
- label: "按科室分配",
- },
- {
- value: "按负责人分配",
- label: "按负责人分配",
- },
- {
- value: "所有人员",
- label: "",
- },
- ],
- chargeoptions: [
- {
- label: "科室名称1",
- value: "科室名称1",
- children: [
- {
- label: "负责人",
- value: "负责人",
- children: [{ label: "尹强", value: "尹强" }],
- },
- ],
- },
- ],
- template_visible: false,
- issue_visible: false,
- table_loading: false,
- table_search: {},
- table_form: [
- {
- label: "模板名称",
- props: "template_name",
- type: "input",
- },
- ],
- table_list: [],
- table_handle: [
- {
- label: "新增模板",
- props: "add",
- },
- ],
- table_handle_row: [
- {
- label: "下发",
- props: "issue",
- },
- {
- label: "查看",
- props: "detail",
- },
- {
- label: "删除",
- props: "delete",
- popconfirm: true,
- },
- ],
- table_config: [
- {
- label: "模板名称",
- props: "template_name",
- },
- {
- label: "配置时间",
- props: "template_date",
- },
- {
- label: "配置工号",
- props: "template_number",
- },
- {
- label: "模板分类",
- props: "template_class",
- },
- {
- label: "模板状态",
- props: "template_status",
- },
- {
- label: "模板类型",
- props: "template_type",
- },
- ],
- };
- },
- methods: {
- async handleInit() {
- this.table_loading = true;
- const data = [];
- let index = 0;
- while (index < 10) {
- data.push({
- template_name: `模板${index}`,
- template_date: "2021-12-01 12:00:00",
- template_number: `NUMBER${index}`,
- template_class: `部门绩效${index}`,
- template_status: `在用`,
- template_type: `科室绩效${index}`,
- });
- index = index + 1;
- }
- this.total = index;
- this.table_list = data;
- this.table_loading = false;
- },
- handleSearch({ template_name }) {
- this.table_search = { template_name };
- this.handleReset();
- this.handleInit();
- },
- handleAdd() {
- this.visible = true;
- },
- // 级联选择
- handleCascader(data) {
- console.log(data, "data");
- },
- handleChange(page) {
- this.page = page;
- this.handleInit();
- },
- handleVisible(props) {
- switch (props) {
- case "template":
- this.template_visible = !this.template_visible;
- break;
- case "issue":
- this.issue_visible = !this.issue_visible;
- }
- },
- handleReset() {
- this.page = 1;
- },
- handleConfirm(visible) {
- this.reload++;
- this.params = {};
- this.visible = visible;
- console.log(this.params, "handleConFirm");
- },
- handleCancel(data) {
- this.reload++;
- this.params = {};
- this.visible = data;
- console.log(data, "handleCancel");
- },
- },
- mounted() {
- this.handleInit();
- },
- };
- </script>
- <style></style>
|