Commit 8c6f39cb authored by 沈翠玲's avatar 沈翠玲

不合格数量和报工人员扫码

parent e2fe0e76
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
<view class="dmodel-table"> <view class="dmodel-table">
<view class="search"> <view class="search">
<u-form :model="tableParams" labelAlign="right" class="tableForm"> <u-form :model="tableParams" labelAlign="right" class="tableForm">
<u-form-item :label="$t('工号')" label-width="60px" name="userName"> <u-form-item :label="$t('不合格原因')" label-width="100px" name="abnormalReason">
<uni-easyinput type="text" v-model="tableParams.userName" :placeholder="$t('请输入编号')" /> <uni-easyinput type="text" v-model="tableParams.abnormalReason" />
</u-form-item>
<u-form-item :label="$t('姓名')" label-width="60px" name="nickName">
<uni-easyinput type="text" v-model="tableParams.nickName" :placeholder="$t('请输入名称')" />
</u-form-item> </u-form-item>
<u-form-item> <u-form-item>
<u-button class="btn" @click="handleClick" type="primary" size="medium">{{$t('搜索')}}</u-button> <u-button class="btn" @click="handleClick" type="primary" size="medium">{{$t('搜索')}}</u-button>
...@@ -14,7 +11,7 @@ ...@@ -14,7 +11,7 @@
</u-form> </u-form>
</view> </view>
<view> <view>
<zb-table ref="zbTable" rowKey="userName" :columns="tableColumn" :data="tableData" :stripe="true" @toggleRowSelection="toggleRowSelection"></zb-table> <zb-table ref="zbTable" rowKey="abnormalId" :columns="tableColumn" :data="tableData" :stripe="true" @toggleRowSelection="toggleRowSelection"></zb-table>
</view> </view>
<view class="uni-pagination-box"><uni-pagination show-icon :page-size="params.pageSize" :current="params.pageNum" :total="total" @change="change" /></view> <view class="uni-pagination-box"><uni-pagination show-icon :page-size="params.pageSize" :current="params.pageNum" :total="total" @change="change" /></view>
</view> </view>
...@@ -25,44 +22,33 @@ ...@@ -25,44 +22,33 @@
export default { export default {
props: { props: {
data: {
type: Object,
default: () => {}
}
}, },
data() { data() {
return { return {
params: { params: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
workunitId: this.data?.workunitId || null abnormalType: "UNQUALIFIED_REASON"
}, },
total: 0, total: 0,
tableParams: { tableParams: {
nickName: null, abnormalReason: null
userName: null
}, },
tableData: [], tableData: [],
tableSelectData: [], tableSelectData: [],
tableColumn: [ tableColumn: [
{ {
type: 'selection', type: 'radio',
width: 40 width: 40
}, },
{ {
name: 'userName', name: 'abnormalReason',
label: i18n.t('工号'), label: i18n.t('不合格原因'),
width: 160 width: 160
}, },
{ {
name: 'nickName', name: 'remark',
label: i18n.t('姓名'), label: i18n.t('备注'),
width: 200
},
{
name: 'workunitName',
label: i18n.t('工作单元'),
width: 160 width: 160
} }
] ]
...@@ -79,29 +65,18 @@ ...@@ -79,29 +65,18 @@
}, },
methods: { methods: {
handleClick() { handleClick() {
if (this.tableParams.userName) { if (this.tableParams.abnormalReason) {
this.params.userName = this.tableParams.userName; this.params.abnormalReason = this.tableParams.abnormalReason;
} else { } else {
delete this.params.userName delete this.params.abnormalReason
}
if (this.tableParams.nickName) {
this.params.nickName = this.tableParams.nickName;
} else {
delete this.params.nickName
} }
this.params.pageNum = 1; this.params.pageNum = 1;
this.getList(); this.getList();
}, },
async getList() { async getList() {
const res = await this.$u.api.userQuery(this.params); const res = await this.$u.api.abnormal.detail(this.params);
console.log(res, 'res');
if (res.code == 200) { if (res.code == 200) {
this.tableData = res.rows.map((item) => { this.tableData = res.rows
return {
...item,
workunitName: this.data?.workunitName || null
};
});
this.total = res.total; this.total = res.total;
} }
}, },
......
...@@ -283,7 +283,6 @@ ...@@ -283,7 +283,6 @@
> >
<u-number-box <u-number-box
:min="0" :min="0"
@change="quantityChanged()"
:max="getFeedbackMax(feedback)" :max="getFeedbackMax(feedback)"
:input-width="190" :input-width="190"
v-model="feedback.quantityQualify" v-model="feedback.quantityQualify"
...@@ -298,8 +297,7 @@ ...@@ -298,8 +297,7 @@
> >
<u-number-box <u-number-box
:min="0" :min="0"
@change="quantityChanged()" :max="getquantityQualifyMax(feedback)"
:max="99999999999999999999999999999999999999999"
:input-width="190" :input-width="190"
v-model="feedback.quantityUnqualify" v-model="feedback.quantityUnqualify"
:long-press="false" :long-press="false"
...@@ -318,14 +316,15 @@ ...@@ -318,14 +316,15 @@
</u-form-item> </u-form-item>
</u-col> </u-col>
<u-col span="6"> <u-col span="6">
<u-form-item :label="$t('不合格原因:')" prop="abnormalType"> <u-form-item :label="$t('不合格原因:')" prop="abnormalReason">
<u-input v-model="feedback.abnormalType" disabled></u-input> <u-input v-model="feedback.abnormalReason" disabled></u-input>
<u-button <u-button
@tap="chooseReason(feedback)" @tap="chooseReason(feedback)"
type="success" type="success"
size="mini" size="mini"
>{{ $t('选择原因') }}</u-button >{{ $t('选择原因') }}</u-button
> >
</u-form-item>
</u-col> </u-col>
<u-col :span="6"> <u-col :span="6">
<u-form-item :label="$t('报工人:')" prop="nickName"> <u-form-item :label="$t('报工人:')" prop="nickName">
...@@ -349,25 +348,6 @@ ...@@ -349,25 +348,6 @@
</u-form-item> </u-form-item>
</u-col> </u-col>
</u-row> </u-row>
<!-- <u-row> -->
<!-- <u-col span="3" width: max-content>
<u-button class="auto-size-button" type="default" @tap="changeShow()">隐藏</u-button>
</u-col>
<view class="box" v-if="timeTest.isshow">
<u-col span="6">
<u-form-item label="合格数量(副):" prop="feedbackQuantityFu">
<uni-number-box :min="0" @change="quantityChangedV2(feedback, feedbackQuantityFu)"
v-model="feedbackQuantityFu"></uni-number-box>
</u-form-item>
</u-col>
<u-col span="6">
<u-form-item label="不良品数量(副):" prop="feedbackUnQuantityFu">
<uni-number-box :min="0" @change="quantityChangedV2(feedback, feedbackUnQuantityFu)"
v-model="feedbackUnQuantityFu"></uni-number-box>
</u-form-item>
</u-col>
</view> -->
</u-form> </u-form>
</view> </view>
</view> </view>
...@@ -442,7 +422,7 @@ ...@@ -442,7 +422,7 @@
:title="$t('不合格原因')" :title="$t('不合格原因')"
:cancelText="$t('取消')" :cancelText="$t('取消')"
:confirmText="$t('确认')" :confirmText="$t('确认')"
@confirm="userDetermine()" @confirm="abnormalReasonDetermine()"
show-cancel-button show-cancel-button
:title-style="{ :title-style="{
'background-color': '#1E3770', 'background-color': '#1E3770',
...@@ -454,10 +434,9 @@ ...@@ -454,10 +434,9 @@
width="1300rpx" width="1300rpx"
> >
<view> <view>
<userPersonnel <abnormalReason
ref="userPersonnelRef" ref="abnormalReasonRef"
v-if="abnormalReasonVisible" v-if="abnormalReasonVisible"
:data="usePersonData"
/> />
</view> </view>
</u-modal> </u-modal>
...@@ -714,6 +693,7 @@ import config from '@/common/config.js' ...@@ -714,6 +693,7 @@ import config from '@/common/config.js'
import SearchInput from '@/components/ScanInput/index.vue' import SearchInput from '@/components/ScanInput/index.vue'
import User from '@/components/User/User.vue' import User from '@/components/User/User.vue'
import abnormalReason from './components/abnormalReason.vue'
import userPersonnel from './components/userPersonnel.vue' import userPersonnel from './components/userPersonnel.vue'
import printTemplate from './components/printTemplate.vue' import printTemplate from './components/printTemplate.vue'
import editFeeding from './components/editFeeding.vue' import editFeeding from './components/editFeeding.vue'
...@@ -730,6 +710,7 @@ export default { ...@@ -730,6 +710,7 @@ export default {
mixins: [cameraAuthMixin], mixins: [cameraAuthMixin],
components: { components: {
SearchInput, SearchInput,
abnormalReason,
editFeeding, editFeeding,
userPersonnel, userPersonnel,
printTemplate, printTemplate,
...@@ -894,6 +875,7 @@ export default { ...@@ -894,6 +875,7 @@ export default {
reason: null, reason: null,
desc: null, desc: null,
}, },
abnormalReasonVisible: false,
screenHeight: 768, screenHeight: 768,
usePersonData: {}, usePersonData: {},
title: i18n.t('生产报工'), title: i18n.t('生产报工'),
...@@ -1650,10 +1632,18 @@ export default { ...@@ -1650,10 +1632,18 @@ export default {
} else if (this.isWaiXie || feedback.surpassState){ } else if (this.isWaiXie || feedback.surpassState){
return 9999999999999999999999999999999999999999 return 9999999999999999999999999999999999999999
} else if(!feedback.surpassState) { } else if(!feedback.surpassState) {
return feedback.workorderUnfeedbackSum return feedback.workorderUnfeedbackSum - feedback.quantityUnqualify
}
},
getquantityQualifyMax(feedback){
if (feedback.isSerialReport && Number(feedback.isSerialReport) === 1 && !this.isWaiXie) {
return 1
} else if (this.isWaiXie || feedback.surpassState){
return 9999999999999999999999999999999999999999
} else if(!feedback.surpassState) {
return feedback.workorderUnfeedbackSum - feedback.quantityQualify
} }
}, },
changeWorkstation() { changeWorkstation() {
uni.$emit('changeWorkunit') uni.$emit('changeWorkunit')
}, },
...@@ -1941,6 +1931,15 @@ export default { ...@@ -1941,6 +1931,15 @@ export default {
knifeTemp() { knifeTemp() {
// this.$u.toast('刀具校验通过!'); // this.$u.toast('刀具校验通过!');
}, },
abnormalReasonDetermine (){
const tableSelectData = JSON.parse(
JSON.stringify(this.$refs.abnormalReasonRef.tableSelectData)
)
this.feedbackForms[0].abnormalId = tableSelectData[0].abnormalId
this.feedbackForms[0].abnormalReason = tableSelectData[0].abnormalReason
this.feedbackForms[0].abnormalType = tableSelectData[0].abnormalType
this.feedbackForms[0].abnormalRemark = tableSelectData[0].remark
},
userDetermine() { userDetermine() {
let nick = '' let nick = ''
let user = '' let user = ''
...@@ -2222,39 +2221,12 @@ export default { ...@@ -2222,39 +2221,12 @@ export default {
} }
}) })
}, },
quantityChanged(val) {
this.feedbackForm.quantity =
this.feedbackForm.quantityQualify + this.feedbackForm.quantityUnqualify
},
changeShow() { changeShow() {
console.log(this.timeTest.isshow) console.log(this.timeTest.isshow)
this.timeTest.isshow = !this.timeTest.isshow this.timeTest.isshow = !this.timeTest.isshow
}, },
quantityChangedV2(feedback, val1, val2) {
let qq = val1 === 0 || val1 === null ? 0 : val1
let quq = val2 === 0 || val2 === null ? 0 : val2
if (qq > 0) {
feedback.quantityQualify = qq / (feedback.unitOfConvert || 1)
}
if (quq > 0) {
feedback.quantityUnqualify = quq / (feedback.unitOfConvert || 1)
}
feedback.quantityUnqualify =
isNaN(feedback.quantityUnqualify) || feedback.quantityUnqualify === null
? 0
: feedback.quantityUnqualify
feedback.quantityQualify =
isNaN(feedback.quantityQualify) || feedback.quantityQualify === null
? 0
: feedback.quantityQualify
feedback.quantity = feedback.quantityUnqualify + feedback.quantityQualify
},
getPrintTemplate(row) { getPrintTemplate(row) {
this.printTemplateData = row this.printTemplateData = row
this.printTemplateVisible = true this.printTemplateVisible = true
...@@ -2322,6 +2294,10 @@ export default { ...@@ -2322,6 +2294,10 @@ export default {
feedbackTime: this.parseTime(new Date()), feedbackTime: this.parseTime(new Date()),
whether: '', whether: '',
closeType: null, closeType: null,
abnormalId: null,
abnormalReason: null,
abnormalType: null,
abnormalRemark: null,
printTemplate: '', printTemplate: '',
tableSizeData: [], tableSizeData: [],
decompressionValue: '', decompressionValue: '',
...@@ -2790,6 +2766,13 @@ export default { ...@@ -2790,6 +2766,13 @@ export default {
if (!item.nickName) { if (!item.nickName) {
this.$u.toast(i18n.t('报工人不能为空')) this.$u.toast(i18n.t('报工人不能为空'))
this.proVisible = true this.proVisible = true
this.$refs.uModal.clearLoading()
return
}
if(item.quantityUnqualify && Number(item.quantityUnqualify) > 0 && !item.abnormalReason) {
this.$u.toast(i18n.t('不合格原因不能为空'))
this.proVisible = true
this.$refs.uModal.clearLoading()
return return
} }
...@@ -2830,6 +2813,10 @@ export default { ...@@ -2830,6 +2813,10 @@ export default {
itemName: item.processName, itemName: item.processName,
workstationId: item.workstationId, workstationId: item.workstationId,
workstationCode: item.workstationCode, workstationCode: item.workstationCode,
abnormalId: item.abnormalId,
abnormalReason: item.abnormalReason,
abnormalType: item.abnormalType,
abnormalRemark: item.abnormalRemark,
workorderId: item.workorderId, workorderId: item.workorderId,
workorderCode: item.workorderCode, workorderCode: item.workorderCode,
workstationName: item.workstationName, workstationName: item.workstationName,
...@@ -2861,6 +2848,10 @@ export default { ...@@ -2861,6 +2848,10 @@ export default {
itemId: item.itemId, itemId: item.itemId,
itemCode: item.itemCode, itemCode: item.itemCode,
itemName: item.itemName, itemName: item.itemName,
abnormalId: item.abnormalId,
abnormalReason: item.abnormalReason,
abnormalType: item.abnormalType,
abnormalRemark: item.abnormalRemark,
workstationId: item.workstationId, workstationId: item.workstationId,
workstationCode: item.workstationCode, workstationCode: item.workstationCode,
workorderId: item.workorderId, workorderId: item.workorderId,
......
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