剩余模块:生产入库,销售出库

This commit is contained in:
2025-05-20 14:40:44 +08:00
parent 14a5fa371b
commit 933ddab8f3
68 changed files with 8868 additions and 13081 deletions

View File

@@ -5,37 +5,38 @@
<view class="data-item" :style="[{'background-color':'#ffffff'}]">
<view class="dataText">
<view class="itemBox">
<view>生产订单</view>
<view>{{ t('index.scdd') }}</view>
<view class="zongjian"></view>
<view>{{ state.FBillNo }}</view>
</view>
<view class="timebox">
<view>开始生产时间</view>
<uni-datetime-picker hasInput :show="state.FStartProTimeShow" v-model="state.FStartProTimes" :visibleItemCount="3" disabled
mode="datetime"></uni-datetime-picker>
<view>{{ t('index.ksscsj') }}</view>
<view class="zongjian"></view>
<view>{{ state.FStartProTimes }}</view>
</view>
<view class="timebox">
<view>开始测试时间</view>
<uni-datetime-picker hasInput :show="state.FProTestTimeShow" v-model="state.FProTestTimes" :visibleItemCount="3" disabled
mode="datetime"></uni-datetime-picker>
<view>{{ t('index.kscssj') }}</view>
<view class="zongjian"></view>
<view>{{ state.FProTestTimes }}</view>
</view>
<view class="timebox">
<view>开始汇报时间</view>
<uni-datetime-picker hasInput :show="state.FProReportTimeShow" v-model="state.FProReportTimes" :visibleItemCount="3" disabled
mode="datetime"></uni-datetime-picker>
<view>{{ t('index.kshbsj') }}</view>
<!-- <uni-datetime-picker hasInput :show="state.FProReportTimeShow" v-model="state.FProReportTimes"
:visibleItemCount="3" disabled mode="datetime"></uni-datetime-picker> -->
<view class="zongjian"></view>
<view>{{ state.FProReportTimes }}</view>
</view>
<view class="timebox" v-if="state.type === '1'">
<view>开始投产个数</view>
<up-input placeholder="请输入开始投产个数" clearable inputmode="numeric" v-memo="state.qty"></up-input>
<view class="timebox">
<view>{{ t('index.scsl') }}</view>
<up-input :placeholder="t('index.scsl')" clearable inputmode="numeric" v-model="state.qty"
:disabled="state.type !== '2'"></up-input>
</view>
</view>
<view class="btnList">
<up-button v-show="state.type === '1'" class="btnItem" type="primary" shape="circle"
@click="PRD_MOPushIntoProFun"
text="确认"></up-button>
@click="PRD_MOPushIntoProFun()" :text="t('public.confirm')"></up-button>
<up-button v-show="state.type !== '1'" class="btnItem" type="primary" shape="circle"
@click="PRD_MORPTSaveFun"
text="确认"></up-button>
@click="PRD_MORPTSaveFun()" :text="t('public.confirm')"></up-button>
</view>
</view>
</view>
@@ -48,6 +49,9 @@
import { PRD_MOEnterIntoPro, PRD_MOPushIntoPro, PRD_MORPTSave, PRD_MOViewIntoPro } 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: '',
@@ -60,80 +64,101 @@
FProReportTimes: '',//开始汇报时间
EnterIntoProData: {},
type: '',
qty:''
qty: ''
})
onShow(() => {
let pageData = pageDataInfoCom.userInfos
console.log(pageData);
state.EnterIntoProData = pageData
state.id = pageData.FID
state.id = pageData.Entry[0].Id
state.FBillNo = pageData.FBillNo
state.type = pageData.type
if (state.type === '1') state.qty = pageData.Entry[0].Qty
if (state.type === '3') state.qty = pageData.Entry[0].TestQty
if (state.type === '2') state.qty = pageData.Entry[0].ReportQty
if (state.type === '1' && state.FStartProTimes == '') {
state.FStartProTimes = timeFormat(pageData.time, 'yyyy-mm-dd hh:MM:ss')
}
if(pageData.FStartProTimes !== ''){
state.FStartProTimes = pageData.FStartProTimes
if (pageData.FStartProTimes !== '') {
state.FStartProTimes = pageData.FStartProTimes.replace("T", " ")
}
if (state.type === '2' && state.FProReportTimes == '') {
state.FProReportTimes = timeFormat(pageData.time, 'yyyy-mm-dd hh:MM:ss')
}
if(pageData.FProReportTimes !== ''){
state.FProReportTimes = pageData.FProReportTimes
if (pageData.FProReportTimes !== '') {
state.FProReportTimes = pageData.FProReportTimes.replace("T", " ")
}
if (state.type === '3' && state.FProTestTimes == '') {
state.FProTestTimes = timeFormat(pageData.time, 'yyyy-mm-dd hh:MM:ss')
}
if(pageData.FProTestTimes !== ''){
state.FProTestTimes = pageData.FProTestTimes
if (pageData.FProTestTimes !== '') {
state.FProTestTimes = pageData.FProTestTimes.replace("T", " ")
}
})
const titleText = () => {
if(state.type === '1') return '开始生产'
if(state.type === '2') return '开始汇报'
if(state.type === '3') return '开始测试'
if (state.type === '1') return t('index.kssc')
if (state.type === '3') return t('index.kscs')
if (state.type === '2') return t('index.kshb')
}
const PRD_MORPTSaveFun = () => {
PRD_MOViewIntoPro({
Number:state.FBillNo
}).then((res:any) => {
if(res.code === 200){
if(res.data.FRPFID !== ''){
PRD_MORPTSave({
Model:JSON.stringify({
FID:res.data.FRPFID,
FStartProTimes:state.FStartProTimes,
FProTestTimes:state.FProTestTimes,
FProReportTimes:state.FProReportTimes,
Number: state.FBillNo
}).then((res : any) => {
if (res.code === 200) {
if (res.data.FRPFID !== '') {
let obj1 = {
Model: JSON.stringify({
FID: res.data.FRPFID,
FStartProTimes: state.FStartProTimes,
FProTestTimes: state.FProTestTimes,
})
}).then((resItem:any) => {
if(resItem.code === 200){
uni.$u.toast('操作成功')
}
let obj2 = {
Model: JSON.stringify({
FID: res.data.FRPFID,
FStartProTimes: state.FStartProTimes,
FProTestTimes: state.FProTestTimes,
FProReportTimes: state.FProReportTimes,
FEntity: [{ FEntryID: res.data.Entry[0].FRPFENTRYID, FQuaQty: Number(state.qty) }]
})
}
PRD_MORPTSave(state.type === '3' ? obj1 : obj2).then((resItem : any) => {
if (resItem.code === 200) {
// uni.$u.toast(t('public.cg'))
if(state.type === '2'){
toPages('/pages/putInProd/print',state.EnterIntoProData)
}
}
})
} else {
uni.$u.toast('请先进行生产')
uni.$u.toast(t('index.qxjxsc'))
}
}
})
}
const PRD_MOPushIntoProFun = () => {
if (state.qty === '' || Number(state.qty) === 0) {
uni.$u.toast(t('index.slbnwk'))
return
}
PRD_MOPushIntoPro({
EntryIds: state.id + '',
EntryIds: state.id,
TargetFormId: "PRD_MORPT",
IsEnableDefaultRule: "true",
CustomParams: {
ScanEntry: [
{
FStartProTimes: state.FStartProTimes,
FENTRYID: state.id + '',
FENTRYID: state.id,
Qty: Number(state.qty)
}
]
}
}).then((res : any) => {
if(res.code === 200){
uni.$u.toast('操作成功')
if (res.code === 200) {
uni.$u.toast(t('public.cg'))
}
})
}
@@ -145,12 +170,19 @@
}
return val[0].Value;
}
const toPages = (url : string, data : any = {}) => {
uni.$u.route({
url: url,
params: data
})
}
</script>
<style lang="scss" scoped>
:deep(.uni-date__x-input){
color: black !important;
:deep(.uni-date__x-input) {
color: black !important;
}
.app {
background-color: #F5F5F5;
@@ -192,6 +224,7 @@
justify-content: space-between;
align-items: center;
margin-bottom: 32rpx;
.zongjian {
height: 1px;
flex: 1;