|
@@ -1,112 +1,136 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div>
|
|
<div>
|
|
|
- <div class=" flex-container">
|
|
|
|
|
- <div class=" flex-header">
|
|
|
|
|
|
|
+ <div class="flex-container">
|
|
|
|
|
+ <!-- 头部搜索区域 -->
|
|
|
|
|
+ <div class="flex-header">
|
|
|
<StockOutPrepareTemplateHeader active-index="1" />
|
|
<StockOutPrepareTemplateHeader active-index="1" />
|
|
|
- <div class="form-inline">
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label for="projectItem">
|
|
|
|
|
- <span class="text-danger">
|
|
|
|
|
- *
|
|
|
|
|
- </span>
|
|
|
|
|
- 项目事件
|
|
|
|
|
- </label>
|
|
|
|
|
- <select id="projectItem" class="form-control" />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label for="warehouse">
|
|
|
|
|
- <span class="text-danger">
|
|
|
|
|
- *
|
|
|
|
|
- </span>
|
|
|
|
|
- 仓库
|
|
|
|
|
- </label>
|
|
|
|
|
- <select id="warehouse" class="form-control" />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <label for="stockOutPrepateTemplate">
|
|
|
|
|
- <span class="text-danger">
|
|
|
|
|
- *
|
|
|
|
|
- </span>
|
|
|
|
|
- 需求模板
|
|
|
|
|
- </label>
|
|
|
|
|
- <select id="stockOutPrepateTemplate" class="form-control" />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group">
|
|
|
|
|
- <button type="button" class="btn btn-primary" @click="queryLines">查询</button>
|
|
|
|
|
- <button type="button" class="btn btn-info" @click="clear">清空</button>
|
|
|
|
|
- <button type="button" class="btn btn-success" @click="save">确定领料</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <a-form layout="inline" class="search-form">
|
|
|
|
|
+ <a-form-item label="项目事件">
|
|
|
|
|
+ <a-select
|
|
|
|
|
+ v-model:value="projectItemId"
|
|
|
|
|
+ style="width: 220px"
|
|
|
|
|
+ show-search
|
|
|
|
|
+ allow-clear
|
|
|
|
|
+ @change="handleProjectItemChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-select-option
|
|
|
|
|
+ v-for="item in projectItems"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="仓库">
|
|
|
|
|
+ <a-select
|
|
|
|
|
+ v-model:value="warehouseId"
|
|
|
|
|
+ style="width: 220px"
|
|
|
|
|
+ allow-clear
|
|
|
|
|
+ @change="handleWarehouseChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-select-option
|
|
|
|
|
+ v-for="item in warehouses"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item label="需求模板">
|
|
|
|
|
+ <a-select
|
|
|
|
|
+ v-model:value="stockOutPrepateTemplateId"
|
|
|
|
|
+ style="width: 220px"
|
|
|
|
|
+ show-search
|
|
|
|
|
+ allow-clear
|
|
|
|
|
+ @change="handleTemplateChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-select-option
|
|
|
|
|
+ v-for="item in stockOutPrepateTemplateNames"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ {{ item.name }}
|
|
|
|
|
+ </a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ <a-form-item>
|
|
|
|
|
+ <a-button @click="queryLines">查询</a-button>
|
|
|
|
|
+ <a-button @click="clear">清空</a-button>
|
|
|
|
|
+ <a-button type="primary" @click="save">确定领料</a-button>
|
|
|
|
|
+ </a-form-item>
|
|
|
|
|
+ </a-form>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class=" flex-content">
|
|
|
|
|
- <table class="fixed-table table table-responsive table-bordered">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td style="width: 150px;">物料编码</td>
|
|
|
|
|
- <td style="width: 200px;">物料名称</td>
|
|
|
|
|
- <td style="width: 150px;">规格型号</td>
|
|
|
|
|
- <td style="width: 120px;">库存数量</td>
|
|
|
|
|
- <td style="width: 150px;">待出库数量</td>
|
|
|
|
|
- <td style="width: 150px;">可领用数量</td>
|
|
|
|
|
- <td style="width: 120px;">需求数量</td>
|
|
|
|
|
- <td style="width: 120px;">领用数量</td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody v-if="pageStockOutPrepateTemplates.length>0">
|
|
|
|
|
- <tr v-for="item in pageStockOutPrepateTemplates" :key="item.inventoryId" :class="{'danger' : item.currentStockCanPickQuantity < item.pickQuantity}">
|
|
|
|
|
- <td>{{ item.inventoryNo }}</td>
|
|
|
|
|
- <td>{{ item.inventoryName }}</td>
|
|
|
|
|
- <td>{{ item.inventoryType }}</td>
|
|
|
|
|
- <td>{{ item.currentStockQuantity }}</td>
|
|
|
|
|
- <td>{{ item.currentStockOutQuantity }}</td>
|
|
|
|
|
- <td>{{ item.currentStockCanPickQuantity }}</td>
|
|
|
|
|
- <td>{{ item.quantity }}</td>
|
|
|
|
|
- <td><input v-model="item.pickQuantity" autocomplete="off" type="number" class="form-control" placeholder="领料数量" aria-describedby="basic-addon1" /></td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
|
|
+ <!-- 表格区域 -->
|
|
|
|
|
+ <div class="flex-content">
|
|
|
|
|
+ <a-table
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :data-source="pageStockOutPrepateTemplates"
|
|
|
|
|
+ :pagination="pagination"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ @change="handleTableChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #bodyCell="{ column, record }">
|
|
|
|
|
+ <template v-if="column.dataIndex === 'pickQuantity'">
|
|
|
|
|
+ <a-input-number
|
|
|
|
|
+ v-model:value="record.pickQuantity"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :max="record.currentStockCanPickQuantity"
|
|
|
|
|
+ @change="handlePickQuantityChange(record)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </a-table>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class=" flex-footer">
|
|
|
|
|
|
|
+ <!-- 分页信息区域 -->
|
|
|
|
|
+ <div class="flex-footer">
|
|
|
<div class="pull-left">
|
|
<div class="pull-left">
|
|
|
- <span>第{{ (pagination.current_page-1)*pagination.per_page+1 }}-{{ pagination.current_page*pagination.per_page }}条,共计{{ pagination.total }}条,每页显示</span>
|
|
|
|
|
- <PageSizeSelect @page-size-changed="gridSizeSelect" />
|
|
|
|
|
|
|
+ <span>
|
|
|
|
|
+ 第{{ (pagination.current - 1) * pagination.pageSize + 1 }}-{{ pagination.current * pagination.pageSize }}条,
|
|
|
|
|
+ 共计{{ pagination.total }}条,
|
|
|
|
|
+ 每页显示
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <a-select
|
|
|
|
|
+ v-model:value="pagination.pageSize"
|
|
|
|
|
+ style="width: 80px"
|
|
|
|
|
+ @change="gridSizeSelect"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a-select-option value="10">10</a-select-option>
|
|
|
|
|
+ <a-select-option value="20">20</a-select-option>
|
|
|
|
|
+ <a-select-option value="50">50</a-select-option>
|
|
|
|
|
+ </a-select>
|
|
|
<span>条</span>
|
|
<span>条</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="pull-right">
|
|
<div class="pull-right">
|
|
|
- <VueBootstrapPagination v-if="pagination.last_page > 0" :pagination="pagination" :callback="getDatas" />
|
|
|
|
|
|
|
+ <a-pagination
|
|
|
|
|
+ v-if="pagination.total > 0"
|
|
|
|
|
+ :current="pagination.current"
|
|
|
|
|
+ :page-size="pagination.pageSize"
|
|
|
|
|
+ :total="pagination.total"
|
|
|
|
|
+ @change="getDatas"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <!-- 加载状态 -->
|
|
|
<div>
|
|
<div>
|
|
|
- <Loading v-if="loading" />
|
|
|
|
|
|
|
+ <a-spin v-if="loading" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import Common from '../common/Common.js';
|
|
import Common from '../common/Common.js';
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
import StockOutPrepareResource from '../api/wms/StockOutPrepareResource.js';
|
|
import StockOutPrepareResource from '../api/wms/StockOutPrepareResource.js';
|
|
|
import StockOutPrepateTemplateResource from '../api/wms/StockOutPrepateTemplateResource.js';
|
|
import StockOutPrepateTemplateResource from '../api/wms/StockOutPrepateTemplateResource.js';
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
import StockOutPrepareTemplateHeader from './StockOutPrepareTemplateHeader.vue';
|
|
import StockOutPrepareTemplateHeader from './StockOutPrepareTemplateHeader.vue';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
StockOutPrepareTemplateHeader,
|
|
StockOutPrepareTemplateHeader,
|
|
|
},
|
|
},
|
|
|
- data: function() {
|
|
|
|
|
|
|
+ data() {
|
|
|
return {
|
|
return {
|
|
|
stockOutPrepateTemplates: [],
|
|
stockOutPrepateTemplates: [],
|
|
|
pageStockOutPrepateTemplates: [],
|
|
pageStockOutPrepateTemplates: [],
|
|
@@ -115,40 +139,65 @@ export default {
|
|
|
projectItemId: undefined,
|
|
projectItemId: undefined,
|
|
|
pagination: {
|
|
pagination: {
|
|
|
total: 0,
|
|
total: 0,
|
|
|
- per_page: Common.pageSize, // required
|
|
|
|
|
- current_page: 1, // required
|
|
|
|
|
- last_page: 0, // required
|
|
|
|
|
|
|
+ pageSize: Common.pageSize,
|
|
|
|
|
+ current: 1,
|
|
|
},
|
|
},
|
|
|
- hot: '',
|
|
|
|
|
- count: 0,
|
|
|
|
|
- storageLife: undefined,
|
|
|
|
|
- checked: false,
|
|
|
|
|
- page: 20,
|
|
|
|
|
- length: undefined,
|
|
|
|
|
- start: undefined,
|
|
|
|
|
- stockOutPrepateTemplateName:'',
|
|
|
|
|
- warehouseName: '',
|
|
|
|
|
- projectItemName: '',
|
|
|
|
|
- projectItems:[],
|
|
|
|
|
- warehouses:[],
|
|
|
|
|
- stockOutPrepateTemplateNames:[],
|
|
|
|
|
|
|
+ projectItems: [],
|
|
|
|
|
+ warehouses: [],
|
|
|
|
|
+ stockOutPrepateTemplateNames: [],
|
|
|
loading: false,
|
|
loading: false,
|
|
|
-
|
|
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ columns() {
|
|
|
|
|
+ return [
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'inventoryNo',
|
|
|
|
|
+ title: '物料编码',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'inventoryName',
|
|
|
|
|
+ title: '物料名称',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'inventoryType',
|
|
|
|
|
+ title: '规格型号',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'currentStockQuantity',
|
|
|
|
|
+ title: '库存数量',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'currentStockOutQuantity',
|
|
|
|
|
+ title: '待出库数量',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'currentStockCanPickQuantity',
|
|
|
|
|
+ title: '可领用数量',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'quantity',
|
|
|
|
|
+ title: '需求数量',
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ dataIndex: 'pickQuantity',
|
|
|
|
|
+ title: '领用数量',
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
+ },
|
|
|
|
|
+ },
|
|
|
watch: {
|
|
watch: {
|
|
|
- 'page': function(curVal, oldVal) {
|
|
|
|
|
- if(curVal != undefined) {
|
|
|
|
|
|
|
+ 'pagination.pageSize': function (curVal, oldVal) {
|
|
|
|
|
+ if (curVal !== undefined) {
|
|
|
this.getDatas();
|
|
this.getDatas();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- created: function() {
|
|
|
|
|
- if(!window.localStorage) {
|
|
|
|
|
|
|
+ created() {
|
|
|
|
|
+ if (!window.localStorage) {
|
|
|
alert('浏览器不支持localstorage');
|
|
alert('浏览器不支持localstorage');
|
|
|
} else {
|
|
} else {
|
|
|
- var storage = window.localStorage;
|
|
|
|
|
|
|
+ const storage = window.localStorage;
|
|
|
this.warehouseId = storage.getItem('warehouseId');
|
|
this.warehouseId = storage.getItem('warehouseId');
|
|
|
this.warehouseName = storage.getItem('warehouseName');
|
|
this.warehouseName = storage.getItem('warehouseName');
|
|
|
this.projectItemId = storage.getItem('projectItemId');
|
|
this.projectItemId = storage.getItem('projectItemId');
|
|
@@ -156,520 +205,271 @@ export default {
|
|
|
this.stockOutPrepateTemplateId = storage.getItem('stockOutPrepateTemplateId');
|
|
this.stockOutPrepateTemplateId = storage.getItem('stockOutPrepateTemplateId');
|
|
|
this.stockOutPrepateTemplateName = storage.getItem('stockOutPrepateTemplateName');
|
|
this.stockOutPrepateTemplateName = storage.getItem('stockOutPrepateTemplateName');
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- mounted: function() {
|
|
|
|
|
|
|
+ mounted() {
|
|
|
this.loadSelectProjectItem();
|
|
this.loadSelectProjectItem();
|
|
|
this.loadSelectWarehouse();
|
|
this.loadSelectWarehouse();
|
|
|
this.loadSelectTemplate();
|
|
this.loadSelectTemplate();
|
|
|
- if (this.warehouseId != null) {
|
|
|
|
|
- var warehouse = new Option(this.warehouseName, this.warehouseId);
|
|
|
|
|
- $('#warehouse').append(warehouse);
|
|
|
|
|
- }
|
|
|
|
|
- if (this.projectItemId != null) {
|
|
|
|
|
- var projectItem = new Option(this.projectItemName, this.projectItemId);
|
|
|
|
|
- $('#projectItem').append(projectItem);
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- if (this.stockOutPrepateTemplateId != null) {
|
|
|
|
|
- var stockOutPrepateTemplate = new Option(this.stockOutPrepateTemplateName, this.stockOutPrepateTemplateId);
|
|
|
|
|
- $('#stockOutPrepateTemplate').append(stockOutPrepateTemplate);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $('.fixed-table').tableFixer({'left' : 2,'head':true});
|
|
|
|
|
-
|
|
|
|
|
- $('.fixed-table').colResizable({
|
|
|
|
|
- resizeMode: 'overflow',
|
|
|
|
|
- partialRefresh: true,
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 项目事件
|
|
|
|
|
- */
|
|
|
|
|
- loadSelectProjectItem: function() {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- $('#projectItem').select2({
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- //data: _self.data,
|
|
|
|
|
- theme: 'bootstrap',
|
|
|
|
|
- placeholder: '项目事件',
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- placeholderOption: 'first',
|
|
|
|
|
- quietMillis: 250,
|
|
|
|
|
- allowClear: true,
|
|
|
|
|
- language: 'zh-CN',
|
|
|
|
|
- width: 'resolve',
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- ajax: {
|
|
|
|
|
- url: function(params) {
|
|
|
|
|
- return Common.getApiURL('ProjectItemResource/queryByCondition');
|
|
|
|
|
- },
|
|
|
|
|
- dataType: 'json',
|
|
|
|
|
- type: 'get',
|
|
|
|
|
- delay: 250,
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- transport: function(params, success, failure) {
|
|
|
|
|
- params.beforeSend = Common.addTokenToRequest;
|
|
|
|
|
- var $request = $.ajax(params);
|
|
|
|
|
- $request.then(success);
|
|
|
|
|
- $request.fail(failure);
|
|
|
|
|
- return $request;
|
|
|
|
|
- },
|
|
|
|
|
- data: function(params) {
|
|
|
|
|
- return {
|
|
|
|
|
- 'name': params.term,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- processResults: function(data, params) {
|
|
|
|
|
- if(data.errorCode == 0) {
|
|
|
|
|
- var more = (params * 10) <= data.datas.length;
|
|
|
|
|
- for(var i = 0; i < data.datas.length; i++) {
|
|
|
|
|
- data.datas[i].text = data.datas[i].name;
|
|
|
|
|
- }
|
|
|
|
|
- _self.projectItems = data.datas;
|
|
|
|
|
- return {
|
|
|
|
|
- results: data.datas,
|
|
|
|
|
- more: more,
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- }).on('change', function() {
|
|
|
|
|
- if($(this).val() == null) {
|
|
|
|
|
- _self.projectItemId = undefined;
|
|
|
|
|
- var storage = window.localStorage;
|
|
|
|
|
- storage.setItem('projectItemId', _self.projectItemId);
|
|
|
|
|
- _self.projectItemName = '';
|
|
|
|
|
- storage.setItem('projectItemName', _self.projectItemName);
|
|
|
|
|
- _self.clear();
|
|
|
|
|
- } else {
|
|
|
|
|
- _self.projectItemId = $(this).val();
|
|
|
|
|
- for (var i = 0; i < _self.projectItems.length; i++) {
|
|
|
|
|
- if (_self.projectItems[i].id == _self.projectItemId) {
|
|
|
|
|
- _self.projectItemName = _self.projectItems[i].name;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 加载项目事件选项
|
|
|
|
|
+ loadSelectProjectItem() {
|
|
|
|
|
+ const _self = this;
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: Common.getApiURL('ProjectItemResource/queryByCondition'),
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ type: 'get',
|
|
|
|
|
+ data: { name: '' },
|
|
|
|
|
+ beforeSend: Common.addTokenToRequest,
|
|
|
|
|
+ success(data) {
|
|
|
|
|
+ if (data.errorCode === 0) {
|
|
|
|
|
+ _self.projectItems = data.datas;
|
|
|
}
|
|
}
|
|
|
- _self.clear();
|
|
|
|
|
- storage.setItem('projectItemId', _self.projectItemId);
|
|
|
|
|
- storage.setItem('projectItemName', _self.projectItemName);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ error(errorData) {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 仓库
|
|
|
|
|
- */
|
|
|
|
|
- loadSelectWarehouse: function() {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- var storage = window.localStorage;
|
|
|
|
|
- $('#warehouse').select2({
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- //data: _self.data,
|
|
|
|
|
- theme: 'bootstrap',
|
|
|
|
|
- placeholder: '仓库',
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- placeholderOption: 'first',
|
|
|
|
|
- quietMillis: 250,
|
|
|
|
|
- allowClear: true,
|
|
|
|
|
- language: 'zh-CN',
|
|
|
|
|
- width: 'resolve',
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- ajax: {
|
|
|
|
|
- url: function(params) {
|
|
|
|
|
- return Common.getApiURL('WarehouseResource/queryByCondition');
|
|
|
|
|
- },
|
|
|
|
|
- dataType: 'json',
|
|
|
|
|
- type: 'get',
|
|
|
|
|
- delay: 250,
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- transport: function(params, success, failure) {
|
|
|
|
|
- params.beforeSend = Common.addTokenToRequest;
|
|
|
|
|
- var $request = $.ajax(params);
|
|
|
|
|
- $request.then(success);
|
|
|
|
|
- $request.fail(failure);
|
|
|
|
|
- return $request;
|
|
|
|
|
- },
|
|
|
|
|
- data: function(params) {
|
|
|
|
|
- return {
|
|
|
|
|
- 'name': params.term,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- processResults: function(data, params) {
|
|
|
|
|
- if(data.errorCode == 0) {
|
|
|
|
|
- var more = (params * 10) <= data.datas.length;
|
|
|
|
|
- for(var i = 0; i < data.datas.length; i++) {
|
|
|
|
|
- data.datas[i].text = data.datas[i].name;
|
|
|
|
|
- }
|
|
|
|
|
- _self.warehouses = data.datas;
|
|
|
|
|
- return {
|
|
|
|
|
- results: data.datas,
|
|
|
|
|
- more: more,
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- }).on('change', function() {
|
|
|
|
|
- if($(this).val() == null) {
|
|
|
|
|
- _self.warehouseId = undefined;
|
|
|
|
|
- _self.warehouseName = '';
|
|
|
|
|
- storage.setItem('warehouseId', _self.warehouseId);
|
|
|
|
|
- storage.setItem('warehouseName', _self.warehouseName);
|
|
|
|
|
- _self.clear();
|
|
|
|
|
- } else {
|
|
|
|
|
- _self.warehouseId = $(this).val();
|
|
|
|
|
- for (var i = 0; i < _self.warehouses.length; i++) {
|
|
|
|
|
- if (_self.warehouses[i].id == _self.warehouseId) {
|
|
|
|
|
- _self.warehouseName = _self.warehouses[i].name;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 加载仓库选项
|
|
|
|
|
+ loadSelectWarehouse() {
|
|
|
|
|
+ const _self = this;
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: Common.getApiURL('WarehouseResource/queryByCondition'),
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ type: 'get',
|
|
|
|
|
+ data: { name: '' },
|
|
|
|
|
+ beforeSend: Common.addTokenToRequest,
|
|
|
|
|
+ success(data) {
|
|
|
|
|
+ if (data.errorCode === 0) {
|
|
|
|
|
+ _self.warehouses = data.datas;
|
|
|
}
|
|
}
|
|
|
- _self.clear();
|
|
|
|
|
- storage.setItem('warehouseId', _self.warehouseId);
|
|
|
|
|
- storage.setItem('warehouseName', _self.warehouseName);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ error(errorData) {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 需求模板
|
|
|
|
|
- */
|
|
|
|
|
- loadSelectTemplate: function() {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- var storage = window.localStorage;
|
|
|
|
|
- $('#stockOutPrepateTemplate').select2({
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- //data: _self.data,
|
|
|
|
|
- theme: 'bootstrap',
|
|
|
|
|
- placeholder: '需求模板',
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- placeholderOption: 'first',
|
|
|
|
|
- quietMillis: 250,
|
|
|
|
|
- allowClear: true,
|
|
|
|
|
- language: 'zh-CN',
|
|
|
|
|
- width: 'resolve',
|
|
|
|
|
- // 请求搜索框数据
|
|
|
|
|
- ajax: {
|
|
|
|
|
- url: function(params) {
|
|
|
|
|
- return Common.getApiURL('StockOutPrepateTemplateResource/queryByCondition');
|
|
|
|
|
- },
|
|
|
|
|
- dataType: 'json',
|
|
|
|
|
- type: 'get',
|
|
|
|
|
- delay: 250,
|
|
|
|
|
- minimumInputLength: 0,
|
|
|
|
|
- transport: function(params, success, failure) {
|
|
|
|
|
- params.beforeSend = Common.addTokenToRequest;
|
|
|
|
|
- var $request = $.ajax(params);
|
|
|
|
|
- $request.then(success);
|
|
|
|
|
- $request.fail(failure);
|
|
|
|
|
- return $request;
|
|
|
|
|
- },
|
|
|
|
|
- data: function(params) {
|
|
|
|
|
- return {
|
|
|
|
|
- 'name': params.term,
|
|
|
|
|
- };
|
|
|
|
|
- },
|
|
|
|
|
- processResults: function(data, params) {
|
|
|
|
|
- if(data.errorCode == 0) {
|
|
|
|
|
- var more = (params * 10) <= data.datas.length;
|
|
|
|
|
- for(var i = 0; i < data.datas.length; i++) {
|
|
|
|
|
- data.datas[i].text = data.datas[i].name;
|
|
|
|
|
- }
|
|
|
|
|
- _self.stockOutPrepateTemplateNames = data.datas;
|
|
|
|
|
- return {
|
|
|
|
|
- results: data.datas,
|
|
|
|
|
- more: more,
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- },
|
|
|
|
|
- }).on('change', function() {
|
|
|
|
|
- if($(this).val() == null) {
|
|
|
|
|
- _self.stockOutPrepateTemplateId = undefined;
|
|
|
|
|
- _self.clear();
|
|
|
|
|
- _self.stockOutPrepateTemplateName = '';
|
|
|
|
|
- storage.setItem('stockOutPrepateTemplateId', _self.stockOutPrepateTemplateId);
|
|
|
|
|
- storage.setItem('stockOutPrepateTemplateName', _self.stockOutPrepateTemplateName);
|
|
|
|
|
- } else {
|
|
|
|
|
- _self.stockOutPrepateTemplateId = $(this).val();
|
|
|
|
|
- for (var i = 0; i < _self.stockOutPrepateTemplateNames.length; i++) {
|
|
|
|
|
- if (_self.stockOutPrepateTemplateNames[i].id == _self.stockOutPrepateTemplateId) {
|
|
|
|
|
- _self.stockOutPrepateTemplateName = _self.stockOutPrepateTemplateNames[i].name;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 加载需求模板选项
|
|
|
|
|
+ loadSelectTemplate() {
|
|
|
|
|
+ const _self = this;
|
|
|
|
|
+ $.ajax({
|
|
|
|
|
+ url: Common.getApiURL('StockOutPrepateTemplateResource/queryByCondition'),
|
|
|
|
|
+ dataType: 'json',
|
|
|
|
|
+ type: 'get',
|
|
|
|
|
+ data: { name: '' },
|
|
|
|
|
+ beforeSend: Common.addTokenToRequest,
|
|
|
|
|
+ success(data) {
|
|
|
|
|
+ if (data.errorCode === 0) {
|
|
|
|
|
+ _self.stockOutPrepateTemplateNames = data.datas;
|
|
|
}
|
|
}
|
|
|
- _self.clear();
|
|
|
|
|
- storage.setItem('stockOutPrepateTemplateId', _self.stockOutPrepateTemplateId);
|
|
|
|
|
- storage.setItem('stockOutPrepateTemplateName', _self.stockOutPrepateTemplateName);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ error(errorData) {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 修改每页显示的数量
|
|
|
|
|
- * @param {Object} newPageSize
|
|
|
|
|
- */
|
|
|
|
|
- gridSizeSelect: function(newPageSize) {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- this.pagination.per_page = newPageSize;
|
|
|
|
|
- this.pagination.current_page = 1;
|
|
|
|
|
- // 刷新界面
|
|
|
|
|
-
|
|
|
|
|
- //清空这样显示数据
|
|
|
|
|
- _self.pageStockOutPrepateTemplates.splice(0, _self.pageStockOutPrepateTemplates.length);
|
|
|
|
|
-
|
|
|
|
|
- //清空查询数据,重新查询数据
|
|
|
|
|
- _self.stockOutPrepateTemplates.splice(0, _self.stockOutPrepateTemplates.length);
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 修改每页显示数量
|
|
|
|
|
+ gridSizeSelect(newPageSize) {
|
|
|
|
|
+ this.pagination.pageSize = newPageSize;
|
|
|
|
|
+ this.pagination.current = 1;
|
|
|
|
|
+ this.pageStockOutPrepateTemplates = [];
|
|
|
|
|
+ this.stockOutPrepateTemplates = [];
|
|
|
this.queryLines();
|
|
this.queryLines();
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- //查询领料模板详情
|
|
|
|
|
- queryLines: function() {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- if(_self.projectItemId == undefined) {
|
|
|
|
|
|
|
+ // 查询领料模板详情
|
|
|
|
|
+ queryLines() {
|
|
|
|
|
+ if (!this.projectItemId) {
|
|
|
Common.showDialog('提示', '请选择项目事件', 'error');
|
|
Common.showDialog('提示', '请选择项目事件', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(_self.warehouseId == undefined) {
|
|
|
|
|
|
|
+ if (!this.warehouseId) {
|
|
|
Common.showDialog('提示', '请选择仓库', 'error');
|
|
Common.showDialog('提示', '请选择仓库', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(_self.stockOutPrepateTemplateId == undefined) {
|
|
|
|
|
|
|
+ if (!this.stockOutPrepateTemplateId) {
|
|
|
Common.showDialog('提示', '请选择需求模板', 'error');
|
|
Common.showDialog('提示', '请选择需求模板', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- var param = {
|
|
|
|
|
- warehouseId: _self.warehouseId,
|
|
|
|
|
- projectItemId: _self.projectItemId,
|
|
|
|
|
- stockOutPrepateTemplateDtoId: _self.stockOutPrepateTemplateId,
|
|
|
|
|
|
|
+ const param = {
|
|
|
|
|
+ warehouseId: this.warehouseId,
|
|
|
|
|
+ projectItemId: this.projectItemId,
|
|
|
|
|
+ stockOutPrepateTemplateDtoId: this.stockOutPrepateTemplateId,
|
|
|
};
|
|
};
|
|
|
- _self.loading=true;
|
|
|
|
|
-
|
|
|
|
|
- //清空这样显示数据
|
|
|
|
|
- _self.pageStockOutPrepateTemplates.splice(0, _self.pageStockOutPrepateTemplates.length);
|
|
|
|
|
-
|
|
|
|
|
- StockOutPrepateTemplateResource.queryStockOutPrepateTemplateDto(param).then(successData =>{
|
|
|
|
|
- if(successData.errorCode == 0) {
|
|
|
|
|
- _self.pagination.total = successData.data.stockOutPrepateTemplateLineDtos.length;
|
|
|
|
|
- _self.stockOutPrepateTemplates = successData.data.stockOutPrepateTemplateLineDtos;
|
|
|
|
|
- _self.pagination.last_page = Math.ceil(successData.data.stockOutPrepateTemplateLineDtos.length / _self.pagination.per_page);
|
|
|
|
|
- _self.getDatas();
|
|
|
|
|
- _self.loading=false;
|
|
|
|
|
- } else {
|
|
|
|
|
- Notify.error('提示', successData.errorMessage, false);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- },errorData =>{
|
|
|
|
|
- _self.loading=false;
|
|
|
|
|
- Common.processException(errorData);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ this.pageStockOutPrepateTemplates = [];
|
|
|
|
|
+ StockOutPrepateTemplateResource.queryStockOutPrepateTemplateDto(param)
|
|
|
|
|
+ .then(successData => {
|
|
|
|
|
+ if (successData.errorCode === 0) {
|
|
|
|
|
+ this.pagination.total = successData.data.stockOutPrepateTemplateLineDtos.length;
|
|
|
|
|
+ this.stockOutPrepateTemplates = successData.data.stockOutPrepateTemplateLineDtos;
|
|
|
|
|
+ this.getDatas();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Notify.error('提示', successData.errorMessage, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(errorData => {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- getDatas: function() {
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- var start = (_self.pagination.current_page - 1) * _self.pagination.per_page;
|
|
|
|
|
- var end = start + _self.pagination.per_page;
|
|
|
|
|
- //将录入的数据导过来
|
|
|
|
|
- if(_self.pageStockOutPrepateTemplates != null && _self.pageStockOutPrepateTemplates.length > 0) {
|
|
|
|
|
- for(var j = 0; j < _self.pageStockOutPrepateTemplates.length; j++) {
|
|
|
|
|
- var index = _self.pageStockOutPrepateTemplates[j].index;
|
|
|
|
|
- _self.stockOutPrepateTemplates[index].pickQuantity = _self.pageStockOutPrepateTemplates[j].pickQuantity;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 获取分页数据
|
|
|
|
|
+ getDatas() {
|
|
|
|
|
+ const start = (this.pagination.current - 1) * this.pagination.pageSize;
|
|
|
|
|
+ const end = start + this.pagination.pageSize;
|
|
|
|
|
+ if (this.pageStockOutPrepateTemplates.length > 0) {
|
|
|
|
|
+ this.pageStockOutPrepateTemplates.forEach(item => {
|
|
|
|
|
+ this.stockOutPrepateTemplates[item.index].pickQuantity = item.pickQuantity;
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- //清空这样显示数据
|
|
|
|
|
- _self.pageStockOutPrepateTemplates.splice(0, _self.pageStockOutPrepateTemplates.length);
|
|
|
|
|
-
|
|
|
|
|
- //重新生成另一页的数据
|
|
|
|
|
- for(var i = 0; i < _self.stockOutPrepateTemplates.length; i++) {
|
|
|
|
|
- if(i >= start && i < end) {
|
|
|
|
|
- var obj = {
|
|
|
|
|
- inventoryName: _self.stockOutPrepateTemplates[i].inventoryName,
|
|
|
|
|
- inventoryNo: _self.stockOutPrepateTemplates[i].inventoryNo,
|
|
|
|
|
- inventoryType: _self.stockOutPrepateTemplates[i].inventoryType,
|
|
|
|
|
- warehouseName: _self.stockOutPrepateTemplates[i].warehouseName,
|
|
|
|
|
- currentStockQuantity: _self.stockOutPrepateTemplates[i].currentStockQuantity,
|
|
|
|
|
- currentStockOutQuantity: _self.stockOutPrepateTemplates[i].currentStockOutQuantity,
|
|
|
|
|
- currentStockCanPickQuantity: _self.stockOutPrepateTemplates[i].currentStockCanPickQuantity,
|
|
|
|
|
- quantity: _self.stockOutPrepateTemplates[i].quantity,
|
|
|
|
|
- pickQuantity: _self.stockOutPrepateTemplates[i].pickQuantity,
|
|
|
|
|
|
|
+ this.pageStockOutPrepateTemplates = [];
|
|
|
|
|
+ for (let i = 0; i < this.stockOutPrepateTemplates.length; i++) {
|
|
|
|
|
+ if (i >= start && i < end) {
|
|
|
|
|
+ const obj = {
|
|
|
|
|
+ ...this.stockOutPrepateTemplates[i],
|
|
|
index: i,
|
|
index: i,
|
|
|
};
|
|
};
|
|
|
- _self.pageStockOutPrepateTemplates.push(obj);
|
|
|
|
|
|
|
+ this.pageStockOutPrepateTemplates.push(obj);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- _self.fixedTableHeader();
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- //清空
|
|
|
|
|
- clear:function(){
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- //清空这样显示数据
|
|
|
|
|
- _self.pageStockOutPrepateTemplates.splice(0, _self.pageStockOutPrepateTemplates.length);
|
|
|
|
|
- //清空记录数据
|
|
|
|
|
- _self.stockOutPrepateTemplates.splice(0, _self.stockOutPrepateTemplates.length);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 清空数据
|
|
|
|
|
+ clear() {
|
|
|
|
|
+ this.pageStockOutPrepateTemplates = [];
|
|
|
|
|
+ this.stockOutPrepateTemplates = [];
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- //提交
|
|
|
|
|
- save: function() {
|
|
|
|
|
- var currentStock = [];
|
|
|
|
|
- var num = 0;
|
|
|
|
|
- var num3 = 0;
|
|
|
|
|
- var num5 = 0;
|
|
|
|
|
- var _self = this;
|
|
|
|
|
- _self.getDatas();
|
|
|
|
|
- this.stockOutPrepateTemplates.forEach(function(item) {
|
|
|
|
|
-
|
|
|
|
|
- if(item.pickQuantity == undefined || item.pickQuantity == '') {
|
|
|
|
|
|
|
+ // 提交领料数据
|
|
|
|
|
+ save() {
|
|
|
|
|
+ const currentStock = [];
|
|
|
|
|
+ let num = 0;
|
|
|
|
|
+ let num3 = 0;
|
|
|
|
|
+ let num5 = 0;
|
|
|
|
|
+ this.getDatas();
|
|
|
|
|
+ this.stockOutPrepateTemplates.forEach(item => {
|
|
|
|
|
+ if (item.pickQuantity === undefined || item.pickQuantity === '') {
|
|
|
num++;
|
|
num++;
|
|
|
}
|
|
}
|
|
|
- if(item.pickQuantity <= 0 && item.currentStockCanPickQuantity > 0) {
|
|
|
|
|
|
|
+ if (item.pickQuantity <= 0 && item.currentStockCanPickQuantity > 0) {
|
|
|
num5++;
|
|
num5++;
|
|
|
}
|
|
}
|
|
|
- if(item.pickQuantity > item.currentStockCanPickQuantity) {
|
|
|
|
|
|
|
+ if (item.pickQuantity > item.currentStockCanPickQuantity) {
|
|
|
num3++;
|
|
num3++;
|
|
|
} else {
|
|
} else {
|
|
|
currentStock.push(item);
|
|
currentStock.push(item);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
});
|
|
});
|
|
|
- if(_self.projectItemId == undefined) {
|
|
|
|
|
|
|
+ if (!this.projectItemId) {
|
|
|
Common.showDialog('提示', '请选择项目事件', 'error');
|
|
Common.showDialog('提示', '请选择项目事件', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(_self.warehouseId == undefined) {
|
|
|
|
|
|
|
+ if (!this.warehouseId) {
|
|
|
Common.showDialog('提示', '请选择仓库', 'error');
|
|
Common.showDialog('提示', '请选择仓库', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(_self.stockOutPrepateTemplateId == undefined) {
|
|
|
|
|
|
|
+ if (!this.stockOutPrepateTemplateId) {
|
|
|
Common.showDialog('提示', '请选择需求模板', 'error');
|
|
Common.showDialog('提示', '请选择需求模板', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(num > 0) {
|
|
|
|
|
|
|
+ if (num > 0) {
|
|
|
Common.showDialog('提示', '请填写领用数量', 'error');
|
|
Common.showDialog('提示', '请填写领用数量', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(num3 > 0) {
|
|
|
|
|
|
|
+ if (num3 > 0) {
|
|
|
Common.showDialog('提示', '领用数量大于可领数量', 'error');
|
|
Common.showDialog('提示', '领用数量大于可领数量', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- if(num5 > 0) {
|
|
|
|
|
|
|
+ if (num5 > 0) {
|
|
|
Common.showDialog('提示', '填写的领用数量必须大于零', 'error');
|
|
Common.showDialog('提示', '填写的领用数量必须大于零', 'error');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- var param = {
|
|
|
|
|
- projectItemId: _self.projectItemId,
|
|
|
|
|
- warehouseId: _self.warehouseId,
|
|
|
|
|
- stockOutPrepateTemplateId: _self.stockOutPrepateTemplateId,
|
|
|
|
|
|
|
+ const param = {
|
|
|
|
|
+ projectItemId: this.projectItemId,
|
|
|
|
|
+ warehouseId: this.warehouseId,
|
|
|
|
|
+ stockOutPrepateTemplateId: this.stockOutPrepateTemplateId,
|
|
|
pickingCarDtoList: currentStock,
|
|
pickingCarDtoList: currentStock,
|
|
|
};
|
|
};
|
|
|
- _self.loading=true;
|
|
|
|
|
- if(currentStock.length > 0) {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- StockOutPrepareResource.saveByTemplate(param).then(successData =>{
|
|
|
|
|
- if(successData.errorCode == 0) {
|
|
|
|
|
- Notify.success('成功', '领料成功', 4000);
|
|
|
|
|
- //清空这样显示数据
|
|
|
|
|
- _self.pageStockOutPrepateTemplates.splice(0, _self.pageStockOutPrepateTemplates.length);
|
|
|
|
|
- _self.stockOutPrepateTemplates.splice(0,_self.stockOutPrepateTemplates.length);
|
|
|
|
|
- _self.loading=false;
|
|
|
|
|
- } else {
|
|
|
|
|
- Notify.error('提示', successData.errorMessage, false);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- },errorData =>{
|
|
|
|
|
- _self.loading=false;
|
|
|
|
|
- Common.processException(errorData);
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
|
|
+ this.loading = true;
|
|
|
|
|
+ if (currentStock.length > 0) {
|
|
|
|
|
+ StockOutPrepareResource.saveByTemplate(param)
|
|
|
|
|
+ .then(successData => {
|
|
|
|
|
+ if (successData.errorCode === 0) {
|
|
|
|
|
+ Notify.success('成功', '领料成功', 4000);
|
|
|
|
|
+ this.pageStockOutPrepateTemplates = [];
|
|
|
|
|
+ this.stockOutPrepateTemplates = [];
|
|
|
|
|
+ } else {
|
|
|
|
|
+ Notify.error('提示', successData.errorMessage, false);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(errorData => {
|
|
|
|
|
+ Common.processException(errorData);
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ });
|
|
|
} else {
|
|
} else {
|
|
|
- _self.loading=false;
|
|
|
|
|
|
|
+ this.loading = false;
|
|
|
Common.showDialog('提示', '请选择要提交的内容', 'error');
|
|
Common.showDialog('提示', '请选择要提交的内容', 'error');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * 冻结表头
|
|
|
|
|
- */
|
|
|
|
|
- fixedTableHeader:function(){
|
|
|
|
|
- let _self = this;
|
|
|
|
|
- _self.$nextTick(function(){
|
|
|
|
|
- $('.fixed-table').tableFixer({'left' : 2,'head':true});
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ // 表格分页变化处理
|
|
|
|
|
+ handleTableChange(pagination) {
|
|
|
|
|
+ this.pagination.current = pagination.current;
|
|
|
|
|
+ this.getDatas();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 项目事件选择变化处理
|
|
|
|
|
+ handleProjectItemChange(value) {
|
|
|
|
|
+ this.projectItemId = value;
|
|
|
|
|
+ this.clear();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 仓库选择变化处理
|
|
|
|
|
+ handleWarehouseChange(value) {
|
|
|
|
|
+ this.warehouseId = value;
|
|
|
|
|
+ this.clear();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 需求模板选择变化处理
|
|
|
|
|
+ handleTemplateChange(value) {
|
|
|
|
|
+ this.stockOutPrepateTemplateId = value;
|
|
|
|
|
+ this.clear();
|
|
|
|
|
+ },
|
|
|
|
|
+ // 领用数量变化处理
|
|
|
|
|
+ handlePickQuantityChange(record) {
|
|
|
|
|
+ // 可根据需求添加额外逻辑
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
-.form-inline .form-group label {
|
|
|
|
|
- width: 80px;
|
|
|
|
|
- text-align: right;
|
|
|
|
|
- padding-right: 5px;
|
|
|
|
|
|
|
+.flex-container {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: calc(100vh - 85px);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-.form-inline .form-group input,
|
|
|
|
|
-.form-inline .form-group select {
|
|
|
|
|
- width: 200px;
|
|
|
|
|
|
|
+.flex-header {
|
|
|
|
|
+ flex: 0 0 100px;
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
|
|
|
-<style scoped>
|
|
|
|
|
- .flex-container {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- /* 垂直*/
|
|
|
|
|
- flex-direction: column;
|
|
|
|
|
- width: 100%;
|
|
|
|
|
- /*视口被均分为100单位的vh 占据整个窗口,扣掉顶部topNav的距离后,计算得到container的高度*/
|
|
|
|
|
- height: calc(100vh - 85px);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .flex-header {
|
|
|
|
|
- height: 200px;
|
|
|
|
|
- /*放大缩小比例为0 */
|
|
|
|
|
- flex: 0 0 100px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .flex-footer {
|
|
|
|
|
- margin-top: 0.8em;
|
|
|
|
|
- height: 35px;
|
|
|
|
|
- /*放大缩小比例为0 */
|
|
|
|
|
- flex: 0 0 35px;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .flex-content {
|
|
|
|
|
- margin-top: 0.8em;
|
|
|
|
|
|
|
+.flex-footer {
|
|
|
|
|
+ margin-top: 0.8em;
|
|
|
|
|
+ flex: 0 0 35px;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.flex-content {
|
|
|
|
|
+ margin-top: 0.8em;
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
- overflow: scroll;
|
|
|
|
|
|
|
+ overflow: auto;
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
- height: 0;
|
|
|
|
|
- }
|
|
|
|
|
-</style>
|
|
|
|
|
-<style scoped>
|
|
|
|
|
-.fixed-table {
|
|
|
|
|
- table-layout: fixed;
|
|
|
|
|
- width: 800px !important;
|
|
|
|
|
- min-width: 800px !important;
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-table.fixed-table tr {
|
|
|
|
|
- height: 40px;
|
|
|
|
|
|
|
+.pull-left {
|
|
|
|
|
+ float: left;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-table.fixed-table th,
|
|
|
|
|
-table.fixed-table td {
|
|
|
|
|
- overflow: hidden;
|
|
|
|
|
- white-space: nowrap;
|
|
|
|
|
- text-overflow: ellipsis;
|
|
|
|
|
|
|
+.pull-right {
|
|
|
|
|
+ float: right;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|