|
@@ -1,107 +1,149 @@
|
|
|
<template>
|
|
|
<view class="uni-column container">
|
|
|
- <view style="margin: 12rpx;">
|
|
|
- <view class="margenTop" style="font-size: 30rpx;font-weight: bold;">批次号:{{product.lotCode}}</view>
|
|
|
- <view class="margenTop" style="font-size: 30rpx;font-weight: bold;">产品描述:{{product.productDescription}}</view>
|
|
|
- <view class="margenTop" style="font-size: 30rpx;font-weight: bold; flex-direction: row;">
|
|
|
- <view >工艺版本:{{product.technologyVersion}}</view>
|
|
|
- <view style="margin-left: 200rpx;" >工序:{{product.processAlias}}</view>
|
|
|
- </view>
|
|
|
+ <view style="margin: 12rpx;">
|
|
|
+ <view class="margenTop" style="font-size: 30rpx;font-weight: bold;">批次号:{{product.lotCode}}</view>
|
|
|
+ <view class="margenTop" style="font-size: 30rpx;font-weight: bold;">产品描述:{{product.productDescription}}
|
|
|
</view>
|
|
|
- <view class='middle'>
|
|
|
- <view class='segment'></view>
|
|
|
- <uni-icons type="paperclip" size="30" ></uni-icons>
|
|
|
- <view class='segment'></view>
|
|
|
+ <view class="margenTop" style="font-size: 30rpx;font-weight: bold; flex-direction: row;">
|
|
|
+ <view>工艺版本:{{product.technologyVersion}}</view>
|
|
|
+ <view style="margin-left: 200rpx;">工序:</view>
|
|
|
+ <uni-data-select v-model="curSelectedProcessCode" :localdata="selectedProcessList" :clear="false"
|
|
|
+ @change="handleSelectedChange"></uni-data-select>
|
|
|
</view>
|
|
|
- <view style="overflow: auto;">
|
|
|
- <view :class="{'list-container':true}"
|
|
|
- v-for="(item, index) in drawingList" :key="item.id">
|
|
|
- <view ><text style="text-align: center; font-size: 28rpx; padding: 48rpx 0 24rpx 0;color: #1684fc;" @click="handleOpenDrawing(item)">{{item.drawingName}}</text></view>
|
|
|
-
|
|
|
- </view>
|
|
|
- </view>
|
|
|
-
|
|
|
+ </view>
|
|
|
+ <view class='middle'>
|
|
|
+ <view class='segment'></view>
|
|
|
+ <uni-icons type="paperclip" size="30"></uni-icons>
|
|
|
+ <view class='segment'></view>
|
|
|
+ </view>
|
|
|
+ <view style="overflow: auto;">
|
|
|
+ <view :class="{'list-container':true}" v-for="(item, index) in drawingList" :key="item.id">
|
|
|
+ <view><text style="text-align: center; font-size: 28rpx; padding: 48rpx 0 24rpx 0;color: #1684fc;"
|
|
|
+ @click="handleOpenDrawing(item)">{{item.drawingName}}</text></view>
|
|
|
+
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
- import{getDrawingList,getTechnologicalProcess} from '@/api/business/drawing.js'
|
|
|
+ import {
|
|
|
+ getDrawingList,
|
|
|
+ getTechnologicalProcess,
|
|
|
+ getDeptProcess
|
|
|
+ } from '@/api/business/drawing.js'
|
|
|
import {
|
|
|
ref
|
|
|
} from 'vue'
|
|
|
import {
|
|
|
onLoad,
|
|
|
} from '@dcloudio/uni-app'
|
|
|
-import { store } from '../../store';
|
|
|
-const technologicalProcessId = ref("")
|
|
|
-const drawingList = ref([])
|
|
|
-const processCode = ref("")
|
|
|
-const productId = ref("")
|
|
|
-const product = ref({})
|
|
|
-const lotCode = ref("")
|
|
|
-const processAlias = ref("")
|
|
|
+ import {
|
|
|
+ store
|
|
|
+ } from '../../store';
|
|
|
+ const technologicalProcessId = ref("")
|
|
|
+ const drawingList = ref([])
|
|
|
+ const processCode = ref("")
|
|
|
+ const productId = ref("")
|
|
|
+ const product = ref({})
|
|
|
+ const lotCode = ref("")
|
|
|
+ const selectedProcessList = ref([]);
|
|
|
+ const curSelectedProcessCode = ref("");
|
|
|
+ const processAlias = ref("")
|
|
|
onLoad((options) => {
|
|
|
- console.log(options,1111)
|
|
|
+ console.log(options, 1111)
|
|
|
technologicalProcessId.value = options.param4
|
|
|
lotCode.value = options.param2
|
|
|
productId.value = options.param1
|
|
|
processCode.value = options.param3
|
|
|
- processAlias.value = decodeURIComponent(options.param5)
|
|
|
+ curSelectedProcessCode.value = processCode.value
|
|
|
+ processAlias.value = decodeURIComponent(options.param5)
|
|
|
init();
|
|
|
-
|
|
|
+
|
|
|
})
|
|
|
+ // 获取所有的本工段可加工工序
|
|
|
+
|
|
|
+ function getProcesses(data) {
|
|
|
+ console.log(data)
|
|
|
+ getDeptProcess(data).then(res => {
|
|
|
+ selectedProcessList.value = res.data.map(v => ({
|
|
|
+ text: v.processAlias,
|
|
|
+ value: v.processCode
|
|
|
+ }))
|
|
|
+ curSelectedProcessCode.value = processCode.value
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
function init() {
|
|
|
console.log(product.value)
|
|
|
- getTechnologicalProcess(technologicalProcessId.value).then(response=>{
|
|
|
- console.log(response,1123)
|
|
|
- if(response.code ==200){
|
|
|
- product.value = response.data
|
|
|
+ getTechnologicalProcess(technologicalProcessId.value).then(response => {
|
|
|
+ console.log(response, 1123)
|
|
|
+ if (response.code == 200) {
|
|
|
+ product.value = response.data
|
|
|
product.value.lotCode = lotCode.value
|
|
|
product.value.processAlias = processAlias.value
|
|
|
- getDrawingList({productVersion:product.value.technologyVersion,processCode:processCode.value,productId:productId.value}).then(res=>{
|
|
|
- if(res.code == 200){
|
|
|
+ getProcesses({
|
|
|
+ productVersion: product.value.technologyVersion,
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
|
+ productId: productId.value
|
|
|
+ })
|
|
|
+ getDrawingList({
|
|
|
+ productVersion: product.value.technologyVersion,
|
|
|
+ processCode: processCode.value,
|
|
|
+ productId: productId.value
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
drawingList.value = res.data
|
|
|
// product.value = drawingList.value[0].product
|
|
|
// product.value.technologyVersion = drawingList.value[0].technologyVersion
|
|
|
// product.value.processAlias = drawingList.value[0].processAlias
|
|
|
// product.value.lotCode = lotCode.value
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- function handleOpenDrawing(row){
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+ function handleOpenDrawing(row) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
// 检查 filteredProcess 是否有元素,并选择第一个元素
|
|
|
|
|
|
-
|
|
|
-
|
|
|
- var encodeUrl = row.url;
|
|
|
- console.log(row)
|
|
|
- // 构建查询参数字符串
|
|
|
- var queryParam = `param1=${encodeUrl}`;
|
|
|
-
|
|
|
- // 使用模板字符串构建完整的URL
|
|
|
- var navigateUrl = `/pages/pdfviewer/index?${queryParam}`;
|
|
|
-
|
|
|
- // 导航到指定页面
|
|
|
- uni.navigateTo({
|
|
|
- url: navigateUrl
|
|
|
- });
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ var encodeUrl = row.url;
|
|
|
+ console.log(row)
|
|
|
+ // 构建查询参数字符串
|
|
|
+ var queryParam = `param1=${encodeUrl}`;
|
|
|
+
|
|
|
+ // 使用模板字符串构建完整的URL
|
|
|
+ var navigateUrl = `/pages/pdfviewer/index?${queryParam}`;
|
|
|
|
|
|
+ // 导航到指定页面
|
|
|
+ uni.navigateTo({
|
|
|
+ url: navigateUrl
|
|
|
+ });
|
|
|
|
|
|
+ }
|
|
|
+ //切换工序查询
|
|
|
+ function handleSelectedChange(item) {
|
|
|
+ getDrawingList({
|
|
|
+ productVersion: product.value.technologyVersion,
|
|
|
+ processCode: curSelectedProcessCode.value,
|
|
|
+ productId: productId.value
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ drawingList.value = res.data
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
@@ -109,6 +151,7 @@ const processAlias = ref("")
|
|
|
height: 100%;
|
|
|
background-color: #f5f5f5;
|
|
|
}
|
|
|
+
|
|
|
.middle {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
@@ -116,6 +159,7 @@ const processAlias = ref("")
|
|
|
justify-content: center;
|
|
|
margin-top: 20rpx;
|
|
|
}
|
|
|
+
|
|
|
.scroll-container {
|
|
|
position: absolute;
|
|
|
top: 24rpx;
|
|
@@ -123,15 +167,18 @@ const processAlias = ref("")
|
|
|
bottom: 160rpx;
|
|
|
left: 0;
|
|
|
}
|
|
|
-.segment {
|
|
|
+
|
|
|
+ .segment {
|
|
|
width: 280rpx;
|
|
|
background-color: rgba(213, 213, 213, 1);
|
|
|
border: 1rpx solid rgba(213, 213, 213, 1);
|
|
|
}
|
|
|
+
|
|
|
.selected {
|
|
|
border: 1px solid #1684fc;
|
|
|
}
|
|
|
- .margenTop{
|
|
|
+
|
|
|
+ .margenTop {
|
|
|
margin: 20rpx;
|
|
|
}
|
|
|
|
|
@@ -165,7 +212,7 @@ const processAlias = ref("")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
.item-info {
|
|
|
margin-bottom: 16rpx;
|
|
|
|