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/mjwx.vue | 509 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 508 insertions(+), 1 deletions(-)
diff --git a/pages/mjgl/mjwx.vue b/pages/mjgl/mjwx.vue
index 02409e3..5359ac2 100644
--- a/pages/mjgl/mjwx.vue
+++ b/pages/mjgl/mjwx.vue
@@ -1,8 +1,515 @@
<template>
+ <view>
+ <page-nav title="妯″叿缁翠慨"></page-nav>
+
+
+ <view v-show="topContent.length===0">
+ <div class="sacnBody">
+ <div class="boxImg"></div>
+ <div class="scanText">鏆傛棤妯″叿鍙淮淇�</div>
+ </div>
+ </view>
+
+
+ <view v-show="topContent.length!==0">
+ <view class="mainContent" :style="{maxHeight: '600rpx',overflow: 'scroll'}">
+ <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="56"></u-icon>
+ </view>
+
+ </view>
+
+ <view class=" marginLeft20 marginRight20 flex_column"
+ style="max-height: 420rpx;overflow:scroll;">
+ <u-radio-group v-model="radioValue" class="flex_column">
+ <view class="marginBottom20" style="position: relative"
+ @click="groupChange(item.docu_code)" v-for="item in topContent"
+ :key="item.docu_code">
+ <view style="display: flex;float: left;">
+ <view class="titleFont">
+ <view>缁翠慨鐢宠鍗�:</view>
+ <view>妯″叿缂栫爜:</view>
+ <view>妯″叿鍚嶇О:</view>
+ <view>瑙勬牸鍨嬪彿:</view>
+ <view>鐢宠浜哄憳:</view>
+ <view>鐢宠鏃堕棿:</view>
+ <view>鏁呴殰鏉ユ簮:</view>
+ <view>鏁呴殰鎻忚堪:</view>
+ </view>
+ <view class="contentFont">
+ <view>{{item.docu_code}}</view>
+ <view>{{item.code}}</view>
+ <view>{{item.name}}</view>
+ <view>{{item.spec?item.spec:'/'}}</view>
+ <view>{{item.request_person}}</view>
+ <view>{{item.request_date}}</view>
+ <view>{{item.source}}</view>
+ <view style="width:400rpx;word-wrap:break-word">
+ {{item.failure_descript}}
+ </view>
+ </view>
+ </view>
+ <u-radio size='40' style='position: absolute;top: 45%;right: 0;'
+ :key="item.docu_code" :name="item.docu_code"
+ @change="groupChange(item.docu_code)" activeColor="red"></u-radio>
+
+ </view>
+ </u-radio-group>
+ </view>
+
+ </view>
+ <u-gap height="20" bgColor="#eff0f1"></u-gap>
+
+ <view class="head" style="padding-bottom: 10rpx;">
+ <view class="head_block" style="margin-bottom: 10rpx;margin-top:20rpx;">
+ <view class="head_left">
+ <view class="head_bar"></view>
+ <view class="head_title">
+ 鏁呴殰鎻忚堪
+ </view>
+ </view>
+ </view>
+ <view class='inputClass contentFont' style="margin: 0 20rpx; width: 95%;">
+ <u--textarea placeholder="璇疯緭鍏�" confirm-type="send" border="surround" height='100'
+ 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"
+ style="position: absolute;z-index: 10;right: 0;background-color: black;border-radius:50%;"
+ @click="deletePic(pic)"></u-icon>
+
+ <image :src="pic.uri" @click="imgPreview(pic)" class="upLoadImg"></image>
+ </view>
+ </view>
+ <image v-if="fileList.length<3" src="../../static/img/uploadImg.png" style="width: 100rpx;height: 100rpx;border: 1rpx solid #eff0f1;border-radius: 20rpx;
+ margin: 20rpx;padding: 30rpx;
+ " @click="selectPics">
+ </view>
+ </view>
+
+
+ <u-gap height="20" bgColor="#eff0f1"></u-gap>
+
+ <view class="head" style="padding-bottom: 10rpx;">
+ <view class="head_block" style="margin-bottom: 10rpx;margin-top:20rpx;">
+ <view class="head_left">
+ <view class="head_bar"></view>
+ <view class="head_title">
+ 鍋滄満缁翠慨
+ </view>
+ </view>
+
+ <view class="marginRight20" style="width: 200rpx;display: flex;">
+ <u-button type="primary" :plain="isStop!=='Y'" text="鏄�" @click="isStopClick('Y')">
+ </u-button>
+ <u-button type="warning" :plain="isStop!=='N'" text="鍚�" @click="isStopClick('N')">
+ </u-button>
+ </view>
+ </view>
+ </view>
+
+ <u-gap height="20" bgColor="#eff0f1"></u-gap>
+
+ <view v-show="isStop==='N'" class="head" style="padding-bottom: 10rpx;padding-bottom: 20rpx;">
+ <view class="head_block" style="margin-bottom: 10rpx;margin-top:20rpx;">
+ <view class="head_left">
+ <view class="head_bar"></view>
+ <view class="head_title">
+ 缁翠慨鍐呭
+ </view>
+ </view>
+ </view>
+ <view class='inputClass contentFont' style="margin: 0 20rpx; width: 95%;">
+ <u--textarea placeholder="璇疯緭鍏�" confirm-type="send" border="surround" height='100'
+ v-model="descMessage2">
+ </u--textarea>
+ </view>
+
+ </view>
+
+ <u-gap height="20" bgColor="#eff0f1"></u-gap>
+ <!-- margin-bottom: 110rpx; -->
+ <view v-show="isStop==='N'" class="head" style="padding-bottom: 10rpx;">
+ <view class="head_block" style="margin-bottom: 10rpx;margin-top:20rpx;">
+ <view class="head_left">
+ <view class="head_bar"></view>
+ <view class="head_title">
+ 鏇存崲澶囦欢
+ </view>
+ </view>
+ </view>
+ <view class='inputClass contentFont' style="margin: 0 20rpx; width: 95%;">
+ <u--textarea placeholder="璇疯緭鍏�" confirm-type="send" border="surround" height='100'
+ v-model="descMessage3">
+ </u--textarea>
+ </view>
+
+ <view style="display: flex;">
+ <view v-for="(pic,index) in fileList2" :key="pic.name">
+ <view style="margin: 20rpx 0rpx 20rpx 20rpx;position: relative;">
+ <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>
+
+ <image :src="pic.uri" @click="imgPreview2(pic)" class="upLoadImg"></image>
+ </view>
+ </view>
+ <image v-if="fileList2.length<3" src="../../static/img/uploadImg.png" style="width: 100rpx;height: 100rpx;border: 1rpx solid #eff0f1;border-radius: 20rpx;
+ margin: 20rpx;padding: 30rpx;
+ " @click="selectPics2">
+ </view>
+ </view>
+
+
+ </view>
+ </view>
+
+
+ <view class="footer" style="min-height:62rpx;">
+ <u-button size="large" :loading="isDisabledSubmitButton" loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary"
+ @click="submit"
+ :disabled="isStop==='Y'?descMessage.toString().length===0:descMessage.toString().length===0||descMessage2.toString().length===0"
+ text="纭鎻愪氦">
+ </u-button>
+ </view>
+
+
+ </view>
+
+ <!-- <scan-code></scan-code> -->
+ </view>
</template>
<script>
+ // import {
+ // RepairScanDeviceQrCodeDataList,
+ // } from '../../config/api.js'
+ // import {
+ // data
+ // } from '../../uni_modules/uview-ui/libs/mixin/mixin.js';
+ // import scanCode from '@/components/scan-code/scan-code.vue'
+
+ export default {
+ // components: {
+ // scanCode
+ // },
+ onLoad(option) {
+
+
+ // const _this = this
+ // uni.$off('scancodedate') // 姣忔杩涙潵鍏� 绉婚櫎鍏ㄥ眬鑷畾涔変簨浠剁洃鍚櫒
+ // uni.$on('scancodedate', function(content) {
+ // console.log("鎵弿鍒扮殑鍐呭涓�:", content)
+ // // _this.getCheckScanDeviceQrCodeData(content)
+
+ // let r = _this.topContent.find(i => i.docu_code === content)
+
+ // if (r === undefined) {
+ // uni.$u.toast('鎵�鎵殑浜岀淮鐮佷笉鍦ㄥ垪琛ㄤ腑锛�')
+ // } else {
+ // _this.topContent.forEach((item, index) => {
+ // if (item.docu_code === content) {
+ // _this.topContent.splice(index, 1)
+ // }
+ // })
+ // _this.topContent.unshift(r)
+ // _this.radioValue = content
+ // }
+ // })
+ },
+ onPullDownRefresh() {
+ setTimeout(() => {
+ this.init(() => {
+ uni.stopPullDownRefresh();
+ })
+ }, 1000);
+ },
+ data() {
+ return {
+ topRightMessageCount: 0,
+ isDisabledSubmitButton: false,
+
+ topContent: [], //鎵弿淇濆吇宸ヤ綅鎵�甯﹀嚭鏉ョ殑鍐呭
+ centerContent: [], //
+ scanContent: '', //鎵弿鎵嚭鏉ョ殑鍊�
+ radioValue: '', //鍗曢�夋鐨勫��
+ descMessage: '', //鏁呴殰鎻忚堪
+ imgPreviewSrcs: [], //鍥剧墖棰勮src 鏁呴殰鎻忚堪
+ fileList: [], //鍥剧墖鏁扮粍 鏁呴殰鎻忚堪
+ isStop: 'Y',
+ descMessage2: '', //缁翠慨鍐呭
+ descMessage3: '', //鏇存崲澶囦欢
+ fileList2: [], //鏇存崲澶囦欢鍥剧墖
+ imgPreviewSrcs2: [],
+ }
+ },
+ created() {
+
+ },
+ mounted() {
+ this.init()
+ // this.getRepairScanDeviceQrCodeDataList()
+
+
+ },
+ methods: {
+
+ // 閫夋嫨鍥剧墖
+ selectPics() {
+ var that = this;
+ uni.chooseImage({
+ count: 3,
+ success: (res) => {
+ const files = res.tempFiles;
+ for (let i = 0; i < files.length; i++) {
+ let obj = new Object();
+ obj.name = 'files1;' + i + new Date().getTime();
+ obj.uri = files[i].path;
+ that.fileList.push(obj);
+ if (obj.src == null || obj.src == '' || obj.src == undefined) {
+ that.imgPreviewSrcs.push(obj.uri)
+ } else {
+ that.imgPreviewSrcs.push(obj.src)
+ }
+
+ }
+ }
+ })
+ },
+
+ selectPics2() {
+ var that = this;
+ uni.chooseImage({
+ count: 3,
+ success: (res) => {
+ const files = res.tempFiles;
+ for (let i = 0; i < files.length; i++) {
+ let obj = new Object();
+ obj.name = 'files2;' + i + new Date().getTime();
+ obj.uri = files[i].path;
+ that.fileList2.push(obj);
+ if (obj.src == null || obj.src == '' || obj.src == undefined) {
+ that.imgPreviewSrcs2.push(obj.uri)
+ } else {
+ that.imgPreviewSrcs2.push(obj.src)
+ }
+
+ }
+ }
+ })
+ },
+
+ // 棰勮鍥剧墖
+ imgPreview(img) {
+ uni.previewImage({
+ current: this.fileList.findIndex(i => i.name === img.name),
+ indicator: "number",
+ loop: true,
+ urls: this.imgPreviewSrcs
+ })
+ },
+ imgPreview2(img) {
+ uni.previewImage({
+ current: this.fileList2.findIndex(i => i.name === img.name),
+ indicator: "number",
+ loop: true,
+ urls: this.imgPreviewSrcs2
+ })
+ },
+ // 鍒犻櫎鍥剧墖
+ deletePic(img) {
+ this.fileList = this.fileList.filter(i => i.name !== img.name)
+ this.fileList2 = this.fileList2.filter(i => i.name !== img.name)
+ this.imgPreviewSrcs = this.imgPreviewSrcs.filter(i => i !== img.uri)
+ this.imgPreviewSrcs2 = this.imgPreviewSrcs2.filter(i => i !== img.uri)
+ },
+ init() {
+ uni.stopPullDownRefresh();
+ },
+ // 鍗曢�夋寜閽�変腑鍊兼敼鍙�
+ groupChange(val) {
+ this.radioValue = val
+ this.descMessage = ''
+ this.imgPreviewSrcs = []
+ this.fileList = []
+ this.isStop = 'Y'
+ this.descMessage2 = ''
+ this.descMessage3 = ''
+ this.fileList2 = []
+ this.imgPreviewSrcs2 = []
+ this.$forceUpdate()
+ },
+ // 鍋滄満缁翠慨
+ isStopClick(val) {
+ this.isStop = val
+ if (val === 'Y') {
+ this.descMessage2 = ''
+ this.descMessage3 = ''
+ this.fileList2 = []
+ this.imgPreviewSrcs2 = []
+ }
+
+ },
+ // 鎵爜宸ヤ綅 鐨勬壂鐮佹鐐瑰嚮
+ topScanClick() {
+ 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;
+
+
+
+ let r = that.topContent.find(i => i.docu_code === that.scanContent)
+
+ if (r === undefined) {
+ uni.$u.toast('鎵�鎵殑浜岀淮鐮佷笉鍦ㄥ垪琛ㄤ腑锛�')
+ } else {
+ that.topContent.forEach((item, index) => {
+ if (item.docu_code === that.scanContent) {
+ that.topContent.splice(index, 1)
+ }
+ })
+ that.topContent.unshift(r)
+ that.radioValue = that.scanContent
+ }
+
+ },
+ complete: function(res) {
+
+ },
+ fail: function(res) {
+ console.log('鏉$爜绫诲瀷锛�' + res.scanType);
+ console.log('鏉$爜鍐呭锛�' + res.result);
+ }
+
+ });
+ },
+
+ // 鑾峰彇缁翠慨宸ヤ綅
+ async getRepairScanDeviceQrCodeDataList(val) {
+ const res = await RepairScanDeviceQrCodeDataList()
+ if (res.code === '200') {
+ this.topContent = res.data
+ this.radioValue = this.topContent.length > 0 ? this.topContent[0].docu_code : ''
+ }
+ },
+
+ // 纭鎻愪氦鎸夐挳
+ 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.docu_code === this.radioValue)
+ const formData = {
+ username: uni.getStorageSync('username'),
+ docu_code: result.docu_code,
+ eqpcode: result.eqpcode,
+ wkshpcode: result.wksp_code,
+ faultdescr: this.descMessage,
+ is_stoprepair: this.isStop,
+ // files1: this.fileList,
+ repaircontent: this.descMessage2,
+ replaceparts: this.descMessage3
+ }
+ // console.log(formData)
+ // console.log([...this.fileList, ...this.fileList2].length)
+ this.isDisabledSubmitButton = true
+ uni.uploadFile({
+ url: this.$baseUrl + '/AppDeviceManage/RepairScanDeviceSave',
+ files: [...this.fileList, ...this.fileList2].length === 0 ? [{
+ "uri": "/"
+ }] : [...this.fileList, ...this.fileList2],
+ header: header,
+ formData: formData,
+ success: (res) => {
+ console.log(res)
+ let result = JSON.parse(res.data)
+ if (res.statusCode == 200 && result.code == '200') {
+ uni.$u.toast('鎻愪氦鎴愬姛锛�')
+ this.topContent = this.topContent.filter(i => i.docu_code !== this.radioValue)
+ this.radioValue = this.topContent.length === 0 ? '' : this.topContent[0]
+ .docu_code
+ this.descMessage = ''
+ this.imgPreviewSrcs = []
+ this.fileList = []
+ this.isStop = 'Y'
+ this.descMessage2 = ''
+ this.descMessage3 = ''
+ this.fileList2 = []
+ this.imgPreviewSrcs2 = []
+ } else {
+ uni.$u.toast(result.Message)
+ }
+ this.isDisabledSubmitButton = false
+ },
+ fail(res) {
+ uni.$u.toast('鎻愪氦澶辫触锛�')
+ this.isDisabledSubmitButton = false
+ },
+ })
+
+ },
+ }
+ }
</script>
-<style>
+<style lang="scss" scoped>
+ @import url('@/style/global.css');
+
+ .u-radio {
+ justify-content: flex-end;
+ }
+
+ ::v-deep .uicon-arrow-left>span {
+ display: block;
+ }
+
+ ::v-deep .uicon-camera-fill {
+ font-size: 60rpx !important;
+ }
+
+ .uploader {
+ /deep/.u-add-tips {
+ display: none;
+ }
+ }
+
+ ::v-deep .uni-progress-bar {
+ background-color: transparent !important;
+ }
+
+ .upLoadImg {
+ width: 160rpx;
+ height: 160rpx;
+ border-radius: 20rpx;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3