|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <page-meta :page-style="(badShow||statistics) ?'overflow: hidden;': ''"/> | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <view> | 
|---|
|  |  |  | <view class="tips-label">当前任务需要质检;产出后,请耐心等待质检员检验,并根据检验结果调整产出数据后再报工。</view> | 
|---|
|  |  |  | <workOrderInfo :orederMessage="info" /> | 
|---|
|  |  |  | 
|---|
|  |  |  | :style="{ color: form.durationName ? '#333' : '' }">{{ form.durationName ? form.durationName : '请选择' }}</span> | 
|---|
|  |  |  | <image src="../../../static/ic_ar@2x.png" class="img_ar" mode=""></image> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- form.duration &&  --> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="bg_list_item" v-if="arrType && arrType.length > 0"> | 
|---|
|  |  |  | <div class="bg_list_item_top"> | 
|---|
|  |  |  | <div class="bg_list_item_top_left"> | 
|---|
|  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="details_dj" v-if="typeView === 1"> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <div class="details_dj_list"> | 
|---|
|  |  |  | <u-swipe-action v-for="(item, index) in djData" :key="index"> | 
|---|
|  |  |  | <u-swipe-action-item :options="options" @click="dele(item.id)"> | 
|---|
|  |  |  | <div class="details_dj_list_item"> | 
|---|
|  |  |  | <span>{{ item.attrName }}:{{ item.val }}</span> | 
|---|
|  |  |  | <span>{{ item.userName }} {{ item.createTime }}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </u-swipe-action-item> | 
|---|
|  |  |  | </u-swipe-action> | 
|---|
|  |  |  | <div class="details_dj_list"> | 
|---|
|  |  |  | <scroll-view scroll-y="true" refresher-enabled="true" @scrolltolower="getLists"> | 
|---|
|  |  |  | <u-swipe-action v-for="(item, index) in djData" :key="index"> | 
|---|
|  |  |  | <u-swipe-action-item :options="options" @click="dele(item.id)"> | 
|---|
|  |  |  | <div class="details_dj_list_item"> | 
|---|
|  |  |  | <span>{{ item.attrName }}:{{ item.val }}</span> | 
|---|
|  |  |  | <span>{{ item.userName }} {{ item.createTime }}</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </u-swipe-action-item> | 
|---|
|  |  |  | </u-swipe-action> | 
|---|
|  |  |  | </scroll-view> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <!-- v-if="info.status === 2 || info.procedureNeedcheck === 1" --> | 
|---|
|  |  |  | <!-- status 0已创建、1已备料、2已完工、3已检验、4已报工、5已入库、6已取消、7生产中 --> | 
|---|
|  |  |  | <!-- procedureNeedcheck 工序是否需要检验才能报工 0是 1否 --> | 
|---|
|  |  |  | <template v-if="typeView == 0 &&( info.status === 2 || info.procedureNeedcheck === 1 )"> | 
|---|
|  |  |  | <!-- v-if="info.status === 2 || info.procedureNeedcheck === 1" --> | 
|---|
|  |  |  | <template v-if="info.status === 2 || info.procedureNeedcheck === 1"> | 
|---|
|  |  |  | <div class="bh_zw"></div> | 
|---|
|  |  |  | <div class="bg_footer bg_f7"> | 
|---|
|  |  |  | <div class="bg_footer_submit bg_m" v-if="typeView == 0" @click="submit">确认报工</div> | 
|---|
|  |  |  | <!-- proxy.$auth('h5:workorder:processRecord') &&  --> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <template v-if="typeView == 1 && info.status !== 4 && info.procedureNeedcheck !== 5 && info.procedureNeedcheck !== 6"> | 
|---|
|  |  |  | <div class="bh_zw"></div> | 
|---|
|  |  |  | <div class="bg_footer bg_f7"> | 
|---|
|  |  |  | <div class="bg_footer_submit1" @click="jumpdj" v-if="typeView == 1"> | 
|---|
|  |  |  | <image src="../../../static/gongdan_ic_shoudong@2x.png" class="fornt-img" mode=""></image> | 
|---|
|  |  |  | <span>新增点检</span> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <u-safe-bottom></u-safe-bottom> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | <u-datetime-picker :show="TimeShow" @cancel="TimeShow=false" @confirm="timeConfirm" v-model="form.time" | 
|---|
|  |  |  | mode="time"></u-datetime-picker> | 
|---|
|  |  |  | <u-popup :show="badShow" @close="badShow=false" :round="8" closeable zIndex="20000"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <view class="fx1 ml20 ptb20 sbtn_green" @click="confirm">确定</view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </u-popup> | 
|---|
|  |  |  | <u-popup :show="statistics" @close="statistics=false" :round="8" closeable zIndex="20000"> | 
|---|
|  |  |  | <div class="tg"> | 
|---|
|  |  |  | <div class="tg_header">请确认报工信息</div> | 
|---|
|  |  |  | <div class="tg_table"> | 
|---|
|  |  |  | <div class="tg_table_header"> | 
|---|
|  |  |  | <div class="tg_table_header_item">类型</div> | 
|---|
|  |  |  | <div class="tg_table_header_item">物料名称</div> | 
|---|
|  |  |  | <!-- <div class="tg_table_header_item">工装数量</div> --> | 
|---|
|  |  |  | <div class="tg_table_header_item">物料数量</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="nr" v-if="statisticsData.length > 0"> | 
|---|
|  |  |  | <div class="tg_table_nr" v-for="(item, index) in statisticsData" :key="index"> | 
|---|
|  |  |  | <div class="tg_table_nr_item">{{ item.name }}</div> | 
|---|
|  |  |  | <div class="tg_table_nr_item">{{ item.materialName }}</div> | 
|---|
|  |  |  | <!-- <div class="tg_table_nr_item">{{item.gznum}}</div> --> | 
|---|
|  |  |  | <div class="tg_table_nr_item" :style="item.name === '工单未投料' ? 'color: #DE5243' : ''"> | 
|---|
|  |  |  | {{ item.num }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="nr" v-else> | 
|---|
|  |  |  | <div class="tg_table_nr"> | 
|---|
|  |  |  | <div class="tg_table_nr_item1">暂无数据</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="tg_footer"> | 
|---|
|  |  |  | <!-- proxy.$auth('h5:workorderoutput:confirm') &&  --> | 
|---|
|  |  |  | <button class="tg_footer_qr" @click="submitBG" v-if="isSubmit">确认报工</button> | 
|---|
|  |  |  | <div class="tg_footer_fh" @click="statistics = false" v-else-if="!isSubmit">返回修改</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </u-popup> | 
|---|
|  |  |  | </view> | 
|---|
|  |  |  | </template> | 
|---|
|  |  |  | 
|---|
|  |  |  | capacity: 10, | 
|---|
|  |  |  | page: 1, | 
|---|
|  |  |  | total: 0 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | statisticsData: [], | 
|---|
|  |  |  | isSubmit: false, | 
|---|
|  |  |  | statistics: false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | onLoad(obj) { | 
|---|
|  |  |  | this.workorderId = obj.id | 
|---|
|  |  |  | this.queryByIds() | 
|---|
|  |  |  | this.getOrocessRecords() | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | this.pageDJs() | 
|---|
|  |  |  | this.getData() | 
|---|
|  |  |  | uni.$on('spotAdd', () => { | 
|---|
|  |  |  | if (this.typeView == 1) { | 
|---|
|  |  |  | this.pages.page = 1 | 
|---|
|  |  |  | 
|---|
|  |  |  | return (Number(h) * (this.arrType[this.form.index].salary / 10 / 10)).toFixed(2) || 0 | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | complianceRate() { | 
|---|
|  |  |  | let { index, duration } = this.form | 
|---|
|  |  |  | let { qualified, undesirable } = this.produceFrom | 
|---|
|  |  |  | complianceRate() { | 
|---|
|  |  |  | if (this.arrType.length === 0) return 0; | 
|---|
|  |  |  | if (!qualified && !undesirable) return 0; | 
|---|
|  |  |  | if (!duration) return 0; | 
|---|
|  |  |  | if (!this.arrType[index].num) return 0; | 
|---|
|  |  |  | if (!this.produceFrom.qualified && !this.produceFrom.undesirable) return 0; | 
|---|
|  |  |  | if (!this.form.duration) return 0; | 
|---|
|  |  |  | if (!this.arrType[this.form.index].num) return 0; | 
|---|
|  |  |  | // 按件计算 | 
|---|
|  |  |  | // if (infoBox.value.type == 0) { | 
|---|
|  |  |  | if (this.arrType[index].unqualified == 1) { // 是否计入不良品 | 
|---|
|  |  |  | let a = ((Number(qualified) + Number(undesirable)) / (duration / 3600)).toFixed(2) | 
|---|
|  |  |  | let b = (this.arrType[index].num / (this.arrType[index].times / 3600)).toFixed(2) | 
|---|
|  |  |  | if (this.arrType[this.form.index].unqualified == 1) { // 是否计入不良品 | 
|---|
|  |  |  | let a = ((Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)) / (this.form | 
|---|
|  |  |  | .duration / 3600)).toFixed(2) | 
|---|
|  |  |  | let b = (this.arrType[this.form.index].num / (this.arrType[form.index].times / 3600)).toFixed(2) | 
|---|
|  |  |  | return ((Number(a) / Number(b)) * 100).toFixed(2) | 
|---|
|  |  |  | // let total = (Number(from.qualified) + Number(from.undesirable)) / ((from.duration * 60 * 60) * infoBox.value.num / ) | 
|---|
|  |  |  | // return total * infoBox.value.salary; | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | let a = (qualified / (duration / 3600)).toFixed(2) | 
|---|
|  |  |  | let b = (this.arrType[index].num / (this.arrType[index].times / 3600)).toFixed(2) | 
|---|
|  |  |  | let a = (this.produceFrom.qualified / (this.form.duration / 3600)).toFixed(2) | 
|---|
|  |  |  | let b = (this.arrType[this.form.index].num / (this.arrType[this.form.index].times / 3600)).toFixed(2) | 
|---|
|  |  |  | return ((Number(a) / Number(b)) * 100).toFixed(2) | 
|---|
|  |  |  | // return Number(from.qualified) * infoBox.value.salary; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | item.id = item.type | 
|---|
|  |  |  | item.active = index == 0 | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.arrType = result.data | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.arrType = result.data | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.arrType = [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | timeConfirm({ | 
|---|
|  |  |  | value | 
|---|
|  |  |  | }) { | 
|---|
|  |  |  | console.log(value) | 
|---|
|  |  |  | let h = Number(value.substring(0, 2)) | 
|---|
|  |  |  | let m = Number(value.substring(3, 5)) | 
|---|
|  |  |  | let s = 0 | 
|---|
|  |  |  | 
|---|
|  |  |  | if (unitAttribute == 0 && num != '') { | 
|---|
|  |  |  | if (!REGULAR.positiveInteger.test(num)) { | 
|---|
|  |  |  | obj.num = obj.ynum | 
|---|
|  |  |  | uni.$u.toast('只能输入正整数') | 
|---|
|  |  |  | Toast({ | 
|---|
|  |  |  | message: '只能输入正整数' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (unitAttribute == 1 && num != '') { | 
|---|
|  |  |  | if (!REGULAR.number.test(num)) { | 
|---|
|  |  |  | uni.$u.toast('只能输入正整数或小数(最多四位)') | 
|---|
|  |  |  | Toast({ | 
|---|
|  |  |  | message: '只能输入正整数或小数(最多四位)' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | obj.num = obj.ynum | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (num > maxNum) { | 
|---|
|  |  |  | obj.num = obj.ynum | 
|---|
|  |  |  | uni.$u.toast('超出工装总数') | 
|---|
|  |  |  | Toast.fail({ | 
|---|
|  |  |  | message: '超出工装总数' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (type === 'C' && num > info.value.planNum) { | 
|---|
|  |  |  | obj.num = obj.ynum | 
|---|
|  |  |  | uni.$u.toast('产出数量不能超过计划数量') | 
|---|
|  |  |  | Toast.fail({ | 
|---|
|  |  |  | message: '产出数量不能超过计划数量' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | updateById({ | 
|---|
|  |  |  | id, | 
|---|
|  |  |  | num | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | if (res.code === 200 && type === 'T') { | 
|---|
|  |  |  | this.getOrocessRecords() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // updateById({ id, num }).then(res => { | 
|---|
|  |  |  | //   if (res.code === 200 && type === 'T') { | 
|---|
|  |  |  | //     getOrocessRecords() | 
|---|
|  |  |  | //   } else if (res.code === 200 && type === 'C') { | 
|---|
|  |  |  | //     // getOrocessRecordCC() | 
|---|
|  |  |  | //   } | 
|---|
|  |  |  | // }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeCC(downType, num, recordId) { | 
|---|
|  |  |  | if (!num) return | 
|---|
|  |  |  | console.log(Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)) | 
|---|
|  |  |  | if ((Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable)) > this.info.planNum) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '产出数量不能大于计划数量', | 
|---|
|  |  |  | 
|---|
|  |  |  | this.form.index = index | 
|---|
|  |  |  | this.form.type = item.type | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getGroupNum(arr) { | 
|---|
|  |  |  | let newArry = {}; | 
|---|
|  |  |  | for (let i = 0; i < arr.length; i++) { | 
|---|
|  |  |  | if (newArry[arr[i].materialName]) { | 
|---|
|  |  |  | newArry[arr[i].materialName].push(arr[i]) | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | newArry[arr[i].materialName] = [arr[i]] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return newArry; | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | submit() { | 
|---|
|  |  |  | let res = this.getGroupNum(this.feedingData) | 
|---|
|  |  |  | if (this.info.bomType === 1) { // 拉式 | 
|---|
|  |  |  | console.log('拉式') | 
|---|
|  |  |  | this.statisticsData = [] | 
|---|
|  |  |  | if (this.produceFrom.qualified <= 0 && this.produceFrom.undesirable <= 0) { | 
|---|
|  |  |  | uni.$u.toast('产出明细不能为空') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (this.info.hasBom === 0) { | 
|---|
|  |  |  | console.log('无bom') | 
|---|
|  |  |  | let arr = [] | 
|---|
|  |  |  | let tl = 0 | 
|---|
|  |  |  | for (let i in res) { | 
|---|
|  |  |  | let num = 0 | 
|---|
|  |  |  | res[i].forEach(item => { | 
|---|
|  |  |  | num += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | arr.push({ | 
|---|
|  |  |  | name: '工单投料', | 
|---|
|  |  |  | materialName: i + res[i][0].procedureName, | 
|---|
|  |  |  | num: num | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.feedingData.forEach(item => { | 
|---|
|  |  |  | tl += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData = [...this.statisticsData, ...arr] | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单合格产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.qualified | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.infostatisticsData.push({ | 
|---|
|  |  |  | name: '工单不良产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.undesirable | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单未投料', | 
|---|
|  |  |  | materialName: '', | 
|---|
|  |  |  | num: this.info.planNum - Number(this.produceFrom.qualified) - Number(this.produceFrom | 
|---|
|  |  |  | .undesirable) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | let total = this.info.planNum - (Number(this.produceFrom.qualified) + Number(this.produceFrom | 
|---|
|  |  |  | .undesirable)) | 
|---|
|  |  |  | if (total === 0) { | 
|---|
|  |  |  | this.isSubmit = true | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.isSubmit = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (this.info.hasBom === 1) { // 有bom情况 | 
|---|
|  |  |  | console.log('有bom') | 
|---|
|  |  |  | let arr = [] | 
|---|
|  |  |  | let tl = 0 | 
|---|
|  |  |  | // let res = getGroupNum(feedingData) | 
|---|
|  |  |  | for (let i in res) { | 
|---|
|  |  |  | let num = 0 | 
|---|
|  |  |  | res[i].forEach(item => { | 
|---|
|  |  |  | num += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | arr.push({ | 
|---|
|  |  |  | name: '工单投料', | 
|---|
|  |  |  | materialName: i, | 
|---|
|  |  |  | num: num | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.feedingData.forEach(item => { | 
|---|
|  |  |  | tl += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData = [...this.statisticsData, ...arr] | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单合格产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.qualified | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单不良产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.undesirable | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.isSubmit = Number(this.produceFrom.qualified) + Number(this.produceFrom.undesirable) <= this | 
|---|
|  |  |  | .info.planNum; | 
|---|
|  |  |  | console.log(this.isSubmit); | 
|---|
|  |  |  | debugger | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | console.log('推式') | 
|---|
|  |  |  | if (this.feedingData.length === 0) { | 
|---|
|  |  |  | uni.$u.toast('投料明细不能为空') | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (this.produceFrom.qualified <= 0 && this.produceFrom.undesirable <= 0) { | 
|---|
|  |  |  | uni.$u.toast('产出明细不能为空') | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.statisticsData = [] | 
|---|
|  |  |  | if (this.info.hasBom === 0) { | 
|---|
|  |  |  | console.log('无bom') | 
|---|
|  |  |  | let arr = [] | 
|---|
|  |  |  | let tl = 0 | 
|---|
|  |  |  | for (let i in res) { | 
|---|
|  |  |  | let num = 0 | 
|---|
|  |  |  | res[i].forEach(item => { | 
|---|
|  |  |  | num += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | arr.push({ | 
|---|
|  |  |  | name: '工单投料', | 
|---|
|  |  |  | materialName: i + '-' + res[i][0].procedureName, | 
|---|
|  |  |  | num: num | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.feedingData.forEach(item => { | 
|---|
|  |  |  | tl += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData = [...this.statisticsData, ...arr] | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单合格产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.qualified | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单不良产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.undesirable | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (Number(tl) <= this.info.planNum) { | 
|---|
|  |  |  | let total = Number(tl) - Number(this.produceFrom.qualified) - Number(this.produceFrom | 
|---|
|  |  |  | .undesirable) // 是否有余 | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单未投料', | 
|---|
|  |  |  | materialName: '', | 
|---|
|  |  |  | num: (Number(tl) - Number(this.produceFrom.qualified) - Number(this.produceFrom | 
|---|
|  |  |  | .undesirable)) | 
|---|
|  |  |  | .toFixed(2) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (total === 0) { | 
|---|
|  |  |  | this.isSubmit = true | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.isSubmit = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.isSubmit = false | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } else if (this.info.hasBom === 1) { // 有bom情况 | 
|---|
|  |  |  | console.log('有bom') | 
|---|
|  |  |  | let arr = [] | 
|---|
|  |  |  | let tl = 0 | 
|---|
|  |  |  | for (let i in res) { | 
|---|
|  |  |  | let num = 0 | 
|---|
|  |  |  | res[i].forEach(item => { | 
|---|
|  |  |  | num += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | arr.push({ | 
|---|
|  |  |  | name: '工单投料', | 
|---|
|  |  |  | materialName: i, | 
|---|
|  |  |  | num: num | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.feedingData.forEach(item => { | 
|---|
|  |  |  | tl += Number(item.num) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData = [...this.statisticsData, ...arr] | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单合格产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.qualified | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.statisticsData.push({ | 
|---|
|  |  |  | name: '工单不良产出', | 
|---|
|  |  |  | materialName: this.info.mmodel.name + '-' + this.info.procedureName, | 
|---|
|  |  |  | num: this.produceFrom.undesirable | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | // isSubmit.value = produceFrom.qualified + produceFrom.undesirable <= info.value.planNum; | 
|---|
|  |  |  | this.isSubmit = true | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.statistics = true | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | submitBG() { | 
|---|
|  |  |  | let createUnqualifiedDTOList = this.form.defective.map((item) => { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | categoryId: item.id, | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | // => { | 
|---|
|  |  |  | //   // if (!from.duration || from.duration <= 0) { | 
|---|
|  |  |  | //   //     return Toast('报工时长不能为空') | 
|---|
|  |  |  | //   // } | 
|---|
|  |  |  | //   let createUnqualifiedDTOList = from.defective.map(item => { | 
|---|
|  |  |  | //     return { | 
|---|
|  |  |  | //       categoryId: item.id, | 
|---|
|  |  |  | //       unQualifiedNum: item.num | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | //   }) | 
|---|
|  |  |  | //   let createWorkorderRecordDTO = { | 
|---|
|  |  |  | //     workorderId: route.query.id, | 
|---|
|  |  |  | //     duration: from.duration ? from.duration : 0, | 
|---|
|  |  |  | //     qualifiedNum: produceFrom.qualified ? produceFrom.qualified : 0, | 
|---|
|  |  |  | //     unQualifiedNum: produceFrom.undesirable ? produceFrom.undesirable : 0 | 
|---|
|  |  |  | //   } | 
|---|
|  |  |  | //   // id: route.query.id | 
|---|
|  |  |  | //   comfirmDoneStandard({ | 
|---|
|  |  |  | //     createUnqualifiedDTOList, | 
|---|
|  |  |  | //     createWorkorderRecordDTO | 
|---|
|  |  |  | //   }).then(res => { | 
|---|
|  |  |  | //     if (res.code === 200) { | 
|---|
|  |  |  | //       Toast.success({ message: '报工成功', forbidClick: true, duration: 2000 }) | 
|---|
|  |  |  | //       setTimeout(() => { | 
|---|
|  |  |  | //         router.go(-2) | 
|---|
|  |  |  | //       }, 2000) | 
|---|
|  |  |  | //     } | 
|---|
|  |  |  | //   }) | 
|---|
|  |  |  | // } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | jumpdj() { | 
|---|
|  |  |  | uni.navigateTo({ | 
|---|
|  |  |  | url: `/pages_adjust/pages/spotCheck/spotCheck?id=${this.workorderId}` | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | total += Number(item.num) | 
|---|
|  |  |  | total = total += item.num | 
|---|
|  |  |  | arr.push(item) | 
|---|
|  |  |  | name += item.name + item.num + ';' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | if (total != Number(this.produceFrom.undesirable)) { | 
|---|
|  |  |  | uni.showToast({ | 
|---|
|  |  |  | title: '不良数必须等于产出不良数', | 
|---|
|  |  |  | 
|---|
|  |  |  | content: '确定删除此条记录吗?', | 
|---|
|  |  |  | success: (res) => { | 
|---|
|  |  |  | if (res.confirm) { | 
|---|
|  |  |  | console.log('用户点击确定'); | 
|---|
|  |  |  | deleteCT(id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.getOrocessRecords() | 
|---|
|  |  |  | // if (type === 'C') { | 
|---|
|  |  |  | //    this.getOrocessRecordCC() | 
|---|
|  |  |  | // } else if (type === 'T') { | 
|---|
|  |  |  | //    this.getOrocessRecords() | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | .catch(err => {}) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|
|  |  |  | // margin-top: 30rpx; | 
|---|
|  |  |  | margin-top: 30rpx; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .bg_list_item { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|
|  |  |  | // margin-bottom: 40rpx; | 
|---|
|  |  |  | // border-bottom: 40rpx #f7f7f7 solid; | 
|---|
|  |  |  | // | 
|---|
|  |  |  | border-bottom: 40rpx #f7f7f7 solid; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .kong { | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | padding: 30rpx 0; | 
|---|
|  |  |  | 
|---|
|  |  |  | .bg_list_item_top { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: space-between; | 
|---|
|  |  |  | background-color: #f7f7f7; | 
|---|
|  |  |  | padding: 30rpx; | 
|---|
|  |  |  | // padding-right: 30rpx; | 
|---|
|  |  |  | justify-content: space-between; | 
|---|
|  |  |  | padding-left: 30rpx; | 
|---|
|  |  |  | padding-right: 30rpx; | 
|---|
|  |  |  | margin-bottom: 30rpx; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .bg_list_item_top_left { | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | 
|---|
|  |  |  | padding: 0 30rpx; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | background: white; | 
|---|
|  |  |  | &:last-child { | 
|---|
|  |  |  | .bg_list_item_num{ | 
|---|
|  |  |  | border: none !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .bg_list_item_num { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | min-height: 98rpx; | 
|---|
|  |  |  | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | border-bottom: 1rpx solid #E5E5E5; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | &:last-child { | 
|---|
|  |  |  | border: none !important; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .kong { | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | font-size: 25rpx; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | span { | 
|---|
|  |  |  | flex-shrink: 0; | 
|---|
|  |  |  | // overflow: hidden; | 
|---|
|  |  |  | // text-overflow: ellipsis; | 
|---|
|  |  |  | // white-space: nowrap; | 
|---|
|  |  |  | overflow: hidden; | 
|---|
|  |  |  | text-overflow: ellipsis; | 
|---|
|  |  |  | white-space: nowrap; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | b { | 
|---|
|  |  |  | font-size: 30rpx; | 
|---|
|  |  |  | 
|---|
|  |  |  | .wulll { | 
|---|
|  |  |  | width: 400rpx; | 
|---|
|  |  |  | text-align: right; | 
|---|
|  |  |  | // overflow: hidden; | 
|---|
|  |  |  | // white-space: nowrap; | 
|---|
|  |  |  | // text-overflow: ellipsis; | 
|---|
|  |  |  | overflow: hidden; | 
|---|
|  |  |  | white-space: nowrap; | 
|---|
|  |  |  | text-overflow: ellipsis; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | span { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .bg_plan { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | border-top: 20rpx #f7f7f7 solid; | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | // height: 98px; | 
|---|
|  |  |  | padding: 30rpx; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | background: #FFFFFF; | 
|---|
|  |  |  | // margin-bottom: 40rpx; | 
|---|
|  |  |  | margin-bottom: 40rpx; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: space-between; | 
|---|
|  |  |  | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | padding: 30rpx 30rpx 60rpx 30rpx; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | z-index: 9999; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .bg_footer_submit1 { | 
|---|
|  |  |  | width: 690rpx; | 
|---|
|  |  |  | 
|---|
|  |  |  | .bottom-view { | 
|---|
|  |  |  | left: 40rpx; | 
|---|
|  |  |  | right: 40rpx; | 
|---|
|  |  |  | bottom: 20rpx | 
|---|
|  |  |  | bottom: 0 | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .bl_list { | 
|---|
|  |  |  | 
|---|
|  |  |  | .bl_list_item_right { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | height: 50rpx; | 
|---|
|  |  |  | text-align: right; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | justify-content: flex-end; | 
|---|
|  |  |  | text-align: right; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | input { | 
|---|
|  |  |  | padding-left: 5rpx; | 
|---|
|  |  |  | width: 160rpx; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 800rpx; | 
|---|
|  |  |  | padding: 30rpx; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_header { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 45rpx; | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | line-height: 45rpx; | 
|---|
|  |  |  | font-size: 30rpx; | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | color: #222222; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_table { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | margin-top: 40rpx; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_table_header { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 72rpx; | 
|---|
|  |  |  | background: #EFF2FC; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_table_header_item { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | font-size: 26rpx; | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | color: #333333; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .nr { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | max-height: calc(100% - 133rpx); | 
|---|
|  |  |  | overflow-x: scroll; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_table_nr { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | padding: 24rpx 10rpx; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | background: white; | 
|---|
|  |  |  | box-shadow: inset 0px -2rpx 0px 0px #E5E5E5; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_table_nr_item { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | font-size: 26rpx; | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | color: #333333; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_table_nr_item1 { | 
|---|
|  |  |  | flex: 1; | 
|---|
|  |  |  | font-size: 26rpx; | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | color: #333333; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_footer { | 
|---|
|  |  |  | width: calc(100% - 60rpx); | 
|---|
|  |  |  | position: fixed; | 
|---|
|  |  |  | bottom: 0; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | justify-content: space-between; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | box-sizing: border-box; | 
|---|
|  |  |  | padding-bottom: 40rpx; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_footer_fh { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 88rpx; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | background: rgba(66, 117, 252, 0.05); | 
|---|
|  |  |  | border-radius: 8rpx; | 
|---|
|  |  |  | border: 1rPX solid #4275FC; | 
|---|
|  |  |  | font-size: 32rpx; | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | color: $nav-color; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | .tg_footer_qr { | 
|---|
|  |  |  | width: 100%; | 
|---|
|  |  |  | height: 88rpx; | 
|---|
|  |  |  | border: none; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | align-items: center; | 
|---|
|  |  |  | justify-content: center; | 
|---|
|  |  |  | background: $nav-color; | 
|---|
|  |  |  | border-radius: 8rpx; | 
|---|
|  |  |  | font-size: 32rpx; | 
|---|
|  |  |  | font-weight: 500; | 
|---|
|  |  |  | color: #FFFFFF; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </style> | 
|---|