NNowhZzU
2023-12-27 97c3f97a11524d8bacc6d36cf2ec4e3b93b5c277
north-glass-erp/northglass-erp/src/views/mm/mainProductStock/CreateProductStock.vue
@@ -1,156 +1,267 @@
<!--产品入库-->
<script setup>
import {reactive} from "vue";
import {useRouter} from  'vue-router'
let router=useRouter()
const getTableRow = (row,type) =>{
  switch (type) {
    case 'edit' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/productStock/OrderAllocation', query: { id: row.id }})
      break
    }
    case 'back':{
      router.push({path: '/main/productStock/FinishedProductRework', query: { id: row.id }})
      break
    }
    case 'out' :{
      //alert('我接收到子组件传送的编辑信息')
      router.push({path: '/main/productStock/FinishedGoodsIssue', query: { id: row.id }})
      break
    }
  }
}
<script lang="ts" setup>
import {ref} from "vue";
let tableData = ref([
  {
    "销售单号":'NG23072003',
    "楼层编号":'10059419',
    "成品编号":'0604000027',
    "成品名称":'NG23072003A01',
    "产品名称":'',
    "长":'1075.00',
    "宽":'440.00',
    "业务员":'陈宗凯',
    "客户名称":'71',
    "项目名称":'钢化玻璃',
    "订序":'1',
    "订单总数":'3800',
    "数量":'1140',
    "完工":'1140',
    "面积":'505.270000',
    "流程卡号":'NG23112311A01',
    "已入数量":'0',
    "下工序":'成品',
    "批次":'',
  },{
    "销售单号":'NG23072003',
    "楼层编号":'10059419',
    "成品编号":'0604000027',
    "成品名称":'NG23072003A01',
    "产品名称":'',
    "长":'1075.00',
    "宽":'440.00',
    "业务员":'陈宗凯',
    "客户名称":'71',
    "项目名称":'钢化玻璃',
    "订序":'1',
    "订单总数":'3800',
    "数量":'1140',
    "完工":'1140',
    "面积":'505.270000',
    "流程卡号":'NG23112311A01',
    "已入数量":'0',
    "下工序":'成品',
    "批次":'',
  },{
    "销售单号":'NG23072003',
    "楼层编号":'10059419',
    "成品编号":'0604000027',
    "成品名称":'NG23072003A01',
    "产品名称":'',
    "长":'1075.00',
    "宽":'440.00',
    "业务员":'陈宗凯',
    "客户名称":'71',
    "项目名称":'钢化玻璃',
    "订序":'1',
    "订单总数":'3800',
    "数量":'1140',
    "完工":'1140',
    "面积":'505.270000',
    "流程卡号":'NG23112311A01',
    "已入数量":'0',
    "下工序":'成品',
    "批次":'',
  },{
    "销售单号":'NG23072003',
    "楼层编号":'10059419',
    "成品编号":'0604000027',
    "成品名称":'NG23072003A01',
    "产品名称":'',
    "长":'1075.00',
    "宽":'440.00',
    "业务员":'陈宗凯',
    "客户名称":'71',
    "项目名称":'钢化玻璃',
    "订序":'1',
    "订单总数":'3800',
    "数量":'1140',
    "完工":'1140',
    "面积":'505.270000',
    "流程卡号":'NG23112311A01',
    "已入数量":'0',
    "下工序":'成品',
    "批次":'',
//子组件接收参数
const gridOptions = reactive({
  border:  "full",//表格加边框
  keepSource: true,//保持源数据
  align: 'center',//文字居中
  stripe:true,//斑马纹
  rowConfig: {isCurrent: true, isHover: true,height: 50},//鼠标移动或选择高亮
  id: 'CustomerList',
  showFooter: true,//显示脚
  printConfig: {},
  importConfig: {},
  exportConfig: {},
  scrollY:{ enabled: true },//开启虚拟滚动
  showOverflow:true,
  columnConfig: {
    resizable: true,
    useKey: true
  },
])
const checked1 = ref(true)
  filterConfig: {   //筛选配置项
    remote: true
  },
  customConfig: {
    storage: true
  },
  editConfig: {
    trigger: 'click',
    mode: 'row',
    showStatus: true
  },//表头参数
  columns:[
    {type:'expand',fixed:"left",slots: { content:'content' },width: '50'},
    { type: 'checkbox',fixed:"left", title: '选择', width: '80' },
    { type: 'seq',fixed:"left", title: '自序', width: '80' },
    // {title: '操作', width: '220', slots: { default: 'button_slot' },fixed:"left"},
    {field: 'SalesOrderNumber', width: '150',title: '销售单号', sortable: true,showOverflow:"ellipsis" ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'floorNumber', width: '120',title: '楼层编号', sortable: true,filters:[{ data: '' }],slots: { filter: 'num1_filter' }},
    {field: 'finishedProductNumber',width: '100', title: '成品编号', sortable: true,showOverflow:"ellipsis"},
    {field: 'finishedProductName', width: '100',title: ' 成品名称', sortable: true},
    {field: 'productName',width: '100', title: '产品名称', sortable: true},
    {field: 'length', width: '100',title: '长度', sortable: true},
    {field: 'width',width: '100', title: '宽度', sortable: true},
    {field: 'salesperson', width: '100',title: '业务员', sortable: true},
    {field: 'customerName',width: '100', title: '客户名称', sortable: true},
    {field: 'projectName', width: '100',title: '项目名称', sortable: true},
    {field: 'orderNumber',width: '140', title: '订序', sortable: true},
    {field: 'totalOrders',width: '140', title: '订单总数', sortable: true},
    {field: 'quantity',width: '100', title: '数量', sortable: true},
    {field: 'completion',width: '140', title: '完工', sortable: true},
    {field: 'area',width: '140', title: '面积', sortable: true},
    {field: 'processCardNumber',width: '100', title: '流程卡号', sortable: true},
    {field: 'quantityEntered',width: '100', title: '已入数量', sortable: true},
    {field: 'nextProcess',width: '100', title: ' 下工序', sortable: true},
    {field: 'Batch',width: '100', title: '批次', sortable: true},
  ],//表头按钮
  toolbarConfig: {
    buttons: [{
      'name': '确认入库',status: 'primary',
      'code':'add'
    }
      ],
    import: false,
    export: true,
    print: true,
    zoom: true,
    custom: true
  },
  data:  [
    {
      "SalesOrderNumber": "NG23072003",
      "floorNumber": "10059419",
      "finishedProductNumber": "0604000027",
      "finishedProductName": "NG23072003A01",
      "productName": '钢化玻璃',
      "length": "1075.00",
      "width": "440.00",
      "salesperson": "小岳",
      "customerName": "大头",
      "projectName": "Tempered Glass",
      "orderNumber": "1",
      "totalOrders": "3800",
      "quantity": "1140",
      "completion":'1140',
      "area": "505.270000",
      "processCardNumber": "NG23112311A01",
      "quantityEntered": "0",
      "nextProcess": "Finished Product",
      "Batch": "一",
    },
    {
      "SalesOrderNumber": "NG23072003",
      "floorNumber": "10059419",
      "finishedProductNumber": "0604000027",
      "finishedProductName": "NG23072003A01",
      "productName": '钢化玻璃',
      "length": "1075.00",
      "width": "440.00",
      "salesperson": "小岳",
      "customerName": "大头",
      "projectName": "Tempered Glass",
      "orderNumber": "1",
      "totalOrders": "3800",
      "quantity": "1140",
      "completion":'1140',
      "area": "505.270000",
      "processCardNumber": "NG23112311A01",
      "quantityEntered": "0",
      "nextProcess": "Finished Product",
      "Batch": "一",
    },
    {
      "SalesOrderNumber": "NG23072003",
      "floorNumber": "10059419",
      "finishedProductNumber": "0604000027",
      "finishedProductName": "NG23072003A01",
      "productName": '钢化玻璃',
      "length": "1075.00",
      "width": "440.00",
      "salesperson": "小岳",
      "customerName": "大头",
      "projectName": "Tempered Glass",
      "orderNumber": "1",
      "totalOrders": "3800",
      "quantity": "1140",
      "completion":'1140',
      "area": "505.270000",
      "processCardNumber": "NG23112311A01",
      "quantityEntered": "0",
      "nextProcess": "Finished Product",
      "Batch": "一",
    },
    {
      "SalesOrderNumber": "NG23072003",
      "floorNumber": "10059419",
      "finishedProductNumber": "0604000027",
      "finishedProductName": "NG23072003A01",
      "productName": '钢化玻璃',
      "length": "1075.00",
      "width": "440.00",
      "salesperson": "小岳",
      "customerName": "大头",
      "projectName": "Tempered Glass",
      "orderNumber": "1",
      "totalOrders": "3800",
      "quantity": "1140",
      "completion":'1140',
      "area": "505.270000",
      "processCardNumber": "NG23112311A01",
      "quantityEntered": "0",
      "nextProcess": "Finished Product",
      "Batch": "一",
    },
  ],//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 ''
      })
    ]
  }
})
const gridEvents = {
  toolbarButtonClick ({ code }) {
    const $grid = xGrid.value
    if ($grid) {
      switch (code) {
        case 'add': {
          router.push({path: '/main/trader/CreateTrader'})
          /*if($grid.getCheckboxRecords().length==0){
            VXETable.modal.message( '请选择一条数据!')
            return
          }*/
          return;
        }
      }
    }
  },
}
</script>
<template>
<div>
  <div>
    <el-form  size="medium" >
  <div class="main-div-customer">
    <vxe-grid
        max-height="100%"
        @filter-change="filterChanged"
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        v-on="gridEvents"
    >
      <!--      @toolbar-button-click="toolbarButtonClickEvent"-->
      <!--      下拉显示所有信息插槽-->
      <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-row gutter="7">-->
<!--        <el-col :span="4">-->
<!--          <el-input v-model="name" placeholder="销售单号" style="width: 200px; height: 30px;" />-->
<!--        </el-col>-->
<!--        <el-col :span="4">-->
<!--          <el-input v-model="productName" placeholder="流程卡号" style="width: 200px; height: 30px;" />-->
<!--        </el-col>-->
<!--        <el-col :span="4">-->
<!--          <el-input v-model="salId" placeholder="订序" style="width: 200px; height: 30px;" />-->
<!--        </el-col>-->
      <!--左边固定显示的插槽-->
      <template #button_slot="{ row }">
<!--        <el-button @click="getTableRow(row,'edit')" link type="primary" size="small">订单调拨</el-button>-->
<!--        <el-button @click="getTableRow(row,'out')" link type="primary" size="small">成品领出</el-button>-->
<!--        <el-button @click="getTableRow(row,'back')" link type="primary" size="small">成品返工</el-button>-->
      </template>
<!--        <el-col :span="4">-->
<!--          <el-button id="searchButton" type="primary" :icon="Search" style="width: 100px; height: 25px">查询</el-button>-->
<!--        </el-col>-->
<!--      </el-row>-->
      <el-row gutter="7">
        <el-col :span="4">
          <el-input v-model="name" placeholder="制单员" style="width: 200px; height: 30px;" />
        </el-col>
        <el-col :span="4">
          <el-input v-model="productName" placeholder="工号" style="width: 200px; height: 30px;" />
        </el-col>
        <el-col :span="4">
          <el-input v-model="salId" placeholder="库位" style="width: 200px; height: 30px;" />
        </el-col>
      <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>
        <el-col :span="4">
          <el-button id="searchButton" type="primary" :icon="Search" style="width: 100px; height: 25px">确定</el-button>
        </el-col>
      </el-row>
    </el-form>
    <div>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="销售单号" label="销售单号" width="100" />
        <el-table-column prop="楼层编号" label="楼层编号" width="100" />
        <el-table-column prop="成品编号" label="成品编号" width="100"/>
        <el-table-column prop="成品名称" label="成品名称" width="180"/>
        <el-table-column prop="长" label="长" width="80"/>
        <el-table-column prop="宽" label="宽" width="80"/>
        <el-table-column prop="业务员" label="业务员" width="100"/>
        <el-table-column prop="客户名称" label="客户名称" width="100"/>
        <el-table-column prop="项目名称" label="项目名称" width="180"/>
        <el-table-column prop="订序" label="订序" width="80"/>
        <el-table-column prop="订单总数" label="订单总数" width="100"/>
        <el-table-column prop="数量" label="数量" width="80"/>
        <el-table-column prop="完工" label="完工" width="80"/>
        <el-table-column prop="面积" label="面积" width="80"/>
        <el-table-column prop="流程卡号" label="流程卡号" width="100"/>
        <el-table-column prop="已入数量" label="已入数量" width="100"/>
        <el-table-column prop="下工序" label="下工序" width="80"/>
        <el-table-column prop="批次" label="批次" width="80"/>
        <el-table-column prop="选择" label="选择"  type="selection" width="80"/>
      </el-table>
    </div>
    </vxe-grid>
  </div>
</div>
</template>
<style>
<style scoped>
.main-div-customer{
  width: 99%;
  height: 100%;
}
</style>