loulijun2021
2023-11-13 cd3d47e7fdb04ab40bb3e871637279ef0ca3ca23
1.生产报工 50%
已修改2个文件
93 ■■■■ 文件已修改
config/api.js 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/scgl/scbg.vue 77 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
config/api.js
@@ -162,9 +162,21 @@
    data)
// 人员基础资料
export const PersonPermissions = (data) => http.get('/GeneralBasicData​/PersonPermissions',
export const PersonPermissions = (data) => http.get('/GeneralBasicData/PersonPermissions',
    data)
// 设备下拉接口
export const EqpPermissionsPlus = (data) => http.get('/GeneralBasicData​/EqpPermissions',
export const EqpPermissionsPlus = (data) => http.get('/GeneralBasicData/EqpPermissions',
    data)
// 班组基础资料
export const GroupsPermissions = (data) => http.get('/GeneralBasicData/GroupsPermissions',
    data)
// 班组查找人员基础资料
export const GroupsPersonPermissions = (data) => http.get('/GeneralBasicData/GroupsPersonPermissions',
    data)
// 缺陷下拉
export const DefectPermissions = (data) => http.get('/GeneralBasicData/DefectPermissions',
    data)
pages/scgl/scbg.vue
@@ -50,7 +50,7 @@
                                            <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>
@@ -230,7 +230,7 @@
                            </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>
@@ -275,7 +275,7 @@
                    <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>
@@ -329,7 +329,12 @@
<script>
    import {
        MesOrderStepStart
        MesOrderStepStart,
        PersonPermissions,
        EqpPermissionsPlus,
        GroupsPermissions,
        GroupsPersonPermissions,
        DefectPermissions
    } from '../../config/api.js';
    // import scanCode from '@/components/scan-code/scan-code.vue'
    export default {
@@ -427,11 +432,11 @@
            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.getGroupsPermissions() //获取生产班组
            this.getEqpPermissionsPlus() //获取设备名称
            this.getDefectPermissions() //获取缺陷下拉
            this.getPersonPermissions() //获取操作人员
            // this.getGroupsPersonPermissions('BZ001') //根据班组获取人员
        },
        methods: {
            init() {
@@ -439,50 +444,42 @@
            },
            //获取生产班组
            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
@@ -495,12 +492,8 @@
                }
            },
            // 根据生产班组获取人员
            async getMesOrderGroupSelectUser(usergroupcode) {
                const data = {
                    usergroupcode,
                    stu_torgcode: uni.getStorageSync('stu_torgcode')
                }
                const res = await MesOrderGroupSelectUser(this.global.formatData(data))
            async getGroupsPersonPermissions(usergroupcode) {
                const res = await GroupsPersonPermissions()
                if (res.code === '200') {
                    this.userArr = res.data
                    this.calculatedValue()
@@ -533,11 +526,11 @@
                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('此工序已报工!')
@@ -806,7 +799,7 @@
            },
            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
            },