出库任务

This commit is contained in:
chc0125 2025-02-28 11:22:39 +08:00
parent f9178d85f7
commit ea41b35a28
2 changed files with 71 additions and 1 deletions

View File

@ -42,3 +42,11 @@ export function delTask(taskId) {
method: 'delete' method: 'delete'
}) })
} }
export function taskOutRequest(data) {
return request({
url: '/app/task/createOutRequest',
method: 'post',
data: data
})
}

View File

@ -162,6 +162,17 @@
v-hasPermi="['app:stock:export']" v-hasPermi="['app:stock:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-edit"
size="mini"
:disabled="multiple"
@click="handleCK"
v-hasPermi="['app:stock:export']"
>物料出库</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -216,6 +227,23 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<el-dialog :title="title" :visible.sync="ck" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="物料编号" prop="goodsId" >
<el-input v-model="form.goodsId" placeholder="请输入载具号" disabled/>
</el-form-item>
<el-form-item label="需求数量" prop="needNum">
<el-input v-model="form.needNum" placeholder="请输入需求数量" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForms"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 添加或修改请填写功能名称对话框 --> <!-- 添加或修改请填写功能名称对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@ -281,6 +309,7 @@
<script> <script>
import { listStock, getStock, delStock, addStock, updateStock } from "@/api/system/stock"; import { listStock, getStock, delStock, addStock, updateStock } from "@/api/system/stock";
import {taskOutRequest} from "@/api/system/task";
export default { export default {
name: "Stock", name: "Stock",
@ -304,6 +333,11 @@ export default {
title: "", title: "",
// //
open: false, open: false,
ck: false,
taskOut:{
goodsId: null,
needNum: null,
},
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -356,6 +390,9 @@ export default {
createTime: [ createTime: [
{ required: true, message: "入库时间不能为空", trigger: "blur" } { required: true, message: "入库时间不能为空", trigger: "blur" }
], ],
needNum: [
{ required: true, message: "需求数量不能为空", trigger: "blur" }
],
} }
}; };
}, },
@ -375,6 +412,7 @@ export default {
// //
cancel() { cancel() {
this.open = false; this.open = false;
this.ck = false;
this.reset(); this.reset();
}, },
// //
@ -454,6 +492,20 @@ export default {
} }
}); });
}, },
submitForms() {
this.$refs["form"].validate(valid => {
if (valid) {
taskOutRequest(this.form).then(response => {
this.$modal.msgSuccess("出库成功");
this.ck = false;
this.getList();
}).catch(() => {
this.ck = false;
this.getList();
});
}
});
},
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const stockIds = row.stockId || this.ids; const stockIds = row.stockId || this.ids;
@ -469,7 +521,17 @@ export default {
this.download('app/stock/export', { this.download('app/stock/export', {
...this.queryParams ...this.queryParams
}, `stock_${new Date().getTime()}.xlsx`) }, `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 = "物料出库";
});
},
} }
}; };
</script> </script>