From d26ff568b097248861a6cbc13bcf2acc88a54524 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期五, 23 五月 2025 11:03:06 +0800
Subject: [PATCH] 1.上靖 app端部署
---
pages/sbgl/rcdj.vue | 519 ++++++++++++++-------------------------------------------
1 files changed, 130 insertions(+), 389 deletions(-)
diff --git a/pages/sbgl/rcdj.vue b/pages/sbgl/rcdj.vue
index 5d6ee32..2b5ad91 100644
--- a/pages/sbgl/rcdj.vue
+++ b/pages/sbgl/rcdj.vue
@@ -2,188 +2,69 @@
<view>
<page-nav title="鏃ュ父鐐规"></page-nav>
- <!-- <u-notify ref="uNotify"></u-notify> -->
- <view v-show="topContent.length===0">
+ <view v-if="purchorderArrAll.length>0">
+ <!-- <view class="mainContent" :style="{maxHeight: '1340rpx',overflow: 'scroll',padding:0}"> -->
+
+ <!-- #ifdef H5 -->
+ <u--input prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" placeholder="杈撳叆璁惧/宸ヤ綅"
+ clearable border="surround" @clear='inputBoxValueClear' v-model="inputBoxValue"
+ @change="changeInputBoxValue">
+ <template slot="suffix">
+ <u-icon name="scan" color="#909399" size="24" @click="topScanClick"></u-icon>
+ </template>
+ </u--input>
+ <!-- #endif -->
+
+ <!-- #ifdef APP-PLUS -->
+ <u-input prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399" placeholder="杈撳叆璁惧/宸ヤ綅"
+ clearable border="surround" @clear='inputBoxValueClear' v-model="inputBoxValue"
+ @change="changeInputBoxValue">
+ <template slot="suffix">
+ <u-icon name="scan" color="#909399" size="24" @click="topScanClick"></u-icon>
+ </template>
+ </u-input>
+ <!-- #endif -->
+
+
+ <u-alert :title="'璁惧/宸ヤ綅鏁帮紙鍏�'+title+'涓級'" type="primary"></u-alert>
+
+ <u-radio-group v-model="radioValue" iconPlacement="right" @change="radioValueClick" class="radioGroupClass">
+ <view v-for="(item,index) in purchorderArr" :key="item.code">
+ <!-- @click="radioValueClick(item.code)" -->
+ <view>
+ <u-radio activeColor="red" size="18" labelSize='18' :name='item.code' :key="item.code"
+ :label="item.code+'/'+item.name"></u-radio>
+ </view>
+ <u-line v-if="index!==purchorderArr.length-1" color="#2979ff"></u-line>
+ </view>
+ </u-radio-group>
+
+ <view class="footer" style="min-height:62rpx;">
+ <u-button type="primary" size='large' :hairline="true" @click="navigateTo" text="涓嬩竴姝�"></u-button>
+ </view>
+ <!-- </view> -->
+ </view>
+
+
+ <view v-if="purchorderArrAll.length===0">
<div class="sacnBody">
- <div class="scanImg" @click="topScanClick"></div>
- <div class="scanText">鎵弿鐐规宸ヤ綅</div>
+ <div class="boxImg"></div>
+ <div class="scanText">鏆傛棤璁惧/宸ヤ綅</div>
</div>
</view>
-
-
- <view v-show="topContent.length!==0">
- <view class="mainContent">
- <view>
- <u-gap height="10" bgColor="#eff0f1"></u-gap>
- <view class="head">
- <view class="head_block">
- <view class="head_left">
- <view class="head_bar"></view>
- <view class="head_title">
- 鎵弿鐐规宸ヤ綅
- </view>
- </view>
-
- <view class="marginRight20">
- <u-icon name="scan" @click="topScanClick" color="red" size="28"></u-icon>
- </view>
-
- </view>
-
- <view class="marginLeft20 marginRight20" style="max-height: 180rpx;overflow:auto;">
- <u-radio-group v-model="radioValue" class="flex_column">
- <view class="marginBottom20 flex_between" @click="groupChange(item.code)"
- v-for="item in topContent" :key="item.code">
- <view style="display: flex;">
- <view class="flex_column titleFont">
- <view>宸ヤ綅缂栫爜锛�</view>
- <view>宸ヤ綅鍚嶇О锛�</view>
- <view>鐢熶骇杞﹂棿锛�</view>
- </view>
- <view class="flex_column contentFont">
- <view>{{item.code}}</view>
- <view>{{item.name}}</view>
- <view>{{item.wksp_name}}</view>
- </view>
- </view>
- <u-radio style="line-height: 44rpx;" size='20' :key="item.code" :name="item.code"
- @change="groupChange(item.code)" activeColor="red"></u-radio>
- </view>
- </u-radio-group>
- </view>
-
- </view>
-
- <u-gap height="10" bgColor="#eff0f1"></u-gap>
- <view class="head" style="height:82rpx;">
- <view class="head_block">
- <view class="head_left">
- <view class="head_bar"></view>
- <view class="head_title">
- 鐐规鏍囧噯
- </view>
- </view>
-
- <view class="marginRight20 marginTop10" style="width: 200rpx;">
- <!-- <u-icon name="scan" @click="topScanClick" color="red" size="56"></u-icon> -->
- <uni-data-select v-model="selectValueBZ" :clear="false" :localdata="selectRangeBZ"
- @change="selectChangeBZ">
- </uni-data-select>
- </view>
-
- </view>
- </view>
-
- <u-gap height="10" bgColor="#eff0f1"></u-gap>
- <view class="head" style="">
- <view class="head_block">
- <view class="head_left">
- <view class="head_bar"></view>
- <view class="head_title">
- 鐐规椤圭洰鍐呭
- </view>
- </view>
- </view>
-
- <!-- <view :style="{maxHeight:(($DeviceInformation.screenHeight-530)*3)+'rpx',overflow: 'scroll'}"> -->
- <view :style="{maxHeight:'1000rpx',overflow: 'scroll'}">
-
- <view class="center_border flex_column" style="margin: 10rpx;" v-for="item in centerContent"
- :key="item.code">
-
- <view class="flex_between marginBottom10">
- <view class="center_title">{{item.name}}</view>
- <view class="marginRight20" v-if="item.isscan==='Y'">
- <u-icon name="scan" @click="centerScanClick(item.code)" color="red" size="28">
- </u-icon>
- </view>
- </view>
- <view class="flex_between marginBottom10">
- <view class='inputClass marginTop10'>
- <u--input :disabled='item.isDisabled' placeholder="璇疯緭鍏�" border="surround"
- v-model="item.inputValue"></u--input>
- </view>
-
-
- <view class="flex_center">
- <u-button type="primary" :plain="item.isOK!=='OK'" :disabled="item.isDisabled"
- style="height: 60rpx;" text="姝e父" @click="bwClick(item,'OK')">
- </u-button>
- <u-button type="warning" :plain="item.isOK!=='NG'" :disabled="item.isDisabled"
- style="height: 60rpx;margin:0 5rpx;" text="寮傚父" @click="bwClick(item,'NG')">
- </u-button>
- </view>
- </view>
- <view class="titleFont">
- {{item.chkdesc}}
- </view>
- </view>
- </view>
-
-
- </view>
- </view>
- </view>
-
-
- <view class="footer" style="">
-
- <view class="head_block" style="align-items: center;padding: 0 23rpx;height: 100rpx;">
- <view class="head_left">
- <view class="head_bar"></view>
- <view class="head_title">
- 鐐规缁撴灉
- </view>
- </view>
- <view class="flex_center">
- <u-button type="primary" :plain="resultValue!=='OK'" style="height: 60rpx;"
- :disabled="centerContent.some(item=>item.isDisabled===true)||centerContent.length===0"
- text="姝e父" @click="resultClick('OK')"></u-button>
- <u-button type="warning" :plain="resultValue!=='NG'" style="margin-left: 20rpx;height: 60rpx;"
- :disabled="centerContent.some(item=>item.isDisabled===true)||centerContent.length===0"
- text="寮傚父" @click="resultClick('NG')"></u-button>
- </view>
- </view>
-
-
- <u-button size="large" :loading="isDisabledSubmitButton" loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary"
- @click="submit" :disabled="resultValue===''" text="纭鎻愪氦">
- </u-button>
-
- </view>
-
-
-
- </view>
-
- <scan-code></scan-code>
</view>
</template>
+
<script>
import {
- CheckScanDeviceQrCodeData,
- SelectScanDeviceQrCodeItem,
- CheckScanDeviceTemp,
- AppDeviceCheckSave
- } from '../../config/api.js'
- import scanCode from '@/components/scan-code/scan-code.vue'
+ EqpPermissions
+ } from '../../config/api.js';
export default {
- components: {
- scanCode
- },
- onLoad(option) {
+ onLoad(option) {},
- const _this = this
- uni.$off('scancodedate') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
- uni.$on('scancodedate', function(content) {
- console.log("鎵弿鍒扮殑鍐呭涓�:", content)
- _this.getCheckScanDeviceQrCodeData(content)
- })
-
- },
onPullDownRefresh() {
setTimeout(() => {
this.init(() => {
@@ -191,19 +72,20 @@
})
}, 1000);
},
+
data() {
return {
- isDisabledSubmitButton: false,
- selectValueBZ: '',
- selectRangeBZ: [],
+ inputBoxValue: '', //杈撳叆妗嗗��
- topContent: [], //鎵弿鐐规宸ヤ綅鎵�甯﹀嚭鏉ョ殑鍐呭
- centerContent: [], //鐐规椤圭洰鍐呭
- scanContent: '', //鎵弿鎵嚭鏉ョ殑鍊�
- radioValue: '', //鍗曢�夋鐨勫��
- resultValue: '', //鐐规缁撴灉鍊�
+ title: 0,
+
+ radioValue: '',
+
+ purchorderArr: [],
+
+ purchorderArrAll: []
}
},
created() {
@@ -212,14 +94,39 @@
mounted() {
this.init()
- // this.getCheckScanDeviceQrCodeData('111')
-
+ this.getEqpPermissions()
},
methods: {
init() {
uni.stopPullDownRefresh();
},
- // 鎵爜鐐规宸ヤ綅 鐨勬壂鐮佹鐐瑰嚮
+ changeInputBoxValue(val) {
+
+ this.purchorderArr = this.purchorderArrAll.filter((p) => {
+ return p.code.indexOf(val) !== -1
+ })
+
+
+ if (this.purchorderArr.length > 0) {
+ this.radioValue = this.purchorderArr[0].code
+ }
+
+
+ },
+ inputBoxValueClear() {
+ this.inputBoxValue = ''
+ },
+ radioValueClick(val) {
+ console.log(val)
+ this.radioValue = val
+ },
+ navigateTo() {
+ uni.navigateTo({
+ url: './rcdj2?code=' + this.radioValue
+ });
+ },
+
+ // 鎵爜妗嗙偣鍑�
topScanClick() {
let that = this;
@@ -231,18 +138,7 @@
console.log('鏉$爜绫诲瀷锛�' + res.scanType);
console.log('鏉$爜鍐呭锛�' + res.result);
that.scanContent = res.result;
- let flag = false
- that.topContent.forEach(item => {
- if (item.code === res.result) {
- flag = true
- }
- })
- if (flag) {
- that.$u.toast('姝ゆ潯鐮佸凡鎵弿锛屽凡鍦ㄥ垪琛ㄤ腑锛�')
- } else {
- //澶勭悊鎵爜浜嬩欢
- that.getCheckScanDeviceQrCodeData(that.scanContent);
- }
+ that.changeInputBoxValue(that.scanContent);
},
complete: function(res) {
@@ -255,204 +151,19 @@
});
},
- // 鐐规椤圭洰鍐呭 鐨勬壂鐮佹鐐瑰嚮
- centerScanClick(val) {
- let that = this;
- uni.scanCode({
- onlyFromCamera: true,
- // scanType: ['barCode', 'qrCode'],
- scanType: ['qrCode'],
- success: function(res) {
- console.log('鏉$爜绫诲瀷锛�' + res.scanType);
- console.log('鏉$爜鍐呭锛�' + res.result);
- // that.scanContent = res.result;
+ async getEqpPermissions() {
+ const res = await EqpPermissions()
+
+ this.purchorderArrAll = res.data
+
+ this.purchorderArr = res.data
+
+ this.title = res.data.length
+
+ this.radioValue = res.data[0].code
- if (res.result === val) {
- that.centerContent.find(item => item.code === val).isDisabled = false
- that.centerContent.find(item => item.code === val).isOK = 'OK'
-
- if (that.centerContent.every(r => r.isOK === 'OK')) {
- that.resultValue = 'OK'
- }
- if (that.centerContent.some(r => r.isOK === 'NG')) {
- that.resultValue = 'NG'
- }
- if (that.centerContent.some(r => r.isOK === '')) {
- that.resultValue = ''
- }
-
-
- that.$forceUpdate()
- } else {
- uni.$u.toast('鎵�鎵潯鐮佷笌鐐规閮ㄤ綅涓嶇鍚堬紒')
- }
-
-
- //澶勭悊鎵爜浜嬩欢
- // that.SearchBarcode();
- },
- complete: function(res) {},
- fail: function(res) {}
-
- });
- },
-
- // 鑾峰彇鐐规宸ヤ綅
- async getCheckScanDeviceQrCodeData(val) {
- const data = {
- eqpcode: val
- }
- const res = await CheckScanDeviceQrCodeData(data)
-
- if (res.code === '200' && res.data[0].eqpchkmain_code !== null) { //琛ㄧず缁戝畾浜嗘爣鍑�
- this.topContent.unshift(res.data[0])
- // console.log(res.data[0],222);
- this.getCheckScanDeviceTemp(res.data[0].code)
- } else if (res.code === '200' && res.data[0].eqpchkmain_code === null) {
- uni.$u.toast('褰撳墠璁惧鏈缃偣妫�鏍囧噯缁戝畾鐐规椤圭洰锛�')
- }
-
- },
- // 鑾峰彇鐐规鏍囧噯
- async getCheckScanDeviceTemp(eqpcode) {
- const res = await CheckScanDeviceTemp({
- eqpcode
- })
- this.selectRangeBZ = res.data.map(({
- code,
- name
- }) => ({
- text: name,
- value: code
- }))
-
- this.selectValueBZ = this.selectRangeBZ[0].value
-
- this.getSelectScanDeviceQrCodeItem(eqpcode, this.selectValueBZ)
-
- },
- //鐐规鏍囧噯涓嬫媺閫夋嫨鏀瑰彉
- selectChangeBZ(val) {
- this.selectValueBZ = val
-
- this.getSelectScanDeviceQrCodeItem(this.radioValue, this.selectValueBZ)
- },
- // 鑾峰彇鐐规椤圭洰鍐呭
- async getSelectScanDeviceQrCodeItem(eqpcode, checktempcode) {
-
- const data = {
- eqpcode,
- checktempcode
- }
- const res = await SelectScanDeviceQrCodeItem(data)
-
- if (res.code === '200') {
- this.centerContent = res.data
-
- this.centerContent.forEach(item => {
- item.inputValue = ''
- item.isDisabled = item.isscan === 'Y'
- item.isOK = item.isscan !== 'Y' ? 'OK' : ''
- })
-
- if (this.centerContent.every(r => r.isOK === 'OK')) {
- this.resultValue = 'OK'
- }
- if (this.centerContent.some(r => r.isOK === 'NG')) {
- this.resultValue = 'NG'
- }
- if (this.centerContent.some(r => r.isOK === '')) {
- this.resultValue = ''
- }
-
- this.radioValue = eqpcode
- this.$forceUpdate()
- }
-
-
- },
- // 鍗曢�夋寜閽偣鍑�
- groupChange(val) {
- this.radioValue = val
- this.$forceUpdate()
- this.getCheckScanDeviceTemp(val)
- },
-
- // 閮ㄤ綅姝e父 寮傚父鎸夐挳鐐瑰嚮
- bwClick(item, val) {
- item.isOK = val
- if (this.centerContent.every(item => item.isOK !== '')) {
- if (this.centerContent.every(item => item.isOK === 'OK')) {
- this.resultValue = 'OK'
- } else {
- this.resultValue = 'NG'
- }
- }
- this.$forceUpdate() //寮哄埗瑙嗗浘鏇存柊
- },
- // 鐐规缁撴灉鐐瑰嚮
- resultClick(val) {
- this.resultValue = val
- this.$forceUpdate() //寮哄埗瑙嗗浘鏇存柊
- },
- // 纭鎻愪氦鎸夐挳
- async submit() {
- const children = []
- this.centerContent.forEach(item => {
- children.push({
- seq: item.seq,
- itemcode: item.code,
- cycle: item.cycle,
- value: item.inputValue,
- result: item.isOK
- })
-
- })
- const data = {
- code: this.topContent.find(item => item.code === this.radioValue).code,
- name: this.topContent.find(item => item.code === this.radioValue).name,
- // standcode: this.topContent.find(item => item.code === this.radioValue).eqpchkmain_code,
- standcode: this.selectValueBZ,
- result: this.resultValue,
- children: children
- }
-
- // console.log(data, 8);
-
-
- this.isDisabledSubmitButton = true
- const res = await AppDeviceCheckSave(uni.getStorageSync("username"), data)
- if (res.code === '200') {
-
- // this.$refs.uNotify.show({
- // top: 160,
- // type: 'primary',
- // color: '#fff',
- // bgColor: '#436df5',
- // message: '鎻愪氦鎴愬姛!',
- // duration: 1000 * 3,
- // fontSize: 30,
- // safeAreaInsetTop: false
- // })
- uni.$u.toast('鎻愪氦鎴愬姛锛�')
- this.isDisabledSubmitButton = false
- this.topContent.forEach((item, index) => {
- if (item.code === this.radioValue) {
- this.topContent.splice(index, 1)
- }
- })
- this.radioValue = this.topContent[0].code
- if (this.radioValue.toString().length > 0) {
- // this.getSelectScanDeviceQrCodeItem(this.radioValue, this.topContent.find(i => i.code === this
- // .radioValue).eqpchkmain_code)
- this.getCheckScanDeviceTemp(val)
- }
-
- } else {
- this.isDisabledSubmitButton = false
- }
- },
+ }
}
}
</script>
@@ -463,4 +174,34 @@
::v-deep .uicon-arrow-left>span {
display: block;
}
+
+ .u-input--square {
+ margin: 20rpx 10rpx;
+ border-radius: 40rpx;
+ background-color: #fff;
+ border: 1px solid #c8c8c8;
+ }
+
+ ::v-deep .u-alert__text--primary--light {
+ margin-bottom: 0;
+ font-size: 32rpx !important;
+ }
+
+ .radioGroupClass {
+ display: flex;
+ flex-direction: column;
+ background-color: #fff;
+
+ overflow-y: auto;
+ max-height: 1040rpx;
+ margin-top: 20rpx;
+ }
+
+ ::v-deep .u-radio-label--right {
+ height: 90rpx;
+ line-height: 90rpx;
+ width: 92%;
+ margin-left: 4%;
+ // padding: 0 50rpx;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3