mould.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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="权限设置"
  64. :visible="visible"
  65. :reload="reload"
  66. width="700px"
  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. visible: false,
  117. reload: 0,
  118. form: {},
  119. ruleoptions: [
  120. {
  121. value: "按行号",
  122. label: "按行号",
  123. },
  124. {
  125. value: "按科室分配",
  126. label: "按科室分配",
  127. },
  128. {
  129. value: "按负责人分配",
  130. label: "按负责人分配",
  131. },
  132. {
  133. value: "所有人员",
  134. label: "",
  135. },
  136. ],
  137. chargeoptions: [
  138. {
  139. label: "科室名称1",
  140. value: "科室名称1",
  141. children: [
  142. {
  143. label: "负责人",
  144. value: "负责人",
  145. children: [{ label: "尹强", value: "尹强" }],
  146. },
  147. ],
  148. },
  149. ],
  150. template_visible: false,
  151. issue_visible: false,
  152. table_loading: false,
  153. table_search: {},
  154. table_form: [
  155. {
  156. label: "模板名称",
  157. props: "template_name",
  158. type: "input",
  159. },
  160. ],
  161. table_list: [],
  162. table_handle: [
  163. {
  164. label: "新增模板",
  165. props: "add",
  166. },
  167. ],
  168. table_handle_row: [
  169. {
  170. label: "下发",
  171. props: "issue",
  172. },
  173. {
  174. label: "查看",
  175. props: "detail",
  176. },
  177. {
  178. label: "删除",
  179. props: "delete",
  180. popconfirm: true,
  181. },
  182. ],
  183. table_config: [
  184. {
  185. label: "模板名称",
  186. props: "template_name",
  187. },
  188. {
  189. label: "配置时间",
  190. props: "template_date",
  191. },
  192. {
  193. label: "配置工号",
  194. props: "template_number",
  195. },
  196. {
  197. label: "模板分类",
  198. props: "template_class",
  199. },
  200. {
  201. label: "模板状态",
  202. props: "template_status",
  203. },
  204. {
  205. label: "模板类型",
  206. props: "template_type",
  207. },
  208. ],
  209. };
  210. },
  211. methods: {
  212. async handleInit() {
  213. this.table_loading = true;
  214. const data = [];
  215. let index = 0;
  216. while (index < 10) {
  217. data.push({
  218. template_name: `模板${index}`,
  219. template_date: "2021-12-01 12:00:00",
  220. template_number: `NUMBER${index}`,
  221. template_class: `部门绩效${index}`,
  222. template_status: `在用`,
  223. template_type: `科室绩效${index}`,
  224. });
  225. index = index + 1;
  226. }
  227. this.total = index;
  228. this.table_list = data;
  229. this.table_loading = false;
  230. },
  231. handleSearch({ template_name }) {
  232. this.table_search = { template_name };
  233. this.handleReset();
  234. this.handleInit();
  235. },
  236. handleAdd() {
  237. this.visible = true;
  238. },
  239. // 级联选择
  240. handleCascader(data) {
  241. console.log(data, "data");
  242. },
  243. handleChange(page) {
  244. this.page = page;
  245. this.handleInit();
  246. },
  247. handleVisible(props) {
  248. switch (props) {
  249. case "template":
  250. this.template_visible = !this.template_visible;
  251. break;
  252. case "issue":
  253. this.issue_visible = !this.issue_visible;
  254. }
  255. },
  256. handleReset() {
  257. this.page = 1;
  258. },
  259. handleConfirm(visible) {
  260. this.reload++;
  261. this.params = {};
  262. this.visible = visible;
  263. console.log(this.params, "handleConFirm");
  264. },
  265. handleCancel(data) {
  266. this.reload++;
  267. this.params = {};
  268. this.visible = data;
  269. console.log(data, "handleCancel");
  270. },
  271. },
  272. mounted() {
  273. this.handleInit();
  274. },
  275. };
  276. </script>
  277. <style></style>