factory_web/src/views/wpm/worktask.vue

921 lines
38 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<el-container style="flex-direction: column">
<el-main id="topContainer" class="nopadding" style="position: relative;height: 50%;margin-bottom: 10px;">
<el-row :gutter="10">
<el-col :span="activeSpan" style="border-right: 1px solid #eeeeee;position: relative;">
<div class="right-panel btnWrap">
<el-button v-if="activeName == '8车间' || activeName == '退火'" type="primary" icon="el-icon-plus" @click="add">新增</el-button>
<el-button v-if="activeName == '退火'" type="primary" @click="submittuihuo">提交</el-button>
<el-date-picker v-if="activeName == '7车间' || activeName == '10车间'"
v-model="paramsDate"
type="date"
value-format="YYYY-MM-DD"
/>
<el-button
type="primary"
icon="el-icon-search"
@click="handleQuerys"
v-if="activeName == '7车间' || activeName == '10车间'"
>查询</el-button>
</div>
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
<el-tab-pane label="混料工序" name="8车间">
<scTable ref="table8" :apiObj="apiObjMlog" row-key="id" stripe :height="tableHeightHalf" :params="params8"
hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="配料日期" prop="handle_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_out_">{{ scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="设备" prop="equipment_name">
</el-table-column>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量/桶数" prop="count_real">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
</el-table-column>
<el-table-column label="配料人" prop="handle_user_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="addHandover(scope.row)" v-auth="'equipment'">
转交接单
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
</el-table-column>
</scTable>
<div class="tableTitle">交接记录</div>
<scTable ref="table8" :apiObj="apiObjHandover" row-key="id" stripe :height="tableHeightHalf"
:params="params82" hidePagination hideDo @selection-change="handleSelectionChange">
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="40" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_out_">{{ scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="设备" prop="equipment_name">
</el-table-column>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量/桶数" prop="count">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_eweight">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="send_user_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-link type="primary" @click="handover_edit(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="退火" name="退火">
<scTable ref="table8" :apiObj="apiObjMlog" row-key="id" stripe :height="tableHeightHalf" :params="paramsth"
hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="合格数" prop="equipment_name">
</el-table-column>
<el-table-column label="不合格数" prop="batch">
</el-table-column>
<el-table-column label="不合格原因" prop="handle_date">
</el-table-column>
<el-table-column label="检测数" prop="count_real">
</el-table-column>
<el-table-column label="检测合格数" prop="count_real_eweight">
</el-table-column>
<el-table-column label="检测不合格数" prop="handle_user_name">
</el-table-column>
<el-table-column label="检测不合格原因" prop="handle_user_name">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="success" @click="table_tuihuo_submit(scope.row)" v-auth="'equipment'">
提交
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="table_del(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
</el-table-column>
</scTable>
<el-row :gutter="10">
<el-col :span="12" style="position: relative;">
<div class="tableTitle">
交接记录
<div class="right-panel btnWrap">
<el-button type="primary" icon="el-icon-plus" @click="addHandover2">新增</el-button>
</div>
</div>
<scTable ref="table8" :apiObj="apiObjHandover" row-key="id" stripe :height="tableHeightHalf"
:params="params82" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column label="交接日期" prop="send_date">
</el-table-column>
<el-table-column label="批次号" prop="batch" show-overflow-tooltip>
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="recive_user_name">
</el-table-column>
<el-table-column label="数量" prop="count">
</el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="180">
<template #default="scope">
<el-link type="primary" @click="editHandover2(scope.row)" v-auth="'equipment'">
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="danger" @click="delHandover2(scope.row, '8车间')" v-auth="'equipment'">
删除
</el-link>
</template>
</el-table-column>
</scTable>
</el-col>
<el-col :span="12" style="position: relative;">
<div class="tableTitle">
车间物料
<div class="right-panel btnWrap">
<el-button type="primary" @click="getMaterial">领料</el-button>
</div>
</div>
<scTable ref="table8wM" :apiObj="apiObjMetarial" row-key="id" stripe :height="tableHeightHalf"
:params="paramsMaterial" hidePagination hideDo @selection-change="handleSelectionChange">
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="40" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope"><span v-if="scope.row.material_out_">{{ scope.row.material_out_.name
}}</span>
</template>
</el-table-column>
<el-table-column label="设备" prop="equipment_name">
</el-table-column>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量/桶数" prop="count_real">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="send_user_name">
</el-table-column>
<!-- <el-table-column label="操作" fixed="right" align="left">
<template #default="scope">
<el-link
type="primary"
@click="handover_edit(scope.row)"
v-auth="'equipment'"
>
编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link
type="danger"
@click="table_del(scope.row,'8车间')"
v-auth="'equipment'"
>
删除
</el-link>
</template>
</el-table-column> -->
</scTable>
</el-col>
</el-row>
</el-tab-pane>
<el-tab-pane label="7车间" name="7车间">
<scTable ref="table7" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params7"
hideDo @row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="任务编号" prop="number">
</el-table-column>
<el-table-column label="型号规格" prop="">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="计划量" prop="count">
</el-table-column>
<el-table-column label="日均量" prop="count">
</el-table-column>
<el-table-column label="开始时间" prop="start_date">
</el-table-column>
<el-table-column label="结束时间" prop="end_date">
</el-table-column>
<el-table-column label="完成量" prop="count">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'equipment'"
:disabled="scope.row.state == 40">提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
<el-tab-pane label="10车间" name="10车间">
<scTable ref="table10" :apiObj="apiObjMtask" row-key="id" stripe :height="tableHeight" :params="params10"
hideDo @row-click="rowClick">
<el-table-column type="index" width="50" />
<el-table-column label="产品名称" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="型号" prop="number">
</el-table-column>
<el-table-column label="规格" prop="number">
</el-table-column>
<el-table-column label="计划量" prop="count">
</el-table-column>
<el-table-column label="日均量" prop="count">
</el-table-column>
<el-table-column label="开始时间" prop="start_date">
</el-table-column>
<el-table-column label="结束时间" prop="end_date">
</el-table-column>
<el-table-column label="完成量" prop="count">
</el-table-column>
<el-table-column label="状态" prop="state">
<template #default="scope">
<el-tag v-if="scope.row.state !== 40" type="primary">
{{ state_[scope.row.state] }}
</el-tag>
<el-tag v-else type="success">
{{ state_[scope.row.state] }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="60">
<template #default="scope">
<el-link type="primary" @click="table_submit(scope.row)" v-auth="'equipment'"
:disabled="scope.row.state == 40">提交
</el-link>
</template>
</el-table-column>
</scTable>
</el-tab-pane>
</el-tabs>
</el-col>
<el-col :span="12" v-if="activeName=='7车间'||activeName == '10车间'">
<el-card>
<el-form label-width="100px">
<el-row>
<el-col :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="产品名称:">
<span v-if="choseData && choseData.material_out_">{{ choseData.material_out_.name }}</span>
</el-form-item>
</el-col>
<el-col :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="产品型号:">
<span v-if="choseData && choseData.material_out_">{{ choseData.material_out_.number }}</span>
</el-form-item>
</el-col>
<el-col :md="8" :sm="12" :xs="24">
<el-form-item class="infoForm" label="配粉料数:">
<span>{{ peifen_kg }}</span>
</el-form-item>
</el-col>
<!-- <el-col :md="8" :sm="12" :xs="24">
<el-form-item label="配粉料数:">
<el-input-number
v-model="materialCount"
controls-position="right"
:min="0" step="1"
:step-strictly="true"
style="width:100%"
placeholder="配粉料数"
>
</el-input-number>
</el-form-item>
</el-col> -->
</el-row>
</el-form>
</el-card>
<div style="margin-top: 10px;">
<el-button type="primary" icon="el-icon-plus" @click="add"
:disabled="choseData && choseData.state == 40">新增</el-button>
</div>
<!-- 7车间 -->
<scTable ref="table" :data="flogs" row-key="id" stripe :height="rightHeight" :params="query"
v-if="activeName == '7车间'">
<el-table-column type="index" width="40" />
<el-table-column label="锅号" prop="equipment_name">
</el-table-column>
<el-table-column label="产品名称" prop="material_out_">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name }}</span>
</template>
</el-table-column>
<el-table-column label="规格" prop="material_out_">
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.specification }}</span>
</template>
</el-table-column>
<el-table-column label="生产量" prop="count_real">
</el-table-column>
<el-table-column label="合格量" prop="count_ok">
</el-table-column>
<el-table-column label="合格率" prop="count">
<template #default="scope">
<span>{{ scope.row.count_ok / scope.row.count_real }}</span>
</template>
</el-table-column>
<el-table-column label="不合格原因及数量" align="center">
<el-table-column label="炸纹" prop="count_n_zw">
</el-table-column>
<el-table-column label="条纹" prop="count_n_tw">
</el-table-column>
<el-table-column label="气泡" prop="count_n_qp">
</el-table-column>
<el-table-column label="弯曲" prop="count_n_wq">
</el-table-column>
<el-table-column label="其他" prop="count_n_qt">
</el-table-column>
<el-table-column label="合计" prop="count_n_qt">
</el-table-column>
</el-table-column>
<el-table-column label="退火炉号" prop="equipment_2_name">
</el-table-column>
<el-table-column label="第几锅" prop="index">
</el-table-column>
<el-table-column label="成型人" prop="handle_user_name">
</el-table-column>
<el-table-column label="切料人" prop="handle_user_2_name">
</el-table-column>
<el-table-column label="操作" fixed="right" width="100" align="center">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'"
:disabled="choseData.state == 40">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" @click="table_del(scope.row)" :disabled="choseData.state == 40">删除
</el-link>
</template>
</el-table-column>
</scTable>
<!-- 10车间 -->
<scTable ref="table" :data="flogs" row-key="id" stripe :height="rightHeight" :params="query"
v-if="activeName == '10车间'">
<el-table-column type="index" width="40" />
<el-table-column label="班次" prop="shift_name">
</el-table-column>
<el-table-column label="出管总数" prop="count_real">
</el-table-column>
<el-table-column label="规格" prop="mlogb" width="100">
<template #default="scope">
<div v-for="item in scope.row.mlogb" :key="item" class="cateItem" style="">
<span>{{ item.material_out_.name }}</span>
<span>{{ item.count_ok }}</span>
</div>
</template>
</el-table-column>
<el-table-column label="合格总数" prop="count_ok">
</el-table-column>
<el-table-column label="合格率" prop="count">
<template #default="scope">
<span>{{ scope.row.count_ok / scope.row.count_real }}</span>
</template>
</el-table-column>
<el-table-column label="不合格原因及数量" align="center">
<el-table-column label="椭圆/弯曲" prop="count_n_wq">
</el-table-column>
<el-table-column label="条纹" prop="count_n_tw">
</el-table-column>
<el-table-column label="断裂" prop="count_n_dl">
</el-table-column>
<el-table-column label="偏壁" prop="count_n_pb">
</el-table-column>
<el-table-column label="大小头" prop="count_n_dxt">
</el-table-column>
<el-table-column label="结石气绒" prop="count_n_jsqx">
</el-table-column>
<el-table-column label="合计" prop="count_n_qt">
</el-table-column>
</el-table-column>
<el-table-column label="成型人" prop="handle_user_name">
</el-table-column>
<el-table-column label="带班长" prop="handle_leader_name">
</el-table-column>
<el-table-column label="碎料" prop="count">
</el-table-column>
<el-table-column label="操作" fixed="right" width="100" align="center">
<template #default="scope">
<el-link type="primary" @click="table_edit(scope.row)" v-auth="'equipment'"
:disabled="choseData.state == 40">编辑
</el-link>
<el-divider direction="vertical"></el-divider>
<el-link type="primary" :disabled="choseData.state == 40" @click="table_del(scope.row)">删除
</el-link>
</template>
</el-table-column>
</scTable>
<div class="tableTitle">
车间物料
<div class="right-panel btnWrap">
<el-button type="primary" @click="getMaterial">领料</el-button>
</div>
</div>
<scTable ref="table8wM" :apiObj="apiObjMetarial" row-key="id" stripe :height="300"
:params="paramsMaterial" hidePagination hideDo>
<el-table-column type="index" width="50" />
<el-table-column type="selection" width="40" />
<el-table-column label="送料日期" prop="send_date">
</el-table-column>
<el-table-column label="产物" prop="material" show-overflow-tooltip>
<template #default="scope">
<span v-if="scope.row.material_out_">{{ scope.row.material_out_.name}}</span>
</template>
</el-table-column>
<el-table-column label="设备" prop="equipment_name">
</el-table-column>
<el-table-column label="批次" prop="batch">
</el-table-column>
<el-table-column label="数量/桶数" prop="count_real">
</el-table-column>
<el-table-column label="每桶重量/kg" prop="count_real_eweight">
</el-table-column>
<el-table-column label="交送人" prop="send_user_name">
</el-table-column>
<el-table-column label="接收人" prop="send_user_name">
</el-table-column>
</scTable>
</el-col>
</el-row>
</el-main>
<save-dialog v-if="dialog.save" ref="saveDialog" :mtask="mtask" :brothersList="brothersList" :activeType="activeName"
@success="handleSaveSuccess" @closed="dialog.save = false"></save-dialog>
<handover-dialog v-if="dialog.handover" ref="handoverDialog2" @success="handleSuccess"
@closed="dialog.handover = false"></handover-dialog>
<el-dialog title="交接单" ref="handoverDialog" v-model="handoverVisible" :size="1000" destroy-on-close
@closed="handoverVisible = false">
<el-form ref="dialogForm" :model="handoverForm" :rules="rules" label-width="120px">
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="送料日期" prop="send_date">
<el-date-picker v-model="handoverForm.send_date" type="date" value-format="YYYY-MM-DD" style="width:100%" />
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收部门" prop="recive_dept">
<el-select v-model="handoverForm.recive_dept" placeholder="接收部门" clearable style="width:100%"
@change="getUserList2">
<el-option v-for="item in group" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="送料部门" prop="send_dept">
<el-select v-model="handoverForm.send_dept" placeholder="送料部门" clearable style="width:100%">
<el-option v-for="item in group" :key="item.id" :label="item.name" :value="item.id"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="接收人" prop="recive_user">
<el-select v-model="handoverForm.recive_user" placeholder="接收人" clearable style="width:100%">
<el-option v-for="item in userList2" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="交送人" prop="send_user">
<el-select v-model="handoverForm.send_user" placeholder="交送人" clearable style="width:100%">
<el-option v-for="item in userList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-footer>
<el-button @click="resetForm">取消</el-button>
<el-button type="primary" @click="submitHandover">提交</el-button>
</el-footer>
</el-dialog>
</el-container>
</template>
<script>
import { generateExcel } from "@/utils/exportExcel.js";
import saveDialog from "./worktask_form.vue";
import handoverDialog from "./handover_form.vue";
import GanttComponent from '@/components/GanttComponent.vue';
export default {
name: "rparty",
components: {
GanttComponent, saveDialog, handoverDialog
},
data() {
return {
ganttHeight: '500px',
ganttLoading: false,
projectId: '',
tasks: {
data: [
{ number: 'GZ20231012', model: 'GB2', cate: '100*50*2', count: 300, text: "一天任务", start_date: "2023-10-12", id: '2023101800', duration: 2, progress: 1 },
{ number: 'GZ20231013', model: 'GB2', cate: '100*50*2', count: 300, text: "一天任务", start_date: "2023-10-13", id: '2023101801', duration: 1, progress: 1 },
{ number: 'GZ20231014', model: 'GB2', cate: '100*50*2', count: 200, text: "一天任务", start_date: "2023-10-14", id: '2023101802', duration: 1, progress: 0.8 },
{ number: 'GZ20231015', model: 'ZB2', cate: '100*50*2', count: 100, text: "一天任务", start_date: "2023-10-15", id: '2023101803', duration: 1, progress: 0.6 },
]
},
dialog: {
save: false,
handover: false
},
handoverVisible: false,
paramsDate:'',
// apiObj: this.$API.pm.mtask.list,
params7: {
mgroup__belong_dept__name: '7车间'
},
params10: {
mgroup__belong_dept__name: '10车间'
},
params8: {
mgroup__belong_dept__name: '8车间',
},
params82: {
send_dept__name: '8车间',
},
paramsth: {
belong_dept_name: '8车间',
},
apiObjMlog: null,
apiObjHandover: null,
apiObjWMaterial: this.$API.wpm.wmaterial.list,
apiObjMtask: this.$API.pm.mtask.list,
apiObj: null,
apiObjMetarial: this.$API.wpm.wmaterial.list,
paramsMaterial: { belong_dept__name: '8车间', page: 0 },
form: {},
handoverForm: {},
flogs: [],
selectedIds: [],
flogsData: [{ id: 1, name: 'John Doe', dob: new Date(1970, 1, 1) }],
columns: [
{ header: 'Id', key: 'id', wpx: 40 },
{ header: 'Name', key: 'name', wch: 15 },
{ header: 'D.O.B.', key: 'dob', width: 32 }
],
activeName: '8车间',
selection: [],
state_: {
10: '创建中',
20: '已下达',
30: '生产中',
40: '已提交',
},
choseData: {},
mtask: '',
activeSpan: 24,
rightHeight: null,
tableHeight: null,
tableHeightHalf: null,
formList: [
{
count1: 0,
count2: 0,
rate: 0,
count_no1: 0,
count_no2: 0,
count_no3: 0,
count_noall: 0,
material: 0,
}
],
peifen_kg: 0,
userList: [],
userList2: [],
brothersList: []
};
},
created() {
//清空gantt数据
gantt.clearAll();
},
mounted() {
let heights = document.getElementById('topContainer').clientHeight;
console.log('heights', heights)
this.tableHeight = (heights - 50) + 'px';
this.tableHeightHalf = (heights - 100) / 2 + 'px';
let rightHeight = heights - 100;
this.rightHeight = rightHeight / 2 + 'px';
let NowDate = new Date();
let paramsDate = NowDate.getFullYear() + '-' + (NowDate.getMonth() + 1) + '-' + NowDate.getDate();
// NowDate.getMonth() > 8 ? NowDate.getMonth() + 1 : '0' + (NowDate.getMonth() + 1)
this.apiObjMtask = this.$API.pm.mtask.list;
this.apiObjMlog = this.$API.wpm.mlog.list;
this.apiObjHandover = this.$API.wpm.handover.list;
this.getGroup();
this.getUserList();
},
methods: {
//部门数据
getGroup() {
this.$API.system.dept.list.req({ page: 0, type: 'dept' }).then(res => {
this.group = res;
});
},
getUserList() {
let that = this;
this.$API.system.user.list.req({ belong_dept__name: this.activeName, page: 0 }).then(res => {
that.userList = res;
});
},
getUserList2() {
let that = this;
this.$API.system.user.list.req({ belong_dept: this.handoverForm.recive_dept, page: 0 }).then(res => {
that.userList2 = res;
});
},
handleClick(val) {
console.log(val.index);
if (val.index == 0) {
this.activeSpan = 24
}else if(val.index == 1) {
this.activeSpan = 24;
this.paramsMaterial.belong_dept__name = '8车间';
this.$refs.table8wM.refresh();
}else if(val.index == 2){
this.activeSpan = 12;
this.paramsMaterial.belong_dept__name = '7车间';
this.$refs.table8wM.refresh();
}
else if(val.index == 3){
this.activeSpan = 12;
this.paramsMaterial.belong_dept__name = '10车间';
this.$refs.table8wM.refresh();
}
this.choseData = null;
this.flogs = [];
},
handleQuerys(){
if(this.activeName=='7车间'){
this.params7.start_date = this.paramsDate;
this.params7.end_date = this.paramsDate;
console.log('paramsDate',this.paramsDate)
console.log('7车间',this.params7)
this.$refs.table7.queryData(this.params7);
}else{
this.params10.start_date = this.paramsDate;
this.params10.end_date = this.paramsDate;
this.$refs.table10.queryData(this.params10);
}
},
table_submit(row) {
let obj = {};
obj.ids = [];
obj.ids.push(row.id);
this.$API.pm.mtask.submit.req(obj).then(res => {
debugger;
})
},
//退火日志提交
table_tuihuo_submit(row){
this.$API.wpm.mlog.submit.req(row.id,row).then(res => {
console.log(res)
})
},
//自定义新增任务
addTask(taskId) {
var $this = this;
this.$nextTick(() => {
$this.$refs.taskAdd.init(task, action, parentTask, $this.milestoneOriginalData);
});
//删除任务每次调用gantt内置新增事件时gantt会直接新增任务到甘特图中而我们需要的是自定义新增任务
gantt.deleteTask(taskId);
//灯箱事件必须返回布尔值这里使用了自定义灯箱返回false即不打开灯箱
return false;
},
//添加
add() {
if (this.activeName == '8车间' || this.activeName == '退火') {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
} else {
if (this.choseData && this.choseData.id) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("add");
});
} else {
this.$message.warning("请选择任务");
}
}
},
//提交退火
submittuihuo(){},
//编辑
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
});
},
//查看
table_show(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("show").setData(row);
});
},
//删除
async table_del(row, type) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.mlog.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
rowClick(row) {
this.choseData = row;
this.mtask = row.id;
this.$API.wpm.mlog.list.req({ mtask: row.id, page: 0 }).then(res => {
this.flogs = res;
})
this.$TOOL.data.set("MATERIAL_OBJECT", row.material_out_);
if (this.activeName == '10车间') {
this.brothersList = [];
this.brothersList = row.material_out_.brothers;
}
},
//本地更新数据
handleSaveSuccess(data, mode) {
this.$refs.table7.refresh();
this.$refs.table8.refresh();
this.$refs.table10.refresh();
},
handleSuccess() {
},
// handleQuery() {
// // this.$refs.table.queryData(this.query)
// debugger;
// generateExcel(this.columns, this.flogsData, '测试')
// },
resetQuery() {
this.query = {};
},
//从生产日志生成交接记录
addHandover(row) {
this.handoverForm.send_date = '';
this.handoverForm.mlog = row.id;
this.handoverForm.batch = row.batch;
this.handoverForm.count = row.count_real;
this.handoverForm.count_eweight = row.count_real_eweight;
this.handoverForm.send_dept = '';
this.handoverForm.recive_dept = '';
this.handoverForm.send_user = '';
this.handoverForm.recive_user = '';
this.handoverVisible = true;
},
addHandover2() {
let that = this;
that.dialog.handover = true;
that.$nextTick(() => {
that.$refs.handoverDialog2.open("add");
});
},
//编辑
editHandover2(row) {
this.dialog.handover = true;
this.$nextTick(() => {
this.$refs.handoverDialog2.open("edit").setData(row);
});
},
delHandover2(row) {
this.$confirm(`确定删除吗?`, "提示", {
type: "warning",
}).then(() => {
this.$API.wpm.handover.delete.req(row.id).then((res) => {
this.$message.success("删除成功");
return res;
}).catch((err) => {
return err;
});
}).catch(() => { });
},
handover_edit(row) {
Object.assign(this.handoverForm, row);
this.getUserList2();
console.log('this.handoverVisible:', this.handoverForm)
this.handoverVisible = true;
},
submitHandover() {
this.$API.wpm.handover.create.req(this.handoverForm).then(res => {
})
},
handleSelectionChange(selection) {
this.selectedIds = [];
selection.forEach(item => {
this.selectedIds.push(item.id)
});
},
submitMaterialCount() {
let obj = {};
obj = this.choseData;
obj.peifen_kg = this.peifen_kg;
this.$API.pm.mtask.update.req(this.mtask, obj).then(res => {
console.log('配粉料数');
})
},
getMaterial() {
this.$router.push({ name: "mio" })
},
},
};
</script>
<style scoped>
.btnWrap {
display: inline-block;
position: absolute;
right: 20px;
margin-top: 4px;
z-index: 100
}
.el-main.nopadding {
padding: 0 20px 0 20px
}
.gantt-container {
height: 30%;
}
.ganntClass {
background-color: #fff;
padding: 10px;
border-radius: 4px;
}
.cateItem {
justify-content: space-between;
display: flex;
border-bottom: 1px solid #eeeeee;
}
.tableTitle {
height: 40px;
font-size: 16px;
padding-top: 5px;
margin-top: 10px;
border-top: 1px solid rgb(238, 238, 238);
}
</style>