Commit 1726cfb4 authored by jzc's avatar jzc

调整页面展示

parent 6524426e
......@@ -30,13 +30,13 @@
},
{
name: 'toolCode',
label: '工装夹具sn码',
label: '刀模版sn码',
width: 140,
},
{
name: 'toolName',
label: '工装夹具名称',
label: '刀模版名称',
width: 140,
},
{
......
<style lang="scss">
.prod-body {
//display: flex;
height: 100%;
//overflow: hidden;
display: grid;
grid-template-columns: 1fr 150px;
}
.prod-body-left {
//flex-grow: 1;
// padding: 10rpx;
overflow: hidden;
.prod-body-left-btns {
height: 80rpx;
.u-btn {
width: 250rpx;
height: 60rpx;
line-height: 60rpx;
display: inline-block;
margin: 10rpx 20rpx;
}
.workstation{
display: inline-block;
}
}
.prod-body-left-task {
height: calc(100% - 80rpx - 500rpx);
border: 1px solid rgb(232, 232, 232);
}
.prod-body-left-num {
height: 60rpx;
line-height: 60rpx;
padding: 0 16rpx;
background-color: #add8e6;
}
.prod-body-left-bom {
height: 500rpx;
.prod-body-left-bom-type {
width: 500rpx;
height: 80rpx;
padding-top: 10rpx;
.u-subsection {
border-radius: 5px 5px 0 0 !important;
}
}
.prod-body-left-bom-table {
height: 400rpx;
border: 1px solid rgb(232, 232, 232);
}
}
}
.prod-body-right {
width: 300rpx;
padding: 10rpx;
overflow: auto;
.u-btn {
height: 100rpx;
line-height: 100rpx;
margin: 20rpx 10rpx;
font-size: 40rpx;
}
}
.prod-body {
//display: flex;
height: 100%;
//overflow: hidden;
display: grid;
grid-template-columns: 1fr 150px;
}
.prod-body-left {
//flex-grow: 1;
// padding: 10rpx;
overflow: hidden;
.prod-body-left-btns {
height: 80rpx;
.u-btn {
width: 250rpx;
height: 60rpx;
line-height: 60rpx;
display: inline-block;
margin: 10rpx 20rpx;
}
.workstation {
display: inline-block;
}
}
.prod-body-left-task {
height: calc(100% - 80rpx - 500rpx);
border: 1px solid rgb(232, 232, 232);
}
.prod-body-left-num {
height: 60rpx;
line-height: 60rpx;
padding: 0 16rpx;
background-color: #add8e6;
}
.prod-body-left-bom {
height: 500rpx;
.prod-body-left-bom-type {
width: 500rpx;
height: 80rpx;
padding-top: 10rpx;
.u-subsection {
border-radius: 5px 5px 0 0 !important;
}
}
.prod-body-left-bom-table {
height: 400rpx;
border: 1px solid rgb(232, 232, 232);
}
}
}
.prod-body-right {
width: 300rpx;
padding: 10rpx;
overflow: auto;
.u-btn {
height: 100rpx;
line-height: 100rpx;
margin: 20rpx 10rpx;
font-size: 40rpx;
}
}
</style>
<template>
<view class="commonBody">
<view class="prod-body">
<view class="prod-body-left">
<!-- <view class="prod-body-left-btns">-->
<!-- <view class="workstation">-->
<!-- 工作站名称:-->
<!-- {{ this.vuex_workstation == null ? '请选择工作站' : this.vuex_workstation.workstationName }}-->
<!-- &lt;!&ndash; <u-icon name="edit-pen-fill" size="46" color="#2979ff"></u-icon>&ndash;&gt;-->
<!-- </view>-->
<!-- <u-button type="primary" @click="changeWorkstation">切换工作站</u-button>-->
<!-- &lt;!&ndash; <u-button type="primary" @click="commonClick('')">生产任务</u-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <u-button type="primary" @click="commonClick('KnifeTemp')">刀模上架</u-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <u-button type="primary" @click="commonClick('')">生产投料</u-button>&ndash;&gt;-->
<!-- </view>-->
<view class="prod-body-left-task">
<zb-table :columns="tableColumn" :stripe="true" @rowClick="rowClick"
@numclik = "numclik"
@toggleRowSelection="toggleRowSelection" @toggleAllSelection="toggleAllSelection" :border="true"
:data="tableData"></zb-table>
</view>
<view class="prod-body-left-num">
总报工订单数:{{ tableData.length }}
</view>
<view class="prod-body-left-bom">
<view class="prod-body-left-bom-type">
<u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"
@change="typeChange"></u-subsection>
</view>
<view class="prod-body-left-bom-table">
<u-form>
<u-row gutter="16">
<u-col span="3">
<u-form-item label="任务单号" label-width="150">
{{ curTaskInfo.taskCode }}
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="物料条码" label-width="150">
<SearchInput v-model="materialRecordInfo.materialBatchNumber" placeholder="请输入物料条码"
hassearchbtn="true" @inputchange="search"/>
</u-form-item>
</u-col>
<u-col span="2">
<u-form-item label="数量">
<u-number-box :min="0" v-model="materialRecordInfo.quantity"></u-number-box>
</u-form-item>
</u-col>
<u-col span="1">
<u-button type="primary" size="mini" @click="commonClick('MaterialUsageRecord')">添加</u-button>
</u-col>
<!-- <u-col span="1">-->
<!-- <u-button type="primary" @click="commonClick('')">删除</u-button>-->
<!-- </u-col>-->
<u-col span="1">
<!-- <u-button type="primary" size="mini" @click="commonClick('')">领料批次</u-button>-->
</u-col>
<u-col span="5">
</u-col>
</u-row>
</u-form>
<zb-table :columns="bomFeeColumn" :stripe="true" :border="true" :data="materialUsageRecordList"></zb-table>
</view>
</view>
</view>
<view class="prod-body-right">
<view style="text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;"> {{ this.vuex_workstation == null ? '请选择工作站' : this.vuex_workstation.workstationName }}</view>
<u-button type="primary" @click="changeWorkstation">切换工作站</u-button>
<br/>
<u-button type="warning" @click="commonClick('KnifeTemp')">刀模上架</u-button>
<u-button type="primary" @click="commonClick('Refresh')">刷新</u-button>
<u-button type="success" @click="commonClick('StartTask')">开始作业</u-button>
<u-button type="warning" @click="commonClick('StopTask')">暂停作业</u-button>
<u-button type="success" @click="commonClick('Prod')">生产报工</u-button>
<u-button type="primary" @click="commonClick('FinshTask')">完成作业</u-button>
<!-- <u-button type="error" @click="commonClick('')">报告异常</u-button>-->
<!-- <u-button type="warning" @click="commonClick('')">检验通知</u-button>-->
<!-- <u-button type="primary" @click="commonClick('')">属性收集</u-button>-->
<!-- <u-button type="primary" @click="commonClick('')">反扣冲减</u-button>-->
<!-- <u-button type="primary" @click="commonClick('')">查看图纸</u-button>-->
<!-- <u-button type="warning" @click="commonClick('')">完成全部</u-button>-->
</view>
</view>
<u-modal :title="title" @confirm="feedback()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="open" width="1800rpx">
<view class="feedback-card" v-for="feedback in feedbackForms">
<u-form label-width="100px" :model="feedback" :rules="rules">
<u-row>
<u-col span="6">
<u-form-item label="任务单号" prop="quantity">
{{ feedback.taskCode }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="工序" prop="nickName">
{{ feedback.processName }}
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<u-form-item label="报工总数量" prop="quantity">
{{ feedback.quantityQuanlify + feedback.quantityUnquanlify }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="报工人" prop="nickName">
<u-input v-model="feedback.nickName"></u-input>
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<u-form-item label="合格品数量" prop="quantityQualify">
<u-number-box :min="0" @change="quantityChanged"
v-model="feedback.quantityQualify"></u-number-box>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="不良品数量" prop="quantityUnqualify">
<u-number-box :min="0" @change="quantityChanged"
v-model="feedback.quantityUnqualify"></u-number-box>
</u-form-item>
</u-col>
</u-row>
</u-form>
</view>
</u-modal>
<u-modal title="刀模版上架" @confirm="knifeTemp()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="knifeTempVisible" width="1300rpx">
<u-form label-width="130px" :model="knifeTempSearch" :rules="rules">
<u-row>
<u-col span="6">
<u-form-item label="扫描刃模版条码" prop="quantity">
<u-input v-model="knifeTempSearch.knifeTempCode"></u-input>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="扫描库位条码" prop="nickName">
<u-input v-model="knifeTempSearch.locationCode"></u-input>
</u-form-item>
</u-col>
</u-row>
</u-form>
<dModelList :data="dModelData" @action="upDownGetList" />
</u-modal>
<u-modal title="暂停原因" @confirm="stopReasonSubmit()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="stopReasonVisible" width="1300rpx">
<u-form label-width="100px" :model="feedback" :rules="rules">
<u-form-item label="故障类型" prop="quantity">
<uni-data-select
:localdata="stopReasonList"
@change="stopReasonChange"
></uni-data-select>
</u-form-item>
<u-form-item label="故障原因" prop="nickName">
<u-input type="textarea" height="150" :border="true" v-model="stopReason"></u-input>
</u-form-item>
</u-form>
</u-modal>
</view>
<view class="commonBody">
<view class="prod-body">
<view class="prod-body-left">
<!-- <view class="prod-body-left-btns">-->
<!-- <view class="workstation">-->
<!-- 工作站名称:-->
<!-- {{ this.vuex_workstation == null ? '请选择工作站' : this.vuex_workstation.workstationName }}-->
<!-- &lt;!&ndash; <u-icon name="edit-pen-fill" size="46" color="#2979ff"></u-icon>&ndash;&gt;-->
<!-- </view>-->
<!-- <u-button type="primary" @click="changeWorkstation">切换工作站</u-button>-->
<!-- &lt;!&ndash; <u-button type="primary" @click="commonClick('')">生产任务</u-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <u-button type="primary" @click="commonClick('KnifeTemp')">刀模上架</u-button>&ndash;&gt;-->
<!-- &lt;!&ndash; <u-button type="primary" @click="commonClick('')">生产投料</u-button>&ndash;&gt;-->
<!-- </view>-->
<view class="prod-body-left-task">
<zb-table :columns="tableColumn" :stripe="true" @rowClick="rowClick" @numclik="numclik"
@toggleRowSelection="toggleRowSelection" @toggleAllSelection="toggleAllSelection" :border="true"
:data="tableData"></zb-table>
</view>
<view class="prod-body-left-num">
总报工订单数:{{ tableData.length }}
</view>
<view class="prod-body-left-bom">
<view class="prod-body-left-bom-type">
<u-subsection :list="typeList" :current="currentType" type="primary" font-size="28"
@change="typeChange"></u-subsection>
</view>
<view class="prod-body-left-bom-table">
<u-form>
<u-row gutter="16">
<u-col span="3">
<u-form-item label="任务单号" label-width="150">
{{ curTaskInfo.taskCode }}
</u-form-item>
</u-col>
<u-col span="4">
<u-form-item label="物料条码" label-width="150">
<SearchInput v-model="materialRecordInfo.materialBatchNumber"
placeholder="请输入物料条码" hassearchbtn="true" @inputchange="search" />
</u-form-item>
</u-col>
<u-col span="2">
<u-form-item label="数量">
<u-number-box :min="0" v-model="materialRecordInfo.quantity"></u-number-box>
</u-form-item>
</u-col>
<u-col span="1">
<u-button type="primary" size="mini"
@click="commonClick('MaterialUsageRecord')">添加</u-button>
</u-col>
<!-- <u-col span="1">-->
<!-- <u-button type="primary" @click="commonClick('')">删除</u-button>-->
<!-- </u-col>-->
<u-col span="1">
<!-- <u-button type="primary" size="mini" @click="commonClick('')">领料批次</u-button>-->
</u-col>
<u-col span="5">
</u-col>
</u-row>
</u-form>
<zb-table :columns="bomFeeColumn" :stripe="true" :border="true"
:data="materialUsageRecordList"></zb-table>
</view>
</view>
</view>
<view class="prod-body-right">
<view style="text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;">
{{ this.vuex_workstation == null ? '请选择工作站' : this.vuex_workstation.workstationName }}
</view>
<u-button type="primary" @click="changeWorkstation">切换工作站</u-button>
<br />
<u-button type="warning" @click="commonClick('KnifeTemp')">刀模版上下机</u-button>
<u-button type="primary" @click="commonClick('Refresh')">刷新</u-button>
<u-button type="success" @click="commonClick('StartTask')">开始作业</u-button>
<u-button type="warning" @click="commonClick('StopTask')">暂停作业</u-button>
<u-button type="success" @click="commonClick('Prod')">生产报工</u-button>
<u-button type="primary" @click="commonClick('FinshTask')">完成作业</u-button>
<!-- <u-button type="error" @click="commonClick('')">报告异常</u-button>-->
<!-- <u-button type="warning" @click="commonClick('')">检验通知</u-button>-->
<!-- <u-button type="primary" @click="commonClick('')">属性收集</u-button>-->
<!-- <u-button type="primary" @click="commonClick('')">反扣冲减</u-button>-->
<!-- <u-button type="primary" @click="commonClick('')">查看图纸</u-button>-->
<!-- <u-button type="warning" @click="commonClick('')">完成全部</u-button>-->
</view>
</view>
<u-modal :title="title" @confirm="feedback()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="open" width="1800rpx">
<view class="feedback-card" v-for="feedback in feedbackForms">
<u-form label-width="100px" :model="feedback" :rules="rules">
<u-row>
<u-col span="6">
<u-form-item label="任务单号" prop="quantity">
{{ feedback.taskCode }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="工序" prop="nickName">
{{ feedback.processName }}
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<u-form-item label="报工总数量" prop="quantity">
{{ feedback.quantityQuanlify + feedback.quantityUnquanlify }}
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="报工人" prop="nickName">
<u-input v-model="feedback.nickName"></u-input>
</u-form-item>
</u-col>
</u-row>
<u-row>
<u-col span="6">
<u-form-item label="合格品数量" prop="quantityQualify">
<u-number-box :min="0" @change="quantityChanged"
v-model="feedback.quantityQualify"></u-number-box>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="不良品数量" prop="quantityUnqualify">
<u-number-box :min="0" @change="quantityChanged"
v-model="feedback.quantityUnqualify"></u-number-box>
</u-form-item>
</u-col>
</u-row>
</u-form>
</view>
</u-modal>
<u-modal title="刀模版上下机" @confirm="knifeTemp()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="knifeTempVisible" width="1300rpx">
<u-form label-width="130px" :model="knifeTempSearch" :rules="rules">
<u-row>
<u-col span="6">
<u-form-item label="扫描刃模版条码" prop="quantity">
<u-input v-model="knifeTempSearch.knifeTempCode"></u-input>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="扫描库位条码" prop="nickName">
<u-input v-model="knifeTempSearch.locationCode"></u-input>
</u-form-item>
</u-col>
</u-row>
</u-form>
<dModelList :data="dModelData" @action="upDownGetList" />
</u-modal>
<u-modal title="暂停原因" @confirm="stopReasonSubmit()" show-cancel-button
:title-style="{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
v-model="stopReasonVisible" width="1300rpx">
<u-form label-width="100px" :model="feedback" :rules="rules">
<u-form-item label="故障类型" prop="quantity">
<uni-data-select :localdata="stopReasonList" @change="stopReasonChange"></uni-data-select>
</u-form-item>
<u-form-item label="故障原因" prop="nickName">
<u-input type="textarea" height="150" :border="true" v-model="stopReason"></u-input>
</u-form-item>
</u-form>
</u-modal>
</view>
</template>
<script>
import SearchInput from "@/components/ScanInput/index.vue";
import dModelList from './components/dModelList.vue'
export default {
name: "ProdReport",
components: {SearchInput, dModelList},
data() {
return {
screenHeight: 768,
title: '生产报工',
open: false,
form: {},
feedbackForm: {},
tableData: [],
knifeTempVisible: false,
knifeTempSearch: {
knifeTempCode: '',
locationCode: ''
},
knifeTempInfo: {
knifeTemplateCode: '',
knifeTemplateName: '',
knifeTemplateSpec: '',
locationCode: '',
locationName: '',
locationType: '',
locationTypeCode: '',
locationTypeDesc: '',
locationTypeDescCode: '',
locationTypeDescName: '',
locationTypeDescNameCode: '',
locationTypeDescNameCode2: ''
},
stopReasonList: [
{value: '中午休息吃饭。', text: "休息吃饭"},
{value: '刀头模具到期更换,更换期间。', text: "刀头模具到期更换"},
{value: '没料了,正在领料', text: "领料加仓"}
],
stopReason: '',
stopReasonVisible: false,
rules: {
quantity: [{
required: true,
message: "请输入合格品数量或者不良品数量!",
trigger: "blur"
}]
},
typeList: [
{
name: '物料扣减'
},
{
name: 'BOM外扣减'
}
],
materialRecordInfo: {
taskCode: '',
materialBatchNumber: '',
quantity: 0,
operatorTime: '',
depletionMethod: 1
},
curTaskInfo: {},
currentType: 0,
bomFeeData: [],
bomFeeColumn: [
{
type: 'selection',
width: 35
},
{
name: 'taskCode',
label: '物料批次',
align: "center",
width: 150
},
{
name: 'status',
label: 'ERP物料批次',
align: "center",
width: 150
},
{
name: 'materialBatchNumber',
label: '物料编码',
width: 150
},
{
name: 'taskCode',
label: '序列号',
width: 150
},
{
name: 'quantity',
label: '数量',
width: 150
},
{
name: 'itemCode',
label: '物料描述',
}
],
tableColumn: [
{
type: 'selection',
width: 35
},
{
name: 'arrangeCode',
label: '编排单号',
width: 140,
func:"numclik"
import SearchInput from "@/components/ScanInput/index.vue";
import dModelList from './components/dModelList.vue'
export default {
name: "ProdReport",
components: {
SearchInput,
dModelList
},
data() {
return {
screenHeight: 768,
title: '生产报工',
open: false,
form: {},
feedbackForm: {},
tableData: [],
knifeTempVisible: false,
knifeTempSearch: {
knifeTempCode: '',
locationCode: ''
},
knifeTempInfo: {
knifeTemplateCode: '',
knifeTemplateName: '',
knifeTemplateSpec: '',
locationCode: '',
locationName: '',
locationType: '',
locationTypeCode: '',
locationTypeDesc: '',
locationTypeDescCode: '',
locationTypeDescName: '',
locationTypeDescNameCode: '',
locationTypeDescNameCode2: ''
},
stopReasonList: [{
value: '中午休息吃饭。',
text: "休息吃饭"
},
{
value: '刀头模具到期更换,更换期间。',
text: "刀头模具到期更换"
},
{
value: '没料了,正在领料',
text: "领料加仓"
}
],
stopReason: '',
stopReasonVisible: false,
rules: {
quantity: [{
required: true,
message: "请输入合格品数量或者不良品数量!",
trigger: "blur"
}]
},
typeList: [{
name: '物料扣减'
},
{
name: 'BOM外扣减'
}
],
materialRecordInfo: {
taskCode: '',
materialBatchNumber: '',
quantity: 0,
operatorTime: '',
depletionMethod: 1
},
curTaskInfo: {},
currentType: 0,
bomFeeData: [],
bomFeeColumn: [{
type: 'selection',
width: 35
},
{
name: 'taskCode',
label: '物料批次',
align: "center",
width: 150
},
{
name: 'status',
label: 'ERP物料批次',
align: "center",
width: 150
},
{
name: 'materialBatchNumber',
label: '物料编码',
width: 150
},
{
name: 'taskCode',
label: '序列号',
width: 150
},
{
name: 'quantity',
label: '数量',
width: 150
},
{
name: 'itemCode',
label: '物料描述',
}
],
tableColumn: [{
type: 'selection',
width: 35
},
{
name: 'arrangeCode',
label: '编排单号',
width: 140,
func: "numclik"
},
{
name: 'startTime',
label: '计划开始时间',
width: 140,
func: "numclik"
},
{
name: 'endTime',
label: '计划结束时间',
width: 140,
},
{
name: 'quantity',
label: '待加工数量',
width: 140,
},
{
name: 'status',
label: '状态',
filters: {
// 'START': '生产中',
// 'PAUSE': '暂停',
// 'NORMARL': '未开始'
'PREPARE': '未开工',
'BEGINNING': '已开工',
'PAUSE': '暂停',
'ERROR_STOP': '异常停工',
'FINISH': '完工'
},
width: 60,
align: "center"
},
// {
// name: 'date',
// label: '批号',
// width: 50,
// },
{
name: 'taskCode',
label: '任务单号',
width: 110,
},
{
name: 'workorderCode',
label: '生产单号',
width: 120,
},
// {
// name: 'itemCode',
// label: '物料编号',
// width: 110,
// },
// {
// name: 'itemName',
// label: '物料名称'
// },
{
name: 'processName',
label: '工序',
width: 60,
},
{
name: 'quantity',
label: '数量',
width: 60,
align: "center"
},
{
name: 'quantityQuanlify',
label: '合格数量',
width: 60,
align: "center"
},
{
name: 'quantityUnquanlify',
label: '不合格数量',
width: 60,
align: "center"
},
{
name: 'clientName',
label: '作业人员',
width: 60,
align: "center"
},
],
dModelData: [],
tableSelectData: [],
feedbackForms: [],
materialUsageRecordList: [],
materialusagerecordLoading: false
}
},
{
name: 'startTime',
label: '计划开始时间',
width: 140,
func:"numclik"
},
{
name: 'endTime',
label: '计划结束时间',
width: 140,
created() {
//获取屏幕高度
uni.getSystemInfo({
success(res) {
this.screenHeight = res.windowHeight;
}
})
//监听工作站切换事件
uni.$on('switchWorkstation', (station) => {
// this.reset();
this.getTaskList();
})
uni.$on('taskStatusChanged', () => {
this.getTaskList(); //刷新任务状态
})
if (this.vuex_workstation != null) {
this.getTaskList();
}
// if (this.vuex_task != null) {
// this.shiftTask(this.vuex_task.taskId);
// }
},
{
name: 'quantity',
label: '待加工数量',
width: 140,
destroyed() {
uni.$off('switchWorkstation');
uni.$off('taskStatusChanged');
},
{
name: 'status',
label: '状态',
filters: {
// 'START': '生产中',
// 'PAUSE': '暂停',
// 'NORMARL': '未开始'
'PREPARE': '未开工',
'BEGINNING': '已开工',
'PAUSE': '暂停',
'ERROR_STOP': '异常停工',
'FINISH': '完工'
},
width: 60,
align: "center"
},
// {
// name: 'date',
// label: '批号',
// width: 50,
// },
{
name: 'taskCode',
label: '任务单号',
width: 110,
},
{
name: 'workorderCode',
label: '生产单号',
width: 120,
},
// {
// name: 'itemCode',
// label: '物料编号',
// width: 110,
// },
// {
// name: 'itemName',
// label: '物料名称'
// },
{
name: 'processName',
label: '工序',
width: 60,
},
{
name: 'quantity',
label: '数量',
width: 60,
align: "center"
},
{
name: 'quantityQuanlify',
label: '合格数量',
width: 60,
align: "center"
},
{
name: 'quantityUnquanlify',
label: '不合格数量',
width: 60,
align: "center"
},
{
name: 'clientName',
label: '作业人员',
width: 60,
align: "center"
},
],
dModelData: [],
tableSelectData: [],
feedbackForms: [],
materialUsageRecordList: [],
materialusagerecordLoading: false
}
},
created() {
//获取屏幕高度
uni.getSystemInfo({
success(res) {
this.screenHeight = res.windowHeight;
}
})
//监听工作站切换事件
uni.$on('switchWorkstation', (station) => {
// this.reset();
this.getTaskList();
})
uni.$on('taskStatusChanged', () => {
this.getTaskList(); //刷新任务状态
})
if (this.vuex_workstation != null) {
this.getTaskList();
}
// if (this.vuex_task != null) {
// this.shiftTask(this.vuex_task.taskId);
// }
},
destroyed() {
uni.$off('switchWorkstation');
uni.$off('taskStatusChanged');
},
methods: {
numclik(...arg){
console.log('99999999', arg)
},
changeWorkstation() {
uni.$emit('changeWorkstation');
},
commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
this.$u.toast('请选择工作任务!');
return
}
switch (oper) {
case 'Refresh':
this.getTaskList();
break;
case 'StartTask':
this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, 'START')
})
this.getTaskList()
break;
case 'StopTask':
this.stopReason = ''
this.stopReasonVisible = true
break;
case 'FinshTask':
this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, 'FINISHED')
})
this.getTaskList()
break;
case 'Prod':
this.doFeedback()
break;
case 'MaterialUsageRecord':
this.addMaterialUsageRecord()
break;
case 'KnifeTemp':
this.knifeTempShow()
break;
default:
this.$u.toast('功能正在开发中!');
break
}
},
async knifeTempShow() {
if (this.tableSelectData.length > 1) {
return
}
const params = {
arrangeCode: this.tableSelectData[0].arrangeCode || '',
processId: this.tableSelectData[0].processId
}
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
// 如果有数据
if (records?.data && records.data.length) {
this.dModelData = records.data
this.knifeTempVisible = true
return
}
this.addDModelRecord(params)
},
async upDownGetList() {
const params = {
arrangeCode: this.tableSelectData[0].arrangeCode || '',
processId: this.tableSelectData[0].processId
}
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
this.dModelData = records.data
},
// 新增刀模版上下机记录
async addDModelRecord(params) {
const {data} = await this.$u.api.dModel.getToolsByProcessIdAndArrangeCode(params)
if (data?.length) {
const [selectData] = this.tableSelectData
const ps = {
toolMachinesCode: '',
arrangeCode: selectData.arrangeCode,
workunitId: selectData.workunitId,
processId: selectData.processId,
workorderId: selectData.workorderId,
toolRequestUseId: data[0].toolRequestUseId,
toolMachinesRecordList: data.map(v => {
return {
toolRequestUseItemId: v.toolRequestUseItemId,
type: 3,
upDate: '',
downDate: ''
methods: {
numclik(...arg) {
console.log('99999999', arg)
},
changeWorkstation() {
uni.$emit('changeWorkstation');
},
commonClick(oper) {
if (['Refresh', 'MaterialUsageRecord'].indexOf(oper) === -1 && this.tableSelectData.length === 0) {
this.$u.toast('请选择工作任务!');
return
}
switch (oper) {
case 'Refresh':
this.getTaskList();
break;
case 'StartTask':
this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, 'START')
})
this.getTaskList()
break;
case 'StopTask':
this.stopReason = ''
this.stopReasonVisible = true
break;
case 'FinshTask':
this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, 'FINISHED')
})
this.getTaskList()
break;
case 'Prod':
this.doFeedback()
break;
case 'MaterialUsageRecord':
this.addMaterialUsageRecord()
break;
case 'KnifeTemp':
this.knifeTempShow()
break;
default:
this.$u.toast('功能正在开发中!');
break
}
},
async knifeTempShow() {
if (this.tableSelectData.length > 1) {
return
}
const params = {
arrangeCode: this.tableSelectData[0].arrangeCode || '',
processId: this.tableSelectData[0].processId
}
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
// 如果有数据
if (records?.data && records.data.length) {
this.dModelData = records.data
this.knifeTempVisible = true
return
}
this.addDModelRecord(params)
},
async upDownGetList() {
const params = {
arrangeCode: this.tableSelectData[0].arrangeCode || '',
processId: this.tableSelectData[0].processId
}
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
this.dModelData = records.data
},
// 新增刀模版上下机记录
async addDModelRecord(params) {
const {
data
} = await this.$u.api.dModel.getToolsByProcessIdAndArrangeCode(params)
if (data?.length) {
const [selectData] = this.tableSelectData
const ps = {
toolMachinesCode: '',
arrangeCode: selectData.arrangeCode,
workunitId: selectData.workunitId,
processId: selectData.processId,
workorderId: selectData.workorderId,
toolRequestUseId: data[0].toolRequestUseId,
toolMachinesRecordList: data.map(v => {
return {
toolRequestUseItemId: v.toolRequestUseItemId,
type: 3,
upDate: '',
downDate: ''
}
})
}
// 新增
const data2 = await this.$u.api.dModel.tmToolMachines(ps)
if (data2.code == 200) {
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
this.dModelData = records.data || []
this.knifeTempVisible = true
}
}
},
rowClick(row, index) {
this.curTaskInfo = row;
this.getMaterialUsageRecordList();
},
toggleAllSelection(checked, arr) {
this.tableSelectData = arr
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr
},
knifeTemp() {
this.$u.toast('刀具校验通过!');
},
stopReasonSubmit() {
this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, 'PAUSE')
})
}
// 新增
const data2 = await this.$u.api.dModel.tmToolMachines(ps)
if (data2.code == 200) {
const records = await this.$u.api.dModel.getRecordsByProcessIdAndArrangeCode(params)
this.dModelData = records.data || []
this.knifeTempVisible = true
this.getTaskList()
},
stopReasonChange(e) {
this.stopReason += e;
},
getTaskList() {
this.form = {}
this.$u.api.getTaskList({
workstationId: this.vuex_workstation.workstationId,
}).then(res => {
if (res.code === 200) {
this.tableData = res.rows;
if (this.tableData.length > 0) {
this.curTaskInfo = this.tableData[0]
this.getMaterialUsageRecordList();
} else {}
}
});
},
typeChange(index) {
this.currentType = index;
this.getMaterialUsageRecordList()
},
getMaterialUsageRecordList() {
this.materialusagerecordLoading = true
this.$u.api.materialusagerecordList({
workstationId: this.vuex_workstation.workstationId,
depletionMethod: this.currentType + 1,
taskId: this.curTaskInfo.taskId
}).then(res => {
this.materialusagerecordLoading = false
if (res.code === 200) {
this.materialUsageRecordList = res.rows;
}
});
},
addMaterialUsageRecord() {
if (this.materialRecordInfo.materialBatchNumber !== this.curTaskInfo.itemCode && this.currentType === 0) {
this.$u.toast('物料不在生产目录中!');
return
}
if (this.materialRecordInfo.quantity === 0) {
this.$u.toast('请输入物料数量!');
return
}
this.materialRecordInfo.operatorTime = new Date();
this.materialRecordInfo.operatorId = this.vuex_user.userId;
this.materialRecordInfo.operatorName = this.vuex_user.userName;
this.materialRecordInfo.taskId = this.curTaskInfo.taskId;
this.materialRecordInfo.depletionMethod = this.currentType + 1;
this.materialRecordInfo.workstationId = this.vuex_workstation.workstationId;
this.$u.api.addMaterialusagerecord(this.materialRecordInfo).then(res => {
if (res.code === 200) {
this.materialRecordInfo.quantity = 0;
this.materialRecordInfo.materialBatchNumber = '';
this.$u.toast('上报成功');
this.getMaterialUsageRecordList()
}
});
},
shiftTask(tid) {
this.$u.api.getTaskInfo({
taskId: tid,
}).then(res => {
if (res.code === 200) {
this.form = res.data;
this.$u.vuex('vuex_task', res.data);
this.form.progress = Math.round((this.form.quantityProduced / this.form.quantity) * 100,
0);
}
});
},
changeStatus(taskId, status) {
// this.form.status = status;
this.$u.api.changeStatus({
taskId: taskId,
status: status,
attr1: this.stopReason
}).then(res => {
if (res.code === 200) {
this.$u.toast('变更成功');
uni.$emit('taskStatusChanged'); //任务状态变更
this.getTaskList()
}
});
},
// reset() {
// this.feedbackForm = {
// workstationId: 0,
// userName: this.vuex_user.userName,
// taskId: this.form.taskId,
// feedbackChannel: 'PAD',
// quantity: 0,
// quantityQualify: 0,
// quantityUnqualify: 0
// }
// },
quantityChanged() {
this.feedbackForm.quantity = this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify;
},
doFeedback() {
// this.reset();
this.feedbackForms = []
this.tableSelectData.forEach((item) => {
const feedback = {
...item,
workstationId: item.workstationId,
userName: this.vuex_user.userName,
taskId: item.taskId,
feedbackChannel: 'PAD',
quantity: item.quantity,
quantityQualify: 0,
quantityUnqualify: 0,
nickName: this.vuex_user.nickName
}
this.feedbackForms.push(feedback)
})
this.open = true;
},
cancel() {
this.open = false;
},
feedback() {
// this.$refs.feedbackForm.validate(valid => {
// // if (valid) {
// // console.log('验证通过');
// // } else {
// // console.log('验证失败');
// // }
// });
this.feedbackForms.forEach((item) => {
if (item.quantityQualify === 0 && item.quantityUnqualify === 0) {
this.$u.toast('请填写合格/不合格产品数量!');
return
}
this.$u.api.feedback({
taskId: item.taskId,
quantityFeedback: item.quantity,
quantityQualified: item.quantityQualify,
quantityUnquanlified: item.quantityUnqualify,
userName: this.vuex_user.userName,
feedbackType: item.feedbackType,
routeId: item.routeId,
processId: item.processId,
itemId: item.itemId,
itemCode: item.itemCode,
itemName: item.itemName
}).then(res => {
if (res.code === 200) {
this.$u.toast('上报成功');
}
});
})
this.getTaskList()
this.open = false;
}
}
},
rowClick(row, index) {
this.curTaskInfo = row;
this.getMaterialUsageRecordList();
},
toggleAllSelection(checked, arr) {
this.tableSelectData = arr
},
toggleRowSelection(checked, arr) {
this.tableSelectData = arr
},
knifeTemp() {
this.$u.toast('刀具校验通过!');
},
stopReasonSubmit() {
this.tableSelectData.forEach((item) => {
this.changeStatus(item.taskId, 'PAUSE')
})
this.getTaskList()
},
stopReasonChange(e) {
this.stopReason += e;
},
getTaskList() {
this.form = {}
this.$u.api.getTaskList({
workstationId: this.vuex_workstation.workstationId,
}).then(res => {
if (res.code === 200) {
this.tableData = res.rows;
if (this.tableData.length > 0) {
this.curTaskInfo = this.tableData[0]
this.getMaterialUsageRecordList();
} else {
}
}
});
},
typeChange(index) {
this.currentType = index;
this.getMaterialUsageRecordList()
},
getMaterialUsageRecordList() {
this.materialusagerecordLoading = true
this.$u.api.materialusagerecordList({
workstationId: this.vuex_workstation.workstationId,
depletionMethod: this.currentType + 1,
taskId: this.curTaskInfo.taskId
}).then(res => {
this.materialusagerecordLoading = false
if (res.code === 200) {
this.materialUsageRecordList = res.rows;
}
});
},
addMaterialUsageRecord() {
if (this.materialRecordInfo.materialBatchNumber !== this.curTaskInfo.itemCode && this.currentType === 0) {
this.$u.toast('物料不在生产目录中!');
return
}
if (this.materialRecordInfo.quantity === 0) {
this.$u.toast('请输入物料数量!');
return
}
this.materialRecordInfo.operatorTime = new Date();
this.materialRecordInfo.operatorId = this.vuex_user.userId;
this.materialRecordInfo.operatorName = this.vuex_user.userName;
this.materialRecordInfo.taskId = this.curTaskInfo.taskId;
this.materialRecordInfo.depletionMethod = this.currentType + 1;
this.materialRecordInfo.workstationId = this.vuex_workstation.workstationId;
this.$u.api.addMaterialusagerecord(this.materialRecordInfo).then(res => {
if (res.code === 200) {
this.materialRecordInfo.quantity = 0;
this.materialRecordInfo.materialBatchNumber = '';
this.$u.toast('上报成功');
this.getMaterialUsageRecordList()
}
});
},
shiftTask(tid) {
this.$u.api.getTaskInfo({
taskId: tid,
}).then(res => {
if (res.code === 200) {
this.form = res.data;
this.$u.vuex('vuex_task', res.data);
this.form.progress = Math.round((this.form.quantityProduced / this.form.quantity) * 100, 0);
}
});
},
changeStatus(taskId, status) {
// this.form.status = status;
this.$u.api.changeStatus({
taskId: taskId,
status: status,
attr1: this.stopReason
}).then(res => {
if (res.code === 200) {
this.$u.toast('变更成功');
uni.$emit('taskStatusChanged'); //任务状态变更
this.getTaskList()
}
});
},
// reset() {
// this.feedbackForm = {
// workstationId: 0,
// userName: this.vuex_user.userName,
// taskId: this.form.taskId,
// feedbackChannel: 'PAD',
// quantity: 0,
// quantityQualify: 0,
// quantityUnqualify: 0
// }
// },
quantityChanged() {
this.feedbackForm.quantity = this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify;
},
doFeedback() {
// this.reset();
this.feedbackForms = []
this.tableSelectData.forEach((item) => {
const feedback = {
...item,
workstationId: item.workstationId,
userName: this.vuex_user.userName,
taskId: item.taskId,
feedbackChannel: 'PAD',
quantity: item.quantity,
quantityQualify: 0,
quantityUnqualify: 0,
nickName: this.vuex_user.nickName
}
this.feedbackForms.push(feedback)
})
this.open = true;
},
cancel() {
this.open = false;
},
feedback() {
// this.$refs.feedbackForm.validate(valid => {
// // if (valid) {
// // console.log('验证通过');
// // } else {
// // console.log('验证失败');
// // }
// });
this.feedbackForms.forEach((item) => {
if (item.quantityQualify === 0 && item.quantityUnqualify === 0) {
this.$u.toast('请填写合格/不合格产品数量!');
return
}
this.$u.api.feedback({
taskId: item.taskId,
quantityFeedback: item.quantity,
quantityQualified: item.quantityQualify,
quantityUnquanlified: item.quantityUnqualify,
userName: this.vuex_user.userName,
feedbackType: item.feedbackType,
routeId: item.routeId,
processId: item.processId,
itemId: item.itemId,
itemCode: item.itemCode,
itemName: item.itemName
}).then(res => {
if (res.code === 200) {
this.$u.toast('上报成功');
}
});
})
this.getTaskList()
this.open = false;
}
}
}
}
</script>
<style>
.commonBody {
width: 100%;
height: 100%;
background-color: #FEFEFF;
margin: 0 0;
padding: 0 0;
}
.content {
margin: 10px;
display: flex;
}
.content_left {
width: 40%;
}
.task_card {
width: 90%;
margin: 5px;
}
.uRow {
margin-top: 5px;
margin-bottom: 5px;
}
.content_right {
width: 60%;
padding: 10px;
}
.feedback-card {
margin: 25rpx;
padding: 18rpx;
box-sizing: border-box;
position: relative;
background: #ffffff;
border-radius: 8px;
cursor: pointer;
transition: box-shadow 0.2s, border-color 0.2s;
box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);
}
::v-deep .u-form-item {
padding: 0px;
}
</style>
.commonBody {
width: 100%;
height: 100%;
background-color: #FEFEFF;
margin: 0 0;
padding: 0 0;
}
.content {
margin: 10px;
display: flex;
}
.content_left {
width: 40%;
}
.task_card {
width: 90%;
margin: 5px;
}
.uRow {
margin-top: 5px;
margin-bottom: 5px;
}
.content_right {
width: 60%;
padding: 10px;
}
.feedback-card {
margin: 25rpx;
padding: 18rpx;
box-sizing: border-box;
position: relative;
background: #ffffff;
border-radius: 8px;
cursor: pointer;
transition: box-shadow 0.2s, border-color 0.2s;
box-shadow: 0 1px 2px -2px rgba(0, 0, 0, 0.16), 0 3px 6px 0 rgba(0, 0, 0, 0.12), 0 5px 12px 4px rgba(0, 0, 0, 0.09);
}
::v-deep .u-form-item {
padding: 0px;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment