区分扫码枪和手动录入
This commit is contained in:
@@ -13,7 +13,10 @@ export default {
|
|||||||
components: { ThemePicker },
|
components: { ThemePicker },
|
||||||
created() {
|
created() {
|
||||||
// 应用启动时全局初始化分类数据
|
// 应用启动时全局初始化分类数据
|
||||||
this.$store.dispatch('category/getCategoryList');
|
if (this.$store.getters.token) {
|
||||||
|
this.$store.dispatch('category/getCategoryList');
|
||||||
|
}
|
||||||
|
console.log(this.$store)
|
||||||
},
|
},
|
||||||
metaInfo() {
|
metaInfo() {
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ export default {
|
|||||||
Cookies.remove('rememberMe');
|
Cookies.remove('rememberMe');
|
||||||
}
|
}
|
||||||
this.$store.dispatch("Login", this.loginForm).then(() => {
|
this.$store.dispatch("Login", this.loginForm).then(() => {
|
||||||
|
this.$store.dispatch('category/getCategoryList');
|
||||||
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ export default {
|
|||||||
const res = await listStockIoDetail({ stockIoId: row.stockIoId });
|
const res = await listStockIoDetail({ stockIoId: row.stockIoId });
|
||||||
const details = res.data || res.rows || [];
|
const details = res.data || res.rows || [];
|
||||||
// 拼接条码内容 stockIoId_warehouseId_materialId_quantity
|
// 拼接条码内容 stockIoId_warehouseId_materialId_quantity
|
||||||
const barcodes = details.map(item => {
|
const barcodes = details.filter(el => el.recordType == 0).map(item => {
|
||||||
return encodeURIComponent(`${row.stockIoId}_${item.warehouseId || ''}_${item.itemId || ''}_${item.quantity || ''}`);
|
return encodeURIComponent(`${row.stockIoId}_${item.warehouseId || ''}_${item.itemId || ''}_${item.quantity || ''}`);
|
||||||
});
|
});
|
||||||
this.drawerBarcodeData = {
|
this.drawerBarcodeData = {
|
||||||
|
|||||||
@@ -39,7 +39,11 @@
|
|||||||
<el-form v-else label-width="80px" size="small" label-position="top">
|
<el-form v-else label-width="80px" size="small" label-position="top">
|
||||||
<el-form-item label="条码明细">
|
<el-form-item label="条码明细">
|
||||||
<el-table :data="barcodeConfigs" size="mini" border style="width:100%;">
|
<el-table :data="barcodeConfigs" size="mini" border style="width:100%;">
|
||||||
<el-table-column label="条码内容" prop="code" width="90" align="center" show-overflow-tooltip />
|
<el-table-column label="条码内容" prop="code" width="90" align="center" show-overflow-tooltip>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-input type="textarea" v-model="scope.row.code" size="mini" :autosize="{ minRows: 1, maxRows: 3 }" placeholder="请输入条码内容" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="数量" width="180" align="center">
|
<el-table-column label="数量" width="180" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input-number v-model.number="scope.row.count" :min="1" :max="100" size="mini" />
|
<el-input-number v-model.number="scope.row.count" :min="1" :max="100" size="mini" />
|
||||||
|
|||||||
@@ -22,92 +22,107 @@
|
|||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<br />
|
<br />
|
||||||
<!-- 明细表格 -->
|
<!-- 明细表格 -->
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-tabs v-model="activeTab" style="margin-bottom: 10px;">
|
||||||
<el-col :span="1.5">
|
<el-tab-pane label="手动录入" name="manual">
|
||||||
<el-button
|
<el-row :gutter="10" class="mb8">
|
||||||
type="primary"
|
<el-col :span="1.5">
|
||||||
plain
|
<el-button
|
||||||
icon="el-icon-plus"
|
type="primary"
|
||||||
size="mini"
|
plain
|
||||||
@click="handleAdd"
|
icon="el-icon-plus"
|
||||||
:disabled="stockIo.status >= 2"
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
>新增</el-button>
|
:disabled="stockIo.status >= 2"
|
||||||
</el-col>
|
>新增</el-button>
|
||||||
<el-col :span="1.5">
|
</el-col>
|
||||||
<el-button
|
<el-col :span="1.5">
|
||||||
type="success"
|
<el-button
|
||||||
plain
|
type="success"
|
||||||
icon="el-icon-edit"
|
plain
|
||||||
size="mini"
|
icon="el-icon-edit"
|
||||||
:disabled="single || stockIo.status >= 2"
|
size="mini"
|
||||||
@click="handleUpdate"
|
:disabled="single || stockIo.status >= 2"
|
||||||
|
@click="handleUpdate"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple || stockIo.status >= 2"
|
:disabled="multiple || stockIo.status >= 2"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
|
>删除</el-button>
|
||||||
>删除</el-button>
|
</el-col>
|
||||||
</el-col>
|
<el-col :span="1.5">
|
||||||
<el-col :span="1.5">
|
<el-button
|
||||||
<el-button
|
type="warning"
|
||||||
type="warning"
|
plain
|
||||||
plain
|
icon="el-icon-download"
|
||||||
icon="el-icon-download"
|
size="mini"
|
||||||
size="mini"
|
@click="handleExport"
|
||||||
@click="handleExport"
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
>导出</el-button>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-col>
|
</el-row>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<el-table v-loading="loading" :data="manualList" @selection-change="handleSelectionChange">
|
||||||
</el-row>
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table v-loading="loading" :data="stockIoDetailList" @selection-change="handleSelectionChange">
|
<el-table-column label="库区/库位" align="center" prop="warehouseName" />
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column
|
||||||
<el-table-column label="库区/库位" align="center" prop="warehouseName" />
|
v-if="stockIo.ioType === 'transfer'"
|
||||||
<el-table-column
|
label="源库区/库位"
|
||||||
v-if="stockIo.ioType === 'transfer'"
|
align="center"
|
||||||
label="源库区/库位"
|
prop="fromWarehouseName"
|
||||||
align="center"
|
/>
|
||||||
prop="fromWarehouseName"
|
<el-table-column label="物品类型" align="center" prop="itemType">
|
||||||
/>
|
<template slot-scope="scope">
|
||||||
<el-table-column label="物品类型" align="center" prop="itemType">
|
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
||||||
<template slot-scope="scope">
|
</template>
|
||||||
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
</el-table-column>
|
||||||
</template>
|
<el-table-column label="物品ID" align="center" prop="itemId" />
|
||||||
</el-table-column>
|
<el-table-column label="数量" align="center" prop="quantity" />
|
||||||
<el-table-column label="物品ID" align="center" prop="itemId" />
|
<el-table-column label="单位" align="center" prop="unit" />
|
||||||
<el-table-column label="数量" align="center" prop="quantity" />
|
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||||
<el-table-column label="单位" align="center" prop="unit" />
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<el-table-column label="备注" align="center" prop="remark" />
|
<template slot-scope="scope">
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-button
|
||||||
<template slot-scope="scope">
|
size="mini"
|
||||||
<el-button
|
type="text"
|
||||||
size="mini"
|
icon="el-icon-edit"
|
||||||
type="text"
|
@click="handleUpdate(scope.row)"
|
||||||
icon="el-icon-edit"
|
:disabled="stockIo.status >= 2"
|
||||||
@click="handleUpdate(scope.row)"
|
>修改</el-button>
|
||||||
:disabled="stockIo.status >= 2"
|
<el-button
|
||||||
|
size="mini"
|
||||||
>修改</el-button>
|
type="text"
|
||||||
<el-button
|
icon="el-icon-delete"
|
||||||
size="mini"
|
@click="handleDelete(scope.row)"
|
||||||
type="text"
|
:disabled="stockIo.status >= 2"
|
||||||
icon="el-icon-delete"
|
>删除</el-button>
|
||||||
@click="handleDelete(scope.row)"
|
</template>
|
||||||
:disabled="stockIo.status >= 2"
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
>删除</el-button>
|
</el-tab-pane>
|
||||||
</template>
|
<el-tab-pane label="扫码枪" name="scanner">
|
||||||
</el-table-column>
|
<el-table :data="scannerList" :show-header="true" :border="true" style="width: 100%;" :default-sort="{}" :highlight-current-row="true">
|
||||||
</el-table>
|
<el-table-column type="index" width="55" align="center" label="#" />
|
||||||
|
<el-table-column label="库区/库位" align="center" prop="warehouseName" />
|
||||||
|
<el-table-column v-if="stockIo.ioType === 'transfer'" label="源库区/库位" align="center" prop="fromWarehouseName" />
|
||||||
|
<el-table-column label="物品类型" align="center" prop="itemType">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.stock_item_type" :value="scope.row.itemType" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="物品ID" align="center" prop="itemId" />
|
||||||
|
<el-table-column label="数量" align="center" prop="quantity" />
|
||||||
|
<el-table-column label="单位" align="center" prop="unit" />
|
||||||
|
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||||
|
<el-table-column label="备注" align="center" prop="remark" />
|
||||||
|
</el-table>
|
||||||
|
</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
@@ -267,7 +282,8 @@ export default {
|
|||||||
multiple: true,
|
multiple: true,
|
||||||
statusLoading: false, // 新增状态修改按钮加载状态
|
statusLoading: false, // 新增状态修改按钮加载状态
|
||||||
cancelLoading: false, // 撤回按钮加载状态
|
cancelLoading: false, // 撤回按钮加载状态
|
||||||
unitDisabled: false // 新增:单位输入框是否禁用
|
unitDisabled: false, // 新增:单位输入框是否禁用
|
||||||
|
activeTab: 'manual' // 新增:当前激活的标签页
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -281,6 +297,16 @@ export default {
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
// 手动录入的列表,使用recordType区分为0
|
||||||
|
manualList() {
|
||||||
|
return this.stockIoDetailList.filter(item => item.recordType === 0);
|
||||||
|
},
|
||||||
|
// 来自扫码枪的列表,为1
|
||||||
|
scannerList() {
|
||||||
|
return this.stockIoDetailList.filter(item => item.recordType === 1);
|
||||||
|
}
|
||||||
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.stockIo && this.stockIo.stockIoId) {
|
if (this.stockIo && this.stockIo.stockIoId) {
|
||||||
this.queryParams.stockIoId = this.stockIo.stockIoId;
|
this.queryParams.stockIoId = this.stockIo.stockIoId;
|
||||||
@@ -334,6 +360,7 @@ export default {
|
|||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
this.form.stockIoId = this.stockIo.stockIoId;
|
this.form.stockIoId = this.stockIo.stockIoId;
|
||||||
|
this.form.recordType = 0; // 新增时设为手动录入
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加出入库单明细";
|
this.title = "添加出入库单明细";
|
||||||
},
|
},
|
||||||
@@ -344,6 +371,7 @@ export default {
|
|||||||
getStockIoDetail(detailId).then(response => {
|
getStockIoDetail(detailId).then(response => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.form = response.data;
|
this.form = response.data;
|
||||||
|
this.form.recordType = 0; // 修改时强制设为手动录入
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "修改出入库单明细";
|
this.title = "修改出入库单明细";
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user