| | |
| | | <span>新增投料</span> |
| | | </div> |
| | | </div> |
| | | <template v-if="wuList.length > 0"> |
| | | <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)"> |
| | | <van-swipe-cell v-for="(item, index) in wuList" :key="index"> |
| | | <div class="bg_list_item_h"> |
| | | <div class="bg_list_item_num"> |
| | |
| | | </template> |
| | | </van-swipe-cell> |
| | | </template> |
| | | <template v-else> |
| | | <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)"> |
| | | <div class="kong"> |
| | | <span>暂无数据</span> |
| | | </div> |
| | |
| | | <span><b>*</b>良品数</span> |
| | | <div class="bg_list_item_num_item_sr"> |
| | | <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="请输入" /> |
| | | <span>块</span> |
| | | <span v-if="from.processPlan">{{from.processPlan.unitName}}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <span>不良数</span> |
| | | <div class="bg_list_item_num_item_sr"> |
| | | <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="请输入" /> |
| | | <span>块</span> |
| | | <span v-if="from.processPlan">{{from.processPlan.unitName}}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="bg_list_item_num_item"> |
| | | <span>工资单价</span> |
| | | <div class="bg_list_item_num_item_sr"> |
| | | <span class="color1">{{infoBox.salary}}元/{{infoBox.type == 0 ? '件' : '时'}}</span> |
| | | <span class="color1">{{(infoBox.salary / 10 / 10).toFixed(2)}}元/{{infoBox.type == 0 ? '件' : '时'}}</span> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="bg_footer_submit" @click="submit">提交</div> |
| | | </div> |
| | | <!-- 选择不良项 --> |
| | | <van-popup v-model:show="show" round position="bottom" :style="{ height: '53%' }"> |
| | | <van-popup v-model:show="show" round position="bottom"> |
| | | <div class="bl"> |
| | | <div class="bl_head"> |
| | | <img src="@/assets/icon/ic_close@2x.png" style="opacity: 0;" alt="" /> |
| | |
| | | text: 'name' |
| | | }; |
| | | let userShow = ref(false) |
| | | let userList = ref([]) |
| | | let wuList: any = ref([]) |
| | | let wuList = ref<Array<any>>([]) |
| | | |
| | | // 产出数量验证 |
| | | const changeNum = (type: number) => { |
| | |
| | | } else { |
| | | if (!wuList.value.length === 0) return Toast('投料不能为空') |
| | | } |
| | | if (!from.qualified) return Toast('良品数不能为空') |
| | | if (!from.qualified && !from.undesirable) { |
| | | return Toast('良品数与不良数不能同时为空') |
| | | } |
| | | // if (!from.qualified) return Toast('良品数不能为空') |
| | | // 有不良数 |
| | | if (from.undesirable > 0) { |
| | | if (from.defective.length === 0) return Toast('不良项不能为空') |
| | |
| | | autoWorkReport({ |
| | | createWorkorderRecordDTO: { |
| | | duration: from.duration, |
| | | qualifiedNum: from.qualified, |
| | | unQualifiedNum: from.undesirable |
| | | qualifiedNum: from.qualified ? from.qualified : 0, |
| | | unQualifiedNum: from.undesirable ? from.undesirable : 0 |
| | | }, |
| | | plansId: from.processPlan.id, |
| | | proGroupId: deviceId.value, |
| | |
| | | |
| | | // 预计工资 |
| | | const expectedSalary = computed(() => { |
| | | if (!infoBox.value) return 0 |
| | | if (!infoBox.value) return 0; |
| | | // 按件计算 |
| | | if (infoBox.value.type == 0) { |
| | | console.log('计件') |
| | | if (!from.qualified) return 0 |
| | | if (infoBox.value.unqualified == 1) { // 是否计入不良品 |
| | | let total = Number(from.qualified) + Number(from.undesirable) |
| | | return total * infoBox.value.salary |
| | | return (total * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0 |
| | | } else { |
| | | return Number(from.qualified) * infoBox.value.salary |
| | | return (Number(from.qualified) * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0 |
| | | } |
| | | } else { |
| | | console.log('计时') |
| | | if (!from.duration) return 0; |
| | | let h = (from.duration / 60 / 60).toFixed(2) |
| | | return Number(h) * infoBox.value.salary |
| | | return (Number(h) * (infoBox.value.salary / 10 / 10)).toFixed(2) || 0 |
| | | } |
| | | }) |
| | | |
| | | // 达标率 |
| | | const complianceRate = computed(() => { |
| | | if (!infoBox.value) return 0; |
| | | if (!from.qualified) return 0; |
| | | if (!from.qualified && !from.undesirable) return 0; |
| | | if (!from.duration) return 0; |
| | | // 按件计算 |
| | | // if (infoBox.value.type == 0) { |
| | | // if (infoBox.value.unqualified == 1) { // 是否计入不良品 |
| | | if (infoBox.value.unqualified == 1) { // 是否计入不良品 |
| | | let a = ((Number(from.qualified) + Number(from.undesirable)) / (from.duration / 60 / 60)).toFixed(2) |
| | | let b = (infoBox.value.num / (infoBox.value.times / 60 / 60)).toFixed(2) |
| | | console.log(a) |
| | | console.log(b) |
| | | return (Number(a) / Number(b)).toFixed(2) |
| | | return ((Number(a) / Number(b)) * 100).toFixed(2) || 0 |
| | | // let total = (Number(from.qualified) + Number(from.undesirable)) / ((from.duration * 60 * 60) * infoBox.value.num / ) |
| | | // return total * infoBox.value.salary; |
| | | // } else { |
| | | // return Number(from.qualified) * infoBox.value.salary; |
| | | // } |
| | | } else { |
| | | let a = (from.qualified / (from.duration / 60 / 60)).toFixed(2) |
| | | let b = (infoBox.value.num / (infoBox.value.times / 60 / 60)).toFixed(2) |
| | | console.log(a) |
| | | console.log(b) |
| | | return ((Number(a) / Number(b)) * 100).toFixed(2) || 0 |
| | | // return Number(from.qualified) * infoBox.value.salary; |
| | | } |
| | | // } else { |
| | | // console.log('按时长') |
| | | // } |
| | |
| | | // 获取类型 |
| | | getIdPlansExt(res.id) |
| | | .then(res2 => { |
| | | if (res.code === 200) { |
| | | if (res2.code === 200) { |
| | | bomType.value = res2.data.bomType |
| | | hasBom.value = res2.data.hasBom |
| | | } |
| | |
| | | font-size: 28px; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | padding: 0 30px |
| | | padding: 0 30px; |
| | | } |
| | | .wulll { |
| | | width: 400px; |
| | |
| | | } |
| | | } |
| | | .bl { |
| | | width: 100%; |
| | | height: 800px; |
| | | padding: 30px; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .bl_head { |
| | | width: 100%; |
| | | height: 50px; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | |
| | | } |
| | | .bl_list { |
| | | width: 100%; |
| | | height: 550px; |
| | | height: calc(100% - 168px); |
| | | overflow-y: scroll; |
| | | margin-top: 30px; |
| | | .bl_list_item { |