| | |
| | | sortable="custom" |
| | | /> |
| | | <el-table-column |
| | | label="未报工数量" |
| | | label="未收料数量" |
| | | width="120" |
| | | > |
| | | <!-- sortable="custom"--> |
| | |
| | | :visible.sync="dialogVisible" |
| | | width="850px" |
| | | class="dialogVisible" |
| | | :top="dialogTitle==='自制报工'?'5vh':'15vh'" |
| | | top="15vh" |
| | | :close-on-click-modal="false" |
| | | @close="handleClose" |
| | | @closed="handleClose" |
| | |
| | | v-model="dialogForm.eqpcode" |
| | | style="width: 200px;" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | | <el-option |
| | | v-for="item in ZZeqpArr" |
| | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="下道工序:"> |
| | | <div style="width: 200px">{{ dialogForm.nextstepname }}</div> |
| | | </el-form-item> |
| | | <el-form-item v-if="dialogTitle==='自制报工'" prop="usergroupcode" label="生产班组:"> |
| | | <!-- <el-form-item v-if="dialogTitle==='自制报工'" prop="productionType" label="生产类型:">--> |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.productionType"--> |
| | | <!-- style="width: 200px;"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- @change="usergroupChange111"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in productionTypeSelect"--> |
| | | <!-- :key="item.code"--> |
| | | <!-- :label="item.name"--> |
| | | <!-- :value="item.code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | <!-- <el-form-item v-if="dialogTitle==='自制报工'" :prop="dialogForm.productionType==='personal'?'':'usergroupcode'" label="生产班组:">--> |
| | | <!-- <el-select--> |
| | | <!-- v-model="dialogForm.usergroupcode"--> |
| | | <!-- style="width: 200px;"--> |
| | | <!-- placeholder="请选择"--> |
| | | <!-- @change="usergroupChange"--> |
| | | <!-- >--> |
| | | <!-- <el-option--> |
| | | <!-- v-for="item in ZZtreams"--> |
| | | <!-- :key="item.group_code"--> |
| | | <!-- :label="item.group_name"--> |
| | | <!-- :value="item.group_code"--> |
| | | <!-- />--> |
| | | <!-- </el-select>--> |
| | | <!-- </el-form-item>--> |
| | | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" prop="productionType" label="报工人员:"> |
| | | <el-select |
| | | v-model="dialogForm.usergroupcode" |
| | | v-model="dialogForm.reportuser" |
| | | style="width: 200px;" |
| | | placeholder="请选择" |
| | | @change="usergroupChange" |
| | | filterable |
| | | > |
| | | <el-option |
| | | v-for="item in ZZtreams" |
| | | :key="item.group_code" |
| | | :label="item.group_name" |
| | | :value="item.group_code" |
| | | v-for="item in ZZuserArr" |
| | | :key="item.usercode" |
| | | :label="item.username+' / '+item.usercode" |
| | | :value="item.usercode" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="设备名称:" prop="eqpcode"> |
| | | <el-select |
| | | v-model="dialogForm.eqpcode" |
| | | style="width: 200px;" |
| | | filterable |
| | | placeholder="请选择" |
| | | > |
| | | <el-option |
| | |
| | | :disabled="parseFloat(dialogForm.noputqty)===0||dialogForm.noputqty.trim()===''" |
| | | multiple |
| | | collapse-tags |
| | | filterable |
| | | > |
| | | <el-option |
| | | v-for="item in badArr" |
| | |
| | | <!-- <el-form-item v-if="dialogTitle==='自制报工'" label="报工人员:">--> |
| | | <!-- <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" />--> |
| | | <!-- </el-form-item>--> |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="报工人:"> |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="操作人员:"> |
| | | <el-select |
| | | v-model="dialogForm.operation" |
| | | style="width: 200px;" |
| | | placeholder="请选择" |
| | | filterable |
| | | > |
| | | <el-option |
| | | v-for="item in OperationArr" |
| | |
| | | <el-form-item v-if="dialogTitle==='自制报工'" label="备注:"> |
| | | <el-input v-model="dialogForm.remarks" type="textarea" style="width: 200px;" /> |
| | | </el-form-item> |
| | | <div v-if="dialogTitle==='自制报工'"> |
| | | <!-- <div v-if="dialogTitle==='自制报工'">--> |
| | | <div v-if="false"> |
| | | <i class="el-icon-s-operation" style="color:#42b983;" /> 人员列表 |
| | | <el-button type="primary" style="margin: 10px 0" @click="userAdd">增行</el-button> |
| | | <el-table |
| | |
| | | startqtySum: '', // 不能超过的数值 |
| | | |
| | | operation: getCookie('navTabId'), // 报工人(收料人) |
| | | remarks: ''// 备注 |
| | | remarks: '', // 备注 |
| | | |
| | | productionType: 'personal'// 生产类型 |
| | | }, |
| | | productionTypeSelect: [ |
| | | { code: 'personal', name: '个人类型' }, |
| | | { code: 'team', name: '班组类型' } |
| | | ], // 生产类型数组 |
| | | ZZuserArr: [], // 自制用户所有 |
| | | ZZtreams: [], // 自制生产班组数组 |
| | | ZZeqpArr: [], // 自制设备名称 |
| | |
| | | ], |
| | | startqty: [ |
| | | { required: true, message: '请输入报工数量', trigger: ['blur', 'change'] } |
| | | ], |
| | | productionType: [ |
| | | { required: true, message: '请选择生产类型', trigger: ['blur', 'change'] } |
| | | ] |
| | | }, |
| | | activeName: '', |
| | |
| | | this.getMesOrderSelectUserAll() // 获取所有人员 |
| | | }, |
| | | methods: { |
| | | // 选择生产类型 |
| | | usergroupChange111(val) { |
| | | console.log(val) |
| | | if (val === 'personal') { |
| | | this.dialogForm.usergroupcode = '' |
| | | } |
| | | }, |
| | | |
| | | tableRowClassName({ row, rowIndex }) { |
| | | return 'custom-row' |
| | |
| | | }, |
| | | // 用户添加 |
| | | userAdd() { |
| | | if (this.userTableData.find(i => i.isVisible === 1)) { |
| | | return this.$message.info('请先保存当前行信息!') |
| | | } |
| | | |
| | | let number = Math.random() * Math.random()// 作为删除时的标识符 |
| | | number = number === 0 ? (10 + Math.random()) : number |
| | | console.log(this.userTableData, 6) |
| | |
| | | this.dialogForm.reportqty = '', // 已报数量 |
| | | this.dialogForm.noreportqty = '', // 未报数量 |
| | | this.dialogForm.startqty = '', // 开(报)工数量 |
| | | |
| | | this.dialogForm.reportuser = '', // 报工人员 |
| | | this.dialogForm.wxcode = '', // 外协供应商编码 |
| | | this.dialogForm.outuser = '', // 发料人员 |
| | | this.dialogForm.taskqty = '', // 任务数量 |
| | |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | this.$message.success('收料成功!') |
| | | if (this.dialogForm.nextstepcode === '') { |
| | | this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username) |
| | | this.dialogVisible2 = true |
| | | } |
| | | // if (this.dialogForm.nextstepcode === '') { |
| | | this.WXprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.inuser).username) |
| | | this.dialogVisible2 = true |
| | | // } |
| | | this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |
| | |
| | | if (parseFloat(this.dialogForm.startqtySum) < parseFloat(this.dialogForm.startqty) + parseFloat(this.dialogForm.noputqty)) { |
| | | return this.$message.info('报工数量加不良数量不能大于了未报数量!') |
| | | } |
| | | if (this.userTableData.length < 1) { |
| | | return this.$message.info('人员列表不能为空!') |
| | | } |
| | | // if (this.userTableData.length < 1) { |
| | | // return this.$message.info('人员列表不能为空!') |
| | | // } |
| | | |
| | | if (parseFloat(this.dialogForm.noputqty) > 0) { |
| | | if (this.dialogForm.badcode.length < 1) { |
| | |
| | | } |
| | | } |
| | | // this.userTableData = [...new Set(this.userTableData)]// 数组去重 |
| | | this.userTableData = this.userTableData.filter(item => item.usercode !== '') |
| | | // this.userTableData = this.userTableData.filter(item => item.usercode !== '') |
| | | // 数组中对象相同的去重 |
| | | this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => { |
| | | return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex |
| | | }) |
| | | // this.userTableData = this.userTableData.filter((currentValue, currentIndex, selfArr) => { |
| | | // return selfArr.findIndex(item => item.usercode === currentValue.usercode) === currentIndex |
| | | // }) |
| | | // console.log(this.userTableData, 1) |
| | | const reportuser = this.userTableData.map(item => item.usercode).join(';') |
| | | // const reportuser = this.userTableData.map(item => item.usercode).join(';') |
| | | const data = { |
| | | mesordercode: this.dialogForm.wo_code, // 工单编号 |
| | | partcode: this.dialogForm.partcode, // 产品编码 |
| | |
| | | stepcode: this.dialogForm.stepcode, // 工序编码 |
| | | eqpcode: this.dialogForm.eqpcode, // 设备编码 |
| | | usergroupcode: this.dialogForm.usergroupcode, // 班组编码 |
| | | reportuser: reportuser, // 报工人员 |
| | | // reportuser: reportuser, // 报工人员 |
| | | reportuser: this.dialogForm.reportuser, // 报工人员 |
| | | taskqty: this.dialogForm.planqty, // 任务数量 |
| | | // startqty: this.dialogForm.startqty, // 开工数量 |
| | | startqty: this.dialogForm.reportqty, // 开工数量 |
| | |
| | | if (res.code === '200') { |
| | | this.dialogVisible = false |
| | | this.$message.success('报工成功!') |
| | | if (this.dialogForm.nextstepcode === '') { |
| | | this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | } |
| | | // if (this.dialogForm.nextstepcode === '') { |
| | | this.ZZprint2(this.OperationArr.find(item => item.usercode === this.dialogForm.operation).username) |
| | | this.dialogVisible2 = true |
| | | // } |
| | | this.tabClick() |
| | | this.$store.state.app.buttonIsDisabled = false |
| | | } else { |