| | |
| | | <template> |
| | | <view class="bg"> |
| | | <view class="bg_plan" @click="selectPlan"> |
| | | <view class="bg_plan_label" v-if="!from.processPlan"> |
| | | <text><text>*</text>工序生产计划</text> |
| | | </view> |
| | | <view class="bg_plan_nr" v-else> |
| | | <text>{{ from.processPlan.materialName }} | {{ from.processPlan.materialCode }} | {{ from.processPlan.produceName }}</text> |
| | | <text>{{ from.processPlan.batch }}{{ from.processPlan.salesOrder ? ` / ${from.processPlan.salesOrder}` : '' }}</text> |
| | | <text>计划时间:{{ from.processPlan.workPlanStartDate }} ~ {{ from.processPlan.workPlanEndDate }}</text> |
| | | <text>计划进度:{{from.processPlan.num}}/{{from.processPlan.workorderDistributNum}}{{ from.processPlan.unitName }}</text> |
| | | </view> |
| | | <view class="bg_plan_label_val"> |
| | | <text v-if="!from.processPlan">请选择</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </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_h"> |
| | | <view class="bg_list_item_num" @click="openDev"> |
| | | <view class="bg_list_item_num_item"> |
| | | <text>生产设备</text> |
| | | <template>
|
| | | <view class="bg">
|
| | | <view class="bg_plan" @click="selectPlan">
|
| | | <view class="bg_plan_label" v-if="!from.processPlan">
|
| | | <text><text>*</text>工序生产计划</text>
|
| | | </view>
|
| | | <view class="bg_plan_nr" v-else>
|
| | | <text>{{ from.processPlan.materialName }} | {{ from.processPlan.materialCode }} |
|
| | | {{ from.processPlan.produceName }}</text>
|
| | | <text>{{ from.processPlan.batch }}{{ from.processPlan.salesOrder ? ` / ${from.processPlan.salesOrder}` : '' }}</text>
|
| | | <text>计划时间:{{ from.processPlan.workPlanStartDate }} ~ {{ from.processPlan.workPlanEndDate }}</text>
|
| | | <text>计划进度:{{from.processPlan.num}}/{{from.processPlan.workorderDistributNum}}{{ from.processPlan.unitName }}</text>
|
| | | </view>
|
| | | <view class="bg_plan_label_val">
|
| | | <text v-if="!from.processPlan">请选择</text>
|
| | | <image src="@/static/ic_ar@2x.png" alt="" />
|
| | | </view>
|
| | | </view>
|
| | | <!-- v-if="plansId" -->
|
| | | <template>
|
| | | <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>
|
| | | </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>
|
| | | </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"> |
| | | <text :style="{color: from.deviceName ? '#333' : ''}">{{from.deviceName ? from.deviceName : '请选择'}}</text> |
| | | <image src="@/static/ic_ar@2x.png" alt="" /> |
| | | </view> |
| | | </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> |
| | | </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> |
| | | <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="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" /> |
| | | <!-- 生产设备 --> |
| | | <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm" @cancel="deviceShow = false"></u-picker> |
| | | <!-- 时间 --> |
| | | <u-picker :show="TimeShow" :columns="columns" @confirm="onConfirm2" @cancel="TimeShow = false"></u-picker> |
| | | <!-- 物料 --> |
| | | <MaterialSelect ref="MaterialSelect" :plansId="String(plansId)" :selected="ids" :deviceId="String(deviceId)" @value="getValue" /> |
| | | <!-- 不良项 --> |
| | | <u-popup :show="show" @close="show = false" :round="8" closeable zIndex="20000"> |
| | | <view class="rp p40 contanir"> |
| | | <view class="c2 b tc">不良项</view> |
| | | <view class="content bl_list"> |
| | | <div class="bl_list_item" v-for="(item, i) in cateList" :key="i" @click="changeChecked(i)"> |
| | | <div class="bl_list_item_left"> |
| | | <u-checkbox-group @change="poorSelection(item.active, i)"> |
| | | <u-checkbox :checked="item.active" :label="item.name" :name="item.name"></u-checkbox> |
| | | </u-checkbox-group> |
| | | </div> |
| | | <div class="bl_list_item_right"> |
| | | <input type="number" @click.stop v-model="item.num" placeholder="0" /> |
| | | </div> |
| | | </div> |
| | | </view> |
| | | <view class="flex ap tc bottom-view"> |
| | | <view class="fx1 ml20 ptb20 sbtn_green" @click="onConfirm3">确定</view> |
| | | </view> |
| | | </view> |
| | | </u-popup> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import user from '../../components/user.vue' |
| | | import MaterialSelect from '../../components/MaterialSelect.vue' |
| | | import { mapState } from 'vuex' |
| | | import { getDeviceByCondition, getFindAll, queryOne, queryList, autoWorkReport, getIdPlansExt, categoryExtList } from '@/util/api/PlanningAPI' |
| | | export default { |
| | | components: { |
| | | user, |
| | | MaterialSelect |
| | | }, |
| | | data() { |
| | | return { |
| | | from: { |
| | | processPlan: null, |
| | | deviceId: '', |
| | | deviceName: '', |
| | | // userId: userInfo.id, |
| | | userId: '', |
| | | // userName: userInfo.companyUser.name, |
| | | userName: '', |
| | | qualified: '', // 良品数 |
| | | undesirable: '', // 不良数 |
| | | duration: '', |
| | | durationName: '0小时0分钟', |
| | | time: '', |
| | | defective: [], |
| | | defectiveName: '', |
| | | type: '', // 绩效类型 |
| | | index: 0 |
| | | }, |
| | | columns: [], |
| | | arrType: [], |
| | | bomType: '', |
| | | hasBom : '', |
| | | deviceShow: false, |
| | | userShow: false, |
| | | wuList: [], |
| | | deviceList: [], |
| | | cateList: [ |
| | | { |
| | | active: false, |
| | | num: '', |
| | | name: '有瑕疵' |
| | | } |
| | | ], |
| | | total: 0, // 可投数量 |
| | | ids: '', |
| | | plansId: '', |
| | | deviceId: '', |
| | | TimeShow: '', |
| | | show1: '', |
| | | show: false |
| | | }; |
| | | }, |
| | | computed: { |
| | | ...mapState(['userInfo']), |
| | | // 预计工资 |
| | | expectedSalary() { |
| | | |
| | | if (this.arrType.length === 0) return 0; |
| | | 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(qualified) * (temp.salary / 10 / 10)).toFixed(2) |
| | | } |
| | | } else { |
| | | 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; |
| | | 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 = (qualified / (duration / 3600)).toFixed(2) |
| | | let b = (temp.num / (temp.times / 3600)).toFixed(2) |
| | | return ((Number(a) / Number(b)) * 100).toFixed(2) |
| | | } |
| | | } |
| | | }, |
| | | onReady() { |
| | | let timer = setInterval(() => { |
| | | if (this.userInfo) { |
| | | this.from.userId = this.userInfo.id |
| | | this.from.userName = this.userInfo.realname |
| | | clearInterval(timer) |
| | | } |
| | | }, 500) |
| | | }, |
| | | onLoad() { |
| | | let arr = [] |
| | | for(let i = 0; i < 60; i++) { |
| | | arr.push(i) |
| | | } |
| | | this.getData() |
| | | this.columns = [arr, arr] |
| | | // 接收计划 |
| | | uni.$on('update', (data) => { |
| | | this.from.processPlan = data.obj |
| | | this.plansId = data.obj.id |
| | | this.from.deviceId = '' |
| | | this.from.deviceName = '' |
| | | this.deviceId = '' |
| | | this.total = data.obj.num - data.obj.workorderDistributNum |
| | | this.wuList = [] |
| | | this.from.defective = [] |
| | | this.from.defectiveName = '' |
| | | // this.from.userName = '' |
| | | // this.from.userId = '' |
| | | // 获取设备 |
| | | getDeviceByCondition({ procedureId: data.obj.procedureId }) |
| | | .then(res1 => { |
| | | if (res1.code === 200) { |
| | | if (res1.data && res1.data.length > 0) { |
| | | this.deviceId = res1.data[0].id |
| | | this.from.deviceId = res1.data[0].id |
| | | this.from.deviceName = res1.data[0].name |
| | | this.deviceList = [res1.data] |
| | | } |
| | | } |
| | | }) |
| | | // 获取类型 |
| | | getIdPlansExt(data.obj.id) |
| | | .then(res2 => { |
| | | if (res2.code === 200) { |
| | | this.bomType = res2.data.bomType |
| | | this.hasBom = res2.data.hasBom |
| | | } |
| | | }) |
| | | // 获取工资绩效数据 |
| | | queryList({ |
| | | deleted: 0, |
| | | departId: data.obj.factoryId, |
| | | materialId: data.obj.materialId, |
| | | procedureId: data.obj.procedureId |
| | | }).then(result => { |
| | | if (result.code === 200) { |
| | | if (result.data && result.data.length > 0) { |
| | | result.data.forEach((item, index) => { |
| | | item.name = item.type == 0 ? '计件' : '计时' |
| | | item.id = item.type |
| | | item.active = index == 0 |
| | | }) |
| | | this.arrType = result.data |
| | | console.log(this.arrType) |
| | | } else { |
| | | this.arrType = [] |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | methods: { |
| | | poorSelection(val, i) { |
| | | this.cateList.forEach((item, index) => { |
| | | if (i === index) { |
| | | item.active = !item.active |
| | | } |
| | | }) |
| | | }, |
| | | // 切换绩效类型 |
| | | clickPerformanceType(i) { |
| | | this.from.index = i |
| | | this.arrType.forEach((item, index) => { |
| | | if (i === index) { |
| | | this.from.type = item.id |
| | | } |
| | | item.active = index === i |
| | | }) |
| | | }, |
| | | // 选择物料 |
| | | getValue(val) { |
| | | let obj = JSON.parse(JSON.stringify(val)) |
| | | obj.total = val.num |
| | | this.wuList.unshift(obj) |
| | | let arr = this.wuList.map(item => item.id) |
| | | this.ids = arr |
| | | }, |
| | | // 获取不良项目 |
| | | getData() { |
| | | categoryExtList({ |
| | | cateType: "3" |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | res.data.forEach(item => { |
| | | item.active = false |
| | | item.num = '' |
| | | }) |
| | | this.cateList = res.data |
| | | } |
| | | }) |
| | | }, |
| | | // 选择设备 |
| | | onConfirm(e) { |
| | | this.from.deviceId = e.value[0].id |
| | | this.from.deviceName = e.value[0].name |
| | | this.deviceId = e.value[0].id |
| | | this.from.userId = '' |
| | | this.from.userName = '' |
| | | // getFindAll({ |
| | | // deviceId: e.id, |
| | | // planId: from.processPlan.id |
| | | // }).then(res => { |
| | | // if (res.code === 200) { |
| | | // res.data.forEach((item: any) => { |
| | | // item.name = item.umodel.name + '-' + item.tmodel.name |
| | | // }) |
| | | // userList.value = res.data |
| | | // } |
| | | // }) |
| | | this.deviceShow = false |
| | | }, |
| | | // 选择不良项 |
| | | onConfirm3() { |
| | | let isOpen = false |
| | | this.cateList.forEach((item, index) => { |
| | | if (item.active) { |
| | | isOpen = true |
| | | } |
| | | }) |
| | | if (!isOpen) return uni.showToast({ title: '请选择不良项', icon: 'none', duration: 2000 }); |
| | | let arr = [] |
| | | let total = 0 |
| | | let name = '' |
| | | for (let i = 0; i < this.cateList.length; i++) { |
| | | if (this.cateList[i].active) { |
| | | if (Number(this.cateList[i].num) <= 0) { |
| | | return uni.showToast({ title: '不良数量必须大于0', icon: 'none', duration: 2000 }); |
| | | } |
| | | total = total += Number(this.cateList[i].num) |
| | | arr.push(this.cateList[i]) |
| | | name += this.cateList[i].name + this.cateList[i].num + ';' |
| | | } |
| | | } |
| | | if (total !== Number(this.from.undesirable)) return uni.showToast({ title: '不良数必须等于产出不良数', icon: 'none', duration: 2000 }); |
| | | this.from.defective = arr |
| | | this.from.defectiveName = name |
| | | this.show = false |
| | | }, |
| | | changeChecked(i) { |
| | | this.cateList[i].active = !this.cateList[i].active |
| | | }, |
| | | onConfirm2(e) { |
| | | let h = e.value[0] |
| | | let m = e.value[1] |
| | | let s = 0 |
| | | if (h > 0) { |
| | | s += h * 60 * 60 |
| | | } |
| | | if (m > 0) { |
| | | s += m * 60 |
| | | } |
| | | this.from.duration = s |
| | | this.from.durationName = `${h}小时${m}分钟` |
| | | this.TimeShow = false |
| | | }, |
| | | onConfirm1(e) { |
| | | this.from.userId = e.userId |
| | | this.from.userName = e.name |
| | | this.userShow = false |
| | | }, |
| | | selectPlan() { |
| | | uni.navigateTo({ |
| | | url: '/pages_adjust/pages/processPlan/processPlan' |
| | | }); |
| | | }, |
| | | openDev() { |
| | | if (!this.from.processPlan) return uni.showToast({ title: '请先选择工序生产计划', icon: 'none', duration: 2000 }); |
| | | this.deviceShow = true |
| | | }, |
| | | openMaterial() { |
| | | if (!this.plansId) return uni.showToast({ title: '请先选择工序生产计划', icon: 'none', duration: 2000 }); |
| | | if (!this.deviceId) return uni.showToast({ title: '请先选择生产设备', icon: 'none', duration: 2000 }); |
| | | this.$refs.MaterialSelect.open() |
| | | }, |
| | | inputwl(i) { |
| | | if (this.wuList[i].num > this.wuList[i].total) { |
| | | this.wuList[i].num = '' |
| | | uni.showToast({ title: '投料数量不能大于库存数量', icon: 'none', duration: 2000 }); |
| | | } |
| | | }, |
| | | deleItem(index) { |
| | | if (this.wuList.length === 1) return uni.showToast({ title: '至少保留一项内容', icon: 'none', duration: 2000 }); |
| | | this.wuList.splice(index, 1) |
| | | }, |
| | | // 产出数量验证 |
| | | <!-- <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="$event => 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>
|
| | | <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="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" />
|
| | | <!-- 生产设备 -->
|
| | | <u-picker :show="deviceShow" :columns="deviceList" keyName="name" @confirm="onConfirm"
|
| | | @cancel="deviceShow = false"></u-picker>
|
| | | <!-- 时间 -->
|
| | | <u-picker :show="TimeShow" :columns="columns" @confirm="onConfirm2" @cancel="TimeShow = false"></u-picker>
|
| | | <!-- 物料 -->
|
| | | <MaterialSelect ref="MaterialSelect" :plansId="String(plansId)" :selected="ids" :deviceId="String(deviceId)"
|
| | | @value="getValue" />
|
| | | <!-- 不良项 -->
|
| | | <u-popup :show="show" @close="show = false" :round="8" closeable zIndex="20000">
|
| | | <view class="rp p40 contanir">
|
| | | <view class="c2 b tc">不良项</view>
|
| | | <view class="content bl_list">
|
| | | <div class="bl_list_item" v-for="(item, i) in cateList" :key="i" @click="changeChecked(i)">
|
| | | <div class="bl_list_item_left">
|
| | | <u-checkbox-group @change="poorSelection(item.active, i)">
|
| | | <u-checkbox :checked="item.active" :label="item.name" :name="item.name"></u-checkbox>
|
| | | </u-checkbox-group>
|
| | | </div>
|
| | | <div class="bl_list_item_right">
|
| | | <input type="number" @click.stop v-model="item.num" placeholder="0" />
|
| | | </div>
|
| | | </div>
|
| | | </view>
|
| | | <view class="flex ap tc bottom-view">
|
| | | <view class="fx1 ml20 ptb20 sbtn_green" @click="onConfirm3">确定</view>
|
| | | </view>
|
| | | </view>
|
| | | </u-popup>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import user from '../../components/user.vue'
|
| | | import MaterialSelect from '../../components/MaterialSelect.vue'
|
| | | import {
|
| | | mapState
|
| | | } from 'vuex'
|
| | | import {
|
| | | getDeviceByCondition,
|
| | | getFindAll,
|
| | | queryOne,
|
| | | queryList,
|
| | | autoWorkReport,
|
| | | getIdPlansExt,
|
| | | categoryExtList
|
| | | } from '@/util/api/PlanningAPI'
|
| | | export default {
|
| | | components: {
|
| | | user,
|
| | | MaterialSelect
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | from: {
|
| | | processPlan: null,
|
| | | deviceId: '',
|
| | | deviceName: '',
|
| | | // userId: userInfo.id,
|
| | | userId: '',
|
| | | // userName: userInfo.companyUser.name,
|
| | | userName: '',
|
| | | qualified: '', // 良品数
|
| | | undesirable: '', // 不良数
|
| | | duration: '',
|
| | | durationName: '0小时0分钟',
|
| | | time: '',
|
| | | defective: [],
|
| | | defectiveName: '',
|
| | | type: '', // 绩效类型
|
| | | index: 0
|
| | | },
|
| | | columns: [],
|
| | | arrType: [],
|
| | | bomType: '',
|
| | | hasBom: '',
|
| | | deviceShow: false,
|
| | | userShow: false,
|
| | | wuList: [],
|
| | | deviceList: [],
|
| | | cateList: [{
|
| | | active: false,
|
| | | num: '',
|
| | | name: '有瑕疵'
|
| | | }],
|
| | | total: 0, // 可投数量
|
| | | ids: '',
|
| | | plansId: '',
|
| | | deviceId: '',
|
| | | TimeShow: '',
|
| | | show1: '',
|
| | | show: false
|
| | | };
|
| | | },
|
| | | computed: {
|
| | | ...mapState(['userInfo']),
|
| | | // 预计工资
|
| | | expectedSalary() {
|
| | |
|
| | | if (this.arrType.length === 0) return 0;
|
| | | 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(qualified) * (temp.salary / 10 / 10)).toFixed(2)
|
| | | }
|
| | | } else {
|
| | | 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;
|
| | | 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 = (qualified / (duration / 3600)).toFixed(2)
|
| | | let b = (temp.num / (temp.times / 3600)).toFixed(2)
|
| | | return ((Number(a) / Number(b)) * 100).toFixed(2)
|
| | | }
|
| | | }
|
| | | },
|
| | | onReady() {
|
| | | let timer = setInterval(() => {
|
| | | if (this.userInfo) {
|
| | | this.from.userId = this.userInfo.id
|
| | | this.from.userName = this.userInfo.realname
|
| | | clearInterval(timer)
|
| | | }
|
| | | }, 500)
|
| | | },
|
| | | onLoad() {
|
| | | let arr = []
|
| | | for (let i = 0; i < 60; i++) {
|
| | | arr.push(i)
|
| | | }
|
| | | this.getData()
|
| | | this.columns = [arr, arr]
|
| | | // 接收计划
|
| | | uni.$on('update', (data) => {
|
| | | this.from.processPlan = data.obj
|
| | | this.plansId = data.obj.id
|
| | | this.from.deviceId = ''
|
| | | this.from.deviceName = ''
|
| | | this.deviceId = ''
|
| | | this.total = data.obj.num - data.obj.workorderDistributNum
|
| | | this.wuList = []
|
| | | this.from.defective = []
|
| | | this.from.defectiveName = ''
|
| | | // this.from.userName = ''
|
| | | // this.from.userId = ''
|
| | | // 获取设备
|
| | | getDeviceByCondition({
|
| | | procedureId: data.obj.procedureId
|
| | | })
|
| | | .then(res1 => {
|
| | | if (res1.code === 200) {
|
| | | if (res1.data && res1.data.length > 0) {
|
| | | this.deviceId = res1.data[0].id
|
| | | this.from.deviceId = res1.data[0].id
|
| | | this.from.deviceName = res1.data[0].name
|
| | | this.deviceList = [res1.data]
|
| | | }
|
| | | }
|
| | | })
|
| | | // 获取类型
|
| | | getIdPlansExt(data.obj.id)
|
| | | .then(res2 => {
|
| | | if (res2.code === 200) {
|
| | | this.bomType = res2.data.bomType
|
| | | this.hasBom = res2.data.hasBom
|
| | | }
|
| | | })
|
| | | // 获取工资绩效数据
|
| | | queryList({
|
| | | deleted: 0,
|
| | | departId: data.obj.factoryId,
|
| | | materialId: data.obj.materialId,
|
| | | procedureId: data.obj.procedureId
|
| | | }).then(result => {
|
| | | if (result.code === 200) {
|
| | | if (result.data && result.data.length > 0) {
|
| | | result.data.forEach((item, index) => {
|
| | | item.name = item.type == 0 ? '计件' : '计时'
|
| | | item.id = item.type
|
| | | item.active = index == 0
|
| | | })
|
| | | this.arrType = result.data
|
| | | console.log(this.arrType)
|
| | | } else {
|
| | | this.arrType = []
|
| | | }
|
| | | }
|
| | | })
|
| | | })
|
| | | },
|
| | | methods: {
|
| | | poorSelection(val, i) {
|
| | | this.cateList.forEach((item, index) => {
|
| | | if (i === index) {
|
| | | item.active = !item.active
|
| | | }
|
| | | })
|
| | | },
|
| | | // 切换绩效类型
|
| | | clickPerformanceType(i) {
|
| | | this.from.index = i
|
| | | this.arrType.forEach((item, index) => {
|
| | | if (i === index) {
|
| | | this.from.type = item.id
|
| | | }
|
| | | item.active = index === i
|
| | | })
|
| | | },
|
| | | // 选择物料
|
| | | getValue(val) {
|
| | | let obj = JSON.parse(JSON.stringify(val))
|
| | | obj.total = val.num
|
| | | this.wuList.unshift(obj)
|
| | | let arr = this.wuList.map(item => item.id)
|
| | | this.ids = arr
|
| | | },
|
| | | // 获取不良项目
|
| | | getData() {
|
| | | categoryExtList({
|
| | | cateType: "3"
|
| | | }).then(res => {
|
| | | if (res.code === 200) {
|
| | | res.data.forEach(item => {
|
| | | item.active = false
|
| | | item.num = ''
|
| | | })
|
| | | this.cateList = res.data
|
| | | }
|
| | | })
|
| | | },
|
| | | // 选择设备
|
| | | onConfirm(e) {
|
| | | this.from.deviceId = e.value[0].id
|
| | | this.from.deviceName = e.value[0].name
|
| | | this.deviceId = e.value[0].id
|
| | | this.from.userId = ''
|
| | | this.from.userName = ''
|
| | | // getFindAll({
|
| | | // deviceId: e.id,
|
| | | // planId: from.processPlan.id
|
| | | // }).then(res => {
|
| | | // if (res.code === 200) {
|
| | | // res.data.forEach((item: any) => {
|
| | | // item.name = item.umodel.name + '-' + item.tmodel.name
|
| | | // })
|
| | | // userList.value = res.data
|
| | | // }
|
| | | // })
|
| | | this.deviceShow = false
|
| | | },
|
| | | // 选择不良项
|
| | | onConfirm3() {
|
| | | let isOpen = false
|
| | | this.cateList.forEach((item, index) => {
|
| | | if (item.active) {
|
| | | isOpen = true
|
| | | }
|
| | | })
|
| | | if (!isOpen) return uni.showToast({
|
| | | title: '请选择不良项',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | let arr = []
|
| | | let total = 0
|
| | | let name = ''
|
| | | for (let i = 0; i < this.cateList.length; i++) {
|
| | | if (this.cateList[i].active) {
|
| | | if (Number(this.cateList[i].num) <= 0) {
|
| | | return uni.showToast({
|
| | | title: '不良数量必须大于0',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | total = total += Number(this.cateList[i].num)
|
| | | arr.push(this.cateList[i])
|
| | | name += this.cateList[i].name + this.cateList[i].num + ';'
|
| | | }
|
| | | }
|
| | | if (total !== Number(this.from.undesirable)) return uni.showToast({
|
| | | title: '不良数必须等于产出不良数',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | this.from.defective = arr
|
| | | this.from.defectiveName = name
|
| | | this.show = false
|
| | | },
|
| | | changeChecked(i) {
|
| | | this.cateList[i].active = !this.cateList[i].active
|
| | | },
|
| | | onConfirm2(e) {
|
| | | let h = e.value[0]
|
| | | let m = e.value[1]
|
| | | let s = 0
|
| | | if (h > 0) {
|
| | | s += h * 60 * 60
|
| | | }
|
| | | if (m > 0) {
|
| | | s += m * 60
|
| | | }
|
| | | this.from.duration = s
|
| | | this.from.durationName = `${h}小时${m}分钟`
|
| | | this.TimeShow = false
|
| | | },
|
| | | onConfirm1(e) {
|
| | | this.from.userId = e.userId
|
| | | this.from.userName = e.name
|
| | | this.userShow = false
|
| | | },
|
| | | selectPlan() {
|
| | | uni.navigateTo({
|
| | | url: '/pages_adjust/pages/processPlan/processPlan'
|
| | | });
|
| | | },
|
| | | openDev() {
|
| | | if (!this.from.processPlan) return uni.showToast({
|
| | | title: '请先选择工序生产计划',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | this.deviceShow = true
|
| | | },
|
| | | openMaterial() {
|
| | | if (!this.plansId) return uni.showToast({
|
| | | title: '请先选择工序生产计划',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (!this.deviceId) return uni.showToast({
|
| | | title: '请先选择生产设备',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | this.$refs.MaterialSelect.open()
|
| | | },
|
| | | inputwl(i) {
|
| | | if (this.wuList[i].num > this.wuList[i].total) {
|
| | | this.wuList[i].num = ''
|
| | | uni.showToast({
|
| | | title: '投料数量不能大于库存数量',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | },
|
| | | deleItem(index) {
|
| | | if (this.wuList.length === 1) return uni.showToast({
|
| | | title: '至少保留一项内容',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | this.wuList.splice(index, 1)
|
| | | },
|
| | | // 产出数量验证
|
| | | changeNum(type) { |
| | | let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable)) |
| | | if (type == 2) { |
| | | this.from.defective = [] |
| | | this.from.defectiveName = '' |
| | | } |
| | | } else { |
| | | this.from.qualified = event |
| | | }
|
| | | let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable)) |
| | | if (num < 0) { |
| | | uni.showToast({ title: '产出数量不能大于可产出数量!', icon: 'none', duration: 2000 }); |
| | | if (type == 1) { |
| | | this.from.qualified = '' |
| | | } else { |
| | | this.from.undesirable = '' |
| | | } |
| | | } |
| | | }, |
| | | openBL() { |
| | | this.cateList.forEach(item => { |
| | | if (!item.active) { |
| | | item.num = '' |
| | | } |
| | | if (item.active && item.num <= 0) { |
| | | item.active = false |
| | | } |
| | | }) |
| | | this.show = true |
| | | }, |
| | | // 继续报工 |
| | | continueSubmit() { |
| | | if (!this.from.processPlan) return uni.showToast({ title: '计划不能为空', icon: 'none', duration: 2000 }); |
| | | if (!this.from.deviceId) return uni.showToast({ title: '设备不能为空', icon: 'none', duration: 2000 }); |
| | | if (!this.from.userId) return uni.showToast({ title: '生产人员不能为空', icon: 'none', duration: 2000 }); |
| | | if (this.hasBom == 1 && this.bomType == 1) { |
| | | console.log('不需要投料') |
| | | } else { |
| | | if (!this.wuList.length === 0) return uni.showToast({ title: '投料不能为空', icon: 'none', duration: 2000 }); |
| | | } |
| | | if (!this.from.qualified && !this.from.undesirable) { |
| | | return uni.showToast({ title: '良品数与不良数不能同时为空', icon: 'none', duration: 2000 }); |
| | | } |
| | | if (this.from.qualified && this.from.qualified <= 0) { |
| | | return uni.showToast({ title: '良品数必须大于0', icon: 'none', duration: 2000 }); |
| | | } |
| | | if (this.from.undesirable && this.from.undesirable <= 0) { |
| | | return uni.showToast({ title: '不良品数必须大于0', icon: 'none', duration: 2000 }); |
| | | } |
| | | // 有不良数 |
| | | if (this.from.undesirable > 0) { |
| | | if (this.from.defective.length === 0) return uni.showToast({ title: '不良项不能为空', icon: 'none', duration: 2000 }); |
| | | } |
| | | let type = '' |
| | | this.arrType.forEach(item => { |
| | | if (item.active) { |
| | | type = item.id |
| | | } |
| | | }) |
| | | autoWorkReport({ |
| | | createWorkorderRecordDTO: { |
| | | type, |
| | | duration: this.from.duration, |
| | | qualifiedNum: this.from.qualified ? this.from.qualified : 0, |
| | | unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0 |
| | | }, |
| | | plansId: this.from.processPlan.id, |
| | | proGroupId: this.deviceId, |
| | | proUserList: [this.from.userId], |
| | | recordList: this.wuList.map(item => { |
| | | return { |
| | | wstockId: item.id, |
| | | num: item.num |
| | | } |
| | | }), |
| | | createUnqualifiedDTOList: this.from.defective.map(item => { |
| | | return { |
| | | categoryId: item.id, |
| | | unQualifiedNum: item.num |
| | | } |
| | | }) |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.showToast({ title: '报工成功!', icon: 'success', duration: 2000 }); |
| | | this.arrType = [] |
| | | this.from.processPlan = null |
| | | this.from.deviceId = '' |
| | | this.from.deviceName = '' |
| | | this.from.userId = '' |
| | | this.from.userName = '' |
| | | this.from.qualified = '' |
| | | this.from.undesirable = '' |
| | | this.from.duration = '' |
| | | this.from.durationName = '0小时0分钟' |
| | | this.from.time = '' |
| | | this.from.defective = [] |
| | | this.from.defectiveName = '' |
| | | this.wuList = [] |
| | | this.deviceId = '' |
| | | this.plansId = '' |
| | | this.ids = '' |
| | | this.total = '' |
| | | } |
| | | }) |
| | | }, |
| | | // 报工 |
| | | submit() { |
| | | if (!this.from.processPlan) return uni.showToast({ title: '计划不能为空', icon: 'none', duration: 2000 }); |
| | | if (!this.from.deviceId) return uni.showToast({ title: '设备不能为空', icon: 'none', duration: 2000 }); |
| | | if (!this.from.userId) return uni.showToast({ title: '生产人员不能为空', icon: 'none', duration: 2000 }); |
| | | if (this.hasBom == 1 && this.bomType == 1) { |
| | | console.log('不需要投料') |
| | | } else { |
| | | if (!this.wuList.length === 0) return uni.showToast({ title: '投料不能为空', icon: 'none', duration: 2000 }); |
| | | } |
| | | if (!this.from.qualified && !this.from.undesirable) { |
| | | return uni.showToast({ title: '良品数与不良数不能同时为空', icon: 'none', duration: 2000 }); |
| | | } |
| | | // 有不良数 |
| | | if (this.from.undesirable > 0) { |
| | | if (this.from.defective.length === 0) return uni.showToast({ title: '不良项不能为空', icon: 'none', duration: 2000 }); |
| | | } |
| | | let type = '' |
| | | this.arrType.forEach(item => { |
| | | if (item.active) { |
| | | type = item.id |
| | | } |
| | | }) |
| | | autoWorkReport({ |
| | | createWorkorderRecordDTO: { |
| | | type, |
| | | duration: this.from.duration, |
| | | qualifiedNum: this.from.qualified ? this.from.qualified : 0, |
| | | unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0 |
| | | }, |
| | | plansId: this.from.processPlan.id, |
| | | proGroupId: this.deviceId, |
| | | proUserList: [this.from.userId], |
| | | recordList: this.wuList.map(item => { |
| | | return { |
| | | wstockId: item.id, |
| | | num: item.num |
| | | } |
| | | }), |
| | | createUnqualifiedDTOList: this.from.defective.map(item => { |
| | | return { |
| | | categoryId: item.id, |
| | | unQualifiedNum: item.num |
| | | } |
| | | }) |
| | | }).then(res => { |
| | | if (res.code === 200) { |
| | | uni.showToast({ title: '报工成功!', icon: 'success', duration: 2000 }); |
| | | setTimeout(() => { |
| | | uni.navigateBack({ delta: 1 }); |
| | | }, 2000); |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .bg { |
| | | width: 100%; |
| | | position: absolute; |
| | | background: #F7F7F7; |
| | | .contanir { |
| | | height: calc(env(safe-area-inset-bottom) + 720rpx); |
| | | .content { |
| | | margin-top: 20rpx; |
| | | .type-style { |
| | | width: 325rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | } |
| | | } |
| | | .bg_plan { |
| | | width: 100%; |
| | | // height: 98rpx; |
| | | padding: 30rpx; |
| | | box-sizing: border-box; |
| | | background: #FFFFFF; |
| | | margin-bottom: 40rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | text { |
| | | font-size: 30rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | text { |
| | | color: red; |
| | | } |
| | | } |
| | | .bg_plan_nr { |
| | | display: flex; |
| | | flex-direction: column; |
| | | text { |
| | | font-size: 24rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #666666; |
| | | margin-top: 20rpx; |
| | | &:first-child { |
| | | font-size: 32rpx; |
| | | font-family: PingFangSC-Medium, PingFang SC; |
| | | font-weight: 500; |
| | | color: #333333; |
| | | margin-top: 0 !important; |
| | | } |
| | | } |
| | | } |
| | | .bg_plan_label_val { |
| | | display: flex; |
| | | align-items: center; |
| | | text { |
| | | font-size: 28rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | image { |
| | | width: 12rpx; |
| | | height: 24rpx; |
| | | margin-left: 20rpx; |
| | | } |
| | | } |
| | | } |
| | | .bg_list { |
| | | width: 100%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .bottomval { |
| | | margin-bottom: 20rpx !important; |
| | | } |
| | | .bg_list_item { |
| | | display: flex; |
| | | flex-direction: column; |
| | | margin-bottom: 40rpx; |
| | | .kong { |
| | | text-align: center; |
| | | padding: 30rpx 0; |
| | | background: #ffffff; |
| | | font-size: 25rpx; |
| | | text { |
| | | color: #474747; |
| | | } |
| | | } |
| | | .bg_list_item_top { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | padding-left: 30rpx; |
| | | padding-right: 30rpx; |
| | | margin-bottom: 30rpx; |
| | | .bg_list_item_top_left { |
| | | display: flex; |
| | | align-items: center; |
| | | .left { |
| | | margin-left: 12rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | .warning { |
| | | width: 8rpx; |
| | | height: 30rpx; |
| | | border-radius: 2rpx; |
| | | margin-right: 12rpx; |
| | | background: $nav-stateColor5 !important; |
| | | } |
| | | .error { |
| | | width: 8rpx; |
| | | height: 30rpx; |
| | | border-radius: 2rpx; |
| | | margin-right: 12rpx; |
| | | background: $nav-stateColor4 !important; |
| | | } |
| | | .bg_list_item_top_left_x { |
| | | width: 8rpx; |
| | | height: 30rpx; |
| | | background: $nav-color; |
| | | border-radius: 2rpx; |
| | | margin-right: 12rpx; |
| | | } |
| | | text { |
| | | font-size: 32rpx; |
| | | font-weight: 500; |
| | | color: #222222; |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | } |
| | | .bg_list_item_top_right { |
| | | display: flex; |
| | | align-items: center; |
| | | image { |
| | | width: 28rpx; |
| | | height: 28rpx; |
| | | margin-right: 12rpx; |
| | | } |
| | | text { |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | color: $nav-color; |
| | | } |
| | | } |
| | | } |
| | | .top { |
| | | margin-top: 20rpx !important; |
| | | } |
| | | .bg_list_item_h { |
| | | width: 100%; |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | background: white; |
| | | .bg_list_item_num { |
| | | width: 100%; |
| | | min-height: 98rpx; |
| | | background: white; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | border-bottom: 1rpx solid #E5E5E5; |
| | | &:last-child { |
| | | border: none !important; |
| | | } |
| | | .kong { |
| | | text-align: center; |
| | | font-size: 25rpx; |
| | | padding: 30rpx 0; |
| | | background: #ffffff; |
| | | } |
| | | .bg_list_item_num_item { |
| | | width: 100%; |
| | | height: 100%; |
| | | display: flex; |
| | | align-items: center; |
| | | // height: 118rpx; |
| | | padding: 15rpx 0; |
| | | box-sizing: border-box; |
| | | justify-content: space-between; |
| | | border-bottom: 1rpx solid #E5E5E5; |
| | | &:last-child { |
| | | border: none; |
| | | } |
| | | .bg_list_item_num_item_list { |
| | | display: flex; |
| | | align-items: center; |
| | | .active { |
| | | background: #305ED5 !important; |
| | | color: #FFFFFF !important; |
| | | } |
| | | .bg_list_item_num_item_list_item { |
| | | width: 116rpx; |
| | | height: 62rpx; |
| | | line-height: 62rpx; |
| | | text-align: center; |
| | | background: #F2F2F2; |
| | | border-radius: 8rpx; |
| | | font-size: 26rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | margin-right: 20rpx; |
| | | &:last-child { |
| | | margin: 0 !important; |
| | | } |
| | | } |
| | | } |
| | | .bg_list_item_num_item_wl { |
| | | flex: 1; |
| | | display: flex; |
| | | flex-direction: column; |
| | | text { |
| | | font-size: 34rpx; |
| | | color: #222222; |
| | | } |
| | | .bg_list_item_num_item_wl_lx { |
| | | margin-top: 10rpx; |
| | | text { |
| | | color: #222222; |
| | | font-size: 28rpx; |
| | | } |
| | | } |
| | | } |
| | | .warning { |
| | | color: $nav-stateColor5 !important; |
| | | } |
| | | .err { |
| | | color: $nav-stateColor4 !important; |
| | | } |
| | | image { |
| | | width: 12rpx; |
| | | height: 24rpx; |
| | | margin-left: 20rpx; |
| | | } |
| | | text { |
| | | flex-shrink: 0; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | text { |
| | | font-size: 30rpx; |
| | | color: red !important; |
| | | margin-right: 5rpx; |
| | | } |
| | | .warning { |
| | | color: $nav-stateColor5 !important; |
| | | margin-right: 5rpx; |
| | | } |
| | | .err { |
| | | color: $nav-stateColor4 !important; |
| | | margin-right: 5rpx; |
| | | } |
| | | &:nth-child(1) { |
| | | font-size: 30rpx; |
| | | font-weight: 400; |
| | | color: #222222; |
| | | } |
| | | &:nth-child(2) { |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | flex-shrink: 0; |
| | | } |
| | | } |
| | | .bg_list_item_num_item_sr { |
| | | // flex: 1; |
| | | flex-shrink: 0; |
| | | width: 230rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | .color1 { |
| | | font-size: 28rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | } |
| | | input::-webkit-input-placeholder { |
| | | font-size: 28rpx; |
| | | } |
| | | input { |
| | | text-align: right; |
| | | width: 180rpx; |
| | | height: 60rpx; |
| | | border-radius: 8rpx; |
| | | border: 1rpx solid #E5E5E5; |
| | | margin-right: 20rpx; |
| | | font-size: 28rpx; |
| | | font-weight: 400; |
| | | color: #333333; |
| | | padding: 0 30rpx; |
| | | margin-right: 20rpx; |
| | | } |
| | | .wulll { |
| | | width: 400rpx; |
| | | text-align: right; |
| | | overflow: hidden; |
| | | white-space: nowrap; |
| | | text-overflow: ellipsis; |
| | | } |
| | | text { |
| | | font-size: 28rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .bh_zw { |
| | | height: 160rpx; |
| | | } |
| | | .bg_footer { |
| | | position: fixed; |
| | | bottom: 0; |
| | | left: 0; |
| | | width: 100%; |
| | | z-index: 9; |
| | | padding: 0 30rpx 60rpx 30rpx; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | .bg_footer_submit1 { |
| | | width: 334rpx; |
| | | height: 88rpx; |
| | | line-height: 88rpx; |
| | | text-align: center; |
| | | background: #FFFFFF; |
| | | box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0,0,0,0.08); |
| | | border-radius: 8rpx; |
| | | font-size: 30rpx; |
| | | font-family: PingFangSC-Medium, PingFang SC; |
| | | font-weight: 500; |
| | | color: #305ED5; |
| | | } |
| | | .bg_footer_submit { |
| | | width: 334rpx; |
| | | height: 88rpx; |
| | | background: $nav-color; |
| | | box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08); |
| | | border-radius: 8rpx; |
| | | font-size: 30rpx; |
| | | font-weight: 500; |
| | | color: #FFFFFF; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | } |
| | | .bl { |
| | | width: 100%; |
| | | height: 800rpx; |
| | | padding: 30rpx; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-direction: column; |
| | | .bl_head { |
| | | width: 100%; |
| | | height: 50rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | text { |
| | | font-size: 28rpx; |
| | | color: #222222; |
| | | &:nth-child(2) { |
| | | font-size: 32rpx !important; |
| | | } |
| | | } |
| | | image { |
| | | width: 28rpx; |
| | | height: 28rpx; |
| | | } |
| | | } |
| | | .bl_footer { |
| | | width: 100%; |
| | | height: 88rpx; |
| | | line-height: 88rpx; |
| | | text-align: center; |
| | | background: #305ED5; |
| | | border-radius: 8rpx; |
| | | font-size: 32rpx; |
| | | font-family: PingFangSC-Medium, PingFang SC; |
| | | font-weight: 500; |
| | | color: #FFFFFF; |
| | | margin-top: 30rpx; |
| | | } |
| | | .bl_list { |
| | | width: 100%; |
| | | height: calc(100% - 168rpx); |
| | | overflow-y: scroll; |
| | | margin-top: 30rpx; |
| | | .bl_list_item { |
| | | width: 100%; |
| | | height: 96rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | border-bottom: 1rpx solid #E5E5E5; |
| | | &:last-child { |
| | | border: none !important; |
| | | } |
| | | .bl_list_item_left { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | input { |
| | | width: 30rpx; |
| | | height: 30rpx; |
| | | border: 1rpx solid #CCCCCC; |
| | | margin: 0 !important; |
| | | } |
| | | text { |
| | | font-size: 30rpx; |
| | | color: #222222; |
| | | margin-left: 10rpx; |
| | | } |
| | | } |
| | | .bl_list_item_right { |
| | | width: 200rpx; |
| | | flex-shrink: 0; |
| | | height: 50rpx; |
| | | text-align: right; |
| | | input { |
| | | padding-left: 5rpx; |
| | | width: 160rpx; |
| | | height: 100%; |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | text-align: right; |
| | | font-size: 28rpx; |
| | | color: #333333; |
| | | border-radius: 10rpx; |
| | | border: 1rpx solid #CCCCCC; |
| | | &::-webkit-input-placeholder { |
| | | font-size: 28rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .bl_list { |
| | | width: 100%; |
| | | height: calc(100% - 168rpx); |
| | | overflow-y: scroll; |
| | | margin-top: 30rpx; |
| | | |
| | | .bl_list_item { |
| | | width: 100%; |
| | | height: 96rpx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | border-bottom: 1rPX solid #E5E5E5; |
| | | |
| | | &:last-child { |
| | | border: none !important; |
| | | } |
| | | |
| | | .bl_list_item_left { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | input { |
| | | width: 30rpx; |
| | | height: 30rpx; |
| | | border: 1rpX solid #CCCCCC; |
| | | margin: 0 !important; |
| | | } |
| | | |
| | | span { |
| | | font-size: 30rpx; |
| | | color: #222222; |
| | | margin-left: 10rpx; |
| | | } |
| | | } |
| | | |
| | | .bl_list_item_right { |
| | | width: 200rpx; |
| | | flex-shrink: 0; |
| | | height: 50rpx; |
| | | text-align: right; |
| | | |
| | | input { |
| | | padding-left: 5rpx; |
| | | width: 180rpx; |
| | | height: 60rpx; |
| | | border-radius: 8rpx; |
| | | border: 1rpx solid #CCCCCC; |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | text-align: right; |
| | | font-size: 28rpx; |
| | | color: #333333; |
| | | border-radius: 10rpx; |
| | | border: 1rPX solid #CCCCCC; |
| | | |
| | | &::-webkit-input-placeholder { |
| | | font-size: 28rpx; |
| | | font-family: PingFangSC-Regular, PingFang SC; |
| | | font-weight: 400; |
| | | color: #999999; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .bottom-view { |
| | | left: 40rpx; |
| | | right: 40rpx; |
| | | bottom: 20rpx |
| | | } |
| | | } |
| | | uni.$u.toast('产出数量不能大于可产出数量!')
|
| | | }
|
| | | },
|
| | | openBL() {
|
| | | this.cateList.forEach(item => {
|
| | | if (!item.active) {
|
| | | item.num = ''
|
| | | }
|
| | | if (item.active && item.num <= 0) {
|
| | | item.active = false
|
| | | }
|
| | | })
|
| | | this.show = true
|
| | | },
|
| | | // 继续报工
|
| | | continueSubmit() {
|
| | | if (!this.from.processPlan) return uni.showToast({
|
| | | title: '计划不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (!this.from.deviceId) return uni.showToast({
|
| | | title: '设备不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (!this.from.userId) return uni.showToast({
|
| | | title: '生产人员不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (this.hasBom == 1 && this.bomType == 1) {
|
| | | console.log('不需要投料')
|
| | | } else {
|
| | | if (!this.wuList.length === 0) return uni.showToast({
|
| | | title: '投料不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | if (!this.from.qualified && !this.from.undesirable) {
|
| | | return uni.showToast({
|
| | | title: '良品数与不良数不能同时为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | if (this.from.qualified && this.from.qualified <= 0) {
|
| | | return uni.showToast({
|
| | | title: '良品数必须大于0',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | if (this.from.undesirable && this.from.undesirable <= 0) {
|
| | | return uni.showToast({
|
| | | title: '不良品数必须大于0',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | // 有不良数
|
| | | if (this.from.undesirable > 0) {
|
| | | if (this.from.defective.length === 0) return uni.showToast({
|
| | | title: '不良项不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | let type = ''
|
| | | this.arrType.forEach(item => {
|
| | | if (item.active) {
|
| | | type = item.id
|
| | | }
|
| | | })
|
| | | autoWorkReport({
|
| | | createWorkorderRecordDTO: {
|
| | | type,
|
| | | duration: this.from.duration,
|
| | | qualifiedNum: this.from.qualified ? this.from.qualified : 0,
|
| | | unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
|
| | | },
|
| | | plansId: this.from.processPlan.id,
|
| | | proGroupId: this.deviceId,
|
| | | proUserList: [this.from.userId],
|
| | | recordList: this.wuList.map(item => {
|
| | | return {
|
| | | wstockId: item.id,
|
| | | num: item.num
|
| | | }
|
| | | }),
|
| | | createUnqualifiedDTOList: this.from.defective.map(item => {
|
| | | return {
|
| | | categoryId: item.id,
|
| | | unQualifiedNum: item.num
|
| | | }
|
| | | })
|
| | | }).then(res => {
|
| | | if (res.code === 200) {
|
| | | uni.showToast({
|
| | | title: '报工成功!',
|
| | | icon: 'success',
|
| | | duration: 2000
|
| | | });
|
| | | this.arrType = []
|
| | | this.from.processPlan = null
|
| | | this.from.deviceId = ''
|
| | | this.from.deviceName = ''
|
| | | this.from.userId = ''
|
| | | this.from.userName = ''
|
| | | this.from.qualified = ''
|
| | | this.from.undesirable = ''
|
| | | this.from.duration = ''
|
| | | this.from.durationName = '0小时0分钟'
|
| | | this.from.time = ''
|
| | | this.from.defective = []
|
| | | this.from.defectiveName = ''
|
| | | this.wuList = []
|
| | | this.deviceId = ''
|
| | | this.plansId = ''
|
| | | this.ids = ''
|
| | | this.total = 0
|
| | | }
|
| | | })
|
| | | },
|
| | | // 报工
|
| | | submit() {
|
| | | if (!this.from.processPlan) return uni.showToast({
|
| | | title: '计划不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (!this.from.deviceId) return uni.showToast({
|
| | | title: '设备不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (!this.from.userId) return uni.showToast({
|
| | | title: '生产人员不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | if (this.hasBom == 1 && this.bomType == 1) {
|
| | | console.log('不需要投料')
|
| | | } else {
|
| | | if (!this.wuList.length === 0) return uni.showToast({
|
| | | title: '投料不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | if (!this.from.qualified && !this.from.undesirable) {
|
| | | return uni.showToast({
|
| | | title: '良品数与不良数不能同时为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | // 有不良数
|
| | | if (this.from.undesirable > 0) {
|
| | | if (this.from.defective.length === 0) return uni.showToast({
|
| | | title: '不良项不能为空',
|
| | | icon: 'none',
|
| | | duration: 2000
|
| | | });
|
| | | }
|
| | | let type = ''
|
| | | this.arrType.forEach(item => {
|
| | | if (item.active) {
|
| | | type = item.id
|
| | | }
|
| | | })
|
| | | autoWorkReport({
|
| | | createWorkorderRecordDTO: {
|
| | | type,
|
| | | duration: this.from.duration,
|
| | | qualifiedNum: this.from.qualified ? this.from.qualified : 0,
|
| | | unQualifiedNum: this.from.undesirable ? this.from.undesirable : 0
|
| | | },
|
| | | plansId: this.from.processPlan.id,
|
| | | proGroupId: this.deviceId,
|
| | | proUserList: [this.from.userId],
|
| | | recordList: this.wuList.map(item => {
|
| | | return {
|
| | | wstockId: item.id,
|
| | | num: item.num
|
| | | }
|
| | | }),
|
| | | createUnqualifiedDTOList: this.from.defective.map(item => {
|
| | | return {
|
| | | categoryId: item.id,
|
| | | unQualifiedNum: item.num
|
| | | }
|
| | | })
|
| | | }).then(res => {
|
| | | if (res.code === 200) {
|
| | | uni.showToast({
|
| | | title: '报工成功!',
|
| | | icon: 'success',
|
| | | duration: 2000
|
| | | });
|
| | | setTimeout(() => {
|
| | | uni.navigateBack({
|
| | | delta: 1
|
| | | });
|
| | | }, 2000);
|
| | | }
|
| | | })
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .bg {
|
| | | width: 100%;
|
| | | position: absolute;
|
| | | background: #F7F7F7;
|
| | |
|
| | | .contanir {
|
| | | height: calc(env(safe-area-inset-bottom) + 720rpx);
|
| | |
|
| | | .content {
|
| | | margin-top: 20rpx;
|
| | |
|
| | | .type-style {
|
| | | width: 325rpx;
|
| | | margin-bottom: 20rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_plan {
|
| | | width: 100%;
|
| | | // height: 98rpx;
|
| | | padding: 30rpx;
|
| | | box-sizing: border-box;
|
| | | background: #FFFFFF;
|
| | | margin-bottom: 40rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | |
|
| | | text {
|
| | | font-size: 30rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #222222;
|
| | |
|
| | | text {
|
| | | color: red;
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_plan_nr {
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | |
|
| | | text {
|
| | | font-size: 24rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #666666;
|
| | | margin-top: 20rpx;
|
| | |
|
| | | &:first-child {
|
| | | font-size: 32rpx;
|
| | | font-family: PingFangSC-Medium, PingFang SC;
|
| | | font-weight: 500;
|
| | | color: #333333;
|
| | | margin-top: 0 !important;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_plan_label_val {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | text {
|
| | | font-size: 28rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | }
|
| | |
|
| | | image {
|
| | | width: 12rpx;
|
| | | height: 24rpx;
|
| | | margin-left: 20rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_list {
|
| | | width: 100%;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | |
|
| | | .bottomval {
|
| | | margin-bottom: 20rpx !important;
|
| | | }
|
| | |
|
| | | .bg_list_item {
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | | margin-bottom: 40rpx;
|
| | |
|
| | | .kong {
|
| | | text-align: center;
|
| | | padding: 30rpx 0;
|
| | | background: #ffffff;
|
| | | font-size: 25rpx;
|
| | |
|
| | | text {
|
| | | color: #474747;
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_list_item_top {
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | padding-left: 30rpx;
|
| | | padding-right: 30rpx;
|
| | | margin-bottom: 30rpx;
|
| | |
|
| | | .bg_list_item_top_left {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .left {
|
| | | margin-left: 12rpx;
|
| | | font-size: 28rpx;
|
| | | }
|
| | |
|
| | | .warning {
|
| | | width: 8rpx;
|
| | | height: 30rpx;
|
| | | border-radius: 2rpx;
|
| | | margin-right: 12rpx;
|
| | | background: $nav-stateColor5 !important;
|
| | | }
|
| | |
|
| | | .error {
|
| | | width: 8rpx;
|
| | | height: 30rpx;
|
| | | border-radius: 2rpx;
|
| | | margin-right: 12rpx;
|
| | | background: $nav-stateColor4 !important;
|
| | | }
|
| | |
|
| | | .bg_list_item_top_left_x {
|
| | | width: 8rpx;
|
| | | height: 30rpx;
|
| | | background: $nav-color;
|
| | | border-radius: 2rpx;
|
| | | margin-right: 12rpx;
|
| | | }
|
| | |
|
| | | text {
|
| | | font-size: 32rpx;
|
| | | font-weight: 500;
|
| | | color: #222222;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_list_item_top_right {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | image {
|
| | | width: 28rpx;
|
| | | height: 28rpx;
|
| | | margin-right: 12rpx;
|
| | | }
|
| | |
|
| | | text {
|
| | | font-size: 28rpx;
|
| | | font-weight: 400;
|
| | | color: $nav-color;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .top {
|
| | | margin-top: 20rpx !important;
|
| | | }
|
| | |
|
| | | .bg_list_item_h {
|
| | | width: 100%;
|
| | | padding: 0 30rpx;
|
| | | box-sizing: border-box;
|
| | | background: white;
|
| | |
|
| | | .bg_list_item_num {
|
| | | width: 100%;
|
| | | min-height: 98rpx;
|
| | | background: white;
|
| | | display: flex;
|
| | | justify-content: center;
|
| | | align-items: center;
|
| | | border-bottom: 1rpx solid #E5E5E5;
|
| | |
|
| | | &:last-child {
|
| | | border: none !important;
|
| | | }
|
| | |
|
| | | .kong {
|
| | | text-align: center;
|
| | | font-size: 25rpx;
|
| | | padding: 30rpx 0;
|
| | | background: #ffffff;
|
| | | }
|
| | |
|
| | | .bg_list_item_num_item {
|
| | | width: 100%;
|
| | | height: 100%;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | // height: 118rpx;
|
| | | padding: 15rpx 0;
|
| | | box-sizing: border-box;
|
| | | justify-content: space-between;
|
| | | border-bottom: 1rpx solid #E5E5E5;
|
| | |
|
| | | &:last-child {
|
| | | border: none;
|
| | | }
|
| | |
|
| | | .bg_list_item_num_item_list {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .active {
|
| | | background: #305ED5 !important;
|
| | | color: #FFFFFF !important;
|
| | | }
|
| | |
|
| | | .bg_list_item_num_item_list_item {
|
| | | width: 116rpx;
|
| | | height: 62rpx;
|
| | | line-height: 62rpx;
|
| | | text-align: center;
|
| | | background: #F2F2F2;
|
| | | border-radius: 8rpx;
|
| | | font-size: 26rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #333333;
|
| | | margin-right: 20rpx;
|
| | |
|
| | | &:last-child {
|
| | | margin: 0 !important;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_list_item_num_item_wl {
|
| | | flex: 1;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | |
|
| | | text {
|
| | | font-size: 34rpx;
|
| | | color: #222222;
|
| | | }
|
| | |
|
| | | .bg_list_item_num_item_wl_lx {
|
| | | margin-top: 10rpx;
|
| | |
|
| | | text {
|
| | | color: #222222;
|
| | | font-size: 28rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .warning {
|
| | | color: $nav-stateColor5 !important;
|
| | | }
|
| | |
|
| | | .err {
|
| | | color: $nav-stateColor4 !important;
|
| | | }
|
| | |
|
| | | image {
|
| | | width: 12rpx;
|
| | | height: 24rpx;
|
| | | margin-left: 20rpx;
|
| | | }
|
| | |
|
| | | text {
|
| | | flex-shrink: 0;
|
| | | overflow: hidden;
|
| | | text-overflow: ellipsis;
|
| | | white-space: nowrap;
|
| | |
|
| | | text {
|
| | | font-size: 30rpx;
|
| | | color: red !important;
|
| | | margin-right: 5rpx;
|
| | | }
|
| | |
|
| | | .warning {
|
| | | color: $nav-stateColor5 !important;
|
| | | margin-right: 5rpx;
|
| | | }
|
| | |
|
| | | .err {
|
| | | color: $nav-stateColor4 !important;
|
| | | margin-right: 5rpx;
|
| | | }
|
| | |
|
| | | &:nth-child(1) {
|
| | | font-size: 30rpx;
|
| | | font-weight: 400;
|
| | | color: #222222;
|
| | | }
|
| | |
|
| | | &:nth-child(2) {
|
| | | font-size: 28rpx;
|
| | | font-weight: 400;
|
| | | color: #333333;
|
| | | flex-shrink: 0;
|
| | | }
|
| | | }
|
| | |
|
| | | .bg_list_item_num_item_sr {
|
| | | // flex: 1;
|
| | | flex-shrink: 0;
|
| | | width: 230rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: flex-end;
|
| | |
|
| | | .color1 {
|
| | | font-size: 28rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #333333;
|
| | | }
|
| | |
|
| | | input::-webkit-input-placeholder {
|
| | | font-size: 28rpx;
|
| | | }
|
| | |
|
| | | input {
|
| | | text-align: right;
|
| | | width: 180rpx;
|
| | | height: 60rpx;
|
| | | border-radius: 8rpx;
|
| | | border: 1rpx solid #E5E5E5;
|
| | | margin-right: 20rpx;
|
| | | font-size: 28rpx;
|
| | | font-weight: 400;
|
| | | color: #333333;
|
| | | padding: 0 30rpx;
|
| | | margin-right: 20rpx;
|
| | | }
|
| | |
|
| | | .wulll {
|
| | | width: 400rpx;
|
| | | text-align: right;
|
| | | overflow: hidden;
|
| | | white-space: nowrap;
|
| | | text-overflow: ellipsis;
|
| | | }
|
| | |
|
| | | text {
|
| | | font-size: 28rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bh_zw {
|
| | | height: 160rpx;
|
| | | }
|
| | |
|
| | | .bg_footer {
|
| | | position: fixed;
|
| | | bottom: 0;
|
| | | left: 0;
|
| | | width: 100%;
|
| | | z-index: 9;
|
| | | padding: 0 30rpx 60rpx 30rpx;
|
| | | box-sizing: border-box;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | |
|
| | | .bg_footer_submit1 {
|
| | | width: 334rpx;
|
| | | height: 88rpx;
|
| | | line-height: 88rpx;
|
| | | text-align: center;
|
| | | background: #FFFFFF;
|
| | | box-shadow: 0rpx 0rpx 12rpx 0rpx rgba(0, 0, 0, 0.08);
|
| | | border-radius: 8rpx;
|
| | | font-size: 30rpx;
|
| | | font-family: PingFangSC-Medium, PingFang SC;
|
| | | font-weight: 500;
|
| | | color: #305ED5;
|
| | | }
|
| | |
|
| | | .bg_footer_submit {
|
| | | width: 334rpx;
|
| | | height: 88rpx;
|
| | | background: $nav-color;
|
| | | box-shadow: 0 0 12rpx 0 rgba(0, 0, 0, 0.08);
|
| | | border-radius: 8rpx;
|
| | | font-size: 30rpx;
|
| | | font-weight: 500;
|
| | | color: #FFFFFF;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center;
|
| | | }
|
| | | }
|
| | |
|
| | | .bl {
|
| | | width: 100%;
|
| | | height: 800rpx;
|
| | | padding: 30rpx;
|
| | | box-sizing: border-box;
|
| | | display: flex;
|
| | | flex-direction: column;
|
| | |
|
| | | .bl_head {
|
| | | width: 100%;
|
| | | height: 50rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | |
|
| | | text {
|
| | | font-size: 28rpx;
|
| | | color: #222222;
|
| | |
|
| | | &:nth-child(2) {
|
| | | font-size: 32rpx !important;
|
| | | }
|
| | | }
|
| | |
|
| | | image {
|
| | | width: 28rpx;
|
| | | height: 28rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .bl_footer {
|
| | | width: 100%;
|
| | | height: 88rpx;
|
| | | line-height: 88rpx;
|
| | | text-align: center;
|
| | | background: #305ED5;
|
| | | border-radius: 8rpx;
|
| | | font-size: 32rpx;
|
| | | font-family: PingFangSC-Medium, PingFang SC;
|
| | | font-weight: 500;
|
| | | color: #FFFFFF;
|
| | | margin-top: 30rpx;
|
| | | }
|
| | |
|
| | | .bl_list {
|
| | | width: 100%;
|
| | | height: calc(100% - 168rpx);
|
| | | overflow-y: scroll;
|
| | | margin-top: 30rpx;
|
| | |
|
| | | .bl_list_item {
|
| | | width: 100%;
|
| | | height: 96rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | border-bottom: 1rpx solid #E5E5E5;
|
| | |
|
| | | &:last-child {
|
| | | border: none !important;
|
| | | }
|
| | |
|
| | | .bl_list_item_left {
|
| | | flex: 1;
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | input {
|
| | | width: 30rpx;
|
| | | height: 30rpx;
|
| | | border: 1rpx solid #CCCCCC;
|
| | | margin: 0 !important;
|
| | | }
|
| | |
|
| | | text {
|
| | | font-size: 30rpx;
|
| | | color: #222222;
|
| | | margin-left: 10rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .bl_list_item_right {
|
| | | width: 200rpx;
|
| | | flex-shrink: 0;
|
| | | height: 50rpx;
|
| | | text-align: right;
|
| | |
|
| | | input {
|
| | | padding-left: 5rpx;
|
| | | width: 160rpx;
|
| | | height: 100%;
|
| | | padding: 0 30rpx;
|
| | | box-sizing: border-box;
|
| | | text-align: right;
|
| | | font-size: 28rpx;
|
| | | color: #333333;
|
| | | border-radius: 10rpx;
|
| | | border: 1rpx solid #CCCCCC;
|
| | |
|
| | | &::-webkit-input-placeholder {
|
| | | font-size: 28rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bl_list {
|
| | | width: 100%;
|
| | | height: calc(100% - 168rpx);
|
| | | overflow-y: scroll;
|
| | | margin-top: 30rpx;
|
| | |
|
| | | .bl_list_item {
|
| | | width: 100%;
|
| | | height: 96rpx;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: space-between;
|
| | | border-bottom: 1rPX solid #E5E5E5;
|
| | |
|
| | | &:last-child {
|
| | | border: none !important;
|
| | | }
|
| | |
|
| | | .bl_list_item_left {
|
| | | flex: 1;
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | input {
|
| | | width: 30rpx;
|
| | | height: 30rpx;
|
| | | border: 1rpX solid #CCCCCC;
|
| | | margin: 0 !important;
|
| | | }
|
| | |
|
| | | span {
|
| | | font-size: 30rpx;
|
| | | color: #222222;
|
| | | margin-left: 10rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .bl_list_item_right {
|
| | | width: 200rpx;
|
| | | flex-shrink: 0;
|
| | | height: 50rpx;
|
| | | text-align: right;
|
| | |
|
| | | input {
|
| | | padding-left: 5rpx;
|
| | | width: 180rpx;
|
| | | height: 60rpx;
|
| | | border-radius: 8rpx;
|
| | | border: 1rpx solid #CCCCCC;
|
| | | padding: 0 30rpx;
|
| | | box-sizing: border-box;
|
| | | text-align: right;
|
| | | font-size: 28rpx;
|
| | | color: #333333;
|
| | | border-radius: 10rpx;
|
| | | border: 1rPX solid #CCCCCC;
|
| | |
|
| | | &::-webkit-input-placeholder {
|
| | | font-size: 28rpx;
|
| | | font-family: PingFangSC-Regular, PingFang SC;
|
| | | font-weight: 400;
|
| | | color: #999999;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .bottom-view {
|
| | | left: 40rpx;
|
| | | right: 40rpx;
|
| | | bottom: 20rpx
|
| | | }
|
| | | }
|
| | | </style> |