浏览代码

修改页面前端处理

oyq28 2 年之前
父节点
当前提交
be13ebcfb8

+ 9 - 7
imcs-bt-fe/imcs-bt-fe/imcs-ui/src/views/zuihou/productionresource/components/MaterialMgr.vue

@@ -114,8 +114,9 @@
                          prop="exprStatus"
                          width="">
           <template slot-scope="scope">
-            <span v-if="daysLater(scope.row.exprTime,scope.row.exprWarDays)">正常</span>
-            <span v-else>过期</span>
+            <span v-if="daysLater(scope.row.exprTime,scope.row.exprWarDays)===1">过期</span>
+            <span v-else-if="daysLater(scope.row.exprTime,scope.row.exprWarDays)===2">即将过期</span>
+            <span v-else>正常</span>
           </template>
         </el-table-column>
         <!--        <el-table-column :label="$t('btMaterial.material.mtWeight')" :show-overflow-tooltip="true" align="center"-->
@@ -275,11 +276,12 @@ export default {
 
     daysLater(exprTime, exprWarDays) {
       let nowTime = new Date().getTime();
-      console.log("当前时间" + new Date())
-      let endTime = new Date(exprTime).getTime() - exprWarDays * 1000 * 24 * 60 * 60;
-      console.log("过期时间" + new Date(exprTime))
-      console.log("截止时间" + new Date(endTime))
-      return (nowTime <= endTime) ? true : false;
+      //console.log("当前时间" + new Date())
+      let expiryTime = new Date(exprTime).getTime();
+      let endTime = expiryTime - exprWarDays * 1000 * 24 * 60 * 60;
+      //console.log("过期时间" + new Date(exprTime))
+      //console.log("截止时间" + new Date(endTime))
+      return nowTime > expiryTime ? 1 : (nowTime > endTime? 2 : 3);
 
       // let dqTime = new Date(exprTime);
       // let nTime = dqTime.setDate(dqTime.getDate() + exprWarDays)

+ 6 - 14
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/cup.vue

@@ -15,7 +15,6 @@
 								:style="{ height: Math.round(item.mtrResidue) + '%', backgroundColor:'#ff0000'}" v-else>
 								<view class="progress-view"></view>
 							</view>
-							{{item.mtrResidue}} {{item.residueWarn}}
 							<text class="expMsg" v-if="item.exprCloseStatus==='1' && item.exprStatus==='0' ">即将到期</text>							
 							<text class="errMsg" v-if="parseInt(item.mtrResidue) <= parseInt(item.residueWarn)">原料不足</text>
 							<text class="tip">{{parseInt(item.mtrResidue) || '0'}}个</text>
@@ -45,11 +44,11 @@
 				</uni-tr>
 				<uni-tr v-for="(item, index) in records" :key="item.id">
 					<uni-td align="center">{{item.barrelCode}}</uni-td>
-					<uni-td align="center">{{item.mtName}}</uni-td>
-					<uni-td align="center">{{item.surplus}}</uni-td>
-					<uni-td align="center">{{item.mtrName}}</uni-td>
-					<uni-td align="center">{{item.specs}}</uni-td>
-					<uni-td align="center">{{item.date}}</uni-td>
+					<uni-td align="center">{{item.mtName||'空'}}</uni-td>
+					<uni-td align="center">{{item.surplus||'0'}}</uni-td>
+					<uni-td align="center">{{item.mtrName||'空'}}</uni-td>
+					<uni-td align="center">{{item.specs||'0'}}</uni-td>
+					<uni-td align="center">{{item.date||''}}</uni-td>
 				</uni-tr>
 			</uni-table>
 
@@ -199,14 +198,7 @@
 					specs: '',
 					date: ''
 				},
-				records: [{
-					id: 1,
-					name: '燕麦',
-					rawMaterial: '燕麦',
-					surplus: '2',
-					specs: '10',
-					date: '2021-11-14 12:13'
-				}],
+				records: [],
 				records2: [{
 					id: 1,
 					name: '燕麦',

+ 6 - 13
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/material/material.vue

@@ -44,11 +44,11 @@
 				</uni-tr>
 				<uni-tr v-for="(item, index) in records" :key="item.id">
 					<uni-td align="center">{{item.barrelCode}}</uni-td>
-					<uni-td align="center">{{item.mtName}}</uni-td>
-					<uni-td align="center">{{item.surplus}}</uni-td>
-					<uni-td align="center">{{item.mtrName}}</uni-td>
-					<uni-td align="center">{{item.specs}}</uni-td>
-					<uni-td align="center">{{item.date}}</uni-td>
+					<uni-td align="center">{{item.mtName||'空'}}</uni-td>
+					<uni-td align="center">{{item.surplus|| '0'}}</uni-td>
+					<uni-td align="center">{{item.mtrName||'空'}}</uni-td>
+					<uni-td align="center">{{item.specs || '0'}}</uni-td>
+					<uni-td align="center">{{item.date||''}}</uni-td>
 				</uni-tr>
 			</uni-table>
 
@@ -212,14 +212,7 @@
 					specs: '',
 					date: ''
 				},
-				records: [{
-					id: 1,
-					name: '燕麦',
-					rawMaterial: '燕麦',
-					surplus: '2',
-					specs: '10',
-					date: '2021-11-14 12:13'
-				}],
+				records: [],
 				records2: [{
 					id: 1,
 					name: '燕麦',

+ 28 - 16
imcs-bt-fe/imcs-bt-fe/uni-mall/pages/ucenter/order/order.vue

@@ -50,7 +50,7 @@
 				:key="item.id">
 				<view class="h">
 					<view class="l">创建时间:{{item.createTime||''}}</view>
-					<view class="r">{{item.status==='1'?'生产中':(item.status==='2'?'生产失败':'生产完成')}}</view>
+					<view class="r">{{array[parseInt(item.orderStatus)+1].name}}</view>
 				</view>
 				<view class="h">
 					<view class="l">订单编号:{{item.id||''}}</view>
@@ -62,7 +62,10 @@
 				<view class="h">
 					<view class="l">设备名称:{{item.deviceName||''}}</view>
 				</view>
-				<view class="h" v-if="item.errorMsg && item.status==2">
+				<view class="h">
+					<view class="l">产品名称:{{item.orderGoodsName||''}}</view>
+				</view>
+				<view class="h" v-if="item.errorMsg && item.orderStatus==2">
 					<view class="l">异常原因:{{item.errorMsg}}</view>
 				</view>
 				<view class="b" v-if="false">
@@ -91,6 +94,7 @@
 				index: 0,
 				index2: 0,
 				isToday: true,
+				statusId: 0,
 				deviceId: '',
 				deviceList: [{
 					id: '',
@@ -99,9 +103,9 @@
 				orderCount: 2,
 				orderSum: 0.0,
 				array: [{
-					id: '',
+					id: 0,
 					name: '全部'
-				},{id:1, name: '已支付'},{id:2, name:'生产中'},{id:3, name:'生产完成'}],
+				},{id:1, name: '未支付'},{id:2, name: '已支付'},{id:3, name:'已取消'},{id:4, name:'生产完成'},{id:5, name: '异常'},{id:6, name: '转入退款'},],
 				orderList: [
 					/*{
 					name: '美式咖啡',
@@ -143,13 +147,20 @@
 		methods: {
 			bindPickerChange: function(e) {
 				this.index = e.detail.value
+				this.statusId = this.array[this.index].id				
+				this.orderList = []
+				this.queryParams.current = 1
+				let pages = getCurrentPages();
+				let page = pages[pages.length - 1].$page.fullPath;
+				let oType = page.split('type=')[1]
+				this.getOrderList(oType)
 			},
 			bindPickerChange2: function(e) {
 				this.index2 = e.detail.value;
 				this.deviceId = this.deviceList[this.index2].id
 				this.orderList = []
 				this.queryParams.current = 1
-				this.queryParams.model.orderEquId = this.deviceId
+				//this.queryParams.model.orderEquId = this.deviceId
 				let pages = getCurrentPages();
 				let page = pages[pages.length - 1].$page.fullPath;
 				let oType = page.split('type=')[1]
@@ -176,7 +187,7 @@
 				let page = pages[pages.length - 1].$page.fullPath;
 				let oType = page.split('type=')[1]
 				console.log(oType)
-				this.getOrderList(oType)
+				this.getOrderList(oType) 
 			},
 			onCancel(e) {
 				this.range = []
@@ -212,23 +223,24 @@
 				let that = this;
 				if(type=="1"){
 					that.range=[util.getNowDate(0), util.getNowDate(1)];
-					that.isToday = true					
-				}else{
-					//异常状态位
-					//that.queryParams.model
-					that.isToday = false
+					that.isToday = true
+				}else{					
+					that.isToday = false					
 				}
 				if (that.deviceId) {
-					that.queryParams.model.orderEquId = that.deviceId;
-				} else {
-					that.queryParams.model = {}
+					that.queryParams.model.orderEquId = that.deviceId
+				}
+				if(that.statusId>0){
+					that.queryParams.model.orderStatus = that.statusId - 1
+					that.index = that.statusId
+				}else if(type=="2"){
+					that.queryParams.model.orderStatus = '4'
+					that.index = 5
 				}
 				console.log(that.range)
 				if (that.range.length > 0) {
 					that.queryParams.map.createTime_st = that.range[0];
 					that.queryParams.map.createTime_ed = that.range[1];
-				} else {
-					that.queryParams.map = {}
 				}
 				util.request(api.OrderList, that.queryParams, 'post', 'application/json').then(function(res) {
 					if (res.code === 0) {						

+ 4 - 4
imcs-bt-fe/imcs-bt-fe/uni-mall/utils/util.js

@@ -1,8 +1,8 @@
 const utils = {
 	// 域名
 	//domain: 'https://fly2you.cn/',
-	domain: 'https://gn.baotingsmart.com/',
-	//domain: 'http://127.0.0.1:8764/',
+	//domain: 'https://gn.baotingsmart.com/',
+	domain: 'http://127.0.0.1:8764/',
 	//接口地址
 	interfaceUrl: function(params) {
 		//return utils.domain + 'platform/api/'
@@ -448,8 +448,8 @@ const utils = {
 	},
 	loginH5: function(data){
 		data.interfaceUrl = "/"
-		return utils.request("api/oauth/anno/token", data, "post", "application/json");
-	    //return utils.request("anno/token", data, "post", "application/json");
+		//return utils.request("api/oauth/anno/token", data, "post", "application/json");
+	    return utils.request("anno/token", data, "post", "application/json");
 	},
 	randomNum: function(len, radix) {
 	  const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('')