| | |
| | | --> |
| | | <template> |
| | | <el-dialog |
| | | width="95%" |
| | | title="批量产出" |
| | | width="90%" |
| | | title="汇报产出" |
| | | :visible.sync="innerVisible" |
| | | append-to-body |
| | | @close="$emit('update:currshowlist', false)" |
| | | @close="handleClose" |
| | | :show="currshowlist" |
| | | :close-on-click-modal="false" |
| | | class="batch-product-out-form" |
| | | > |
| | | <div |
| | | style="float: left;width: 15%;box-sizing: border-box;padding-right: 34px;position: relative" |
| | | style="float: left;width: 20%;box-sizing: border-box;padding-right: 34px;position: relative" |
| | | > |
| | | <el-table |
| | | stripe |
| | |
| | | style="position: absolute;top:0px;right: 0px;height: 100%;width: 34px;border-left: 1px solid #f4f2ea;border-right: 1px solid #f4f2ea;" |
| | | ></div> |
| | | </div> |
| | | <div style="float: left;width: 85%"> |
| | | <div style="float: left;width: 80%"> |
| | | <el-row style=""> |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>序号</span></el-col |
| | |
| | | ><el-col :span="2" class="batch-product-out-form-header-col" |
| | | ><span>零件名称</span></el-col |
| | | > |
| | | <el-col :span="4" class="batch-product-out-form-header-col" |
| | | ><span>SN号</span></el-col |
| | | > |
| | | <el-col :span="2" class="batch-product-out-form-header-col" |
| | | <!-- <el-col :span="4" class="batch-product-out-form-header-col" |
| | | ><span>序列号</span></el-col |
| | | > --> |
| | | <!-- <el-col :span="2" class="batch-product-out-form-header-col" |
| | | ><span>载具编号</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>每盘产量</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | > --> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>起始米标</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>截止米标</span></el-col |
| | | > |
| | | > --> |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>单位</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | <!-- <el-col :span="2" class="batch-product-out-form-header-col" |
| | | ><span>WDR号</span></el-col |
| | | > --> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>分段描述</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | > --> |
| | | <el-col :span="2" class="batch-product-out-form-header-col" |
| | | ><span>生产数量</span></el-col |
| | | > |
| | | <el-col :span="2" class="batch-product-out-form-header-col" |
| | | ><span>报废数量</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | <!-- <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>盘具重量</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | | > --> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>毛重</span></el-col |
| | | > |
| | | > --> |
| | | <!--<el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><span>IFS批次号</span></el-col |
| | | >--> |
| | | <el-col :span="2" class="batch-product-out-form-header-col" |
| | | <el-col :span="3" class="batch-product-out-form-header-col" |
| | | ><span>生产人员</span></el-col |
| | | ><el-col :span="1" class="batch-product-out-form-header-col" |
| | | ><el-col :span="2" class="batch-product-out-form-header-col" |
| | | ><span>备注</span></el-col |
| | | > |
| | | <el-col :span="1" class="batch-product-out-form-header-col" |
| | |
| | | <span class="inline-el-hidden">{{ item.partName }}</span> |
| | | </el-tooltip> |
| | | </el-col> |
| | | <el-col :span="4" class="batch-product-out-form-body-col"> |
| | | <span v-show="!item.batchNoEdit">{{ item.outBatchNo }}</span> |
| | | <!--<el-input v-show="item.batchNoEdit" v-model="item.outBatchNo"> |
| | | <i |
| | | slot="prefix" |
| | | class="el-input__icon el-icon-search" |
| | | style="cursor:pointer" |
| | | @click="openOutPutBatch(item)" |
| | | ></i> |
| | | <i |
| | | slot="suffix" |
| | | class="el-input__icon el-icon-circle-close" |
| | | style="cursor:pointer" |
| | | @click="cleanOutBatchNo(item)" |
| | | ></i> |
| | | </el-input>--> |
| | | </el-col> |
| | | <el-col :span="2" class="batch-product-out-form-body-col l-mes"> |
| | | <!-- <el-col :span="4" class="batch-product-out-form-body-col l-mes"> --> |
| | | <!-- <span>{{ item.outBatchNo }}</span> --> |
| | | <!-- <el-input v-model="item.outBatchNo"> |
| | | </el-input> |
| | | </el-col> --> |
| | | <!-- <el-col :span="2" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.reelNumber"></el-input> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <span>{{ item.productQty }}</span> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | </el-col> --> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.startMeterMark"></el-input> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.endMeterMark"></el-input> |
| | | </el-col> |
| | | </el-col> --> |
| | | <el-col :span="1" class="batch-product-out-form-body-col"> |
| | | <span>{{ item.unit }}</span> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <!-- <el-col :span="2" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.wdr"></el-input> |
| | | </el-col> --> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.segmentDesc"></el-input> |
| | | </el-col> --> |
| | | <el-col :span="2" class="batch-product-out-form-body-col l-mes"> |
| | | <span v-text="item.outNum"></span> |
| | | </el-col> |
| | | <el-col :span="2" class="batch-product-out-form-body-col l-mes"> |
| | | <el-select v-model="item.scrapQty"> |
| | | <el-option label="0" value="0"> |
| | | </el-option> |
| | | <el-option label="1" value="1"> |
| | | </el-option> |
| | | </el-select> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.scrapQty"></el-input> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.reelWeight"></el-input> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | </el-col> --> |
| | | <!-- <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.grossWeight"></el-input> |
| | | </el-col> |
| | | </el-col> --> |
| | | <!--<el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.ifsBatchNo"></el-input> |
| | | </el-col>--> |
| | | <el-col :span="2" class="batch-product-out-form-body-col"> |
| | | <el-col :span="3" class="batch-product-out-form-body-col"> |
| | | <el-tooltip |
| | | class="item" |
| | | effect="dark" |
| | |
| | | <!--<el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.remark"></el-input> |
| | | </el-col>--> |
| | | <el-col :span="1" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.mainRemark"></el-input> |
| | | <el-col :span="2" class="batch-product-out-form-body-col l-mes"> |
| | | <el-input v-model="item.remark"></el-input> |
| | | </el-col> |
| | | <el-col :span="1" class="batch-product-out-form-body-col"> |
| | | <span |
| | |
| | | </div> |
| | | </div> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <div style="display: inline-block;width: 25%;float: left"> |
| | | <!-- <div style="display: inline-block;width: 25%;float: left"> |
| | | <el-button |
| | | style="margin-right: 34px" |
| | | type="primary" |
| | | @click="addProductOutForPerson" |
| | | >添加</el-button |
| | | > |
| | | </div> |
| | | </div> --> |
| | | <el-button @click="innerVisible = false">取 消</el-button> |
| | | <el-button |
| | | type="primary" |
| | | :disabled="saveDisabled" |
| | | @click="saveProductOuts" |
| | | @click="saveProductOuts2" |
| | | >确 定</el-button |
| | | > |
| | | </div> |
| | |
| | | batchSaveProductMain, |
| | | getShiftProductOutByOpIdAndWsId, |
| | | validateOverProduction, |
| | | validateOverFeed |
| | | validateOverFeed, |
| | | submitProductMain |
| | | } from '@/api/product/personboard' |
| | | import ElButton from '../../../../node_modules/element-ui/packages/button/src/button.vue' |
| | | import OutPutBatch from './outputbatch.vue' |
| | |
| | | data() { |
| | | return { |
| | | innerVisible: false, |
| | | staffNameList: [], |
| | | personSelection: [], |
| | | saveDisabled: false, |
| | | currDutyInitproducts: [], // 用于缓存页面中原有的staff产出记录,并且是属于当前班次下的,用于勾选人员时作为原数据参照 |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | initProductList(){ |
| | | let val = this.personSelection |
| | | //按人员报工 |
| | | if(this.groupStatus){ |
| | | this.products = [] |
| | | this.addProductOutForPerson() |
| | | }else{ |
| | | //按组报工 |
| | | let nameList = [] |
| | | val.forEach(obj=>{ |
| | | nameList.push(obj.staffName) |
| | | }) |
| | | let staffName = Array.from(new Set(nameList)).join(",") |
| | | if(staffName!=''){ |
| | | this.products = this.productList |
| | | this.products.forEach(item=>{ |
| | | item.staffName = staffName |
| | | item.outNum=1 |
| | | }) |
| | | }else{ |
| | | this.products = [] |
| | | } |
| | | } |
| | | }, |
| | | handleClose(){ |
| | | this.$emit('update:currshowlist', false) |
| | | this.$nextTick(()=>{ |
| | | this.$refs.productOutPersonList.clearSelection() |
| | | }) |
| | | }, |
| | | isNumber(value) { |
| | | var reg = /^[0-9]+(.[0-9]{1,4})?$/ |
| | | if ( |
| | |
| | | // 再去与products(此为页面的实时数据,用户有改动即更新)对比,将其中存在的相同人员的生产数量和生产批次同步过来,若products中生产数量或生产批次不存在值,则不进行同步,沿用原来的。 |
| | | // 最后,将组装好的选中人员信息,更新到products(按照班次进行),注意更新之后选中人员信息在products位置顺序 |
| | | this.personSelection = val |
| | | if(this.currshowlist){ |
| | | this.initProductList() |
| | | } |
| | | }, |
| | | // 根据选中的人员,生成人员产出信息,并且放在右边列表的最前面 |
| | | addProductOutForPerson() { |
| | |
| | | newProduct.partNo = this.parentInfo.partNo |
| | | newProduct.partName = this.parentInfo.partName |
| | | newProduct.outBatchNo = oriOutBatchNo |
| | | newProduct.productQty = 0 |
| | | newProduct.productQty = 1 |
| | | newProduct.outNum = 1 |
| | | newProduct.unit = this.parentInfo.unit |
| | | newProduct.productStaffs = productStaffs |
| | | newProduct.productStaffIds = productStaffIds |
| | |
| | | // row.outBatchNo = null |
| | | } |
| | | }, |
| | | saveProductOuts2() { |
| | | this.clickDateArr.push(new Date().getTime()) |
| | | var productOutputList = [] |
| | | this.products.forEach(a=>{ |
| | | productOutputList.push({ |
| | | partId: a.partId, |
| | | productQty: a.outNum, |
| | | outBatchNo: a.outBatchNo, |
| | | scrapQty: a.scrapQty, |
| | | remark: a.remark, |
| | | wdr: a.wdr, |
| | | staffNo: a.staffNo, |
| | | staffName: a.staffName, |
| | | status: a.status, |
| | | dutyRecordId: a.dutyRecordId, |
| | | productStaffIds: a.productStaffIds, |
| | | productStaffs: a.productStaffs, |
| | | sortNo: a.sortNo |
| | | }) |
| | | }) |
| | | var productMains = { |
| | | productOutputList: productOutputList, |
| | | workstationId: this.parentInfo.workstationId, |
| | | operationTaskId: this.parentInfo.operationTaskId, |
| | | } |
| | | submitProductMain(productMains).then(res=>{ |
| | | this.$emit('refreshProductOutputList', res.data.data) |
| | | this.innerVisible = false |
| | | }) |
| | | }, |
| | | saveProductOuts() { |
| | | var canClickFlag = true |
| | | this.clickDateArr.push(new Date().getTime()) |
| | | if (this.clickDateArr.length > 1) { |
| | | /* if (this.clickDateArr.length > 1) { |
| | | if ( |
| | | this.clickDateArr[this.clickDateArr.length - 1] - |
| | | this.clickDateArr[this.clickDateArr.length - 2] < |
| | |
| | | // 小于2秒则认为重复提交 |
| | | canClickFlag = false |
| | | } |
| | | } |
| | | } */ |
| | | |
| | | if (canClickFlag) { |
| | | this.saveDisabled = true |
| | |
| | | s_list = JSON.parse(JSON.stringify(p_list)) |
| | | } |
| | | |
| | | if (s_list.length <= 0) { |
| | | /* if (s_list.length <= 0) { |
| | | this.$message.error('报工,请填写盘数!') |
| | | this.saveDisabled = false |
| | | return |
| | | } |
| | | let totalDisNumber = 0 |
| | | for (let i = 0; i < s_list.length; i++) { |
| | | // 盘数校验 |
| | | if (!this.isPositiveIntegerNumber(s_list[i].disNumber)) { |
| | | validateFlag = false |
| | | if (this.groupStatus) { |
| | | validateMsg = |
| | | '人员:' + |
| | | s_list[i].staffName + |
| | | ',所在行,【盘数】请输入正整数!' |
| | | } else { |
| | | validateMsg = '第' + (i + 1) + '行,【盘数】请输入正整数!' |
| | | } |
| | | break |
| | | } |
| | | totalDisNumber += s_list[i].disNumber - 0 |
| | | // 起始米标校验 |
| | | if (!this.isNumber(s_list[i].startMeterMark)) { |
| | | validateFlag = false |
| | | validateMsg = |
| | | '第' + (i + 1) + '行,【起始米标】请输入非负数,小数位最多4位!' |
| | | break |
| | | } |
| | | // 截止米标校验 |
| | | if (!this.isNumber(s_list[i].endMeterMark)) { |
| | | validateFlag = false |
| | | validateMsg = |
| | | '第' + (i + 1) + '行,【截止米标】请输入非负数,小数位最多4位!' |
| | | break |
| | | } |
| | | // 截止米标需大于开始米标 |
| | | if ( |
| | | Number(s_list[i].endMeterMark) < Number(s_list[i].startMeterMark) |
| | | ) { |
| | | validateFlag = false |
| | | validateMsg = |
| | | '第' + (i + 1) + '行,【截止米标】需大于【起始米标】' |
| | | break |
| | | } |
| | | } |
| | | const maxDisNumber = 2000 // 最大盘数 |
| | | } */ |
| | | // let totalDisNumber = 0 |
| | | // for (let i = 0; i < s_list.length; i++) { |
| | | // // 盘数校验 |
| | | // /* if (!this.isPositiveIntegerNumber(s_list[i].disNumber)) { |
| | | // validateFlag = false |
| | | // if (this.groupStatus) { |
| | | // validateMsg = |
| | | // '人员:' + |
| | | // s_list[i].staffName + |
| | | // ',所在行,【盘数】请输入正整数!' |
| | | // } else { |
| | | // validateMsg = '第' + (i + 1) + '行,【盘数】请输入正整数!' |
| | | // } |
| | | // break |
| | | // } */ |
| | | // totalDisNumber += s_list[i].disNumber - 0 |
| | | // // 起始米标校验 |
| | | // if (!this.isNumber(s_list[i].startMeterMark)) { |
| | | // validateFlag = false |
| | | // validateMsg = |
| | | // '第' + (i + 1) + '行,【起始米标】请输入非负数,小数位最多4位!' |
| | | // break |
| | | // } |
| | | // // 截止米标校验 |
| | | // if (!this.isNumber(s_list[i].endMeterMark)) { |
| | | // validateFlag = false |
| | | // validateMsg = |
| | | // '第' + (i + 1) + '行,【截止米标】请输入非负数,小数位最多4位!' |
| | | // break |
| | | // } |
| | | // // 截止米标需大于开始米标 |
| | | // if ( |
| | | // Number(s_list[i].endMeterMark) < Number(s_list[i].startMeterMark) |
| | | // ) { |
| | | // validateFlag = false |
| | | // validateMsg = |
| | | // '第' + (i + 1) + '行,【截止米标】需大于【起始米标】' |
| | | // break |
| | | // } |
| | | // } |
| | | /* const maxDisNumber = 2000 // 最大盘数 |
| | | if (totalDisNumber > maxDisNumber) { |
| | | validateMsg = '总盘数不能大于' + maxDisNumber + '!' |
| | | validateFlag = false |
| | | } |
| | | } */ |
| | | if (validateFlag) { |
| | | if (this.parentInfo.productOutId == null) { |
| | | // 当前是产出的新增 |
| | |
| | | this.products.push(this.productList[i]) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.productOutPersonList.clearSelection() |
| | | this.$refs.productOutPersonList.toggleAllSelection() |
| | | }) |
| | | } else { |
| | | for (let i = 0; i < this.productList.length; i++) { |
| | | this.products.push(this.productList[i]) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.$refs.productOutPersonList.clearSelection() |
| | | this.$refs.productOutPersonList.toggleAllSelection() |
| | | }) |
| | | } |
| | | } |