| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283 |
- <template>
- <div class="ele-body">
- <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-item label="执行人工号">
- <el-input></el-input>
- </el-form-item>
- <el-form-item label="执行日期">
- <el-input></el-input>
- </el-form-item>
- </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" @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>
- <script>
- import Extrusion from './components/report/Extrusion';
- import Drying from './components/report/Drying';
- import Heating from './components/report/Heating';
- import HalfAdded from './components/report/HalfAdded';
- import Processing from './components/report/Processing';
- import Package from './components/report/Package';
- import Warehousing from './components/report/Warehousing';
- 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,
- HalfAdded,
- Processing,
- Package,
- Sinter,
- Furnace,
- Warehousing
- },
- data () {
- return {
- descriptionsShow: true,
- activeName: '1',
- orderColumns: [
- {
- label: '工单号',
- prop: 'code'
- },
- {
- label: '产品编码',
- prop: 'productCode'
- },
- {
- label: '产品名称',
- prop: 'productName'
- },
- {
- label: '牌号',
- prop: 'brandNo'
- },
- {
- label: '型号',
- prop: 'model'
- },
- {
- label: '要求成型数量',
- prop: 'formingNum'
- },
- {
- label: '要求成型重量',
- prop: 'formingWeight'
- },
- {
- label: '未成型数量',
- prop: 'a',
- formatter: (row) => {
- return row.formingNum - row.formedNum;
- }
- },
- {
- label: '未成型重量',
- prop: 'a',
- formatter: (row) => {
- return row.formingWeight - row.formedWeight;
- }
- },
- {
- label: '计划开始时间',
- prop: 'planStartTime'
- },
- {
- label: '实际开始时间',
- prop: 'startTime'
- },
- {
- slot: 'action',
- label: '操作'
- }
- ],
- orderList: [],
- materialList: [],
- materialColumns: [
- {
- label: '序号',
- type: 'index',
- width: 55
- },
- {
- label: '编码',
- prop: 'a'
- },
- {
- label: '名称',
- prop: 'a'
- },
- {
- label: '类型',
- prop: 'a'
- },
- {
- label: '单位',
- prop: 'a'
- },
- {
- label: '牌号',
- prop: 'a'
- },
- {
- label: '型号',
- prop: 'a'
- },
- {
- label: '规格',
- prop: 'a'
- },
- {
- slot: 'requireNum',
- label: '需求数量'
- },
- {
- slot: 'warehouse',
- label: '仓库'
- },
- {
- slot: 'action',
- label: '操作',
- prop: 'a'
- }
- ]
- };
- },
- computed: {
- title () {
- return this.$route.query.name;
- }
- },
- methods: {
- addOrder () {
- this.$refs.orderDailogRef.open(this.orderList.slice(0));
- },
- 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(() => {
- this.materialList.splice(index, 1);
- })
- .catch(() => {});
- },
- delOrder (index) {
- this.$confirm('是否删除', '提示')
- .then(() => {
- this.orderList.splice(index, 1);
- })
- .catch(() => {});
- },
- async handleReport () {
- this.$refs.formRef.validate(async (value) => {
- if (value) {
- await batchSave();
- }
- });
- }
- }
- };
- </script>
- <style lang="scss" scoped>
- .el-tabs {
- margin-top: 20px;
- }
- .el-button {
- margin-top: 10px;
- }
- .slideUp-icon {
- transform: rotate(-90deg);
- }
- .slideDown-icon {
- transform: rotate(90deg);
- }
- .form-wrapper {
- :deep(.el-form-item) {
- margin-bottom: 0;
- }
- }
- </style>
|