From 9e7bbd1a203c39c74b81624640a5ea8f6e247ba3 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期二, 14 五月 2024 10:08:02 +0800
Subject: [PATCH] 1.外协收料不良数量可填多个
---
pages/scgl/scbg.vue | 134 +++++---------------------------------------
1 files changed, 16 insertions(+), 118 deletions(-)
diff --git a/pages/scgl/scbg.vue b/pages/scgl/scbg.vue
index e2a80cb..8f7247a 100644
--- a/pages/scgl/scbg.vue
+++ b/pages/scgl/scbg.vue
@@ -145,29 +145,6 @@
</view>
</view>
- <!-- <view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
- <view style="color: #fff;margin-right: 6rpx;">*</view> 涓嶈壇鏁伴噺锛�
- <view class='inputClass'>
- <u--input placeholder="璇疯緭鍏�" border="surround" :adjustPosition='false'
- @change='ngqtyChange' type='number' v-model="ngqty"></u--input>
- </view>
- </view>
- <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
- <view style="display: flex;" class="titleFont">
- <view style="color: #fff;margin-right: 6rpx;">*</view> 涓嶈壇鍘熷洜锛�
- </view>
- <view @click='badSheetClick' class="custominputClass">
- <view v-show='badSheetValue.length===0' style="color: rgb(192, 196, 204);">璇烽�夋嫨</view>
- <view v-show='badSheetValue.length!==0' class="ellipsis" style="width: 390rpx;">
- {{badSheetValue}}
- </view>
- <u-icon :name="!badSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
- </view>
- </view> -->
-
-
-
-
</view>
</view>
@@ -190,13 +167,13 @@
<u-button type="primary" :plain="true" icon='plus-circle' text="娣诲姞"
style="width: 90%;margin: 20rpx auto;" @click="add"></u-button>
- <!-- ngqtyArr -->
+
<view v-for='(item,index) in ngqtyArr' class="badSheetClass" :key="item.uid">
- <!-- {{item.uid}} -->
+
<view class="badNumber">{{index+1}}</view>
- <u-icon name="trash" size="20" class="trash" @click="trashDelete(index)"
- color="rgb(0, 102, 255)"></u-icon>
+ <u-icon name="trash" size="20" class="trash" v-if="ngqtyArr.length!==1"
+ @click="trashDelete(index)" color="rgb(0, 102, 255)"></u-icon>
<view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
<view style="color: #fff;margin-right: 6rpx;">*</view> 涓嶈壇鏁伴噺锛�
@@ -204,7 +181,7 @@
<u--input placeholder="璇疯緭鍏�" border="surround" :adjustPosition='false' type='number'
v-model="item.ngqty"></u--input>
</view>
- <!-- @change='ngqtyChange(item)' -->
+
</view>
<view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
<view style="display: flex;" class="titleFont">
@@ -225,13 +202,6 @@
</view>
-
-
- <!--
- <u-button type="primary" :plain="true" icon='plus-circle' text="娣诲姞"
- style="width: 90%;margin: 20rpx auto;" @click="add"></u-button> -->
-
-
</view>
</view>
@@ -300,22 +270,6 @@
</u-checkbox-group>
</view>
</u-action-sheet>
-
- <!-- <u-popup :show="userSheetShow" @close="userSheetShow=false" customStyle='customPopupStyle'
- :safeAreaInsetTop='true' @open="open">
- <u-checkbox-group @change="userCheckboxChange" size='20px' v-model="userCheckBoxValue"
- iconPlacement="right" placement="column">
- <view v-for="(item,index) in userSelectArrAll">
- <u-checkbox activeColor="rgb(0, 102, 255)" labelSize='18' :key="item.code+index"
- :name='item.name' :label="item.name">
- </u-checkbox>
- </view>
- </u-checkbox-group>
- </u-popup> -->
-
-
-
-
<!-- 鎶ュ伐浜哄憳 -->
<u-picker v-if="topContent.length!==0" :show="operSheetShow" :columns="operColumns" :itemHeight='55'
@@ -473,7 +427,7 @@
mounted() {
this.init()
- this.getMesOrderStepStart('MO-2024-01-0004_1;102')
+ // this.getMesOrderStepStart('MO-2024-01-0004_1;102')
this.getSellectAllApi()
},
@@ -570,14 +524,7 @@
},
userCheckboxChange(val) {
this.userCheckBoxValue = val.join(',')
- // this.userCheckBoxValue = ['001']
- // this.$forceUpdate()
-
- // console.log(this.userCheckBoxValue);
},
-
-
-
//鑾峰彇寮�宸ヤ俊鎭�
async getMesOrderStepStart(orderstepqrcode) {
@@ -592,12 +539,6 @@
if (res.code === '200' && res.count === 1) {
this.formData = res.data
this.topContent.unshift(res.data)
- // this.getGroupsPermissions(res.data.wkshopcode)
- // let o = res.data.wo_code + ';' + res.data.stepcode
- // this.getEqpPermissionsPlus(o)
- // this.getDefectPermissions(o)
- // this.getPersonPermissions()
-
} else if (res.code === '200' && res.count !== 1) {
this.$u.toast('姝ゅ伐搴忓凡鎶ュ伐锛�')
}
@@ -632,17 +573,6 @@
});
},
- // 姝ヨ繘鍣ㄥ�兼敼鍙樻椂
- numberBoxChange(val) {
- this.userArr.find(i => i.usercode === val.name).ratio = parseFloat(val.value).toFixed(2)
- },
-
- ngqtyChange(val) {
- if (!parseFloat(val)) {
- this.badSheetValue = ''
- this.checkBoxValue = ''
- }
- },
async submit() {
// 涓嬪崍鍐欑敓浜ф姤宸ユ彁浜�
@@ -660,16 +590,9 @@
return uni.$u.toast('鎶ュ伐鏁伴噺涓嶈兘涓虹┖锛�')
}
- // if (parseFloat(this.reportqty) + parseFloat(this.ngqty) > parseFloat(this.topContent[0].noreportqty)) {
- // return uni.$u.toast('鎶ュ伐鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庢湭鎶ユ暟閲忥紒')
- // }
-
-
if (this.reckway === '鐝粍' && this.operSheetValue.length === 0) {
return uni.$u.toast('鎶ュ伐浜哄憳淇℃伅涓嶈兘涓虹┖锛�')
}
-
-
let badcode = []
@@ -681,14 +604,6 @@
})
}
- // if (this.ngqty !== '') {
- // if (badcode.length === 0) {
- // return uni.$u.toast('涓嶈壇鍘熷洜鏈�夋嫨锛�')
- // }
- // }
-
-
-
let reportuser = []
if (this.operSheetValue.length > 0) {
@@ -699,28 +614,30 @@
})
}
- console.log(this.userSelectValue);
- // reportuser = this.userArr.map(i => i.usercode).join(';') //鎶ュ伐浜哄憳
-
// 涓嶈壇鍘熷洜
const defectlist = []
+ //涓嶈壇鏁伴噺
+ let ngqtyNumber = 0
this.ngqtyArr.forEach(i => {
-
-
if (i.badSheetValue.toString().length > 0) {
let codeArr = []
+ ngqtyNumber += parseFloat(i.ngqty)
i.badSheetValue.split(',').forEach(j => {
codeArr.push(this.badSelectArr.find(i => i.name === j).code)
})
-
defectlist.push({
badqty: i.ngqty,
defect_code: codeArr.join(',')
})
}
-
})
+
+
+ if (parseFloat(this.reportqty) + parseFloat(ngqtyNumber) > parseFloat(this.topContent[0]
+ .noreportqty)) {
+ return uni.$u.toast('鎶ュ伐鏁伴噺鍔犱笉鑹暟閲忎笉鑳藉ぇ浜庢湭鎶ユ暟閲忥紒')
+ }
@@ -763,7 +680,7 @@
remarks: ''
}
- console.log(JSON.parse(JSON.stringify(data)), 7777)
+ // console.log(JSON.parse(JSON.stringify(data)), 7777)
this.isDisabledSubmitButton = true
const res = await SavaMesOrderStepReport(data)
if (res.code === '200') {
@@ -829,8 +746,6 @@
// console.log(val,9999999)
},
badSheetClick(item) {
- // console.log(item, 1)
-
if (!item.ngqty) {
return uni.$u.toast('璇峰厛濉啓涓嶈壇鏁伴噺锛�')
}
@@ -843,19 +758,15 @@
badSelectClose() {
let index = this.ngqtyArr.findIndex(i => !i.arrowDown)
-
this.ngqtyArr[index].badSheetValue = this.checkBoxValue.join(',')
this.ngqtyArr[index].arrowDown = true
-
this.checkBoxValue = []
this.badSheetShow = false
-
},
checkboxChange(val) {
this.badSheetValue = val.join(',')
- console.log(this.badSheetValue, 5);
},
operSheetClick() {
if (this.reckway === '涓汉') {
@@ -969,19 +880,6 @@
max-height: 600rpx !important;
overflow: auto !important;
}
-
- ::v-deep .u-number-box__minus {
- height: 50rpx !important;
- }
-
- ::v-deep .u-number-box__input {
- height: 50rpx !important;
- }
-
- ::v-deep .u-number-box__plus {
- height: 50rpx !important;
- }
-
::v-deep .u-checkbox-label--right {
padding: 30rpx;
--
Gitblit v1.9.3