mould.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <div>
  3. <div class="simple-container">
  4. <simple-form
  5. :form="table_form"
  6. :handle="table_handle"
  7. @search="handleSearch"
  8. @add="handleAdd"
  9. ></simple-form>
  10. <simple-table
  11. :list="table_list"
  12. :config="table_config"
  13. :loading="table_loading"
  14. :handle-row="table_handle_row"
  15. @issue="handleVisible('issue')"
  16. @detail="handleVisible('template')"
  17. ></simple-table>
  18. <simple-pagination
  19. :page="page"
  20. :total="total"
  21. @change="handleChange"
  22. ></simple-pagination>
  23. </div>
  24. <simple-dialog
  25. title="查看模板"
  26. width="1200px"
  27. @cancel="handleVisible('template')"
  28. @confirm="handleVisible('template')"
  29. :visible="template_visible"
  30. >
  31. <analysis />
  32. </simple-dialog>
  33. <simple-dialog
  34. title="下发"
  35. width="500px"
  36. @cancel="handleVisible('issue')"
  37. @confirm="handleVisible('issue')"
  38. :visible="issue_visible"
  39. >
  40. <el-form label-width="100px" :model="form">
  41. <el-form-item label="填报事由">
  42. <el-input v-model="form.name"></el-input>
  43. </el-form-item>
  44. <el-form-item label="填报注意事项">
  45. <el-input v-model="form.region"></el-input>
  46. </el-form-item>
  47. <el-form-item label="截止时间">
  48. <el-input v-model="form.type"></el-input>
  49. </el-form-item>
  50. <el-form-item label="">
  51. <el-upload
  52. drag
  53. action="https://jsonplaceholder.typicode.com/posts/"
  54. multiple
  55. >
  56. <i class="el-icon-upload"></i>
  57. <div>上传附件</div>
  58. </el-upload>
  59. </el-form-item>
  60. </el-form>
  61. </simple-dialog>
  62. <simple-dialog
  63. :title="title"
  64. :visible="visible"
  65. :reload="reload"
  66. :width="width"
  67. @confirm="handleConfirm"
  68. @cancel="handleCancel"
  69. >
  70. <el-form :model="form" label-width="80px">
  71. <el-form-item label="可编辑列"
  72. ><el-input v-model="form.editrows"
  73. /></el-form-item>
  74. <el-form-item label="权限规则">
  75. <el-select v-model="form.rule">
  76. <el-option
  77. v-for="item in ruleoptions"
  78. :key="item.value"
  79. :label="item.label"
  80. :value="item.value"
  81. ></el-option> </el-select
  82. ></el-form-item>
  83. <el-form-item label="负责人">
  84. <el-cascader-panel
  85. v-model="form.charge"
  86. :options="chargeoptions"
  87. clearable
  88. @change="handleCascader"
  89. ></el-cascader-panel
  90. ></el-form-item>
  91. </el-form>
  92. </simple-dialog>
  93. </div>
  94. </template>
  95. <script>
  96. import analysis from "./analysis.vue";
  97. import simpleForm from "./components/form.vue";
  98. import simpleTable from "./components/table.vue";
  99. import simpleDialog from "./components/dialog.vue";
  100. import simplePagination from "./components/pagination.vue";
  101. export default {
  102. components: {
  103. analysis,
  104. simpleTable,
  105. simpleDialog,
  106. simpleForm,
  107. simplePagination,
  108. },
  109. data() {
  110. return {
  111. page: 1,
  112. rows: 10,
  113. total: 0,
  114. form: {},
  115. // dialog
  116. title: "权限设置",
  117. visible: false,
  118. reload: 0,
  119. width: "700px",
  120. form: {},
  121. ruleoptions: [
  122. {
  123. value: "按行号",
  124. label: "按行号",
  125. },
  126. {
  127. value: "按科室分配",
  128. label: "按科室分配",
  129. },
  130. {
  131. value: "按负责人分配",
  132. label: "按负责人分配",
  133. },
  134. {
  135. value: "所有人员",
  136. label: "",
  137. },
  138. ],
  139. chargeoptions: [
  140. {
  141. label: "科室名称1",
  142. value: "科室名称1",
  143. children: [
  144. {
  145. label: "负责人",
  146. value: "负责人",
  147. children: [{ label: "尹强", value: "尹强" }],
  148. },
  149. ],
  150. },
  151. ],
  152. template_visible: false,
  153. issue_visible: false,
  154. table_loading: false,
  155. table_search: {},
  156. table_form: [
  157. {
  158. label: "模板名称",
  159. props: "template_name",
  160. type: "input",
  161. },
  162. ],
  163. table_list: [],
  164. table_handle: [
  165. {
  166. label: "新增模板",
  167. props: "add",
  168. },
  169. ],
  170. table_handle_row: [
  171. {
  172. label: "下发",
  173. props: "issue",
  174. },
  175. {
  176. label: "查看",
  177. props: "detail",
  178. },
  179. {
  180. label: "删除",
  181. props: "delete",
  182. popconfirm: true,
  183. },
  184. ],
  185. table_config: [
  186. {
  187. label: "模板名称",
  188. props: "template_name",
  189. },
  190. {
  191. label: "配置时间",
  192. props: "template_date",
  193. },
  194. {
  195. label: "配置工号",
  196. props: "template_number",
  197. },
  198. {
  199. label: "模板分类",
  200. props: "template_class",
  201. },
  202. {
  203. label: "模板状态",
  204. props: "template_status",
  205. },
  206. {
  207. label: "模板类型",
  208. props: "template_type",
  209. },
  210. ],
  211. };
  212. },
  213. methods: {
  214. async handleInit() {
  215. this.table_loading = true;
  216. const data = [];
  217. let index = 0;
  218. while (index < 10) {
  219. data.push({
  220. template_name: `模板${index}`,
  221. template_date: "2021-12-01 12:00:00",
  222. template_number: `NUMBER${index}`,
  223. template_class: `部门绩效${index}`,
  224. template_status: `在用`,
  225. template_type: `科室绩效${index}`,
  226. });
  227. index = index + 1;
  228. }
  229. this.total = index;
  230. this.table_list = data;
  231. this.table_loading = false;
  232. },
  233. handleSearch({ template_name }) {
  234. this.table_search = { template_name };
  235. this.handleReset();
  236. this.handleInit();
  237. },
  238. handleAdd() {
  239. this.visible = true;
  240. },
  241. // 级联选择
  242. handleCascader(data) {
  243. console.log(data, "data");
  244. },
  245. handleChange(page) {
  246. this.page = page;
  247. this.handleInit();
  248. },
  249. handleVisible(props) {
  250. switch (props) {
  251. case "template":
  252. this.template_visible = !this.template_visible;
  253. break;
  254. case "issue":
  255. this.issue_visible = !this.issue_visible;
  256. }
  257. },
  258. handleReset() {
  259. this.page = 1;
  260. },
  261. handleConfirm(visible) {
  262. this.reload++;
  263. this.params = {};
  264. this.visible = visible;
  265. console.log(this.params, "handleConFirm");
  266. },
  267. handleCancel(data) {
  268. this.reload++;
  269. this.params = {};
  270. this.visible = data;
  271. console.log(data, "handleCancel");
  272. },
  273. },
  274. mounted() {
  275. this.handleInit();
  276. },
  277. };
  278. </script>
  279. <style></style>