|
|
@@ -0,0 +1,213 @@
|
|
|
+<template>
|
|
|
+ <ele-modal
|
|
|
+ :visible.sync="visible"
|
|
|
+ title="添加工单-选择设备"
|
|
|
+ width="65vw"
|
|
|
+ append-to-body
|
|
|
+ >
|
|
|
+ <div class="search-box">
|
|
|
+ 生产工单号:
|
|
|
+ <el-input placeholder="请输入" v-model="orderCode"></el-input>
|
|
|
+ </div>
|
|
|
+ <!-- 数据表格 -->
|
|
|
+ <ele-pro-table
|
|
|
+ ref="table"
|
|
|
+ :columns="columns"
|
|
|
+ @done="handleDone"
|
|
|
+ row-key="id"
|
|
|
+ :needPage="false"
|
|
|
+ :initLoad="false"
|
|
|
+ :selection.sync="selectionList"
|
|
|
+ :datasource="datasource"
|
|
|
+ height="45vh"
|
|
|
+ >
|
|
|
+ </ele-pro-table>
|
|
|
+ <div class="footer" slot="footer">
|
|
|
+ <el-button @click="cancel">取消</el-button>
|
|
|
+ <el-button @click="confirm" type="primary">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </ele-modal>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+ import { getPage } from '@/api/produceOrder/index.js';
|
|
|
+ export default {
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ orderCode: '',
|
|
|
+ selectionList: [],
|
|
|
+ memoList: [],
|
|
|
+ callback: null
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ columns () {
|
|
|
+ const list = [
|
|
|
+ {
|
|
|
+ type: 'selection',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ fixed: 'left',
|
|
|
+ reserveSelection: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'index',
|
|
|
+ label: '序号',
|
|
|
+ type: 'index',
|
|
|
+ width: 55,
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ slot: 'code',
|
|
|
+ label: '生产工单号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productionPlanCode',
|
|
|
+ label: '计划编号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planType',
|
|
|
+ label: '计划类型',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'produceVersionName',
|
|
|
+ label: '生产版本',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productCode',
|
|
|
+ label: '产品编号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'productName',
|
|
|
+ label: '产品名称',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'brandNo',
|
|
|
+ label: '牌号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'model',
|
|
|
+ label: '型号',
|
|
|
+ align: 'center'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formingNum',
|
|
|
+ label: '要求成型数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formingWeight',
|
|
|
+ label: '要求成型重量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formedNum',
|
|
|
+ label: '已成型数量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'formedWeight',
|
|
|
+ label: '已成型重量',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'planStartTime',
|
|
|
+ label: '计划开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ prop: 'startTime',
|
|
|
+ label: '实际开始时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ prop: 'createTime',
|
|
|
+ label: '创建时间',
|
|
|
+ align: 'center',
|
|
|
+ showOverflowTooltip: true,
|
|
|
+ minWidth: 110
|
|
|
+ },
|
|
|
+ {
|
|
|
+ columnKey: 'action',
|
|
|
+ label: '操作',
|
|
|
+ width: 350,
|
|
|
+ align: 'center',
|
|
|
+ resizable: false,
|
|
|
+ fixed: 'right',
|
|
|
+ slot: 'action',
|
|
|
+ showOverflowTooltip: true
|
|
|
+ }
|
|
|
+ ];
|
|
|
+
|
|
|
+ return list;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ open (val, list = []) {
|
|
|
+ this.memoList = list;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ handleDone ({ data }) {
|
|
|
+ if (this.memoList.length) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.memoList.length &&
|
|
|
+ this.$refs.table.setSelectedRowKeys(
|
|
|
+ this.memoList.map((i) => i.id)
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ /* 表格数据源 */
|
|
|
+ datasource ({ page, limit }) {
|
|
|
+ return getPage({
|
|
|
+ pageNum: page,
|
|
|
+ size: limit,
|
|
|
+ code: this.orderCode
|
|
|
+ });
|
|
|
+ },
|
|
|
+ confirm () {
|
|
|
+ if (!this.selectionList?.length)
|
|
|
+ return this.$message.error('请选择数据');
|
|
|
+ this.$emit('success', this.selectionList);
|
|
|
+
|
|
|
+ this.cancel();
|
|
|
+ },
|
|
|
+ cancel () {
|
|
|
+ this.$refs.table.clearSelection();
|
|
|
+ this.orderCode = '';
|
|
|
+ this.visible = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .search-box {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-start;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ .el-input {
|
|
|
+ width: 220px;
|
|
|
+ margin: 0 32px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|