feat: 耗材报损
This commit is contained in:
parent
c093c618b2
commit
0d495c20ef
|
|
@ -8,7 +8,7 @@ const Api = {
|
|||
return request<any>({
|
||||
url: `${baseURL}/in`,
|
||||
method: "post",
|
||||
data
|
||||
data,
|
||||
});
|
||||
},
|
||||
//出库
|
||||
|
|
@ -16,7 +16,7 @@ const Api = {
|
|||
return request<any>({
|
||||
url: `${baseURL}/out`,
|
||||
method: "post",
|
||||
data
|
||||
data,
|
||||
});
|
||||
},
|
||||
// 库存盘点记录
|
||||
|
|
@ -24,7 +24,7 @@ const Api = {
|
|||
return request<any>({
|
||||
url: `${baseURL}/checkRecord`,
|
||||
method: "get",
|
||||
params
|
||||
params,
|
||||
});
|
||||
},
|
||||
//库存盘点
|
||||
|
|
@ -32,7 +32,7 @@ const Api = {
|
|||
return request<any>({
|
||||
url: `${baseURL}/check`,
|
||||
method: "post",
|
||||
data
|
||||
data,
|
||||
});
|
||||
},
|
||||
//耗材报损
|
||||
|
|
@ -41,7 +41,7 @@ const Api = {
|
|||
return request<any>({
|
||||
url: `${baseURL}/reportDamage`,
|
||||
method: "post",
|
||||
data
|
||||
data,
|
||||
});
|
||||
},
|
||||
//耗材库存变动记录
|
||||
|
|
@ -49,11 +49,17 @@ const Api = {
|
|||
return request<any>({
|
||||
url: `${baseURL}/flow`,
|
||||
method: "get",
|
||||
params
|
||||
params,
|
||||
});
|
||||
},
|
||||
//耗材库存变动记录
|
||||
reportinglosses(data: any) {
|
||||
return request<any>({
|
||||
url: `${baseURL}/reportDamage`,
|
||||
method: "POST",
|
||||
data,
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
export default Api;
|
||||
|
|
|
|||
|
|
@ -77,11 +77,11 @@ const contentConfig: IContentConfig = {
|
|||
name: "damage-out",
|
||||
auth: "",
|
||||
},
|
||||
// {
|
||||
// text: "报损",
|
||||
// name: "reportinglosses",
|
||||
// auth: "",
|
||||
// },
|
||||
{
|
||||
text: "报损",
|
||||
name: "reportinglosses",
|
||||
auth: "",
|
||||
},
|
||||
],
|
||||
defaultToolbar: ["refresh", "filter", "search"],
|
||||
cols: [
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
">
|
||||
<el-button type="primary" link @click="refAddHaocaiOpen(scope.row)" v-if="!isSyncStatus()">编辑</el-button>
|
||||
<el-button v-if="!isSyncStatus()" type="primary" link @click="refAddHaocaiOpen(scope.row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, 'consumables')">
|
||||
耗材盘点
|
||||
</el-button>
|
||||
|
|
@ -127,14 +129,13 @@ if (conName) {
|
|||
}
|
||||
|
||||
if (isSyncStatus()) {
|
||||
contentConfig.toolbar[0].hidden = true
|
||||
contentConfig.toolbar[1].hidden = false
|
||||
contentConfig.toolbar[0].hidden = true;
|
||||
contentConfig.toolbar[1].hidden = false;
|
||||
} else {
|
||||
contentConfig.toolbar[0].hidden = false
|
||||
contentConfig.toolbar[1].hidden = true
|
||||
contentConfig.toolbar[0].hidden = false;
|
||||
contentConfig.toolbar[1].hidden = true;
|
||||
}
|
||||
|
||||
|
||||
//统计数据
|
||||
const gongjiData = reactive({ totalRow: 0 });
|
||||
function getTongji(params: IObject | undefined) {
|
||||
|
|
@ -204,9 +205,9 @@ async function handleEditClick(row: IObject) {
|
|||
// 其他工具栏
|
||||
async function handleToolbarClick(name: string) {
|
||||
console.log(name);
|
||||
if (name === 'sync') {
|
||||
let res = await UserAPI.sync()
|
||||
ElMessage.success('操作成功,数据正在后台同步中...')
|
||||
if (name === "sync") {
|
||||
let res = await UserAPI.sync();
|
||||
ElMessage.success("操作成功,数据正在后台同步中...");
|
||||
return;
|
||||
}
|
||||
if (name === "category") {
|
||||
|
|
@ -225,6 +226,10 @@ async function handleToolbarClick(name: string) {
|
|||
router.push({ path: "/inventory/operation_in", query: { type: "out" } });
|
||||
return;
|
||||
}
|
||||
if (name == "reportinglosses") {
|
||||
router.push({ path: "/inventory/operation_in", query: { type: "reportinglosses" } });
|
||||
return;
|
||||
}
|
||||
if (name == "damage-out" || name == "manual-out" || name == "manual-in") {
|
||||
router.push({ path: "/inventory/libraryrecords", query: { inOutItem: name } });
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -5,60 +5,65 @@
|
|||
<el-row>
|
||||
<el-form-item label="类型">
|
||||
<el-radio-group :model-value="type" @change="tabChange">
|
||||
<el-radio value="in">入库</el-radio>
|
||||
<el-radio value="out">出库</el-radio>
|
||||
<el-radio v-if="type == 'reportinglosses'" value="reportinglosses">报损</el-radio>
|
||||
<div v-else>
|
||||
<el-radio value="in">入库</el-radio>
|
||||
<el-radio value="out">出库</el-radio>
|
||||
</div>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col v-if="type == 'in'" :span="8">
|
||||
<el-form-item label="供应商">
|
||||
<el-select v-model="queryForm.vendorId" placeholder="请选择供应商" clearable style="width: 220px"
|
||||
@change="changeTypeEnum">
|
||||
<el-option v-for="item in purveyorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
{{ queryForm.waitAmount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出入库时间" prop="inOutDate">
|
||||
<el-date-picker v-model="queryForm.inOutDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期" style="width: 220px" disabled="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input v-model="queryForm.amountPayable" placeholder="请输入应收金额" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实付金额">
|
||||
<el-input v-model="queryForm.actualPaymentAmount" placeholder="请输入实收金额" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款时间">
|
||||
<el-date-picker v-model="queryForm.paymentDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<div v-if="type != 'reportinglosses'">
|
||||
<el-row>
|
||||
<el-col v-if="type == 'in'" :span="8">
|
||||
<el-form-item label="供应商">
|
||||
<el-select v-model="queryForm.vendorId" placeholder="请选择供应商" clearable style="width: 220px"
|
||||
@change="changeTypeEnum">
|
||||
<el-option v-for="item in purveyorList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
{{ queryForm.waitAmount }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="出入库时间" prop="inOutDate">
|
||||
<el-date-picker v-model="queryForm.inOutDate" type="date" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
|
||||
placeholder="选择日期" style="width: 220px" disabled="false" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="应付金额">
|
||||
<el-input v-model="queryForm.amountPayable" placeholder="请输入应收金额" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="实付金额">
|
||||
<el-input v-model="queryForm.actualPaymentAmount" placeholder="请输入实收金额" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="付款时间">
|
||||
<el-date-picker v-model="queryForm.paymentDate" type="date" format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD" placeholder="选择日期" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="批号">
|
||||
<el-input v-model="queryForm.batchNo" placeholder="请输入批号" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryForm.remark" placeholder="请输入备注" style="width: 220px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</div>
|
||||
<el-form-item label="选择耗材">
|
||||
<div />
|
||||
<el-button type="primary" @click="showHaocai">选择耗材</el-button>
|
||||
|
|
@ -84,7 +89,7 @@
|
|||
{{ scope.row.consGroupName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="进价">
|
||||
<el-table-column>
|
||||
<template v-slot="scope">
|
||||
<el-input-number v-model="scope.row.price" :min="0" controls-position="right" />
|
||||
<div class="tips" style="font-size: 16px">
|
||||
|
|
@ -117,16 +122,27 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="小计">
|
||||
<!-- <el-table-column v-if="type == 'reportinglosses'" label="报损数量">
|
||||
<template v-slot="scope">
|
||||
<el-input :value="xiaoji(scope.row)" readonly style="width: 100px" />
|
||||
{{ scope.row.number }}
|
||||
<div class="tips" style="font-size: 16px">
|
||||
入库前:
|
||||
{{ returnStockNumber(scope.row, scope.row.number) }}
|
||||
|
||||
{{ scope.row.unit }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column v-if="type == 'reportinglosses'" label="上传图片">
|
||||
<template v-slot="scope">
|
||||
<MultiImageUpload v-model="scope.row.imgUrls" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注">
|
||||
<!-- <el-table-column label="备注">
|
||||
<template v-slot="scope">
|
||||
<el-input v-model="textarea" stype="textarea" placeholder="" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="scope">
|
||||
<el-button link @click="tableData.list.splice(scope.$index, 1)">删除</el-button>
|
||||
|
|
@ -164,6 +180,8 @@ import vendorApi from "@/api/product/vendor";
|
|||
import stockApi from "@/api/product/stock";
|
||||
import dayjs from "dayjs";
|
||||
import goodsList from "./components/goods-list.vue";
|
||||
import MultiImageUpload from "@/components/Upload/MultiImageUpload.vue";
|
||||
|
||||
import ConsumableList from "./components/consumableList.vue";
|
||||
import { formatDecimal } from "@/utils/tools.js";
|
||||
export default {
|
||||
|
|
@ -371,21 +389,26 @@ export default {
|
|||
unitName: v.conUnit,
|
||||
inOutNumber,
|
||||
subTotal: this.xiaoji(v),
|
||||
imgUrls: v.imgUrls,
|
||||
number: v.number,
|
||||
};
|
||||
});
|
||||
if (this.type == "in") {
|
||||
await stockApi.in({ ...this.queryForm, bodyList });
|
||||
} else {
|
||||
} else if (this.type == "out") {
|
||||
await stockApi.out({ ...this.queryForm, bodyList });
|
||||
} else if (this.type == "reportinglosses") {
|
||||
await stockApi.reportinglosses(bodyList);
|
||||
}
|
||||
this.queryFormLoading = false;
|
||||
const title = this.type == "in" ? "入库" : "出库";
|
||||
// const title = this.type == "in" ? "入库" : "出库";
|
||||
ElMessage({
|
||||
message: title + "提交成功",
|
||||
// message: title + "提交成功",
|
||||
message: "提交成功",
|
||||
type: "success",
|
||||
});
|
||||
this.$router.push("/inventory/consumables");
|
||||
// this.showResult = true
|
||||
this.showResult = true;
|
||||
// this.$refs.shopList.reset()//清除选项
|
||||
// this.$refs.ConsumableList.reset()//清除选项
|
||||
} catch (error) {
|
||||
|
|
@ -406,6 +429,7 @@ export default {
|
|||
item.unit = item.defaultUnit || item.conUnit;
|
||||
item.originPrice = item.price;
|
||||
item.price = this.returnPrice(item, item.price);
|
||||
item.imgUrls = item.imgUrls ? item.imgUrls : [];
|
||||
return item;
|
||||
});
|
||||
this.tableData.list = [...this.tableData.list, ...arr];
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<span v-if="scope.row.type == 2">耗材新增</span>
|
||||
<span v-if="scope.row.type == 3">耗材编辑</span> -->
|
||||
<div v-for="(item, index) in matchedProducts(scope.row.content)" :key="index">
|
||||
<span v-for="i in item.map" :key="i.id" style="color: #6161f7" @click="handleContentClick(scope, i)">
|
||||
<span v-for="i in item.map" :key="i.id" style="color: #6161f7" @click="handleContentClick(item, i)">
|
||||
{{ i.name }},
|
||||
</span>
|
||||
</div>
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
">
|
||||
<div v-if="scope.row.isRead == 1">
|
||||
<div v-if="scope.row.isRead != 1">
|
||||
<el-button link type="primary" @click="refAddHaocaiTakinShow(scope.row, '')">
|
||||
设为已读
|
||||
</el-button>
|
||||
|
|
@ -98,14 +98,14 @@ async function handleEditClick(row: IObject) {
|
|||
editModalRef.value?.setFormData({ ...row });
|
||||
}
|
||||
// 其他工具栏
|
||||
function handleToolbarClick(name: string) {
|
||||
async function handleToolbarClick(name: string) {
|
||||
if (name === "mark_all_read") {
|
||||
Api.edit({
|
||||
await Api.edit({
|
||||
noticeIdList: [],
|
||||
});
|
||||
}
|
||||
if (name == "Clear_Read") {
|
||||
Api.syncNoticeclear();
|
||||
await Api.syncNoticeclear();
|
||||
}
|
||||
contentRef.value?.fetchPageData();
|
||||
}
|
||||
|
|
@ -132,13 +132,13 @@ async function handleOperatClick(data: IOperatData) {
|
|||
}
|
||||
// Handle content click
|
||||
function handleContentClick(scope: any, item: any) {
|
||||
if (scope.type == "spec" || scope.type == "product") {
|
||||
if (scope.type == "product") {
|
||||
router.push({
|
||||
path: "/product/addgoods",
|
||||
query: { goods_id: item.id },
|
||||
});
|
||||
}
|
||||
if (scope.type == "consInfo" || scope.type == "consGroup") {
|
||||
if (scope.type == "consInfo") {
|
||||
router.push({
|
||||
path: "/inventory/consumables",
|
||||
query: { conName: item.name },
|
||||
|
|
|
|||
Loading…
Reference in New Issue