ysy 2 년 전
부모
커밋
cec853db55

+ 12 - 1
api/pda/workOrder.js

@@ -2,7 +2,7 @@ import { postJ, post, get } from "@/utils/request";
 import Vue from "vue";
 
 
-
+// 工单列表
 export async function workorderPage(params) {
   const data = await postJ(
    Vue.prototype.apiUrl  + `/pda/mes/workorder/page`, params, true,
@@ -14,3 +14,14 @@ export async function workorderPage(params) {
 }
 
 
+// 根据工单id获取工序列表
+
+export async function getTaskInstanceList(id) {
+  const data = await get(
+   Vue.prototype.apiUrl  + `/pda/mes/workorder/getTaskInstanceById/${id}`,
+  );
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}

+ 9 - 33
pages/pda/components/stepsNav.vue

@@ -2,7 +2,7 @@
 	<view class="nav_box">
 		<scroll-view :scroll-x="scrollable" :scroll-left="scrollLeft" scroll-with-animation
 			class="u-tabs__wrapper__scroll-view" :show-scrollbar="false" ref="u-tabs__wrapper__scroll-view">
-			<uniSteps :options="stepOptions" :active="activeIndex" @selectStep="selectStep"></uniSteps>
+			<uniSteps :options="stepsList" :active="activeIndex" @selectStep="selectStep"></uniSteps>
 		</scroll-view>
 	</view>
 </template>
@@ -13,47 +13,23 @@
 		components: {
 			uniSteps
 		},
+		props: {
+			stepsList: {
+				type: Array,
+				default: () => []
+			}
+		},
 		data() {
 			return {
 				scrollable: true,
 				scrollLeft: 10,
 				activeIndex: 5,
-				stepOptions: [{
-						title: '基本信息',
-						index: 0
-					},
-					{
-						title: '门店信息',
-						index: 1
-					},
-					{
-						title: '门店图片',
-						index: 2
-					},
-					{
-						title: '等待审核',
-						index: 3
-					},
-
-					{
-						title: '测试',
-						index: 4
-					},
-
-					{
-						title: '测试22',
-						index: 5
-					},
-					{
-						title: '测试444',
-						index: 6
-					}
-				],
-
+	
 			}
 		},
 		
 		created() {
+			console.log(this.stepsList)
 			this.$nextTick(() => {
 				// this.scrollLeft = 10
 			})

+ 3 - 3
pages/pda/components/uni-steps.vue

@@ -26,7 +26,7 @@
 				<view v-for="(item,index) in options" :key="index"
 					:class="[direction==='column'?'uni-steps__column-text':'uni-steps__row-text']">
 					<text :style="{color:index<=active?activeColor:deactiveColor}"
-						:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.title}}</text>
+						:class="[direction==='column'?'uni-steps__column-title':'uni-steps__row-title']">{{item.taskTypeName}}</text>
 					<text :style="{color:index<=active?activeColor:deactiveColor}"
 						:class="[direction==='column'?'uni-steps__column-desc':'uni-steps__row-desc']">{{item.desc}}</text>
 				</view>
@@ -146,7 +146,7 @@
 		font-size: 28rpx;
 		line-height: 40upx;
 		text-align: center;
-		min-width: 180rpx;
+		min-width: 200rpx;
 	}
 
 	.uni-steps__column-title {
@@ -194,7 +194,7 @@
 		line-height: 60upx;
 		align-items: center;
 		justify-content: center;
-		min-width: 180rpx;
+		min-width: 200rpx;
 	}
 
 	.uni-steps__column-line-item {

+ 18 - 1
pages/pda/workOrder/extrusionMolding/index.vue

@@ -5,7 +5,7 @@
 
 
 		<view class="top-wrapper cx">
-			<stepsNav></stepsNav>
+			<stepsNav :stepsList="stepsList"></stepsNav>
 
 			<view class="tab_box rx-sc">
 				<view class="tab_item" :class="{active: tabType == 1}" @click="handTab(1)">基本信息</view>
@@ -120,6 +120,8 @@
 <script>
 	import bottomOperate from '../../components/bottomOperate.vue'
 	import stepsNav from '../../components/stepsNav.vue'
+	
+		import { getTaskInstanceList } from '@/api/pda/workOrder.js'
 	export default {
 		components: {
 			bottomOperate,
@@ -129,6 +131,9 @@
 			return {
 				title: '',
 				tabType: 1,
+				id: null,
+				
+				stepsList: [],
 
 				detailList: [{
 						name: '挤压成型',
@@ -167,6 +172,9 @@
 
 		onLoad(options) {
 			this.title = options.title
+			
+			this.id = options.id
+			this.getSteps()
 
 		},
 
@@ -177,6 +185,15 @@
 				if (type != this.tabType) {
 					this.tabType = type
 				}
+			},
+			
+			getSteps() {
+				getTaskInstanceList(this.id).then(res => {
+					this.stepsList = res
+					if(!this.title && this.stepsList.length) {
+					this.title = this.stepsList[0].taskTypeName
+					}
+				})
 			}
 		}
 	}

+ 3 - 3
pages/pda/workOrder/index/index.vue

@@ -21,7 +21,7 @@
 
 			<u-list @scrolltolower="scrolltolower" key="list" :preLoadScreen="page * 10">
 				<u-list-item v-for="(item, index) in dataList" :key="index">
-					<workCard  :item="item" @handleDetail="handleDetail"></workCard>
+					<workCard :item="item" @handleDetail="handleDetail"></workCard>
 				</u-list-item>
 
 
@@ -37,6 +37,7 @@
 
 <script>
 	import workCard from '../../components/workCard.vue'
+	import { getTaskInstanceList } from '@/api/pda/workOrder.js'
 	import {
 		workorderPage
 	} from '@/api/pda/workOrder.js'
@@ -99,8 +100,7 @@
 
 
 				let url = '/pages/pda/workOrder/extrusionMolding/index'
-
-				url += `?id=1&title=挤压成型`
+				url += `?id=${item.id}&title=${item.produceTaskInstanceName}`
 				console.log(url)
 				uni.navigateTo({
 					url