1
This commit is contained in:
parent
1cb60092c4
commit
33e985f965
|
|
@ -49,3 +49,12 @@ export function enableGoods(goodsId) {
|
|||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询物料类别下拉树结构
|
||||
export function goodsTypeTreeSelect() {
|
||||
return request({
|
||||
url: '/system/goodsType/goodsTypeTree',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,3 +42,13 @@ export function delPmsOrderOut(recordId) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//新增出库通知单
|
||||
export function createOrderOut(data){
|
||||
return request({
|
||||
url: '/app/pms/orderOut',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
@ -42,3 +42,11 @@ export function delStock(stockId) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
// 模糊查询库存统计
|
||||
export function queryListByGoodsId(query) {
|
||||
return request({
|
||||
url: '/app/stock/queryListByGoodsId',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
214
src/views/system/components/OutboundDialog.vue
Normal file
214
src/views/system/components/OutboundDialog.vue
Normal file
|
|
@ -0,0 +1,214 @@
|
|||
<!-- 物料出库弹窗 -->
|
||||
<template>
|
||||
<el-dialog
|
||||
title="物料出库"
|
||||
:visible.sync="visible"
|
||||
width="900px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<div class="outbound-table">
|
||||
<el-table :data="tableData" size="small" border>
|
||||
<el-table-column label="物料编码" width="280">
|
||||
<template slot-scope="scope">
|
||||
<el-autocomplete
|
||||
v-model="scope.row.materialCode"
|
||||
:fetch-suggestions="searchMaterials"
|
||||
:trigger-on-focus="false"
|
||||
@select="(item) => handleMaterialSelect(item, scope.$index)"
|
||||
placeholder="请输入物料编码或名称"
|
||||
clearable
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<div class="material-item">
|
||||
<div class="material-code">{{ item.code }}</div>
|
||||
<div class="material-desc">{{ item.description }}</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料描述" prop="materialDescription">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.materialDescription" readonly placeholder="物料描述" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出库数量" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.quantity"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
placeholder="请输入数量"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="removeRow(scope.$index)"
|
||||
:disabled="tableData.length === 1"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="table-footer">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addRow">新增行</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'OutboundDialog',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [
|
||||
{
|
||||
id: Date.now(),
|
||||
materialCode: '',
|
||||
materialDescription: '',
|
||||
quantity: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索物料
|
||||
async searchMaterials(query, callback) {
|
||||
if (query.length < 2) {
|
||||
callback([])
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
// 这里替换为实际的后端API调用
|
||||
// const { data } = await getMaterialList({ keyword: query })
|
||||
// callback(data.map(item => ({
|
||||
// code: item.materialCode,
|
||||
// description: item.materialName,
|
||||
// value: item.materialCode
|
||||
// })))
|
||||
|
||||
// 模拟数据,实际使用时替换为上面的API调用
|
||||
const mockData = [
|
||||
{ code: 'MAT001', description: '钢板', value: 'MAT001' },
|
||||
{ code: 'MAT002', description: '铝板', value: 'MAT002' },
|
||||
{ code: 'MAT003', description: '铜线', value: 'MAT003' }
|
||||
].filter(item =>
|
||||
item.code.toLowerCase().includes(query.toLowerCase()) ||
|
||||
item.description.includes(query)
|
||||
)
|
||||
callback(mockData)
|
||||
} catch (error) {
|
||||
this.$message.error('获取物料列表失败')
|
||||
callback([])
|
||||
}
|
||||
},
|
||||
|
||||
// 选择物料
|
||||
handleMaterialSelect(item, index) {
|
||||
this.$set(this.tableData[index], 'materialCode', item.code)
|
||||
this.$set(this.tableData[index], 'materialDescription', item.description)
|
||||
},
|
||||
|
||||
// 新增行
|
||||
addRow() {
|
||||
this.tableData.push({
|
||||
id: Date.now(),
|
||||
materialCode: '',
|
||||
materialDescription: '',
|
||||
quantity: 1
|
||||
})
|
||||
},
|
||||
|
||||
// 删除行
|
||||
removeRow(index) {
|
||||
if (this.tableData.length > 1) {
|
||||
this.tableData.splice(index, 1)
|
||||
}
|
||||
},
|
||||
|
||||
// 取消
|
||||
handleCancel() {
|
||||
this.$emit('update:visible', false)
|
||||
this.resetForm()
|
||||
},
|
||||
|
||||
// 提交
|
||||
handleSubmit() {
|
||||
// 验证数据
|
||||
const invalidRow = this.tableData.find(item =>
|
||||
!item.materialCode ||
|
||||
!item.materialDescription ||
|
||||
!item.quantity ||
|
||||
item.quantity < 1
|
||||
)
|
||||
|
||||
if (invalidRow) {
|
||||
this.$message.warning('请填写完整的出库信息')
|
||||
return
|
||||
}
|
||||
|
||||
// 提交数据
|
||||
this.$emit('submit', this.tableData)
|
||||
this.handleCancel()
|
||||
},
|
||||
|
||||
// 重置表单
|
||||
resetForm() {
|
||||
this.tableData = [
|
||||
{
|
||||
id: Date.now(),
|
||||
materialCode: '',
|
||||
materialDescription: '',
|
||||
quantity: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.outbound-table {
|
||||
.material-item {
|
||||
.material-code {
|
||||
font-weight: bold;
|
||||
}
|
||||
.material-desc {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.table-footer {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.el-autocomplete {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -254,11 +254,13 @@
|
|||
<el-form-item label="物料描述" prop="goodsName">
|
||||
<el-input v-model="form.goodsName" placeholder="请输入物料描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计量单位" prop="goodsUnit">
|
||||
<el-input v-model="form.goodsUnit" placeholder="请输入计量单位" />
|
||||
<el-form-item label="计量单位">
|
||||
<el-select v-model="form.goodsUnit" placeholder="请选择计量单位">
|
||||
<el-option v-for="dict in dict.type.goods_unit" :key="dict.value" :label="dict.label" :value="dict.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料类别" prop="goodsType">
|
||||
<el-input v-model="form.goodsType" placeholder="请输入物料类别" />
|
||||
<treeselect v-model="form.goodsType" :options="enabledGoodsTypeOptions" :show-count="true" placeholder="请输入物料类别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="通用容器类型" prop="normalVehicleType">
|
||||
<el-input v-model="form.normalVehicleType" placeholder="请输入通用容器类型" />
|
||||
|
|
@ -312,11 +314,14 @@
|
|||
<script>
|
||||
// import {addMessage, updateMessage} from "@/api/system/message";
|
||||
import {getToken} from "@/utils/auth";
|
||||
import {addGoods, delGoods, getGoods, listGoods, updateGoods , enableGoods} from "@/api/system/goods";
|
||||
import {addGoods, delGoods, getGoods, listGoods, updateGoods , enableGoods, goodsTypeTreeSelect} from "@/api/system/goods";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
|
||||
export default {
|
||||
name: "goods",
|
||||
dicts: ['kc_sts','site_type'],
|
||||
dicts: ['kc_sts','site_type','goods_unit'],
|
||||
components: { Treeselect },
|
||||
data() {
|
||||
return {
|
||||
upload: {
|
||||
|
|
@ -338,6 +343,8 @@ export default {
|
|||
isAdvanced: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 过滤掉已禁用部门树选项
|
||||
enabledGoodsTypeOptions: undefined,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 任务表格数据
|
||||
|
|
@ -404,6 +411,7 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getGoodsTypeTree();
|
||||
this.initTableHeight();
|
||||
window.addEventListener('resize', this.handleResize);
|
||||
},
|
||||
|
|
@ -427,6 +435,24 @@ export default {
|
|||
toggleSearch() {
|
||||
this.showSearch = !this.showSearch;
|
||||
},
|
||||
/** 查询部门下拉树结构 */
|
||||
getGoodsTypeTree() {
|
||||
goodsTypeTreeSelect().then(response => {
|
||||
this.enabledGoodsTypeOptions = this.filterDisabledDept(JSON.parse(JSON.stringify(response.data)));
|
||||
});
|
||||
},
|
||||
// 过滤禁用的部门
|
||||
filterDisabledDept(deptList) {
|
||||
return deptList.filter(dept => {
|
||||
if (dept.disabled) {
|
||||
return false;
|
||||
}
|
||||
if (dept.children && dept.children.length) {
|
||||
dept.children = this.filterDisabledDept(dept.children);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
},
|
||||
/** 查询任务明细
|
||||
列表 */
|
||||
getList() {
|
||||
|
|
|
|||
256
src/views/system/pmsOrderOut/components/OutboundDialog.vue
Normal file
256
src/views/system/pmsOrderOut/components/OutboundDialog.vue
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
title="新增手动出库"
|
||||
:visible.sync="visible"
|
||||
width="900px"
|
||||
append-to-body
|
||||
destroy-on-close
|
||||
>
|
||||
<div class="outbound-table">
|
||||
<el-table :data="tableData" size="small" border>
|
||||
<el-table-column label="物料编码" width="280">
|
||||
<template slot-scope="scope">
|
||||
<el-autocomplete
|
||||
:value="queryGoods"
|
||||
v-model="scope.row.goodsId"
|
||||
:fetch-suggestions="searchMaterials"
|
||||
:trigger-on-focus="false"
|
||||
placeholder="请输入物料编码或名称"
|
||||
clearable
|
||||
@select="handleMaterialSelect(scope.$index,$event)"
|
||||
>
|
||||
<template slot-scope="{ item }">
|
||||
<div class="material-item">
|
||||
<div class="material-code">{{ item.goodsId }}</div>
|
||||
<div class="material-desc">{{ item.goodsName }}</div>
|
||||
<div class="material-divider"></div>
|
||||
</div>
|
||||
</template>
|
||||
</el-autocomplete>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" prop="goodsName">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsName" readonly placeholder="物料名称" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料描述" prop="goodsDesc">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsDesc" readonly placeholder="物料描述" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="remainNum">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.remainNum" readonly placeholder="库存数量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出库数量" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
v-model="scope.row.goodsNum"
|
||||
:min="1"
|
||||
controls-position="right"
|
||||
placeholder="请输入数量"
|
||||
:max="scope.row.remainNum"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="removeRow(scope.$index)"
|
||||
:disabled="tableData.length === 1"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="table-footer">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="addRow">新增行</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="handleCancel">取 消</el-button>
|
||||
<el-button type="primary" @click="handleSubmit">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { queryListByGoodsId } from "@/api/system/stock";
|
||||
|
||||
export default {
|
||||
name: 'OutboundDialog',
|
||||
props: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
queryGoods: "",
|
||||
tableData: [
|
||||
{
|
||||
stockId: Date.now(),
|
||||
goodsId: '',
|
||||
goodsDesc: '',
|
||||
goodsNum: 1, // 统一使用 goodsNum
|
||||
remainNum: 0
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 搜索物料
|
||||
async searchMaterials(query, callback) {
|
||||
if (query.length < 2) {
|
||||
callback([]);
|
||||
return;
|
||||
}
|
||||
|
||||
const queryParams = {
|
||||
goodsId: query
|
||||
};
|
||||
let mockData = [];
|
||||
await queryListByGoodsId(queryParams).then(response => {
|
||||
if(response.code === 200){
|
||||
response.data.forEach(item => {
|
||||
mockData.push({
|
||||
value: item.goodsId,
|
||||
goodsId: item.goodsId,
|
||||
goodsName: item.goodsName,
|
||||
goodsDesc: item.goodsDesc
|
||||
});
|
||||
});
|
||||
mockData = response.data;
|
||||
}
|
||||
});
|
||||
callback(mockData);
|
||||
|
||||
},
|
||||
|
||||
// 选择物料
|
||||
// handleMaterialSelect(index,item) {
|
||||
// consoe.log("=======================");
|
||||
// console.log("index", index);
|
||||
// console.log("item",item );
|
||||
// this.$set(this.tableData[index], 'goodsId', item.goodsId);
|
||||
// this.$set(this.tableData[index], 'goodsDesc', item.goodsDesc);
|
||||
// this.$set(this.tableData[index], 'goodsName', item.goodsName);
|
||||
// this.$set(this.tableData[index], 'remainNum', item.remainNum);
|
||||
// },
|
||||
|
||||
// 新增行
|
||||
addRow() {
|
||||
this.tableData.push({
|
||||
stockId: Date.now(),
|
||||
goodsId: '',
|
||||
goodsDesc: '',
|
||||
goodsNum: 1,
|
||||
remainNum: 0
|
||||
});
|
||||
},
|
||||
|
||||
// 删除行
|
||||
removeRow(index) {
|
||||
if (this.tableData.length > 1) {
|
||||
this.tableData.splice(index, 1);
|
||||
}
|
||||
},
|
||||
|
||||
// 取消
|
||||
handleCancel() {
|
||||
this.$emit('update:visible', false);
|
||||
this.resetForm();
|
||||
},
|
||||
// 选择物料后,更新 goodsName 和 goodsDesc
|
||||
handleMaterialSelect(index,item){
|
||||
console.log("handleMaterialSelect",index);
|
||||
const selectedItem = this.tableData[index];
|
||||
console.log("selectedItem",selectedItem);
|
||||
// 模拟API返回的数据
|
||||
// const selectedMaterial = {
|
||||
// goodsId: selectedItem.goodsId,
|
||||
// goodsName: '物料名称示例', // 需要从接口获取实际物料名称
|
||||
// goodsDesc: '物料描述示例' // 需要从接口获取实际物料描述
|
||||
// };
|
||||
|
||||
this.$set(this.tableData, index, {
|
||||
...selectedItem,
|
||||
goodsId: item.goodsId, // 更新物料编码
|
||||
goodsName: item.goodsName, // 更新物料名称
|
||||
goodsDesc: item.goodsDesc, // 更新物料描述
|
||||
remainNum: item.remainNum, // 更新库存数量
|
||||
goodsNum: item.remainNum
|
||||
});
|
||||
},
|
||||
// 提交
|
||||
handleSubmit() {
|
||||
// 验证数据
|
||||
const invalidRow = this.tableData.find(item =>
|
||||
!item.goodsId ||
|
||||
item.goodsNum < 1 ||
|
||||
item.goodsNum > item.remainNum
|
||||
);
|
||||
|
||||
if (invalidRow) {
|
||||
this.$message.warning('请填写完整的出库信息');
|
||||
return;
|
||||
}
|
||||
|
||||
// 提交数据
|
||||
this.$emit('submit', this.tableData);
|
||||
this.handleCancel();
|
||||
},
|
||||
|
||||
// 重置表单
|
||||
resetForm() {
|
||||
this.tableData = [
|
||||
{
|
||||
stockId: Date.now(),
|
||||
goodsId: '',
|
||||
goodsDesc: '',
|
||||
goodsNum: 1,
|
||||
remainNum: 0
|
||||
}
|
||||
];
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.outbound-table {
|
||||
.material-item {
|
||||
.material-code {
|
||||
font-weight: bold;
|
||||
}
|
||||
.material-desc {
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
.table-footer {
|
||||
margin-top: 15px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
}
|
||||
}
|
||||
|
||||
.el-autocomplete {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.el-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
.material-divider {
|
||||
border-top: 1px dashed #ccc;
|
||||
margin: 8px 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -120,6 +120,8 @@
|
|||
<el-table-column label="物料描述" align="center" prop="goodsDesc" />
|
||||
<el-table-column label="订单状态" align="center" prop="orderStatus" />
|
||||
<el-table-column label="是否锁定" align="center" prop="isLock" />
|
||||
<el-table-column label="操作人" align="center" prop="createBy" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
|
@ -149,61 +151,64 @@
|
|||
/>
|
||||
|
||||
<!-- 添加或修改出库单对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="wms订单号" prop="orderId">
|
||||
<el-input v-model="form.orderId" placeholder="请输入wms订单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出库单号" prop="listId">
|
||||
<el-input v-model="form.listId" placeholder="请输入出库单号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="客户名称" prop="customerId">
|
||||
<el-input v-model="form.customerId" placeholder="请输入客户名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料号" prop="goodsId">
|
||||
<el-input v-model="form.goodsId" placeholder="请输入物料号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单出库数量" prop="goodsNum">
|
||||
<el-input v-model="form.goodsNum" placeholder="请输入订单出库数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总出库数量" prop="pickNum">
|
||||
<el-input v-model="form.pickNum" placeholder="请输入总出库数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认出库数量" prop="trNum">
|
||||
<el-input v-model="form.trNum" placeholder="请输入确认出库数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="本次出库数量" prop="shelvesNum">
|
||||
<el-input v-model="form.shelvesNum" placeholder="请输入本次出库数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="库存数量" prop="stockNum">
|
||||
<el-input v-model="form.stockNum" placeholder="请输入库存数量" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料描述" prop="goodsDesc">
|
||||
<el-input v-model="form.goodsDesc" placeholder="请输入物料描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预留1" prop="spare1">
|
||||
<el-input v-model="form.spare1" placeholder="请输入预留1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="预留2" prop="spare2">
|
||||
<el-input v-model="form.spare2" placeholder="请输入预留2" />
|
||||
</el-form-item>
|
||||
<el-form-item label="是否锁定" prop="isLock">
|
||||
<el-input v-model="form.isLock" placeholder="请输入是否锁定" />
|
||||
</el-form-item>
|
||||
<el-table v-model="form.goodsList" :data="form.goodsList" style="width: 100%">
|
||||
<el-table-column label="物料号" prop="goodsId">
|
||||
<template slot-scope="scope">
|
||||
<el-autocomplete
|
||||
v-model="scope.row.goodsId"
|
||||
:fetch-suggestions="searchGoods"
|
||||
placeholder="请输入物料号"
|
||||
@select="handleSelectGoods(scope.row)"
|
||||
:debounce="300"
|
||||
></el-autocomplete>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料名称" prop="goodsName">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsName" disabled placeholder="物料名称" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存数量" prop="stockQty">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.stockQty" disabled placeholder="库存数量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="出库数量" prop="goodsNum">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsNum" placeholder="请输入出库数量" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物料描述" prop="goodsDesc">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.goodsDesc" placeholder="请输入物料描述" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 出库弹窗 -->
|
||||
<outbound-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
@submit="handleDialogSubmit"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listPmsOrderOut, getPmsOrderOut, delPmsOrderOut, addPmsOrderOut, updatePmsOrderOut } from "@/api/system/pmsOrderOut";
|
||||
import { listPmsOrderOut, getPmsOrderOut, delPmsOrderOut, addPmsOrderOut, updatePmsOrderOut,createOrderOut } from "@/api/system/pmsOrderOut";
|
||||
import {createOutRequestByPmsOrders} from "@/api/system/task";
|
||||
import OutboundDialog from './components/OutboundDialog'
|
||||
export default {
|
||||
name: "PmsOrderOut",
|
||||
components: {
|
||||
OutboundDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
@ -222,6 +227,7 @@ export default {
|
|||
pmsOrderOutList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
dialogVisible: false,
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
|
|
@ -235,7 +241,11 @@ export default {
|
|||
isLock: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
form: {
|
||||
goodsList: [
|
||||
{ goodsId: '11', goodsName: '11', stockQty: '11', goodsNum: '', goodsDesc: '' }
|
||||
]
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
recordId: [
|
||||
|
|
@ -260,6 +270,11 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.dialogVisible = true
|
||||
},
|
||||
|
||||
/** 查询出库单列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
|
@ -325,11 +340,11 @@ export default {
|
|||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加出库单";
|
||||
},
|
||||
// handleAdd() {
|
||||
// this.reset();
|
||||
// this.open = true;
|
||||
// this.title = "添加出库单";
|
||||
// },
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
|
|
@ -340,6 +355,25 @@ export default {
|
|||
this.title = "修改出库单";
|
||||
});
|
||||
},
|
||||
handleDialogSubmit(data){
|
||||
let form = [];
|
||||
console.log("data",data);
|
||||
data.forEach((element) => {
|
||||
form.push({
|
||||
orderType: 6,
|
||||
goodsId: element.goodsId,
|
||||
goodsNum: element.goodsNum,
|
||||
goodsDesc: element.goodsDesc,
|
||||
inner: true
|
||||
});
|
||||
});
|
||||
|
||||
createOrderOut(form).then(response => {
|
||||
this.$modal.msgSuccess("出库成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
|
|
@ -416,6 +450,33 @@ export default {
|
|||
...this.queryParams
|
||||
}, `pmsOrderOut_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
// 模糊搜索物料
|
||||
searchGoods(queryString, cb) {
|
||||
// 这里可以调用 API 或从本地数据中筛选匹配的物料
|
||||
const goodsData = [
|
||||
{ goodsId: '123', goodsName: '物料A', stockQty: 100 },
|
||||
{ goodsId: '456', goodsName: '物料B', stockQty: 200 },
|
||||
{ goodsId: '789', goodsName: '物料C', stockQty: 50 },
|
||||
];
|
||||
const results = goodsData.filter(item => item.goodsId.includes(queryString));
|
||||
cb(results);
|
||||
},
|
||||
|
||||
// 选择物料后填充物料名称和库存数量
|
||||
handleSelectGoods(row) {
|
||||
// 查找并填充物料名称和库存数量
|
||||
const selectedGoods = [
|
||||
{ goodsId: '123', goodsName: '物料A', stockQty: 100 },
|
||||
{ goodsId: '456', goodsName: '物料B', stockQty: 200 },
|
||||
{ goodsId: '789', goodsName: '物料C', stockQty: 50 },
|
||||
].find(item => item.goodsId === row.goodsId);
|
||||
|
||||
if (selectedGoods) {
|
||||
row.goodsName = selectedGoods.goodsName;
|
||||
row.stockQty = selectedGoods.stockQty;
|
||||
}
|
||||
},
|
||||
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -274,6 +274,7 @@
|
|||
<script>
|
||||
import { listTask, getTask, delTask, addTask, updateTask } from "@/api/system/task";
|
||||
|
||||
|
||||
export default {
|
||||
name: "Task",
|
||||
dicts: ['order_status','task_type'],
|
||||
|
|
|
|||
|
|
@ -25,54 +25,9 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物料名称" prop="goodsName">
|
||||
<el-input
|
||||
v-model="queryParams.goodsName"
|
||||
placeholder="请输入物料名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="goodsUnit">
|
||||
<el-input
|
||||
v-model="queryParams.goodsUnit"
|
||||
placeholder="请输入单位"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商id" prop="providerId">
|
||||
<el-input
|
||||
v-model="queryParams.providerId"
|
||||
placeholder="请输入供应商id"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商名称" prop="providerName">
|
||||
<el-input
|
||||
v-model="queryParams.providerName"
|
||||
placeholder="请输入供应商名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="剩余数量" prop="remainNum">
|
||||
<el-input
|
||||
v-model="queryParams.remainNum"
|
||||
placeholder="请输入剩余数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库数量" prop="originNum">
|
||||
<el-input
|
||||
v-model="queryParams.originNum"
|
||||
placeholder="请输入入库数量"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
|
||||
<el-form-item label="批次号" prop="batchNo">
|
||||
<el-input
|
||||
v-model="queryParams.batchNo"
|
||||
|
|
@ -81,38 +36,8 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="库龄" prop="invAge">
|
||||
<el-input
|
||||
v-model="queryParams.invAge"
|
||||
placeholder="请输入库龄"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="入库用户" prop="createUser">
|
||||
<el-input
|
||||
v-model="queryParams.createUser"
|
||||
placeholder="请输入入库用户"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最近更新时间" prop="lastUpdateTime">
|
||||
<el-date-picker clearable
|
||||
v-model="queryParams.lastUpdateTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择最近更新时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="最近更新用户" prop="lastUpdateUser">
|
||||
<el-input
|
||||
v-model="queryParams.lastUpdateUser"
|
||||
placeholder="请输入最近更新用户"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
|
@ -120,7 +45,7 @@
|
|||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
|
|
@ -151,7 +76,7 @@
|
|||
@click="handleDelete"
|
||||
v-hasPermi="['app:stock:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
|
|
@ -162,45 +87,67 @@
|
|||
v-hasPermi="['app:stock:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
icon="el-icon-remove"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleCK"
|
||||
v-hasPermi="['app:stock:export']"
|
||||
>物料出库</el-button>
|
||||
</el-col>
|
||||
>手动出库</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- <el-table v-loading="loading" :data="stockList" @selection-change="handleSelectionChange" :row-class-name="tableRowClassName"> -->
|
||||
<el-table v-loading="loading" :data="stockList" @selection-change="handleSelectionChange" >
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="物料编号" align="center" prop="stockId" />
|
||||
<el-table-column type="selection" width="55" align="center" :selectable="checkSelectable"/>
|
||||
<!-- <el-table-column label="库存编号" align="center" prop="stockId" style="display: none;" /> -->
|
||||
<el-table-column label="载具号" align="center" prop="vehicleId" />
|
||||
<el-table-column label="库位号" align="center" prop="locationId" />
|
||||
<el-table-column label="物料编号" align="center" prop="goodsId" />
|
||||
<el-table-column label="物料名称" align="center" prop="goodsName" />
|
||||
<el-table-column label="物料描述" align="center" prop="goodsDesc" />
|
||||
<el-table-column label="单位" align="center" prop="goodsUnit" />
|
||||
<el-table-column label="供应商id" align="center" prop="providerId" />
|
||||
<el-table-column label="供应商名称" align="center" prop="providerName" />
|
||||
<el-table-column label="剩余数量" align="center" prop="remainNum" />
|
||||
<el-table-column label="入库数量" align="center" prop="originNum" />
|
||||
<!-- <el-table-column prop="packingNum" label="出库数量" width="200">
|
||||
<template slot-scope="scope">
|
||||
<el-input-number
|
||||
class="item"
|
||||
v-model="scope.row.packingNum"
|
||||
:min="0"
|
||||
:max="scope.row.remainNum"
|
||||
:disabled="scope.row.stockStatus == 1"
|
||||
></el-input-number>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="库存数量" align="center" prop="remainNum" />
|
||||
<!-- <el-table-column label="入库数量" align="center" prop="originNum" /> -->
|
||||
<el-table-column label="批次号" align="center" prop="batchNo" />
|
||||
<el-table-column label="库龄" align="center" prop="invAge" />
|
||||
<el-table-column label="物料状态" align="center" prop="goodsStatus" />
|
||||
<el-table-column label="库存状态" align="center" prop="stockStatus" />
|
||||
<el-table-column label="入库用户" align="center" prop="createUser" />
|
||||
<el-table-column label="最近更新时间" align="center" prop="lastUpdateTime" width="180">
|
||||
<el-table-column label="供应商id" align="center" prop="providerId" />
|
||||
<el-table-column label="供应商名称" align="center" prop="providerName" />
|
||||
<!-- <el-table-column label="物料状态" align="center" prop="goodsStatus" /> -->
|
||||
<el-table-column label="入库类型" align="center" prop="storageMode" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.in_order_type" :value="scope.row.storageMode"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存状态" align="center" prop="stockStatus" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.stock_status" :value="scope.row.stockStatus"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作人" align="center" prop="createUser" />
|
||||
<!-- <el-table-column label="最近更新时间" align="center" prop="lastUpdateTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.lastUpdateTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最近更新用户" align="center" prop="lastUpdateUser" />
|
||||
<el-table-column label="最近更新用户" align="center" prop="lastUpdateUser" /> -->
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<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">
|
||||
<el-button
|
||||
size="mini"
|
||||
|
|
@ -217,7 +164,7 @@
|
|||
v-hasPermi="['app:stock:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
|
@ -260,6 +207,9 @@
|
|||
<el-form-item label="物料名称" prop="goodsName">
|
||||
<el-input v-model="form.goodsName" placeholder="请输入物料名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料描述" prop="goodsDesc">
|
||||
<el-input v-model="form.goodsDesc" placeholder="请输入物料描述" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单位" prop="goodsUnit">
|
||||
<el-input v-model="form.goodsUnit" placeholder="请输入单位" />
|
||||
</el-form-item>
|
||||
|
|
@ -312,6 +262,7 @@ import { listStock, getStock, delStock, addStock, updateStock } from "@/api/syst
|
|||
import {taskOutRequest} from "@/api/system/task";
|
||||
|
||||
export default {
|
||||
dicts: ["in_order_type", "stock_status"],
|
||||
name: "Stock",
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -400,6 +351,23 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
checkSelectable(row) {
|
||||
if (this.stockList.length > 0) {
|
||||
//判断容器表里是否有数据
|
||||
//有数据的话,取容器表里的id和勾选过来的id判断是否有相等
|
||||
if (
|
||||
this.stockList.some(
|
||||
(item) => item.stockId === row.stockId && item.stockStatus == 1
|
||||
)
|
||||
) {
|
||||
return false; //有相等的返回false ,返回false当前行的checkbox就可以置灰
|
||||
} else {
|
||||
return true; //没有相等的返回true,当前行checkbox不置灰
|
||||
}
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
/** 查询【请填写功能名称】列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
|
@ -436,7 +404,8 @@ export default {
|
|||
createUser: null,
|
||||
lastUpdateTime: null,
|
||||
lastUpdateUser: null,
|
||||
remark: null
|
||||
remark: null,
|
||||
goodsDesc: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
@ -449,10 +418,22 @@ export default {
|
|||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
//指定行颜色
|
||||
tableRowClassName: function ({ row, rowIndex }) {
|
||||
// console.log(row, "row");
|
||||
if (row.stockStatus == 1) {
|
||||
return "warm-row";
|
||||
}
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.stockId)
|
||||
// selection.forEach((element) => {
|
||||
// if (element.packingNum == undefined || element.packingNum == 0) {
|
||||
// element.packingNum = element.remainNum;
|
||||
// }
|
||||
// });
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
|
@ -523,15 +504,41 @@ export default {
|
|||
}, `stock_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
handleCK(row) {
|
||||
this.reset();
|
||||
const stockId = row.stockId || this.ids
|
||||
getStock(stockId).then(response => {
|
||||
this.form = response.data;
|
||||
this.ck = true;
|
||||
this.title = "物料出库";
|
||||
const stockIds = row.stockId || this.ids;
|
||||
if (stockIds == "" || stockIds == undefined || stockIds.length == 0) {
|
||||
this.$modal.msgError("请选择待出库的库存!");
|
||||
return;
|
||||
}
|
||||
var reqArr = [];
|
||||
var error = false;
|
||||
|
||||
for (var j = 0; j < stockIds.length; j++) {
|
||||
for (var i = 0; i < this.stockList.length; i++) {
|
||||
if (stockIds[j] == this.stockList[i].stockId) {
|
||||
reqArr.push(this.stockList[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$modal
|
||||
.confirm("如果出库数量等于库存,则为整出,不会自动产生回库任务!")
|
||||
.then(function () {
|
||||
return delStock(reqArr);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("出库任务创建成功");
|
||||
})
|
||||
.catch(() => {
|
||||
this.$modal.msgSuccess("出库任务创建异常");
|
||||
});
|
||||
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.warm-row {
|
||||
background-color: #f9f9f9 !important;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user