修复耗材显示不全问题
This commit is contained in:
@@ -72,7 +72,7 @@ const AuthAPI = {
|
||||
});
|
||||
},
|
||||
|
||||
// 耗材列表
|
||||
// 耗材列表分页
|
||||
productcons(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `/product/admin/product/cons/page`,
|
||||
@@ -80,7 +80,14 @@ const AuthAPI = {
|
||||
params
|
||||
});
|
||||
},
|
||||
|
||||
// 耗材列表
|
||||
productconsList(params: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `/product/admin/product/cons/list`,
|
||||
method: "get",
|
||||
params
|
||||
});
|
||||
},
|
||||
// 上下架
|
||||
onOff(data: any) {
|
||||
return request<any, Responseres>({
|
||||
|
||||
@@ -2,14 +2,26 @@
|
||||
<div class="app-container">
|
||||
<!-- 列表 -->
|
||||
<!-- 搜索 -->
|
||||
<page-search ref="searchRef" :search-config="searchConfig" @query-click="newHandleQueryClick"
|
||||
@reset-click="handleResetClick2" />
|
||||
<page-search
|
||||
ref="searchRef"
|
||||
:search-config="searchConfig"
|
||||
@query-click="newHandleQueryClick"
|
||||
@reset-click="handleResetClick2"
|
||||
/>
|
||||
<!-- 顶部数据 -->
|
||||
<Statistics :data="gongjiData"></Statistics>
|
||||
<!-- 列表 -->
|
||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<!-- <template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
@@ -25,11 +37,20 @@
|
||||
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||
</template>
|
||||
<template #shangjia="scope">
|
||||
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||
@click="handleSwitchChange(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@click="handleSwitchChange(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
<template #isStock="scope">
|
||||
<el-switch disabled v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"></el-switch>
|
||||
<el-switch
|
||||
disabled
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</template>
|
||||
|
||||
<template #kucunedit="scope">
|
||||
@@ -42,16 +63,29 @@
|
||||
</template>
|
||||
|
||||
<template #tuikuantuihui="scope">
|
||||
<el-switch v-if="!scope.row.productId" v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||
@click="handleSwitchhaocai(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-if="!scope.row.productId"
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@click="handleSwitchhaocai(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
<template #sellOut="scope">
|
||||
<el-switch v-model="scope.row[scope.prop]" :active-value="1" :inactive-value="0"
|
||||
@click="handleSwitchChangeTwo(scope.row)"></el-switch>
|
||||
<el-switch
|
||||
v-model="scope.row[scope.prop]"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
@click="handleSwitchChangeTwo(scope.row)"
|
||||
></el-switch>
|
||||
</template>
|
||||
<template #mobile="scope">
|
||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||
<copy-button
|
||||
v-if="scope.row[scope.prop]"
|
||||
:text="scope.row[scope.prop]"
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
</template>
|
||||
<template #consumables="scope">
|
||||
<template v-if="scope.row.type != null">
|
||||
@@ -74,7 +108,11 @@
|
||||
</page-modal>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
>
|
||||
<template #gender="scope">
|
||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||
</template>
|
||||
@@ -121,16 +159,30 @@
|
||||
<el-table-column label="序号" type="index" width="60"></el-table-column>
|
||||
<el-table-column label="耗材名称" prop="consInfoId">
|
||||
<template v-slot="scope">
|
||||
<el-select v-model="scope.row.consInfoId" reserve-keyword placeholder="请输入关键词"
|
||||
@change="selectionChange($event, scope.row)">
|
||||
<el-option v-for="item in options" :key="item.id" :label="item.conName" :value="item.id"></el-option>
|
||||
<el-select
|
||||
v-model="scope.row.consInfoId"
|
||||
reserve-keyword
|
||||
placeholder="请输入关键词"
|
||||
@change="selectionChange($event, scope.row)"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options"
|
||||
:key="item.id"
|
||||
:label="item.conName"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
<!-- <div class="tips" v-if="scope.row.stockNumber">库存:{{ scope.row.stockNumber }}</div> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="单位" prop="conUnit">
|
||||
<template v-slot="scope">
|
||||
<el-input v-model="scope.row.conUnit" readonly disabled placeholder="请选择耗材"></el-input>
|
||||
<el-input
|
||||
v-model="scope.row.conUnit"
|
||||
readonly
|
||||
disabled
|
||||
placeholder="请选择耗材"
|
||||
></el-input>
|
||||
<!-- <el-select v-model="scope.row.conUnit" reserve-keyword placeholder="请输入关键词">
|
||||
<el-option
|
||||
v-for="item in returnConUnits(scope.row.consInfoId)"
|
||||
@@ -149,13 +201,20 @@
|
||||
<el-table-column label="操作" width="100">
|
||||
<template v-slot="scope">
|
||||
<div class="table_btn_wrap">
|
||||
<div class="btn sub" v-if="haocaiData.consList.length > 1"
|
||||
@click="haocaiData.consList.splice(scope.$index, 1)">
|
||||
<div
|
||||
class="btn sub"
|
||||
v-if="haocaiData.consList.length > 1"
|
||||
@click="haocaiData.consList.splice(scope.$index, 1)"
|
||||
>
|
||||
<el-icon>
|
||||
<RemoveFilled />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="btn add" v-if="scope.$index == haocaiData.consList.length - 1" @click="createItem(scope.row)">
|
||||
<div
|
||||
class="btn add"
|
||||
v-if="scope.$index == haocaiData.consList.length - 1"
|
||||
@click="createItem(scope.row)"
|
||||
>
|
||||
<el-icon>
|
||||
<CirclePlusFilled />
|
||||
</el-icon>
|
||||
@@ -255,8 +314,8 @@ onMounted(async () => {
|
||||
// 获取耗材列表
|
||||
gethaocaiList();
|
||||
|
||||
const res = await UserAPI.getPage()
|
||||
form.warnLine = res.warnLine || ''
|
||||
const res = await UserAPI.getPage();
|
||||
form.warnLine = res.warnLine || "";
|
||||
// console.log('contentRef.value===', res);
|
||||
});
|
||||
|
||||
@@ -310,7 +369,7 @@ function getTongji(params: IObject | undefined) {
|
||||
|
||||
// 显示批量导入
|
||||
function handleUploadClick() {
|
||||
importDataRef.value.show()
|
||||
importDataRef.value.show();
|
||||
}
|
||||
|
||||
// 导出商品
|
||||
@@ -398,7 +457,7 @@ async function handleToolbarClick(name: string) {
|
||||
ElMessage.success("操作成功,数据正在后台同步中...");
|
||||
}
|
||||
if (name === "upload") {
|
||||
importDataRef.value.show()
|
||||
importDataRef.value.show();
|
||||
}
|
||||
}
|
||||
async function confirm() {
|
||||
@@ -451,8 +510,8 @@ async function handleOperatClick(data: IOperatData) {
|
||||
}
|
||||
|
||||
async function gethaocaiList() {
|
||||
let res = await UserAPI.productcons({ id: route.query.id });
|
||||
options.value = res.records;
|
||||
let res = await UserAPI.productconsList({ id: route.query.id });
|
||||
options.value = res || [];
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user