瀏覽代碼

工单核验单维护

tty 1 年之前
父節點
當前提交
fba1742069

+ 46 - 1
src/api/mes_api_gty/workOrderVerification.js

@@ -85,7 +85,7 @@ export const getWasteDistribution = (params) => {
   })
 }
 
-// 4.1工单工期异常调整
+// 4.1获取工单工序状态
 export const getOrderDate = (params) => {
   return service({
     url: '/mes_server/work_order_verification/getOrderDate',
@@ -93,3 +93,48 @@ export const getOrderDate = (params) => {
     params
   })
 }
+
+// 4.2工单工序状态修正
+export const updateOrderData = (data) => {
+  return service({
+    url: '/mes_server/work_order_verification/editOrderFinishDate',
+    method: 'post',
+    data
+  })
+}
+
+// 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
+  })
+}
+
+// 6核检废品日统计
+export const getDaysWast = (params) => {
+  return service({
+    url: '/mes_server/work_order_verification/getDaysWast',
+    method: 'get',
+    params
+  })
+}
+
+// 8工单质检废品统计
+export const getOrderWasteTotal = (params) => {
+  return service({
+    url: '/mes_server/work_order_verification/getOrderWasteTotal',
+    method: 'get',
+    params
+  })
+}

+ 1 - 1
src/view/performance/06-packingDocuments/index.vue

@@ -61,6 +61,7 @@
               row-key="ID"
               highlight-current-row
               border
+              show-overflow-tooltip="true"
               :row-style="{ height: '20px' }"
               :cell-style="{ padding: '0px' }"
               :header-row-style="{ height: '20px' }"
@@ -79,7 +80,6 @@
                 :prop="column.prop"
                 :label="column.label"
                 :width="column.width"
-                show-overflow-tooltip="true"
               />
             </el-table>
             <!-- 分页 -->

+ 1 - 1
src/view/performance/07-otherDocuments/index.vue

@@ -50,6 +50,7 @@
               row-key="ID"
               highlight-current-row
               border
+              show-overflow-tooltip="true"
               :row-style="{ height: '20px' }"
               :cell-style="{ padding: '0px' }"
               :header-row-style="{ height: '20px' }"
@@ -69,7 +70,6 @@
                 :prop="column.prop"
                 :label="column.label"
                 :width="column.width"
-                show-overflow-tooltip="true"
               />
 
             </el-table>

+ 1 - 1
src/view/performance/08-timesheet/index.vue

@@ -54,6 +54,7 @@
               row-key="ID"
               highlight-current-row
               border
+              show-overflow-tooltip="true"
               :row-style="{ height: '20px' }"
               :cell-style="{ padding: '0px' }"
               :header-row-style="{ height: '20px' }"
@@ -72,7 +73,6 @@
                 :prop="column.prop"
                 :label="column.label"
                 :width="column.width"
-                show-overflow-tooltip="true"
               />
 
             </el-table>

+ 158 - 0
src/view/performance/09-workOrderVerification/gongdanzhijianfeipintongji.vue

@@ -0,0 +1,158 @@
+<template>
+  <el-dialog
+    :model-value="props.isShow"
+    title="核检废品日统计"
+    fullscreen
+    destroy-on-close
+    @close="handleExit"
+  >
+    <el-container>
+      <!-- 按钮部分 -->
+      <el-header>
+        <el-button
+          type="primary"
+          size="large"
+          @click="handleExcel"
+        >导出到Excel
+        </el-button>
+        <el-button
+          type="primary"
+          size="large"
+          @click="handleExit"
+        >退出
+        </el-button>
+      </el-header>
+
+      <el-main>
+
+        <el-input
+          v-model="input"
+          placeholder="输入工单编号"
+          style="width: 200px;margin-bottom: 10px"
+        />
+        <el-button
+          type="primary"
+          :loading="isLoading"
+          style="margin-bottom: 10px; margin-left: 5px;"
+          @click="handleSearch"
+        >刷新
+        </el-button>
+        <el-input
+          v-model="inputCpmc"
+          readonly
+          style="width: 50vw;margin-bottom: 10px;margin-left: 5px"
+        />
+        <el-table
+          ref="multipleTable"
+          width="100%"
+          height="70vh"
+          :data="tableData"
+          row-key="ID"
+          highlight-current-row
+          border
+          show-overflow-tooltip
+          :row-style="{ height: '20px' }"
+          :cell-style="{ padding: '0px' }"
+          :header-row-style="{ height: '20px' }"
+          :header-cell-style="{ padding: '0px' }"
+        >
+          <!-- 循环渲染表格列 -->
+          <el-table-column
+            v-for="column in tableColumns"
+            :key="column.prop"
+            :prop="column.prop"
+            :label="column.label"
+            :width="column.width"
+          />
+        </el-table>
+
+      </el-main>
+
+    </el-container>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: 'Gongdanzhijianfeipintongji',
+}
+
+// 8工单质检废品统计
+import service from '@/utils/request'
+export const getOrderWasteTotal = (params) => {
+  return service({
+    url: '/mes_server/work_order_verification/getOrderWasteTotal',
+    method: 'get',
+    params
+  })
+}
+</script>
+
+<script setup>
+import { watch, ref, reactive, defineProps, defineEmits } from 'vue'
+
+const props = defineProps(['isShow', 'val'])
+const emits = defineEmits(['myClose'])
+
+const tableColumns = reactive([
+  { label: '工单编号', prop: 'gdbh', width: '150' },
+  { label: '产品代号', prop: 'product_code', width: '150' },
+  { label: '产品名称', prop: 'product_name', width: '150' },
+  { label: '订单数量', prop: '订单数量', width: '150' },
+  { label: '实际投料', prop: 'aaa', width: '150' },
+  { label: '计量单位', prop: '计量单位', width: '150' },
+  { label: '交货日期', prop: '交货日期', width: '150' },
+  { label: '入仓数量', prop: 'aaa', width: '150' },
+  { label: '入仓日期', prop: 'aaa', width: '150' },
+  { label: '印件号', prop: 'qczl_yjno', width: '150' },
+  { label: '联数', prop: 'yj_ls', width: '150' },
+  { label: '工序号', prop: 'fp_gxh', width: '150' },
+  { label: '流程单号', prop: 'qczl_num', width: '150' },
+  { label: '员工编号', prop: 'fp_bh', width: '150' },
+  { label: '员工姓名', prop: 'aaa', width: '150' },
+  { label: '废品类别', prop: 'fp_lb', width: '150' },
+  { label: '数量', prop: 'fp_sl', width: '150' },
+])
+const tableData = ref([])
+const input = ref('')
+const inputCpmc = ref('')
+const isLoading = ref(false)
+
+watch(props, (value, oldValue, onCleanup) => {
+  if (value.isShow === true) {
+    input.value = value.val
+  }
+})
+const handleExit = () => {
+  emits('myClose')
+}
+
+const handleExcel = () => {
+}
+
+const handleSearch = async() => {
+  if (!input.value) { return }
+  const params = { order: input.value }
+
+  isLoading.value = true
+  const res = await getOrderWasteTotal(params)
+  isLoading.value = false
+  if (res.code === 0) {
+    inputCpmc.value = res.data?.[0]?.['product_name']
+    const val = res.data.map(item => {
+      return { ...item, gdbh: params.order }
+    })
+    console.log(res.data)
+    tableData.value = val
+  }
+}
+
+</script>
+
+<style scoped>
+
+:deep(.el-table td .cell) {
+  line-height: 30px !important;
+}
+
+</style>

+ 55 - 15
src/view/performance/09-workOrderVerification/index.vue

@@ -3,13 +3,12 @@
     <el-container>
       <!-- 左侧树形结构 -->
       <el-scrollbar max-height="75vh">
-        <el-aside >
+        <el-aside>
           <div class="JKWTree-tree">
             <h3>工单核验单维护</h3>
             <el-tree
               :data="treeData"
-              :props="defaultProps"
-              highlight-current="true"
+              highlight-current
               @node-click="handleNodeClick"
             />
           </div>
@@ -31,7 +30,22 @@
                 type="primary"
                 :icon="Search"
                 @click="handleSearch"
-              >搜索</el-button>
+              >搜索
+              </el-button>
+              <el-button
+                type="primary"
+                :icon="Search"
+                @click="isShowMrhjtj = true"
+              >每日核检统计
+              </el-button>
+
+              <el-button
+                type="primary"
+                :icon="Search"
+                @click="showGdzjfptj"
+              >工单质检废品统计
+              </el-button>
+
               <div style="margin-left: auto;">
                 <el-button
                   type="primary"
@@ -42,17 +56,18 @@
             </div>
             <!-- 数据展示 -->
             <el-table
-              ref="multipleTable"
+              ref="table"
               style="width: 100%"
               :data="tableData"
               row-key="ID"
               highlight-current-row
               border
+              show-overflow-tooltip
               :row-style="{ height: '20px' }"
               :cell-style="{ padding: '0px' }"
               :header-row-style="{ height: '20px' }"
               :header-cell-style="{ padding: '0px' }"
-              @selection-change="handleSelectionChange"
+              @row-click="handleSelectChange"
               @row-dblclick="doubleClick"
             >
               <el-table-column
@@ -66,7 +81,6 @@
                 :prop="column.prop"
                 :label="column.label"
                 :width="column.width"
-                show-overflow-tooltip="true"
               />
 
             </el-table>
@@ -381,6 +395,19 @@
             </el-table>
           </el-dialog>
 
+          <!-- 核验废品日统计弹出框 -->
+          <Meirihejiantongji
+            :is-show="isShowMrhjtj"
+            @my-close="isShowMrhjtj = false"
+          />
+
+          <!-- 工单质检废品统计 -->
+          <Gongdanzhijianfeipintongji
+            :is-show="isShowGdzjfptj"
+            :val="value1"
+            @my-close="isShowGdzjfptj =false"
+          />
+
         </el-main>
       </el-container>
     </el-container>
@@ -399,11 +426,12 @@ import {
 } from '@/api/company'
 
 // 全量引入格式化工具 请按需保留
-import { getDictFunc, formatDate, formatBoolean, filterDict, ReturnArrImg, onDownloadFile } from '@/utils/format'
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessage } from 'element-plus'
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
-import { ref, reactive, onMounted, onBeforeMount } from 'vue'
+import { ref, reactive } from 'vue'
 import { getSide, getTable, getOneWorkOrder, getOrderInfo, getGxAndLeader, getWastInfo, updateData } from '@/api/mes_api_gty/workOrderVerification'
+import Meirihejiantongji from './meirihejiantongji.vue'
+import Gongdanzhijianfeipintongji from './gongdanzhijianfeipintongji.vue'
 
 defineOptions({
   name: '06PackingDocuments'
@@ -488,8 +516,8 @@ const getTableData = async() => {
   const response = await getTable(params)
   if (response.code === 0) {
     total.value = response.data.total
-    Object.assign(tableData, response.data.rows)
-    // tableData.splice(0, tableData.length, ...response.data.rows)
+    // Object.assign(tableData, response.data.rows)
+    tableData.splice(0, tableData.length, ...response.data.rows)
   }
 }
 
@@ -796,9 +824,21 @@ function exportExcel() {
   console.log('导出到excel')
 }
 
-// 生命周期钩子
-onMounted(async() => {
-})
+const isShowMrhjtj = ref(false)
+const isShowGdzjfptj = ref(false)
+const value1 = ref('')
+const table = ref(null)
+const currentRow = ref()
+
+const showGdzjfptj = () => {
+  value1.value = currentRow.value?.qczl_gdbh
+  isShowGdzjfptj.value = true
+}
+
+const handleSelectChange = (row, column, event) => {
+  currentRow.value = row
+}
+
 </script>
 
 <style scoped>

+ 158 - 0
src/view/performance/09-workOrderVerification/meirihejiantongji.vue

@@ -0,0 +1,158 @@
+<template>
+  <el-dialog
+    :model-value="props.isShow"
+    title="核检废品日统计"
+    fullscreen
+    destroy-on-close
+    @close="handleExit"
+  >
+    <el-container>
+      <!-- 按钮部分 -->
+      <el-header>
+        <el-button
+          type="primary"
+          size="large"
+          @click="handleExcel"
+        >导出到Excel
+        </el-button>
+        <el-button
+          type="primary"
+          size="large"
+          @click="handleExit"
+        >退出
+        </el-button>
+      </el-header>
+
+      <el-main>
+        <el-date-picker
+          v-model="date"
+          type="daterange"
+          range-separator="--"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+          value-format="YYYY-MM-DD"
+          style="margin-bottom: 10px;"
+        />
+        <el-button
+          type="primary"
+          :loading="isLoading"
+          style="margin-bottom: 10px; margin-left: 5px;"
+          @click="handleSearch"
+        >刷新
+        </el-button>
+        <el-table
+          ref="multipleTable"
+          width="100%"
+          height="70vh"
+          :data="tableData"
+          row-key="ID"
+          highlight-current-row
+          border
+          show-overflow-tooltip
+          :row-style="{ height: '20px' }"
+          :cell-style="{ padding: '0px' }"
+          :header-row-style="{ height: '20px' }"
+          :header-cell-style="{ padding: '0px' }"
+        >
+          <!-- 循环渲染表格列 -->
+          <el-table-column
+            v-for="column in tableColumns"
+            :key="column.prop"
+            :prop="column.prop"
+            :label="column.label"
+            :width="column.width"
+          />
+        </el-table>
+
+      </el-main>
+
+    </el-container>
+  </el-dialog>
+</template>
+
+<script>
+export default {
+  name: 'Meirihejiantongji',
+}
+
+// 6核检废品日统计
+import service from '@/utils/request'
+
+const getDaysWast = (params) => {
+  return service({
+    url: '/mes_server/work_order_verification/getDaysWast',
+    method: 'get',
+    params
+  })
+}
+</script>
+
+<script setup>
+import { ref, reactive, defineProps, defineEmits } from 'vue'
+
+const props = defineProps(['isShow'])
+const emits = defineEmits(['myClose'])
+
+const tableColumns = reactive([
+  { label: '日期', prop: 'qczl_rq', width: '150' },
+  { label: '废品类别', prop: 'fp_lb', width: '150' },
+  { label: 'A班员工编号', prop: 'fp_bh', width: '150' },
+  { label: 'A班员工姓名', prop: 'fp_name', width: '150' },
+  { label: 'A班数量', prop: 'fp_sl', width: '150' },
+  { label: 'B班员工编号', prop: 'fp_bh_b', width: '150' },
+  { label: 'B班员工姓名', prop: 'fp_name_b', width: '150' },
+  { label: 'B班数量', prop: 'fp_sl_b', width: '150' },
+])
+const tableData = reactive([])
+const date = ref()
+const isLoading = ref(false)
+
+const handleExit = () => {
+  emits('myClose')
+}
+
+const handleExcel = () => {
+}
+
+const handleSearch = async() => {
+  const start_date = date?.value?.[0]
+  const end_date = date?.value?.[1]
+
+  if (!start_date || !end_date) { return }
+  const params = {
+    start_date,
+    end_date
+  }
+  isLoading.value = true
+  const res = await getDaysWast(params)
+  isLoading.value = false
+  if (res.code === 0) {
+    const { data } = res
+    const val = data.map(item => {
+      const formatDate = item.qczl_rq?.split(' ')[0]
+
+      if (item.fp_bz === 'B班') {
+        return {
+          qczl_rq: formatDate,
+          fp_lb: item.fp_lb,
+          fp_bh_b: item.fp_bh,
+          fp_name_b: item.fp_name,
+          fp_sl_b: item.fp_sl,
+        }
+      }
+      return { ...item, qczl_rq: formatDate }
+    })
+    console.log(val)
+    tableData.splice(0, tableData.length, ...val)
+  }
+}
+
+</script>
+
+<style scoped>
+
+:deep(.el-table td .cell) {
+  line-height: 30px !important;
+}
+
+</style>