Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mes-pad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ximai
mes-pad
Commits
1726cfb4
Commit
1726cfb4
authored
Feb 20, 2024
by
jzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整页面展示
parent
6524426e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
814 additions
and
804 deletions
+814
-804
dModelList.vue
pages/mes/prodReport/components/dModelList.vue
+2
-2
index.vue
pages/mes/prodReport/index.vue
+812
-802
No files found.
pages/mes/prodReport/components/dModelList.vue
View file @
1726cfb4
...
@@ -30,13 +30,13 @@
...
@@ -30,13 +30,13 @@
},
},
{
{
name
:
'toolCode'
,
name
:
'toolCode'
,
label
:
'
工装夹具
sn码'
,
label
:
'
刀模版
sn码'
,
width
:
140
,
width
:
140
,
},
},
{
{
name
:
'toolName'
,
name
:
'toolName'
,
label
:
'
工装夹具
名称'
,
label
:
'
刀模版
名称'
,
width
:
140
,
width
:
140
,
},
},
{
{
...
...
pages/mes/prodReport/index.vue
View file @
1726cfb4
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
.prod-body
{
.prod-body
{
//display: flex;
//display: flex;
height
:
100%
;
height
:
100%
;
//overflow: hidden;
//overflow: hidden;
display
:
grid
;
display
:
grid
;
grid-template-columns
:
1fr
150px
;
grid-template-columns
:
1fr
150px
;
}
}
.prod-body-left
{
.prod-body-left
{
//flex-grow: 1;
//flex-grow: 1;
// padding: 10rpx;
// padding: 10rpx;
overflow
:
hidden
;
overflow
:
hidden
;
.prod-body-left-btns
{
.prod-body-left-btns
{
height
:
80rpx
;
height
:
80rpx
;
.u-btn
{
.u-btn
{
width
:
250rpx
;
width
:
250rpx
;
height
:
60rpx
;
height
:
60rpx
;
line-height
:
60rpx
;
line-height
:
60rpx
;
display
:
inline-block
;
display
:
inline-block
;
margin
:
10rpx
20rpx
;
margin
:
10rpx
20rpx
;
}
}
.workstation
{
.workstation
{
display
:
inline-block
;
display
:
inline-block
;
}
}
}
}
.prod-body-left-task
{
.prod-body-left-task
{
height
:
calc
(
100%
-
80rpx
-
500rpx
);
height
:
calc
(
100%
-
80rpx
-
500rpx
);
border
:
1px
solid
rgb
(
232
,
232
,
232
);
border
:
1px
solid
rgb
(
232
,
232
,
232
);
}
}
.prod-body-left-num
{
.prod-body-left-num
{
height
:
60rpx
;
height
:
60rpx
;
line-height
:
60rpx
;
line-height
:
60rpx
;
padding
:
0
16rpx
;
padding
:
0
16rpx
;
background-color
:
#add8e6
;
background-color
:
#add8e6
;
}
}
.prod-body-left-bom
{
.prod-body-left-bom
{
height
:
500rpx
;
height
:
500rpx
;
.prod-body-left-bom-type
{
.prod-body-left-bom-type
{
width
:
500rpx
;
width
:
500rpx
;
height
:
80rpx
;
height
:
80rpx
;
padding-top
:
10rpx
;
padding-top
:
10rpx
;
.u-subsection
{
.u-subsection
{
border-radius
:
5px
5px
0
0
!
important
;
border-radius
:
5px
5px
0
0
!
important
;
}
}
}
}
.prod-body-left-bom-table
{
.prod-body-left-bom-table
{
height
:
400rpx
;
height
:
400rpx
;
border
:
1px
solid
rgb
(
232
,
232
,
232
);
border
:
1px
solid
rgb
(
232
,
232
,
232
);
}
}
}
}
}
}
.prod-body-right
{
.prod-body-right
{
width
:
300rpx
;
width
:
300rpx
;
padding
:
10rpx
;
padding
:
10rpx
;
overflow
:
auto
;
overflow
:
auto
;
.u-btn
{
.u-btn
{
height
:
100rpx
;
height
:
100rpx
;
line-height
:
100rpx
;
line-height
:
100rpx
;
margin
:
20rpx
10rpx
;
margin
:
20rpx
10rpx
;
font-size
:
40rpx
;
font-size
:
40rpx
;
}
}
}
}
</
style
>
</
style
>
<
template
>
<
template
>
<view
class=
"commonBody"
>
<view
class=
"commonBody"
>
<view
class=
"prod-body"
>
<view
class=
"prod-body"
>
<view
class=
"prod-body-left"
>
<view
class=
"prod-body-left"
>
<!--
<view
class=
"prod-body-left-btns"
>
-->
<!--
<view
class=
"prod-body-left-btns"
>
-->
<!--
<view
class=
"workstation"
>
-->
<!--
<view
class=
"workstation"
>
-->
<!-- 工作站名称:-->
<!-- 工作站名称:-->
<!--
{{
this
.
vuex_workstation
==
null
?
'请选择工作站'
:
this
.
vuex_workstation
.
workstationName
}}
-->
<!--
{{
this
.
vuex_workstation
==
null
?
'请选择工作站'
:
this
.
vuex_workstation
.
workstationName
}}
-->
<!-- <!–
<u-icon
name=
"edit-pen-fill"
size=
"46"
color=
"#2979ff"
></u-icon>
–>
-->
<!-- <!–
<u-icon
name=
"edit-pen-fill"
size=
"46"
color=
"#2979ff"
></u-icon>
–>
-->
<!--
</view>
-->
<!--
</view>
-->
<!--
<u-button
type=
"primary"
@
click=
"changeWorkstation"
>
切换工作站
</u-button>
-->
<!--
<u-button
type=
"primary"
@
click=
"changeWorkstation"
>
切换工作站
</u-button>
-->
<!-- <!–
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
生产任务
</u-button>
–>
-->
<!-- <!–
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
生产任务
</u-button>
–>
-->
<!-- <!–
<u-button
type=
"primary"
@
click=
"commonClick('KnifeTemp')"
>
刀模上架
</u-button>
–>
-->
<!-- <!–
<u-button
type=
"primary"
@
click=
"commonClick('KnifeTemp')"
>
刀模上架
</u-button>
–>
-->
<!-- <!–
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
生产投料
</u-button>
–>
-->
<!-- <!–
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
生产投料
</u-button>
–>
-->
<!--
</view>
-->
<!--
</view>
-->
<view
class=
"prod-body-left-task"
>
<view
class=
"prod-body-left-task"
>
<zb-table
:columns=
"tableColumn"
:stripe=
"true"
@
rowClick=
"rowClic
k"
<zb-table
:columns=
"tableColumn"
:stripe=
"true"
@
rowClick=
"rowClick"
@
numclik=
"numcli
k"
@
numclik =
"numclik
"
@
toggleRowSelection=
"toggleRowSelection"
@
toggleAllSelection=
"toggleAllSelection"
:border=
"true
"
@
toggleRowSelection=
"toggleRowSelection"
@
toggleAllSelection=
"toggleAllSelection"
:border=
"true"
:data=
"tableData"
></zb-table>
:data=
"tableData"
></zb-table
>
</view
>
</view
>
<view
class=
"prod-body-left-num"
>
<view
class=
"prod-body-left-num"
>
总报工订单数:
{{
tableData
.
length
}}
总报工订单数:
{{
tableData
.
length
}}
</view>
</view
>
<view
class=
"prod-body-left-bom"
>
<view
class=
"prod-body-left-bom
"
>
<view
class=
"prod-body-left-bom-type
"
>
<view
class=
"prod-body-left-bom-type"
>
<u-subsection
:list=
"typeList"
:current=
"currentType"
type=
"primary"
font-size=
"28"
<u-subsection
:list=
"typeList"
:current=
"currentType"
type=
"primary"
font-size=
"28"
@
change=
"typeChange"
></u-subsection>
@
change=
"typeChange"
></u-subsection
>
</view
>
</view
>
<view
class=
"prod-body-left-bom-table"
>
<view
class=
"prod-body-left-bom-table"
>
<u-form
>
<u-form
>
<u-row
gutter=
"16"
>
<u-row
gutter=
"16
"
>
<u-col
span=
"3
"
>
<u-col
span=
"3
"
>
<u-form-item
label=
"任务单号"
label-width=
"150
"
>
<u-form-item
label=
"任务单号"
label-width=
"150"
>
{{
curTaskInfo
.
taskCode
}}
{{
curTaskInfo
.
taskCode
}}
</u-form-item>
</u-form-item
>
</u-col
>
</u-col
>
<u-col
span=
"4"
>
<u-col
span=
"4
"
>
<u-form-item
label=
"物料条码"
label-width=
"150
"
>
<u-form-item
label=
"物料条码"
label-width=
"150"
>
<SearchInput
v-model=
"materialRecordInfo.materialBatchNumber"
<SearchInput
v-model=
"materialRecordInfo.materialBatchNumber"
placeholder=
"请输入物料条码"
placeholder=
"请输入物料条码"
hassearchbtn=
"true"
@
inputchange=
"search"
/>
hassearchbtn=
"true"
@
inputchange=
"search"
/
>
</u-form-item
>
</u-form-item
>
</u-col
>
</u-col
>
<u-col
span=
"2"
>
<u-col
span=
"2
"
>
<u-form-item
label=
"数量
"
>
<u-form-item
label=
"数量"
>
<u-number-box
:min=
"0"
v-model=
"materialRecordInfo.quantity"
></u-number-box
>
<u-number-box
:min=
"0"
v-model=
"materialRecordInfo.quantity"
></u-number-box
>
</u-form-item
>
</u-form-item
>
</u-col
>
</u-col
>
<u-col
span=
"1"
>
<u-col
span=
"1"
>
<u-button
type=
"primary"
size=
"mini"
<u-button
type=
"primary"
size=
"mini"
@
click=
"commonClick('MaterialUsageRecord')"
>
添加
</u-button>
@
click=
"commonClick('MaterialUsageRecord')"
>
添加
</u-button>
</u-col>
</u-col>
<!--
<u-col
span=
"1"
>
-->
<!--
<u-col
span=
"1"
>
-->
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
删除
</u-button>
-->
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
删除
</u-button>
-->
<!--
</u-col>
-->
<!--
</u-col>
-->
<u-col
span=
"1"
>
<u-col
span=
"1"
>
<!--
<u-button
type=
"primary"
size=
"mini"
@
click=
"commonClick('')"
>
领料批次
</u-button>
-->
<!--
<u-button
type=
"primary"
size=
"mini"
@
click=
"commonClick('')"
>
领料批次
</u-button>
-->
</u-col>
</u-col>
<u-col
span=
"5"
>
<u-col
span=
"5"
>
</u-col>
</u-col>
</u-row>
</u-row>
</u-form>
</u-form>
<zb-table
:columns=
"bomFeeColumn"
:stripe=
"true"
:border=
"true"
:data=
"materialUsageRecordList"
></zb-table>
<zb-table
:columns=
"bomFeeColumn"
:stripe=
"true"
:border=
"true"
</view
>
:data=
"materialUsageRecordList"
></zb-table
>
</view>
</view>
</view>
</view>
<view
class=
"prod-body-right"
>
</view
>
<view
style=
"text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;"
>
{{
this
.
vuex_workstation
==
null
?
'请选择工作站'
:
this
.
vuex_workstation
.
workstationName
}}
</view
>
<view
class=
"prod-body-right"
>
<u-button
type=
"primary"
@
click=
"changeWorkstation"
>
切换工作站
</u-button
>
<view
style=
"text-align: center;line-height: 80rpx;font-size: 28rpx;font-weight: 600;"
>
<br/>
{{
this
.
vuex_workstation
==
null
?
'请选择工作站'
:
this
.
vuex_workstation
.
workstationName
}}
<u-button
type=
"warning"
@
click=
"commonClick('KnifeTemp')"
>
刀模上架
</u-button
>
</view
>
<u-button
type=
"primary"
@
click=
"commonClick('Refresh')"
>
刷新
</u-button>
<u-button
type=
"primary"
@
click=
"changeWorkstation"
>
切换工作站
</u-button>
<u-button
type=
"success"
@
click=
"commonClick('StartTask')"
>
开始作业
</u-button
>
<br
/
>
<u-button
type=
"warning"
@
click=
"commonClick('StopTask')"
>
暂停作业
</u-button>
<u-button
type=
"warning"
@
click=
"commonClick('KnifeTemp')"
>
刀模版上下机
</u-button>
<u-button
type=
"success"
@
click=
"commonClick('Prod')"
>
生产报工
</u-button>
<u-button
type=
"primary"
@
click=
"commonClick('Refresh')"
>
刷新
</u-button>
<u-button
type=
"primary"
@
click=
"commonClick('FinshTask')"
>
完成
作业
</u-button>
<u-button
type=
"success"
@
click=
"commonClick('StartTask')"
>
开始
作业
</u-button>
<!--
<u-button
type=
"error"
@
click=
"commonClick('')"
>
报告异常
</u-button>
--
>
<u-button
type=
"warning"
@
click=
"commonClick('StopTask')"
>
暂停作业
</u-button
>
<!--
<u-button
type=
"warning"
@
click=
"commonClick('')"
>
检验通知
</u-button>
--
>
<u-button
type=
"success"
@
click=
"commonClick('Prod')"
>
生产报工
</u-button
>
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
属性收集
</u-button>
--
>
<u-button
type=
"primary"
@
click=
"commonClick('FinshTask')"
>
完成作业
</u-button
>
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
反扣冲减
</u-button>
-->
<!--
<u-button
type=
"error"
@
click=
"commonClick('')"
>
报告异常
</u-button>
-->
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
查看图纸
</u-button>
-->
<!--
<u-button
type=
"warning"
@
click=
"commonClick('')"
>
检验通知
</u-button>
-->
<!--
<u-button
type=
"warning"
@
click=
"commonClick('')"
>
完成全部
</u-button>
-->
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
属性收集
</u-button>
-->
</view
>
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
反扣冲减
</u-button>
--
>
</view
>
<!--
<u-button
type=
"primary"
@
click=
"commonClick('')"
>
查看图纸
</u-button>
--
>
<!--
<u-button
type=
"warning"
@
click=
"commonClick('')"
>
完成全部
</u-button>
-->
<u-modal
:title=
"title"
@
confirm=
"feedback()"
show-cancel-button
</view>
:title-style=
"
{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
</view>
v-model="open" width="1800rpx">
<view
class=
"feedback-card"
v-for=
"feedback in feedbackForms"
>
<u-modal
:title=
"title"
@
confirm=
"feedback()"
show-cancel-button
<u-form
label-width=
"100px"
:model=
"feedback"
:rules=
"rules"
>
:title-style=
"
{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
<u-row
>
v-model="open" width="1800rpx"
>
<u-col
span=
"6
"
>
<view
class=
"feedback-card"
v-for=
"feedback in feedbackForms
"
>
<u-form-item
label=
"任务单号"
prop=
"quantity
"
>
<u-form
label-width=
"100px"
:model=
"feedback"
:rules=
"rules
"
>
{{
feedback
.
taskCode
}}
<u-row>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"任务单号"
prop=
"quantity"
>
<u-col
span=
"6"
>
{{
feedback
.
taskCode
}}
<u-form-item
label=
"工序"
prop=
"nickName"
>
</u-form-item
>
{{
feedback
.
processName
}}
</u-col>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"工序"
prop=
"nickName"
>
</u-row>
{{
feedback
.
processName
}}
<u-row
>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"报工总数量"
prop=
"quantity"
>
</u-row
>
{{
feedback
.
quantityQuanlify
+
feedback
.
quantityUnquanlify
}}
<u-row>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"报工总数量"
prop=
"quantity"
>
<u-col
span=
"6"
>
{{
feedback
.
quantityQuanlify
+
feedback
.
quantityUnquanlify
}}
<u-form-item
label=
"报工人"
prop=
"nickName"
>
</u-form-item
>
<u-input
v-model=
"feedback.nickName"
></u-input
>
</u-col
>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"报工人"
prop=
"nickName"
>
</u-row
>
<u-input
v-model=
"feedback.nickName"
></u-input
>
<u-row
>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"合格品数量"
prop=
"quantityQualify"
>
</u-row
>
<u-number-box
:min=
"0"
@
change=
"quantityChanged"
<u-row>
v-model=
"feedback.quantityQualify"
></u-number-box
>
<u-col
span=
"6"
>
</u-form-item
>
<u-form-item
label=
"合格品数量"
prop=
"quantityQualify"
>
</u-col>
<u-number-box
:min=
"0"
@
change=
"quantityChanged"
<u-col
span=
"6"
>
v-model=
"feedback.quantityQualify"
></u-number-box
>
<u-form-item
label=
"不良品数量"
prop=
"quantityUnqualify"
>
</u-form-item
>
<u-number-box
:min=
"0"
@
change=
"quantityChanged"
</u-col>
v-model=
"feedback.quantityUnqualify"
></u-number-box
>
<u-col
span=
"6"
>
</u-form-item
>
<u-form-item
label=
"不良品数量"
prop=
"quantityUnqualify"
>
</u-col>
<u-number-box
:min=
"0"
@
change=
"quantityChanged"
</u-row
>
v-model=
"feedback.quantityUnqualify"
></u-number-box
>
</u-for
m>
</u-form-ite
m>
</view
>
</u-col
>
</u-modal
>
</u-row
>
</u-form>
</view>
<u-modal
title=
"刀模版上架"
@
confirm=
"knifeTemp()"
show-cancel-button
</u-modal>
: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-modal
title=
"刀模版上下机"
@
confirm=
"knifeTemp()"
show-cancel-button
<u-row>
:title-style=
"
{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
<u-col
span=
"6
"
>
v-model="knifeTempVisible" width="1300rpx
">
<u-form-item
label=
"扫描刃模版条码"
prop=
"quantity
"
>
<u-form
label-width=
"130px"
:model=
"knifeTempSearch"
:rules=
"rules
"
>
<u-input
v-model=
"knifeTempSearch.knifeTempCode"
></u-input
>
<u-row
>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"扫描刃模版条码"
prop=
"quantity"
>
<u-col
span=
"6"
>
<u-input
v-model=
"knifeTempSearch.knifeTempCode"
></u-input
>
<u-form-item
label=
"扫描库位条码"
prop=
"nickName"
>
</u-form-item
>
<u-input
v-model=
"knifeTempSearch.locationCode"
></u-input
>
</u-col
>
</u-form-item
>
<u-col
span=
"6"
>
</u-col
>
<u-form-item
label=
"扫描库位条码"
prop=
"nickName"
>
</u-row
>
<u-input
v-model=
"knifeTempSearch.locationCode"
></u-input
>
</u-for
m>
</u-form-ite
m>
<dModelList
:data=
"dModelData"
@
action=
"upDownGetList"
/
>
</u-col
>
</u-row>
</u-modal
>
</u-form
>
<dModelList
:data=
"dModelData"
@
action=
"upDownGetList"
/>
<u-modal
title=
"暂停原因"
@
confirm=
"stopReasonSubmit()"
show-cancel-button
</u-modal>
: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-modal
title=
"暂停原因"
@
confirm=
"stopReasonSubmit()"
show-cancel-button
<u-form-item
label=
"故障类型"
prop=
"quantity"
>
:title-style=
"
{'background-color':'#1E3770','color': '#FFFFFF' ,'line-height': '37px','padding-top': '0px'}"
<uni-data-select
v-model="stopReasonVisible" width="1300rpx">
:localdata=
"stopReasonList"
<u-form
label-width=
"100px"
:model=
"feedback"
:rules=
"rules"
>
@
change=
"stopReasonChange"
<u-form-item
label=
"故障类型"
prop=
"quantity"
>
></uni-data-select>
<uni-data-select
:localdata=
"stopReasonList"
@
change=
"stopReasonChange"
></uni-data-select>
</u-form-item>
</u-form-item>
<u-form-item
label=
"故障原因"
prop=
"nickName"
>
<u-form-item
label=
"故障原因"
prop=
"nickName"
>
<u-input
type=
"textarea"
height=
"150"
:border=
"true"
v-model=
"stopReason"
></u-input>
<u-input
type=
"textarea"
height=
"150"
:border=
"true"
v-model=
"stopReason"
></u-input>
</u-form-item>
</u-form-item>
</u-form>
</u-form>
</u-modal>
</u-modal>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
SearchInput
from
"@/components/ScanInput/index.vue"
;
import
SearchInput
from
"@/components/ScanInput/index.vue"
;
import
dModelList
from
'./components/dModelList.vue'
import
dModelList
from
'./components/dModelList.vue'
export
default
{
export
default
{
name
:
"ProdReport"
,
name
:
"ProdReport"
,
components
:
{
SearchInput
,
dModelList
},
components
:
{
data
()
{
SearchInput
,
return
{
dModelList
screenHeight
:
768
,
},
title
:
'生产报工'
,
data
()
{
open
:
false
,
return
{
form
:
{},
screenHeight
:
768
,
feedbackForm
:
{},
title
:
'生产报工'
,
tableData
:
[],
open
:
false
,
knifeTempVisible
:
false
,
form
:
{},
knifeTempSearch
:
{
feedbackForm
:
{},
knifeTempCode
:
''
,
tableData
:
[],
locationCode
:
''
knifeTempVisible
:
false
,
},
knifeTempSearch
:
{
knifeTempInfo
:
{
knifeTempCode
:
''
,
knifeTemplateCode
:
''
,
locationCode
:
''
knifeTemplateName
:
''
,
},
knifeTemplateSpec
:
''
,
knifeTempInfo
:
{
locationCode
:
''
,
knifeTemplateCode
:
''
,
locationName
:
''
,
knifeTemplateName
:
''
,
locationType
:
''
,
knifeTemplateSpec
:
''
,
locationTypeCode
:
''
,
locationCode
:
''
,
locationTypeDesc
:
''
,
locationName
:
''
,
locationTypeDescCode
:
''
,
locationType
:
''
,
locationTypeDescName
:
''
,
locationTypeCode
:
''
,
locationTypeDescNameCode
:
''
,
locationTypeDesc
:
''
,
locationTypeDescNameCode2
:
''
locationTypeDescCode
:
''
,
},
locationTypeDescName
:
''
,
stopReasonList
:
[
locationTypeDescNameCode
:
''
,
{
value
:
'中午休息吃饭。'
,
text
:
"休息吃饭"
},
locationTypeDescNameCode2
:
''
{
value
:
'刀头模具到期更换,更换期间。'
,
text
:
"刀头模具到期更换"
},
},
{
value
:
'没料了,正在领料'
,
text
:
"领料加仓"
}
stopReasonList
:
[{
],
value
:
'中午休息吃饭。'
,
stopReason
:
''
,
text
:
"休息吃饭"
stopReasonVisible
:
false
,
},
rules
:
{
{
quantity
:
[{
value
:
'刀头模具到期更换,更换期间。'
,
required
:
true
,
text
:
"刀头模具到期更换"
message
:
"请输入合格品数量或者不良品数量!"
,
},
trigger
:
"blur"
{
}]
value
:
'没料了,正在领料'
,
},
text
:
"领料加仓"
typeList
:
[
}
{
],
name
:
'物料扣减'
stopReason
:
''
,
},
stopReasonVisible
:
false
,
{
rules
:
{
name
:
'BOM外扣减'
quantity
:
[{
}
required
:
true
,
],
message
:
"请输入合格品数量或者不良品数量!"
,
materialRecordInfo
:
{
trigger
:
"blur"
taskCode
:
''
,
}]
materialBatchNumber
:
''
,
},
quantity
:
0
,
typeList
:
[{
operatorTime
:
''
,
name
:
'物料扣减'
depletionMethod
:
1
},
},
{
curTaskInfo
:
{},
name
:
'BOM外扣减'
currentType
:
0
,
}
bomFeeData
:
[],
],
bomFeeColumn
:
[
materialRecordInfo
:
{
{
taskCode
:
''
,
type
:
'selection'
,
materialBatchNumber
:
''
,
width
:
35
quantity
:
0
,
},
operatorTime
:
''
,
{
depletionMethod
:
1
name
:
'taskCode'
,
},
label
:
'物料批次'
,
curTaskInfo
:
{},
align
:
"center"
,
currentType
:
0
,
width
:
150
bomFeeData
:
[],
},
bomFeeColumn
:
[{
{
type
:
'selection'
,
name
:
'status'
,
width
:
35
label
:
'ERP物料批次'
,
},
align
:
"center"
,
{
width
:
150
name
:
'taskCode'
,
},
label
:
'物料批次'
,
{
align
:
"center"
,
name
:
'materialBatchNumber'
,
width
:
150
label
:
'物料编码'
,
},
width
:
150
{
},
name
:
'status'
,
{
label
:
'ERP物料批次'
,
name
:
'taskCode'
,
align
:
"center"
,
label
:
'序列号'
,
width
:
150
width
:
150
},
},
{
{
name
:
'materialBatchNumber'
,
name
:
'quantity'
,
label
:
'物料编码'
,
label
:
'数量'
,
width
:
150
width
:
150
},
},
{
{
name
:
'taskCode'
,
name
:
'itemCode'
,
label
:
'序列号'
,
label
:
'物料描述'
,
width
:
150
}
},
],
{
tableColumn
:
[
name
:
'quantity'
,
{
label
:
'数量'
,
type
:
'selection'
,
width
:
150
width
:
35
},
},
{
{
name
:
'itemCode'
,
name
:
'arrangeCode'
,
label
:
'物料描述'
,
label
:
'编排单号'
,
}
width
:
140
,
],
func
:
"numclik"
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
}
},
},
{
created
()
{
name
:
'startTime'
,
//获取屏幕高度
label
:
'计划开始时间'
,
uni
.
getSystemInfo
({
width
:
140
,
success
(
res
)
{
func
:
"numclik"
this
.
screenHeight
=
res
.
windowHeight
;
},
}
{
})
name
:
'endTime'
,
//监听工作站切换事件
label
:
'计划结束时间'
,
uni
.
$on
(
'switchWorkstation'
,
(
station
)
=>
{
width
:
140
,
// 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
()
{
name
:
'quantity'
,
uni
.
$off
(
'switchWorkstation'
);
label
:
'待加工数量'
,
uni
.
$off
(
'taskStatusChanged'
);
width
:
140
,
},
},
{
methods
:
{
name
:
'status'
,
numclik
(...
arg
)
{
label
:
'状态'
,
console
.
log
(
'99999999'
,
arg
)
filters
:
{
},
// 'START': '生产中',
changeWorkstation
()
{
// 'PAUSE': '暂停',
uni
.
$emit
(
'changeWorkstation'
);
// 'NORMARL': '未开始'
},
'PREPARE'
:
'未开工'
,
commonClick
(
oper
)
{
'BEGINNING'
:
'已开工'
,
if
([
'Refresh'
,
'MaterialUsageRecord'
].
indexOf
(
oper
)
===
-
1
&&
this
.
tableSelectData
.
length
===
0
)
{
'PAUSE'
:
'暂停'
,
this
.
$u
.
toast
(
'请选择工作任务!'
);
'ERROR_STOP'
:
'异常停工'
,
return
'FINISH'
:
'完工'
}
},
switch
(
oper
)
{
width
:
60
,
case
'Refresh'
:
align
:
"center"
this
.
getTaskList
();
},
break
;
// {
case
'StartTask'
:
// name: 'date',
this
.
tableSelectData
.
forEach
((
item
)
=>
{
// label: '批号',
this
.
changeStatus
(
item
.
taskId
,
'START'
)
// width: 50,
})
// },
this
.
getTaskList
()
{
break
;
name
:
'taskCode'
,
case
'StopTask'
:
label
:
'任务单号'
,
this
.
stopReason
=
''
width
:
110
,
this
.
stopReasonVisible
=
true
},
{
break
;
name
:
'workorderCode'
,
case
'FinshTask'
:
label
:
'生产单号'
,
this
.
tableSelectData
.
forEach
((
item
)
=>
{
width
:
120
,
this
.
changeStatus
(
item
.
taskId
,
'FINISHED'
)
},
})
// {
this
.
getTaskList
()
// name: 'itemCode',
break
;
// label: '物料编号',
case
'Prod'
:
// width: 110,
this
.
doFeedback
()
// },
break
;
// {
case
'MaterialUsageRecord'
:
// name: 'itemName',
this
.
addMaterialUsageRecord
()
// label: '物料名称'
break
;
// },
case
'KnifeTemp'
:
{
this
.
knifeTempShow
()
name
:
'processName'
,
break
;
label
:
'工序'
,
default
:
width
:
60
,
this
.
$u
.
toast
(
'功能正在开发中!'
);
},
break
{
}
name
:
'quantity'
,
},
label
:
'数量'
,
async
knifeTempShow
()
{
width
:
60
,
if
(
this
.
tableSelectData
.
length
>
1
)
{
align
:
"center"
return
},
}
{
const
params
=
{
name
:
'quantityQuanlify'
,
arrangeCode
:
this
.
tableSelectData
[
0
].
arrangeCode
||
''
,
label
:
'合格数量'
,
processId
:
this
.
tableSelectData
[
0
].
processId
width
:
60
,
}
align
:
"center"
const
records
=
await
this
.
$u
.
api
.
dModel
.
getRecordsByProcessIdAndArrangeCode
(
params
)
},
// 如果有数据
{
if
(
records
?.
data
&&
records
.
data
.
length
)
{
name
:
'quantityUnquanlify'
,
this
.
dModelData
=
records
.
data
label
:
'不合格数量'
,
this
.
knifeTempVisible
=
true
width
:
60
,
return
align
:
"center"
}
},
this
.
addDModelRecord
(
params
)
{
name
:
'clientName'
,
},
label
:
'作业人员'
,
async
upDownGetList
()
{
width
:
60
,
const
params
=
{
align
:
"center"
arrangeCode
:
this
.
tableSelectData
[
0
].
arrangeCode
||
''
,
},
processId
:
this
.
tableSelectData
[
0
].
processId
],
}
dModelData
:
[],
const
records
=
await
this
.
$u
.
api
.
dModel
.
getRecordsByProcessIdAndArrangeCode
(
params
)
tableSelectData
:
[],
this
.
dModelData
=
records
.
data
feedbackForms
:
[],
},
materialUsageRecordList
:
[],
// 新增刀模版上下机记录
materialusagerecordLoading
:
false
async
addDModelRecord
(
params
)
{
}
const
{
},
data
created
()
{
}
=
await
this
.
$u
.
api
.
dModel
.
getToolsByProcessIdAndArrangeCode
(
params
)
//获取屏幕高度
if
(
data
?.
length
)
{
uni
.
getSystemInfo
({
const
[
selectData
]
=
this
.
tableSelectData
success
(
res
)
{
const
ps
=
{
this
.
screenHeight
=
res
.
windowHeight
;
toolMachinesCode
:
''
,
}
arrangeCode
:
selectData
.
arrangeCode
,
})
workunitId
:
selectData
.
workunitId
,
//监听工作站切换事件
processId
:
selectData
.
processId
,
uni
.
$on
(
'switchWorkstation'
,
(
station
)
=>
{
workorderId
:
selectData
.
workorderId
,
// this.reset();
toolRequestUseId
:
data
[
0
].
toolRequestUseId
,
this
.
getTaskList
();
toolMachinesRecordList
:
data
.
map
(
v
=>
{
})
return
{
toolRequestUseItemId
:
v
.
toolRequestUseItemId
,
uni
.
$on
(
'taskStatusChanged'
,
()
=>
{
type
:
3
,
this
.
getTaskList
();
//刷新任务状态
upDate
:
''
,
})
downDate
:
''
}
if
(
this
.
vuex_workstation
!=
null
)
{
})
this
.
getTaskList
();
}
}
// 新增
// if (this.vuex_task != null) {
const
data2
=
await
this
.
$u
.
api
.
dModel
.
tmToolMachines
(
ps
)
// this.shiftTask(this.vuex_task.taskId);
if
(
data2
.
code
==
200
)
{
// }
const
records
=
await
this
.
$u
.
api
.
dModel
.
getRecordsByProcessIdAndArrangeCode
(
params
)
},
this
.
dModelData
=
records
.
data
||
[]
destroyed
()
{
this
.
knifeTempVisible
=
true
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
:
''
}
}
}
},
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
()
// 新增
},
const
data2
=
await
this
.
$u
.
api
.
dModel
.
tmToolMachines
(
ps
)
stopReasonChange
(
e
)
{
if
(
data2
.
code
==
200
)
{
this
.
stopReason
+=
e
;
const
records
=
await
this
.
$u
.
api
.
dModel
.
getRecordsByProcessIdAndArrangeCode
(
params
)
},
this
.
dModelData
=
records
.
data
||
[]
getTaskList
()
{
this
.
knifeTempVisible
=
true
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
>
</
script
>
<
style
>
<
style
>
.commonBody
{
.commonBody
{
width
:
100%
;
width
:
100%
;
height
:
100%
;
height
:
100%
;
background-color
:
#FEFEFF
;
background-color
:
#FEFEFF
;
margin
:
0
0
;
margin
:
0
0
;
padding
:
0
0
;
padding
:
0
0
;
}
}
.content
{
.content
{
margin
:
10px
;
margin
:
10px
;
display
:
flex
;
display
:
flex
;
}
}
.content_left
{
.content_left
{
width
:
40%
;
width
:
40%
;
}
}
.task_card
{
.task_card
{
width
:
90%
;
width
:
90%
;
margin
:
5px
;
margin
:
5px
;
}
}
.uRow
{
.uRow
{
margin-top
:
5px
;
margin-top
:
5px
;
margin-bottom
:
5px
;
margin-bottom
:
5px
;
}
}
.content_right
{
.content_right
{
width
:
60%
;
width
:
60%
;
padding
:
10px
;
padding
:
10px
;
}
}
.feedback-card
{
.feedback-card
{
margin
:
25
rpx
;
margin
:
25
rpx
;
padding
:
18
rpx
;
padding
:
18
rpx
;
box-sizing
:
border-box
;
box-sizing
:
border-box
;
position
:
relative
;
position
:
relative
;
background
:
#ffffff
;
background
:
#ffffff
;
border-radius
:
8px
;
border-radius
:
8px
;
cursor
:
pointer
;
cursor
:
pointer
;
transition
:
box-shadow
0.2s
,
border-color
0.2s
;
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
);
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
{
::v-deep
.u-form-item
{
padding
:
0px
;
padding
:
0px
;
}
}
</
style
>
</
style
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment