yyb
8 天以前 c0db1d4fa603e227695ffc8738a30843c28f5dd6
src/views/productionManagement/productionProcess/New.vue
@@ -40,8 +40,17 @@
            <el-option label="计件" :value="1" />
          </el-select>
        </el-form-item>
        <el-form-item label="工资定额" prop="salaryQuota">
          <el-input v-model="formState.salaryQuota" type="number" :step="0.001">
        <el-form-item
            label="工资定额"
            prop="salaryQuota"
            :rules="[
              {
                validator: validateSalaryQuota,
                trigger: ['blur', 'change']
              }
            ]"
        >
          <el-input v-model="formState.salaryQuota" type="number" :step="0.001" :min="0">
            <template #append>元</template>
          </el-input>
        </el-form-item>
@@ -95,6 +104,18 @@
let { proxy } = getCurrentInstance()
const validateSalaryQuota = (rule, value, callback) => {
  if (value === '' || value === null || value === undefined) {
    callback();
    return;
  }
  if (Number(value) < 0) {
    callback(new Error('工资定额不能小于0'));
    return;
  }
  callback();
};
const closeModal = () => {
  isShow.value = false;
};