Browse Source

工序记录关联表单

qinhb 6 tháng trước cách đây
mục cha
commit
5b91a30994
2 tập tin đã thay đổi với 67 bổ sung1 xóa
  1. 7 0
      src/api/process/index.ts
  2. 60 1
      src/views/quality/handover/index.vue

+ 7 - 0
src/api/process/index.ts

@@ -93,4 +93,11 @@ export function saveOpDetails(queryParams: object) {
     data: queryParams,
   });
 }
+export function queryFormList(queryParams: object) {
+  return request({
+    url: "/api/v1/proRecord/queryForms",
+    method: "post",
+    data: queryParams,
+  });
+}
 

+ 60 - 1
src/views/quality/handover/index.vue

@@ -120,6 +120,17 @@
             <el-input v-model="scope.row.remark"></el-input>
           </template>
         </el-table-column>
+        <el-table-column prop="remark" label="关联表单" width="120">
+          <template  #default="scope">
+            <el-button
+                icon="el-icon-setting"
+                text
+                @click="formList(scope.row)"
+                type="primary"
+                size="small"
+            >表单列表</el-button>
+          </template>
+        </el-table-column>
       </el-table>
 
       <div
@@ -131,15 +142,41 @@
         <el-button type="primary" @click="handleExport" v-if="itemList.value !== 0">导 出</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog
+        v-model="dialog8.visible"
+        :title="dialog8.title"
+        width="950px"
+        @close="dialog8.visible = false"
+    >
+      <el-card
+          style="cursor: pointer; font-size: 20px"
+          shadow="always"
+          :key="index"
+          @click="toShowExcel(item)"
+          v-for="(item, index) in showProList"
+      >{{ item.formName }}-{{item.formCode}}({{item.seqs}})</el-card
+      >
+    </el-dialog>
+    <el-dialog
+        v-model="excelShow"
+        title="详情"
+        @close="excelShow = false"
+        width="1600"
+        destroy-on-close
+    >
+      <ExcelDataBbox :data="ExDataObj" @close="excelShow = false" />
+    </el-dialog>
   </div>
 </template>
 <script setup>
 import { ref, getCurrentInstance } from "vue";
 import { useCrud } from "@/hooks/userCrud";
-import { exportOperationRecord ,addProRecord,queryProductHandover,updateHandoverList} from "@/api/process";
+import { exportOperationRecord ,queryFormList,queryProductHandover,updateHandoverList} from "@/api/process";
 import { useCommonStoreHook } from "@/store";
 import dictDataUtil from "@/common/configs/dictDataUtil";
 const { isShowTable, tableType } = toRefs(useCommonStoreHook());
+import ExcelDataBbox from "@/views/base/apply/excelDataBbox.vue";
 const test = () => {
   isShowTable.value = true;
   tableType.value = tableType.value == 1 ? 2 : 1;
@@ -206,6 +243,22 @@ const openDialog = (type, row) => {
     dialog.type = type;
   });
 };
+const dialog8 = reactive({
+  title: "表单列表",
+  visible: false,
+});
+const showProList = ref([]);
+const formList = (row) => {
+  queryFormList({...search.value,workOrderId: row.workOrderId,operationId: row.operationId}).then((data)=>{
+    if(data.data.length > 0){
+      showProList.value = data.data;
+      dialog8.visible = true;
+    }else{
+      ElMessage.error("未关联到表单");
+    }
+  })
+
+};
 const saveItemList = () => {
   updateHandoverList(itemList.value).then((data) => {
     if (data.code === "200") {
@@ -267,6 +320,12 @@ option.value = Object.assign(option.value, {
     },
   ],
 });
+const excelShow = ref(false);
+const ExDataObj = ref({});
+const toShowExcel = (item) => {
+  ExDataObj.value = item;
+  excelShow.value = true;
+};
 const handleExport = () => {
   if(data.value.length !== 0){
     exportOperationRecord({...search.value,operationType: clickOperationType.value,type: 0}).then((response) => {