|
|
@@ -1,63 +1,69 @@
|
|
|
<template>
|
|
|
<div class="ele-body">
|
|
|
- <el-card>
|
|
|
- <div class="page-title">
|
|
|
- <el-page-header @back="$router.go(-1)">
|
|
|
- <div slot="content" class="pageContent">
|
|
|
- <div>{{ title }}领料</div>
|
|
|
- </div>
|
|
|
- </el-page-header>
|
|
|
- <el-button type="primary">一键报工</el-button>
|
|
|
- </div>
|
|
|
+ <el-form
|
|
|
+ inline
|
|
|
+ ref="formRef"
|
|
|
+ :show-error-message="false"
|
|
|
+ class="form-wrapper"
|
|
|
+ >
|
|
|
+ <el-card>
|
|
|
+ <div class="page-title">
|
|
|
+ <el-page-header @back="$router.go(-1)">
|
|
|
+ <div slot="content" class="pageContent">
|
|
|
+ <div>{{ title }}领料</div>
|
|
|
+ </div>
|
|
|
+ </el-page-header>
|
|
|
+ <el-button type="primary" @click="handleReport">一键报工</el-button>
|
|
|
+ </div>
|
|
|
|
|
|
- <header-title title="工单信息">
|
|
|
- <el-form inline :show-error-message="false" class="form-wrapper">
|
|
|
+ <header-title title="工单信息">
|
|
|
<el-form-item label="执行人工号">
|
|
|
<el-input></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执行日期">
|
|
|
<el-input></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
- </header-title>
|
|
|
+ </header-title>
|
|
|
|
|
|
- <ele-pro-table
|
|
|
- :columns="orderColumns"
|
|
|
- :datasource="orderList"
|
|
|
- cache-key="picking-table"
|
|
|
- >
|
|
|
- <template v-slot:toolbar>
|
|
|
- <el-link type="primary" @click="addOrder">加入工单</el-link>
|
|
|
- </template>
|
|
|
- <template v-slot:action="{ $index }">
|
|
|
- <el-link type="danger" @click="delOrder($index)">删除</el-link>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
- <header-title title="物料信息"> </header-title>
|
|
|
+ <ele-pro-table
|
|
|
+ :columns="orderColumns"
|
|
|
+ :datasource="orderList"
|
|
|
+ cache-key="picking-table"
|
|
|
+ >
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-link type="primary" @click="addOrder">加入工单</el-link>
|
|
|
+ </template>
|
|
|
+ <template v-slot:action="{ $index }">
|
|
|
+ <el-link type="danger" @click="delOrder($index)">删除</el-link>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ <header-title title="物料信息"> </header-title>
|
|
|
|
|
|
- <ele-pro-table
|
|
|
- :columns="materialColumns"
|
|
|
- :datasource="materialList"
|
|
|
- cache-key="picking-table-material"
|
|
|
- >
|
|
|
- <template v-slot:toolbar>
|
|
|
- <el-link type="primary">添加物料</el-link>
|
|
|
- </template>
|
|
|
- <template v-slot:action="{ $index }">
|
|
|
- <el-link type="danger" @click="delMaterial($index)">删除</el-link>
|
|
|
- </template>
|
|
|
- <template v-slot:warehouse="{ row }">
|
|
|
- <el-select v-model="row.w">
|
|
|
- <el-option>ss</el-option>
|
|
|
- </el-select>
|
|
|
- </template>
|
|
|
- <template v-slot:requireNum="{ row }">
|
|
|
- <el-input v-model="row.c"></el-input>
|
|
|
- </template>
|
|
|
- </ele-pro-table>
|
|
|
- </el-card>
|
|
|
+ <ele-pro-table
|
|
|
+ :columns="materialColumns"
|
|
|
+ :datasource="materialList"
|
|
|
+ cache-key="picking-table-material"
|
|
|
+ >
|
|
|
+ <template v-slot:toolbar>
|
|
|
+ <el-link type="primary" @click="addMaterial">添加物料</el-link>
|
|
|
+ </template>
|
|
|
+ <template v-slot:action="{ $index }">
|
|
|
+ <el-link type="danger" @click="delMaterial($index)">删除</el-link>
|
|
|
+ </template>
|
|
|
+ <template v-slot:warehouse="{ row }">
|
|
|
+ <el-select v-model="row.w">
|
|
|
+ <el-option>ss</el-option>
|
|
|
+ </el-select>
|
|
|
+ </template>
|
|
|
+ <template v-slot:requireNum="{ row }">
|
|
|
+ <el-input v-model="row.c"></el-input>
|
|
|
+ </template>
|
|
|
+ </ele-pro-table>
|
|
|
+ </el-card>
|
|
|
+ </el-form>
|
|
|
|
|
|
<orderDailog ref="orderDailogRef" @success="orderSuccess" />
|
|
|
+ <ChooseMaterial ref="ChooseMaterialRef" @success="materialSuccess" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -72,9 +78,12 @@
|
|
|
import Sinter from './components/report/Sinter';
|
|
|
import Furnace from './components/report/Furnace';
|
|
|
import orderDailog from './components/order-dailog';
|
|
|
+ import ChooseMaterial from '@/components/material/ChooseMaterial';
|
|
|
+ import { batchSave } from '@/api/produceOrder';
|
|
|
export default {
|
|
|
components: {
|
|
|
orderDailog,
|
|
|
+ ChooseMaterial,
|
|
|
Extrusion,
|
|
|
Drying,
|
|
|
Heating,
|
|
|
@@ -209,6 +218,24 @@
|
|
|
orderSuccess (list) {
|
|
|
this.orderList = list;
|
|
|
},
|
|
|
+ materialSuccess (list) {
|
|
|
+ this.orderList = list;
|
|
|
+ },
|
|
|
+ addMaterial () {
|
|
|
+ this.$refs.ChooseMaterialRef.open(this.materialList.slice(0));
|
|
|
+ },
|
|
|
+ materialSuccess (list) {
|
|
|
+ const obj = {};
|
|
|
+ this.materialList = [...this.materialList, ...list].reduce(
|
|
|
+ (next, pre) => {
|
|
|
+ if (!obj[pre.id]) {
|
|
|
+ obj[pre.id] = true;
|
|
|
+ next.push(pre);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ []
|
|
|
+ );
|
|
|
+ },
|
|
|
delMaterial (index) {
|
|
|
this.$confirm('是否删除', '提示')
|
|
|
.then(() => {
|
|
|
@@ -222,6 +249,13 @@
|
|
|
this.orderList.splice(index, 1);
|
|
|
})
|
|
|
.catch(() => {});
|
|
|
+ },
|
|
|
+ async handleReport () {
|
|
|
+ this.$refs.formRef.validate(async (value) => {
|
|
|
+ if (value) {
|
|
|
+ await batchSave();
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
};
|