123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285 |
- <template>
- <view class="uni-column container">
- <view style="margin: 12rpx;">
- <view class="margenTop" style="font-size: 30rpx;font-weight: bold; flex-direction: row;">
- 批次号:{{product.lotCode}}
- <view style="margin-left: 30px;">工艺版本:{{product.technologyVersion}}</view>
- </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; display: inline-block; line-height: 35px; height: 35px;">
- <view>工序:</view>
- <uni-data-select v-model="curSelectedProcessCode" :localdata="selectedProcessList" :clear="false"
- @change="handleSelectedChange" style="font-size: 20rpx;"></uni-data-select>
- </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 v-if="drawingList.length > 0" :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 v-else style="width: 100%; text-align: center;margin-top: 12px;">暂无图纸</view>
- </view>
- </view>
- </template>
- <script setup>
- 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 selectedProcessList = ref([]);
- const curSelectedProcessCode = ref("");
- const processAlias = ref("")
- onLoad((options) => {
- console.log(options, 1111)
- technologicalProcessId.value = options.param4
- lotCode.value = options.param2
- productId.value = options.param1
- processCode.value = options.param3
- 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
- }))
- // selectedProcessList.value.push({
- // text: '分选-直径Φ13.04(杠杆千',
- // value: '30492'
- // })
- if (!selectedProcessList.value.some(v => v.value == processCode.value)) {
- selectedProcessList.value.push({
- text: processAlias.value,
- value: processCode.value
- })
- }
- 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
- product.value.lotCode = lotCode.value
- product.value.processAlias = processAlias.value
- 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) {
- // 检查 filteredProcess 是否有元素,并选择第一个元素
- 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">
- .container {
- height: 100%;
- background-color: #f5f5f5;
- }
- .middle {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- margin-top: 20rpx;
- }
- .scroll-container {
- position: absolute;
- top: 24rpx;
- right: 0;
- bottom: 160rpx;
- left: 0;
- }
- .segment {
- width: 280rpx;
- background-color: rgba(213, 213, 213, 1);
- border: 1rpx solid rgba(213, 213, 213, 1);
- }
- .selected {
- border: 1px solid #1684fc;
- }
- .margenTop {
- margin: 20rpx;
- }
- .list-item {
- background-color: #fff;
- position: relative;
- padding: 16rpx;
- padding-bottom: 24rpx;
- margin: 0 24rpx;
- margin-bottom: 24rpx;
- border-radius: 8rpx;
- .title-container {
- justify-content: space-between;
- margin-top: 8rpx;
- margin-bottom: 16rpx;
- .title {
- height: 48rpx;
- align-items: center;
- .label {
- color: #1684fc;
- font-size: 32rpx;
- font-weight: bold;
- &.code {
- color: #000000;
- margin-left: 32rpx;
- }
- }
- }
- }
- .item-info {
- margin-bottom: 16rpx;
- .label {
- font-size: 28rpx;
- width: 152rpx;
- color: #808080;
- &.right {
- flex: 1;
- color: #808080;
- }
- }
- }
- .right-info {
- justify-content: flex-end;
- margin-top: 2rpx;
- .label {
- font-size: 28rpx;
- color: #ff0000;
- }
- }
- }
- .bottom {
- position: fixed;
- right: 0;
- bottom: 0;
- left: 0;
- height: 100rpx;
- padding: 16rpx 24rpx;
- align-items: center;
- background-color: #FFFFFF;
- justify-content: space-between;
- .bottom-btn {
- flex: 1;
- font-size: 28rpx;
- color: #FFFFFF;
- &.left-btn {
- background-color: #1684fc;
- }
- &.right-btn {
- background-color: rgb(255, 121, 1);
- margin-left: 24rpx;
- }
- }
- }
- </style>
|