pblmRectifyUnit.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <a-form :model="rectifyInfo" :rules="rules" :label-col="{span: 6}" :wrapper-col="{span: 16}" ref="rectifyInfoForm">
  3. <a-form-item label="整改单位" prop="zgXianOrgId">
  4. <a-tree-select v-model:value="rectifyInfo.zgXianOrgId" style="width: 100%" :tree-data="rectifyUnits" :fieldNames="{children: 'children', value: 'id', title: 'label', key: 'id'}" search-placeholder="请选择整改单位" />
  5. </a-form-item>
  6. <a-form-item label="备注意见" prop="activityComment">
  7. <a-textarea v-model:value="rectifyInfo.activityComment" :rows="8" />
  8. </a-form-item>
  9. </a-form>
  10. </template>
  11. <script>
  12. import { hostUrl } from '../../../utils/global_variable';
  13. import { getOrgTreeJson } from '../Common/rectify_api';
  14. export default {
  15. data() {
  16. return {
  17. rectifyInfo: {
  18. zgXianOrgId: null,
  19. activityComment: '',
  20. },
  21. loadingStat: false,
  22. loadingStatText: '提交',
  23. rules: {},
  24. rectifyUnits: [],
  25. };
  26. },
  27. computed: {
  28. hostUrl() {
  29. return hostUrl;
  30. },
  31. },
  32. mounted() {
  33. this.rectifyUnits = this.getOrgTreeJson();
  34. },
  35. methods: {
  36. saveRectifyUnitInfo() {
  37. this.$refs.rectifyInfoForm.validate((valid) => {
  38. if (valid) {
  39. // console.dir(this.rectifyInfo);
  40. this.$emit('saveRectifyUnitInfo', this.rectifyInfo);
  41. this.$refs.rectifyInfoForm.resetFields();
  42. } else {
  43. return false;
  44. }
  45. });
  46. },
  47. getOrgTreeJson() {
  48. getOrgTreeJson().then((res) => {
  49. const jsonArray = [];
  50. const jsonStr = JSON.stringify(res.data);
  51. jsonArray.push(res.data);
  52. this.rectifyUnits = jsonArray;
  53. });
  54. },
  55. },
  56. };
  57. </script>
  58. <style lang='less' scoped>
  59. </style>