| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <template>
- <div v-if="redDocument != undefined" class="container-fluid">
- <stockInLineInstanceBlue v-if="!redDocument" :stock-in-id="stockInId" />
- <stockInLineInstanceRed v-if="redDocument" :stock-in-id="stockInId" />
- </div>
- </template>
- <script>
- import stockInLineInstanceBlue from './StockInLineInstanceBlue.vue';
- import stockInLineInstanceRed from './StockInLineInstanceRed.vue';
- import Common from '../common/Common.js';
- import { UserStorageResource } from 'pc-component-v3';
- export default {
- components: {
- stockInLineInstanceBlue,
- stockInLineInstanceRed,
- },
- data: function () {
- return {
- redDocument: undefined,
- stockInId: undefined,
- };
- },
- mounted: function () {
- var uuid = this.$route.params.uuid;
- UserStorageResource.uniqueByKey(uuid + '_modelData').then(
- str => {
- // if(str.errorCode != 0) {
- // Notify.error('提示', str.errorMessage, false);
- // return;
- // }
- if (str.data != null) {
- console.log(str.data);
- var modelData = JSON.parse(str.data);
- this.stockInId = modelData.id;
- this.getDocumentType();
- }
- },
- errorData => {
- Common.processException(errorData);
- },
- );
- },
- methods: {
- getDocumentType: function () {
- var _self = this;
- $.ajax({
- type: 'get',
- url: Common.getApiURL(
- 'stockInResource/uniqueIsRedByStockInId?stockInId=' + _self.stockInId,
- ),
- beforeSend: function (request) {
- Common.addTokenToRequest(request);
- },
- success: function (data) {
- _self.redDocument = data;
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- Common.processException(XMLHttpRequest, textStatus, errorThrown);
- },
- });
- },
- },
- };
- </script>
|