Jelajahi Sumber

员工计件工资明细 打印

tty 1 tahun lalu
induk
melakukan
e5c5f21d83

+ 76 - 6
src/view/performance/12-orderAccounting/index.vue

@@ -91,7 +91,7 @@
                 type="primary"
                 icon="edit"
                 class="bt"
-                @click="()=>{pd_lcdlist = true}"
+                @click="()=>{pd_lcdlist = true; pd_lcdProductValue()}"
               >流程单查询
               </el-button>
 
@@ -173,7 +173,8 @@
                   style="margin-right: 20px; padding: 0;"
                 >
                   <el-input
-                    v-model="gdbh"
+                    v-model="pd_lcdformData['gdbh']"
+                    @keyup.enter="pd_lcdProductValue"
                   />
                 </el-form-item>
                 <el-form-item
@@ -181,7 +182,7 @@
                   style="margin-right: 5px; padding: 0;"
                 >
                   <el-input
-                    v-model="gdbh"
+                    v-model="pd_lcdformData['code']"
                     disabled
                   />
                 </el-form-item>
@@ -190,7 +191,7 @@
                   style="margin-right: 5px; padding: 0;"
                 >
                   <el-input
-                    v-model="gdbh"
+                    v-model="pd_lcdformData['name']"
                     disabled
                     style="width: 500px"
                   />
@@ -205,7 +206,9 @@
                   >
                     <div class="JKWTree-tree">
                       <el-tree
+                        :data="pd_lcd_treeData"
                         default-expand-all
+                        @node-click="pd_lcd_handleNodeClick"
                       />
                     </div>
                   </layout-sider>
@@ -213,14 +216,14 @@
                     <!-- 这里放右侧的内容 -->
                     <el-space wrap>
                       <!-- 右侧内容 -->
-                      <!-- <template v-for="item in processList.total_process">
+                      <template v-for="item in processList.total_process">
                         <el-button
                           disabled
                           :type="! processList.process.includes(item) ? 'danger' : 'info'"
                           plain
                           style="width: 50px"
                         >{{ item }}</el-button>
-                      </template> -->
+                      </template>
                     </el-space>
                   </layout-main>
                 </layout>
@@ -322,6 +325,26 @@
     </layout>
   </div>
 </template>
+
+<script>
+import service from '@/utils/request'
+// 5.1流程单查询-工单工序生产进程菜单栏
+export const getOrderProcessLeft = (params) => {
+  return service({
+    url: '/mes_server/work_order_verification/getOrderProcessLeft',
+    method: 'get',
+    params
+  })
+}
+// 5.2流程单查询-获取工单工序生产进程右侧
+export const getOrderProcessRight = (params) => {
+  return service({
+    url: '/mes_server/work_order_verification/getOrderProcessRight',
+    method: 'get',
+    params
+  })
+}
+</script>
 <script setup>
 import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
 import { ref, watch } from 'vue'
@@ -335,6 +358,7 @@ import Gongdanzhijianfeipintongji
 import Detail from '@/view/performance/12-orderAccounting/componets/detail.vue'
 import Hjfpfb from './componets/hjfpfb.vue'
 import PrintPage from '@/view/yunyin/shengchanguanli/components/print.vue'
+import { reactive } from 'vue'
 
 // 弹窗
 const dialogGdcjstj = ref(false)
@@ -422,6 +446,7 @@ const searchInfo = ref('')
 watch(currentRow, (value, oldValue, onCleanup) => {
   gdbh.value = value?.['Gd_gdbh']
   date.value = value?.['date']
+  pd_lcdformData['gdbh'] = value?.['Gd_gdbh']
 })
 
 // 显示上方表格
@@ -483,6 +508,51 @@ function handleGddy() {
 }
 
 const pd_lcdlist = ref(false)
+const processList = ref([])
+
+const pd_lcdformData = reactive({})
+const pd_lcdProductValue = async() => {
+  _getOrderProcessLeft_list()
+}
+const pd_lcd_treeData = ref([])
+const _getOrderProcessLeft_list = async() => {
+  const order = pd_lcdformData['gdbh']
+  console.log(order)
+  try {
+    // 5.1流程单查询-工单工序生产进程菜单栏
+    const getOrderProcessLeft_list = await getOrderProcessLeft({ order: order })
+    console.log(getOrderProcessLeft_list)
+    pd_lcdformData['code'] = getOrderProcessLeft_list.data.Gd_info['code']
+    pd_lcdformData['name'] = getOrderProcessLeft_list.data.Gd_info['name']
+    pd_lcd_treeData.value = [{
+      label: order + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
+      // label: order + '-' + getOrderProcessLeft_list.data.Gd_info['code'] + '-' + getOrderProcessLeft_list.data.Gd_info['name'],
+      value: undefined,
+      children: []
+    }]
+    const newData = []
+    for (const key in getOrderProcessLeft_list.data.Gy_info) {
+      const temp = getOrderProcessLeft_list.data.Gy_info[key]
+      const concatenatedValue = `${temp.Gy0_yjno}-${temp.Gy0_gxh} ---> ${temp.Gy0_gxmc}`
+      newData.push({ label: concatenatedValue, value: temp.Gy0_gxh })
+    }
+    pd_lcd_treeData.value[0].children = newData
+    // 5.2流程单查询-获取工单工序生产进程右侧【进入页面默认显示第一个】
+    const getOrderProcessRight_list = await getOrderProcessRight({ order: order, gxNo: newData[0].value })
+    processList.value = getOrderProcessRight_list.data
+  } catch (error) {
+    console.error(error)
+  }
+}
+
+const pd_lcd_handleNodeClick = async(node) => {
+  if (node.value === undefined) return
+  const order = pd_lcdformData['gdbh']
+  // //5.2流程单查询-获取工单工序生产进程右侧
+  const getOrderProcessRight_list = await getOrderProcessRight({ order: order, gxNo: node.value })
+  console.log(getOrderProcessRight_list)
+  processList.value = getOrderProcessRight_list.data
+}
 </script>
 
 <style scoped>

+ 582 - 0
src/view/performance/printYgjjmx.vue

@@ -0,0 +1,582 @@
+<template>
+  <div style="width: 30vw; height: 50vh">
+    <el-form inline @submit.prevent>
+      <el-form-item label="日期选择">
+        <div class="block">
+          <el-date-picker
+            v-model="date"
+            type="daterange"
+            range-separator="到"
+            start-placeholder="起始日期"
+            end-placeholder="结束日期"
+            value-format="YYYY.MM.DD"
+            style="width: 250px"
+          />
+        </div>
+      </el-form-item>
+
+      <el-form-item label="员工编号">
+        <el-input
+          v-model="input"
+          autocomplete="off"
+          style="width: 110px"
+          @keyup.enter="handleEnter"
+        />
+      </el-form-item>
+      <el-form-item label="">
+        <el-input
+          v-model="ygxm"
+          autocomplete="off"
+          style="width: 128px"
+          readonly
+        />
+      </el-form-item>
+
+      <br />
+      <el-form-item label="">
+        <el-button @click="handlePrint"> 打印 </el-button>
+      </el-form-item>
+    </el-form>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "Ygjjmx",
+};
+// 2工单超节损统计(按工序)
+import service from "@/utils/request";
+//获取员工姓名
+const reportName = (params) => {
+  return service({
+    url: "/mes_server/reporting_work/getStaffName",
+    method: "get",
+    params,
+  });
+};
+//员工计件明细
+const getPieceDetail = (params) => {
+  return service({
+    url: "/mes_server/employee_daily_salary/getPieceDetail",
+    method: "get",
+    params,
+  });
+};
+</script>
+
+<script setup>
+import { ref, defineProps } from "vue";
+import { hiprint } from "vue-plugin-hiprint";
+import { ElMessage, dayjs } from "element-plus";
+
+// const props = defineProps(['gdbh'])
+const props = defineProps({
+  ygbh: {
+    type: String,
+    default: "",
+  },
+});
+const input = ref(props["ygbh"]);
+const ygxm = ref("");
+const date = ref([
+  dayjs().startOf("month").format("YYYY.MM.DD"),
+  dayjs().format("YYYY.MM.DD"),
+]);
+
+const handlePrint = async () => {
+  // 引入后初始化
+  hiprint.init();
+  const template = {
+    panels: [
+      {
+        index: 0,
+        name: 1,
+        paperType: "A4",
+        height: 210,
+        width: 297,
+        paperHeader: 78,
+        paperFooter: 577.5,
+        printElements: [
+          {
+            options: {
+              left: 320,
+              top: 20,
+              height: 18,
+              width: 130,
+              title: "员工计件明细记录",
+              coordinateSync: false,
+              widthHeightSync: false,
+              fontSize: 15,
+              textAlign: "center",
+              textContentVerticalAlign: "middle",
+              qrCodeLevel: 0,
+              draggable: false,
+            },
+            printElementType: {
+              title: "文本",
+              type: "text",
+            },
+          },
+          {
+            options: {
+              left: 320,
+              top: 45,
+              height: 12,
+              width: 130,
+              title: "文本",
+              right: 451.83339436848956,
+              bottom: 57.08334859212239,
+              vCenter: 391.83339436848956,
+              hCenter: 52.20834859212239,
+              field: "rqfw",
+              coordinateSync: false,
+              widthHeightSync: false,
+              hideTitle: true,
+              textAlign: "center",
+              textContentVerticalAlign: "middle",
+              qrCodeLevel: 0,
+              draggable: false,
+            },
+            printElementType: {
+              title: "文本",
+              type: "text",
+            },
+          },
+          {
+            options: {
+              left: 30,
+              top: 65,
+              height: 12,
+              width: 130,
+              right: 451.83339436848956,
+              bottom: 57.08334859212239,
+              vCenter: 391.83339436848956,
+              hCenter: 52.20834859212239,
+              field: "ygzl",
+              coordinateSync: false,
+              widthHeightSync: false,
+              hideTitle: true,
+              textContentVerticalAlign: "middle",
+              qrCodeLevel: 0,
+              draggable: false,
+              fontSize: 9.75,
+              color: "#0000ff",
+            },
+            printElementType: {
+              title: "文本",
+              type: "text",
+            },
+          },
+          {
+            options: {
+              left: 600,
+              top: 66,
+              height: 12,
+              width: 140,
+              title: "文本",
+              right: 756.5624885559082,
+              bottom: 76.50000286102295,
+              vCenter: 691.3124885559082,
+              hCenter: 70.50000286102295,
+              coordinateSync: false,
+              widthHeightSync: false,
+              textAlign: "right",
+              textContentVerticalAlign: "middle",
+              qrCodeLevel: 0,
+              draggable: false,
+              field: "dysj",
+              hideTitle: true,
+            },
+            printElementType: {
+              title: "文本",
+              type: "text",
+            },
+          },
+          {
+            options: {
+              left: 20,
+              top: 80,
+              height: 470,
+              width: 795,
+              field: "table",
+              coordinateSync: false,
+              widthHeightSync: false,
+              fontSize: 7.5,
+              lineHeight: 12,
+              tableHeaderRowHeight: 30,
+              tableHeaderBackground: "#ffffff",
+              tableHeaderFontSize: 9,
+              tableBodyRowHeight: 25,
+              columns: [
+                [
+                  {
+                    width: 50,
+                    title: "日期",
+                    titleSync: false,
+                    field: "rq",
+                    checked: true,
+                    columnId: "rq",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 40,
+                    title: "工单编号",
+                    titleSync: false,
+                    field: "gdbh",
+                    checked: true,
+                    columnId: "gdbh",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 135,
+                    title: "工序名称",
+                    titleSync: false,
+                    field: "gxmc",
+                    checked: true,
+                    columnId: "gxmc",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 40,
+                    title: "机台",
+                    titleSync: false,
+                    field: "jt",
+                    checked: true,
+                    columnId: "jt",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 50,
+                    title: "班组产量",
+                    titleSync: false,
+                    field: "bzcl",
+                    checked: true,
+                    columnId: "bzcl",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 30,
+                    title: "保养工时",
+                    titleSync: false,
+                    field: "bygs",
+                    checked: true,
+                    columnId: "bygs",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 30,
+                    title: "装版工时",
+                    titleSync: false,
+                    field: "zbgs",
+                    checked: true,
+                    columnId: "zbgs",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 30,
+                    title: "打样工时",
+                    titleSync: false,
+                    field: "dygs",
+                    checked: true,
+                    columnId: "dygs",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 30,
+                    title: "异常停机",
+                    titleSync: false,
+                    field: "yctj",
+                    checked: true,
+                    columnId: "yctj",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "补产标准",
+                    titleSync: false,
+                    field: "bcbz",
+                    checked: true,
+                    columnId: "bcbz",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "班组补产",
+                    titleSync: false,
+                    field: "bzbc",
+                    checked: true,
+                    columnId: "bzbc",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "日定额",
+                    titleSync: false,
+                    field: "rde",
+                    checked: true,
+                    columnId: "rde",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "达标定额",
+                    titleSync: false,
+                    field: "dbde",
+                    checked: true,
+                    columnId: "dbde",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "千件工价",
+                    titleSync: false,
+                    field: "qjgj",
+                    checked: true,
+                    columnId: "qjgj",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "个人计件工资",
+                    titleSync: false,
+                    field: "grjjgz",
+                    checked: true,
+                    columnId: "grjjgz",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "个人加班工资",
+                    titleSync: false,
+                    field: "grjbgz",
+                    checked: true,
+                    columnId: "grjbgz",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                  {
+                    width: 45,
+                    title: "比例",
+                    titleSync: false,
+                    field: "bl",
+                    checked: true,
+                    columnId: "bl",
+                    fixed: false,
+                    rowspan: 1,
+                    colspan: 1,
+                    align: "right",
+                    halign: "center",
+                    tableQRCodeLevel: 0,
+                    tableSummaryTitle: true,
+                    tableSummary: "",
+                  },
+                ],
+              ],
+            },
+            printElementType: {
+              title: "表格",
+              type: "table",
+              editable: true,
+              columnDisplayEditable: true,
+              columnDisplayIndexEditable: true,
+              columnTitleEditable: true,
+              columnResizable: true,
+              columnAlignEditable: true,
+              isEnableEditField: true,
+              isEnableContextMenu: true,
+              isEnableInsertRow: true,
+              isEnableDeleteRow: true,
+              isEnableInsertColumn: true,
+              isEnableDeleteColumn: true,
+              isEnableMergeCell: true,
+            },
+          },
+        ],
+        paperNumberLeft: 736.5,
+        paperNumberTop: 66,
+        paperNumberContinue: true,
+        paperNumberFormat: "(第paperNo页 共paperCount页)",
+        backgroundColor: "#ffffff",
+        overPrintOptions: {
+          content: "",
+          opacity: 0.7,
+          type: 1,
+        },
+        watermarkOptions: {
+          content: "",
+          fillStyle: "rgba(87, 13, 248, 0.5)",
+          fontSize: "36px",
+          rotate: 25,
+          width: 413,
+          height: 310,
+          timestamp: true,
+          format: "YYYY-MM-DD HH:mm",
+        },
+      },
+    ],
+  };
+  const hiprintTemplate = new hiprint.PrintTemplate({ template });
+  const params = {
+    start_time: date.value[0],
+    end_time: date.value[1],
+    code: input.value,
+  };
+  console.log(params);
+  const res = await getPieceDetail(params);
+  if (res?.["code"] === 0) {
+    const { data } = res;
+    if (!data) {
+      ElMessage({
+        type: "info",
+        message: res["msg"],
+      });
+      return;
+    }
+    let preRq = "";
+    const getRq = (val) => {
+      const result = val === preRq ? "" : val;
+      preRq = val;
+      return result;
+    };
+    const tableData = {
+      rqfw: `(${params["start_time"]} - ${params["end_time"]})`,
+      ygzl: `员工资料:${data?.[0]?.["员工资料"]}`,
+      dysj: `打印时间:${dayjs().format("YYYY.MM.DD HH:mm:ss")}`,
+      table: data?.map((item, index) => ({
+        rq: getRq(item["sczl_rq"]),
+        gdbh: item["sczl_gdbh"],
+        gxmc: item["sczl_type"].substring(0, 20),
+        jt: item["sczl_jtbh"],
+        bzcl: item["班组车头产量"],
+        bygs: item["保养工时"],
+        zbgs: item["装版工时"],
+        dygs: item["打样工时"],
+        yctj: item["异常停机工时"],
+        bcbz: item["补产标准"],
+        bzbc: item["班组补产"],
+        rde: item["日定额"],
+        dbde: item["达标定额"],
+        qjgj: item["千件工价"],
+        grjjgz: item["个人计件工资"],
+        grjbgz: item["个人加班工资"],
+        bl: item["个人比例"],
+      })),
+    };
+    hiprintTemplate.print(tableData);
+  }
+};
+
+async function handleEnter(params) {
+  const res = await reportName({ code: input.value });
+  if (res?.["code"] === 0) {
+    ygxm.value = res?.["data"];
+  }
+}
+</script>
+
+<style scoped></style>

+ 20 - 0
src/view/performance/yuangongrigongzi.vue

@@ -40,6 +40,7 @@
               <el-button type="primary" :icon="Refresh">重置</el-button>
 			  <el-button type="primary" :icon="Search" @click="onposition">定位</el-button>
 			  <el-button type="primary" :icon="Search">查改</el-button>
+			  <el-button type="primary" @click="handlePrint">员工计件明细</el-button>
               <div style="margin-left: auto;">
                 <el-button type="primary" :icon="Download" @click="exportExcel">导出到Excel</el-button>
               </div>
@@ -326,6 +327,16 @@
       </el-container>
     </el-container>
 
+
+          <!-- 员工计件明细 -->
+          <el-dialog
+        v-model="dialogYgjjmx"
+        title="员工计件明细"
+        destroy-on-close
+      >
+        <Ygjjmx :ygbh="currentRow?.['bh']" />
+      </el-dialog>
+
   </div>
 </template>
 
@@ -347,6 +358,7 @@ import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive, onMounted, onBeforeMount } from 'vue'
 import { getPackingSideTable, getPackingTable } from '@/api/mes_api_gty/myapi'
 import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+import Ygjjmx from './printYgjjmx.vue'
 defineOptions({
   name: '06-packingDocuments'
 })
@@ -666,6 +678,7 @@ const enterDialog = async () => {
 }
 // 单击表格操作
 function ontable(row, column, event) {
+  currentRow.value = row
   console.log(params.date)
   let parts = params.date.split('-')
   
@@ -707,6 +720,13 @@ function exportExcel() {
   console.log('导出到excel');
 }
 
+const currentRow = ref()
+const dialogYgjjmx = ref(false)
+function handlePrint() {
+  dialogYgjjmx.value = true
+  console.log(currentRow.value);
+}
+
 // 生命周期钩子
 onMounted(async () => {
 });