chen 2 年 前
コミット
3bf44ef732

+ 1 - 1
main.js

@@ -56,7 +56,7 @@ const api = {
 	},
 	apiHost: function() {
 		//接口地址
-		// return 'http://192.168.1.18/'
+		// return 'http://127.0.0.1/'
 		return 'https://ai.my-123.cn/api/'
 	},
 	

+ 8 - 13
pages.json

@@ -6,76 +6,71 @@
 		{
 			"path": "pages/start/start",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		},
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		},
 		{
 			"path": "pages/login/login",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		},
 		{
 			"path": "pages/product/query",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
+				"enablePullDownRefresh": true
 			}
 		}	,
 		{
 			"path": "pages/product/inStock",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		}	,
 		{
 			"path": "pages/product/reworkRecord",
 			"style": {
-				"navigationBarTitleText": "数智化产线",
 				"enablePullDownRefresh": true
 			}
 		},
 		{
 			"path": "pages/product/rework-pecord/add",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		},
 		{
 			"path": "pages/product/rework-pecord/detail",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		},
 		{
 			"path": "pages/product/details",
 			"style": {
-				"navigationBarTitleText": "数智化产线",
 				"enablePullDownRefresh": true
 			}
 		},
 		{
 			"path": "pages/reportCenter/index",
 			"style": {
-				"navigationBarTitleText": "数智化产线"
 			}
 		},
 		{
 			"path": "pages/reportCenter/report1",
 			"style": {
-				"navigationBarTitleText": "数智化产线",
 				"enablePullDownRefresh": true
 			}
 		},
 		{
 			"path": "pages/reportCenter/report2",
 			"style": {
-				"navigationBarTitleText": "数智化产线",
+				"enablePullDownRefresh": true
+			}
+		},
+		{
+			"path": "pages/reportCenter/report3",
+			"style": {
 				"enablePullDownRefresh": true
 			}
 		}	
@@ -83,7 +78,7 @@
   "globalStyle": {
     "navigationStyle": "custom",
     "navigationBarTextStyle": "black",
-    "navigationBarTitleText": "Tuniao UI",
+    "navigationBarTitleText": "数智化产线",
     "navigationBarBackgroundColor": "#F8F8F8",
     "backgroundColor": "#F8F8F8"
   },

+ 24 - 3
pages/index/index.vue

@@ -9,7 +9,7 @@
 		  </view>
 		  <view class="page-items">
 		    <tn-list-view  >
-		      <tn-list-cell v-if="permission == 1 || permission == 2">
+		      <tn-list-cell v-if="permission == 1 || permission == 2 || permission == 5">
 		        <view class="message tn-margin-left message tn-margin-top tn-margin-bottom" @click="toPage(1)">
 		          <view class="message__left">
 					<!-- <img class="item-img" src="@/static/image/list-search.png"> -->
@@ -42,7 +42,24 @@
 		          </view>
 		        </view>
 		      </tn-list-cell>
-		      <tn-list-cell v-if="permission == 1 || permission == 2 || permission == 3 || permission == 4">
+		      <tn-list-cell v-if="permission == 1 || permission == 2 || permission == 5">
+		        <view class="message tn-margin-left message tn-margin-top tn-margin-bottom" @click="toPage(5)">
+		          <view class="message__left">
+					<!-- <img class="item-img" src="@/static/image/list-search.png"> -->
+					<view class="tn-icon-write tn-main-gradient-red--reverse  item-icon"></view>
+		          </view>
+		          <view class="message__middle">
+		            <view class="message__name">数据补偿</view>
+		            <view class="message__content tn-text-ellipsis">NG数据补偿,调整、多入口解决</view>
+		          </view>
+		          <view class="message__right">
+		            <view class="message__tips tn-margin-right">
+		              <text class="message__tips__icon tn-icon-sound-close tn-icon-right"></text>
+		            </view>
+		          </view>
+		        </view>
+		      </tn-list-cell>
+		      <tn-list-cell v-if="permission == 1 || permission == 2 || permission == 3 || permission == 4 || permission == 5">
 		        <view class="message tn-margin-left message tn-margin-top tn-margin-bottom" @click="toPage(3)">
 		          <view class="message__left">
 					<view class="tn-icon-set tn-main-gradient-orangered--reverse item-icon"></view>
@@ -58,7 +75,7 @@
 		          </view>
 		        </view>
 		      </tn-list-cell>
-			  <tn-list-cell v-if="permission == 1">
+			  <tn-list-cell v-if="permission == 1 || permission == 5">
 			    <view class="message tn-margin-left message tn-margin-top tn-margin-bottom" @click="toPage(4)">
 			      <view class="message__left">
 					<view class="tn-icon-data tn-main-gradient-orange--reverse item-icon"></view>
@@ -115,6 +132,10 @@
 				uni.navigateTo({
 					url:"/pages/reportCenter/index" 
 				})
+			}else if(type==5){ 
+				uni.navigateTo({
+					url:"/pages/product/query?status=-1" 
+				})
 			}
 		}
     }

+ 58 - 1
pages/product/details.vue

@@ -33,7 +33,7 @@
 				    <view class="list__left">
 				      <view class="list__left__text tn-color-gray--dark">状态</view>
 				    </view>
-				    <view class="list__right">{{details.status==1?'维修中':details.status==2?'已下线':details.status==3?'已入库':''}}</view>
+				    <view class="list__right">{{details.status==1?'维修中':details.status==2?'已下线':details.status==3?'已入库':details.status==0?'作废':''}}</view>
 				  </view>
 				</tn-list-cell>
 				<tn-list-cell>
@@ -64,6 +64,21 @@
 						  @tap.stop="doPreviewImage(details.frontImg)"
 						></image>
 						</view>
+						<view
+						  v-if="details.frontAiImg"
+						  class="tn-image-upload__item tn-image-upload__item-preview"
+						  :style="{
+							width: $tn.string.getLengthUnitValue(170),
+							height: $tn.string.getLengthUnitValue(170)
+						  }"
+						>
+						<image
+						  class="tn-image-upload__item-preview__image"
+						  :src="details.frontAiImg"
+						  :mode="imageMode"
+						  @tap.stop="doPreviewImage(details.frontAiImg)"
+						></image>
+						</view>
 					</view>
 				  </view>
 				</tn-list-cell>
@@ -87,6 +102,21 @@
 						  @tap.stop="doPreviewImage(details.backImg)"
 						></image>
 						</view>
+						<view
+						  v-if="details.backAiImg"
+						  class="tn-image-upload__item tn-image-upload__item-preview"
+						  :style="{
+							width: $tn.string.getLengthUnitValue(170),
+							height: $tn.string.getLengthUnitValue(170)
+						  }"
+						>
+						<image
+						  class="tn-image-upload__item-preview__image"
+						  :src="details.backAiImg"
+						  :mode="imageMode"
+						  @tap.stop="doPreviewImage(details.backAiImg)"
+						></image>
+						</view>
 					</view>
 				  </view>
 				</tn-list-cell>
@@ -148,6 +178,18 @@
 					  </view>
 					</tn-list-cell>
 				  </template>
+				  
+				  
+				  <template v-if="details.status==-1">
+				    <view class="tn-flex">
+				      <view class="tn-flex-1 tn-padding-sm">
+						<tn-button :shadow="true" width="100%"  backgroundColor="tn-bg-teal" fontColor="#FFFFFF" @click="productOkOrNg(0)" margin="10rpx 0">AI误判</tn-button>
+					  </view>
+				      <view class="tn-flex-1 tn-padding-sm">
+						<tn-button :shadow="true" width="100%"  backgroundColor="#01BEFF" fontColor="#FFFFFF" @click="productOkOrNg(1)" margin="10rpx 0">发起维修</tn-button>
+					  </view>
+				    </view>
+				  </template>
 			  </view>
 		  </view>
 	  </view>
@@ -176,6 +218,21 @@
 			}).catch((res) => {
 			})
 		},
+		
+		productOkOrNg(isNg){
+			this.btnLoad = true;
+			let that = this,
+			params = {
+				productId:that.details.id,
+				aiImg:that.details.frontAiImg?that.details.frontAiImg:that.details.backAiImg,
+				isNg:isNg,
+			}
+			that.api.request('wx/product/api/productNgOperate',params,'get','').then((res) => {
+				that.api.toast('操作成功')
+				that.detail(that.details.id);
+			}).catch((res) => {
+			})
+		},
 		  // 预览图片
 		  doPreviewImage(url) {
 			uni.previewImage({

+ 13 - 24
pages/product/inStock.vue

@@ -23,10 +23,10 @@
 				  </view>
 		          <view class="list__left__text">{{item.qrCode?('产品:'+item.qrCode):'请填写产品信息'}}</view>
 		        </view>
-		       <!-- <view class="list__right">
-		          <view class="tn-text-df tn-icon-delete tn-color-blue" v-if="index>6" @click.stop="deleteProduct(index)"> 删除</view>
+		       <view class="list__right">
+		          <view class="tn-text-df tn-icon-delete tn-color-blue" v-if="index>0" @click.stop="deleteProduct(index)"> 删除</view>
 		          <view class="tn-text-sm tn-icon-down tn-margin-left"></view>
-		        </view> -->
+		        </view>
 		      </view>
 		    </tn-list-cell>
 		  </view>
@@ -137,7 +137,7 @@
 			  airtight:'',
 			  orderNo:'',
 			  coldQrCode:'',
-			  checkResult:'1',
+			  // checkResult:'1',
 		  },
 		  index:0,
 		  form:{
@@ -146,7 +146,7 @@
 			  airtight:'',
 			  orderNo:'',
 			  coldQrCode:'',
-			  checkResult:'1',
+			  // checkResult:'1',
 		  },
 		  
 		  modelList: [],
@@ -187,13 +187,13 @@
 		 //        trigger: 'blur'
 		 //      },
 			// ],
-		    checkResult: [
-		      {
-		        required: true,
-		        message: '请选择检测结果',
-		        trigger: 'blur'
-		      },
-			],
+		 //    checkResult: [
+		 //      {
+		 //        required: true,
+		 //        message: '请选择检测结果',
+		 //        trigger: 'blur'
+		 //      },
+			// ],
 			  
 		  },
 		  showForm:false,
@@ -293,7 +293,7 @@
 			for(let i=0;i<that.products.length;i++){
 				let product = that.products[i];
 				if(!product.qrCode){
-					that.api.toast("请填写所有产品信息,确保有7个合格的产品");
+					that.api.toast("请填写所有产品信息,若要提交请删除多于空行");
 					return
 				}
 				if(qrCpdes.includes(","+product.qrCode+",")){
@@ -302,17 +302,6 @@
 				}
 				qrCpdes = qrCpdes+product.qrCode+","
 				console.log(qrCpdes);
-				if(product.checkResult==1){
-					count++;
-				}
-			}
-			if(count<7){
-				that.api.toast("仅有"+count+"个合格品,请添加后提交");
-				return
-			}
-			if(count>7){
-				that.api.toast("当前存在"+count+"个合格品超出7个,请删除后提交");
-				return
 			}
 			let form = {};
 			form.productModelId = that.productModelId;

+ 18 - 1
pages/product/query.vue

@@ -42,6 +42,12 @@
 						  {{item.qrCode}}
 					  </view>
 					  <view class="tn-flex-1  tn-text-right ">
+						  <view v-if="item.status==-1" class="tn-btn-class tn-btn  tn-round tn-main-gradient-orangered--reverse tn-text-center" style="height: 50rpx;line-height:50rpx;">
+							  NG待处理
+						  </view>
+						  <view v-if="item.status==0" class="tn-btn-class tn-btn  tn-round tn-main-gradient-orange tn-text-center" style="height: 50rpx;line-height:50rpx;">
+							  作废
+						  </view>
 						  <view v-if="item.status==1" class="tn-btn-class tn-btn  tn-round tn-main-gradient-red tn-text-center" style="height: 50rpx;line-height:50rpx;">
 							  待维修
 						  </view>
@@ -84,10 +90,14 @@
 		current:1,
 		size:20,
 		total:-1,
+		status:'',
       }
     },
 	onLoad(options){
-		this.initList();
+		// if(options.status){
+		// 	this.status = options.status
+		// }
+		// this.initList();
 	},
 	onReachBottom() { //监听上拉触底事件
 		if(this.total<= this.list.length){
@@ -99,6 +109,12 @@
 		this.initList();
 	},
 	onShow(){
+		let pages = getCurrentPages();
+		let currentPage = pages[pages.length-1];
+		if(currentPage.options.status){
+			this.status = currentPage.options.status
+		}
+		this.initList();
 	},
     methods: {
 		openScan(){
@@ -122,6 +138,7 @@
 			params = {
 				current:that.current,
 				size:that.size,
+				status:that.status,
 			}
 			if(this.qrCode){
 				params.qrCode = this.qrCode;

+ 100 - 34
pages/product/rework-pecord/detail.vue

@@ -59,11 +59,43 @@
 		      <view class="list__right">{{details.problemDesc}}</view>
 		    </view>
 		  </tn-list-cell>
-		  <template v-if="details.status>=2">
+		  <tn-list-cell>
+		    <view class="list-icon-text">
+		      <view class="list__left">
+		        <view class="list__left__text tn-color-gray--dark">上报人</view>
+		      </view>
+		      <view class="list__right">{{details.createPersonName}}</view>
+		    </view>
+		  </tn-list-cell>
+		  <tn-list-cell>
+		    <view class="list-icon-text">
+		      <view class="list__left">
+		        <view class="list__left__text tn-color-gray--dark">上报时间</view>
+		      </view>
+		      <view class="list__right">{{details.createTime}}</view>
+		    </view>
+		  </tn-list-cell>
+		  <template v-if="details.status!=0 && details.status!=1">
 			  <tn-list-cell>
 				<view class="list-icon-text">
 				  <view class="list__left">
-					<view class="list__left__text">维修图片</view>
+					<view class="list__left__text tn-color-gray--dark">是否作废</view>
+				  </view>
+				  <view class="list__right">{{details.isInvalid==0?'否':'是'}}</view>
+				</view>
+			  </tn-list-cell>
+			  <tn-list-cell v-if="details.isInvalid==1">  
+				<view class="list-icon-text">
+				  <view class="list__left">
+					<view class="list__left__text tn-color-gray--dark">作废原因</view>
+				  </view>
+				  <view class="list__right">{{details.invalidCause}}</view>
+				</view>
+			  </tn-list-cell>
+			  <tn-list-cell v-else>
+				<view class="list-icon-text">
+				  <view class="list__left">
+					<view class="list__left__text tn-color-gray--dark">维修图片</view>
 				  </view>
 				  <view class="list__right">
 					  <view
@@ -88,7 +120,7 @@
 			  <tn-list-cell>
 				<view class="list-icon-text">
 				  <view class="list__left">
-					<view class="list__left__text">维修人</view>
+					<view class="list__left__text tn-color-gray--dark">维修人</view>
 				  </view>
 				  <view class="list__right">{{details.reworkPersonName}}</view>
 				</view>
@@ -96,17 +128,17 @@
 			  <tn-list-cell>
 				<view class="list-icon-text">
 				  <view class="list__left">
-					<view class="list__left__text">维修时间</view>
+					<view class="list__left__text tn-color-gray--dark">维修时间</view>
 				  </view>
 				  <view class="list__right">{{details.reworkDate}}</view>
 				</view>
 			  </tn-list-cell>
 		  </template>
-		  <template v-if="details.status==0 || details.status==3">
+		  <template v-if="details.status!=1 && details.status!=2">
 			  <tn-list-cell>
 				<view class="list-icon-text">
 				  <view class="list__left">
-					<view class="list__left__text">审核人</view>
+					<view class="list__left__text tn-color-gray--dark">审核人</view>
 				  </view>
 				  <view class="list__right">{{details.auditPersonName}}</view>
 				</view>
@@ -114,7 +146,7 @@
 			  <tn-list-cell>
 				<view class="list-icon-text">
 				  <view class="list__left">
-					<view class="list__left__text">审核时间</view>
+					<view class="list__left__text tn-color-gray--dark">审核时间</view>
 				  </view>
 				  <view class="list__right">{{details.auditDate}}</view>
 				</view>
@@ -122,7 +154,7 @@
 			  <tn-list-cell v-if="details.auditFailCause">
 				<view class="list-icon-text">
 				  <view class="list__left">
-					<view class="list__left__text">不通过原因</view>
+					<view class="list__left__text tn-color-gray--dark">不通过原因</view>
 				  </view>
 				  <view class="list__right">{{details.auditFailCause}}</view>
 				</view>
@@ -151,24 +183,37 @@
 	    >
 	      <view class="popup-content tn-margin" :class="{'popup-content--center': mode === 'center'}">
 	  		<tn-form :model="form" ref="form" :labelPosition="labelPosition" :labelWidth="labelWidth" :labelAlign="labelAlign">
-				<tn-form-item label="维修图片" prop="images"  :required="true" v-if="details.status<2">
-					<tn-image-upload :fileList="form.images" :action="action" :header="header" @on-success="imageUploadChange"></tn-image-upload>
-				</tn-form-item>
-				 <tn-form-item label="新二维码" prop="qrCode" v-if="details.status<2">
-					<tn-input v-model="form.qrCode" type="text" placeholder="请输入二维码编码(新)" ></tn-input>
-					<view slot="right" class="tn-icon-scan tn-color-blue"  @click="openScan">扫码</view>
-				 </tn-form-item>
-				
+				<template v-if="details.status<2">
+					<tn-form-item label="是否作废" prop="isInvalid" :width="radioWidth" :wrap="radioWrap"  :required="true">
+						<tn-radio-group v-model="form.isInvalid" >
+						  <tn-radio name="0">否</tn-radio>
+						  <tn-radio name="1">是</tn-radio>
+						</tn-radio-group>
+					 </tn-form-item>
+					 <tn-form-item label="作废原因" prop="invalidCause"  :required="true" v-if="form.isInvalid==1">
+						<tn-input v-model="form.invalidCause" type="textarea" placeholder="请输入作废原因" ></tn-input>
+					 </tn-form-item>
+					
+					<tn-form-item label="维修图片" prop="images"  :required="true"  v-if="form.isInvalid==0">
+						<tn-image-upload :fileList="form.images" :action="action" :header="header" @on-success="imageUploadChange"></tn-image-upload>
+					</tn-form-item>
+					 <tn-form-item label="新二维码" prop="qrCode"  v-if="form.isInvalid==0">
+						<tn-input v-model="form.qrCode" type="text" placeholder="请输入二维码编码(新)" ></tn-input>
+						<view slot="right" class="tn-icon-scan tn-color-blue"  @click="openScan">扫码</view>
+					 </tn-form-item>
+				</template>
 				
-				<tn-form-item label="维修结果" prop="checkResult" :width="radioWidth" :wrap="radioWrap"  :required="true" v-if="details.status==2">
-					<tn-radio-group v-model="form.checkResult" >
-					  <tn-radio name="1">成功</tn-radio>
-					  <tn-radio name="0">失败</tn-radio>
-					</tn-radio-group>
-				 </tn-form-item>
-				 <tn-form-item label="失败原因" prop="problemDesc"  :required="true" v-if="details.status==2 && form.checkResult=='0'">
-					<tn-input v-model="form.auditFailCause" type="textarea" placeholder="请输入失败原因" ></tn-input>
-				 </tn-form-item>
+				<template  v-if="details.status==2">
+					<tn-form-item label="维修结果" prop="checkResult" :width="radioWidth" :wrap="radioWrap"  :required="true">
+						<tn-radio-group v-model="form.checkResult" >
+						  <tn-radio name="1">通过</tn-radio>
+						  <tn-radio name="0">不通过</tn-radio>
+						</tn-radio-group>
+					 </tn-form-item>
+					 <tn-form-item label="不通过原因" prop="problemDesc"  :required="true" v-if="form.checkResult=='0'">
+						<tn-input v-model="form.auditFailCause" type="textarea" placeholder="请输入不通过原因" ></tn-input>
+					 </tn-form-item>
+				</template>
 	  		</tn-form>
 			
 			<view class="tn-flex tn-flex-wrap tn-margin-top">
@@ -205,6 +250,8 @@
 			checkResult:'',
 			auditFailCause:'',
 			qrCode:'',
+			isInvalid:'0',
+			
 		},
 		rules: {
 		  images:  [
@@ -215,6 +262,20 @@
               type: 'array'
             }
           ],
+		  isInvalid: [
+		    {
+		      required: true,
+		      message: '请选择是否作废',
+              trigger: 'change'
+		    },
+		  ],
+		  invalidCause: [
+		    {
+		      required: true,
+		      message: '请输入作废原因',
+		      trigger: 'blur'
+		    },
+		  ],
 		  checkResult: [
 		    {
 		      required: true,
@@ -294,18 +355,23 @@
 			  form.id = that.details.id
 			  let url = 'wx/productRework/api/rework';
 			  if(that.details.status<2){
-				  let urls = [];
-				  for(let i=0;i<that.form.images.length;i++){
-					let url = that.form.images[i].url
-					urls.push(url)
+				  form.isInvalid = that.form.isInvalid
+				  if(that.form.isInvalid==0){
+					  let urls = [];
+					    for(let i=0;i<that.form.images.length;i++){
+					  	let url = that.form.images[i].url
+					  	urls.push(url)
+					    }
+					  form.reworkImgs = urls.join()
+					  if(that.form.qrCode){
+					  	form.qrCode = that.form.qrCode
+					  }
+				  }else{
+					  form.invalidCause = that.form.invalidCause
 				  }
-				form.reworkImgs = urls.join()
-				if(that.form.qrCode){
-					form.qrCode = that.form.qrCode
-				}
 			  }else{
 				form.auditFailCause = that.form.auditFailCause
-				form.status = that.form.checkResult==1?3:0
+				form.status = that.form.checkResult==1?(that.details.isInvalid==1?-1:3):0
 				url = 'wx/productRework/api/check';
 			  }
 			  that.api.request(url,form,'post','').then((res) => {

+ 3 - 2
pages/product/reworkRecord.vue

@@ -10,7 +10,7 @@
 				  <view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
 					<view class="content__title">商品二维码:</view>
 					<view class="content__data tn-flex-1">
-					  <tn-input v-model="qrCode" type="text" placeholder="请扫描产品二维码" border :height="60" disabled="disabled">
+					  <tn-input v-model="qrCode" type="text" placeholder="请扫描商品二维码" border :height="60" @confirm="initList()" >
 					  </tn-input>
 					</view>
 				  </view>
@@ -55,6 +55,7 @@
           {name: '待维修'},
           {name: '已维修'},
           {name: '维修完成'},
+          {name: '作废'},
         ],
 		qrCode:'',
 		type:0,
@@ -106,7 +107,7 @@
 			params = {
 				current:that.current,
 				size:that.size,
-				type: this.type+1,
+				type: this.type==3?-1:this.type+1,
 			}
 			if(this.qrCode){
 				params.qrCode = this.qrCode;

+ 1 - 0
pages/reportCenter/index.vue

@@ -49,6 +49,7 @@
 		list:[
 			{url:'/pages/reportCenter/report1',title:'产品入库汇总报表',icon:'home-totop'},
 			{url:'/pages/reportCenter/report2',title:'返工返修汇总报表',icon:'set'},
+			{url:'/pages/reportCenter/report3',title:'报废汇总报表',icon:'prohibit'},
 		]
       }
     },

+ 7 - 5
pages/reportCenter/report2.vue

@@ -24,9 +24,9 @@
 				<view class="tn-flex tn-flex-col-bottom tn-margin">
 					  <view class="tn-flex-3 align-content-item  tn-text-center ">
 						  <view class="content tn-flex tn-flex-direction-row tn-flex-col-center ">
-							<view class="content__title">入库时间:</view>
+							<view class="content__title">上报时间:</view>
 							<view class="content__data tn-flex-1">
-							  <tn-input v-model="time" type="text" :disabled="true" placeholder="请选择入库时间"  :height="60" border @click="openCalendar"></tn-input>
+							  <tn-input v-model="time" type="text" :disabled="true" placeholder="请选择上报时间"  :height="60" border @click="openCalendar"></tn-input>
 							</view>
 						  </view>
 					  </view>
@@ -47,7 +47,7 @@
 				  </view>
 				  <view class="tn-flex-1 tn-text-center tn-shadow tn-margin-sm tn-bg-white tn-padding tn-radius">
 					  
-					  <tn-count-to :startVal="0" :endVal="countSucceed+countCheck"></tn-count-to> 
+					  <tn-count-to :startVal="0" :endVal="countSucceed+countCheck+countInvalid"></tn-count-to> 
 					  <view>
 						  已维修数
 					  </view>
@@ -55,14 +55,14 @@
 			  </view>
 			  <view class=" tn-flex tn-bg-gray--light">
 				  <view class="tn-flex-1 tn-text-center tn-shadow tn-margin-sm tn-bg-white tn-padding tn-radius tn-no-margin-top">
-					  <tn-count-to :startVal="0" :endVal="countCheck"></tn-count-to> 
+					  <tn-count-to :startVal="0" :endVal="countCheck+countInvalid"></tn-count-to> 
 					  <view>
 						  审核台数
 					  </view>
 					  
 				  </view>
 				  <view class="tn-flex-1 tn-text-center tn-shadow tn-margin-sm tn-bg-white tn-padding tn-radius tn-no-margin-top">
-					  <tn-count-to :startVal="0" :endVal="countAll-countCheck"></tn-count-to> 
+					  <tn-count-to :startVal="0" :endVal="countAll-countCheck-countInvalid"></tn-count-to> 
 					  <view>
 						  未处理数
 					  </view>
@@ -123,6 +123,7 @@
 			countAll:0,
 			countSucceed:0,
 			countCheck:0,
+			countInvalid:0,
       }
     },
 	onLoad(options){
@@ -189,6 +190,7 @@
 				that.countAll = res.countAll;
 				that.countSucceed = res.countSucceed;
 				that.countCheck = res.countCheck;
+				that.countInvalid = res.countInvalid;
 			}).catch((res) => {
 			})
 		},

+ 227 - 0
pages/reportCenter/report3.vue

@@ -0,0 +1,227 @@
+<template>
+  <view >
+	  <tn-nav-bar fixed>返工返修汇总报表</tn-nav-bar>
+	  <view class="" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
+		  <view style="position: relative">
+			  <view class="tn-border-solid">
+				<view class="tn-flex tn-flex-col-bottom tn-margin">
+					  <view class="tn-flex-3 align-content-item  tn-text-center ">
+						  <view class="content tn-flex tn-flex-direction-row tn-flex-col-center">
+							<view class="content__title">产品二维码:</view>
+							<view class="content__data tn-flex-1">
+							  <tn-input v-model="qrCode" type="text" placeholder="请扫描产品二维码" border :height="60" >
+							  </tn-input>
+							</view>
+						  </view>
+					  </view>
+					  <view class="tn-flex-1 align-content-item  tn-text-right">
+						  <tn-button backgroundColor="#01BEFF"  fontColor="tn-color-white" icon="tn-icon-scan"  @click="openScan">
+							  <span class="tn-icon-scan tn-margin-right-xs"></span>扫码
+						  </tn-button>
+					  </view>
+				</view>
+						
+				<view class="tn-flex tn-flex-col-bottom tn-margin">
+					  <view class="tn-flex-3 align-content-item  tn-text-center ">
+						  <view class="content tn-flex tn-flex-direction-row tn-flex-col-center ">
+							<view class="content__title">作废时间:</view>
+							<view class="content__data tn-flex-1">
+							  <tn-input v-model="time" type="text" :disabled="true" placeholder="请选择作废时间"  :height="60" border @click="openCalendar"></tn-input>
+							</view>
+						  </view>
+					  </view>
+					  <view class="tn-flex-1 align-content-item  tn-text-right">
+						  <tn-button :plain="true"  backgroundColor="#dcdfe6" @click="initList()">
+							   <span class="tn-icon-search tn-margin-right-xs"></span>查询
+						   </tn-button>
+					  </view>
+				</view>
+			  </view>
+			  <view class=" tn-flex tn-bg-gray--light">
+				  <view class="tn-flex-1 tn-text-center tn-shadow tn-margin-sm tn-bg-white tn-padding tn-radius">
+					  <tn-count-to :startVal="0" :endVal="countNow"></tn-count-to> 
+					  <view>
+						  当日报废数
+					  </view>
+					  
+				  </view>
+				  <view class="tn-flex-1 tn-text-center tn-shadow tn-margin-sm tn-bg-white tn-padding tn-radius">
+					  
+					  <tn-count-to :startVal="0" :endVal="countAll"></tn-count-to> 
+					  <view>
+						  累计报废数
+					  </view>
+				  </view>
+			  </view>
+		  </view>
+		  <view>
+			  <template v-for="(item,index) in list">
+				  <view class="tn-flex tn-border-solid-bottom tn-bg-white tn-padding" @click="toDetail(item.id)" >
+					  <view class="tn-flex-4 "style="height: 50rpx;line-height:50rpx;">
+						  {{item.qrCode}}
+					  </view>
+					  <view class="tn-flex-1  tn-text-right ">
+						  <view v-if="item.status==-1" class="tn-btn-class tn-btn  tn-round tn-main-gradient-orange tn-text-center" style="height: 50rpx;line-height:50rpx;">
+							  作废
+						  </view>
+					  </view>
+				  </view>
+			  </template>
+				<tn-load-more class="tn-margin" status="nomore" v-if="total>0 && total<=list.length"></tn-load-more>
+			  
+		  </view>
+		  <view v-if="total==0" class="tn-padding tn-bg-white tn-border-solid-top">
+		  			  <tn-empty  icon="../../../static/image/cart.jpg" text="暂无数据" :imgWidth="200" :imgHeight="200" class="tn-margin-top-xl "></tn-empty>
+		  </view>
+	  </view>
+	  
+    <tn-calendar
+      v-if="showCalendar"
+      v-model="showCalendar"
+      mode="date"
+	  :dateValue="time"
+      :showLunar="false"
+      :changeYear="false"
+      @change="onChangeCalendar"
+    ></tn-calendar>
+  </view>
+</template>
+
+<script setup>
+  import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
+  export default {
+    data(){
+      return {
+			showCalendar: false,
+			time:'',
+			qrCode:'',
+			list:[],
+			current:1,
+			size:20,
+			total:-1,
+			countAll:0,
+			countNow:0,
+      }
+    },
+	onLoad(options){
+		this.initList();
+	},
+	onReachBottom() { //监听上拉触底事件
+		if(this.total<= this.list.length){
+			return
+		}
+		this.getList();
+	},
+	onPullDownRefresh() {//下拉刷新
+		this.initList();
+	},
+	onShow(){
+	},
+    methods: {
+		initList(){
+			this.current = 1;
+			this.list = [];
+			this.getList();
+		},
+		getList(){
+			this.countProduct(); 
+			let that = this,
+			url = "wx/productRework/api/page",
+			params = {
+				current:that.current,
+				size:that.size,
+				status:-1,
+			}
+			if(this.qrCode){
+				params.qrCode = this.qrCode;
+			}
+			if(this.time){
+				params.auditDate=this.time;
+			}
+			that.api.request(url, params,"get").then((res) => {
+				console.log(res)
+				let list=res.records;
+				for(var i = 0; i < list.length; i++){
+					that.list.push(list[i]);
+				}
+				if(list.length>0){
+					that.current=that.current+1;
+				}
+				that.total = res.total
+				uni.stopPullDownRefresh();
+			}).catch((res) => {
+				uni.stopPullDownRefresh();
+			})
+		},
+		countProduct(){
+			let that = this,
+			url = "wx/productRework/api/countProductRework",
+			params = {}
+			if(this.qrCode){
+				// params.qrCode = this.qrCode;
+			}
+			if(this.time){
+				params.auditDate=this.time;
+			}
+			params.status=-1
+			that.api.request(url, params,"get").then((res) => {
+				that.countAll = res.countAll;
+				that.countNow = res.countNow;
+			})
+		},
+		openScan(){
+			// 允许从相机和相册扫码
+			let that = this;
+			uni.scanCode({
+				success: function (res) {
+					that.qrCode = res.result
+					that.initList();
+				}
+			});
+		},
+		toDetail(id){
+			uni.navigateTo({
+				url:"/pages/product/rework-pecord/detail?id="+id
+			})
+		},
+		openCalendar() {
+		  this.showCalendar = true
+		},
+		onChangeCalendar(event){
+			this.time = event.date
+			this.initList();
+		},
+    }
+  }
+</script>
+
+<style lang="scss" scoped>
+	
+	.list-icon-text, .list-image-text {
+	  display: flex;
+	  align-items: center;
+	  justify-content: space-between;
+	}
+	
+	.list {
+	  &__left {
+	    display: flex;
+	    align-items: center;
+	    justify-content: flex-start;
+		min-width: 140rpx;
+	    
+	    &__icon, &__image {
+	      margin-right: 18rpx;
+	    }
+	  }
+	  
+	  &__right {
+	    display: flex;
+	    align-items: center;
+	    justify-content: flex-end;
+		flex-wrap: wrap;
+		word-break: break-all;
+	  }
+	}
+	
+</style>