From 349332ae95d97beb3e4aca5c30d131c8997c3de6 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期三, 18 十月 2023 19:58:01 +0800
Subject: [PATCH] 1.模具维修申请 95%
---
pages/mjgl/wxsq.vue | 166 +++++++++++++++++++++++++++++-------------------------
1 files changed, 89 insertions(+), 77 deletions(-)
diff --git a/pages/mjgl/wxsq.vue b/pages/mjgl/wxsq.vue
index 2482ce5..8b75aa2 100644
--- a/pages/mjgl/wxsq.vue
+++ b/pages/mjgl/wxsq.vue
@@ -20,12 +20,12 @@
<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="56"></u-icon>
+ <u-icon name="scan" @click="topScanClick" color="red" size="24"></u-icon>
</view>
</view>
@@ -36,14 +36,14 @@
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>
+ <view>妯″叿鍚嶇О锛�</view>
+ <view>瑙勬牸鍨嬪彿锛�</view>
</view>
<view class="flex_column contentFont">
<view>{{item.code}}</view>
<view>{{item.name}}</view>
- <view>{{item.wksp_name}}</view>
+ <view>{{item.spec?item.spec:'/'}}</view>
</view>
</view>
<!-- <u-radio size='40' :key="item.code" :name="item.code"
@@ -53,7 +53,7 @@
</view>
</view>
- <u-gap height="20" bgColor="#eff0f1"></u-gap>
+ <u-gap height="10" bgColor="#eff0f1"></u-gap>
<view class="head" style="padding-bottom: 10rpx;">
<view class="head_block" style="margin-bottom: 10rpx;margin-top:20rpx;">
@@ -71,7 +71,7 @@
</view>
</view>
</view>
- <u-gap height="20" bgColor="#eff0f1"></u-gap>
+ <u-gap height="10" bgColor="#eff0f1"></u-gap>
<view class="head" style="padding-bottom: 10rpx;">
<view class="head_block" style="margin-bottom: 10rpx;margin-top:20rpx;">
@@ -83,17 +83,16 @@
</view>
</view>
<view class='inputClass contentFont' style="margin: 0 20rpx; width: 95%;">
- <u--textarea placeholder="璇疯緭鍏�" confirm-type="send" border="surround" height='140'
+ <u--textarea placeholder="璇疯緭鍏�" confirm-type="send" border="surround" height='80'
v-model="descMessage">
</u--textarea>
</view>
-
<view style="display: flex;">
<view v-for="(pic,index) in fileList" :key="pic.name">
<view style="margin: 20rpx 0rpx 20rpx 20rpx;position: relative;">
- <u-icon name="close" color="#fff" size="26"
+ <u-icon name="close" color="#fff" size="16"
style="position: absolute;z-index: 10;right: 0;background-color: black;border-radius:50%;"
@click="deletePic(pic)"></u-icon>
@@ -111,37 +110,39 @@
</view>
-
- <u-button size="large" :loading="isDisabledSubmitButton" loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary"
- @click="submit" :disabled="descMessage.toString().length===0" text="纭鎻愪氦">
- </u-button>
+ <view class="footer">
+ <u-button size="large" :loading="isDisabledSubmitButton" loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary"
+ @click="submit" :disabled="descMessage.toString().length===0" text="纭鎻愪氦">
+ </u-button>
+ </view>
</view>
- <scan-code></scan-code>
+ <!-- <scan-code></scan-code> -->
</view>
</template>
<script>
- // import {
- // MaintainScanDeviceApplyQrCodeData,
- // MaintainScanDeviceApplySave
- // } from '../../config/api.js'
+ import {
+ MaintainScanMouldApplyQrCodeData,
+ MaintainScanMouldApplySave
+ } from '../../config/api.js'
// import {
// data
// } from '../../uni_modules/uview-ui/libs/mixin/mixin.js';
- import scanCode from '@/components/scan-code/scan-code.vue'
+
+ // import scanCode from '@/components/scan-code/scan-code.vue'
export default {
- components: {
- scanCode
- },
+ // components: {
+ // scanCode
+ // },
onLoad(option) {
// const _this = this
// uni.$off('scancodedate') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
// uni.$on('scancodedate', function(content) {
// console.log("鎵弿鍒扮殑鍐呭涓�:", content)
- // _this.getMaintainScanDeviceApplyQrCodeData(content)
+ // _this.getMaintainScanMouldApplyQrCodeData(content)
// })
},
onPullDownRefresh() {
@@ -164,18 +165,21 @@
selectValue: 'A',
selectRange: [{
- value: 'A',
- text: '璁惧鐐规'
- }, {
- value: 'B',
- text: '璁惧淇濆吇'
- }, {
- value: 'C',
- text: '瀹夌伅鍛煎彨'
- }, {
- value: 'D',
- text: '鎵嬪伐'
- }],
+ value: 'A',
+ text: '妯″叿鐐规'
+ }, {
+ value: 'B',
+ text: '妯″叿淇濆吇'
+ },
+ // {
+ // value: 'C',
+ // text: '瀹夌伅鍛煎彨'
+ // },
+ {
+ value: 'D',
+ text: '鎵嬪伐'
+ },
+ ],
descMessage: '', //鏁呴殰鎻忚堪
imgPreviewSrcs: [], //鍥剧墖棰勮src
@@ -183,7 +187,7 @@
}
},
created() {
-
+ // this.getMaintainScanMouldApplyQrCodeData('002')
},
mounted() {
this.init()
@@ -262,7 +266,7 @@
that.$u.toast('姝ゆ潯鐮佸凡鎵弿锛屽凡鍦ㄥ垪琛ㄤ腑锛�')
} else {
//澶勭悊鎵爜浜嬩欢
- that.getMaintainScanDeviceApplyQrCodeData(that.scanContent);
+ that.getMaintainScanMouldApplyQrCodeData(that.scanContent);
}
},
complete: function(res) {
@@ -277,12 +281,12 @@
},
// 鑾峰彇缁翠慨宸ヤ綅
- async getMaintainScanDeviceApplyQrCodeData(val) {
+ async getMaintainScanMouldApplyQrCodeData(val) {
const data = {
- eqpcode: val
+ mouldcode: val
}
- const res = await MaintainScanDeviceApplyQrCodeData(data)
+ const res = await MaintainScanMouldApplyQrCodeData(data)
if (res.code === '200') {
this.topContent = []
this.topContent.unshift(res.data[0])
@@ -294,16 +298,9 @@
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'
+ // 'Content-Type': 'application/json',
+ 'Token': uni.getStorageSync('Token')
}
-
-
/*
@@ -311,52 +308,66 @@
鎵嬫満涓婅姹傛槸闇�瑕丄PP-PLUS鐨勪唬鐮�
*/
// #ifdef H5
- // console.log('H5')
- // let formData = new FormData()
- // formData.append("username", uni.getStorageSync('username'))
- // formData.append("eqpcode", this.topContent[0].code)
- // formData.append("wkshpcode", this.topContent[0].wksp_code)
- // formData.append("faultsourcecode", this.selectValue)
- // formData.append("faultdescr", this.descMessage)
+ // 鐩墠杩樻槸涓嶈鐨�
+ let formData = new FormData()
+ formData.append("menucode", '2052')
+ formData.append("mouldcode", this.topContent[0].code)
+ formData.append("faultsourcecode", this.selectValue)
+ formData.append("faultdescr", this.descMessage)
+ this.fileList.forEach((item, index) => {
+ formData.append('files', item.uri)
+ })
+
+ // for (var [a, b] of formData.entries()) {
+ // console.log(a, b)
+ // }
+
+ // let files = []
+ // console.log(this.fileList, 1)
// this.fileList.forEach((item, index) => {
- // formData.append('files1', item.file)
+ // files.push(item.uri)
// })
- // MaintainScanDeviceApplySave(formData).then(res => {
- // console.log(res, 1)
- // })
+
+ // console.log(this.fileList, 1)
+ // let formData = {
+ // menucode: '2052',
+ // mouldcode: this.topContent[0].code,
+ // faultsourcecode: this.selectValue,
+ // faultdescr: this.descMessage,
+ // files
+ // }
+
+ // MaintainScanMouldApplySave('2052', '001', 'A', '123', formData).then(res => {
+ MaintainScanMouldApplySave(JSON.stringify(formData)).then(res => {
+ console.log(res, 1)
+ })
// #endif
-
-
// #ifdef APP-PLUS ||MP
- // const temp = [{
- // name: 'files1'
- // }]
-
+ // 鐩墠鍙互鐨�
let formData = {
- username: uni.getStorageSync('username'),
- eqpcode: this.topContent[0].code,
- wkshpcode: this.topContent[0].wksp_code,
+ menucode: '2052',
+ mouldcode: this.topContent[0].code,
faultsourcecode: this.selectValue,
faultdescr: this.descMessage,
}
-
- console.log(formData)
-
-
+ console.log(JSON.stringify(formData))
this.isDisabledSubmitButton = true
uni.uploadFile({
- url: this.$baseUrl + '/AppDeviceManage/MaintainScanDeviceApplySave',
+ url: this.$baseUrl + '/MouldManager/MaintainScanMouldApplySave',
files: this.fileList.length === 0 ? [{
uri: '/'
}] : this.fileList,
- // files: [{"uri": "/" }],
+ // files: [{
+ // "uri": "/"
+ // }],
header: header,
formData: formData,
success: (res) => {
+ console.log(JSON.stringify(res))
let result = JSON.parse(res.data)
if (res.statusCode == 200 && result.code == '200') {
uni.$u.toast('鎻愪氦鎴愬姛锛�')
@@ -371,6 +382,7 @@
this.isDisabledSubmitButton = false
},
fail(res) {
+ console.log(res)
uni.$u.toast('鎻愪氦澶辫触锛�')
this.isDisabledSubmitButton = false
},
--
Gitblit v1.9.3