소스 검색

fix:表单增加附件,增加返工表单

lupeng 7 달 전
부모
커밋
c08c8c4e41

+ 14 - 0
src/api/fault/index.ts

@@ -70,6 +70,20 @@ export function handleReworkRecord(data: Object) {
 }
 
 /**
+ * 处理结果
+ *
+ * @param id
+ * @param data
+ */
+export function getReworkItem(data: Object) {
+  return request({
+    url: "/api/v1/rework/item/list",
+    method: "post",
+    data: data,
+  });
+}
+
+/**
  * 返工处理
  *
  *

+ 69 - 0
src/views/quality/feedback/components/show.vue

@@ -146,6 +146,28 @@
                               ? tableData.remark3.content
                               : "/"
                           }}
+                          <div
+                            class="noPrint"
+                            v-if="
+                              undefined != tableData.remark3.srcList &&
+                              null != tableData.remark3.srcList &&
+                              tableData.remark3.srcList.length > 0
+                            "
+                          >
+                            <div>附件:</div>
+                            <div
+                              v-for="(item, index) in tableData.remark3
+                                .fileNameList"
+                              :key="index"
+                            >
+                              {{ item }}
+                              <a :href="tableData.remark3.srcList[index]"
+                                ><el-button type="primary" round size="small"
+                                  >下载</el-button
+                                >
+                              </a>
+                            </div>
+                          </div>
                         </div>
                         <div class="sale-bottom">
                           <div class="desc">
@@ -221,6 +243,28 @@
                               ? tableData.remark4.content
                               : "/"
                           }}
+                          <div
+                            class="noPrint"
+                            v-if="
+                              undefined != tableData.remark4.srcList &&
+                              null != tableData.remark4.srcList &&
+                              tableData.remark4.srcList.length > 0
+                            "
+                          >
+                            <div>附件:</div>
+                            <div
+                              v-for="(item, index) in tableData.remark4
+                                .fileNameList"
+                              :key="index"
+                            >
+                              {{ item }}
+                              <a :href="tableData.remark4.srcList[index]"
+                                ><el-button type="primary" round size="small"
+                                  >下载</el-button
+                                >
+                              </a>
+                            </div>
+                          </div>
                         </div>
                         <div class="sale-bottom">
                           <div class="desc">
@@ -253,6 +297,28 @@
                               ? tableData.remark5.content
                               : "/"
                           }}
+                          <div
+                            class="noPrint"
+                            v-if="
+                              undefined != tableData.remark5.srcList &&
+                              null != tableData.remark5.srcList &&
+                              tableData.remark5.srcList.length > 0
+                            "
+                          >
+                            <div>附件:</div>
+                            <div
+                              v-for="(item, index) in tableData.remark5
+                                .fileNameList"
+                              :key="index"
+                            >
+                              {{ item }}
+                              <a :href="tableData.remark5.srcList[index]"
+                                ><el-button type="primary" round size="small"
+                                  >下载</el-button
+                                >
+                              </a>
+                            </div>
+                          </div>
                         </div>
                         <div class="sale-bottom">
                           <div class="desc">
@@ -412,6 +478,9 @@ watch(
     margin: 0; /* 重置边距 */
     width: 700px;
   }
+  .noPrint {
+    display: none;
+  }
 }
 table {
   width: 100%;

+ 70 - 0
src/views/quality/reject/components/show.vue

@@ -146,6 +146,28 @@
                               ? tableData.remark3.content
                               : "/"
                           }}
+                          <div
+                            class="noPrint"
+                            v-if="
+                              undefined != tableData.remark3.srcList &&
+                              null != tableData.remark3.srcList &&
+                              tableData.remark3.srcList.length > 0
+                            "
+                          >
+                            <div>附件:</div>
+                            <div
+                              v-for="(item, index) in tableData.remark3
+                                .fileNameList"
+                              :key="index"
+                            >
+                              {{ item }}
+                              <a :href="tableData.remark3.srcList[index]"
+                                ><el-button type="primary" round size="small"
+                                  >下载</el-button
+                                >
+                              </a>
+                            </div>
+                          </div>
                         </div>
                         <div class="sale-bottom">
                           <div class="desc">
@@ -221,6 +243,28 @@
                               ? tableData.remark4.content
                               : "/"
                           }}
+                          <div
+                            class="noPrint"
+                            v-if="
+                              undefined != tableData.remark4.srcList &&
+                              null != tableData.remark4.srcList &&
+                              tableData.remark4.srcList.length > 0
+                            "
+                          >
+                            <div>附件:</div>
+                            <div
+                              v-for="(item, index) in tableData.remark4
+                                .fileNameList"
+                              :key="index"
+                            >
+                              {{ item }}
+                              <a :href="tableData.remark4.srcList[index]"
+                                ><el-button type="primary" round size="small"
+                                  >下载</el-button
+                                >
+                              </a>
+                            </div>
+                          </div>
                         </div>
                         <div class="sale-bottom">
                           <div class="desc">
@@ -253,6 +297,28 @@
                               ? tableData.remark5.content
                               : "/"
                           }}
+                          <div
+                            class="noPrint"
+                            v-if="
+                              undefined != tableData.remark5.srcList &&
+                              null != tableData.remark5.srcList &&
+                              tableData.remark5.srcList.length > 0
+                            "
+                          >
+                            <div>附件:</div>
+                            <div
+                              v-for="(item, index) in tableData.remark5
+                                .fileNameList"
+                              :key="index"
+                            >
+                              {{ item }}
+                              <a :href="tableData.remark5.srcList[index]"
+                                ><el-button type="primary" round size="small"
+                                  >下载</el-button
+                                >
+                              </a>
+                            </div>
+                          </div>
                         </div>
                         <div class="sale-bottom">
                           <div class="desc">
@@ -376,6 +442,7 @@ const setBoxValue = () => {
     checkboxes2[1].checked = true;
   }
 };
+import dictDataUtil from "@/common/configs/dictDataUtil";
 watch(
   () => props.tableData,
   () => {
@@ -412,6 +479,9 @@ watch(
     margin: 0; /* 重置边距 */
     width: 700px;
   }
+  .noPrint {
+    display: none;
+  }
 }
 table {
   width: 100%;

+ 7 - 0
src/views/quality/rework/components/rework-detail.vue

@@ -20,6 +20,7 @@
         <el-button
           icon="el-icon-edit"
           text
+          v-if="props.status == 0"
           @click="doEdit(row, index)"
           type="primary"
           :size="size"
@@ -79,6 +80,12 @@ const props = defineProps({
       return {};
     },
   },
+  status: {
+    type: Number,
+    default: () => {
+      return 0;
+    },
+  },
 });
 const doEdit = (row, index) => {
   srcList.value = [];

+ 258 - 0
src/views/quality/rework/components/rework-show.vue

@@ -0,0 +1,258 @@
+<template>
+  <div class="bgColor" @click="close" v-if="modelValue">
+    <div class="body" @click.stop>
+      <div class="header">
+        <div class="text">详情查看</div>
+        <div class="delete">
+          <el-button
+            style="margin-right: 10px"
+            type="primary"
+            size="small"
+            class="btn"
+            v-print="'#print'"
+            >打印</el-button
+          >
+          <span style="padding: 20px; cursor: pointer" @click="close">X</span>
+        </div>
+      </div>
+      <div class="box">
+        <el-scrollbar>
+          <div id="print">
+            <div class="tableInfo">
+              <div class="info">
+                <div class="text" style="margin-left: 20px">表号:J05-018B</div>
+              </div>
+              <div class="title" style="text-align: center">返工记录卡</div>
+              <div class="title-remark" style="text-align: center">
+                (随工单附表,代替随工单上的返工)
+              </div>
+              <div class="title-head">
+                <div class="head-term" style="margin-left: 20px; width: 240px">
+                  产品名称: {{ tableData.materialName }}
+                </div>
+                <div class="head-term" style="width: 110px">
+                  数量: {{ tableData.num }}
+                </div>
+                <div class="head-term" style="width: 180px">
+                  返工提出者: {{ tableData.creator }}
+                </div>
+                <div class="head-term" style="width: 150px">
+                  日期: {{ tableData.dateCreate }}
+                </div>
+              </div>
+              <table style="border-collapse: collapse; border-bottom: 0">
+                <tr>
+                  <td class="detail-title" rowspan="2">需返工内容</td>
+                  <td class="title-one-height title-one-width title-size">
+                    管号
+                  </td>
+                  <td class="title-one-height title-one-width title-size">
+                    生产批号
+                  </td>
+                  <td class="title-one-height title-size" style="width: 265px">
+                    具体返工内容
+                  </td>
+                  <td class="title-one-height title-size">返工原因</td>
+                </tr>
+                <tr style="border-bottom: 0">
+                  <td class="title-size">{{ tableData.seqNos }}</td>
+                  <td class="title-size">{{ tableData.workOrderCode }}</td>
+                  <td class="title-size">
+                    {{ tableData.remark }}
+                  </td>
+                  <td class="title-size">
+                    {{ tableData.reason }}
+                  </td>
+                </tr>
+              </table>
+              <table>
+                <tr>
+                  <td class="detail-title" rowspan="2">各工序返工情况</td>
+                  <td class="title-one-height title-one-width title-size">
+                    工序
+                  </td>
+                  <td class="title-one-height title-size" style="width: 191px">
+                    主要工艺条件
+                  </td>
+                  <td class="title-one-height title-size" style="width: 58px">
+                    接收数
+                  </td>
+                  <td class="title-one-height title-size" style="width: 58px">
+                    合格数
+                  </td>
+                  <td class="title-one-height title-size" style="width: 58px">
+                    合格率
+                  </td>
+                  <td class="title-one-height title-size">操作者</td>
+                  <td class="title-one-height title-size">日期</td>
+                  <td class="title-one-height title-size">检验人</td>
+                </tr>
+                <tr v-for="item in tableData.itemList">
+                  <td class="title-size">{{ item.operationName }}</td>
+                  <td class="title-size">{{ item.processAsk }}</td>
+                  <td class="title-size">{{ item.num }}</td>
+                  <td class="title-size">{{ item.qualifiedNum }}</td>
+                  <td class="title-size">{{ item.qualifiedRate }}</td>
+                  <td class="title-size">{{ item.operateName }}</td>
+                  <td class="title-size">{{ item.operateDate }}</td>
+                  <td class="title-size">{{ item.checkName }}</td>
+                </tr>
+              </table>
+            </div>
+          </div>
+        </el-scrollbar>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+const props = defineProps({
+  modelValue: {
+    type: [Boolean],
+  },
+  tableData: {
+    type: [Object],
+  },
+});
+const emits = defineEmits(["update:modelValue"]);
+const close = () => {
+  emits("update:modelValue", false);
+};
+const setBoxValue = () => {
+  const checkboxes1 = document.getElementsByName("options1");
+  const checkboxes2 = document.getElementsByName("options2");
+};
+watch(
+  () => props.tableData,
+  () => {
+    nextTick(() => {
+      setBoxValue();
+    });
+  }
+);
+</script>
+
+<style lang="scss" scoped>
+#checkboxForm1 {
+  display: flex;
+  justify-content: space-between;
+  padding: 0 40px;
+}
+#checkboxForm2 {
+  display: flex;
+  label {
+    margin-right: 20px;
+  }
+}
+.title-size {
+  font-size: 13px;
+  text-align: center;
+}
+.title-one-width {
+  width: 100px;
+}
+@media print {
+  #print {
+    position: absolute; /* 或 absolute, fixed, 根据需要调整 */
+    top: 20px; /* 调整顶部位置 */
+    margin: 0; /* 重置边距 */
+    width: 700px;
+  }
+}
+table {
+  width: 100%;
+  border-collapse: collapse; /* 合并表格边框 */
+  table-layout: fixed;
+}
+th,
+td {
+  border: 1px solid rgba(0, 0, 0, 0.3); /* 设置所有单元格的边框 */
+  padding: 8px;
+  text-align: left;
+  word-wrap: break-word;
+}
+th {
+  background-color: #f2f2f2; /* 设置表头的背景颜色 */
+}
+.title-one-height {
+  height: 20px;
+}
+.detail-title {
+  font-size: 13px;
+  width: 30px;
+}
+.sale-box {
+  .sale-title {
+    font-size: 16px;
+    margin-bottom: 5px;
+    text-align: start;
+  }
+  .sale-content {
+    font-size: 16px;
+    margin-bottom: 10px;
+    text-align: start;
+    padding: 0 8px;
+  }
+  .sale-bottom {
+    display: flex;
+    justify-content: flex-end;
+    margin-top: 10px;
+  }
+  .desc {
+    margin-right: 20px;
+  }
+}
+.bgColor {
+  position: fixed;
+  width: 100vw;
+  height: 100vh;
+  z-index: 99999;
+  background-color: rgba(0, 0, 0, 0.3);
+  top: 0;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  left: 0;
+  .body {
+    width: 800px;
+    height: 85vh;
+    background-color: white;
+    display: flex;
+    flex-direction: column;
+    padding: 20px;
+    .header {
+      width: 100%;
+      height: 40px;
+      display: flex;
+      padding-bottom: 10px;
+      justify-content: space-between;
+      border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+    }
+    .box {
+      height: calc(100% - 40px);
+    }
+  }
+}
+.tableInfo {
+  width: 100%;
+  height: 60px;
+
+  .title {
+    margin: 10px 0 0;
+    font-size: 28px;
+    font-weight: 600;
+  }
+  .title-remark {
+    margin: 0 0 20px;
+    font-size: 12px;
+  }
+  .head-term {
+    float: left;
+  }
+  .info {
+    display: flex;
+    justify-content: space-between;
+  }
+}
+</style>

+ 53 - 4
src/views/quality/rework/index.vue

@@ -18,6 +18,22 @@
     >
       <template #menu="{ row, index, type }">
         <el-button
+          @click="showTable(row)"
+          icon="el-icon-view"
+          text
+          type="primary"
+          >查看</el-button
+        >
+        <el-button
+          icon="el-icon-edit"
+          text
+          @click="doEdit(row, index)"
+          type="primary"
+          v-if="row.state === 0"
+          :size="size"
+          >编辑</el-button
+        >
+        <el-button
           @click="operation(row)"
           icon="el-icon-link"
           text
@@ -52,8 +68,13 @@
       @close="closeOperation"
       :destroy-on-close="true"
     >
-      <ReworkItem :recordId="record.id" :dialog="dialog" />
+      <ReworkItem
+        :recordId="record.id"
+        :dialog="dialog"
+        :status="record.state"
+      />
     </el-dialog>
+    <ReworkShow v-model="showState" :tableData="tableData" />
   </div>
 </template>
 <script setup>
@@ -63,7 +84,8 @@ import ButtonPermKeys from "@/common/configs/buttonPermission";
 import { useCommonStoreHook, useDictionaryStore } from "@/store";
 import ReworkItem from "@/views/quality/rework/components/rework-detail.vue";
 import { ref } from "vue";
-import { handleReworkRecord } from "@/api/fault/index";
+import { handleReworkRecord, getReworkItem } from "@/api/fault/index";
+import ReworkShow from "@/views/quality/rework/components/rework-show.vue";
 
 // 数据字典相关
 const { dicts } = useDictionaryStore();
@@ -77,12 +99,15 @@ const { dataList, createRow, updateRow, deleteRow, searchChange, resetChange } =
   Methords; //增删改查
 const { selectionChange, multipleDelete } = Methords; //选中和批量删除事件
 const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等工具
-
+const tableData = ref({});
 const crudRef = ref(null); //crudRef.value 获取avue-crud对象
 const dialog = ref({
   title: "关联工序",
   visible: false,
 });
+const doEdit = (row, index) => {
+  crudRef.value && crudRef.value.rowEdit(row, index);
+};
 onMounted(() => {
   dataList();
 });
@@ -91,10 +116,27 @@ const operation = (row) => {
   record.value = row;
   dialog.value.visible = true;
 };
+const showState = ref(false);
+const showTable = (row) => {
+  reworkItem.value.recordId = row.id;
+  getReworkItem(reworkItem.value).then((data) => {
+    if (data.code === "200") {
+      tableData.value = row;
+      tableData.value.itemList = data.data;
+      showState.value = true;
+    } else {
+      ElMessage({
+        message: data.msg,
+        type: "error",
+      });
+    }
+  });
+};
 const closeOperation = () => {
   dialog.value.visible = false;
 };
 const handleData = ref({});
+const reworkItem = ref({});
 const handle = (row, index, state) => {
   handleData.value.id = row.id;
   handleData.value.state = state;
@@ -120,11 +162,12 @@ option.value = Object.assign(option.value, {
   addBtn: false,
   delBtn: false,
   editBtn: false,
-  viewBtn: true,
+  viewBtn: false,
   column: [
     {
       label: "生产批号",
       prop: "workOrderCode",
+      editDisabled: true,
       width: 160,
       overHidden: true,
       search: true,
@@ -132,20 +175,24 @@ option.value = Object.assign(option.value, {
     {
       label: "产品名称",
       prop: "materialName",
+      editDisabled: true,
       search: true,
     },
     {
       label: "数量",
+      editDisabled: true,
       prop: "num",
     },
     {
       label: "管号",
       prop: "seqNos",
+      editDisabled: true,
     },
     {
       label: "管号",
       prop: "seqNo",
       search: true,
+      editDisabled: true,
       hide: true,
       display: false,
     },
@@ -186,6 +233,7 @@ option.value = Object.assign(option.value, {
     {
       label: "返工提出者",
       prop: "creator",
+      editDisplay: false,
     },
     {
       label: "日期",
@@ -194,6 +242,7 @@ option.value = Object.assign(option.value, {
       width: 160,
       format: "YYYY-MM-DD",
       valueFormat: "YYYY-MM-DD",
+      editDisplay: false,
       overHidden: true,
     },
     {