123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- <template>
- <view>
- <uni-section title="">
- <view class="example">
- <uni-forms ref="form" :modelValue="item" labelWidth="80px" :rules="rules">
- <uni-forms-item label="装箱单号" name="FBillNo">
- <uni-easyinput v-model="item['FENCHASENUM.LT']" disabled>
- </uni-easyinput>
- </uni-forms-item>
-
- <uni-forms-item label="调拨数量" name="FQty" >
- <uni-easyinput v-model="item['FQty']"/>
- </uni-forms-item>
-
- </uni-forms>
- <button type="primary" @click="submit()">确认</button>
- </view>
- </uni-section>
- </view>
- </template>
- <script>
- import {
- getInfoByBarcode,
- getStockInfo
- } from '../../api/production_replenishment';
- import {
- playVoice,
- audioUrls
- } from '@/utils/audio.js'
- import modal from '../../uni_modules/uview-ui/libs/config/props/modal';
- export default {
- onLoad(option) {
- this.formId = uni.getStorageSync("formId")
- const item = JSON.parse(decodeURIComponent(option.item))
- const index = JSON.parse(decodeURIComponent(option.index))
- console.log(item)
- console.log(index)
- this.item = item
- this.index = index
- },
- data() {
- return {
- formId: '',
- item: {},
- index: '',
- isReplace: false,
- rules: {
- FActualQty: {
- rules: [{
- required: true,
- errorMessage: '请输入实发数量',
- },
- ]
- },
- FQty: {
- rules: [{
- required: true,
- errorMessage: '请输入实发数量',
- },
- ]
- },
- FRMREALQTY: {
- rules: [{
- required: true,
- errorMessage: '请输入实际作业数量',
- },
- ]
- },
- },
- };
- },
- computed: {
-
- },
- methods: {
- handleError(error) {
- playVoice(audioUrls.failVoiceUrl)
- console.error('操作失败:', error);
- modal.confirm(error).then(res => {
- if (res) {} else {}
- })
- },
- submit() {
- console.log(this.item)
- this.$refs.form.validate().then(res => {
-
-
- this.item["index"] = this.index
- let self = this
- uni.navigateBack({
- success: function() {
- // 传递数据给上一页
- uni.$emit('item', self.item);
- }
- });
- }).catch(err => {
- console.log(err);
- })
- },
- }
- };
- </script>
- <style>
- /deep/ .is-disabled {
- background-color: #ffffff !important;
- color: #0d0d0d !important;
- }
- .example {
- padding-left: 10px;
- padding-right: 10px;
- background-color: #fff;
- }
- .segmented-control {
- margin-bottom: 15px;
- }
- .button-group {
- margin-top: 15px;
- display: flex;
- justify-content: space-around;
- }
- .form-item {
- display: flex;
- align-items: center;
- }
- .button {
- display: flex;
- align-items: center;
- height: 35px;
- margin-left: 10px;
- }
- </style>
|