<template>
|
<view>
|
<page-nav title="生产报工"></page-nav>
|
|
|
<view v-show="topContent.length===0">
|
<div class="sacnBody">
|
<div class="scanImg" @click="topScanClick"></div>
|
<div class="scanText">请扫描任务条码</div>
|
</div>
|
</view>
|
|
<view v-show="topContent.length!==0">
|
<view class="mainContent" :style="{maxHeight:'1200rpx',overflow: 'scroll'}">
|
|
<!-- 报工信息 -->
|
<u-gap height="15" bgColor="#eff0f1"></u-gap>
|
<view class="head" style="padding-bottom: 10rpx;">
|
<view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title">
|
报工信息
|
</view>
|
</view>
|
|
</view>
|
<view class="marginTop20 marginLeft20 marginRight20 flex_between">
|
<u-radio-group class="flex_column">
|
|
<view class="marginBottom20 " v-for="(item,index) in topContent" :key="item.wo_code">
|
|
<view class="flex_between">
|
<view style="display: flex;">
|
<view class="flex_column titleFont">
|
<view>工单编号:</view>
|
<view>产品编码:</view>
|
<view>产品名称:</view>
|
<view>产品规格:</view>
|
<view>当前工序:</view>
|
<view>任务数量:</view>
|
<view>未报/已报:</view>
|
<view>下道工序:</view>
|
</view>
|
<view class="flex_column contentFont">
|
<view>{{item.wo_code}}</view>
|
<view>{{item.partnumber}}</view>
|
<view>{{item.partname}}</view>
|
<view>{{item.partspec.toString().length===0?'/':item.partspec}}</view>
|
<view>{{item.stepname}}</view>
|
<view>{{item.planqty}}</view>
|
<view>{{item.noreportqty}}/{{item.reportqty}}</view>
|
<view>{{item.nextstepname?item.nextstepname:'/'}}</view>
|
</view>
|
</view>
|
|
|
</view>
|
|
</view>
|
|
</u-radio-group>
|
</view>
|
</view>
|
|
<!-- 报工操作 -->
|
<u-gap height="15" bgColor="#eff0f1"></u-gap>
|
<view class="head marginLeft10 marginRight10" style="padding-bottom: 20rpx;">
|
<view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title">
|
报工操作
|
</view>
|
</view>
|
|
</view>
|
<view class="flex_column">
|
|
<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
|
<view style="display: flex;" class="titleFont">
|
<view style="color: red;margin-right: 6rpx;">*</view> 计件方式:
|
</view>
|
<u-radio-group v-model="reckway">
|
<u-radio shape="circle" label="班组" name="班组" labelSize="16"></u-radio>
|
<u-radio shape="circle" label="个人" style="margin-left: 20rpx;" name="个人" labelSize="16">
|
</u-radio>
|
</u-radio-group>
|
</view>
|
|
|
<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;"
|
v-if="reckway==='班组'">
|
<view style="display: flex;" class="titleFont">
|
<view style="color: red;margin-right: 6rpx;">*</view> 生产班组:
|
</view>
|
<view @click='userGroupSheetClick' class="custominputClass">
|
<view v-show='userGroupSheetValue===""' style="color: rgb(192, 196, 204);">请选择</view>
|
<view v-show='userGroupSheetValue!==""' class="ellipsis" style="width: 390rpx;">
|
{{userGroupSheetValue}}
|
</view>
|
<u-icon :name="!userGroupSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view>
|
</view>
|
|
|
<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;"
|
v-if="reckway==='个人'">
|
<view style="display: flex;" class="titleFont">
|
<view style="color: red;margin-right: 6rpx;">*</view> 报工人员:
|
</view>
|
<view @click='operSheetClick' class="custominputClass">
|
<view v-show='operSheetValue===""' style="color: rgb(192, 196, 204);">请选择</view>
|
<view v-show='operSheetValue!==""' class="ellipsis" style="width: 390rpx;">
|
{{operSheetValue}}
|
</view>
|
|
<u-icon :name="!operSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view>
|
</view>
|
|
|
<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
|
<view style="display: flex;" class="titleFont">
|
<view style="color: red;margin-right: 6rpx;">*</view> 设备名称:
|
</view>
|
<view @click='epqSheetClick' class="custominputClass">
|
|
<view v-show='eqpSheetValue===""' style="color: rgb(192, 196, 204);">请选择</view>
|
<view v-show='eqpSheetValue!==""' class="ellipsis" style="width: 390rpx;">
|
{{eqpSheetValue}}
|
</view>
|
|
<u-icon :name="!eqpSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view>
|
</view>
|
|
|
<view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
|
<view style="color: red;margin-right: 6rpx;">*</view> 报工数量:
|
<view class='inputClass'>
|
<u--input placeholder="请输入" border="surround" type='number' v-model="reportqty">
|
</u--input>
|
</view>
|
</view>
|
|
<view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
|
<view style="color: #fff;margin-right: 6rpx;">*</view> 不良数量:
|
<view class='inputClass'>
|
<u--input placeholder="请输入" border="surround" @change='ngqtyChange' type='number'
|
v-model="ngqty"></u--input>
|
</view>
|
</view>
|
<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
|
<view style="display: flex;" class="titleFont">
|
<view style="color: #fff;margin-right: 6rpx;">*</view> 不良原因:
|
</view>
|
<view @click='badSheetClick' class="custominputClass">
|
<view v-show='badSheetValue.length===0' style="color: rgb(192, 196, 204);">请选择</view>
|
<view v-show='badSheetValue.length!==0' class="ellipsis" style="width: 390rpx;">
|
{{badSheetValue}}
|
</view>
|
<u-icon :name="!badSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view>
|
</view>
|
|
<!-- <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
|
<view style="display: flex;">
|
<view style="color: red;margin-right: 6rpx;">*</view> 操作人员:
|
</view>
|
<view @click='operSheetClick' class="custominputClass">
|
<view v-show='operSheetValue===""' style="color: rgb(192, 196, 204);">请选择</view>
|
<view v-show='operSheetValue!==""' class="ellipsis" style="width: 390rpx;">
|
{{operSheetValue}}
|
</view>
|
|
<u-icon :name="!operSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
|
</view>
|
</view> -->
|
|
|
<!-- 可能上拉显示 要换成下拉显示 -->
|
<!-- <uni-section style="width: 100%;" title=''>
|
<uni-data-select v-model="operSheetValue" :clear='false' emptyText :localdata="operSheetList">
|
</uni-data-select>
|
</uni-section>
|
-->
|
|
|
|
|
</view>
|
</view>
|
|
<!-- 报工人员信息 -->
|
<u-gap height="15" v-if="reckway==='班组'" bgColor="#eff0f1"></u-gap>
|
<view class="head marginLeft10 marginRight10" v-if="reckway==='班组'">
|
<view class="head_block">
|
<view class="head_left">
|
<view class="head_bar"></view>
|
<view class="head_title">
|
报工人员信息
|
</view>
|
</view>
|
</view>
|
|
<u-button type="primary" icon='plus-circle' plain
|
style="height: 100rpx;width: 98%;margin-top: 10rpx;" @click="addUser" class='addClass'
|
text="添加">
|
</u-button>
|
|
<view class="flex_between titleFont" style="margin: 20rpx 40rpx 30rpx;">
|
<view>序号</view>
|
<view :style="{width:'200rpx'}">人员名称</view>
|
<view style="width: 184rpx;">分配比例(%)</view>
|
<view>操作</view>
|
</view>
|
|
|
<view class="flex_column marginLeft20 marginRight20" :key="item.usercode"
|
v-for="(item,index) in userArr">
|
<view class="flex_between marginLeft20 marginRight20 contentFont">
|
<view style="width: 60rpx;text-align: center;">{{(index+1)}}</view>
|
<view style="width: 200rpx;text-align: center;">{{item.username}}</view>
|
<view style="width: 240rpx; text-align: center;color: rgb(41, 121, 255);">
|
<u-number-box @focus='isAsyncChange=true' @blur='isAsyncChange=false'
|
:key="item.usercode" :asyncChange='isAsyncChange' step="0.01" :name='item.usercode'
|
@change='numberBoxChange' decimal-length="2" :value="item.ratio" inputWidth='110'>
|
</u-number-box>
|
</view>
|
|
<u-icon @click="deleteUser(item)" style="width: 50rpx;text-align: center;" name="trash"
|
min='0' max='100' color="#2979ff" size="24">
|
</u-icon>
|
|
</view>
|
<u-divider></u-divider>
|
</view>
|
|
|
|
|
</view>
|
|
</view>
|
|
<u-gap height="20" bgColor="#eff0f1"></u-gap>
|
|
<u-button size="large" :loading="isDisabledSubmitButton" loadingText="正在提交,请稍等..." type="primary"
|
@click="submit" text="报工">
|
</u-button>
|
|
<!-- <u-action-sheet :actions="userGroupSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
|
:closeOnClickAction="true" @close="userGroupSheetShow=false" :show="userGroupSheetShow"
|
@select='userGroupSheetSelect'>
|
</u-action-sheet> -->
|
<u-picker v-if="topContent.length!==0" :show="userGroupSheetShow" :columns="userGroupColumns"
|
:itemHeight='55' :closeOnClickOverlay='true' @close='userGroupSheetShow=false'
|
@confirm='userGroupPickerConfirm' @cancel='userGroupSheetShow=false'>
|
</u-picker>
|
<!-- <u-action-sheet :actions="eqpSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
|
:closeOnClickAction="true" @close="eqpSheetShow=false" :show="eqpSheetShow" @select='eqpSheetSelect'>
|
</u-action-sheet> -->
|
<u-picker v-if="topContent.length!==0" :show="eqpSheetShow" :columns="eqpColumns" :itemHeight='55'
|
:closeOnClickOverlay='true' @close='eqpSheetShow=false' @confirm='eqpPickerConfirm'
|
@cancel='eqpSheetShow=false'>
|
</u-picker>
|
|
|
|
<u-action-sheet v-if="topContent.length!==0" :actions="badSelectArr" :safeAreaInsetBottom='true'
|
:closeOnClickOverlay="true" :closeOnClickAction="true" @close="badSheetShow=false" :show="badSheetShow"
|
@select='badSheetSelect'>
|
<view style="min-height: 100rpx;padding: 20rpx 20rpx 30rpx 20rpx;">
|
<u-checkbox-group @change="checkboxChange" size='20px' v-model="checkBoxValue" iconPlacement="right"
|
placement="column">
|
<view v-for="(item,index) in badSelectArr">
|
<u-checkbox activeColor="rgb(0, 102, 255)" labelSize='18' :key="item.code" :name='item.name'
|
:label="item.name">
|
</u-checkbox>
|
<u-divider :key="item.code"></u-divider>
|
</view>
|
</u-checkbox-group>
|
</view>
|
</u-action-sheet>
|
|
|
<!-- <u-action-sheet :actions="operSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
|
:closeOnClickAction="true" @close="operSheetShow=false" :show="operSheetShow" @select='operSheetSelect'>
|
</u-action-sheet> -->
|
<u-picker v-if="topContent.length!==0" :show="operSheetShow" :columns="operColumns" :itemHeight='55'
|
:closeOnClickOverlay='true' @close='operSheetShow=false' @confirm='operPickerConfirm'
|
@cancel='operSheetShow=false'>
|
</u-picker>
|
|
|
<u-modal v-if="topContent.length!==0" :show="modalShow" :showCancelButton='true' cancelText='取消'
|
@close="modalShow=false" :closeOnClickOverlay="true" style=" " @cancel="modalCancel"
|
@confirm="modalConfirm" title="报工人员" :content='modalContent'>
|
|
<uni-section style="width: 100%;" title=''>
|
<uni-data-select v-model="userSelectValue" :clear='false' emptyText :localdata="userSelectArr"
|
@change="userChange">
|
</uni-data-select>
|
</uni-section>
|
|
</u-modal>
|
|
|
</view>
|
|
|
<!-- <view v-show="topContent.length!==0" style="position: absolute; bottom: 210rpx;right: 20rpx;">
|
<div class="scanImg2" @click="topScanClick"></div>
|
</div>
|
</view> -->
|
|
<!-- 悬浮球 -->
|
<!-- <view
|
v-show="topContent.length!==0&&!modalShow&&!userGroupSheetShow&&!eqpSheetShow&&!operSheetShow&&!badSheetShow"
|
@click="topScanClick">
|
<drag-ball :x='$DeviceInformation.screenWidth*0.8' :y="$DeviceInformation.screenHeight*0.7"></drag-ball>
|
</view> -->
|
|
<!-- <scan-code></scan-code> -->
|
</view>
|
</template>
|
|
|
<script>
|
import {
|
MesOrderStepStart,
|
PersonPermissions,
|
EqpPermissionsPlus,
|
GroupsPermissions,
|
GroupsPersonPermissions,
|
DefectPermissions
|
} from '../../config/api.js';
|
// import scanCode from '@/components/scan-code/scan-code.vue'
|
export default {
|
// components: {
|
// scanCode
|
// },
|
onLoad(option) {
|
// const _this = this
|
// uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
|
// uni.$on('scancodedate', function(content) {
|
// console.log("扫描到的内容为:", content)
|
// // _this.getMesOrderStepStart(content)
|
|
// if (_this.topContent.find(i => i.wo_code + ';' + i.stepcode === content)) {
|
// _this.$u.toast('此条码已扫描,已在列表中!')
|
// } else {
|
// _this.getMesOrderStepStart(content)
|
// }
|
// })
|
},
|
|
onPullDownRefresh() {
|
setTimeout(() => {
|
this.init(() => {
|
uni.stopPullDownRefresh();
|
})
|
}, 1000);
|
},
|
|
data() {
|
return {
|
topRightMessageCount: 0,
|
isDisabledSubmitButton: false,
|
|
formData: {},
|
|
reckway: '个人', //计件方式 group代表是班组 person 代表是个人
|
userGroupSheetValue: '', //生产班组下拉选中的值
|
eqpSheetValue: '', //设备名称下拉选中的值
|
userGroupSheetList: [], //生产班组下拉数组
|
eqpSheetList: [], //设备名称下拉数组
|
userGroupSheetShow: false, //上拉列表是否展开
|
eqpSheetShow: false,
|
topContent: [
|
// {
|
// nextstepcode: "GX005",
|
// nextstepname: "入库",
|
// noputqty: 0,
|
// noreportqty: 100,
|
// partname: "8504光机",
|
// partnumber: "302",
|
// partspec: "/",
|
// planqty: 100,
|
// reportqty: 0,
|
// seq: "1",
|
// startqty: 100,
|
// stepcode: "GX001",
|
// stepdesc: "",
|
// stepname: "领料",
|
// wo_code: "MO-2022-11-0035_1",
|
// },
|
],
|
|
reportqty: '', //报工数量
|
ngqty: '', //不良数量
|
badSelectArr: [], //不良原因下拉数组
|
badSheetValue: '', //不良原因选中值
|
badSheetShow: false,
|
checkBoxValue: [], //不良原因显示值
|
operSheetValue: '', //操作人员选中值
|
operSheetShow: false,
|
operSheetList: [], //操作人员数组
|
userArr: [], //报工人员信息数组
|
modalShow: false,
|
modalContent: '', //模态框数
|
userSelectValue: '', //下拉选项值
|
userSelectArrAll: [], //所有人员下拉数组
|
userSelectArr: [
|
// {
|
// value: '1001',
|
// text: '小美1'
|
// },
|
], //人员下拉数组
|
userGroupColumns: [], //
|
eqpColumns: [], //
|
operColumns: [], //
|
isAsyncChange: false
|
}
|
},
|
created() {
|
|
},
|
mounted() {
|
this.init()
|
|
|
this.getMesOrderStepStart('SGPO20231110_1;101')
|
this.getGroupsPermissions() //获取生产班组
|
this.getEqpPermissionsPlus() //获取设备名称
|
this.getDefectPermissions() //获取缺陷下拉
|
this.getPersonPermissions() //获取操作人员
|
// this.getGroupsPersonPermissions('BZ001') //根据班组获取人员
|
},
|
methods: {
|
init() {
|
uni.stopPullDownRefresh();
|
},
|
|
//获取生产班组
|
async getGroupsPermissions(wkshopcode) {
|
|
const res = await GroupsPermissions()
|
if (res.code === '200') {
|
// 数组对象 替换对象键名
|
this.userGroupSheetList = res.data.map(({
|
usergroupcode,
|
usergroupname
|
}) => ({
|
code: usergroupcode,
|
name: usergroupname
|
}))
|
|
this.userGroupColumns = [this.userGroupSheetList.map(i => i.name)]
|
}
|
},
|
// 获取设备名称
|
async getEqpPermissionsPlus() {
|
const res = await EqpPermissionsPlus()
|
if (res.code === '200') {
|
this.eqpSheetList = res.data
|
this.eqpColumns = [this.eqpSheetList.map(i => i.name)]
|
}
|
},
|
// 获取不良原因
|
async getDefectPermissions(orderstepqrcode) {
|
const res = await DefectPermissions()
|
if (res.code === '200') {
|
this.badSelectArr = res.data
|
}
|
},
|
// 获取操作人员
|
async getPersonPermissions() {
|
const res = await PersonPermissions()
|
if (res.code === '200') {
|
// this.operSheetList = res.data
|
this.operSheetList = res.data.map(({
|
usercode,
|
username
|
}) => ({
|
code: usercode,
|
name: username
|
}))
|
this.operColumns = [this.operSheetList.map(i => i.name)]
|
this.userSelectArrAll = this.operSheetList
|
}
|
},
|
// 根据生产班组获取人员
|
async getGroupsPersonPermissions(usergroupcode) {
|
const res = await GroupsPersonPermissions()
|
if (res.code === '200') {
|
this.userArr = res.data
|
this.calculatedValue()
|
}
|
},
|
// 计算分配比例的值
|
calculatedValue() {
|
const total = 100;
|
let value = 0
|
this.userArr.forEach(item => {
|
item.ratio = parseFloat((100 / this.userArr.length).toFixed(2))
|
value += item.ratio
|
})
|
if (Math.round(value * 100) / 100 !== total) {
|
this.userArr[this.userArr.length - 1].ratio = parseFloat((this.userArr[this.userArr.length - 1].ratio +
|
(total - value)).toFixed(2))
|
}
|
},
|
|
//获取开工信息
|
async getMesOrderStepStart(orderstepqrcode) {
|
const data = {
|
OperType: 'ZZ',
|
SelectType: '',
|
wocode: orderstepqrcode ? orderstepqrcode.split(';')[0] : '',
|
stepcode: orderstepqrcode ? orderstepqrcode.split(';')[1] : ''
|
|
}
|
const res = await MesOrderStepStart(this.global.formatData(data))
|
if (res.code === '200' && res.count === 1) {
|
this.formData = res.data
|
this.topContent.unshift(res.data)
|
// this.getGroupsPermissions(res.data.wkshopcode)
|
// let o = res.data.wo_code + ';' + res.data.stepcode
|
// this.getEqpPermissionsPlus(o)
|
// this.getDefectPermissions(o)
|
// this.getPersonPermissions()
|
|
} else if (res.code === '200' && res.count !== 1) {
|
this.$u.toast('此工序已报工!')
|
}
|
|
},
|
// 扫码事件
|
topScanClick() {
|
let that = this;
|
|
uni.scanCode({
|
onlyFromCamera: true,
|
// scanType: ['barCode', 'qrCode'],
|
scanType: ['qrCode'],
|
success: function(res) {
|
console.log('条码类型:' + res.scanType);
|
console.log('条码内容:' + res.result);
|
|
if (that.topContent.find(i => i.wo_code + ';' + i.stepcode === res.result)) {
|
that.$u.toast('此条码已扫描,已在列表中!')
|
} else {
|
that.getMesOrderStepStart(res.result)
|
}
|
|
},
|
complete: function(res) {
|
|
},
|
fail: function(res) {
|
console.log('条码类型:' + res.scanType);
|
console.log('条码内容:' + res.result);
|
}
|
|
});
|
},
|
// 步进器值改变时
|
numberBoxChange(val) {
|
this.userArr.find(i => i.usercode === val.name).ratio = parseFloat(val.value).toFixed(2)
|
},
|
|
ngqtyChange(val) {
|
if (!parseFloat(val)) {
|
this.badSheetValue = ''
|
this.checkBoxValue = ''
|
}
|
},
|
|
async submit() {
|
|
if (this.reckway === '班组' && this.userGroupSheetValue === "") {
|
return uni.$u.toast('生产班组不能为空!')
|
}
|
if (this.reckway === '个人' && this.operSheetValue === "") {
|
return uni.$u.toast('报工人员不能为空!')
|
}
|
if (this.eqpSheetValue === "") {
|
return uni.$u.toast('设备名称不能为空!')
|
}
|
if (this.reportqty === "") {
|
return uni.$u.toast('报工数量不能为空!')
|
}
|
|
if (this.reckway === '班组' && this.userArr.length === 0) {
|
return uni.$u.toast('报工人员信息不能为空!')
|
}
|
|
if (this.reckway === '班组') {
|
let sum = 0
|
this.userArr.forEach(item => {
|
console.log(item.ratio, 'item.ratio')
|
sum += parseFloat(item.ratio)
|
})
|
sum = parseFloat(sum)
|
console.log(sum, 'sum44')
|
if (Math.round(sum * 100) / 100 !== 100) {
|
return uni.$u.toast('分配比例总和必须为100!')
|
}
|
}
|
|
|
const header = {
|
// 'Content-Type': 'multipart/form-data',
|
'Content-Type': 'application/x-www-form-urlencoded',
|
'rediskey': uni.getStorageSync('rediskey'),
|
'admin': uni.getStorageSync('usercode'),
|
'username': encodeURIComponent(uni.getStorageSync('username')),
|
'navTabId': uni.getStorageSync('usercode'),
|
'userid': uni.getStorageSync('userid'),
|
'guid': uni.getStorageSync('guid'),
|
'usertype': 'APP'
|
}
|
|
let badcode = []
|
|
|
if (this.badSheetValue.length > 0) {
|
this.badSelectArr.forEach(i => {
|
if (this.badSheetValue.split(',').includes(i.name)) {
|
badcode.push(i.code)
|
}
|
})
|
}
|
|
if (this.ngqty !== '') {
|
if (badcode.length === 0) {
|
return uni.$u.toast('不良原因未选择!')
|
}
|
}
|
|
|
|
let reportuser = ''
|
|
// if (this.$company === 'A') {
|
// reportuser = this.reckway === '班组' ? JSON.stringify(this.userArr) : JSON.stringify([{
|
// usercode: this.operSheetValue,
|
// ratio: 100
|
// }])
|
// } else {
|
reportuser = this.userArr.map(i => i.usercode).join(';') //报工人员
|
// }
|
|
|
const data = {
|
admin: uni.getStorageSync('usercode'),
|
mesordercode: this.formData.wo_code, // 工单编号
|
partcode: this.formData.partnumber, // 产品编码
|
stepseq: this.formData.seq, // 工序序号
|
stepcode: this.formData.stepcode, // 工序编码
|
eqpcode: this.eqpSheetList.find(i => i.name === this.eqpSheetValue).code, // 设备编码
|
taskqty: this.formData.planqty, // 任务数量
|
startqty: this.formData.reportqty, // 开工数量
|
usergroupcode: this.userGroupSheetValue ? this.userGroupSheetList.find(i => i.name === this
|
.userGroupSheetValue).code : '', // 班组编码
|
reportqty: parseFloat(this.reportqty), // 报工数量
|
// reportuser: this.userArr.map(i => i.usercode).join(';'), //报工人员
|
reportuser,
|
|
//报工人员
|
remarks: '', // 备注
|
reckway: this.reckway === '班组' ? 'group' : 'person', //
|
ngqty: this.ngqty === '' ? 0 : this.ngqty, //不良数量
|
badcode: badcode.join(';'), //不良原因
|
|
inbarcode: '', //扫码入库
|
}
|
|
console.log(data, 7777)
|
|
this.isDisabledSubmitButton = true
|
uni.uploadFile({
|
url: this.$baseUrl + '/AppProductionManagement/SavaMesOrderStepReport',
|
files: [{
|
"uri": "/"
|
}],
|
header: header,
|
formData: data,
|
success: (res) => {
|
uni.$u.toast('报工成功!')
|
this.topContent = []
|
this.formData = {}
|
this.reportqty = ''
|
this.ngqty = ''
|
this.reckway = '个人'
|
this.userGroupSheetValue = ''
|
this.eqpSheetValue = ''
|
this.userGroupSheetList = []
|
this.eqpSheetList = []
|
this.badSelectArr = []
|
this.badSheetValue = []
|
this.checkBoxValue = []
|
this.operSheetValue = ''
|
this.operSheetList = []
|
this.userArr = []
|
this.userSelectValue = ''
|
this.userSelectArrAll = []
|
this.userSelectArr = []
|
this.userGroupColumns = []
|
this.eqpColumns = []
|
this.operColumns = []
|
|
|
this.isDisabledSubmitButton = false
|
},
|
fail(res) {
|
uni.$u.toast('报工失败!')
|
this.isDisabledSubmitButton = false
|
},
|
})
|
|
},
|
userGroupSheetSelect(val) {
|
this.userGroupSheetValue = val.name
|
this.userGroupSheetShow = false
|
},
|
userGroupSheetClick() {
|
this.userGroupSheetShow = true
|
},
|
eqpSheetSelect(val) {
|
this.eqpSheetValue = val.name
|
this.eqpSheetShow = false
|
},
|
epqSheetClick() {
|
this.eqpSheetShow = true
|
},
|
badSheetSelect(val) {
|
// console.log(val,9999999)
|
},
|
badSheetClick() {
|
if (!this.ngqty) {
|
return uni.$u.toast('请先填写不良数量!')
|
}
|
this.badSheetShow = true
|
},
|
checkboxChange(val) {
|
this.badSheetValue = val.join(',')
|
console.log(this.badSheetValue, 5);
|
},
|
operSheetClick() {
|
this.operSheetShow = true
|
},
|
operSheetSelect(val) {
|
this.operSheetValue = val.name
|
this.operSheetShow = false
|
},
|
// 添加人员按钮
|
addUser() {
|
this.userSelectArr = []
|
this.userSelectArrAll.forEach(i => {
|
if (!this.userArr.map(j => j.usercode).includes(i.code)) {
|
this.userSelectArr.push({
|
value: i.code,
|
text: i.name
|
})
|
}
|
})
|
this.modalShow = true
|
|
},
|
// 删除人员按钮
|
deleteUser(item) {
|
this.userArr = this.userArr.filter(i => i.usercode !== item.usercode)
|
this.calculatedValue()
|
},
|
// 模态框取消按钮
|
modalCancel() {
|
this.modalShow = false
|
this.userSelectValue = ''
|
},
|
// 模态框确认按钮
|
modalConfirm() {
|
if (this.userSelectValue) {
|
this.userArr.unshift({
|
usercode: this.userSelectValue,
|
username: this.userSelectArrAll.find(i => i.code === this.userSelectValue).name
|
})
|
this.userSelectValue = ''
|
} else {
|
uni.$u.toast('请选择报工人员!')
|
}
|
this.modalShow = false
|
this.calculatedValue()
|
},
|
userChange(val) {
|
this.userSelectValue = val
|
},
|
userGroupPickerConfirm(val) {
|
console.log(val, 11)
|
this.getGroupsPersonPermissions(this.userGroupSheetList.find(i => i.name === val.value[0]).code)
|
this.userGroupSheetValue = val.value[0]
|
this.userGroupSheetShow = false
|
},
|
eqpPickerConfirm(val) {
|
this.eqpSheetValue = val.value[0]
|
this.eqpSheetShow = false
|
},
|
operPickerConfirm(val) {
|
this.operSheetValue = val.value[0]
|
this.operSheetShow = false
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
@import url('@/style/global.css');
|
|
::v-deep .uicon-arrow-left>span {
|
display: block;
|
}
|
|
.custominputClass {
|
width: 412rpx;
|
display: flex;
|
justify-content: space-between;
|
border: 3rpx #eff0f1 solid;
|
border-radius: 10rpx;
|
padding: 0 16rpx;
|
|
}
|
|
.ellipsis {
|
text-overflow: ellipsis;
|
overflow: hidden;
|
white-space: nowrap;
|
}
|
|
.scanImg2 {
|
width: 70px;
|
height: 70px;
|
border-radius: 50%;
|
margin: auto;
|
background: url('@/static/img/scan.png') no-repeat;
|
box-shadow: #436df5 0px 0px 20px;
|
background-size: 100% 100%;
|
}
|
|
::v-deep .addClass .uicon-plus-circle {
|
font-size: 50rpx !important;
|
margin-right: 20rpx !important;
|
}
|
|
::v-deep .addClass .u-button__text {
|
font-size: 46rpx !important;
|
}
|
|
|
::v-deep .u-modal__content {
|
padding-bottom: 260rpx;
|
margin-bottom: 100rpx;
|
}
|
|
::v-deep .u-action-sheet {
|
max-height: 600rpx !important;
|
overflow: auto !important;
|
}
|
|
::v-deep .u-number-box__minus {
|
height: 50rpx !important;
|
}
|
|
::v-deep .u-number-box__input {
|
height: 50rpx !important;
|
}
|
|
::v-deep .u-number-box__plus {
|
height: 50rpx !important;
|
}
|
</style>
|