| | |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list"> |
| | | <view class="bg_list_item"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>生产信息</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num" @click="openDev"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>生产设备</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | <template v-if="plansId"> |
| | | <view class="bg_list"> |
| | | <view class="bg_list_item"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>生产信息</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num" @click="userShow = true"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>生产人员</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>生产投料</text> |
| | | </view> |
| | | <view class="bg_list_item_top_right" @click="openMaterial" v-if="(hasBom == 1 && bomType != 1) || hasBom == 0"> |
| | | <image src="@/static/gongdan_ic_shoudong@2x.png" alt="" /> |
| | | <text>新增投料</text> |
| | | </view> |
| | | </view> |
| | | <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)"> |
| | | <van-swipe-cell v-for="(item, index) in wuList" :key="index"> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <view class="bg_list_item_num_item_wl"> |
| | | <text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text> |
| | | <view class="bg_list_item_num_item_wl_lx"> |
| | | <text class="green" v-if="item.qualityType == 0">合格 / </text> |
| | | <text class="yellow" v-if="item.qualityType == 1">不良 / </text> |
| | | <text class="red" v-if="item.qualityType == 2">报废 / </text> |
| | | <text>{{ item.locationName || '-' }} / </text> |
| | | <text>{{ item.batch || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <u--input |
| | | placeholder="请输入" |
| | | border="surround" |
| | | type="number" |
| | | :customStyle="{width: '100%'}" |
| | | v-model="item.num" |
| | | @input="inputwl(index)" |
| | | ></u--input> |
| | | <!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> --> |
| | | <text>{{ item.unitName }}</text> |
| | | </view> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num" @click="openDev"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>生产设备</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <template #right> |
| | | <van-button style="height: 100%;" @click="deleItem(index)" square text="删除" type="danger" /> |
| | | </template> |
| | | </van-swipe-cell> |
| | | </template> |
| | | <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)"> |
| | | <view class="kong"> |
| | | <text>暂无数据</text> |
| | | </view> |
| | | </template> |
| | | <view class="kong" v-if="hasBom == 1 && bomType == 1"> |
| | | <text>当前工序无需投料</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item bottomval"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>产出明细</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text><text>*</text>良品数</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <u--input |
| | | placeholder="请输入" |
| | | border="surround" |
| | | type="number" |
| | | :customStyle="{width: '180rpx'}" |
| | | v-model="from.qualified" |
| | | @input="changeNum(1)" |
| | | ></u--input> |
| | | <!-- <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="请输入" /> --> |
| | | <text v-if="from.processPlan">{{from.processPlan.unitName}}</text> |
| | | <view class="bg_list_item_num" @click="userShow = true"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>生产人员</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text :style="{color: from.userName ? '#333' : ''}">{{from.userName ? from.userName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>不良数</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <u--input |
| | | placeholder="请输入" |
| | | border="surround" |
| | | type="number" |
| | | :customStyle="{width: '180rpx'}" |
| | | v-model="from.undesirable" |
| | | @input="changeNum(2)" |
| | | ></u--input> |
| | | <!-- <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="请输入" /> --> |
| | | <text v-if="from.processPlan">{{from.processPlan.unitName}}</text> |
| | | </view> |
| | | <view class="bg_list_item"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>生产投料</text> |
| | | </view> |
| | | <view class="bg_list_item_top_right" @click="openMaterial" v-if="(hasBom == 1 && bomType != 1) || hasBom == 0"> |
| | | <image src="@/static/gongdan_ic_shoudong@2x.png" alt="" /> |
| | | <text>新增投料</text> |
| | | </view> |
| | | </view> |
| | | <template v-if="wuList.length > 0 && !(hasBom == 1 && bomType == 1)"> |
| | | <van-swipe-cell v-for="(item, index) in wuList" :key="index"> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <view class="bg_list_item_num_item_wl"> |
| | | <text>{{ item.materialName }}{{ item.procedureName ? ` | ${item.procedureName}` : '' }}</text> |
| | | <view class="bg_list_item_num_item_wl_lx"> |
| | | <text class="green" v-if="item.qualityType == 0">合格 / </text> |
| | | <text class="yellow" v-if="item.qualityType == 1">不良 / </text> |
| | | <text class="red" v-if="item.qualityType == 2">报废 / </text> |
| | | <text>{{ item.locationName || '-' }} / </text> |
| | | <text>{{ item.batch || '-' }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <u--input |
| | | placeholder="请输入" |
| | | border="surround" |
| | | type="number" |
| | | :customStyle="{width: '100%'}" |
| | | v-model="item.num" |
| | | @input="inputwl(index)" |
| | | ></u--input> |
| | | <!-- <input type="number" v-model="item.num" @input="inputwl(index)" /> --> |
| | | <text>{{ item.unitName }}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <template #right> |
| | | <van-button style="height: 100%;" @click="deleItem(index)" square text="删除" type="danger" /> |
| | | </template> |
| | | </van-swipe-cell> |
| | | </template> |
| | | <template v-else-if="wuList.length == 0 && !(hasBom == 1 && bomType == 1)"> |
| | | <view class="kong"> |
| | | <text>暂无数据</text> |
| | | </view> |
| | | </template> |
| | | <view class="kong" v-if="hasBom == 1 && bomType == 1"> |
| | | <text>当前工序无需投料</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item bottomval"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>产出明细</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text><text>*</text>良品数</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <u--input |
| | | placeholder="请输入" |
| | | border="surround" |
| | | type="number" |
| | | :customStyle="{width: '180rpx'}" |
| | | v-model="from.qualified" |
| | | @input="changeNum(1)" |
| | | ></u--input> |
| | | <!-- <input type="number" v-model="from.qualified" @input="changeNum(1)" placeholder="请输入" /> --> |
| | | <text v-if="from.processPlan">{{from.processPlan.unitName}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>不良数</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <u--input |
| | | placeholder="请输入" |
| | | border="surround" |
| | | type="number" |
| | | :customStyle="{width: '180rpx'}" |
| | | v-model="from.undesirable" |
| | | @input="changeNum(2)" |
| | | ></u--input> |
| | | <!-- <input type="number" v-model="from.undesirable" @input="changeNum(2)" placeholder="请输入" /> --> |
| | | <text v-if="from.processPlan">{{from.processPlan.unitName}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num" v-if="from.undesirable > 0"> |
| | | <view class="bg_list_item_num_item" @click="openBL"> |
| | | <!-- <text>*</text> --> |
| | | <text>不良项</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '设置'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num" v-if="from.undesirable > 0"> |
| | | <view class="bg_list_item_num_item" @click="openBL"> |
| | | <!-- <text>*</text> --> |
| | | <text>不良项</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="wulll" :style="{color: from.defectiveName ? '#305ED5' : ''}">{{from.defectiveName ? from.defectiveName : '设置'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | <view class="bg_plan" @click="TimeShow = true"> |
| | | <view class="bg_plan_label"> |
| | | <text>报工时长</text> |
| | | </view> |
| | | <view class="bg_plan_label_val"> |
| | | <text :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item" v-if="arrType && arrType.length > 0 && from.duration > 0"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>工资绩效</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>计件方式</text> |
| | | <view class="bg_list_item_num_item_list"> |
| | | <view :class="item.active ? 'bg_list_item_num_item_list_item active' : 'bg_list_item_num_item_list_item'" v-for="(item, index) in arrType" :key="index" @click="clickPerformanceType(index)">{{ item.name }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>工资单价</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}元/{{arrType[from.index].type == 0 ? '件' : '时'}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>预计工资</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="color1">{{expectedSalary}}元</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>达标率</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="color1">{{complianceRate}}%</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_plan" @click="TimeShow = true"> |
| | | <view class="bg_plan_label"> |
| | | <text>报工时长</text> |
| | | </view> |
| | | <view class="bg_plan_label_val"> |
| | | <text :style="{color: from.durationName ? '#333' : ''}">{{from.durationName ? from.durationName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | <!-- 报工按钮 --> |
| | | <view class="bh_zw"></view> |
| | | <view class="bg_footer"> |
| | | <view class="bg_footer_submit1" @click="continueSubmit">继续报工</view> |
| | | <view class="bg_footer_submit" @click="submit">提交</view> |
| | | </view> |
| | | <view class="bg_list_item" v-if="arrType && arrType.length > 0 && from.duration > 0"> |
| | | <view class="bg_list_item_top"> |
| | | <view class="bg_list_item_top_left"> |
| | | <view class="bg_list_item_top_left_x"></view> |
| | | <text>工资绩效</text> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_h"> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>计件方式</text> |
| | | <view class="bg_list_item_num_item_list"> |
| | | <view :class="item.active ? 'bg_list_item_num_item_list_item active' : 'bg_list_item_num_item_list_item'" v-for="(item, index) in arrType" :key="index" @click="clickPerformanceType(index)">{{ item.name }}</view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>工资单价</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="color1">{{(arrType[from.index].salary / 10 / 10).toFixed(2)}}元/{{arrType[from.index].type == 0 ? '件' : '时'}}</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>预计工资</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="color1">{{expectedSalary}}元</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="bg_list_item_num"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>达标率</text> |
| | | <view class="bg_list_item_num_item_sr"> |
| | | <text class="color1">{{complianceRate}}%</text> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 报工按钮 --> |
| | | <view class="bh_zw"></view> |
| | | <view class="bg_footer"> |
| | | <view class="bg_footer_submit1" @click="continueSubmit">继续报工</view> |
| | | <view class="bg_footer_submit" @click="submit">提交</view> |
| | | </view> |
| | | </template> |
| | | |
| | | <!-- 生产人员 --> |
| | | <user :show="userShow" @close="userShow = false" @value="onConfirm1" /> |
| | | <!-- 生产设备 --> |
| | |
| | | ...mapState(['userInfo']), |
| | | // 预计工资 |
| | | expectedSalary() { |
| | | |
| | | if (this.arrType.length === 0) return 0; |
| | | if (this.arrType[this.from.index].type == 0) { |
| | | if (!this.from.qualified) return 0 |
| | | if (this.arrType[this.from.index].unqualified == 1) { // 是否计入不良品 |
| | | let total = Number(this.from.qualified) + Number(this.from.undesirable) |
| | | return (total * (this.arrType[from.index].salary / 10 / 10)).toFixed(2) |
| | | let { index, qualified, undesirable, duration } = this.from |
| | | let temp = this.arrType[index] |
| | | if (temp.type == 0) { |
| | | if (!qualified) return 0 |
| | | if (temp.unqualified == 1) { // 是否计入不良品 |
| | | let total = Number(qualified) + Number(undesirable) |
| | | return (total * (temp.salary / 10 / 10)).toFixed(2) |
| | | } else { |
| | | return (Number(this.from.qualified) * (this.arrType[this.from.index].salary / 10 / 10)).toFixed(2) |
| | | return (Number(qualified) * (temp.salary / 10 / 10)).toFixed(2) |
| | | } |
| | | } else { |
| | | if (!this.from.duration) return 0; |
| | | let h = (this.from.duration / 60 / 60).toFixed(2) |
| | | return (Number(h) * (this.arrType[this.from.index].salary / 10 / 10)).toFixed(2) |
| | | if (!duration) return 0; |
| | | let h = (duration / 60 / 60).toFixed(2) |
| | | return (Number(h) * (temp.salary / 10 / 10)).toFixed(2) |
| | | } |
| | | }, |
| | | // 达标率 |
| | | complianceRate() { |
| | | if (this.arrType.length === 0) return 0; |
| | | if (!this.from.qualified && !this.from.undesirable) return 0; |
| | | if (!this.from.duration) return 0; |
| | | if (!this.arrType[this.from.index].num) return 0; |
| | | if (this.arrType[this.from.index].unqualified == 1) { // 是否计入不良品 |
| | | let a = ((Number(this.from.qualified) + Number(this.from.undesirable)) / (this.from.duration / 3600)).toFixed(2) |
| | | let b = (this.arrType[this.from.index].num / (this.arrType[this.from.index].times / 3600)).toFixed(2) |
| | | let { index, qualified, undesirable, duration } = this.from |
| | | let temp = this.arrType[index] |
| | | if (!qualified && !undesirable) return 0; |
| | | if (!duration) return 0; |
| | | if (!temp.num) return 0; |
| | | if (temp.unqualified == 1) { // 是否计入不良品 |
| | | let a = ((Number(qualified) + Number(undesirable)) / (duration / 3600)).toFixed(2) |
| | | let b = (temp.num / (temp.times / 3600)).toFixed(2) |
| | | return ((Number(a) / Number(b)) * 100).toFixed(2) |
| | | } else { |
| | | let a = (this.from.qualified / (this.from.duration / 3600)).toFixed(2) |
| | | let b = (this.arrType[this.from.index].num / (this.arrType[this.from.index].times / 3600)).toFixed(2) |
| | | let a = (qualified / (duration / 3600)).toFixed(2) |
| | | let b = (temp.num / (temp.times / 3600)).toFixed(2) |
| | | return ((Number(a) / Number(b)) * 100).toFixed(2) |
| | | } |
| | | } |
| | |
| | | this.wuList = [] |
| | | this.from.defective = [] |
| | | this.from.defectiveName = '' |
| | | this.from.userName = '' |
| | | this.from.userId = '' |
| | | // this.from.userName = '' |
| | | // this.from.userId = '' |
| | | // 获取设备 |
| | | getDeviceByCondition({ procedureId: data.obj.procedureId }) |
| | | .then(res1 => { |