158 lines
4.0 KiB
Vue
Raw Normal View History

<template>
<view class="app status-bar-gap">
<view class="page">
<l-header :title="state.FBillNo" sticky></l-header>
<view class="data-item" :style="[{'background-color':'#ffffff'}]">
<view class="dataText">
<view class="itemBox">
<view>{{ t('index.cpmc') }}</view>
<view class="zongjian"></view>
<view>{{ formatLangTextValue(state.viewData.MaterialName) }}</view>
</view>
<view class="itemBox">
<view>{{ t('index.scdd') }}</view>
<view class="zongjian"></view>
<view>{{ state.FBillNo }}</view>
</view>
<view class="itemBox">
<view>{{ t('index.cpbm') }}</view>
<view class="zongjian"></view>
<view>{{ state.viewData.MaterialNumber }}</view>
</view>
<view class="itemBox">
<view>{{ t('public.qty') }}</view>
<view class="zongjian"></view>
<view>{{ state.viewData.Qty }}</view>
</view>
<view class="itemBox">
<view>{{ t('index.llts') }}</view>
<view class="zongjian"></view>
<view style="width: 50%;">
<up-input :placeholder="t('index.llts')" clearable inputAlign="right" inputmode="numeric"
@change="quantityStrChange" v-model="state.quantityStr">
</up-input>
</view>
</view>
</view>
<view class="btnList">
<up-button class="btnItem" type="primary" shape="circle" :text="t('public.confirm')" @click="WholeSetPushFun"></up-button>
</view>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { reactive, nextTick, onMounted, ref, computed, watch } from 'vue';
import { onLoad, onShow, onReachBottom, } from '@dcloudio/uni-app'
import { PRD_MOEnterIntoPro, PRD_MOPushIntoPro, PRD_MORPTSave, PRD_MOView, PRD_MOViewIntoPro, WholeSetPush, WholeSetView } from '../../common/request/api/api';
import { timeFormat } from '@/uni_modules/uview-plus';
import { pageDataInfo } from '../../stores/info.js';
import { useI18n } from 'vue-i18n'
const getI18n = useI18n()
const { t, locale } = getI18n
const pageDataInfoCom = pageDataInfo()
const state = reactive({
id: '',
FBillNo: '',
quantityStr: '',//开始汇报时间
viewData: {}
})
onLoad((pageData : any) => {
state.id = pageData.id
state.FBillNo = pageData.fBillNo
getPRD_MOViewFun()
})
const quantityStrChange = (e : any) => {
if (Number(state.viewData.Qty) < Number(e)) {
uni.$u.toast(t('index.llthbddy'))
}
}
const WholeSetPushFun = () => {
WholeSetPush({
FBillNo:state.FBillNo,
SetsQty:state.quantityStr
}).then((res:any) => {
if(res.code === 200){
uni.$u.toast(t('public.cg'))
}
})
}
//获取详情数据
const getPRD_MOViewFun = () => {
WholeSetView({ Id: state.id }).then((res : any) => {
if (res.code === 200) {
state.viewData = res.data.Entry[0]
}
})
}
const formatLangTextValue = (val : any) => {
if (!val || !Array.isArray(val)) { // 检查 val 是否存在且为数组
return ''; // 返回默认值或空字符串
}
let lang_Id = uni.getStorageSync('locale');
let item = val.find((p : any) => p.Key === (lang_Id === 'cn' ? 2052 : 1033));
return item ? item.Value : (val[0]?.Value || '');
};
</script>
<style lang="scss" scoped>
:deep(.uni-date__x-input) {
color: black !important;
}
.app {
background-color: #F5F5F5;
.page {
padding: 18px 32rpx;
display: flex;
flex-direction: column;
height: 100%;
flex: 1;
.data-item {
border: 1px solid #efeaea;
border-radius: 20rpx;
padding: 20rpx 22rpx;
background-color: #ffffff;
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
.btnList {
display: flex;
margin-bottom: 32rpx;
.btnItem {
width: 40%;
}
}
.timebox {
display: flex;
align-items: center;
margin-top: 32rpx;
}
.itemBox {
line-height: 50rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 32rpx;
.zongjian {
height: 1px;
flex: 1;
background-color: #f0f0f0;
margin: 0 16rpx;
}
}
}
}
}
</style>