houjie
2023-08-19 a01a0b502447a0ca0a45f1849cde4f0bed1ef1f8
src/views/spare/modules/sparePartScrapRequirement/SparePartScrapRequirementForm.vue
@@ -18,12 +18,20 @@
                v-model='model.departId'
                dictCode="sys_depart,depart_name,id,del_flag!='1'"
              />-->
              <a-select
              <a-tree-select
                style="width: 100%"
                :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
                :tree-data="treeData"
                placeholder="请选择申请部门"
                tree-default-expand-all
                v-model='model.departId'
              />
<!--              <a-select
                :placeholder="'请选择申请部门'"
                :options="this.departs"
                style="width: 100%"
                v-model='model.departId'
              />
              />-->
            </a-form-model-item>
          </a-col>
          <a-col :span='12'>
@@ -94,6 +102,7 @@
  },
  data() {
    return {
      treeData:[],
      bordered:true,
      departs: [],
      labelCol: {
@@ -293,6 +302,7 @@
        add: '/spare/sparePartRequirement/add',
        edit: '/spare/sparePartRequirement/edit',
        queryById: '/spare/sparePartRequirement/queryById',
        loadOptions: '/sys/sysDepart/loadDepartTreeOptions',
        getSysDeparts: "/eam/equipment/getSysDeparts",
        sparesScrapRequirementDetail: {
          list: '/spare/sparePartRequirement/querySparesScrapRequirementDetailByMainId'
@@ -326,9 +336,18 @@
    })
  },
  created() {
    this.getSysDeparts()
    this.initOptions()
  },
  methods: {
    initOptions() {
      getAction(this.url.loadOptions).then(res => {
        if (res.success) {
          this.treeData = res.result
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    getSysDeparts() {
      getAction(this.url.getSysDeparts).then((res) => {
        if (res.success) {