Parcourir la source

feat: 生成工单列表增加规格,详情增加规格,投料,领料状态,领料和报工时间通过参数是否默认时间

liujt il y a 9 mois
Parent
commit
a189ff974a

+ 7 - 0
pages/pda/components/workCard.vue

@@ -46,6 +46,13 @@
       </view>
     </view>
 
+    <view class="item_box rx-sc">
+      <view class="item_one perce50 rx-sc">
+        <view class="lable">规格:</view>
+        <view class="gylx">{{ item.specification }}</view>
+      </view>
+    </view>
+    
     <view class="item_box rx-bc">
       <view class="item_one perce50 rx-sc">
         <view class="lable">生产数量:</view>

+ 33 - 5
pages/pda/feeding/components/workOrderBom.vue

@@ -90,6 +90,7 @@
 
 					<view class="content ">
 						<uni-datetime-picker type="datetime" 
+							:value="currentExecutorTime"
 							@change="changeTime($event, item)" />
 					</view>
 				</view>
@@ -102,6 +103,7 @@
 </template>
 
 <script>
+import { parameterGetByCode } from "@/api/mainData/index.js";
 export default {
 	props: {
 		item: {
@@ -126,22 +128,48 @@ export default {
 	},
 	data() {
 		return {
-			clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId
+			clientEnvironmentId: uni.getStorageSync("userInfo") && uni.getStorageSync("userInfo").clientEnvironmentId,
+			currentExecutorTime: ''
 		}
 	},
+	created() {
+		console.log('item', this.item)
+		this.getByCode();
+	},
 	methods: {
 		changeTime(e, val) {
 
 			let a = e.split(' ');
 			console.log(a);
 			if (a[1] !== "") {
-				this.item.executorTime = e
+				this.currentExecutorTime = e
 			} else {
-				this.item.executorTime = `${e}00:00:00`
-				
+				this.currentExecutorTime = `${e}00:00:00`
 			}
+			this.item.executorTime = this.currentExecutorTime;
+			console.log('executorTime', this.item.executorTime)
+		},
+		getByCode() {
+			parameterGetByCode({ code: "mes_order_feed_by_default_date" }).then((res) => {
+				console.log('res', res)
+				if(res.value == "1") {
+					if(!this.item.executorTime) {
+						const now = new Date();
+						const year = now.getFullYear();
+						const month = String(now.getMonth() + 1).padStart(2, '0');
+						const day = String(now.getDate()).padStart(2, '0');
+						const hours = String(now.getHours()).padStart(2, '0');
+						const minutes = String(now.getMinutes()).padStart(2, '0');
+						const seconds = String(now.getSeconds()).padStart(2, '0');
+						this.currentExecutorTime = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
+						this.item.executorTime = this.currentExecutorTime;
+						console.log('executorTime', this.item.executorTime)
+						console.log('item', this.item)
+						this.$forceUpdate();
+					}
+				}
+			});
 		},
-
 		handleScan(id) {
 			this.$emit('handleScan', id, 'wordOrder')
 		},

+ 64 - 2
pages/pda/workOrder/extrusionMolding/index.vue

@@ -81,7 +81,12 @@
           <text class="lable">牌号</text>
           <text>{{ info.brandNo }}</text>
         </view>
-
+		
+        <view class="item_list rx-bc">
+          <text class="lable">规格</text>
+          <text>{{ info.specification }}</text>
+        </view>
+		
         <view class="item_list rx-bc">
           <text class="lable">型号</text>
           <text>{{ info.model }}</text>
@@ -102,6 +107,16 @@
           <text>{{ info.singleReport == 1 ? "单个报工" : "批量报工" }}</text>
         </view>
 
+        <view class="item_list rx-bc">
+          <text class="lable">领料状态</text>
+          <text>{{ isPickingStatus }}</text>
+        </view>
+
+        <view class="item_list rx-bc">
+          <text class="lable">投料状态</text>
+          <text>{{ isFeedStatus }}</text>
+        </view>
+
         <view class="item_list rx-bc">
           <text class="lable">已完成生产数量</text>
           <text>{{ info.formedNum }}</text>
@@ -261,6 +276,18 @@ export default {
       return v == 1 ? "未委外" : v == 2 ? "委外中" : v == 3 ? "完成委外" : "";
     },
   },
+  computed: {
+    isFeedStatus() {
+      const currentStep = this.stepsList?.[this.currentStepIndex]
+      // 投料状态 0未投料 1已投料 2已报工
+      return this.feedStatusOption.find(item => item.value === currentStep?.feedStatus)?.label || ''
+    },
+    isPickingStatus() {
+      const currentStep = this.stepsList?.[this.currentStepIndex]
+      // 领料状态 0未领料 1领料中2已出库3已驳回
+      return this.pickStatusOption.find(item => item.value === currentStep?.pickStatus)?.label || ''
+    }
+  },
   data() {
     return {
       title: "",
@@ -284,6 +311,39 @@ export default {
         uni.getStorageSync("userInfo") &&
         uni.getStorageSync("userInfo").clientEnvironmentId, // *1 主环境-601环境   2 soll-索尔环境    3 tg-碳谷环境
       feedNeedEquipment: 1, //投料是否要添加生产设备1是0否
+      currentStepIndex: 0, // 当前步骤索引
+      pickStatusOption: [
+        {
+          label: '未领料',
+          value: 0
+        },
+        {
+          label: '领料中',
+          value: 1
+        },
+        {
+          label: '已出库',
+          value: 2
+        },
+        {
+          label: '已驳回',
+          value: 3
+        }
+      ],
+      feedStatusOption: [
+        {
+          label: '未投料',
+          value: 0
+        },
+        {
+          label: '已投料',
+          value: 1
+        },
+        {
+          label: '已报工',
+          value: 2
+        }
+      ]
     };
   },
 
@@ -354,6 +414,7 @@ export default {
             (this.currentType = f.type),
               (this.existOutsource = f.existOutsource);
             this.controlReportMethod = f.controlReportMethod;
+            this.currentStepIndex = f.index;
           }
         });
     },
@@ -367,13 +428,14 @@ export default {
 
     // 点击工序列表
     selectStep(item) {
+      console.log('item', item)
       this.currentTaskId = item.taskId;
       this.currentTaskName = item.taskTypeName;
       this.existOutsource = item.existOutsource;
       this.currentType = item.type;
       this.controlReportMethod = item.controlReportMethod;
       this.feedNeedEquipment = item.feedNeedEquipment;
-
+      this.currentStepIndex = item.index;
       this.feedStatus();
     },