feat: 添加空置库选项和打印标签功能
- 在WarehouseTree组件中添加showEmpty属性以显示空置库选项 - 在DrillDownTable和search组件中传递showEmpty属性 - 在base面板中添加打印标签功能 - 在correct页面添加创建人选择功能 - 在receive报表页面添加收货计划筛选功能
This commit is contained in:
@@ -17,6 +17,10 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: 'real'
|
default: 'real'
|
||||||
},
|
},
|
||||||
|
showEmpty: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -38,23 +42,19 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadChildren(node, resolve) {
|
|
||||||
if (this.warehouseType !== 'real') {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (node.level === 0) {
|
|
||||||
// resolve(this.handleTree(this.treeData, 'warehouseId', 'parentId'));
|
|
||||||
} else {
|
|
||||||
listActualWarehouse({ parentId: node.data.actualWarehouseId }).then(response => {
|
|
||||||
resolve(response.data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getWarehouseTree() {
|
getWarehouseTree() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
if (this.warehouseType === 'real') {
|
if (this.warehouseType === 'real') {
|
||||||
treeActualWarehouseTwoLevel().then(response => {
|
treeActualWarehouseTwoLevel().then(response => {
|
||||||
this.treeData = response.data
|
const data = response.data;
|
||||||
|
if (this.showEmpty) {
|
||||||
|
data.unshift({
|
||||||
|
actualWarehouseId: '-1',
|
||||||
|
actualWarehouseName: '空置库',
|
||||||
|
isLeaf: true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.treeData = data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -307,6 +307,12 @@
|
|||||||
<el-date-picker v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
<el-date-picker v-model="form.createTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="请选择创建时间" style="width: 100%;" />
|
placeholder="请选择创建时间" style="width: 100%;" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="创建人" prop="createBy">
|
||||||
|
<el-select v-model="form.createBy" placeholder="请选择创建人" style="width: 100%;" clearable filterable>
|
||||||
|
<el-option v-for="item in userList" :key="item.userName" :label="item.nickName" :value="item.userName" />
|
||||||
|
</el-select>
|
||||||
|
<!-- <el-input v-model="form.createBy" placeholder="请输入创建人" /> -->
|
||||||
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
@@ -318,6 +324,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listMaterialCoil, updateMaterialCoilSimple } from '@/api/wms/coil'
|
import { listMaterialCoil, updateMaterialCoilSimple } from '@/api/wms/coil'
|
||||||
|
import { listUser } from '@/api/system/user'
|
||||||
import { listPendingAction, startProcess, cancelAction, delPendingAction, addPendingAction } from '@/api/wms/pendingAction'
|
import { listPendingAction, startProcess, cancelAction, delPendingAction, addPendingAction } from '@/api/wms/pendingAction'
|
||||||
import { parseTime } from '@/utils/klp'
|
import { parseTime } from '@/utils/klp'
|
||||||
import ProductInfo from '@/components/KLPService/Renderer/ProductInfo'
|
import ProductInfo from '@/components/KLPService/Renderer/ProductInfo'
|
||||||
@@ -395,7 +402,8 @@ export default {
|
|||||||
},
|
},
|
||||||
form: {},
|
form: {},
|
||||||
correctVisible: false,
|
correctVisible: false,
|
||||||
buttonLoading: false
|
buttonLoading: false,
|
||||||
|
userList: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -461,6 +469,8 @@ export default {
|
|||||||
this.getPendingAction()
|
this.getPendingAction()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// 加载用户列表
|
||||||
|
this.getUsers()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 确保在mounted时也尝试加载(字典数据可能此时才加载完成)
|
// 确保在mounted时也尝试加载(字典数据可能此时才加载完成)
|
||||||
@@ -473,6 +483,12 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
parseTime,
|
parseTime,
|
||||||
|
/** 查询用户列表 */
|
||||||
|
getUsers() {
|
||||||
|
listUser({ pageNum: 1, pageSize: 1000 }).then(response => {
|
||||||
|
this.userList = response.rows || []
|
||||||
|
})
|
||||||
|
},
|
||||||
// 处理材料类型变化
|
// 处理材料类型变化
|
||||||
handleMaterialTypeChange(value) {
|
handleMaterialTypeChange(value) {
|
||||||
// 清空物品选择
|
// 清空物品选择
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="实际库区" prop="actualWarehouseId">
|
<el-form-item label="实际库区" prop="actualWarehouseId">
|
||||||
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
|
<actual-warehouse-select v-model="form.actualWarehouseId" placeholder="请选择实际库区" style="width: 100%;"
|
||||||
clearable />
|
clearable :showEmpty="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export default {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// 调用API获取数据
|
// 调用API获取数据
|
||||||
listMaterialCoil({ ...params, dataType: 1 }).then(res => {
|
listMaterialCoil({ ...params, dataType: 1, status: 0 }).then(res => {
|
||||||
this.list = res.rows || [];
|
this.list = res.rows || [];
|
||||||
this.total = res.total || 0;
|
this.total = res.total || 0;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
@@ -134,7 +134,10 @@
|
|||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handlePreviewLabel(scope.row)">
|
||||||
导出标签
|
预览标签
|
||||||
|
</el-button>
|
||||||
|
<el-button size="mini" type="text" icon="el-icon-printer" @click="handlePrintLabel(scope.row)">
|
||||||
|
打印标签
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="mini" v-if="showStatus" type="text" icon="el-icon-upload"
|
<el-button size="mini" v-if="showStatus" type="text" icon="el-icon-upload"
|
||||||
@click="handleExportCoil(scope.row)">
|
@click="handleExportCoil(scope.row)">
|
||||||
@@ -259,6 +262,8 @@
|
|||||||
<label-render :content="labelRender.data" :labelType="labelType" />
|
<label-render :content="labelRender.data" :labelType="labelType" />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<label-render ref="labelRender" v-show="false" :content="labelRender.data" :labelType="labelType" />
|
||||||
|
|
||||||
<!-- 批量导出标签PDF弹窗 -->
|
<!-- 批量导出标签PDF弹窗 -->
|
||||||
<el-dialog title="批量导出标签PDF" :visible.sync="batchPrint.visible" width="520px" append-to-body>
|
<el-dialog title="批量导出标签PDF" :visible.sync="batchPrint.visible" width="520px" append-to-body>
|
||||||
<div style="line-height: 22px; font-size: 12px; color: #909399; margin-bottom: 10px;">
|
<div style="line-height: 22px; font-size: 12px; color: #909399; margin-bottom: 10px;">
|
||||||
@@ -519,6 +524,21 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 打印标签
|
||||||
|
handlePrintLabel(row) {
|
||||||
|
const item = row.itemType === 'product' ? row.product : row.rawMaterial;
|
||||||
|
const itemName = row.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
|
||||||
|
|
||||||
|
this.labelRender.data = {
|
||||||
|
...row,
|
||||||
|
itemName: itemName,
|
||||||
|
updateTime: row.updateTime?.split(' ')[0] || '',
|
||||||
|
};
|
||||||
|
this.$refs.labelRender.printLabel();
|
||||||
|
// this.labelRender.visible = true;
|
||||||
|
// this.labelRender.data = row;
|
||||||
|
// this.labelRender.type = '2';
|
||||||
|
},
|
||||||
// 处理材料类型变化
|
// 处理材料类型变化
|
||||||
handleMaterialTypeChange(value) {
|
handleMaterialTypeChange(value) {
|
||||||
// 清空物品选择
|
// 清空物品选择
|
||||||
|
|||||||
@@ -38,6 +38,13 @@
|
|||||||
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
<muti-select style="width: 200px;" v-model="queryParams.itemManufacturer"
|
||||||
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
:options="dict.type.coil_manufacturer" placeholder="请选择厂家" clearable @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="收货计划" prop="planId">
|
||||||
|
<el-select style="width: 200px;" v-model="queryParams.planId" placeholder="请输入计划名称搜索收货计划" filterable remote
|
||||||
|
:remote-method="remoteMethod">
|
||||||
|
<el-option v-for="item in planList" :key="item.planId" :label="item.planName" :value="item.planId" />
|
||||||
|
</el-select>
|
||||||
|
<!-- 默认选中今天的收货计划,如果今天还没有收货计划,提醒创建收货计划 -->
|
||||||
|
</el-form-item>
|
||||||
<el-form-item prop="endTime">
|
<el-form-item prop="endTime">
|
||||||
<el-button type="primary" @click="getList">查询</el-button>
|
<el-button type="primary" @click="getList">查询</el-button>
|
||||||
<el-button type="primary" @click="exportData">导出</el-button>
|
<el-button type="primary" @click="exportData">导出</el-button>
|
||||||
@@ -99,6 +106,7 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
|||||||
import MemoInput from "@/components/MemoInput";
|
import MemoInput from "@/components/MemoInput";
|
||||||
import MutiSelect from "@/components/MutiSelect";
|
import MutiSelect from "@/components/MutiSelect";
|
||||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||||
|
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -139,7 +147,9 @@ export default {
|
|||||||
itemSpecification: '',
|
itemSpecification: '',
|
||||||
itemMaterial: '',
|
itemMaterial: '',
|
||||||
itemManufacturer: '',
|
itemManufacturer: '',
|
||||||
|
planId: '',
|
||||||
},
|
},
|
||||||
|
planList: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -157,10 +167,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
remoteMethod(query) {
|
||||||
|
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
|
||||||
|
this.planList = res.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
listPendingAction({
|
listPendingAction({
|
||||||
// actionStatus: 2,
|
// actionStatus: 2,
|
||||||
|
warehouseId: this.queryParams.planId,
|
||||||
actionType: 401,
|
actionType: 401,
|
||||||
pageSize: 999,
|
pageSize: 999,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
@@ -175,6 +191,7 @@ export default {
|
|||||||
message: '暂无数据',
|
message: '暂无数据',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
|
this.list = []
|
||||||
this.loading = false
|
this.loading = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -196,6 +213,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getList()
|
this.getList()
|
||||||
|
this.remoteMethod('')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<WarehouseTree @node-click="handleTreeSelect" :warehouseType="warehouseType" />
|
<WarehouseTree @node-click="handleTreeSelect" :warehouseType="warehouseType" :showEmpty="true" />
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
<!-- 右侧内容 -->
|
<!-- 右侧内容 -->
|
||||||
|
|||||||
Reference in New Issue
Block a user