guoyuji
2024-03-22 ae3841bbc95227f6da9d594dd3ddf33af87cddfa
north-glass-erp/northglass-erp/src/views/pp/report/ProcessCardProgress.vue
@@ -1,7 +1,22 @@
<script setup>
import {reactive, ref} from "vue";
import {useRouter} from  'vue-router'
import request from "@/utils/request"
import deepClone from "@/utils/deepClone"
import {ElDatePicker, ElMessage} from "element-plus"
import useProductGlassTypeStore from "@/stores/sd/product/productGlassType"
import {nextTick, onMounted, onUnmounted, reactive, ref, watch} from "vue"
import {Search} from "@element-plus/icons-vue"
import GlassType from "@/components/sd/product/GlassType.vue"
import {useRouter} from 'vue-router'
import Sortable from 'sortablejs'
import BasicTable from '@/components/basic/BasicTable.vue'
import {VXETable} from "vxe-table";
import useUserInfoStore from "@/stores/userInfo";
import {changeFilterEvent, filterChanged} from "@/hook"
import {addListener,toolbarButtonClickEvent} from "@/hook/mouseMove";
import { useI18n } from 'vue-i18n'
//语言获取
const { t } = useI18n()
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
@@ -30,8 +45,56 @@
  return count.toFixed(2)
}
//子组件接收参数
//定义滚动条高度
let scrollTop = ref(null)
let scrollHeight = ref(null)
let clientHeight = ref(null)
const scrollEvnt = (row) => {
  // 内容高度
  scrollTop.value = row.$event.target.scrollTop
  scrollHeight.value = row.$event.target.scrollHeight
  clientHeight.value = row.$event.target.clientHeight
}
//筛选条件,有外键需要先定义明细里面的数据
let filterData = ref({
  order: {
    project: ''
  },
  orderDetail: {
    productId: '',
    productName: '',
    computeGrossArea: '',
    processingNote: '',
  }
})
//点击查询
const getWorkOrder = () => {
  let inputVal = form.orderId
  request.post(`/processCard/flowCard/${inputVal}`, filterData.value).then((res) => {
    if (res.code == 200) {
      pageTotal.value = res.data.total
      xGrid.value.loadData(res.data.data)
      gridOptions.loading = false
    } else {
      ElMessage.warning(res.msg)
    }
  })
}
/*后端返回结果多层嵌套展示*/
const hasDecimal = (value) => {
  const regex = /\./; // 定义正则表达式,查找小数点
  return regex.test(value); // 返回true/false
}
//子组件接收参数
const xGrid = ref()
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
@@ -62,17 +125,18 @@
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {field: '1', width: 150, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true, },
    {field: '2',width: 130, title: '单片名称', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: '3', width: 120,title: '订单类型', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: '4',width: 110, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: '5', width: 90,title: '标记', sortable: true,showOverflow:"ellipsis"},
    {field: '6', width: 90,title: '数量', sortable: true},
    {field: '7',width: 90, title: '次破数量', sortable: true},
    {field: '8',width: 120, title: '切割', sortable: true},
    {field: '9',width: 120, title: '磨边', sortable: true},
    {field: '10',width: 120, title: '钢化', sortable: true},
    {field: '11',width: 120, title: '入库面积', sortable: true},
    {field: '1', width: 150, title: '产品名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
    {field: '2',width: 130, title: '单片名称' ,filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
    {field: '3', width: 120,title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
    {field: '4',width: 110, title: '流程卡号',filters:[{ data: '' }],slots: { filter: 'num1_filter' },filterMethod: filterChanged},
    {field: '5', width: 90,title: '标记',showOverflow:"ellipsis"},
    {field: '6', width: 90,title: '数量'},
    {field: '7',width: 90, title: '次破数量'},
    {field: '8',width: 120, title: '切割'},
    {field: '9',width: 120, title: '磨边'},
    {field: '10',width: 120, title: '钢化'},
    {field: '11',width: 120, title: '入库面积'},
  ],//表头按钮
  toolbarConfig: {
@@ -86,45 +150,6 @@
    custom: true
  },
  data:  [
    {
      1:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)',
      2:'10mm超白UD60平钢(外)',
      3:'普通订单',
      4:'NG23052602A01/1',
      5:'1',
      6:'33',
      7:'1',
      8:'22',
      9:'22',
      10:'22',
      11:'314.13',
    },
    {
      1:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)',
      2:'10mm超白平钢+12Ar(结)',
      3:'普通订单',
      4:'NG23052602A01/2',
      5:'2',
      6:'33',
      7:'1',
      8:'22',
      9:'22',
      10:'22',
      11:'314.13',
    },
    {
      1:'10mm超白UD60平钢(外)+12Ar(结)+10mm超白平钢+12Ar(结)+10mm超白平钢(内)',
      2:'10mm超白平钢(内)',
      3:'普通订单',
      4:'NG23052602A01/3',
      5:'3',
      6:'33',
      7:'1',
      8:'22',
      9:'22',
      10:'22',
      11:'314.13',
    },
  ],//table body实际数据
  //脚部求和
  // footerMethod ({ columns, data }) {//页脚函数
@@ -144,31 +169,10 @@
})
const value = ref('')
const options = [
  {
    value: 'Option1',
    label: 'Option1',
  },
  {
    value: 'Option2',
    label: 'Option2',
  },
  {
    value: 'Option3',
    label: 'Option3',
  },
]
const form = reactive({
  name: '',
  region: '',
  date1: '',
  date2: '',
  delivery: false,
  type: [],
  resource: '',
  desc: '',
  orderId: '',
})
@@ -187,9 +191,14 @@
  <div class="main-div-customer" >
    <div id="selectForm">
      <el-row :gutter="0">
        <el-input placeholder="销售单号" v-model="form.name" value="NG23110102" style="width: 150px"/>
        <el-input v-model="form.orderId" clearable :placeholder="$t('order.orderId')" style="width: 130px"></el-input>
        &nbsp;&nbsp;
        <el-button type="primary">查询</el-button>
        <el-button
            @click="getWorkOrder"
            id="select"
            type="primary" :icon="Search">{{$t('basicData.search')}}
        </el-button>
      </el-row>
    </div>
@@ -213,12 +222,6 @@
        </ul>
      </template>
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button @click="getTableRow(row,'setType')" link type="primary" size="small">反审</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>
      </template>
      <template #num1_filter="{ column, $panel }">
        <div>