廖井涛
2024-06-25 96d02cbf12a949c1f7b892b8fcc24a0c4ffd3b22
north-glass-erp/northglass-erp/src/views/sd/delivery/SelectDelivery.vue
@@ -10,6 +10,8 @@
import { useI18n } from 'vue-i18n'
import DeliveryPrinting from "@/views/sd/delivery/DeliveryPrinting.vue";
import footSum from "@/hook/footSum"
import {CircleCheck, Download, Printer} from "@element-plus/icons-vue/global";
import PrintSheet1 from "@/components/sd/delivery/PrintSheet1.vue";
//语言获取
const { t } = useI18n()
@@ -18,6 +20,7 @@
const username = userStore.user.userName
const userid = userStore.user.userId
const dialogTableVisible = ref(false)
let sheetIndex = ref(-1)
let rowClickIndex = ref(null)
let produceList = ref([])
const getTableRow = (row,type) =>{
@@ -187,7 +190,16 @@
          dialogTableVisible.value = true
          break
        }
        case 'sheet1': {
          if(rowClickIndex.value===null){
            ElMessage.warning(t('searchOrder.msgList.checkOrder'))
            return
          }
          console.log(rowClickIndex.value.deliveryId)
          dialogTableVisible.value = true
          sheetIndex.value=1
          break
        }
      }
    }
  },
@@ -228,7 +240,7 @@
    body: {
      options: [
        [
          { code: 'getProcessList', name: t('basicData.print'), prefixIcon: 'vxe-icon-file-txt', visible: true}
          { code: 'sheet1', name: t('basicData.print'), prefixIcon: 'vxe-icon-file-txt', visible: true},
        ]
      ]
    }
@@ -282,6 +294,10 @@
  }
})
const printContent = ref({
  id: 'child',
})
</script>
@@ -329,7 +345,7 @@
        <el-button @click="getTableRow(row,'edit')"
                   v-if="userStore.user.permissions.indexOf('selectDelivery.edit') > -1"
                   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-button @click="getTableRow(row,'printing')" :disabled="row.deliveryState!==2" link type="primary" size="small">打印</el-button>-->
        <el-popconfirm @confirm="getTableRow(row,'delete')"  :title="$t('searchOrder.deleteConfirm')">
          <template #reference>
            <el-button :disabled="row.deliveryState===2" link type="primary" size="small">{{ $t('basicData.delete') }}</el-button>
@@ -360,15 +376,43 @@
    </vxe-grid>
    <el-dialog
        :key="dialogKey"
        id="print"
        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%;" />
        style="width: 75%;height:75% "
    >
      <template #header="{ close, titleId, titleClass }">
        <el-button v-print="printContent"  :icon="Printer" circle />
      </template>
      <print-sheet1 id="child"  v-if="sheetIndex===1" :deliveryId="rowClickIndex.deliveryId" />
    </el-dialog>
  </div>
</template>
<style scoped>
:deep(.el-tabs__content) {
  width: 100%;
  height: 86%;
}
.el-tab-pane{
  width: 100%;
  height: 100%;
}
:deep(#print .el-dialog__body){
  height: 85%;
  width: 100%;
  overflow-y: auto;
}
#child{
  width:100%;
  height: 100%;
}
</style>