From f16c4fed5e34e5514a564266c500ff382644630a Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期五, 17 五月 2024 12:37:11 +0800
Subject: [PATCH] 1.设备维修提交2.维修验证提交
---
pages/sbgl/wxyz.vue | 119 ++++++++++++++++++++++++-----------------------------------
1 files changed, 48 insertions(+), 71 deletions(-)
diff --git a/pages/sbgl/wxyz.vue b/pages/sbgl/wxyz.vue
index c96d955..97cc005 100644
--- a/pages/sbgl/wxyz.vue
+++ b/pages/sbgl/wxyz.vue
@@ -32,7 +32,7 @@
- <view :style="{maxHeight:'1000rpx',overflow: 'scroll'}">
+ <view :style="{maxHeight:'1360rpx',overflow: 'scroll'}">
<view class="marginTop20 marginLeft20 marginRight20 flex_column">
<u-radio-group v-model="radioValue" class="flex_column">
@@ -86,7 +86,8 @@
</view>
<view style="display: flex;" v-show="fileList.length!==0">
<view v-for="(pic,index) in fileList" :key="index">
- <view style="margin: 20rpx 0rpx 20rpx 20rpx;position: relative;">
+ <view style="margin: 20rpx 0rpx 20rpx 20rpx;position: relative;"
+ v-if='pic.img1url'>
<!-- <u-icon name="close" color="#fff" size="26"
style="position: absolute;z-index: 10;right: 0;background-color: black;border-radius:50%;"
@click="deletePic(pic)"></u-icon>
@@ -113,7 +114,7 @@
</view>
<view class="" style="width: 90rpx;display: flex;">
- <u-button type="primary" disabled
+ <u-button type="primary" disabled style="height: 60rpx;"
:text="descMessage2.toString().length>0?'鍚�':'鏄�'">
</u-button>
</view>
@@ -158,7 +159,8 @@
</view>
<view style="display: flex;" v-show="fileList2.length!==0">
<view v-for="(pic,index) in fileList2" :key="index">
- <view style="margin: 20rpx 0rpx 20rpx 20rpx;position: relative;">
+ <view style="margin: 20rpx 0rpx 20rpx 20rpx;position: relative;"
+ v-if='pic.img2url'>
<!-- <u-icon name="close" color="#fff" size="26"
style="position: absolute;z-index: 10;right: 0;background-color: black;border-radius:50%;"
@click="deletePic(pic)"></u-icon>
@@ -189,11 +191,13 @@
:key="Math.random()+item.repair_code">
<u-button :plain="item.resultValue!=='OK'" text="姝e父"
@click="resultValueClick(item.repair_code,'OK')"
+ style="height: 60rpx;"
:key="Math.random()+item.repair_code+'OK'" type="primary">
</u-button>
<u-button type="warning" :plain="item.resultValue!=='NG'"
:key="Math.random()+item.repair_code+'NG'" text="寮傚父"
+ style="height: 60rpx;margin: 0 5rpx;"
@click="resultValueClick(item.repair_code,'NG')">
</u-button>
</view>
@@ -207,7 +211,7 @@
<view class="arrowClass"
@click="item.arrowType?arrowDownClick(item):arrowUpClick(item)">
<u-icon :name="item.arrowType?'arrow-down':'arrow-up'" color="#c8c8c8"
- size="50"></u-icon>
+ size="25"></u-icon>
</view>
</view>
@@ -242,8 +246,9 @@
<script>
import {
- // RepairVerificationScanDeviceData,
- // RepairVerificationScanDeviceDataSub
+ RepairVerificationScanDeviceData,
+ RepairVerificationScanDeviceDataSub,
+ RepairVerificationScanDeviceSave
} from '../../config/api.js'
import {
data
@@ -287,7 +292,7 @@
data() {
return {
isDisabledSubmitButton: false,
- baseUrl: 'http://121.196.36.24:8001',
+ baseUrl: 'http://121.196.36.24:8019/',
topContent: [], //鎵弿淇濆吇宸ヤ綅鎵�甯﹀嚭鏉ョ殑鍐呭
radioValue: '', //鍗曢�夋鐨勫��
scanContent: '', //鎵弿鎵嚭鏉ョ殑鍊�
@@ -471,85 +476,57 @@
},
// 纭鎻愪氦鎸夐挳
async submit() {
- 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'
- }
-
const result = this.topContent.find(item => item.repair_code === this.radioValue)
let formData = {
- username: uni.getStorageSync('username'),
repairwo: result.repair_code,
eqpcode: result.eqpcode,
wkshpcode: result.wksp_code,
result: result.resultValue,
}
- // console.log(formData)
+ this.isDisabledSubmitButton = true
- // this.isDisabledSubmitButton = true
- // uni.request({
- // url: this.$baseUrl + '/AppDeviceManage/RepairVerificationScanDeviceSave', //浠呬负绀轰緥锛屽苟闈炵湡瀹炴帴鍙e湴鍧�銆�
- // data: formData,
- // method: "POST",
+ const res = await RepairVerificationScanDeviceSave(formData)
+ if (res.code == '200') {
+ uni.$u.toast('鎻愪氦鎴愬姛锛�')
+ this.topContent = this.topContent.filter(i => i.repair_code !== this
+ .radioValue)
+ this.radioValue = this.topContent.length === 0 ? '' : this.topContent[0]
+ .repair_code
+ this.isDisabledSubmitButton = false
+ } else {
+ this.isDisabledSubmitButton = false
+ uni.$u.toast(result.Message)
+ }
+ // this.isDisabledSubmitButton = false
+ this.$forceUpdate()
+
+ // uni.uploadFile({
+ // url: this.$baseUrl + '/AppDeviceManage/RepairVerificationScanDeviceSave',
+ // files: [{
+ // "uri": "/"
+ // }],
// header: header,
- // success: res => {
- // if (res.statusCode == 200 && res.data.code == '200') {
+ // formData: formData,
+ // success: (res) => {
+ // let result = JSON.parse(res.data)
+ // if (res.statusCode == 200 && result.code == '200') {
// uni.$u.toast('鎻愪氦鎴愬姛锛�')
- // // this.topContent = this.topContent.filter(i => i.repair_code !== this
- // // .radioValue)
- // // this.radioValue = this.topContent.length === 0 ? '' : this.topContent[0]
- // // .repair_code
- // // console.log(this.radioValue)
- // // console.log(this.topContent, 9)
- // // this.groupChange(this.radioValue)
-
- // this.getRepairVerificationScanDeviceData()
- // this.isDisabledSubmitButton = false
- // this.$forceUpdate()
+ // this.topContent = this.topContent.filter(i => i.repair_code !== this
+ // .radioValue)
+ // this.radioValue = this.topContent.length === 0 ? '' : this.topContent[0]
+ // .repair_code
+ // } else {
+ // uni.$u.toast(result.Message)
// }
+ // this.isDisabledSubmitButton = false
+ // this.$forceUpdate()
// },
- // fail: res => {
+ // fail(res) {
// uni.$u.toast('鎻愪氦澶辫触锛�')
// this.isDisabledSubmitButton = false
- // }
+ // },
// })
-
-
- this.isDisabledSubmitButton = true
- uni.uploadFile({
- url: this.$baseUrl + '/AppDeviceManage/RepairVerificationScanDeviceSave',
- files: [{
- "uri": "/"
- }],
- header: header,
- formData: formData,
- success: (res) => {
- let result = JSON.parse(res.data)
- if (res.statusCode == 200 && result.code == '200') {
- uni.$u.toast('鎻愪氦鎴愬姛锛�')
- this.topContent = this.topContent.filter(i => i.repair_code !== this
- .radioValue)
- this.radioValue = this.topContent.length === 0 ? '' : this.topContent[0]
- .repair_code
- } else {
- uni.$u.toast(result.Message)
- }
- this.isDisabledSubmitButton = false
- this.$forceUpdate()
- },
- fail(res) {
- uni.$u.toast('鎻愪氦澶辫触锛�')
- this.isDisabledSubmitButton = false
- },
- })
},
--
Gitblit v1.9.3