houjie
2023-08-21 d1135f31a7dae36d04bd2f47936dbd5a39fba9e3
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: {
@@ -215,16 +224,18 @@
            width: '200px',
            placeholder: '请输入${title}',
            defaultValue: 0,
            formatter({ cellValue, row, column }) {
            Function({cellValue, row, column}){
              console.log(cellValue)
              console.log(row)
              console.log(column)
              if (cellValue != null) {
                let conversionRatio = row.conversionRatio
                console.log(conversionRatio)
                row.auxiliaryQuantity = Math.abs(cellValue * conversionRatio)
              }
              console.log(cellValue)
              return cellValue
            },
            validateRules: [
              {
@@ -293,6 +304,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 +338,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) {
@@ -375,8 +396,6 @@
            auxiliaryUnitId: data[i].auxiliaryUnitId,
            mainUnitIdName: data[i].mainUnitId_dictText,
            auxiliaryUnitIdName: data[i].auxiliaryUnitId_dictText,
            mainQuantity: data[i].mainQuantity,
            auxiliaryQuantity: data[i].auxiliaryQuantity,
            requirementTime: data[i].requirementTime,
            conversionRatio: data[i].conversionRatio