From 29673a4ad10c8c544062b3ca91e81e30cfd56f0c Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期二, 05 八月 2025 11:13:38 +0800
Subject: [PATCH] 1
---
pages/home/home.vue | 2
pages.json | 9 +
pages/pakin/review.vue | 503 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 513 insertions(+), 1 deletions(-)
diff --git a/pages.json b/pages.json
index 3b960c6..4da7a1a 100644
--- a/pages.json
+++ b/pages.json
@@ -286,6 +286,15 @@
}
}
+ ,{
+ "path" : "pages/pakin/review",
+ "style" :
+ {
+ "navigationBarTitleText": "鍗曟嵁澶嶆牳"
+
+ }
+
+ }
,{
"path" : "pages/pakin/delCheck",
"style" :
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 74a02e2..92deec9 100644
--- a/pages/home/home.vue
+++ b/pages/home/home.vue
@@ -58,7 +58,7 @@
name: 'review',
color: 'blue',
cuIcon: 'pullup',
- url: '/pakin/boxPakin'
+ url: '/pakin/review'
},
// {
// title: '鍑哄簱',
diff --git a/pages/pakin/review.vue b/pages/pakin/review.vue
new file mode 100644
index 0000000..26ca0ae
--- /dev/null
+++ b/pages/pakin/review.vue
@@ -0,0 +1,503 @@
+<template>
+ <view>
+ <view class="combox">
+ <view style="flex: 1;"><uni-combox :candidates="orderNoList" placeholder="璇烽�夋嫨璁㈠崟" v-model="orderNo"
+ @input="getOrderDet"></uni-combox></view>
+ <view style="width: 80px;display: flex;align-items: center;justify-content: center;"><button size="mini"
+ type="primary" @click="getOrderDetlByOrderNo()">妫�绱�</button></view>
+ </view>
+ <view class="list-header" style="display: flex;text-align: start;align-items: center;padding: 8px;">
+ <text style="width: 6em;">鎵爜纭</text>
+ <view style="width: 10px;"></view>
+ <textarea style="background-color: #f0f0f0;max-height: 100rpx;padding: 4px;margin: 4px;font-weight: normal;"
+ type="textarea" placeholder=" 鎵爜 / 杈撳叆" maxlength="1000" v-model="matnr" :focus="matFocus"
+ @input="analysis2()" />
+ </view>
+ <view class="item">
+ <view class="code-decs">澶嶆牳浜�:</view>
+ <uni-combox emptyTips="鏆傛棤鏁版嵁" :candidates="checkUser" v-model="threeCode" placeholder="澶嶆牳浜�"></uni-combox>
+ </view>
+ <view class="item">
+ <view class="code-decs">澶嶆牳澶囨敞:</view>
+ <input type="text" placeholder=" 杈撳叆" v-model="memo">
+ </view>
+ <view class="list-header">
+ <text>璁㈠崟鏄庣粏</text>
+ </view>
+ <!-- 鍖呰缁勫彿锛歿{item.packageGroupNo}} -->
+ <view class="order-item" v-for="item in orderList">
+ <view class="list-left">
+ <!-- <view class="list-left-item">
+ <view class="desc">鐗╂枡缂栫爜锛�</view>
+ <view class="left-item">
+ <uni-tag :text="item.matnr" type="primary"></uni-tag>
+ </view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">浜у搧鍚嶇О锛�</view>
+ <view class="left-item">{{item.maktx}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">鍗峰彿锛�</view>
+ <view class="left-item">{{item.model}}</view>
+ </view> -->
+ <view class="list-left-item">
+ <view class="desc">瑙勬牸鍨嬪彿锛�</view>
+ <view class="left-item">{{item.specs}}</view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">鎵规鍙凤細</view>
+ <view class="left-item">
+ <uni-tag :text="item.batch" type="warning"></uni-tag>
+ </view>
+ </view>
+ <view class="list-left-item">
+ <view class="desc">鍑�閲嶏細</view>
+ <view class="left-item">{{item.anfme}}</view>
+ </view>
+ </view>
+ <view style="width: 30px;" v-show="item.inspect == 1">
+ <uni-icons type="checkbox-filled" color="#9add8b" size="24" @click="revise(item,i)"></uni-icons>
+ </view>
+ <view style="width: 30px;" v-show="item.inspect != 1">
+ <uni-icons type="checkbox-filled" color="#c3c3c3" size="24" @click="revise(item,i)"></uni-icons>
+ </view>
+
+ </view>
+
+
+ <view style="height: 60px;"></view>
+ <view class="orderDetl-none" v-if="orderList.length == 0">鏆傛棤鏄庣粏</view>
+
+ <!-- 搴曢儴鎿嶄綔鎸夐挳 -->
+ <view class="buttom">
+ <button size="mini" @click="reset('warn')">閲嶇疆</button>
+ <button size="mini" type="primary" @click="combConfirm('warn')">鍗曟嵁鏍稿</button>
+ </view>
+ <view>
+ <uni-popup ref="combConfirm2" type="dialog">
+ <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
+ @close="combClose"></uni-popup-dialog>
+ </uni-popup>
+ </view>
+ <!-- 纭缁勬墭 -->
+ <view>
+ <uni-popup ref="combConfirm" type="dialog">
+ <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
+ @confirm="comb" @close="combClose"></uni-popup-dialog>
+ </uni-popup>
+ </view>
+ <!-- 纭閲嶇疆 -->
+ <view>
+ <uni-popup ref="resetConfirm" type="dialog">
+ <uni-popup-dialog :type="msgType" cancelText="鍙栨秷" confirmText="纭" :title="title" :content="content"
+ @confirm="resetConfirm" @close="resetClose"></uni-popup-dialog>
+ </uni-popup>
+ </view>
+ </view>
+</template>
+
+<script>
+ export default {
+ data() {
+ return {
+ baseUrl: '',
+ token: '',
+ orderNoList: [],
+ orderNo: '',
+ orderList: [],
+ checkUser:[],
+ matnr: '',
+ matFocus: true,
+ msgType: 'success',
+ messageText: '',
+ title: '',
+ content: '',
+ threeCode:'',
+ memo:'',
+ }
+ },
+ onShow() {
+ this.baseUrl = uni.getStorageSync('baseUrl');
+ this.token = uni.getStorageSync('token');
+ this.getCheckUser();
+ this.getOrderDet();
+ },
+ methods: {
+ getOrderDet() {
+ let _this = this
+ // if (_this.orderNo.length == 0) {
+ // _this.orderList = []
+ // _this.orderNoList = []
+ // return
+ // }
+ uni.request({
+ url: `${_this.baseUrl}/mobile/getReviewList?orderNo=`+_this.orderNo,
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ method: 'GET',
+ success(res) {
+ res = res.data
+ if (res.code == 200) {
+ _this.orderNoList = res.data
+ } else if (res.code == 403) {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ }
+ }
+ })
+ },
+ getOrderDetlByOrderNo() {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/mobile/getReviewDetlByOrderNo/${_this.orderNo}`,
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ method: 'GET',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ _this.orderList.length = 0
+ console.log(_this.orderList);
+ _this.orderList = res.data
+ } else if (res.code === 403) {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ }
+ }
+ })
+ },
+ getCheckUser() {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/mobile/getCheckUser`,
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ method: 'GET',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ _this.checkUser.length = 0
+ console.log( res.data);
+ _this.checkUser = res.data
+ } else if (res.code === 403) {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ }
+ }
+ })
+ },
+ choseOne() {
+ let _this = this
+ uni.navigateTo({
+ url: './orderSelect',
+ success(res) {
+ res.eventChannel.emit('matList', {
+ matList: _this.dataList
+ })
+ },
+ events: {
+ pickList: function(data) {}
+ }
+ })
+ },
+ // 瑙f瀽浜у搧鏍囩淇℃伅
+ parseProductInfo() {
+ const productInfo = {
+ model: '', // 鍗峰彿
+ batch: '', // 绠卞彿
+ specs: '', // 瑙勬牸
+ length: 0, // 闀垮害
+ anfme: 0, // 鍑�閲�
+ qty: 0, // 姣涢噸
+ volume: 0 // 鎺ュご鏁伴噺
+ };
+ // 浣跨敤姝e垯琛ㄨ揪寮忔彁鍙栧悇椤逛俊鎭�
+ const patterns = {
+ model: /鍗峰彿[锛�:]\s*([^\s<]+)/,
+ batch: /绠卞彿[锛�:]\s*([^\s<]+)/,
+ specs: /瑙勬牸[锛�:]\s*([^\s<]+)/,
+ length: /闀垮害[锛�:]\s*([\d.]+)\s* ?m/,
+ anfme: /鍑�閲峓锛�:]\s*([\d.]+)\s* ?kg/,
+ qty: /姣涢噸[锛�:]\s*([\d.]+)\s* ?kg/,
+ volume: /鎺ュご[锛�:]\s*([\d.]+)\s* ?涓�/
+ };
+
+ // 鎻愬彇鍚勫瓧娈典俊鎭�
+ for (let key in patterns) {
+ const match = this.matnr.match(patterns[key]);
+ if (match && match[1]) {
+ if (['length', 'anfme', 'qty', 'volume'].includes(key)) {
+ productInfo[key] = parseFloat(match[1]);
+ } else {
+ productInfo[key] = match[1].trim();
+ }
+ }
+ }
+ return productInfo;
+ },
+ analysis2() {
+ const result = this.parseProductInfo()
+ console.info(result)
+ this.secAnalysis(result)
+ // if (this.dataList.length > 0) this.checkAdd(result)
+ // else this.dataList.push(result);
+ // this.focuss()
+
+ },
+ secAnalysis(data) {
+ let flag = false;
+ for (let k of this.orderList) {
+ if (data.batch == k.batch && data.specs == k.specs && data.anfme == k.anfme) {
+ flag = true
+ if (k.inspect == 1) {
+ uni.showToast({
+ title: '褰撳墠鏉$爜宸茬‘璁�',
+ icon: "error",
+ position: 'center'
+ })
+ } else {
+ uni.showToast({
+ title: '纭鎴愬姛',
+ icon: "success",
+ position: 'center',
+ duration: 2000
+ })
+ k.inspect = 1
+ }
+ }
+ }
+ if (!flag) {
+ this.msgType = 'warn'
+ this.title = '璀﹀憡'
+ this.content = '鎵规鍙凤細' + data.batch + '瑙勬牸锛�' + data.specs + '鍑�閲嶏細' + data.qty + ' 涓嶅瓨鍦紝璇锋鏌�!'
+ this.$refs.combConfirm2.open()
+ }
+ this.focuss()
+ },
+ focuss() {
+ this.matFocus = false;
+ setTimeout(() => {
+ this.matnr = '';
+ this.matFocus = true;
+ }, 100);
+ },
+ reset(type) {
+ this.msgType = type
+ this.title = '璀﹀憡'
+ this.content = '鏄惁閲嶇疆!'
+ this.$refs.resetConfirm.open()
+ },
+ combConfirm(type) {
+ this.msgType = type
+ this.title = '璀﹀憡'
+ this.content = '鏄惁鐜板湪鏍稿!'
+ this.$refs.combConfirm.open()
+ },
+ combClose() {
+ this.$refs.combConfirm.close()
+ },
+ comb() {
+ let _this = this
+
+ if (!_this.memo) {
+ this.messageText = "璇烽�夋嫨澶嶆牳澶囨敞"
+ this.messageToggle('error')
+ return;
+ }
+ if (!_this.threeCode) {
+ this.messageText = "璇烽�夋嫨澶嶆牳浜�"
+ this.messageToggle('error')
+ return;
+ }
+ for (let k of this.orderList) {
+ k.memo =this.memo
+ k.threeCode =this.threeCode
+ }
+ uni.request({
+ url: `${_this.baseUrl}/mobile/reviewCheck`,
+ header: {
+ 'token': uni.getStorageSync('token')
+ },
+ data: JSON.stringify(_this.orderList),
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ _this.orderList = [],
+ _this.orderNo = ''
+ uni.showToast({
+ title: res.msg,
+ icon: "success",
+ position: 'center'
+ })
+ } else if (res.code === 403) {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ setTimeout(() => {
+ uni.reLaunch({
+ url: '../login/login'
+ });
+ }, 1000);
+ } else {
+ uni.showToast({
+ title: res.msg,
+ icon: "error",
+ position: 'center'
+ })
+ }
+ }
+ })
+ },
+ // 纭閲嶇疆
+ resetConfirm() {
+ this.orderList = [],
+ this.orderNo = ''
+ this.messageText = "閲嶇疆瀹屾垚"
+ this.messageToggle('success')
+ },
+ // 鍙栨秷閲嶇疆
+ resetClose() {
+
+ },
+ }
+ }
+</script>
+
+<style>
+ @import url('../../static/css/wms.css/wms.css');
+
+ .list {
+ display: flex;
+ min-height: 80rpx;
+ background-color: #FFF;
+ padding: 10rpx;
+ margin: 30rpx 20rpx;
+ border-radius: 20rpx;
+ box-shadow: 0px 0px 30px 0px rgba(0, 0, 0, 0.2);
+ }
+
+ .combox {
+ background-color: white;
+ padding: 8px;
+ display: flex;
+ }
+
+ .list-header {
+ border-top: 1px solid #eee;
+ background-color: white;
+ text-align: center;
+ min-height: 70rpx;
+ line-height: 70rpx;
+ color: #555;
+ font-weight: bold;
+ }
+
+ .order-item {
+ margin: 8px;
+ padding: 16px;
+ background-color: white;
+ border-radius: 10px;
+ display: flex;
+ }
+
+ .orderDetl-none {
+ height: 100vh;
+ text-align: center;
+ line-height: 50vh;
+ color: #aaa;
+ }
+
+ .buttom {
+ width: 100%;
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 100rpx;
+ background-color: #FFF;
+ }
+
+ .code {
+ width: 100%;
+ position: fixed;
+ min-height: 200rpx;
+ background-color: #FFF;
+ z-index: 10;
+ }
+
+ .item {
+ background-color: white;
+ display: flex;
+ padding: 2px;
+ align-items: center;
+ height: 100rpx;
+ border-bottom: 1px solid #DCDFE6;
+ }
+
+ .item input {
+ height: 50rpx;
+ line-height: 50rpx;
+ /* font-family: PingFang SC; uniapp 榛樿瀛椾綋涓嶅眳涓� */
+ font-size: 36upx;
+ font-family: PingFang SC;
+ width: 55vw;
+
+ }
+
+ .code-decs {
+ width: 20vw;
+ font-size: 18px;
+ color: #303133;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.1