生产报工平台逻辑修改
This commit is contained in:
parent
cd4ac94501
commit
a8fe049555
@ -40,3 +40,11 @@ export function findPoOrderDataByPo(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function findDocumentDetailDataByDocumentNo(query) {
|
||||
return request({
|
||||
url: mom_wms('/po-order/findDocumentDetailDataByDocumentNo'),
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
@ -257,7 +257,7 @@
|
||||
<el-table-column prop="lotNo" label="LOT号" width="120"></el-table-column>
|
||||
<el-table-column prop="item" label="产出物料"></el-table-column>
|
||||
<el-table-column prop="item" label="物料描述"></el-table-column>
|
||||
<el-table-column prop="sapBatchNo" label="SAP批次"></el-table-column>
|
||||
<el-table-column prop="sapBatchNo" label="SAP批次" width="150"></el-table-column>
|
||||
<el-table-column prop="externalLot" label="客户批号"></el-table-column>
|
||||
<el-table-column prop="productType" label="入库类型"></el-table-column>
|
||||
<el-table-column prop="mainQty" label="数量"></el-table-column>
|
||||
|
||||
@ -17,6 +17,53 @@
|
||||
:modal-show.sync="showPoRegisterDialogVisible"
|
||||
@inputDialogSelected="poRegisterDialogSelected"></input-select-dialog>
|
||||
|
||||
<el-dialog title="收货明细"
|
||||
:fullscreen="true"
|
||||
:close-on-click-modal="false"
|
||||
:close-on-press-escape="false"
|
||||
custom-class="custom-dialog"
|
||||
:visible.sync="dialogDocumentDetailVisible"
|
||||
@close="dialogDocumentDetailVisible = false"
|
||||
center>
|
||||
<el-form :model="detailFormObj" label-width="100px">
|
||||
<el-row :gutter="24">
|
||||
<el-descriptions title="采购订单">
|
||||
<el-descriptions-item label="采购订单号">{{ detailFormObj.po }}</el-descriptions-item>
|
||||
<el-descriptions-item label="采购到货单号">{{ detailFormObj.documentNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="到货单状态">{{ detailFormObj.state }}</el-descriptions-item>
|
||||
<el-descriptions-item label="供应商">{{ detailFormObj.customerNo }}</el-descriptions-item>
|
||||
<el-descriptions-item label="采购日期">{{ detailFormObj.procurementDate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="采购组">{{ detailFormObj.purchaser }}</el-descriptions-item>
|
||||
<el-descriptions-item label="登记日期">{{ detailFormObj.createDate }}</el-descriptions-item>
|
||||
<el-descriptions-item label="登记人">{{ detailFormObj.createUser }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-row>
|
||||
<el-tabs>
|
||||
<el-tab-pane label="收货明细">
|
||||
<el-table :data="detailFormObj.detailList" max-height="360"
|
||||
:header-cell-style="{ 'text-align': 'center' }"
|
||||
:cell-style="{ 'text-align': 'center' }" tooltip-effect="dark" border style="width: 100%">
|
||||
<el-table-column type="index" width="60" fixed="left" label="序号"></el-table-column>
|
||||
<el-table-column prop="iqcResults" label="IQC状态"></el-table-column>
|
||||
<el-table-column prop="item" label="物料"></el-table-column>
|
||||
<el-table-column prop="itemDescription" label="物料名称"></el-table-column>
|
||||
<el-table-column prop="unitOfMeasure" label="单位"></el-table-column>
|
||||
<el-table-column prop="state" label="行状态"></el-table-column>
|
||||
<el-table-column prop="applicationsQuantity" label="申请数量"></el-table-column>
|
||||
<el-table-column prop="actualQuantity" label="实际数量" ></el-table-column>
|
||||
<el-table-column prop="salesBatch" label="出货批次"></el-table-column>
|
||||
<el-table-column prop="registeredQty" label="已登记数量" width="110"></el-table-column>
|
||||
<el-table-column prop="completedQty" label="已入库数量" width="110"></el-table-column>
|
||||
<el-table-column prop="createDate" label="生产日期"></el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogDocumentDetailVisible = false">关 闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog title="收货登记"
|
||||
:fullscreen="true"
|
||||
:close-on-click-modal="false"
|
||||
@ -188,7 +235,7 @@
|
||||
<el-table-column label="操作" width="80" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<!-- 查看 -->
|
||||
<el-button class="custom-mini-button" size="mini" style="margin-left: 5px">查看</el-button>
|
||||
<el-button class="custom-mini-button" size="mini" style="margin-left: 5px" @click="searchDetailDataAction(scope.row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -233,6 +280,7 @@ import {copyJSON} from "@/util/util";
|
||||
import moment from 'moment';
|
||||
import {isBlank} from "@/util/string";
|
||||
import {
|
||||
findDocumentDetailDataByDocumentNo,
|
||||
findPoOrderDataByPo,
|
||||
getDetailByPo,
|
||||
getDocumentPage,
|
||||
@ -247,6 +295,10 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
username: getStore({name: 'userInfo'}).username,
|
||||
dialogDocumentDetailVisible: false,
|
||||
detailFormObj: {
|
||||
detailList: []
|
||||
},
|
||||
registerFormObj: {
|
||||
po: "",
|
||||
purchaser: "",
|
||||
@ -535,10 +587,13 @@ export default {
|
||||
showLoading();
|
||||
saveDocumentDetailData(newArray).then(res => {
|
||||
hideLoading();
|
||||
debugger
|
||||
this.$message.success("执行成功");
|
||||
me.dialogRegisterVisible = false;
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
this.$message.error(error);
|
||||
debugger
|
||||
});
|
||||
}else{
|
||||
this.$message.error("本次到货数量不能为空");
|
||||
@ -562,6 +617,20 @@ export default {
|
||||
me.materialCompleteList = [];
|
||||
},
|
||||
|
||||
// 检索收获单明细
|
||||
searchDetailDataAction(row){
|
||||
let me = this;
|
||||
showLoading();
|
||||
findDocumentDetailDataByDocumentNo({documentNo: row.documentNo}).then(res => {
|
||||
hideLoading();
|
||||
me.dialogDocumentDetailVisible = true;
|
||||
Object.assign(me.detailFormObj,row);
|
||||
me.detailFormObj.detailList = res.data.data;
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
handleWipReSizeChange(val) {
|
||||
this.wipRe.pageSize = val;
|
||||
},
|
||||
@ -598,109 +667,6 @@ export default {
|
||||
return obj != undefined ? obj.label : srcVal;
|
||||
},
|
||||
|
||||
// 同步扣料数据报工数据
|
||||
materialSyncAction(postingDate){
|
||||
let me = this;
|
||||
if(me.mtrlConsSelection.length>0){
|
||||
me.mtrlConsSelection.forEach(ite=>{
|
||||
ite.syncPostingDate = postingDate;
|
||||
});
|
||||
showLoading();
|
||||
callErpMaterialTransaction(me.mtrlConsSelection).then(res => {
|
||||
hideLoading();
|
||||
this.$message.success('同步成功');
|
||||
me.searchFormObjAction();
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
this.$message.error('错误:'+error);
|
||||
me.searchFormObjAction();
|
||||
});
|
||||
}else{
|
||||
this.$message.error('请选择数据');
|
||||
}
|
||||
},
|
||||
|
||||
// 同步批次完工报工数据
|
||||
lotSyncAction(postingDate){
|
||||
let me = this;
|
||||
if(me.mtrlCompleteSelection.length>0){
|
||||
me.mtrlCompleteSelection.forEach(ite=>{
|
||||
ite.syncPostingDate = postingDate;
|
||||
});
|
||||
showLoading();
|
||||
callErpLotCompleteTransaction(me.mtrlCompleteSelection).then(res => {
|
||||
hideLoading();
|
||||
this.$message.success('同步成功');
|
||||
me.searchFormObjAction();
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
this.$message.error('错误:'+error);
|
||||
me.searchFormObjAction();
|
||||
});
|
||||
}else{
|
||||
this.$message.error('请选择数据');
|
||||
}
|
||||
},
|
||||
|
||||
// 同步工单报工数据
|
||||
soSyncAction(postingDate){
|
||||
let me = this;
|
||||
if(me.wipReportSelection.length>0){
|
||||
me.wipReportSelection.forEach(ite=>{
|
||||
ite.syncPostingDate = postingDate;
|
||||
});
|
||||
showLoading();
|
||||
callErpShopOrderStatisticsTransaction(me.wipReportSelection).then(res => {
|
||||
hideLoading();
|
||||
this.$message.success('同步成功');
|
||||
me.searchFormObjAction();
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
me.searchFormObjAction();
|
||||
});
|
||||
}else{
|
||||
this.$message.error('请选择数据');
|
||||
}
|
||||
},
|
||||
|
||||
// 同步工单报工取消事件
|
||||
soSyncCancelAction(){
|
||||
let me = this;
|
||||
if(me.wipReportSelection.length>0){
|
||||
showLoading();
|
||||
callErpSoStatistCancelTransaction(me.wipReportSelection).then(res => {
|
||||
hideLoading();
|
||||
this.$message.success('同步成功');
|
||||
me.searchFormObjAction();
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
me.searchFormObjAction();
|
||||
});
|
||||
}else{
|
||||
this.$message.error('请选择数据');
|
||||
}
|
||||
},
|
||||
|
||||
// 物料消耗和完工入库确认抛送ERP
|
||||
postErpSure(){
|
||||
let me = this;
|
||||
if(isBlank(me.postingDateForm.postingDate)){
|
||||
this.$message.error('请设定过账日期');
|
||||
return;
|
||||
}
|
||||
me.dialogPostingDateVisible = false;
|
||||
if(me.activeName === 'materialComplete'){
|
||||
me.lotSyncAction(me.postingDateForm.postingDate);
|
||||
}else if(me.activeName === 'materialConsumption'){
|
||||
me.materialSyncAction(me.postingDateForm.postingDate);
|
||||
}else if(me.activeName === 'wipReportSap'){
|
||||
me.soSyncAction(me.postingDateForm.postingDate);
|
||||
}else{
|
||||
this.$message.error('未获取到正确到报工选项');
|
||||
}
|
||||
me.postingDateForm.postingDate = '';
|
||||
},
|
||||
|
||||
wipReportSelectionChange(val){
|
||||
this.wipReportSelection = val;
|
||||
},
|
||||
|
||||
@ -11,6 +11,17 @@
|
||||
:modal-fetch-fun='storageLocationDialogFetchFun'
|
||||
:modal-show.sync="storageLocationDialogVisible"
|
||||
@inputDialogSelected="storageLocationSelect"></input-select-dialog>
|
||||
|
||||
<input-select-dialog :modal-obj='fabNoDialogObj'
|
||||
:modal-fetch-fun='fabNoDialogFetchFun'
|
||||
:modal-show.sync="fabNoDialogVisible"
|
||||
@inputDialogSelected="fabNoSelect"></input-select-dialog>
|
||||
|
||||
<input-select-dialog :modal-obj='workCenterDialogObj'
|
||||
:modal-fetch-fun='workCenterDialogFetchFun'
|
||||
:modal-show.sync="workCenterDialogVisible"
|
||||
@inputDialogSelected="workCenterSelect"></input-select-dialog>
|
||||
|
||||
<basic-container>
|
||||
<avue-crud ref="crud" :page.sync="page" :data="tableData" v-model="form" :permission="permissionList"
|
||||
:table-loading="tableLoading" :option="tableOption" @on-load="getList" @search-change="searchChange"
|
||||
@ -36,6 +47,18 @@
|
||||
<i slot="suffix" class="el-input__icon el-icon-search" @click.stop="showStorageLocationDialog"></i>
|
||||
</el-input>
|
||||
</template>
|
||||
<template slot-scope="scope" slot="fabNoForm">
|
||||
<el-input placeholder="请输入车间代码" v-model="form.fabNo">
|
||||
<i slot="suffix" class="el-input__icon el-icon-search"
|
||||
@click.stop="showFabNoDialog"></i>
|
||||
</el-input>
|
||||
</template>
|
||||
<template slot-scope="scope" slot="workCenterForm">
|
||||
<el-input placeholder="请输入工作中心" v-model="form.workCenter">
|
||||
<i slot="suffix" class="el-input__icon el-icon-search"
|
||||
@click.stop="showWorkCenterDialog"></i>
|
||||
</el-input>
|
||||
</template>
|
||||
<template slot="menuLeft" slot-scope="{size}">
|
||||
<el-button type="primary" icon="el-icon-printer" :size="size" @click="printCode()"
|
||||
:disabled="!print_permissions">打印
|
||||
@ -53,383 +76,445 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {fetchList, getObj, addObj, putObj, delObj, labelPrint, updateBatchById} from '@/api/wms/storage-location';
|
||||
import {getByActivityOption} from "@/api/admin/activity-option";
|
||||
import { getLocation} from "@/api/wms/storage-location";
|
||||
import {showLoading, hideLoading} from '@/const/loading';
|
||||
import {mapGetters} from 'vuex';
|
||||
import {stringFormat, isBlank} from "@/util/string";
|
||||
import {fetchList as fetchWarehouseList} from "@/api/wms/warehouse";
|
||||
import {fetchList as fetchStorageLocationTypeList} from "@/api/wms/storage-location-type";
|
||||
import {getStore} from '@/util/store';
|
||||
import {fetchList, getObj, addObj, putObj, delObj, labelPrint, updateBatchById, getLocation} from '@/api/wms/storage-location';
|
||||
import {getByActivityOption} from "@/api/admin/activity-option";
|
||||
import {showLoading, hideLoading} from '@/const/loading';
|
||||
import {mapGetters} from 'vuex';
|
||||
import {stringFormat, isBlank} from "@/util/string";
|
||||
import {getStore} from '@/util/store';
|
||||
import { fetchList as fbNoFetchList } from '@/api/mes/smd/fab-basis';
|
||||
import { fetchList as fetchWorkCenterList } from '@/api/mes/prd/work-center';
|
||||
import {fetchList as fetchWarehouseList} from "@/api/mes/wms-nalinv/warehouse";
|
||||
import { fetchList as fetchStorageLocationTypeList } from '@/api/wms/storage-location-type';
|
||||
|
||||
export default {
|
||||
name: 'wmsstoragelocation',
|
||||
data() {
|
||||
var validateName = (rule, value, callback) => {
|
||||
let acount = /[\u4E00-\u9FA5]/g;
|
||||
if (value === '') {
|
||||
callback(new Error('名称不可为空'));
|
||||
} else if (acount.test(value)) {
|
||||
callback(new Error('名称不可包含中文'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
form: {},
|
||||
selectList: [], //打印传的数据
|
||||
searchForm: {},
|
||||
printer: "",
|
||||
tableData: [],
|
||||
page: {
|
||||
total: 0, // 总页数
|
||||
currentPage: 1, // 当前页数
|
||||
pageSize: 20 // 每页显示多少条
|
||||
},
|
||||
tableLoading: false,
|
||||
tableOption: {
|
||||
"tip": false,
|
||||
"reserveSelection": true,
|
||||
"selection": true,
|
||||
"border": true,
|
||||
"index": true,
|
||||
"indexLabel": "序号",
|
||||
"stripe": true,
|
||||
"menuAlign": "center",
|
||||
"align": "center",
|
||||
"searchLabelWidth": 100,
|
||||
"column": [
|
||||
{
|
||||
"type": "input",
|
||||
"label": "存储位置",
|
||||
"search": true,
|
||||
"editDisabled": true,
|
||||
"maxlength": 12,
|
||||
"prop": "storageLocation",
|
||||
"span": 12,
|
||||
"required": true,
|
||||
"rules": [{validator: validateName, trigger: 'blur', "required": true}]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "描述",
|
||||
"prop": "description",
|
||||
"span": 12
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "存储位置类型",
|
||||
"search": true,
|
||||
"prop": "storageLocationType",
|
||||
"formslot": true,
|
||||
"span": 12,
|
||||
"required": true,
|
||||
"rules": [{
|
||||
"message": "请选择存储位置类型",
|
||||
"required": true
|
||||
}],
|
||||
"hide":true
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "存储位置类型",
|
||||
"prop": "storageLocationTypeDesc",
|
||||
"span": 12,
|
||||
"disabled":true
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "仓库",
|
||||
"prop": "warehouse",
|
||||
"formslot": true,
|
||||
"span": 12,
|
||||
"required": true,
|
||||
"rules": [{
|
||||
"message": "请选择仓库",
|
||||
"required": true
|
||||
}]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"search": true,
|
||||
"label": "ERP仓库编号",
|
||||
"prop": "erpStorageLocation",
|
||||
"span": 12
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"label": "默认存储位置",
|
||||
"prop": "isDefault",
|
||||
"span": 12,
|
||||
dicData: [{
|
||||
label: '否',
|
||||
value: "N"
|
||||
},
|
||||
{
|
||||
label: '是',
|
||||
value: "Y"
|
||||
}],
|
||||
export default {
|
||||
name: 'wmsstoragelocation',
|
||||
data() {
|
||||
var validateName = (rule, value, callback) => {
|
||||
let acount = /[\u4E00-\u9FA5]/g;
|
||||
if (value === '') {
|
||||
callback(new Error('名称不可为空'));
|
||||
} else if (acount.test(value)) {
|
||||
callback(new Error('名称不可包含中文'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
form: {},
|
||||
selectList: [], //打印传的数据
|
||||
searchForm: {},
|
||||
printer: "",
|
||||
tableData: [],
|
||||
page: {
|
||||
total: 0, // 总页数
|
||||
currentPage: 1, // 当前页数
|
||||
pageSize: 20 // 每页显示多少条
|
||||
},
|
||||
tableLoading: false,
|
||||
tableOption: {
|
||||
"tip": false,
|
||||
"reserveSelection": true,
|
||||
"selection": true,
|
||||
"border": true,
|
||||
"index": true,
|
||||
"indexLabel": "序号",
|
||||
"stripe": true,
|
||||
"menuAlign": "center",
|
||||
"align": "center",
|
||||
"searchLabelWidth": 120,
|
||||
"column": [
|
||||
{
|
||||
"type": "input",
|
||||
"label": "存储位置",
|
||||
"search": true,
|
||||
"editDisabled": true,
|
||||
"maxlength": 12,
|
||||
"prop": "storageLocation",
|
||||
"span": 12,
|
||||
"required": true,
|
||||
"rules": [{validator: validateName, trigger: 'blur', "required": true}]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "描述",
|
||||
"prop": "description",
|
||||
"span": 12
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "存储位置类型",
|
||||
"search": true,
|
||||
"prop": "storageLocationType",
|
||||
"formslot": true,
|
||||
"span": 12,
|
||||
"required": true,
|
||||
"rules": [{
|
||||
"message": "请选择存储位置类型",
|
||||
"required": true
|
||||
}],
|
||||
"hide":true
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "存储位置类型",
|
||||
"prop": "storageLocationTypeDesc",
|
||||
"span": 12,
|
||||
"disabled":true
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "仓库",
|
||||
"prop": "warehouse",
|
||||
"formslot": true,
|
||||
"span": 12,
|
||||
"required": true,
|
||||
"rules": [{
|
||||
"message": "请选择仓库",
|
||||
"required": true
|
||||
}]
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"search": true,
|
||||
"label": "ERP仓库编号",
|
||||
"prop": "erpStorageLocation",
|
||||
"span": 12
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "车间",
|
||||
"search": false,
|
||||
"prop": "fabNo",
|
||||
"formslot": true,
|
||||
"span": 12
|
||||
},
|
||||
{
|
||||
"type": "input",
|
||||
"label": "工作中心",
|
||||
"search": false,
|
||||
"prop": "workCenter",
|
||||
"formslot": true,
|
||||
"span": 12
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"label": "默认存储位置",
|
||||
"prop": "isDefault",
|
||||
"span": 12,
|
||||
dicData: [{
|
||||
label: '否',
|
||||
value: "N"
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"search": true,
|
||||
"label": "是否启用",
|
||||
"prop": "status",
|
||||
"span": 12,
|
||||
dicData: [
|
||||
{
|
||||
label: '否',
|
||||
value: "N"
|
||||
}, {
|
||||
label: '是',
|
||||
value: "Y"
|
||||
}
|
||||
],
|
||||
value: "Y"
|
||||
},
|
||||
]
|
||||
},
|
||||
warehouseDialogVisible: false,
|
||||
warehouseDialogFetchFun: fetchWarehouseList,
|
||||
warehouseDialogObj: {
|
||||
"condition": "warehouse",
|
||||
tableColumn: [
|
||||
{prop: "warehouse", label: "仓库", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
},
|
||||
storageLocationTypeDialogVisible: false,
|
||||
storageLocationTypeDialogFetchFun: fetchStorageLocationTypeList,
|
||||
storageLocationTypeDialogObj: {
|
||||
"condition": "storageLocationType",
|
||||
tableColumn: [
|
||||
{prop: "storageLocationType", label: "存储位置类型", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
},
|
||||
storageLocationDialogVisible: false,
|
||||
storageLocationDialogFetchFun: getLocation,
|
||||
storageLocationDialogObj: {
|
||||
"condition": "storageLocation",
|
||||
tableColumn: [
|
||||
{prop: "storageLocation", label: "存储位置", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
{
|
||||
label: '是',
|
||||
value: "Y"
|
||||
}],
|
||||
value: "N"
|
||||
},
|
||||
{
|
||||
"type": "switch",
|
||||
"search": true,
|
||||
"label": "是否启用",
|
||||
"prop": "status",
|
||||
"span": 12,
|
||||
dicData: [
|
||||
{
|
||||
label: '否',
|
||||
value: "N"
|
||||
}, {
|
||||
label: '是',
|
||||
value: "Y"
|
||||
}
|
||||
],
|
||||
value: "Y"
|
||||
},
|
||||
]
|
||||
},
|
||||
warehouseDialogVisible: false,
|
||||
warehouseDialogFetchFun: fetchWarehouseList,
|
||||
warehouseDialogObj: {
|
||||
"condition": "warehouse",
|
||||
tableColumn: [
|
||||
{prop: "warehouse", label: "仓库", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
},
|
||||
storageLocationTypeDialogVisible: false,
|
||||
storageLocationTypeDialogFetchFun: fetchStorageLocationTypeList,
|
||||
storageLocationTypeDialogObj: {
|
||||
"condition": "storageLocationType",
|
||||
tableColumn: [
|
||||
{prop: "storageLocationType", label: "存储位置类型", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
},
|
||||
storageLocationDialogVisible: false,
|
||||
storageLocationDialogFetchFun: getLocation,
|
||||
storageLocationDialogObj: {
|
||||
"condition": "storageLocation",
|
||||
tableColumn: [
|
||||
{prop: "storageLocation", label: "存储位置", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
},
|
||||
fabNoDialogVisible: false,
|
||||
fabNoDialogFetchFun: fbNoFetchList,
|
||||
fabNoDialogObj: {
|
||||
"condition": "fabNo",
|
||||
tableColumn: [
|
||||
{prop: "fabNo", label: "车间", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
]
|
||||
},
|
||||
workCenterDialogVisible: false,
|
||||
workCenterDialogFetchFun: fetchWorkCenterList,
|
||||
workCenterDialogObj: {
|
||||
"condition": "workCenter",
|
||||
tableColumn: [
|
||||
{prop: "workCenter", label: "工作中心", width: "200"},
|
||||
{prop: "description", label: "描述"}
|
||||
],
|
||||
queryParam: {
|
||||
fabBasisBo: ''
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//加载站点信息
|
||||
this.site = getStore({name: 'tenantId'});
|
||||
this.print_permissions = this.permissions['wms_storage_location_print'];
|
||||
},
|
||||
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
try {
|
||||
//获取作业规则
|
||||
let me = vm;
|
||||
let activityId = me.$route.query.ACTIVITY_ID;
|
||||
getByActivityOption(activityId, 'PRINTER').then(response => {
|
||||
if (response.data.code != 0) {
|
||||
return me.$message.error(response.data.msg);
|
||||
}
|
||||
if (response.data.data && response.data.data != {} && !isBlank(response.data.data.optionValue)) {
|
||||
me.printer = response.data.data.optionValue;
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['permissions']),
|
||||
permissionList() {
|
||||
return {
|
||||
addBtn: this.vaildData(this.permissions.wms_storage_location_add, false),
|
||||
delBtn: this.vaildData(this.permissions.wms_storage_location_del, false),
|
||||
editBtn: this.vaildData(this.permissions.wms_storage_location_edit, false)
|
||||
};
|
||||
},
|
||||
created() {
|
||||
//加载站点信息
|
||||
this.site = getStore({name: 'tenantId'});
|
||||
this.print_permissions = this.permissions['wms_storage_location_print'];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//显示仓库弹窗框
|
||||
showWarehouseDialog() {
|
||||
let me = this;
|
||||
me.warehouseDialogVisible = true;
|
||||
},
|
||||
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(vm => {
|
||||
try {
|
||||
//获取作业规则
|
||||
let me = vm;
|
||||
let activityId = me.$route.query.ACTIVITY_ID;
|
||||
getByActivityOption(activityId, 'PRINTER').then(response => {
|
||||
if (response.data.code != 0) {
|
||||
return me.$message.error(response.data.msg);
|
||||
}
|
||||
if (response.data.data && response.data.data != {} && !isBlank(response.data.data.optionValue)) {
|
||||
me.printer = response.data.data.optionValue;
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log(e);
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
warehouseSelect(row) {
|
||||
let me = this;
|
||||
me.form.warehouse = row.warehouse;
|
||||
me.form.warehouseBo = row.handle;
|
||||
},
|
||||
|
||||
//显示存储位置类型弹出框
|
||||
showStorageLocationTypeDialog() {
|
||||
let me = this;
|
||||
me.storageLocationTypeDialogVisible = true;
|
||||
},
|
||||
|
||||
storageLocationTypeSelect(row) {
|
||||
let me = this;
|
||||
me.form.storageLocationType = row.storageLocationType;
|
||||
me.form.storageLocationTypeBo = row.handle;
|
||||
me.form.storageLocationTypeDesc = row.description;
|
||||
},
|
||||
|
||||
showStorageLocationDialog() {
|
||||
let me = this;
|
||||
me.storageLocationDialogVisible = true;
|
||||
},
|
||||
|
||||
storageLocationSelect(row) {
|
||||
let me = this;
|
||||
me.form.erpStorageLocation = row.storageLocation;
|
||||
},
|
||||
|
||||
//显示车间代码弹出框
|
||||
showFabNoDialog() {
|
||||
let me = this;
|
||||
me.fabNoDialogVisible = true;
|
||||
},
|
||||
|
||||
fabNoSelect(row) {
|
||||
let me = this;
|
||||
me.form.fabNo = row.fabNo;
|
||||
me.form.fabNoBo = row.handle;
|
||||
},
|
||||
|
||||
showWorkCenterDialog() {
|
||||
let me = this;
|
||||
me.workCenterDialogVisible = true;
|
||||
me.workCenterDialogObj.queryParam.fabBasisBo = me.form.fabNoBo;
|
||||
},
|
||||
|
||||
workCenterSelect(row) {
|
||||
let me = this;
|
||||
me.form.workCenter = row.workCenter;
|
||||
me.form.workCenterBo = row.handle;
|
||||
},
|
||||
|
||||
//表格多选
|
||||
selectionChange(list) {
|
||||
let me = this;
|
||||
me.selectList = list;
|
||||
},
|
||||
|
||||
//取消选择
|
||||
toggleSelection(val) {
|
||||
if (this.$refs.crud) {
|
||||
this.$refs.crud.toggleSelection(val);
|
||||
}
|
||||
},
|
||||
|
||||
searchReset() {
|
||||
this.selectList = [];
|
||||
},
|
||||
|
||||
//打印
|
||||
|
||||
printCode() {
|
||||
let me = this;
|
||||
if (isBlank(me.printer)) {
|
||||
this.$message.error('打印机编号不能为空');
|
||||
return false;
|
||||
}
|
||||
if (me.selectList.length == 0) {
|
||||
this.$message.error('请选择打印数据');
|
||||
return false;
|
||||
}
|
||||
let printList = [];
|
||||
for (let i = 0; i < me.selectList.length; i++) {
|
||||
let obj = {
|
||||
"storageLocation": me.selectList[i].storageLocation,
|
||||
"description": me.selectList[i].description,
|
||||
"printer": me.printer
|
||||
};
|
||||
printList.push(obj);
|
||||
}
|
||||
showLoading();
|
||||
labelPrint(printList).then(respData => {
|
||||
hideLoading();
|
||||
this.$message.success('打印成功');
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['permissions']),
|
||||
permissionList() {
|
||||
return {
|
||||
addBtn: this.vaildData(this.permissions.wms_storage_location_add, false),
|
||||
delBtn: this.vaildData(this.permissions.wms_storage_location_del, false),
|
||||
editBtn: this.vaildData(this.permissions.wms_storage_location_edit, false)
|
||||
};
|
||||
}
|
||||
// 列表查询
|
||||
getList(page, params) {
|
||||
this.tableLoading = true;
|
||||
this.toggleSelection();
|
||||
fetchList(Object.assign({
|
||||
current: page.currentPage,
|
||||
size: page.pageSize
|
||||
}, params, this.searchForm)).then(response => {
|
||||
this.tableData = response.data.data.records;
|
||||
this.page.total = response.data.data.total;
|
||||
this.tableLoading = false;
|
||||
}).catch(() => {
|
||||
this.tableLoading = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//显示仓库弹窗框
|
||||
showWarehouseDialog() {
|
||||
let me = this;
|
||||
me.warehouseDialogVisible = true;
|
||||
},
|
||||
|
||||
warehouseSelect(row) {
|
||||
let me = this;
|
||||
me.form.warehouse = row.warehouse;
|
||||
me.form.warehouseBo = row.handle;
|
||||
},
|
||||
|
||||
//显示存储位置类型弹出框
|
||||
showStorageLocationTypeDialog() {
|
||||
let me = this;
|
||||
me.storageLocationTypeDialogVisible = true;
|
||||
},
|
||||
|
||||
storageLocationTypeSelect(row) {
|
||||
let me = this;
|
||||
me.form.storageLocationType = row.storageLocationType;
|
||||
me.form.storageLocationTypeBo = row.handle;
|
||||
me.form.storageLocationTypeDesc = row.description;
|
||||
},
|
||||
|
||||
showStorageLocationDialog() {
|
||||
let me = this;
|
||||
me.storageLocationDialogVisible = true;
|
||||
},
|
||||
|
||||
storageLocationSelect(row) {
|
||||
let me = this;
|
||||
me.form.erpStorageLocation = row.storageLocation;
|
||||
},
|
||||
|
||||
//表格多选
|
||||
selectionChange(list) {
|
||||
let me = this;
|
||||
me.selectList = list;
|
||||
},
|
||||
|
||||
//取消选择
|
||||
toggleSelection(val) {
|
||||
if (this.$refs.crud) {
|
||||
this.$refs.crud.toggleSelection(val);
|
||||
}
|
||||
},
|
||||
|
||||
searchReset() {
|
||||
this.selectList = [];
|
||||
},
|
||||
|
||||
//打印
|
||||
|
||||
printCode() {
|
||||
let me = this;
|
||||
if (isBlank(me.printer)) {
|
||||
this.$message.error('打印机编号不能为空');
|
||||
return false;
|
||||
}
|
||||
if (me.selectList.length == 0) {
|
||||
this.$message.error('请选择打印数据');
|
||||
return false;
|
||||
}
|
||||
let printList = [];
|
||||
for (let i = 0; i < me.selectList.length; i++) {
|
||||
let obj = {
|
||||
"storageLocation": me.selectList[i].storageLocation,
|
||||
"description": me.selectList[i].description,
|
||||
"printer": me.printer
|
||||
};
|
||||
printList.push(obj);
|
||||
}
|
||||
showLoading();
|
||||
labelPrint(printList).then(respData => {
|
||||
hideLoading();
|
||||
this.$message.success('打印成功');
|
||||
}).catch(error => {
|
||||
hideLoading();
|
||||
});
|
||||
},
|
||||
// 列表查询
|
||||
getList(page, params) {
|
||||
this.tableLoading = true;
|
||||
this.toggleSelection();
|
||||
fetchList(Object.assign({
|
||||
current: page.currentPage,
|
||||
size: page.pageSize
|
||||
}, params, this.searchForm)).then(response => {
|
||||
this.tableData = response.data.data.records;
|
||||
this.page.total = response.data.data.total;
|
||||
this.tableLoading = false;
|
||||
}).catch(() => {
|
||||
this.tableLoading = false;
|
||||
});
|
||||
},
|
||||
// 删除
|
||||
handleDel: function (row, index) {
|
||||
this.$confirm('是否确认删除存储位置' + row.storageLocation, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function () {
|
||||
return delObj(row.handle);
|
||||
}).then(data => {
|
||||
this.$message.success('删除成功');
|
||||
this.getList(this.page);
|
||||
});
|
||||
},
|
||||
// 更新
|
||||
handleUpdate: function (row, index, done, loading) {
|
||||
putObj(row).then(data => {
|
||||
this.$message.success('修改成功');
|
||||
done();
|
||||
this.getList(this.page);
|
||||
}).catch(() => {
|
||||
loading();
|
||||
});
|
||||
},
|
||||
// 保存
|
||||
handleSave: function (row, done, loading) {
|
||||
addObj(row).then(data => {
|
||||
this.$message.success('添加成功');
|
||||
done();
|
||||
this.getList(this.page);
|
||||
}).catch(() => {
|
||||
loading();
|
||||
});
|
||||
},
|
||||
// 每页条数改变事件
|
||||
sizeChange(pageSize) {
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
// 当前页发生改变事件
|
||||
currentChange(current) {
|
||||
this.toggleSelection();
|
||||
this.page.currentPage = current;
|
||||
},
|
||||
// 查询事件
|
||||
searchChange(form, done) {
|
||||
this.searchForm = form;
|
||||
this.page.currentPage = 1;
|
||||
this.getList(this.page, form);
|
||||
done();
|
||||
},
|
||||
// 刷新事件
|
||||
refreshChange() {
|
||||
// 删除
|
||||
handleDel: function (row, index) {
|
||||
this.$confirm('是否确认删除存储位置' + row.storageLocation, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function () {
|
||||
return delObj(row.handle);
|
||||
}).then(data => {
|
||||
this.$message.success('删除成功');
|
||||
this.getList(this.page);
|
||||
},
|
||||
// 导出excel
|
||||
exportExcel() {
|
||||
this.downBlobFile('/wms/wmsstoragelocation/export', this.searchForm, 'wmsstoragelocation.xlsx');
|
||||
},
|
||||
});
|
||||
},
|
||||
// 更新
|
||||
handleUpdate: function (row, index, done, loading) {
|
||||
putObj(row).then(data => {
|
||||
this.$message.success('修改成功');
|
||||
done();
|
||||
this.getList(this.page);
|
||||
}).catch(() => {
|
||||
loading();
|
||||
});
|
||||
},
|
||||
// 保存
|
||||
handleSave: function (row, done, loading) {
|
||||
addObj(row).then(data => {
|
||||
this.$message.success('添加成功');
|
||||
done();
|
||||
this.getList(this.page);
|
||||
}).catch(() => {
|
||||
loading();
|
||||
});
|
||||
},
|
||||
// 每页条数改变事件
|
||||
sizeChange(pageSize) {
|
||||
this.page.pageSize = pageSize;
|
||||
},
|
||||
// 当前页发生改变事件
|
||||
currentChange(current) {
|
||||
this.toggleSelection();
|
||||
this.page.currentPage = current;
|
||||
},
|
||||
// 查询事件
|
||||
searchChange(form, done) {
|
||||
this.searchForm = form;
|
||||
this.page.currentPage = 1;
|
||||
this.getList(this.page, form);
|
||||
done();
|
||||
},
|
||||
// 刷新事件
|
||||
refreshChange() {
|
||||
this.getList(this.page);
|
||||
},
|
||||
// 导出excel
|
||||
exportExcel() {
|
||||
this.downBlobFile('/wms/wmsstoragelocation/export', this.searchForm, 'wmsstoragelocation.xlsx');
|
||||
},
|
||||
|
||||
disablePage() {
|
||||
if (this.selectList.length > 0) {
|
||||
this.tableLoading = true;
|
||||
updateBatchById(this.selectList.map(o => {
|
||||
return {
|
||||
handle: o.handle,
|
||||
status: o.status === "Y" ? "N" : "Y"
|
||||
};
|
||||
})).then(response => {
|
||||
this.refreshChange();
|
||||
this.tableLoading = false;
|
||||
}).catch(() => {
|
||||
this.tableLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请选择行项目");
|
||||
}
|
||||
disablePage() {
|
||||
if (this.selectList.length > 0) {
|
||||
this.tableLoading = true;
|
||||
updateBatchById(this.selectList.map(o => {
|
||||
return {
|
||||
handle: o.handle,
|
||||
status: o.status === "Y" ? "N" : "Y"
|
||||
};
|
||||
})).then(response => {
|
||||
this.refreshChange();
|
||||
this.tableLoading = false;
|
||||
}).catch(() => {
|
||||
this.tableLoading = false;
|
||||
});
|
||||
} else {
|
||||
this.$message.error("请选择行项目");
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user