tty 1 жил өмнө
parent
commit
506ff977e4

+ 2 - 2
src/api/mes_api_gty/orderAccounting.js

@@ -4,7 +4,7 @@ import service from '@/utils/request'
 * 工单超节损核算
 */
 
-// 1.1获取左侧菜单栏
+// 1.1获取左侧菜单栏(2.22修改)
 export const getSide = (params) => {
   return service({
     url: '/mes_server/order_super_loss/getTab',
@@ -13,7 +13,7 @@ export const getSide = (params) => {
   })
 }
 
-// 1.2获取超节损工单列表-筛选
+// 1.2获取超节损工单列表-筛选(2.22修改)
 export const getTable = (params) => {
   return service({
     url: '/mes_server/order_super_loss/getList',

+ 15 - 5
src/view/performance/12-orderAccounting/componets/detail.vue

@@ -1,9 +1,9 @@
 <template>
   <el-dialog
-    :model-value="modelValue"
+    :model-value="isShow"
     title="产品工艺流程"
     destroy-on-close
-    :before-close="()=>{emits('update:modelValue', false )}"
+    :before-close="()=>{emits('destroy')}"
     style="width: 80vw; height: 80vh"
   >
     <el-form
@@ -89,7 +89,7 @@
 
     <template #footer>
       <div class="dialog-footer">
-        <el-button @click="()=>{emits('update:modelValue', false )}">取 消</el-button>
+        <el-button @click="()=>{emits('destroy')}">取 消</el-button>
         <el-button
           type="primary"
           @click="handleUpdateDatail"
@@ -129,8 +129,18 @@ const updateOrderGy = (data) => {
 import { defineEmits, defineProps, ref } from 'vue'
 import { ElMessage } from 'element-plus'
 
-const props = defineProps(['modelValue', 'gdbh'])
-const emits = defineEmits(['update:modelValue'])
+// const props = defineProps(['isShow', 'gdbh'])
+const props = defineProps({
+  isShow: {
+    type: Boolean,
+    default: false,
+  },
+  gdbh: {
+    type: String,
+    default: '',
+  },
+})
+const emits = defineEmits(['destroy'])
 const detailData = ref([])
 const input = ref(props['gdbh'])
 

+ 41 - 25
src/view/performance/12-orderAccounting/index.vue

@@ -78,8 +78,9 @@
             <!-- 查改 -->
             <Detail
               v-if="dialogDetail"
-              v-model="dialogDetail"
+              :is-show="dialogDetail"
               :gdbh="gdbh"
+              @destroy="()=>{dialogDetail = false}"
             />
 
             <!-- 工单超节损统计 -->
@@ -155,6 +156,7 @@
               highlight-current-row
               border
               :row-class-name="rowClassName"
+              :cell-class-name="cellClassName"
               :row-style="{ height: '20px' }"
               :cell-style="{ padding: '0px' }"
               :header-row-style="{ height: '20px' }"
@@ -258,30 +260,30 @@ getSideData()
 
 // 表格数据
 const tableCols1 = [
-  { label: '超损工单', prop: '', width: '90' },
+  { label: '超损工单', prop: 'csgd', width: '90' },
   { label: '工单编号', prop: 'Gd_gdbh', width: '100' },
-  { label: '印件号', prop: 'yj_Yjno', width: '100' },
+  { label: '印件号', prop: 'jjcp_yjno', width: '100' },
   { label: '联数', prop: 'yj_ls', width: '80' },
-  { label: '产品代号', prop: 'Gd_cpdh', width: '150' },
-  { label: '产品名称', prop: 'Gd_cpmc', width: '250' },
+  { label: '产品代号', prop: '成品编码', width: '150' },
+  { label: '产品名称', prop: '成品名称', width: '250' },
   { label: '实际投料', prop: '实际投料', width: '100' },
   { label: '计量单位', prop: '计量单位', width: '100' },
   { label: '入仓日期', prop: 'warehousing_date', width: '120' },
   { label: '入仓数量', prop: 'warehousing_num', width: '100' },
   { label: '目标合格率', prop: 'target_rate', width: '100' },
   { label: '实际合格率', prop: 'real_rate', width: '100' },
-  { label: '奖惩系数', prop: '', width: '100' },
+  { label: '奖惩系数', prop: 'reward_rate', width: '100' },
   { label: '奖罚金额合计', prop: '', width: '120' },
   { label: '废品合计', prop: '废品合计', width: '100' },
-  { label: '工单无形损', prop: 'intangible_loss', width: '100' },
-  { label: '材料废', prop: 'material_waste', width: '100' },
-  { label: '零头处理', prop: '', width: '100' },
-  { label: '处发废', prop: 'waste_out', width: '100' },
-  { label: '外摊废', prop: '', width: '100' },
-  { label: '工单计划损耗', prop: 'plan_loss', width: '120' },
-  { label: '工单制程废', prop: 'zcfp', width: '100' },
-  { label: '工单检验废', prop: 'waste_quality', width: '100' },
-  { label: '年月', prop: '年月', width: '100' },
+  { label: '工单无形损', prop: '工单无形损', width: '100' },
+  { label: '材料废', prop: '材料废', width: '100' },
+  { label: '零头处理', prop: '零头处理', width: '100' },
+  { label: '处发废', prop: '外发废', width: '100' },
+  { label: '外摊废', prop: '分摊废', width: '100' },
+  { label: '工单计划损耗', prop: '工单计划损耗', width: '120' },
+  { label: '工单制程废', prop: '', width: '100' },
+  { label: '工单检验废', prop: '工单质检废', width: '100' },
+  { label: '年月', prop: '', width: '100' },
 ]
 const tableCols2 = [
   { label: '工单编号', prop: 'Gy0_gdbh', width: '100' },
@@ -311,10 +313,14 @@ watch(currentRow, (value, oldValue, onCleanup) => {
 
 // 显示上方表格
 const handleNodeClick = async(node) => {
-  if (node.children) {
-    const { date } = node
-    const res = await getTable({ date, limit: 9999, page: 1 })
-    tableData1.value = res.data.data
+  console.log(node)
+  if (!node.children) {
+    const { date, code } = node
+    const res = await getTable({ date, code, limit: 9999, page: 1 })
+    tableData1.value = res.data.data.map(item => ({
+      ...item,
+      csgd: parseFloat(item['target_rate']) - parseFloat(item['real_rate']) > 0 ? '√' : '',
+    }))
     console.log(res.data)
   } else {
     // console.log(node.date, node.code)
@@ -343,7 +349,17 @@ const handleSearch = () => {
   }
 }
 const rowClassName = ({ row, rowIndex }) => {
+  if (row['csgd'] === '√') {
+    return 'yellow-row'
+  }
+  return ''
+}
 
+const cellClassName = ({ row, column, rowIndex, columnIndex }) => {
+  if ([7, 11, 13, 21].includes(columnIndex)) {
+    return 'red-cell'
+  }
+  return ''
 }
 </script>
 
@@ -374,8 +390,12 @@ const rowClassName = ({ row, rowIndex }) => {
   flex: 1;
 }
 
-:deep(.el-table__body .warning-row) {
-  background: #FFFF80 !important;
+:deep(.el-table .yellow-row) {
+  background: #FFFF80;
+}
+
+:deep(.red-cell div) {
+  color: #FF0000 !important;
 }
 
 /* 选中某行时的背景色 */
@@ -383,10 +403,6 @@ const rowClassName = ({ row, rowIndex }) => {
   background: #ff80ff !important;
 }
 
-:deep(.el-table .bg-yellow) {
-  background: yellow;
-}
-
 </style>
 <style scoped>
 :deep(.el-table td .cell) {