广丰卷烟厂数采质量分析系统
zhuguifei
7 天以前 2b31fa203f3435a582be51f45899d99164c9917a
ruoyi-plus-soybean/src/views/qm/std/modules/std-operate-drawer.vue
old mode 100644 new mode 100755
@@ -45,30 +45,27 @@
function createDefaultModel(): Model {
  return {
      id: '',
      stdCode: '',
      stdName: '',
      cdate: null,
      ver: null,
      enable: null,
      itemCod: '',
      itemNam: '',
      typ: null,
      stdDes: '',
      checkLevel: null,
      category: null,
      matfltype: '',
      matflname: ''
    id: '',
    stdCode: '',
    stdName: '',
    cdate: null,
    ver: null,
    enable: null,
    itemCod: '',
    itemNam: '',
    typ: null,
    stdDes: '',
    checkLevel: null,
    category: null,
    matfltype: '',
    matflname: ''
  };
}
type RuleKey = Extract<
  keyof Model,
  | 'id'
>;
type RuleKey = Extract<keyof Model, 'id'>;
const rules: Record<RuleKey, App.Global.FormRule> = {
  id: createRequiredRule('编码不能为空'),
  id: createRequiredRule('编码不能为空')
};
function handleUpdateModelWhenEdit() {
@@ -86,16 +83,60 @@
async function handleSubmit() {
  await validate();
  const { id, stdCode, stdName, cdate, ver, enable, itemCod, itemNam, typ, stdDes, checkLevel, category, matfltype, matflname } = model.value;
  const {
    id,
    stdCode,
    stdName,
    cdate,
    ver,
    enable,
    itemCod,
    itemNam,
    typ,
    stdDes,
    checkLevel,
    category,
    matfltype,
    matflname
  } = model.value;
  // request
  if (props.operateType === 'add') {
    const { error } = await fetchCreateStd({ stdCode, stdName, cdate, ver, enable, itemCod, itemNam, typ, stdDes, checkLevel, category, matfltype, matflname });
    const { error } = await fetchCreateStd({
      stdCode,
      stdName,
      cdate,
      ver,
      enable,
      itemCod,
      itemNam,
      typ,
      stdDes,
      checkLevel,
      category,
      matfltype,
      matflname
    });
    if (error) return;
  }
  if (props.operateType === 'edit') {
    const { error } = await fetchUpdateStd({ id, stdCode, stdName, cdate, ver, enable, itemCod, itemNam, typ, stdDes, checkLevel, category, matfltype, matflname });
    const { error } = await fetchUpdateStd({
      id,
      stdCode,
      stdName,
      cdate,
      ver,
      enable,
      itemCod,
      itemNam,
      typ,
      stdDes,
      checkLevel,
      category,
      matfltype,
      matflname
    });
    if (error) return;
  }
@@ -143,7 +184,10 @@
          <NInput v-model:value="model.itemNam" placeholder="请输入检验项目名称" />
        </NFormItem>
        <NFormItem label="判定类型  0-手动判定,1-上下限判定,2-平均值判定,3-SD值判定,4-CV值判定,5-超标数判定" path="typ">
          <NInput v-model:value="model.typ" placeholder="请输入判定类型  0-手动判定,1-上下限判定,2-平均值判定,3-SD值判定,4-CV值判定,5-超标数判定" />
          <NInput
            v-model:value="model.typ"
            placeholder="请输入判定类型  0-手动判定,1-上下限判定,2-平均值判定,3-SD值判定,4-CV值判定,5-超标数判定"
          />
        </NFormItem>
        <NFormItem label="备注" path="stdDes">
          <NInput v-model:value="model.stdDes" placeholder="请输入备注" />