ソースを参照

fix:返工记录卡

lupeng 1 ヶ月 前
コミット
64a801f282

+ 89 - 35
src/views/pro-operation/remove/components/rework-show.vue

@@ -7,10 +7,10 @@
           <!--          <el-button style="margin-right: 10px" type="primary" size="small" class="btn" v-print="'#print'"-->
           <!--            >打印</el-button-->
           <!--          >-->
-          <el-button style="margin-right: 10px" type="primary" size="small" class="btn" @click="submitData"
+<!--          <el-button style="margin-right: 10px" type="primary" size="small" class="btn" @click="submitData"
             >提交</el-button
-          >
-          <span style="padding: 20px; cursor: pointer" @click="close">X</span>
+          >-->
+<!--          <span style="padding: 20px; cursor: pointer" @click="close">X</span>-->
         </div>
       </div>
       <div class="box">
@@ -23,12 +23,12 @@
               <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 class="head-term" style="margin-left: 20px; width: 300px">
+                  产品名称: {{ dataTable.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 class="head-term" style="width: 180px">数量: {{ dataTable.num }}</div>
+                <div class="head-term" style="width: 180px">返工提出者: {{ dataTable.creator }}</div>
+                <div class="head-term" style="width: 150px">日期: {{ dataTable.dateCreate }}</div>
               </div>
               <table style="border-collapse: collapse; border-bottom: 0">
                 <tbody>
@@ -40,13 +40,13 @@
                     <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">{{ dataTable.seqNos }}</td>
+                    <td class="title-size">{{ dataTable.workOrderCode }}</td>
                     <td class="title-size">
-                      {{ tableData.remark }}
+                        <InputDiv v-model:text="dataTable.remark" />
                     </td>
                     <td class="title-size">
-                      {{ tableData.reason }}
+                      <InputDiv v-model:text="dataTable.reason" />
                     </td>
                   </tr>
                 </tbody>
@@ -54,31 +54,44 @@
               <table>
                 <tbody>
                   <tr>
-                    <td class="detail-title" :rowspan="tableData.itemList.length + 1">各工序返工情况</td>
+                    <td class="detail-title" :rowspan="itemList.length + 1">各工序返工情况</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" style="width: 190px">主要工艺条件</td>
+                    <td class="title-one-height title-size" style="width: 65px">接收数</td>
+                    <td class="title-one-height title-size" style="width: 65px">合格数</td>
+                    <td class="title-one-height title-size" style="width: 65px">合格率</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>
+                    <td class="title-one-height title-size">操作</td>
                   </tr>
-                  <tr v-for="item in tableData.itemList">
-                    <template v-if="item.isChange">
+                  <tr v-for="(item,index) in itemList" :class="item.isChange === '0' ? 'no-change' : 'change'">
+                    <template v-if="item.isChange==='1' && item.state=='0'">
                       <td class="title-size">{{ item.operationName }}</td>
                       <td class="title-size">
                         <InputDiv v-model:text="item.processAsk" />
                       </td>
-                      <td class="title-size">{{ item.num }}</td>
-                      <td class="title-size">{{ item.qualifiedNum }}</td>
+                      <td class="title-size"><InputDiv v-model:text="item.num" style="border: #1b1b19"/></td>
+                      <td class="title-size"><InputDiv v-model:text="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" v-if="!item.signatureUrl">{{ item.checkName }}</td>
-                      <td class="title-size" v-if="item.signatureUrl">
-                        <img :src="item.signatureUrl" style="height: 30px" />
-                      </td>
+                      <td class="title-size"><el-select
+                              v-model="item.checkName"
+                              class="no-border"
+                              placeholder="请选择检验员"
+                              size="small"
+                      >
+                          <el-option
+                                  v-for="item in checkList"
+                                  :key="item.id"
+                                  :label="item.signatureName"
+                                  :value="item.signatureName"
+                          />
+                      </el-select></td>
+                      <td class="title-one-height title-size"><el-button style="margin-right: 10px" type="primary" size="small" class="btn" @click="submitData(index)"
+                      >提交</el-button
+                      ></td>
                     </template>
                     <template v-else>
                       <td class="title-size cannot-edit">{{ item.operationName }}</td>
@@ -90,10 +103,10 @@
                       <td class="title-size cannot-edit">{{ item.qualifiedRate }}</td>
                       <td class="title-size cannot-edit">{{ item.operateName }}</td>
                       <td class="title-size cannot-edit">{{ item.operateDate }}</td>
-                      <td class="title-size cannot-edit" v-if="!item.signatureUrl">{{ item.checkName }}</td>
-                      <td class="title-size cannot-edit" v-if="item.signatureUrl">
-                        <img :src="item.signatureUrl" style="height: 30px" />
-                      </td>
+                      <td class="title-size cannot-edit">{{ item.checkName }}</td>
+                      <td class="title-one-height title-size"><el-button v-if="item.isChange==='1' && item.state=='1'" style="margin-right: 10px" type="primary" size="small" class="btn" @click="dataResubmit(index)"
+                      >再次编辑</el-button
+                      > </td>
                     </template>
                   </tr>
                 </tbody>
@@ -107,6 +120,9 @@
 </template>
 
 <script setup>
+import {updateReworkRecord} from "@/api/rework/index.js";
+import {signList} from "@/api/process/reportBreak.js";
+
 const props = defineProps({
   modelValue: {
     type: [Boolean],
@@ -123,17 +139,48 @@ const setBoxValue = () => {
   const checkboxes1 = document.getElementsByName("options1");
   const checkboxes2 = document.getElementsByName("options2");
 };
-watch(
+/*watch(
   () => props.tableData,
   () => {
     nextTick(() => {
       setBoxValue();
     });
   }
-);
+);*/
+const dataResubmit=(index)=>{
+    itemList.value[index].state=0;
+}
+const checkList=ref([]);
+const dataTable = ref({});
+const itemList = ref([]);
+onMounted(
+    () => {
+        signList({signatureType:3}).then(
+            (data)=>{
+                if(data.code==='200'){
+                    checkList.value=data.data;
+                }
+            }
+        )
+        dataTable.value=props.tableData;
+        itemList.value=props.tableData.itemList;
+    }
 
-const submitData = () => {
-  console.log("submitData", props.tableData);
+)
+const dataRework =ref({});
+const submitData = (index) => {
+    dataRework.value.id =dataTable.value.id;
+    dataRework.value.reason=dataTable.value.reason;
+    dataRework.value.remark=dataTable.value.remark;
+    dataRework.value.seqNos=dataTable.value.seqNos;
+    dataRework.value.item=dataTable.value.itemList[index];
+    updateReworkRecord(dataRework.value).then(
+      (data)=>{
+        if(data.code==='200'){
+            dataTable.value.itemList[index]=data.data;
+        }
+      }
+    )
 };
 </script>
 
@@ -154,7 +201,7 @@ const submitData = () => {
   text-align: center;
 }
 .title-one-width {
-  width: 100px;
+  width: 120px;
 }
 @media print {
   #print {
@@ -211,6 +258,7 @@ th {
   width: 100%;
   height: 100%;
   z-index: 99999;
+  margin-top: 50px;
   background-color: rgba(0, 0, 0, 0.3);
 
   display: flex;
@@ -218,7 +266,7 @@ th {
   justify-content: center;
 
   .body {
-    width: 800px;
+    width: 900px;
     height: 85vh;
     background-color: white;
     display: flex;
@@ -262,4 +310,10 @@ th {
 .cannot-edit {
   color: gray;
 }
+.no-change{
+  background: #e2e2e2;
+}
+.change{
+  background: white;
+}
 </style>

+ 6 - 3
src/views/pro-operation/rework/records.vue

@@ -1,7 +1,7 @@
 <script setup lang="ts">
 import {useCrud} from "@/hooks/userCrud";
 import {getReworkItem} from "@/api/rework";
-import ReworkShow from "@/views/pro-operation/remove/components/rework-show.vue";
+import ReworkShow from "@/views/pro-operation/rework/components/rework-show.vue";
 const dialogVisible = ref(false);
 const itemVisible = ref(false);
 const dialogTitle = ref("返工记录卡");
@@ -49,6 +49,9 @@ const showTable = (row) => {
     });
 
 };
+const refreshData = () =>{
+    dataList();
+}
 // 设置表格列或者其他自定义的option
 option.value = Object.assign(option.value, {
   selection: false,
@@ -124,7 +127,7 @@ option.value = Object.assign(option.value, {
             link
             type="primary"
             size="small"
-          >查看</el-button
+          >操作</el-button
           >
 
 
@@ -135,7 +138,7 @@ option.value = Object.assign(option.value, {
 
     </div>
   </el-dialog>
-  <el-dialog v-model="itemVisible" append-to-body align-center :title="itemTitle">
+  <el-dialog v-model="itemVisible" append-to-body align-center :title="itemTitle" style="width: 940px" :destroy-on-close="true" @close="refreshData">
     <ReworkShow  :tableData="tableData" />
   </el-dialog>
 </template>