NNowhZzU
2023-12-25 fcd7ece15a86fc0cb526ee801ff8262b0db22dee
north-glass-erp/northglass-erp/src/views/sd/order/SelectOrder.vue
@@ -1,38 +1,153 @@
<script setup>
  import {Search} from "@element-plus/icons-vue"
  import {useRouter} from "vue-router"
  import {reactive} from "vue";
  const router = useRouter()
  let orderList = $ref([
    {
      '1':'NG23120701',
      '2':'1',
      '3':'中山市云镜家居有限公司',
      '4':'大板镜',
      '5':'一批1',
      '6':'999999.99',
      '7':'99999',
      '8':'99999.99',
      '9':'99999.99',
      '10':'2023-12-07',
      '11':'装箱',
      '12':'普通订单',
      '13':'张三',
      '14':'第二批',
      '15':'2023-12-30',
  const getTableRow = (row,type) =>{
    switch (type) {
      case 'edit' :{
        //alert('我接收到子组件传送的编辑信息')
        router.push({path: '/main/order/createOrder', query: { orderID: 'NG24010101' }})
        break
      }
      case 'delete':{
        alert('我接收到子组件传送的删除信息')
        break
      }
    }
  ])
  let listName = $ref([
      '下单','工艺','审核','生产','交接','下达','入库','发货'
  ])
  function openCraft(){
    router.push({name:'updateOrderCraft'})
  }
  const gridOptions = reactive({
    border:  "full",//表格加边框
    keepSource: true,//保持源数据
    align: 'center',//文字居中
    stripe:true,//斑马纹
    rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
    id: 'OrderList',
    showFooter: true,//显示脚
    printConfig: {},
    importConfig: {},
    exportConfig: {},
    scrollY:{ enabled: true },//开启虚拟滚动
    showOverflow:true,
    columnConfig: {
      resizable: true,
      useKey: true
    },
    filterConfig: {   //筛选配置项
      remote: true
    },
    customConfig: {
      storage: true
    },
    editConfig: {
      trigger: 'click',
      mode: 'row',
      showStatus: true
    },//表头参数
    columns:[
      {type:'expand',slots: { content:'content' },width: 50,fixed:"left",},
      {title: '操作', width: 110, slots: { default: 'button_slot' },fixed:"left",},
      {type: 'seq', title: '自序', width: 80 ,fixed:"left",},
      {title: '下单', width: 40, slots: { default: 'state' }},
      {title: '工艺', width: 40, slots: { default: 'state' }},
      {title: '审核', width: 40, slots: { default: 'state' }},
      {title: '生产', width: 40, slots: { default: 'state' }},
      {title: '交接', width: 40, slots: { default: 'state' }},
      {title: '下达', width: 40, slots: { default: 'state' }},
      {title: '入库', width: 40, slots: { default: 'state' }},
      {title: '发货', width: 40, slots: { default: 'state' }},
      {field: '1',width:120,  title: '销售单号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '2',width:120,  title: '客户编号',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '3',width:120,  title: '客户名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '4',width:120,  title: '总数量',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '5',width:120,  title: '可用库存',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '6',width:120,  title: '项目名称',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '7',width:120,  title: '批次',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '8',width:120,   title: '总金额',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '9',width:120,  title: '结算总面积',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '10',width:120,  title: '报表日期',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '11',width:120,  title: '包装方式',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '12',width:120,  title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '13',width:120,  title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true},
      {field: '14',width:120,  title: '订单类型',filters:[{ data: '' }],slots: { filter: 'num1_filter' }, sortable: true}
    ],//表头按钮
    toolbarConfig: {
      buttons: [
      ],
      import: false,
      export: true,
      print: true,
      zoom: true,
      custom: true
    },
    data:  [
      {
        '0': '1',
        '1': 'NG23110102',
        '2': '11',
        '3': '中建',
        '4': '534',
        '5': '116',
        '6': '黄石有轨电车',
        '7': '20批',
        '8': '111100.02',
        '9': '1008.38',
        '10': '2023-10-30',
        '11': '叉车木箱',
        '12': '普通订单',
        '13': '',
        '14': '王龙'
      },
      {
        '0': '1',
        '1': 'NG23110101',
        '2': '11',
        '3': '中建',
        '4': '534',
        '5': '116',
        '6': '黄石有轨电车',
        '7': '20批',
        '8': '111100.02',
        '9': '1008.38',
        '10': '2023-10-30',
        '11': '叉车木箱',
        '12': '普通订单',
        '13': '',
        '14': '王龙'
      }
    ],//table body实际数据
    footerMethod ({ columns, data }) {//页脚函数
      return[
        columns.map((column, columnIndex) => {
          if (columnIndex === 0) {
            return '合计:'
          }
          // if (props.tableProp.footList.includes(column.field)) {
          //   return sumNum(data, column.field)
          // }
          return ''
        })
      ]
    }
  })
</script>
<template>
  <div >
  <div  style="width: 100%;height: 100%">
    <el-date-picker
        v-model="value1"
        type="daterange"
@@ -40,85 +155,46 @@
        end-placeholder="结束时间"
    />
    <el-button style="margin-top: -5px"  id="searchButton" type="primary" :icon="Search">查询</el-button>
    <el-table
        :data="orderList"
        :header-cell-style="{ 'text-align': 'center' }"
        :cell-style="{ 'text-align': 'center' }"
        lazy
        border
        style="width: 99%;"
        max-height="80vh">
      <el-table-column type="expand" fixed>
        <template #default="props" >
          <div m="4">
    <vxe-grid
        max-height="97%"
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
            <p m="t-0 b-2">编号: {{ props.row.prodID }}</p>
          </div>
        </template>
      </el-table-column>
      <el-table-column label="操作" fixed width="110"  >
<!--        <el-button @click="openCraft" link type="primary" size="small">工艺</el-button>-->
<!--        审核与工艺都在同一个按钮-->
        <el-button link type="primary" size="small">编辑</el-button>
        <el-button link type="primary" size="small">删除</el-button>
<!--订单审核后不能删除只能作废-->
      </el-table-column>
      <el-table-column   label="序号" width="40"  />
    >
      <!--      下拉显示所有信息插槽-->
      <template #content="{ row}">
        <ul class="expand-wrapper">
          <li  v-for="(item,key,index) in row">
            <span style="font-weight: bold">{{key+':  '}}</span>
            <span>{{ item }}</span>
          </li>
        </ul>
      </template>
      <el-table-column v-for="item in listName" prop="" :label="item" width="40"   >
<!--        <el-table-column prop="1" >-->
<!--          <template #header>-->
<!--            <el-button type="primary" size="small" style="width: 10px;height: 10px"></el-button>-->
<!--          </template>-->
<!--          <el-checkbox checked/>-->
<!--        </el-table-column>-->
      <template #state="{ row}">
        <el-checkbox checked/>
      </template>
      </el-table-column>
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">编辑</el-button>
        <el-button @click="getTableRow(row,'delete')" link type="primary" size="small">删除</el-button>
      </template>
      <el-table-column  prop="1" width="110" label="销售单号"    />
      <el-table-column  prop="2" width="55" label="客户编号"    />
      <el-table-column  prop="3" width="120" label="客户名称"    />
      <el-table-column  prop="4" width="120" label="项目名称"   />
      <el-table-column  prop="5" label="批次"     />
      <el-table-column  prop="6" width="100" label="总金额"     />
      <el-table-column  prop="7" label="数量"     />
      <el-table-column  prop="8" width="100" label="结算面积"    />
      <el-table-column  prop="9" width="100" label="实际面积"    />
      <el-table-column  prop="10" width="100" label="报表日期" />
      <el-table-column  prop="11" width="100" label="包装方式" />
      <el-table-column  prop="12" width="100" label="订单类型" />
      <el-table-column  prop="13" label="业务员" />
      <el-table-column  prop="14" width="100" label="客户批次" />
      <el-table-column  prop="15" width="100" label="交货日期" />
      <template #num1_filter="{ column, $panel }">
        <div>
          <div v-for="(option, index) in column.filters" :key="index">
            <input type="type" v-model="option.data" @input="changeFilterEvent($event, option, $panel)"/>
          </div>
        </div>
      </template>
    </vxe-grid>
    </el-table>
  </div>
</template>
<style scoped>
:deep(.el-table .el-input__wrapper) {
  box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
  cursor: default;
  border: none !important;
  background-color: transparent;
}
</style>