Fixiaobai
2023-11-17 f19edc96af3261347f48cb8f66f1f5b2feb6071e
src/views/plan/outsourcingorder/outsourcingorder-form.vue
@@ -9,7 +9,7 @@
      :rules="dataRule"
      :disabled="editable"
      ref="dataForm"
      label-width="100px"
      label-width="110px"
      class="l-mes"
    >
      <el-row :gutter="10">
@@ -37,6 +37,7 @@
        <el-col :span="12">
          <el-form-item label="需求数量" prop="qtyRequired">
            <el-input
              style="width:100%"
              v-model="dataForm.qtyRequired"
              @change="checkNumber()"
            ></el-input>
@@ -61,6 +62,18 @@
            <el-input v-model="dataForm.remark"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="是否外协直发" prop="foreignState">
            <el-switch
            v-model="dataForm.foreignState"
            active-text="是"
            inactive-text="否"
            active-value="0"
            inactive-value="1"
            active-color="#13ce66">
            </el-switch>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <span slot="footer" class="dialog-footer">
@@ -82,7 +95,8 @@
  addOutsourcingOrder,
  putOutsourcingOrder
} from '@/api/plan/outsourcingorder'
import { validateSixDecimalNotNull } from '@/util/validate'
import { getObj } from '@/api/plan/masterproductionschedule'
import { validatePositiveInteger } from '@/util/validate'
import partDialog from '@/views/common/part.vue'
export default {
@@ -102,13 +116,14 @@
        qtyRequired: '',
        requiredDate: '',
        remark: '',
        mpsId: null
        mpsId: null,
        foreignState: null,
      },
      dataRule: {
        partId: [{ required: true, message: '零件不能为空', trigger: 'blur' }],
        qtyRequired: [
          { required: true, message: '需求数量不能为空', trigger: 'blur' },
          { validator: validateSixDecimalNotNull, trigger: 'blur' }
          { validator: validatePositiveInteger, trigger: 'blur' },
        ],
        requiredDate: [
          { required: true, message: '需求日期不能为空', trigger: 'blur' }
@@ -119,7 +134,7 @@
  },
  created() {},
  methods: {
    init(id, masterProductionSchedule) {
    init(id, masterProductionSchedule,mpsId) {
      this.dataForm.id = id || 0
      this.visible = true
      this.$nextTick(() => {
@@ -129,13 +144,14 @@
            this.dataForm = response.data.data
          })
        }
        // 从主生产计划过来的,带上零件
        if (masterProductionSchedule) {
          this.dataForm.qtyRequired = masterProductionSchedule.qtyRequired
          this.dataForm.partNo = masterProductionSchedule.partNo
          this.dataForm.partName = masterProductionSchedule.partName
          this.dataForm.partId = masterProductionSchedule.partId
          this.dataForm.mpsId = masterProductionSchedule.id
          this.dataForm.qtyRequired = masterProductionSchedule.qtyRequired
          this.dataForm.requiredDate = masterProductionSchedule.requiredDate
        }
      })
@@ -179,7 +195,8 @@
      }
    },
    // 检验需求数量
    checkNumber() {},
    checkNumber() {
    },
    // 检验需求日期
    checkDate() {}
  },