From 094bff4f727d2fd2c6cf5a923d76782aa3f8010a Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 29 四月 2024 16:09:57 +0800
Subject: [PATCH] 1.圣沣 移动端 新增
---
pages/scgl/scbg.vue | 363 +++++++++++++++++++++++++++++++--------------------
1 files changed, 217 insertions(+), 146 deletions(-)
diff --git a/pages/scgl/scbg.vue b/pages/scgl/scbg.vue
index 1d05155..4cfc281 100644
--- a/pages/scgl/scbg.vue
+++ b/pages/scgl/scbg.vue
@@ -11,7 +11,7 @@
</view>
<view v-show="topContent.length!==0">
- <view class="mainContent" :style="{maxHeight:'1200rpx',overflow: 'scroll'}">
+ <view class="mainContent" :style="{maxHeight:'1260rpx',overflow: 'scroll'}">
<!-- 鎶ュ伐淇℃伅 -->
<u-gap height="15" bgColor="#eff0f1"></u-gap>
@@ -104,8 +104,8 @@
</view>
- <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;"
- v-if="reckway==='涓汉'">
+ <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
+ <!-- v-if="reckway==='涓汉'" -->
<view style="display: flex;" class="titleFont">
<view style="color: red;margin-right: 6rpx;">*</view> 鎶ュ伐浜哄憳锛�
</view>
@@ -139,7 +139,8 @@
<view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
<view style="color: red;margin-right: 6rpx;">*</view> 鎶ュ伐鏁伴噺锛�
<view class='inputClass'>
- <u--input placeholder="璇疯緭鍏�" border="surround" type='number' v-model="reportqty">
+ <u--input placeholder="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number'
+ v-model="reportqty">
</u--input>
</view>
</view>
@@ -147,8 +148,8 @@
<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" @change='ngqtyChange' type='number'
- v-model="ngqty"></u--input>
+ <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;">
@@ -193,13 +194,13 @@
</view>
<!-- 鎶ュ伐浜哄憳淇℃伅 -->
- <u-gap height="15" v-if="reckway==='鐝粍'" bgColor="#eff0f1"></u-gap>
+ <!-- <u-gap height="15" v-if="reckway==='鐝粍'" bgColor="#eff0f1"></u-gap>
<view class="head marginLeft10 marginRight10" v-if="reckway==='鐝粍'">
<view class="head_block">
<view class="head_left">
<view class="head_bar"></view>
<view class="head_title">
- 鎶ュ伐浜哄憳淇℃伅
+ 涓嶈壇鍘熷洜鏄庣粏
</view>
</view>
</view>
@@ -240,7 +241,7 @@
- </view>
+ </view> -->
</view>
@@ -250,17 +251,12 @@
@click="submit" text="鎶ュ伐">
</u-button>
- <!-- <u-action-sheet :actions="userGroupSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
- :closeOnClickAction="true" @close="userGroupSheetShow=false" :show="userGroupSheetShow"
- @select='userGroupSheetSelect'>
- </u-action-sheet> -->
+
<u-picker v-if="topContent.length!==0" :show="userGroupSheetShow" :columns="userGroupColumns"
:itemHeight='55' :closeOnClickOverlay='true' @close='userGroupSheetShow=false'
@confirm='userGroupPickerConfirm' @cancel='userGroupSheetShow=false'>
</u-picker>
- <!-- <u-action-sheet :actions="eqpSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
- :closeOnClickAction="true" @close="eqpSheetShow=false" :show="eqpSheetShow" @select='eqpSheetSelect'>
- </u-action-sheet> -->
+
<u-picker v-if="topContent.length!==0" :show="eqpSheetShow" :columns="eqpColumns" :itemHeight='55'
:closeOnClickOverlay='true' @close='eqpSheetShow=false' @confirm='eqpPickerConfirm'
@cancel='eqpSheetShow=false'>
@@ -275,8 +271,8 @@
<u-checkbox-group @change="checkboxChange" size='20px' v-model="checkBoxValue" iconPlacement="right"
placement="column">
<view v-for="(item,index) in badSelectArr">
- <u-checkbox activeColor="rgb(0, 102, 255)" labelSize='18' :key="item.code" :name='item.name'
- :label="item.name">
+ <u-checkbox activeColor="rgb(0, 102, 255)" labelSize='18' :key="item.code+index"
+ :name='item.name' :label="item.name">
</u-checkbox>
<u-divider :key="item.code"></u-divider>
</view>
@@ -285,9 +281,26 @@
</u-action-sheet>
- <!-- <u-action-sheet :actions="operSheetList" :safeAreaInsetBottom='true' :closeOnClickOverlay="true"
- :closeOnClickAction="true" @close="operSheetShow=false" :show="operSheetShow" @select='operSheetSelect'>
- </u-action-sheet> -->
+
+ <u-action-sheet v-if="topContent.length!==0" :actions="userSelectArrAll" :safeAreaInsetBottom='true'
+ :closeOnClickOverlay="true" :closeOnClickAction="true" @close="userSheetShow=false"
+ :show="userSheetShow" @select='userSheetSelect'>
+ <view style="min-height: 100rpx;padding: 20rpx 20rpx 30rpx 20rpx;">
+ <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>
+ <u-divider :key="item.code"></u-divider>
+ </view>
+ </u-checkbox-group>
+ </view>
+ </u-action-sheet>
+
+
+
+
<u-picker v-if="topContent.length!==0" :show="operSheetShow" :columns="operColumns" :itemHeight='55'
:closeOnClickOverlay='true' @close='operSheetShow=false' @confirm='operPickerConfirm'
@cancel='operSheetShow=false'>
@@ -296,13 +309,36 @@
<u-modal v-if="topContent.length!==0" :show="modalShow" :showCancelButton='true' cancelText='鍙栨秷'
@close="modalShow=false" :closeOnClickOverlay="true" style=" " @cancel="modalCancel"
- @confirm="modalConfirm" title="鎶ュ伐浜哄憳" :content='modalContent'>
+ @confirm="modalConfirm" title="涓嶈壇鏄庣粏" :content='modalContent'>
- <uni-section style="width: 100%;" title=''>
+ <!-- <uni-section style="width: 100%;" title=''>
<uni-data-select v-model="userSelectValue" :clear='false' emptyText :localdata="userSelectArr"
@change="userChange">
</uni-data-select>
- </uni-section>
+ </uni-section> -->
+
+ <!-- <view style="display: flex;flex-direction: column;">
+ <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" @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> -->
+
</u-modal>
@@ -334,7 +370,9 @@
EqpPermissionsPlus,
GroupsPermissions,
GroupsPersonPermissions,
- DefectPermissions
+ DefectPermissions,
+ SavaMesOrderStepReport,
+ LabelBarCode
} from '../../config/api.js';
// import scanCode from '@/components/scan-code/scan-code.vue'
export default {
@@ -421,7 +459,10 @@
userGroupColumns: [], //
eqpColumns: [], //
operColumns: [], //
- isAsyncChange: false
+ isAsyncChange: false,
+
+ userCheckBoxValue: [],
+ userSheetShow: false
}
},
created() {
@@ -431,17 +472,26 @@
this.init()
- this.getMesOrderStepStart('SGPO20231110_1;101')
- this.getGroupsPermissions() //鑾峰彇鐢熶骇鐝粍
- this.getEqpPermissionsPlus() //鑾峰彇璁惧鍚嶇О
- this.getDefectPermissions() //鑾峰彇缂洪櫡涓嬫媺
- this.getPersonPermissions() //鑾峰彇鎿嶄綔浜哄憳
- // this.getGroupsPersonPermissions('BZ001') //鏍规嵁鐝粍鑾峰彇浜哄憳
+ // this.getMesOrderStepStart('SGPO20231110_1;101')
+
+
+
+
+ this.getSellectAllApi()
+
+
},
methods: {
init() {
uni.stopPullDownRefresh();
},
+ async getSellectAllApi() {
+ await this.getGroupsPermissions() //鑾峰彇鐢熶骇鐝粍
+ await this.getEqpPermissionsPlus() //鑾峰彇璁惧鍚嶇О
+ await this.getDefectPermissions() //鑾峰彇缂洪櫡涓嬫媺
+ await this.getPersonPermissions() //鑾峰彇鎿嶄綔浜哄憳
+ },
+
//鑾峰彇鐢熶骇鐝粍
async getGroupsPermissions(wkshopcode) {
@@ -475,7 +525,7 @@
this.badSelectArr = res.data
}
},
- // 鑾峰彇鎿嶄綔浜哄憳
+ // 鑾峰彇鎶ュ伐浜哄憳
async getPersonPermissions() {
const res = await PersonPermissions()
if (res.code === '200') {
@@ -492,26 +542,46 @@
}
},
// 鏍规嵁鐢熶骇鐝粍鑾峰彇浜哄憳
- async getGroupsPersonPermissions(usergroupcode) {
- const res = await GroupsPersonPermissions()
- if (res.code === '200') {
- this.userArr = res.data
- this.calculatedValue()
- }
- },
- // 璁$畻鍒嗛厤姣斾緥鐨勫��
- calculatedValue() {
- const total = 100;
- let value = 0
- this.userArr.forEach(item => {
- item.ratio = parseFloat((100 / this.userArr.length).toFixed(2))
- value += item.ratio
+ async getGroupsPersonPermissions(groupcode) {
+
+ const res = await GroupsPersonPermissions({
+ groupcode
})
- if (Math.round(value * 100) / 100 !== total) {
- this.userArr[this.userArr.length - 1].ratio = parseFloat((this.userArr[this.userArr.length - 1].ratio +
- (total - value)).toFixed(2))
+ if (res.code === '200') {
+ this.userCheckBoxValue = []
+
+ if (res.data[0].usercode_list && res.data[0].usercode_list.length > 0) {
+ this.userSelectArrAll.forEach(i => {
+
+ if (res.data[0].usercode_list.split(',').includes(i.code)) {
+ this.userCheckBoxValue.push(i.name)
+ }
+
+ })
+
+ }
+
+ this.operSheetValue = this.userCheckBoxValue.join(',')
+
+
}
},
+
+
+
+ userSheetSelect() {
+
+ },
+ userCheckboxChange(val) {
+ this.userCheckBoxValue = val.join(',')
+ // this.userCheckBoxValue = ['001']
+ // this.$forceUpdate()
+
+ // console.log(this.userCheckBoxValue);
+ },
+
+
+
//鑾峰彇寮�宸ヤ俊鎭�
async getMesOrderStepStart(orderstepqrcode) {
@@ -579,6 +649,7 @@
},
async submit() {
+ // 涓嬪崍鍐欑敓浜ф姤宸ユ彁浜�
if (this.reckway === '鐝粍' && this.userGroupSheetValue === "") {
return uni.$u.toast('鐢熶骇鐝粍涓嶈兘涓虹┖锛�')
@@ -593,38 +664,18 @@
return uni.$u.toast('鎶ュ伐鏁伴噺涓嶈兘涓虹┖锛�')
}
- if (this.reckway === '鐝粍' && this.userArr.length === 0) {
+ 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('鎶ュ伐浜哄憳淇℃伅涓嶈兘涓虹┖锛�')
}
- if (this.reckway === '鐝粍') {
- let sum = 0
- this.userArr.forEach(item => {
- console.log(item.ratio, 'item.ratio')
- sum += parseFloat(item.ratio)
- })
- sum = parseFloat(sum)
- console.log(sum, 'sum44')
- if (Math.round(sum * 100) / 100 !== 100) {
- return uni.$u.toast('鍒嗛厤姣斾緥鎬诲拰蹇呴』涓�100锛�')
- }
- }
-
- const header = {
- // 'Content-Type': 'multipart/form-data',
- 'Content-Type': 'application/x-www-form-urlencoded',
- 'rediskey': uni.getStorageSync('rediskey'),
- 'admin': uni.getStorageSync('usercode'),
- 'username': encodeURIComponent(uni.getStorageSync('username')),
- 'navTabId': uni.getStorageSync('usercode'),
- 'userid': uni.getStorageSync('userid'),
- 'guid': uni.getStorageSync('guid'),
- 'usertype': 'APP'
- }
let badcode = []
-
if (this.badSheetValue.length > 0) {
this.badSelectArr.forEach(i => {
@@ -642,84 +693,95 @@
- let reportuser = ''
+ let reportuser = []
- // if (this.$company === 'A') {
- // reportuser = this.reckway === '鐝粍' ? JSON.stringify(this.userArr) : JSON.stringify([{
- // usercode: this.operSheetValue,
- // ratio: 100
- // }])
- // } else {
- reportuser = this.userArr.map(i => i.usercode).join(';') //鎶ュ伐浜哄憳
- // }
+ if (this.operSheetValue.length > 0) {
+ this.userSelectArrAll.forEach(i => {
+ if (this.operSheetValue.split(',').includes(i.name)) {
+ reportuser.push(i.code)
+ }
+ })
+ }
+
+ console.log(this.userSelectValue);
+ // reportuser = this.userArr.map(i => i.usercode).join(';') //鎶ュ伐浜哄憳
+
+
+
+ const D = {
+ rightcode: '0601',
+ partcode: this.topContent[0].partnumber,
+ qty: parseFloat(this.reportqty),
+ onelabqty: parseFloat(this.reportqty)
+ }
+ const {
+ data: R
+ } = await LabelBarCode(D)
const data = {
- admin: uni.getStorageSync('usercode'),
- mesordercode: this.formData.wo_code, // 宸ュ崟缂栧彿
- partcode: this.formData.partnumber, // 浜у搧缂栫爜
- stepseq: this.formData.seq, // 宸ュ簭搴忓彿
- stepcode: this.formData.stepcode, // 宸ュ簭缂栫爜
- eqpcode: this.eqpSheetList.find(i => i.name === this.eqpSheetValue).code, // 璁惧缂栫爜
- taskqty: this.formData.planqty, // 浠诲姟鏁伴噺
- startqty: this.formData.reportqty, // 寮�宸ユ暟閲�
+ mesordercode: this.topContent[0].wo_code,
+ partcode: this.topContent[0].partnumber,
+ stepseq: this.topContent[0].seq,
+ stepcode: this.topContent[0].stepcode,
+ stepprice: this.topContent[0].stepprice,
+
+ eqpcode: this.eqpSheetList.find(i => i.name === this.eqpSheetValue).code,
+
+ reckway: this.reckway === '鐝粍' ? 'group' : 'person',
+
usergroupcode: this.userGroupSheetValue ? this.userGroupSheetList.find(i => i.name === this
.userGroupSheetValue).code : '', // 鐝粍缂栫爜
- reportqty: parseFloat(this.reportqty), // 鎶ュ伐鏁伴噺
- // reportuser: this.userArr.map(i => i.usercode).join(';'), //鎶ュ伐浜哄憳
- reportuser,
-
- //鎶ュ伐浜哄憳
- remarks: '', // 澶囨敞
- reckway: this.reckway === '鐝粍' ? 'group' : 'person', //
- ngqty: this.ngqty === '' ? 0 : this.ngqty, //涓嶈壇鏁伴噺
- badcode: badcode.join(';'), //涓嶈壇鍘熷洜
-
- inbarcode: '', //鎵爜鍏ュ簱
+ reportuser: this.reckway === '鐝粍' ? reportuser.join(',') : this.userSelectArrAll.find(i => i
+ .name === this.operSheetValue).code,
+ taskqty: this.topContent[0].planqty,
+ startqty: parseFloat(this.reportqty),
+ reportqty: parseFloat(this.reportqty),
+ inbarcode: R[0].labcode, //鍏ュ簱鏉$爜
+ defectlist: badcode.length > 0 ? [{
+ defect_code: badcode.join(','),
+ badqty: this.ngqty
+ }] : [],
+ remarks: ''
}
- console.log(data, 7777)
-
+ console.log(JSON.parse(JSON.stringify(data)), 7777)
this.isDisabledSubmitButton = true
- uni.uploadFile({
- url: this.$baseUrl + '/AppProductionManagement/SavaMesOrderStepReport',
- files: [{
- "uri": "/"
- }],
- header: header,
- formData: data,
- success: (res) => {
- uni.$u.toast('鎶ュ伐鎴愬姛锛�')
- this.topContent = []
- this.formData = {}
- this.reportqty = ''
- this.ngqty = ''
- this.reckway = '涓汉'
- this.userGroupSheetValue = ''
- this.eqpSheetValue = ''
- this.userGroupSheetList = []
- this.eqpSheetList = []
- this.badSelectArr = []
- this.badSheetValue = []
- this.checkBoxValue = []
- this.operSheetValue = ''
- this.operSheetList = []
- this.userArr = []
- this.userSelectValue = ''
- this.userSelectArrAll = []
- this.userSelectArr = []
- this.userGroupColumns = []
- this.eqpColumns = []
- this.operColumns = []
+ const res = await SavaMesOrderStepReport(data)
+ if (res.code === '200') {
+ uni.$u.toast('鎶ュ伐鎴愬姛锛�')
+ this.topContent = []
+ this.formData = {}
+ this.reportqty = ''
+ this.ngqty = ''
+ this.reckway = '涓汉'
+ this.userGroupSheetValue = ''
+ this.eqpSheetValue = ''
+ // this.userGroupSheetList = []
+ // this.eqpSheetList = []
+ // this.badSelectArr = []
+ this.badSheetValue = []
+ this.checkBoxValue = []
+ this.operSheetValue = ''
+ // this.operSheetList = []
+ // this.userArr = []
+ this.userSelectValue = ''
+ // this.userSelectArrAll = []
+ // this.userSelectArr = []
+ // this.userGroupColumns = []
+ // this.eqpColumns = []
+ // this.operColumns = []
+
+ this.userCheckBoxValue = []
+ this.userSheetShow = false
- this.isDisabledSubmitButton = false
- },
- fail(res) {
- uni.$u.toast('鎶ュ伐澶辫触锛�')
- this.isDisabledSubmitButton = false
- },
- })
+ this.isDisabledSubmitButton = false
+ }
+
+
+
+
},
userGroupSheetSelect(val) {
@@ -750,7 +812,16 @@
console.log(this.badSheetValue, 5);
},
operSheetClick() {
- this.operSheetShow = true
+ if (this.reckway === '涓汉') {
+ this.operSheetShow = true
+ }
+
+ if (this.reckway === '鐝粍') {
+ this.userSheetShow = true
+ }
+
+
+
},
operSheetSelect(val) {
this.operSheetValue = val.name
@@ -773,7 +844,7 @@
// 鍒犻櫎浜哄憳鎸夐挳
deleteUser(item) {
this.userArr = this.userArr.filter(i => i.usercode !== item.usercode)
- this.calculatedValue()
+
},
// 妯℃�佹鍙栨秷鎸夐挳
modalCancel() {
@@ -792,7 +863,7 @@
uni.$u.toast('璇烽�夋嫨鎶ュ伐浜哄憳锛�')
}
this.modalShow = false
- this.calculatedValue()
+
},
userChange(val) {
this.userSelectValue = val
--
Gitblit v1.9.3