瀏覽代碼

物料新增,编辑删除,列表

lupeng 1 年之前
父節點
當前提交
bc7c850374
共有 2 個文件被更改,包括 127 次插入60 次删除
  1. 18 0
      src/common/configs/dictDataUtil.ts
  2. 109 60
      src/views/base/materials/columns.ts

+ 18 - 0
src/common/configs/dictDataUtil.ts

@@ -18,6 +18,24 @@ const DictDataUtil = {
     device_run_status: "device_run_status",
     //设备维护频率
     device_maintenance_cycle: "device_maintenance_cycle",
+    //物料属性
+    material_properties:"material_properties",
+    //单位
+    unit:"danwei_type",
+    //物料级别
+    material_level:"material_level",
+    //质检方案
+    quality_testing_plan:"quality_testing_plan",
+    //适用平台
+    applicable_platforms:"applicable_platforms",
+    //质量等级
+    quality_grade:"quality_grade",
+    //选用类型
+    selection_type:"selection_type",
+    //阶段
+    stage:"stage",
+    //封装方法
+    packaging_method:"packaging_method",
   },
   EXPAND_FIELD_TABLE: {
     //映射表列表

+ 109 - 60
src/views/base/materials/columns.ts

@@ -1,82 +1,90 @@
 import { useDictionaryStoreHook } from "@/store";
 const { dicts } = useDictionaryStoreHook();
-
+import dictDataUtil from "@/common/configs/dictDataUtil";
 export const columns = [
-  { label: "客户型号", prop: "customervodel", search: true },
-  { label: "生产厂家", prop: "manufacturer", search: true },
-  { label: "物料编码", prop: "materialCode", search: true },
-  { label: "物料名称", prop: "materialName", search: true },
-  { label: "保质期", prop: "qualityGuaranteePeriod", search: true },
-
-  { label: "筛选规范", prop: "selectionSpec", search: true },
-  { label: "物料规格", prop: "spec", search: true },
-  {
-    label: "适用平台",
-    prop: "applicablePlatformsDictValue",
-    search: true,
-    filterable: true,
-    type: "select",
-    dataType: "string",
-    dicData: dicts.applicable_platforms,
-    props: { label: "dictLabel", value: "dictValue" },
-  },
+  { label: "物料编码", prop: "materialCode", search: true ,rules: [{
+      required: true,
+      message: "请填写物料编码",
+      trigger: "blur"
+    }],},
+  { label: "物料名称", prop: "materialName", search: true ,rules: [{
+      required: true,
+      message: "请填写物料名称",
+      trigger: "blur"
+    }],},
   {
     label: "物料属性",
     prop: "attributeDictValue",
     search: true,
     filterable: true,
-    type: "select",
-    dataType: "string",
-    dicData: dicts.material_properties,
+    type: 'select',
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.material_properties,
     props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择物料属性",
+      trigger: "blur"
+    }],
   },
+  { label: "物料规格", prop: "spec", search: true,rules: [{
+      required: true,
+      message: "请填写物料规格",
+      trigger: "blur"
+    }], },
   {
-    label: "是否工装",
-    prop: "frock",
+    label: "单位",
+    prop: "unitDictValue",
     search: true,
     filterable: true,
-    type: "radio", //类型为单选框
-    dicData: [
-      {
-        label: "否",
-        value: 0,
-      },
-      {
-        label: "是",
-        value: 1,
-      },
-    ],
-    value: 0,
+    type: "select",
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.unit,
+    props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择单位",
+      trigger: "blur"
+    }],
   },
   {
-    label: "质检方案",
-    prop: "inspectDictValue",
+    label: "物料级别",
+    prop: "levelDictValue",
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.quality_testing_plan,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.material_level,
     props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择物料级别",
+      trigger: "blur"
+    }],
   },
+  { label: "生产厂家", prop: "manufacturer", search: true ,rules: [{
+      required: true,
+      message: "请填写生产厂家",
+      trigger: "blur"
+    }],},
   {
-    label: "物料级别",
-    prop: "levelDictValue",
+    label: "质检方案",
+    prop: "inspectDictValue",
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.material_level,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.quality_testing_plan,
     props: { label: "dictLabel", value: "dictValue" },
   },
   {
-    label: "封装方法",
-    prop: "packageDictValue",
+    label: "适用平台",
+    prop: "applicablePlatformsDictValue",
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.packaging_method,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.applicable_platforms,
     props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+     required: true, message: "请选择适用平台",
+     trigger: "blur"
+    }],
   },
   {
     label: "质量等级",
@@ -84,9 +92,13 @@ export const columns = [
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.quality_grade,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.quality_grade,
     props: { label: "dictLabel", value: "dictValue" },
+    rules: [{
+      required: true,
+      message: "请选择质量等级",
+      trigger: "blur"
+    }],
   },
   {
     label: "选用类型",
@@ -94,29 +106,66 @@ export const columns = [
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.selection_type,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.selection_type,
     props: { label: "dictLabel", value: "dictValue" },
   },
   {
-    label: "阶段",
+    label: "产品阶段",
     prop: "stageDictValue",
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.stage,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.stage,
     props: { label: "dictLabel", value: "dictValue" },
   },
+  { label: "客户型号", prop: "customerModel", search: true },
+  { label: "保质期(天)", prop: "qualityGuaranteePeriod", search: true },
+
+
+
+
+
+
   {
-    label: "物料单位",
-    prop: "unitDictValue",
+    label: "封装方法",
+    prop: "packageDictValue",
     search: true,
     filterable: true,
     type: "select",
-    dataType: "string",
-    dicData: dicts.danwei_type,
+    dicUrl:dictDataUtil.request_url+dictDataUtil.TYPE_CODE.packaging_method,
     props: { label: "dictLabel", value: "dictValue" },
   },
-  { label: "备注", prop: "remark", type: "textarea", search: true },
+
+  {
+    label: "是否工装",
+    prop: "frock",
+    search: true,
+    filterable: true,
+    type: "radio", //类型为单选框
+    dicData: [
+      {
+        label: "是",
+        value: 1,
+      },
+      {
+        label: "否",
+        value: 0,
+      },
+
+    ],
+    value: 1,
+    rules: [{
+      required: true,
+      message: "是否工装",
+      trigger: "blur"
+    }],
+  },
+
+
+
+
+
+  { label: "筛选规范", prop: "selectionSpec", search: true , type: "textarea",span:18},
+
+  { label: "备注", prop: "remark", type: "textarea", span:18 },
 ];