|
@@ -1,6 +1,10 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <en-table-layout :tableData="tableData.data" :loading="loading" @selection-change="handleSelectionChange">
|
|
|
|
|
|
+ <en-table-layout
|
|
|
|
+ :tableData="tableData.data"
|
|
|
|
+ :loading="loading"
|
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
|
+ >
|
|
<div slot="toolbar" class="inner-toolbar">
|
|
<div slot="toolbar" class="inner-toolbar">
|
|
<div class="toolbar-btns">
|
|
<div class="toolbar-btns">
|
|
<el-button
|
|
<el-button
|
|
@@ -10,7 +14,7 @@
|
|
@click="handleAddWarehouse"
|
|
@click="handleAddWarehouse"
|
|
>新增</el-button
|
|
>新增</el-button
|
|
>
|
|
>
|
|
- <!-- <el-button
|
|
|
|
|
|
+ <!-- <el-button
|
|
size="mini"
|
|
size="mini"
|
|
type="delect"
|
|
type="delect"
|
|
:disabled="multipleSelection.length === 0"
|
|
:disabled="multipleSelection.length === 0"
|
|
@@ -25,7 +29,7 @@
|
|
>批量打印</el-button
|
|
>批量打印</el-button
|
|
>
|
|
>
|
|
</div>
|
|
</div>
|
|
- <div class="toolbar-search" style="display:flex;align-items: center;">
|
|
|
|
|
|
+ <div class="toolbar-search" style="display: flex; align-items: center">
|
|
<span>商品编号/条码:</span>
|
|
<span>商品编号/条码:</span>
|
|
<en-table-search
|
|
<en-table-search
|
|
@search="searchEvent"
|
|
@search="searchEvent"
|
|
@@ -40,6 +44,8 @@
|
|
<el-table-column prop="goods_vo.name" label="商品名称" />
|
|
<el-table-column prop="goods_vo.name" label="商品名称" />
|
|
<el-table-column prop="product_vo.spec_name" label="规格型号" />
|
|
<el-table-column prop="product_vo.spec_name" label="规格型号" />
|
|
<el-table-column prop="sn_code" label="序列号" />
|
|
<el-table-column prop="sn_code" label="序列号" />
|
|
|
|
+ <el-table-column prop="out_house_id" label="出库单编号" />
|
|
|
|
+ <el-table-column prop="entry_house_id" label="入库单编号" />
|
|
<el-table-column label="操作" width="260">
|
|
<el-table-column label="操作" width="260">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -55,7 +61,9 @@
|
|
@click="handleDeleteWarehouse(scope.$index, scope.row)"
|
|
@click="handleDeleteWarehouse(scope.$index, scope.row)"
|
|
>删除</el-button
|
|
>删除</el-button
|
|
> -->
|
|
> -->
|
|
- <el-button size="mini" @click="PrintIng(scope.row)">打印序列号</el-button>
|
|
|
|
|
|
+ <el-button size="mini" @click="PrintIng(scope.row)"
|
|
|
|
+ >打印序列号</el-button
|
|
|
|
+ >
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</template>
|
|
</template>
|
|
@@ -89,18 +97,33 @@
|
|
<el-button>搜索</el-button>
|
|
<el-button>搜索</el-button>
|
|
</div>
|
|
</div>
|
|
<div class="center">
|
|
<div class="center">
|
|
- <el-table :data="snTableData" border ref="table" style="width: 100%" @selection-change="snHandleSelectionChange">
|
|
|
|
|
|
+ <el-table
|
|
|
|
+ :data="snTableData"
|
|
|
|
+ border
|
|
|
|
+ ref="table"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ @selection-change="snHandleSelectionChange"
|
|
|
|
+ >
|
|
<el-table-column type="selection" width="55" />
|
|
<el-table-column type="selection" width="55" />
|
|
<el-table-column prop="goods_vo.sn" label="商品编号">
|
|
<el-table-column prop="goods_vo.sn" label="商品编号">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="goods_vo.name" label="商品名称" />
|
|
<el-table-column prop="goods_vo.name" label="商品名称" />
|
|
- <el-table-column prop="bar_code" label="商品条码" v-if="title!=='查看序列号'">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="bar_code"
|
|
|
|
+ label="商品条码"
|
|
|
|
+ v-if="title !== '查看序列号'"
|
|
|
|
+ >
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column prop="product_vo.bar_code" label="商品条码" v-else>
|
|
<el-table-column prop="product_vo.bar_code" label="商品条码" v-else>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="spec_name" label="规格型号" v-if="title!=='查看序列号'"> </el-table-column>
|
|
|
|
- <el-table-column prop="product_vo.spec_name" label="规格型号" v-else> </el-table-column>
|
|
|
|
-
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="spec_name"
|
|
|
|
+ label="规格型号"
|
|
|
|
+ v-if="title !== '查看序列号'"
|
|
|
|
+ >
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="product_vo.spec_name" label="规格型号" v-else>
|
|
|
|
+ </el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
<!-- <el-form :model="stockForm" :rules="stockRules" ref="stockForm" label-width="120px">
|
|
<!-- <el-form :model="stockForm" :rules="stockRules" ref="stockForm" label-width="120px">
|
|
@@ -118,23 +141,45 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form> -->
|
|
</el-form> -->
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
- <el-input :disabled="title=='查看序列号'" v-model="stockForm.qty" placeholder="请输入要生成序列号的数量"></el-input>
|
|
|
|
- <el-button :disabled="title=='查看序列号'" @click="saveQ">生成</el-button>
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ :disabled="title == '查看序列号'"
|
|
|
|
+ v-model="stockForm.qty"
|
|
|
|
+ placeholder="请输入要生成序列号的数量"
|
|
|
|
+ ></el-input>
|
|
|
|
+ <el-button :disabled="title == '查看序列号'" @click="saveQ"
|
|
|
|
+ >生成</el-button
|
|
|
|
+ >
|
|
<!-- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
<!-- <el-button @click="dialogVisible = false">取 消</el-button>
|
|
<el-button type="primary" @click="submitWarehouseForm">确 定</el-button> -->
|
|
<el-button type="primary" @click="submitWarehouseForm">确 定</el-button> -->
|
|
</div>
|
|
</div>
|
|
<div class="info">
|
|
<div class="info">
|
|
- <p>生成规则:序号号=商品编号+4位规格编码+当前生成时间+4位自然序号</p>
|
|
|
|
- <p>注意:如果没有规格的商品默认规格编码就是0000,单次生成数量不得超过9999</p>
|
|
|
|
|
|
+ <p>生成规则:序号号=商品编号+4位规格编码+当前生成时间+4位自然序号</p>
|
|
|
|
+ <p>
|
|
|
|
+ 注意:如果没有规格的商品默认规格编码就是0000,单次生成数量不得超过9999
|
|
|
|
+ </p>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
- <el-dialog title="打印预览" :visible.sync="PrintVisible" width="940px" center @close='handleCancle'>
|
|
|
|
- <el-button size="mini" type="primary" @click="handlePrintGoodsLend" class="print">打印</el-button>
|
|
|
|
- <div id="deliverySheet" style="width:900px">
|
|
|
|
- <div class="tips-t" v-for="(item,index) in codeList" :key="index">
|
|
|
|
|
|
+ <el-dialog
|
|
|
|
+ title="打印预览"
|
|
|
|
+ :visible.sync="PrintVisible"
|
|
|
|
+ width="940px"
|
|
|
|
+ center
|
|
|
|
+ @close="handleCancle"
|
|
|
|
+ >
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handlePrintGoodsLend"
|
|
|
|
+ class="print"
|
|
|
|
+ >打印</el-button
|
|
|
|
+ >
|
|
|
|
+ <div id="deliverySheet" style="width: 900px">
|
|
|
|
+ <div class="tips-t" v-for="(item, index) in codeList" :key="index">
|
|
<div>
|
|
<div>
|
|
<!-- <div class="qrcode-pic" ref="codeItem" ></div> -->
|
|
<!-- <div class="qrcode-pic" ref="codeItem" ></div> -->
|
|
- <div style="margin-top: 10px; font-size: 20px; text-align: center;">{{ item }}</div>
|
|
|
|
|
|
+ <div style="margin-top: 10px; font-size: 20px; text-align: center">
|
|
|
|
+ {{ item }}
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -148,7 +193,7 @@ import * as API_Setting from "@/api/setting";
|
|
import * as API_Auth from "@/api/auth";
|
|
import * as API_Auth from "@/api/auth";
|
|
import { Foundation } from "~/ui-utils";
|
|
import { Foundation } from "~/ui-utils";
|
|
import { mapGetters } from "vuex";
|
|
import { mapGetters } from "vuex";
|
|
-import Print from 'print-js'
|
|
|
|
|
|
+import Print from "print-js";
|
|
export default {
|
|
export default {
|
|
name: "warehouse",
|
|
name: "warehouse",
|
|
data() {
|
|
data() {
|
|
@@ -167,7 +212,7 @@ export default {
|
|
tableData: "",
|
|
tableData: "",
|
|
// 仓库表单
|
|
// 仓库表单
|
|
stockForm: {
|
|
stockForm: {
|
|
- qty:0
|
|
|
|
|
|
+ qty: 0,
|
|
},
|
|
},
|
|
// 仓库表单 规则
|
|
// 仓库表单 规则
|
|
stockRules: {
|
|
stockRules: {
|
|
@@ -178,14 +223,14 @@ export default {
|
|
},
|
|
},
|
|
// 仓库表单 dialog
|
|
// 仓库表单 dialog
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
- snTableData:[],
|
|
|
|
|
|
+ snTableData: [],
|
|
// 当前已选择的行
|
|
// 当前已选择的行
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
- PrintVisible:false,
|
|
|
|
- codeList:[],
|
|
|
|
|
|
+ PrintVisible: false,
|
|
|
|
+ codeList: [],
|
|
// 新增窗口选中的值
|
|
// 新增窗口选中的值
|
|
- snMultipleSelection:[],
|
|
|
|
- title:''
|
|
|
|
|
|
+ snMultipleSelection: [],
|
|
|
|
+ title: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -198,11 +243,11 @@ export default {
|
|
...mapGetters(["user"]),
|
|
...mapGetters(["user"]),
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- close(){
|
|
|
|
- this.dialogVisible = false
|
|
|
|
- this.snTableData=[]
|
|
|
|
|
|
+ close() {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.snTableData = [];
|
|
},
|
|
},
|
|
- snHandleSelectionChange(val){
|
|
|
|
|
|
+ snHandleSelectionChange(val) {
|
|
if (val.length > 1) {
|
|
if (val.length > 1) {
|
|
// 如果当前选中数量超过1,移除先前选中的,保留最后选中的
|
|
// 如果当前选中数量超过1,移除先前选中的,保留最后选中的
|
|
const lastSelected = val[val.length - 1];
|
|
const lastSelected = val[val.length - 1];
|
|
@@ -212,32 +257,32 @@ export default {
|
|
this.snMultipleSelection = val; // 更新当前选中的行
|
|
this.snMultipleSelection = val; // 更新当前选中的行
|
|
},
|
|
},
|
|
// 批量打印
|
|
// 批量打印
|
|
- batchPrint(){
|
|
|
|
|
|
+ batchPrint() {
|
|
const ids = this.multipleSelection.map((item) => item.sn_code);
|
|
const ids = this.multipleSelection.map((item) => item.sn_code);
|
|
- this.codeList=ids
|
|
|
|
- this.PrintVisible=true
|
|
|
|
|
|
+ this.codeList = ids;
|
|
|
|
+ this.PrintVisible = true;
|
|
},
|
|
},
|
|
/** 打印对账详情 */
|
|
/** 打印对账详情 */
|
|
handlePrintGoodsLend() {
|
|
handlePrintGoodsLend() {
|
|
Print({
|
|
Print({
|
|
- printable: 'deliverySheet',
|
|
|
|
- type: 'html',
|
|
|
|
- targetStyles: ['*'],
|
|
|
|
- ignoreElements: ['no-logs', 'goods-image', 'no-btn']
|
|
|
|
- })
|
|
|
|
|
|
+ printable: "deliverySheet",
|
|
|
|
+ type: "html",
|
|
|
|
+ targetStyles: ["*"],
|
|
|
|
+ ignoreElements: ["no-logs", "goods-image", "no-btn"],
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- handleCancle () {
|
|
|
|
- this.dialogVisible = false
|
|
|
|
- this.codeList=[]
|
|
|
|
|
|
+ handleCancle() {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.codeList = [];
|
|
},
|
|
},
|
|
// 打印
|
|
// 打印
|
|
- PrintIng(row){
|
|
|
|
- this.PrintVisible=true
|
|
|
|
- this.codeList.push(row.sn_code)
|
|
|
|
|
|
+ PrintIng(row) {
|
|
|
|
+ this.PrintVisible = true;
|
|
|
|
+ this.codeList.push(row.sn_code);
|
|
},
|
|
},
|
|
// 删除
|
|
// 删除
|
|
- handleDelectWarehous(){
|
|
|
|
- /* if (!this.multipleSelection || !this.multipleSelection.length)
|
|
|
|
|
|
+ handleDelectWarehous() {
|
|
|
|
+ /* if (!this.multipleSelection || !this.multipleSelection.length)
|
|
return this.$message.error("请先选择!");
|
|
return this.$message.error("请先选择!");
|
|
this.$confirm("确定要删除这些吗?", "提示", { type: "warning" })
|
|
this.$confirm("确定要删除这些吗?", "提示", { type: "warning" })
|
|
.then(() => {
|
|
.then(() => {
|
|
@@ -249,21 +294,21 @@ export default {
|
|
})
|
|
})
|
|
.catch(() => {}); */
|
|
.catch(() => {}); */
|
|
},
|
|
},
|
|
- /** 多选改变 */
|
|
|
|
- handleSelectionChange(val) {
|
|
|
|
|
|
+ /** 多选改变 */
|
|
|
|
+ handleSelectionChange(val) {
|
|
this.multipleSelection = val;
|
|
this.multipleSelection = val;
|
|
},
|
|
},
|
|
// 生成序列号
|
|
// 生成序列号
|
|
- saveQ(){
|
|
|
|
|
|
+ saveQ() {
|
|
// if (!this.snMultipleSelection || !this.snMultipleSelection.length)
|
|
// if (!this.snMultipleSelection || !this.snMultipleSelection.length)
|
|
- API_Setting.addCreateSnCode({product_id:this.snMultipleSelection[0].id,
|
|
|
|
- num:Number(this.stockForm.qty)}).then(res=>{
|
|
|
|
- this.dialogVisible = false
|
|
|
|
- this.snTableData=[]
|
|
|
|
- this.GET_WarehouseList();
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ API_Setting.addCreateSnCode({
|
|
|
|
+ product_id: this.snMultipleSelection[0].id,
|
|
|
|
+ num: Number(this.stockForm.qty),
|
|
|
|
+ }).then((res) => {
|
|
|
|
+ this.dialogVisible = false;
|
|
|
|
+ this.snTableData = [];
|
|
|
|
+ this.GET_WarehouseList();
|
|
|
|
+ });
|
|
},
|
|
},
|
|
/** 获取人员列表 */
|
|
/** 获取人员列表 */
|
|
GET_AdministratorList() {
|
|
GET_AdministratorList() {
|
|
@@ -305,25 +350,24 @@ export default {
|
|
dept_id: 0,
|
|
dept_id: 0,
|
|
admin_id: this.user.uid,
|
|
admin_id: this.user.uid,
|
|
}; */
|
|
}; */
|
|
- this.title='新增序列号'
|
|
|
|
- API_Setting.getSnProduct().then(res=>{
|
|
|
|
|
|
+ this.title = "新增序列号";
|
|
|
|
+ API_Setting.getSnProduct().then((res) => {
|
|
console.log(res);
|
|
console.log(res);
|
|
- this.snTableData=res.records//this.tableData.data
|
|
|
|
- this.dialogVisible = true;
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
|
|
+ this.snTableData = res.records; //this.tableData.data
|
|
|
|
+ this.dialogVisible = true;
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
/** 编辑仓库 */
|
|
/** 编辑仓库 */
|
|
handleEditWarehouse(index, row) {
|
|
handleEditWarehouse(index, row) {
|
|
- this.title='查看序列号'
|
|
|
|
- this.snTableData.push(row)
|
|
|
|
|
|
+ this.title = "查看序列号";
|
|
|
|
+ this.snTableData.push(row);
|
|
this.dialogVisible = true;
|
|
this.dialogVisible = true;
|
|
},
|
|
},
|
|
|
|
|
|
/** 删除 */
|
|
/** 删除 */
|
|
handleDeleteWarehouse(index, row) {
|
|
handleDeleteWarehouse(index, row) {
|
|
- /* this.$confirm("确定要删除这个仓库吗?", "提示", { type: "warning" })
|
|
|
|
|
|
+ /* this.$confirm("确定要删除这个仓库吗?", "提示", { type: "warning" })
|
|
.then(() => {
|
|
.then(() => {
|
|
API_Setting.deleteSn(row.id).then(() => {
|
|
API_Setting.deleteSn(row.id).then(() => {
|
|
this.$message.success("删除成功!");
|
|
this.$message.success("删除成功!");
|
|
@@ -408,27 +452,26 @@ export default {
|
|
/deep/ .el-dialog__body {
|
|
/deep/ .el-dialog__body {
|
|
padding: 10px 20px;
|
|
padding: 10px 20px;
|
|
}
|
|
}
|
|
-.header{
|
|
|
|
|
|
+.header {
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: flex-start;
|
|
justify-content: flex-start;
|
|
- align-items: center;
|
|
|
|
- .el-input{
|
|
|
|
|
|
+ align-items: center;
|
|
|
|
+ .el-input {
|
|
width: 200px;
|
|
width: 200px;
|
|
margin: 15px;
|
|
margin: 15px;
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
-.dialog-footer{
|
|
|
|
|
|
+.dialog-footer {
|
|
margin-top: 30px;
|
|
margin-top: 30px;
|
|
margin-bottom: 20px;
|
|
margin-bottom: 20px;
|
|
display: flex;
|
|
display: flex;
|
|
justify-content: center;
|
|
justify-content: center;
|
|
- .el-input{
|
|
|
|
|
|
+ .el-input {
|
|
width: 200px;
|
|
width: 200px;
|
|
margin-right: 15px;
|
|
margin-right: 15px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-.info{
|
|
|
|
|
|
+.info {
|
|
text-align: center;
|
|
text-align: center;
|
|
color: #aaaaaa;
|
|
color: #aaaaaa;
|
|
}
|
|
}
|