From afb30c85a1b56c296494f94b103b1c7c8e378440 Mon Sep 17 00:00:00 2001
From: 廖井涛 <2265517004@qq.com>
Date: 星期四, 11 七月 2024 12:28:34 +0800
Subject: [PATCH] Merge branch 'master' of http://bore.pub:10439/r/ERP_override

---
 north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue         |  154 ++++++++++++++++++++++++++++++++-------------------
 north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java |    1 
 2 files changed, 98 insertions(+), 57 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue b/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue
index ce8eff5..538d84e 100644
--- a/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue
+++ b/north-glass-erp/northglass-erp/src/views/pp/Replenish/PrintReplenishFlowCard.vue
@@ -14,6 +14,11 @@
 import PrintCustomLabel from '@/views/pp/processCard/PrintCustomLabel.vue'
 import footSum from "@/hook/footSum"
 import {Search} from "@element-plus/icons-vue";
+import companyInfo from "@/stores/sd/companyInfo"
+import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global";
+import SortDetail from "@/components/pp/SelectSortDetailProcessCard.vue";
+
+const company = companyInfo()
 //璇█鑾峰彇
 const {t} = useI18n()
 let router = useRouter()
@@ -30,19 +35,12 @@
 
 const getTableRow = (row,type) =>{
   switch (type) {
-    case 'edit' :{
-      request.post(`/processCard/printFlowCardDetails/${row.process_id}/${row.technology_number}`,filterData.value).then((res) => {
-        if (res.code == 200) {
+    case 'edit' : {
+      editRow.value.processId = row.process_id
+      editRow.value.technologyNumber = row.technology_number
+      printVisible.value = true
 
-          produceDetailList.value = (res.data.data)
-          printVisible.value=true
-
-        } else {
-
-          ElMessage.warning(res.msg)
-
-        }
-      })
+      // router.push({path: '/sort-detail', query: {processId: row.process_id,technologyNumber:row.technology_number}})
       break
     }
 
@@ -79,6 +77,18 @@
   date1: '',
 })
 
+//鎺掑簭
+let editRow = ref({
+  processId:null,
+  technologyNumber:null
+})
+
+//鎵撳嵃
+let  printRow = ref({
+  list:null,
+  printMergeVal:null
+})
+
 //瀹ゅ唴瀹ゅ闈�
 const stateValue = ref('')
 const stateOptions = [
@@ -92,23 +102,44 @@
   },
 ]
 
-//瀹ゅ唴瀹ゅ闈�
+//鏍囩绫诲瀷
+let  filteredOptions=[]
 const lableType = ref('1')
 const lableTypeOptions = [
   {
     value: '1',
     label: t('processCard.finishedProductLabel'),
   },
+  /*  {
+      value: '2',
+      label: t('processCard.halfProductLabel'),
+    },*/
   {
-    value: '2',
-    label: t('processCard.halfProductLabel'),
+    value: `${company.printLabel.labelValue}`,
+    label: `${company.printLabel.labelType}`,
+  },
+  {
+    value: `${company.printLabel.labelValue3}`,
+    label: `${company.printLabel.labelType3}`,
   },
 ]
+
+let hidePrintLabels = company.printLabel.hideButton;
+
+if (hidePrintLabels=='true'){
+  filteredOptions = lableTypeOptions.filter((option, index) => index !== 2);
+}else {
+  filteredOptions = lableTypeOptions;
+}
 
 //鍚堢墖娴佺▼鍗℃墦鍗颁笅鎷夐�夐」
 const printMerge = ref('')
 const printMergeOptions=[{}]
 
+const printContent = ref({
+  id: 'child',
+
+})
 
 //鎵撳嵃绫诲瀷
 const printType = ref()
@@ -150,6 +181,7 @@
   } else {
     ElMessage.warning(res.msg)
   }
+  hideButton()
 })
 
 //鐐瑰嚮鏌ヨ
@@ -167,6 +199,7 @@
       ElMessage.warning(res.msg)
     }
   })
+  hideButton()
 }
 
 
@@ -317,8 +350,10 @@
               id += selectRecords[i].id + "|"
             }
           }
-          router.push({path: '/main/Replenish/PrintRepairProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMerge.value}})
-
+          printRow.value.list = JSON.stringify(selectRecords)
+          printRow.value.printMergeVal=printMerge.value
+          // router.push({path: '/main/processCard/printProcess', query: {printList: JSON.stringify(selectRecords),printMerge:printMergeVal}})
+          dialogTableVisible.value=true
           break
         }
 
@@ -346,10 +381,16 @@
           let flowCardData = ref({
             flowCard: data,
           })
+          for (let i = 0; i < flowCardData.value.flowCard.length; i++) {
+            const regex = /^[1-9]\d*$/
+            if (!regex.test(flowCardData.value.flowCard[i].sort)) {
+              ElMessage.warning(t('basicData.msg.greater0'))
+              return; // 濡傛灉鏈変竴涓笉鏄暣鏁�
+            }
+          }
           request.post("/processCard/printSort", flowCardData.value).then((res) => {
             if (res.code == 200) {
               ElMessage.success(t('processCard.sortingSuccessful'))
-              //router.push('/main/processCard/SplittingDetails?orderId=${orderId}')
               router.push({
                 path: '/main/processCard/PrintFlowCard',
                 query: {orderId: orderId,random: Math.random()}
@@ -529,6 +570,32 @@
   xGridDetail.value.reloadData(detail.value)
 }
 
+const hideButton = () =>{
+  // 鏍规嵁鏉′欢鍊� hidePrintLabels 杩囨护鎸夐挳鏁扮粍
+  gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => {
+    // 杩欓噷鏍规嵁 hidePrintLabels 鐨勫�煎喅瀹氭槸鍚﹂殣钘� printLabel 鍜� printLabel2
+    if (hidePrintLabels=='true') {
+      return button.code !== 'printLabel' && button.code !== 'printLabel2';
+    } else {
+      return true; // 涓嶉殣钘忎换浣曟寜閽�
+    }
+  })
+}
+
+// 鐩戝惉鎵撳嵃瀹屾垚浜嬩欢
+const printNumber = () =>{
+
+  selectRecordsData.value.printList=selectRecords
+  let printState=0
+  request.post(`/processCard/updatePrintState/${printState}`, selectRecordsData.value).then((res) => {
+    if (res.code == 200 && res.data === true) {
+    } else {
+
+      ElMessage.warning(t('basicData.msg.saveFail'))
+
+    }
+  })
+}
 
 </script>
 
@@ -565,7 +632,7 @@
     &nbsp;
     <el-select v-model="lableType" class="m-2" :placeholder="lableTypeOptions[0].label" style="width: 140px">
       <el-option
-          v-for="item in lableTypeOptions"
+          v-for="item in filteredOptions"
           :key="item.value"
           :label="item.label"
           :value="item.value"
@@ -628,12 +695,16 @@
 
     </vxe-grid>
     <el-dialog
+        id="sizePrintCalrd"
         v-model="dialogTableVisible"
-        destroy-on-close
         :title="$t('processCard.print')"
-        style="width: 80%;height:75% ">
-      <PrintProcess :printList="selectRecords"
-                    style="width: 100%;height: 100%" />
+        destroy-on-close
+        style="width: 75%;height:75% ">
+      <template #header="{ close, titleId, titleClass }">
+        <el-button v-print="printContent" @click="printNumber"  :icon="Printer" circle />
+      </template>
+      <print-process id="child" :printList="printRow.list" :printMerge="printRow.printMergeVal"
+                     style="width: 100%;height: 100%" />
     </el-dialog>
 
     <el-dialog
@@ -655,43 +726,12 @@
     </el-dialog>
 
     <el-dialog
-        @opened="openedTable"
+        id="sizeCheck"
         v-model="printVisible"
         :title="$t('processCard.processCardDetails')"
-        :close-on-click-modal="false"
-        :close-on-press-escape="false"
+        destroy-on-close
         style="width: 80%;height:75% ">
-      <vxe-grid
-          ref="xGridDetail"
-          class="mytable-scrollbar"
-          max-height="100%"
-          height="600px"
-          size="small"
-          v-bind="detailGridOptions"
-          v-on="gridEvents">
-
-        <template #content="{ row }">
-          <ul class="expand-wrapper">
-            <li v-for="(item,index) in detailGridOptions.columns" v-show="item.field!=undefined ">
-              <span style="font-weight: bold">{{ item.title + ':  ' }}</span>
-              <span v-if="hasDecimal(item.field)">{{ row[item.field.split('.')[0]][item.field.split('.')[1]] }}</span>
-              <span v-else>{{ row[item.field] }}</span>
-
-            </li>
-          </ul>
-        </template>
-
-        <template #num1_filter="{ column, $panel }">
-          <div>
-            <div v-for="(option, index) in column.filters" :key="index">
-              <input type="text"
-                     v-model="option.data"
-                     @input="changeFilterEvent($event, option, $panel)"/>
-            </div>
-          </div>
-        </template>
-
-      </vxe-grid>
+      <sort-detail id="child"  :processId="editRow.processId" :technologyNumber="editRow.technologyNumber" />
     </el-dialog>
 
 
diff --git a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
index 17c0a89..fa1191e 100644
--- a/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
+++ b/north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
@@ -26,6 +26,7 @@
     }
 
     @ApiOperation("鎶ュ伐鏂板鏌ヨ")
+    @SaCheckPermission("AddReportingWork.search")
     @PostMapping  ("/addSelectLastWork/{processIdStr}/{technologyStr}/{process}")
     public Result AddSelectLastWork(
             @PathVariable String processIdStr,

--
Gitblit v1.8.0