From 5314634fbbe6fd099d9b134614dba450cba2b5b9 Mon Sep 17 00:00:00 2001
From: guoyuji <guoyujie@ng.com>
Date: 星期五, 19 四月 2024 13:52:23 +0800
Subject: [PATCH] Merge branch 'master' of https://gitee.com/a1536384743/erp_-override

---
 north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue |   59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 57 insertions(+), 2 deletions(-)

diff --git a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
index 847874e..fe180ed 100644
--- a/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
+++ b/north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
@@ -8,6 +8,7 @@
 import useUserInfoStore from "@/stores/userInfo";
 import {ElMessage} from "element-plus";
 import { useI18n } from 'vue-i18n'
+import DeliveryPrinting from "@/views/sd/delivery/DeliveryPrinting.vue";
 
 //璇█鑾峰彇
 const { t } = useI18n()
@@ -15,11 +16,20 @@
 const userStore = useUserInfoStore()
 const username = userStore.user.userName
 const userid = userStore.user.userId
+const dialogTableVisible = ref(false)
+let rowClickIndex = ref(null)
 let produceList = ref([])
 const getTableRow = (row,type) =>{
   switch (type) {
     case 'edit' :{
       router.push({path: '/main/delivery/createDelivery', query: { deliveryID: row.deliveryId }})
+      break
+    }
+    case 'printing' :{
+      /*const url = router.resolve({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
+      window.open(url.href, '_blank')
+      break*/
+      router.push({path: '/main/delivery/deliveryPrinting', query: { deliveryID: row.deliveryId }})
       break
     }
     case 'delete':{
@@ -162,6 +172,29 @@
   selectOrderList()
 }
 
+const gridEvents = {
+
+  menuClick ({ menu, row, column }) {
+    const $grid = xGrid.value
+    if ($grid) {
+      switch (menu.code) {
+        case 'getProcessList': {
+          if(rowClickIndex.value===null){
+            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
+            return
+          }
+          dialogTableVisible.value = true
+          break
+        }
+
+      }
+    }
+  },
+  cellClick({ row }){
+    rowClickIndex.value = row
+  }
+}
+
 const gridOptions = reactive({
   border:  "full",//琛ㄦ牸鍔犺竟妗�
   keepSource: true,//淇濇寔婧愭暟鎹�
@@ -189,10 +222,20 @@
     trigger: 'click',
     mode: 'row',
     showStatus: true
-  },//琛ㄥご鍙傛暟
+  },
+  menuConfig: {
+    body: {
+      options: [
+        [
+          { code: 'getProcessList', name: "鎵撳嵃", prefixIcon: 'vxe-icon-file-txt', visible: true}
+        ]
+      ]
+    }
+  },
+  //琛ㄥご鍙傛暟
   columns:[
     {type:'expand',slots: { content:'content' },width: 60},
-    {title: t('basicData.operate'), width: 110, slots: { default: 'button_slot' }},
+    {title: t('basicData.operate'), width: 150, slots: { default: 'button_slot' }},
     {type: 'seq', title: t('basicData.Number'), width: 80 },
 
     {field: 'deliveryState',title: t('basicData.review'), width: 40, slots: { default: 'state' }},
@@ -258,6 +301,7 @@
         class="mytable-scrollbar"
         ref="xGrid"
         v-bind="gridOptions"
+        v-on="gridEvents"
 
     >
       <!--      涓嬫媺鏄剧ず鎵�鏈変俊鎭彃妲�-->
@@ -280,6 +324,7 @@
       <!--宸﹁竟鍥哄畾鏄剧ず鐨勬彃妲�-->
       <template #button_slot="{ row }">
         <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">{{$t('basicData.edit')}}</el-button>
+        <el-button @click="getTableRow(row,'printing')" :disabled="row.deliveryState!==2" link type="primary" size="small">鎵撳嵃</el-button>
         <el-popconfirm @confirm="getTableRow(row,'delete')" title="纭畾鍒犻櫎?">
           <template #reference>
             <el-button  link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
@@ -308,6 +353,16 @@
         </vxe-pager>
       </template>
     </vxe-grid>
+
+    <el-dialog
+        v-model="dialogTableVisible"
+        destroy-on-close
+        id="deliveryPrinting"
+        style="width: 100%;height:100%;margin-top: 0; ">
+      <DeliveryPrinting
+          :deliveryId="rowClickIndex.deliveryId"
+          style="width: 100%;height: 100%;" />
+    </el-dialog>
   </div>
 
 </template>

--
Gitblit v1.8.0