chenlu
2024-12-02 e50fa16b6dbc4e7c50d5fbdbc04d2a556ca01c4e
north-glass-erp/northglass-erp/src/views/pp/glassOptimize/page/ProcessCard.vue
New file
@@ -0,0 +1,194 @@
<script setup>
import {reactive, ref} from "vue";
import {useI18n} from "vue-i18n";
import {Search} from "@element-plus/icons-vue";
import request from "@/utils/request";
import deepClone from "@/utils/deepClone";
import {ElMessage} from "element-plus";
const { t } = useI18n()
const xGrid = ref()
const gridOptions = reactive({
  height:'100%',
  loading: false,
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 30, useKey: true},//鼠标移动或选择高亮
  id: 'ProcessCard',
  scrollX:{enabled: true},
  scrollY:{ enabled: true ,gt:0},//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
  filterConfig: {   //筛选配置项
    remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },
  /*formConfig: {
    data: {
      width: '',
      height: '',
      quantity: ''
    },
    items: [
      { field: 'width', title: t('order.width')+':', itemRender: { name: 'VxeInput' } },
      { field: 'height', title: t('order.height')+':', itemRender: { name: 'VxeInput' } },
      { field: 'quantity', title: t('order.quantity')+':', itemRender: { name: 'VxeInput' } },
      {
        itemRender: {
          name: 'VxeButtonGroup',
          options: [
            { type: 'submit', content: t('craft.sure'), status: 'primary' },
            { type: 'reset', content: t('product.msg.reset') }
          ]
        }
      }
    ]
  },*/
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: 50},
    {type: 'checkbox', fixed: "left", title: t('basicData.check'), width: 80},
    {field: 'process_id',width: 150, title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'technology_number',width: 70, title: '层',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'TotalFloors',width: 150, title: '总层数',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'TotalNumber',width: 150, title: '规格',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'quantity',width: 150, title: t('order.quantity'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'shape',width: 150, title: t('order.shape'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'glass_child',width: 150, title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
    {field: 'project', width:150, title: t('order.project'), showOverflow: "ellipsis"},
    {field: 'area',width: 150, title: t('order.area'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
  ],//表头参数
  data:null,//表格数据
  toolbarConfig: {
    buttons: [],
    slots:{
      buttons: "toolbar_buttons"
    },
  },
})
let emit = defineEmits([
  'changeDialog'
])
//膜系列表
const optionVal = ref('')
const options = [
  {
    value: '白玻',
    label: '白玻',
  },
  {
    value: '灰镜',
    label: '灰镜',
  },
  {
    value: 'Low-e',
    label: 'Low-e',
  },
]
//小圆点单选框
let radio = ref(1);
const selectFlowCardList = ()=>{
  request.post(`/glassOptimize/getFlowCardList/${optionVal.value}/${radio.value}`).then((res) => {
    if(res.code==200){
      xGrid.value.loadData(res.data.data)
    }else{
      ElMessage.warning(res.msg)
    }
  })
}
</script>
<template>
  <div style="width: 100%;height: 110%; margin-top: -36px">
    <h1>流程卡列表
    <span style="margin-left: 140px;font-size: 14px">工程编号:</span>
    <vxe-input disabled placeholder="" size="small"></vxe-input>&nbsp;
    <span style="font-size: 14px">工程名称:</span>
    <vxe-input placeholder="" size="small"></vxe-input>
      <el-button type="primary" style="margin-left: 20px">创建</el-button>
    </h1>
    <vxe-grid
          size="small"
          @filter-change="filterChanged"
          height="100%"
          class="mytable-scrollbar"
          ref="xGrid"
          v-bind="gridOptions"
          v-on="gridEvents"
      >
        <template #num2_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <vxe-select v-model="option.data" :placeholder="$t('processCard.pleaseSelect')"  @change="changeFilterEvent($event, option, $panel)">
                <vxe-option value="0" :label="$t('basicData.unchecked')"></vxe-option>
                <vxe-option value="1" :label="$t('basicData.selected')"></vxe-option>
              </vxe-select>
            </div>
          </div>
        </template>
        <template #num1_filter="{ column, $panel }">
          <div>
            <div v-for="(option, index) in column.filters" :key="index">
              <input
                  type="type"
                  v-model="option.data"
                  @keyup.enter.native="$panel.confirmFilter()"
                  @input="changeFilterEvent($event, option, $panel)"/>
            </div>
          </div>
        </template>
        <template #toolbar_buttons>
          <h1>膜系筛选:</h1>
          <el-select
              placeholder="选择膜系"
              style="margin-left:10px; width: 170px "
              ref="getSelect"
              v-model="optionVal"
              clearable
              class="m-2"
              @change="getWorkOrder"
          >
            <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
            />
          </el-select>
          <el-button type="primary" :icon="Search" style="margin-left: 20px" @click="selectFlowCardList">查询</el-button>
          <vxe-radio-group v-model="radio" style="margin-left: 20px">
            <vxe-radio label="1" content="全部"></vxe-radio>
            <vxe-radio label="2" content="正单"></vxe-radio>
            <vxe-radio label="3" content="补单"></vxe-radio>
          </vxe-radio-group>
        </template>
    </vxe-grid>
  </div>
</template>
<style scoped>
</style>