zouyu
2024-03-06 6ac64fea29fa0df01f9d0e70372e086de9725aa1
src/views/plan/manufacturingorder/edit-order-operation.vue
@@ -36,15 +36,17 @@
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="因素单位" prop="runTimeCodeDb">
          <el-form-item label="是否专检" prop="isSpecialIns">
            <el-select
              v-model="dataForm.runTimeCodeDb"
              placeholder="因素单位"
              v-model="dataForm.isSpecialIns"
              placeholder="是否专检"
              style="width: 100%"
            >
              <el-option
                v-for="item in runTimeCodeDbOptions"
                v-for="item in isSpecialIns"
                :key="item.id"
                :label="item.label"
                :value="item.value"
@@ -53,7 +55,7 @@
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
      <!-- <el-row>
        <el-col :span="12">
          <el-form-item label="机器运转因素" prop="machRunFactor">
            <el-input
@@ -136,7 +138,7 @@
          </el-form-item>
        </el-col>
        <el-col :span="12"> </el-col>
      </el-row>
      </el-row> -->
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="innerVisible = false">取 消</el-button>
@@ -152,20 +154,20 @@
  props: {
    currshowlist: {
      type: Boolean,
      default: false
      default: false,
    },
    currOrderOperation: {
      type: Object,
      default: () => {
        return {}
      }
    }
      },
    },
  },
  data() {
    return {
      innerVisible: false,
      workCenterOptions: [],
      runTimeCodeDbOptions: [],
      isSpecialIns: [{ label: '是', value: true} ,{label: '否', value: false }],
      dataForm: {
        id: 0,
        workCenter: null,
@@ -177,34 +179,34 @@
        runTimeCodeDb: null,
        crewSize: 1,
        outsideOpItem: null,
        moId: null
        moId: null,
      },
      dataRule: {
        workCenter: [
          { required: true, message: '工作中心不能为空', trigger: 'change' }
          { required: true, message: '工作中心不能为空', trigger: 'change' },
        ],
        machRunFactor: [
          { required: true, message: '机器运转因素不能为空', trigger: 'blur' },
          { validator: validateSixDecimalPositives, trigger: 'blur' }
          { validator: validateSixDecimalPositives, trigger: 'blur' },
        ],
        machSetupTime: [
          { required: true, message: '机器设置时间不能为空', trigger: 'blur' },
          { validator: validateSixDecimalPositives, trigger: 'blur' }
          { validator: validateSixDecimalPositives, trigger: 'blur' },
        ],
        laborRunFactor: [
          { required: true, message: '劳力运转因素不能为空', trigger: 'blur' },
          { validator: validateSixDecimalPositives, trigger: 'blur' }
          { validator: validateSixDecimalPositives, trigger: 'blur' },
        ],
        laborSetupTime: [
          { required: true, message: '劳力设置时间不能为空', trigger: 'blur' },
          { validator: validateSixDecimalPositives, trigger: 'blur' }
          { validator: validateSixDecimalPositives, trigger: 'blur' },
        ],
        runTimeCodeDb: [
          { required: true, message: '因素单位不能为空', trigger: 'change' }
        ]
          { required: true, message: '因素单位不能为空', trigger: 'change' },
        ],
      },
      laborClassNoOptions: [],
      outsideOpItemOptions: []
      outsideOpItemOptions: [],
    }
  },
  methods: {
@@ -253,14 +255,21 @@
                const data = response.data
                if (data.code === 0) {
                  this.currOrderOperation.workCenter = this.dataForm.workCenter
                  this.currOrderOperation.machRunFactor = this.dataForm.machRunFactor
                  this.currOrderOperation.machSetupTime = this.dataForm.machSetupTime
                  this.currOrderOperation.laborClassNo = this.dataForm.laborClassNo
                  this.currOrderOperation.laborRunFactor = this.dataForm.laborRunFactor
                  this.currOrderOperation.laborSetupTime = this.dataForm.laborSetupTime
                  this.currOrderOperation.runTimeCodeDb = this.dataForm.runTimeCodeDb
                  this.currOrderOperation.machRunFactor =
                    this.dataForm.machRunFactor
                  this.currOrderOperation.machSetupTime =
                    this.dataForm.machSetupTime
                  this.currOrderOperation.laborClassNo =
                    this.dataForm.laborClassNo
                  this.currOrderOperation.laborRunFactor =
                    this.dataForm.laborRunFactor
                  this.currOrderOperation.laborSetupTime =
                    this.dataForm.laborSetupTime
                  this.currOrderOperation.runTimeCodeDb =
                    this.dataForm.runTimeCodeDb
                  this.currOrderOperation.crewSize = this.dataForm.crewSize
                  this.currOrderOperation.outsideOpItem = this.dataForm.outsideOpItem
                  this.currOrderOperation.outsideOpItem =
                    this.dataForm.outsideOpItem
                  this.innerVisible = false
                  this.$message.success('编辑成功')
                } else {
@@ -308,7 +317,7 @@
          this.outsideOpItemOptions = []
        }
      })
    }
    },
  },
  watch: {
    currshowlist() {
@@ -334,8 +343,10 @@
            this.dataForm.machRunFactor = this.currOrderOperation.machRunFactor
            this.dataForm.machSetupTime = this.currOrderOperation.machSetupTime
            this.dataForm.laborClassNo = this.currOrderOperation.laborClassNo
            this.dataForm.laborRunFactor = this.currOrderOperation.laborRunFactor
            this.dataForm.laborSetupTime = this.currOrderOperation.laborSetupTime
            this.dataForm.laborRunFactor =
              this.currOrderOperation.laborRunFactor
            this.dataForm.laborSetupTime =
              this.currOrderOperation.laborSetupTime
            this.dataForm.runTimeCodeDb =
              this.currOrderOperation.runTimeCodeDb == null
                ? '2'
@@ -343,11 +354,13 @@
            this.dataForm.crewSize = this.currOrderOperation.crewSize
            this.dataForm.outsideOpItem = this.currOrderOperation.outsideOpItem
            this.dataForm.moId = this.currOrderOperation.moId
            this.dataForm.isSpecialIns = this.currOrderOperation.isSpecialIns
          })
        })
      }
    }
  }
    },
  },
}
</script>
<style>