parent
e4e699cdba
commit
d1bf38271b
92
src/api/mes/wip/product-storag-request.js
Normal file
92
src/api/mes/wip/product-storag-request.js
Normal file
@ -0,0 +1,92 @@
|
||||
import request from '@/router/axios'
|
||||
import {nlv_wms, tds} from "@/api/prefix";
|
||||
|
||||
// 生产入库单申请-单据号弹窗分页查询
|
||||
export function getDocumentNoPage(query) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/getDocumentNoPage'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 生产入库单申请-目标仓库弹窗分页查询
|
||||
export function getTargetWarehousePage(query) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/getTargetWarehousePage'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 生产入库单申请-来源仓库弹窗分页查询
|
||||
export function getSourceWarehousePage(query) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/getSourceWarehousePage'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 生产入库单申请-物料弹窗分页查询
|
||||
export function getItemPage(query) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/getItemPage'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 生产入库单申请-创建人弹窗分页查询
|
||||
export function getCreateUserPage(query) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/getCreateUserPage'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 生产入库单申请-分页查询
|
||||
export function getObj(obj,params) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/search'),
|
||||
method: 'post',
|
||||
data: obj,
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 生产入库单申请-托盘号/条码号扫描事件
|
||||
export function barScanEvent(query) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/barScanEvent'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 生产入库单申请-保存事件
|
||||
export function greatSaveOrUpdate(obj) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/greatSaveOrUpdate'),
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
// 生产入库单申请-提交事件
|
||||
export function submit(site,documentNo) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/submit/'+documentNo+'/'+site),
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 生产入库单申请-删除事件
|
||||
export function greatDelete(obj) {
|
||||
return request({
|
||||
url: nlv_wms('/z-storag-request/greatDelete'),
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
}
|
||||
811
src/views/mes/wip/product-storag-request/index.vue
Normal file
811
src/views/mes/wip/product-storag-request/index.vue
Normal file
@ -0,0 +1,811 @@
|
||||
<template>
|
||||
<div class="execution">
|
||||
<!-- 单据号 弹窗 -->
|
||||
<input-select-dialog
|
||||
:modal-obj="documentNoDialogObj"
|
||||
:modal-fetch-fun="documentNoDialogFetchFun"
|
||||
:modal-show.sync="documentNoDialogVisible"
|
||||
@inputDialogSelected="dialogSelected"
|
||||
></input-select-dialog>
|
||||
|
||||
<!-- 目标仓库 弹窗 -->
|
||||
<input-select-dialog
|
||||
:modal-obj="targetWarehouseDialogObj"
|
||||
:modal-fetch-fun="targetWarehouseDialogFetchFun"
|
||||
:modal-show.sync="targetWarehouseDialogVisible"
|
||||
@inputDialogSelected="dialogSelected"
|
||||
></input-select-dialog>
|
||||
|
||||
<!-- 来源仓库 弹窗 -->
|
||||
<input-select-dialog
|
||||
:modal-obj="sourceWarehouseDialogObj"
|
||||
:modal-fetch-fun="sourceWarehouseDialogFetchFun"
|
||||
:modal-show.sync="sourceWarehouseDialogVisible"
|
||||
@inputDialogSelected="dialogSelected"
|
||||
></input-select-dialog>
|
||||
|
||||
<!-- 物料编码 弹窗 -->
|
||||
<input-select-dialog
|
||||
:modal-obj="itemDialogObj"
|
||||
:modal-fetch-fun="itemDialogFetchFun"
|
||||
:modal-show.sync="itemDialogVisible"
|
||||
@inputDialogSelected="dialogSelected"
|
||||
></input-select-dialog>
|
||||
|
||||
<!-- 创建人 弹窗 -->
|
||||
<input-select-dialog
|
||||
:modal-obj="createUserDialogObj"
|
||||
:modal-fetch-fun="createUserDialogFetchFun"
|
||||
:modal-show.sync="createUserDialogVisible"
|
||||
@inputDialogSelected="dialogSelected"
|
||||
></input-select-dialog>
|
||||
|
||||
<!-- 主页面 -->
|
||||
<basic-container>
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
label-width="120px"
|
||||
label-suffix=":"
|
||||
:rules="rules"
|
||||
>
|
||||
<el-row :gutter="24">
|
||||
<!-- 单据号 -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据号" prop="documentNo">
|
||||
<el-input v-model="form.documentNo" clearable>
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('documentNo')"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 单据状态 -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="单据状态" prop="documentStatus">
|
||||
<el-select v-model="form.documentStatus" clearable>
|
||||
<el-option
|
||||
v-for="item in documentStatusList"
|
||||
:key="item.value"
|
||||
:label="$t(item.label)"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- 创建时间 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="form.timeRange"
|
||||
type="datetimerange"
|
||||
:picker-options="pickerOptions"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
format="yyyy-MM-dd HH:mm:ss"
|
||||
valueFormat="yyyy-MM-dd HH:mm:ss"
|
||||
align="right">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<!-- 目标仓库 -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="目标仓库" prop="targetWarehouse">
|
||||
<el-input v-model="form.targetWarehouse" clearable >
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('targetWarehouse')"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 来源仓库 -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="来源仓库" prop="sourceWarehouse">
|
||||
<el-input v-model="form.sourceWarehouse" clearable >
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('sourceWarehouse')"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 物料编码 -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="物料编码" prop="item">
|
||||
<el-input v-model="form.item" clearable >
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('item')"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- 创建人 -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="创建人" prop="createUser">
|
||||
<el-input v-model="form.createUser" clearable >
|
||||
<i
|
||||
slot="suffix"
|
||||
class="el-input__icon el-icon-copy-document"
|
||||
@click.stop="showDialog('createUser')"
|
||||
></i>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row style="text-align: center; margin-bottom: 5px" :gutter="24">
|
||||
<el-col :span="24">
|
||||
<el-button type="primary" @click="doSearch">搜索</el-button>
|
||||
<el-button type="primary" @click="doSave">保存</el-button>
|
||||
<el-button type="primary" @click="doSubmit">提交</el-button>
|
||||
<el-button type="primary" @click="doToolbarDelete">移除选定项</el-button>
|
||||
<el-button type="primary" @click="doDelete">删除</el-button>
|
||||
<el-button type="primary" @click="doReset">清空</el-button>
|
||||
<el-button type="primary" @click="doRePrint">单据补打印</el-button>
|
||||
<el-button type="primary" @click="doExcel">导出</el-button>
|
||||
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!--分割线-->
|
||||
<el-divider></el-divider>
|
||||
<el-row :gutter="24">
|
||||
<!-- 托盘号/条码号 -->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="托盘号/条码号" prop="carrierNumberOrLotNumber">
|
||||
<el-input clearable v-model="form.carrierNumberOrLotNumber" ref="carrierNumberOrLotNumberInput" @keyup.enter.native="scanEvent"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!--分割线-->
|
||||
<el-divider></el-divider>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24">
|
||||
<el-table
|
||||
ref="storagRequestData"
|
||||
stripe
|
||||
:data="storagRequestList"
|
||||
tooltip-effect="dark"
|
||||
height="calc(100vh - 480px)"
|
||||
style="width: 100%"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }"
|
||||
@selection-change="handleSelectionChange"
|
||||
:row-key="row=>row.documentNo + row.carrierNumber + row.lotNumber">
|
||||
<el-table-column :reserve-selection="true" type="selection" width="45"/>
|
||||
<!-- 顺序 -->
|
||||
<el-table-column prop="seq" align="center" width="70" label="序号" />
|
||||
<el-table-column prop="documentNo" width="100" label="单据号" />
|
||||
<el-table-column prop="documentStatus" label="单据状态" />
|
||||
<el-table-column prop="carrierNumber" label="托盘号" />
|
||||
<el-table-column prop="lotNumber" label="条码号" />
|
||||
<el-table-column prop="targetWarehouse" label="目标仓库" />
|
||||
<el-table-column prop="sourceWarehouse" label="来源仓库" />
|
||||
<el-table-column prop="item" label="物料编码" />
|
||||
<el-table-column prop="itemDescription" label="物料描述" />
|
||||
<el-table-column prop="qualityInspectionStatus" label="质检状态" />
|
||||
<el-table-column prop="qty" label="数量" />
|
||||
<el-table-column prop="weigth" label="重量" />
|
||||
<el-table-column prop="width" label="宽度" />
|
||||
<el-table-column prop="thickness" label="厚度" />
|
||||
</el-table>
|
||||
<div style="width: 100%; display: flex; flex-direction: column; align-items: flex-end; justify-content: center">
|
||||
<el-pagination @current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
:current-page.sync="page.current"
|
||||
:page-sizes="[20, 50, 100, 200]"
|
||||
:page-size="page.size"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="page.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
</basic-container>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
documentNoDialogObj,
|
||||
documentStatusList,
|
||||
targetWarehouseDialogObj,
|
||||
sourceWarehouseDialogObj,
|
||||
itemDialogObj,
|
||||
createUserDialogObj,
|
||||
pickerOptions
|
||||
} from "@/views/mes/wip/product-storag-request/init";
|
||||
|
||||
import {
|
||||
getDocumentNoPage,
|
||||
getTargetWarehousePage,
|
||||
getSourceWarehousePage,
|
||||
getItemPage,
|
||||
getCreateUserPage,
|
||||
barScanEvent,
|
||||
getObj,
|
||||
greatSaveOrUpdate,
|
||||
submit,
|
||||
greatDelete
|
||||
} from "@/api/mes/wip/product-storag-request";
|
||||
import {stringFormat, isBlank} from "@/util/string";
|
||||
import {
|
||||
doAdd,
|
||||
replaceData,
|
||||
doDispatch,
|
||||
doDeleteAndLogRecord,
|
||||
} from '@/api/mes/tds/dispatch-equipment'
|
||||
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getStore } from '@/util/store'
|
||||
import {hideLoading, showLoading} from '@/const/loading'
|
||||
import {fetchItemList} from "@/api/admin/dict";
|
||||
import dynamicFunction from "@/const/crud/mes/common/dynamic-data";
|
||||
import {listByActivityId} from "@/api/admin/activity-option";
|
||||
import {setSeq} from "@/util/table";
|
||||
import {dcc, nlv_wms} from "@/api/prefix";
|
||||
import ExcelJS from "exceljs";
|
||||
import moment from "moment/moment";
|
||||
|
||||
export default {
|
||||
name: 'product-storag-request',
|
||||
mixins: [],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
site: getStore({name: 'tenantId'}),
|
||||
username: getStore({name: 'userInfo'}).username,
|
||||
form: {},
|
||||
initData: {
|
||||
site: getStore({name: 'tenantId'}),
|
||||
documentNo: '',
|
||||
documentStatus: '',
|
||||
timeRange: '',
|
||||
targetWarehouse: '',
|
||||
sourceWarehouse: '',
|
||||
item: '',
|
||||
createUser: '',
|
||||
carrierNumberOrLotNumber: '',
|
||||
},
|
||||
// 作业规则
|
||||
targetStoLoc: '',
|
||||
isPrint: '',
|
||||
// 单据状态
|
||||
documentStatusList,
|
||||
rules: {
|
||||
targetWarehouse: [
|
||||
{
|
||||
required: true,
|
||||
message: '目标仓库必填',
|
||||
trigger: ['blur', 'change'],
|
||||
},
|
||||
],
|
||||
},
|
||||
// 单据号
|
||||
documentNoDialogVisible: false,
|
||||
documentNoDialogFetchFun: getDocumentNoPage,
|
||||
documentNoDialogObj,
|
||||
// 目标仓库
|
||||
targetWarehouseDialogVisible: false,
|
||||
targetWarehouseDialogFetchFun: getTargetWarehousePage,
|
||||
targetWarehouseDialogObj,
|
||||
// 来源仓库
|
||||
sourceWarehouseDialogVisible: false,
|
||||
sourceWarehouseDialogFetchFun: getSourceWarehousePage,
|
||||
sourceWarehouseDialogObj,
|
||||
// 物料
|
||||
itemDialogVisible: false,
|
||||
itemDialogFetchFun: getItemPage,
|
||||
itemDialogObj,
|
||||
// 创建人
|
||||
createUserDialogVisible: false,
|
||||
createUserDialogFetchFun: getCreateUserPage,
|
||||
createUserDialogObj,
|
||||
// 便捷时间范围选项
|
||||
pickerOptions,
|
||||
storagRequestList:[],
|
||||
multipleSelection: [],
|
||||
titleText: '',
|
||||
selectedIndex: 0,
|
||||
page: {
|
||||
total: 0,
|
||||
current: 1,
|
||||
size: 20
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 初始化数据
|
||||
this.form = Object.assign({}, this.initData);
|
||||
// 获取作业规则
|
||||
let activityId = this.$route.query.ACTIVITY_ID
|
||||
showLoading()
|
||||
listByActivityId(activityId)
|
||||
.then((response) => {
|
||||
hideLoading()
|
||||
if (response.data.code != 0) {
|
||||
return this.$message.error(response.data.msg)
|
||||
}
|
||||
|
||||
if (response.data.data.length == 0) {
|
||||
return this.$message.error('请先在[菜单管理]功能中维护作业规则[TARGET_STO_LOC]')
|
||||
}
|
||||
|
||||
// 检查是否存在 optionName 为 'TARGET_STO_LOC' 的规则
|
||||
let hasTargetStoLoc = false;
|
||||
|
||||
for (let i = 0; i < response.data.data.length; i++) {
|
||||
// TARGET_STO_LOC
|
||||
// 判断 作业规则是否为 TARGET_STO_LOC; 如果是则判断其值是否为空;若为空则报错,否则则把值付给 targetStoLoc
|
||||
if (response.data.data[i].optionName == 'TARGET_STO_LOC') {
|
||||
if (isBlank(response.data.data[i].optionValue)) {
|
||||
return this.$message.error('作业规则中['+response.data.data[i].optionName+']的值不能为空')
|
||||
}
|
||||
hasTargetStoLoc = true;
|
||||
this.targetStoLoc = response.data.data[i].optionValue
|
||||
} else if (response.data.data[i].optionName == 'IS_PRINT') {
|
||||
this.isPrint = response.data.data[i].optionValue
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有找到 'TARGET_STO_LOC' 规则,则显示错误信息
|
||||
if (!hasTargetStoLoc) {
|
||||
return this.$message.error('请先在[菜单管理]功能中维护作业规则[TARGET_STO_LOC]');
|
||||
}
|
||||
// this.activity = response.data.data
|
||||
})
|
||||
.catch((e) => {
|
||||
hideLoading()
|
||||
})
|
||||
},
|
||||
|
||||
mounted() {
|
||||
// 页面加载完成后,自动聚焦到托盘号/条码号输入框
|
||||
this.$refs.carrierNumberOrLotNumberInput.focus();
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['permissions']),
|
||||
permissionList() {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 打开弹窗
|
||||
showDialog(key) {
|
||||
let me = this;
|
||||
this.openKey = key
|
||||
switch (key) {
|
||||
case 'documentNo':
|
||||
this.documentNoDialogVisible = true
|
||||
break;
|
||||
case 'targetWarehouse':
|
||||
this.targetWarehouseDialogObj.queryParam.targetWarehouse = this.targetStoLoc;
|
||||
this.targetWarehouseDialogVisible = true
|
||||
break;
|
||||
case 'sourceWarehouse':
|
||||
this.sourceWarehouseDialogVisible = true
|
||||
break;
|
||||
case 'item':
|
||||
this.itemDialogVisible = true
|
||||
break;
|
||||
case 'createUser':
|
||||
this.createUserDialogVisible = true
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
// 选择弹窗资料
|
||||
dialogSelected(row) {
|
||||
let obj = {}
|
||||
switch (this.openKey) {
|
||||
case 'documentNo':
|
||||
obj['documentNo'] = row.DOCUMENT_NO
|
||||
break;
|
||||
case 'targetWarehouse':
|
||||
obj['targetWarehouse'] = row.TARGET_WAREHOUSE
|
||||
break;
|
||||
case 'sourceWarehouse':
|
||||
obj['sourceWarehouse'] = row.SOURCE_WAREHOUSE
|
||||
break;
|
||||
case 'item':
|
||||
obj['item'] = row.ITEM
|
||||
break;
|
||||
case 'createUser':
|
||||
obj['createUser'] = row.USER_NAME
|
||||
break;
|
||||
}
|
||||
// 更新form对象
|
||||
this.form = Object.assign({}, this.form, obj)
|
||||
},
|
||||
|
||||
//字符串不为空
|
||||
isNotBank(str) {
|
||||
return !isBlank(str);
|
||||
},
|
||||
// 托盘号/条码号 扫描事件
|
||||
scanEvent() {
|
||||
let me = this
|
||||
let targetWarehouse = me.form.targetWarehouse
|
||||
// 如果 目标仓库 为空,则报错
|
||||
if (isBlank(targetWarehouse)) {
|
||||
me.form.carrierNumberOrLotNumber = ''
|
||||
// 目标仓库不可为空
|
||||
me.$message.error('目标仓库字段为空,请选择')
|
||||
return false;
|
||||
}
|
||||
|
||||
let scanValue = me.form.carrierNumberOrLotNumber
|
||||
// 如果 托盘号/条码号扫描框 为空,则报错
|
||||
if (isBlank(scanValue)) {
|
||||
// 托盘号/条码号扫描框不能为空
|
||||
return me.$message.error('托盘号/条码号扫描框不能为空')
|
||||
}
|
||||
|
||||
let storagRequestList = me.storagRequestList;
|
||||
let documentNo = "";
|
||||
for (let rowObject of storagRequestList) {
|
||||
if (scanValue === rowObject.carrierNumber || scanValue === rowObject.lotNumber) {
|
||||
me.$message.error(stringFormat('托盘号/条码号[{0}]已扫描', scanValue));
|
||||
return me.form.carrierNumberOrLotNumber = "";
|
||||
}
|
||||
if (me.isNotBank(documentNo) && me.isNotBank(rowObject.documentNo)) {
|
||||
if (documentNo !== rowObject.documentNo) {
|
||||
return me.$message.error('请检索单据号或清除页面后操作');
|
||||
}
|
||||
} else {
|
||||
documentNo = rowObject.documentNo;
|
||||
}
|
||||
}
|
||||
|
||||
let param = {
|
||||
"targetWarehouse": targetWarehouse,
|
||||
"carrierNumberOrLotNumber": scanValue,
|
||||
"targetStoLoc": this.targetStoLoc,
|
||||
};
|
||||
|
||||
showLoading();
|
||||
barScanEvent(param).then(res => {
|
||||
hideLoading();
|
||||
if (res.data.code !== 0) {
|
||||
return this.$message.error(res.data.msg);
|
||||
}
|
||||
if (res.data.data) {
|
||||
let data = res.data.data;
|
||||
for (let dataObject of data) {
|
||||
let isDuplicate = false;
|
||||
// 检查 dataObject.lotNumber 是否已经存在于 storagRequestList 中
|
||||
for (let rowObject of storagRequestList) {
|
||||
if (dataObject.lotNumber === rowObject.lotNumber) {
|
||||
isDuplicate = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isDuplicate) {
|
||||
me.$message.error(stringFormat('托盘号[{0}]上的条码号[{1}]已扫描',scanValue ,dataObject.lotNumber));
|
||||
return me.form.carrierNumberOrLotNumber = "";
|
||||
}
|
||||
}
|
||||
|
||||
for (let dataObject of data) {
|
||||
storagRequestList.push(dataObject);
|
||||
setSeq(this.storagRequestList, 'seq');
|
||||
}
|
||||
}
|
||||
me.form.carrierNumberOrLotNumber = "";
|
||||
me.$nextTick(() => {
|
||||
me.$refs.storagRequestData.clearSelection();
|
||||
me.$refs.carrierNumberOrLotNumberInput.focus(); // 视图出现后使input获取焦点
|
||||
});
|
||||
}).catch(() => {
|
||||
hideLoading();
|
||||
me.form.carrierNumberOrLotNumber = "";
|
||||
me.$nextTick(() => {
|
||||
me.$refs.storagRequestData.clearSelection();
|
||||
me.$refs.carrierNumberOrLotNumberInput.focus(); // 视图出现后使input获取焦点
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
// 保存
|
||||
doSave() {
|
||||
let me = this;
|
||||
|
||||
let tmp = me.storagRequestList.filter(o => isBlank(o.handle));
|
||||
|
||||
for (let rowObject of me.storagRequestList) {
|
||||
rowObject.seq = null;
|
||||
}
|
||||
|
||||
/*if (!tmp || tmp.length <= 0) {
|
||||
return me.$message.warning('没有要保存的数据');
|
||||
}*/
|
||||
|
||||
let param = {
|
||||
documentNo: me.form.documentNo,
|
||||
targetStorage: me.form.targetStorage,
|
||||
storagRequestDetailList: tmp
|
||||
};
|
||||
|
||||
showLoading();
|
||||
greatSaveOrUpdate(param).then(response => {
|
||||
hideLoading();
|
||||
if (response.data.code != 0) {
|
||||
return me.$message.error(response.data.msg);
|
||||
}
|
||||
me.form.documentNo = response.data.data;
|
||||
me.doSearch();
|
||||
me.$message.success('保存成功');
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
hideLoading();
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
//提交
|
||||
doSubmit() {
|
||||
let me = this;
|
||||
let documentNo = me.form.documentNo;
|
||||
if (isBlank(documentNo)) {
|
||||
return me.$message.error('请检索单据号操作');
|
||||
}
|
||||
|
||||
debugger
|
||||
for (let rowObject of me.storagRequestList) {
|
||||
if (me.isNotBank(documentNo)) {
|
||||
if (documentNo !== rowObject.documentNo) {
|
||||
return me.$message.error('请检索单据号操作');
|
||||
}
|
||||
}
|
||||
}
|
||||
showLoading();
|
||||
submit(me.site, documentNo).then(response => {
|
||||
hideLoading();
|
||||
if (response.data.code != 0) {
|
||||
return me.$message.error(response.data.msg);
|
||||
}
|
||||
me.$message.success('提交成功');
|
||||
// 调用查询方法
|
||||
me.doSearch();
|
||||
// 判断作业规则中 isPrint 是否为Y,如果是则调用打印否则不调用
|
||||
if (this.isPrint == 'Y') {
|
||||
// 调用打印方法
|
||||
me.doRePrint();
|
||||
}
|
||||
|
||||
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
// 移除选定项
|
||||
doToolbarDelete() {
|
||||
let me = this;
|
||||
let indices = me.multipleSelection;
|
||||
if (indices.length < 1) {
|
||||
return me.$message.warning('请选择行');
|
||||
}
|
||||
for (let i = indices.length - 1; i >= 0; i--) {
|
||||
for (let j = 0; j < me.storagRequestList.length; j++) {
|
||||
if (indices[i].seq === me.storagRequestList[j].seq) {
|
||||
let temp = me.storagRequestList[j].carrierNumber
|
||||
if (isBlank(temp)) {
|
||||
temp = me.storagRequestList[j].lotNumber
|
||||
}
|
||||
if (!isBlank(indices[i]['handle']) && (indices[i]['documentStatus'] === '保存')) {
|
||||
return me.$message.error(stringFormat('托盘号[{0}]已经保存,不可移除;请检索单据后删除', temp));
|
||||
}
|
||||
if (!isBlank(indices[i]['handle']) && (indices[i]['documentStatus'] === '提交')) {
|
||||
return me.$message.error(stringFormat('托盘号[{0}]已经提交,不可移除', temp));
|
||||
}
|
||||
if (!isBlank(indices[i]['handle']) && (indices[i]['documentStatus'] === '关闭')) {
|
||||
return me.$message.error(stringFormat('托盘号[{0}]已经关闭,不可移除', temp));
|
||||
}
|
||||
if (!isBlank(indices[i]['handle']) && (indices[i]['documentStatus'] === '拒收')) {
|
||||
return me.$message.error(stringFormat('托盘号[{0}]已经拒收,不可移除', temp));
|
||||
}
|
||||
me.storagRequestList.splice(j, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
me.$refs.storagRequestData.clearSelection();
|
||||
setSeq(this.storagRequestList, 'seq');
|
||||
},
|
||||
|
||||
//删除
|
||||
doDelete() {
|
||||
let me = this;
|
||||
let storagRequestList = me.storagRequestList;
|
||||
let documentNo = me.form.documentNo;
|
||||
if (isBlank(documentNo)) {
|
||||
return me.$message.error('请检索单据号操作');
|
||||
}
|
||||
for (let rowObject of storagRequestList) {
|
||||
if (me.isNotBank(documentNo)) {
|
||||
if (documentNo !== rowObject.documentNo) {
|
||||
return me.$message.error('请检索单据号后操作');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let selectedIndices = me.multipleSelection;
|
||||
let removeList = [];
|
||||
if (selectedIndices && selectedIndices.length > 0) {
|
||||
for (let index in selectedIndices) {
|
||||
if (storagRequestList[index].handle) {
|
||||
removeList.push(storagRequestList[index].handle);
|
||||
}
|
||||
}
|
||||
|
||||
let param = {
|
||||
documentNo: documentNo,
|
||||
removeList: removeList
|
||||
};
|
||||
|
||||
showLoading();
|
||||
greatDelete(param).then(response => {
|
||||
hideLoading();
|
||||
if (response.data.code != 0) {
|
||||
return me.$message.error(response.data.msg);
|
||||
}
|
||||
me.doReset();
|
||||
me.$message.success('删除成功');
|
||||
me.$refs.storagRequestData.clearSelection(); // 视图出现后使input获取焦点
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
hideLoading();
|
||||
});
|
||||
} else {
|
||||
return me.$message.warning('请先勾选要删除的数据');
|
||||
}
|
||||
},
|
||||
|
||||
// 搜索事件
|
||||
doSearch() {
|
||||
let me = this;
|
||||
let timeRange = me.form.timeRange;
|
||||
|
||||
let startTime = "";
|
||||
let endTime = "";
|
||||
if(!timeRange || timeRange == null) {
|
||||
startTime = "";
|
||||
endTime = "";
|
||||
} else {
|
||||
startTime = timeRange[0];
|
||||
endTime = timeRange[1];
|
||||
}
|
||||
|
||||
let param = {
|
||||
"site": me.site,
|
||||
"documentNo": me.form.documentNo,
|
||||
"documentStatus": me.form.documentStatus,
|
||||
"targetWarehouse": me.form.targetWarehouse,
|
||||
"sourceWarehouse": me.form.sourceWarehouse,
|
||||
"item": me.form.item,
|
||||
"createUser": me.form.createUser,
|
||||
"startTime": startTime,
|
||||
"endTime": endTime,
|
||||
};
|
||||
me.storagRequestList = [];
|
||||
|
||||
showLoading();
|
||||
getObj(param,me.page).then(res => {
|
||||
hideLoading();
|
||||
if (res.data.code !== 0) {
|
||||
return me.$message.error(res.data.msg);
|
||||
}
|
||||
if(res.data.data.records.length === 0){
|
||||
return me.$message.error("查询无数据");
|
||||
}
|
||||
me.storagRequestList = res.data.data.records;
|
||||
me.page.total = res.data.data.total;
|
||||
me.page.current = res.data.data.current;
|
||||
setSeq(this.storagRequestList, 'seq')
|
||||
}).catch(() => {
|
||||
hideLoading();
|
||||
})
|
||||
},
|
||||
|
||||
// 导出excel
|
||||
doExcel() {
|
||||
this.downBlobFile(nlv_wms('/z-storag-request/exportData'), this.form, '生产入库单.xlsx')
|
||||
},
|
||||
//表格多选
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
|
||||
// 单据补打印
|
||||
doRePrint() {
|
||||
let me = this;
|
||||
let storagRequestList = me.storagRequestList;
|
||||
let documentNo = me.form.documentNo;
|
||||
if (isBlank(documentNo)) {
|
||||
return me.$message.error('请检索单据号后操作');
|
||||
}
|
||||
for (let rowObject of storagRequestList) {
|
||||
if (me.isNotBank(documentNo)) {
|
||||
|
||||
if (documentNo !== rowObject.documentNo) {
|
||||
return me.$message.error('请检索单据号后操作');
|
||||
}
|
||||
|
||||
// 调用
|
||||
// me.doSearch();
|
||||
console.log(rowObject.documentStatus);
|
||||
if (rowObject.documentStatus !== '提交' ) {
|
||||
return me.$message.error(documentNo+'单据状态不是提交状态不允许打印');
|
||||
}
|
||||
}
|
||||
}
|
||||
showLoading();
|
||||
axios({
|
||||
method: 'get',
|
||||
url: nlv_wms('/z-storag-request/rePrint/' + documentNo + '/' + me.site),
|
||||
headers: {
|
||||
'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
|
||||
},
|
||||
responseType: 'blob' //设置响应的数据类型为一个包含二进制数据的 Blob 对象,必须设置!!!
|
||||
}).then(response => {
|
||||
hideLoading();
|
||||
// 处理返回的文件流
|
||||
const binaryData = [];
|
||||
binaryData.push(response);
|
||||
if (binaryData[0].size === 0) {
|
||||
return this.$notify.error("内容为空,无法下载");
|
||||
}
|
||||
let pdfUrl = window.URL.createObjectURL(new Blob([response.data], {type: response.data.type}));
|
||||
const newPage = window.open(pdfUrl, "_blank", "scrollbars=yes,resizable=1,modal=false,alwaysRaised=yes");
|
||||
newPage.document.title = documentNo + '.pdf';
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
// 清空
|
||||
doReset() {
|
||||
this.form = Object.assign({}, this.initData);
|
||||
this.page = {
|
||||
total: 0,
|
||||
current: 1,
|
||||
size: 20
|
||||
};
|
||||
this.multipleSelection = [];
|
||||
// 清空列表信息
|
||||
this.storagRequestList = [];
|
||||
},
|
||||
|
||||
handleSizeChange(val) {
|
||||
let me = this
|
||||
me.page.size = val
|
||||
me.doSearch()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
let me = this
|
||||
me.page.current = val
|
||||
me.doSearch()
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
101
src/views/mes/wip/product-storag-request/init.js
Normal file
101
src/views/mes/wip/product-storag-request/init.js
Normal file
@ -0,0 +1,101 @@
|
||||
// 单据号
|
||||
export const documentNoDialogObj = {
|
||||
title: '单据选择',
|
||||
"condition": "searchText",
|
||||
tableColumn: [
|
||||
{prop: 'DOCUMENT_NO', label: '单据号'},
|
||||
{prop: 'DOCUMENT_STATUS', label: '单据状态'}
|
||||
],
|
||||
}
|
||||
|
||||
// 目标仓库
|
||||
export const targetWarehouseDialogObj = {
|
||||
title: '目标仓库选择',
|
||||
"condition": "searchText",
|
||||
tableColumn: [
|
||||
{prop: 'TARGET_WAREHOUSE', label: '仓库编码'},
|
||||
{prop: 'TARGET_WAREHOUSE_DESC', label: '仓库描述'}
|
||||
],
|
||||
queryParam: {
|
||||
targetWarehouse:''
|
||||
},
|
||||
}
|
||||
|
||||
// 来源仓库
|
||||
export const sourceWarehouseDialogObj = {
|
||||
title: '来源仓库选择',
|
||||
"condition": "searchText",
|
||||
tableColumn: [
|
||||
{prop: 'SOURCE_WAREHOUSE', label: '仓库编码'},
|
||||
{prop: 'SOURCE_WAREHOUSE_DESC', label: '仓库描述'}
|
||||
],
|
||||
}
|
||||
|
||||
// 物料
|
||||
export const itemDialogObj = {
|
||||
title: '物料选择',
|
||||
"condition": "searchText",
|
||||
tableColumn: [
|
||||
{prop: 'ITEM', label: '物料编码'},
|
||||
{prop: 'ITEM_DESCRIPTION', label: '物料描述'}
|
||||
],
|
||||
}
|
||||
|
||||
// 创建人
|
||||
export const createUserDialogObj = {
|
||||
title: '创建人选择',
|
||||
"condition": "searchText",
|
||||
tableColumn: [
|
||||
{prop: 'USER_NAME', label: '用户名'},
|
||||
{prop: 'NAME', label: '姓名'}
|
||||
],
|
||||
}
|
||||
|
||||
// 单据状态
|
||||
export const documentStatusList = [
|
||||
{
|
||||
value: 'SAVE',
|
||||
label: '保存',
|
||||
},
|
||||
{
|
||||
value: 'SUBMIT',
|
||||
label: '提交',
|
||||
},
|
||||
{
|
||||
value: 'CLOSE',
|
||||
label: '关闭',
|
||||
},
|
||||
{
|
||||
value: 'REJECT',
|
||||
label: '拒收',
|
||||
},
|
||||
]
|
||||
|
||||
// 便捷时间范围选项
|
||||
export const pickerOptions = {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user