From ea87c908fb6cdfc3e227a584a53e6730efb8262a Mon Sep 17 00:00:00 2001 From: jiangping <jp@doumee.com> Date: 星期四, 26 十月 2023 13:41:12 +0800 Subject: [PATCH] 小程序代码 --- minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue | 712 +++++++++++++++++++++-------------------------------------- 1 files changed, 256 insertions(+), 456 deletions(-) diff --git a/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue b/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue index dc91f7c..0f42c0c 100644 --- a/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue +++ b/minipro_standard/pages_adjust/pages/reportingForWork/reportingForWork.vue @@ -5,8 +5,7 @@ <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.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> @@ -16,211 +15,210 @@ <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 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 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 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 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 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"> - <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> + <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> - <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 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 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 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> - <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> + <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 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="$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 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> - <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 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 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 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="bh_zw"></view> - <view class="bg_footer"> - <view class="bg_footer_submit1" @click="continueSubmit">缁х画鎶ュ伐</view> - <view class="bg_footer_submit" @click="submit">鎻愪氦</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> - </template> - + <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> <!-- 鐢熶骇浜哄憳 --> <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="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" /> + <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"> @@ -248,18 +246,8 @@ <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' + import { mapState } from 'vuex' + import { getDeviceByCondition, getFindAll, queryOne, queryList, autoWorkReport, getIdPlansExt, categoryExtList } from '@/util/api/PlanningAPI' export default { components: { user, @@ -275,30 +263,32 @@ userId: '', // userName: userInfo.companyUser.name, userName: '', - qualified: '', // 鑹搧鏁� + qualified: '', // 鑹搧鏁� undesirable: '', // 涓嶈壇鏁� duration: '', durationName: '0灏忔椂0鍒嗛挓', time: '', defective: [], defectiveName: '', - type: '', // 缁╂晥绫诲瀷 + type: '', // 缁╂晥绫诲瀷 index: 0 }, columns: [], arrType: [], bomType: '', - hasBom: '', + hasBom : '', deviceShow: false, userShow: false, wuList: [], deviceList: [], - cateList: [{ - active: false, - num: '', - name: '鏈夌憰鐤�' - }], - total: 0, // 鍙姇鏁伴噺 + cateList: [ + { + active: false, + num: '', + name: '鏈夌憰鐤�' + } + ], + total: 0, // 鍙姇鏁伴噺 ids: '', plansId: '', deviceId: '', @@ -311,49 +301,34 @@ ...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) + 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) } else { - return (Number(qualified) * (temp.salary / 10 / 10)).toFixed(2) + return (Number(this.from.qualified) * (this.arrType[this.from.index].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) + 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) } }, // 杈炬爣鐜� 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) + 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) 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) + 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) return ((Number(a) / Number(b)) * 100).toFixed(2) } } @@ -369,7 +344,7 @@ }, onLoad() { let arr = [] - for (let i = 0; i < 60; i++) { + for(let i = 0; i < 60; i++) { arr.push(i) } this.getData() @@ -385,12 +360,10 @@ 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 - }) + getDeviceByCondition({ procedureId: data.obj.procedureId }) .then(res1 => { if (res1.code === 200) { if (res1.data && res1.data.length > 0) { @@ -500,33 +473,21 @@ isOpen = true } }) - if (!isOpen) return uni.showToast({ - title: '璇烽�夋嫨涓嶈壇椤�', - icon: 'none', - duration: 2000 - }); + 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 - }); + 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 - }); + 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 @@ -559,55 +520,38 @@ }); }, openDev() { - if (!this.from.processPlan) return uni.showToast({ - title: '璇峰厛閫夋嫨宸ュ簭鐢熶骇璁″垝', - icon: 'none', - duration: 2000 - }); + 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 - }); + 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 - }); + uni.showToast({ title: '鎶曟枡鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺', icon: 'none', duration: 2000 }); } }, deleItem(index) { - if (this.wuList.length === 1) return uni.showToast({ - title: '鑷冲皯淇濈暀涓�椤瑰唴瀹�', - icon: 'none', - duration: 2000 - }); + if (this.wuList.length === 1) return uni.showToast({ title: '鑷冲皯淇濈暀涓�椤瑰唴瀹�', icon: 'none', duration: 2000 }); this.wuList.splice(index, 1) }, // 浜у嚭鏁伴噺楠岃瘉 - changeNum(type) { - if (type == 2) { - this.from.defective = [] - this.from.defectiveName = '' - } else { - this.from.qualified = event + changeNum(type) { + let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable)) + if (type == 2) { + this.from.defective = [] + this.from.defectiveName = '' } - let num = this.total - (Number(this.from.qualified) + Number(this.from.undesirable)) - if (num < 0) { - uni.$u.toast('浜у嚭鏁伴噺涓嶈兘澶т簬鍙骇鍑烘暟閲忥紒') + if (num < 0) { + uni.showToast({ title: '浜у嚭鏁伴噺涓嶈兘澶т簬鍙骇鍑烘暟閲忥紒', icon: 'none', duration: 2000 }); + if (type == 1) { + this.from.qualified = '' + } else { + this.from.undesirable = '' + } } }, openBL() { @@ -623,58 +567,26 @@ }, // 缁х画鎶ュ伐 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.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.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 - }); + 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 - }); + 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 - }); + 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 - }); + if (this.from.defective.length === 0) return uni.showToast({ title: '涓嶈壇椤逛笉鑳戒负绌�', icon: 'none', duration: 2000 }); } let type = '' this.arrType.forEach(item => { @@ -706,11 +618,7 @@ }) }).then(res => { if (res.code === 200) { - uni.showToast({ - title: '鎶ュ伐鎴愬姛锛�', - icon: 'success', - duration: 2000 - }); + uni.showToast({ title: '鎶ュ伐鎴愬姛锛�', icon: 'success', duration: 2000 }); this.arrType = [] this.from.processPlan = null this.from.deviceId = '' @@ -728,50 +636,26 @@ this.deviceId = '' this.plansId = '' this.ids = '' - this.total = 0 + 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.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.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 - }); + 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 - }); + if (this.from.defective.length === 0) return uni.showToast({ title: '涓嶈壇椤逛笉鑳戒负绌�', icon: 'none', duration: 2000 }); } let type = '' this.arrType.forEach(item => { @@ -803,15 +687,9 @@ }) }).then(res => { if (res.code === 200) { - uni.showToast({ - title: '鎶ュ伐鎴愬姛锛�', - icon: 'success', - duration: 2000 - }); + uni.showToast({ title: '鎶ュ伐鎴愬姛锛�', icon: 'success', duration: 2000 }); setTimeout(() => { - uni.navigateBack({ - delta: 1 - }); + uni.navigateBack({ delta: 1 }); }, 2000); } }) @@ -825,20 +703,16 @@ 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; @@ -849,29 +723,24 @@ 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; @@ -881,18 +750,15 @@ } } } - .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; @@ -900,32 +766,26 @@ } } } - .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; @@ -933,16 +793,13 @@ 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; @@ -950,7 +807,6 @@ margin-right: 12rpx; background: $nav-stateColor5 !important; } - .error { width: 8rpx; height: 30rpx; @@ -958,7 +814,6 @@ margin-right: 12rpx; background: $nav-stateColor4 !important; } - .bg_list_item_top_left_x { width: 8rpx; height: 30rpx; @@ -966,7 +821,6 @@ border-radius: 2rpx; margin-right: 12rpx; } - text { font-size: 32rpx; font-weight: 500; @@ -975,17 +829,14 @@ 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; @@ -993,17 +844,14 @@ } } } - .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; @@ -1012,18 +860,15 @@ 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%; @@ -1034,20 +879,16 @@ 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; @@ -1060,75 +901,61 @@ 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; @@ -1136,7 +963,6 @@ flex-shrink: 0; } } - .bg_list_item_num_item_sr { // flex: 1; flex-shrink: 0; @@ -1144,18 +970,15 @@ 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; @@ -1169,7 +992,6 @@ padding: 0 30rpx; margin-right: 20rpx; } - .wulll { width: 400rpx; text-align: right; @@ -1177,7 +999,6 @@ white-space: nowrap; text-overflow: ellipsis; } - text { font-size: 28rpx; font-family: PingFangSC-Regular, PingFang SC; @@ -1190,11 +1011,9 @@ } } } - .bh_zw { height: 160rpx; } - .bg_footer { position: fixed; bottom: 0; @@ -1206,21 +1025,19 @@ 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); + 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; @@ -1235,7 +1052,6 @@ justify-content: center; } } - .bl { width: 100%; height: 800rpx; @@ -1243,29 +1059,24 @@ 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; @@ -1279,13 +1090,11 @@ 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; @@ -1293,36 +1102,30 @@ 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; @@ -1334,7 +1137,6 @@ color: #333333; border-radius: 10rpx; border: 1rpx solid #CCCCCC; - &::-webkit-input-placeholder { font-size: 28rpx; font-family: PingFangSC-Regular, PingFang SC; @@ -1346,13 +1148,12 @@ } } } - .bl_list { width: 100%; height: calc(100% - 168rpx); overflow-y: scroll; margin-top: 30rpx; - + .bl_list_item { width: 100%; height: 96rpx; @@ -1360,36 +1161,36 @@ 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; @@ -1403,7 +1204,7 @@ color: #333333; border-radius: 10rpx; border: 1rPX solid #CCCCCC; - + &::-webkit-input-placeholder { font-size: 28rpx; font-family: PingFangSC-Regular, PingFang SC; @@ -1414,11 +1215,10 @@ } } } - .bottom-view { left: 40rpx; right: 40rpx; - bottom: 20rpx + bottom: 0 } } -</style> +</style> -- Gitblit v1.9.3