From 49dedf908e2e0f2f317f05acc55f8f5faa1f4d2a Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期二, 15 七月 2025 16:19:31 +0800
Subject: [PATCH] 1.异常录入功能开发
---
config/api.js | 25 ++
pages/zlgl/yclr.vue | 570 +++++++++++++++++++++++++++++++++++++++++++++++++++
pages.json | 7
pages/xtsy/index.vue | 3
4 files changed, 604 insertions(+), 1 deletions(-)
diff --git a/config/api.js b/config/api.js
index 12cb085..82fb193 100644
--- a/config/api.js
+++ b/config/api.js
@@ -400,4 +400,27 @@
//閲囪喘鍏ュ簱鎻愪氦-鎸夊埌璐ф爣绛�
export const MesAppPurchInStorLabSave = (data1, data2, config = {}) => http.post(
- '/AppPurchManagement/MesAppPurchInStorLabSave' + data1, data2, config)
\ No newline at end of file
+ '/AppPurchManagement/MesAppPurchInStorLabSave' + data1, data2, config)
+
+
+
+//鏌ユ壘杞﹂棿 鏃犲叕鍙稿悕绉�
+export const PrentOrganizationNoCompany = (data, config = {}) => http.get(
+ '/GeneralBasicData/PrentOrganizationNoCompany', {
+ params: data
+ })
+
+
+
+//杞﹂棿鏌ユ壘璁㈠崟
+export const WkspWrkOrderDataSelect = (data, config = {}) => http.get(
+ '/GeneralBasicData/WkspWrkOrderDataSelect', {
+ params: data
+ })
+
+
+//璁㈠崟鎵句骇鍝�
+export const WrkOrderPartDataSelect = (data, config = {}) => http.get(
+ '/GeneralBasicData/WrkOrderPartDataSelect', {
+ params: data
+ })
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 9536799..da50d26 100644
--- a/pages.json
+++ b/pages.json
@@ -477,6 +477,13 @@
"navigationStyle": "custom",
"enablePullDownRefresh": false
}
+ }, {
+ "path": "pages/zlgl/yclr",
+ "style": {
+ "navigationBarTitleText": "寮傚父褰曞叆",
+ "navigationStyle": "custom",
+ "enablePullDownRefresh": false
+ }
}
],
"globalStyle": {
diff --git a/pages/xtsy/index.vue b/pages/xtsy/index.vue
index a367537..607ca0a 100644
--- a/pages/xtsy/index.vue
+++ b/pages/xtsy/index.vue
@@ -217,6 +217,9 @@
case '2704':
url = 'zlgl/wgjy' //瀹屽伐妫�楠�
break;
+ case '2706':
+ url = 'zlgl/yclr' //寮傚父褰曞叆
+ break;
diff --git a/pages/zlgl/yclr.vue b/pages/zlgl/yclr.vue
new file mode 100644
index 0000000..65b51c3
--- /dev/null
+++ b/pages/zlgl/yclr.vue
@@ -0,0 +1,570 @@
+<template>
+ <view>
+ <page-nav title="寮傚父褰曞叆"></page-nav>
+ <view class="mainContent" :style="{maxHeight:'1260rpx',overflow: 'scroll'}">
+
+
+ <u-gap height="5" bgColor="#eff0f1"></u-gap>
+
+
+ <view class="head marginLeft10 marginRight10" style="padding: 20rpx; 0">
+
+ <view class="flex_column">
+
+ <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
+ <view style="display: flex;" class="titleFont">
+ <view style="color: red;margin-right: 6rpx;">*</view> 杞﹂棿鍚嶇О锛�
+ </view>
+ <view @click='workshopSheetShow = true' class="custominputClass">
+ <view v-show='workshopSheetValue===""' style="color: rgb(192, 196, 204);">璇烽�夋嫨</view>
+ <view v-show='workshopSheetValue!==""' class="ellipsis" style="width: 390rpx;">
+ {{workshopSheetValue}}
+ </view>
+ <u-icon :name="!workshopSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
+ </view>
+ </view>
+
+ <view class="flex_center" style="margin: 0rpx 20rpx 10rpx;line-height: 76rpx;">
+ <view style="display: flex;" class="titleFont">
+ <view style="color: red;margin-right: 6rpx;">*</view>
+ 璁㈠崟缂栧彿锛�
+ </view>
+ <view @click='orderSheetShow = true' class="custominputClass">
+ <view v-show='orderSheetValue===""' style="color: rgb(192, 196, 204);">璇烽�夋嫨</view>
+ <view v-show='orderSheetValue!==""' class="ellipsis" style="width: 390rpx;">
+ {{orderSheetValue}}
+ </view>
+ <u-icon :name="!orderSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
+ </view>
+ </view>
+
+ <view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
+ <view style="color: transparent;margin-right: 6rpx;">*</view> 閿�鍞鍗曪細
+ <view class='inputClass'>
+ <u--input placeholder="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number' disabled
+ v-model="saleOrder">
+ </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: red;margin-right: 6rpx;">*</view>
+ 浜у搧鍚嶇О锛�
+ </view>
+ <view @click='partnameSheetShow = true' class="custominputClass">
+ <view v-show='partnameSheetValue===""' style="color: rgb(192, 196, 204);">璇烽�夋嫨</view>
+ <view v-show='partnameSheetValue!==""' class="ellipsis" style="width: 390rpx;">
+ {{partnameSheetValue}}
+ </view>
+ <u-icon :name="!partnameSheetShow?'arrow-down-fill':'arrow-up-fill'"></u-icon>
+ </view>
+ </view>
+
+ <view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
+ <view style="color: transparent;margin-right: 6rpx;">*</view> 瑙勬牸鍨嬪彿锛�
+ <view class='inputClass'>
+ <u--input placeholder="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number' disabled
+ v-model="partdesc">
+ </u--input>
+ </view>
+ </view>
+
+
+ <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="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number' disabled
+ v-model="order_qty">
+ </u--input>
+ </view>
+ </view>
+
+ <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="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number'
+ v-model="plan_qty">
+ </u--input>
+ </view>
+ </view>
+
+
+ <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="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number'
+ v-model="comp_qty">
+ </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: red;margin-right: 6rpx;">*</view> 寮傚父绛夌骇锛�
+ </view>
+ <u-radio-group v-model="exceleve">
+ <u-radio shape="circle" label="鏅��" name="R" labelSize="16"></u-radio>
+ <u-radio shape="circle" label="涓ラ噸" style="margin-left: 20rpx;" name="S" labelSize="16">
+ </u-radio>
+ </u-radio-group>
+ </view>
+
+ <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="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number'
+ v-model="excepeople">
+ </u--input>
+ </view>
+ </view>
+
+ <!-- <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="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number'
+ v-model="excedate">
+ </u--input>
+ </view>
+ </view> -->
+
+ <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="璇疯緭鍏�" :adjustPosition='false' border="surround" type='number'
+ v-model="totaltime">
+ </u--input>
+ </view>
+ </view>
+
+ <view class="flex_center titleFont" style="margin: 0rpx 20rpx 10rpx;line-height: 56rpx;">
+ <view style="color: transparent;margin-right: 6rpx;">*</view> 寮傚父鍘熷洜锛�
+ <view class='inputClass'>
+ <u--textarea placeholder="璇疯緭鍏�" :adjustPosition='false' border="surround" v-model="excedesc">
+ </u--textarea>
+ </view>
+ </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="16"
+ 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>
+ </view>
+
+ </view>
+
+ <!-- :disabled="" -->
+ <view class="footer">
+ <u-button size="large" :loading="isDisabledSubmitButton" loadingText="姝e湪鎻愪氦,璇风◢绛�..." type="primary"
+ @click="submit" text="纭鎻愪氦">
+ </u-button>
+ </view>
+
+
+
+ <!-- 杞﹂棿鍚嶇О -->
+ <u-picker :show="workshopSheetShow" :columns="workshopColumns" :itemHeight='55' :closeOnClickOverlay='true'
+ @close='workshopSheetShow=false' @confirm='workshopPickerConfirm' @cancel='workshopSheetShow=false'>
+ </u-picker>
+
+ <!-- 璁㈠崟缂栧彿 -->
+ <u-picker :show="orderSheetShow" :columns="orderColumns" :itemHeight='55' :closeOnClickOverlay='true'
+ @close='orderSheetShow=false' @confirm='orderPickerConfirm' @cancel='orderSheetShow=false'>
+ </u-picker>
+
+ <!-- 浜у搧鍚嶇О -->
+ <u-picker :show="partnameSheetShow" :columns="partnameColumns" :itemHeight='55' :closeOnClickOverlay='true'
+ @close='partnameSheetShow=false' @confirm='partnamePickerConfirm' @cancel='partnameSheetShow=false'>
+ </u-picker>
+
+
+
+ </view>
+</template>
+
+<script>
+ import {
+ PrentOrganizationNoCompany,
+ WkspWrkOrderDataSelect,
+ WrkOrderPartDataSelect
+ } from '../../config/api.js';
+
+ export default {
+ data() {
+ return {
+ workshopSheetShow: false, //涓婃媺鍒楄〃鏄惁灞曞紑
+ workshopColumns: [], //
+ workshopList: [],
+ workshopSheetValue: '',
+
+ orderSheetShow: false, //涓婃媺鍒楄〃鏄惁灞曞紑
+ orderColumns: [], //
+ orderList: [],
+ orderSheetValue: '',
+
+ saleOrder: '', //閿�鍞鍗�
+
+ partnameSheetShow: false, //涓婃媺鍒楄〃鏄惁灞曞紑
+ partnameColumns: [], //
+ partnameList: [],
+ partnameSheetValue: '',
+
+
+ partdesc: '', //瑙勬牸鍨嬪彿
+ order_qty: '', //璁㈠崟鏁伴噺
+ plan_qty: '', //璁″垝鏁伴噺
+ comp_qty: '', //瀹屾垚鏁伴噺
+ exceleve: 'R', //寮傚父绛夌骇
+ excepeople: '', //寮傚父浜烘暟
+ excedate: '', //寮傚父鏃ユ湡
+ totaltime: '', //鍚堣鏃堕棿
+ excedesc: '', //寮傚父鍘熷洜
+
+
+ imgPreviewSrcs: [], //鍥剧墖棰勮src
+ fileList: [
+
+ ],
+ isDisabledSubmitButton: false
+ }
+ },
+
+ created() {
+
+ },
+ mounted() {
+
+
+ this.getPrentOrganizationNoCompany()
+ },
+ methods: {
+ async getPrentOrganizationNoCompany() {
+ const res = await PrentOrganizationNoCompany()
+ if (res.code === '200') {
+ this.workshopList = res.data.map(({
+ torg_code,
+ torg_name
+ }) => ({
+ code: torg_code,
+ name: torg_name
+ }))
+ this.workshopColumns = [this.workshopList.map(i => i.name)]
+ }
+
+ },
+ workshopPickerConfirm(val) {
+ console.log(val, 11)
+
+ this.getWkspWrkOrderDataSelect(this.workshopList.find(i => i.name === val.value[0]).code)
+ this.workshopSheetValue = val.value[0]
+ this.workshopSheetShow = false
+
+
+ this.orderColumns = []
+ this.orderSheetValue = ''
+
+ this.partnameColumns = []
+ this.partnameSheetValue = ''
+ },
+
+ async getWkspWrkOrderDataSelect(wkshopcode) {
+ const res = await WkspWrkOrderDataSelect({
+ wkshopcode
+ })
+
+ if (res.code === '200') {
+ this.orderList = res.data
+ this.orderColumns = [this.orderList.map(i => i.wo)]
+ }
+ },
+ orderPickerConfirm(val) {
+ this.getWrkOrderPartDataSelect(val.value[0])
+ this.saleOrder = this.orderList.find(i => i.wo === val.value[0]).saleOrderCode
+ this.orderSheetValue = val.value[0]
+ this.orderSheetShow = false
+
+ this.partnameColumns = []
+ this.partnameSheetValue = ''
+ },
+ async getWrkOrderPartDataSelect(ordercode) {
+ const res = await WrkOrderPartDataSelect({
+ ordercode
+ })
+ this.partnameList = res.data
+ this.partnameColumns = [this.partnameList.map(i => i.partname)]
+ },
+ partnamePickerConfirm(val) {
+ this.partnameSheetValue = val.value[0]
+ this.partnameSheetShow = false
+
+ this.partdesc = this.partnameList.find(i => i.partname === val.value[0]).partspec
+ this.order_qty = this.partnameList.find(i => i.partname === val.value[0]).qty
+ },
+
+ // 閫夋嫨鍥剧墖
+ 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 = 'photo' + 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)
+ }
+
+ }
+ }
+ })
+ },
+
+ // 棰勮鍥剧墖
+ imgPreview(img) {
+ uni.previewImage({
+ current: this.fileList.findIndex(i => i.name === img.name),
+ indicator: "number",
+ loop: true,
+ urls: this.imgPreviewSrcs
+
+ })
+ },
+
+ submit() {
+
+ if (this.workshopSheetValue === '') {
+ return uni.$u.toast('杞﹂棿涓嶈兘涓虹┖')
+ }
+ if (this.orderSheetValue === '') {
+ return uni.$u.toast('璁㈠崟涓嶈兘涓虹┖')
+ }
+ if (this.partnameSheetValue === '') {
+ return uni.$u.toast('浜у搧涓嶈兘涓虹┖')
+ }
+ if (this.order_qty === '') {
+ return uni.$u.toast('璁㈠崟鏁伴噺涓嶈兘涓虹┖')
+ }
+ if (this.plan_qty === '') {
+ return uni.$u.toast('璁″垝鏁伴噺涓嶈兘涓虹┖')
+ }
+ if (this.comp_qty === '') {
+ return uni.$u.toast('瀹屾垚鏁伴噺涓嶈兘涓虹┖')
+ }
+ if (this.excepeople === '') {
+ return uni.$u.toast('寮傚父浜烘暟涓嶈兘涓虹┖')
+ }
+ if (this.totaltime === '') {
+ return uni.$u.toast('鍚堣鏃堕棿涓嶈兘涓虹┖')
+ }
+
+
+
+
+
+ let formData = {
+ opertype: 'Add',
+ id: '',
+ wkshop_code: this.workshopList.find(i => i.name === this.workshopSheetValue).code,
+ order_code: this.orderSheetValue,
+ saleorder_code: this.saleOrder,
+ partcode: this.partnameList.find(i => i.partname === this.partnameSheetValue).partcode,
+ order_qty: this.order_qty,
+ plan_qty: this.plan_qty,
+ comp_qty: this.comp_qty,
+ exceleve: this.exceleve,
+ excedesc: this.excedesc,
+ excepeople: this.excepeople,
+ totaltime: this.totaltime,
+ excedate: this.global.handleDatetime2(new Date())
+ }
+
+ console.log(JSON.stringify(formData))
+ const header = {
+ // 'Content-Type': 'multipart/form-data',
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ // 'Content-Type': 'application/json',
+ 'Token': uni.getStorageSync('Token')
+ }
+
+ this.isDisabledSubmitButton = true
+ uni.uploadFile({
+ url: this.$baseUrl + '/ExceptionManagement/AddUpdateExceptionManagement',
+ files: this.fileList.length === 0 ? [{
+ uri: '/'
+ }] : this.fileList,
+ 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('鎻愪氦鎴愬姛锛�')
+ this.fileList = []
+ this.imgPreviewSrcs = []
+
+
+ this.workshopSheetValue = ''
+ this.orderSheetValue = ''
+ this.saleOrder = ''
+ this.partnameSheetValue = ''
+
+ this.partdesc = ''
+ this.order_qty = ''
+ this.plan_qty = ''
+ this.comp_qty = ''
+ this.exceleve = 'R'
+ this.excepeople = ''
+ this.excedate = ''
+ this.totaltime = ''
+ this.excedesc = ''
+
+ this.orderColumns = []
+ this.partnameColumns = []
+
+
+
+ } else {
+ uni.$u.toast(result.Message)
+ }
+ this.isDisabledSubmitButton = false
+ },
+ fail(res) {
+ console.log(res)
+ uni.$u.toast('鎻愪氦澶辫触锛�')
+ this.isDisabledSubmitButton = false
+ },
+ })
+
+ // #ifdef APP-PLUS ||MP
+
+ // #endif
+ }
+
+
+ }
+
+
+ }
+</script>
+
+
+<style lang="scss" scoped>
+ @import url('@/style/global.css');
+
+ ::v-deep .uicon-arrow-left>span {
+ display: block;
+ }
+
+ .custominputClass {
+ width: 412rpx;
+ display: flex;
+ justify-content: space-between;
+ border: 3rpx #eff0f1 solid;
+ border-radius: 10rpx;
+ padding: 0 16rpx;
+
+ }
+
+ .ellipsis {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ }
+
+ .scanImg2 {
+ width: 70px;
+ height: 70px;
+ border-radius: 50%;
+ margin: auto;
+ background: url('@/static/img/scan.png') no-repeat;
+ box-shadow: #436df5 0px 0px 20px;
+ background-size: 100% 100%;
+ }
+
+ ::v-deep .addClass .uicon-plus-circle {
+ font-size: 50rpx !important;
+ margin-right: 20rpx !important;
+ }
+
+ ::v-deep .addClass .u-button__text {
+ font-size: 46rpx !important;
+ }
+
+
+ ::v-deep .u-modal__content {
+ padding-bottom: 260rpx;
+ margin-bottom: 100rpx;
+ }
+
+ ::v-deep .u-action-sheet {
+ max-height: 600rpx !important;
+ overflow: auto !important;
+ }
+
+ ::v-deep .u-checkbox-label--right {
+ padding: 30rpx;
+ border-bottom: 1rpx solid #eee;
+ }
+
+
+
+ .badSheetClass {
+ position: relative;
+ }
+
+ .badNumber {
+ position: absolute;
+ top: 20rpx;
+ left: 20rpx;
+ font-size: 26rpx;
+ color: rgb(0, 102, 255)
+ }
+
+ .trash {
+ position: absolute;
+ top: 20rpx;
+ right: 30rpx;
+ font-size: 26rpx;
+ }
+
+ .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