ソースを参照

Merge branch 'qingban' of http://maven.jgiot.com:7012/jiaxiaoqiang/JG-ADMIN-TEMP into qingban

huhao@jgai.com 3 ヶ月 前
コミット
f01a9bbcfe

+ 8 - 0
src/api/report/index.ts

@@ -40,3 +40,11 @@ export function getOperationInfo(data: string) {
     data,
   });
 }
+
+// 获取工单编码
+export function getJobInfo(orderId: string, opType: string) {
+  return request({
+    url: `/api/v1/plan/workOrder/workOrderCode/${orderId}/${opType}`,
+    method: "get",
+  });
+}

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

@@ -8,7 +8,6 @@
       <div class="processInfo">
         <span>工艺名称:{{ routeOperationData?.processRouteName }}</span>
         <span>产品名称:{{ routeOperationData?.prodtName }}</span>
-        <span>产品编码:{{ routeOperationData?.prodtCode }}</span>
         <span>产品型号: {{ routeOperationData?.prodtModel }}</span>
       </div>
       <el-button :icon="Back" size="small" @click="back">返回</el-button>
@@ -804,8 +803,9 @@ const convertToSnakeLayout = () => {
 }
 
 .processInfo span {
-  margin: 0 150px 0 150px;
+  margin-left: 100px;
 }
+
 .processInfo {
   position: absolute;
   left: 5%;

+ 9 - 13
src/views/base/information/index.vue

@@ -64,12 +64,12 @@
           >编辑</el-button
         >
         <el-button
-          @click="downloadFile(row, index)"
-          :loading="downloadBtnLoading"
+          @click="downloadFile(row)"
+          :loading="row?.downloadBtnLoading"
           text
           type="primary"
           v-hasPerm="[buttonPermission.BasicData.BTNS.picture_download]"
-        >下载</el-button
+          >下载</el-button
         >
       </template>
       <template #menu-left="{ size }">
@@ -172,8 +172,6 @@ onMounted?.(() => {
   dataEditList();
 });
 
-
-
 const onSelectedFinish = (selectedValue) => {
   form.value.associationCode = selectedValue.materialCode;
   form.value.associationName = selectedValue.materialName;
@@ -426,9 +424,8 @@ const deleteRecord = (row, index, done) => {
 };
 
 const downloadBtnLoading = ref(false);
-const downloadFile = async (row, index, done) => {
-
-  downloadBtnLoading.value = true;
+const downloadFile = async (row) => {
+  row.downloadBtnLoading = true;
   let url = import.meta.env.VITE_APP_UPLOAD_URL + row.drawingPath;
 
   // 1. 获取资源并转为Blob
@@ -441,15 +438,14 @@ const downloadFile = async (row, index, done) => {
   // 3. 创建隐藏a标签触发下载
   const link = document.createElement("a");
   link.href = tempUrl;
-  link.download = row.filename;
+  link.download = row.fileName;
   link.style.display = "none";
   document.body.appendChild(link);
   link.click();
 
   // 4. 清理内存
   URL.revokeObjectURL(tempUrl);
-  document.body.removeChild(link)
-  downloadBtnLoading.value = false;
-}
-
+  document.body.removeChild(link);
+  row.downloadBtnLoading = false;
+};
 </script>

+ 82 - 5
src/views/plan/workOrder/index.vue

@@ -337,7 +337,7 @@ import { checkPerm } from "@/directive/permission";
 import { queryDictDataByType } from "@/api/system/dict";
 import { getProExcel } from "@/api/excel";
 import { exportDataInfo } from "@/api/order";
-import { getWorkshopData } from "@/api/report";
+import { getJobInfo, getWorkshopData } from "@/api/report";
 import ButtonPermKeys from "@/common/configs/buttonPermission";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
 const updateTitle = ref("生产随工单");
@@ -656,6 +656,16 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
 const opGroupShow = ref(true);
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const groupStri = ref({});
+const switchOp = [
+  {
+    label: "否",
+    value: 0,
+  },
+  {
+    label: "是",
+    value: 1,
+  },
+];
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   searchEnter: true,
@@ -663,6 +673,7 @@ option.value = Object.assign(option.value, {
   selection: true,
   viewBtn: false,
   editBtn: false,
+  labelWidth: 120,
   column: [
     {
       label: "生产批号",
@@ -893,6 +904,9 @@ option.value = Object.assign(option.value, {
             }
           }
         });
+        if (value) {
+          getOpGroup(value);
+        }
       },
       rules: [
         {
@@ -903,6 +917,17 @@ option.value = Object.assign(option.value, {
       ],
     },
     {
+      label: "工单编号",
+      prop: "workOrderCode",
+      rules: [
+        {
+          required: true,
+          message: "工单编号不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
       label: "分组标识",
       prop: "opGroup",
       width: "100",
@@ -1036,21 +1061,43 @@ option.value = Object.assign(option.value, {
       overHidden: true,
     },
     {
-      label: "工单数量",
-      prop: "planNum",
-      width: 85,
+      label: "管号最小值",
+      prop: "seqMin",
       type: "number",
       min: 1,
       max: 99999,
       rules: [
         {
           required: true,
-          message: "工单数量不能为空",
+          message: "管号最小值不能为空",
           trigger: "trigger",
         },
       ],
     },
     {
+      label: "管号最大值",
+      prop: "seqMax",
+      type: "number",
+      min: 1,
+      max: 99999,
+      blur: () => {
+        countPlanNum();
+      },
+      rules: [
+        {
+          required: true,
+          message: "管号最小值不能为空",
+          trigger: "trigger",
+        },
+      ],
+    },
+    {
+      label: "工单数量",
+      prop: "planNum",
+      width: 85,
+      disabled: true,
+    },
+    {
       label: "检验批号",
       width: 85,
       display: false,
@@ -1106,6 +1153,22 @@ option.value = Object.assign(option.value, {
       prop: "packageUrl",
       hide: true,
     },
+    {
+      label: "水汽",
+      prop: "waterVapor",
+      span: 12,
+      type: "switch",
+      dicData: switchOp,
+      value: 0,
+    },
+    {
+      label: "DPA",
+      prop: "dpa",
+      span: 12,
+      type: "switch",
+      dicData: switchOp,
+      value: 0,
+    },
   ],
 });
 
@@ -1125,4 +1188,18 @@ onMounted(() => {
     editBtn: checkPerm(buttonPermission.PLAN.BTNS.work_order_edit),
   };
 });
+
+// 选择完前工序或者后工序后获取这个
+const getOpGroup = (value) => {
+  getJobInfo(form.value.orderCode, value + "").then((res) => {
+    form.value.workOrderCode = res.data;
+  });
+};
+
+// 输入完最大值和最小值计算工单数量
+const countPlanNum = () => {
+  if (form.value.seqMax && form.value.seqMin) {
+    form.value.planNum = form.value.seqMax - form.value.seqMin + 1;
+  }
+};
 </script>