|
|
|
@ -15,6 +15,14 @@
|
|
|
|
|
>查询
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" icon="search" @click="addStack"
|
|
|
|
|
>扫码建垛
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-button type="primary" icon="search" @click="importStackCode"
|
|
|
|
|
>导入垛码
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
@ -40,7 +48,7 @@
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native="handleForm(scope.$index, scope.row)"
|
|
|
|
|
@click.native="editStack(scope.row)"
|
|
|
|
|
>编辑
|
|
|
|
|
</el-button>
|
|
|
|
|
<el-button
|
|
|
|
@ -76,12 +84,133 @@
|
|
|
|
|
>
|
|
|
|
|
</stackCode>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
title="导入垛码"
|
|
|
|
|
:visible.sync="importVisible"
|
|
|
|
|
:append-to-body="true"
|
|
|
|
|
width="30%"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
>
|
|
|
|
|
<el-upload
|
|
|
|
|
class="upload-demo"
|
|
|
|
|
action="https://jsonplaceholder.typicode.com/posts/"
|
|
|
|
|
:on-preview="handlePreview"
|
|
|
|
|
:on-remove="handleRemove"
|
|
|
|
|
:before-remove="beforeRemove"
|
|
|
|
|
multiple
|
|
|
|
|
:limit="3"
|
|
|
|
|
:on-exceed="handleExceed"
|
|
|
|
|
:file-list="fileList">
|
|
|
|
|
<el-button size="small" type="primary">点击上传</el-button>
|
|
|
|
|
<div slot="tip" class="el-upload__tip">只能上传 xls/xlsx 文件</div>
|
|
|
|
|
</el-upload>
|
|
|
|
|
<el-button type="primary" style="margin-top: 20px;">提交</el-button>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
<el-dialog
|
|
|
|
|
:title="formNames[formName]"
|
|
|
|
|
:visible.sync="stackVisible"
|
|
|
|
|
:append-to-body="true"
|
|
|
|
|
width="60%"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
:close-on-press-escape="false"
|
|
|
|
|
>
|
|
|
|
|
<el-form :model="formData" ref="dataForm">
|
|
|
|
|
<el-button-group style="display: flex;margin: -50px 0 10px 80%; height: 35px">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
@click.native="saveStackOrder"
|
|
|
|
|
>提交
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-button-group>
|
|
|
|
|
<el-card>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<div class="ao-text">
|
|
|
|
|
<span>条码:</span>
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="19">
|
|
|
|
|
<el-form-item prop="code">
|
|
|
|
|
<el-input
|
|
|
|
|
id="inputer"
|
|
|
|
|
@focus="getInputFocus($event)"
|
|
|
|
|
@keypress.enter.native="enterKey($event)"
|
|
|
|
|
ref='inputRef'
|
|
|
|
|
style="ime-mode:disabled"
|
|
|
|
|
type="tel"
|
|
|
|
|
v-model="formData.code"
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="2">
|
|
|
|
|
<el-button
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native.stop="addCode()"
|
|
|
|
|
style="height: 31px; margin-left: 20px"
|
|
|
|
|
>添加
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-row :gutter="20">
|
|
|
|
|
<el-col :span="16">
|
|
|
|
|
<span style="margin-left: 65px;">垛号:</span>
|
|
|
|
|
<el-input style="width: 50%; margin-left: 15px;" disabled
|
|
|
|
|
v-model="formData.orderId"></el-input>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="4">
|
|
|
|
|
<div class="text item" style="margin-left: 30px"> 条码数量:{{ codeTotal }}
|
|
|
|
|
</div>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
<el-table v-loading="loading" :data="codeList" style="width: 100%;" max-height="350" height="350"
|
|
|
|
|
ref="multipleTable">
|
|
|
|
|
<el-table-column label="序号" type="index" width="45"></el-table-column>
|
|
|
|
|
<el-table-column
|
|
|
|
|
label="条码"
|
|
|
|
|
prop="code"
|
|
|
|
|
show-overflow-tooltip
|
|
|
|
|
></el-table-column>
|
|
|
|
|
<el-table-column label="操作" fixed="right" width="250">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
type="text"
|
|
|
|
|
size="small"
|
|
|
|
|
@click.native.stop="deleteCode(scope.$index, scope.row)"
|
|
|
|
|
>减一
|
|
|
|
|
</el-button
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<div class="block">
|
|
|
|
|
<el-pagination
|
|
|
|
|
:page-size="codeQuery.limit"
|
|
|
|
|
@current-change="getStackCodes"
|
|
|
|
|
layout="prev, pager, next"
|
|
|
|
|
:total="codeTotal"
|
|
|
|
|
:current-page="codeQuery.page"
|
|
|
|
|
:current-page.sync="codeQuery.page"
|
|
|
|
|
></el-pagination>
|
|
|
|
|
</div>
|
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {getStackOrderList, deleteStackOrder, updateStack, uploadStack} from "@/api/production/stackOrder";
|
|
|
|
|
import {getStackCodeList, deleteCode, addStackCode} from "@/api/production/stackCode";
|
|
|
|
|
import stackCode from "@/views/production/stackCode";
|
|
|
|
|
import {isBlank} from "@/utils/strUtil";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
@ -94,6 +223,7 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
list: [],
|
|
|
|
|
total: 0,
|
|
|
|
|
codeTotal: 0,
|
|
|
|
|
loading: false,
|
|
|
|
|
index: null,
|
|
|
|
|
formName: null,
|
|
|
|
@ -102,15 +232,31 @@ export default {
|
|
|
|
|
edit: "编辑",
|
|
|
|
|
},
|
|
|
|
|
formLoading: false,
|
|
|
|
|
formData: null,
|
|
|
|
|
formData: {
|
|
|
|
|
orderId: null,
|
|
|
|
|
code: null
|
|
|
|
|
},
|
|
|
|
|
codeList: [],
|
|
|
|
|
exportStatusMap: {
|
|
|
|
|
0: "未导出",
|
|
|
|
|
1: "已导出"
|
|
|
|
|
},
|
|
|
|
|
codeDetailVisible: false,
|
|
|
|
|
stackVisible: false,
|
|
|
|
|
importVisible: false,
|
|
|
|
|
idQuery: {
|
|
|
|
|
orderIdFk: null
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
formNames: {
|
|
|
|
|
add: "新增",
|
|
|
|
|
edit: "编辑"
|
|
|
|
|
},
|
|
|
|
|
sitcomScan: false,
|
|
|
|
|
codeQuery: {
|
|
|
|
|
orderIdFk: null,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
@ -139,7 +285,6 @@ export default {
|
|
|
|
|
this.total = res.data.total || 0;
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
codeDetail(orderId) {
|
|
|
|
@ -160,10 +305,130 @@ export default {
|
|
|
|
|
},
|
|
|
|
|
// 删除
|
|
|
|
|
handleDel(index, row) {
|
|
|
|
|
|
|
|
|
|
this.$confirm("是否删除此垛数据?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
let params = {id: row.id}
|
|
|
|
|
deleteStackOrder(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
|
|
this.getList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(res.data.message);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
addStack() {
|
|
|
|
|
this.stackVisible = true;
|
|
|
|
|
this.formName = 'add';
|
|
|
|
|
this.formData = {};
|
|
|
|
|
this.codeList = [];
|
|
|
|
|
this.codeTotal = 0;
|
|
|
|
|
this.codeQuery = {
|
|
|
|
|
orderIdFk: null,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
editStack(row) {
|
|
|
|
|
this.stackVisible = true;
|
|
|
|
|
this.formName = 'edit';
|
|
|
|
|
this.formData = row;
|
|
|
|
|
this.codeQuery = {
|
|
|
|
|
orderIdFk: row.orderId,
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 20
|
|
|
|
|
}
|
|
|
|
|
this.getStackCodes();
|
|
|
|
|
},
|
|
|
|
|
saveStackOrder() {
|
|
|
|
|
if (this.codeTotal === 0) {
|
|
|
|
|
this.$message.error("请添加条码!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {
|
|
|
|
|
stackOrderEntity: this.formData,
|
|
|
|
|
stackCodeEntityList: this.codeList
|
|
|
|
|
}
|
|
|
|
|
if (isBlank(this.formData.orderId)) {
|
|
|
|
|
//新建单据
|
|
|
|
|
uploadStack(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("保存成功");
|
|
|
|
|
this.formData.orderId = res.data;
|
|
|
|
|
this.stackVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
updateStack(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.$message.success("保存成功");
|
|
|
|
|
this.stackVisible = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
deleteCode(index, row) {
|
|
|
|
|
this.$confirm("是否删除此条码?", "提示", {
|
|
|
|
|
confirmButtonText: "确定",
|
|
|
|
|
cancelButtonText: "取消",
|
|
|
|
|
type: "warning"
|
|
|
|
|
}).then(() => {
|
|
|
|
|
let params = {id: row.id};
|
|
|
|
|
deleteCode(params).then((res) => {
|
|
|
|
|
this.$message.success("删除成功");
|
|
|
|
|
this.getStackCodes();
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
addCode() {
|
|
|
|
|
let code = this.formData.code.trim();
|
|
|
|
|
if (isBlank(code)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let params = {
|
|
|
|
|
orderId: this.formData.orderId,
|
|
|
|
|
code: code,
|
|
|
|
|
customerId: this.$store.getters.customerId
|
|
|
|
|
};
|
|
|
|
|
addStackCode(params).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
if (isBlank(this.formData.orderId)) {
|
|
|
|
|
this.formData.orderId = res.data.orderIdFk;
|
|
|
|
|
this.codeQuery.orderIdFk = res.data.orderIdFk;
|
|
|
|
|
}
|
|
|
|
|
this.getStackCodes();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
this.$refs.inputRef.select();
|
|
|
|
|
},
|
|
|
|
|
getStackCodes() {
|
|
|
|
|
getStackCodeList(this.codeQuery).then((res) => {
|
|
|
|
|
if (res.code === 20000) {
|
|
|
|
|
this.codeList = res.data.list || [];
|
|
|
|
|
this.codeTotal = res.data.total || 0;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
enterKey(event) {
|
|
|
|
|
if (this.sitcomScan) {
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
this.addCode(event);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
getInputFocus(event) {
|
|
|
|
|
event.currentTarget.select();
|
|
|
|
|
},
|
|
|
|
|
importStackCode() {
|
|
|
|
|
this.importVisible = true;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
mounted() {
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
this.getList();
|
|
|
|
|