Просмотр исходного кода

所有的批量报工设置为1,且不可修改。绑定工序,组件添加辅料采集。

jiaxiaoqiang 5 месяцев назад
Родитель
Сommit
d423930f38

+ 9 - 0
src/api/craft/process/index.ts

@@ -26,6 +26,15 @@ export function addBatch(data: object) {
     data: data,
   });
 }
+// 新增工序采集辅料
+export function addFuliao(data: object) {
+  return request({
+    url: "/api/v1/operationAccessoryItem/addBatch",
+    method: "post",
+    data: data,
+  });
+}
+
 //批量新增esop
 export function addEsopBatch(data: object) {
   return request({

Разница между файлами не показана из-за своего большого размера
+ 9 - 0
src/assets/icons/fuliaoCJ.svg


+ 68 - 0
src/components/CommonTable/configs/tableConfig.ts

@@ -785,4 +785,72 @@ export const tableConfig = {
       },
     ],
   },
+  FULIAO_CAIJI: {
+    url: "/api/v1/base/accessories/material",
+    column: [
+      {
+        label: "辅料属性",
+        prop: "accessoriesProperty",
+        search: true,
+        type: "select",
+        dicData: dicts.accessories_property,
+        props: {
+          label: "dictLabel",
+          value: "dictValue",
+        },
+        rules: [
+          {
+            required: true,
+            message: "辅料属性不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+      {
+        label: "物料编码",
+        prop: "materialCode",
+        clearable: false,
+        search: true,
+        rules: [
+          {
+            required: true,
+            message: "生产物料编码不能为空",
+            trigger: "change",
+          },
+        ],
+      },
+      {
+        label: "物料名称",
+        prop: "materialName",
+        addDisplay: false,
+        editDisplay: false,
+        search: true,
+      },
+      {
+        label: "物料规格",
+        prop: "spec",
+        addDisplay: false,
+        editDisplay: false,
+        search: true,
+      },
+      {
+        label: "辅料类型",
+        prop: "accessoriesType",
+        search: true,
+        type: "select",
+        dicData: dicts.accessories_type,
+        props: {
+          label: "dictLabel",
+          value: "dictValue",
+        },
+        rules: [
+          {
+            required: true,
+            message: "辅料类型不能为空",
+            trigger: "blur",
+          },
+        ],
+      },
+    ],
+  },
 };

+ 1 - 0
src/store/modules/dictionary.ts

@@ -37,6 +37,7 @@ export const useDictionaryStore = defineStore("dictionaryStore", () => {
     "warehouse_type",
     "signature_type",
     "signature_attribution",
+    "accessories_property",
   ];
   const dicts = ref<{ [key: string]: any[] }>({});
 

+ 2 - 1
src/views/base/craftManagement/route/bindConfig.ts

@@ -179,9 +179,10 @@ export const formOption = {
       label: "批量报工",
       prop: "batchReport",
       span: 24,
+      disabled: true,
       type: "switch",
       dicData: switchOp,
-      value: 0,
+      value: 1,
     },
     {
       label: "是否可跳过",

+ 2 - 0
src/views/base/craftManagement/route/bindProcess.vue

@@ -259,6 +259,8 @@ function isJSON(str) {
 }
 const avueKey = ref(false);
 const nodeClick = (event) => {
+  // 所有的批量报工设置为1
+  event.node.batchReport = 1;
   if (usableStatus.value == false && !editStatus.value) return;
   if (!editStatus.value) {
     selectNode.value = event.node;

+ 44 - 0
src/views/base/craftManagement/route/components/bottomTable.vue

@@ -88,6 +88,7 @@ import {
   addBatch,
   addEsopBatch,
   addCheckBatch,
+  addFuliao,
 } from "@/api/craft/process/index";
 import SingleUpload from "@/components/Upload/SingleUpload.vue";
 
@@ -226,6 +227,18 @@ const startCreat = () => {
         reserveSelection: true,
       });
     });
+  } else if (props.tableType === "fuliaoCJ") {
+    commonTableType.value = "FULIAO_CAIJI";
+
+    nextTick(() => {
+      commonTableRef.value?.startSelect({
+        accessoriesProperty: "2", //默认直接查所有的部件辅料)
+      });
+      commonTableRef.value?.mergeOption({
+        selection: true,
+        reserveSelection: true,
+      });
+    });
   } else {
     crudRef.value && crudRef.value.rowAdd();
   }
@@ -257,6 +270,7 @@ const esopList = ref([]);
 const checkItem = ref({});
 const checkList = ref([]);
 const onSelectedFinish = (itemValue) => {
+  console.log(itemValue);
   if (Object.keys(itemValue).length == 0) {
     ElMessage.error("请选择数据,数据不能为空!");
   }
@@ -357,6 +371,36 @@ const onSelectedFinish = (itemValue) => {
         });
       }
     });
+  } else if (props.tableType === "fuliaoCJ") {
+    itemValue?.forEach((item, index) => {
+      const recordItem = ref({});
+      recordItem.value.itemName = item.materialName;
+      recordItem.value.itemCode = item.materialCode;
+      recordItem.value.itemModel = item.spec;
+      recordItem.value.recordVersion = item.bomVersion;
+      recordItem.value.num = item.materialNumber;
+      recordItem.value.traceType = "S";
+      recordItem.value.operationId = route.params.id;
+      recordItem.value.unit = item.unit;
+      recordItem.value.isTrace = 1;
+      itemRecordList.value.push(recordItem.value);
+    });
+    itemRecord.value.operationId = route.params.id;
+    itemRecord.value.itemList = Array.from(itemRecordList.value);
+    addFuliao(itemRecord.value).then((data) => {
+      if (data.code == "200") {
+        dataList();
+        ElMessage({
+          message: data.msg,
+          type: "success",
+        });
+      } else {
+        ElMessage({
+          message: data.msg,
+          type: "error",
+        });
+      }
+    });
   }
 };
 

+ 64 - 0
src/views/base/craftManagement/route/components/configs.ts

@@ -111,6 +111,66 @@ export const getTableConfig = (id: string) => {
         },
       ],
     },
+    // 辅料采集
+    fuliaoCJ: {
+      url: "/api/v1/operationAccessoryItem",
+      column: [
+        {
+          label: "工序id",
+          prop: "operationId",
+          display: false,
+          hide: true,
+          value: id,
+        },
+        {
+          label: "物料名称",
+          prop: "itemName",
+          addDisabled: true,
+          editDisabled: true,
+        },
+        {
+          label: "物料版本号",
+          prop: "recordVersion",
+          addDisabled: true,
+          editDisabled: true,
+        },
+        {
+          label: "物料编码",
+          prop: "itemCode",
+          addDisabled: true,
+          editDisabled: true,
+        },
+        {
+          label: "物料规格",
+          prop: "itemModel",
+          addDisabled: true,
+          editDisabled: true,
+        },
+        {
+          label: "是否需要",
+          prop: "isTrace",
+          type: "radio", //类型为单选框
+          dicData: [
+            {
+              label: "需采集物料",
+              value: 1,
+            },
+            {
+              label: "非必须采集物料",
+              value: 0,
+            },
+          ],
+          value: 1,
+          rules: [
+            {
+              required: true,
+              message: "是否需要",
+              trigger: "blur",
+            },
+          ],
+        },
+      ],
+    },
     dianjian: {
       url: `/api/v1/op/operationCheck`,
       column: [
@@ -332,6 +392,10 @@ export const comTypes: comType[] = [
     compentType: "wuliaocaiji",
   },
   {
+    compentName: "辅料采集",
+    compentType: "fuliaoCJ",
+  },
+  {
     compentName: "ESOP",
     compentType: "ESOP",
   },