| | |
| | | <view>{{item.stepname}}</view> |
| | | <view>{{item.planqty}}</view> |
| | | <view>{{item.noreportqty}}/{{item.reportqty}}</view> |
| | | <view>{{item.nextstepname}}</view> |
| | | <view>{{item.nextstepname?item.nextstepname:'/'}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | </view> |
| | | |
| | | |
| | | <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;" |
| | | v-if="reckway==='个人'"> |
| | | <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> |
| | | |
| | | <!-- 报工人员信息 --> |
| | | <u-gap height="15" v-if="reckway==='班组'" bgColor="#eff0f1"></u-gap> |
| | | <!-- <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> |
| | |
| | | </view> |
| | | |
| | | <u-icon @click="deleteUser(item)" style="width: 50rpx;text-align: center;" name="trash" |
| | | min='0' max='100' color="#2979ff" size="40"> |
| | | min='0' max='100' color="#2979ff" size="24"> |
| | | </u-icon> |
| | | |
| | | </view> |
| | |
| | | |
| | | |
| | | |
| | | </view> |
| | | </view> --> |
| | | |
| | | </view> |
| | | |
| | |
| | | @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-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='40' :key="item.code" :name='item.name' |
| | | <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> |
| | |
| | | </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-action-sheet v-if="topContent.length!==0" :actions="userSelectArrAll" :safeAreaInsetBottom='true' |
| | | :closeOnClickOverlay="true" :closeOnClickAction="true" @close="userSheetShow=false" |
| | | :show="userSheetShow" @select='userSheetSelect'> |
| | | <view style="min-height: 100rpx;padding: 20rpx 20rpx 30rpx 20rpx;"> |
| | | <u-checkbox-group @change="userCheckboxChange" size='20px' v-model="userCheckBoxValue" |
| | | iconPlacement="right" placement="column"> |
| | | <view v-for="(item,index) in userSelectArrAll"> |
| | | <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-picker v-if="topContent.length!==0" :show="operSheetShow" :columns="operColumns" :itemHeight='55' |
| | | :closeOnClickOverlay='true' @close='operSheetShow=false' @confirm='operPickerConfirm' |
| | | @cancel='operSheetShow=false'> |
| | |
| | | |
| | | <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'> |
| | | @confirm="modalConfirm" title="不良明细" :content='modalContent'> |
| | | |
| | | <uni-section style="width: 100%;" title=''> |
| | | <!-- <uni-section style="width: 100%;" title=''> |
| | | <uni-data-select v-model="userSelectValue" :clear='false' emptyText :localdata="userSelectArr" |
| | | @change="userChange"> |
| | | </uni-data-select> |
| | | </uni-section> |
| | | </uni-section> --> |
| | | |
| | | <!-- <view style="display: flex;flex-direction: column;"> |
| | | <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> --> |
| | | |
| | | |
| | | </u-modal> |
| | | |
| | |
| | | |
| | | <script> |
| | | import { |
| | | MesOrderStepStart |
| | | MesOrderStepStart, |
| | | PersonPermissions, |
| | | EqpPermissionsPlus, |
| | | GroupsPermissions, |
| | | GroupsPersonPermissions, |
| | | DefectPermissions |
| | | } from '../../config/api.js'; |
| | | // import scanCode from '@/components/scan-code/scan-code.vue' |
| | | export default { |
| | |
| | | userGroupColumns: [], // |
| | | eqpColumns: [], // |
| | | operColumns: [], // |
| | | isAsyncChange: false |
| | | isAsyncChange: false, |
| | | |
| | | userCheckBoxValue: [], |
| | | userSheetShow: false |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | |
| | | |
| | | this.getMesOrderStepStart('SGPO20231110_1;101') |
| | | // this.getMesOrderStepReportSelectUserGroup() //获取生产班组 |
| | | // this.getMesOrderStepStartSelectEqp('MO-2023-02-1502;GX002') //获取设备名称 |
| | | // this.getMesOrderStepSelectCause('MO-2023-02-1502;GX002') |
| | | // this.getMesOrderSelectUser() //获取操作人员 |
| | | // this.getMesOrderGroupSelectUser('BZ001') //根据班组获取人员 |
| | | |
| | | |
| | | |
| | | |
| | | this.getSellectAllApi() |
| | | |
| | | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | uni.stopPullDownRefresh(); |
| | | }, |
| | | async getSellectAllApi() { |
| | | await this.getGroupsPermissions() //获取生产班组 |
| | | await this.getEqpPermissionsPlus() //获取设备名称 |
| | | await this.getDefectPermissions() //获取缺陷下拉 |
| | | await this.getPersonPermissions() //获取操作人员 |
| | | }, |
| | | |
| | | |
| | | //获取生产班组 |
| | | async getMesOrderStepReportSelectUserGroup(wkshopcode) { |
| | | const data = { |
| | | stu_torgcode: uni.getStorageSync('stu_torgcode'), |
| | | stu_torgtypecode: uni.getStorageSync('description'), |
| | | wkshopcode |
| | | } |
| | | async getGroupsPermissions(wkshopcode) { |
| | | |
| | | const res = await MesOrderStepReportSelectUserGroup(this.global.formatData(data)) |
| | | const res = await GroupsPermissions() |
| | | if (res.code === '200') { |
| | | // 数组对象 替换对象键名 |
| | | this.userGroupSheetList = res.data.map(({ |
| | | group_code, |
| | | group_name |
| | | usergroupcode, |
| | | usergroupname |
| | | }) => ({ |
| | | code: group_code, |
| | | name: group_name |
| | | code: usergroupcode, |
| | | name: usergroupname |
| | | })) |
| | | |
| | | this.userGroupColumns = [this.userGroupSheetList.map(i => i.name)] |
| | | } |
| | | }, |
| | | // 获取设备名称 |
| | | async getMesOrderStepStartSelectEqp(orderstepqrcode) { |
| | | const res = await MesOrderStepStartSelectEqp(this.global.formatData({ |
| | | orderstepqrcode |
| | | })) |
| | | async getEqpPermissionsPlus() { |
| | | const res = await EqpPermissionsPlus() |
| | | if (res.code === '200') { |
| | | this.eqpSheetList = res.data |
| | | this.eqpColumns = [this.eqpSheetList.map(i => i.name)] |
| | | } |
| | | }, |
| | | // 获取不良原因 |
| | | async getMesOrderStepSelectCause(orderstepqrcode) { |
| | | const res = await MesOrderStepSelectCause(this.global.formatData({ |
| | | orderstepqrcode |
| | | })) |
| | | async getDefectPermissions(orderstepqrcode) { |
| | | const res = await DefectPermissions() |
| | | if (res.code === '200') { |
| | | this.badSelectArr = res.data |
| | | } |
| | | }, |
| | | // 获取操作人员 |
| | | async getMesOrderSelectUser() { |
| | | const res = await MesOrderSelectUser() |
| | | // 获取报工人员 |
| | | async getPersonPermissions() { |
| | | const res = await PersonPermissions() |
| | | if (res.code === '200') { |
| | | // this.operSheetList = res.data |
| | | this.operSheetList = res.data.map(({ |
| | | usercode, |
| | | username |
| | |
| | | } |
| | | }, |
| | | // 根据生产班组获取人员 |
| | | async getMesOrderGroupSelectUser(usergroupcode) { |
| | | const data = { |
| | | usergroupcode, |
| | | stu_torgcode: uni.getStorageSync('stu_torgcode') |
| | | } |
| | | const res = await MesOrderGroupSelectUser(this.global.formatData(data)) |
| | | 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 |
| | | async getGroupsPersonPermissions(groupcode) { |
| | | |
| | | const res = await GroupsPersonPermissions({ |
| | | groupcode |
| | | }) |
| | | 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)) |
| | | if (res.code === '200') { |
| | | this.userCheckBoxValue = [] |
| | | |
| | | if (res.data[0].usercode_list && res.data[0].usercode_list.length > 0) { |
| | | this.userSelectArrAll.forEach(i => { |
| | | |
| | | if (res.data[0].usercode_list.split(',').includes(i.code)) { |
| | | this.userCheckBoxValue.push(i.name) |
| | | } |
| | | |
| | | }) |
| | | |
| | | } |
| | | |
| | | this.operSheetValue = this.userCheckBoxValue.join(',') |
| | | |
| | | |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | userSheetSelect() { |
| | | |
| | | }, |
| | | userCheckboxChange(val) { |
| | | this.userCheckBoxValue = val.join(',') |
| | | // this.userCheckBoxValue = ['001'] |
| | | // this.$forceUpdate() |
| | | |
| | | // console.log(this.userCheckBoxValue); |
| | | }, |
| | | |
| | | |
| | | |
| | | |
| | | //获取开工信息 |
| | | async getMesOrderStepStart(orderstepqrcode) { |
| | |
| | | if (res.code === '200' && res.count === 1) { |
| | | this.formData = res.data |
| | | this.topContent.unshift(res.data) |
| | | this.getMesOrderStepReportSelectUserGroup(res.data.wkshopcode) |
| | | let o = res.data.wo_code + ';' + res.data.stepcode |
| | | this.getMesOrderStepStartSelectEqp(o) |
| | | this.getMesOrderStepSelectCause(o) |
| | | this.getMesOrderSelectUser() |
| | | // 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('此工序已报工!') |
| | |
| | | console.log(this.badSheetValue, 5); |
| | | }, |
| | | operSheetClick() { |
| | | this.operSheetShow = true |
| | | if (this.reckway === '个人') { |
| | | this.operSheetShow = true |
| | | } |
| | | |
| | | if (this.reckway === '班组') { |
| | | this.userSheetShow = true |
| | | } |
| | | |
| | | |
| | | |
| | | }, |
| | | operSheetSelect(val) { |
| | | this.operSheetValue = val.name |
| | |
| | | // 删除人员按钮 |
| | | deleteUser(item) { |
| | | this.userArr = this.userArr.filter(i => i.usercode !== item.usercode) |
| | | this.calculatedValue() |
| | | |
| | | }, |
| | | // 模态框取消按钮 |
| | | modalCancel() { |
| | |
| | | uni.$u.toast('请选择报工人员!') |
| | | } |
| | | this.modalShow = false |
| | | this.calculatedValue() |
| | | |
| | | }, |
| | | userChange(val) { |
| | | this.userSelectValue = val |
| | | }, |
| | | userGroupPickerConfirm(val) { |
| | | console.log(val, 11) |
| | | this.getMesOrderGroupSelectUser(this.userGroupSheetList.find(i => i.name === val.value[0]).code) |
| | | this.getGroupsPersonPermissions(this.userGroupSheetList.find(i => i.name === val.value[0]).code) |
| | | this.userGroupSheetValue = val.value[0] |
| | | this.userGroupSheetShow = false |
| | | }, |